invoke.texi (AVR Built-in Macros): Correct condition for when __AVR_3_BYTE_PC__ is...
[official-gcc.git] / gcc / doc / invoke.texi
blob42285a7e56518b3aceaecc05a1feba49443c148c
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{-pedantic}]
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} would be @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  -no-integrated-cpp  -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 -fconserve-space  -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-depth=@var{n} @gol
196 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
197 -fno-default-inline  -fvisibility-inlines-hidden @gol
198 -fvisibility-ms-compat @gol
199 -Wabi  -Wconversion-null  -Wctor-dtor-privacy @gol
200 -Wdelete-non-virtual-dtor -Wnarrowing -Wnoexcept @gol
201 -Wnon-virtual-dtor  -Wreorder @gol
202 -Weffc++  -Wstrict-null-sentinel @gol
203 -Wno-non-template-friend  -Wold-style-cast @gol
204 -Woverloaded-virtual  -Wno-pmf-conversions @gol
205 -Wsign-promo}
207 @item Objective-C and Objective-C++ Language Options
208 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
209 Objective-C and Objective-C++ Dialects}.
210 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
211 -fgnu-runtime  -fnext-runtime @gol
212 -fno-nil-receivers @gol
213 -fobjc-abi-version=@var{n} @gol
214 -fobjc-call-cxx-cdtors @gol
215 -fobjc-direct-dispatch @gol
216 -fobjc-exceptions @gol
217 -fobjc-gc @gol
218 -fobjc-nilcheck @gol
219 -fobjc-std=objc1 @gol
220 -freplace-objc-classes @gol
221 -fzero-link @gol
222 -gen-decls @gol
223 -Wassign-intercept @gol
224 -Wno-protocol  -Wselector @gol
225 -Wstrict-selector-match @gol
226 -Wundeclared-selector}
228 @item Language Independent Options
229 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
230 @gccoptlist{-fmessage-length=@var{n}  @gol
231 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
232 -fno-diagnostics-show-option}
234 @item Warning Options
235 @xref{Warning Options,,Options to Request or Suppress Warnings}.
236 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -pedantic @gol
237 -pedantic-errors @gol
238 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  -Warray-bounds @gol
239 -Wno-attributes -Wno-builtin-macro-redefined @gol
240 -Wc++-compat -Wc++11-compat -Wcast-align  -Wcast-qual  @gol
241 -Wchar-subscripts -Wclobbered  -Wcomment @gol
242 -Wconversion  -Wcoverage-mismatch  -Wno-cpp  -Wno-deprecated  @gol
243 -Wno-deprecated-declarations -Wdisabled-optimization  @gol
244 -Wno-div-by-zero -Wdouble-promotion -Wempty-body  -Wenum-compare @gol
245 -Wno-endif-labels -Werror  -Werror=* @gol
246 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
247 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
248 -Wformat-security  -Wformat-y2k @gol
249 -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol
250 -Wignored-qualifiers @gol
251 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
252 -Winit-self  -Winline -Wmaybe-uninitialized @gol
253 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
254 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
255 -Wlogical-op -Wlong-long @gol
256 -Wmain -Wmaybe-uninitialized -Wmissing-braces  -Wmissing-field-initializers @gol
257 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
258 -Wno-mudflap @gol
259 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
260 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
261 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
262 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
263 -Wredundant-decls @gol
264 -Wreturn-type  -Wsequence-point  -Wshadow @gol
265 -Wsign-compare  -Wsign-conversion  -Wstack-protector @gol
266 -Wstack-usage=@var{len} -Wstrict-aliasing -Wstrict-aliasing=n @gol
267 -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
268 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{]} @gol
269 -Wswitch  -Wswitch-default  -Wswitch-enum -Wsync-nand @gol
270 -Wsystem-headers  -Wtrampolines  -Wtrigraphs  -Wtype-limits  -Wundef @gol
271 -Wuninitialized  -Wunknown-pragmas  -Wno-pragmas @gol
272 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
273 -Wunused-label  -Wunused-local-typedefs -Wunused-parameter @gol
274 -Wno-unused-result -Wunused-value @gol -Wunused-variable @gol
275 -Wunused-but-set-parameter -Wunused-but-set-variable @gol
276 -Wvariadic-macros -Wvector-operation-performance -Wvla 
277 -Wvolatile-register-var  -Wwrite-strings -Wzero-as-null-pointer-constant}
279 @item C and Objective-C-only Warning Options
280 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
281 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
282 -Wold-style-declaration  -Wold-style-definition @gol
283 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
284 -Wdeclaration-after-statement -Wpointer-sign}
286 @item Debugging Options
287 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
288 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
289 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
290 -fdisable-ipa-@var{pass_name} @gol
291 -fdisable-rtl-@var{pass_name} @gol
292 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
293 -fdisable-tree-@var{pass_name} @gol
294 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
295 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
296 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
297 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
298 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
299 -fdump-passes @gol
300 -fdump-statistics @gol
301 -fdump-tree-all @gol
302 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
303 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
304 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
305 -fdump-tree-ch @gol
306 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
307 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
308 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
309 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
310 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
311 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
312 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
313 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
314 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
315 -fdump-tree-nrv -fdump-tree-vect @gol
316 -fdump-tree-sink @gol
317 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
318 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
319 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
320 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
321 -ftree-vectorizer-verbose=@var{n} @gol
322 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
323 -fdump-final-insns=@var{file} @gol
324 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
325 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
326 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
327 -fenable-@var{kind}-@var{pass} @gol
328 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
329 -fdebug-types-section @gol
330 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
331 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
332 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
333 -fstack-usage  -ftest-coverage  -ftime-report -fvar-tracking @gol
334 -fvar-tracking-assignments  -fvar-tracking-assignments-toggle @gol
335 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
336 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
337 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
338 -gvms  -gxcoff  -gxcoff+ @gol
339 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
340 -fdebug-prefix-map=@var{old}=@var{new} @gol
341 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
342 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
343 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
344 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
345 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
346 -print-sysroot -print-sysroot-headers-suffix @gol
347 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
349 @item Optimization Options
350 @xref{Optimize Options,,Options that Control Optimization}.
351 @gccoptlist{-falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol
352 -falign-labels[=@var{n}] -falign-loops[=@var{n}] -fassociative-math @gol
353 -fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol
354 -fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves @gol
355 -fcheck-data-deps -fcombine-stack-adjustments -fconserve-stack @gol
356 -fcompare-elim -fcprop-registers -fcrossjumping @gol
357 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
358 -fcx-limited-range @gol
359 -fdata-sections -fdce -fdelayed-branch @gol
360 -fdelete-null-pointer-checks -fdevirtualize -fdse @gol
361 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects @gol
362 -ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
363 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
364 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
365 -fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol
366 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
367 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg @gol
368 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference @gol
369 -fira-algorithm=@var{algorithm} @gol
370 -fira-region=@var{region} @gol
371 -fira-loop-pressure -fno-ira-share-save-slots @gol
372 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
373 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
374 -floop-block -floop-interchange -floop-strip-mine @gol
375 -floop-parallelize-all -flto -flto-compression-level @gol
376 -flto-partition=@var{alg} -flto-report -fmerge-all-constants @gol
377 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
378 -fmove-loop-invariants fmudflap -fmudflapir -fmudflapth -fno-branch-count-reg @gol
379 -fno-default-inline @gol
380 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
381 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
382 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
383 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
384 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
385 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
386 -fprefetch-loop-arrays @gol
387 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
388 -fprofile-generate=@var{path} @gol
389 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
390 -freciprocal-math -free -fregmove -frename-registers -freorder-blocks @gol
391 -freorder-blocks-and-partition -freorder-functions @gol
392 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
393 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
394 -fsched-spec-load -fsched-spec-load-dangerous @gol
395 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
396 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
397 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
398 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
399 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
400 -fselective-scheduling -fselective-scheduling2 @gol
401 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
402 -fshrink-wrap -fsignaling-nans -fsingle-precision-constant @gol
403 -fsplit-ivs-in-unroller -fsplit-wide-types -fstack-protector @gol
404 -fstack-protector-all -fstrict-aliasing -fstrict-overflow @gol
405 -fthread-jumps -ftracer -ftree-bit-ccp @gol
406 -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol
407 -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
408 -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
409 -ftree-loop-if-convert-stores -ftree-loop-im @gol
410 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
411 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
412 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-pta -ftree-reassoc @gol
413 -ftree-sink -ftree-sra -ftree-switch-conversion -ftree-tail-merge @gol
414 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
415 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
416 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
417 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
418 -fwhole-program -fwpa -fuse-linker-plugin @gol
419 --param @var{name}=@var{value}
420 -O  -O0  -O1  -O2  -O3  -Os -Ofast}
422 @item Preprocessor Options
423 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
424 @gccoptlist{-A@var{question}=@var{answer} @gol
425 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
426 -C  -dD  -dI  -dM  -dN @gol
427 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
428 -idirafter @var{dir} @gol
429 -include @var{file}  -imacros @var{file} @gol
430 -iprefix @var{file}  -iwithprefix @var{dir} @gol
431 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
432 -imultilib @var{dir} -isysroot @var{dir} @gol
433 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
434 -P  -fdebug-cpp -ftrack-macro-expansion -fworking-directory @gol
435 -remap -trigraphs  -undef  -U@var{macro}  @gol
436 -Wp,@var{option} -Xpreprocessor @var{option}}
438 @item Assembler Option
439 @xref{Assembler Options,,Passing Options to the Assembler}.
440 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
442 @item Linker Options
443 @xref{Link Options,,Options for Linking}.
444 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
445 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
446 -s  -static  -static-libgcc  -static-libstdc++ -shared  @gol
447 -shared-libgcc  -symbolic @gol
448 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
449 -u @var{symbol}}
451 @item Directory Options
452 @xref{Directory Options,,Options for Directory Search}.
453 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
454 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol
455 --sysroot=@var{dir}}
457 @item Machine Dependent Options
458 @xref{Submodel Options,,Hardware Models and Configurations}.
459 @c This list is ordered alphanumerically by subsection name.
460 @c Try and put the significant identifier (CPU or system) first,
461 @c so users have a clue at guessing where the ones they want will be.
463 @emph{Adapteva Epiphany Options}
464 @gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs @gol
465 -mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf @gol
466 -msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} @gol
467 -mround-nearest -mlong-calls -mshort-calls -msmall16 @gol
468 -mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} @gol
469 -msplit-vecmove-early -m1reg-@var{reg}}
471 @emph{ARM Options}
472 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
473 -mabi=@var{name} @gol
474 -mapcs-stack-check  -mno-apcs-stack-check @gol
475 -mapcs-float  -mno-apcs-float @gol
476 -mapcs-reentrant  -mno-apcs-reentrant @gol
477 -msched-prolog  -mno-sched-prolog @gol
478 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
479 -mfloat-abi=@var{name}  -mfpe @gol
480 -mfp16-format=@var{name}
481 -mthumb-interwork  -mno-thumb-interwork @gol
482 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
483 -mstructure-size-boundary=@var{n} @gol
484 -mabort-on-noreturn @gol
485 -mlong-calls  -mno-long-calls @gol
486 -msingle-pic-base  -mno-single-pic-base @gol
487 -mpic-register=@var{reg} @gol
488 -mnop-fun-dllimport @gol
489 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
490 -mpoke-function-name @gol
491 -mthumb  -marm @gol
492 -mtpcs-frame  -mtpcs-leaf-frame @gol
493 -mcaller-super-interworking  -mcallee-super-interworking @gol
494 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
495 -mword-relocations @gol
496 -mfix-cortex-m3-ldrd}
498 @emph{AVR Options}
499 @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
500 -mcall-prologues -mint8 -mno-interrupts -mrelax -mshort-calls @gol
501 -mstrict-X -mtiny-stack}
503 @emph{Blackfin Options}
504 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
505 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
506 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
507 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
508 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
509 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
510 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
511 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
512 -micplb}
514 @emph{C6X Options}
515 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
516 -msim -msdata=@var{sdata-type}}
518 @emph{CRIS Options}
519 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
520 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
521 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
522 -mstack-align  -mdata-align  -mconst-align @gol
523 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
524 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
525 -mmul-bug-workaround  -mno-mul-bug-workaround}
527 @emph{CR16 Options}
528 @gccoptlist{-mmac @gol
529 -mcr16cplus -mcr16c @gol
530 -msim -mint32 -mbit-ops
531 -mdata-model=@var{model}}
533 @emph{Darwin Options}
534 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
535 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
536 -client_name  -compatibility_version  -current_version @gol
537 -dead_strip @gol
538 -dependency-file  -dylib_file  -dylinker_install_name @gol
539 -dynamic  -dynamiclib  -exported_symbols_list @gol
540 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
541 -force_flat_namespace  -headerpad_max_install_names @gol
542 -iframework @gol
543 -image_base  -init  -install_name  -keep_private_externs @gol
544 -multi_module  -multiply_defined  -multiply_defined_unused @gol
545 -noall_load   -no_dead_strip_inits_and_terms @gol
546 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
547 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
548 -private_bundle  -read_only_relocs  -sectalign @gol
549 -sectobjectsymbols  -whyload  -seg1addr @gol
550 -sectcreate  -sectobjectsymbols  -sectorder @gol
551 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
552 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
553 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
554 -single_module  -static  -sub_library  -sub_umbrella @gol
555 -twolevel_namespace  -umbrella  -undefined @gol
556 -unexported_symbols_list  -weak_reference_mismatches @gol
557 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
558 -mkernel -mone-byte-bool}
560 @emph{DEC Alpha Options}
561 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
562 -mieee  -mieee-with-inexact  -mieee-conformant @gol
563 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
564 -mtrap-precision=@var{mode}  -mbuild-constants @gol
565 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
566 -mbwx  -mmax  -mfix  -mcix @gol
567 -mfloat-vax  -mfloat-ieee @gol
568 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
569 -msmall-text  -mlarge-text @gol
570 -mmemory-latency=@var{time}}
572 @emph{DEC Alpha/VMS Options}
573 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64}
575 @emph{FR30 Options}
576 @gccoptlist{-msmall-model -mno-lsim}
578 @emph{FRV Options}
579 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
580 -mhard-float  -msoft-float @gol
581 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
582 -mdouble  -mno-double @gol
583 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
584 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
585 -mlinked-fp  -mlong-calls  -malign-labels @gol
586 -mlibrary-pic  -macc-4  -macc-8 @gol
587 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
588 -moptimize-membar -mno-optimize-membar @gol
589 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
590 -mvliw-branch  -mno-vliw-branch @gol
591 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
592 -mno-nested-cond-exec  -mtomcat-stats @gol
593 -mTLS -mtls @gol
594 -mcpu=@var{cpu}}
596 @emph{GNU/Linux Options}
597 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
598 -tno-android-cc -tno-android-ld}
600 @emph{H8/300 Options}
601 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
603 @emph{HPPA Options}
604 @gccoptlist{-march=@var{architecture-type} @gol
605 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
606 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
607 -mfixed-range=@var{register-range} @gol
608 -mjump-in-delay -mlinker-opt -mlong-calls @gol
609 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
610 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
611 -mno-jump-in-delay  -mno-long-load-store @gol
612 -mno-portable-runtime  -mno-soft-float @gol
613 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
614 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
615 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
616 -munix=@var{unix-std}  -nolibdld  -static  -threads}
618 @emph{i386 and x86-64 Options}
619 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
620 -mfpmath=@var{unit} @gol
621 -masm=@var{dialect}  -mno-fancy-math-387 @gol
622 -mno-fp-ret-in-387  -msoft-float @gol
623 -mno-wide-multiply  -mrtd  -malign-double @gol
624 -mpreferred-stack-boundary=@var{num} @gol
625 -mincoming-stack-boundary=@var{num} @gol
626 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
627 -mrecip -mrecip=@var{opt} @gol
628 -mvzeroupper @gol
629 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
630 -mavx2 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma @gol
631 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
632 -mbmi2 -mlwp -mthreads  -mno-align-stringops  -minline-all-stringops @gol
633 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
634 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
635 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
636 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
637 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
638 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
639 -mcmodel=@var{code-model} -mabi=@var{name} @gol
640 -m32 -m64 -mx32 -mlarge-data-threshold=@var{num} @gol
641 -msse2avx -mfentry -m8bit-idiv @gol
642 -mavx256-split-unaligned-load -mavx256-split-unaligned-store}
644 @emph{i386 and x86-64 Windows Options}
645 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
646 -mnop-fun-dllimport -mthread @gol
647 -municode -mwin32 -mwindows -fno-set-stack-executable}
649 @emph{IA-64 Options}
650 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
651 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
652 -mconstant-gp  -mauto-pic  -mfused-madd @gol
653 -minline-float-divide-min-latency @gol
654 -minline-float-divide-max-throughput @gol
655 -mno-inline-float-divide @gol
656 -minline-int-divide-min-latency @gol
657 -minline-int-divide-max-throughput  @gol
658 -mno-inline-int-divide @gol
659 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
660 -mno-inline-sqrt @gol
661 -mdwarf2-asm -mearly-stop-bits @gol
662 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
663 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
664 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
665 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
666 -msched-spec-ldc -msched-spec-control-ldc @gol
667 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
668 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
669 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
670 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
672 @emph{IA-64/VMS Options}
673 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64}
675 @emph{LM32 Options}
676 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
677 -msign-extend-enabled -muser-enabled}
679 @emph{M32R/D Options}
680 @gccoptlist{-m32r2 -m32rx -m32r @gol
681 -mdebug @gol
682 -malign-loops -mno-align-loops @gol
683 -missue-rate=@var{number} @gol
684 -mbranch-cost=@var{number} @gol
685 -mmodel=@var{code-size-model-type} @gol
686 -msdata=@var{sdata-type} @gol
687 -mno-flush-func -mflush-func=@var{name} @gol
688 -mno-flush-trap -mflush-trap=@var{number} @gol
689 -G @var{num}}
691 @emph{M32C Options}
692 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
694 @emph{M680x0 Options}
695 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
696 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
697 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
698 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
699 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
700 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
701 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
702 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
703 -mxgot -mno-xgot}
705 @emph{MCore Options}
706 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
707 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
708 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
709 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
710 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
712 @emph{MeP Options}
713 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
714 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
715 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
716 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
717 -mtiny=@var{n}}
719 @emph{MicroBlaze Options}
720 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
721 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
722 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
723 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
724 -mxl-mode-@var{app-model}}
726 @emph{MIPS Options}
727 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
728 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
729 -mips64  -mips64r2 @gol
730 -mips16  -mno-mips16  -mflip-mips16 @gol
731 -minterlink-mips16  -mno-interlink-mips16 @gol
732 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
733 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
734 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
735 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
736 -mfpu=@var{fpu-type} @gol
737 -msmartmips  -mno-smartmips @gol
738 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
739 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
740 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
741 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
742 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
743 -membedded-data  -mno-embedded-data @gol
744 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
745 -mcode-readable=@var{setting} @gol
746 -msplit-addresses  -mno-split-addresses @gol
747 -mexplicit-relocs  -mno-explicit-relocs @gol
748 -mcheck-zero-division  -mno-check-zero-division @gol
749 -mdivide-traps  -mdivide-breaks @gol
750 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
751 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
752 -mfix-24k -mno-fix-24k @gol
753 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
754 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
755 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
756 -mflush-func=@var{func}  -mno-flush-func @gol
757 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
758 -mfp-exceptions -mno-fp-exceptions @gol
759 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
760 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
762 @emph{MMIX Options}
763 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
764 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
765 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
766 -mno-base-addresses  -msingle-exit  -mno-single-exit}
768 @emph{MN10300 Options}
769 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
770 -mno-am33 -mam33 -mam33-2 -mam34 @gol
771 -mtune=@var{cpu-type} @gol
772 -mreturn-pointer-on-d0 @gol
773 -mno-crt0  -mrelax -mliw -msetlb}
775 @emph{PDP-11 Options}
776 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
777 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
778 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
779 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
780 -mbranch-expensive  -mbranch-cheap @gol
781 -munix-asm  -mdec-asm}
783 @emph{picoChip Options}
784 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
785 -msymbol-as-address -mno-inefficient-warnings}
787 @emph{PowerPC Options}
788 See RS/6000 and PowerPC Options.
790 @emph{RL78 Options}
791 @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=rl78}
793 @emph{RS/6000 and PowerPC Options}
794 @gccoptlist{-mcpu=@var{cpu-type} @gol
795 -mtune=@var{cpu-type} @gol
796 -mcmodel=@var{code-model} @gol
797 -mpower  -mno-power  -mpower2  -mno-power2 @gol
798 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
799 -maltivec  -mno-altivec @gol
800 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
801 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
802 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
803 -mfprnd  -mno-fprnd @gol
804 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
805 -mnew-mnemonics  -mold-mnemonics @gol
806 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
807 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
808 -malign-power  -malign-natural @gol
809 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
810 -msingle-float -mdouble-float -msimple-fpu @gol
811 -mstring  -mno-string  -mupdate  -mno-update @gol
812 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
813 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
814 -mstrict-align  -mno-strict-align  -mrelocatable @gol
815 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
816 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
817 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
818 -mprioritize-restricted-insns=@var{priority} @gol
819 -msched-costly-dep=@var{dependence_type} @gol
820 -minsert-sched-nops=@var{scheme} @gol
821 -mcall-sysv  -mcall-netbsd @gol
822 -maix-struct-return  -msvr4-struct-return @gol
823 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
824 -mblock-move-inline-limit=@var{num} @gol
825 -misel -mno-isel @gol
826 -misel=yes  -misel=no @gol
827 -mspe -mno-spe @gol
828 -mspe=yes  -mspe=no @gol
829 -mpaired @gol
830 -mgen-cell-microcode -mwarn-cell-microcode @gol
831 -mvrsave -mno-vrsave @gol
832 -mmulhw -mno-mulhw @gol
833 -mdlmzb -mno-dlmzb @gol
834 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
835 -mprototype  -mno-prototype @gol
836 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
837 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
838 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
839 -mno-recip-precision @gol
840 -mveclibabi=@var{type} -mfriz -mno-friz @gol
841 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
842 -msave-toc-indirect -mno-save-toc-indirect}
844 @emph{RX Options}
845 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
846 -mcpu=@gol
847 -mbig-endian-data -mlittle-endian-data @gol
848 -msmall-data @gol
849 -msim  -mno-sim@gol
850 -mas100-syntax -mno-as100-syntax@gol
851 -mrelax@gol
852 -mmax-constant-size=@gol
853 -mint-register=@gol
854 -mpid@gol
855 -msave-acc-in-interrupts}
857 @emph{S/390 and zSeries Options}
858 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
859 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
860 -mlong-double-64 -mlong-double-128 @gol
861 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
862 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
863 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
864 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
865 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
867 @emph{Score Options}
868 @gccoptlist{-meb -mel @gol
869 -mnhwloop @gol
870 -muls @gol
871 -mmac @gol
872 -mscore5 -mscore5u -mscore7 -mscore7d}
874 @emph{SH Options}
875 @gccoptlist{-m1  -m2  -m2e @gol
876 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
877 -m3  -m3e @gol
878 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
879 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
880 -m5-64media  -m5-64media-nofpu @gol
881 -m5-32media  -m5-32media-nofpu @gol
882 -m5-compact  -m5-compact-nofpu @gol
883 -mb  -ml  -mdalign  -mrelax @gol
884 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
885 -mieee  -mbitops  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
886 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
887 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
888 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
889 -maccumulate-outgoing-args -minvalid-symbols -msoft-atomic @gol
890 -mbranch-cost=@var{num} -mcbranchdi -mcmpeqdi -mfused-madd -mpretend-cmove @gol
891 -menable-tas}
893 @emph{Solaris 2 Options}
894 @gccoptlist{-mimpure-text  -mno-impure-text @gol
895 -pthreads -pthread}
897 @emph{SPARC Options}
898 @gccoptlist{-mcpu=@var{cpu-type} @gol
899 -mtune=@var{cpu-type} @gol
900 -mcmodel=@var{code-model} @gol
901 -mmemory-model=@var{mem-model} @gol
902 -m32  -m64  -mapp-regs  -mno-app-regs @gol
903 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
904 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
905 -mhard-quad-float  -msoft-quad-float @gol
906 -mlittle-endian @gol
907 -mstack-bias  -mno-stack-bias @gol
908 -munaligned-doubles  -mno-unaligned-doubles @gol
909 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
910 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
911 -mfmaf  -mno-fmaf  -mpopc  -mno-popc @gol
912 -mfix-at697f}
914 @emph{SPU Options}
915 @gccoptlist{-mwarn-reloc -merror-reloc @gol
916 -msafe-dma -munsafe-dma @gol
917 -mbranch-hints @gol
918 -msmall-mem -mlarge-mem -mstdmain @gol
919 -mfixed-range=@var{register-range} @gol
920 -mea32 -mea64 @gol
921 -maddress-space-conversion -mno-address-space-conversion @gol
922 -mcache-size=@var{cache-size} @gol
923 -matomic-updates -mno-atomic-updates}
925 @emph{System V Options}
926 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
928 @emph{TILE-Gx Options}
929 @gccoptlist{-mcpu=CPU -m32 -m64}
931 @emph{TILEPro Options}
932 @gccoptlist{-mcpu=CPU -m32}
934 @emph{V850 Options}
935 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
936 -mprolog-function  -mno-prolog-function  -mspace @gol
937 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
938 -mapp-regs  -mno-app-regs @gol
939 -mdisable-callt  -mno-disable-callt @gol
940 -mv850e2v3 @gol
941 -mv850e2 @gol
942 -mv850e1 -mv850es @gol
943 -mv850e @gol
944 -mv850  -mbig-switch}
946 @emph{VAX Options}
947 @gccoptlist{-mg  -mgnu  -munix}
949 @emph{VxWorks Options}
950 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
951 -Xbind-lazy  -Xbind-now}
953 @emph{x86-64 Options}
954 See i386 and x86-64 Options.
956 @emph{Xstormy16 Options}
957 @gccoptlist{-msim}
959 @emph{Xtensa Options}
960 @gccoptlist{-mconst16 -mno-const16 @gol
961 -mfused-madd  -mno-fused-madd @gol
962 -mforce-no-pic @gol
963 -mserialize-volatile  -mno-serialize-volatile @gol
964 -mtext-section-literals  -mno-text-section-literals @gol
965 -mtarget-align  -mno-target-align @gol
966 -mlongcalls  -mno-longcalls}
968 @emph{zSeries Options}
969 See S/390 and zSeries Options.
971 @item Code Generation Options
972 @xref{Code Gen Options,,Options for Code Generation Conventions}.
973 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
974 -ffixed-@var{reg}  -fexceptions @gol
975 -fnon-call-exceptions  -funwind-tables @gol
976 -fasynchronous-unwind-tables @gol
977 -finhibit-size-directive  -finstrument-functions @gol
978 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
979 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
980 -fno-common  -fno-ident @gol
981 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
982 -fno-jump-tables @gol
983 -frecord-gcc-switches @gol
984 -freg-struct-return  -fshort-enums @gol
985 -fshort-double  -fshort-wchar @gol
986 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
987 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
988 -fno-stack-limit -fsplit-stack @gol
989 -fleading-underscore  -ftls-model=@var{model} @gol
990 -ftrapv  -fwrapv  -fbounds-check @gol
991 -fvisibility -fstrict-volatile-bitfields}
992 @end table
994 @menu
995 * Overall Options::     Controlling the kind of output:
996                         an executable, object files, assembler files,
997                         or preprocessed source.
998 * C Dialect Options::   Controlling the variant of C language compiled.
999 * C++ Dialect Options:: Variations on C++.
1000 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
1001                         and Objective-C++.
1002 * Language Independent Options:: Controlling how diagnostics should be
1003                         formatted.
1004 * Warning Options::     How picky should the compiler be?
1005 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
1006 * Optimize Options::    How much optimization?
1007 * Preprocessor Options:: Controlling header files and macro definitions.
1008                          Also, getting dependency information for Make.
1009 * Assembler Options::   Passing options to the assembler.
1010 * Link Options::        Specifying libraries and so on.
1011 * Directory Options::   Where to find header files and libraries.
1012                         Where to find the compiler executable files.
1013 * Spec Files::          How to pass switches to sub-processes.
1014 * Target Options::      Running a cross-compiler, or an old version of GCC.
1015 @end menu
1017 @node Overall Options
1018 @section Options Controlling the Kind of Output
1020 Compilation can involve up to four stages: preprocessing, compilation
1021 proper, assembly and linking, always in that order.  GCC is capable of
1022 preprocessing and compiling several files either into several
1023 assembler input files, or into one assembler input file; then each
1024 assembler input file produces an object file, and linking combines all
1025 the object files (those newly compiled, and those specified as input)
1026 into an executable file.
1028 @cindex file name suffix
1029 For any given input file, the file name suffix determines what kind of
1030 compilation is done:
1032 @table @gcctabopt
1033 @item @var{file}.c
1034 C source code that must be preprocessed.
1036 @item @var{file}.i
1037 C source code that should not be preprocessed.
1039 @item @var{file}.ii
1040 C++ source code that should not be preprocessed.
1042 @item @var{file}.m
1043 Objective-C source code.  Note that you must link with the @file{libobjc}
1044 library to make an Objective-C program work.
1046 @item @var{file}.mi
1047 Objective-C source code that should not be preprocessed.
1049 @item @var{file}.mm
1050 @itemx @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.  Note that @samp{.M} refers
1053 to a literal capital M@.
1055 @item @var{file}.mii
1056 Objective-C++ source code that should not be preprocessed.
1058 @item @var{file}.h
1059 C, C++, Objective-C or Objective-C++ header file to be turned into a
1060 precompiled header (default), or C, C++ header file to be turned into an
1061 Ada spec (via the @option{-fdump-ada-spec} switch).
1063 @item @var{file}.cc
1064 @itemx @var{file}.cp
1065 @itemx @var{file}.cxx
1066 @itemx @var{file}.cpp
1067 @itemx @var{file}.CPP
1068 @itemx @var{file}.c++
1069 @itemx @var{file}.C
1070 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1071 the last two letters must both be literally @samp{x}.  Likewise,
1072 @samp{.C} refers to a literal capital C@.
1074 @item @var{file}.mm
1075 @itemx @var{file}.M
1076 Objective-C++ source code that must be preprocessed.
1078 @item @var{file}.mii
1079 Objective-C++ source code that should not be preprocessed.
1081 @item @var{file}.hh
1082 @itemx @var{file}.H
1083 @itemx @var{file}.hp
1084 @itemx @var{file}.hxx
1085 @itemx @var{file}.hpp
1086 @itemx @var{file}.HPP
1087 @itemx @var{file}.h++
1088 @itemx @var{file}.tcc
1089 C++ header file to be turned into a precompiled header or Ada spec.
1091 @item @var{file}.f
1092 @itemx @var{file}.for
1093 @itemx @var{file}.ftn
1094 Fixed form Fortran source code that should not be preprocessed.
1096 @item @var{file}.F
1097 @itemx @var{file}.FOR
1098 @itemx @var{file}.fpp
1099 @itemx @var{file}.FPP
1100 @itemx @var{file}.FTN
1101 Fixed form Fortran source code that must be preprocessed (with the traditional
1102 preprocessor).
1104 @item @var{file}.f90
1105 @itemx @var{file}.f95
1106 @itemx @var{file}.f03
1107 @itemx @var{file}.f08
1108 Free form Fortran source code that should not be preprocessed.
1110 @item @var{file}.F90
1111 @itemx @var{file}.F95
1112 @itemx @var{file}.F03
1113 @itemx @var{file}.F08
1114 Free form Fortran source code that must be preprocessed (with the
1115 traditional preprocessor).
1117 @item @var{file}.go
1118 Go source code.
1120 @c FIXME: Descriptions of Java file types.
1121 @c @var{file}.java
1122 @c @var{file}.class
1123 @c @var{file}.zip
1124 @c @var{file}.jar
1126 @item @var{file}.ads
1127 Ada source code file that contains a library unit declaration (a
1128 declaration of a package, subprogram, or generic, or a generic
1129 instantiation), or a library unit renaming declaration (a package,
1130 generic, or subprogram renaming declaration).  Such files are also
1131 called @dfn{specs}.
1133 @item @var{file}.adb
1134 Ada source code file containing a library unit body (a subprogram or
1135 package body).  Such files are also called @dfn{bodies}.
1137 @c GCC also knows about some suffixes for languages not yet included:
1138 @c Pascal:
1139 @c @var{file}.p
1140 @c @var{file}.pas
1141 @c Ratfor:
1142 @c @var{file}.r
1144 @item @var{file}.s
1145 Assembler code.
1147 @item @var{file}.S
1148 @itemx @var{file}.sx
1149 Assembler code that must be preprocessed.
1151 @item @var{other}
1152 An object file to be fed straight into linking.
1153 Any file name with no recognized suffix is treated this way.
1154 @end table
1156 @opindex x
1157 You can specify the input language explicitly with the @option{-x} option:
1159 @table @gcctabopt
1160 @item -x @var{language}
1161 Specify explicitly the @var{language} for the following input files
1162 (rather than letting the compiler choose a default based on the file
1163 name suffix).  This option applies to all following input files until
1164 the next @option{-x} option.  Possible values for @var{language} are:
1165 @smallexample
1166 c  c-header  cpp-output
1167 c++  c++-header  c++-cpp-output
1168 objective-c  objective-c-header  objective-c-cpp-output
1169 objective-c++ objective-c++-header objective-c++-cpp-output
1170 assembler  assembler-with-cpp
1172 f77  f77-cpp-input f95  f95-cpp-input
1174 java
1175 @end smallexample
1177 @item -x none
1178 Turn off any specification of a language, so that subsequent files are
1179 handled according to their file name suffixes (as they are if @option{-x}
1180 has not been used at all).
1182 @item -pass-exit-codes
1183 @opindex pass-exit-codes
1184 Normally the @command{gcc} program will exit with the code of 1 if any
1185 phase of the compiler returns a non-success return code.  If you specify
1186 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
1187 numerically highest error produced by any phase that returned an error
1188 indication.  The C, C++, and Fortran frontends return 4, if an internal
1189 compiler error is encountered.
1190 @end table
1192 If you only want some of the stages of compilation, you can use
1193 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1194 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1195 @command{gcc} is to stop.  Note that some combinations (for example,
1196 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1198 @table @gcctabopt
1199 @item -c
1200 @opindex c
1201 Compile or assemble the source files, but do not link.  The linking
1202 stage simply is not done.  The ultimate output is in the form of an
1203 object file for each source file.
1205 By default, the object file name for a source file is made by replacing
1206 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1208 Unrecognized input files, not requiring compilation or assembly, are
1209 ignored.
1211 @item -S
1212 @opindex S
1213 Stop after the stage of compilation proper; do not assemble.  The output
1214 is in the form of an assembler code file for each non-assembler input
1215 file specified.
1217 By default, the assembler file name for a source file is made by
1218 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1220 Input files that don't require compilation are ignored.
1222 @item -E
1223 @opindex E
1224 Stop after the preprocessing stage; do not run the compiler proper.  The
1225 output is in the form of preprocessed source code, which is sent to the
1226 standard output.
1228 Input files that don't require preprocessing are ignored.
1230 @cindex output file option
1231 @item -o @var{file}
1232 @opindex o
1233 Place output in file @var{file}.  This applies regardless to whatever
1234 sort of output is being produced, whether it be an executable file,
1235 an object file, an assembler file or preprocessed C code.
1237 If @option{-o} is not specified, the default is to put an executable
1238 file in @file{a.out}, the object file for
1239 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1240 assembler file in @file{@var{source}.s}, a precompiled header file in
1241 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1242 standard output.
1244 @item -v
1245 @opindex v
1246 Print (on standard error output) the commands executed to run the stages
1247 of compilation.  Also print the version number of the compiler driver
1248 program and of the preprocessor and the compiler proper.
1250 @item -###
1251 @opindex ###
1252 Like @option{-v} except the commands are not executed and arguments
1253 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1254 This is useful for shell scripts to capture the driver-generated command lines.
1256 @item -pipe
1257 @opindex pipe
1258 Use pipes rather than temporary files for communication between the
1259 various stages of compilation.  This fails to work on some systems where
1260 the assembler is unable to read from a pipe; but the GNU assembler has
1261 no trouble.
1263 @item --help
1264 @opindex help
1265 Print (on the standard output) a description of the command-line options
1266 understood by @command{gcc}.  If the @option{-v} option is also specified
1267 then @option{--help} will also be passed on to the various processes
1268 invoked by @command{gcc}, so that they can display the command-line options
1269 they accept.  If the @option{-Wextra} option has also been specified
1270 (prior to the @option{--help} option), then command-line options that
1271 have no documentation associated with them will also be displayed.
1273 @item --target-help
1274 @opindex target-help
1275 Print (on the standard output) a description of target-specific command-line
1276 options for each tool.  For some targets extra target-specific
1277 information may also be printed.
1279 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1280 Print (on the standard output) a description of the command-line
1281 options understood by the compiler that fit into all specified classes
1282 and qualifiers.  These are the supported classes:
1284 @table @asis
1285 @item @samp{optimizers}
1286 This will display all of the optimization options supported by the
1287 compiler.
1289 @item @samp{warnings}
1290 This will display all of the options controlling warning messages
1291 produced by the compiler.
1293 @item @samp{target}
1294 This will display target-specific options.  Unlike the
1295 @option{--target-help} option however, target-specific options of the
1296 linker and assembler will not be displayed.  This is because those
1297 tools do not currently support the extended @option{--help=} syntax.
1299 @item @samp{params}
1300 This will display the values recognized by the @option{--param}
1301 option.
1303 @item @var{language}
1304 This will display the options supported for @var{language}, where
1305 @var{language} is the name of one of the languages supported in this
1306 version of GCC.
1308 @item @samp{common}
1309 This will display the options that are common to all languages.
1310 @end table
1312 These are the supported qualifiers:
1314 @table @asis
1315 @item @samp{undocumented}
1316 Display only those options that are undocumented.
1318 @item @samp{joined}
1319 Display options taking an argument that appears after an equal
1320 sign in the same continuous piece of text, such as:
1321 @samp{--help=target}.
1323 @item @samp{separate}
1324 Display options taking an argument that appears as a separate word
1325 following the original option, such as: @samp{-o output-file}.
1326 @end table
1328 Thus for example to display all the undocumented target-specific
1329 switches supported by the compiler the following can be used:
1331 @smallexample
1332 --help=target,undocumented
1333 @end smallexample
1335 The sense of a qualifier can be inverted by prefixing it with the
1336 @samp{^} character, so for example to display all binary warning
1337 options (i.e., ones that are either on or off and that do not take an
1338 argument) that have a description, use:
1340 @smallexample
1341 --help=warnings,^joined,^undocumented
1342 @end smallexample
1344 The argument to @option{--help=} should not consist solely of inverted
1345 qualifiers.
1347 Combining several classes is possible, although this usually
1348 restricts the output by so much that there is nothing to display.  One
1349 case where it does work however is when one of the classes is
1350 @var{target}.  So for example to display all the target-specific
1351 optimization options the following can be used:
1353 @smallexample
1354 --help=target,optimizers
1355 @end smallexample
1357 The @option{--help=} option can be repeated on the command line.  Each
1358 successive use will display its requested class of options, skipping
1359 those that have already been displayed.
1361 If the @option{-Q} option appears on the command line before the
1362 @option{--help=} option, then the descriptive text displayed by
1363 @option{--help=} is changed.  Instead of describing the displayed
1364 options, an indication is given as to whether the option is enabled,
1365 disabled or set to a specific value (assuming that the compiler
1366 knows this at the point where the @option{--help=} option is used).
1368 Here is a truncated example from the ARM port of @command{gcc}:
1370 @smallexample
1371   % gcc -Q -mabi=2 --help=target -c
1372   The following options are target specific:
1373   -mabi=                                2
1374   -mabort-on-noreturn                   [disabled]
1375   -mapcs                                [disabled]
1376 @end smallexample
1378 The output is sensitive to the effects of previous command-line
1379 options, so for example it is possible to find out which optimizations
1380 are enabled at @option{-O2} by using:
1382 @smallexample
1383 -Q -O2 --help=optimizers
1384 @end smallexample
1386 Alternatively you can discover which binary optimizations are enabled
1387 by @option{-O3} by using:
1389 @smallexample
1390 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1391 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1392 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1393 @end smallexample
1395 @item -no-canonical-prefixes
1396 @opindex no-canonical-prefixes
1397 Do not expand any symbolic links, resolve references to @samp{/../}
1398 or @samp{/./}, or make the path absolute when generating a relative
1399 prefix.
1401 @item --version
1402 @opindex version
1403 Display the version number and copyrights of the invoked GCC@.
1405 @item -wrapper
1406 @opindex wrapper
1407 Invoke all subcommands under a wrapper program.  The name of the
1408 wrapper program and its parameters are passed as a comma separated
1409 list.
1411 @smallexample
1412 gcc -c t.c -wrapper gdb,--args
1413 @end smallexample
1415 This will invoke all subprograms of @command{gcc} under
1416 @samp{gdb --args}, thus the invocation of @command{cc1} will be
1417 @samp{gdb --args cc1 @dots{}}.
1419 @item -fplugin=@var{name}.so
1420 Load the plugin code in file @var{name}.so, assumed to be a
1421 shared object to be dlopen'd by the compiler.  The base name of
1422 the shared object file is used to identify the plugin for the
1423 purposes of argument parsing (See
1424 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1425 Each plugin should define the callback functions specified in the
1426 Plugins API.
1428 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1429 Define an argument called @var{key} with a value of @var{value}
1430 for the plugin called @var{name}.
1432 @item -fdump-ada-spec@r{[}-slim@r{]}
1433 For C and C++ source and include files, generate corresponding Ada
1434 specs. @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1435 GNAT User's Guide}, which provides detailed documentation on this feature.
1437 @item -fdump-go-spec=@var{file}
1438 For input files in any language, generate corresponding Go
1439 declarations in @var{file}.  This generates Go @code{const},
1440 @code{type}, @code{var}, and @code{func} declarations which may be a
1441 useful way to start writing a Go interface to code written in some
1442 other language.
1444 @include @value{srcdir}/../libiberty/at-file.texi
1445 @end table
1447 @node Invoking G++
1448 @section Compiling C++ Programs
1450 @cindex suffixes for C++ source
1451 @cindex C++ source file suffixes
1452 C++ source files conventionally use one of the suffixes @samp{.C},
1453 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1454 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1455 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1456 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1457 files with these names and compiles them as C++ programs even if you
1458 call the compiler the same way as for compiling C programs (usually
1459 with the name @command{gcc}).
1461 @findex g++
1462 @findex c++
1463 However, the use of @command{gcc} does not add the C++ library.
1464 @command{g++} is a program that calls GCC and treats @samp{.c},
1465 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1466 files unless @option{-x} is used, and automatically specifies linking
1467 against the C++ library.  This program is also useful when
1468 precompiling a C header file with a @samp{.h} extension for use in C++
1469 compilations.  On many systems, @command{g++} is also installed with
1470 the name @command{c++}.
1472 @cindex invoking @command{g++}
1473 When you compile C++ programs, you may specify many of the same
1474 command-line options that you use for compiling programs in any
1475 language; or command-line options meaningful for C and related
1476 languages; or options that are meaningful only for C++ programs.
1477 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1478 explanations of options for languages related to C@.
1479 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1480 explanations of options that are meaningful only for C++ programs.
1482 @node C Dialect Options
1483 @section Options Controlling C Dialect
1484 @cindex dialect options
1485 @cindex language dialect options
1486 @cindex options, dialect
1488 The following options control the dialect of C (or languages derived
1489 from C, such as C++, Objective-C and Objective-C++) that the compiler
1490 accepts:
1492 @table @gcctabopt
1493 @cindex ANSI support
1494 @cindex ISO support
1495 @item -ansi
1496 @opindex ansi
1497 In C mode, this is equivalent to @samp{-std=c90}. In C++ mode, it is
1498 equivalent to @samp{-std=c++98}.
1500 This turns off certain features of GCC that are incompatible with ISO
1501 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1502 such as the @code{asm} and @code{typeof} keywords, and
1503 predefined macros such as @code{unix} and @code{vax} that identify the
1504 type of system you are using.  It also enables the undesirable and
1505 rarely used ISO trigraph feature.  For the C compiler,
1506 it disables recognition of C++ style @samp{//} comments as well as
1507 the @code{inline} keyword.
1509 The alternate keywords @code{__asm__}, @code{__extension__},
1510 @code{__inline__} and @code{__typeof__} continue to work despite
1511 @option{-ansi}.  You would not want to use them in an ISO C program, of
1512 course, but it is useful to put them in header files that might be included
1513 in compilations done with @option{-ansi}.  Alternate predefined macros
1514 such as @code{__unix__} and @code{__vax__} are also available, with or
1515 without @option{-ansi}.
1517 The @option{-ansi} option does not cause non-ISO programs to be
1518 rejected gratuitously.  For that, @option{-pedantic} is required in
1519 addition to @option{-ansi}.  @xref{Warning Options}.
1521 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1522 option is used.  Some header files may notice this macro and refrain
1523 from declaring certain functions or defining certain macros that the
1524 ISO standard doesn't call for; this is to avoid interfering with any
1525 programs that might use these names for other things.
1527 Functions that would normally be built in but do not have semantics
1528 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1529 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1530 built-in functions provided by GCC}, for details of the functions
1531 affected.
1533 @item -std=
1534 @opindex std
1535 Determine the language standard. @xref{Standards,,Language Standards
1536 Supported by GCC}, for details of these standard versions.  This option
1537 is currently only supported when compiling C or C++.
1539 The compiler can accept several base standards, such as @samp{c90} or
1540 @samp{c++98}, and GNU dialects of those standards, such as
1541 @samp{gnu90} or @samp{gnu++98}.  By specifying a base standard, the
1542 compiler will accept all programs following that standard and those
1543 using GNU extensions that do not contradict it.  For example,
1544 @samp{-std=c90} turns off certain features of GCC that are
1545 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1546 keywords, but not other GNU extensions that do not have a meaning in
1547 ISO C90, such as omitting the middle term of a @code{?:}
1548 expression. On the other hand, by specifying a GNU dialect of a
1549 standard, all features the compiler support are enabled, even when
1550 those features change the meaning of the base standard and some
1551 strict-conforming programs may be rejected.  The particular standard
1552 is used by @option{-pedantic} to identify which features are GNU
1553 extensions given that version of the standard. For example
1554 @samp{-std=gnu90 -pedantic} would warn about C++ style @samp{//}
1555 comments, while @samp{-std=gnu99 -pedantic} would not.
1557 A value for this option must be provided; possible values are
1559 @table @samp
1560 @item c90
1561 @itemx c89
1562 @itemx iso9899:1990
1563 Support all ISO C90 programs (certain GNU extensions that conflict
1564 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1566 @item iso9899:199409
1567 ISO C90 as modified in amendment 1.
1569 @item c99
1570 @itemx c9x
1571 @itemx iso9899:1999
1572 @itemx iso9899:199x
1573 ISO C99.  Note that this standard is not yet fully supported; see
1574 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1575 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1577 @item c11
1578 @itemx c1x
1579 @itemx iso9899:2011
1580 ISO C11, the 2011 revision of the ISO C standard.
1581 Support is incomplete and experimental.  The name @samp{c1x} is
1582 deprecated.
1584 @item gnu90
1585 @itemx gnu89
1586 GNU dialect of ISO C90 (including some C99 features). This
1587 is the default for C code.
1589 @item gnu99
1590 @itemx gnu9x
1591 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1592 this will become the default.  The name @samp{gnu9x} is deprecated.
1594 @item gnu11
1595 @item gnu1x
1596 GNU dialect of ISO C11.  Support is incomplete and experimental.  The
1597 name @samp{gnu1x} is deprecated.
1599 @item c++98
1600 The 1998 ISO C++ standard plus amendments. Same as @option{-ansi} for
1601 C++ code.
1603 @item gnu++98
1604 GNU dialect of @option{-std=c++98}.  This is the default for
1605 C++ code.
1607 @item c++11
1608 The 2011 ISO C++ standard plus amendments.  Support for C++11 is still
1609 experimental, and may change in incompatible ways in future releases.
1611 @item gnu++11
1612 GNU dialect of @option{-std=c++11}. Support for C++11 is still
1613 experimental, and may change in incompatible ways in future releases.
1614 @end table
1616 @item -fgnu89-inline
1617 @opindex fgnu89-inline
1618 The option @option{-fgnu89-inline} tells GCC to use the traditional
1619 GNU semantics for @code{inline} functions when in C99 mode.
1620 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1621 is accepted and ignored by GCC versions 4.1.3 up to but not including
1622 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1623 C99 mode.  Using this option is roughly equivalent to adding the
1624 @code{gnu_inline} function attribute to all inline functions
1625 (@pxref{Function Attributes}).
1627 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1628 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1629 specifies the default behavior).  This option was first supported in
1630 GCC 4.3.  This option is not supported in @option{-std=c90} or
1631 @option{-std=gnu90} mode.
1633 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1634 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1635 in effect for @code{inline} functions.  @xref{Common Predefined
1636 Macros,,,cpp,The C Preprocessor}.
1638 @item -aux-info @var{filename}
1639 @opindex aux-info
1640 Output to the given filename prototyped declarations for all functions
1641 declared and/or defined in a translation unit, including those in header
1642 files.  This option is silently ignored in any language other than C@.
1644 Besides declarations, the file indicates, in comments, the origin of
1645 each declaration (source file and line), whether the declaration was
1646 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1647 @samp{O} for old, respectively, in the first character after the line
1648 number and the colon), and whether it came from a declaration or a
1649 definition (@samp{C} or @samp{F}, respectively, in the following
1650 character).  In the case of function definitions, a K&R-style list of
1651 arguments followed by their declarations is also provided, inside
1652 comments, after the declaration.
1654 @item -fallow-parameterless-variadic-functions
1655 Accept variadic functions without named parameters.
1657 Although it is possible to define such a function, this is not very
1658 useful as it is not possible to read the arguments.  This is only
1659 supported for C as this construct is allowed by C++.
1661 @item -fno-asm
1662 @opindex fno-asm
1663 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1664 keyword, so that code can use these words as identifiers.  You can use
1665 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1666 instead.  @option{-ansi} implies @option{-fno-asm}.
1668 In C++, this switch only affects the @code{typeof} keyword, since
1669 @code{asm} and @code{inline} are standard keywords.  You may want to
1670 use the @option{-fno-gnu-keywords} flag instead, which has the same
1671 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1672 switch only affects the @code{asm} and @code{typeof} keywords, since
1673 @code{inline} is a standard keyword in ISO C99.
1675 @item -fno-builtin
1676 @itemx -fno-builtin-@var{function}
1677 @opindex fno-builtin
1678 @cindex built-in functions
1679 Don't recognize built-in functions that do not begin with
1680 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1681 functions provided by GCC}, for details of the functions affected,
1682 including those which are not built-in functions when @option{-ansi} or
1683 @option{-std} options for strict ISO C conformance are used because they
1684 do not have an ISO standard meaning.
1686 GCC normally generates special code to handle certain built-in functions
1687 more efficiently; for instance, calls to @code{alloca} may become single
1688 instructions which adjust the stack directly, and calls to @code{memcpy}
1689 may become inline copy loops.  The resulting code is often both smaller
1690 and faster, but since the function calls no longer appear as such, you
1691 cannot set a breakpoint on those calls, nor can you change the behavior
1692 of the functions by linking with a different library.  In addition,
1693 when a function is recognized as a built-in function, GCC may use
1694 information about that function to warn about problems with calls to
1695 that function, or to generate more efficient code, even if the
1696 resulting code still contains calls to that function.  For example,
1697 warnings are given with @option{-Wformat} for bad calls to
1698 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1699 known not to modify global memory.
1701 With the @option{-fno-builtin-@var{function}} option
1702 only the built-in function @var{function} is
1703 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1704 function is named that is not built-in in this version of GCC, this
1705 option is ignored.  There is no corresponding
1706 @option{-fbuiltin-@var{function}} option; if you wish to enable
1707 built-in functions selectively when using @option{-fno-builtin} or
1708 @option{-ffreestanding}, you may define macros such as:
1710 @smallexample
1711 #define abs(n)          __builtin_abs ((n))
1712 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1713 @end smallexample
1715 @item -fhosted
1716 @opindex fhosted
1717 @cindex hosted environment
1719 Assert that compilation takes place in a hosted environment.  This implies
1720 @option{-fbuiltin}.  A hosted environment is one in which the
1721 entire standard library is available, and in which @code{main} has a return
1722 type of @code{int}.  Examples are nearly everything except a kernel.
1723 This is equivalent to @option{-fno-freestanding}.
1725 @item -ffreestanding
1726 @opindex ffreestanding
1727 @cindex hosted environment
1729 Assert that compilation takes place in a freestanding environment.  This
1730 implies @option{-fno-builtin}.  A freestanding environment
1731 is one in which the standard library may not exist, and program startup may
1732 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1733 This is equivalent to @option{-fno-hosted}.
1735 @xref{Standards,,Language Standards Supported by GCC}, for details of
1736 freestanding and hosted environments.
1738 @item -fopenmp
1739 @opindex fopenmp
1740 @cindex OpenMP parallel
1741 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1742 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1743 compiler generates parallel code according to the OpenMP Application
1744 Program Interface v3.0 @w{@uref{http://www.openmp.org/}}.  This option
1745 implies @option{-pthread}, and thus is only supported on targets that
1746 have support for @option{-pthread}.
1748 @item -fgnu-tm
1749 @opindex fgnu-tm
1750 When the option @option{-fgnu-tm} is specified, the compiler will
1751 generate code for the Linux variant of Intel's current Transactional
1752 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
1753 an experimental feature whose interface may change in future versions
1754 of GCC, as the official specification changes.  Please note that not
1755 all architectures are supported for this feature.
1757 For more information on GCC's support for transactional memory,
1758 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
1759 Transactional Memory Library}.
1761 Note that the transactional memory feature is not supported with
1762 non-call exceptions (@option{-fnon-call-exceptions}).
1764 @item -fms-extensions
1765 @opindex fms-extensions
1766 Accept some non-standard constructs used in Microsoft header files.
1768 In C++ code, this allows member names in structures to be similar
1769 to previous types declarations.
1771 @smallexample
1772 typedef int UOW;
1773 struct ABC @{
1774   UOW UOW;
1776 @end smallexample
1778 Some cases of unnamed fields in structures and unions are only
1779 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1780 fields within structs/unions}, for details.
1782 @item -fplan9-extensions
1783 Accept some non-standard constructs used in Plan 9 code.
1785 This enables @option{-fms-extensions}, permits passing pointers to
1786 structures with anonymous fields to functions that expect pointers to
1787 elements of the type of the field, and permits referring to anonymous
1788 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
1789 struct/union fields within structs/unions}, for details.  This is only
1790 supported for C, not C++.
1792 @item -trigraphs
1793 @opindex trigraphs
1794 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1795 options for strict ISO C conformance) implies @option{-trigraphs}.
1797 @item -no-integrated-cpp
1798 @opindex no-integrated-cpp
1799 Performs a compilation in two passes: preprocessing and compiling.  This
1800 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1801 @option{-B} option.  The user supplied compilation step can then add in
1802 an additional preprocessing step after normal preprocessing but before
1803 compiling.  The default is to use the integrated cpp (internal cpp)
1805 The semantics of this option will change if "cc1", "cc1plus", and
1806 "cc1obj" are merged.
1808 @cindex traditional C language
1809 @cindex C language, traditional
1810 @item -traditional
1811 @itemx -traditional-cpp
1812 @opindex traditional-cpp
1813 @opindex traditional
1814 Formerly, these options caused GCC to attempt to emulate a pre-standard
1815 C compiler.  They are now only supported with the @option{-E} switch.
1816 The preprocessor continues to support a pre-standard mode.  See the GNU
1817 CPP manual for details.
1819 @item -fcond-mismatch
1820 @opindex fcond-mismatch
1821 Allow conditional expressions with mismatched types in the second and
1822 third arguments.  The value of such an expression is void.  This option
1823 is not supported for C++.
1825 @item -flax-vector-conversions
1826 @opindex flax-vector-conversions
1827 Allow implicit conversions between vectors with differing numbers of
1828 elements and/or incompatible element types.  This option should not be
1829 used for new code.
1831 @item -funsigned-char
1832 @opindex funsigned-char
1833 Let the type @code{char} be unsigned, like @code{unsigned char}.
1835 Each kind of machine has a default for what @code{char} should
1836 be.  It is either like @code{unsigned char} by default or like
1837 @code{signed char} by default.
1839 Ideally, a portable program should always use @code{signed char} or
1840 @code{unsigned char} when it depends on the signedness of an object.
1841 But many programs have been written to use plain @code{char} and
1842 expect it to be signed, or expect it to be unsigned, depending on the
1843 machines they were written for.  This option, and its inverse, let you
1844 make such a program work with the opposite default.
1846 The type @code{char} is always a distinct type from each of
1847 @code{signed char} or @code{unsigned char}, even though its behavior
1848 is always just like one of those two.
1850 @item -fsigned-char
1851 @opindex fsigned-char
1852 Let the type @code{char} be signed, like @code{signed char}.
1854 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1855 the negative form of @option{-funsigned-char}.  Likewise, the option
1856 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1858 @item -fsigned-bitfields
1859 @itemx -funsigned-bitfields
1860 @itemx -fno-signed-bitfields
1861 @itemx -fno-unsigned-bitfields
1862 @opindex fsigned-bitfields
1863 @opindex funsigned-bitfields
1864 @opindex fno-signed-bitfields
1865 @opindex fno-unsigned-bitfields
1866 These options control whether a bit-field is signed or unsigned, when the
1867 declaration does not use either @code{signed} or @code{unsigned}.  By
1868 default, such a bit-field is signed, because this is consistent: the
1869 basic integer types such as @code{int} are signed types.
1870 @end table
1872 @node C++ Dialect Options
1873 @section Options Controlling C++ Dialect
1875 @cindex compiler options, C++
1876 @cindex C++ options, command-line
1877 @cindex options, C++
1878 This section describes the command-line options that are only meaningful
1879 for C++ programs; but you can also use most of the GNU compiler options
1880 regardless of what language your program is in.  For example, you
1881 might compile a file @code{firstClass.C} like this:
1883 @smallexample
1884 g++ -g -frepo -O -c firstClass.C
1885 @end smallexample
1887 @noindent
1888 In this example, only @option{-frepo} is an option meant
1889 only for C++ programs; you can use the other options with any
1890 language supported by GCC@.
1892 Here is a list of options that are @emph{only} for compiling C++ programs:
1894 @table @gcctabopt
1896 @item -fabi-version=@var{n}
1897 @opindex fabi-version
1898 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1899 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1900 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1901 the version that conforms most closely to the C++ ABI specification.
1902 Therefore, the ABI obtained using version 0 will change as ABI bugs
1903 are fixed.
1905 The default is version 2.
1907 Version 3 corrects an error in mangling a constant address as a
1908 template argument.
1910 Version 4, which first appeared in G++ 4.5, implements a standard
1911 mangling for vector types.
1913 Version 5, which first appeared in G++ 4.6, corrects the mangling of
1914 attribute const/volatile on function pointer types, decltype of a
1915 plain decl, and use of a function parameter in the declaration of
1916 another parameter.
1918 Version 6, which first appeared in G++ 4.7, corrects the promotion
1919 behavior of C++11 scoped enums and the mangling of template argument
1920 packs, const/static_cast, prefix ++ and --, and a class scope function
1921 used as a template argument.
1923 See also @option{-Wabi}.
1925 @item -fno-access-control
1926 @opindex fno-access-control
1927 Turn off all access checking.  This switch is mainly useful for working
1928 around bugs in the access control code.
1930 @item -fcheck-new
1931 @opindex fcheck-new
1932 Check that the pointer returned by @code{operator new} is non-null
1933 before attempting to modify the storage allocated.  This check is
1934 normally unnecessary because the C++ standard specifies that
1935 @code{operator new} will only return @code{0} if it is declared
1936 @samp{throw()}, in which case the compiler will always check the
1937 return value even without this option.  In all other cases, when
1938 @code{operator new} has a non-empty exception specification, memory
1939 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1940 @samp{new (nothrow)}.
1942 @item -fconserve-space
1943 @opindex fconserve-space
1944 Put uninitialized or run-time-initialized global variables into the
1945 common segment, as C does.  This saves space in the executable at the
1946 cost of not diagnosing duplicate definitions.  If you compile with this
1947 flag and your program mysteriously crashes after @code{main()} has
1948 completed, you may have an object that is being destroyed twice because
1949 two definitions were merged.
1951 This option is no longer useful on most targets, now that support has
1952 been added for putting variables into BSS without making them common.
1954 @item -fconstexpr-depth=@var{n}
1955 @opindex fconstexpr-depth
1956 Set the maximum nested evaluation depth for C++11 constexpr functions
1957 to @var{n}.  A limit is needed to detect endless recursion during
1958 constant expression evaluation.  The minimum specified by the standard
1959 is 512.
1961 @item -fdeduce-init-list
1962 @opindex fdeduce-init-list
1963 Enable deduction of a template type parameter as
1964 std::initializer_list from a brace-enclosed initializer list, i.e.
1966 @smallexample
1967 template <class T> auto forward(T t) -> decltype (realfn (t))
1969   return realfn (t);
1972 void f()
1974   forward(@{1,2@}); // call forward<std::initializer_list<int>>
1976 @end smallexample
1978 This deduction was implemented as a possible extension to the
1979 originally proposed semantics for the C++11 standard, but was not part
1980 of the final standard, so it is disabled by default.  This option is
1981 deprecated, and may be removed in a future version of G++.
1983 @item -ffriend-injection
1984 @opindex ffriend-injection
1985 Inject friend functions into the enclosing namespace, so that they are
1986 visible outside the scope of the class in which they are declared.
1987 Friend functions were documented to work this way in the old Annotated
1988 C++ Reference Manual, and versions of G++ before 4.1 always worked
1989 that way.  However, in ISO C++ a friend function that is not declared
1990 in an enclosing scope can only be found using argument dependent
1991 lookup.  This option causes friends to be injected as they were in
1992 earlier releases.
1994 This option is for compatibility, and may be removed in a future
1995 release of G++.
1997 @item -fno-elide-constructors
1998 @opindex fno-elide-constructors
1999 The C++ standard allows an implementation to omit creating a temporary
2000 that is only used to initialize another object of the same type.
2001 Specifying this option disables that optimization, and forces G++ to
2002 call the copy constructor in all cases.
2004 @item -fno-enforce-eh-specs
2005 @opindex fno-enforce-eh-specs
2006 Don't generate code to check for violation of exception specifications
2007 at run time.  This option violates the C++ standard, but may be useful
2008 for reducing code size in production builds, much like defining
2009 @samp{NDEBUG}.  This does not give user code permission to throw
2010 exceptions in violation of the exception specifications; the compiler
2011 will still optimize based on the specifications, so throwing an
2012 unexpected exception will result in undefined behavior.
2014 @item -ffor-scope
2015 @itemx -fno-for-scope
2016 @opindex ffor-scope
2017 @opindex fno-for-scope
2018 If @option{-ffor-scope} is specified, the scope of variables declared in
2019 a @i{for-init-statement} is limited to the @samp{for} loop itself,
2020 as specified by the C++ standard.
2021 If @option{-fno-for-scope} is specified, the scope of variables declared in
2022 a @i{for-init-statement} extends to the end of the enclosing scope,
2023 as was the case in old versions of G++, and other (traditional)
2024 implementations of C++.
2026 The default if neither flag is given to follow the standard,
2027 but to allow and give a warning for old-style code that would
2028 otherwise be invalid, or have different behavior.
2030 @item -fno-gnu-keywords
2031 @opindex fno-gnu-keywords
2032 Do not recognize @code{typeof} as a keyword, so that code can use this
2033 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2034 @option{-ansi} implies @option{-fno-gnu-keywords}.
2036 @item -fno-implicit-templates
2037 @opindex fno-implicit-templates
2038 Never emit code for non-inline templates that are instantiated
2039 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2040 @xref{Template Instantiation}, for more information.
2042 @item -fno-implicit-inline-templates
2043 @opindex fno-implicit-inline-templates
2044 Don't emit code for implicit instantiations of inline templates, either.
2045 The default is to handle inlines differently so that compiles with and
2046 without optimization will need the same set of explicit instantiations.
2048 @item -fno-implement-inlines
2049 @opindex fno-implement-inlines
2050 To save space, do not emit out-of-line copies of inline functions
2051 controlled by @samp{#pragma implementation}.  This will cause linker
2052 errors if these functions are not inlined everywhere they are called.
2054 @item -fms-extensions
2055 @opindex fms-extensions
2056 Disable pedantic warnings about constructs used in MFC, such as implicit
2057 int and getting a pointer to member function via non-standard syntax.
2059 @item -fno-nonansi-builtins
2060 @opindex fno-nonansi-builtins
2061 Disable built-in declarations of functions that are not mandated by
2062 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2063 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2065 @item -fnothrow-opt
2066 @opindex fnothrow-opt
2067 Treat a @code{throw()} exception specification as though it were a
2068 @code{noexcept} specification to reduce or eliminate the text size
2069 overhead relative to a function with no exception specification.  If
2070 the function has local variables of types with non-trivial
2071 destructors, the exception specification will actually make the
2072 function smaller because the EH cleanups for those variables can be
2073 optimized away.  The semantic effect is that an exception thrown out of
2074 a function with such an exception specification will result in a call
2075 to @code{terminate} rather than @code{unexpected}.
2077 @item -fno-operator-names
2078 @opindex fno-operator-names
2079 Do not treat the operator name keywords @code{and}, @code{bitand},
2080 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2081 synonyms as keywords.
2083 @item -fno-optional-diags
2084 @opindex fno-optional-diags
2085 Disable diagnostics that the standard says a compiler does not need to
2086 issue.  Currently, the only such diagnostic issued by G++ is the one for
2087 a name having multiple meanings within a class.
2089 @item -fpermissive
2090 @opindex fpermissive
2091 Downgrade some diagnostics about nonconformant code from errors to
2092 warnings.  Thus, using @option{-fpermissive} will allow some
2093 nonconforming code to compile.
2095 @item -fno-pretty-templates
2096 @opindex fno-pretty-templates
2097 When an error message refers to a specialization of a function
2098 template, the compiler will normally print the signature of the
2099 template followed by the template arguments and any typedefs or
2100 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2101 rather than @code{void f(int)}) so that it's clear which template is
2102 involved.  When an error message refers to a specialization of a class
2103 template, the compiler will omit any template arguments that match
2104 the default template arguments for that template.  If either of these
2105 behaviors make it harder to understand the error message rather than
2106 easier, using @option{-fno-pretty-templates} will disable them.
2108 @item -frepo
2109 @opindex frepo
2110 Enable automatic template instantiation at link time.  This option also
2111 implies @option{-fno-implicit-templates}.  @xref{Template
2112 Instantiation}, for more information.
2114 @item -fno-rtti
2115 @opindex fno-rtti
2116 Disable generation of information about every class with virtual
2117 functions for use by the C++ run-time type identification features
2118 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
2119 of the language, you can save some space by using this flag.  Note that
2120 exception handling uses the same information, but it will generate it as
2121 needed. The @samp{dynamic_cast} operator can still be used for casts that
2122 do not require run-time type information, i.e.@: casts to @code{void *} or to
2123 unambiguous base classes.
2125 @item -fstats
2126 @opindex fstats
2127 Emit statistics about front-end processing at the end of the compilation.
2128 This information is generally only useful to the G++ development team.
2130 @item -fstrict-enums
2131 @opindex fstrict-enums
2132 Allow the compiler to optimize using the assumption that a value of
2133 enumerated type can only be one of the values of the enumeration (as
2134 defined in the C++ standard; basically, a value that can be
2135 represented in the minimum number of bits needed to represent all the
2136 enumerators).  This assumption may not be valid if the program uses a
2137 cast to convert an arbitrary integer value to the enumerated type.
2139 @item -ftemplate-depth=@var{n}
2140 @opindex ftemplate-depth
2141 Set the maximum instantiation depth for template classes to @var{n}.
2142 A limit on the template instantiation depth is needed to detect
2143 endless recursions during template class instantiation.  ANSI/ISO C++
2144 conforming programs must not rely on a maximum depth greater than 17
2145 (changed to 1024 in C++11).  The default value is 900, as the compiler
2146 can run out of stack space before hitting 1024 in some situations.
2148 @item -fno-threadsafe-statics
2149 @opindex fno-threadsafe-statics
2150 Do not emit the extra code to use the routines specified in the C++
2151 ABI for thread-safe initialization of local statics.  You can use this
2152 option to reduce code size slightly in code that doesn't need to be
2153 thread-safe.
2155 @item -fuse-cxa-atexit
2156 @opindex fuse-cxa-atexit
2157 Register destructors for objects with static storage duration with the
2158 @code{__cxa_atexit} function rather than the @code{atexit} function.
2159 This option is required for fully standards-compliant handling of static
2160 destructors, but will only work if your C library supports
2161 @code{__cxa_atexit}.
2163 @item -fno-use-cxa-get-exception-ptr
2164 @opindex fno-use-cxa-get-exception-ptr
2165 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2166 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
2167 if the runtime routine is not available.
2169 @item -fvisibility-inlines-hidden
2170 @opindex fvisibility-inlines-hidden
2171 This switch declares that the user does not attempt to compare
2172 pointers to inline functions or methods where the addresses of the two functions
2173 were taken in different shared objects.
2175 The effect of this is that GCC may, effectively, mark inline methods with
2176 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2177 appear in the export table of a DSO and do not require a PLT indirection
2178 when used within the DSO@.  Enabling this option can have a dramatic effect
2179 on load and link times of a DSO as it massively reduces the size of the
2180 dynamic export table when the library makes heavy use of templates.
2182 The behavior of this switch is not quite the same as marking the
2183 methods as hidden directly, because it does not affect static variables
2184 local to the function or cause the compiler to deduce that
2185 the function is defined in only one shared object.
2187 You may mark a method as having a visibility explicitly to negate the
2188 effect of the switch for that method.  For example, if you do want to
2189 compare pointers to a particular inline method, you might mark it as
2190 having default visibility.  Marking the enclosing class with explicit
2191 visibility will have no effect.
2193 Explicitly instantiated inline methods are unaffected by this option
2194 as their linkage might otherwise cross a shared library boundary.
2195 @xref{Template Instantiation}.
2197 @item -fvisibility-ms-compat
2198 @opindex fvisibility-ms-compat
2199 This flag attempts to use visibility settings to make GCC's C++
2200 linkage model compatible with that of Microsoft Visual Studio.
2202 The flag makes these changes to GCC's linkage model:
2204 @enumerate
2205 @item
2206 It sets the default visibility to @code{hidden}, like
2207 @option{-fvisibility=hidden}.
2209 @item
2210 Types, but not their members, are not hidden by default.
2212 @item
2213 The One Definition Rule is relaxed for types without explicit
2214 visibility specifications that are defined in more than one different
2215 shared object: those declarations are permitted if they would have
2216 been permitted when this option was not used.
2217 @end enumerate
2219 In new code it is better to use @option{-fvisibility=hidden} and
2220 export those classes that are intended to be externally visible.
2221 Unfortunately it is possible for code to rely, perhaps accidentally,
2222 on the Visual Studio behavior.
2224 Among the consequences of these changes are that static data members
2225 of the same type with the same name but defined in different shared
2226 objects will be different, so changing one will not change the other;
2227 and that pointers to function members defined in different shared
2228 objects may not compare equal.  When this flag is given, it is a
2229 violation of the ODR to define types with the same name differently.
2231 @item -fno-weak
2232 @opindex fno-weak
2233 Do not use weak symbol support, even if it is provided by the linker.
2234 By default, G++ will use weak symbols if they are available.  This
2235 option exists only for testing, and should not be used by end-users;
2236 it will result in inferior code and has no benefits.  This option may
2237 be removed in a future release of G++.
2239 @item -nostdinc++
2240 @opindex nostdinc++
2241 Do not search for header files in the standard directories specific to
2242 C++, but do still search the other standard directories.  (This option
2243 is used when building the C++ library.)
2244 @end table
2246 In addition, these optimization, warning, and code generation options
2247 have meanings only for C++ programs:
2249 @table @gcctabopt
2250 @item -fno-default-inline
2251 @opindex fno-default-inline
2252 Do not assume @samp{inline} for functions defined inside a class scope.
2253 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
2254 functions will have linkage like inline functions; they just won't be
2255 inlined by default.
2257 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2258 @opindex Wabi
2259 @opindex Wno-abi
2260 Warn when G++ generates code that is probably not compatible with the
2261 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2262 all such cases, there are probably some cases that are not warned about,
2263 even though G++ is generating incompatible code.  There may also be
2264 cases where warnings are emitted even though the code that is generated
2265 will be compatible.
2267 You should rewrite your code to avoid these warnings if you are
2268 concerned about the fact that code generated by G++ may not be binary
2269 compatible with code generated by other compilers.
2271 The known incompatibilities in @option{-fabi-version=2} (the default) include:
2273 @itemize @bullet
2275 @item
2276 A template with a non-type template parameter of reference type is
2277 mangled incorrectly:
2278 @smallexample
2279 extern int N;
2280 template <int &> struct S @{@};
2281 void n (S<N>) @{2@}
2282 @end smallexample
2284 This is fixed in @option{-fabi-version=3}.
2286 @item
2287 SIMD vector types declared using @code{__attribute ((vector_size))} are
2288 mangled in a non-standard way that does not allow for overloading of
2289 functions taking vectors of different sizes.
2291 The mangling is changed in @option{-fabi-version=4}.
2292 @end itemize
2294 The known incompatibilities in @option{-fabi-version=1} include:
2296 @itemize @bullet
2298 @item
2299 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2300 pack data into the same byte as a base class.  For example:
2302 @smallexample
2303 struct A @{ virtual void f(); int f1 : 1; @};
2304 struct B : public A @{ int f2 : 1; @};
2305 @end smallexample
2307 @noindent
2308 In this case, G++ will place @code{B::f2} into the same byte
2309 as@code{A::f1}; other compilers will not.  You can avoid this problem
2310 by explicitly padding @code{A} so that its size is a multiple of the
2311 byte size on your platform; that will cause G++ and other compilers to
2312 layout @code{B} identically.
2314 @item
2315 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2316 tail padding when laying out virtual bases.  For example:
2318 @smallexample
2319 struct A @{ virtual void f(); char c1; @};
2320 struct B @{ B(); char c2; @};
2321 struct C : public A, public virtual B @{@};
2322 @end smallexample
2324 @noindent
2325 In this case, G++ will not place @code{B} into the tail-padding for
2326 @code{A}; other compilers will.  You can avoid this problem by
2327 explicitly padding @code{A} so that its size is a multiple of its
2328 alignment (ignoring virtual base classes); that will cause G++ and other
2329 compilers to layout @code{C} identically.
2331 @item
2332 Incorrect handling of bit-fields with declared widths greater than that
2333 of their underlying types, when the bit-fields appear in a union.  For
2334 example:
2336 @smallexample
2337 union U @{ int i : 4096; @};
2338 @end smallexample
2340 @noindent
2341 Assuming that an @code{int} does not have 4096 bits, G++ will make the
2342 union too small by the number of bits in an @code{int}.
2344 @item
2345 Empty classes can be placed at incorrect offsets.  For example:
2347 @smallexample
2348 struct A @{@};
2350 struct B @{
2351   A a;
2352   virtual void f ();
2355 struct C : public B, public A @{@};
2356 @end smallexample
2358 @noindent
2359 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
2360 it should be placed at offset zero.  G++ mistakenly believes that the
2361 @code{A} data member of @code{B} is already at offset zero.
2363 @item
2364 Names of template functions whose types involve @code{typename} or
2365 template template parameters can be mangled incorrectly.
2367 @smallexample
2368 template <typename Q>
2369 void f(typename Q::X) @{@}
2371 template <template <typename> class Q>
2372 void f(typename Q<int>::X) @{@}
2373 @end smallexample
2375 @noindent
2376 Instantiations of these templates may be mangled incorrectly.
2378 @end itemize
2380 It also warns about psABI-related changes.  The known psABI changes at this
2381 point include:
2383 @itemize @bullet
2385 @item
2386 For SysV/x86-64, unions with @code{long double} members are 
2387 passed in memory as specified in psABI.  For example:
2389 @smallexample
2390 union U @{
2391   long double ld;
2392   int i;
2394 @end smallexample
2396 @noindent
2397 @code{union U} is always passed in memory.
2399 @end itemize
2401 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2402 @opindex Wctor-dtor-privacy
2403 @opindex Wno-ctor-dtor-privacy
2404 Warn when a class seems unusable because all the constructors or
2405 destructors in that class are private, and it has neither friends nor
2406 public static member functions.
2408 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2409 @opindex Wdelete-non-virtual-dtor
2410 @opindex Wno-delete-non-virtual-dtor
2411 Warn when @samp{delete} is used to destroy an instance of a class that
2412 has virtual functions and non-virtual destructor. It is unsafe to delete
2413 an instance of a derived class through a pointer to a base class if the
2414 base class does not have a virtual destructor.  This warning is enabled
2415 by @option{-Wall}.
2417 @item -Wnarrowing @r{(C++ and Objective-C++ only)}
2418 @opindex Wnarrowing
2419 @opindex Wno-narrowing
2420 Warn when a narrowing conversion prohibited by C++11 occurs within
2421 @samp{@{ @}}, e.g.
2423 @smallexample
2424 int i = @{ 2.2 @}; // error: narrowing from double to int
2425 @end smallexample
2427 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2429 With -std=c++11, @option{-Wno-narrowing} suppresses the diagnostic
2430 required by the standard.  Note that this does not affect the meaning
2431 of well-formed code; narrowing conversions are still considered
2432 ill-formed in SFINAE context.
2434 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2435 @opindex Wnoexcept
2436 @opindex Wno-noexcept
2437 Warn when a noexcept-expression evaluates to false because of a call
2438 to a function that does not have a non-throwing exception
2439 specification (i.e. @samp{throw()} or @samp{noexcept}) but is known by
2440 the compiler to never throw an exception.
2442 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2443 @opindex Wnon-virtual-dtor
2444 @opindex Wno-non-virtual-dtor
2445 Warn when a class has virtual functions and accessible non-virtual
2446 destructor, in which case it would be possible but unsafe to delete
2447 an instance of a derived class through a pointer to the base class.
2448 This warning is also enabled if @option{-Weffc++} is specified.
2450 @item -Wreorder @r{(C++ and Objective-C++ only)}
2451 @opindex Wreorder
2452 @opindex Wno-reorder
2453 @cindex reordering, warning
2454 @cindex warning for reordering of member initializers
2455 Warn when the order of member initializers given in the code does not
2456 match the order in which they must be executed.  For instance:
2458 @smallexample
2459 struct A @{
2460   int i;
2461   int j;
2462   A(): j (0), i (1) @{ @}
2464 @end smallexample
2466 The compiler will rearrange the member initializers for @samp{i}
2467 and @samp{j} to match the declaration order of the members, emitting
2468 a warning to that effect.  This warning is enabled by @option{-Wall}.
2469 @end table
2471 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2473 @table @gcctabopt
2474 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2475 @opindex Weffc++
2476 @opindex Wno-effc++
2477 Warn about violations of the following style guidelines from Scott Meyers'
2478 @cite{Effective C++, Second Edition} book:
2480 @itemize @bullet
2481 @item
2482 Item 11:  Define a copy constructor and an assignment operator for classes
2483 with dynamically allocated memory.
2485 @item
2486 Item 12:  Prefer initialization to assignment in constructors.
2488 @item
2489 Item 14:  Make destructors virtual in base classes.
2491 @item
2492 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2494 @item
2495 Item 23:  Don't try to return a reference when you must return an object.
2497 @end itemize
2499 Also warn about violations of the following style guidelines from
2500 Scott Meyers' @cite{More Effective C++} book:
2502 @itemize @bullet
2503 @item
2504 Item 6:  Distinguish between prefix and postfix forms of increment and
2505 decrement operators.
2507 @item
2508 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2510 @end itemize
2512 When selecting this option, be aware that the standard library
2513 headers do not obey all of these guidelines; use @samp{grep -v}
2514 to filter out those warnings.
2516 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2517 @opindex Wstrict-null-sentinel
2518 @opindex Wno-strict-null-sentinel
2519 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2520 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2521 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2522 it is guaranteed to be of the same size as a pointer.  But this use is
2523 not portable across different compilers.
2525 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2526 @opindex Wno-non-template-friend
2527 @opindex Wnon-template-friend
2528 Disable warnings when non-templatized friend functions are declared
2529 within a template.  Since the advent of explicit template specification
2530 support in G++, if the name of the friend is an unqualified-id (i.e.,
2531 @samp{friend foo(int)}), the C++ language specification demands that the
2532 friend declare or define an ordinary, nontemplate function.  (Section
2533 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2534 could be interpreted as a particular specialization of a templatized
2535 function.  Because this non-conforming behavior is no longer the default
2536 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2537 check existing code for potential trouble spots and is on by default.
2538 This new compiler behavior can be turned off with
2539 @option{-Wno-non-template-friend}, which keeps the conformant compiler code
2540 but disables the helpful warning.
2542 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2543 @opindex Wold-style-cast
2544 @opindex Wno-old-style-cast
2545 Warn if an old-style (C-style) cast to a non-void type is used within
2546 a C++ program.  The new-style casts (@samp{dynamic_cast},
2547 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2548 less vulnerable to unintended effects and much easier to search for.
2550 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2551 @opindex Woverloaded-virtual
2552 @opindex Wno-overloaded-virtual
2553 @cindex overloaded virtual function, warning
2554 @cindex warning for overloaded virtual function
2555 Warn when a function declaration hides virtual functions from a
2556 base class.  For example, in:
2558 @smallexample
2559 struct A @{
2560   virtual void f();
2563 struct B: public A @{
2564   void f(int);
2566 @end smallexample
2568 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2569 like:
2571 @smallexample
2572 B* b;
2573 b->f();
2574 @end smallexample
2576 will fail to compile.
2578 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2579 @opindex Wno-pmf-conversions
2580 @opindex Wpmf-conversions
2581 Disable the diagnostic for converting a bound pointer to member function
2582 to a plain pointer.
2584 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2585 @opindex Wsign-promo
2586 @opindex Wno-sign-promo
2587 Warn when overload resolution chooses a promotion from unsigned or
2588 enumerated type to a signed type, over a conversion to an unsigned type of
2589 the same size.  Previous versions of G++ would try to preserve
2590 unsignedness, but the standard mandates the current behavior.
2592 @smallexample
2593 struct A @{
2594   operator int ();
2595   A& operator = (int);
2598 main ()
2600   A a,b;
2601   a = b;
2603 @end smallexample
2605 In this example, G++ will synthesize a default @samp{A& operator =
2606 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2607 @end table
2609 @node Objective-C and Objective-C++ Dialect Options
2610 @section Options Controlling Objective-C and Objective-C++ Dialects
2612 @cindex compiler options, Objective-C and Objective-C++
2613 @cindex Objective-C and Objective-C++ options, command-line
2614 @cindex options, Objective-C and Objective-C++
2615 (NOTE: This manual does not describe the Objective-C and Objective-C++
2616 languages themselves.  @xref{Standards,,Language Standards
2617 Supported by GCC}, for references.)
2619 This section describes the command-line options that are only meaningful
2620 for Objective-C and Objective-C++ programs, but you can also use most of
2621 the language-independent GNU compiler options.
2622 For example, you might compile a file @code{some_class.m} like this:
2624 @smallexample
2625 gcc -g -fgnu-runtime -O -c some_class.m
2626 @end smallexample
2628 @noindent
2629 In this example, @option{-fgnu-runtime} is an option meant only for
2630 Objective-C and Objective-C++ programs; you can use the other options with
2631 any language supported by GCC@.
2633 Note that since Objective-C is an extension of the C language, Objective-C
2634 compilations may also use options specific to the C front-end (e.g.,
2635 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2636 C++-specific options (e.g., @option{-Wabi}).
2638 Here is a list of options that are @emph{only} for compiling Objective-C
2639 and Objective-C++ programs:
2641 @table @gcctabopt
2642 @item -fconstant-string-class=@var{class-name}
2643 @opindex fconstant-string-class
2644 Use @var{class-name} as the name of the class to instantiate for each
2645 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2646 class name is @code{NXConstantString} if the GNU runtime is being used, and
2647 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2648 @option{-fconstant-cfstrings} option, if also present, will override the
2649 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2650 to be laid out as constant CoreFoundation strings.
2652 @item -fgnu-runtime
2653 @opindex fgnu-runtime
2654 Generate object code compatible with the standard GNU Objective-C
2655 runtime.  This is the default for most types of systems.
2657 @item -fnext-runtime
2658 @opindex fnext-runtime
2659 Generate output compatible with the NeXT runtime.  This is the default
2660 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2661 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2662 used.
2664 @item -fno-nil-receivers
2665 @opindex fno-nil-receivers
2666 Assume that all Objective-C message dispatches (@code{[receiver
2667 message:arg]}) in this translation unit ensure that the receiver is
2668 not @code{nil}.  This allows for more efficient entry points in the
2669 runtime to be used.  This option is only available in conjunction with
2670 the NeXT runtime and ABI version 0 or 1.
2672 @item -fobjc-abi-version=@var{n}
2673 @opindex fobjc-abi-version
2674 Use version @var{n} of the Objective-C ABI for the selected runtime.
2675 This option is currently supported only for the NeXT runtime.  In that
2676 case, Version 0 is the traditional (32-bit) ABI without support for
2677 properties and other Objective-C 2.0 additions.  Version 1 is the
2678 traditional (32-bit) ABI with support for properties and other
2679 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
2680 nothing is specified, the default is Version 0 on 32-bit target
2681 machines, and Version 2 on 64-bit target machines.
2683 @item -fobjc-call-cxx-cdtors
2684 @opindex fobjc-call-cxx-cdtors
2685 For each Objective-C class, check if any of its instance variables is a
2686 C++ object with a non-trivial default constructor.  If so, synthesize a
2687 special @code{- (id) .cxx_construct} instance method which will run
2688 non-trivial default constructors on any such instance variables, in order,
2689 and then return @code{self}.  Similarly, check if any instance variable
2690 is a C++ object with a non-trivial destructor, and if so, synthesize a
2691 special @code{- (void) .cxx_destruct} method which will run
2692 all such default destructors, in reverse order.
2694 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
2695 methods thusly generated will only operate on instance variables
2696 declared in the current Objective-C class, and not those inherited
2697 from superclasses.  It is the responsibility of the Objective-C
2698 runtime to invoke all such methods in an object's inheritance
2699 hierarchy.  The @code{- (id) .cxx_construct} methods will be invoked
2700 by the runtime immediately after a new object instance is allocated;
2701 the @code{- (void) .cxx_destruct} methods will be invoked immediately
2702 before the runtime deallocates an object instance.
2704 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2705 support for invoking the @code{- (id) .cxx_construct} and
2706 @code{- (void) .cxx_destruct} methods.
2708 @item -fobjc-direct-dispatch
2709 @opindex fobjc-direct-dispatch
2710 Allow fast jumps to the message dispatcher.  On Darwin this is
2711 accomplished via the comm page.
2713 @item -fobjc-exceptions
2714 @opindex fobjc-exceptions
2715 Enable syntactic support for structured exception handling in
2716 Objective-C, similar to what is offered by C++ and Java.  This option
2717 is required to use the Objective-C keywords @code{@@try},
2718 @code{@@throw}, @code{@@catch}, @code{@@finally} and
2719 @code{@@synchronized}.  This option is available with both the GNU
2720 runtime and the NeXT runtime (but not available in conjunction with
2721 the NeXT runtime on Mac OS X 10.2 and earlier).
2723 @item -fobjc-gc
2724 @opindex fobjc-gc
2725 Enable garbage collection (GC) in Objective-C and Objective-C++
2726 programs.  This option is only available with the NeXT runtime; the
2727 GNU runtime has a different garbage collection implementation that
2728 does not require special compiler flags.
2730 @item -fobjc-nilcheck
2731 @opindex fobjc-nilcheck
2732 For the NeXT runtime with version 2 of the ABI, check for a nil
2733 receiver in method invocations before doing the actual method call.
2734 This is the default and can be disabled using
2735 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
2736 checked for nil in this way no matter what this flag is set to.
2737 Currently this flag does nothing when the GNU runtime, or an older
2738 version of the NeXT runtime ABI, is used.
2740 @item -fobjc-std=objc1
2741 @opindex fobjc-std
2742 Conform to the language syntax of Objective-C 1.0, the language
2743 recognized by GCC 4.0.  This only affects the Objective-C additions to
2744 the C/C++ language; it does not affect conformance to C/C++ standards,
2745 which is controlled by the separate C/C++ dialect option flags.  When
2746 this option is used with the Objective-C or Objective-C++ compiler,
2747 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
2748 This is useful if you need to make sure that your Objective-C code can
2749 be compiled with older versions of GCC.
2751 @item -freplace-objc-classes
2752 @opindex freplace-objc-classes
2753 Emit a special marker instructing @command{ld(1)} not to statically link in
2754 the resulting object file, and allow @command{dyld(1)} to load it in at
2755 run time instead.  This is used in conjunction with the Fix-and-Continue
2756 debugging mode, where the object file in question may be recompiled and
2757 dynamically reloaded in the course of program execution, without the need
2758 to restart the program itself.  Currently, Fix-and-Continue functionality
2759 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2760 and later.
2762 @item -fzero-link
2763 @opindex fzero-link
2764 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2765 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2766 compile time) with static class references that get initialized at load time,
2767 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2768 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2769 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2770 for individual class implementations to be modified during program execution.
2771 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
2772 regardless of command-line options.
2774 @item -gen-decls
2775 @opindex gen-decls
2776 Dump interface declarations for all classes seen in the source file to a
2777 file named @file{@var{sourcename}.decl}.
2779 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2780 @opindex Wassign-intercept
2781 @opindex Wno-assign-intercept
2782 Warn whenever an Objective-C assignment is being intercepted by the
2783 garbage collector.
2785 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2786 @opindex Wno-protocol
2787 @opindex Wprotocol
2788 If a class is declared to implement a protocol, a warning is issued for
2789 every method in the protocol that is not implemented by the class.  The
2790 default behavior is to issue a warning for every method not explicitly
2791 implemented in the class, even if a method implementation is inherited
2792 from the superclass.  If you use the @option{-Wno-protocol} option, then
2793 methods inherited from the superclass are considered to be implemented,
2794 and no warning is issued for them.
2796 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2797 @opindex Wselector
2798 @opindex Wno-selector
2799 Warn if multiple methods of different types for the same selector are
2800 found during compilation.  The check is performed on the list of methods
2801 in the final stage of compilation.  Additionally, a check is performed
2802 for each selector appearing in a @code{@@selector(@dots{})}
2803 expression, and a corresponding method for that selector has been found
2804 during compilation.  Because these checks scan the method table only at
2805 the end of compilation, these warnings are not produced if the final
2806 stage of compilation is not reached, for example because an error is
2807 found during compilation, or because the @option{-fsyntax-only} option is
2808 being used.
2810 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2811 @opindex Wstrict-selector-match
2812 @opindex Wno-strict-selector-match
2813 Warn if multiple methods with differing argument and/or return types are
2814 found for a given selector when attempting to send a message using this
2815 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2816 is off (which is the default behavior), the compiler will omit such warnings
2817 if any differences found are confined to types that share the same size
2818 and alignment.
2820 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2821 @opindex Wundeclared-selector
2822 @opindex Wno-undeclared-selector
2823 Warn if a @code{@@selector(@dots{})} expression referring to an
2824 undeclared selector is found.  A selector is considered undeclared if no
2825 method with that name has been declared before the
2826 @code{@@selector(@dots{})} expression, either explicitly in an
2827 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2828 an @code{@@implementation} section.  This option always performs its
2829 checks as soon as a @code{@@selector(@dots{})} expression is found,
2830 while @option{-Wselector} only performs its checks in the final stage of
2831 compilation.  This also enforces the coding style convention
2832 that methods and selectors must be declared before being used.
2834 @item -print-objc-runtime-info
2835 @opindex print-objc-runtime-info
2836 Generate C header describing the largest structure that is passed by
2837 value, if any.
2839 @end table
2841 @node Language Independent Options
2842 @section Options to Control Diagnostic Messages Formatting
2843 @cindex options to control diagnostics formatting
2844 @cindex diagnostic messages
2845 @cindex message formatting
2847 Traditionally, diagnostic messages have been formatted irrespective of
2848 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2849 below can be used to control the diagnostic messages formatting
2850 algorithm, e.g.@: how many characters per line, how often source location
2851 information should be reported.  Right now, only the C++ front end can
2852 honor these options.  However it is expected, in the near future, that
2853 the remaining front ends would be able to digest them correctly.
2855 @table @gcctabopt
2856 @item -fmessage-length=@var{n}
2857 @opindex fmessage-length
2858 Try to format error messages so that they fit on lines of about @var{n}
2859 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2860 the front ends supported by GCC@.  If @var{n} is zero, then no
2861 line-wrapping will be done; each error message will appear on a single
2862 line.
2864 @opindex fdiagnostics-show-location
2865 @item -fdiagnostics-show-location=once
2866 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2867 reporter to emit @emph{once} source location information; that is, in
2868 case the message is too long to fit on a single physical line and has to
2869 be wrapped, the source location won't be emitted (as prefix) again,
2870 over and over, in subsequent continuation lines.  This is the default
2871 behavior.
2873 @item -fdiagnostics-show-location=every-line
2874 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2875 messages reporter to emit the same source location information (as
2876 prefix) for physical lines that result from the process of breaking
2877 a message which is too long to fit on a single line.
2879 @item -fno-diagnostics-show-option
2880 @opindex fno-diagnostics-show-option
2881 @opindex fdiagnostics-show-option
2882 By default, each diagnostic emitted includes text indicating the
2883 command-line option that directly controls the diagnostic (if such an
2884 option is known to the diagnostic machinery).  Specifying the
2885 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
2887 @end table
2889 @node Warning Options
2890 @section Options to Request or Suppress Warnings
2891 @cindex options to control warnings
2892 @cindex warning messages
2893 @cindex messages, warning
2894 @cindex suppressing warnings
2896 Warnings are diagnostic messages that report constructions that
2897 are not inherently erroneous but that are risky or suggest there
2898 may have been an error.
2900 The following language-independent options do not enable specific
2901 warnings but control the kinds of diagnostics produced by GCC.
2903 @table @gcctabopt
2904 @cindex syntax checking
2905 @item -fsyntax-only
2906 @opindex fsyntax-only
2907 Check the code for syntax errors, but don't do anything beyond that.
2909 @item -fmax-errors=@var{n}
2910 @opindex fmax-errors
2911 Limits the maximum number of error messages to @var{n}, at which point
2912 GCC bails out rather than attempting to continue processing the source
2913 code.  If @var{n} is 0 (the default), there is no limit on the number
2914 of error messages produced.  If @option{-Wfatal-errors} is also
2915 specified, then @option{-Wfatal-errors} takes precedence over this
2916 option.
2918 @item -w
2919 @opindex w
2920 Inhibit all warning messages.
2922 @item -Werror
2923 @opindex Werror
2924 @opindex Wno-error
2925 Make all warnings into errors.
2927 @item -Werror=
2928 @opindex Werror=
2929 @opindex Wno-error=
2930 Make the specified warning into an error.  The specifier for a warning
2931 is appended, for example @option{-Werror=switch} turns the warnings
2932 controlled by @option{-Wswitch} into errors.  This switch takes a
2933 negative form, to be used to negate @option{-Werror} for specific
2934 warnings, for example @option{-Wno-error=switch} makes
2935 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
2936 is in effect.
2938 The warning message for each controllable warning includes the
2939 option that controls the warning.  That option can then be used with
2940 @option{-Werror=} and @option{-Wno-error=} as described above.
2941 (Printing of the option in the warning message can be disabled using the
2942 @option{-fno-diagnostics-show-option} flag.)
2944 Note that specifying @option{-Werror=}@var{foo} automatically implies
2945 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
2946 imply anything.
2948 @item -Wfatal-errors
2949 @opindex Wfatal-errors
2950 @opindex Wno-fatal-errors
2951 This option causes the compiler to abort compilation on the first error
2952 occurred rather than trying to keep going and printing further error
2953 messages.
2955 @end table
2957 You can request many specific warnings with options beginning
2958 @samp{-W}, for example @option{-Wimplicit} to request warnings on
2959 implicit declarations.  Each of these specific warning options also
2960 has a negative form beginning @samp{-Wno-} to turn off warnings; for
2961 example, @option{-Wno-implicit}.  This manual lists only one of the
2962 two forms, whichever is not the default.  For further,
2963 language-specific options also refer to @ref{C++ Dialect Options} and
2964 @ref{Objective-C and Objective-C++ Dialect Options}.
2966 When an unrecognized warning option is requested (e.g.,
2967 @option{-Wunknown-warning}), GCC will emit a diagnostic stating
2968 that the option is not recognized.  However, if the @option{-Wno-} form
2969 is used, the behavior is slightly different: No diagnostic will be
2970 produced for @option{-Wno-unknown-warning} unless other diagnostics
2971 are being produced.  This allows the use of new @option{-Wno-} options
2972 with old compilers, but if something goes wrong, the compiler will
2973 warn that an unrecognized option was used.
2975 @table @gcctabopt
2976 @item -pedantic
2977 @opindex pedantic
2978 Issue all the warnings demanded by strict ISO C and ISO C++;
2979 reject all programs that use forbidden extensions, and some other
2980 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2981 version of the ISO C standard specified by any @option{-std} option used.
2983 Valid ISO C and ISO C++ programs should compile properly with or without
2984 this option (though a rare few will require @option{-ansi} or a
2985 @option{-std} option specifying the required version of ISO C)@.  However,
2986 without this option, certain GNU extensions and traditional C and C++
2987 features are supported as well.  With this option, they are rejected.
2989 @option{-pedantic} does not cause warning messages for use of the
2990 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2991 warnings are also disabled in the expression that follows
2992 @code{__extension__}.  However, only system header files should use
2993 these escape routes; application programs should avoid them.
2994 @xref{Alternate Keywords}.
2996 Some users try to use @option{-pedantic} to check programs for strict ISO
2997 C conformance.  They soon find that it does not do quite what they want:
2998 it finds some non-ISO practices, but not all---only those for which
2999 ISO C @emph{requires} a diagnostic, and some others for which
3000 diagnostics have been added.
3002 A feature to report any failure to conform to ISO C might be useful in
3003 some instances, but would require considerable additional work and would
3004 be quite different from @option{-pedantic}.  We don't have plans to
3005 support such a feature in the near future.
3007 Where the standard specified with @option{-std} represents a GNU
3008 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3009 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3010 extended dialect is based.  Warnings from @option{-pedantic} are given
3011 where they are required by the base standard.  (It would not make sense
3012 for such warnings to be given only for features not in the specified GNU
3013 C dialect, since by definition the GNU dialects of C include all
3014 features the compiler supports with the given option, and there would be
3015 nothing to warn about.)
3017 @item -pedantic-errors
3018 @opindex pedantic-errors
3019 Like @option{-pedantic}, except that errors are produced rather than
3020 warnings.
3022 @item -Wall
3023 @opindex Wall
3024 @opindex Wno-all
3025 This enables all the warnings about constructions that some users
3026 consider questionable, and that are easy to avoid (or modify to
3027 prevent the warning), even in conjunction with macros.  This also
3028 enables some language-specific warnings described in @ref{C++ Dialect
3029 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3031 @option{-Wall} turns on the following warning flags:
3033 @gccoptlist{-Waddress   @gol
3034 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
3035 -Wc++11-compat  @gol
3036 -Wchar-subscripts  @gol
3037 -Wenum-compare @r{(in C/Objc; this is on by default in C++)} @gol
3038 -Wimplicit-int @r{(C and Objective-C only)} @gol
3039 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3040 -Wcomment  @gol
3041 -Wformat   @gol
3042 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3043 -Wmaybe-uninitialized @gol
3044 -Wmissing-braces  @gol
3045 -Wnonnull  @gol
3046 -Wparentheses  @gol
3047 -Wpointer-sign  @gol
3048 -Wreorder   @gol
3049 -Wreturn-type  @gol
3050 -Wsequence-point  @gol
3051 -Wsign-compare @r{(only in C++)}  @gol
3052 -Wstrict-aliasing  @gol
3053 -Wstrict-overflow=1  @gol
3054 -Wswitch  @gol
3055 -Wtrigraphs  @gol
3056 -Wuninitialized  @gol
3057 -Wunknown-pragmas  @gol
3058 -Wunused-function  @gol
3059 -Wunused-label     @gol
3060 -Wunused-value     @gol
3061 -Wunused-variable  @gol
3062 -Wvolatile-register-var @gol
3065 Note that some warning flags are not implied by @option{-Wall}.  Some of
3066 them warn about constructions that users generally do not consider
3067 questionable, but which occasionally you might wish to check for;
3068 others warn about constructions that are necessary or hard to avoid in
3069 some cases, and there is no simple way to modify the code to suppress
3070 the warning. Some of them are enabled by @option{-Wextra} but many of
3071 them must be enabled individually.
3073 @item -Wextra
3074 @opindex W
3075 @opindex Wextra
3076 @opindex Wno-extra
3077 This enables some extra warning flags that are not enabled by
3078 @option{-Wall}. (This option used to be called @option{-W}.  The older
3079 name is still supported, but the newer name is more descriptive.)
3081 @gccoptlist{-Wclobbered  @gol
3082 -Wempty-body  @gol
3083 -Wignored-qualifiers @gol
3084 -Wmissing-field-initializers  @gol
3085 -Wmissing-parameter-type @r{(C only)}  @gol
3086 -Wold-style-declaration @r{(C only)}  @gol
3087 -Woverride-init  @gol
3088 -Wsign-compare  @gol
3089 -Wtype-limits  @gol
3090 -Wuninitialized  @gol
3091 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3092 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3095 The option @option{-Wextra} also prints warning messages for the
3096 following cases:
3098 @itemize @bullet
3100 @item
3101 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3102 @samp{>}, or @samp{>=}.
3104 @item
3105 (C++ only) An enumerator and a non-enumerator both appear in a
3106 conditional expression.
3108 @item
3109 (C++ only) Ambiguous virtual bases.
3111 @item
3112 (C++ only) Subscripting an array that has been declared @samp{register}.
3114 @item
3115 (C++ only) Taking the address of a variable that has been declared
3116 @samp{register}.
3118 @item
3119 (C++ only) A base class is not initialized in a derived class' copy
3120 constructor.
3122 @end itemize
3124 @item -Wchar-subscripts
3125 @opindex Wchar-subscripts
3126 @opindex Wno-char-subscripts
3127 Warn if an array subscript has type @code{char}.  This is a common cause
3128 of error, as programmers often forget that this type is signed on some
3129 machines.
3130 This warning is enabled by @option{-Wall}.
3132 @item -Wcomment
3133 @opindex Wcomment
3134 @opindex Wno-comment
3135 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3136 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3137 This warning is enabled by @option{-Wall}.
3139 @item -Wno-coverage-mismatch
3140 @opindex Wno-coverage-mismatch
3141 Warn if feedback profiles do not match when using the
3142 @option{-fprofile-use} option.
3143 If a source file was changed between @option{-fprofile-gen} and
3144 @option{-fprofile-use}, the files with the profile feedback can fail
3145 to match the source file and GCC cannot use the profile feedback
3146 information.  By default, this warning is enabled and is treated as an
3147 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3148 warning or @option{-Wno-error=coverage-mismatch} can be used to
3149 disable the error.  Disabling the error for this warning can result in
3150 poorly optimized code and is useful only in the
3151 case of very minor changes such as bug fixes to an existing code-base.
3152 Completely disabling the warning is not recommended.
3154 @item -Wno-cpp
3155 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3157 Suppress warning messages emitted by @code{#warning} directives.
3159 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3160 @opindex Wdouble-promotion
3161 @opindex Wno-double-promotion
3162 Give a warning when a value of type @code{float} is implicitly
3163 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3164 floating-point unit implement @code{float} in hardware, but emulate
3165 @code{double} in software.  On such a machine, doing computations
3166 using @code{double} values is much more expensive because of the
3167 overhead required for software emulation.
3169 It is easy to accidentally do computations with @code{double} because
3170 floating-point literals are implicitly of type @code{double}.  For
3171 example, in:
3172 @smallexample
3173 @group
3174 float area(float radius)
3176    return 3.14159 * radius * radius;
3178 @end group
3179 @end smallexample
3180 the compiler will perform the entire computation with @code{double}
3181 because the floating-point literal is a @code{double}.
3183 @item -Wformat
3184 @opindex Wformat
3185 @opindex Wno-format
3186 @opindex ffreestanding
3187 @opindex fno-builtin
3188 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3189 the arguments supplied have types appropriate to the format string
3190 specified, and that the conversions specified in the format string make
3191 sense.  This includes standard functions, and others specified by format
3192 attributes (@pxref{Function Attributes}), in the @code{printf},
3193 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3194 not in the C standard) families (or other target-specific families).
3195 Which functions are checked without format attributes having been
3196 specified depends on the standard version selected, and such checks of
3197 functions without the attribute specified are disabled by
3198 @option{-ffreestanding} or @option{-fno-builtin}.
3200 The formats are checked against the format features supported by GNU
3201 libc version 2.2.  These include all ISO C90 and C99 features, as well
3202 as features from the Single Unix Specification and some BSD and GNU
3203 extensions.  Other library implementations may not support all these
3204 features; GCC does not support warning about features that go beyond a
3205 particular library's limitations.  However, if @option{-pedantic} is used
3206 with @option{-Wformat}, warnings will be given about format features not
3207 in the selected standard version (but not for @code{strfmon} formats,
3208 since those are not in any version of the C standard).  @xref{C Dialect
3209 Options,,Options Controlling C Dialect}.
3211 Since @option{-Wformat} also checks for null format arguments for
3212 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
3214 @option{-Wformat} is included in @option{-Wall}.  For more control over some
3215 aspects of format checking, the options @option{-Wformat-y2k},
3216 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
3217 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
3218 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
3220 @item -Wformat-y2k
3221 @opindex Wformat-y2k
3222 @opindex Wno-format-y2k
3223 If @option{-Wformat} is specified, also warn about @code{strftime}
3224 formats that may yield only a two-digit year.
3226 @item -Wno-format-contains-nul
3227 @opindex Wno-format-contains-nul
3228 @opindex Wformat-contains-nul
3229 If @option{-Wformat} is specified, do not warn about format strings that
3230 contain NUL bytes.
3232 @item -Wno-format-extra-args
3233 @opindex Wno-format-extra-args
3234 @opindex Wformat-extra-args
3235 If @option{-Wformat} is specified, do not warn about excess arguments to a
3236 @code{printf} or @code{scanf} format function.  The C standard specifies
3237 that such arguments are ignored.
3239 Where the unused arguments lie between used arguments that are
3240 specified with @samp{$} operand number specifications, normally
3241 warnings are still given, since the implementation could not know what
3242 type to pass to @code{va_arg} to skip the unused arguments.  However,
3243 in the case of @code{scanf} formats, this option will suppress the
3244 warning if the unused arguments are all pointers, since the Single
3245 Unix Specification says that such unused arguments are allowed.
3247 @item -Wno-format-zero-length
3248 @opindex Wno-format-zero-length
3249 @opindex Wformat-zero-length
3250 If @option{-Wformat} is specified, do not warn about zero-length formats.
3251 The C standard specifies that zero-length formats are allowed.
3253 @item -Wformat-nonliteral
3254 @opindex Wformat-nonliteral
3255 @opindex Wno-format-nonliteral
3256 If @option{-Wformat} is specified, also warn if the format string is not a
3257 string literal and so cannot be checked, unless the format function
3258 takes its format arguments as a @code{va_list}.
3260 @item -Wformat-security
3261 @opindex Wformat-security
3262 @opindex Wno-format-security
3263 If @option{-Wformat} is specified, also warn about uses of format
3264 functions that represent possible security problems.  At present, this
3265 warns about calls to @code{printf} and @code{scanf} functions where the
3266 format string is not a string literal and there are no format arguments,
3267 as in @code{printf (foo);}.  This may be a security hole if the format
3268 string came from untrusted input and contains @samp{%n}.  (This is
3269 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3270 in future warnings may be added to @option{-Wformat-security} that are not
3271 included in @option{-Wformat-nonliteral}.)
3273 @item -Wformat=2
3274 @opindex Wformat=2
3275 @opindex Wno-format=2
3276 Enable @option{-Wformat} plus format checks not included in
3277 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
3278 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
3280 @item -Wnonnull
3281 @opindex Wnonnull
3282 @opindex Wno-nonnull
3283 Warn about passing a null pointer for arguments marked as
3284 requiring a non-null value by the @code{nonnull} function attribute.
3286 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3287 can be disabled with the @option{-Wno-nonnull} option.
3289 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3290 @opindex Winit-self
3291 @opindex Wno-init-self
3292 Warn about uninitialized variables that are initialized with themselves.
3293 Note this option can only be used with the @option{-Wuninitialized} option.
3295 For example, GCC will warn about @code{i} being uninitialized in the
3296 following snippet only when @option{-Winit-self} has been specified:
3297 @smallexample
3298 @group
3299 int f()
3301   int i = i;
3302   return i;
3304 @end group
3305 @end smallexample
3307 @item -Wimplicit-int @r{(C and Objective-C only)}
3308 @opindex Wimplicit-int
3309 @opindex Wno-implicit-int
3310 Warn when a declaration does not specify a type.
3311 This warning is enabled by @option{-Wall}.
3313 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3314 @opindex Wimplicit-function-declaration
3315 @opindex Wno-implicit-function-declaration
3316 Give a warning whenever a function is used before being declared. In
3317 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3318 enabled by default and it is made into an error by
3319 @option{-pedantic-errors}. This warning is also enabled by
3320 @option{-Wall}.
3322 @item -Wimplicit @r{(C and Objective-C only)}
3323 @opindex Wimplicit
3324 @opindex Wno-implicit
3325 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3326 This warning is enabled by @option{-Wall}.
3328 @item -Wignored-qualifiers @r{(C and C++ only)}
3329 @opindex Wignored-qualifiers
3330 @opindex Wno-ignored-qualifiers
3331 Warn if the return type of a function has a type qualifier
3332 such as @code{const}.  For ISO C such a type qualifier has no effect,
3333 since the value returned by a function is not an lvalue.
3334 For C++, the warning is only emitted for scalar types or @code{void}.
3335 ISO C prohibits qualified @code{void} return types on function
3336 definitions, so such return types always receive a warning
3337 even without this option.
3339 This warning is also enabled by @option{-Wextra}.
3341 @item -Wmain
3342 @opindex Wmain
3343 @opindex Wno-main
3344 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3345 a function with external linkage, returning int, taking either zero
3346 arguments, two, or three arguments of appropriate types.  This warning
3347 is enabled by default in C++ and is enabled by either @option{-Wall}
3348 or @option{-pedantic}.
3350 @item -Wmissing-braces
3351 @opindex Wmissing-braces
3352 @opindex Wno-missing-braces
3353 Warn if an aggregate or union initializer is not fully bracketed.  In
3354 the following example, the initializer for @samp{a} is not fully
3355 bracketed, but that for @samp{b} is fully bracketed.
3357 @smallexample
3358 int a[2][2] = @{ 0, 1, 2, 3 @};
3359 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3360 @end smallexample
3362 This warning is enabled by @option{-Wall}.
3364 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3365 @opindex Wmissing-include-dirs
3366 @opindex Wno-missing-include-dirs
3367 Warn if a user-supplied include directory does not exist.
3369 @item -Wparentheses
3370 @opindex Wparentheses
3371 @opindex Wno-parentheses
3372 Warn if parentheses are omitted in certain contexts, such
3373 as when there is an assignment in a context where a truth value
3374 is expected, or when operators are nested whose precedence people
3375 often get confused about.
3377 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3378 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3379 interpretation from that of ordinary mathematical notation.
3381 Also warn about constructions where there may be confusion to which
3382 @code{if} statement an @code{else} branch belongs.  Here is an example of
3383 such a case:
3385 @smallexample
3386 @group
3388   if (a)
3389     if (b)
3390       foo ();
3391   else
3392     bar ();
3394 @end group
3395 @end smallexample
3397 In C/C++, every @code{else} branch belongs to the innermost possible
3398 @code{if} statement, which in this example is @code{if (b)}.  This is
3399 often not what the programmer expected, as illustrated in the above
3400 example by indentation the programmer chose.  When there is the
3401 potential for this confusion, GCC will issue a warning when this flag
3402 is specified.  To eliminate the warning, add explicit braces around
3403 the innermost @code{if} statement so there is no way the @code{else}
3404 could belong to the enclosing @code{if}.  The resulting code would
3405 look like this:
3407 @smallexample
3408 @group
3410   if (a)
3411     @{
3412       if (b)
3413         foo ();
3414       else
3415         bar ();
3416     @}
3418 @end group
3419 @end smallexample
3421 Also warn for dangerous uses of the
3422 ?: with omitted middle operand GNU extension. When the condition
3423 in the ?: operator is a boolean expression the omitted value will
3424 be always 1. Often the user expects it to be a value computed
3425 inside the conditional expression instead.
3427 This warning is enabled by @option{-Wall}.
3429 @item -Wsequence-point
3430 @opindex Wsequence-point
3431 @opindex Wno-sequence-point
3432 Warn about code that may have undefined semantics because of violations
3433 of sequence point rules in the C and C++ standards.
3435 The C and C++ standards defines the order in which expressions in a C/C++
3436 program are evaluated in terms of @dfn{sequence points}, which represent
3437 a partial ordering between the execution of parts of the program: those
3438 executed before the sequence point, and those executed after it.  These
3439 occur after the evaluation of a full expression (one which is not part
3440 of a larger expression), after the evaluation of the first operand of a
3441 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3442 function is called (but after the evaluation of its arguments and the
3443 expression denoting the called function), and in certain other places.
3444 Other than as expressed by the sequence point rules, the order of
3445 evaluation of subexpressions of an expression is not specified.  All
3446 these rules describe only a partial order rather than a total order,
3447 since, for example, if two functions are called within one expression
3448 with no sequence point between them, the order in which the functions
3449 are called is not specified.  However, the standards committee have
3450 ruled that function calls do not overlap.
3452 It is not specified when between sequence points modifications to the
3453 values of objects take effect.  Programs whose behavior depends on this
3454 have undefined behavior; the C and C++ standards specify that ``Between
3455 the previous and next sequence point an object shall have its stored
3456 value modified at most once by the evaluation of an expression.
3457 Furthermore, the prior value shall be read only to determine the value
3458 to be stored.''.  If a program breaks these rules, the results on any
3459 particular implementation are entirely unpredictable.
3461 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3462 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3463 diagnosed by this option, and it may give an occasional false positive
3464 result, but in general it has been found fairly effective at detecting
3465 this sort of problem in programs.
3467 The standard is worded confusingly, therefore there is some debate
3468 over the precise meaning of the sequence point rules in subtle cases.
3469 Links to discussions of the problem, including proposed formal
3470 definitions, may be found on the GCC readings page, at
3471 @uref{http://gcc.gnu.org/@/readings.html}.
3473 This warning is enabled by @option{-Wall} for C and C++.
3475 @item -Wreturn-type
3476 @opindex Wreturn-type
3477 @opindex Wno-return-type
3478 Warn whenever a function is defined with a return-type that defaults
3479 to @code{int}.  Also warn about any @code{return} statement with no
3480 return-value in a function whose return-type is not @code{void}
3481 (falling off the end of the function body is considered returning
3482 without a value), and about a @code{return} statement with an
3483 expression in a function whose return-type is @code{void}.
3485 For C++, a function without return type always produces a diagnostic
3486 message, even when @option{-Wno-return-type} is specified.  The only
3487 exceptions are @samp{main} and functions defined in system headers.
3489 This warning is enabled by @option{-Wall}.
3491 @item -Wswitch
3492 @opindex Wswitch
3493 @opindex Wno-switch
3494 Warn whenever a @code{switch} statement has an index of enumerated type
3495 and lacks a @code{case} for one or more of the named codes of that
3496 enumeration.  (The presence of a @code{default} label prevents this
3497 warning.)  @code{case} labels outside the enumeration range also
3498 provoke warnings when this option is used (even if there is a
3499 @code{default} label).
3500 This warning is enabled by @option{-Wall}.
3502 @item -Wswitch-default
3503 @opindex Wswitch-default
3504 @opindex Wno-switch-default
3505 Warn whenever a @code{switch} statement does not have a @code{default}
3506 case.
3508 @item -Wswitch-enum
3509 @opindex Wswitch-enum
3510 @opindex Wno-switch-enum
3511 Warn whenever a @code{switch} statement has an index of enumerated type
3512 and lacks a @code{case} for one or more of the named codes of that
3513 enumeration.  @code{case} labels outside the enumeration range also
3514 provoke warnings when this option is used.  The only difference
3515 between @option{-Wswitch} and this option is that this option gives a
3516 warning about an omitted enumeration code even if there is a
3517 @code{default} label.
3519 @item -Wsync-nand @r{(C and C++ only)}
3520 @opindex Wsync-nand
3521 @opindex Wno-sync-nand
3522 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3523 built-in functions are used.  These functions changed semantics in GCC 4.4.
3525 @item -Wtrigraphs
3526 @opindex Wtrigraphs
3527 @opindex Wno-trigraphs
3528 Warn if any trigraphs are encountered that might change the meaning of
3529 the program (trigraphs within comments are not warned about).
3530 This warning is enabled by @option{-Wall}.
3532 @item -Wunused-but-set-parameter
3533 @opindex Wunused-but-set-parameter
3534 @opindex Wno-unused-but-set-parameter
3535 Warn whenever a function parameter is assigned to, but otherwise unused
3536 (aside from its declaration).
3538 To suppress this warning use the @samp{unused} attribute
3539 (@pxref{Variable Attributes}).
3541 This warning is also enabled by @option{-Wunused} together with
3542 @option{-Wextra}.
3544 @item -Wunused-but-set-variable
3545 @opindex Wunused-but-set-variable
3546 @opindex Wno-unused-but-set-variable
3547 Warn whenever a local variable is assigned to, but otherwise unused
3548 (aside from its declaration).
3549 This warning is enabled by @option{-Wall}.
3551 To suppress this warning use the @samp{unused} attribute
3552 (@pxref{Variable Attributes}).
3554 This warning is also enabled by @option{-Wunused}, which is enabled
3555 by @option{-Wall}.
3557 @item -Wunused-function
3558 @opindex Wunused-function
3559 @opindex Wno-unused-function
3560 Warn whenever a static function is declared but not defined or a
3561 non-inline static function is unused.
3562 This warning is enabled by @option{-Wall}.
3564 @item -Wunused-label
3565 @opindex Wunused-label
3566 @opindex Wno-unused-label
3567 Warn whenever a label is declared but not used.
3568 This warning is enabled by @option{-Wall}.
3570 To suppress this warning use the @samp{unused} attribute
3571 (@pxref{Variable Attributes}).
3573 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
3574 @opindex Wunused-local-typedefs
3575 Warn when a typedef locally defined in a function is not used.
3577 @item -Wunused-parameter
3578 @opindex Wunused-parameter
3579 @opindex Wno-unused-parameter
3580 Warn whenever a function parameter is unused aside from its declaration.
3582 To suppress this warning use the @samp{unused} attribute
3583 (@pxref{Variable Attributes}).
3585 @item -Wno-unused-result
3586 @opindex Wunused-result
3587 @opindex Wno-unused-result
3588 Do not warn if a caller of a function marked with attribute
3589 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
3590 its return value. The default is @option{-Wunused-result}.
3592 @item -Wunused-variable
3593 @opindex Wunused-variable
3594 @opindex Wno-unused-variable
3595 Warn whenever a local variable or non-constant static variable is unused
3596 aside from its declaration.
3597 This warning is enabled by @option{-Wall}.
3599 To suppress this warning use the @samp{unused} attribute
3600 (@pxref{Variable Attributes}).
3602 @item -Wunused-value
3603 @opindex Wunused-value
3604 @opindex Wno-unused-value
3605 Warn whenever a statement computes a result that is explicitly not
3606 used. To suppress this warning cast the unused expression to
3607 @samp{void}. This includes an expression-statement or the left-hand
3608 side of a comma expression that contains no side effects. For example,
3609 an expression such as @samp{x[i,j]} will cause a warning, while
3610 @samp{x[(void)i,j]} will not.
3612 This warning is enabled by @option{-Wall}.
3614 @item -Wunused
3615 @opindex Wunused
3616 @opindex Wno-unused
3617 All the above @option{-Wunused} options combined.
3619 In order to get a warning about an unused function parameter, you must
3620 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
3621 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
3623 @item -Wuninitialized
3624 @opindex Wuninitialized
3625 @opindex Wno-uninitialized
3626 Warn if an automatic variable is used without first being initialized
3627 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3628 warn if a non-static reference or non-static @samp{const} member
3629 appears in a class without constructors.
3631 If you want to warn about code that uses the uninitialized value of the
3632 variable in its own initializer, use the @option{-Winit-self} option.
3634 These warnings occur for individual uninitialized or clobbered
3635 elements of structure, union or array variables as well as for
3636 variables that are uninitialized or clobbered as a whole.  They do
3637 not occur for variables or elements declared @code{volatile}.  Because
3638 these warnings depend on optimization, the exact variables or elements
3639 for which there are warnings will depend on the precise optimization
3640 options and version of GCC used.
3642 Note that there may be no warning about a variable that is used only
3643 to compute a value that itself is never used, because such
3644 computations may be deleted by data flow analysis before the warnings
3645 are printed.
3647 @item -Wmaybe-uninitialized
3648 @opindex Wmaybe-uninitialized
3649 @opindex Wno-maybe-uninitialized
3650 For an automatic variable, if there exists a path from the function
3651 entry to a use of the variable that is initialized, but there exist
3652 some other paths the variable is not initialized, the compiler will
3653 emit a warning if it can not prove the uninitialized paths do not
3654 happen at run time. These warnings are made optional because GCC is
3655 not smart enough to see all the reasons why the code might be correct
3656 despite appearing to have an error.  Here is one example of how
3657 this can happen:
3659 @smallexample
3660 @group
3662   int x;
3663   switch (y)
3664     @{
3665     case 1: x = 1;
3666       break;
3667     case 2: x = 4;
3668       break;
3669     case 3: x = 5;
3670     @}
3671   foo (x);
3673 @end group
3674 @end smallexample
3676 @noindent
3677 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3678 always initialized, but GCC doesn't know this. To suppress the
3679 warning, the user needs to provide a default case with assert(0) or
3680 similar code.
3682 @cindex @code{longjmp} warnings
3683 This option also warns when a non-volatile automatic variable might be
3684 changed by a call to @code{longjmp}.  These warnings as well are possible
3685 only in optimizing compilation.
3687 The compiler sees only the calls to @code{setjmp}.  It cannot know
3688 where @code{longjmp} will be called; in fact, a signal handler could
3689 call it at any point in the code.  As a result, you may get a warning
3690 even when there is in fact no problem because @code{longjmp} cannot
3691 in fact be called at the place that would cause a problem.
3693 Some spurious warnings can be avoided if you declare all the functions
3694 you use that never return as @code{noreturn}.  @xref{Function
3695 Attributes}.
3697 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3699 @item -Wunknown-pragmas
3700 @opindex Wunknown-pragmas
3701 @opindex Wno-unknown-pragmas
3702 @cindex warning for unknown pragmas
3703 @cindex unknown pragmas, warning
3704 @cindex pragmas, warning of unknown
3705 Warn when a @code{#pragma} directive is encountered that is not understood by 
3706 GCC@.  If this command-line option is used, warnings will even be issued
3707 for unknown pragmas in system header files.  This is not the case if
3708 the warnings were only enabled by the @option{-Wall} command-line option.
3710 @item -Wno-pragmas
3711 @opindex Wno-pragmas
3712 @opindex Wpragmas
3713 Do not warn about misuses of pragmas, such as incorrect parameters,
3714 invalid syntax, or conflicts between pragmas.  See also
3715 @samp{-Wunknown-pragmas}.
3717 @item -Wstrict-aliasing
3718 @opindex Wstrict-aliasing
3719 @opindex Wno-strict-aliasing
3720 This option is only active when @option{-fstrict-aliasing} is active.
3721 It warns about code that might break the strict aliasing rules that the
3722 compiler is using for optimization.  The warning does not catch all
3723 cases, but does attempt to catch the more common pitfalls.  It is
3724 included in @option{-Wall}.
3725 It is equivalent to @option{-Wstrict-aliasing=3}
3727 @item -Wstrict-aliasing=n
3728 @opindex Wstrict-aliasing=n
3729 @opindex Wno-strict-aliasing=n
3730 This option is only active when @option{-fstrict-aliasing} is active.
3731 It warns about code that might break the strict aliasing rules that the
3732 compiler is using for optimization.
3733 Higher levels correspond to higher accuracy (fewer false positives).
3734 Higher levels also correspond to more effort, similar to the way -O works.
3735 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3736 with n=3.
3738 Level 1: Most aggressive, quick, least accurate.
3739 Possibly useful when higher levels
3740 do not warn but -fstrict-aliasing still breaks the code, as it has very few
3741 false negatives.  However, it has many false positives.
3742 Warns for all pointer conversions between possibly incompatible types,
3743 even if never dereferenced.  Runs in the front end only.
3745 Level 2: Aggressive, quick, not too precise.
3746 May still have many false positives (not as many as level 1 though),
3747 and few false negatives (but possibly more than level 1).
3748 Unlike level 1, it only warns when an address is taken.  Warns about
3749 incomplete types.  Runs in the front end only.
3751 Level 3 (default for @option{-Wstrict-aliasing}):
3752 Should have very few false positives and few false
3753 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3754 Takes care of the common pun+dereference pattern in the front end:
3755 @code{*(int*)&some_float}.
3756 If optimization is enabled, it also runs in the back end, where it deals
3757 with multiple statement cases using flow-sensitive points-to information.
3758 Only warns when the converted pointer is dereferenced.
3759 Does not warn about incomplete types.
3761 @item -Wstrict-overflow
3762 @itemx -Wstrict-overflow=@var{n}
3763 @opindex Wstrict-overflow
3764 @opindex Wno-strict-overflow
3765 This option is only active when @option{-fstrict-overflow} is active.
3766 It warns about cases where the compiler optimizes based on the
3767 assumption that signed overflow does not occur.  Note that it does not
3768 warn about all cases where the code might overflow: it only warns
3769 about cases where the compiler implements some optimization.  Thus
3770 this warning depends on the optimization level.
3772 An optimization that assumes that signed overflow does not occur is
3773 perfectly safe if the values of the variables involved are such that
3774 overflow never does, in fact, occur.  Therefore this warning can
3775 easily give a false positive: a warning about code that is not
3776 actually a problem.  To help focus on important issues, several
3777 warning levels are defined.  No warnings are issued for the use of
3778 undefined signed overflow when estimating how many iterations a loop
3779 will require, in particular when determining whether a loop will be
3780 executed at all.
3782 @table @gcctabopt
3783 @item -Wstrict-overflow=1
3784 Warn about cases that are both questionable and easy to avoid.  For
3785 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3786 compiler will simplify this to @code{1}.  This level of
3787 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3788 are not, and must be explicitly requested.
3790 @item -Wstrict-overflow=2
3791 Also warn about other cases where a comparison is simplified to a
3792 constant.  For example: @code{abs (x) >= 0}.  This can only be
3793 simplified when @option{-fstrict-overflow} is in effect, because
3794 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3795 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3796 @option{-Wstrict-overflow=2}.
3798 @item -Wstrict-overflow=3
3799 Also warn about other cases where a comparison is simplified.  For
3800 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3802 @item -Wstrict-overflow=4
3803 Also warn about other simplifications not covered by the above cases.
3804 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3806 @item -Wstrict-overflow=5
3807 Also warn about cases where the compiler reduces the magnitude of a
3808 constant involved in a comparison.  For example: @code{x + 2 > y} will
3809 be simplified to @code{x + 1 >= y}.  This is reported only at the
3810 highest warning level because this simplification applies to many
3811 comparisons, so this warning level will give a very large number of
3812 false positives.
3813 @end table
3815 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{]}
3816 @opindex Wsuggest-attribute=
3817 @opindex Wno-suggest-attribute=
3818 Warn for cases where adding an attribute may be beneficial. The
3819 attributes currently supported are listed below.
3821 @table @gcctabopt
3822 @item -Wsuggest-attribute=pure
3823 @itemx -Wsuggest-attribute=const
3824 @itemx -Wsuggest-attribute=noreturn
3825 @opindex Wsuggest-attribute=pure
3826 @opindex Wno-suggest-attribute=pure
3827 @opindex Wsuggest-attribute=const
3828 @opindex Wno-suggest-attribute=const
3829 @opindex Wsuggest-attribute=noreturn
3830 @opindex Wno-suggest-attribute=noreturn
3832 Warn about functions that might be candidates for attributes
3833 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
3834 functions visible in other compilation units or (in the case of @code{pure} and
3835 @code{const}) if it cannot prove that the function returns normally. A function
3836 returns normally if it doesn't contain an infinite loop nor returns abnormally
3837 by throwing, calling @code{abort()} or trapping.  This analysis requires option
3838 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
3839 higher.  Higher optimization levels improve the accuracy of the analysis.
3840 @end table
3842 @item -Warray-bounds
3843 @opindex Wno-array-bounds
3844 @opindex Warray-bounds
3845 This option is only active when @option{-ftree-vrp} is active
3846 (default for @option{-O2} and above). It warns about subscripts to arrays
3847 that are always out of bounds. This warning is enabled by @option{-Wall}.
3849 @item -Wno-div-by-zero
3850 @opindex Wno-div-by-zero
3851 @opindex Wdiv-by-zero
3852 Do not warn about compile-time integer division by zero.  Floating-point
3853 division by zero is not warned about, as it can be a legitimate way of
3854 obtaining infinities and NaNs.
3856 @item -Wsystem-headers
3857 @opindex Wsystem-headers
3858 @opindex Wno-system-headers
3859 @cindex warnings from system headers
3860 @cindex system headers, warnings from
3861 Print warning messages for constructs found in system header files.
3862 Warnings from system headers are normally suppressed, on the assumption
3863 that they usually do not indicate real problems and would only make the
3864 compiler output harder to read.  Using this command-line option tells
3865 GCC to emit warnings from system headers as if they occurred in user
3866 code.  However, note that using @option{-Wall} in conjunction with this
3867 option will @emph{not} warn about unknown pragmas in system
3868 headers---for that, @option{-Wunknown-pragmas} must also be used.
3870 @item -Wtrampolines
3871 @opindex Wtrampolines
3872 @opindex Wno-trampolines
3873  Warn about trampolines generated for pointers to nested functions.
3875  A trampoline is a small piece of data or code that is created at run
3876  time on the stack when the address of a nested function is taken, and
3877  is used to call the nested function indirectly.  For some targets, it
3878  is made up of data only and thus requires no special treatment.  But,
3879  for most targets, it is made up of code and thus requires the stack
3880  to be made executable in order for the program to work properly.
3882 @item -Wfloat-equal
3883 @opindex Wfloat-equal
3884 @opindex Wno-float-equal
3885 Warn if floating-point values are used in equality comparisons.
3887 The idea behind this is that sometimes it is convenient (for the
3888 programmer) to consider floating-point values as approximations to
3889 infinitely precise real numbers.  If you are doing this, then you need
3890 to compute (by analyzing the code, or in some other way) the maximum or
3891 likely maximum error that the computation introduces, and allow for it
3892 when performing comparisons (and when producing output, but that's a
3893 different problem).  In particular, instead of testing for equality, you
3894 would check to see whether the two values have ranges that overlap; and
3895 this is done with the relational operators, so equality comparisons are
3896 probably mistaken.
3898 @item -Wtraditional @r{(C and Objective-C only)}
3899 @opindex Wtraditional
3900 @opindex Wno-traditional
3901 Warn about certain constructs that behave differently in traditional and
3902 ISO C@.  Also warn about ISO C constructs that have no traditional C
3903 equivalent, and/or problematic constructs that should be avoided.
3905 @itemize @bullet
3906 @item
3907 Macro parameters that appear within string literals in the macro body.
3908 In traditional C macro replacement takes place within string literals,
3909 but does not in ISO C@.
3911 @item
3912 In traditional C, some preprocessor directives did not exist.
3913 Traditional preprocessors would only consider a line to be a directive
3914 if the @samp{#} appeared in column 1 on the line.  Therefore
3915 @option{-Wtraditional} warns about directives that traditional C
3916 understands but would ignore because the @samp{#} does not appear as the
3917 first character on the line.  It also suggests you hide directives like
3918 @samp{#pragma} not understood by traditional C by indenting them.  Some
3919 traditional implementations would not recognize @samp{#elif}, so it
3920 suggests avoiding it altogether.
3922 @item
3923 A function-like macro that appears without arguments.
3925 @item
3926 The unary plus operator.
3928 @item
3929 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
3930 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3931 constants.)  Note, these suffixes appear in macros defined in the system
3932 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3933 Use of these macros in user code might normally lead to spurious
3934 warnings, however GCC's integrated preprocessor has enough context to
3935 avoid warning in these cases.
3937 @item
3938 A function declared external in one block and then used after the end of
3939 the block.
3941 @item
3942 A @code{switch} statement has an operand of type @code{long}.
3944 @item
3945 A non-@code{static} function declaration follows a @code{static} one.
3946 This construct is not accepted by some traditional C compilers.
3948 @item
3949 The ISO type of an integer constant has a different width or
3950 signedness from its traditional type.  This warning is only issued if
3951 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3952 typically represent bit patterns, are not warned about.
3954 @item
3955 Usage of ISO string concatenation is detected.
3957 @item
3958 Initialization of automatic aggregates.
3960 @item
3961 Identifier conflicts with labels.  Traditional C lacks a separate
3962 namespace for labels.
3964 @item
3965 Initialization of unions.  If the initializer is zero, the warning is
3966 omitted.  This is done under the assumption that the zero initializer in
3967 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3968 initializer warnings and relies on default initialization to zero in the
3969 traditional C case.
3971 @item
3972 Conversions by prototypes between fixed/floating-point values and vice
3973 versa.  The absence of these prototypes when compiling with traditional
3974 C would cause serious problems.  This is a subset of the possible
3975 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3977 @item
3978 Use of ISO C style function definitions.  This warning intentionally is
3979 @emph{not} issued for prototype declarations or variadic functions
3980 because these ISO C features will appear in your code when using
3981 libiberty's traditional C compatibility macros, @code{PARAMS} and
3982 @code{VPARAMS}.  This warning is also bypassed for nested functions
3983 because that feature is already a GCC extension and thus not relevant to
3984 traditional C compatibility.
3985 @end itemize
3987 @item -Wtraditional-conversion @r{(C and Objective-C only)}
3988 @opindex Wtraditional-conversion
3989 @opindex Wno-traditional-conversion
3990 Warn if a prototype causes a type conversion that is different from what
3991 would happen to the same argument in the absence of a prototype.  This
3992 includes conversions of fixed point to floating and vice versa, and
3993 conversions changing the width or signedness of a fixed-point argument
3994 except when the same as the default promotion.
3996 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
3997 @opindex Wdeclaration-after-statement
3998 @opindex Wno-declaration-after-statement
3999 Warn when a declaration is found after a statement in a block.  This
4000 construct, known from C++, was introduced with ISO C99 and is by default
4001 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
4002 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
4004 @item -Wundef
4005 @opindex Wundef
4006 @opindex Wno-undef
4007 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
4009 @item -Wno-endif-labels
4010 @opindex Wno-endif-labels
4011 @opindex Wendif-labels
4012 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
4014 @item -Wshadow
4015 @opindex Wshadow
4016 @opindex Wno-shadow
4017 Warn whenever a local variable or type declaration shadows another variable,
4018 parameter, type, or class member (in C++), or whenever a built-in function
4019 is shadowed. Note that in C++, the compiler will not warn if a local variable
4020 shadows a struct/class/enum, but will warn if it shadows an explicit typedef.
4022 @item -Wlarger-than=@var{len}
4023 @opindex Wlarger-than=@var{len}
4024 @opindex Wlarger-than-@var{len}
4025 Warn whenever an object of larger than @var{len} bytes is defined.
4027 @item -Wframe-larger-than=@var{len}
4028 @opindex Wframe-larger-than
4029 Warn if the size of a function frame is larger than @var{len} bytes.
4030 The computation done to determine the stack frame size is approximate
4031 and not conservative.
4032 The actual requirements may be somewhat greater than @var{len}
4033 even if you do not get a warning.  In addition, any space allocated
4034 via @code{alloca}, variable-length arrays, or related constructs
4035 is not included by the compiler when determining
4036 whether or not to issue a warning.
4038 @item -Wno-free-nonheap-object
4039 @opindex Wno-free-nonheap-object
4040 @opindex Wfree-nonheap-object
4041 Do not warn when attempting to free an object that was not allocated
4042 on the heap.
4044 @item -Wstack-usage=@var{len}
4045 @opindex Wstack-usage
4046 Warn if the stack usage of a function might be larger than @var{len} bytes.
4047 The computation done to determine the stack usage is conservative.
4048 Any space allocated via @code{alloca}, variable-length arrays, or related
4049 constructs is included by the compiler when determining whether or not to
4050 issue a warning.
4052 The message is in keeping with the output of @option{-fstack-usage}.
4054 @itemize
4055 @item
4056 If the stack usage is fully static but exceeds the specified amount, it's:
4058 @smallexample
4059   warning: stack usage is 1120 bytes
4060 @end smallexample
4061 @item
4062 If the stack usage is (partly) dynamic but bounded, it's:
4064 @smallexample
4065   warning: stack usage might be 1648 bytes
4066 @end smallexample
4067 @item
4068 If the stack usage is (partly) dynamic and not bounded, it's:
4070 @smallexample
4071   warning: stack usage might be unbounded
4072 @end smallexample
4073 @end itemize
4075 @item -Wunsafe-loop-optimizations
4076 @opindex Wunsafe-loop-optimizations
4077 @opindex Wno-unsafe-loop-optimizations
4078 Warn if the loop cannot be optimized because the compiler could not
4079 assume anything on the bounds of the loop indices.  With
4080 @option{-funsafe-loop-optimizations} warn if the compiler made
4081 such assumptions.
4083 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
4084 @opindex Wno-pedantic-ms-format
4085 @opindex Wpedantic-ms-format
4086 Disables the warnings about non-ISO @code{printf} / @code{scanf} format
4087 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets
4088 depending on the MS runtime, when you are using the options @option{-Wformat}
4089 and @option{-pedantic} without gnu-extensions.
4091 @item -Wpointer-arith
4092 @opindex Wpointer-arith
4093 @opindex Wno-pointer-arith
4094 Warn about anything that depends on the ``size of'' a function type or
4095 of @code{void}.  GNU C assigns these types a size of 1, for
4096 convenience in calculations with @code{void *} pointers and pointers
4097 to functions.  In C++, warn also when an arithmetic operation involves
4098 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
4100 @item -Wtype-limits
4101 @opindex Wtype-limits
4102 @opindex Wno-type-limits
4103 Warn if a comparison is always true or always false due to the limited
4104 range of the data type, but do not warn for constant expressions.  For
4105 example, warn if an unsigned variable is compared against zero with
4106 @samp{<} or @samp{>=}.  This warning is also enabled by
4107 @option{-Wextra}.
4109 @item -Wbad-function-cast @r{(C and Objective-C only)}
4110 @opindex Wbad-function-cast
4111 @opindex Wno-bad-function-cast
4112 Warn whenever a function call is cast to a non-matching type.
4113 For example, warn if @code{int malloc()} is cast to @code{anything *}.
4115 @item -Wc++-compat @r{(C and Objective-C only)}
4116 Warn about ISO C constructs that are outside of the common subset of
4117 ISO C and ISO C++, e.g.@: request for implicit conversion from
4118 @code{void *} to a pointer to non-@code{void} type.
4120 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
4121 Warn about C++ constructs whose meaning differs between ISO C++ 1998
4122 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
4123 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
4124 enabled by @option{-Wall}.
4126 @item -Wcast-qual
4127 @opindex Wcast-qual
4128 @opindex Wno-cast-qual
4129 Warn whenever a pointer is cast so as to remove a type qualifier from
4130 the target type.  For example, warn if a @code{const char *} is cast
4131 to an ordinary @code{char *}.
4133 Also warn when making a cast that introduces a type qualifier in an
4134 unsafe way.  For example, casting @code{char **} to @code{const char **}
4135 is unsafe, as in this example:
4137 @smallexample
4138   /* p is char ** value.  */
4139   const char **q = (const char **) p;
4140   /* Assignment of readonly string to const char * is OK.  */
4141   *q = "string";
4142   /* Now char** pointer points to read-only memory.  */
4143   **p = 'b';
4144 @end smallexample
4146 @item -Wcast-align
4147 @opindex Wcast-align
4148 @opindex Wno-cast-align
4149 Warn whenever a pointer is cast such that the required alignment of the
4150 target is increased.  For example, warn if a @code{char *} is cast to
4151 an @code{int *} on machines where integers can only be accessed at
4152 two- or four-byte boundaries.
4154 @item -Wwrite-strings
4155 @opindex Wwrite-strings
4156 @opindex Wno-write-strings
4157 When compiling C, give string constants the type @code{const
4158 char[@var{length}]} so that copying the address of one into a
4159 non-@code{const} @code{char *} pointer will get a warning.  These
4160 warnings will help you find at compile time code that can try to write
4161 into a string constant, but only if you have been very careful about
4162 using @code{const} in declarations and prototypes.  Otherwise, it will
4163 just be a nuisance. This is why we did not make @option{-Wall} request
4164 these warnings.
4166 When compiling C++, warn about the deprecated conversion from string
4167 literals to @code{char *}.  This warning is enabled by default for C++
4168 programs.
4170 @item -Wclobbered
4171 @opindex Wclobbered
4172 @opindex Wno-clobbered
4173 Warn for variables that might be changed by @samp{longjmp} or
4174 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
4176 @item -Wconversion
4177 @opindex Wconversion
4178 @opindex Wno-conversion
4179 Warn for implicit conversions that may alter a value. This includes
4180 conversions between real and integer, like @code{abs (x)} when
4181 @code{x} is @code{double}; conversions between signed and unsigned,
4182 like @code{unsigned ui = -1}; and conversions to smaller types, like
4183 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4184 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4185 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4186 conversions between signed and unsigned integers can be disabled by
4187 using @option{-Wno-sign-conversion}.
4189 For C++, also warn for confusing overload resolution for user-defined
4190 conversions; and conversions that will never use a type conversion
4191 operator: conversions to @code{void}, the same type, a base class or a
4192 reference to them. Warnings about conversions between signed and
4193 unsigned integers are disabled by default in C++ unless
4194 @option{-Wsign-conversion} is explicitly enabled.
4196 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4197 @opindex Wconversion-null
4198 @opindex Wno-conversion-null
4199 Do not warn for conversions between @code{NULL} and non-pointer
4200 types. @option{-Wconversion-null} is enabled by default.
4202 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
4203 @opindex Wzero-as-null-pointer-constant
4204 @opindex Wno-zero-as-null-pointer-constant
4205 Warn when a literal '0' is used as null pointer constant.  This can
4206 be useful to facilitate the conversion to @code{nullptr} in C++11.
4208 @item -Wempty-body
4209 @opindex Wempty-body
4210 @opindex Wno-empty-body
4211 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4212 while} statement.  This warning is also enabled by @option{-Wextra}.
4214 @item -Wenum-compare
4215 @opindex Wenum-compare
4216 @opindex Wno-enum-compare
4217 Warn about a comparison between values of different enumerated types. In C++
4218 this warning is enabled by default.  In C this warning is enabled by
4219 @option{-Wall}.
4221 @item -Wjump-misses-init @r{(C, Objective-C only)}
4222 @opindex Wjump-misses-init
4223 @opindex Wno-jump-misses-init
4224 Warn if a @code{goto} statement or a @code{switch} statement jumps
4225 forward across the initialization of a variable, or jumps backward to a
4226 label after the variable has been initialized.  This only warns about
4227 variables that are initialized when they are declared.  This warning is
4228 only supported for C and Objective-C; in C++ this sort of branch is an
4229 error in any case.
4231 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4232 can be disabled with the @option{-Wno-jump-misses-init} option.
4234 @item -Wsign-compare
4235 @opindex Wsign-compare
4236 @opindex Wno-sign-compare
4237 @cindex warning for comparison of signed and unsigned values
4238 @cindex comparison of signed and unsigned values, warning
4239 @cindex signed and unsigned values, comparison warning
4240 Warn when a comparison between signed and unsigned values could produce
4241 an incorrect result when the signed value is converted to unsigned.
4242 This warning is also enabled by @option{-Wextra}; to get the other warnings
4243 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
4245 @item -Wsign-conversion
4246 @opindex Wsign-conversion
4247 @opindex Wno-sign-conversion
4248 Warn for implicit conversions that may change the sign of an integer
4249 value, like assigning a signed integer expression to an unsigned
4250 integer variable. An explicit cast silences the warning. In C, this
4251 option is enabled also by @option{-Wconversion}.
4253 @item -Waddress
4254 @opindex Waddress
4255 @opindex Wno-address
4256 Warn about suspicious uses of memory addresses. These include using
4257 the address of a function in a conditional expression, such as
4258 @code{void func(void); if (func)}, and comparisons against the memory
4259 address of a string literal, such as @code{if (x == "abc")}.  Such
4260 uses typically indicate a programmer error: the address of a function
4261 always evaluates to true, so their use in a conditional usually
4262 indicate that the programmer forgot the parentheses in a function
4263 call; and comparisons against string literals result in unspecified
4264 behavior and are not portable in C, so they usually indicate that the
4265 programmer intended to use @code{strcmp}.  This warning is enabled by
4266 @option{-Wall}.
4268 @item -Wlogical-op
4269 @opindex Wlogical-op
4270 @opindex Wno-logical-op
4271 Warn about suspicious uses of logical operators in expressions.
4272 This includes using logical operators in contexts where a
4273 bit-wise operator is likely to be expected.
4275 @item -Waggregate-return
4276 @opindex Waggregate-return
4277 @opindex Wno-aggregate-return
4278 Warn if any functions that return structures or unions are defined or
4279 called.  (In languages where you can return an array, this also elicits
4280 a warning.)
4282 @item -Wno-attributes
4283 @opindex Wno-attributes
4284 @opindex Wattributes
4285 Do not warn if an unexpected @code{__attribute__} is used, such as
4286 unrecognized attributes, function attributes applied to variables,
4287 etc.  This will not stop errors for incorrect use of supported
4288 attributes.
4290 @item -Wno-builtin-macro-redefined
4291 @opindex Wno-builtin-macro-redefined
4292 @opindex Wbuiltin-macro-redefined
4293 Do not warn if certain built-in macros are redefined.  This suppresses
4294 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4295 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4297 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4298 @opindex Wstrict-prototypes
4299 @opindex Wno-strict-prototypes
4300 Warn if a function is declared or defined without specifying the
4301 argument types.  (An old-style function definition is permitted without
4302 a warning if preceded by a declaration that specifies the argument
4303 types.)
4305 @item -Wold-style-declaration @r{(C and Objective-C only)}
4306 @opindex Wold-style-declaration
4307 @opindex Wno-old-style-declaration
4308 Warn for obsolescent usages, according to the C Standard, in a
4309 declaration. For example, warn if storage-class specifiers like
4310 @code{static} are not the first things in a declaration.  This warning
4311 is also enabled by @option{-Wextra}.
4313 @item -Wold-style-definition @r{(C and Objective-C only)}
4314 @opindex Wold-style-definition
4315 @opindex Wno-old-style-definition
4316 Warn if an old-style function definition is used.  A warning is given
4317 even if there is a previous prototype.
4319 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4320 @opindex Wmissing-parameter-type
4321 @opindex Wno-missing-parameter-type
4322 A function parameter is declared without a type specifier in K&R-style
4323 functions:
4325 @smallexample
4326 void foo(bar) @{ @}
4327 @end smallexample
4329 This warning is also enabled by @option{-Wextra}.
4331 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4332 @opindex Wmissing-prototypes
4333 @opindex Wno-missing-prototypes
4334 Warn if a global function is defined without a previous prototype
4335 declaration.  This warning is issued even if the definition itself
4336 provides a prototype.  The aim is to detect global functions that 
4337 are not declared in header files.
4339 @item -Wmissing-declarations
4340 @opindex Wmissing-declarations
4341 @opindex Wno-missing-declarations
4342 Warn if a global function is defined without a previous declaration.
4343 Do so even if the definition itself provides a prototype.
4344 Use this option to detect global functions that are not declared in
4345 header files.  In C++, no warnings are issued for function templates,
4346 or for inline functions, or for functions in anonymous namespaces.
4348 @item -Wmissing-field-initializers
4349 @opindex Wmissing-field-initializers
4350 @opindex Wno-missing-field-initializers
4351 @opindex W
4352 @opindex Wextra
4353 @opindex Wno-extra
4354 Warn if a structure's initializer has some fields missing.  For
4355 example, the following code would cause such a warning, because
4356 @code{x.h} is implicitly zero:
4358 @smallexample
4359 struct s @{ int f, g, h; @};
4360 struct s x = @{ 3, 4 @};
4361 @end smallexample
4363 This option does not warn about designated initializers, so the following
4364 modification would not trigger a warning:
4366 @smallexample
4367 struct s @{ int f, g, h; @};
4368 struct s x = @{ .f = 3, .g = 4 @};
4369 @end smallexample
4371 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4372 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
4374 @item -Wmissing-format-attribute
4375 @opindex Wmissing-format-attribute
4376 @opindex Wno-missing-format-attribute
4377 @opindex Wformat
4378 @opindex Wno-format
4379 Warn about function pointers that might be candidates for @code{format}
4380 attributes.  Note these are only possible candidates, not absolute ones.
4381 GCC will guess that function pointers with @code{format} attributes that
4382 are used in assignment, initialization, parameter passing or return
4383 statements should have a corresponding @code{format} attribute in the
4384 resulting type.  I.e.@: the left-hand side of the assignment or
4385 initialization, the type of the parameter variable, or the return type
4386 of the containing function respectively should also have a @code{format}
4387 attribute to avoid the warning.
4389 GCC will also warn about function definitions that might be
4390 candidates for @code{format} attributes.  Again, these are only
4391 possible candidates.  GCC will guess that @code{format} attributes
4392 might be appropriate for any function that calls a function like
4393 @code{vprintf} or @code{vscanf}, but this might not always be the
4394 case, and some functions for which @code{format} attributes are
4395 appropriate may not be detected.
4397 @item -Wno-multichar
4398 @opindex Wno-multichar
4399 @opindex Wmultichar
4400 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4401 Usually they indicate a typo in the user's code, as they have
4402 implementation-defined values, and should not be used in portable code.
4404 @item -Wnormalized=<none|id|nfc|nfkc>
4405 @opindex Wnormalized=
4406 @cindex NFC
4407 @cindex NFKC
4408 @cindex character set, input normalization
4409 In ISO C and ISO C++, two identifiers are different if they are
4410 different sequences of characters.  However, sometimes when characters
4411 outside the basic ASCII character set are used, you can have two
4412 different character sequences that look the same.  To avoid confusion,
4413 the ISO 10646 standard sets out some @dfn{normalization rules} which
4414 when applied ensure that two sequences that look the same are turned into
4415 the same sequence.  GCC can warn you if you are using identifiers that
4416 have not been normalized; this option controls that warning.
4418 There are four levels of warning supported by GCC.  The default is
4419 @option{-Wnormalized=nfc}, which warns about any identifier that is
4420 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4421 recommended form for most uses.
4423 Unfortunately, there are some characters allowed in identifiers by
4424 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
4425 identifiers.  That is, there's no way to use these symbols in portable
4426 ISO C or C++ and have all your identifiers in NFC@.
4427 @option{-Wnormalized=id} suppresses the warning for these characters.
4428 It is hoped that future versions of the standards involved will correct
4429 this, which is why this option is not the default.
4431 You can switch the warning off for all characters by writing
4432 @option{-Wnormalized=none}.  You would only want to do this if you
4433 were using some other normalization scheme (like ``D''), because
4434 otherwise you can easily create bugs that are literally impossible to see.
4436 Some characters in ISO 10646 have distinct meanings but look identical
4437 in some fonts or display methodologies, especially once formatting has
4438 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4439 LETTER N'', will display just like a regular @code{n} that has been
4440 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4441 normalization scheme to convert all these into a standard form as
4442 well, and GCC will warn if your code is not in NFKC if you use
4443 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4444 about every identifier that contains the letter O because it might be
4445 confused with the digit 0, and so is not the default, but may be
4446 useful as a local coding convention if the programming environment is
4447 unable to be fixed to display these characters distinctly.
4449 @item -Wno-deprecated
4450 @opindex Wno-deprecated
4451 @opindex Wdeprecated
4452 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4454 @item -Wno-deprecated-declarations
4455 @opindex Wno-deprecated-declarations
4456 @opindex Wdeprecated-declarations
4457 Do not warn about uses of functions (@pxref{Function Attributes}),
4458 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4459 Attributes}) marked as deprecated by using the @code{deprecated}
4460 attribute.
4462 @item -Wno-overflow
4463 @opindex Wno-overflow
4464 @opindex Woverflow
4465 Do not warn about compile-time overflow in constant expressions.
4467 @item -Woverride-init @r{(C and Objective-C only)}
4468 @opindex Woverride-init
4469 @opindex Wno-override-init
4470 @opindex W
4471 @opindex Wextra
4472 @opindex Wno-extra
4473 Warn if an initialized field without side effects is overridden when
4474 using designated initializers (@pxref{Designated Inits, , Designated
4475 Initializers}).
4477 This warning is included in @option{-Wextra}.  To get other
4478 @option{-Wextra} warnings without this one, use @samp{-Wextra
4479 -Wno-override-init}.
4481 @item -Wpacked
4482 @opindex Wpacked
4483 @opindex Wno-packed
4484 Warn if a structure is given the packed attribute, but the packed
4485 attribute has no effect on the layout or size of the structure.
4486 Such structures may be mis-aligned for little benefit.  For
4487 instance, in this code, the variable @code{f.x} in @code{struct bar}
4488 will be misaligned even though @code{struct bar} does not itself
4489 have the packed attribute:
4491 @smallexample
4492 @group
4493 struct foo @{
4494   int x;
4495   char a, b, c, d;
4496 @} __attribute__((packed));
4497 struct bar @{
4498   char z;
4499   struct foo f;
4501 @end group
4502 @end smallexample
4504 @item -Wpacked-bitfield-compat
4505 @opindex Wpacked-bitfield-compat
4506 @opindex Wno-packed-bitfield-compat
4507 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4508 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4509 the change can lead to differences in the structure layout.  GCC
4510 informs you when the offset of such a field has changed in GCC 4.4.
4511 For example there is no longer a 4-bit padding between field @code{a}
4512 and @code{b} in this structure:
4514 @smallexample
4515 struct foo
4517   char a:4;
4518   char b:8;
4519 @} __attribute__ ((packed));
4520 @end smallexample
4522 This warning is enabled by default.  Use
4523 @option{-Wno-packed-bitfield-compat} to disable this warning.
4525 @item -Wpadded
4526 @opindex Wpadded
4527 @opindex Wno-padded
4528 Warn if padding is included in a structure, either to align an element
4529 of the structure or to align the whole structure.  Sometimes when this
4530 happens it is possible to rearrange the fields of the structure to
4531 reduce the padding and so make the structure smaller.
4533 @item -Wredundant-decls
4534 @opindex Wredundant-decls
4535 @opindex Wno-redundant-decls
4536 Warn if anything is declared more than once in the same scope, even in
4537 cases where multiple declaration is valid and changes nothing.
4539 @item -Wnested-externs @r{(C and Objective-C only)}
4540 @opindex Wnested-externs
4541 @opindex Wno-nested-externs
4542 Warn if an @code{extern} declaration is encountered within a function.
4544 @item -Winline
4545 @opindex Winline
4546 @opindex Wno-inline
4547 Warn if a function can not be inlined and it was declared as inline.
4548 Even with this option, the compiler will not warn about failures to
4549 inline functions declared in system headers.
4551 The compiler uses a variety of heuristics to determine whether or not
4552 to inline a function.  For example, the compiler takes into account
4553 the size of the function being inlined and the amount of inlining
4554 that has already been done in the current function.  Therefore,
4555 seemingly insignificant changes in the source program can cause the
4556 warnings produced by @option{-Winline} to appear or disappear.
4558 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4559 @opindex Wno-invalid-offsetof
4560 @opindex Winvalid-offsetof
4561 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4562 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4563 to a non-POD type is undefined.  In existing C++ implementations,
4564 however, @samp{offsetof} typically gives meaningful results even when
4565 applied to certain kinds of non-POD types. (Such as a simple
4566 @samp{struct} that fails to be a POD type only by virtue of having a
4567 constructor.)  This flag is for users who are aware that they are
4568 writing nonportable code and who have deliberately chosen to ignore the
4569 warning about it.
4571 The restrictions on @samp{offsetof} may be relaxed in a future version
4572 of the C++ standard.
4574 @item -Wno-int-to-pointer-cast
4575 @opindex Wno-int-to-pointer-cast
4576 @opindex Wint-to-pointer-cast
4577 Suppress warnings from casts to pointer type of an integer of a
4578 different size. In C++, casting to a pointer type of smaller size is
4579 an error. @option{Wint-to-pointer-cast} is enabled by default.
4582 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4583 @opindex Wno-pointer-to-int-cast
4584 @opindex Wpointer-to-int-cast
4585 Suppress warnings from casts from a pointer to an integer type of a
4586 different size.
4588 @item -Winvalid-pch
4589 @opindex Winvalid-pch
4590 @opindex Wno-invalid-pch
4591 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4592 the search path but can't be used.
4594 @item -Wlong-long
4595 @opindex Wlong-long
4596 @opindex Wno-long-long
4597 Warn if @samp{long long} type is used.  This is enabled by either
4598 @option{-pedantic} or @option{-Wtraditional} in ISO C90 and C++98
4599 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
4601 @item -Wvariadic-macros
4602 @opindex Wvariadic-macros
4603 @opindex Wno-variadic-macros
4604 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4605 alternate syntax when in pedantic ISO C99 mode.  This is default.
4606 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4608 @item -Wvector-operation-performance
4609 @opindex Wvector-operation-performance
4610 @opindex Wno-vector-operation-performance
4611 Warn if vector operation is not implemented via SIMD capabilities of the
4612 architecture.  Mainly useful for the performance tuning.
4613 Vector operation can be implemented @code{piecewise}, which means that the
4614 scalar operation is performed on every vector element; 
4615 @code{in parallel}, which means that the vector operation is implemented
4616 using scalars of wider type, which normally is more performance efficient;
4617 and @code{as a single scalar}, which means that vector fits into a
4618 scalar type.
4620 @item -Wvla
4621 @opindex Wvla
4622 @opindex Wno-vla
4623 Warn if variable length array is used in the code.
4624 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
4625 the variable length array.
4627 @item -Wvolatile-register-var
4628 @opindex Wvolatile-register-var
4629 @opindex Wno-volatile-register-var
4630 Warn if a register variable is declared volatile.  The volatile
4631 modifier does not inhibit all optimizations that may eliminate reads
4632 and/or writes to register variables.  This warning is enabled by
4633 @option{-Wall}.
4635 @item -Wdisabled-optimization
4636 @opindex Wdisabled-optimization
4637 @opindex Wno-disabled-optimization
4638 Warn if a requested optimization pass is disabled.  This warning does
4639 not generally indicate that there is anything wrong with your code; it
4640 merely indicates that GCC's optimizers were unable to handle the code
4641 effectively.  Often, the problem is that your code is too big or too
4642 complex; GCC will refuse to optimize programs when the optimization
4643 itself is likely to take inordinate amounts of time.
4645 @item -Wpointer-sign @r{(C and Objective-C only)}
4646 @opindex Wpointer-sign
4647 @opindex Wno-pointer-sign
4648 Warn for pointer argument passing or assignment with different signedness.
4649 This option is only supported for C and Objective-C@.  It is implied by
4650 @option{-Wall} and by @option{-pedantic}, which can be disabled with
4651 @option{-Wno-pointer-sign}.
4653 @item -Wstack-protector
4654 @opindex Wstack-protector
4655 @opindex Wno-stack-protector
4656 This option is only active when @option{-fstack-protector} is active.  It
4657 warns about functions that will not be protected against stack smashing.
4659 @item -Wno-mudflap
4660 @opindex Wno-mudflap
4661 Suppress warnings about constructs that cannot be instrumented by
4662 @option{-fmudflap}.
4664 @item -Woverlength-strings
4665 @opindex Woverlength-strings
4666 @opindex Wno-overlength-strings
4667 Warn about string constants that are longer than the ``minimum
4668 maximum'' length specified in the C standard.  Modern compilers
4669 generally allow string constants that are much longer than the
4670 standard's minimum limit, but very portable programs should avoid
4671 using longer strings.
4673 The limit applies @emph{after} string constant concatenation, and does
4674 not count the trailing NUL@.  In C90, the limit was 509 characters; in
4675 C99, it was raised to 4095.  C++98 does not specify a normative
4676 minimum maximum, so we do not diagnose overlength strings in C++@.
4678 This option is implied by @option{-pedantic}, and can be disabled with
4679 @option{-Wno-overlength-strings}.
4681 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
4682 @opindex Wunsuffixed-float-constants
4684 GCC will issue a warning for any floating constant that does not have
4685 a suffix.  When used together with @option{-Wsystem-headers} it will
4686 warn about such constants in system header files.  This can be useful
4687 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
4688 from the decimal floating-point extension to C99.
4689 @end table
4691 @node Debugging Options
4692 @section Options for Debugging Your Program or GCC
4693 @cindex options, debugging
4694 @cindex debugging information options
4696 GCC has various special options that are used for debugging
4697 either your program or GCC:
4699 @table @gcctabopt
4700 @item -g
4701 @opindex g
4702 Produce debugging information in the operating system's native format
4703 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
4704 information.
4706 On most systems that use stabs format, @option{-g} enables use of extra
4707 debugging information that only GDB can use; this extra information
4708 makes debugging work better in GDB but will probably make other debuggers
4709 crash or
4710 refuse to read the program.  If you want to control for certain whether
4711 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
4712 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
4714 GCC allows you to use @option{-g} with
4715 @option{-O}.  The shortcuts taken by optimized code may occasionally
4716 produce surprising results: some variables you declared may not exist
4717 at all; flow of control may briefly move where you did not expect it;
4718 some statements may not be executed because they compute constant
4719 results or their values were already at hand; some statements may
4720 execute in different places because they were moved out of loops.
4722 Nevertheless it proves possible to debug optimized output.  This makes
4723 it reasonable to use the optimizer for programs that might have bugs.
4725 The following options are useful when GCC is generated with the
4726 capability for more than one debugging format.
4728 @item -ggdb
4729 @opindex ggdb
4730 Produce debugging information for use by GDB@.  This means to use the
4731 most expressive format available (DWARF 2, stabs, or the native format
4732 if neither of those are supported), including GDB extensions if at all
4733 possible.
4735 @item -gstabs
4736 @opindex gstabs
4737 Produce debugging information in stabs format (if that is supported),
4738 without GDB extensions.  This is the format used by DBX on most BSD
4739 systems.  On MIPS, Alpha and System V Release 4 systems this option
4740 produces stabs debugging output that is not understood by DBX or SDB@.
4741 On System V Release 4 systems this option requires the GNU assembler.
4743 @item -feliminate-unused-debug-symbols
4744 @opindex feliminate-unused-debug-symbols
4745 Produce debugging information in stabs format (if that is supported),
4746 for only symbols that are actually used.
4748 @item -femit-class-debug-always
4749 Instead of emitting debugging information for a C++ class in only one
4750 object file, emit it in all object files using the class.  This option
4751 should be used only with debuggers that are unable to handle the way GCC
4752 normally emits debugging information for classes because using this
4753 option will increase the size of debugging information by as much as a
4754 factor of two.
4756 @item -fno-debug-types-section
4757 @opindex fno-debug-types-section
4758 @opindex fdebug-types-section
4759 By default when using DWARF v4 or higher type DIEs will be put into
4760 their own .debug_types section instead of making them part of the
4761 .debug_info section.  It is more efficient to put them in a separate
4762 comdat sections since the linker will then be able to remove duplicates.
4763 But not all DWARF consumers support .debug_types sections yet.
4765 @item -gstabs+
4766 @opindex gstabs+
4767 Produce debugging information in stabs format (if that is supported),
4768 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4769 use of these extensions is likely to make other debuggers crash or
4770 refuse to read the program.
4772 @item -gcoff
4773 @opindex gcoff
4774 Produce debugging information in COFF format (if that is supported).
4775 This is the format used by SDB on most System V systems prior to
4776 System V Release 4.
4778 @item -gxcoff
4779 @opindex gxcoff
4780 Produce debugging information in XCOFF format (if that is supported).
4781 This is the format used by the DBX debugger on IBM RS/6000 systems.
4783 @item -gxcoff+
4784 @opindex gxcoff+
4785 Produce debugging information in XCOFF format (if that is supported),
4786 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4787 use of these extensions is likely to make other debuggers crash or
4788 refuse to read the program, and may cause assemblers other than the GNU
4789 assembler (GAS) to fail with an error.
4791 @item -gdwarf-@var{version}
4792 @opindex gdwarf-@var{version}
4793 Produce debugging information in DWARF format (if that is
4794 supported).  This is the format used by DBX on IRIX 6.  The value
4795 of @var{version} may be either 2, 3 or 4; the default version is 2.
4797 Note that with DWARF version 2 some ports require, and will always
4798 use, some non-conflicting DWARF 3 extensions in the unwind tables.
4800 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
4801 for maximum benefit.
4803 @item -grecord-gcc-switches
4804 @opindex grecord-gcc-switches
4805 This switch causes the command-line options used to invoke the
4806 compiler that may affect code generation to be appended to the
4807 DW_AT_producer attribute in DWARF debugging information.  The options
4808 are concatenated with spaces separating them from each other and from
4809 the compiler version.  See also @option{-frecord-gcc-switches} for another
4810 way of storing compiler options into the object file.
4812 @item -gno-record-gcc-switches
4813 @opindex gno-record-gcc-switches
4814 Disallow appending command-line options to the DW_AT_producer attribute
4815 in DWARF debugging information.  This is the default.
4817 @item -gstrict-dwarf
4818 @opindex gstrict-dwarf
4819 Disallow using extensions of later DWARF standard version than selected
4820 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
4821 DWARF extensions from later standard versions is allowed.
4823 @item -gno-strict-dwarf
4824 @opindex gno-strict-dwarf
4825 Allow using extensions of later DWARF standard version than selected with
4826 @option{-gdwarf-@var{version}}.
4828 @item -gvms
4829 @opindex gvms
4830 Produce debugging information in VMS debug format (if that is
4831 supported).  This is the format used by DEBUG on VMS systems.
4833 @item -g@var{level}
4834 @itemx -ggdb@var{level}
4835 @itemx -gstabs@var{level}
4836 @itemx -gcoff@var{level}
4837 @itemx -gxcoff@var{level}
4838 @itemx -gvms@var{level}
4839 Request debugging information and also use @var{level} to specify how
4840 much information.  The default level is 2.
4842 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4843 @option{-g}.
4845 Level 1 produces minimal information, enough for making backtraces in
4846 parts of the program that you don't plan to debug.  This includes
4847 descriptions of functions and external variables, but no information
4848 about local variables and no line numbers.
4850 Level 3 includes extra information, such as all the macro definitions
4851 present in the program.  Some debuggers support macro expansion when
4852 you use @option{-g3}.
4854 @option{-gdwarf-2} does not accept a concatenated debug level, because
4855 GCC used to support an option @option{-gdwarf} that meant to generate
4856 debug information in version 1 of the DWARF format (which is very
4857 different from version 2), and it would have been too confusing.  That
4858 debug format is long obsolete, but the option cannot be changed now.
4859 Instead use an additional @option{-g@var{level}} option to change the
4860 debug level for DWARF.
4862 @item -gtoggle
4863 @opindex gtoggle
4864 Turn off generation of debug info, if leaving out this option would have
4865 generated it, or turn it on at level 2 otherwise.  The position of this
4866 argument in the command line does not matter, it takes effect after all
4867 other options are processed, and it does so only once, no matter how
4868 many times it is given.  This is mainly intended to be used with
4869 @option{-fcompare-debug}.
4871 @item -fdump-final-insns@r{[}=@var{file}@r{]}
4872 @opindex fdump-final-insns
4873 Dump the final internal representation (RTL) to @var{file}.  If the
4874 optional argument is omitted (or if @var{file} is @code{.}), the name
4875 of the dump file will be determined by appending @code{.gkd} to the
4876 compilation output file name.
4878 @item -fcompare-debug@r{[}=@var{opts}@r{]}
4879 @opindex fcompare-debug
4880 @opindex fno-compare-debug
4881 If no error occurs during compilation, run the compiler a second time,
4882 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
4883 passed to the second compilation.  Dump the final internal
4884 representation in both compilations, and print an error if they differ.
4886 If the equal sign is omitted, the default @option{-gtoggle} is used.
4888 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
4889 and nonzero, implicitly enables @option{-fcompare-debug}.  If
4890 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
4891 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
4892 is used.
4894 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
4895 is equivalent to @option{-fno-compare-debug}, which disables the dumping
4896 of the final representation and the second compilation, preventing even
4897 @env{GCC_COMPARE_DEBUG} from taking effect.
4899 To verify full coverage during @option{-fcompare-debug} testing, set
4900 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
4901 which GCC will reject as an invalid option in any actual compilation
4902 (rather than preprocessing, assembly or linking).  To get just a
4903 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
4904 not overridden} will do.
4906 @item -fcompare-debug-second
4907 @opindex fcompare-debug-second
4908 This option is implicitly passed to the compiler for the second
4909 compilation requested by @option{-fcompare-debug}, along with options to
4910 silence warnings, and omitting other options that would cause
4911 side-effect compiler outputs to files or to the standard output.  Dump
4912 files and preserved temporary files are renamed so as to contain the
4913 @code{.gk} additional extension during the second compilation, to avoid
4914 overwriting those generated by the first.
4916 When this option is passed to the compiler driver, it causes the
4917 @emph{first} compilation to be skipped, which makes it useful for little
4918 other than debugging the compiler proper.
4920 @item -feliminate-dwarf2-dups
4921 @opindex feliminate-dwarf2-dups
4922 Compress DWARF2 debugging information by eliminating duplicated
4923 information about each symbol.  This option only makes sense when
4924 generating DWARF2 debugging information with @option{-gdwarf-2}.
4926 @item -femit-struct-debug-baseonly
4927 Emit debug information for struct-like types
4928 only when the base name of the compilation source file
4929 matches the base name of file in which the struct was defined.
4931 This option substantially reduces the size of debugging information,
4932 but at significant potential loss in type information to the debugger.
4933 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4934 See @option{-femit-struct-debug-detailed} for more detailed control.
4936 This option works only with DWARF 2.
4938 @item -femit-struct-debug-reduced
4939 Emit debug information for struct-like types
4940 only when the base name of the compilation source file
4941 matches the base name of file in which the type was defined,
4942 unless the struct is a template or defined in a system header.
4944 This option significantly reduces the size of debugging information,
4945 with some potential loss in type information to the debugger.
4946 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4947 See @option{-femit-struct-debug-detailed} for more detailed control.
4949 This option works only with DWARF 2.
4951 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4952 Specify the struct-like types
4953 for which the compiler will generate debug information.
4954 The intent is to reduce duplicate struct debug information
4955 between different object files within the same program.
4957 This option is a detailed version of
4958 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4959 which will serve for most needs.
4961 A specification has the syntax@*
4962 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4964 The optional first word limits the specification to
4965 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4966 A struct type is used directly when it is the type of a variable, member.
4967 Indirect uses arise through pointers to structs.
4968 That is, when use of an incomplete struct would be legal, the use is indirect.
4969 An example is
4970 @samp{struct one direct; struct two * indirect;}.
4972 The optional second word limits the specification to
4973 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
4974 Generic structs are a bit complicated to explain.
4975 For C++, these are non-explicit specializations of template classes,
4976 or non-template classes within the above.
4977 Other programming languages have generics,
4978 but @samp{-femit-struct-debug-detailed} does not yet implement them.
4980 The third word specifies the source files for those
4981 structs for which the compiler will emit debug information.
4982 The values @samp{none} and @samp{any} have the normal meaning.
4983 The value @samp{base} means that
4984 the base of name of the file in which the type declaration appears
4985 must match the base of the name of the main compilation file.
4986 In practice, this means that
4987 types declared in @file{foo.c} and @file{foo.h} will have debug information,
4988 but types declared in other header will not.
4989 The value @samp{sys} means those types satisfying @samp{base}
4990 or declared in system or compiler headers.
4992 You may need to experiment to determine the best settings for your application.
4994 The default is @samp{-femit-struct-debug-detailed=all}.
4996 This option works only with DWARF 2.
4998 @item -fno-merge-debug-strings
4999 @opindex fmerge-debug-strings
5000 @opindex fno-merge-debug-strings
5001 Direct the linker to not merge together strings in the debugging
5002 information that are identical in different object files.  Merging is
5003 not supported by all assemblers or linkers.  Merging decreases the size
5004 of the debug information in the output file at the cost of increasing
5005 link processing time.  Merging is enabled by default.
5007 @item -fdebug-prefix-map=@var{old}=@var{new}
5008 @opindex fdebug-prefix-map
5009 When compiling files in directory @file{@var{old}}, record debugging
5010 information describing them as in @file{@var{new}} instead.
5012 @item -fno-dwarf2-cfi-asm
5013 @opindex fdwarf2-cfi-asm
5014 @opindex fno-dwarf2-cfi-asm
5015 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
5016 instead of using GAS @code{.cfi_*} directives.
5018 @cindex @command{prof}
5019 @item -p
5020 @opindex p
5021 Generate extra code to write profile information suitable for the
5022 analysis program @command{prof}.  You must use this option when compiling
5023 the source files you want data about, and you must also use it when
5024 linking.
5026 @cindex @command{gprof}
5027 @item -pg
5028 @opindex pg
5029 Generate extra code to write profile information suitable for the
5030 analysis program @command{gprof}.  You must use this option when compiling
5031 the source files you want data about, and you must also use it when
5032 linking.
5034 @item -Q
5035 @opindex Q
5036 Makes the compiler print out each function name as it is compiled, and
5037 print some statistics about each pass when it finishes.
5039 @item -ftime-report
5040 @opindex ftime-report
5041 Makes the compiler print some statistics about the time consumed by each
5042 pass when it finishes.
5044 @item -fmem-report
5045 @opindex fmem-report
5046 Makes the compiler print some statistics about permanent memory
5047 allocation when it finishes.
5049 @item -fpre-ipa-mem-report
5050 @opindex fpre-ipa-mem-report
5051 @item -fpost-ipa-mem-report
5052 @opindex fpost-ipa-mem-report
5053 Makes the compiler print some statistics about permanent memory
5054 allocation before or after interprocedural optimization.
5056 @item -fstack-usage
5057 @opindex fstack-usage
5058 Makes the compiler output stack usage information for the program, on a
5059 per-function basis.  The filename for the dump is made by appending
5060 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
5061 the output file, if explicitly specified and it is not an executable,
5062 otherwise it is the basename of the source file.  An entry is made up
5063 of three fields:
5065 @itemize
5066 @item
5067 The name of the function.
5068 @item
5069 A number of bytes.
5070 @item
5071 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
5072 @end itemize
5074 The qualifier @code{static} means that the function manipulates the stack
5075 statically: a fixed number of bytes are allocated for the frame on function
5076 entry and released on function exit; no stack adjustments are otherwise made
5077 in the function.  The second field is this fixed number of bytes.
5079 The qualifier @code{dynamic} means that the function manipulates the stack
5080 dynamically: in addition to the static allocation described above, stack
5081 adjustments are made in the body of the function, for example to push/pop
5082 arguments around function calls.  If the qualifier @code{bounded} is also
5083 present, the amount of these adjustments is bounded at compile time and
5084 the second field is an upper bound of the total amount of stack used by
5085 the function.  If it is not present, the amount of these adjustments is
5086 not bounded at compile time and the second field only represents the
5087 bounded part.
5089 @item -fprofile-arcs
5090 @opindex fprofile-arcs
5091 Add code so that program flow @dfn{arcs} are instrumented.  During
5092 execution the program records how many times each branch and call is
5093 executed and how many times it is taken or returns.  When the compiled
5094 program exits it saves this data to a file called
5095 @file{@var{auxname}.gcda} for each source file.  The data may be used for
5096 profile-directed optimizations (@option{-fbranch-probabilities}), or for
5097 test coverage analysis (@option{-ftest-coverage}).  Each object file's
5098 @var{auxname} is generated from the name of the output file, if
5099 explicitly specified and it is not the final executable, otherwise it is
5100 the basename of the source file.  In both cases any suffix is removed
5101 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
5102 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
5103 @xref{Cross-profiling}.
5105 @cindex @command{gcov}
5106 @item --coverage
5107 @opindex coverage
5109 This option is used to compile and link code instrumented for coverage
5110 analysis.  The option is a synonym for @option{-fprofile-arcs}
5111 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
5112 linking).  See the documentation for those options for more details.
5114 @itemize
5116 @item
5117 Compile the source files with @option{-fprofile-arcs} plus optimization
5118 and code generation options.  For test coverage analysis, use the
5119 additional @option{-ftest-coverage} option.  You do not need to profile
5120 every source file in a program.
5122 @item
5123 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
5124 (the latter implies the former).
5126 @item
5127 Run the program on a representative workload to generate the arc profile
5128 information.  This may be repeated any number of times.  You can run
5129 concurrent instances of your program, and provided that the file system
5130 supports locking, the data files will be correctly updated.  Also
5131 @code{fork} calls are detected and correctly handled (double counting
5132 will not happen).
5134 @item
5135 For profile-directed optimizations, compile the source files again with
5136 the same optimization and code generation options plus
5137 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
5138 Control Optimization}).
5140 @item
5141 For test coverage analysis, use @command{gcov} to produce human readable
5142 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
5143 @command{gcov} documentation for further information.
5145 @end itemize
5147 With @option{-fprofile-arcs}, for each function of your program GCC
5148 creates a program flow graph, then finds a spanning tree for the graph.
5149 Only arcs that are not on the spanning tree have to be instrumented: the
5150 compiler adds code to count the number of times that these arcs are
5151 executed.  When an arc is the only exit or only entrance to a block, the
5152 instrumentation code can be added to the block; otherwise, a new basic
5153 block must be created to hold the instrumentation code.
5155 @need 2000
5156 @item -ftest-coverage
5157 @opindex ftest-coverage
5158 Produce a notes file that the @command{gcov} code-coverage utility
5159 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
5160 show program coverage.  Each source file's note file is called
5161 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
5162 above for a description of @var{auxname} and instructions on how to
5163 generate test coverage data.  Coverage data will match the source files
5164 more closely, if you do not optimize.
5166 @item -fdbg-cnt-list
5167 @opindex fdbg-cnt-list
5168 Print the name and the counter upper bound for all debug counters.
5171 @item -fdbg-cnt=@var{counter-value-list}
5172 @opindex fdbg-cnt
5173 Set the internal debug counter upper bound.  @var{counter-value-list}
5174 is a comma-separated list of @var{name}:@var{value} pairs
5175 which sets the upper bound of each debug counter @var{name} to @var{value}.
5176 All debug counters have the initial upper bound of @var{UINT_MAX},
5177 thus dbg_cnt() returns true always unless the upper bound is set by this option.
5178 e.g. With -fdbg-cnt=dce:10,tail_call:0
5179 dbg_cnt(dce) will return true only for first 10 invocations
5181 @itemx -fenable-@var{kind}-@var{pass}
5182 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
5183 @opindex fdisable-
5184 @opindex fenable-
5186 This is a set of debugging options that are used to explicitly disable/enable
5187 optimization passes. For compiler users, regular options for enabling/disabling
5188 passes should be used instead.
5190 @itemize
5192 @item -fdisable-ipa-@var{pass}
5193 Disable ipa pass @var{pass}. @var{pass} is the pass name.  If the same pass is
5194 statically invoked in the compiler multiple times, the pass name should be
5195 appended with a sequential number starting from 1.
5197 @item -fdisable-rtl-@var{pass}
5198 @item -fdisable-rtl-@var{pass}=@var{range-list}
5199 Disable rtl pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5200 statically invoked in the compiler multiple times, the pass name should be
5201 appended with a sequential number starting from 1.  @var{range-list} is a comma
5202 seperated list of function ranges or assembler names.  Each range is a number
5203 pair seperated by a colon.  The range is inclusive in both ends.  If the range
5204 is trivial, the number pair can be simplified as a single number.  If the
5205 function's cgraph node's @var{uid} is falling within one of the specified ranges,
5206 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
5207 function header of a dump file, and the pass names can be dumped by using
5208 option @option{-fdump-passes}.
5210 @item -fdisable-tree-@var{pass}
5211 @item -fdisable-tree-@var{pass}=@var{range-list}
5212 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
5213 option arguments.
5215 @item -fenable-ipa-@var{pass}
5216 Enable ipa pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5217 statically invoked in the compiler multiple times, the pass name should be
5218 appended with a sequential number starting from 1.
5220 @item -fenable-rtl-@var{pass}
5221 @item -fenable-rtl-@var{pass}=@var{range-list}
5222 Enable rtl pass @var{pass}.  See @option{-fdisable-rtl} for option argument
5223 description and examples.
5225 @item -fenable-tree-@var{pass}
5226 @item -fenable-tree-@var{pass}=@var{range-list}
5227 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
5228 of option arguments.
5230 @smallexample
5232 # disable ccp1 for all functions
5233    -fdisable-tree-ccp1
5234 # disable complete unroll for function whose cgraph node uid is 1
5235    -fenable-tree-cunroll=1
5236 # disable gcse2 for functions at the following ranges [1,1],
5237 # [300,400], and [400,1000]
5238 # disable gcse2 for functions foo and foo2
5239    -fdisable-rtl-gcse2=foo,foo2
5240 # disable early inlining
5241    -fdisable-tree-einline
5242 # disable ipa inlining
5243    -fdisable-ipa-inline
5244 # enable tree full unroll
5245    -fenable-tree-unroll
5247 @end smallexample
5249 @end itemize
5251 @item -d@var{letters}
5252 @itemx -fdump-rtl-@var{pass}
5253 @opindex d
5254 Says to make debugging dumps during compilation at times specified by
5255 @var{letters}.  This is used for debugging the RTL-based passes of the
5256 compiler.  The file names for most of the dumps are made by appending
5257 a pass number and a word to the @var{dumpname}, and the files are
5258 created in the directory of the output file.  Note that the pass
5259 number is computed statically as passes get registered into the pass
5260 manager.  Thus the numbering is not related to the dynamic order of
5261 execution of passes.  In particular, a pass installed by a plugin
5262 could have a number over 200 even if it executed quite early.
5263 @var{dumpname} is generated from the name of the output file, if
5264 explicitly specified and it is not an executable, otherwise it is the
5265 basename of the source file. These switches may have different effects
5266 when @option{-E} is used for preprocessing.
5268 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
5269 @option{-d} option @var{letters}.  Here are the possible
5270 letters for use in @var{pass} and @var{letters}, and their meanings:
5272 @table @gcctabopt
5274 @item -fdump-rtl-alignments
5275 @opindex fdump-rtl-alignments
5276 Dump after branch alignments have been computed.
5278 @item -fdump-rtl-asmcons
5279 @opindex fdump-rtl-asmcons
5280 Dump after fixing rtl statements that have unsatisfied in/out constraints.
5282 @item -fdump-rtl-auto_inc_dec
5283 @opindex fdump-rtl-auto_inc_dec
5284 Dump after auto-inc-dec discovery.  This pass is only run on
5285 architectures that have auto inc or auto dec instructions.
5287 @item -fdump-rtl-barriers
5288 @opindex fdump-rtl-barriers
5289 Dump after cleaning up the barrier instructions.
5291 @item -fdump-rtl-bbpart
5292 @opindex fdump-rtl-bbpart
5293 Dump after partitioning hot and cold basic blocks.
5295 @item -fdump-rtl-bbro
5296 @opindex fdump-rtl-bbro
5297 Dump after block reordering.
5299 @item -fdump-rtl-btl1
5300 @itemx -fdump-rtl-btl2
5301 @opindex fdump-rtl-btl2
5302 @opindex fdump-rtl-btl2
5303 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
5304 after the two branch
5305 target load optimization passes.
5307 @item -fdump-rtl-bypass
5308 @opindex fdump-rtl-bypass
5309 Dump after jump bypassing and control flow optimizations.
5311 @item -fdump-rtl-combine
5312 @opindex fdump-rtl-combine
5313 Dump after the RTL instruction combination pass.
5315 @item -fdump-rtl-compgotos
5316 @opindex fdump-rtl-compgotos
5317 Dump after duplicating the computed gotos.
5319 @item -fdump-rtl-ce1
5320 @itemx -fdump-rtl-ce2
5321 @itemx -fdump-rtl-ce3
5322 @opindex fdump-rtl-ce1
5323 @opindex fdump-rtl-ce2
5324 @opindex fdump-rtl-ce3
5325 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
5326 @option{-fdump-rtl-ce3} enable dumping after the three
5327 if conversion passes.
5329 @itemx -fdump-rtl-cprop_hardreg
5330 @opindex fdump-rtl-cprop_hardreg
5331 Dump after hard register copy propagation.
5333 @itemx -fdump-rtl-csa
5334 @opindex fdump-rtl-csa
5335 Dump after combining stack adjustments.
5337 @item -fdump-rtl-cse1
5338 @itemx -fdump-rtl-cse2
5339 @opindex fdump-rtl-cse1
5340 @opindex fdump-rtl-cse2
5341 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
5342 the two common sub-expression elimination passes.
5344 @itemx -fdump-rtl-dce
5345 @opindex fdump-rtl-dce
5346 Dump after the standalone dead code elimination passes.
5348 @itemx -fdump-rtl-dbr
5349 @opindex fdump-rtl-dbr
5350 Dump after delayed branch scheduling.
5352 @item -fdump-rtl-dce1
5353 @itemx -fdump-rtl-dce2
5354 @opindex fdump-rtl-dce1
5355 @opindex fdump-rtl-dce2
5356 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
5357 the two dead store elimination passes.
5359 @item -fdump-rtl-eh
5360 @opindex fdump-rtl-eh
5361 Dump after finalization of EH handling code.
5363 @item -fdump-rtl-eh_ranges
5364 @opindex fdump-rtl-eh_ranges
5365 Dump after conversion of EH handling range regions.
5367 @item -fdump-rtl-expand
5368 @opindex fdump-rtl-expand
5369 Dump after RTL generation.
5371 @item -fdump-rtl-fwprop1
5372 @itemx -fdump-rtl-fwprop2
5373 @opindex fdump-rtl-fwprop1
5374 @opindex fdump-rtl-fwprop2
5375 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
5376 dumping after the two forward propagation passes.
5378 @item -fdump-rtl-gcse1
5379 @itemx -fdump-rtl-gcse2
5380 @opindex fdump-rtl-gcse1
5381 @opindex fdump-rtl-gcse2
5382 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
5383 after global common subexpression elimination.
5385 @item -fdump-rtl-init-regs
5386 @opindex fdump-rtl-init-regs
5387 Dump after the initialization of the registers.
5389 @item -fdump-rtl-initvals
5390 @opindex fdump-rtl-initvals
5391 Dump after the computation of the initial value sets.
5393 @itemx -fdump-rtl-into_cfglayout
5394 @opindex fdump-rtl-into_cfglayout
5395 Dump after converting to cfglayout mode.
5397 @item -fdump-rtl-ira
5398 @opindex fdump-rtl-ira
5399 Dump after iterated register allocation.
5401 @item -fdump-rtl-jump
5402 @opindex fdump-rtl-jump
5403 Dump after the second jump optimization.
5405 @item -fdump-rtl-loop2
5406 @opindex fdump-rtl-loop2
5407 @option{-fdump-rtl-loop2} enables dumping after the rtl
5408 loop optimization passes.
5410 @item -fdump-rtl-mach
5411 @opindex fdump-rtl-mach
5412 Dump after performing the machine dependent reorganization pass, if that
5413 pass exists.
5415 @item -fdump-rtl-mode_sw
5416 @opindex fdump-rtl-mode_sw
5417 Dump after removing redundant mode switches.
5419 @item -fdump-rtl-rnreg
5420 @opindex fdump-rtl-rnreg
5421 Dump after register renumbering.
5423 @itemx -fdump-rtl-outof_cfglayout
5424 @opindex fdump-rtl-outof_cfglayout
5425 Dump after converting from cfglayout mode.
5427 @item -fdump-rtl-peephole2
5428 @opindex fdump-rtl-peephole2
5429 Dump after the peephole pass.
5431 @item -fdump-rtl-postreload
5432 @opindex fdump-rtl-postreload
5433 Dump after post-reload optimizations.
5435 @itemx -fdump-rtl-pro_and_epilogue
5436 @opindex fdump-rtl-pro_and_epilogue
5437 Dump after generating the function prologues and epilogues.
5439 @item -fdump-rtl-regmove
5440 @opindex fdump-rtl-regmove
5441 Dump after the register move pass.
5443 @item -fdump-rtl-sched1
5444 @itemx -fdump-rtl-sched2
5445 @opindex fdump-rtl-sched1
5446 @opindex fdump-rtl-sched2
5447 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
5448 after the basic block scheduling passes.
5450 @item -fdump-rtl-see
5451 @opindex fdump-rtl-see
5452 Dump after sign extension elimination.
5454 @item -fdump-rtl-seqabstr
5455 @opindex fdump-rtl-seqabstr
5456 Dump after common sequence discovery.
5458 @item -fdump-rtl-shorten
5459 @opindex fdump-rtl-shorten
5460 Dump after shortening branches.
5462 @item -fdump-rtl-sibling
5463 @opindex fdump-rtl-sibling
5464 Dump after sibling call optimizations.
5466 @item -fdump-rtl-split1
5467 @itemx -fdump-rtl-split2
5468 @itemx -fdump-rtl-split3
5469 @itemx -fdump-rtl-split4
5470 @itemx -fdump-rtl-split5
5471 @opindex fdump-rtl-split1
5472 @opindex fdump-rtl-split2
5473 @opindex fdump-rtl-split3
5474 @opindex fdump-rtl-split4
5475 @opindex fdump-rtl-split5
5476 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
5477 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
5478 @option{-fdump-rtl-split5} enable dumping after five rounds of
5479 instruction splitting.
5481 @item -fdump-rtl-sms
5482 @opindex fdump-rtl-sms
5483 Dump after modulo scheduling.  This pass is only run on some
5484 architectures.
5486 @item -fdump-rtl-stack
5487 @opindex fdump-rtl-stack
5488 Dump after conversion from GCC's ``flat register file'' registers to the
5489 x87's stack-like registers.  This pass is only run on x86 variants.
5491 @item -fdump-rtl-subreg1
5492 @itemx -fdump-rtl-subreg2
5493 @opindex fdump-rtl-subreg1
5494 @opindex fdump-rtl-subreg2
5495 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
5496 the two subreg expansion passes.
5498 @item -fdump-rtl-unshare
5499 @opindex fdump-rtl-unshare
5500 Dump after all rtl has been unshared.
5502 @item -fdump-rtl-vartrack
5503 @opindex fdump-rtl-vartrack
5504 Dump after variable tracking.
5506 @item -fdump-rtl-vregs
5507 @opindex fdump-rtl-vregs
5508 Dump after converting virtual registers to hard registers.
5510 @item -fdump-rtl-web
5511 @opindex fdump-rtl-web
5512 Dump after live range splitting.
5514 @item -fdump-rtl-regclass
5515 @itemx -fdump-rtl-subregs_of_mode_init
5516 @itemx -fdump-rtl-subregs_of_mode_finish
5517 @itemx -fdump-rtl-dfinit
5518 @itemx -fdump-rtl-dfinish
5519 @opindex fdump-rtl-regclass
5520 @opindex fdump-rtl-subregs_of_mode_init
5521 @opindex fdump-rtl-subregs_of_mode_finish
5522 @opindex fdump-rtl-dfinit
5523 @opindex fdump-rtl-dfinish
5524 These dumps are defined but always produce empty files.
5526 @item -fdump-rtl-all
5527 @opindex fdump-rtl-all
5528 Produce all the dumps listed above.
5530 @item -dA
5531 @opindex dA
5532 Annotate the assembler output with miscellaneous debugging information.
5534 @item -dD
5535 @opindex dD
5536 Dump all macro definitions, at the end of preprocessing, in addition to
5537 normal output.
5539 @item -dH
5540 @opindex dH
5541 Produce a core dump whenever an error occurs.
5543 @item -dm
5544 @opindex dm
5545 Print statistics on memory usage, at the end of the run, to
5546 standard error.
5548 @item -dp
5549 @opindex dp
5550 Annotate the assembler output with a comment indicating which
5551 pattern and alternative was used.  The length of each instruction is
5552 also printed.
5554 @item -dP
5555 @opindex dP
5556 Dump the RTL in the assembler output as a comment before each instruction.
5557 Also turns on @option{-dp} annotation.
5559 @item -dv
5560 @opindex dv
5561 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
5562 dump a representation of the control flow graph suitable for viewing with VCG
5563 to @file{@var{file}.@var{pass}.vcg}.
5565 @item -dx
5566 @opindex dx
5567 Just generate RTL for a function instead of compiling it.  Usually used
5568 with @option{-fdump-rtl-expand}.
5569 @end table
5571 @item -fdump-noaddr
5572 @opindex fdump-noaddr
5573 When doing debugging dumps, suppress address output.  This makes it more
5574 feasible to use diff on debugging dumps for compiler invocations with
5575 different compiler binaries and/or different
5576 text / bss / data / heap / stack / dso start locations.
5578 @item -fdump-unnumbered
5579 @opindex fdump-unnumbered
5580 When doing debugging dumps, suppress instruction numbers and address output.
5581 This makes it more feasible to use diff on debugging dumps for compiler
5582 invocations with different options, in particular with and without
5583 @option{-g}.
5585 @item -fdump-unnumbered-links
5586 @opindex fdump-unnumbered-links
5587 When doing debugging dumps (see @option{-d} option above), suppress
5588 instruction numbers for the links to the previous and next instructions
5589 in a sequence.
5591 @item -fdump-translation-unit @r{(C++ only)}
5592 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
5593 @opindex fdump-translation-unit
5594 Dump a representation of the tree structure for the entire translation
5595 unit to a file.  The file name is made by appending @file{.tu} to the
5596 source file name, and the file is created in the same directory as the
5597 output file.  If the @samp{-@var{options}} form is used, @var{options}
5598 controls the details of the dump as described for the
5599 @option{-fdump-tree} options.
5601 @item -fdump-class-hierarchy @r{(C++ only)}
5602 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
5603 @opindex fdump-class-hierarchy
5604 Dump a representation of each class's hierarchy and virtual function
5605 table layout to a file.  The file name is made by appending
5606 @file{.class} to the source file name, and the file is created in the
5607 same directory as the output file.  If the @samp{-@var{options}} form
5608 is used, @var{options} controls the details of the dump as described
5609 for the @option{-fdump-tree} options.
5611 @item -fdump-ipa-@var{switch}
5612 @opindex fdump-ipa
5613 Control the dumping at various stages of inter-procedural analysis
5614 language tree to a file.  The file name is generated by appending a
5615 switch specific suffix to the source file name, and the file is created
5616 in the same directory as the output file.  The following dumps are
5617 possible:
5619 @table @samp
5620 @item all
5621 Enables all inter-procedural analysis dumps.
5623 @item cgraph
5624 Dumps information about call-graph optimization, unused function removal,
5625 and inlining decisions.
5627 @item inline
5628 Dump after function inlining.
5630 @end table
5632 @item -fdump-passes
5633 @opindex fdump-passes
5634 Dump the list of optimization passes that are turned on and off by
5635 the current command-line options.
5637 @item -fdump-statistics-@var{option}
5638 @opindex fdump-statistics
5639 Enable and control dumping of pass statistics in a separate file.  The
5640 file name is generated by appending a suffix ending in
5641 @samp{.statistics} to the source file name, and the file is created in
5642 the same directory as the output file.  If the @samp{-@var{option}}
5643 form is used, @samp{-stats} will cause counters to be summed over the
5644 whole compilation unit while @samp{-details} will dump every event as
5645 the passes generate them.  The default with no option is to sum
5646 counters for each function compiled.
5648 @item -fdump-tree-@var{switch}
5649 @itemx -fdump-tree-@var{switch}-@var{options}
5650 @opindex fdump-tree
5651 Control the dumping at various stages of processing the intermediate
5652 language tree to a file.  The file name is generated by appending a
5653 switch specific suffix to the source file name, and the file is
5654 created in the same directory as the output file.  If the
5655 @samp{-@var{options}} form is used, @var{options} is a list of
5656 @samp{-} separated options which control the details of the dump.  Not
5657 all options are applicable to all dumps; those that are not
5658 meaningful will be ignored.  The following options are available
5660 @table @samp
5661 @item address
5662 Print the address of each node.  Usually this is not meaningful as it
5663 changes according to the environment and source file.  Its primary use
5664 is for tying up a dump file with a debug environment.
5665 @item asmname
5666 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
5667 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
5668 use working backward from mangled names in the assembly file.
5669 @item slim
5670 Inhibit dumping of members of a scope or body of a function merely
5671 because that scope has been reached.  Only dump such items when they
5672 are directly reachable by some other path.  When dumping pretty-printed
5673 trees, this option inhibits dumping the bodies of control structures.
5674 @item raw
5675 Print a raw representation of the tree.  By default, trees are
5676 pretty-printed into a C-like representation.
5677 @item details
5678 Enable more detailed dumps (not honored by every dump option).
5679 @item stats
5680 Enable dumping various statistics about the pass (not honored by every dump
5681 option).
5682 @item blocks
5683 Enable showing basic block boundaries (disabled in raw dumps).
5684 @item vops
5685 Enable showing virtual operands for every statement.
5686 @item lineno
5687 Enable showing line numbers for statements.
5688 @item uid
5689 Enable showing the unique ID (@code{DECL_UID}) for each variable.
5690 @item verbose
5691 Enable showing the tree dump for each statement.
5692 @item eh
5693 Enable showing the EH region number holding each statement.
5694 @item scev
5695 Enable showing scalar evolution analysis details.
5696 @item all
5697 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
5698 and @option{lineno}.
5699 @end table
5701 The following tree dumps are possible:
5702 @table @samp
5704 @item original
5705 @opindex fdump-tree-original
5706 Dump before any tree based optimization, to @file{@var{file}.original}.
5708 @item optimized
5709 @opindex fdump-tree-optimized
5710 Dump after all tree based optimization, to @file{@var{file}.optimized}.
5712 @item gimple
5713 @opindex fdump-tree-gimple
5714 Dump each function before and after the gimplification pass to a file.  The
5715 file name is made by appending @file{.gimple} to the source file name.
5717 @item cfg
5718 @opindex fdump-tree-cfg
5719 Dump the control flow graph of each function to a file.  The file name is
5720 made by appending @file{.cfg} to the source file name.
5722 @item vcg
5723 @opindex fdump-tree-vcg
5724 Dump the control flow graph of each function to a file in VCG format.  The
5725 file name is made by appending @file{.vcg} to the source file name.  Note
5726 that if the file contains more than one function, the generated file cannot
5727 be used directly by VCG@.  You will need to cut and paste each function's
5728 graph into its own separate file first.
5730 @item ch
5731 @opindex fdump-tree-ch
5732 Dump each function after copying loop headers.  The file name is made by
5733 appending @file{.ch} to the source file name.
5735 @item ssa
5736 @opindex fdump-tree-ssa
5737 Dump SSA related information to a file.  The file name is made by appending
5738 @file{.ssa} to the source file name.
5740 @item alias
5741 @opindex fdump-tree-alias
5742 Dump aliasing information for each function.  The file name is made by
5743 appending @file{.alias} to the source file name.
5745 @item ccp
5746 @opindex fdump-tree-ccp
5747 Dump each function after CCP@.  The file name is made by appending
5748 @file{.ccp} to the source file name.
5750 @item storeccp
5751 @opindex fdump-tree-storeccp
5752 Dump each function after STORE-CCP@.  The file name is made by appending
5753 @file{.storeccp} to the source file name.
5755 @item pre
5756 @opindex fdump-tree-pre
5757 Dump trees after partial redundancy elimination.  The file name is made
5758 by appending @file{.pre} to the source file name.
5760 @item fre
5761 @opindex fdump-tree-fre
5762 Dump trees after full redundancy elimination.  The file name is made
5763 by appending @file{.fre} to the source file name.
5765 @item copyprop
5766 @opindex fdump-tree-copyprop
5767 Dump trees after copy propagation.  The file name is made
5768 by appending @file{.copyprop} to the source file name.
5770 @item store_copyprop
5771 @opindex fdump-tree-store_copyprop
5772 Dump trees after store copy-propagation.  The file name is made
5773 by appending @file{.store_copyprop} to the source file name.
5775 @item dce
5776 @opindex fdump-tree-dce
5777 Dump each function after dead code elimination.  The file name is made by
5778 appending @file{.dce} to the source file name.
5780 @item mudflap
5781 @opindex fdump-tree-mudflap
5782 Dump each function after adding mudflap instrumentation.  The file name is
5783 made by appending @file{.mudflap} to the source file name.
5785 @item sra
5786 @opindex fdump-tree-sra
5787 Dump each function after performing scalar replacement of aggregates.  The
5788 file name is made by appending @file{.sra} to the source file name.
5790 @item sink
5791 @opindex fdump-tree-sink
5792 Dump each function after performing code sinking.  The file name is made
5793 by appending @file{.sink} to the source file name.
5795 @item dom
5796 @opindex fdump-tree-dom
5797 Dump each function after applying dominator tree optimizations.  The file
5798 name is made by appending @file{.dom} to the source file name.
5800 @item dse
5801 @opindex fdump-tree-dse
5802 Dump each function after applying dead store elimination.  The file
5803 name is made by appending @file{.dse} to the source file name.
5805 @item phiopt
5806 @opindex fdump-tree-phiopt
5807 Dump each function after optimizing PHI nodes into straightline code.  The file
5808 name is made by appending @file{.phiopt} to the source file name.
5810 @item forwprop
5811 @opindex fdump-tree-forwprop
5812 Dump each function after forward propagating single use variables.  The file
5813 name is made by appending @file{.forwprop} to the source file name.
5815 @item copyrename
5816 @opindex fdump-tree-copyrename
5817 Dump each function after applying the copy rename optimization.  The file
5818 name is made by appending @file{.copyrename} to the source file name.
5820 @item nrv
5821 @opindex fdump-tree-nrv
5822 Dump each function after applying the named return value optimization on
5823 generic trees.  The file name is made by appending @file{.nrv} to the source
5824 file name.
5826 @item vect
5827 @opindex fdump-tree-vect
5828 Dump each function after applying vectorization of loops.  The file name is
5829 made by appending @file{.vect} to the source file name.
5831 @item slp
5832 @opindex fdump-tree-slp
5833 Dump each function after applying vectorization of basic blocks.  The file name
5834 is made by appending @file{.slp} to the source file name.
5836 @item vrp
5837 @opindex fdump-tree-vrp
5838 Dump each function after Value Range Propagation (VRP).  The file name
5839 is made by appending @file{.vrp} to the source file name.
5841 @item all
5842 @opindex fdump-tree-all
5843 Enable all the available tree dumps with the flags provided in this option.
5844 @end table
5846 @item -ftree-vectorizer-verbose=@var{n}
5847 @opindex ftree-vectorizer-verbose
5848 This option controls the amount of debugging output the vectorizer prints.
5849 This information is written to standard error, unless
5850 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
5851 in which case it is output to the usual dump listing file, @file{.vect}.
5852 For @var{n}=0 no diagnostic information is reported.
5853 If @var{n}=1 the vectorizer reports each loop that got vectorized,
5854 and the total number of loops that got vectorized.
5855 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
5856 the first analysis phase (vect_analyze_loop_form) - i.e.@: countable,
5857 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
5858 level that @option{-fdump-tree-vect-stats} uses.
5859 Higher verbosity levels mean either more information dumped for each
5860 reported loop, or same amount of information reported for more loops:
5861 if @var{n}=3, vectorizer cost model information is reported.
5862 If @var{n}=4, alignment related information is added to the reports.
5863 If @var{n}=5, data-references related information (e.g.@: memory dependences,
5864 memory access-patterns) is added to the reports.
5865 If @var{n}=6, the vectorizer reports also non-vectorized inner-most loops
5866 that did not pass the first analysis phase (i.e., may not be countable, or
5867 may have complicated control-flow).
5868 If @var{n}=7, the vectorizer reports also non-vectorized nested loops.
5869 If @var{n}=8, SLP related information is added to the reports.
5870 For @var{n}=9, all the information the vectorizer generates during its
5871 analysis and transformation is reported.  This is the same verbosity level
5872 that @option{-fdump-tree-vect-details} uses.
5874 @item -frandom-seed=@var{string}
5875 @opindex frandom-seed
5876 This option provides a seed that GCC uses when it would otherwise use
5877 random numbers.  It is used to generate certain symbol names
5878 that have to be different in every compiled file.  It is also used to
5879 place unique stamps in coverage data files and the object files that
5880 produce them.  You can use the @option{-frandom-seed} option to produce
5881 reproducibly identical object files.
5883 The @var{string} should be different for every file you compile.
5885 @item -fsched-verbose=@var{n}
5886 @opindex fsched-verbose
5887 On targets that use instruction scheduling, this option controls the
5888 amount of debugging output the scheduler prints.  This information is
5889 written to standard error, unless @option{-fdump-rtl-sched1} or
5890 @option{-fdump-rtl-sched2} is specified, in which case it is output
5891 to the usual dump listing file, @file{.sched1} or @file{.sched2}
5892 respectively.  However for @var{n} greater than nine, the output is
5893 always printed to standard error.
5895 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
5896 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
5897 For @var{n} greater than one, it also output basic block probabilities,
5898 detailed ready list information and unit/insn info.  For @var{n} greater
5899 than two, it includes RTL at abort point, control-flow and regions info.
5900 And for @var{n} over four, @option{-fsched-verbose} also includes
5901 dependence info.
5903 @item -save-temps
5904 @itemx -save-temps=cwd
5905 @opindex save-temps
5906 Store the usual ``temporary'' intermediate files permanently; place them
5907 in the current directory and name them based on the source file.  Thus,
5908 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
5909 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
5910 preprocessed @file{foo.i} output file even though the compiler now
5911 normally uses an integrated preprocessor.
5913 When used in combination with the @option{-x} command-line option,
5914 @option{-save-temps} is sensible enough to avoid over writing an
5915 input source file with the same extension as an intermediate file.
5916 The corresponding intermediate file may be obtained by renaming the
5917 source file before using @option{-save-temps}.
5919 If you invoke GCC in parallel, compiling several different source
5920 files that share a common base name in different subdirectories or the
5921 same source file compiled for multiple output destinations, it is
5922 likely that the different parallel compilers will interfere with each
5923 other, and overwrite the temporary files.  For instance:
5925 @smallexample
5926 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
5927 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
5928 @end smallexample
5930 may result in @file{foo.i} and @file{foo.o} being written to
5931 simultaneously by both compilers.
5933 @item -save-temps=obj
5934 @opindex save-temps=obj
5935 Store the usual ``temporary'' intermediate files permanently.  If the
5936 @option{-o} option is used, the temporary files are based on the
5937 object file.  If the @option{-o} option is not used, the
5938 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
5940 For example:
5942 @smallexample
5943 gcc -save-temps=obj -c foo.c
5944 gcc -save-temps=obj -c bar.c -o dir/xbar.o
5945 gcc -save-temps=obj foobar.c -o dir2/yfoobar
5946 @end smallexample
5948 would create @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
5949 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
5950 @file{dir2/yfoobar.o}.
5952 @item -time@r{[}=@var{file}@r{]}
5953 @opindex time
5954 Report the CPU time taken by each subprocess in the compilation
5955 sequence.  For C source files, this is the compiler proper and assembler
5956 (plus the linker if linking is done).
5958 Without the specification of an output file, the output looks like this:
5960 @smallexample
5961 # cc1 0.12 0.01
5962 # as 0.00 0.01
5963 @end smallexample
5965 The first number on each line is the ``user time'', that is time spent
5966 executing the program itself.  The second number is ``system time'',
5967 time spent executing operating system routines on behalf of the program.
5968 Both numbers are in seconds.
5970 With the specification of an output file, the output is appended to the
5971 named file, and it looks like this:
5973 @smallexample
5974 0.12 0.01 cc1 @var{options}
5975 0.00 0.01 as @var{options}
5976 @end smallexample
5978 The ``user time'' and the ``system time'' are moved before the program
5979 name, and the options passed to the program are displayed, so that one
5980 can later tell what file was being compiled, and with which options.
5982 @item -fvar-tracking
5983 @opindex fvar-tracking
5984 Run variable tracking pass.  It computes where variables are stored at each
5985 position in code.  Better debugging information is then generated
5986 (if the debugging information format supports this information).
5988 It is enabled by default when compiling with optimization (@option{-Os},
5989 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
5990 the debug info format supports it.
5992 @item -fvar-tracking-assignments
5993 @opindex fvar-tracking-assignments
5994 @opindex fno-var-tracking-assignments
5995 Annotate assignments to user variables early in the compilation and
5996 attempt to carry the annotations over throughout the compilation all the
5997 way to the end, in an attempt to improve debug information while
5998 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
6000 It can be enabled even if var-tracking is disabled, in which case
6001 annotations will be created and maintained, but discarded at the end.
6003 @item -fvar-tracking-assignments-toggle
6004 @opindex fvar-tracking-assignments-toggle
6005 @opindex fno-var-tracking-assignments-toggle
6006 Toggle @option{-fvar-tracking-assignments}, in the same way that
6007 @option{-gtoggle} toggles @option{-g}.
6009 @item -print-file-name=@var{library}
6010 @opindex print-file-name
6011 Print the full absolute name of the library file @var{library} that
6012 would be used when linking---and don't do anything else.  With this
6013 option, GCC does not compile or link anything; it just prints the
6014 file name.
6016 @item -print-multi-directory
6017 @opindex print-multi-directory
6018 Print the directory name corresponding to the multilib selected by any
6019 other switches present in the command line.  This directory is supposed
6020 to exist in @env{GCC_EXEC_PREFIX}.
6022 @item -print-multi-lib
6023 @opindex print-multi-lib
6024 Print the mapping from multilib directory names to compiler switches
6025 that enable them.  The directory name is separated from the switches by
6026 @samp{;}, and each switch starts with an @samp{@@} instead of the
6027 @samp{-}, without spaces between multiple switches.  This is supposed to
6028 ease shell-processing.
6030 @item -print-multi-os-directory
6031 @opindex print-multi-os-directory
6032 Print the path to OS libraries for the selected
6033 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
6034 present in the @file{lib} subdirectory and no multilibs are used, this is
6035 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
6036 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
6037 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
6038 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
6040 @item -print-prog-name=@var{program}
6041 @opindex print-prog-name
6042 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
6044 @item -print-libgcc-file-name
6045 @opindex print-libgcc-file-name
6046 Same as @option{-print-file-name=libgcc.a}.
6048 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
6049 but you do want to link with @file{libgcc.a}.  You can do
6051 @smallexample
6052 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
6053 @end smallexample
6055 @item -print-search-dirs
6056 @opindex print-search-dirs
6057 Print the name of the configured installation directory and a list of
6058 program and library directories @command{gcc} will search---and don't do anything else.
6060 This is useful when @command{gcc} prints the error message
6061 @samp{installation problem, cannot exec cpp0: No such file or directory}.
6062 To resolve this you either need to put @file{cpp0} and the other compiler
6063 components where @command{gcc} expects to find them, or you can set the environment
6064 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
6065 Don't forget the trailing @samp{/}.
6066 @xref{Environment Variables}.
6068 @item -print-sysroot
6069 @opindex print-sysroot
6070 Print the target sysroot directory that will be used during
6071 compilation.  This is the target sysroot specified either at configure
6072 time or using the @option{--sysroot} option, possibly with an extra
6073 suffix that depends on compilation options.  If no target sysroot is
6074 specified, the option prints nothing.
6076 @item -print-sysroot-headers-suffix
6077 @opindex print-sysroot-headers-suffix
6078 Print the suffix added to the target sysroot when searching for
6079 headers, or give an error if the compiler is not configured with such
6080 a suffix---and don't do anything else.
6082 @item -dumpmachine
6083 @opindex dumpmachine
6084 Print the compiler's target machine (for example,
6085 @samp{i686-pc-linux-gnu})---and don't do anything else.
6087 @item -dumpversion
6088 @opindex dumpversion
6089 Print the compiler version (for example, @samp{3.0})---and don't do
6090 anything else.
6092 @item -dumpspecs
6093 @opindex dumpspecs
6094 Print the compiler's built-in specs---and don't do anything else.  (This
6095 is used when GCC itself is being built.)  @xref{Spec Files}.
6097 @item -feliminate-unused-debug-types
6098 @opindex feliminate-unused-debug-types
6099 Normally, when producing DWARF2 output, GCC will emit debugging
6100 information for all types declared in a compilation
6101 unit, regardless of whether or not they are actually used
6102 in that compilation unit.  Sometimes this is useful, such as
6103 if, in the debugger, you want to cast a value to a type that is
6104 not actually used in your program (but is declared).  More often,
6105 however, this results in a significant amount of wasted space.
6106 With this option, GCC will avoid producing debug symbol output
6107 for types that are nowhere used in the source file being compiled.
6108 @end table
6110 @node Optimize Options
6111 @section Options That Control Optimization
6112 @cindex optimize options
6113 @cindex options, optimization
6115 These options control various sorts of optimizations.
6117 Without any optimization option, the compiler's goal is to reduce the
6118 cost of compilation and to make debugging produce the expected
6119 results.  Statements are independent: if you stop the program with a
6120 breakpoint between statements, you can then assign a new value to any
6121 variable or change the program counter to any other statement in the
6122 function and get exactly the results you would expect from the source
6123 code.
6125 Turning on optimization flags makes the compiler attempt to improve
6126 the performance and/or code size at the expense of compilation time
6127 and possibly the ability to debug the program.
6129 The compiler performs optimization based on the knowledge it has of the
6130 program.  Compiling multiple files at once to a single output file mode allows
6131 the compiler to use information gained from all of the files when compiling
6132 each of them.
6134 Not all optimizations are controlled directly by a flag.  Only
6135 optimizations that have a flag are listed in this section.
6137 Most optimizations are only enabled if an @option{-O} level is set on
6138 the command line.  Otherwise they are disabled, even if individual
6139 optimization flags are specified.
6141 Depending on the target and how GCC was configured, a slightly different
6142 set of optimizations may be enabled at each @option{-O} level than
6143 those listed here.  You can invoke GCC with @samp{-Q --help=optimizers}
6144 to find out the exact set of optimizations that are enabled at each level.
6145 @xref{Overall Options}, for examples.
6147 @table @gcctabopt
6148 @item -O
6149 @itemx -O1
6150 @opindex O
6151 @opindex O1
6152 Optimize.  Optimizing compilation takes somewhat more time, and a lot
6153 more memory for a large function.
6155 With @option{-O}, the compiler tries to reduce code size and execution
6156 time, without performing any optimizations that take a great deal of
6157 compilation time.
6159 @option{-O} turns on the following optimization flags:
6160 @gccoptlist{
6161 -fauto-inc-dec @gol
6162 -fcompare-elim @gol
6163 -fcprop-registers @gol
6164 -fdce @gol
6165 -fdefer-pop @gol
6166 -fdelayed-branch @gol
6167 -fdse @gol
6168 -fguess-branch-probability @gol
6169 -fif-conversion2 @gol
6170 -fif-conversion @gol
6171 -fipa-pure-const @gol
6172 -fipa-profile @gol
6173 -fipa-reference @gol
6174 -fmerge-constants
6175 -fsplit-wide-types @gol
6176 -ftree-bit-ccp @gol
6177 -ftree-builtin-call-dce @gol
6178 -ftree-ccp @gol
6179 -ftree-ch @gol
6180 -ftree-copyrename @gol
6181 -ftree-dce @gol
6182 -ftree-dominator-opts @gol
6183 -ftree-dse @gol
6184 -ftree-forwprop @gol
6185 -ftree-fre @gol
6186 -ftree-phiprop @gol
6187 -ftree-sra @gol
6188 -ftree-pta @gol
6189 -ftree-ter @gol
6190 -funit-at-a-time}
6192 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
6193 where doing so does not interfere with debugging.
6195 @item -O2
6196 @opindex O2
6197 Optimize even more.  GCC performs nearly all supported optimizations
6198 that do not involve a space-speed tradeoff.
6199 As compared to @option{-O}, this option increases both compilation time
6200 and the performance of the generated code.
6202 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
6203 also turns on the following optimization flags:
6204 @gccoptlist{-fthread-jumps @gol
6205 -falign-functions  -falign-jumps @gol
6206 -falign-loops  -falign-labels @gol
6207 -fcaller-saves @gol
6208 -fcrossjumping @gol
6209 -fcse-follow-jumps  -fcse-skip-blocks @gol
6210 -fdelete-null-pointer-checks @gol
6211 -fdevirtualize @gol
6212 -fexpensive-optimizations @gol
6213 -fgcse  -fgcse-lm  @gol
6214 -finline-small-functions @gol
6215 -findirect-inlining @gol
6216 -fipa-sra @gol
6217 -foptimize-sibling-calls @gol
6218 -fpartial-inlining @gol
6219 -fpeephole2 @gol
6220 -fregmove @gol
6221 -freorder-blocks  -freorder-functions @gol
6222 -frerun-cse-after-loop  @gol
6223 -fsched-interblock  -fsched-spec @gol
6224 -fschedule-insns  -fschedule-insns2 @gol
6225 -fstrict-aliasing -fstrict-overflow @gol
6226 -ftree-switch-conversion -ftree-tail-merge @gol
6227 -ftree-pre @gol
6228 -ftree-vrp}
6230 Please note the warning under @option{-fgcse} about
6231 invoking @option{-O2} on programs that use computed gotos.
6233 @item -O3
6234 @opindex O3
6235 Optimize yet more.  @option{-O3} turns on all optimizations specified
6236 by @option{-O2} and also turns on the @option{-finline-functions},
6237 @option{-funswitch-loops}, @option{-fpredictive-commoning},
6238 @option{-fgcse-after-reload}, @option{-ftree-vectorize} and
6239 @option{-fipa-cp-clone} options.
6241 @item -O0
6242 @opindex O0
6243 Reduce compilation time and make debugging produce the expected
6244 results.  This is the default.
6246 @item -Os
6247 @opindex Os
6248 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
6249 do not typically increase code size.  It also performs further
6250 optimizations designed to reduce code size.
6252 @option{-Os} disables the following optimization flags:
6253 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
6254 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
6255 -fprefetch-loop-arrays  -ftree-vect-loop-version}
6257 @item -Ofast
6258 @opindex Ofast
6259 Disregard strict standards compliance.  @option{-Ofast} enables all
6260 @option{-O3} optimizations.  It also enables optimizations that are not
6261 valid for all standard compliant programs.
6262 It turns on @option{-ffast-math} and the Fortran-specific
6263 @option{-fno-protect-parens} and @option{-fstack-arrays}.
6265 If you use multiple @option{-O} options, with or without level numbers,
6266 the last such option is the one that is effective.
6267 @end table
6269 Options of the form @option{-f@var{flag}} specify machine-independent
6270 flags.  Most flags have both positive and negative forms; the negative
6271 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
6272 below, only one of the forms is listed---the one you typically will
6273 use.  You can figure out the other form by either removing @samp{no-}
6274 or adding it.
6276 The following options control specific optimizations.  They are either
6277 activated by @option{-O} options or are related to ones that are.  You
6278 can use the following flags in the rare cases when ``fine-tuning'' of
6279 optimizations to be performed is desired.
6281 @table @gcctabopt
6282 @item -fno-default-inline
6283 @opindex fno-default-inline
6284 Do not make member functions inline by default merely because they are
6285 defined inside the class scope (C++ only).  Otherwise, when you specify
6286 @w{@option{-O}}, member functions defined inside class scope are compiled
6287 inline by default; i.e., you don't need to add @samp{inline} in front of
6288 the member function name.
6290 @item -fno-defer-pop
6291 @opindex fno-defer-pop
6292 Always pop the arguments to each function call as soon as that function
6293 returns.  For machines that must pop arguments after a function call,
6294 the compiler normally lets arguments accumulate on the stack for several
6295 function calls and pops them all at once.
6297 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6299 @item -fforward-propagate
6300 @opindex fforward-propagate
6301 Perform a forward propagation pass on RTL@.  The pass tries to combine two
6302 instructions and checks if the result can be simplified.  If loop unrolling
6303 is active, two passes are performed and the second is scheduled after
6304 loop unrolling.
6306 This option is enabled by default at optimization levels @option{-O},
6307 @option{-O2}, @option{-O3}, @option{-Os}.
6309 @item -ffp-contract=@var{style}
6310 @opindex ffp-contract
6311 @option{-ffp-contract=off} disables floating-point expression contraction.
6312 @option{-ffp-contract=fast} enables floating-point expression contraction
6313 such as forming of fused multiply-add operations if the target has
6314 native support for them.
6315 @option{-ffp-contract=on} enables floating-point expression contraction
6316 if allowed by the language standard.  This is currently not implemented
6317 and treated equal to @option{-ffp-contract=off}.
6319 The default is @option{-ffp-contract=fast}.
6321 @item -fomit-frame-pointer
6322 @opindex fomit-frame-pointer
6323 Don't keep the frame pointer in a register for functions that
6324 don't need one.  This avoids the instructions to save, set up and
6325 restore frame pointers; it also makes an extra register available
6326 in many functions.  @strong{It also makes debugging impossible on
6327 some machines.}
6329 On some machines, such as the VAX, this flag has no effect, because
6330 the standard calling sequence automatically handles the frame pointer
6331 and nothing is saved by pretending it doesn't exist.  The
6332 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
6333 whether a target machine supports this flag.  @xref{Registers,,Register
6334 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
6336 Starting with GCC version 4.6, the default setting (when not optimizing for
6337 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets has been changed to
6338 @option{-fomit-frame-pointer}.  The default can be reverted to
6339 @option{-fno-omit-frame-pointer} by configuring GCC with the
6340 @option{--enable-frame-pointer} configure option.
6342 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6344 @item -foptimize-sibling-calls
6345 @opindex foptimize-sibling-calls
6346 Optimize sibling and tail recursive calls.
6348 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6350 @item -fno-inline
6351 @opindex fno-inline
6352 Do not expand any functions inline apart from those marked with
6353 the @code{always_inline} attribute.  This is the default when not
6354 optimizing.
6356 Single functions can be exempted from inlining by marking them
6357 with the @code{noinline} attribute.
6359 @item -finline-small-functions
6360 @opindex finline-small-functions
6361 Integrate functions into their callers when their body is smaller than expected
6362 function call code (so overall size of program gets smaller).  The compiler
6363 heuristically decides which functions are simple enough to be worth integrating
6364 in this way.  This inlining applies to all functions, even those not declared
6365 inline.
6367 Enabled at level @option{-O2}.
6369 @item -findirect-inlining
6370 @opindex findirect-inlining
6371 Inline also indirect calls that are discovered to be known at compile
6372 time thanks to previous inlining.  This option has any effect only
6373 when inlining itself is turned on by the @option{-finline-functions}
6374 or @option{-finline-small-functions} options.
6376 Enabled at level @option{-O2}.
6378 @item -finline-functions
6379 @opindex finline-functions
6380 Consider all functions for inlining, even if they are not declared inline.
6381 The compiler heuristically decides which functions are worth integrating
6382 in this way.
6384 If all calls to a given function are integrated, and the function is
6385 declared @code{static}, then the function is normally not output as
6386 assembler code in its own right.
6388 Enabled at level @option{-O3}.
6390 @item -finline-functions-called-once
6391 @opindex finline-functions-called-once
6392 Consider all @code{static} functions called once for inlining into their
6393 caller even if they are not marked @code{inline}.  If a call to a given
6394 function is integrated, then the function is not output as assembler code
6395 in its own right.
6397 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
6399 @item -fearly-inlining
6400 @opindex fearly-inlining
6401 Inline functions marked by @code{always_inline} and functions whose body seems
6402 smaller than the function call overhead early before doing
6403 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
6404 makes profiling significantly cheaper and usually inlining faster on programs
6405 having large chains of nested wrapper functions.
6407 Enabled by default.
6409 @item -fipa-sra
6410 @opindex fipa-sra
6411 Perform interprocedural scalar replacement of aggregates, removal of
6412 unused parameters and replacement of parameters passed by reference
6413 by parameters passed by value.
6415 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
6417 @item -finline-limit=@var{n}
6418 @opindex finline-limit
6419 By default, GCC limits the size of functions that can be inlined.  This flag
6420 allows coarse control of this limit.  @var{n} is the size of functions that
6421 can be inlined in number of pseudo instructions.
6423 Inlining is actually controlled by a number of parameters, which may be
6424 specified individually by using @option{--param @var{name}=@var{value}}.
6425 The @option{-finline-limit=@var{n}} option sets some of these parameters
6426 as follows:
6428 @table @gcctabopt
6429 @item max-inline-insns-single
6430 is set to @var{n}/2.
6431 @item max-inline-insns-auto
6432 is set to @var{n}/2.
6433 @end table
6435 See below for a documentation of the individual
6436 parameters controlling inlining and for the defaults of these parameters.
6438 @emph{Note:} there may be no value to @option{-finline-limit} that results
6439 in default behavior.
6441 @emph{Note:} pseudo instruction represents, in this particular context, an
6442 abstract measurement of function's size.  In no way does it represent a count
6443 of assembly instructions and as such its exact meaning might change from one
6444 release to an another.
6446 @item -fno-keep-inline-dllexport
6447 @opindex -fno-keep-inline-dllexport
6448 This is a more fine-grained version of @option{-fkeep-inline-functions},
6449 which applies only to functions that are declared using the @code{dllexport}
6450 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
6451 Functions}.)
6453 @item -fkeep-inline-functions
6454 @opindex fkeep-inline-functions
6455 In C, emit @code{static} functions that are declared @code{inline}
6456 into the object file, even if the function has been inlined into all
6457 of its callers.  This switch does not affect functions using the
6458 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
6459 inline functions into the object file.
6461 @item -fkeep-static-consts
6462 @opindex fkeep-static-consts
6463 Emit variables declared @code{static const} when optimization isn't turned
6464 on, even if the variables aren't referenced.
6466 GCC enables this option by default.  If you want to force the compiler to
6467 check if the variable was referenced, regardless of whether or not
6468 optimization is turned on, use the @option{-fno-keep-static-consts} option.
6470 @item -fmerge-constants
6471 @opindex fmerge-constants
6472 Attempt to merge identical constants (string constants and floating-point
6473 constants) across compilation units.
6475 This option is the default for optimized compilation if the assembler and
6476 linker support it.  Use @option{-fno-merge-constants} to inhibit this
6477 behavior.
6479 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6481 @item -fmerge-all-constants
6482 @opindex fmerge-all-constants
6483 Attempt to merge identical constants and identical variables.
6485 This option implies @option{-fmerge-constants}.  In addition to
6486 @option{-fmerge-constants} this considers e.g.@: even constant initialized
6487 arrays or initialized constant variables with integral or floating-point
6488 types.  Languages like C or C++ require each variable, including multiple
6489 instances of the same variable in recursive calls, to have distinct locations,
6490 so using this option will result in non-conforming
6491 behavior.
6493 @item -fmodulo-sched
6494 @opindex fmodulo-sched
6495 Perform swing modulo scheduling immediately before the first scheduling
6496 pass.  This pass looks at innermost loops and reorders their
6497 instructions by overlapping different iterations.
6499 @item -fmodulo-sched-allow-regmoves
6500 @opindex fmodulo-sched-allow-regmoves
6501 Perform more aggressive SMS based modulo scheduling with register moves
6502 allowed.  By setting this flag certain anti-dependences edges will be
6503 deleted which will trigger the generation of reg-moves based on the
6504 life-range analysis.  This option is effective only with
6505 @option{-fmodulo-sched} enabled.
6507 @item -fno-branch-count-reg
6508 @opindex fno-branch-count-reg
6509 Do not use ``decrement and branch'' instructions on a count register,
6510 but instead generate a sequence of instructions that decrement a
6511 register, compare it against zero, then branch based upon the result.
6512 This option is only meaningful on architectures that support such
6513 instructions, which include x86, PowerPC, IA-64 and S/390.
6515 The default is @option{-fbranch-count-reg}.
6517 @item -fno-function-cse
6518 @opindex fno-function-cse
6519 Do not put function addresses in registers; make each instruction that
6520 calls a constant function contain the function's address explicitly.
6522 This option results in less efficient code, but some strange hacks
6523 that alter the assembler output may be confused by the optimizations
6524 performed when this option is not used.
6526 The default is @option{-ffunction-cse}
6528 @item -fno-zero-initialized-in-bss
6529 @opindex fno-zero-initialized-in-bss
6530 If the target supports a BSS section, GCC by default puts variables that
6531 are initialized to zero into BSS@.  This can save space in the resulting
6532 code.
6534 This option turns off this behavior because some programs explicitly
6535 rely on variables going to the data section.  E.g., so that the
6536 resulting executable can find the beginning of that section and/or make
6537 assumptions based on that.
6539 The default is @option{-fzero-initialized-in-bss}.
6541 @item -fmudflap -fmudflapth -fmudflapir
6542 @opindex fmudflap
6543 @opindex fmudflapth
6544 @opindex fmudflapir
6545 @cindex bounds checking
6546 @cindex mudflap
6547 For front-ends that support it (C and C++), instrument all risky
6548 pointer/array dereferencing operations, some standard library
6549 string/heap functions, and some other associated constructs with
6550 range/validity tests.  Modules so instrumented should be immune to
6551 buffer overflows, invalid heap use, and some other classes of C/C++
6552 programming errors.  The instrumentation relies on a separate runtime
6553 library (@file{libmudflap}), which will be linked into a program if
6554 @option{-fmudflap} is given at link time.  Run-time behavior of the
6555 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
6556 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
6557 for its options.
6559 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
6560 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
6561 addition to @option{-fmudflap} or @option{-fmudflapth}, if
6562 instrumentation should ignore pointer reads.  This produces less
6563 instrumentation (and therefore faster execution) and still provides
6564 some protection against outright memory corrupting writes, but allows
6565 erroneously read data to propagate within a program.
6567 @item -fthread-jumps
6568 @opindex fthread-jumps
6569 Perform optimizations where we check to see if a jump branches to a
6570 location where another comparison subsumed by the first is found.  If
6571 so, the first branch is redirected to either the destination of the
6572 second branch or a point immediately following it, depending on whether
6573 the condition is known to be true or false.
6575 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6577 @item -fsplit-wide-types
6578 @opindex fsplit-wide-types
6579 When using a type that occupies multiple registers, such as @code{long
6580 long} on a 32-bit system, split the registers apart and allocate them
6581 independently.  This normally generates better code for those types,
6582 but may make debugging more difficult.
6584 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
6585 @option{-Os}.
6587 @item -fcse-follow-jumps
6588 @opindex fcse-follow-jumps
6589 In common subexpression elimination (CSE), scan through jump instructions
6590 when the target of the jump is not reached by any other path.  For
6591 example, when CSE encounters an @code{if} statement with an
6592 @code{else} clause, CSE will follow the jump when the condition
6593 tested is false.
6595 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6597 @item -fcse-skip-blocks
6598 @opindex fcse-skip-blocks
6599 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
6600 follow jumps that conditionally skip over blocks.  When CSE
6601 encounters a simple @code{if} statement with no else clause,
6602 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
6603 body of the @code{if}.
6605 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6607 @item -frerun-cse-after-loop
6608 @opindex frerun-cse-after-loop
6609 Re-run common subexpression elimination after loop optimizations has been
6610 performed.
6612 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6614 @item -fgcse
6615 @opindex fgcse
6616 Perform a global common subexpression elimination pass.
6617 This pass also performs global constant and copy propagation.
6619 @emph{Note:} When compiling a program using computed gotos, a GCC
6620 extension, you may get better run-time performance if you disable
6621 the global common subexpression elimination pass by adding
6622 @option{-fno-gcse} to the command line.
6624 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6626 @item -fgcse-lm
6627 @opindex fgcse-lm
6628 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
6629 attempt to move loads that are only killed by stores into themselves.  This
6630 allows a loop containing a load/store sequence to be changed to a load outside
6631 the loop, and a copy/store within the loop.
6633 Enabled by default when gcse is enabled.
6635 @item -fgcse-sm
6636 @opindex fgcse-sm
6637 When @option{-fgcse-sm} is enabled, a store motion pass is run after
6638 global common subexpression elimination.  This pass will attempt to move
6639 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
6640 loops containing a load/store sequence can be changed to a load before
6641 the loop and a store after the loop.
6643 Not enabled at any optimization level.
6645 @item -fgcse-las
6646 @opindex fgcse-las
6647 When @option{-fgcse-las} is enabled, the global common subexpression
6648 elimination pass eliminates redundant loads that come after stores to the
6649 same memory location (both partial and full redundancies).
6651 Not enabled at any optimization level.
6653 @item -fgcse-after-reload
6654 @opindex fgcse-after-reload
6655 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
6656 pass is performed after reload.  The purpose of this pass is to cleanup
6657 redundant spilling.
6659 @item -funsafe-loop-optimizations
6660 @opindex funsafe-loop-optimizations
6661 If given, the loop optimizer will assume that loop indices do not
6662 overflow, and that the loops with nontrivial exit condition are not
6663 infinite.  This enables a wider range of loop optimizations even if
6664 the loop optimizer itself cannot prove that these assumptions are valid.
6665 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
6666 if it finds this kind of loop.
6668 @item -fcrossjumping
6669 @opindex fcrossjumping
6670 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
6671 resulting code may or may not perform better than without cross-jumping.
6673 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6675 @item -fauto-inc-dec
6676 @opindex fauto-inc-dec
6677 Combine increments or decrements of addresses with memory accesses.
6678 This pass is always skipped on architectures that do not have
6679 instructions to support this.  Enabled by default at @option{-O} and
6680 higher on architectures that support this.
6682 @item -fdce
6683 @opindex fdce
6684 Perform dead code elimination (DCE) on RTL@.
6685 Enabled by default at @option{-O} and higher.
6687 @item -fdse
6688 @opindex fdse
6689 Perform dead store elimination (DSE) on RTL@.
6690 Enabled by default at @option{-O} and higher.
6692 @item -fif-conversion
6693 @opindex fif-conversion
6694 Attempt to transform conditional jumps into branch-less equivalents.  This
6695 include use of conditional moves, min, max, set flags and abs instructions, and
6696 some tricks doable by standard arithmetics.  The use of conditional execution
6697 on chips where it is available is controlled by @code{if-conversion2}.
6699 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6701 @item -fif-conversion2
6702 @opindex fif-conversion2
6703 Use conditional execution (where available) to transform conditional jumps into
6704 branch-less equivalents.
6706 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6708 @item -fdelete-null-pointer-checks
6709 @opindex fdelete-null-pointer-checks
6710 Assume that programs cannot safely dereference null pointers, and that
6711 no code or data element resides there.  This enables simple constant
6712 folding optimizations at all optimization levels.  In addition, other
6713 optimization passes in GCC use this flag to control global dataflow
6714 analyses that eliminate useless checks for null pointers; these assume
6715 that if a pointer is checked after it has already been dereferenced,
6716 it cannot be null.
6718 Note however that in some environments this assumption is not true.
6719 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
6720 for programs that depend on that behavior.
6722 Some targets, especially embedded ones, disable this option at all levels.
6723 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
6724 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
6725 are enabled independently at different optimization levels.
6727 @item -fdevirtualize
6728 @opindex fdevirtualize
6729 Attempt to convert calls to virtual functions to direct calls.  This
6730 is done both within a procedure and interprocedurally as part of
6731 indirect inlining (@code{-findirect-inlining}) and interprocedural constant
6732 propagation (@option{-fipa-cp}).
6733 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6735 @item -fexpensive-optimizations
6736 @opindex fexpensive-optimizations
6737 Perform a number of minor optimizations that are relatively expensive.
6739 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6741 @item -free
6742 @opindex free
6743 Attempt to remove redundant extension instructions.  This is especially
6744 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
6745 registers after writing to their lower 32-bit half.
6747 Enabled for x86 at levels @option{-O2}, @option{-O3}.
6749 @item -foptimize-register-move
6750 @itemx -fregmove
6751 @opindex foptimize-register-move
6752 @opindex fregmove
6753 Attempt to reassign register numbers in move instructions and as
6754 operands of other simple instructions in order to maximize the amount of
6755 register tying.  This is especially helpful on machines with two-operand
6756 instructions.
6758 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
6759 optimization.
6761 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6763 @item -fira-algorithm=@var{algorithm}
6764 Use the specified coloring algorithm for the integrated register
6765 allocator.  The @var{algorithm} argument can be @samp{priority}, which
6766 specifies Chow's priority coloring, or @samp{CB}, which specifies
6767 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
6768 for all architectures, but for those targets that do support it, it is
6769 the default because it generates better code.
6771 @item -fira-region=@var{region}
6772 Use specified regions for the integrated register allocator.  The
6773 @var{region} argument should be one of the following:
6775 @table @samp
6777 @item all
6778 Use all loops as register allocation regions.
6779 This can give the best results for machines with a small and/or
6780 irregular register set.
6782 @item mixed
6783 Use all loops except for loops with small register pressure 
6784 as the regions.  This value usually gives
6785 the best results in most cases and for most architectures,
6786 and is enabled by default when compiling with optimization for speed
6787 (@option{-O}, @option{-O2}, @dots{}).
6789 @item one
6790 Use all functions as a single region.  
6791 This typically results in the smallest code size, and is enabled by default for
6792 @option{-Os} or @option{-O0}.
6794 @end table
6796 @item -fira-loop-pressure
6797 @opindex fira-loop-pressure
6798 Use IRA to evaluate register pressure in loops for decisions to move
6799 loop invariants.  This option usually results in generation
6800 of faster and smaller code on machines with large register files (>= 32
6801 registers), but it can slow the compiler down.
6803 This option is enabled at level @option{-O3} for some targets.
6805 @item -fno-ira-share-save-slots
6806 @opindex fno-ira-share-save-slots
6807 Disable sharing of stack slots used for saving call-used hard
6808 registers living through a call.  Each hard register gets a
6809 separate stack slot, and as a result function stack frames are
6810 larger.
6812 @item -fno-ira-share-spill-slots
6813 @opindex fno-ira-share-spill-slots
6814 Disable sharing of stack slots allocated for pseudo-registers.  Each
6815 pseudo-register that does not get a hard register gets a separate
6816 stack slot, and as a result function stack frames are larger.
6818 @item -fira-verbose=@var{n}
6819 @opindex fira-verbose
6820 Control the verbosity of the dump file for the integrated register allocator.
6821 The default value is 5.  If the value @var{n} is greater or equal to 10,
6822 the dump output is sent to stderr using the same format as @var{n} minus 10.
6824 @item -fdelayed-branch
6825 @opindex fdelayed-branch
6826 If supported for the target machine, attempt to reorder instructions
6827 to exploit instruction slots available after delayed branch
6828 instructions.
6830 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6832 @item -fschedule-insns
6833 @opindex fschedule-insns
6834 If supported for the target machine, attempt to reorder instructions to
6835 eliminate execution stalls due to required data being unavailable.  This
6836 helps machines that have slow floating point or memory load instructions
6837 by allowing other instructions to be issued until the result of the load
6838 or floating-point instruction is required.
6840 Enabled at levels @option{-O2}, @option{-O3}.
6842 @item -fschedule-insns2
6843 @opindex fschedule-insns2
6844 Similar to @option{-fschedule-insns}, but requests an additional pass of
6845 instruction scheduling after register allocation has been done.  This is
6846 especially useful on machines with a relatively small number of
6847 registers and where memory load instructions take more than one cycle.
6849 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6851 @item -fno-sched-interblock
6852 @opindex fno-sched-interblock
6853 Don't schedule instructions across basic blocks.  This is normally
6854 enabled by default when scheduling before register allocation, i.e.@:
6855 with @option{-fschedule-insns} or at @option{-O2} or higher.
6857 @item -fno-sched-spec
6858 @opindex fno-sched-spec
6859 Don't allow speculative motion of non-load instructions.  This is normally
6860 enabled by default when scheduling before register allocation, i.e.@:
6861 with @option{-fschedule-insns} or at @option{-O2} or higher.
6863 @item -fsched-pressure
6864 @opindex fsched-pressure
6865 Enable register pressure sensitive insn scheduling before the register
6866 allocation.  This only makes sense when scheduling before register
6867 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
6868 @option{-O2} or higher.  Usage of this option can improve the
6869 generated code and decrease its size by preventing register pressure
6870 increase above the number of available hard registers and as a
6871 consequence register spills in the register allocation.
6873 @item -fsched-spec-load
6874 @opindex fsched-spec-load
6875 Allow speculative motion of some load instructions.  This only makes
6876 sense when scheduling before register allocation, i.e.@: with
6877 @option{-fschedule-insns} or at @option{-O2} or higher.
6879 @item -fsched-spec-load-dangerous
6880 @opindex fsched-spec-load-dangerous
6881 Allow speculative motion of more load instructions.  This only makes
6882 sense when scheduling before register allocation, i.e.@: with
6883 @option{-fschedule-insns} or at @option{-O2} or higher.
6885 @item -fsched-stalled-insns
6886 @itemx -fsched-stalled-insns=@var{n}
6887 @opindex fsched-stalled-insns
6888 Define how many insns (if any) can be moved prematurely from the queue
6889 of stalled insns into the ready list, during the second scheduling pass.
6890 @option{-fno-sched-stalled-insns} means that no insns will be moved
6891 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
6892 on how many queued insns can be moved prematurely.
6893 @option{-fsched-stalled-insns} without a value is equivalent to
6894 @option{-fsched-stalled-insns=1}.
6896 @item -fsched-stalled-insns-dep
6897 @itemx -fsched-stalled-insns-dep=@var{n}
6898 @opindex fsched-stalled-insns-dep
6899 Define how many insn groups (cycles) will be examined for a dependency
6900 on a stalled insn that is candidate for premature removal from the queue
6901 of stalled insns.  This has an effect only during the second scheduling pass,
6902 and only if @option{-fsched-stalled-insns} is used.
6903 @option{-fno-sched-stalled-insns-dep} is equivalent to
6904 @option{-fsched-stalled-insns-dep=0}.
6905 @option{-fsched-stalled-insns-dep} without a value is equivalent to
6906 @option{-fsched-stalled-insns-dep=1}.
6908 @item -fsched2-use-superblocks
6909 @opindex fsched2-use-superblocks
6910 When scheduling after register allocation, do use superblock scheduling
6911 algorithm.  Superblock scheduling allows motion across basic block boundaries
6912 resulting on faster schedules.  This option is experimental, as not all machine
6913 descriptions used by GCC model the CPU closely enough to avoid unreliable
6914 results from the algorithm.
6916 This only makes sense when scheduling after register allocation, i.e.@: with
6917 @option{-fschedule-insns2} or at @option{-O2} or higher.
6919 @item -fsched-group-heuristic
6920 @opindex fsched-group-heuristic
6921 Enable the group heuristic in the scheduler.  This heuristic favors
6922 the instruction that belongs to a schedule group.  This is enabled
6923 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
6924 or @option{-fschedule-insns2} or at @option{-O2} or higher.
6926 @item -fsched-critical-path-heuristic
6927 @opindex fsched-critical-path-heuristic
6928 Enable the critical-path heuristic in the scheduler.  This heuristic favors
6929 instructions on the critical path.  This is enabled by default when
6930 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
6931 or @option{-fschedule-insns2} or at @option{-O2} or higher.
6933 @item -fsched-spec-insn-heuristic
6934 @opindex fsched-spec-insn-heuristic
6935 Enable the speculative instruction heuristic in the scheduler.  This
6936 heuristic favors speculative instructions with greater dependency weakness.
6937 This is enabled by default when scheduling is enabled, i.e.@:
6938 with @option{-fschedule-insns} or @option{-fschedule-insns2}
6939 or at @option{-O2} or higher.
6941 @item -fsched-rank-heuristic
6942 @opindex fsched-rank-heuristic
6943 Enable the rank heuristic in the scheduler.  This heuristic favors
6944 the instruction belonging to a basic block with greater size or frequency.
6945 This is enabled by default when scheduling is enabled, i.e.@:
6946 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
6947 at @option{-O2} or higher.
6949 @item -fsched-last-insn-heuristic
6950 @opindex fsched-last-insn-heuristic
6951 Enable the last-instruction heuristic in the scheduler.  This heuristic
6952 favors the instruction that is less dependent on the last instruction
6953 scheduled.  This is enabled by default when scheduling is enabled,
6954 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
6955 at @option{-O2} or higher.
6957 @item -fsched-dep-count-heuristic
6958 @opindex fsched-dep-count-heuristic
6959 Enable the dependent-count heuristic in the scheduler.  This heuristic
6960 favors the instruction that has more instructions depending on it.
6961 This is enabled by default when scheduling is enabled, i.e.@:
6962 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
6963 at @option{-O2} or higher.
6965 @item -freschedule-modulo-scheduled-loops
6966 @opindex freschedule-modulo-scheduled-loops
6967 The modulo scheduling comes before the traditional scheduling, if a loop
6968 was modulo scheduled we may want to prevent the later scheduling passes
6969 from changing its schedule, we use this option to control that.
6971 @item -fselective-scheduling
6972 @opindex fselective-scheduling
6973 Schedule instructions using selective scheduling algorithm.  Selective
6974 scheduling runs instead of the first scheduler pass.
6976 @item -fselective-scheduling2
6977 @opindex fselective-scheduling2
6978 Schedule instructions using selective scheduling algorithm.  Selective
6979 scheduling runs instead of the second scheduler pass.
6981 @item -fsel-sched-pipelining
6982 @opindex fsel-sched-pipelining
6983 Enable software pipelining of innermost loops during selective scheduling.
6984 This option has no effect until one of @option{-fselective-scheduling} or
6985 @option{-fselective-scheduling2} is turned on.
6987 @item -fsel-sched-pipelining-outer-loops
6988 @opindex fsel-sched-pipelining-outer-loops
6989 When pipelining loops during selective scheduling, also pipeline outer loops.
6990 This option has no effect until @option{-fsel-sched-pipelining} is turned on.
6992 @item -fshrink-wrap
6993 @opindex fshrink-wrap
6994 Emit function prologues only before parts of the function that need it,
6995 rather than at the top of the function.  This flag is enabled by default at
6996 @option{-O} and higher.
6998 @item -fcaller-saves
6999 @opindex fcaller-saves
7000 Enable values to be allocated in registers that will be clobbered by
7001 function calls, by emitting extra instructions to save and restore the
7002 registers around such calls.  Such allocation is done only when it
7003 seems to result in better code than would otherwise be produced.
7005 This option is always enabled by default on certain machines, usually
7006 those which have no call-preserved registers to use instead.
7008 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7010 @item -fcombine-stack-adjustments
7011 @opindex fcombine-stack-adjustments
7012 Tracks stack adjustments (pushes and pops) and stack memory references
7013 and then tries to find ways to combine them.
7015 Enabled by default at @option{-O1} and higher.
7017 @item -fconserve-stack
7018 @opindex fconserve-stack
7019 Attempt to minimize stack usage.  The compiler will attempt to use less
7020 stack space, even if that makes the program slower.  This option
7021 implies setting the @option{large-stack-frame} parameter to 100
7022 and the @option{large-stack-frame-growth} parameter to 400.
7024 @item -ftree-reassoc
7025 @opindex ftree-reassoc
7026 Perform reassociation on trees.  This flag is enabled by default
7027 at @option{-O} and higher.
7029 @item -ftree-pre
7030 @opindex ftree-pre
7031 Perform partial redundancy elimination (PRE) on trees.  This flag is
7032 enabled by default at @option{-O2} and @option{-O3}.
7034 @item -ftree-forwprop
7035 @opindex ftree-forwprop
7036 Perform forward propagation on trees.  This flag is enabled by default
7037 at @option{-O} and higher.
7039 @item -ftree-fre
7040 @opindex ftree-fre
7041 Perform full redundancy elimination (FRE) on trees.  The difference
7042 between FRE and PRE is that FRE only considers expressions
7043 that are computed on all paths leading to the redundant computation.
7044 This analysis is faster than PRE, though it exposes fewer redundancies.
7045 This flag is enabled by default at @option{-O} and higher.
7047 @item -ftree-phiprop
7048 @opindex ftree-phiprop
7049 Perform hoisting of loads from conditional pointers on trees.  This
7050 pass is enabled by default at @option{-O} and higher.
7052 @item -ftree-copy-prop
7053 @opindex ftree-copy-prop
7054 Perform copy propagation on trees.  This pass eliminates unnecessary
7055 copy operations.  This flag is enabled by default at @option{-O} and
7056 higher.
7058 @item -fipa-pure-const
7059 @opindex fipa-pure-const
7060 Discover which functions are pure or constant.
7061 Enabled by default at @option{-O} and higher.
7063 @item -fipa-reference
7064 @opindex fipa-reference
7065 Discover which static variables do not escape cannot escape the
7066 compilation unit.
7067 Enabled by default at @option{-O} and higher.
7069 @item -fipa-pta
7070 @opindex fipa-pta
7071 Perform interprocedural pointer analysis and interprocedural modification
7072 and reference analysis.  This option can cause excessive memory and
7073 compile-time usage on large compilation units.  It is not enabled by
7074 default at any optimization level.
7076 @item -fipa-profile
7077 @opindex fipa-profile
7078 Perform interprocedural profile propagation.  The functions called only from
7079 cold functions are marked as cold. Also functions executed once (such as
7080 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
7081 functions and loop less parts of functions executed once are then optimized for
7082 size.
7083 Enabled by default at @option{-O} and higher.
7085 @item -fipa-cp
7086 @opindex fipa-cp
7087 Perform interprocedural constant propagation.
7088 This optimization analyzes the program to determine when values passed
7089 to functions are constants and then optimizes accordingly.
7090 This optimization can substantially increase performance
7091 if the application has constants passed to functions.
7092 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
7094 @item -fipa-cp-clone
7095 @opindex fipa-cp-clone
7096 Perform function cloning to make interprocedural constant propagation stronger.
7097 When enabled, interprocedural constant propagation will perform function cloning
7098 when externally visible function can be called with constant arguments.
7099 Because this optimization can create multiple copies of functions,
7100 it may significantly increase code size
7101 (see @option{--param ipcp-unit-growth=@var{value}}).
7102 This flag is enabled by default at @option{-O3}.
7104 @item -fipa-matrix-reorg
7105 @opindex fipa-matrix-reorg
7106 Perform matrix flattening and transposing.
7107 Matrix flattening tries to replace an @math{m}-dimensional matrix
7108 with its equivalent @math{n}-dimensional matrix, where @math{n < m}.
7109 This reduces the level of indirection needed for accessing the elements
7110 of the matrix. The second optimization is matrix transposing, which
7111 attempts to change the order of the matrix's dimensions in order to
7112 improve cache locality.
7113 Both optimizations need the @option{-fwhole-program} flag.
7114 Transposing is enabled only if profiling information is available.
7116 @item -ftree-sink
7117 @opindex ftree-sink
7118 Perform forward store motion  on trees.  This flag is
7119 enabled by default at @option{-O} and higher.
7121 @item -ftree-bit-ccp
7122 @opindex ftree-bit-ccp
7123 Perform sparse conditional bit constant propagation on trees and propagate
7124 pointer alignment information.
7125 This pass only operates on local scalar variables and is enabled by default
7126 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
7128 @item -ftree-ccp
7129 @opindex ftree-ccp
7130 Perform sparse conditional constant propagation (CCP) on trees.  This
7131 pass only operates on local scalar variables and is enabled by default
7132 at @option{-O} and higher.
7134 @item -ftree-switch-conversion
7135 Perform conversion of simple initializations in a switch to
7136 initializations from a scalar array.  This flag is enabled by default
7137 at @option{-O2} and higher.
7139 @item -ftree-tail-merge
7140 Look for identical code sequences.  When found, replace one with a jump to the
7141 other.  This optimization is known as tail merging or cross jumping.  This flag
7142 is enabled by default at @option{-O2} and higher.  The compilation time
7143 in this pass can
7144 be limited using @option{max-tail-merge-comparisons} parameter and
7145 @option{max-tail-merge-iterations} parameter.
7147 @item -ftree-dce
7148 @opindex ftree-dce
7149 Perform dead code elimination (DCE) on trees.  This flag is enabled by
7150 default at @option{-O} and higher.
7152 @item -ftree-builtin-call-dce
7153 @opindex ftree-builtin-call-dce
7154 Perform conditional dead code elimination (DCE) for calls to builtin functions
7155 that may set @code{errno} but are otherwise side-effect free.  This flag is
7156 enabled by default at @option{-O2} and higher if @option{-Os} is not also
7157 specified.
7159 @item -ftree-dominator-opts
7160 @opindex ftree-dominator-opts
7161 Perform a variety of simple scalar cleanups (constant/copy
7162 propagation, redundancy elimination, range propagation and expression
7163 simplification) based on a dominator tree traversal.  This also
7164 performs jump threading (to reduce jumps to jumps). This flag is
7165 enabled by default at @option{-O} and higher.
7167 @item -ftree-dse
7168 @opindex ftree-dse
7169 Perform dead store elimination (DSE) on trees.  A dead store is a store into
7170 a memory location that is later overwritten by another store without
7171 any intervening loads.  In this case the earlier store can be deleted.  This
7172 flag is enabled by default at @option{-O} and higher.
7174 @item -ftree-ch
7175 @opindex ftree-ch
7176 Perform loop header copying on trees.  This is beneficial since it increases
7177 effectiveness of code motion optimizations.  It also saves one jump.  This flag
7178 is enabled by default at @option{-O} and higher.  It is not enabled
7179 for @option{-Os}, since it usually increases code size.
7181 @item -ftree-loop-optimize
7182 @opindex ftree-loop-optimize
7183 Perform loop optimizations on trees.  This flag is enabled by default
7184 at @option{-O} and higher.
7186 @item -ftree-loop-linear
7187 @opindex ftree-loop-linear
7188 Perform loop interchange transformations on tree.  Same as
7189 @option{-floop-interchange}.  To use this code transformation, GCC has
7190 to be configured with @option{--with-ppl} and @option{--with-cloog} to
7191 enable the Graphite loop transformation infrastructure.
7193 @item -floop-interchange
7194 @opindex floop-interchange
7195 Perform loop interchange transformations on loops.  Interchanging two
7196 nested loops switches the inner and outer loops.  For example, given a
7197 loop like:
7198 @smallexample
7199 DO J = 1, M
7200   DO I = 1, N
7201     A(J, I) = A(J, I) * C
7202   ENDDO
7203 ENDDO
7204 @end smallexample
7205 loop interchange will transform the loop as if the user had written:
7206 @smallexample
7207 DO I = 1, N
7208   DO J = 1, M
7209     A(J, I) = A(J, I) * C
7210   ENDDO
7211 ENDDO
7212 @end smallexample
7213 which can be beneficial when @code{N} is larger than the caches,
7214 because in Fortran, the elements of an array are stored in memory
7215 contiguously by column, and the original loop iterates over rows,
7216 potentially creating at each access a cache miss.  This optimization
7217 applies to all the languages supported by GCC and is not limited to
7218 Fortran.  To use this code transformation, GCC has to be configured
7219 with @option{--with-ppl} and @option{--with-cloog} to enable the
7220 Graphite loop transformation infrastructure.
7222 @item -floop-strip-mine
7223 @opindex floop-strip-mine
7224 Perform loop strip mining transformations on loops.  Strip mining
7225 splits a loop into two nested loops.  The outer loop has strides
7226 equal to the strip size and the inner loop has strides of the
7227 original loop within a strip.  The strip length can be changed
7228 using the @option{loop-block-tile-size} parameter.  For example,
7229 given a loop like:
7230 @smallexample
7231 DO I = 1, N
7232   A(I) = A(I) + C
7233 ENDDO
7234 @end smallexample
7235 loop strip mining will transform the loop as if the user had written:
7236 @smallexample
7237 DO II = 1, N, 51
7238   DO I = II, min (II + 50, N)
7239     A(I) = A(I) + C
7240   ENDDO
7241 ENDDO
7242 @end smallexample
7243 This optimization applies to all the languages supported by GCC and is
7244 not limited to Fortran.  To use this code transformation, GCC has to
7245 be configured with @option{--with-ppl} and @option{--with-cloog} to
7246 enable the Graphite loop transformation infrastructure.
7248 @item -floop-block
7249 @opindex floop-block
7250 Perform loop blocking transformations on loops.  Blocking strip mines
7251 each loop in the loop nest such that the memory accesses of the
7252 element loops fit inside caches.  The strip length can be changed
7253 using the @option{loop-block-tile-size} parameter.  For example, given
7254 a loop like:
7255 @smallexample
7256 DO I = 1, N
7257   DO J = 1, M
7258     A(J, I) = B(I) + C(J)
7259   ENDDO
7260 ENDDO
7261 @end smallexample
7262 loop blocking will transform the loop as if the user had written:
7263 @smallexample
7264 DO II = 1, N, 51
7265   DO JJ = 1, M, 51
7266     DO I = II, min (II + 50, N)
7267       DO J = JJ, min (JJ + 50, M)
7268         A(J, I) = B(I) + C(J)
7269       ENDDO
7270     ENDDO
7271   ENDDO
7272 ENDDO
7273 @end smallexample
7274 which can be beneficial when @code{M} is larger than the caches,
7275 because the innermost loop will iterate over a smaller amount of data
7276 which can be kept in the caches.  This optimization applies to all the
7277 languages supported by GCC and is not limited to Fortran.  To use this
7278 code transformation, GCC has to be configured with @option{--with-ppl}
7279 and @option{--with-cloog} to enable the Graphite loop transformation
7280 infrastructure.
7282 @item -fgraphite-identity
7283 @opindex fgraphite-identity
7284 Enable the identity transformation for graphite.  For every SCoP we generate
7285 the polyhedral representation and transform it back to gimple.  Using
7286 @option{-fgraphite-identity} we can check the costs or benefits of the
7287 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
7288 are also performed by the code generator CLooG, like index splitting and
7289 dead code elimination in loops.
7291 @item -floop-parallelize-all
7292 @opindex floop-parallelize-all
7293 Use the Graphite data dependence analysis to identify loops that can
7294 be parallelized.  Parallelize all the loops that can be analyzed to
7295 not contain loop carried dependences without checking that it is
7296 profitable to parallelize the loops.
7298 @item -fcheck-data-deps
7299 @opindex fcheck-data-deps
7300 Compare the results of several data dependence analyzers.  This option
7301 is used for debugging the data dependence analyzers.
7303 @item -ftree-loop-if-convert
7304 Attempt to transform conditional jumps in the innermost loops to
7305 branch-less equivalents.  The intent is to remove control-flow from
7306 the innermost loops in order to improve the ability of the
7307 vectorization pass to handle these loops.  This is enabled by default
7308 if vectorization is enabled.
7310 @item -ftree-loop-if-convert-stores
7311 Attempt to also if-convert conditional jumps containing memory writes.
7312 This transformation can be unsafe for multi-threaded programs as it
7313 transforms conditional memory writes into unconditional memory writes.
7314 For example,
7315 @smallexample
7316 for (i = 0; i < N; i++)
7317   if (cond)
7318     A[i] = expr;
7319 @end smallexample
7320 would be transformed to
7321 @smallexample
7322 for (i = 0; i < N; i++)
7323   A[i] = cond ? expr : A[i];
7324 @end smallexample
7325 potentially producing data races.
7327 @item -ftree-loop-distribution
7328 Perform loop distribution.  This flag can improve cache performance on
7329 big loop bodies and allow further loop optimizations, like
7330 parallelization or vectorization, to take place.  For example, the loop
7331 @smallexample
7332 DO I = 1, N
7333   A(I) = B(I) + C
7334   D(I) = E(I) * F
7335 ENDDO
7336 @end smallexample
7337 is transformed to
7338 @smallexample
7339 DO I = 1, N
7340    A(I) = B(I) + C
7341 ENDDO
7342 DO I = 1, N
7343    D(I) = E(I) * F
7344 ENDDO
7345 @end smallexample
7347 @item -ftree-loop-distribute-patterns
7348 Perform loop distribution of patterns that can be code generated with
7349 calls to a library.  This flag is enabled by default at @option{-O3}.
7351 This pass distributes the initialization loops and generates a call to
7352 memset zero.  For example, the loop
7353 @smallexample
7354 DO I = 1, N
7355   A(I) = 0
7356   B(I) = A(I) + I
7357 ENDDO
7358 @end smallexample
7359 is transformed to
7360 @smallexample
7361 DO I = 1, N
7362    A(I) = 0
7363 ENDDO
7364 DO I = 1, N
7365    B(I) = A(I) + I
7366 ENDDO
7367 @end smallexample
7368 and the initialization loop is transformed into a call to memset zero.
7370 @item -ftree-loop-im
7371 @opindex ftree-loop-im
7372 Perform loop invariant motion on trees.  This pass moves only invariants that
7373 would be hard to handle at RTL level (function calls, operations that expand to
7374 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
7375 operands of conditions that are invariant out of the loop, so that we can use
7376 just trivial invariantness analysis in loop unswitching.  The pass also includes
7377 store motion.
7379 @item -ftree-loop-ivcanon
7380 @opindex ftree-loop-ivcanon
7381 Create a canonical counter for number of iterations in loops for which
7382 determining number of iterations requires complicated analysis.  Later
7383 optimizations then may determine the number easily.  Useful especially
7384 in connection with unrolling.
7386 @item -fivopts
7387 @opindex fivopts
7388 Perform induction variable optimizations (strength reduction, induction
7389 variable merging and induction variable elimination) on trees.
7391 @item -ftree-parallelize-loops=n
7392 @opindex ftree-parallelize-loops
7393 Parallelize loops, i.e., split their iteration space to run in n threads.
7394 This is only possible for loops whose iterations are independent
7395 and can be arbitrarily reordered.  The optimization is only
7396 profitable on multiprocessor machines, for loops that are CPU-intensive,
7397 rather than constrained e.g.@: by memory bandwidth.  This option
7398 implies @option{-pthread}, and thus is only supported on targets
7399 that have support for @option{-pthread}.
7401 @item -ftree-pta
7402 @opindex ftree-pta
7403 Perform function-local points-to analysis on trees.  This flag is
7404 enabled by default at @option{-O} and higher.
7406 @item -ftree-sra
7407 @opindex ftree-sra
7408 Perform scalar replacement of aggregates.  This pass replaces structure
7409 references with scalars to prevent committing structures to memory too
7410 early.  This flag is enabled by default at @option{-O} and higher.
7412 @item -ftree-copyrename
7413 @opindex ftree-copyrename
7414 Perform copy renaming on trees.  This pass attempts to rename compiler
7415 temporaries to other variables at copy locations, usually resulting in
7416 variable names which more closely resemble the original variables.  This flag
7417 is enabled by default at @option{-O} and higher.
7419 @item -ftree-ter
7420 @opindex ftree-ter
7421 Perform temporary expression replacement during the SSA->normal phase.  Single
7422 use/single def temporaries are replaced at their use location with their
7423 defining expression.  This results in non-GIMPLE code, but gives the expanders
7424 much more complex trees to work on resulting in better RTL generation.  This is
7425 enabled by default at @option{-O} and higher.
7427 @item -ftree-vectorize
7428 @opindex ftree-vectorize
7429 Perform loop vectorization on trees. This flag is enabled by default at
7430 @option{-O3}.
7432 @item -ftree-slp-vectorize
7433 @opindex ftree-slp-vectorize
7434 Perform basic block vectorization on trees. This flag is enabled by default at
7435 @option{-O3} and when @option{-ftree-vectorize} is enabled.
7437 @item -ftree-vect-loop-version
7438 @opindex ftree-vect-loop-version
7439 Perform loop versioning when doing loop vectorization on trees.  When a loop
7440 appears to be vectorizable except that data alignment or data dependence cannot
7441 be determined at compile time, then vectorized and non-vectorized versions of
7442 the loop are generated along with run-time checks for alignment or dependence
7443 to control which version is executed.  This option is enabled by default
7444 except at level @option{-Os} where it is disabled.
7446 @item -fvect-cost-model
7447 @opindex fvect-cost-model
7448 Enable cost model for vectorization.
7450 @item -ftree-vrp
7451 @opindex ftree-vrp
7452 Perform Value Range Propagation on trees.  This is similar to the
7453 constant propagation pass, but instead of values, ranges of values are
7454 propagated.  This allows the optimizers to remove unnecessary range
7455 checks like array bound checks and null pointer checks.  This is
7456 enabled by default at @option{-O2} and higher.  Null pointer check
7457 elimination is only done if @option{-fdelete-null-pointer-checks} is
7458 enabled.
7460 @item -ftracer
7461 @opindex ftracer
7462 Perform tail duplication to enlarge superblock size.  This transformation
7463 simplifies the control flow of the function allowing other optimizations to do
7464 better job.
7466 @item -funroll-loops
7467 @opindex funroll-loops
7468 Unroll loops whose number of iterations can be determined at compile
7469 time or upon entry to the loop.  @option{-funroll-loops} implies
7470 @option{-frerun-cse-after-loop}.  This option makes code larger,
7471 and may or may not make it run faster.
7473 @item -funroll-all-loops
7474 @opindex funroll-all-loops
7475 Unroll all loops, even if their number of iterations is uncertain when
7476 the loop is entered.  This usually makes programs run more slowly.
7477 @option{-funroll-all-loops} implies the same options as
7478 @option{-funroll-loops},
7480 @item -fsplit-ivs-in-unroller
7481 @opindex fsplit-ivs-in-unroller
7482 Enables expressing of values of induction variables in later iterations
7483 of the unrolled loop using the value in the first iteration.  This breaks
7484 long dependency chains, thus improving efficiency of the scheduling passes.
7486 Combination of @option{-fweb} and CSE is often sufficient to obtain the
7487 same effect.  However in cases the loop body is more complicated than
7488 a single basic block, this is not reliable.  It also does not work at all
7489 on some of the architectures due to restrictions in the CSE pass.
7491 This optimization is enabled by default.
7493 @item -fvariable-expansion-in-unroller
7494 @opindex fvariable-expansion-in-unroller
7495 With this option, the compiler will create multiple copies of some
7496 local variables when unrolling a loop which can result in superior code.
7498 @item -fpartial-inlining
7499 @opindex fpartial-inlining
7500 Inline parts of functions.  This option has any effect only
7501 when inlining itself is turned on by the @option{-finline-functions}
7502 or @option{-finline-small-functions} options.
7504 Enabled at level @option{-O2}.
7506 @item -fpredictive-commoning
7507 @opindex fpredictive-commoning
7508 Perform predictive commoning optimization, i.e., reusing computations
7509 (especially memory loads and stores) performed in previous
7510 iterations of loops.
7512 This option is enabled at level @option{-O3}.
7514 @item -fprefetch-loop-arrays
7515 @opindex fprefetch-loop-arrays
7516 If supported by the target machine, generate instructions to prefetch
7517 memory to improve the performance of loops that access large arrays.
7519 This option may generate better or worse code; results are highly
7520 dependent on the structure of loops within the source code.
7522 Disabled at level @option{-Os}.
7524 @item -fno-peephole
7525 @itemx -fno-peephole2
7526 @opindex fno-peephole
7527 @opindex fno-peephole2
7528 Disable any machine-specific peephole optimizations.  The difference
7529 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
7530 are implemented in the compiler; some targets use one, some use the
7531 other, a few use both.
7533 @option{-fpeephole} is enabled by default.
7534 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7536 @item -fno-guess-branch-probability
7537 @opindex fno-guess-branch-probability
7538 Do not guess branch probabilities using heuristics.
7540 GCC will use heuristics to guess branch probabilities if they are
7541 not provided by profiling feedback (@option{-fprofile-arcs}).  These
7542 heuristics are based on the control flow graph.  If some branch probabilities
7543 are specified by @samp{__builtin_expect}, then the heuristics will be
7544 used to guess branch probabilities for the rest of the control flow graph,
7545 taking the @samp{__builtin_expect} info into account.  The interactions
7546 between the heuristics and @samp{__builtin_expect} can be complex, and in
7547 some cases, it may be useful to disable the heuristics so that the effects
7548 of @samp{__builtin_expect} are easier to understand.
7550 The default is @option{-fguess-branch-probability} at levels
7551 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7553 @item -freorder-blocks
7554 @opindex freorder-blocks
7555 Reorder basic blocks in the compiled function in order to reduce number of
7556 taken branches and improve code locality.
7558 Enabled at levels @option{-O2}, @option{-O3}.
7560 @item -freorder-blocks-and-partition
7561 @opindex freorder-blocks-and-partition
7562 In addition to reordering basic blocks in the compiled function, in order
7563 to reduce number of taken branches, partitions hot and cold basic blocks
7564 into separate sections of the assembly and .o files, to improve
7565 paging and cache locality performance.
7567 This optimization is automatically turned off in the presence of
7568 exception handling, for linkonce sections, for functions with a user-defined
7569 section attribute and on any architecture that does not support named
7570 sections.
7572 @item -freorder-functions
7573 @opindex freorder-functions
7574 Reorder functions in the object file in order to
7575 improve code locality.  This is implemented by using special
7576 subsections @code{.text.hot} for most frequently executed functions and
7577 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
7578 the linker so object file format must support named sections and linker must
7579 place them in a reasonable way.
7581 Also profile feedback must be available in to make this option effective.  See
7582 @option{-fprofile-arcs} for details.
7584 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7586 @item -fstrict-aliasing
7587 @opindex fstrict-aliasing
7588 Allow the compiler to assume the strictest aliasing rules applicable to
7589 the language being compiled.  For C (and C++), this activates
7590 optimizations based on the type of expressions.  In particular, an
7591 object of one type is assumed never to reside at the same address as an
7592 object of a different type, unless the types are almost the same.  For
7593 example, an @code{unsigned int} can alias an @code{int}, but not a
7594 @code{void*} or a @code{double}.  A character type may alias any other
7595 type.
7597 @anchor{Type-punning}Pay special attention to code like this:
7598 @smallexample
7599 union a_union @{
7600   int i;
7601   double d;
7604 int f() @{
7605   union a_union t;
7606   t.d = 3.0;
7607   return t.i;
7609 @end smallexample
7610 The practice of reading from a different union member than the one most
7611 recently written to (called ``type-punning'') is common.  Even with
7612 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
7613 is accessed through the union type.  So, the code above will work as
7614 expected.  @xref{Structures unions enumerations and bit-fields
7615 implementation}.  However, this code might not:
7616 @smallexample
7617 int f() @{
7618   union a_union t;
7619   int* ip;
7620   t.d = 3.0;
7621   ip = &t.i;
7622   return *ip;
7624 @end smallexample
7626 Similarly, access by taking the address, casting the resulting pointer
7627 and dereferencing the result has undefined behavior, even if the cast
7628 uses a union type, e.g.:
7629 @smallexample
7630 int f() @{
7631   double d = 3.0;
7632   return ((union a_union *) &d)->i;
7634 @end smallexample
7636 The @option{-fstrict-aliasing} option is enabled at levels
7637 @option{-O2}, @option{-O3}, @option{-Os}.
7639 @item -fstrict-overflow
7640 @opindex fstrict-overflow
7641 Allow the compiler to assume strict signed overflow rules, depending
7642 on the language being compiled.  For C (and C++) this means that
7643 overflow when doing arithmetic with signed numbers is undefined, which
7644 means that the compiler may assume that it will not happen.  This
7645 permits various optimizations.  For example, the compiler will assume
7646 that an expression like @code{i + 10 > i} will always be true for
7647 signed @code{i}.  This assumption is only valid if signed overflow is
7648 undefined, as the expression is false if @code{i + 10} overflows when
7649 using twos complement arithmetic.  When this option is in effect any
7650 attempt to determine whether an operation on signed numbers will
7651 overflow must be written carefully to not actually involve overflow.
7653 This option also allows the compiler to assume strict pointer
7654 semantics: given a pointer to an object, if adding an offset to that
7655 pointer does not produce a pointer to the same object, the addition is
7656 undefined.  This permits the compiler to conclude that @code{p + u >
7657 p} is always true for a pointer @code{p} and unsigned integer
7658 @code{u}.  This assumption is only valid because pointer wraparound is
7659 undefined, as the expression is false if @code{p + u} overflows using
7660 twos complement arithmetic.
7662 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
7663 that integer signed overflow is fully defined: it wraps.  When
7664 @option{-fwrapv} is used, there is no difference between
7665 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
7666 integers.  With @option{-fwrapv} certain types of overflow are
7667 permitted.  For example, if the compiler gets an overflow when doing
7668 arithmetic on constants, the overflowed value can still be used with
7669 @option{-fwrapv}, but not otherwise.
7671 The @option{-fstrict-overflow} option is enabled at levels
7672 @option{-O2}, @option{-O3}, @option{-Os}.
7674 @item -falign-functions
7675 @itemx -falign-functions=@var{n}
7676 @opindex falign-functions
7677 Align the start of functions to the next power-of-two greater than
7678 @var{n}, skipping up to @var{n} bytes.  For instance,
7679 @option{-falign-functions=32} aligns functions to the next 32-byte
7680 boundary, but @option{-falign-functions=24} would align to the next
7681 32-byte boundary only if this can be done by skipping 23 bytes or less.
7683 @option{-fno-align-functions} and @option{-falign-functions=1} are
7684 equivalent and mean that functions will not be aligned.
7686 Some assemblers only support this flag when @var{n} is a power of two;
7687 in that case, it is rounded up.
7689 If @var{n} is not specified or is zero, use a machine-dependent default.
7691 Enabled at levels @option{-O2}, @option{-O3}.
7693 @item -falign-labels
7694 @itemx -falign-labels=@var{n}
7695 @opindex falign-labels
7696 Align all branch targets to a power-of-two boundary, skipping up to
7697 @var{n} bytes like @option{-falign-functions}.  This option can easily
7698 make code slower, because it must insert dummy operations for when the
7699 branch target is reached in the usual flow of the code.
7701 @option{-fno-align-labels} and @option{-falign-labels=1} are
7702 equivalent and mean that labels will not be aligned.
7704 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
7705 are greater than this value, then their values are used instead.
7707 If @var{n} is not specified or is zero, use a machine-dependent default
7708 which is very likely to be @samp{1}, meaning no alignment.
7710 Enabled at levels @option{-O2}, @option{-O3}.
7712 @item -falign-loops
7713 @itemx -falign-loops=@var{n}
7714 @opindex falign-loops
7715 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
7716 like @option{-falign-functions}.  The hope is that the loop will be
7717 executed many times, which will make up for any execution of the dummy
7718 operations.
7720 @option{-fno-align-loops} and @option{-falign-loops=1} are
7721 equivalent and mean that loops will not be aligned.
7723 If @var{n} is not specified or is zero, use a machine-dependent default.
7725 Enabled at levels @option{-O2}, @option{-O3}.
7727 @item -falign-jumps
7728 @itemx -falign-jumps=@var{n}
7729 @opindex falign-jumps
7730 Align branch targets to a power-of-two boundary, for branch targets
7731 where the targets can only be reached by jumping, skipping up to @var{n}
7732 bytes like @option{-falign-functions}.  In this case, no dummy operations
7733 need be executed.
7735 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
7736 equivalent and mean that loops will not be aligned.
7738 If @var{n} is not specified or is zero, use a machine-dependent default.
7740 Enabled at levels @option{-O2}, @option{-O3}.
7742 @item -funit-at-a-time
7743 @opindex funit-at-a-time
7744 This option is left for compatibility reasons. @option{-funit-at-a-time}
7745 has no effect, while @option{-fno-unit-at-a-time} implies
7746 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
7748 Enabled by default.
7750 @item -fno-toplevel-reorder
7751 @opindex fno-toplevel-reorder
7752 Do not reorder top-level functions, variables, and @code{asm}
7753 statements.  Output them in the same order that they appear in the
7754 input file.  When this option is used, unreferenced static variables
7755 will not be removed.  This option is intended to support existing code
7756 that relies on a particular ordering.  For new code, it is better to
7757 use attributes.
7759 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
7760 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
7761 targets.
7763 @item -fweb
7764 @opindex fweb
7765 Constructs webs as commonly used for register allocation purposes and assign
7766 each web individual pseudo register.  This allows the register allocation pass
7767 to operate on pseudos directly, but also strengthens several other optimization
7768 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
7769 however, make debugging impossible, since variables will no longer stay in a
7770 ``home register''.
7772 Enabled by default with @option{-funroll-loops}.
7774 @item -fwhole-program
7775 @opindex fwhole-program
7776 Assume that the current compilation unit represents the whole program being
7777 compiled.  All public functions and variables with the exception of @code{main}
7778 and those merged by attribute @code{externally_visible} become static functions
7779 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.
7780 While this option is equivalent to proper use of the @code{static} keyword for
7781 programs consisting of a single file, in combination with option
7782 @option{-flto} this flag can be used to
7783 compile many smaller scale programs since the functions and variables become
7784 local for the whole combined compilation unit, not for the single source file
7785 itself.
7787 This option implies @option{-fwhole-file} for Fortran programs.
7789 @item -flto[=@var{n}]
7790 @opindex flto
7791 This option runs the standard link-time optimizer.  When invoked
7792 with source code, it generates GIMPLE (one of GCC's internal
7793 representations) and writes it to special ELF sections in the object
7794 file.  When the object files are linked together, all the function
7795 bodies are read from these ELF sections and instantiated as if they
7796 had been part of the same translation unit.
7798 To use the link-time optimizer, @option{-flto} needs to be specified at
7799 compile time and during the final link.  For example:
7801 @smallexample
7802 gcc -c -O2 -flto foo.c
7803 gcc -c -O2 -flto bar.c
7804 gcc -o myprog -flto -O2 foo.o bar.o
7805 @end smallexample
7807 The first two invocations to GCC save a bytecode representation
7808 of GIMPLE into special ELF sections inside @file{foo.o} and
7809 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
7810 @file{foo.o} and @file{bar.o}, merges the two files into a single
7811 internal image, and compiles the result as usual.  Since both
7812 @file{foo.o} and @file{bar.o} are merged into a single image, this
7813 causes all the interprocedural analyses and optimizations in GCC to
7814 work across the two files as if they were a single one.  This means,
7815 for example, that the inliner is able to inline functions in
7816 @file{bar.o} into functions in @file{foo.o} and vice-versa.
7818 Another (simpler) way to enable link-time optimization is:
7820 @smallexample
7821 gcc -o myprog -flto -O2 foo.c bar.c
7822 @end smallexample
7824 The above generates bytecode for @file{foo.c} and @file{bar.c},
7825 merges them together into a single GIMPLE representation and optimizes
7826 them as usual to produce @file{myprog}.
7828 The only important thing to keep in mind is that to enable link-time
7829 optimizations the @option{-flto} flag needs to be passed to both the
7830 compile and the link commands.
7832 To make whole program optimization effective, it is necessary to make
7833 certain whole program assumptions.  The compiler needs to know
7834 what functions and variables can be accessed by libraries and runtime
7835 outside of the link-time optimized unit.  When supported by the linker,
7836 the linker plugin (see @option{-fuse-linker-plugin}) passes information
7837 to the compiler about used and externally visible symbols.  When
7838 the linker plugin is not available, @option{-fwhole-program} should be
7839 used to allow the compiler to make these assumptions, which leads
7840 to more aggressive optimization decisions.
7842 Note that when a file is compiled with @option{-flto}, the generated
7843 object file is larger than a regular object file because it 
7844 contains GIMPLE bytecodes and the usual final code.  This means that
7845 object files with LTO information can be linked as normal object
7846 files; if @option{-flto} is not passed to the linker, no
7847 interprocedural optimizations are applied.
7849 Additionally, the optimization flags used to compile individual files
7850 are not necessarily related to those used at link time.  For instance,
7852 @smallexample
7853 gcc -c -O0 -flto foo.c
7854 gcc -c -O0 -flto bar.c
7855 gcc -o myprog -flto -O3 foo.o bar.o
7856 @end smallexample
7858 This produces individual object files with unoptimized assembler
7859 code, but the resulting binary @file{myprog} is optimized at
7860 @option{-O3}.  If, instead, the final binary is generated without
7861 @option{-flto}, then @file{myprog} is not optimized.
7863 When producing the final binary with @option{-flto}, GCC only
7864 applies link-time optimizations to those files that contain bytecode.
7865 Therefore, you can mix and match object files and libraries with
7866 GIMPLE bytecodes and final object code.  GCC automatically selects
7867 which files to optimize in LTO mode and which files to link without
7868 further processing.
7870 There are some code generation flags preserved by GCC when
7871 generating bytecodes, as they need to be used during the final link
7872 stage.  Currently, the following options are saved into the GIMPLE
7873 bytecode files: @option{-fPIC}, @option{-fcommon} and all the
7874 @option{-m} target flags.
7876 At link time, these options are read in and reapplied.  Note that the
7877 current implementation makes no attempt to recognize conflicting
7878 values for these options.  If different files have conflicting option
7879 values (e.g., one file is compiled with @option{-fPIC} and another
7880 isn't), the compiler simply uses the last value read from the
7881 bytecode files.  It is recommended, then, that you compile all the files
7882 participating in the same link with the same options.
7884 If LTO encounters objects with C linkage declared with incompatible
7885 types in separate translation units to be linked together (undefined
7886 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
7887 issued.  The behavior is still undefined at run time.
7889 Another feature of LTO is that it is possible to apply interprocedural
7890 optimizations on files written in different languages.  This requires
7891 support in the language front end.  Currently, the C, C++ and
7892 Fortran front ends are capable of emitting GIMPLE bytecodes, so
7893 something like this should work:
7895 @smallexample
7896 gcc -c -flto foo.c
7897 g++ -c -flto bar.cc
7898 gfortran -c -flto baz.f90
7899 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
7900 @end smallexample
7902 Notice that the final link is done with @command{g++} to get the C++
7903 runtime libraries and @option{-lgfortran} is added to get the Fortran
7904 runtime libraries.  In general, when mixing languages in LTO mode, you
7905 should use the same link command options as when mixing languages in a
7906 regular (non-LTO) compilation; all you need to add is @option{-flto} to
7907 all the compile and link commands.
7909 If object files containing GIMPLE bytecode are stored in a library archive, say
7910 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
7911 are using a linker with plugin support.  To enable this feature, use
7912 the flag @option{-fuse-linker-plugin} at link time:
7914 @smallexample
7915 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
7916 @end smallexample
7918 With the linker plugin enabled, the linker extracts the needed
7919 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
7920 to make them part of the aggregated GIMPLE image to be optimized.
7922 If you are not using a linker with plugin support and/or do not
7923 enable the linker plugin, then the objects inside @file{libfoo.a}
7924 are extracted and linked as usual, but they do not participate
7925 in the LTO optimization process.
7927 Link-time optimizations do not require the presence of the whole program to
7928 operate.  If the program does not require any symbols to be exported, it is
7929 possible to combine @option{-flto} and @option{-fwhole-program} to allow
7930 the interprocedural optimizers to use more aggressive assumptions which may
7931 lead to improved optimization opportunities.
7932 Use of @option{-fwhole-program} is not needed when linker plugin is
7933 active (see @option{-fuse-linker-plugin}).
7935 The current implementation of LTO makes no
7936 attempt to generate bytecode that is portable between different
7937 types of hosts.  The bytecode files are versioned and there is a
7938 strict version check, so bytecode files generated in one version of
7939 GCC will not work with an older/newer version of GCC.
7941 Link-time optimization does not work well with generation of debugging
7942 information.  Combining @option{-flto} with
7943 @option{-g} is currently experimental and expected to produce wrong
7944 results.
7946 If you specify the optional @var{n}, the optimization and code
7947 generation done at link time is executed in parallel using @var{n}
7948 parallel jobs by utilizing an installed @command{make} program.  The
7949 environment variable @env{MAKE} may be used to override the program
7950 used.  The default value for @var{n} is 1.
7952 You can also specify @option{-flto=jobserver} to use GNU make's
7953 job server mode to determine the number of parallel jobs. This
7954 is useful when the Makefile calling GCC is already executing in parallel.
7955 You must prepend a @samp{+} to the command recipe in the parent Makefile
7956 for this to work.  This option likely only works if @env{MAKE} is
7957 GNU make.
7959 This option is disabled by default
7961 @item -flto-partition=@var{alg}
7962 @opindex flto-partition
7963 Specify the partitioning algorithm used by the link-time optimizer.
7964 The value is either @code{1to1} to specify a partitioning mirroring
7965 the original source files or @code{balanced} to specify partitioning
7966 into equally sized chunks (whenever possible).  Specifying @code{none}
7967 as an algorithm disables partitioning and streaming completely. The
7968 default value is @code{balanced}.
7970 @item -flto-compression-level=@var{n}
7971 This option specifies the level of compression used for intermediate
7972 language written to LTO object files, and is only meaningful in
7973 conjunction with LTO mode (@option{-flto}).  Valid
7974 values are 0 (no compression) to 9 (maximum compression).  Values
7975 outside this range are clamped to either 0 or 9.  If the option is not
7976 given, a default balanced compression setting is used.
7978 @item -flto-report
7979 Prints a report with internal details on the workings of the link-time
7980 optimizer.  The contents of this report vary from version to version.
7981 It is meant to be useful to GCC developers when processing object
7982 files in LTO mode (via @option{-flto}).
7984 Disabled by default.
7986 @item -fuse-linker-plugin
7987 Enables the use of a linker plugin during link-time optimization.  This
7988 option relies on plugin support in the linker, which is available in gold
7989 or in GNU ld 2.21 or newer.
7991 This option enables the extraction of object files with GIMPLE bytecode out
7992 of library archives. This improves the quality of optimization by exposing
7993 more code to the link-time optimizer.  This information specifies what
7994 symbols can be accessed externally (by non-LTO object or during dynamic
7995 linking).  Resulting code quality improvements on binaries (and shared
7996 libraries that use hidden visibility) are similar to @code{-fwhole-program}.
7997 See @option{-flto} for a description of the effect of this flag and how to
7998 use it.
8000 This option is enabled by default when LTO support in GCC is enabled
8001 and GCC was configured for use with
8002 a linker supporting plugins (GNU ld 2.21 or newer or gold).
8004 @item -ffat-lto-objects
8005 @opindex ffat-lto-objects
8006 Fat LTO objects are object files that contain both the intermediate language
8007 and the object code. This makes them usable for both LTO linking and normal
8008 linking. This option is effective only when compiling with @option{-flto}
8009 and is ignored at link time.
8011 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
8012 requires the complete toolchain to be aware of LTO. It requires a linker with
8013 linker plugin support for basic functionality.  Additionally, nm, ar and ranlib
8014 need to support linker plugins to allow a full-featured build environment
8015 (capable of building static libraries etc).
8017 The default is @option{-ffat-lto-objects} but this default is intended to
8018 change in future releases when linker plugin enabled environments become more
8019 common.
8021 @item -fcompare-elim
8022 @opindex fcompare-elim
8023 After register allocation and post-register allocation instruction splitting,
8024 identify arithmetic instructions that compute processor flags similar to a
8025 comparison operation based on that arithmetic.  If possible, eliminate the
8026 explicit comparison operation.
8028 This pass only applies to certain targets that cannot explicitly represent
8029 the comparison operation before register allocation is complete.
8031 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8033 @item -fcprop-registers
8034 @opindex fcprop-registers
8035 After register allocation and post-register allocation instruction splitting,
8036 we perform a copy-propagation pass to try to reduce scheduling dependencies
8037 and occasionally eliminate the copy.
8039 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8041 @item -fprofile-correction
8042 @opindex fprofile-correction
8043 Profiles collected using an instrumented binary for multi-threaded programs may
8044 be inconsistent due to missed counter updates. When this option is specified,
8045 GCC will use heuristics to correct or smooth out such inconsistencies. By
8046 default, GCC will emit an error message when an inconsistent profile is detected.
8048 @item -fprofile-dir=@var{path}
8049 @opindex fprofile-dir
8051 Set the directory to search for the profile data files in to @var{path}.
8052 This option affects only the profile data generated by
8053 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
8054 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
8055 and its related options.  Both absolute and relative paths can be used.
8056 By default, GCC will use the current directory as @var{path}, thus the
8057 profile data file will appear in the same directory as the object file.
8059 @item -fprofile-generate
8060 @itemx -fprofile-generate=@var{path}
8061 @opindex fprofile-generate
8063 Enable options usually used for instrumenting application to produce
8064 profile useful for later recompilation with profile feedback based
8065 optimization.  You must use @option{-fprofile-generate} both when
8066 compiling and when linking your program.
8068 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
8070 If @var{path} is specified, GCC will look at the @var{path} to find
8071 the profile feedback data files. See @option{-fprofile-dir}.
8073 @item -fprofile-use
8074 @itemx -fprofile-use=@var{path}
8075 @opindex fprofile-use
8076 Enable profile feedback directed optimizations, and optimizations
8077 generally profitable only with profile feedback available.
8079 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
8080 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
8082 By default, GCC emits an error message if the feedback profiles do not
8083 match the source code.  This error can be turned into a warning by using
8084 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
8085 code.
8087 If @var{path} is specified, GCC will look at the @var{path} to find
8088 the profile feedback data files. See @option{-fprofile-dir}.
8089 @end table
8091 The following options control compiler behavior regarding floating-point 
8092 arithmetic.  These options trade off between speed and
8093 correctness.  All must be specifically enabled.
8095 @table @gcctabopt
8096 @item -ffloat-store
8097 @opindex ffloat-store
8098 Do not store floating-point variables in registers, and inhibit other
8099 options that might change whether a floating-point value is taken from a
8100 register or memory.
8102 @cindex floating-point precision
8103 This option prevents undesirable excess precision on machines such as
8104 the 68000 where the floating registers (of the 68881) keep more
8105 precision than a @code{double} is supposed to have.  Similarly for the
8106 x86 architecture.  For most programs, the excess precision does only
8107 good, but a few programs rely on the precise definition of IEEE floating
8108 point.  Use @option{-ffloat-store} for such programs, after modifying
8109 them to store all pertinent intermediate computations into variables.
8111 @item -fexcess-precision=@var{style}
8112 @opindex fexcess-precision
8113 This option allows further control over excess precision on machines
8114 where floating-point registers have more precision than the IEEE
8115 @code{float} and @code{double} types and the processor does not
8116 support operations rounding to those types.  By default,
8117 @option{-fexcess-precision=fast} is in effect; this means that
8118 operations are carried out in the precision of the registers and that
8119 it is unpredictable when rounding to the types specified in the source
8120 code takes place.  When compiling C, if
8121 @option{-fexcess-precision=standard} is specified then excess
8122 precision will follow the rules specified in ISO C99; in particular,
8123 both casts and assignments cause values to be rounded to their
8124 semantic types (whereas @option{-ffloat-store} only affects
8125 assignments).  This option is enabled by default for C if a strict
8126 conformance option such as @option{-std=c99} is used.
8128 @opindex mfpmath
8129 @option{-fexcess-precision=standard} is not implemented for languages
8130 other than C, and has no effect if
8131 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
8132 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
8133 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
8134 semantics apply without excess precision, and in the latter, rounding
8135 is unpredictable.
8137 @item -ffast-math
8138 @opindex ffast-math
8139 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
8140 @option{-ffinite-math-only}, @option{-fno-rounding-math},
8141 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
8143 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
8145 This option is not turned on by any @option{-O} option besides
8146 @option{-Ofast} since it can result in incorrect output for programs
8147 that depend on an exact implementation of IEEE or ISO rules/specifications
8148 for math functions. It may, however, yield faster code for programs
8149 that do not require the guarantees of these specifications.
8151 @item -fno-math-errno
8152 @opindex fno-math-errno
8153 Do not set ERRNO after calling math functions that are executed
8154 with a single instruction, e.g., sqrt.  A program that relies on
8155 IEEE exceptions for math error handling may want to use this flag
8156 for speed while maintaining IEEE arithmetic compatibility.
8158 This option is not turned on by any @option{-O} option since
8159 it can result in incorrect output for programs that depend on
8160 an exact implementation of IEEE or ISO rules/specifications for
8161 math functions. It may, however, yield faster code for programs
8162 that do not require the guarantees of these specifications.
8164 The default is @option{-fmath-errno}.
8166 On Darwin systems, the math library never sets @code{errno}.  There is
8167 therefore no reason for the compiler to consider the possibility that
8168 it might, and @option{-fno-math-errno} is the default.
8170 @item -funsafe-math-optimizations
8171 @opindex funsafe-math-optimizations
8173 Allow optimizations for floating-point arithmetic that (a) assume
8174 that arguments and results are valid and (b) may violate IEEE or
8175 ANSI standards.  When used at link-time, it may include libraries
8176 or startup files that change the default FPU control word or other
8177 similar optimizations.
8179 This option is not turned on by any @option{-O} option since
8180 it can result in incorrect output for programs that depend on
8181 an exact implementation of IEEE or ISO rules/specifications for
8182 math functions. It may, however, yield faster code for programs
8183 that do not require the guarantees of these specifications.
8184 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
8185 @option{-fassociative-math} and @option{-freciprocal-math}.
8187 The default is @option{-fno-unsafe-math-optimizations}.
8189 @item -fassociative-math
8190 @opindex fassociative-math
8192 Allow re-association of operands in series of floating-point operations.
8193 This violates the ISO C and C++ language standard by possibly changing
8194 computation result.  NOTE: re-ordering may change the sign of zero as
8195 well as ignore NaNs and inhibit or create underflow or overflow (and
8196 thus cannot be used on code that relies on rounding behavior like
8197 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
8198 and thus may not be used when ordered comparisons are required.
8199 This option requires that both @option{-fno-signed-zeros} and
8200 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
8201 much sense with @option{-frounding-math}. For Fortran the option
8202 is automatically enabled when both @option{-fno-signed-zeros} and
8203 @option{-fno-trapping-math} are in effect.
8205 The default is @option{-fno-associative-math}.
8207 @item -freciprocal-math
8208 @opindex freciprocal-math
8210 Allow the reciprocal of a value to be used instead of dividing by
8211 the value if this enables optimizations.  For example @code{x / y}
8212 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
8213 is subject to common subexpression elimination.  Note that this loses
8214 precision and increases the number of flops operating on the value.
8216 The default is @option{-fno-reciprocal-math}.
8218 @item -ffinite-math-only
8219 @opindex ffinite-math-only
8220 Allow optimizations for floating-point arithmetic that assume
8221 that arguments and results are not NaNs or +-Infs.
8223 This option is not turned on by any @option{-O} option since
8224 it can result in incorrect output for programs that depend on
8225 an exact implementation of IEEE or ISO rules/specifications for
8226 math functions. It may, however, yield faster code for programs
8227 that do not require the guarantees of these specifications.
8229 The default is @option{-fno-finite-math-only}.
8231 @item -fno-signed-zeros
8232 @opindex fno-signed-zeros
8233 Allow optimizations for floating-point arithmetic that ignore the
8234 signedness of zero.  IEEE arithmetic specifies the behavior of
8235 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
8236 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
8237 This option implies that the sign of a zero result isn't significant.
8239 The default is @option{-fsigned-zeros}.
8241 @item -fno-trapping-math
8242 @opindex fno-trapping-math
8243 Compile code assuming that floating-point operations cannot generate
8244 user-visible traps.  These traps include division by zero, overflow,
8245 underflow, inexact result and invalid operation.  This option requires
8246 that @option{-fno-signaling-nans} be in effect.  Setting this option may
8247 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
8249 This option should never be turned on by any @option{-O} option since
8250 it can result in incorrect output for programs that depend on
8251 an exact implementation of IEEE or ISO rules/specifications for
8252 math functions.
8254 The default is @option{-ftrapping-math}.
8256 @item -frounding-math
8257 @opindex frounding-math
8258 Disable transformations and optimizations that assume default floating-point
8259 rounding behavior.  This is round-to-zero for all floating point
8260 to integer conversions, and round-to-nearest for all other arithmetic
8261 truncations.  This option should be specified for programs that change
8262 the FP rounding mode dynamically, or that may be executed with a
8263 non-default rounding mode.  This option disables constant folding of
8264 floating-point expressions at compile time (which may be affected by
8265 rounding mode) and arithmetic transformations that are unsafe in the
8266 presence of sign-dependent rounding modes.
8268 The default is @option{-fno-rounding-math}.
8270 This option is experimental and does not currently guarantee to
8271 disable all GCC optimizations that are affected by rounding mode.
8272 Future versions of GCC may provide finer control of this setting
8273 using C99's @code{FENV_ACCESS} pragma.  This command-line option
8274 will be used to specify the default state for @code{FENV_ACCESS}.
8276 @item -fsignaling-nans
8277 @opindex fsignaling-nans
8278 Compile code assuming that IEEE signaling NaNs may generate user-visible
8279 traps during floating-point operations.  Setting this option disables
8280 optimizations that may change the number of exceptions visible with
8281 signaling NaNs.  This option implies @option{-ftrapping-math}.
8283 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
8284 be defined.
8286 The default is @option{-fno-signaling-nans}.
8288 This option is experimental and does not currently guarantee to
8289 disable all GCC optimizations that affect signaling NaN behavior.
8291 @item -fsingle-precision-constant
8292 @opindex fsingle-precision-constant
8293 Treat floating-point constants as single precision instead of
8294 implicitly converting them to double-precision constants.
8296 @item -fcx-limited-range
8297 @opindex fcx-limited-range
8298 When enabled, this option states that a range reduction step is not
8299 needed when performing complex division.  Also, there is no checking
8300 whether the result of a complex multiplication or division is @code{NaN
8301 + I*NaN}, with an attempt to rescue the situation in that case.  The
8302 default is @option{-fno-cx-limited-range}, but is enabled by
8303 @option{-ffast-math}.
8305 This option controls the default setting of the ISO C99
8306 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
8307 all languages.
8309 @item -fcx-fortran-rules
8310 @opindex fcx-fortran-rules
8311 Complex multiplication and division follow Fortran rules.  Range
8312 reduction is done as part of complex division, but there is no checking
8313 whether the result of a complex multiplication or division is @code{NaN
8314 + I*NaN}, with an attempt to rescue the situation in that case.
8316 The default is @option{-fno-cx-fortran-rules}.
8318 @end table
8320 The following options control optimizations that may improve
8321 performance, but are not enabled by any @option{-O} options.  This
8322 section includes experimental options that may produce broken code.
8324 @table @gcctabopt
8325 @item -fbranch-probabilities
8326 @opindex fbranch-probabilities
8327 After running a program compiled with @option{-fprofile-arcs}
8328 (@pxref{Debugging Options,, Options for Debugging Your Program or
8329 @command{gcc}}), you can compile it a second time using
8330 @option{-fbranch-probabilities}, to improve optimizations based on
8331 the number of times each branch was taken.  When the program
8332 compiled with @option{-fprofile-arcs} exits it saves arc execution
8333 counts to a file called @file{@var{sourcename}.gcda} for each source
8334 file.  The information in this data file is very dependent on the
8335 structure of the generated code, so you must use the same source code
8336 and the same optimization options for both compilations.
8338 With @option{-fbranch-probabilities}, GCC puts a
8339 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
8340 These can be used to improve optimization.  Currently, they are only
8341 used in one place: in @file{reorg.c}, instead of guessing which path a
8342 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
8343 exactly determine which path is taken more often.
8345 @item -fprofile-values
8346 @opindex fprofile-values
8347 If combined with @option{-fprofile-arcs}, it adds code so that some
8348 data about values of expressions in the program is gathered.
8350 With @option{-fbranch-probabilities}, it reads back the data gathered
8351 from profiling values of expressions for usage in optimizations.
8353 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
8355 @item -fvpt
8356 @opindex fvpt
8357 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
8358 a code to gather information about values of expressions.
8360 With @option{-fbranch-probabilities}, it reads back the data gathered
8361 and actually performs the optimizations based on them.
8362 Currently the optimizations include specialization of division operation
8363 using the knowledge about the value of the denominator.
8365 @item -frename-registers
8366 @opindex frename-registers
8367 Attempt to avoid false dependencies in scheduled code by making use
8368 of registers left over after register allocation.  This optimization
8369 will most benefit processors with lots of registers.  Depending on the
8370 debug information format adopted by the target, however, it can
8371 make debugging impossible, since variables will no longer stay in
8372 a ``home register''.
8374 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
8376 @item -ftracer
8377 @opindex ftracer
8378 Perform tail duplication to enlarge superblock size.  This transformation
8379 simplifies the control flow of the function allowing other optimizations to do
8380 better job.
8382 Enabled with @option{-fprofile-use}.
8384 @item -funroll-loops
8385 @opindex funroll-loops
8386 Unroll loops whose number of iterations can be determined at compile time or
8387 upon entry to the loop.  @option{-funroll-loops} implies
8388 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
8389 It also turns on complete loop peeling (i.e.@: complete removal of loops with
8390 small constant number of iterations).  This option makes code larger, and may
8391 or may not make it run faster.
8393 Enabled with @option{-fprofile-use}.
8395 @item -funroll-all-loops
8396 @opindex funroll-all-loops
8397 Unroll all loops, even if their number of iterations is uncertain when
8398 the loop is entered.  This usually makes programs run more slowly.
8399 @option{-funroll-all-loops} implies the same options as
8400 @option{-funroll-loops}.
8402 @item -fpeel-loops
8403 @opindex fpeel-loops
8404 Peels loops for which there is enough information that they do not
8405 roll much (from profile feedback).  It also turns on complete loop peeling
8406 (i.e.@: complete removal of loops with small constant number of iterations).
8408 Enabled with @option{-fprofile-use}.
8410 @item -fmove-loop-invariants
8411 @opindex fmove-loop-invariants
8412 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
8413 at level @option{-O1}
8415 @item -funswitch-loops
8416 @opindex funswitch-loops
8417 Move branches with loop invariant conditions out of the loop, with duplicates
8418 of the loop on both branches (modified according to result of the condition).
8420 @item -ffunction-sections
8421 @itemx -fdata-sections
8422 @opindex ffunction-sections
8423 @opindex fdata-sections
8424 Place each function or data item into its own section in the output
8425 file if the target supports arbitrary sections.  The name of the
8426 function or the name of the data item determines the section's name
8427 in the output file.
8429 Use these options on systems where the linker can perform optimizations
8430 to improve locality of reference in the instruction space.  Most systems
8431 using the ELF object format and SPARC processors running Solaris 2 have
8432 linkers with such optimizations.  AIX may have these optimizations in
8433 the future.
8435 Only use these options when there are significant benefits from doing
8436 so.  When you specify these options, the assembler and linker will
8437 create larger object and executable files and will also be slower.
8438 You will not be able to use @code{gprof} on all systems if you
8439 specify this option and you may have problems with debugging if
8440 you specify both this option and @option{-g}.
8442 @item -fbranch-target-load-optimize
8443 @opindex fbranch-target-load-optimize
8444 Perform branch target register load optimization before prologue / epilogue
8445 threading.
8446 The use of target registers can typically be exposed only during reload,
8447 thus hoisting loads out of loops and doing inter-block scheduling needs
8448 a separate optimization pass.
8450 @item -fbranch-target-load-optimize2
8451 @opindex fbranch-target-load-optimize2
8452 Perform branch target register load optimization after prologue / epilogue
8453 threading.
8455 @item -fbtr-bb-exclusive
8456 @opindex fbtr-bb-exclusive
8457 When performing branch target register load optimization, don't reuse
8458 branch target registers in within any basic block.
8460 @item -fstack-protector
8461 @opindex fstack-protector
8462 Emit extra code to check for buffer overflows, such as stack smashing
8463 attacks.  This is done by adding a guard variable to functions with
8464 vulnerable objects.  This includes functions that call alloca, and
8465 functions with buffers larger than 8 bytes.  The guards are initialized
8466 when a function is entered and then checked when the function exits.
8467 If a guard check fails, an error message is printed and the program exits.
8469 @item -fstack-protector-all
8470 @opindex fstack-protector-all
8471 Like @option{-fstack-protector} except that all functions are protected.
8473 @item -fsection-anchors
8474 @opindex fsection-anchors
8475 Try to reduce the number of symbolic address calculations by using
8476 shared ``anchor'' symbols to address nearby objects.  This transformation
8477 can help to reduce the number of GOT entries and GOT accesses on some
8478 targets.
8480 For example, the implementation of the following function @code{foo}:
8482 @smallexample
8483 static int a, b, c;
8484 int foo (void) @{ return a + b + c; @}
8485 @end smallexample
8487 would usually calculate the addresses of all three variables, but if you
8488 compile it with @option{-fsection-anchors}, it will access the variables
8489 from a common anchor point instead.  The effect is similar to the
8490 following pseudocode (which isn't valid C):
8492 @smallexample
8493 int foo (void)
8495   register int *xr = &x;
8496   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
8498 @end smallexample
8500 Not all targets support this option.
8502 @item --param @var{name}=@var{value}
8503 @opindex param
8504 In some places, GCC uses various constants to control the amount of
8505 optimization that is done.  For example, GCC will not inline functions
8506 that contain more than a certain number of instructions.  You can
8507 control some of these constants on the command line using the
8508 @option{--param} option.
8510 The names of specific parameters, and the meaning of the values, are
8511 tied to the internals of the compiler, and are subject to change
8512 without notice in future releases.
8514 In each case, the @var{value} is an integer.  The allowable choices for
8515 @var{name} are given in the following table:
8517 @table @gcctabopt
8518 @item predictable-branch-outcome
8519 When branch is predicted to be taken with probability lower than this threshold
8520 (in percent), then it is considered well predictable. The default is 10.
8522 @item max-crossjump-edges
8523 The maximum number of incoming edges to consider for crossjumping.
8524 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
8525 the number of edges incoming to each block.  Increasing values mean
8526 more aggressive optimization, making the compilation time increase with
8527 probably small improvement in executable size.
8529 @item min-crossjump-insns
8530 The minimum number of instructions that must be matched at the end
8531 of two blocks before crossjumping will be performed on them.  This
8532 value is ignored in the case where all instructions in the block being
8533 crossjumped from are matched.  The default value is 5.
8535 @item max-grow-copy-bb-insns
8536 The maximum code size expansion factor when copying basic blocks
8537 instead of jumping.  The expansion is relative to a jump instruction.
8538 The default value is 8.
8540 @item max-goto-duplication-insns
8541 The maximum number of instructions to duplicate to a block that jumps
8542 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
8543 passes, GCC factors computed gotos early in the compilation process,
8544 and unfactors them as late as possible.  Only computed jumps at the
8545 end of a basic blocks with no more than max-goto-duplication-insns are
8546 unfactored.  The default value is 8.
8548 @item max-delay-slot-insn-search
8549 The maximum number of instructions to consider when looking for an
8550 instruction to fill a delay slot.  If more than this arbitrary number of
8551 instructions is searched, the time savings from filling the delay slot
8552 will be minimal so stop searching.  Increasing values mean more
8553 aggressive optimization, making the compilation time increase with probably
8554 small improvement in execution time.
8556 @item max-delay-slot-live-search
8557 When trying to fill delay slots, the maximum number of instructions to
8558 consider when searching for a block with valid live register
8559 information.  Increasing this arbitrarily chosen value means more
8560 aggressive optimization, increasing the compilation time.  This parameter
8561 should be removed when the delay slot code is rewritten to maintain the
8562 control-flow graph.
8564 @item max-gcse-memory
8565 The approximate maximum amount of memory that will be allocated in
8566 order to perform the global common subexpression elimination
8567 optimization.  If more memory than specified is required, the
8568 optimization will not be done.
8570 @item max-gcse-insertion-ratio
8571 If the ratio of expression insertions to deletions is larger than this value
8572 for any expression, then RTL PRE will insert or remove the expression and thus
8573 leave partially redundant computations in the instruction stream.  The default value is 20.
8575 @item max-pending-list-length
8576 The maximum number of pending dependencies scheduling will allow
8577 before flushing the current state and starting over.  Large functions
8578 with few branches or calls can create excessively large lists which
8579 needlessly consume memory and resources.
8581 @item max-modulo-backtrack-attempts
8582 The maximum number of backtrack attempts the scheduler should make
8583 when modulo scheduling a loop.  Larger values can exponentially increase
8584 compilation time.
8586 @item max-inline-insns-single
8587 Several parameters control the tree inliner used in gcc.
8588 This number sets the maximum number of instructions (counted in GCC's
8589 internal representation) in a single function that the tree inliner
8590 will consider for inlining.  This only affects functions declared
8591 inline and methods implemented in a class declaration (C++).
8592 The default value is 400.
8594 @item max-inline-insns-auto
8595 When you use @option{-finline-functions} (included in @option{-O3}),
8596 a lot of functions that would otherwise not be considered for inlining
8597 by the compiler will be investigated.  To those functions, a different
8598 (more restrictive) limit compared to functions declared inline can
8599 be applied.
8600 The default value is 40.
8602 @item large-function-insns
8603 The limit specifying really large functions.  For functions larger than this
8604 limit after inlining, inlining is constrained by
8605 @option{--param large-function-growth}.  This parameter is useful primarily
8606 to avoid extreme compilation time caused by non-linear algorithms used by the
8607 back end.
8608 The default value is 2700.
8610 @item large-function-growth
8611 Specifies maximal growth of large function caused by inlining in percents.
8612 The default value is 100 which limits large function growth to 2.0 times
8613 the original size.
8615 @item large-unit-insns
8616 The limit specifying large translation unit.  Growth caused by inlining of
8617 units larger than this limit is limited by @option{--param inline-unit-growth}.
8618 For small units this might be too tight (consider unit consisting of function A
8619 that is inline and B that just calls A three time.  If B is small relative to
8620 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
8621 large units consisting of small inlineable functions however the overall unit
8622 growth limit is needed to avoid exponential explosion of code size.  Thus for
8623 smaller units, the size is increased to @option{--param large-unit-insns}
8624 before applying @option{--param inline-unit-growth}.  The default is 10000
8626 @item inline-unit-growth
8627 Specifies maximal overall growth of the compilation unit caused by inlining.
8628 The default value is 30 which limits unit growth to 1.3 times the original
8629 size.
8631 @item ipcp-unit-growth
8632 Specifies maximal overall growth of the compilation unit caused by
8633 interprocedural constant propagation.  The default value is 10 which limits
8634 unit growth to 1.1 times the original size.
8636 @item large-stack-frame
8637 The limit specifying large stack frames.  While inlining the algorithm is trying
8638 to not grow past this limit too much.  Default value is 256 bytes.
8640 @item large-stack-frame-growth
8641 Specifies maximal growth of large stack frames caused by inlining in percents.
8642 The default value is 1000 which limits large stack frame growth to 11 times
8643 the original size.
8645 @item max-inline-insns-recursive
8646 @itemx max-inline-insns-recursive-auto
8647 Specifies maximum number of instructions out-of-line copy of self recursive inline
8648 function can grow into by performing recursive inlining.
8650 For functions declared inline @option{--param max-inline-insns-recursive} is
8651 taken into account.  For function not declared inline, recursive inlining
8652 happens only when @option{-finline-functions} (included in @option{-O3}) is
8653 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
8654 default value is 450.
8656 @item max-inline-recursive-depth
8657 @itemx max-inline-recursive-depth-auto
8658 Specifies maximum recursion depth used by the recursive inlining.
8660 For functions declared inline @option{--param max-inline-recursive-depth} is
8661 taken into account.  For function not declared inline, recursive inlining
8662 happens only when @option{-finline-functions} (included in @option{-O3}) is
8663 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
8664 default value is 8.
8666 @item min-inline-recursive-probability
8667 Recursive inlining is profitable only for function having deep recursion
8668 in average and can hurt for function having little recursion depth by
8669 increasing the prologue size or complexity of function body to other
8670 optimizers.
8672 When profile feedback is available (see @option{-fprofile-generate}) the actual
8673 recursion depth can be guessed from probability that function will recurse via
8674 given call expression.  This parameter limits inlining only to call expression
8675 whose probability exceeds given threshold (in percents).  The default value is
8678 @item early-inlining-insns
8679 Specify growth that early inliner can make.  In effect it increases amount of
8680 inlining for code having large abstraction penalty.  The default value is 10.
8682 @item max-early-inliner-iterations
8683 @itemx max-early-inliner-iterations
8684 Limit of iterations of early inliner.  This basically bounds number of nested
8685 indirect calls early inliner can resolve.  Deeper chains are still handled by
8686 late inlining.
8688 @item comdat-sharing-probability
8689 @itemx comdat-sharing-probability
8690 Probability (in percent) that C++ inline function with comdat visibility
8691 will be shared across multiple compilation units.  The default value is 20.
8693 @item min-vect-loop-bound
8694 The minimum number of iterations under which a loop will not get vectorized
8695 when @option{-ftree-vectorize} is used.  The number of iterations after
8696 vectorization needs to be greater than the value specified by this option
8697 to allow vectorization.  The default value is 0.
8699 @item gcse-cost-distance-ratio
8700 Scaling factor in calculation of maximum distance an expression
8701 can be moved by GCSE optimizations.  This is currently supported only in the
8702 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
8703 will be with simple expressions, i.e., the expressions that have cost
8704 less than @option{gcse-unrestricted-cost}.  Specifying 0 will disable
8705 hoisting of simple expressions.  The default value is 10.
8707 @item gcse-unrestricted-cost
8708 Cost, roughly measured as the cost of a single typical machine
8709 instruction, at which GCSE optimizations will not constrain
8710 the distance an expression can travel.  This is currently
8711 supported only in the code hoisting pass.  The lesser the cost,
8712 the more aggressive code hoisting will be.  Specifying 0 will
8713 allow all expressions to travel unrestricted distances.
8714 The default value is 3.
8716 @item max-hoist-depth
8717 The depth of search in the dominator tree for expressions to hoist.
8718 This is used to avoid quadratic behavior in hoisting algorithm.
8719 The value of 0 will avoid limiting the search, but may slow down compilation
8720 of huge functions.  The default value is 30.
8722 @item max-tail-merge-comparisons
8723 The maximum amount of similar bbs to compare a bb with.  This is used to
8724 avoid quadratic behavior in tree tail merging.  The default value is 10.
8726 @item max-tail-merge-iterations
8727 The maximum amount of iterations of the pass over the function.  This is used to
8728 limit compilation time in tree tail merging.  The default value is 2.
8730 @item max-unrolled-insns
8731 The maximum number of instructions that a loop should have if that loop
8732 is unrolled, and if the loop is unrolled, it determines how many times
8733 the loop code is unrolled.
8735 @item max-average-unrolled-insns
8736 The maximum number of instructions biased by probabilities of their execution
8737 that a loop should have if that loop is unrolled, and if the loop is unrolled,
8738 it determines how many times the loop code is unrolled.
8740 @item max-unroll-times
8741 The maximum number of unrollings of a single loop.
8743 @item max-peeled-insns
8744 The maximum number of instructions that a loop should have if that loop
8745 is peeled, and if the loop is peeled, it determines how many times
8746 the loop code is peeled.
8748 @item max-peel-times
8749 The maximum number of peelings of a single loop.
8751 @item max-completely-peeled-insns
8752 The maximum number of insns of a completely peeled loop.
8754 @item max-completely-peel-times
8755 The maximum number of iterations of a loop to be suitable for complete peeling.
8757 @item max-completely-peel-loop-nest-depth
8758 The maximum depth of a loop nest suitable for complete peeling.
8760 @item max-unswitch-insns
8761 The maximum number of insns of an unswitched loop.
8763 @item max-unswitch-level
8764 The maximum number of branches unswitched in a single loop.
8766 @item lim-expensive
8767 The minimum cost of an expensive expression in the loop invariant motion.
8769 @item iv-consider-all-candidates-bound
8770 Bound on number of candidates for induction variables below that
8771 all candidates are considered for each use in induction variable
8772 optimizations.  Only the most relevant candidates are considered
8773 if there are more candidates, to avoid quadratic time complexity.
8775 @item iv-max-considered-uses
8776 The induction variable optimizations give up on loops that contain more
8777 induction variable uses.
8779 @item iv-always-prune-cand-set-bound
8780 If number of candidates in the set is smaller than this value,
8781 we always try to remove unnecessary ivs from the set during its
8782 optimization when a new iv is added to the set.
8784 @item scev-max-expr-size
8785 Bound on size of expressions used in the scalar evolutions analyzer.
8786 Large expressions slow the analyzer.
8788 @item scev-max-expr-complexity
8789 Bound on the complexity of the expressions in the scalar evolutions analyzer.
8790 Complex expressions slow the analyzer.
8792 @item omega-max-vars
8793 The maximum number of variables in an Omega constraint system.
8794 The default value is 128.
8796 @item omega-max-geqs
8797 The maximum number of inequalities in an Omega constraint system.
8798 The default value is 256.
8800 @item omega-max-eqs
8801 The maximum number of equalities in an Omega constraint system.
8802 The default value is 128.
8804 @item omega-max-wild-cards
8805 The maximum number of wildcard variables that the Omega solver will
8806 be able to insert.  The default value is 18.
8808 @item omega-hash-table-size
8809 The size of the hash table in the Omega solver.  The default value is
8810 550.
8812 @item omega-max-keys
8813 The maximal number of keys used by the Omega solver.  The default
8814 value is 500.
8816 @item omega-eliminate-redundant-constraints
8817 When set to 1, use expensive methods to eliminate all redundant
8818 constraints.  The default value is 0.
8820 @item vect-max-version-for-alignment-checks
8821 The maximum number of run-time checks that can be performed when
8822 doing loop versioning for alignment in the vectorizer.  See option
8823 ftree-vect-loop-version for more information.
8825 @item vect-max-version-for-alias-checks
8826 The maximum number of run-time checks that can be performed when
8827 doing loop versioning for alias in the vectorizer.  See option
8828 ftree-vect-loop-version for more information.
8830 @item max-iterations-to-track
8832 The maximum number of iterations of a loop the brute force algorithm
8833 for analysis of # of iterations of the loop tries to evaluate.
8835 @item hot-bb-count-fraction
8836 Select fraction of the maximal count of repetitions of basic block in program
8837 given basic block needs to have to be considered hot.
8839 @item hot-bb-frequency-fraction
8840 Select fraction of the entry block frequency of executions of basic block in
8841 function given basic block needs to have to be considered hot.
8843 @item max-predicted-iterations
8844 The maximum number of loop iterations we predict statically.  This is useful
8845 in cases where function contain single loop with known bound and other loop
8846 with unknown.  We predict the known number of iterations correctly, while
8847 the unknown number of iterations average to roughly 10.  This means that the
8848 loop without bounds would appear artificially cold relative to the other one.
8850 @item align-threshold
8852 Select fraction of the maximal frequency of executions of basic block in
8853 function given basic block will get aligned.
8855 @item align-loop-iterations
8857 A loop expected to iterate at lest the selected number of iterations will get
8858 aligned.
8860 @item tracer-dynamic-coverage
8861 @itemx tracer-dynamic-coverage-feedback
8863 This value is used to limit superblock formation once the given percentage of
8864 executed instructions is covered.  This limits unnecessary code size
8865 expansion.
8867 The @option{tracer-dynamic-coverage-feedback} is used only when profile
8868 feedback is available.  The real profiles (as opposed to statically estimated
8869 ones) are much less balanced allowing the threshold to be larger value.
8871 @item tracer-max-code-growth
8872 Stop tail duplication once code growth has reached given percentage.  This is
8873 rather hokey argument, as most of the duplicates will be eliminated later in
8874 cross jumping, so it may be set to much higher values than is the desired code
8875 growth.
8877 @item tracer-min-branch-ratio
8879 Stop reverse growth when the reverse probability of best edge is less than this
8880 threshold (in percent).
8882 @item tracer-min-branch-ratio
8883 @itemx tracer-min-branch-ratio-feedback
8885 Stop forward growth if the best edge do have probability lower than this
8886 threshold.
8888 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
8889 compilation for profile feedback and one for compilation without.  The value
8890 for compilation with profile feedback needs to be more conservative (higher) in
8891 order to make tracer effective.
8893 @item max-cse-path-length
8895 Maximum number of basic blocks on path that cse considers.  The default is 10.
8897 @item max-cse-insns
8898 The maximum instructions CSE process before flushing. The default is 1000.
8900 @item ggc-min-expand
8902 GCC uses a garbage collector to manage its own memory allocation.  This
8903 parameter specifies the minimum percentage by which the garbage
8904 collector's heap should be allowed to expand between collections.
8905 Tuning this may improve compilation speed; it has no effect on code
8906 generation.
8908 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
8909 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
8910 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
8911 GCC is not able to calculate RAM on a particular platform, the lower
8912 bound of 30% is used.  Setting this parameter and
8913 @option{ggc-min-heapsize} to zero causes a full collection to occur at
8914 every opportunity.  This is extremely slow, but can be useful for
8915 debugging.
8917 @item ggc-min-heapsize
8919 Minimum size of the garbage collector's heap before it begins bothering
8920 to collect garbage.  The first collection occurs after the heap expands
8921 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
8922 tuning this may improve compilation speed, and has no effect on code
8923 generation.
8925 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
8926 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
8927 with a lower bound of 4096 (four megabytes) and an upper bound of
8928 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
8929 particular platform, the lower bound is used.  Setting this parameter
8930 very large effectively disables garbage collection.  Setting this
8931 parameter and @option{ggc-min-expand} to zero causes a full collection
8932 to occur at every opportunity.
8934 @item max-reload-search-insns
8935 The maximum number of instruction reload should look backward for equivalent
8936 register.  Increasing values mean more aggressive optimization, making the
8937 compilation time increase with probably slightly better performance.
8938 The default value is 100.
8940 @item max-cselib-memory-locations
8941 The maximum number of memory locations cselib should take into account.
8942 Increasing values mean more aggressive optimization, making the compilation time
8943 increase with probably slightly better performance.  The default value is 500.
8945 @item reorder-blocks-duplicate
8946 @itemx reorder-blocks-duplicate-feedback
8948 Used by basic block reordering pass to decide whether to use unconditional
8949 branch or duplicate the code on its destination.  Code is duplicated when its
8950 estimated size is smaller than this value multiplied by the estimated size of
8951 unconditional jump in the hot spots of the program.
8953 The @option{reorder-block-duplicate-feedback} is used only when profile
8954 feedback is available and may be set to higher values than
8955 @option{reorder-block-duplicate} since information about the hot spots is more
8956 accurate.
8958 @item max-sched-ready-insns
8959 The maximum number of instructions ready to be issued the scheduler should
8960 consider at any given time during the first scheduling pass.  Increasing
8961 values mean more thorough searches, making the compilation time increase
8962 with probably little benefit.  The default value is 100.
8964 @item max-sched-region-blocks
8965 The maximum number of blocks in a region to be considered for
8966 interblock scheduling.  The default value is 10.
8968 @item max-pipeline-region-blocks
8969 The maximum number of blocks in a region to be considered for
8970 pipelining in the selective scheduler.  The default value is 15.
8972 @item max-sched-region-insns
8973 The maximum number of insns in a region to be considered for
8974 interblock scheduling.  The default value is 100.
8976 @item max-pipeline-region-insns
8977 The maximum number of insns in a region to be considered for
8978 pipelining in the selective scheduler.  The default value is 200.
8980 @item min-spec-prob
8981 The minimum probability (in percents) of reaching a source block
8982 for interblock speculative scheduling.  The default value is 40.
8984 @item max-sched-extend-regions-iters
8985 The maximum number of iterations through CFG to extend regions.
8986 0 - disable region extension,
8987 N - do at most N iterations.
8988 The default value is 0.
8990 @item max-sched-insn-conflict-delay
8991 The maximum conflict delay for an insn to be considered for speculative motion.
8992 The default value is 3.
8994 @item sched-spec-prob-cutoff
8995 The minimal probability of speculation success (in percents), so that
8996 speculative insn will be scheduled.
8997 The default value is 40.
8999 @item sched-mem-true-dep-cost
9000 Minimal distance (in CPU cycles) between store and load targeting same
9001 memory locations.  The default value is 1.
9003 @item selsched-max-lookahead
9004 The maximum size of the lookahead window of selective scheduling.  It is a
9005 depth of search for available instructions.
9006 The default value is 50.
9008 @item selsched-max-sched-times
9009 The maximum number of times that an instruction will be scheduled during
9010 selective scheduling.  This is the limit on the number of iterations
9011 through which the instruction may be pipelined.  The default value is 2.
9013 @item selsched-max-insns-to-rename
9014 The maximum number of best instructions in the ready list that are considered
9015 for renaming in the selective scheduler.  The default value is 2.
9017 @item sms-min-sc
9018 The minimum value of stage count that swing modulo scheduler will
9019 generate.  The default value is 2.
9021 @item max-last-value-rtl
9022 The maximum size measured as number of RTLs that can be recorded in an expression
9023 in combiner for a pseudo register as last known value of that register.  The default
9024 is 10000.
9026 @item integer-share-limit
9027 Small integer constants can use a shared data structure, reducing the
9028 compiler's memory usage and increasing its speed.  This sets the maximum
9029 value of a shared integer constant.  The default value is 256.
9031 @item min-virtual-mappings
9032 Specifies the minimum number of virtual mappings in the incremental
9033 SSA updater that should be registered to trigger the virtual mappings
9034 heuristic defined by virtual-mappings-ratio.  The default value is
9035 100.
9037 @item virtual-mappings-ratio
9038 If the number of virtual mappings is virtual-mappings-ratio bigger
9039 than the number of virtual symbols to be updated, then the incremental
9040 SSA updater switches to a full update for those symbols.  The default
9041 ratio is 3.
9043 @item ssp-buffer-size
9044 The minimum size of buffers (i.e.@: arrays) that will receive stack smashing
9045 protection when @option{-fstack-protection} is used.
9047 @item max-jump-thread-duplication-stmts
9048 Maximum number of statements allowed in a block that needs to be
9049 duplicated when threading jumps.
9051 @item max-fields-for-field-sensitive
9052 Maximum number of fields in a structure we will treat in
9053 a field sensitive manner during pointer analysis.  The default is zero
9054 for -O0, and -O1 and 100 for -Os, -O2, and -O3.
9056 @item prefetch-latency
9057 Estimate on average number of instructions that are executed before
9058 prefetch finishes.  The distance we prefetch ahead is proportional
9059 to this constant.  Increasing this number may also lead to less
9060 streams being prefetched (see @option{simultaneous-prefetches}).
9062 @item simultaneous-prefetches
9063 Maximum number of prefetches that can run at the same time.
9065 @item l1-cache-line-size
9066 The size of cache line in L1 cache, in bytes.
9068 @item l1-cache-size
9069 The size of L1 cache, in kilobytes.
9071 @item l2-cache-size
9072 The size of L2 cache, in kilobytes.
9074 @item min-insn-to-prefetch-ratio
9075 The minimum ratio between the number of instructions and the
9076 number of prefetches to enable prefetching in a loop.
9078 @item prefetch-min-insn-to-mem-ratio
9079 The minimum ratio between the number of instructions and the
9080 number of memory references to enable prefetching in a loop.
9082 @item use-canonical-types
9083 Whether the compiler should use the ``canonical'' type system.  By
9084 default, this should always be 1, which uses a more efficient internal
9085 mechanism for comparing types in C++ and Objective-C++.  However, if
9086 bugs in the canonical type system are causing compilation failures,
9087 set this value to 0 to disable canonical types.
9089 @item switch-conversion-max-branch-ratio
9090 Switch initialization conversion will refuse to create arrays that are
9091 bigger than @option{switch-conversion-max-branch-ratio} times the number of
9092 branches in the switch.
9094 @item max-partial-antic-length
9095 Maximum length of the partial antic set computed during the tree
9096 partial redundancy elimination optimization (@option{-ftree-pre}) when
9097 optimizing at @option{-O3} and above.  For some sorts of source code
9098 the enhanced partial redundancy elimination optimization can run away,
9099 consuming all of the memory available on the host machine.  This
9100 parameter sets a limit on the length of the sets that are computed,
9101 which prevents the runaway behavior.  Setting a value of 0 for
9102 this parameter will allow an unlimited set length.
9104 @item sccvn-max-scc-size
9105 Maximum size of a strongly connected component (SCC) during SCCVN
9106 processing.  If this limit is hit, SCCVN processing for the whole
9107 function will not be done and optimizations depending on it will
9108 be disabled.  The default maximum SCC size is 10000.
9110 @item ira-max-loops-num
9111 IRA uses regional register allocation by default.  If a function
9112 contains more loops than the number given by this parameter, only at most
9113 the given number of the most frequently-executed loops form regions
9114 for regional register allocation.  The default value of the
9115 parameter is 100.
9117 @item ira-max-conflict-table-size 
9118 Although IRA uses a sophisticated algorithm to compress the conflict
9119 table, the table can still require excessive amounts of memory for
9120 huge functions.  If the conflict table for a function could be more
9121 than the size in MB given by this parameter, the register allocator
9122 instead uses a faster, simpler, and lower-quality
9123 algorithm that does not require building a pseudo-register conflict table.  
9124 The default value of the parameter is 2000.
9126 @item ira-loop-reserved-regs
9127 IRA can be used to evaluate more accurate register pressure in loops
9128 for decisions to move loop invariants (see @option{-O3}).  The number
9129 of available registers reserved for some other purposes is given
9130 by this parameter.  The default value of the parameter is 2, which is
9131 the minimal number of registers needed by typical instructions.
9132 This value is the best found from numerous experiments.
9134 @item loop-invariant-max-bbs-in-loop
9135 Loop invariant motion can be very expensive, both in compilation time and
9136 in amount of needed compile-time memory, with very large loops.  Loops
9137 with more basic blocks than this parameter won't have loop invariant
9138 motion optimization performed on them.  The default value of the
9139 parameter is 1000 for -O1 and 10000 for -O2 and above.
9141 @item loop-max-datarefs-for-datadeps
9142 Building data dapendencies is expensive for very large loops.  This
9143 parameter limits the number of data references in loops that are
9144 considered for data dependence analysis.  These large loops will not
9145 be handled then by the optimizations using loop data dependencies.
9146 The default value is 1000.
9148 @item max-vartrack-size
9149 Sets a maximum number of hash table slots to use during variable
9150 tracking dataflow analysis of any function.  If this limit is exceeded
9151 with variable tracking at assignments enabled, analysis for that
9152 function is retried without it, after removing all debug insns from
9153 the function.  If the limit is exceeded even without debug insns, var
9154 tracking analysis is completely disabled for the function.  Setting
9155 the parameter to zero makes it unlimited.
9157 @item max-vartrack-expr-depth
9158 Sets a maximum number of recursion levels when attempting to map
9159 variable names or debug temporaries to value expressions.  This trades
9160 compilation time for more complete debug information.  If this is set too
9161 low, value expressions that are available and could be represented in
9162 debug information may end up not being used; setting this higher may
9163 enable the compiler to find more complex debug expressions, but compile
9164 time and memory use may grow.  The default is 12.
9166 @item min-nondebug-insn-uid
9167 Use uids starting at this parameter for nondebug insns.  The range below
9168 the parameter is reserved exclusively for debug insns created by
9169 @option{-fvar-tracking-assignments}, but debug insns may get
9170 (non-overlapping) uids above it if the reserved range is exhausted.
9172 @item ipa-sra-ptr-growth-factor
9173 IPA-SRA will replace a pointer to an aggregate with one or more new
9174 parameters only when their cumulative size is less or equal to
9175 @option{ipa-sra-ptr-growth-factor} times the size of the original
9176 pointer parameter.
9178 @item tm-max-aggregate-size
9179 When making copies of thread-local variables in a transaction, this
9180 parameter specifies the size in bytes after which variables will be
9181 saved with the logging functions as opposed to save/restore code
9182 sequence pairs.  This option only applies when using
9183 @option{-fgnu-tm}.
9185 @item graphite-max-nb-scop-params
9186 To avoid exponential effects in the Graphite loop transforms, the
9187 number of parameters in a Static Control Part (SCoP) is bounded.  The
9188 default value is 10 parameters.  A variable whose value is unknown at
9189 compilation time and defined outside a SCoP is a parameter of the SCoP.
9191 @item graphite-max-bbs-per-function
9192 To avoid exponential effects in the detection of SCoPs, the size of
9193 the functions analyzed by Graphite is bounded.  The default value is
9194 100 basic blocks.
9196 @item loop-block-tile-size
9197 Loop blocking or strip mining transforms, enabled with
9198 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
9199 loop in the loop nest by a given number of iterations.  The strip
9200 length can be changed using the @option{loop-block-tile-size}
9201 parameter.  The default value is 51 iterations.
9203 @item ipa-cp-value-list-size
9204 IPA-CP attempts to track all possible values and types passed to a function's
9205 parameter in order to propagate them and perform devirtualization.
9206 @option{ipa-cp-value-list-size} is the maximum number of values and types it
9207 stores per one formal parameter of a function.
9209 @item lto-partitions
9210 Specify desired number of partitions produced during WHOPR compilation.
9211 The number of partitions should exceed the number of CPUs used for compilation.
9212 The default value is 32.
9214 @item lto-minpartition
9215 Size of minimal partition for WHOPR (in estimated instructions).
9216 This prevents expenses of splitting very small programs into too many
9217 partitions.
9219 @item cxx-max-namespaces-for-diagnostic-help
9220 The maximum number of namespaces to consult for suggestions when C++
9221 name lookup fails for an identifier.  The default is 1000.
9223 @item sink-frequency-threshold
9224 The maximum relative execution frequency (in percents) of the target block
9225 relative to a statement's original block to allow statement sinking of a
9226 statement.  Larger numbers result in more aggressive statement sinking.
9227 The default value is 75.  A small positive adjustment is applied for
9228 statements with memory operands as those are even more profitable so sink.
9230 @item max-stores-to-sink
9231 The maximum number of conditional stores paires that can be sunk.  Set to 0
9232 if either vectorization (@option{-ftree-vectorize}) or if-conversion
9233 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
9235 @item allow-load-data-races
9236 Allow optimizers to introduce new data races on loads.
9237 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9238 unless implicitly set by the @option{-fmemory-model=} option.
9240 @item allow-store-data-races
9241 Allow optimizers to introduce new data races on stores.
9242 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9243 unless implicitly set by the @option{-fmemory-model=} option.
9245 @item allow-packed-load-data-races
9246 Allow optimizers to introduce new data races on packed data loads.
9247 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9248 unless implicitly set by the @option{-fmemory-model=} option.
9250 @item allow-packed-store-data-races
9251 Allow optimizers to introduce new data races on packed data stores.
9252 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9253 unless implicitly set by the @option{-fmemory-model=} option.
9255 @item case-values-threshold
9256 The smallest number of different values for which it is best to use a
9257 jump-table instead of a tree of conditional branches.  If the value is
9258 0, use the default for the machine.  The default is 0.
9260 @item tree-reassoc-width
9261 Set the maximum number of instructions executed in parallel in
9262 reassociated tree. This parameter overrides target dependent
9263 heuristics used by default if has non zero value.
9265 @end table
9266 @end table
9268 @node Preprocessor Options
9269 @section Options Controlling the Preprocessor
9270 @cindex preprocessor options
9271 @cindex options, preprocessor
9273 These options control the C preprocessor, which is run on each C source
9274 file before actual compilation.
9276 If you use the @option{-E} option, nothing is done except preprocessing.
9277 Some of these options make sense only together with @option{-E} because
9278 they cause the preprocessor output to be unsuitable for actual
9279 compilation.
9281 @table @gcctabopt
9282 @item -Wp,@var{option}
9283 @opindex Wp
9284 You can use @option{-Wp,@var{option}} to bypass the compiler driver
9285 and pass @var{option} directly through to the preprocessor.  If
9286 @var{option} contains commas, it is split into multiple options at the
9287 commas.  However, many options are modified, translated or interpreted
9288 by the compiler driver before being passed to the preprocessor, and
9289 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
9290 interface is undocumented and subject to change, so whenever possible
9291 you should avoid using @option{-Wp} and let the driver handle the
9292 options instead.
9294 @item -Xpreprocessor @var{option}
9295 @opindex Xpreprocessor
9296 Pass @var{option} as an option to the preprocessor.  You can use this to
9297 supply system-specific preprocessor options that GCC does not know how to
9298 recognize.
9300 If you want to pass an option that takes an argument, you must use
9301 @option{-Xpreprocessor} twice, once for the option and once for the argument.
9302 @end table
9304 @include cppopts.texi
9306 @node Assembler Options
9307 @section Passing Options to the Assembler
9309 @c prevent bad page break with this line
9310 You can pass options to the assembler.
9312 @table @gcctabopt
9313 @item -Wa,@var{option}
9314 @opindex Wa
9315 Pass @var{option} as an option to the assembler.  If @var{option}
9316 contains commas, it is split into multiple options at the commas.
9318 @item -Xassembler @var{option}
9319 @opindex Xassembler
9320 Pass @var{option} as an option to the assembler.  You can use this to
9321 supply system-specific assembler options that GCC does not know how to
9322 recognize.
9324 If you want to pass an option that takes an argument, you must use
9325 @option{-Xassembler} twice, once for the option and once for the argument.
9327 @end table
9329 @node Link Options
9330 @section Options for Linking
9331 @cindex link options
9332 @cindex options, linking
9334 These options come into play when the compiler links object files into
9335 an executable output file.  They are meaningless if the compiler is
9336 not doing a link step.
9338 @table @gcctabopt
9339 @cindex file names
9340 @item @var{object-file-name}
9341 A file name that does not end in a special recognized suffix is
9342 considered to name an object file or library.  (Object files are
9343 distinguished from libraries by the linker according to the file
9344 contents.)  If linking is done, these object files are used as input
9345 to the linker.
9347 @item -c
9348 @itemx -S
9349 @itemx -E
9350 @opindex c
9351 @opindex S
9352 @opindex E
9353 If any of these options is used, then the linker is not run, and
9354 object file names should not be used as arguments.  @xref{Overall
9355 Options}.
9357 @cindex Libraries
9358 @item -l@var{library}
9359 @itemx -l @var{library}
9360 @opindex l
9361 Search the library named @var{library} when linking.  (The second
9362 alternative with the library as a separate argument is only for
9363 POSIX compliance and is not recommended.)
9365 It makes a difference where in the command you write this option; the
9366 linker searches and processes libraries and object files in the order they
9367 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
9368 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
9369 to functions in @samp{z}, those functions may not be loaded.
9371 The linker searches a standard list of directories for the library,
9372 which is actually a file named @file{lib@var{library}.a}.  The linker
9373 then uses this file as if it had been specified precisely by name.
9375 The directories searched include several standard system directories
9376 plus any that you specify with @option{-L}.
9378 Normally the files found this way are library files---archive files
9379 whose members are object files.  The linker handles an archive file by
9380 scanning through it for members which define symbols that have so far
9381 been referenced but not defined.  But if the file that is found is an
9382 ordinary object file, it is linked in the usual fashion.  The only
9383 difference between using an @option{-l} option and specifying a file name
9384 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
9385 and searches several directories.
9387 @item -lobjc
9388 @opindex lobjc
9389 You need this special case of the @option{-l} option in order to
9390 link an Objective-C or Objective-C++ program.
9392 @item -nostartfiles
9393 @opindex nostartfiles
9394 Do not use the standard system startup files when linking.
9395 The standard system libraries are used normally, unless @option{-nostdlib}
9396 or @option{-nodefaultlibs} is used.
9398 @item -nodefaultlibs
9399 @opindex nodefaultlibs
9400 Do not use the standard system libraries when linking.
9401 Only the libraries you specify will be passed to the linker, options
9402 specifying linkage of the system libraries, such as @code{-static-libgcc}
9403 or @code{-shared-libgcc}, will be ignored.
9404 The standard startup files are used normally, unless @option{-nostartfiles}
9405 is used.  The compiler may generate calls to @code{memcmp},
9406 @code{memset}, @code{memcpy} and @code{memmove}.
9407 These entries are usually resolved by entries in
9408 libc.  These entry points should be supplied through some other
9409 mechanism when this option is specified.
9411 @item -nostdlib
9412 @opindex nostdlib
9413 Do not use the standard system startup files or libraries when linking.
9414 No startup files and only the libraries you specify will be passed to
9415 the linker, options specifying linkage of the system libraries, such as
9416 @code{-static-libgcc} or @code{-shared-libgcc}, will be ignored.
9417 The compiler may generate calls to @code{memcmp}, @code{memset},
9418 @code{memcpy} and @code{memmove}.
9419 These entries are usually resolved by entries in
9420 libc.  These entry points should be supplied through some other
9421 mechanism when this option is specified.
9423 @cindex @option{-lgcc}, use with @option{-nostdlib}
9424 @cindex @option{-nostdlib} and unresolved references
9425 @cindex unresolved references and @option{-nostdlib}
9426 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
9427 @cindex @option{-nodefaultlibs} and unresolved references
9428 @cindex unresolved references and @option{-nodefaultlibs}
9429 One of the standard libraries bypassed by @option{-nostdlib} and
9430 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
9431 which GCC uses to overcome shortcomings of particular machines, or special
9432 needs for some languages.
9433 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
9434 Collection (GCC) Internals},
9435 for more discussion of @file{libgcc.a}.)
9436 In most cases, you need @file{libgcc.a} even when you want to avoid
9437 other standard libraries.  In other words, when you specify @option{-nostdlib}
9438 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
9439 This ensures that you have no unresolved references to internal GCC
9440 library subroutines.  (For example, @samp{__main}, used to ensure C++
9441 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
9442 GNU Compiler Collection (GCC) Internals}.)
9444 @item -pie
9445 @opindex pie
9446 Produce a position independent executable on targets that support it.
9447 For predictable results, you must also specify the same set of options
9448 that were used to generate code (@option{-fpie}, @option{-fPIE},
9449 or model suboptions) when you specify this option.
9451 @item -rdynamic
9452 @opindex rdynamic
9453 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
9454 that support it. This instructs the linker to add all symbols, not
9455 only used ones, to the dynamic symbol table. This option is needed
9456 for some uses of @code{dlopen} or to allow obtaining backtraces
9457 from within a program.
9459 @item -s
9460 @opindex s
9461 Remove all symbol table and relocation information from the executable.
9463 @item -static
9464 @opindex static
9465 On systems that support dynamic linking, this prevents linking with the shared
9466 libraries.  On other systems, this option has no effect.
9468 @item -shared
9469 @opindex shared
9470 Produce a shared object which can then be linked with other objects to
9471 form an executable.  Not all systems support this option.  For predictable
9472 results, you must also specify the same set of options that were used to
9473 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
9474 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
9475 needs to build supplementary stub code for constructors to work.  On
9476 multi-libbed systems, @samp{gcc -shared} must select the correct support
9477 libraries to link against.  Failing to supply the correct flags may lead
9478 to subtle defects.  Supplying them in cases where they are not necessary
9479 is innocuous.}
9481 @item -shared-libgcc
9482 @itemx -static-libgcc
9483 @opindex shared-libgcc
9484 @opindex static-libgcc
9485 On systems that provide @file{libgcc} as a shared library, these options
9486 force the use of either the shared or static version respectively.
9487 If no shared version of @file{libgcc} was built when the compiler was
9488 configured, these options have no effect.
9490 There are several situations in which an application should use the
9491 shared @file{libgcc} instead of the static version.  The most common
9492 of these is when the application wishes to throw and catch exceptions
9493 across different shared libraries.  In that case, each of the libraries
9494 as well as the application itself should use the shared @file{libgcc}.
9496 Therefore, the G++ and GCJ drivers automatically add
9497 @option{-shared-libgcc} whenever you build a shared library or a main
9498 executable, because C++ and Java programs typically use exceptions, so
9499 this is the right thing to do.
9501 If, instead, you use the GCC driver to create shared libraries, you may
9502 find that they will not always be linked with the shared @file{libgcc}.
9503 If GCC finds, at its configuration time, that you have a non-GNU linker
9504 or a GNU linker that does not support option @option{--eh-frame-hdr},
9505 it will link the shared version of @file{libgcc} into shared libraries
9506 by default.  Otherwise, it will take advantage of the linker and optimize
9507 away the linking with the shared version of @file{libgcc}, linking with
9508 the static version of libgcc by default.  This allows exceptions to
9509 propagate through such shared libraries, without incurring relocation
9510 costs at library load time.
9512 However, if a library or main executable is supposed to throw or catch
9513 exceptions, you must link it using the G++ or GCJ driver, as appropriate
9514 for the languages used in the program, or using the option
9515 @option{-shared-libgcc}, such that it is linked with the shared
9516 @file{libgcc}.
9518 @item -static-libstdc++
9519 When the @command{g++} program is used to link a C++ program, it will
9520 normally automatically link against @option{libstdc++}.  If
9521 @file{libstdc++} is available as a shared library, and the
9522 @option{-static} option is not used, then this will link against the
9523 shared version of @file{libstdc++}.  That is normally fine.  However, it
9524 is sometimes useful to freeze the version of @file{libstdc++} used by
9525 the program without going all the way to a fully static link.  The
9526 @option{-static-libstdc++} option directs the @command{g++} driver to
9527 link @file{libstdc++} statically, without necessarily linking other
9528 libraries statically.
9530 @item -symbolic
9531 @opindex symbolic
9532 Bind references to global symbols when building a shared object.  Warn
9533 about any unresolved references (unless overridden by the link editor
9534 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
9535 this option.
9537 @item -T @var{script}
9538 @opindex T
9539 @cindex linker script
9540 Use @var{script} as the linker script.  This option is supported by most
9541 systems using the GNU linker.  On some targets, such as bare-board
9542 targets without an operating system, the @option{-T} option may be required
9543 when linking to avoid references to undefined symbols.
9545 @item -Xlinker @var{option}
9546 @opindex Xlinker
9547 Pass @var{option} as an option to the linker.  You can use this to
9548 supply system-specific linker options that GCC does not recognize.
9550 If you want to pass an option that takes a separate argument, you must use
9551 @option{-Xlinker} twice, once for the option and once for the argument.
9552 For example, to pass @option{-assert definitions}, you must write
9553 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
9554 @option{-Xlinker "-assert definitions"}, because this passes the entire
9555 string as a single argument, which is not what the linker expects.
9557 When using the GNU linker, it is usually more convenient to pass
9558 arguments to linker options using the @option{@var{option}=@var{value}}
9559 syntax than as separate arguments.  For example, you can specify
9560 @samp{-Xlinker -Map=output.map} rather than
9561 @samp{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
9562 this syntax for command-line options.
9564 @item -Wl,@var{option}
9565 @opindex Wl
9566 Pass @var{option} as an option to the linker.  If @var{option} contains
9567 commas, it is split into multiple options at the commas.  You can use this
9568 syntax to pass an argument to the option.
9569 For example, @samp{-Wl,-Map,output.map} passes @samp{-Map output.map} to the
9570 linker.  When using the GNU linker, you can also get the same effect with
9571 @samp{-Wl,-Map=output.map}.
9573 @item -u @var{symbol}
9574 @opindex u
9575 Pretend the symbol @var{symbol} is undefined, to force linking of
9576 library modules to define it.  You can use @option{-u} multiple times with
9577 different symbols to force loading of additional library modules.
9578 @end table
9580 @node Directory Options
9581 @section Options for Directory Search
9582 @cindex directory options
9583 @cindex options, directory search
9584 @cindex search path
9586 These options specify directories to search for header files, for
9587 libraries and for parts of the compiler:
9589 @table @gcctabopt
9590 @item -I@var{dir}
9591 @opindex I
9592 Add the directory @var{dir} to the head of the list of directories to be
9593 searched for header files.  This can be used to override a system header
9594 file, substituting your own version, since these directories are
9595 searched before the system header file directories.  However, you should
9596 not use this option to add directories that contain vendor-supplied
9597 system header files (use @option{-isystem} for that).  If you use more than
9598 one @option{-I} option, the directories are scanned in left-to-right
9599 order; the standard system directories come after.
9601 If a standard system include directory, or a directory specified with
9602 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
9603 option will be ignored.  The directory will still be searched but as a
9604 system directory at its normal position in the system include chain.
9605 This is to ensure that GCC's procedure to fix buggy system headers and
9606 the ordering for the include_next directive are not inadvertently changed.
9607 If you really need to change the search order for system directories,
9608 use the @option{-nostdinc} and/or @option{-isystem} options.
9610 @item -iplugindir=@var{dir}
9611 Set the directory to search for plugins that are passed
9612 by @option{-fplugin=@var{name}} instead of
9613 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
9614 to be used by the user, but only passed by the driver.
9616 @item -iquote@var{dir}
9617 @opindex iquote
9618 Add the directory @var{dir} to the head of the list of directories to
9619 be searched for header files only for the case of @samp{#include
9620 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
9621 otherwise just like @option{-I}.
9623 @item -L@var{dir}
9624 @opindex L
9625 Add directory @var{dir} to the list of directories to be searched
9626 for @option{-l}.
9628 @item -B@var{prefix}
9629 @opindex B
9630 This option specifies where to find the executables, libraries,
9631 include files, and data files of the compiler itself.
9633 The compiler driver program runs one or more of the subprograms
9634 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
9635 @var{prefix} as a prefix for each program it tries to run, both with and
9636 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
9638 For each subprogram to be run, the compiler driver first tries the
9639 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
9640 was not specified, the driver tries two standard prefixes, 
9641 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
9642 those results in a file name that is found, the unmodified program
9643 name is searched for using the directories specified in your
9644 @env{PATH} environment variable.
9646 The compiler will check to see if the path provided by the @option{-B}
9647 refers to a directory, and if necessary it will add a directory
9648 separator character at the end of the path.
9650 @option{-B} prefixes that effectively specify directory names also apply
9651 to libraries in the linker, because the compiler translates these
9652 options into @option{-L} options for the linker.  They also apply to
9653 includes files in the preprocessor, because the compiler translates these
9654 options into @option{-isystem} options for the preprocessor.  In this case,
9655 the compiler appends @samp{include} to the prefix.
9657 The runtime support file @file{libgcc.a} can also be searched for using
9658 the @option{-B} prefix, if needed.  If it is not found there, the two
9659 standard prefixes above are tried, and that is all.  The file is left
9660 out of the link if it is not found by those means.
9662 Another way to specify a prefix much like the @option{-B} prefix is to use
9663 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
9664 Variables}.
9666 As a special kludge, if the path provided by @option{-B} is
9667 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
9668 9, then it will be replaced by @file{[dir/]include}.  This is to help
9669 with boot-strapping the compiler.
9671 @item -specs=@var{file}
9672 @opindex specs
9673 Process @var{file} after the compiler reads in the standard @file{specs}
9674 file, in order to override the defaults which the @file{gcc} driver
9675 program uses when determining what switches to pass to @file{cc1},
9676 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
9677 @option{-specs=@var{file}} can be specified on the command line, and they
9678 are processed in order, from left to right.
9680 @item --sysroot=@var{dir}
9681 @opindex sysroot
9682 Use @var{dir} as the logical root directory for headers and libraries.
9683 For example, if the compiler would normally search for headers in
9684 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
9685 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
9687 If you use both this option and the @option{-isysroot} option, then
9688 the @option{--sysroot} option will apply to libraries, but the
9689 @option{-isysroot} option will apply to header files.
9691 The GNU linker (beginning with version 2.16) has the necessary support
9692 for this option.  If your linker does not support this option, the
9693 header file aspect of @option{--sysroot} will still work, but the
9694 library aspect will not.
9696 @item -I-
9697 @opindex I-
9698 This option has been deprecated.  Please use @option{-iquote} instead for
9699 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
9700 Any directories you specify with @option{-I} options before the @option{-I-}
9701 option are searched only for the case of @samp{#include "@var{file}"};
9702 they are not searched for @samp{#include <@var{file}>}.
9704 If additional directories are specified with @option{-I} options after
9705 the @option{-I-}, these directories are searched for all @samp{#include}
9706 directives.  (Ordinarily @emph{all} @option{-I} directories are used
9707 this way.)
9709 In addition, the @option{-I-} option inhibits the use of the current
9710 directory (where the current input file came from) as the first search
9711 directory for @samp{#include "@var{file}"}.  There is no way to
9712 override this effect of @option{-I-}.  With @option{-I.} you can specify
9713 searching the directory that was current when the compiler was
9714 invoked.  That is not exactly the same as what the preprocessor does
9715 by default, but it is often satisfactory.
9717 @option{-I-} does not inhibit the use of the standard system directories
9718 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
9719 independent.
9720 @end table
9722 @c man end
9724 @node Spec Files
9725 @section Specifying subprocesses and the switches to pass to them
9726 @cindex Spec Files
9728 @command{gcc} is a driver program.  It performs its job by invoking a
9729 sequence of other programs to do the work of compiling, assembling and
9730 linking.  GCC interprets its command-line parameters and uses these to
9731 deduce which programs it should invoke, and which command-line options
9732 it ought to place on their command lines.  This behavior is controlled
9733 by @dfn{spec strings}.  In most cases there is one spec string for each
9734 program that GCC can invoke, but a few programs have multiple spec
9735 strings to control their behavior.  The spec strings built into GCC can
9736 be overridden by using the @option{-specs=} command-line switch to specify
9737 a spec file.
9739 @dfn{Spec files} are plaintext files that are used to construct spec
9740 strings.  They consist of a sequence of directives separated by blank
9741 lines.  The type of directive is determined by the first non-whitespace
9742 character on the line, which can be one of the following:
9744 @table @code
9745 @item %@var{command}
9746 Issues a @var{command} to the spec file processor.  The commands that can
9747 appear here are:
9749 @table @code
9750 @item %include <@var{file}>
9751 @cindex @code{%include}
9752 Search for @var{file} and insert its text at the current point in the
9753 specs file.
9755 @item %include_noerr <@var{file}>
9756 @cindex @code{%include_noerr}
9757 Just like @samp{%include}, but do not generate an error message if the include
9758 file cannot be found.
9760 @item %rename @var{old_name} @var{new_name}
9761 @cindex @code{%rename}
9762 Rename the spec string @var{old_name} to @var{new_name}.
9764 @end table
9766 @item *[@var{spec_name}]:
9767 This tells the compiler to create, override or delete the named spec
9768 string.  All lines after this directive up to the next directive or
9769 blank line are considered to be the text for the spec string.  If this
9770 results in an empty string then the spec will be deleted.  (Or, if the
9771 spec did not exist, then nothing will happen.)  Otherwise, if the spec
9772 does not currently exist a new spec will be created.  If the spec does
9773 exist then its contents will be overridden by the text of this
9774 directive, unless the first character of that text is the @samp{+}
9775 character, in which case the text will be appended to the spec.
9777 @item [@var{suffix}]:
9778 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
9779 and up to the next directive or blank line are considered to make up the
9780 spec string for the indicated suffix.  When the compiler encounters an
9781 input file with the named suffix, it will processes the spec string in
9782 order to work out how to compile that file.  For example:
9784 @smallexample
9785 .ZZ:
9786 z-compile -input %i
9787 @end smallexample
9789 This says that any input file whose name ends in @samp{.ZZ} should be
9790 passed to the program @samp{z-compile}, which should be invoked with the
9791 command-line switch @option{-input} and with the result of performing the
9792 @samp{%i} substitution.  (See below.)
9794 As an alternative to providing a spec string, the text that follows a
9795 suffix directive can be one of the following:
9797 @table @code
9798 @item @@@var{language}
9799 This says that the suffix is an alias for a known @var{language}.  This is
9800 similar to using the @option{-x} command-line switch to GCC to specify a
9801 language explicitly.  For example:
9803 @smallexample
9804 .ZZ:
9805 @@c++
9806 @end smallexample
9808 Says that .ZZ files are, in fact, C++ source files.
9810 @item #@var{name}
9811 This causes an error messages saying:
9813 @smallexample
9814 @var{name} compiler not installed on this system.
9815 @end smallexample
9816 @end table
9818 GCC already has an extensive list of suffixes built into it.
9819 This directive will add an entry to the end of the list of suffixes, but
9820 since the list is searched from the end backwards, it is effectively
9821 possible to override earlier entries using this technique.
9823 @end table
9825 GCC has the following spec strings built into it.  Spec files can
9826 override these strings or create their own.  Note that individual
9827 targets can also add their own spec strings to this list.
9829 @smallexample
9830 asm          Options to pass to the assembler
9831 asm_final    Options to pass to the assembler post-processor
9832 cpp          Options to pass to the C preprocessor
9833 cc1          Options to pass to the C compiler
9834 cc1plus      Options to pass to the C++ compiler
9835 endfile      Object files to include at the end of the link
9836 link         Options to pass to the linker
9837 lib          Libraries to include on the command line to the linker
9838 libgcc       Decides which GCC support library to pass to the linker
9839 linker       Sets the name of the linker
9840 predefines   Defines to be passed to the C preprocessor
9841 signed_char  Defines to pass to CPP to say whether @code{char} is signed
9842              by default
9843 startfile    Object files to include at the start of the link
9844 @end smallexample
9846 Here is a small example of a spec file:
9848 @smallexample
9849 %rename lib                 old_lib
9851 *lib:
9852 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
9853 @end smallexample
9855 This example renames the spec called @samp{lib} to @samp{old_lib} and
9856 then overrides the previous definition of @samp{lib} with a new one.
9857 The new definition adds in some extra command-line options before
9858 including the text of the old definition.
9860 @dfn{Spec strings} are a list of command-line options to be passed to their
9861 corresponding program.  In addition, the spec strings can contain
9862 @samp{%}-prefixed sequences to substitute variable text or to
9863 conditionally insert text into the command line.  Using these constructs
9864 it is possible to generate quite complex command lines.
9866 Here is a table of all defined @samp{%}-sequences for spec
9867 strings.  Note that spaces are not generated automatically around the
9868 results of expanding these sequences.  Therefore you can concatenate them
9869 together or combine them with constant text in a single argument.
9871 @table @code
9872 @item %%
9873 Substitute one @samp{%} into the program name or argument.
9875 @item %i
9876 Substitute the name of the input file being processed.
9878 @item %b
9879 Substitute the basename of the input file being processed.
9880 This is the substring up to (and not including) the last period
9881 and not including the directory.
9883 @item %B
9884 This is the same as @samp{%b}, but include the file suffix (text after
9885 the last period).
9887 @item %d
9888 Marks the argument containing or following the @samp{%d} as a
9889 temporary file name, so that that file will be deleted if GCC exits
9890 successfully.  Unlike @samp{%g}, this contributes no text to the
9891 argument.
9893 @item %g@var{suffix}
9894 Substitute a file name that has suffix @var{suffix} and is chosen
9895 once per compilation, and mark the argument in the same way as
9896 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
9897 name is now chosen in a way that is hard to predict even when previously
9898 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
9899 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
9900 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
9901 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
9902 was simply substituted with a file name chosen once per compilation,
9903 without regard to any appended suffix (which was therefore treated
9904 just like ordinary text), making such attacks more likely to succeed.
9906 @item %u@var{suffix}
9907 Like @samp{%g}, but generates a new temporary file name even if
9908 @samp{%u@var{suffix}} was already seen.
9910 @item %U@var{suffix}
9911 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
9912 new one if there is no such last file name.  In the absence of any
9913 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
9914 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
9915 would involve the generation of two distinct file names, one
9916 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
9917 simply substituted with a file name chosen for the previous @samp{%u},
9918 without regard to any appended suffix.
9920 @item %j@var{suffix}
9921 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
9922 writable, and if save-temps is off; otherwise, substitute the name
9923 of a temporary file, just like @samp{%u}.  This temporary file is not
9924 meant for communication between processes, but rather as a junk
9925 disposal mechanism.
9927 @item %|@var{suffix}
9928 @itemx %m@var{suffix}
9929 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
9930 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
9931 all.  These are the two most common ways to instruct a program that it
9932 should read from standard input or write to standard output.  If you
9933 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
9934 construct: see for example @file{f/lang-specs.h}.
9936 @item %.@var{SUFFIX}
9937 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
9938 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
9939 terminated by the next space or %.
9941 @item %w
9942 Marks the argument containing or following the @samp{%w} as the
9943 designated output file of this compilation.  This puts the argument
9944 into the sequence of arguments that @samp{%o} will substitute later.
9946 @item %o
9947 Substitutes the names of all the output files, with spaces
9948 automatically placed around them.  You should write spaces
9949 around the @samp{%o} as well or the results are undefined.
9950 @samp{%o} is for use in the specs for running the linker.
9951 Input files whose names have no recognized suffix are not compiled
9952 at all, but they are included among the output files, so they will
9953 be linked.
9955 @item %O
9956 Substitutes the suffix for object files.  Note that this is
9957 handled specially when it immediately follows @samp{%g, %u, or %U},
9958 because of the need for those to form complete file names.  The
9959 handling is such that @samp{%O} is treated exactly as if it had already
9960 been substituted, except that @samp{%g, %u, and %U} do not currently
9961 support additional @var{suffix} characters following @samp{%O} as they would
9962 following, for example, @samp{.o}.
9964 @item %p
9965 Substitutes the standard macro predefinitions for the
9966 current target machine.  Use this when running @code{cpp}.
9968 @item %P
9969 Like @samp{%p}, but puts @samp{__} before and after the name of each
9970 predefined macro, except for macros that start with @samp{__} or with
9971 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
9974 @item %I
9975 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
9976 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
9977 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
9978 and @option{-imultilib} as necessary.
9980 @item %s
9981 Current argument is the name of a library or startup file of some sort.
9982 Search for that file in a standard list of directories and substitute
9983 the full name found.  The current working directory is included in the
9984 list of directories scanned.
9986 @item %T
9987 Current argument is the name of a linker script.  Search for that file
9988 in the current list of directories to scan for libraries. If the file
9989 is located insert a @option{--script} option into the command line
9990 followed by the full path name found.  If the file is not found then
9991 generate an error message.  Note: the current working directory is not
9992 searched.
9994 @item %e@var{str}
9995 Print @var{str} as an error message.  @var{str} is terminated by a newline.
9996 Use this when inconsistent options are detected.
9998 @item %(@var{name})
9999 Substitute the contents of spec string @var{name} at this point.
10001 @item %x@{@var{option}@}
10002 Accumulate an option for @samp{%X}.
10004 @item %X
10005 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
10006 spec string.
10008 @item %Y
10009 Output the accumulated assembler options specified by @option{-Wa}.
10011 @item %Z
10012 Output the accumulated preprocessor options specified by @option{-Wp}.
10014 @item %a
10015 Process the @code{asm} spec.  This is used to compute the
10016 switches to be passed to the assembler.
10018 @item %A
10019 Process the @code{asm_final} spec.  This is a spec string for
10020 passing switches to an assembler post-processor, if such a program is
10021 needed.
10023 @item %l
10024 Process the @code{link} spec.  This is the spec for computing the
10025 command line passed to the linker.  Typically it will make use of the
10026 @samp{%L %G %S %D and %E} sequences.
10028 @item %D
10029 Dump out a @option{-L} option for each directory that GCC believes might
10030 contain startup files.  If the target supports multilibs then the
10031 current multilib directory will be prepended to each of these paths.
10033 @item %L
10034 Process the @code{lib} spec.  This is a spec string for deciding which
10035 libraries should be included on the command line to the linker.
10037 @item %G
10038 Process the @code{libgcc} spec.  This is a spec string for deciding
10039 which GCC support library should be included on the command line to the linker.
10041 @item %S
10042 Process the @code{startfile} spec.  This is a spec for deciding which
10043 object files should be the first ones passed to the linker.  Typically
10044 this might be a file named @file{crt0.o}.
10046 @item %E
10047 Process the @code{endfile} spec.  This is a spec string that specifies
10048 the last object files that will be passed to the linker.
10050 @item %C
10051 Process the @code{cpp} spec.  This is used to construct the arguments
10052 to be passed to the C preprocessor.
10054 @item %1
10055 Process the @code{cc1} spec.  This is used to construct the options to be
10056 passed to the actual C compiler (@samp{cc1}).
10058 @item %2
10059 Process the @code{cc1plus} spec.  This is used to construct the options to be
10060 passed to the actual C++ compiler (@samp{cc1plus}).
10062 @item %*
10063 Substitute the variable part of a matched option.  See below.
10064 Note that each comma in the substituted string is replaced by
10065 a single space.
10067 @item %<@code{S}
10068 Remove all occurrences of @code{-S} from the command line.  Note---this
10069 command is position dependent.  @samp{%} commands in the spec string
10070 before this one will see @code{-S}, @samp{%} commands in the spec string
10071 after this one will not.
10073 @item %:@var{function}(@var{args})
10074 Call the named function @var{function}, passing it @var{args}.
10075 @var{args} is first processed as a nested spec string, then split
10076 into an argument vector in the usual fashion.  The function returns
10077 a string which is processed as if it had appeared literally as part
10078 of the current spec.
10080 The following built-in spec functions are provided:
10082 @table @code
10083 @item @code{getenv}
10084 The @code{getenv} spec function takes two arguments: an environment
10085 variable name and a string.  If the environment variable is not
10086 defined, a fatal error is issued.  Otherwise, the return value is the
10087 value of the environment variable concatenated with the string.  For
10088 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
10090 @smallexample
10091 %:getenv(TOPDIR /include)
10092 @end smallexample
10094 expands to @file{/path/to/top/include}.
10096 @item @code{if-exists}
10097 The @code{if-exists} spec function takes one argument, an absolute
10098 pathname to a file.  If the file exists, @code{if-exists} returns the
10099 pathname.  Here is a small example of its usage:
10101 @smallexample
10102 *startfile:
10103 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
10104 @end smallexample
10106 @item @code{if-exists-else}
10107 The @code{if-exists-else} spec function is similar to the @code{if-exists}
10108 spec function, except that it takes two arguments.  The first argument is
10109 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
10110 returns the pathname.  If it does not exist, it returns the second argument.
10111 This way, @code{if-exists-else} can be used to select one file or another,
10112 based on the existence of the first.  Here is a small example of its usage:
10114 @smallexample
10115 *startfile:
10116 crt0%O%s %:if-exists(crti%O%s) \
10117 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
10118 @end smallexample
10120 @item @code{replace-outfile}
10121 The @code{replace-outfile} spec function takes two arguments.  It looks for the
10122 first argument in the outfiles array and replaces it with the second argument.  Here
10123 is a small example of its usage:
10125 @smallexample
10126 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
10127 @end smallexample
10129 @item @code{remove-outfile}
10130 The @code{remove-outfile} spec function takes one argument.  It looks for the
10131 first argument in the outfiles array and removes it.  Here is a small example
10132 its usage:
10134 @smallexample
10135 %:remove-outfile(-lm)
10136 @end smallexample
10138 @item @code{pass-through-libs}
10139 The @code{pass-through-libs} spec function takes any number of arguments.  It
10140 finds any @option{-l} options and any non-options ending in ".a" (which it
10141 assumes are the names of linker input library archive files) and returns a
10142 result containing all the found arguments each prepended by
10143 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
10144 intended to be passed to the LTO linker plugin.
10146 @smallexample
10147 %:pass-through-libs(%G %L %G)
10148 @end smallexample
10150 @item @code{print-asm-header}
10151 The @code{print-asm-header} function takes no arguments and simply
10152 prints a banner like:
10154 @smallexample
10155 Assembler options
10156 =================
10158 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
10159 @end smallexample
10161 It is used to separate compiler options from assembler options
10162 in the @option{--target-help} output.
10163 @end table
10165 @item %@{@code{S}@}
10166 Substitutes the @code{-S} switch, if that switch was given to GCC@.
10167 If that switch was not specified, this substitutes nothing.  Note that
10168 the leading dash is omitted when specifying this option, and it is
10169 automatically inserted if the substitution is performed.  Thus the spec
10170 string @samp{%@{foo@}} would match the command-line option @option{-foo}
10171 and would output the command-line option @option{-foo}.
10173 @item %W@{@code{S}@}
10174 Like %@{@code{S}@} but mark last argument supplied within as a file to be
10175 deleted on failure.
10177 @item %@{@code{S}*@}
10178 Substitutes all the switches specified to GCC whose names start
10179 with @code{-S}, but which also take an argument.  This is used for
10180 switches like @option{-o}, @option{-D}, @option{-I}, etc.
10181 GCC considers @option{-o foo} as being
10182 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
10183 text, including the space.  Thus two arguments would be generated.
10185 @item %@{@code{S}*&@code{T}*@}
10186 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
10187 (the order of @code{S} and @code{T} in the spec is not significant).
10188 There can be any number of ampersand-separated variables; for each the
10189 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
10191 @item %@{@code{S}:@code{X}@}
10192 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
10194 @item %@{!@code{S}:@code{X}@}
10195 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
10197 @item %@{@code{S}*:@code{X}@}
10198 Substitutes @code{X} if one or more switches whose names start with
10199 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
10200 once, no matter how many such switches appeared.  However, if @code{%*}
10201 appears somewhere in @code{X}, then @code{X} will be substituted once
10202 for each matching switch, with the @code{%*} replaced by the part of
10203 that switch that matched the @code{*}.
10205 @item %@{.@code{S}:@code{X}@}
10206 Substitutes @code{X}, if processing a file with suffix @code{S}.
10208 @item %@{!.@code{S}:@code{X}@}
10209 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
10211 @item %@{,@code{S}:@code{X}@}
10212 Substitutes @code{X}, if processing a file for language @code{S}.
10214 @item %@{!,@code{S}:@code{X}@}
10215 Substitutes @code{X}, if not processing a file for language @code{S}.
10217 @item %@{@code{S}|@code{P}:@code{X}@}
10218 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
10219 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
10220 @code{*} sequences as well, although they have a stronger binding than
10221 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
10222 alternatives must be starred, and only the first matching alternative
10223 is substituted.
10225 For example, a spec string like this:
10227 @smallexample
10228 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
10229 @end smallexample
10231 will output the following command-line options from the following input
10232 command-line options:
10234 @smallexample
10235 fred.c        -foo -baz
10236 jim.d         -bar -boggle
10237 -d fred.c     -foo -baz -boggle
10238 -d jim.d      -bar -baz -boggle
10239 @end smallexample
10241 @item %@{S:X; T:Y; :D@}
10243 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
10244 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
10245 be as many clauses as you need.  This may be combined with @code{.},
10246 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
10249 @end table
10251 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
10252 construct may contain other nested @samp{%} constructs or spaces, or
10253 even newlines.  They are processed as usual, as described above.
10254 Trailing white space in @code{X} is ignored.  White space may also
10255 appear anywhere on the left side of the colon in these constructs,
10256 except between @code{.} or @code{*} and the corresponding word.
10258 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
10259 handled specifically in these constructs.  If another value of
10260 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
10261 @option{-W} switch is found later in the command line, the earlier
10262 switch value is ignored, except with @{@code{S}*@} where @code{S} is
10263 just one letter, which passes all matching options.
10265 The character @samp{|} at the beginning of the predicate text is used to
10266 indicate that a command should be piped to the following command, but
10267 only if @option{-pipe} is specified.
10269 It is built into GCC which switches take arguments and which do not.
10270 (You might think it would be useful to generalize this to allow each
10271 compiler's spec to say which switches take arguments.  But this cannot
10272 be done in a consistent fashion.  GCC cannot even decide which input
10273 files have been specified without knowing which switches take arguments,
10274 and it must know which input files to compile in order to tell which
10275 compilers to run).
10277 GCC also knows implicitly that arguments starting in @option{-l} are to be
10278 treated as compiler output files, and passed to the linker in their
10279 proper position among the other output files.
10281 @c man begin OPTIONS
10283 @node Target Options
10284 @section Specifying Target Machine and Compiler Version
10285 @cindex target options
10286 @cindex cross compiling
10287 @cindex specifying machine version
10288 @cindex specifying compiler version and target machine
10289 @cindex compiler version, specifying
10290 @cindex target machine, specifying
10292 The usual way to run GCC is to run the executable called @command{gcc}, or
10293 @command{@var{machine}-gcc} when cross-compiling, or
10294 @command{@var{machine}-gcc-@var{version}} to run a version other than the
10295 one that was installed last.
10297 @node Submodel Options
10298 @section Hardware Models and Configurations
10299 @cindex submodel options
10300 @cindex specifying hardware config
10301 @cindex hardware models and configurations, specifying
10302 @cindex machine dependent options
10304 Each target machine types can have its own
10305 special options, starting with @samp{-m}, to choose among various
10306 hardware models or configurations---for example, 68010 vs 68020,
10307 floating coprocessor or none.  A single installed version of the
10308 compiler can compile for any model or configuration, according to the
10309 options specified.
10311 Some configurations of the compiler also support additional special
10312 options, usually for compatibility with other compilers on the same
10313 platform.
10315 @c This list is ordered alphanumerically by subsection name.
10316 @c It should be the same order and spelling as these options are listed
10317 @c in Machine Dependent Options
10319 @menu
10320 * Adapteva Epiphany Options::
10321 * ARM Options::
10322 * AVR Options::
10323 * Blackfin Options::
10324 * C6X Options::
10325 * CRIS Options::
10326 * CR16 Options::
10327 * Darwin Options::
10328 * DEC Alpha Options::
10329 * DEC Alpha/VMS Options::
10330 * FR30 Options::
10331 * FRV Options::
10332 * GNU/Linux Options::
10333 * H8/300 Options::
10334 * HPPA Options::
10335 * i386 and x86-64 Options::
10336 * i386 and x86-64 Windows Options::
10337 * IA-64 Options::
10338 * IA-64/VMS Options::
10339 * LM32 Options::
10340 * M32C Options::
10341 * M32R/D Options::
10342 * M680x0 Options::
10343 * MCore Options::
10344 * MeP Options::
10345 * MicroBlaze Options::
10346 * MIPS Options::
10347 * MMIX Options::
10348 * MN10300 Options::
10349 * PDP-11 Options::
10350 * picoChip Options::
10351 * PowerPC Options::
10352 * RL78 Options::
10353 * RS/6000 and PowerPC Options::
10354 * RX Options::
10355 * S/390 and zSeries Options::
10356 * Score Options::
10357 * SH Options::
10358 * Solaris 2 Options::
10359 * SPARC Options::
10360 * SPU Options::
10361 * System V Options::
10362 * TILE-Gx Options::
10363 * TILEPro Options::
10364 * V850 Options::
10365 * VAX Options::
10366 * VxWorks Options::
10367 * x86-64 Options::
10368 * Xstormy16 Options::
10369 * Xtensa Options::
10370 * zSeries Options::
10371 @end menu
10373 @node Adapteva Epiphany Options
10374 @subsection Adapteva Epiphany Options
10376 These @samp{-m} options are defined for Adapteva Epiphany:
10378 @table @gcctabopt
10379 @item -mhalf-reg-file
10380 @opindex mhalf-reg-file
10381 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
10382 That allows code to run on hardware variants that lack these registers.
10384 @item -mprefer-short-insn-regs
10385 @opindex mprefer-short-insn-regs
10386 Preferrentially allocate registers that allow short instruction generation.
10387 This can result in increasesd instruction count, so if this reduces or
10388 increases code size might vary from case to case.
10390 @item -mbranch-cost=@var{num}
10391 @opindex mbranch-cost
10392 Set the cost of branches to roughly @var{num} ``simple'' instructions.
10393 This cost is only a heuristic and is not guaranteed to produce
10394 consistent results across releases.
10396 @item -mcmove
10397 @opindex mcmove
10398 Enable the generation of conditional moves.
10400 @item -mnops=@var{num}
10401 @opindex mnops
10402 Emit @var{num} nops before every other generated instruction.
10404 @item -mno-soft-cmpsf
10405 @opindex mno-soft-cmpsf
10406 For single-precision floating-point comparisons, emit an fsub instruction
10407 and test the flags.  This is faster than a software comparison, but can
10408 get incorrect results in the presence of NaNs, or when two different small
10409 numbers are compared such that their difference is calculated as zero.
10410 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
10411 software comparisons.
10413 @item -mstack-offset=@var{num}
10414 @opindex mstack-offset
10415 Set the offset between the top of the stack and the stack pointer.
10416 E.g., a value of 8 means that the eight bytes in the range sp+0@dots{}sp+7
10417 can be used by leaf functions without stack allocation.
10418 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
10419 Note also that this option changes the ABI, compiling a program with a
10420 different stack offset than the libraries have been compiled with
10421 will generally not work.
10422 This option can be useful if you want to evaluate if a different stack
10423 offset would give you better code, but to actually use a different stack
10424 offset to build working programs, it is recommended to configure the
10425 toolchain with the appropriate @samp{--with-stack-offset=@var{num}} option.
10427 @item -mno-round-nearest
10428 @opindex mno-round-nearest
10429 Make the scheduler assume that the rounding mode has been set to
10430 truncating.  The default is @option{-mround-nearest}.
10432 @item -mlong-calls
10433 @opindex mlong-calls
10434 If not otherwise specified by an attribute, assume all calls might be beyond
10435 the offset range of the b / bl instructions, and therefore load the
10436 function address into a register before performing a (otherwise direct) call.
10437 This is the default.
10439 @item -mshort-calls
10440 @opindex short-calls
10441 If not otherwise specified by an attribute, assume all direct calls are
10442 in the range of the b / bl instructions, so use these instructions
10443 for direct calls.  The default is @option{-mlong-calls}.
10445 @item -msmall16
10446 @opindex msmall16
10447 Assume addresses can be loaded as 16-bit unsigned values.  This does not
10448 apply to function addresses for which @option{-mlong-calls} semantics
10449 are in effect.
10451 @item -mfp-mode=@var{mode}
10452 @opindex mfp-mode
10453 Set the prevailing mode of the floating-point unit.
10454 This determines the floating-point mode that is provided and expected
10455 at function call and return time.  Making this mode match the mode you
10456 predominantly need at function start can make your programs smaller and
10457 faster by avoiding unnecessary mode switches.
10459 @var{mode} can be set to one the following values:
10461 @table @samp
10462 @item caller
10463 Any mode at function entry is valid, and retained or restored when
10464 the function returns, and when it calls other functions.
10465 This mode is useful for compiling libraries or other compilation units
10466 you might want to incorporate into different programs with different
10467 prevailing FPU modes, and the convenience of being able to use a single
10468 object file outweighs the size and speed overhead for any extra
10469 mode switching that might be needed, compared with what would be needed
10470 with a more specific choice of prevailing FPU mode.
10472 @item truncate
10473 This is the mode used for floating-point calculations with
10474 truncating (i.e.@: round towards zero) rounding mode.  That includes
10475 conversion from floating point to integer.
10477 @item round-nearest
10478 This is the mode used for floating-point calculations with
10479 round-to-nearest-or-even rounding mode.
10481 @item int
10482 This is the mode used to perform integer calculations in the FPU, e.g.@:
10483 integer multiply, or integer multiply-and-accumulate.
10484 @end table
10486 The default is @option{-mfp-mode=caller}
10488 @item -mnosplit-lohi
10489 @opindex mnosplit-lohi
10490 @item -mno-postinc
10491 @opindex mno-postinc
10492 @item -mno-postmodify
10493 @opindex mno-postmodify
10494 Code generation tweaks that disable, respectively, splitting of 32-bit
10495 loads, generation of post-increment addresses, and generation of
10496 post-modify addresses.  The defaults are @option{msplit-lohi},
10497 @option{-mpost-inc}, and @option{-mpost-modify}.
10499 @item -mnovect-double
10500 @opindex mno-vect-double
10501 Change the preferred SIMD mode to SImode.  The default is
10502 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
10504 @item -max-vect-align=@var{num}
10505 @opindex max-vect-align
10506 The maximum alignment for SIMD vector mode types.
10507 @var{num} may be 4 or 8.  The default is 8.
10508 Note that this is an ABI change, even though many library function
10509 interfaces will be unaffected, if they don't use SIMD vector modes
10510 in places where they affect size and/or alignment of relevant types.
10512 @item -msplit-vecmove-early
10513 @opindex msplit-vecmove-early
10514 Split vector moves into single word moves before reload.  In theory this
10515 could give better register allocation, but so far the reverse seems to be
10516 generally the case.
10518 @item -m1reg-@var{reg}
10519 @opindex m1reg-
10520 Specify a register to hold the constant @minus{}1, which makes loading small negative
10521 constants and certain bitmasks faster.
10522 Allowable values for reg are r43 and r63, which specify to use that register
10523 as a fixed register, and none, which means that no register is used for this
10524 purpose.  The default is @option{-m1reg-none}.
10526 @end table
10528 @node ARM Options
10529 @subsection ARM Options
10530 @cindex ARM options
10532 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
10533 architectures:
10535 @table @gcctabopt
10536 @item -mabi=@var{name}
10537 @opindex mabi
10538 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
10539 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
10541 @item -mapcs-frame
10542 @opindex mapcs-frame
10543 Generate a stack frame that is compliant with the ARM Procedure Call
10544 Standard for all functions, even if this is not strictly necessary for
10545 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
10546 with this option will cause the stack frames not to be generated for
10547 leaf functions.  The default is @option{-mno-apcs-frame}.
10549 @item -mapcs
10550 @opindex mapcs
10551 This is a synonym for @option{-mapcs-frame}.
10553 @ignore
10554 @c not currently implemented
10555 @item -mapcs-stack-check
10556 @opindex mapcs-stack-check
10557 Generate code to check the amount of stack space available upon entry to
10558 every function (that actually uses some stack space).  If there is
10559 insufficient space available then either the function
10560 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
10561 called, depending upon the amount of stack space required.  The runtime
10562 system is required to provide these functions.  The default is
10563 @option{-mno-apcs-stack-check}, since this produces smaller code.
10565 @c not currently implemented
10566 @item -mapcs-float
10567 @opindex mapcs-float
10568 Pass floating-point arguments using the floating-point registers.  This is
10569 one of the variants of the APCS@.  This option is recommended if the
10570 target hardware has a floating-point unit or if a lot of floating-point
10571 arithmetic is going to be performed by the code.  The default is
10572 @option{-mno-apcs-float}, since integer only code is slightly increased in
10573 size if @option{-mapcs-float} is used.
10575 @c not currently implemented
10576 @item -mapcs-reentrant
10577 @opindex mapcs-reentrant
10578 Generate reentrant, position independent code.  The default is
10579 @option{-mno-apcs-reentrant}.
10580 @end ignore
10582 @item -mthumb-interwork
10583 @opindex mthumb-interwork
10584 Generate code that supports calling between the ARM and Thumb
10585 instruction sets.  Without this option, on pre-v5 architectures, the
10586 two instruction sets cannot be reliably used inside one program.  The
10587 default is @option{-mno-thumb-interwork}, since slightly larger code
10588 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
10589 configurations this option is meaningless.
10591 @item -mno-sched-prolog
10592 @opindex mno-sched-prolog
10593 Prevent the reordering of instructions in the function prologue, or the
10594 merging of those instruction with the instructions in the function's
10595 body.  This means that all functions will start with a recognizable set
10596 of instructions (or in fact one of a choice from a small set of
10597 different function prologues), and this information can be used to
10598 locate the start if functions inside an executable piece of code.  The
10599 default is @option{-msched-prolog}.
10601 @item -mfloat-abi=@var{name}
10602 @opindex mfloat-abi
10603 Specifies which floating-point ABI to use.  Permissible values
10604 are: @samp{soft}, @samp{softfp} and @samp{hard}.
10606 Specifying @samp{soft} causes GCC to generate output containing
10607 library calls for floating-point operations.
10608 @samp{softfp} allows the generation of code using hardware floating-point
10609 instructions, but still uses the soft-float calling conventions.
10610 @samp{hard} allows generation of floating-point instructions
10611 and uses FPU-specific calling conventions.
10613 The default depends on the specific target configuration.  Note that
10614 the hard-float and soft-float ABIs are not link-compatible; you must
10615 compile your entire program with the same ABI, and link with a
10616 compatible set of libraries.
10618 @item -mlittle-endian
10619 @opindex mlittle-endian
10620 Generate code for a processor running in little-endian mode.  This is
10621 the default for all standard configurations.
10623 @item -mbig-endian
10624 @opindex mbig-endian
10625 Generate code for a processor running in big-endian mode; the default is
10626 to compile code for a little-endian processor.
10628 @item -mwords-little-endian
10629 @opindex mwords-little-endian
10630 This option only applies when generating code for big-endian processors.
10631 Generate code for a little-endian word order but a big-endian byte
10632 order.  That is, a byte order of the form @samp{32107654}.  Note: this
10633 option should only be used if you require compatibility with code for
10634 big-endian ARM processors generated by versions of the compiler prior to
10635 2.8.  This option is now deprecated.
10637 @item -mcpu=@var{name}
10638 @opindex mcpu
10639 This specifies the name of the target ARM processor.  GCC uses this name
10640 to determine what kind of instructions it can emit when generating
10641 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
10642 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
10643 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
10644 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
10645 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
10646 @samp{arm720},
10647 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
10648 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
10649 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
10650 @samp{strongarm1110},
10651 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
10652 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
10653 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
10654 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
10655 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
10656 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
10657 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
10658 @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8}, @samp{cortex-a9}, 
10659 @samp{cortex-a15}, @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-r5},
10660 @samp{cortex-m4}, @samp{cortex-m3},
10661 @samp{cortex-m1},
10662 @samp{cortex-m0},
10663 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
10664 @samp{fa526}, @samp{fa626},
10665 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te}.
10668 @option{-mcpu=generic-@var{arch}} is also permissible, and is
10669 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
10670 See @option{-mtune} for more information.
10672 @option{-mcpu=native} causes the compiler to auto-detect the CPU
10673 of the build computer.  At present, this feature is only supported on
10674 Linux, and not all architectures are recognized.  If the auto-detect is
10675 unsuccessful the option has no effect.
10677 @item -mtune=@var{name}
10678 @opindex mtune
10679 This option is very similar to the @option{-mcpu=} option, except that
10680 instead of specifying the actual target processor type, and hence
10681 restricting which instructions can be used, it specifies that GCC should
10682 tune the performance of the code as if the target were of the type
10683 specified in this option, but still choosing the instructions that it
10684 will generate based on the CPU specified by a @option{-mcpu=} option.
10685 For some ARM implementations better performance can be obtained by using
10686 this option.
10688 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
10689 performance for a blend of processors within architecture @var{arch}.
10690 The aim is to generate code that run well on the current most popular
10691 processors, balancing between optimizations that benefit some CPUs in the
10692 range, and avoiding performance pitfalls of other CPUs.  The effects of
10693 this option may change in future GCC versions as CPU models come and go.
10695 @option{-mtune=native} causes the compiler to auto-detect the CPU
10696 of the build computer.  At present, this feature is only supported on
10697 Linux, and not all architectures are recognized.  If the auto-detect is
10698 unsuccessful the option has no effect.
10700 @item -march=@var{name}
10701 @opindex march
10702 This specifies the name of the target ARM architecture.  GCC uses this
10703 name to determine what kind of instructions it can emit when generating
10704 assembly code.  This option can be used in conjunction with or instead
10705 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
10706 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
10707 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
10708 @samp{armv6}, @samp{armv6j},
10709 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
10710 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
10711 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
10713 @option{-march=native} causes the compiler to auto-detect the architecture
10714 of the build computer.  At present, this feature is only supported on
10715 Linux, and not all architectures are recognized.  If the auto-detect is
10716 unsuccessful the option has no effect.
10718 @item -mfpu=@var{name}
10719 @itemx -mfpe=@var{number}
10720 @itemx -mfp=@var{number}
10721 @opindex mfpu
10722 @opindex mfpe
10723 @opindex mfp
10724 This specifies what floating-point hardware (or hardware emulation) is
10725 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
10726 @samp{fpe3}, @samp{maverick}, @samp{vfp}, @samp{vfpv3}, @samp{vfpv3-fp16},
10727 @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd}, @samp{vfpv3xd-fp16},
10728 @samp{neon}, @samp{neon-fp16}, @samp{vfpv4}, @samp{vfpv4-d16},
10729 @samp{fpv4-sp-d16} and @samp{neon-vfpv4}.
10730 @option{-mfp} and @option{-mfpe} are synonyms for
10731 @option{-mfpu}=@samp{fpe}@var{number}, for compatibility with older versions
10732 of GCC@.
10734 If @option{-msoft-float} is specified this specifies the format of
10735 floating-point values.
10737 If the selected floating-point hardware includes the NEON extension
10738 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
10739 operations will not be used by GCC's auto-vectorization pass unless
10740 @option{-funsafe-math-optimizations} is also specified.  This is
10741 because NEON hardware does not fully implement the IEEE 754 standard for
10742 floating-point arithmetic (in particular denormal values are treated as
10743 zero), so the use of NEON instructions may lead to a loss of precision.
10745 @item -mfp16-format=@var{name}
10746 @opindex mfp16-format
10747 Specify the format of the @code{__fp16} half-precision floating-point type.
10748 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
10749 the default is @samp{none}, in which case the @code{__fp16} type is not
10750 defined.  @xref{Half-Precision}, for more information.
10752 @item -mstructure-size-boundary=@var{n}
10753 @opindex mstructure-size-boundary
10754 The size of all structures and unions will be rounded up to a multiple
10755 of the number of bits set by this option.  Permissible values are 8, 32
10756 and 64.  The default value varies for different toolchains.  For the COFF
10757 targeted toolchain the default value is 8.  A value of 64 is only allowed
10758 if the underlying ABI supports it.
10760 Specifying the larger number can produce faster, more efficient code, but
10761 can also increase the size of the program.  Different values are potentially
10762 incompatible.  Code compiled with one value cannot necessarily expect to
10763 work with code or libraries compiled with another value, if they exchange
10764 information using structures or unions.
10766 @item -mabort-on-noreturn
10767 @opindex mabort-on-noreturn
10768 Generate a call to the function @code{abort} at the end of a
10769 @code{noreturn} function.  It will be executed if the function tries to
10770 return.
10772 @item -mlong-calls
10773 @itemx -mno-long-calls
10774 @opindex mlong-calls
10775 @opindex mno-long-calls
10776 Tells the compiler to perform function calls by first loading the
10777 address of the function into a register and then performing a subroutine
10778 call on this register.  This switch is needed if the target function
10779 will lie outside of the 64 megabyte addressing range of the offset based
10780 version of subroutine call instruction.
10782 Even if this switch is enabled, not all function calls will be turned
10783 into long calls.  The heuristic is that static functions, functions
10784 that have the @samp{short-call} attribute, functions that are inside
10785 the scope of a @samp{#pragma no_long_calls} directive and functions whose
10786 definitions have already been compiled within the current compilation
10787 unit, will not be turned into long calls.  The exception to this rule is
10788 that weak function definitions, functions with the @samp{long-call}
10789 attribute or the @samp{section} attribute, and functions that are within
10790 the scope of a @samp{#pragma long_calls} directive, will always be
10791 turned into long calls.
10793 This feature is not enabled by default.  Specifying
10794 @option{-mno-long-calls} will restore the default behavior, as will
10795 placing the function calls within the scope of a @samp{#pragma
10796 long_calls_off} directive.  Note these switches have no effect on how
10797 the compiler generates code to handle function calls via function
10798 pointers.
10800 @item -msingle-pic-base
10801 @opindex msingle-pic-base
10802 Treat the register used for PIC addressing as read-only, rather than
10803 loading it in the prologue for each function.  The runtime system is
10804 responsible for initializing this register with an appropriate value
10805 before execution begins.
10807 @item -mpic-register=@var{reg}
10808 @opindex mpic-register
10809 Specify the register to be used for PIC addressing.  The default is R10
10810 unless stack-checking is enabled, when R9 is used.
10812 @item -mcirrus-fix-invalid-insns
10813 @opindex mcirrus-fix-invalid-insns
10814 @opindex mno-cirrus-fix-invalid-insns
10815 Insert NOPs into the instruction stream to in order to work around
10816 problems with invalid Maverick instruction combinations.  This option
10817 is only valid if the @option{-mcpu=ep9312} option has been used to
10818 enable generation of instructions for the Cirrus Maverick floating-point
10819 co-processor.  This option is not enabled by default, since the
10820 problem is only present in older Maverick implementations.  The default
10821 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
10822 switch.
10824 @item -mpoke-function-name
10825 @opindex mpoke-function-name
10826 Write the name of each function into the text section, directly
10827 preceding the function prologue.  The generated code is similar to this:
10829 @smallexample
10830      t0
10831          .ascii "arm_poke_function_name", 0
10832          .align
10833      t1
10834          .word 0xff000000 + (t1 - t0)
10835      arm_poke_function_name
10836          mov     ip, sp
10837          stmfd   sp!, @{fp, ip, lr, pc@}
10838          sub     fp, ip, #4
10839 @end smallexample
10841 When performing a stack backtrace, code can inspect the value of
10842 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
10843 location @code{pc - 12} and the top 8 bits are set, then we know that
10844 there is a function name embedded immediately preceding this location
10845 and has length @code{((pc[-3]) & 0xff000000)}.
10847 @item -mthumb
10848 @itemx -marm
10849 @opindex marm
10850 @opindex mthumb
10852 Select between generating code that executes in ARM and Thumb
10853 states.  The default for most configurations is to generate code
10854 that executes in ARM state, but the default can be changed by
10855 configuring GCC with the @option{--with-mode=}@var{state}
10856 configure option.
10858 @item -mtpcs-frame
10859 @opindex mtpcs-frame
10860 Generate a stack frame that is compliant with the Thumb Procedure Call
10861 Standard for all non-leaf functions.  (A leaf function is one that does
10862 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
10864 @item -mtpcs-leaf-frame
10865 @opindex mtpcs-leaf-frame
10866 Generate a stack frame that is compliant with the Thumb Procedure Call
10867 Standard for all leaf functions.  (A leaf function is one that does
10868 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
10870 @item -mcallee-super-interworking
10871 @opindex mcallee-super-interworking
10872 Gives all externally visible functions in the file being compiled an ARM
10873 instruction set header which switches to Thumb mode before executing the
10874 rest of the function.  This allows these functions to be called from
10875 non-interworking code.  This option is not valid in AAPCS configurations
10876 because interworking is enabled by default.
10878 @item -mcaller-super-interworking
10879 @opindex mcaller-super-interworking
10880 Allows calls via function pointers (including virtual functions) to
10881 execute correctly regardless of whether the target code has been
10882 compiled for interworking or not.  There is a small overhead in the cost
10883 of executing a function pointer if this option is enabled.  This option
10884 is not valid in AAPCS configurations because interworking is enabled
10885 by default.
10887 @item -mtp=@var{name}
10888 @opindex mtp
10889 Specify the access model for the thread local storage pointer.  The valid
10890 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
10891 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
10892 (supported in the arm6k architecture), and @option{auto}, which uses the
10893 best available method for the selected processor.  The default setting is
10894 @option{auto}.
10896 @item -mtls-dialect=@var{dialect}
10897 @opindex mtls-dialect
10898 Specify the dialect to use for accessing thread local storage.  Two
10899 dialects are supported --- @option{gnu} and @option{gnu2}.  The
10900 @option{gnu} dialect selects the original GNU scheme for supporting
10901 local and global dynamic TLS models.  The @option{gnu2} dialect
10902 selects the GNU descriptor scheme, which provides better performance
10903 for shared libraries.  The GNU descriptor scheme is compatible with
10904 the original scheme, but does require new assembler, linker and
10905 library support.  Initial and local exec TLS models are unaffected by
10906 this option and always use the original scheme.
10908 @item -mword-relocations
10909 @opindex mword-relocations
10910 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
10911 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
10912 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
10913 is specified.
10915 @item -mfix-cortex-m3-ldrd
10916 @opindex mfix-cortex-m3-ldrd
10917 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
10918 with overlapping destination and base registers are used.  This option avoids
10919 generating these instructions.  This option is enabled by default when
10920 @option{-mcpu=cortex-m3} is specified.
10922 @end table
10924 @node AVR Options
10925 @subsection AVR Options
10926 @cindex AVR Options
10928 These options are defined for AVR implementations:
10930 @table @gcctabopt
10931 @item -mmcu=@var{mcu}
10932 @opindex mmcu
10933 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
10935 For a complete list of @var{mcu} values that are supported by avr-gcc,
10936 see the compiler output when called with the @code{--help=target}
10937 command line option.
10938 The default for this option is@tie{}@code{avr2}.
10940 avr-gcc supports the following AVR devices and ISAs:
10942 @table @code
10944 @item avr1
10945 This ISA is implemented by the minimal AVR core and supported
10946 for assembler only.
10947 @*@var{mcu}@tie{}= @code{at90s1200},
10948 @code{attiny10}, @code{attiny11}, @code{attiny12}, @code{attiny15},
10949 @code{attiny28}.
10951 @item avr2
10952 ``Classic'' devices with up to 8@tie{}KiB of program memory.
10953 @*@var{mcu}@tie{}= @code{at90s2313}, @code{attiny26}, @code{at90c8534},
10954 @dots{}
10956 @item avr25
10957 ``Classic'' devices with up to 8@tie{}KiB of program memory and with
10958 the @code{MOVW} instruction.
10959 @*@var{mcu}@tie{}= @code{attiny2313}, @code{attiny261}, @code{attiny24},
10960 @dots{}
10962 @item avr3
10963 ``Classic'' devices with 16@tie{}KiB up to 64@tie{}KiB of program memory.
10964 @*@var{mcu}@tie{}= @code{at43usb355}, @code{at76c711}.
10966 @item avr31
10967 ``Classic'' devices with 128@tie{}KiB of program memory.
10968 @*@var{mcu}@tie{}= @code{atmega103}, @code{at43usb320}.
10970 @item avr35
10971 ``Classic'' devices with 16@tie{}KiB up to 64@tie{}KiB of program
10972 memory and with the @code{MOVW} instruction.
10973 @*@var{mcu}@tie{}= @code{at90usb162}, @code{atmega8u2},
10974 @code{attiny167}, @dots{}
10976 @item avr4
10977 ``Enhanced'' devices with up to 8@tie{}KiB of program memory.
10978 @*@var{mcu}@tie{}= @code{atmega8}, @code{atmega88}, @code{at90pwm81},
10979 @dots{}
10981 @item avr5
10982 ``Enhanced'' devices with 16@tie{}KiB up to 64@tie{}KiB of program memory.
10983 @*@var{mcu}@tie{}= @code{atmega16}, @code{atmega6490}, @code{at90can64},
10984 @dots{}
10986 @item avr51
10987 ``Enhanced'' devices with 128@tie{}KiB of program memory.
10988 @*@var{mcu}@tie{}= @code{atmega128}, @code{at90can128}, @code{at90usb1287},
10989 @dots{}
10991 @item avr6
10992 ``Enhanced'' devices with 3-byte PC, i.e.@: with at least 256@tie{}KiB
10993 of program memory.
10994 @*@var{mcu}@tie{}= @code{atmega2560}, @code{atmega2561}.
10996 @item avrxmega2
10997 ``XMEGA'' devices with more than 8@tie{}KiB and up to 64@tie{}KiB
10998 of program memory.
10999 @*@var{mcu}@tie{}= @code{atxmega16a4}, @code{atxmega16d4},
11000 @dots{}
11002 @item avrxmega4
11003 ``XMEGA'' devices with more than 64@tie{}KiB and up to 128@tie{}KiB
11004 of program memory.
11005 @*@var{mcu}@tie{}= @code{atxmega64a3}, @code{atxmega64d3}.
11007 @item avrxmega5
11008 ``XMEGA'' devices with more than 64@tie{}KiB and up to 128@tie{}KiB
11009 of program memory and more than 64@tie{}KiB of RAM.
11010 @*@var{mcu}@tie{}= @code{atxmega64a1}, @code{atxmega64a1u}.
11012 @item avrxmega6
11013 ``XMEGA'' devices with more than 128@tie{}KiB of program memory.
11014 @*@var{mcu}@tie{}= @code{atxmega128a3}, @code{atxmega192d3},
11015 @dots{}
11017 @item avrxmega7
11018 ``XMEGA'' devices with more than 128@tie{}KiB of program memory and
11019 more than 64@tie{}KiB of RAM.
11020 @*@var{mcu}@tie{}= @code{atxmega128a1}, @code{atxmega128a1u}.
11022 @end table
11025 @item -maccumulate-args
11026 @opindex maccumulate-args
11027 Accumulate outgoing function arguments and acquire/release the needed
11028 stack space for outgoing function arguments once in function
11029 prologue/epilogue.  Without this option, outgoing arguments are pushed
11030 before calling a function and popped afterwards.
11032 Popping the arguments after the function call can be expensive on
11033 AVR so that accumulating the stack space might lead to smaller
11034 executables because arguments need not to be removed from the
11035 stack after such a function call.
11037 This option can lead to reduced code size for functions that perform
11038 several calls to functions that get their arguments on the stack like
11039 calls to printf-like functions.
11041 @item -mbranch-cost=@var{cost}
11042 @opindex mbranch-cost
11043 Set the branch costs for conditional branch instructions to
11044 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
11045 integers. The default branch cost is 0.
11047 @item -mcall-prologues
11048 @opindex mcall-prologues
11049 Functions prologues/epilogues expanded as call to appropriate
11050 subroutines.  Code size will be smaller.
11052 @item -mint8
11053 @opindex mint8
11054 Assume int to be 8-bit integer.  This affects the sizes of all types: a
11055 char will be 1 byte, an int will be 1 byte, a long will be 2 bytes
11056 and long long will be 4 bytes.  Please note that this option does not
11057 comply to the C standards, but it will provide you with smaller code
11058 size.
11060 @item -mno-interrupts
11061 @opindex mno-interrupts
11062 Generated code is not compatible with hardware interrupts.
11063 Code size will be smaller.
11065 @item -mrelax
11066 @opindex mrelax
11067 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
11068 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
11069 Setting @code{-mrelax} just adds the @code{--relax} option to the
11070 linker command line when the linker is called.
11072 Jump relaxing is performed by the linker because jump offsets are not
11073 known before code is located. Therefore, the assembler code generated by the
11074 compiler will be the same, but the instructions in the executable may
11075 differ from instructions in the assembler code.
11077 @item -mshort-calls
11078 @opindex mshort-calls
11079 Use @code{RCALL}/@code{RJMP} instructions even on devices with
11080 16@tie{}KiB or more of program memory, i.e.@: on devices that
11081 have the @code{CALL} and @code{JMP} instructions.
11082 See also the @code{-mrelax} command line option.
11084 @item -mstrict-X
11085 @opindex mstrict-X
11086 Use address register @code{X} in a way proposed by the hardware.  This means
11087 that @code{X} will only be used in indirect, post-increment or
11088 pre-decrement addressing.
11090 Without this option, the @code{X} register may be used in the same way
11091 as @code{Y} or @code{Z} which then is emulated by additional
11092 instructions.  
11093 For example, loading a value with @code{X+const} addressing with a
11094 small non-negative @code{const < 64} to a register @var{Rn} will be
11095 performed as
11097 @example
11098 adiw r26, const   ; X += const
11099 ld   @var{Rn}, X        ; @var{Rn} = *X
11100 sbiw r26, const   ; X -= const
11101 @end example
11103 @item -mtiny-stack
11104 @opindex mtiny-stack
11105 Only use the lower 8@tie{}bits of the stack pointer and assume that the high
11106 byte of SP is always zero.
11107 @end table
11109 @subsubsection @code{EIND} and Devices with more than 128 Ki Bytes of Flash
11110 @cindex @code{EIND}
11111 Pointers in the implementation are 16@tie{}bits wide.
11112 The address of a function or label is represented as word address so
11113 that indirect jumps and calls can target any code address in the
11114 range of 64@tie{}Ki words.
11116 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
11117 bytes of program memory space, there is a special function register called
11118 @code{EIND} that serves as most significant part of the target address
11119 when @code{EICALL} or @code{EIJMP} instructions are used.
11121 Indirect jumps and calls on these devices are handled as follows by
11122 the compiler and are subject to some limitations:
11124 @itemize @bullet
11126 @item
11127 The compiler never sets @code{EIND}.
11129 @item
11130 The compiler uses @code{EIND} implicitely in @code{EICALL}/@code{EIJMP}
11131 instructions or might read @code{EIND} directly in order to emulate an
11132 indirect call/jump by means of a @code{RET} instruction.
11134 @item
11135 The compiler assumes that @code{EIND} never changes during the startup
11136 code or during the application. In particular, @code{EIND} is not
11137 saved/restored in function or interrupt service routine
11138 prologue/epilogue.
11140 @item
11141 For indirect calls to functions and computed goto, the linker will
11142 generate @emph{stubs}. Stubs are jump pads sometimes also called
11143 @emph{trampolines}. Thus, the indirect call/jump will jump to such a stub.
11144 The stub contains a direct jump to the desired address.
11146 @item
11147 The default linker script is arranged for code with @code{EIND = 0}.
11148 If code is supposed to work for a setup with @code{EIND != 0}, a custom
11149 linker script has to be used in order to place the sections whose
11150 name start with @code{.trampolines} into the segment where @code{EIND}
11151 points to.
11153 @item
11154 The startup code from libgcc never sets @code{EIND}.
11155 Notice that startup code is a blend of code from libgcc and AVR-Libc.
11156 For the impact of AVR-Libc on @code{EIND}, see the
11157 @w{@uref{http://nongnu.org/avr-libc/user-manual,AVR-Libc user manual}}.
11159 @item
11160 It is legitimate for user-specific startup code to set up @code{EIND}
11161 early, for example by means of initialization code located in
11162 section @code{.init3}. Such code runs prior to general startup code
11163 that initializes RAM and calls constructors, but after the bit
11164 of startup code from AVR-Libc that sets @code{EIND} to the segment
11165 where the vector table is located.
11166 @example
11167 #include <avr/io.h>
11169 static void
11170 __attribute__ ((section (".init3"), naked, used, no_instrument_function))
11171 init3_set_eind (void)
11173     __asm volatile ("ldi r24, pm_hh8(__trampolines_start)" "\n\t"
11174                     "out %i0, r24" :: "n" (&EIND) : "r24", "memory");
11176 @end example
11178 @noindent
11179 The @code{__trampolines_start} symbol is defined in the linker script.
11181 @item
11182 Stubs will be generated automatically by the linker if
11183 the following two conditions are met:
11184 @itemize @minus
11186 @item The address of a label is taken by means of the @code{gs} modifier
11187 (short for @emph{generate stubs}) like so:
11188 @example
11189 LDI r24, lo8(gs(@var{func}))
11190 LDI r25, hi8(gs(@var{func}))
11191 @end example
11192 @item The final location of that label is in a code segment
11193 @emph{outside} the segment where the stubs are located.
11194 @end itemize
11196 @item
11197 The compiler will emit such @code{gs} modifiers for code labels in the
11198 following situations:
11199 @itemize @minus
11200 @item Taking address of a function or code label.
11201 @item Computed goto.
11202 @item If prologue-save function is used, see @option{-mcall-prologues}
11203 command-line option.
11204 @item Switch/case dispatch tables. If you do not want such dispatch
11205 tables you can specify the @option{-fno-jump-tables} command-line option.
11206 @item C and C++ constructors/destructors called during startup/shutdown.
11207 @item If the tools hit a @code{gs()} modifier explained above.
11208 @end itemize
11210 @item
11211 Jumping to non-symbolic addresses like so is @emph{not} supported:
11213 @example
11214 int main (void)
11216     /* Call function at word address 0x2 */
11217     return ((int(*)(void)) 0x2)();
11219 @end example
11221 Instead, a stub has to be set up, i.e.@: the function has to be called
11222 through a symbol (@code{func_4} in the example):
11224 @example
11225 int main (void)
11227     extern int func_4 (void);
11229     /* Call function at byte address 0x4 */
11230     return func_4();
11232 @end example
11234 and the application be linked with @code{-Wl,--defsym,func_4=0x4}.
11235 Alternatively, @code{func_4} can be defined in the linker script.
11236 @end itemize
11238 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
11239 @cindex @code{RAMPD}
11240 @cindex @code{RAMPX}
11241 @cindex @code{RAMPY}
11242 @cindex @code{RAMPZ}
11243 Some AVR devices support memories larger than the 64@tie{}KiB range
11244 that can be accessed with 16-bit pointers.  To access memory locations
11245 outside this 64@tie{}KiB range, the contentent of a @code{RAMP}
11246 register is used as high part of the address:
11247 The @code{X}, @code{Y}, @code{Z} address register is concatenated
11248 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
11249 register, respectively, to get a wide address. Similarly,
11250 @code{RAMPD} is used together with direct addressing.
11252 @itemize
11253 @item
11254 The startup code initializes the @code{RAMP} special function
11255 registers with zero.
11257 @item
11258 If a @ref{AVR Named Address Spaces,named address space} other than
11259 generic or @code{__flash} is used, then @code{RAMPZ} will be set
11260 as needed before the operation.
11262 @item
11263 If the device supports RAM larger than 64@tie{KiB} and the compiler
11264 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
11265 will be reset to zero after the operation.
11267 @item
11268 If the device comes with a specific @code{RAMP} register, the ISR
11269 prologue/epilogue will save/restore that SFR and initialize it with
11270 zero in case the ISR code might (implicitly) use it.
11272 @item
11273 RAM larger than 64@tie{KiB} is not supported by avr-gcc.
11274 If you use inline assembler to read from locations outside the
11275 16-bit address range and change one of the @code{RAMP} registers,
11276 you must reset it to zero after the access.
11278 @end itemize
11280 @subsubsection AVR Built-in Macros
11282 avr-gcc defines several built-in macros so that the user code can test
11283 for presence of absence of features.  Almost any of the following
11284 built-in macros are deduced from device capabilities and thus
11285 triggered by the @code{-mmcu=} command-line option.
11287 For even more AVR-specific built-in macros see
11288 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
11290 @table @code
11292 @item __AVR_@var{Device}__
11293 Setting @code{-mmcu=@var{device}} defines this built-in macro which reflects
11294 the device's name. For example, @code{-mmcu=atmega8} will define the
11295 built-in macro @code{__AVR_ATmega8__}, @code{-mmcu=attiny261a} defines
11296 @code{__AVR_ATtiny261A__}, etc.
11298 The built-in macros' names follow
11299 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
11300 the device name as from the AVR user manual. The difference between
11301 @var{Device} in the built-in macro and @var{device} in
11302 @code{-mmcu=@var{device}} is that the latter is always lowercase.
11304 @item __AVR_HAVE_ELPM__
11305 The device has the the @code{ELPM} instruction.
11307 @item __AVR_HAVE_ELPMX__
11308 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
11309 R@var{n},Z+} instructions.
11311 @item __AVR_HAVE_MOVW__
11312 The device has the @code{MOVW} instruction to perform 16-bit
11313 register-register moves.
11315 @item __AVR_HAVE_LPMX__
11316 The device has the @code{LPM R@var{n},Z} and @code{LPM
11317 R@var{n},Z+} instructions.
11319 @item __AVR_HAVE_MUL__
11320 The device has a hardware multiplier. 
11322 @item __AVR_HAVE_JMP_CALL__
11323 The device has the @code{JMP} and @code{CALL} instructions.
11324 This is the case for devices with at least 16@tie{}KiB of program
11325 memory and if @code{-mshort-calls} is not set.
11327 @item __AVR_HAVE_EIJMP_EICALL__
11328 @item __AVR_3_BYTE_PC__
11329 The device has the @code{EIJMP} and @code{EICALL} instructions.
11330 This is the case for devices with more than 128@tie{}KiB of program memory.
11331 This also means that the program counter
11332 (PC) is 3@tie{}bytes wide.
11334 @item __AVR_2_BYTE_PC__
11335 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
11336 with up to 128@tie{}KiB of program memory.
11338 @item __AVR_HAVE_8BIT_SP__
11339 @item __AVR_HAVE_16BIT_SP__
11340 The stack pointer (SP) is respectively 8 or 16 bits wide.
11341 The definition of these macros is affected by @code{-mtiny-stack}.
11343 @item __AVR_HAVE_RAMPD__
11344 @item __AVR_HAVE_RAMPX__
11345 @item __AVR_HAVE_RAMPY__
11346 @item __AVR_HAVE_RAMPZ__
11347 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
11348 @code{RAMPZ} special function register, respectively.
11350 @item __NO_INTERRUPTS__
11351 This macro reflects the @code{-mno-interrupts} command line option.
11353 @item __AVR_ERRATA_SKIP__
11354 @item __AVR_ERRATA_SKIP_JMP_CALL__
11355 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
11356 instructions because of a hardware erratum.  Skip instructions are
11357 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
11358 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
11359 set.
11361 @item __AVR_SFR_OFFSET__=@var{offset}
11362 Instructions that can address I/O special function registers directly
11363 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
11364 address as if addressed by an instruction to access RAM like @code{LD}
11365 or @code{STS}. This offset depends on the device architecture and has
11366 to be subtracted from the RAM address in order to get the
11367 respective I/O@tie{}address.
11369 @end table
11371 @node Blackfin Options
11372 @subsection Blackfin Options
11373 @cindex Blackfin Options
11375 @table @gcctabopt
11376 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
11377 @opindex mcpu=
11378 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
11379 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
11380 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
11381 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
11382 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
11383 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
11384 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
11385 @samp{bf561}, @samp{bf592}.
11386 The optional @var{sirevision} specifies the silicon revision of the target
11387 Blackfin processor.  Any workarounds available for the targeted silicon revision
11388 will be enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
11389 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
11390 will be enabled.  The @code{__SILICON_REVISION__} macro is defined to two
11391 hexadecimal digits representing the major and minor numbers in the silicon
11392 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
11393 is not defined.  If @var{sirevision} is @samp{any}, the
11394 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
11395 If this optional @var{sirevision} is not used, GCC assumes the latest known
11396 silicon revision of the targeted Blackfin processor.
11398 Support for @samp{bf561} is incomplete.  For @samp{bf561},
11399 Only the processor macro is defined.
11400 Without this option, @samp{bf532} is used as the processor by default.
11401 The corresponding predefined processor macros for @var{cpu} is to
11402 be defined.  And for @samp{bfin-elf} toolchain, this causes the hardware BSP
11403 provided by libgloss to be linked in if @option{-msim} is not given.
11405 @item -msim
11406 @opindex msim
11407 Specifies that the program will be run on the simulator.  This causes
11408 the simulator BSP provided by libgloss to be linked in.  This option
11409 has effect only for @samp{bfin-elf} toolchain.
11410 Certain other options, such as @option{-mid-shared-library} and
11411 @option{-mfdpic}, imply @option{-msim}.
11413 @item -momit-leaf-frame-pointer
11414 @opindex momit-leaf-frame-pointer
11415 Don't keep the frame pointer in a register for leaf functions.  This
11416 avoids the instructions to save, set up and restore frame pointers and
11417 makes an extra register available in leaf functions.  The option
11418 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
11419 which might make debugging harder.
11421 @item -mspecld-anomaly
11422 @opindex mspecld-anomaly
11423 When enabled, the compiler will ensure that the generated code does not
11424 contain speculative loads after jump instructions. If this option is used,
11425 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
11427 @item -mno-specld-anomaly
11428 @opindex mno-specld-anomaly
11429 Don't generate extra code to prevent speculative loads from occurring.
11431 @item -mcsync-anomaly
11432 @opindex mcsync-anomaly
11433 When enabled, the compiler will ensure that the generated code does not
11434 contain CSYNC or SSYNC instructions too soon after conditional branches.
11435 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
11437 @item -mno-csync-anomaly
11438 @opindex mno-csync-anomaly
11439 Don't generate extra code to prevent CSYNC or SSYNC instructions from
11440 occurring too soon after a conditional branch.
11442 @item -mlow-64k
11443 @opindex mlow-64k
11444 When enabled, the compiler is free to take advantage of the knowledge that
11445 the entire program fits into the low 64k of memory.
11447 @item -mno-low-64k
11448 @opindex mno-low-64k
11449 Assume that the program is arbitrarily large.  This is the default.
11451 @item -mstack-check-l1
11452 @opindex mstack-check-l1
11453 Do stack checking using information placed into L1 scratchpad memory by the
11454 uClinux kernel.
11456 @item -mid-shared-library
11457 @opindex mid-shared-library
11458 Generate code that supports shared libraries via the library ID method.
11459 This allows for execute in place and shared libraries in an environment
11460 without virtual memory management.  This option implies @option{-fPIC}.
11461 With a @samp{bfin-elf} target, this option implies @option{-msim}.
11463 @item -mno-id-shared-library
11464 @opindex mno-id-shared-library
11465 Generate code that doesn't assume ID based shared libraries are being used.
11466 This is the default.
11468 @item -mleaf-id-shared-library
11469 @opindex mleaf-id-shared-library
11470 Generate code that supports shared libraries via the library ID method,
11471 but assumes that this library or executable won't link against any other
11472 ID shared libraries.  That allows the compiler to use faster code for jumps
11473 and calls.
11475 @item -mno-leaf-id-shared-library
11476 @opindex mno-leaf-id-shared-library
11477 Do not assume that the code being compiled won't link against any ID shared
11478 libraries.  Slower code will be generated for jump and call insns.
11480 @item -mshared-library-id=n
11481 @opindex mshared-library-id
11482 Specified the identification number of the ID based shared library being
11483 compiled.  Specifying a value of 0 will generate more compact code, specifying
11484 other values will force the allocation of that number to the current
11485 library but is no more space or time efficient than omitting this option.
11487 @item -msep-data
11488 @opindex msep-data
11489 Generate code that allows the data segment to be located in a different
11490 area of memory from the text segment.  This allows for execute in place in
11491 an environment without virtual memory management by eliminating relocations
11492 against the text section.
11494 @item -mno-sep-data
11495 @opindex mno-sep-data
11496 Generate code that assumes that the data segment follows the text segment.
11497 This is the default.
11499 @item -mlong-calls
11500 @itemx -mno-long-calls
11501 @opindex mlong-calls
11502 @opindex mno-long-calls
11503 Tells the compiler to perform function calls by first loading the
11504 address of the function into a register and then performing a subroutine
11505 call on this register.  This switch is needed if the target function
11506 lies outside of the 24-bit addressing range of the offset-based
11507 version of subroutine call instruction.
11509 This feature is not enabled by default.  Specifying
11510 @option{-mno-long-calls} will restore the default behavior.  Note these
11511 switches have no effect on how the compiler generates code to handle
11512 function calls via function pointers.
11514 @item -mfast-fp
11515 @opindex mfast-fp
11516 Link with the fast floating-point library. This library relaxes some of
11517 the IEEE floating-point standard's rules for checking inputs against
11518 Not-a-Number (NAN), in the interest of performance.
11520 @item -minline-plt
11521 @opindex minline-plt
11522 Enable inlining of PLT entries in function calls to functions that are
11523 not known to bind locally.  It has no effect without @option{-mfdpic}.
11525 @item -mmulticore
11526 @opindex mmulticore
11527 Build standalone application for multicore Blackfin processor. Proper
11528 start files and link scripts will be used to support multicore.
11529 This option defines @code{__BFIN_MULTICORE}. It can only be used with
11530 @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. It can be used with
11531 @option{-mcorea} or @option{-mcoreb}. If it's used without
11532 @option{-mcorea} or @option{-mcoreb}, single application/dual core
11533 programming model is used. In this model, the main function of Core B
11534 should be named as coreb_main. If it's used with @option{-mcorea} or
11535 @option{-mcoreb}, one application per core programming model is used.
11536 If this option is not used, single core application programming
11537 model is used.
11539 @item -mcorea
11540 @opindex mcorea
11541 Build standalone application for Core A of BF561 when using
11542 one application per core programming model. Proper start files
11543 and link scripts will be used to support Core A. This option
11544 defines @code{__BFIN_COREA}. It must be used with @option{-mmulticore}.
11546 @item -mcoreb
11547 @opindex mcoreb
11548 Build standalone application for Core B of BF561 when using
11549 one application per core programming model. Proper start files
11550 and link scripts will be used to support Core B. This option
11551 defines @code{__BFIN_COREB}. When this option is used, coreb_main
11552 should be used instead of main. It must be used with
11553 @option{-mmulticore}.
11555 @item -msdram
11556 @opindex msdram
11557 Build standalone application for SDRAM. Proper start files and
11558 link scripts will be used to put the application into SDRAM.
11559 Loader should initialize SDRAM before loading the application
11560 into SDRAM. This option defines @code{__BFIN_SDRAM}.
11562 @item -micplb
11563 @opindex micplb
11564 Assume that ICPLBs are enabled at run time.  This has an effect on certain
11565 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
11566 are enabled; for standalone applications the default is off.
11567 @end table
11569 @node C6X Options
11570 @subsection C6X Options
11571 @cindex C6X Options
11573 @table @gcctabopt
11574 @item -march=@var{name}
11575 @opindex march
11576 This specifies the name of the target architecture.  GCC uses this
11577 name to determine what kind of instructions it can emit when generating
11578 assembly code.  Permissible names are: @samp{c62x},
11579 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
11581 @item -mbig-endian
11582 @opindex mbig-endian
11583 Generate code for a big-endian target.
11585 @item -mlittle-endian
11586 @opindex mlittle-endian
11587 Generate code for a little-endian target.  This is the default.
11589 @item -msim
11590 @opindex msim
11591 Choose startup files and linker script suitable for the simulator.
11593 @item -msdata=default
11594 @opindex msdata=default
11595 Put small global and static data in the @samp{.neardata} section,
11596 which is pointed to by register @code{B14}.  Put small uninitialized
11597 global and static data in the @samp{.bss} section, which is adjacent
11598 to the @samp{.neardata} section.  Put small read-only data into the
11599 @samp{.rodata} section.  The corresponding sections used for large
11600 pieces of data are @samp{.fardata}, @samp{.far} and @samp{.const}.
11602 @item -msdata=all
11603 @opindex msdata=all
11604 Put all data, not just small objets, into the sections reserved for
11605 small data, and use addressing relative to the @code{B14} register to
11606 access them.
11608 @item -msdata=none
11609 @opindex msdata=none
11610 Make no use of the sections reserved for small data, and use absolute
11611 addresses to access all data.  Put all initialized global and static
11612 data in the @samp{.fardata} section, and all uninitialized data in the
11613 @samp{.far} section.  Put all constant data into the @samp{.const}
11614 section.
11615 @end table
11617 @node CRIS Options
11618 @subsection CRIS Options
11619 @cindex CRIS Options
11621 These options are defined specifically for the CRIS ports.
11623 @table @gcctabopt
11624 @item -march=@var{architecture-type}
11625 @itemx -mcpu=@var{architecture-type}
11626 @opindex march
11627 @opindex mcpu
11628 Generate code for the specified architecture.  The choices for
11629 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
11630 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
11631 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
11632 @samp{v10}.
11634 @item -mtune=@var{architecture-type}
11635 @opindex mtune
11636 Tune to @var{architecture-type} everything applicable about the generated
11637 code, except for the ABI and the set of available instructions.  The
11638 choices for @var{architecture-type} are the same as for
11639 @option{-march=@var{architecture-type}}.
11641 @item -mmax-stack-frame=@var{n}
11642 @opindex mmax-stack-frame
11643 Warn when the stack frame of a function exceeds @var{n} bytes.
11645 @item -metrax4
11646 @itemx -metrax100
11647 @opindex metrax4
11648 @opindex metrax100
11649 The options @option{-metrax4} and @option{-metrax100} are synonyms for
11650 @option{-march=v3} and @option{-march=v8} respectively.
11652 @item -mmul-bug-workaround
11653 @itemx -mno-mul-bug-workaround
11654 @opindex mmul-bug-workaround
11655 @opindex mno-mul-bug-workaround
11656 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
11657 models where it applies.  This option is active by default.
11659 @item -mpdebug
11660 @opindex mpdebug
11661 Enable CRIS-specific verbose debug-related information in the assembly
11662 code.  This option also has the effect to turn off the @samp{#NO_APP}
11663 formatted-code indicator to the assembler at the beginning of the
11664 assembly file.
11666 @item -mcc-init
11667 @opindex mcc-init
11668 Do not use condition-code results from previous instruction; always emit
11669 compare and test instructions before use of condition codes.
11671 @item -mno-side-effects
11672 @opindex mno-side-effects
11673 Do not emit instructions with side-effects in addressing modes other than
11674 post-increment.
11676 @item -mstack-align
11677 @itemx -mno-stack-align
11678 @itemx -mdata-align
11679 @itemx -mno-data-align
11680 @itemx -mconst-align
11681 @itemx -mno-const-align
11682 @opindex mstack-align
11683 @opindex mno-stack-align
11684 @opindex mdata-align
11685 @opindex mno-data-align
11686 @opindex mconst-align
11687 @opindex mno-const-align
11688 These options (no-options) arranges (eliminate arrangements) for the
11689 stack-frame, individual data and constants to be aligned for the maximum
11690 single data access size for the chosen CPU model.  The default is to
11691 arrange for 32-bit alignment.  ABI details such as structure layout are
11692 not affected by these options.
11694 @item -m32-bit
11695 @itemx -m16-bit
11696 @itemx -m8-bit
11697 @opindex m32-bit
11698 @opindex m16-bit
11699 @opindex m8-bit
11700 Similar to the stack- data- and const-align options above, these options
11701 arrange for stack-frame, writable data and constants to all be 32-bit,
11702 16-bit or 8-bit aligned.  The default is 32-bit alignment.
11704 @item -mno-prologue-epilogue
11705 @itemx -mprologue-epilogue
11706 @opindex mno-prologue-epilogue
11707 @opindex mprologue-epilogue
11708 With @option{-mno-prologue-epilogue}, the normal function prologue and
11709 epilogue which set up the stack frame are omitted and no return
11710 instructions or return sequences are generated in the code.  Use this
11711 option only together with visual inspection of the compiled code: no
11712 warnings or errors are generated when call-saved registers must be saved,
11713 or storage for local variable needs to be allocated.
11715 @item -mno-gotplt
11716 @itemx -mgotplt
11717 @opindex mno-gotplt
11718 @opindex mgotplt
11719 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
11720 instruction sequences that load addresses for functions from the PLT part
11721 of the GOT rather than (traditional on other architectures) calls to the
11722 PLT@.  The default is @option{-mgotplt}.
11724 @item -melf
11725 @opindex melf
11726 Legacy no-op option only recognized with the cris-axis-elf and
11727 cris-axis-linux-gnu targets.
11729 @item -mlinux
11730 @opindex mlinux
11731 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
11733 @item -sim
11734 @opindex sim
11735 This option, recognized for the cris-axis-elf arranges
11736 to link with input-output functions from a simulator library.  Code,
11737 initialized data and zero-initialized data are allocated consecutively.
11739 @item -sim2
11740 @opindex sim2
11741 Like @option{-sim}, but pass linker options to locate initialized data at
11742 0x40000000 and zero-initialized data at 0x80000000.
11743 @end table
11745 @node CR16 Options
11746 @subsection CR16 Options
11747 @cindex CR16 Options
11749 These options are defined specifically for the CR16 ports.
11751 @table @gcctabopt
11753 @item -mmac
11754 @opindex mmac
11755 Enable the use of multiply-accumulate instructions. Disabled by default.
11757 @item -mcr16cplus
11758 @itemx -mcr16c
11759 @opindex mcr16cplus
11760 @opindex mcr16c
11761 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
11762 is default.
11764 @item -msim
11765 @opindex msim
11766 Links the library libsim.a which is in compatible with simulator. Applicable
11767 to elf compiler only.
11769 @item -mint32
11770 @opindex mint32
11771 Choose integer type as 32-bit wide.
11773 @item -mbit-ops
11774 @opindex mbit-ops
11775 Generates sbit/cbit instructions for bit manipulations.
11777 @item -mdata-model=@var{model}
11778 @opindex mdata-model
11779 Choose a data model. The choices for @var{model} are @samp{near},
11780 @samp{far} or @samp{medium}. @samp{medium} is default.
11781 However, @samp{far} is not valid when -mcr16c option is chosen as
11782 CR16C architecture does not support far data model.
11783 @end table
11785 @node Darwin Options
11786 @subsection Darwin Options
11787 @cindex Darwin options
11789 These options are defined for all architectures running the Darwin operating
11790 system.
11792 FSF GCC on Darwin does not create ``fat'' object files; it will create
11793 an object file for the single architecture that it was built to
11794 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
11795 @option{-arch} options are used; it does so by running the compiler or
11796 linker multiple times and joining the results together with
11797 @file{lipo}.
11799 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
11800 @samp{i686}) is determined by the flags that specify the ISA
11801 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
11802 @option{-force_cpusubtype_ALL} option can be used to override this.
11804 The Darwin tools vary in their behavior when presented with an ISA
11805 mismatch.  The assembler, @file{as}, will only permit instructions to
11806 be used that are valid for the subtype of the file it is generating,
11807 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
11808 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
11809 and print an error if asked to create a shared library with a less
11810 restrictive subtype than its input files (for instance, trying to put
11811 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
11812 for executables, @file{ld}, will quietly give the executable the most
11813 restrictive subtype of any of its input files.
11815 @table @gcctabopt
11816 @item -F@var{dir}
11817 @opindex F
11818 Add the framework directory @var{dir} to the head of the list of
11819 directories to be searched for header files.  These directories are
11820 interleaved with those specified by @option{-I} options and are
11821 scanned in a left-to-right order.
11823 A framework directory is a directory with frameworks in it.  A
11824 framework is a directory with a @samp{"Headers"} and/or
11825 @samp{"PrivateHeaders"} directory contained directly in it that ends
11826 in @samp{".framework"}.  The name of a framework is the name of this
11827 directory excluding the @samp{".framework"}.  Headers associated with
11828 the framework are found in one of those two directories, with
11829 @samp{"Headers"} being searched first.  A subframework is a framework
11830 directory that is in a framework's @samp{"Frameworks"} directory.
11831 Includes of subframework headers can only appear in a header of a
11832 framework that contains the subframework, or in a sibling subframework
11833 header.  Two subframeworks are siblings if they occur in the same
11834 framework.  A subframework should not have the same name as a
11835 framework, a warning will be issued if this is violated.  Currently a
11836 subframework cannot have subframeworks, in the future, the mechanism
11837 may be extended to support this.  The standard frameworks can be found
11838 in @samp{"/System/Library/Frameworks"} and
11839 @samp{"/Library/Frameworks"}.  An example include looks like
11840 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
11841 the name of the framework and header.h is found in the
11842 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
11844 @item -iframework@var{dir}
11845 @opindex iframework
11846 Like @option{-F} except the directory is a treated as a system
11847 directory.  The main difference between this @option{-iframework} and
11848 @option{-F} is that with @option{-iframework} the compiler does not
11849 warn about constructs contained within header files found via
11850 @var{dir}.  This option is valid only for the C family of languages.
11852 @item -gused
11853 @opindex gused
11854 Emit debugging information for symbols that are used.  For STABS
11855 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
11856 This is by default ON@.
11858 @item -gfull
11859 @opindex gfull
11860 Emit debugging information for all symbols and types.
11862 @item -mmacosx-version-min=@var{version}
11863 The earliest version of MacOS X that this executable will run on
11864 is @var{version}.  Typical values of @var{version} include @code{10.1},
11865 @code{10.2}, and @code{10.3.9}.
11867 If the compiler was built to use the system's headers by default,
11868 then the default for this option is the system version on which the
11869 compiler is running, otherwise the default is to make choices that
11870 are compatible with as many systems and code bases as possible.
11872 @item -mkernel
11873 @opindex mkernel
11874 Enable kernel development mode.  The @option{-mkernel} option sets
11875 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
11876 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
11877 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
11878 applicable.  This mode also sets @option{-mno-altivec},
11879 @option{-msoft-float}, @option{-fno-builtin} and
11880 @option{-mlong-branch} for PowerPC targets.
11882 @item -mone-byte-bool
11883 @opindex mone-byte-bool
11884 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
11885 By default @samp{sizeof(bool)} is @samp{4} when compiling for
11886 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
11887 option has no effect on x86.
11889 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
11890 to generate code that is not binary compatible with code generated
11891 without that switch.  Using this switch may require recompiling all
11892 other modules in a program, including system libraries.  Use this
11893 switch to conform to a non-default data model.
11895 @item -mfix-and-continue
11896 @itemx -ffix-and-continue
11897 @itemx -findirect-data
11898 @opindex mfix-and-continue
11899 @opindex ffix-and-continue
11900 @opindex findirect-data
11901 Generate code suitable for fast turn around development.  Needed to
11902 enable gdb to dynamically load @code{.o} files into already running
11903 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
11904 are provided for backwards compatibility.
11906 @item -all_load
11907 @opindex all_load
11908 Loads all members of static archive libraries.
11909 See man ld(1) for more information.
11911 @item -arch_errors_fatal
11912 @opindex arch_errors_fatal
11913 Cause the errors having to do with files that have the wrong architecture
11914 to be fatal.
11916 @item -bind_at_load
11917 @opindex bind_at_load
11918 Causes the output file to be marked such that the dynamic linker will
11919 bind all undefined references when the file is loaded or launched.
11921 @item -bundle
11922 @opindex bundle
11923 Produce a Mach-o bundle format file.
11924 See man ld(1) for more information.
11926 @item -bundle_loader @var{executable}
11927 @opindex bundle_loader
11928 This option specifies the @var{executable} that will be loading the build
11929 output file being linked.  See man ld(1) for more information.
11931 @item -dynamiclib
11932 @opindex dynamiclib
11933 When passed this option, GCC will produce a dynamic library instead of
11934 an executable when linking, using the Darwin @file{libtool} command.
11936 @item -force_cpusubtype_ALL
11937 @opindex force_cpusubtype_ALL
11938 This causes GCC's output file to have the @var{ALL} subtype, instead of
11939 one controlled by the @option{-mcpu} or @option{-march} option.
11941 @item -allowable_client  @var{client_name}
11942 @itemx -client_name
11943 @itemx -compatibility_version
11944 @itemx -current_version
11945 @itemx -dead_strip
11946 @itemx -dependency-file
11947 @itemx -dylib_file
11948 @itemx -dylinker_install_name
11949 @itemx -dynamic
11950 @itemx -exported_symbols_list
11951 @itemx -filelist
11952 @need 800
11953 @itemx -flat_namespace
11954 @itemx -force_flat_namespace
11955 @itemx -headerpad_max_install_names
11956 @itemx -image_base
11957 @itemx -init
11958 @itemx -install_name
11959 @itemx -keep_private_externs
11960 @itemx -multi_module
11961 @itemx -multiply_defined
11962 @itemx -multiply_defined_unused
11963 @need 800
11964 @itemx -noall_load
11965 @itemx -no_dead_strip_inits_and_terms
11966 @itemx -nofixprebinding
11967 @itemx -nomultidefs
11968 @itemx -noprebind
11969 @itemx -noseglinkedit
11970 @itemx -pagezero_size
11971 @itemx -prebind
11972 @itemx -prebind_all_twolevel_modules
11973 @itemx -private_bundle
11974 @need 800
11975 @itemx -read_only_relocs
11976 @itemx -sectalign
11977 @itemx -sectobjectsymbols
11978 @itemx -whyload
11979 @itemx -seg1addr
11980 @itemx -sectcreate
11981 @itemx -sectobjectsymbols
11982 @itemx -sectorder
11983 @itemx -segaddr
11984 @itemx -segs_read_only_addr
11985 @need 800
11986 @itemx -segs_read_write_addr
11987 @itemx -seg_addr_table
11988 @itemx -seg_addr_table_filename
11989 @itemx -seglinkedit
11990 @itemx -segprot
11991 @itemx -segs_read_only_addr
11992 @itemx -segs_read_write_addr
11993 @itemx -single_module
11994 @itemx -static
11995 @itemx -sub_library
11996 @need 800
11997 @itemx -sub_umbrella
11998 @itemx -twolevel_namespace
11999 @itemx -umbrella
12000 @itemx -undefined
12001 @itemx -unexported_symbols_list
12002 @itemx -weak_reference_mismatches
12003 @itemx -whatsloaded
12004 @opindex allowable_client
12005 @opindex client_name
12006 @opindex compatibility_version
12007 @opindex current_version
12008 @opindex dead_strip
12009 @opindex dependency-file
12010 @opindex dylib_file
12011 @opindex dylinker_install_name
12012 @opindex dynamic
12013 @opindex exported_symbols_list
12014 @opindex filelist
12015 @opindex flat_namespace
12016 @opindex force_flat_namespace
12017 @opindex headerpad_max_install_names
12018 @opindex image_base
12019 @opindex init
12020 @opindex install_name
12021 @opindex keep_private_externs
12022 @opindex multi_module
12023 @opindex multiply_defined
12024 @opindex multiply_defined_unused
12025 @opindex noall_load
12026 @opindex no_dead_strip_inits_and_terms
12027 @opindex nofixprebinding
12028 @opindex nomultidefs
12029 @opindex noprebind
12030 @opindex noseglinkedit
12031 @opindex pagezero_size
12032 @opindex prebind
12033 @opindex prebind_all_twolevel_modules
12034 @opindex private_bundle
12035 @opindex read_only_relocs
12036 @opindex sectalign
12037 @opindex sectobjectsymbols
12038 @opindex whyload
12039 @opindex seg1addr
12040 @opindex sectcreate
12041 @opindex sectobjectsymbols
12042 @opindex sectorder
12043 @opindex segaddr
12044 @opindex segs_read_only_addr
12045 @opindex segs_read_write_addr
12046 @opindex seg_addr_table
12047 @opindex seg_addr_table_filename
12048 @opindex seglinkedit
12049 @opindex segprot
12050 @opindex segs_read_only_addr
12051 @opindex segs_read_write_addr
12052 @opindex single_module
12053 @opindex static
12054 @opindex sub_library
12055 @opindex sub_umbrella
12056 @opindex twolevel_namespace
12057 @opindex umbrella
12058 @opindex undefined
12059 @opindex unexported_symbols_list
12060 @opindex weak_reference_mismatches
12061 @opindex whatsloaded
12062 These options are passed to the Darwin linker.  The Darwin linker man page
12063 describes them in detail.
12064 @end table
12066 @node DEC Alpha Options
12067 @subsection DEC Alpha Options
12069 These @samp{-m} options are defined for the DEC Alpha implementations:
12071 @table @gcctabopt
12072 @item -mno-soft-float
12073 @itemx -msoft-float
12074 @opindex mno-soft-float
12075 @opindex msoft-float
12076 Use (do not use) the hardware floating-point instructions for
12077 floating-point operations.  When @option{-msoft-float} is specified,
12078 functions in @file{libgcc.a} will be used to perform floating-point
12079 operations.  Unless they are replaced by routines that emulate the
12080 floating-point operations, or compiled in such a way as to call such
12081 emulations routines, these routines will issue floating-point
12082 operations.   If you are compiling for an Alpha without floating-point
12083 operations, you must ensure that the library is built so as not to call
12084 them.
12086 Note that Alpha implementations without floating-point operations are
12087 required to have floating-point registers.
12089 @item -mfp-reg
12090 @itemx -mno-fp-regs
12091 @opindex mfp-reg
12092 @opindex mno-fp-regs
12093 Generate code that uses (does not use) the floating-point register set.
12094 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
12095 register set is not used, floating-point operands are passed in integer
12096 registers as if they were integers and floating-point results are passed
12097 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
12098 so any function with a floating-point argument or return value called by code
12099 compiled with @option{-mno-fp-regs} must also be compiled with that
12100 option.
12102 A typical use of this option is building a kernel that does not use,
12103 and hence need not save and restore, any floating-point registers.
12105 @item -mieee
12106 @opindex mieee
12107 The Alpha architecture implements floating-point hardware optimized for
12108 maximum performance.  It is mostly compliant with the IEEE floating-point
12109 standard.  However, for full compliance, software assistance is
12110 required.  This option generates code fully IEEE-compliant code
12111 @emph{except} that the @var{inexact-flag} is not maintained (see below).
12112 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
12113 defined during compilation.  The resulting code is less efficient but is
12114 able to correctly support denormalized numbers and exceptional IEEE
12115 values such as not-a-number and plus/minus infinity.  Other Alpha
12116 compilers call this option @option{-ieee_with_no_inexact}.
12118 @item -mieee-with-inexact
12119 @opindex mieee-with-inexact
12120 This is like @option{-mieee} except the generated code also maintains
12121 the IEEE @var{inexact-flag}.  Turning on this option causes the
12122 generated code to implement fully-compliant IEEE math.  In addition to
12123 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
12124 macro.  On some Alpha implementations the resulting code may execute
12125 significantly slower than the code generated by default.  Since there is
12126 very little code that depends on the @var{inexact-flag}, you should
12127 normally not specify this option.  Other Alpha compilers call this
12128 option @option{-ieee_with_inexact}.
12130 @item -mfp-trap-mode=@var{trap-mode}
12131 @opindex mfp-trap-mode
12132 This option controls what floating-point related traps are enabled.
12133 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
12134 The trap mode can be set to one of four values:
12136 @table @samp
12137 @item n
12138 This is the default (normal) setting.  The only traps that are enabled
12139 are the ones that cannot be disabled in software (e.g., division by zero
12140 trap).
12142 @item u
12143 In addition to the traps enabled by @samp{n}, underflow traps are enabled
12144 as well.
12146 @item su
12147 Like @samp{u}, but the instructions are marked to be safe for software
12148 completion (see Alpha architecture manual for details).
12150 @item sui
12151 Like @samp{su}, but inexact traps are enabled as well.
12152 @end table
12154 @item -mfp-rounding-mode=@var{rounding-mode}
12155 @opindex mfp-rounding-mode
12156 Selects the IEEE rounding mode.  Other Alpha compilers call this option
12157 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
12160 @table @samp
12161 @item n
12162 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
12163 the nearest machine number or towards the even machine number in case
12164 of a tie.
12166 @item m
12167 Round towards minus infinity.
12169 @item c
12170 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
12172 @item d
12173 Dynamic rounding mode.  A field in the floating-point control register
12174 (@var{fpcr}, see Alpha architecture reference manual) controls the
12175 rounding mode in effect.  The C library initializes this register for
12176 rounding towards plus infinity.  Thus, unless your program modifies the
12177 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
12178 @end table
12180 @item -mtrap-precision=@var{trap-precision}
12181 @opindex mtrap-precision
12182 In the Alpha architecture, floating-point traps are imprecise.  This
12183 means without software assistance it is impossible to recover from a
12184 floating trap and program execution normally needs to be terminated.
12185 GCC can generate code that can assist operating system trap handlers
12186 in determining the exact location that caused a floating-point trap.
12187 Depending on the requirements of an application, different levels of
12188 precisions can be selected:
12190 @table @samp
12191 @item p
12192 Program precision.  This option is the default and means a trap handler
12193 can only identify which program caused a floating-point exception.
12195 @item f
12196 Function precision.  The trap handler can determine the function that
12197 caused a floating-point exception.
12199 @item i
12200 Instruction precision.  The trap handler can determine the exact
12201 instruction that caused a floating-point exception.
12202 @end table
12204 Other Alpha compilers provide the equivalent options called
12205 @option{-scope_safe} and @option{-resumption_safe}.
12207 @item -mieee-conformant
12208 @opindex mieee-conformant
12209 This option marks the generated code as IEEE conformant.  You must not
12210 use this option unless you also specify @option{-mtrap-precision=i} and either
12211 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
12212 is to emit the line @samp{.eflag 48} in the function prologue of the
12213 generated assembly file.  Under DEC Unix, this has the effect that
12214 IEEE-conformant math library routines will be linked in.
12216 @item -mbuild-constants
12217 @opindex mbuild-constants
12218 Normally GCC examines a 32- or 64-bit integer constant to
12219 see if it can construct it from smaller constants in two or three
12220 instructions.  If it cannot, it will output the constant as a literal and
12221 generate code to load it from the data segment at run time.
12223 Use this option to require GCC to construct @emph{all} integer constants
12224 using code, even if it takes more instructions (the maximum is six).
12226 You would typically use this option to build a shared library dynamic
12227 loader.  Itself a shared library, it must relocate itself in memory
12228 before it can find the variables and constants in its own data segment.
12230 @item -malpha-as
12231 @itemx -mgas
12232 @opindex malpha-as
12233 @opindex mgas
12234 Select whether to generate code to be assembled by the vendor-supplied
12235 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
12237 @item -mbwx
12238 @itemx -mno-bwx
12239 @itemx -mcix
12240 @itemx -mno-cix
12241 @itemx -mfix
12242 @itemx -mno-fix
12243 @itemx -mmax
12244 @itemx -mno-max
12245 @opindex mbwx
12246 @opindex mno-bwx
12247 @opindex mcix
12248 @opindex mno-cix
12249 @opindex mfix
12250 @opindex mno-fix
12251 @opindex mmax
12252 @opindex mno-max
12253 Indicate whether GCC should generate code to use the optional BWX,
12254 CIX, FIX and MAX instruction sets.  The default is to use the instruction
12255 sets supported by the CPU type specified via @option{-mcpu=} option or that
12256 of the CPU on which GCC was built if none was specified.
12258 @item -mfloat-vax
12259 @itemx -mfloat-ieee
12260 @opindex mfloat-vax
12261 @opindex mfloat-ieee
12262 Generate code that uses (does not use) VAX F and G floating-point
12263 arithmetic instead of IEEE single and double precision.
12265 @item -mexplicit-relocs
12266 @itemx -mno-explicit-relocs
12267 @opindex mexplicit-relocs
12268 @opindex mno-explicit-relocs
12269 Older Alpha assemblers provided no way to generate symbol relocations
12270 except via assembler macros.  Use of these macros does not allow
12271 optimal instruction scheduling.  GNU binutils as of version 2.12
12272 supports a new syntax that allows the compiler to explicitly mark
12273 which relocations should apply to which instructions.  This option
12274 is mostly useful for debugging, as GCC detects the capabilities of
12275 the assembler when it is built and sets the default accordingly.
12277 @item -msmall-data
12278 @itemx -mlarge-data
12279 @opindex msmall-data
12280 @opindex mlarge-data
12281 When @option{-mexplicit-relocs} is in effect, static data is
12282 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
12283 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
12284 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
12285 16-bit relocations off of the @code{$gp} register.  This limits the
12286 size of the small data area to 64KB, but allows the variables to be
12287 directly accessed via a single instruction.
12289 The default is @option{-mlarge-data}.  With this option the data area
12290 is limited to just below 2GB@.  Programs that require more than 2GB of
12291 data must use @code{malloc} or @code{mmap} to allocate the data in the
12292 heap instead of in the program's data segment.
12294 When generating code for shared libraries, @option{-fpic} implies
12295 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
12297 @item -msmall-text
12298 @itemx -mlarge-text
12299 @opindex msmall-text
12300 @opindex mlarge-text
12301 When @option{-msmall-text} is used, the compiler assumes that the
12302 code of the entire program (or shared library) fits in 4MB, and is
12303 thus reachable with a branch instruction.  When @option{-msmall-data}
12304 is used, the compiler can assume that all local symbols share the
12305 same @code{$gp} value, and thus reduce the number of instructions
12306 required for a function call from 4 to 1.
12308 The default is @option{-mlarge-text}.
12310 @item -mcpu=@var{cpu_type}
12311 @opindex mcpu
12312 Set the instruction set and instruction scheduling parameters for
12313 machine type @var{cpu_type}.  You can specify either the @samp{EV}
12314 style name or the corresponding chip number.  GCC supports scheduling
12315 parameters for the EV4, EV5 and EV6 family of processors and will
12316 choose the default values for the instruction set from the processor
12317 you specify.  If you do not specify a processor type, GCC will default
12318 to the processor on which the compiler was built.
12320 Supported values for @var{cpu_type} are
12322 @table @samp
12323 @item ev4
12324 @itemx ev45
12325 @itemx 21064
12326 Schedules as an EV4 and has no instruction set extensions.
12328 @item ev5
12329 @itemx 21164
12330 Schedules as an EV5 and has no instruction set extensions.
12332 @item ev56
12333 @itemx 21164a
12334 Schedules as an EV5 and supports the BWX extension.
12336 @item pca56
12337 @itemx 21164pc
12338 @itemx 21164PC
12339 Schedules as an EV5 and supports the BWX and MAX extensions.
12341 @item ev6
12342 @itemx 21264
12343 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
12345 @item ev67
12346 @itemx 21264a
12347 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
12348 @end table
12350 Native toolchains also support the value @samp{native},
12351 which selects the best architecture option for the host processor.
12352 @option{-mcpu=native} has no effect if GCC does not recognize
12353 the processor.
12355 @item -mtune=@var{cpu_type}
12356 @opindex mtune
12357 Set only the instruction scheduling parameters for machine type
12358 @var{cpu_type}.  The instruction set is not changed.
12360 Native toolchains also support the value @samp{native},
12361 which selects the best architecture option for the host processor.
12362 @option{-mtune=native} has no effect if GCC does not recognize
12363 the processor.
12365 @item -mmemory-latency=@var{time}
12366 @opindex mmemory-latency
12367 Sets the latency the scheduler should assume for typical memory
12368 references as seen by the application.  This number is highly
12369 dependent on the memory access patterns used by the application
12370 and the size of the external cache on the machine.
12372 Valid options for @var{time} are
12374 @table @samp
12375 @item @var{number}
12376 A decimal number representing clock cycles.
12378 @item L1
12379 @itemx L2
12380 @itemx L3
12381 @itemx main
12382 The compiler contains estimates of the number of clock cycles for
12383 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
12384 (also called Dcache, Scache, and Bcache), as well as to main memory.
12385 Note that L3 is only valid for EV5.
12387 @end table
12388 @end table
12390 @node DEC Alpha/VMS Options
12391 @subsection DEC Alpha/VMS Options
12393 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
12395 @table @gcctabopt
12396 @item -mvms-return-codes
12397 @opindex mvms-return-codes
12398 Return VMS condition codes from main.  The default is to return POSIX
12399 style condition (e.g.@: error) codes.
12401 @item -mdebug-main=@var{prefix}
12402 @opindex mdebug-main=@var{prefix}
12403 Flag the first routine whose name starts with @var{prefix} as the main
12404 routine for the debugger.
12406 @item -mmalloc64
12407 @opindex mmalloc64
12408 Default to 64-bit memory allocation routines.
12409 @end table
12411 @node FR30 Options
12412 @subsection FR30 Options
12413 @cindex FR30 Options
12415 These options are defined specifically for the FR30 port.
12417 @table @gcctabopt
12419 @item -msmall-model
12420 @opindex msmall-model
12421 Use the small address space model.  This can produce smaller code, but
12422 it does assume that all symbolic values and addresses will fit into a
12423 20-bit range.
12425 @item -mno-lsim
12426 @opindex mno-lsim
12427 Assume that runtime support has been provided and so there is no need
12428 to include the simulator library (@file{libsim.a}) on the linker
12429 command line.
12431 @end table
12433 @node FRV Options
12434 @subsection FRV Options
12435 @cindex FRV Options
12437 @table @gcctabopt
12438 @item -mgpr-32
12439 @opindex mgpr-32
12441 Only use the first 32 general-purpose registers.
12443 @item -mgpr-64
12444 @opindex mgpr-64
12446 Use all 64 general-purpose registers.
12448 @item -mfpr-32
12449 @opindex mfpr-32
12451 Use only the first 32 floating-point registers.
12453 @item -mfpr-64
12454 @opindex mfpr-64
12456 Use all 64 floating-point registers.
12458 @item -mhard-float
12459 @opindex mhard-float
12461 Use hardware instructions for floating-point operations.
12463 @item -msoft-float
12464 @opindex msoft-float
12466 Use library routines for floating-point operations.
12468 @item -malloc-cc
12469 @opindex malloc-cc
12471 Dynamically allocate condition code registers.
12473 @item -mfixed-cc
12474 @opindex mfixed-cc
12476 Do not try to dynamically allocate condition code registers, only
12477 use @code{icc0} and @code{fcc0}.
12479 @item -mdword
12480 @opindex mdword
12482 Change ABI to use double word insns.
12484 @item -mno-dword
12485 @opindex mno-dword
12487 Do not use double word instructions.
12489 @item -mdouble
12490 @opindex mdouble
12492 Use floating-point double instructions.
12494 @item -mno-double
12495 @opindex mno-double
12497 Do not use floating-point double instructions.
12499 @item -mmedia
12500 @opindex mmedia
12502 Use media instructions.
12504 @item -mno-media
12505 @opindex mno-media
12507 Do not use media instructions.
12509 @item -mmuladd
12510 @opindex mmuladd
12512 Use multiply and add/subtract instructions.
12514 @item -mno-muladd
12515 @opindex mno-muladd
12517 Do not use multiply and add/subtract instructions.
12519 @item -mfdpic
12520 @opindex mfdpic
12522 Select the FDPIC ABI, which uses function descriptors to represent
12523 pointers to functions.  Without any PIC/PIE-related options, it
12524 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
12525 assumes GOT entries and small data are within a 12-bit range from the
12526 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
12527 are computed with 32 bits.
12528 With a @samp{bfin-elf} target, this option implies @option{-msim}.
12530 @item -minline-plt
12531 @opindex minline-plt
12533 Enable inlining of PLT entries in function calls to functions that are
12534 not known to bind locally.  It has no effect without @option{-mfdpic}.
12535 It's enabled by default if optimizing for speed and compiling for
12536 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
12537 optimization option such as @option{-O3} or above is present in the
12538 command line.
12540 @item -mTLS
12541 @opindex mTLS
12543 Assume a large TLS segment when generating thread-local code.
12545 @item -mtls
12546 @opindex mtls
12548 Do not assume a large TLS segment when generating thread-local code.
12550 @item -mgprel-ro
12551 @opindex mgprel-ro
12553 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
12554 that is known to be in read-only sections.  It's enabled by default,
12555 except for @option{-fpic} or @option{-fpie}: even though it may help
12556 make the global offset table smaller, it trades 1 instruction for 4.
12557 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
12558 one of which may be shared by multiple symbols, and it avoids the need
12559 for a GOT entry for the referenced symbol, so it's more likely to be a
12560 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
12562 @item -multilib-library-pic
12563 @opindex multilib-library-pic
12565 Link with the (library, not FD) pic libraries.  It's implied by
12566 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
12567 @option{-fpic} without @option{-mfdpic}.  You should never have to use
12568 it explicitly.
12570 @item -mlinked-fp
12571 @opindex mlinked-fp
12573 Follow the EABI requirement of always creating a frame pointer whenever
12574 a stack frame is allocated.  This option is enabled by default and can
12575 be disabled with @option{-mno-linked-fp}.
12577 @item -mlong-calls
12578 @opindex mlong-calls
12580 Use indirect addressing to call functions outside the current
12581 compilation unit.  This allows the functions to be placed anywhere
12582 within the 32-bit address space.
12584 @item -malign-labels
12585 @opindex malign-labels
12587 Try to align labels to an 8-byte boundary by inserting nops into the
12588 previous packet.  This option only has an effect when VLIW packing
12589 is enabled.  It doesn't create new packets; it merely adds nops to
12590 existing ones.
12592 @item -mlibrary-pic
12593 @opindex mlibrary-pic
12595 Generate position-independent EABI code.
12597 @item -macc-4
12598 @opindex macc-4
12600 Use only the first four media accumulator registers.
12602 @item -macc-8
12603 @opindex macc-8
12605 Use all eight media accumulator registers.
12607 @item -mpack
12608 @opindex mpack
12610 Pack VLIW instructions.
12612 @item -mno-pack
12613 @opindex mno-pack
12615 Do not pack VLIW instructions.
12617 @item -mno-eflags
12618 @opindex mno-eflags
12620 Do not mark ABI switches in e_flags.
12622 @item -mcond-move
12623 @opindex mcond-move
12625 Enable the use of conditional-move instructions (default).
12627 This switch is mainly for debugging the compiler and will likely be removed
12628 in a future version.
12630 @item -mno-cond-move
12631 @opindex mno-cond-move
12633 Disable the use of conditional-move instructions.
12635 This switch is mainly for debugging the compiler and will likely be removed
12636 in a future version.
12638 @item -mscc
12639 @opindex mscc
12641 Enable the use of conditional set instructions (default).
12643 This switch is mainly for debugging the compiler and will likely be removed
12644 in a future version.
12646 @item -mno-scc
12647 @opindex mno-scc
12649 Disable the use of conditional set instructions.
12651 This switch is mainly for debugging the compiler and will likely be removed
12652 in a future version.
12654 @item -mcond-exec
12655 @opindex mcond-exec
12657 Enable the use of conditional execution (default).
12659 This switch is mainly for debugging the compiler and will likely be removed
12660 in a future version.
12662 @item -mno-cond-exec
12663 @opindex mno-cond-exec
12665 Disable the use of conditional execution.
12667 This switch is mainly for debugging the compiler and will likely be removed
12668 in a future version.
12670 @item -mvliw-branch
12671 @opindex mvliw-branch
12673 Run a pass to pack branches into VLIW instructions (default).
12675 This switch is mainly for debugging the compiler and will likely be removed
12676 in a future version.
12678 @item -mno-vliw-branch
12679 @opindex mno-vliw-branch
12681 Do not run a pass to pack branches into VLIW instructions.
12683 This switch is mainly for debugging the compiler and will likely be removed
12684 in a future version.
12686 @item -mmulti-cond-exec
12687 @opindex mmulti-cond-exec
12689 Enable optimization of @code{&&} and @code{||} in conditional execution
12690 (default).
12692 This switch is mainly for debugging the compiler and will likely be removed
12693 in a future version.
12695 @item -mno-multi-cond-exec
12696 @opindex mno-multi-cond-exec
12698 Disable optimization of @code{&&} and @code{||} in conditional execution.
12700 This switch is mainly for debugging the compiler and will likely be removed
12701 in a future version.
12703 @item -mnested-cond-exec
12704 @opindex mnested-cond-exec
12706 Enable nested conditional execution optimizations (default).
12708 This switch is mainly for debugging the compiler and will likely be removed
12709 in a future version.
12711 @item -mno-nested-cond-exec
12712 @opindex mno-nested-cond-exec
12714 Disable nested conditional execution optimizations.
12716 This switch is mainly for debugging the compiler and will likely be removed
12717 in a future version.
12719 @item -moptimize-membar
12720 @opindex moptimize-membar
12722 This switch removes redundant @code{membar} instructions from the
12723 compiler generated code.  It is enabled by default.
12725 @item -mno-optimize-membar
12726 @opindex mno-optimize-membar
12728 This switch disables the automatic removal of redundant @code{membar}
12729 instructions from the generated code.
12731 @item -mtomcat-stats
12732 @opindex mtomcat-stats
12734 Cause gas to print out tomcat statistics.
12736 @item -mcpu=@var{cpu}
12737 @opindex mcpu
12739 Select the processor type for which to generate code.  Possible values are
12740 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
12741 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
12743 @end table
12745 @node GNU/Linux Options
12746 @subsection GNU/Linux Options
12748 These @samp{-m} options are defined for GNU/Linux targets:
12750 @table @gcctabopt
12751 @item -mglibc
12752 @opindex mglibc
12753 Use the GNU C library.  This is the default except
12754 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
12756 @item -muclibc
12757 @opindex muclibc
12758 Use uClibc C library.  This is the default on
12759 @samp{*-*-linux-*uclibc*} targets.
12761 @item -mbionic
12762 @opindex mbionic
12763 Use Bionic C library.  This is the default on
12764 @samp{*-*-linux-*android*} targets.
12766 @item -mandroid
12767 @opindex mandroid
12768 Compile code compatible with Android platform.  This is the default on
12769 @samp{*-*-linux-*android*} targets.
12771 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
12772 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
12773 this option makes the GCC driver pass Android-specific options to the linker.
12774 Finally, this option causes the preprocessor macro @code{__ANDROID__}
12775 to be defined.
12777 @item -tno-android-cc
12778 @opindex tno-android-cc
12779 Disable compilation effects of @option{-mandroid}, i.e., do not enable
12780 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
12781 @option{-fno-rtti} by default.
12783 @item -tno-android-ld
12784 @opindex tno-android-ld
12785 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
12786 linking options to the linker.
12788 @end table
12790 @node H8/300 Options
12791 @subsection H8/300 Options
12793 These @samp{-m} options are defined for the H8/300 implementations:
12795 @table @gcctabopt
12796 @item -mrelax
12797 @opindex mrelax
12798 Shorten some address references at link time, when possible; uses the
12799 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
12800 ld, Using ld}, for a fuller description.
12802 @item -mh
12803 @opindex mh
12804 Generate code for the H8/300H@.
12806 @item -ms
12807 @opindex ms
12808 Generate code for the H8S@.
12810 @item -mn
12811 @opindex mn
12812 Generate code for the H8S and H8/300H in the normal mode.  This switch
12813 must be used either with @option{-mh} or @option{-ms}.
12815 @item -ms2600
12816 @opindex ms2600
12817 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
12819 @item -mint32
12820 @opindex mint32
12821 Make @code{int} data 32 bits by default.
12823 @item -malign-300
12824 @opindex malign-300
12825 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
12826 The default for the H8/300H and H8S is to align longs and floats on
12827 4-byte boundaries.
12828 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
12829 This option has no effect on the H8/300.
12830 @end table
12832 @node HPPA Options
12833 @subsection HPPA Options
12834 @cindex HPPA Options
12836 These @samp{-m} options are defined for the HPPA family of computers:
12838 @table @gcctabopt
12839 @item -march=@var{architecture-type}
12840 @opindex march
12841 Generate code for the specified architecture.  The choices for
12842 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
12843 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
12844 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
12845 architecture option for your machine.  Code compiled for lower numbered
12846 architectures will run on higher numbered architectures, but not the
12847 other way around.
12849 @item -mpa-risc-1-0
12850 @itemx -mpa-risc-1-1
12851 @itemx -mpa-risc-2-0
12852 @opindex mpa-risc-1-0
12853 @opindex mpa-risc-1-1
12854 @opindex mpa-risc-2-0
12855 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
12857 @item -mbig-switch
12858 @opindex mbig-switch
12859 Generate code suitable for big switch tables.  Use this option only if
12860 the assembler/linker complain about out of range branches within a switch
12861 table.
12863 @item -mjump-in-delay
12864 @opindex mjump-in-delay
12865 Fill delay slots of function calls with unconditional jump instructions
12866 by modifying the return pointer for the function call to be the target
12867 of the conditional jump.
12869 @item -mdisable-fpregs
12870 @opindex mdisable-fpregs
12871 Prevent floating-point registers from being used in any manner.  This is
12872 necessary for compiling kernels that perform lazy context switching of
12873 floating-point registers.  If you use this option and attempt to perform
12874 floating-point operations, the compiler aborts.
12876 @item -mdisable-indexing
12877 @opindex mdisable-indexing
12878 Prevent the compiler from using indexing address modes.  This avoids some
12879 rather obscure problems when compiling MIG generated code under MACH@.
12881 @item -mno-space-regs
12882 @opindex mno-space-regs
12883 Generate code that assumes the target has no space registers.  This allows
12884 GCC to generate faster indirect calls and use unscaled index address modes.
12886 Such code is suitable for level 0 PA systems and kernels.
12888 @item -mfast-indirect-calls
12889 @opindex mfast-indirect-calls
12890 Generate code that assumes calls never cross space boundaries.  This
12891 allows GCC to emit code that performs faster indirect calls.
12893 This option will not work in the presence of shared libraries or nested
12894 functions.
12896 @item -mfixed-range=@var{register-range}
12897 @opindex mfixed-range
12898 Generate code treating the given register range as fixed registers.
12899 A fixed register is one that the register allocator can not use.  This is
12900 useful when compiling kernel code.  A register range is specified as
12901 two registers separated by a dash.  Multiple register ranges can be
12902 specified separated by a comma.
12904 @item -mlong-load-store
12905 @opindex mlong-load-store
12906 Generate 3-instruction load and store sequences as sometimes required by
12907 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
12908 the HP compilers.
12910 @item -mportable-runtime
12911 @opindex mportable-runtime
12912 Use the portable calling conventions proposed by HP for ELF systems.
12914 @item -mgas
12915 @opindex mgas
12916 Enable the use of assembler directives only GAS understands.
12918 @item -mschedule=@var{cpu-type}
12919 @opindex mschedule
12920 Schedule code according to the constraints for the machine type
12921 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
12922 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
12923 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
12924 proper scheduling option for your machine.  The default scheduling is
12925 @samp{8000}.
12927 @item -mlinker-opt
12928 @opindex mlinker-opt
12929 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
12930 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
12931 linkers in which they give bogus error messages when linking some programs.
12933 @item -msoft-float
12934 @opindex msoft-float
12935 Generate output containing library calls for floating point.
12936 @strong{Warning:} the requisite libraries are not available for all HPPA
12937 targets.  Normally the facilities of the machine's usual C compiler are
12938 used, but this cannot be done directly in cross-compilation.  You must make
12939 your own arrangements to provide suitable library functions for
12940 cross-compilation.
12942 @option{-msoft-float} changes the calling convention in the output file;
12943 therefore, it is only useful if you compile @emph{all} of a program with
12944 this option.  In particular, you need to compile @file{libgcc.a}, the
12945 library that comes with GCC, with @option{-msoft-float} in order for
12946 this to work.
12948 @item -msio
12949 @opindex msio
12950 Generate the predefine, @code{_SIO}, for server IO@.  The default is
12951 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
12952 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
12953 options are available under HP-UX and HI-UX@.
12955 @item -mgnu-ld
12956 @opindex mgnu-ld
12957 Use GNU ld specific options.  This passes @option{-shared} to ld when
12958 building a shared library.  It is the default when GCC is configured,
12959 explicitly or implicitly, with the GNU linker.  This option does not
12960 have any affect on which ld is called, it only changes what parameters
12961 are passed to that ld.  The ld that is called is determined by the
12962 @option{--with-ld} configure option, GCC's program search path, and
12963 finally by the user's @env{PATH}.  The linker used by GCC can be printed
12964 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
12965 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
12967 @item -mhp-ld
12968 @opindex mhp-ld
12969 Use HP ld specific options.  This passes @option{-b} to ld when building
12970 a shared library and passes @option{+Accept TypeMismatch} to ld on all
12971 links.  It is the default when GCC is configured, explicitly or
12972 implicitly, with the HP linker.  This option does not have any affect on
12973 which ld is called, it only changes what parameters are passed to that
12974 ld.  The ld that is called is determined by the @option{--with-ld}
12975 configure option, GCC's program search path, and finally by the user's
12976 @env{PATH}.  The linker used by GCC can be printed using @samp{which
12977 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
12978 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
12980 @item -mlong-calls
12981 @opindex mno-long-calls
12982 Generate code that uses long call sequences.  This ensures that a call
12983 is always able to reach linker generated stubs.  The default is to generate
12984 long calls only when the distance from the call site to the beginning
12985 of the function or translation unit, as the case may be, exceeds a
12986 predefined limit set by the branch type being used.  The limits for
12987 normal calls are 7,600,000 and 240,000 bytes, respectively for the
12988 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
12989 240,000 bytes.
12991 Distances are measured from the beginning of functions when using the
12992 @option{-ffunction-sections} option, or when using the @option{-mgas}
12993 and @option{-mno-portable-runtime} options together under HP-UX with
12994 the SOM linker.
12996 It is normally not desirable to use this option as it will degrade
12997 performance.  However, it may be useful in large applications,
12998 particularly when partial linking is used to build the application.
13000 The types of long calls used depends on the capabilities of the
13001 assembler and linker, and the type of code being generated.  The
13002 impact on systems that support long absolute calls, and long pic
13003 symbol-difference or pc-relative calls should be relatively small.
13004 However, an indirect call is used on 32-bit ELF systems in pic code
13005 and it is quite long.
13007 @item -munix=@var{unix-std}
13008 @opindex march
13009 Generate compiler predefines and select a startfile for the specified
13010 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
13011 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
13012 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
13013 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
13014 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
13015 and later.
13017 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
13018 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
13019 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
13020 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
13021 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
13022 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
13024 It is @emph{important} to note that this option changes the interfaces
13025 for various library routines.  It also affects the operational behavior
13026 of the C library.  Thus, @emph{extreme} care is needed in using this
13027 option.
13029 Library code that is intended to operate with more than one UNIX
13030 standard must test, set and restore the variable @var{__xpg4_extended_mask}
13031 as appropriate.  Most GNU software doesn't provide this capability.
13033 @item -nolibdld
13034 @opindex nolibdld
13035 Suppress the generation of link options to search libdld.sl when the
13036 @option{-static} option is specified on HP-UX 10 and later.
13038 @item -static
13039 @opindex static
13040 The HP-UX implementation of setlocale in libc has a dependency on
13041 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
13042 when the @option{-static} option is specified, special link options
13043 are needed to resolve this dependency.
13045 On HP-UX 10 and later, the GCC driver adds the necessary options to
13046 link with libdld.sl when the @option{-static} option is specified.
13047 This causes the resulting binary to be dynamic.  On the 64-bit port,
13048 the linkers generate dynamic binaries by default in any case.  The
13049 @option{-nolibdld} option can be used to prevent the GCC driver from
13050 adding these link options.
13052 @item -threads
13053 @opindex threads
13054 Add support for multithreading with the @dfn{dce thread} library
13055 under HP-UX@.  This option sets flags for both the preprocessor and
13056 linker.
13057 @end table
13059 @node i386 and x86-64 Options
13060 @subsection Intel 386 and AMD x86-64 Options
13061 @cindex i386 Options
13062 @cindex x86-64 Options
13063 @cindex Intel 386 Options
13064 @cindex AMD x86-64 Options
13066 These @samp{-m} options are defined for the i386 and x86-64 family of
13067 computers:
13069 @table @gcctabopt
13071 @item -march=@var{cpu-type}
13072 @opindex march
13073 Generate instructions for the machine type @var{cpu-type}.  In contrast to
13074 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
13075 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
13076 to generate code that may not run at all on processors other than the one
13077 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
13078 @option{-mtune=@var{cpu-type}}.
13080 The choices for @var{cpu-type} are:
13082 @table @samp
13083 @item native
13084 This selects the CPU to generate code for at compilation time by determining
13085 the processor type of the compiling machine.  Using @option{-march=native}
13086 enables all instruction subsets supported by the local machine (hence
13087 the result might not run on different machines).  Using @option{-mtune=native}
13088 produces code optimized for the local machine under the constraints
13089 of the selected instruction set.  
13091 @item i386
13092 Original Intel i386 CPU@.
13094 @item i486
13095 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
13097 @item i586
13098 @itemx pentium
13099 Intel Pentium CPU with no MMX support.
13101 @item pentium-mmx
13102 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
13104 @item pentiumpro
13105 Intel Pentium Pro CPU@.
13107 @item i686
13108 When used with @option{-march}, the Pentium Pro
13109 instruction set is used, so the code runs on all i686 family chips.
13110 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
13112 @item pentium2
13113 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
13114 support.
13116 @item pentium3
13117 @itemx pentium3m
13118 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
13119 set support.
13121 @item pentium-m
13122 Intel Pentium M; low-power version of Intel Pentium III CPU
13123 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
13125 @item pentium4
13126 @itemx pentium4m
13127 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
13129 @item prescott
13130 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
13131 set support.
13133 @item nocona
13134 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
13135 SSE2 and SSE3 instruction set support.
13137 @item core2
13138 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
13139 instruction set support.
13141 @item corei7
13142 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1
13143 and SSE4.2 instruction set support.
13145 @item corei7-avx
13146 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
13147 SSE4.1, SSE4.2, AVX, AES and PCLMUL instruction set support.
13149 @item core-avx-i
13150 Intel Core CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
13151 SSE4.1, SSE4.2, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C instruction
13152 set support.
13154 @item atom
13155 Intel Atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
13156 instruction set support.
13158 @item k6
13159 AMD K6 CPU with MMX instruction set support.
13161 @item k6-2
13162 @itemx k6-3
13163 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
13165 @item athlon
13166 @itemx athlon-tbird
13167 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
13168 support.
13170 @item athlon-4
13171 @itemx athlon-xp
13172 @itemx athlon-mp
13173 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
13174 instruction set support.
13176 @item k8
13177 @itemx opteron
13178 @itemx athlon64
13179 @itemx athlon-fx
13180 Processors based on the AMD K8 core with x86-64 instruction set support,
13181 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
13182 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
13183 instruction set extensions.)
13185 @item k8-sse3
13186 @itemx opteron-sse3
13187 @itemx athlon64-sse3
13188 Improved versions of AMD K8 cores with SSE3 instruction set support.
13190 @item amdfam10
13191 @itemx barcelona
13192 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
13193 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
13194 instruction set extensions.)
13196 @item bdver1
13197 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
13198 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
13199 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
13200 @item bdver2
13201 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
13202 supersets BMI, TBM, F16C, FMA, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE,
13203 SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
13204 extensions.)
13206 @item btver1
13207 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
13208 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
13209 instruction set extensions.)
13211 @item winchip-c6
13212 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
13213 set support.
13215 @item winchip2
13216 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
13217 instruction set support.
13219 @item c3
13220 VIA C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
13221 implemented for this chip.)
13223 @item c3-2
13224 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
13225 (No scheduling is
13226 implemented for this chip.)
13228 @item geode
13229 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
13230 @end table
13232 @item -mtune=@var{cpu-type}
13233 @opindex mtune
13234 Tune to @var{cpu-type} everything applicable about the generated code, except
13235 for the ABI and the set of available instructions.  
13236 While picking a specific @var{cpu-type} schedules things appropriately
13237 for that particular chip, the compiler does not generate any code that
13238 cannot run on the default machine type unless you use a
13239 @option{-march=@var{cpu-type}} option.
13240 For example, if GCC is configured for i686-pc-linux-gnu
13241 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
13242 but still runs on i686 machines.
13244 The choices for @var{cpu-type} are the same as for @option{-march}.
13245 In addition, @option{-mtune} supports an extra choice for @var{cpu-type}:
13247 @table @samp
13248 @item generic
13249 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
13250 If you know the CPU on which your code will run, then you should use
13251 the corresponding @option{-mtune} or @option{-march} option instead of
13252 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
13253 of your application will have, then you should use this option.
13255 As new processors are deployed in the marketplace, the behavior of this
13256 option will change.  Therefore, if you upgrade to a newer version of
13257 GCC, code generation controlled by this option will change to reflect
13258 the processors
13259 that are most common at the time that version of GCC is released.
13261 There is no @option{-march=generic} option because @option{-march}
13262 indicates the instruction set the compiler can use, and there is no
13263 generic instruction set applicable to all processors.  In contrast,
13264 @option{-mtune} indicates the processor (or, in this case, collection of
13265 processors) for which the code is optimized.
13266 @end table
13268 @item -mcpu=@var{cpu-type}
13269 @opindex mcpu
13270 A deprecated synonym for @option{-mtune}.
13272 @item -mfpmath=@var{unit}
13273 @opindex mfpmath
13274 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
13275 for @var{unit} are:
13277 @table @samp
13278 @item 387
13279 Use the standard 387 floating-point coprocessor present on the majority of chips and
13280 emulated otherwise.  Code compiled with this option runs almost everywhere.
13281 The temporary results are computed in 80-bit precision instead of the precision
13282 specified by the type, resulting in slightly different results compared to most
13283 of other chips.  See @option{-ffloat-store} for more detailed description.
13285 This is the default choice for i386 compiler.
13287 @item sse
13288 Use scalar floating-point instructions present in the SSE instruction set.
13289 This instruction set is supported by Pentium III and newer chips,
13290 and in the AMD line
13291 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
13292 instruction set supports only single-precision arithmetic, thus the double and
13293 extended-precision arithmetic are still done using 387.  A later version, present
13294 only in Pentium 4 and AMD x86-64 chips, supports double-precision
13295 arithmetic too.
13297 For the i386 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
13298 or @option{-msse2} switches to enable SSE extensions and make this option
13299 effective.  For the x86-64 compiler, these extensions are enabled by default.
13301 The resulting code should be considerably faster in the majority of cases and avoid
13302 the numerical instability problems of 387 code, but may break some existing
13303 code that expects temporaries to be 80 bits.
13305 This is the default choice for the x86-64 compiler.
13307 @item sse,387
13308 @itemx sse+387
13309 @itemx both
13310 Attempt to utilize both instruction sets at once.  This effectively doubles the
13311 amount of available registers, and on chips with separate execution units for
13312 387 and SSE the execution resources too.  Use this option with care, as it is
13313 still experimental, because the GCC register allocator does not model separate
13314 functional units well, resulting in unstable performance.
13315 @end table
13317 @item -masm=@var{dialect}
13318 @opindex masm=@var{dialect}
13319 Output assembly instructions using selected @var{dialect}.  Supported
13320 choices are @samp{intel} or @samp{att} (the default).  Darwin does
13321 not support @samp{intel}.
13323 @item -mieee-fp
13324 @itemx -mno-ieee-fp
13325 @opindex mieee-fp
13326 @opindex mno-ieee-fp
13327 Control whether or not the compiler uses IEEE floating-point
13328 comparisons.  These correctly handle the case where the result of a
13329 comparison is unordered.
13331 @item -msoft-float
13332 @opindex msoft-float
13333 Generate output containing library calls for floating point.
13335 @strong{Warning:} the requisite libraries are not part of GCC@.
13336 Normally the facilities of the machine's usual C compiler are used, but
13337 this can't be done directly in cross-compilation.  You must make your
13338 own arrangements to provide suitable library functions for
13339 cross-compilation.
13341 On machines where a function returns floating-point results in the 80387
13342 register stack, some floating-point opcodes may be emitted even if
13343 @option{-msoft-float} is used.
13345 @item -mno-fp-ret-in-387
13346 @opindex mno-fp-ret-in-387
13347 Do not use the FPU registers for return values of functions.
13349 The usual calling convention has functions return values of types
13350 @code{float} and @code{double} in an FPU register, even if there
13351 is no FPU@.  The idea is that the operating system should emulate
13352 an FPU@.
13354 The option @option{-mno-fp-ret-in-387} causes such values to be returned
13355 in ordinary CPU registers instead.
13357 @item -mno-fancy-math-387
13358 @opindex mno-fancy-math-387
13359 Some 387 emulators do not support the @code{sin}, @code{cos} and
13360 @code{sqrt} instructions for the 387.  Specify this option to avoid
13361 generating those instructions.  This option is the default on FreeBSD,
13362 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
13363 indicates that the target CPU always has an FPU and so the
13364 instruction does not need emulation.  These
13365 instructions are not generated unless you also use the
13366 @option{-funsafe-math-optimizations} switch.
13368 @item -malign-double
13369 @itemx -mno-align-double
13370 @opindex malign-double
13371 @opindex mno-align-double
13372 Control whether GCC aligns @code{double}, @code{long double}, and
13373 @code{long long} variables on a two-word boundary or a one-word
13374 boundary.  Aligning @code{double} variables on a two-word boundary
13375 produces code that runs somewhat faster on a Pentium at the
13376 expense of more memory.
13378 On x86-64, @option{-malign-double} is enabled by default.
13380 @strong{Warning:} if you use the @option{-malign-double} switch,
13381 structures containing the above types are aligned differently than
13382 the published application binary interface specifications for the 386
13383 and are not binary compatible with structures in code compiled
13384 without that switch.
13386 @item -m96bit-long-double
13387 @itemx -m128bit-long-double
13388 @opindex m96bit-long-double
13389 @opindex m128bit-long-double
13390 These switches control the size of @code{long double} type.  The i386
13391 application binary interface specifies the size to be 96 bits,
13392 so @option{-m96bit-long-double} is the default in 32-bit mode.
13394 Modern architectures (Pentium and newer) prefer @code{long double}
13395 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
13396 conforming to the ABI, this is not possible.  So specifying
13397 @option{-m128bit-long-double} aligns @code{long double}
13398 to a 16-byte boundary by padding the @code{long double} with an additional
13399 32-bit zero.
13401 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
13402 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
13404 Notice that neither of these options enable any extra precision over the x87
13405 standard of 80 bits for a @code{long double}.
13407 @strong{Warning:} if you override the default value for your target ABI, this
13408 changes the size of 
13409 structures and arrays containing @code{long double} variables,
13410 as well as modifying the function calling convention for functions taking
13411 @code{long double}.  Hence they are not binary-compatible
13412 with code compiled without that switch.
13414 @item -mlarge-data-threshold=@var{threshold}
13415 @opindex mlarge-data-threshold
13416 When @option{-mcmodel=medium} is specified, data objects larger than
13417 @var{threshold} are placed in the large data section.  This value must be the
13418 same across all objects linked into the binary, and defaults to 65535.
13420 @item -mrtd
13421 @opindex mrtd
13422 Use a different function-calling convention, in which functions that
13423 take a fixed number of arguments return with the @code{ret @var{num}}
13424 instruction, which pops their arguments while returning.  This saves one
13425 instruction in the caller since there is no need to pop the arguments
13426 there.
13428 You can specify that an individual function is called with this calling
13429 sequence with the function attribute @samp{stdcall}.  You can also
13430 override the @option{-mrtd} option by using the function attribute
13431 @samp{cdecl}.  @xref{Function Attributes}.
13433 @strong{Warning:} this calling convention is incompatible with the one
13434 normally used on Unix, so you cannot use it if you need to call
13435 libraries compiled with the Unix compiler.
13437 Also, you must provide function prototypes for all functions that
13438 take variable numbers of arguments (including @code{printf});
13439 otherwise incorrect code is generated for calls to those
13440 functions.
13442 In addition, seriously incorrect code results if you call a
13443 function with too many arguments.  (Normally, extra arguments are
13444 harmlessly ignored.)
13446 @item -mregparm=@var{num}
13447 @opindex mregparm
13448 Control how many registers are used to pass integer arguments.  By
13449 default, no registers are used to pass arguments, and at most 3
13450 registers can be used.  You can control this behavior for a specific
13451 function by using the function attribute @samp{regparm}.
13452 @xref{Function Attributes}.
13454 @strong{Warning:} if you use this switch, and
13455 @var{num} is nonzero, then you must build all modules with the same
13456 value, including any libraries.  This includes the system libraries and
13457 startup modules.
13459 @item -msseregparm
13460 @opindex msseregparm
13461 Use SSE register passing conventions for float and double arguments
13462 and return values.  You can control this behavior for a specific
13463 function by using the function attribute @samp{sseregparm}.
13464 @xref{Function Attributes}.
13466 @strong{Warning:} if you use this switch then you must build all
13467 modules with the same value, including any libraries.  This includes
13468 the system libraries and startup modules.
13470 @item -mvect8-ret-in-mem
13471 @opindex mvect8-ret-in-mem
13472 Return 8-byte vectors in memory instead of MMX registers.  This is the
13473 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
13474 Studio compilers until version 12.  Later compiler versions (starting
13475 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
13476 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
13477 you need to remain compatible with existing code produced by those
13478 previous compiler versions or older versions of GCC@.
13480 @item -mpc32
13481 @itemx -mpc64
13482 @itemx -mpc80
13483 @opindex mpc32
13484 @opindex mpc64
13485 @opindex mpc80
13487 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
13488 is specified, the significands of results of floating-point operations are
13489 rounded to 24 bits (single precision); @option{-mpc64} rounds the
13490 significands of results of floating-point operations to 53 bits (double
13491 precision) and @option{-mpc80} rounds the significands of results of
13492 floating-point operations to 64 bits (extended double precision), which is
13493 the default.  When this option is used, floating-point operations in higher
13494 precisions are not available to the programmer without setting the FPU
13495 control word explicitly.
13497 Setting the rounding of floating-point operations to less than the default
13498 80 bits can speed some programs by 2% or more.  Note that some mathematical
13499 libraries assume that extended-precision (80-bit) floating-point operations
13500 are enabled by default; routines in such libraries could suffer significant
13501 loss of accuracy, typically through so-called ``catastrophic cancellation'',
13502 when this option is used to set the precision to less than extended precision.
13504 @item -mstackrealign
13505 @opindex mstackrealign
13506 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
13507 option generates an alternate prologue and epilogue that realigns the
13508 run-time stack if necessary.  This supports mixing legacy codes that keep
13509 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
13510 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
13511 applicable to individual functions.
13513 @item -mpreferred-stack-boundary=@var{num}
13514 @opindex mpreferred-stack-boundary
13515 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
13516 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
13517 the default is 4 (16 bytes or 128 bits).
13519 @item -mincoming-stack-boundary=@var{num}
13520 @opindex mincoming-stack-boundary
13521 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
13522 boundary.  If @option{-mincoming-stack-boundary} is not specified,
13523 the one specified by @option{-mpreferred-stack-boundary} is used.
13525 On Pentium and Pentium Pro, @code{double} and @code{long double} values
13526 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
13527 suffer significant run time performance penalties.  On Pentium III, the
13528 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
13529 properly if it is not 16-byte aligned.
13531 To ensure proper alignment of this values on the stack, the stack boundary
13532 must be as aligned as that required by any value stored on the stack.
13533 Further, every function must be generated such that it keeps the stack
13534 aligned.  Thus calling a function compiled with a higher preferred
13535 stack boundary from a function compiled with a lower preferred stack
13536 boundary most likely misaligns the stack.  It is recommended that
13537 libraries that use callbacks always use the default setting.
13539 This extra alignment does consume extra stack space, and generally
13540 increases code size.  Code that is sensitive to stack space usage, such
13541 as embedded systems and operating system kernels, may want to reduce the
13542 preferred alignment to @option{-mpreferred-stack-boundary=2}.
13544 @item -mmmx
13545 @itemx -mno-mmx
13546 @itemx -msse
13547 @itemx -mno-sse
13548 @itemx -msse2
13549 @itemx -mno-sse2
13550 @itemx -msse3
13551 @itemx -mno-sse3
13552 @itemx -mssse3
13553 @itemx -mno-ssse3
13554 @itemx -msse4.1
13555 @need 800
13556 @itemx -mno-sse4.1
13557 @itemx -msse4.2
13558 @itemx -mno-sse4.2
13559 @itemx -msse4
13560 @itemx -mno-sse4
13561 @itemx -mavx
13562 @itemx -mno-avx
13563 @itemx -mavx2
13564 @itemx -mno-avx2
13565 @itemx -maes
13566 @itemx -mno-aes
13567 @itemx -mpclmul
13568 @need 800
13569 @itemx -mno-pclmul
13570 @itemx -mfsgsbase
13571 @itemx -mno-fsgsbase
13572 @itemx -mrdrnd
13573 @itemx -mno-rdrnd
13574 @itemx -mf16c
13575 @itemx -mno-f16c
13576 @itemx -mfma
13577 @itemx -mno-fma
13578 @itemx -msse4a
13579 @itemx -mno-sse4a
13580 @itemx -mfma4
13581 @need 800
13582 @itemx -mno-fma4
13583 @itemx -mxop
13584 @itemx -mno-xop
13585 @itemx -mlwp
13586 @itemx -mno-lwp
13587 @itemx -m3dnow
13588 @itemx -mno-3dnow
13589 @itemx -mpopcnt
13590 @itemx -mno-popcnt
13591 @itemx -mabm
13592 @itemx -mno-abm
13593 @itemx -mbmi
13594 @itemx -mbmi2
13595 @itemx -mno-bmi
13596 @itemx -mno-bmi2
13597 @itemx -mlzcnt
13598 @itemx -mno-lzcnt
13599 @itemx -mtbm
13600 @itemx -mno-tbm
13601 @opindex mmmx
13602 @opindex mno-mmx
13603 @opindex msse
13604 @opindex mno-sse
13605 @opindex m3dnow
13606 @opindex mno-3dnow
13607 These switches enable or disable the use of instructions in the MMX, SSE,
13608 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, F16C,
13609 FMA, SSE4A, FMA4, XOP, LWP, ABM, BMI, BMI2, LZCNT or 3DNow!@: 
13610 extended instruction sets.
13611 These extensions are also available as built-in functions: see
13612 @ref{X86 Built-in Functions}, for details of the functions enabled and
13613 disabled by these switches.
13615 To generate SSE/SSE2 instructions automatically from floating-point
13616 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
13618 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
13619 generates new AVX instructions or AVX equivalence for all SSEx instructions
13620 when needed.
13622 These options enable GCC to use these extended instructions in
13623 generated code, even without @option{-mfpmath=sse}.  Applications that
13624 perform run-time CPU detection must compile separate files for each
13625 supported architecture, using the appropriate flags.  In particular,
13626 the file containing the CPU detection code should be compiled without
13627 these options.
13629 @item -mcld
13630 @opindex mcld
13631 This option instructs GCC to emit a @code{cld} instruction in the prologue
13632 of functions that use string instructions.  String instructions depend on
13633 the DF flag to select between autoincrement or autodecrement mode.  While the
13634 ABI specifies the DF flag to be cleared on function entry, some operating
13635 systems violate this specification by not clearing the DF flag in their
13636 exception dispatchers.  The exception handler can be invoked with the DF flag
13637 set, which leads to wrong direction mode when string instructions are used.
13638 This option can be enabled by default on 32-bit x86 targets by configuring
13639 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
13640 instructions can be suppressed with the @option{-mno-cld} compiler option
13641 in this case.
13643 @item -mvzeroupper
13644 @opindex mvzeroupper
13645 This option instructs GCC to emit a @code{vzeroupper} instruction
13646 before a transfer of control flow out of the function to minimize
13647 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
13648 intrinsics.
13650 @item -mcx16
13651 @opindex mcx16
13652 This option enables GCC to generate @code{CMPXCHG16B} instructions.
13653 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
13654 (or oword) data types.  
13655 This is useful for high-resolution counters that can be updated
13656 by multiple processors (or cores).  This instruction is generated as part of
13657 atomic built-in functions: see @ref{__sync Builtins} or
13658 @ref{__atomic Builtins} for details.
13660 @item -msahf
13661 @opindex msahf
13662 This option enables generation of @code{SAHF} instructions in 64-bit code.
13663 Early Intel Pentium 4 CPUs with Intel 64 support,
13664 prior to the introduction of Pentium 4 G1 step in December 2005,
13665 lacked the @code{LAHF} and @code{SAHF} instructions
13666 which were supported by AMD64.
13667 These are load and store instructions, respectively, for certain status flags.
13668 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
13669 @code{drem}, and @code{remainder} built-in functions;
13670 see @ref{Other Builtins} for details.
13672 @item -mmovbe
13673 @opindex mmovbe
13674 This option enables use of the @code{movbe} instruction to implement
13675 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
13677 @item -mcrc32
13678 @opindex mcrc32
13679 This option enables built-in functions @code{__builtin_ia32_crc32qi},
13680 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
13681 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
13683 @item -mrecip
13684 @opindex mrecip
13685 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
13686 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
13687 with an additional Newton-Raphson step
13688 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
13689 (and their vectorized
13690 variants) for single-precision floating-point arguments.  These instructions
13691 are generated only when @option{-funsafe-math-optimizations} is enabled
13692 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
13693 Note that while the throughput of the sequence is higher than the throughput
13694 of the non-reciprocal instruction, the precision of the sequence can be
13695 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
13697 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
13698 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
13699 combination), and doesn't need @option{-mrecip}.
13701 Also note that GCC emits the above sequence with additional Newton-Raphson step
13702 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
13703 already with @option{-ffast-math} (or the above option combination), and
13704 doesn't need @option{-mrecip}.
13706 @item -mrecip=@var{opt}
13707 @opindex mrecip=opt
13708 This option controls which reciprocal estimate instructions
13709 may be used.  @var{opt} is a comma-separated list of options, which may
13710 be preceded by a @samp{!} to invert the option:
13712 @table @samp
13713 @item all
13714 Enable all estimate instructions.
13716 @item default
13717 Enable the default instructions, equivalent to @option{-mrecip}.
13719 @item none
13720 Disable all estimate instructions, equivalent to @option{-mno-recip}.
13722 @item div
13723 Enable the approximation for scalar division.
13725 @item vec-div
13726 Enable the approximation for vectorized division.
13728 @item sqrt
13729 Enable the approximation for scalar square root.
13731 @item vec-sqrt
13732 Enable the approximation for vectorized square root.
13733 @end table
13735 So, for example, @option{-mrecip=all,!sqrt} enables
13736 all of the reciprocal approximations, except for square root.
13738 @item -mveclibabi=@var{type}
13739 @opindex mveclibabi
13740 Specifies the ABI type to use for vectorizing intrinsics using an
13741 external library.  Supported values for @var{type} are @samp{svml} 
13742 for the Intel short
13743 vector math library and @samp{acml} for the AMD math core library.
13744 To use this option, both @option{-ftree-vectorize} and
13745 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
13746 ABI-compatible library must be specified at link time.
13748 GCC currently emits calls to @code{vmldExp2},
13749 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
13750 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
13751 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
13752 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
13753 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
13754 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
13755 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
13756 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
13757 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
13758 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
13759 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
13760 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
13761 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
13762 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
13763 when @option{-mveclibabi=acml} is used.  
13765 @item -mabi=@var{name}
13766 @opindex mabi
13767 Generate code for the specified calling convention.  Permissible values
13768 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
13769 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
13770 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
13771 You can control this behavior for a specific function by
13772 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
13773 @xref{Function Attributes}.
13775 @item -mtls-dialect=@var{type}
13776 @opindex mtls-dialect
13777 Generate code to access thread-local storage using the @samp{gnu} or
13778 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
13779 @samp{gnu2} is more efficient, but it may add compile- and run-time
13780 requirements that cannot be satisfied on all systems.
13782 @item -mpush-args
13783 @itemx -mno-push-args
13784 @opindex mpush-args
13785 @opindex mno-push-args
13786 Use PUSH operations to store outgoing parameters.  This method is shorter
13787 and usually equally fast as method using SUB/MOV operations and is enabled
13788 by default.  In some cases disabling it may improve performance because of
13789 improved scheduling and reduced dependencies.
13791 @item -maccumulate-outgoing-args
13792 @opindex maccumulate-outgoing-args
13793 If enabled, the maximum amount of space required for outgoing arguments is
13794 computed in the function prologue.  This is faster on most modern CPUs
13795 because of reduced dependencies, improved scheduling and reduced stack usage
13796 when the preferred stack boundary is not equal to 2.  The drawback is a notable
13797 increase in code size.  This switch implies @option{-mno-push-args}.
13799 @item -mthreads
13800 @opindex mthreads
13801 Support thread-safe exception handling on MinGW.  Programs that rely
13802 on thread-safe exception handling must compile and link all code with the
13803 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
13804 @code{-D_MT}; when linking, it links in a special thread helper library
13805 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
13807 @item -mno-align-stringops
13808 @opindex mno-align-stringops
13809 Do not align the destination of inlined string operations.  This switch reduces
13810 code size and improves performance in case the destination is already aligned,
13811 but GCC doesn't know about it.
13813 @item -minline-all-stringops
13814 @opindex minline-all-stringops
13815 By default GCC inlines string operations only when the destination is 
13816 known to be aligned to least a 4-byte boundary.  
13817 This enables more inlining and increases code
13818 size, but may improve performance of code that depends on fast
13819 @code{memcpy}, @code{strlen},
13820 and @code{memset} for short lengths.
13822 @item -minline-stringops-dynamically
13823 @opindex minline-stringops-dynamically
13824 For string operations of unknown size, use run-time checks with
13825 inline code for small blocks and a library call for large blocks.
13827 @item -mstringop-strategy=@var{alg}
13828 @opindex mstringop-strategy=@var{alg}
13829 Override the internal decision heuristic for the particular algorithm to use
13830 for inlining string operations.  The allowed values for @var{alg} are:
13832 @table @samp
13833 @item rep_byte
13834 @itemx rep_4byte
13835 @itemx rep_8byte
13836 Expand using i386 @code{rep} prefix of the specified size.
13838 @item byte_loop
13839 @itemx loop
13840 @itemx unrolled_loop
13841 Expand into an inline loop.
13843 @item libcall
13844 Always use a library call.
13845 @end table
13847 @item -momit-leaf-frame-pointer
13848 @opindex momit-leaf-frame-pointer
13849 Don't keep the frame pointer in a register for leaf functions.  This
13850 avoids the instructions to save, set up, and restore frame pointers and
13851 makes an extra register available in leaf functions.  The option
13852 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
13853 which might make debugging harder.
13855 @item -mtls-direct-seg-refs
13856 @itemx -mno-tls-direct-seg-refs
13857 @opindex mtls-direct-seg-refs
13858 Controls whether TLS variables may be accessed with offsets from the
13859 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
13860 or whether the thread base pointer must be added.  Whether or not this
13861 is valid depends on the operating system, and whether it maps the
13862 segment to cover the entire TLS area.
13864 For systems that use the GNU C Library, the default is on.
13866 @item -msse2avx
13867 @itemx -mno-sse2avx
13868 @opindex msse2avx
13869 Specify that the assembler should encode SSE instructions with VEX
13870 prefix.  The option @option{-mavx} turns this on by default.
13872 @item -mfentry
13873 @itemx -mno-fentry
13874 @opindex mfentry
13875 If profiling is active (@option{-pg}), put the profiling
13876 counter call before the prologue.
13877 Note: On x86 architectures the attribute @code{ms_hook_prologue}
13878 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
13880 @item -m8bit-idiv
13881 @itemx -mno-8bit-idiv
13882 @opindex 8bit-idiv
13883 On some processors, like Intel Atom, 8-bit unsigned integer divide is
13884 much faster than 32-bit/64-bit integer divide.  This option generates a
13885 run-time check.  If both dividend and divisor are within range of 0
13886 to 255, 8-bit unsigned integer divide is used instead of
13887 32-bit/64-bit integer divide.
13889 @item -mavx256-split-unaligned-load
13890 @itemx -mavx256-split-unaligned-store
13891 @opindex avx256-split-unaligned-load
13892 @opindex avx256-split-unaligned-store
13893 Split 32-byte AVX unaligned load and store.
13895 @end table
13897 These @samp{-m} switches are supported in addition to the above
13898 on x86-64 processors in 64-bit environments.
13900 @table @gcctabopt
13901 @item -m32
13902 @itemx -m64
13903 @itemx -mx32
13904 @opindex m32
13905 @opindex m64
13906 @opindex mx32
13907 Generate code for a 32-bit or 64-bit environment.
13908 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
13909 to 32 bits, and
13910 generates code that runs on any i386 system.
13912 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
13913 types to 64 bits, and generates code for the x86-64 architecture.
13914 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
13915 and @option{-mdynamic-no-pic} options.
13917 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
13918 to 32 bits, and
13919 generates code for the x86-64 architecture.
13921 @item -mno-red-zone
13922 @opindex mno-red-zone
13923 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
13924 by the x86-64 ABI; it is a 128-byte area beyond the location of the
13925 stack pointer that is not modified by signal or interrupt handlers
13926 and therefore can be used for temporary data without adjusting the stack
13927 pointer.  The flag @option{-mno-red-zone} disables this red zone.
13929 @item -mcmodel=small
13930 @opindex mcmodel=small
13931 Generate code for the small code model: the program and its symbols must
13932 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
13933 Programs can be statically or dynamically linked.  This is the default
13934 code model.
13936 @item -mcmodel=kernel
13937 @opindex mcmodel=kernel
13938 Generate code for the kernel code model.  The kernel runs in the
13939 negative 2 GB of the address space.
13940 This model has to be used for Linux kernel code.
13942 @item -mcmodel=medium
13943 @opindex mcmodel=medium
13944 Generate code for the medium model: the program is linked in the lower 2
13945 GB of the address space.  Small symbols are also placed there.  Symbols
13946 with sizes larger than @option{-mlarge-data-threshold} are put into
13947 large data or BSS sections and can be located above 2GB.  Programs can
13948 be statically or dynamically linked.
13950 @item -mcmodel=large
13951 @opindex mcmodel=large
13952 Generate code for the large model.  This model makes no assumptions
13953 about addresses and sizes of sections.
13954 @end table
13956 @node i386 and x86-64 Windows Options
13957 @subsection i386 and x86-64 Windows Options
13958 @cindex i386 and x86-64 Windows Options
13960 These additional options are available for Microsoft Windows targets:
13962 @table @gcctabopt
13963 @item -mconsole
13964 @opindex mconsole
13965 This option
13966 specifies that a console application is to be generated, by
13967 instructing the linker to set the PE header subsystem type
13968 required for console applications.
13969 This option is available for Cygwin and MinGW targets and is
13970 enabled by default on those targets.
13972 @item -mdll
13973 @opindex mdll
13974 This option is available for Cygwin and MinGW targets.  It
13975 specifies that a DLL---a dynamic link library---is to be
13976 generated, enabling the selection of the required runtime
13977 startup object and entry point.
13979 @item -mnop-fun-dllimport
13980 @opindex mnop-fun-dllimport
13981 This option is available for Cygwin and MinGW targets.  It
13982 specifies that the @code{dllimport} attribute should be ignored.
13984 @item -mthread
13985 @opindex mthread
13986 This option is available for MinGW targets. It specifies
13987 that MinGW-specific thread support is to be used.
13989 @item -municode
13990 @opindex municode
13991 This option is available for MinGW-w64 targets.  It causes
13992 the @code{UNICODE} preprocessor macro to be predefined, and
13993 chooses Unicode-capable runtime startup code.
13995 @item -mwin32
13996 @opindex mwin32
13997 This option is available for Cygwin and MinGW targets.  It
13998 specifies that the typical Microsoft Windows predefined macros are to
13999 be set in the pre-processor, but does not influence the choice
14000 of runtime library/startup code.
14002 @item -mwindows
14003 @opindex mwindows
14004 This option is available for Cygwin and MinGW targets.  It
14005 specifies that a GUI application is to be generated by
14006 instructing the linker to set the PE header subsystem type
14007 appropriately.
14009 @item -fno-set-stack-executable
14010 @opindex fno-set-stack-executable
14011 This option is available for MinGW targets. It specifies that
14012 the executable flag for the stack used by nested functions isn't
14013 set. This is necessary for binaries running in kernel mode of
14014 Microsoft Windows, as there the User32 API, which is used to set executable
14015 privileges, isn't available.
14017 @item -fwritable-relocated-rdata
14018 @opindex fno-writable-relocated-rdata
14019 This option is available for MinGW and Cygwin targets.  It specifies
14020 that relocated-data in read-only section is put into .data
14021 section.  This is a necessary for older runtimes not supporting
14022 modification of .rdata sections for pseudo-relocation.
14024 @item -mpe-aligned-commons
14025 @opindex mpe-aligned-commons
14026 This option is available for Cygwin and MinGW targets.  It
14027 specifies that the GNU extension to the PE file format that
14028 permits the correct alignment of COMMON variables should be
14029 used when generating code.  It is enabled by default if
14030 GCC detects that the target assembler found during configuration
14031 supports the feature.
14032 @end table
14034 See also under @ref{i386 and x86-64 Options} for standard options.
14036 @node IA-64 Options
14037 @subsection IA-64 Options
14038 @cindex IA-64 Options
14040 These are the @samp{-m} options defined for the Intel IA-64 architecture.
14042 @table @gcctabopt
14043 @item -mbig-endian
14044 @opindex mbig-endian
14045 Generate code for a big-endian target.  This is the default for HP-UX@.
14047 @item -mlittle-endian
14048 @opindex mlittle-endian
14049 Generate code for a little-endian target.  This is the default for AIX5
14050 and GNU/Linux.
14052 @item -mgnu-as
14053 @itemx -mno-gnu-as
14054 @opindex mgnu-as
14055 @opindex mno-gnu-as
14056 Generate (or don't) code for the GNU assembler.  This is the default.
14057 @c Also, this is the default if the configure option @option{--with-gnu-as}
14058 @c is used.
14060 @item -mgnu-ld
14061 @itemx -mno-gnu-ld
14062 @opindex mgnu-ld
14063 @opindex mno-gnu-ld
14064 Generate (or don't) code for the GNU linker.  This is the default.
14065 @c Also, this is the default if the configure option @option{--with-gnu-ld}
14066 @c is used.
14068 @item -mno-pic
14069 @opindex mno-pic
14070 Generate code that does not use a global pointer register.  The result
14071 is not position independent code, and violates the IA-64 ABI@.
14073 @item -mvolatile-asm-stop
14074 @itemx -mno-volatile-asm-stop
14075 @opindex mvolatile-asm-stop
14076 @opindex mno-volatile-asm-stop
14077 Generate (or don't) a stop bit immediately before and after volatile asm
14078 statements.
14080 @item -mregister-names
14081 @itemx -mno-register-names
14082 @opindex mregister-names
14083 @opindex mno-register-names
14084 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
14085 the stacked registers.  This may make assembler output more readable.
14087 @item -mno-sdata
14088 @itemx -msdata
14089 @opindex mno-sdata
14090 @opindex msdata
14091 Disable (or enable) optimizations that use the small data section.  This may
14092 be useful for working around optimizer bugs.
14094 @item -mconstant-gp
14095 @opindex mconstant-gp
14096 Generate code that uses a single constant global pointer value.  This is
14097 useful when compiling kernel code.
14099 @item -mauto-pic
14100 @opindex mauto-pic
14101 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
14102 This is useful when compiling firmware code.
14104 @item -minline-float-divide-min-latency
14105 @opindex minline-float-divide-min-latency
14106 Generate code for inline divides of floating-point values
14107 using the minimum latency algorithm.
14109 @item -minline-float-divide-max-throughput
14110 @opindex minline-float-divide-max-throughput
14111 Generate code for inline divides of floating-point values
14112 using the maximum throughput algorithm.
14114 @item -mno-inline-float-divide
14115 @opindex mno-inline-float-divide
14116 Do not generate inline code for divides of floating-point values.
14118 @item -minline-int-divide-min-latency
14119 @opindex minline-int-divide-min-latency
14120 Generate code for inline divides of integer values
14121 using the minimum latency algorithm.
14123 @item -minline-int-divide-max-throughput
14124 @opindex minline-int-divide-max-throughput
14125 Generate code for inline divides of integer values
14126 using the maximum throughput algorithm.
14128 @item -mno-inline-int-divide
14129 @opindex mno-inline-int-divide
14130 Do not generate inline code for divides of integer values.
14132 @item -minline-sqrt-min-latency
14133 @opindex minline-sqrt-min-latency
14134 Generate code for inline square roots
14135 using the minimum latency algorithm.
14137 @item -minline-sqrt-max-throughput
14138 @opindex minline-sqrt-max-throughput
14139 Generate code for inline square roots
14140 using the maximum throughput algorithm.
14142 @item -mno-inline-sqrt
14143 @opindex mno-inline-sqrt
14144 Do not generate inline code for @code{sqrt}.
14146 @item -mfused-madd
14147 @itemx -mno-fused-madd
14148 @opindex mfused-madd
14149 @opindex mno-fused-madd
14150 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
14151 instructions.  The default is to use these instructions.
14153 @item -mno-dwarf2-asm
14154 @itemx -mdwarf2-asm
14155 @opindex mno-dwarf2-asm
14156 @opindex mdwarf2-asm
14157 Don't (or do) generate assembler code for the DWARF 2 line number debugging
14158 info.  This may be useful when not using the GNU assembler.
14160 @item -mearly-stop-bits
14161 @itemx -mno-early-stop-bits
14162 @opindex mearly-stop-bits
14163 @opindex mno-early-stop-bits
14164 Allow stop bits to be placed earlier than immediately preceding the
14165 instruction that triggered the stop bit.  This can improve instruction
14166 scheduling, but does not always do so.
14168 @item -mfixed-range=@var{register-range}
14169 @opindex mfixed-range
14170 Generate code treating the given register range as fixed registers.
14171 A fixed register is one that the register allocator cannot use.  This is
14172 useful when compiling kernel code.  A register range is specified as
14173 two registers separated by a dash.  Multiple register ranges can be
14174 specified separated by a comma.
14176 @item -mtls-size=@var{tls-size}
14177 @opindex mtls-size
14178 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
14181 @item -mtune=@var{cpu-type}
14182 @opindex mtune
14183 Tune the instruction scheduling for a particular CPU, Valid values are
14184 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
14185 and @samp{mckinley}.
14187 @item -milp32
14188 @itemx -mlp64
14189 @opindex milp32
14190 @opindex mlp64
14191 Generate code for a 32-bit or 64-bit environment.
14192 The 32-bit environment sets int, long and pointer to 32 bits.
14193 The 64-bit environment sets int to 32 bits and long and pointer
14194 to 64 bits.  These are HP-UX specific flags.
14196 @item -mno-sched-br-data-spec
14197 @itemx -msched-br-data-spec
14198 @opindex mno-sched-br-data-spec
14199 @opindex msched-br-data-spec
14200 (Dis/En)able data speculative scheduling before reload.
14201 This results in generation of @code{ld.a} instructions and
14202 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
14203 The default is 'disable'.
14205 @item -msched-ar-data-spec
14206 @itemx -mno-sched-ar-data-spec
14207 @opindex msched-ar-data-spec
14208 @opindex mno-sched-ar-data-spec
14209 (En/Dis)able data speculative scheduling after reload.
14210 This results in generation of @code{ld.a} instructions and
14211 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
14212 The default is 'enable'.
14214 @item -mno-sched-control-spec
14215 @itemx -msched-control-spec
14216 @opindex mno-sched-control-spec
14217 @opindex msched-control-spec
14218 (Dis/En)able control speculative scheduling.  This feature is
14219 available only during region scheduling (i.e.@: before reload).
14220 This results in generation of the @code{ld.s} instructions and
14221 the corresponding check instructions @code{chk.s}.
14222 The default is 'disable'.
14224 @item -msched-br-in-data-spec
14225 @itemx -mno-sched-br-in-data-spec
14226 @opindex msched-br-in-data-spec
14227 @opindex mno-sched-br-in-data-spec
14228 (En/Dis)able speculative scheduling of the instructions that
14229 are dependent on the data speculative loads before reload.
14230 This is effective only with @option{-msched-br-data-spec} enabled.
14231 The default is 'enable'.
14233 @item -msched-ar-in-data-spec
14234 @itemx -mno-sched-ar-in-data-spec
14235 @opindex msched-ar-in-data-spec
14236 @opindex mno-sched-ar-in-data-spec
14237 (En/Dis)able speculative scheduling of the instructions that
14238 are dependent on the data speculative loads after reload.
14239 This is effective only with @option{-msched-ar-data-spec} enabled.
14240 The default is 'enable'.
14242 @item -msched-in-control-spec
14243 @itemx -mno-sched-in-control-spec
14244 @opindex msched-in-control-spec
14245 @opindex mno-sched-in-control-spec
14246 (En/Dis)able speculative scheduling of the instructions that
14247 are dependent on the control speculative loads.
14248 This is effective only with @option{-msched-control-spec} enabled.
14249 The default is 'enable'.
14251 @item -mno-sched-prefer-non-data-spec-insns
14252 @itemx -msched-prefer-non-data-spec-insns
14253 @opindex mno-sched-prefer-non-data-spec-insns
14254 @opindex msched-prefer-non-data-spec-insns
14255 If enabled, data-speculative instructions are chosen for schedule
14256 only if there are no other choices at the moment.  This makes
14257 the use of the data speculation much more conservative.
14258 The default is 'disable'.
14260 @item -mno-sched-prefer-non-control-spec-insns
14261 @itemx -msched-prefer-non-control-spec-insns
14262 @opindex mno-sched-prefer-non-control-spec-insns
14263 @opindex msched-prefer-non-control-spec-insns
14264 If enabled, control-speculative instructions are chosen for schedule
14265 only if there are no other choices at the moment.  This makes
14266 the use of the control speculation much more conservative.
14267 The default is 'disable'.
14269 @item -mno-sched-count-spec-in-critical-path
14270 @itemx -msched-count-spec-in-critical-path
14271 @opindex mno-sched-count-spec-in-critical-path
14272 @opindex msched-count-spec-in-critical-path
14273 If enabled, speculative dependencies are considered during
14274 computation of the instructions priorities.  This makes the use of the
14275 speculation a bit more conservative.
14276 The default is 'disable'.
14278 @item -msched-spec-ldc
14279 @opindex msched-spec-ldc
14280 Use a simple data speculation check.  This option is on by default.
14282 @item -msched-control-spec-ldc
14283 @opindex msched-spec-ldc
14284 Use a simple check for control speculation.  This option is on by default.
14286 @item -msched-stop-bits-after-every-cycle
14287 @opindex msched-stop-bits-after-every-cycle
14288 Place a stop bit after every cycle when scheduling.  This option is on
14289 by default.
14291 @item -msched-fp-mem-deps-zero-cost
14292 @opindex msched-fp-mem-deps-zero-cost
14293 Assume that floating-point stores and loads are not likely to cause a conflict
14294 when placed into the same instruction group.  This option is disabled by
14295 default.
14297 @item -msel-sched-dont-check-control-spec
14298 @opindex msel-sched-dont-check-control-spec
14299 Generate checks for control speculation in selective scheduling.
14300 This flag is disabled by default.
14302 @item -msched-max-memory-insns=@var{max-insns}
14303 @opindex msched-max-memory-insns
14304 Limit on the number of memory insns per instruction group, giving lower
14305 priority to subsequent memory insns attempting to schedule in the same
14306 instruction group. Frequently useful to prevent cache bank conflicts.
14307 The default value is 1.
14309 @item -msched-max-memory-insns-hard-limit
14310 @opindex msched-max-memory-insns-hard-limit
14311 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
14312 disallowing more than that number in an instruction group.
14313 Otherwise, the limit is ``soft'', meaning that non-memory operations
14314 are preferred when the limit is reached, but memory operations may still
14315 be scheduled.
14317 @end table
14319 @node IA-64/VMS Options
14320 @subsection IA-64/VMS Options
14322 These @samp{-m} options are defined for the IA-64/VMS implementations:
14324 @table @gcctabopt
14325 @item -mvms-return-codes
14326 @opindex mvms-return-codes
14327 Return VMS condition codes from @code{main}. The default is to return POSIX-style
14328 condition (e.g.@ error) codes.
14330 @item -mdebug-main=@var{prefix}
14331 @opindex mdebug-main=@var{prefix}
14332 Flag the first routine whose name starts with @var{prefix} as the main
14333 routine for the debugger.
14335 @item -mmalloc64
14336 @opindex mmalloc64
14337 Default to 64-bit memory allocation routines.
14338 @end table
14340 @node LM32 Options
14341 @subsection LM32 Options
14342 @cindex LM32 options
14344 These @option{-m} options are defined for the Lattice Mico32 architecture:
14346 @table @gcctabopt
14347 @item -mbarrel-shift-enabled
14348 @opindex mbarrel-shift-enabled
14349 Enable barrel-shift instructions.
14351 @item -mdivide-enabled
14352 @opindex mdivide-enabled
14353 Enable divide and modulus instructions.
14355 @item -mmultiply-enabled
14356 @opindex multiply-enabled
14357 Enable multiply instructions.
14359 @item -msign-extend-enabled
14360 @opindex msign-extend-enabled
14361 Enable sign extend instructions.
14363 @item -muser-enabled
14364 @opindex muser-enabled
14365 Enable user-defined instructions.
14367 @end table
14369 @node M32C Options
14370 @subsection M32C Options
14371 @cindex M32C options
14373 @table @gcctabopt
14374 @item -mcpu=@var{name}
14375 @opindex mcpu=
14376 Select the CPU for which code is generated.  @var{name} may be one of
14377 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
14378 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
14379 the M32C/80 series.
14381 @item -msim
14382 @opindex msim
14383 Specifies that the program will be run on the simulator.  This causes
14384 an alternate runtime library to be linked in which supports, for
14385 example, file I/O@.  You must not use this option when generating
14386 programs that will run on real hardware; you must provide your own
14387 runtime library for whatever I/O functions are needed.
14389 @item -memregs=@var{number}
14390 @opindex memregs=
14391 Specifies the number of memory-based pseudo-registers GCC will use
14392 during code generation.  These pseudo-registers will be used like real
14393 registers, so there is a tradeoff between GCC's ability to fit the
14394 code into available registers, and the performance penalty of using
14395 memory instead of registers.  Note that all modules in a program must
14396 be compiled with the same value for this option.  Because of that, you
14397 must not use this option with the default runtime libraries gcc
14398 builds.
14400 @end table
14402 @node M32R/D Options
14403 @subsection M32R/D Options
14404 @cindex M32R/D options
14406 These @option{-m} options are defined for Renesas M32R/D architectures:
14408 @table @gcctabopt
14409 @item -m32r2
14410 @opindex m32r2
14411 Generate code for the M32R/2@.
14413 @item -m32rx
14414 @opindex m32rx
14415 Generate code for the M32R/X@.
14417 @item -m32r
14418 @opindex m32r
14419 Generate code for the M32R@.  This is the default.
14421 @item -mmodel=small
14422 @opindex mmodel=small
14423 Assume all objects live in the lower 16MB of memory (so that their addresses
14424 can be loaded with the @code{ld24} instruction), and assume all subroutines
14425 are reachable with the @code{bl} instruction.
14426 This is the default.
14428 The addressability of a particular object can be set with the
14429 @code{model} attribute.
14431 @item -mmodel=medium
14432 @opindex mmodel=medium
14433 Assume objects may be anywhere in the 32-bit address space (the compiler
14434 will generate @code{seth/add3} instructions to load their addresses), and
14435 assume all subroutines are reachable with the @code{bl} instruction.
14437 @item -mmodel=large
14438 @opindex mmodel=large
14439 Assume objects may be anywhere in the 32-bit address space (the compiler
14440 will generate @code{seth/add3} instructions to load their addresses), and
14441 assume subroutines may not be reachable with the @code{bl} instruction
14442 (the compiler will generate the much slower @code{seth/add3/jl}
14443 instruction sequence).
14445 @item -msdata=none
14446 @opindex msdata=none
14447 Disable use of the small data area.  Variables will be put into
14448 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
14449 @code{section} attribute has been specified).
14450 This is the default.
14452 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
14453 Objects may be explicitly put in the small data area with the
14454 @code{section} attribute using one of these sections.
14456 @item -msdata=sdata
14457 @opindex msdata=sdata
14458 Put small global and static data in the small data area, but do not
14459 generate special code to reference them.
14461 @item -msdata=use
14462 @opindex msdata=use
14463 Put small global and static data in the small data area, and generate
14464 special instructions to reference them.
14466 @item -G @var{num}
14467 @opindex G
14468 @cindex smaller data references
14469 Put global and static objects less than or equal to @var{num} bytes
14470 into the small data or bss sections instead of the normal data or bss
14471 sections.  The default value of @var{num} is 8.
14472 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
14473 for this option to have any effect.
14475 All modules should be compiled with the same @option{-G @var{num}} value.
14476 Compiling with different values of @var{num} may or may not work; if it
14477 doesn't the linker will give an error message---incorrect code will not be
14478 generated.
14480 @item -mdebug
14481 @opindex mdebug
14482 Makes the M32R specific code in the compiler display some statistics
14483 that might help in debugging programs.
14485 @item -malign-loops
14486 @opindex malign-loops
14487 Align all loops to a 32-byte boundary.
14489 @item -mno-align-loops
14490 @opindex mno-align-loops
14491 Do not enforce a 32-byte alignment for loops.  This is the default.
14493 @item -missue-rate=@var{number}
14494 @opindex missue-rate=@var{number}
14495 Issue @var{number} instructions per cycle.  @var{number} can only be 1
14496 or 2.
14498 @item -mbranch-cost=@var{number}
14499 @opindex mbranch-cost=@var{number}
14500 @var{number} can only be 1 or 2.  If it is 1 then branches will be
14501 preferred over conditional code, if it is 2, then the opposite will
14502 apply.
14504 @item -mflush-trap=@var{number}
14505 @opindex mflush-trap=@var{number}
14506 Specifies the trap number to use to flush the cache.  The default is
14507 12.  Valid numbers are between 0 and 15 inclusive.
14509 @item -mno-flush-trap
14510 @opindex mno-flush-trap
14511 Specifies that the cache cannot be flushed by using a trap.
14513 @item -mflush-func=@var{name}
14514 @opindex mflush-func=@var{name}
14515 Specifies the name of the operating system function to call to flush
14516 the cache.  The default is @emph{_flush_cache}, but a function call
14517 will only be used if a trap is not available.
14519 @item -mno-flush-func
14520 @opindex mno-flush-func
14521 Indicates that there is no OS function for flushing the cache.
14523 @end table
14525 @node M680x0 Options
14526 @subsection M680x0 Options
14527 @cindex M680x0 options
14529 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
14530 The default settings depend on which architecture was selected when
14531 the compiler was configured; the defaults for the most common choices
14532 are given below.
14534 @table @gcctabopt
14535 @item -march=@var{arch}
14536 @opindex march
14537 Generate code for a specific M680x0 or ColdFire instruction set
14538 architecture.  Permissible values of @var{arch} for M680x0
14539 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
14540 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
14541 architectures are selected according to Freescale's ISA classification
14542 and the permissible values are: @samp{isaa}, @samp{isaaplus},
14543 @samp{isab} and @samp{isac}.
14545 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
14546 code for a ColdFire target.  The @var{arch} in this macro is one of the
14547 @option{-march} arguments given above.
14549 When used together, @option{-march} and @option{-mtune} select code
14550 that runs on a family of similar processors but that is optimized
14551 for a particular microarchitecture.
14553 @item -mcpu=@var{cpu}
14554 @opindex mcpu
14555 Generate code for a specific M680x0 or ColdFire processor.
14556 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
14557 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
14558 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
14559 below, which also classifies the CPUs into families:
14561 @multitable @columnfractions 0.20 0.80
14562 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
14563 @item @samp{51} @tab @samp{51} @samp{51ac} @samp{51cn} @samp{51em} @samp{51qe}
14564 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
14565 @item @samp{5206e} @tab @samp{5206e}
14566 @item @samp{5208} @tab @samp{5207} @samp{5208}
14567 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
14568 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
14569 @item @samp{5216} @tab @samp{5214} @samp{5216}
14570 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
14571 @item @samp{5225} @tab @samp{5224} @samp{5225}
14572 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
14573 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
14574 @item @samp{5249} @tab @samp{5249}
14575 @item @samp{5250} @tab @samp{5250}
14576 @item @samp{5271} @tab @samp{5270} @samp{5271}
14577 @item @samp{5272} @tab @samp{5272}
14578 @item @samp{5275} @tab @samp{5274} @samp{5275}
14579 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
14580 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
14581 @item @samp{5307} @tab @samp{5307}
14582 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
14583 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
14584 @item @samp{5407} @tab @samp{5407}
14585 @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}
14586 @end multitable
14588 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
14589 @var{arch} is compatible with @var{cpu}.  Other combinations of
14590 @option{-mcpu} and @option{-march} are rejected.
14592 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
14593 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
14594 where the value of @var{family} is given by the table above.
14596 @item -mtune=@var{tune}
14597 @opindex mtune
14598 Tune the code for a particular microarchitecture, within the
14599 constraints set by @option{-march} and @option{-mcpu}.
14600 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
14601 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
14602 and @samp{cpu32}.  The ColdFire microarchitectures
14603 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
14605 You can also use @option{-mtune=68020-40} for code that needs
14606 to run relatively well on 68020, 68030 and 68040 targets.
14607 @option{-mtune=68020-60} is similar but includes 68060 targets
14608 as well.  These two options select the same tuning decisions as
14609 @option{-m68020-40} and @option{-m68020-60} respectively.
14611 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
14612 when tuning for 680x0 architecture @var{arch}.  It also defines
14613 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
14614 option is used.  If gcc is tuning for a range of architectures,
14615 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
14616 it defines the macros for every architecture in the range.
14618 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
14619 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
14620 of the arguments given above.
14622 @item -m68000
14623 @itemx -mc68000
14624 @opindex m68000
14625 @opindex mc68000
14626 Generate output for a 68000.  This is the default
14627 when the compiler is configured for 68000-based systems.
14628 It is equivalent to @option{-march=68000}.
14630 Use this option for microcontrollers with a 68000 or EC000 core,
14631 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
14633 @item -m68010
14634 @opindex m68010
14635 Generate output for a 68010.  This is the default
14636 when the compiler is configured for 68010-based systems.
14637 It is equivalent to @option{-march=68010}.
14639 @item -m68020
14640 @itemx -mc68020
14641 @opindex m68020
14642 @opindex mc68020
14643 Generate output for a 68020.  This is the default
14644 when the compiler is configured for 68020-based systems.
14645 It is equivalent to @option{-march=68020}.
14647 @item -m68030
14648 @opindex m68030
14649 Generate output for a 68030.  This is the default when the compiler is
14650 configured for 68030-based systems.  It is equivalent to
14651 @option{-march=68030}.
14653 @item -m68040
14654 @opindex m68040
14655 Generate output for a 68040.  This is the default when the compiler is
14656 configured for 68040-based systems.  It is equivalent to
14657 @option{-march=68040}.
14659 This option inhibits the use of 68881/68882 instructions that have to be
14660 emulated by software on the 68040.  Use this option if your 68040 does not
14661 have code to emulate those instructions.
14663 @item -m68060
14664 @opindex m68060
14665 Generate output for a 68060.  This is the default when the compiler is
14666 configured for 68060-based systems.  It is equivalent to
14667 @option{-march=68060}.
14669 This option inhibits the use of 68020 and 68881/68882 instructions that
14670 have to be emulated by software on the 68060.  Use this option if your 68060
14671 does not have code to emulate those instructions.
14673 @item -mcpu32
14674 @opindex mcpu32
14675 Generate output for a CPU32.  This is the default
14676 when the compiler is configured for CPU32-based systems.
14677 It is equivalent to @option{-march=cpu32}.
14679 Use this option for microcontrollers with a
14680 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
14681 68336, 68340, 68341, 68349 and 68360.
14683 @item -m5200
14684 @opindex m5200
14685 Generate output for a 520X ColdFire CPU@.  This is the default
14686 when the compiler is configured for 520X-based systems.
14687 It is equivalent to @option{-mcpu=5206}, and is now deprecated
14688 in favor of that option.
14690 Use this option for microcontroller with a 5200 core, including
14691 the MCF5202, MCF5203, MCF5204 and MCF5206.
14693 @item -m5206e
14694 @opindex m5206e
14695 Generate output for a 5206e ColdFire CPU@.  The option is now
14696 deprecated in favor of the equivalent @option{-mcpu=5206e}.
14698 @item -m528x
14699 @opindex m528x
14700 Generate output for a member of the ColdFire 528X family.
14701 The option is now deprecated in favor of the equivalent
14702 @option{-mcpu=528x}.
14704 @item -m5307
14705 @opindex m5307
14706 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
14707 in favor of the equivalent @option{-mcpu=5307}.
14709 @item -m5407
14710 @opindex m5407
14711 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
14712 in favor of the equivalent @option{-mcpu=5407}.
14714 @item -mcfv4e
14715 @opindex mcfv4e
14716 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
14717 This includes use of hardware floating-point instructions.
14718 The option is equivalent to @option{-mcpu=547x}, and is now
14719 deprecated in favor of that option.
14721 @item -m68020-40
14722 @opindex m68020-40
14723 Generate output for a 68040, without using any of the new instructions.
14724 This results in code that can run relatively efficiently on either a
14725 68020/68881 or a 68030 or a 68040.  The generated code does use the
14726 68881 instructions that are emulated on the 68040.
14728 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
14730 @item -m68020-60
14731 @opindex m68020-60
14732 Generate output for a 68060, without using any of the new instructions.
14733 This results in code that can run relatively efficiently on either a
14734 68020/68881 or a 68030 or a 68040.  The generated code does use the
14735 68881 instructions that are emulated on the 68060.
14737 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
14739 @item -mhard-float
14740 @itemx -m68881
14741 @opindex mhard-float
14742 @opindex m68881
14743 Generate floating-point instructions.  This is the default for 68020
14744 and above, and for ColdFire devices that have an FPU@.  It defines the
14745 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
14746 on ColdFire targets.
14748 @item -msoft-float
14749 @opindex msoft-float
14750 Do not generate floating-point instructions; use library calls instead.
14751 This is the default for 68000, 68010, and 68832 targets.  It is also
14752 the default for ColdFire devices that have no FPU.
14754 @item -mdiv
14755 @itemx -mno-div
14756 @opindex mdiv
14757 @opindex mno-div
14758 Generate (do not generate) ColdFire hardware divide and remainder
14759 instructions.  If @option{-march} is used without @option{-mcpu},
14760 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
14761 architectures.  Otherwise, the default is taken from the target CPU
14762 (either the default CPU, or the one specified by @option{-mcpu}).  For
14763 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
14764 @option{-mcpu=5206e}.
14766 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
14768 @item -mshort
14769 @opindex mshort
14770 Consider type @code{int} to be 16 bits wide, like @code{short int}.
14771 Additionally, parameters passed on the stack are also aligned to a
14772 16-bit boundary even on targets whose API mandates promotion to 32-bit.
14774 @item -mno-short
14775 @opindex mno-short
14776 Do not consider type @code{int} to be 16 bits wide.  This is the default.
14778 @item -mnobitfield
14779 @itemx -mno-bitfield
14780 @opindex mnobitfield
14781 @opindex mno-bitfield
14782 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
14783 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
14785 @item -mbitfield
14786 @opindex mbitfield
14787 Do use the bit-field instructions.  The @option{-m68020} option implies
14788 @option{-mbitfield}.  This is the default if you use a configuration
14789 designed for a 68020.
14791 @item -mrtd
14792 @opindex mrtd
14793 Use a different function-calling convention, in which functions
14794 that take a fixed number of arguments return with the @code{rtd}
14795 instruction, which pops their arguments while returning.  This
14796 saves one instruction in the caller since there is no need to pop
14797 the arguments there.
14799 This calling convention is incompatible with the one normally
14800 used on Unix, so you cannot use it if you need to call libraries
14801 compiled with the Unix compiler.
14803 Also, you must provide function prototypes for all functions that
14804 take variable numbers of arguments (including @code{printf});
14805 otherwise incorrect code will be generated for calls to those
14806 functions.
14808 In addition, seriously incorrect code will result if you call a
14809 function with too many arguments.  (Normally, extra arguments are
14810 harmlessly ignored.)
14812 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
14813 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
14815 @item -mno-rtd
14816 @opindex mno-rtd
14817 Do not use the calling conventions selected by @option{-mrtd}.
14818 This is the default.
14820 @item -malign-int
14821 @itemx -mno-align-int
14822 @opindex malign-int
14823 @opindex mno-align-int
14824 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
14825 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
14826 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
14827 Aligning variables on 32-bit boundaries produces code that runs somewhat
14828 faster on processors with 32-bit busses at the expense of more memory.
14830 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
14831 align structures containing the above types  differently than
14832 most published application binary interface specifications for the m68k.
14834 @item -mpcrel
14835 @opindex mpcrel
14836 Use the pc-relative addressing mode of the 68000 directly, instead of
14837 using a global offset table.  At present, this option implies @option{-fpic},
14838 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
14839 not presently supported with @option{-mpcrel}, though this could be supported for
14840 68020 and higher processors.
14842 @item -mno-strict-align
14843 @itemx -mstrict-align
14844 @opindex mno-strict-align
14845 @opindex mstrict-align
14846 Do not (do) assume that unaligned memory references will be handled by
14847 the system.
14849 @item -msep-data
14850 Generate code that allows the data segment to be located in a different
14851 area of memory from the text segment.  This allows for execute in place in
14852 an environment without virtual memory management.  This option implies
14853 @option{-fPIC}.
14855 @item -mno-sep-data
14856 Generate code that assumes that the data segment follows the text segment.
14857 This is the default.
14859 @item -mid-shared-library
14860 Generate code that supports shared libraries via the library ID method.
14861 This allows for execute in place and shared libraries in an environment
14862 without virtual memory management.  This option implies @option{-fPIC}.
14864 @item -mno-id-shared-library
14865 Generate code that doesn't assume ID based shared libraries are being used.
14866 This is the default.
14868 @item -mshared-library-id=n
14869 Specified the identification number of the ID based shared library being
14870 compiled.  Specifying a value of 0 will generate more compact code, specifying
14871 other values will force the allocation of that number to the current
14872 library but is no more space or time efficient than omitting this option.
14874 @item -mxgot
14875 @itemx -mno-xgot
14876 @opindex mxgot
14877 @opindex mno-xgot
14878 When generating position-independent code for ColdFire, generate code
14879 that works if the GOT has more than 8192 entries.  This code is
14880 larger and slower than code generated without this option.  On M680x0
14881 processors, this option is not needed; @option{-fPIC} suffices.
14883 GCC normally uses a single instruction to load values from the GOT@.
14884 While this is relatively efficient, it only works if the GOT
14885 is smaller than about 64k.  Anything larger causes the linker
14886 to report an error such as:
14888 @cindex relocation truncated to fit (ColdFire)
14889 @smallexample
14890 relocation truncated to fit: R_68K_GOT16O foobar
14891 @end smallexample
14893 If this happens, you should recompile your code with @option{-mxgot}.
14894 It should then work with very large GOTs.  However, code generated with
14895 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
14896 the value of a global symbol.
14898 Note that some linkers, including newer versions of the GNU linker,
14899 can create multiple GOTs and sort GOT entries.  If you have such a linker,
14900 you should only need to use @option{-mxgot} when compiling a single
14901 object file that accesses more than 8192 GOT entries.  Very few do.
14903 These options have no effect unless GCC is generating
14904 position-independent code.
14906 @end table
14908 @node MCore Options
14909 @subsection MCore Options
14910 @cindex MCore options
14912 These are the @samp{-m} options defined for the Motorola M*Core
14913 processors.
14915 @table @gcctabopt
14917 @item -mhardlit
14918 @itemx -mno-hardlit
14919 @opindex mhardlit
14920 @opindex mno-hardlit
14921 Inline constants into the code stream if it can be done in two
14922 instructions or less.
14924 @item -mdiv
14925 @itemx -mno-div
14926 @opindex mdiv
14927 @opindex mno-div
14928 Use the divide instruction.  (Enabled by default).
14930 @item -mrelax-immediate
14931 @itemx -mno-relax-immediate
14932 @opindex mrelax-immediate
14933 @opindex mno-relax-immediate
14934 Allow arbitrary sized immediates in bit operations.
14936 @item -mwide-bitfields
14937 @itemx -mno-wide-bitfields
14938 @opindex mwide-bitfields
14939 @opindex mno-wide-bitfields
14940 Always treat bit-fields as int-sized.
14942 @item -m4byte-functions
14943 @itemx -mno-4byte-functions
14944 @opindex m4byte-functions
14945 @opindex mno-4byte-functions
14946 Force all functions to be aligned to a 4-byte boundary.
14948 @item -mcallgraph-data
14949 @itemx -mno-callgraph-data
14950 @opindex mcallgraph-data
14951 @opindex mno-callgraph-data
14952 Emit callgraph information.
14954 @item -mslow-bytes
14955 @itemx -mno-slow-bytes
14956 @opindex mslow-bytes
14957 @opindex mno-slow-bytes
14958 Prefer word access when reading byte quantities.
14960 @item -mlittle-endian
14961 @itemx -mbig-endian
14962 @opindex mlittle-endian
14963 @opindex mbig-endian
14964 Generate code for a little-endian target.
14966 @item -m210
14967 @itemx -m340
14968 @opindex m210
14969 @opindex m340
14970 Generate code for the 210 processor.
14972 @item -mno-lsim
14973 @opindex mno-lsim
14974 Assume that runtime support has been provided and so omit the
14975 simulator library (@file{libsim.a)} from the linker command line.
14977 @item -mstack-increment=@var{size}
14978 @opindex mstack-increment
14979 Set the maximum amount for a single stack increment operation.  Large
14980 values can increase the speed of programs that contain functions
14981 that need a large amount of stack space, but they can also trigger a
14982 segmentation fault if the stack is extended too much.  The default
14983 value is 0x1000.
14985 @end table
14987 @node MeP Options
14988 @subsection MeP Options
14989 @cindex MeP options
14991 @table @gcctabopt
14993 @item -mabsdiff
14994 @opindex mabsdiff
14995 Enables the @code{abs} instruction, which is the absolute difference
14996 between two registers.
14998 @item -mall-opts
14999 @opindex mall-opts
15000 Enables all the optional instructions - average, multiply, divide, bit
15001 operations, leading zero, absolute difference, min/max, clip, and
15002 saturation.
15005 @item -maverage
15006 @opindex maverage
15007 Enables the @code{ave} instruction, which computes the average of two
15008 registers.
15010 @item -mbased=@var{n}
15011 @opindex mbased=
15012 Variables of size @var{n} bytes or smaller will be placed in the
15013 @code{.based} section by default.  Based variables use the @code{$tp}
15014 register as a base register, and there is a 128-byte limit to the
15015 @code{.based} section.
15017 @item -mbitops
15018 @opindex mbitops
15019 Enables the bit operation instructions - bit test (@code{btstm}), set
15020 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
15021 test-and-set (@code{tas}).
15023 @item -mc=@var{name}
15024 @opindex mc=
15025 Selects which section constant data will be placed in.  @var{name} may
15026 be @code{tiny}, @code{near}, or @code{far}.
15028 @item -mclip
15029 @opindex mclip
15030 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
15031 useful unless you also provide @code{-mminmax}.
15033 @item -mconfig=@var{name}
15034 @opindex mconfig=
15035 Selects one of the build-in core configurations.  Each MeP chip has
15036 one or more modules in it; each module has a core CPU and a variety of
15037 coprocessors, optional instructions, and peripherals.  The
15038 @code{MeP-Integrator} tool, not part of GCC, provides these
15039 configurations through this option; using this option is the same as
15040 using all the corresponding command-line options.  The default
15041 configuration is @code{default}.
15043 @item -mcop
15044 @opindex mcop
15045 Enables the coprocessor instructions.  By default, this is a 32-bit
15046 coprocessor.  Note that the coprocessor is normally enabled via the
15047 @code{-mconfig=} option.
15049 @item -mcop32
15050 @opindex mcop32
15051 Enables the 32-bit coprocessor's instructions.
15053 @item -mcop64
15054 @opindex mcop64
15055 Enables the 64-bit coprocessor's instructions.
15057 @item -mivc2
15058 @opindex mivc2
15059 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
15061 @item -mdc
15062 @opindex mdc
15063 Causes constant variables to be placed in the @code{.near} section.
15065 @item -mdiv
15066 @opindex mdiv
15067 Enables the @code{div} and @code{divu} instructions.
15069 @item -meb
15070 @opindex meb
15071 Generate big-endian code.
15073 @item -mel
15074 @opindex mel
15075 Generate little-endian code.
15077 @item -mio-volatile
15078 @opindex mio-volatile
15079 Tells the compiler that any variable marked with the @code{io}
15080 attribute is to be considered volatile.
15082 @item -ml
15083 @opindex ml
15084 Causes variables to be assigned to the @code{.far} section by default.
15086 @item -mleadz
15087 @opindex mleadz
15088 Enables the @code{leadz} (leading zero) instruction.
15090 @item -mm
15091 @opindex mm
15092 Causes variables to be assigned to the @code{.near} section by default.
15094 @item -mminmax
15095 @opindex mminmax
15096 Enables the @code{min} and @code{max} instructions.
15098 @item -mmult
15099 @opindex mmult
15100 Enables the multiplication and multiply-accumulate instructions.
15102 @item -mno-opts
15103 @opindex mno-opts
15104 Disables all the optional instructions enabled by @code{-mall-opts}.
15106 @item -mrepeat
15107 @opindex mrepeat
15108 Enables the @code{repeat} and @code{erepeat} instructions, used for
15109 low-overhead looping.
15111 @item -ms
15112 @opindex ms
15113 Causes all variables to default to the @code{.tiny} section.  Note
15114 that there is a 65536-byte limit to this section.  Accesses to these
15115 variables use the @code{%gp} base register.
15117 @item -msatur
15118 @opindex msatur
15119 Enables the saturation instructions.  Note that the compiler does not
15120 currently generate these itself, but this option is included for
15121 compatibility with other tools, like @code{as}.
15123 @item -msdram
15124 @opindex msdram
15125 Link the SDRAM-based runtime instead of the default ROM-based runtime.
15127 @item -msim
15128 @opindex msim
15129 Link the simulator runtime libraries.
15131 @item -msimnovec
15132 @opindex msimnovec
15133 Link the simulator runtime libraries, excluding built-in support
15134 for reset and exception vectors and tables.
15136 @item -mtf
15137 @opindex mtf
15138 Causes all functions to default to the @code{.far} section.  Without
15139 this option, functions default to the @code{.near} section.
15141 @item -mtiny=@var{n}
15142 @opindex mtiny=
15143 Variables that are @var{n} bytes or smaller will be allocated to the
15144 @code{.tiny} section.  These variables use the @code{$gp} base
15145 register.  The default for this option is 4, but note that there's a
15146 65536-byte limit to the @code{.tiny} section.
15148 @end table
15150 @node MicroBlaze Options
15151 @subsection MicroBlaze Options
15152 @cindex MicroBlaze Options
15154 @table @gcctabopt
15156 @item -msoft-float
15157 @opindex msoft-float
15158 Use software emulation for floating point (default).
15160 @item -mhard-float
15161 @opindex mhard-float
15162 Use hardware floating-point instructions.
15164 @item -mmemcpy
15165 @opindex mmemcpy
15166 Do not optimize block moves, use @code{memcpy}.
15168 @item -mno-clearbss
15169 @opindex mno-clearbss
15170 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
15172 @item -mcpu=@var{cpu-type}
15173 @opindex mcpu=
15174 Use features of and schedule code for given CPU.
15175 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
15176 where @var{X} is a major version, @var{YY} is the minor version, and
15177 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
15178 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
15180 @item -mxl-soft-mul
15181 @opindex mxl-soft-mul
15182 Use software multiply emulation (default).
15184 @item -mxl-soft-div
15185 @opindex mxl-soft-div
15186 Use software emulation for divides (default).
15188 @item -mxl-barrel-shift
15189 @opindex mxl-barrel-shift
15190 Use the hardware barrel shifter.
15192 @item -mxl-pattern-compare
15193 @opindex mxl-pattern-compare
15194 Use pattern compare instructions.
15196 @item -msmall-divides
15197 @opindex msmall-divides
15198 Use table lookup optimization for small signed integer divisions.
15200 @item -mxl-stack-check
15201 @opindex mxl-stack-check
15202 This option is deprecated.  Use -fstack-check instead.
15204 @item -mxl-gp-opt
15205 @opindex mxl-gp-opt
15206 Use GP relative sdata/sbss sections.
15208 @item -mxl-multiply-high
15209 @opindex mxl-multiply-high
15210 Use multiply high instructions for high part of 32x32 multiply.
15212 @item -mxl-float-convert
15213 @opindex mxl-float-convert
15214 Use hardware floating-point conversion instructions.
15216 @item -mxl-float-sqrt
15217 @opindex mxl-float-sqrt
15218 Use hardware floating-point square root instruction.
15220 @item -mxl-mode-@var{app-model}
15221 Select application model @var{app-model}.  Valid models are
15222 @table @samp
15223 @item executable
15224 normal executable (default), uses startup code @file{crt0.o}.
15226 @item xmdstub
15227 for use with Xilinx Microprocessor Debugger (XMD) based
15228 software intrusive debug agent called xmdstub. This uses startup file
15229 @file{crt1.o} and sets the start address of the program to be 0x800.
15231 @item bootstrap
15232 for applications that are loaded using a bootloader.
15233 This model uses startup file @file{crt2.o} which does not contain a processor
15234 reset vector handler. This is suitable for transferring control on a
15235 processor reset to the bootloader rather than the application.
15237 @item novectors
15238 for applications that do not require any of the
15239 MicroBlaze vectors. This option may be useful for applications running
15240 within a monitoring application. This model uses @file{crt3.o} as a startup file.
15241 @end table
15243 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
15244 @option{-mxl-mode-@var{app-model}}.
15246 @end table
15248 @node MIPS Options
15249 @subsection MIPS Options
15250 @cindex MIPS options
15252 @table @gcctabopt
15254 @item -EB
15255 @opindex EB
15256 Generate big-endian code.
15258 @item -EL
15259 @opindex EL
15260 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
15261 configurations.
15263 @item -march=@var{arch}
15264 @opindex march
15265 Generate code that will run on @var{arch}, which can be the name of a
15266 generic MIPS ISA, or the name of a particular processor.
15267 The ISA names are:
15268 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
15269 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
15270 The processor names are:
15271 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
15272 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
15273 @samp{5kc}, @samp{5kf},
15274 @samp{20kc},
15275 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
15276 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
15277 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
15278 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
15279 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
15280 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
15281 @samp{m4k},
15282 @samp{octeon}, @samp{octeon+}, @samp{octeon2},
15283 @samp{orion},
15284 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
15285 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
15286 @samp{rm7000}, @samp{rm9000},
15287 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
15288 @samp{sb1},
15289 @samp{sr71000},
15290 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
15291 @samp{vr5000}, @samp{vr5400}, @samp{vr5500}
15292 and @samp{xlr}.
15293 The special value @samp{from-abi} selects the
15294 most compatible architecture for the selected ABI (that is,
15295 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
15297 Native Linux/GNU and IRIX toolchains also support the value @samp{native},
15298 which selects the best architecture option for the host processor.
15299 @option{-march=native} has no effect if GCC does not recognize
15300 the processor.
15302 In processor names, a final @samp{000} can be abbreviated as @samp{k}
15303 (for example, @samp{-march=r2k}).  Prefixes are optional, and
15304 @samp{vr} may be written @samp{r}.
15306 Names of the form @samp{@var{n}f2_1} refer to processors with
15307 FPUs clocked at half the rate of the core, names of the form
15308 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
15309 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
15310 processors with FPUs clocked a ratio of 3:2 with respect to the core.
15311 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
15312 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
15313 accepted as synonyms for @samp{@var{n}f1_1}.
15315 GCC defines two macros based on the value of this option.  The first
15316 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
15317 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
15318 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
15319 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
15320 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
15322 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
15323 above.  In other words, it will have the full prefix and will not
15324 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
15325 the macro names the resolved architecture (either @samp{"mips1"} or
15326 @samp{"mips3"}).  It names the default architecture when no
15327 @option{-march} option is given.
15329 @item -mtune=@var{arch}
15330 @opindex mtune
15331 Optimize for @var{arch}.  Among other things, this option controls
15332 the way instructions are scheduled, and the perceived cost of arithmetic
15333 operations.  The list of @var{arch} values is the same as for
15334 @option{-march}.
15336 When this option is not used, GCC will optimize for the processor
15337 specified by @option{-march}.  By using @option{-march} and
15338 @option{-mtune} together, it is possible to generate code that will
15339 run on a family of processors, but optimize the code for one
15340 particular member of that family.
15342 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
15343 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
15344 @samp{-march} ones described above.
15346 @item -mips1
15347 @opindex mips1
15348 Equivalent to @samp{-march=mips1}.
15350 @item -mips2
15351 @opindex mips2
15352 Equivalent to @samp{-march=mips2}.
15354 @item -mips3
15355 @opindex mips3
15356 Equivalent to @samp{-march=mips3}.
15358 @item -mips4
15359 @opindex mips4
15360 Equivalent to @samp{-march=mips4}.
15362 @item -mips32
15363 @opindex mips32
15364 Equivalent to @samp{-march=mips32}.
15366 @item -mips32r2
15367 @opindex mips32r2
15368 Equivalent to @samp{-march=mips32r2}.
15370 @item -mips64
15371 @opindex mips64
15372 Equivalent to @samp{-march=mips64}.
15374 @item -mips64r2
15375 @opindex mips64r2
15376 Equivalent to @samp{-march=mips64r2}.
15378 @item -mips16
15379 @itemx -mno-mips16
15380 @opindex mips16
15381 @opindex mno-mips16
15382 Generate (do not generate) MIPS16 code.  If GCC is targetting a
15383 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
15385 MIPS16 code generation can also be controlled on a per-function basis
15386 by means of @code{mips16} and @code{nomips16} attributes.
15387 @xref{Function Attributes}, for more information.
15389 @item -mflip-mips16
15390 @opindex mflip-mips16
15391 Generate MIPS16 code on alternating functions.  This option is provided
15392 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
15393 not intended for ordinary use in compiling user code.
15395 @item -minterlink-mips16
15396 @itemx -mno-interlink-mips16
15397 @opindex minterlink-mips16
15398 @opindex mno-interlink-mips16
15399 Require (do not require) that non-MIPS16 code be link-compatible with
15400 MIPS16 code.
15402 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
15403 it must either use a call or an indirect jump.  @option{-minterlink-mips16}
15404 therefore disables direct jumps unless GCC knows that the target of the
15405 jump is not MIPS16.
15407 @item -mabi=32
15408 @itemx -mabi=o64
15409 @itemx -mabi=n32
15410 @itemx -mabi=64
15411 @itemx -mabi=eabi
15412 @opindex mabi=32
15413 @opindex mabi=o64
15414 @opindex mabi=n32
15415 @opindex mabi=64
15416 @opindex mabi=eabi
15417 Generate code for the given ABI@.
15419 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
15420 generates 64-bit code when you select a 64-bit architecture, but you
15421 can use @option{-mgp32} to get 32-bit code instead.
15423 For information about the O64 ABI, see
15424 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
15426 GCC supports a variant of the o32 ABI in which floating-point registers
15427 are 64 rather than 32 bits wide.  You can select this combination with
15428 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
15429 and @samp{mfhc1} instructions and is therefore only supported for
15430 MIPS32R2 processors.
15432 The register assignments for arguments and return values remain the
15433 same, but each scalar value is passed in a single 64-bit register
15434 rather than a pair of 32-bit registers.  For example, scalar
15435 floating-point values are returned in @samp{$f0} only, not a
15436 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
15437 remains the same, but all 64 bits are saved.
15439 @item -mabicalls
15440 @itemx -mno-abicalls
15441 @opindex mabicalls
15442 @opindex mno-abicalls
15443 Generate (do not generate) code that is suitable for SVR4-style
15444 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
15445 systems.
15447 @item -mshared
15448 @itemx -mno-shared
15449 Generate (do not generate) code that is fully position-independent,
15450 and that can therefore be linked into shared libraries.  This option
15451 only affects @option{-mabicalls}.
15453 All @option{-mabicalls} code has traditionally been position-independent,
15454 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
15455 as an extension, the GNU toolchain allows executables to use absolute
15456 accesses for locally-binding symbols.  It can also use shorter GP
15457 initialization sequences and generate direct calls to locally-defined
15458 functions.  This mode is selected by @option{-mno-shared}.
15460 @option{-mno-shared} depends on binutils 2.16 or higher and generates
15461 objects that can only be linked by the GNU linker.  However, the option
15462 does not affect the ABI of the final executable; it only affects the ABI
15463 of relocatable objects.  Using @option{-mno-shared} will generally make
15464 executables both smaller and quicker.
15466 @option{-mshared} is the default.
15468 @item -mplt
15469 @itemx -mno-plt
15470 @opindex mplt
15471 @opindex mno-plt
15472 Assume (do not assume) that the static and dynamic linkers
15473 support PLTs and copy relocations.  This option only affects
15474 @samp{-mno-shared -mabicalls}.  For the n64 ABI, this option
15475 has no effect without @samp{-msym32}.
15477 You can make @option{-mplt} the default by configuring
15478 GCC with @option{--with-mips-plt}.  The default is
15479 @option{-mno-plt} otherwise.
15481 @item -mxgot
15482 @itemx -mno-xgot
15483 @opindex mxgot
15484 @opindex mno-xgot
15485 Lift (do not lift) the usual restrictions on the size of the global
15486 offset table.
15488 GCC normally uses a single instruction to load values from the GOT@.
15489 While this is relatively efficient, it will only work if the GOT
15490 is smaller than about 64k.  Anything larger will cause the linker
15491 to report an error such as:
15493 @cindex relocation truncated to fit (MIPS)
15494 @smallexample
15495 relocation truncated to fit: R_MIPS_GOT16 foobar
15496 @end smallexample
15498 If this happens, you should recompile your code with @option{-mxgot}.
15499 It should then work with very large GOTs, although it will also be
15500 less efficient, since it will take three instructions to fetch the
15501 value of a global symbol.
15503 Note that some linkers can create multiple GOTs.  If you have such a
15504 linker, you should only need to use @option{-mxgot} when a single object
15505 file accesses more than 64k's worth of GOT entries.  Very few do.
15507 These options have no effect unless GCC is generating position
15508 independent code.
15510 @item -mgp32
15511 @opindex mgp32
15512 Assume that general-purpose registers are 32 bits wide.
15514 @item -mgp64
15515 @opindex mgp64
15516 Assume that general-purpose registers are 64 bits wide.
15518 @item -mfp32
15519 @opindex mfp32
15520 Assume that floating-point registers are 32 bits wide.
15522 @item -mfp64
15523 @opindex mfp64
15524 Assume that floating-point registers are 64 bits wide.
15526 @item -mhard-float
15527 @opindex mhard-float
15528 Use floating-point coprocessor instructions.
15530 @item -msoft-float
15531 @opindex msoft-float
15532 Do not use floating-point coprocessor instructions.  Implement
15533 floating-point calculations using library calls instead.
15535 @item -msingle-float
15536 @opindex msingle-float
15537 Assume that the floating-point coprocessor only supports single-precision
15538 operations.
15540 @item -mdouble-float
15541 @opindex mdouble-float
15542 Assume that the floating-point coprocessor supports double-precision
15543 operations.  This is the default.
15545 @item -mllsc
15546 @itemx -mno-llsc
15547 @opindex mllsc
15548 @opindex mno-llsc
15549 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
15550 implement atomic memory built-in functions.  When neither option is
15551 specified, GCC will use the instructions if the target architecture
15552 supports them.
15554 @option{-mllsc} is useful if the runtime environment can emulate the
15555 instructions and @option{-mno-llsc} can be useful when compiling for
15556 nonstandard ISAs.  You can make either option the default by
15557 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
15558 respectively.  @option{--with-llsc} is the default for some
15559 configurations; see the installation documentation for details.
15561 @item -mdsp
15562 @itemx -mno-dsp
15563 @opindex mdsp
15564 @opindex mno-dsp
15565 Use (do not use) revision 1 of the MIPS DSP ASE@.
15566 @xref{MIPS DSP Built-in Functions}.  This option defines the
15567 preprocessor macro @samp{__mips_dsp}.  It also defines
15568 @samp{__mips_dsp_rev} to 1.
15570 @item -mdspr2
15571 @itemx -mno-dspr2
15572 @opindex mdspr2
15573 @opindex mno-dspr2
15574 Use (do not use) revision 2 of the MIPS DSP ASE@.
15575 @xref{MIPS DSP Built-in Functions}.  This option defines the
15576 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
15577 It also defines @samp{__mips_dsp_rev} to 2.
15579 @item -msmartmips
15580 @itemx -mno-smartmips
15581 @opindex msmartmips
15582 @opindex mno-smartmips
15583 Use (do not use) the MIPS SmartMIPS ASE.
15585 @item -mpaired-single
15586 @itemx -mno-paired-single
15587 @opindex mpaired-single
15588 @opindex mno-paired-single
15589 Use (do not use) paired-single floating-point instructions.
15590 @xref{MIPS Paired-Single Support}.  This option requires
15591 hardware floating-point support to be enabled.
15593 @item -mdmx
15594 @itemx -mno-mdmx
15595 @opindex mdmx
15596 @opindex mno-mdmx
15597 Use (do not use) MIPS Digital Media Extension instructions.
15598 This option can only be used when generating 64-bit code and requires
15599 hardware floating-point support to be enabled.
15601 @item -mips3d
15602 @itemx -mno-mips3d
15603 @opindex mips3d
15604 @opindex mno-mips3d
15605 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
15606 The option @option{-mips3d} implies @option{-mpaired-single}.
15608 @item -mmt
15609 @itemx -mno-mt
15610 @opindex mmt
15611 @opindex mno-mt
15612 Use (do not use) MT Multithreading instructions.
15614 @item -mlong64
15615 @opindex mlong64
15616 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
15617 an explanation of the default and the way that the pointer size is
15618 determined.
15620 @item -mlong32
15621 @opindex mlong32
15622 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
15624 The default size of @code{int}s, @code{long}s and pointers depends on
15625 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
15626 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
15627 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
15628 or the same size as integer registers, whichever is smaller.
15630 @item -msym32
15631 @itemx -mno-sym32
15632 @opindex msym32
15633 @opindex mno-sym32
15634 Assume (do not assume) that all symbols have 32-bit values, regardless
15635 of the selected ABI@.  This option is useful in combination with
15636 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
15637 to generate shorter and faster references to symbolic addresses.
15639 @item -G @var{num}
15640 @opindex G
15641 Put definitions of externally-visible data in a small data section
15642 if that data is no bigger than @var{num} bytes.  GCC can then access
15643 the data more efficiently; see @option{-mgpopt} for details.
15645 The default @option{-G} option depends on the configuration.
15647 @item -mlocal-sdata
15648 @itemx -mno-local-sdata
15649 @opindex mlocal-sdata
15650 @opindex mno-local-sdata
15651 Extend (do not extend) the @option{-G} behavior to local data too,
15652 such as to static variables in C@.  @option{-mlocal-sdata} is the
15653 default for all configurations.
15655 If the linker complains that an application is using too much small data,
15656 you might want to try rebuilding the less performance-critical parts with
15657 @option{-mno-local-sdata}.  You might also want to build large
15658 libraries with @option{-mno-local-sdata}, so that the libraries leave
15659 more room for the main program.
15661 @item -mextern-sdata
15662 @itemx -mno-extern-sdata
15663 @opindex mextern-sdata
15664 @opindex mno-extern-sdata
15665 Assume (do not assume) that externally-defined data will be in
15666 a small data section if that data is within the @option{-G} limit.
15667 @option{-mextern-sdata} is the default for all configurations.
15669 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
15670 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
15671 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
15672 is placed in a small data section.  If @var{Var} is defined by another
15673 module, you must either compile that module with a high-enough
15674 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
15675 definition.  If @var{Var} is common, you must link the application
15676 with a high-enough @option{-G} setting.
15678 The easiest way of satisfying these restrictions is to compile
15679 and link every module with the same @option{-G} option.  However,
15680 you may wish to build a library that supports several different
15681 small data limits.  You can do this by compiling the library with
15682 the highest supported @option{-G} setting and additionally using
15683 @option{-mno-extern-sdata} to stop the library from making assumptions
15684 about externally-defined data.
15686 @item -mgpopt
15687 @itemx -mno-gpopt
15688 @opindex mgpopt
15689 @opindex mno-gpopt
15690 Use (do not use) GP-relative accesses for symbols that are known to be
15691 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
15692 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
15693 configurations.
15695 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
15696 might not hold the value of @code{_gp}.  For example, if the code is
15697 part of a library that might be used in a boot monitor, programs that
15698 call boot monitor routines will pass an unknown value in @code{$gp}.
15699 (In such situations, the boot monitor itself would usually be compiled
15700 with @option{-G0}.)
15702 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
15703 @option{-mno-extern-sdata}.
15705 @item -membedded-data
15706 @itemx -mno-embedded-data
15707 @opindex membedded-data
15708 @opindex mno-embedded-data
15709 Allocate variables to the read-only data section first if possible, then
15710 next in the small data section if possible, otherwise in data.  This gives
15711 slightly slower code than the default, but reduces the amount of RAM required
15712 when executing, and thus may be preferred for some embedded systems.
15714 @item -muninit-const-in-rodata
15715 @itemx -mno-uninit-const-in-rodata
15716 @opindex muninit-const-in-rodata
15717 @opindex mno-uninit-const-in-rodata
15718 Put uninitialized @code{const} variables in the read-only data section.
15719 This option is only meaningful in conjunction with @option{-membedded-data}.
15721 @item -mcode-readable=@var{setting}
15722 @opindex mcode-readable
15723 Specify whether GCC may generate code that reads from executable sections.
15724 There are three possible settings:
15726 @table @gcctabopt
15727 @item -mcode-readable=yes
15728 Instructions may freely access executable sections.  This is the
15729 default setting.
15731 @item -mcode-readable=pcrel
15732 MIPS16 PC-relative load instructions can access executable sections,
15733 but other instructions must not do so.  This option is useful on 4KSc
15734 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
15735 It is also useful on processors that can be configured to have a dual
15736 instruction/data SRAM interface and that, like the M4K, automatically
15737 redirect PC-relative loads to the instruction RAM.
15739 @item -mcode-readable=no
15740 Instructions must not access executable sections.  This option can be
15741 useful on targets that are configured to have a dual instruction/data
15742 SRAM interface but that (unlike the M4K) do not automatically redirect
15743 PC-relative loads to the instruction RAM.
15744 @end table
15746 @item -msplit-addresses
15747 @itemx -mno-split-addresses
15748 @opindex msplit-addresses
15749 @opindex mno-split-addresses
15750 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
15751 relocation operators.  This option has been superseded by
15752 @option{-mexplicit-relocs} but is retained for backwards compatibility.
15754 @item -mexplicit-relocs
15755 @itemx -mno-explicit-relocs
15756 @opindex mexplicit-relocs
15757 @opindex mno-explicit-relocs
15758 Use (do not use) assembler relocation operators when dealing with symbolic
15759 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
15760 is to use assembler macros instead.
15762 @option{-mexplicit-relocs} is the default if GCC was configured
15763 to use an assembler that supports relocation operators.
15765 @item -mcheck-zero-division
15766 @itemx -mno-check-zero-division
15767 @opindex mcheck-zero-division
15768 @opindex mno-check-zero-division
15769 Trap (do not trap) on integer division by zero.
15771 The default is @option{-mcheck-zero-division}.
15773 @item -mdivide-traps
15774 @itemx -mdivide-breaks
15775 @opindex mdivide-traps
15776 @opindex mdivide-breaks
15777 MIPS systems check for division by zero by generating either a
15778 conditional trap or a break instruction.  Using traps results in
15779 smaller code, but is only supported on MIPS II and later.  Also, some
15780 versions of the Linux kernel have a bug that prevents trap from
15781 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
15782 allow conditional traps on architectures that support them and
15783 @option{-mdivide-breaks} to force the use of breaks.
15785 The default is usually @option{-mdivide-traps}, but this can be
15786 overridden at configure time using @option{--with-divide=breaks}.
15787 Divide-by-zero checks can be completely disabled using
15788 @option{-mno-check-zero-division}.
15790 @item -mmemcpy
15791 @itemx -mno-memcpy
15792 @opindex mmemcpy
15793 @opindex mno-memcpy
15794 Force (do not force) the use of @code{memcpy()} for non-trivial block
15795 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
15796 most constant-sized copies.
15798 @item -mlong-calls
15799 @itemx -mno-long-calls
15800 @opindex mlong-calls
15801 @opindex mno-long-calls
15802 Disable (do not disable) use of the @code{jal} instruction.  Calling
15803 functions using @code{jal} is more efficient but requires the caller
15804 and callee to be in the same 256 megabyte segment.
15806 This option has no effect on abicalls code.  The default is
15807 @option{-mno-long-calls}.
15809 @item -mmad
15810 @itemx -mno-mad
15811 @opindex mmad
15812 @opindex mno-mad
15813 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
15814 instructions, as provided by the R4650 ISA@.
15816 @item -mfused-madd
15817 @itemx -mno-fused-madd
15818 @opindex mfused-madd
15819 @opindex mno-fused-madd
15820 Enable (disable) use of the floating-point multiply-accumulate
15821 instructions, when they are available.  The default is
15822 @option{-mfused-madd}.
15824 When multiply-accumulate instructions are used, the intermediate
15825 product is calculated to infinite precision and is not subject to
15826 the FCSR Flush to Zero bit.  This may be undesirable in some
15827 circumstances.
15829 @item -nocpp
15830 @opindex nocpp
15831 Tell the MIPS assembler to not run its preprocessor over user
15832 assembler files (with a @samp{.s} suffix) when assembling them.
15834 @item -mfix-24k
15835 @item -mno-fix-24k
15836 @opindex mfix-24k
15837 @opindex mno-fix-24k
15838 Work around the 24K E48 (lost data on stores during refill) errata.
15839 The workarounds are implemented by the assembler rather than by GCC.
15841 @item -mfix-r4000
15842 @itemx -mno-fix-r4000
15843 @opindex mfix-r4000
15844 @opindex mno-fix-r4000
15845 Work around certain R4000 CPU errata:
15846 @itemize @minus
15847 @item
15848 A double-word or a variable shift may give an incorrect result if executed
15849 immediately after starting an integer division.
15850 @item
15851 A double-word or a variable shift may give an incorrect result if executed
15852 while an integer multiplication is in progress.
15853 @item
15854 An integer division may give an incorrect result if started in a delay slot
15855 of a taken branch or a jump.
15856 @end itemize
15858 @item -mfix-r4400
15859 @itemx -mno-fix-r4400
15860 @opindex mfix-r4400
15861 @opindex mno-fix-r4400
15862 Work around certain R4400 CPU errata:
15863 @itemize @minus
15864 @item
15865 A double-word or a variable shift may give an incorrect result if executed
15866 immediately after starting an integer division.
15867 @end itemize
15869 @item -mfix-r10000
15870 @itemx -mno-fix-r10000
15871 @opindex mfix-r10000
15872 @opindex mno-fix-r10000
15873 Work around certain R10000 errata:
15874 @itemize @minus
15875 @item
15876 @code{ll}/@code{sc} sequences may not behave atomically on revisions
15877 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
15878 @end itemize
15880 This option can only be used if the target architecture supports
15881 branch-likely instructions.  @option{-mfix-r10000} is the default when
15882 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
15883 otherwise.
15885 @item -mfix-vr4120
15886 @itemx -mno-fix-vr4120
15887 @opindex mfix-vr4120
15888 Work around certain VR4120 errata:
15889 @itemize @minus
15890 @item
15891 @code{dmultu} does not always produce the correct result.
15892 @item
15893 @code{div} and @code{ddiv} do not always produce the correct result if one
15894 of the operands is negative.
15895 @end itemize
15896 The workarounds for the division errata rely on special functions in
15897 @file{libgcc.a}.  At present, these functions are only provided by
15898 the @code{mips64vr*-elf} configurations.
15900 Other VR4120 errata require a nop to be inserted between certain pairs of
15901 instructions.  These errata are handled by the assembler, not by GCC itself.
15903 @item -mfix-vr4130
15904 @opindex mfix-vr4130
15905 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
15906 workarounds are implemented by the assembler rather than by GCC,
15907 although GCC will avoid using @code{mflo} and @code{mfhi} if the
15908 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
15909 instructions are available instead.
15911 @item -mfix-sb1
15912 @itemx -mno-fix-sb1
15913 @opindex mfix-sb1
15914 Work around certain SB-1 CPU core errata.
15915 (This flag currently works around the SB-1 revision 2
15916 ``F1'' and ``F2'' floating-point errata.)
15918 @item -mr10k-cache-barrier=@var{setting}
15919 @opindex mr10k-cache-barrier
15920 Specify whether GCC should insert cache barriers to avoid the
15921 side-effects of speculation on R10K processors.
15923 In common with many processors, the R10K tries to predict the outcome
15924 of a conditional branch and speculatively executes instructions from
15925 the ``taken'' branch.  It later aborts these instructions if the
15926 predicted outcome was wrong.  However, on the R10K, even aborted
15927 instructions can have side effects.
15929 This problem only affects kernel stores and, depending on the system,
15930 kernel loads.  As an example, a speculatively-executed store may load
15931 the target memory into cache and mark the cache line as dirty, even if
15932 the store itself is later aborted.  If a DMA operation writes to the
15933 same area of memory before the ``dirty'' line is flushed, the cached
15934 data will overwrite the DMA-ed data.  See the R10K processor manual
15935 for a full description, including other potential problems.
15937 One workaround is to insert cache barrier instructions before every memory
15938 access that might be speculatively executed and that might have side
15939 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
15940 controls GCC's implementation of this workaround.  It assumes that
15941 aborted accesses to any byte in the following regions will not have
15942 side effects:
15944 @enumerate
15945 @item
15946 the memory occupied by the current function's stack frame;
15948 @item
15949 the memory occupied by an incoming stack argument;
15951 @item
15952 the memory occupied by an object with a link-time-constant address.
15953 @end enumerate
15955 It is the kernel's responsibility to ensure that speculative
15956 accesses to these regions are indeed safe.
15958 If the input program contains a function declaration such as:
15960 @smallexample
15961 void foo (void);
15962 @end smallexample
15964 then the implementation of @code{foo} must allow @code{j foo} and
15965 @code{jal foo} to be executed speculatively.  GCC honors this
15966 restriction for functions it compiles itself.  It expects non-GCC
15967 functions (such as hand-written assembly code) to do the same.
15969 The option has three forms:
15971 @table @gcctabopt
15972 @item -mr10k-cache-barrier=load-store
15973 Insert a cache barrier before a load or store that might be
15974 speculatively executed and that might have side effects even
15975 if aborted.
15977 @item -mr10k-cache-barrier=store
15978 Insert a cache barrier before a store that might be speculatively
15979 executed and that might have side effects even if aborted.
15981 @item -mr10k-cache-barrier=none
15982 Disable the insertion of cache barriers.  This is the default setting.
15983 @end table
15985 @item -mflush-func=@var{func}
15986 @itemx -mno-flush-func
15987 @opindex mflush-func
15988 Specifies the function to call to flush the I and D caches, or to not
15989 call any such function.  If called, the function must take the same
15990 arguments as the common @code{_flush_func()}, that is, the address of the
15991 memory range for which the cache is being flushed, the size of the
15992 memory range, and the number 3 (to flush both caches).  The default
15993 depends on the target GCC was configured for, but commonly is either
15994 @samp{_flush_func} or @samp{__cpu_flush}.
15996 @item mbranch-cost=@var{num}
15997 @opindex mbranch-cost
15998 Set the cost of branches to roughly @var{num} ``simple'' instructions.
15999 This cost is only a heuristic and is not guaranteed to produce
16000 consistent results across releases.  A zero cost redundantly selects
16001 the default, which is based on the @option{-mtune} setting.
16003 @item -mbranch-likely
16004 @itemx -mno-branch-likely
16005 @opindex mbranch-likely
16006 @opindex mno-branch-likely
16007 Enable or disable use of Branch Likely instructions, regardless of the
16008 default for the selected architecture.  By default, Branch Likely
16009 instructions may be generated if they are supported by the selected
16010 architecture.  An exception is for the MIPS32 and MIPS64 architectures
16011 and processors that implement those architectures; for those, Branch
16012 Likely instructions will not be generated by default because the MIPS32
16013 and MIPS64 architectures specifically deprecate their use.
16015 @item -mfp-exceptions
16016 @itemx -mno-fp-exceptions
16017 @opindex mfp-exceptions
16018 Specifies whether FP exceptions are enabled.  This affects how we schedule
16019 FP instructions for some processors.  The default is that FP exceptions are
16020 enabled.
16022 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
16023 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
16024 FP pipe.
16026 @item -mvr4130-align
16027 @itemx -mno-vr4130-align
16028 @opindex mvr4130-align
16029 The VR4130 pipeline is two-way superscalar, but can only issue two
16030 instructions together if the first one is 8-byte aligned.  When this
16031 option is enabled, GCC will align pairs of instructions that it
16032 thinks should execute in parallel.
16034 This option only has an effect when optimizing for the VR4130.
16035 It normally makes code faster, but at the expense of making it bigger.
16036 It is enabled by default at optimization level @option{-O3}.
16038 @item -msynci
16039 @itemx -mno-synci
16040 @opindex msynci
16041 Enable (disable) generation of @code{synci} instructions on
16042 architectures that support it.  The @code{synci} instructions (if
16043 enabled) will be generated when @code{__builtin___clear_cache()} is
16044 compiled.
16046 This option defaults to @code{-mno-synci}, but the default can be
16047 overridden by configuring with @code{--with-synci}.
16049 When compiling code for single processor systems, it is generally safe
16050 to use @code{synci}.  However, on many multi-core (SMP) systems, it
16051 will not invalidate the instruction caches on all cores and may lead
16052 to undefined behavior.
16054 @item -mrelax-pic-calls
16055 @itemx -mno-relax-pic-calls
16056 @opindex mrelax-pic-calls
16057 Try to turn PIC calls that are normally dispatched via register
16058 @code{$25} into direct calls.  This is only possible if the linker can
16059 resolve the destination at link-time and if the destination is within
16060 range for a direct call.
16062 @option{-mrelax-pic-calls} is the default if GCC was configured to use
16063 an assembler and a linker that supports the @code{.reloc} assembly
16064 directive and @code{-mexplicit-relocs} is in effect.  With
16065 @code{-mno-explicit-relocs}, this optimization can be performed by the
16066 assembler and the linker alone without help from the compiler.
16068 @item -mmcount-ra-address
16069 @itemx -mno-mcount-ra-address
16070 @opindex mmcount-ra-address
16071 @opindex mno-mcount-ra-address
16072 Emit (do not emit) code that allows @code{_mcount} to modify the
16073 calling function's return address.  When enabled, this option extends
16074 the usual @code{_mcount} interface with a new @var{ra-address}
16075 parameter, which has type @code{intptr_t *} and is passed in register
16076 @code{$12}.  @code{_mcount} can then modify the return address by
16077 doing both of the following:
16078 @itemize
16079 @item
16080 Returning the new address in register @code{$31}.
16081 @item
16082 Storing the new address in @code{*@var{ra-address}},
16083 if @var{ra-address} is nonnull.
16084 @end itemize
16086 The default is @option{-mno-mcount-ra-address}.
16088 @end table
16090 @node MMIX Options
16091 @subsection MMIX Options
16092 @cindex MMIX Options
16094 These options are defined for the MMIX:
16096 @table @gcctabopt
16097 @item -mlibfuncs
16098 @itemx -mno-libfuncs
16099 @opindex mlibfuncs
16100 @opindex mno-libfuncs
16101 Specify that intrinsic library functions are being compiled, passing all
16102 values in registers, no matter the size.
16104 @item -mepsilon
16105 @itemx -mno-epsilon
16106 @opindex mepsilon
16107 @opindex mno-epsilon
16108 Generate floating-point comparison instructions that compare with respect
16109 to the @code{rE} epsilon register.
16111 @item -mabi=mmixware
16112 @itemx -mabi=gnu
16113 @opindex mabi=mmixware
16114 @opindex mabi=gnu
16115 Generate code that passes function parameters and return values that (in
16116 the called function) are seen as registers @code{$0} and up, as opposed to
16117 the GNU ABI which uses global registers @code{$231} and up.
16119 @item -mzero-extend
16120 @itemx -mno-zero-extend
16121 @opindex mzero-extend
16122 @opindex mno-zero-extend
16123 When reading data from memory in sizes shorter than 64 bits, use (do not
16124 use) zero-extending load instructions by default, rather than
16125 sign-extending ones.
16127 @item -mknuthdiv
16128 @itemx -mno-knuthdiv
16129 @opindex mknuthdiv
16130 @opindex mno-knuthdiv
16131 Make the result of a division yielding a remainder have the same sign as
16132 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
16133 remainder follows the sign of the dividend.  Both methods are
16134 arithmetically valid, the latter being almost exclusively used.
16136 @item -mtoplevel-symbols
16137 @itemx -mno-toplevel-symbols
16138 @opindex mtoplevel-symbols
16139 @opindex mno-toplevel-symbols
16140 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
16141 code can be used with the @code{PREFIX} assembly directive.
16143 @item -melf
16144 @opindex melf
16145 Generate an executable in the ELF format, rather than the default
16146 @samp{mmo} format used by the @command{mmix} simulator.
16148 @item -mbranch-predict
16149 @itemx -mno-branch-predict
16150 @opindex mbranch-predict
16151 @opindex mno-branch-predict
16152 Use (do not use) the probable-branch instructions, when static branch
16153 prediction indicates a probable branch.
16155 @item -mbase-addresses
16156 @itemx -mno-base-addresses
16157 @opindex mbase-addresses
16158 @opindex mno-base-addresses
16159 Generate (do not generate) code that uses @emph{base addresses}.  Using a
16160 base address automatically generates a request (handled by the assembler
16161 and the linker) for a constant to be set up in a global register.  The
16162 register is used for one or more base address requests within the range 0
16163 to 255 from the value held in the register.  The generally leads to short
16164 and fast code, but the number of different data items that can be
16165 addressed is limited.  This means that a program that uses lots of static
16166 data may require @option{-mno-base-addresses}.
16168 @item -msingle-exit
16169 @itemx -mno-single-exit
16170 @opindex msingle-exit
16171 @opindex mno-single-exit
16172 Force (do not force) generated code to have a single exit point in each
16173 function.
16174 @end table
16176 @node MN10300 Options
16177 @subsection MN10300 Options
16178 @cindex MN10300 options
16180 These @option{-m} options are defined for Matsushita MN10300 architectures:
16182 @table @gcctabopt
16183 @item -mmult-bug
16184 @opindex mmult-bug
16185 Generate code to avoid bugs in the multiply instructions for the MN10300
16186 processors.  This is the default.
16188 @item -mno-mult-bug
16189 @opindex mno-mult-bug
16190 Do not generate code to avoid bugs in the multiply instructions for the
16191 MN10300 processors.
16193 @item -mam33
16194 @opindex mam33
16195 Generate code using features specific to the AM33 processor.
16197 @item -mno-am33
16198 @opindex mno-am33
16199 Do not generate code using features specific to the AM33 processor.  This
16200 is the default.
16202 @item -mam33-2
16203 @opindex mam33-2
16204 Generate code using features specific to the AM33/2.0 processor.
16206 @item -mam34
16207 @opindex mam34
16208 Generate code using features specific to the AM34 processor.
16210 @item -mtune=@var{cpu-type}
16211 @opindex mtune
16212 Use the timing characteristics of the indicated CPU type when
16213 scheduling instructions.  This does not change the targeted processor
16214 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
16215 @samp{am33-2} or @samp{am34}.
16217 @item -mreturn-pointer-on-d0
16218 @opindex mreturn-pointer-on-d0
16219 When generating a function that returns a pointer, return the pointer
16220 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
16221 only in a0, and attempts to call such functions without a prototype
16222 would result in errors.  Note that this option is on by default; use
16223 @option{-mno-return-pointer-on-d0} to disable it.
16225 @item -mno-crt0
16226 @opindex mno-crt0
16227 Do not link in the C run-time initialization object file.
16229 @item -mrelax
16230 @opindex mrelax
16231 Indicate to the linker that it should perform a relaxation optimization pass
16232 to shorten branches, calls and absolute memory addresses.  This option only
16233 has an effect when used on the command line for the final link step.
16235 This option makes symbolic debugging impossible.
16237 @item -mliw
16238 @opindex mliw
16239 Allow the compiler to generate @emph{Long Instruction Word}
16240 instructions if the target is the @samp{AM33} or later.  This is the
16241 default.  This option defines the preprocessor macro @samp{__LIW__}.
16243 @item -mnoliw
16244 @opindex mnoliw
16245 Do not allow the compiler to generate @emph{Long Instruction Word}
16246 instructions.  This option defines the preprocessor macro
16247 @samp{__NO_LIW__}.
16249 @item -msetlb
16250 @opindex msetlb
16251 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
16252 instructions if the target is the @samp{AM33} or later.  This is the
16253 default.  This option defines the preprocessor macro @samp{__SETLB__}.
16255 @item -mnosetlb
16256 @opindex mnosetlb
16257 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
16258 instructions.  This option defines the preprocessor macro
16259 @samp{__NO_SETLB__}.
16261 @end table
16263 @node PDP-11 Options
16264 @subsection PDP-11 Options
16265 @cindex PDP-11 Options
16267 These options are defined for the PDP-11:
16269 @table @gcctabopt
16270 @item -mfpu
16271 @opindex mfpu
16272 Use hardware FPP floating point.  This is the default.  (FIS floating
16273 point on the PDP-11/40 is not supported.)
16275 @item -msoft-float
16276 @opindex msoft-float
16277 Do not use hardware floating point.
16279 @item -mac0
16280 @opindex mac0
16281 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
16283 @item -mno-ac0
16284 @opindex mno-ac0
16285 Return floating-point results in memory.  This is the default.
16287 @item -m40
16288 @opindex m40
16289 Generate code for a PDP-11/40.
16291 @item -m45
16292 @opindex m45
16293 Generate code for a PDP-11/45.  This is the default.
16295 @item -m10
16296 @opindex m10
16297 Generate code for a PDP-11/10.
16299 @item -mbcopy-builtin
16300 @opindex mbcopy-builtin
16301 Use inline @code{movmemhi} patterns for copying memory.  This is the
16302 default.
16304 @item -mbcopy
16305 @opindex mbcopy
16306 Do not use inline @code{movmemhi} patterns for copying memory.
16308 @item -mint16
16309 @itemx -mno-int32
16310 @opindex mint16
16311 @opindex mno-int32
16312 Use 16-bit @code{int}.  This is the default.
16314 @item -mint32
16315 @itemx -mno-int16
16316 @opindex mint32
16317 @opindex mno-int16
16318 Use 32-bit @code{int}.
16320 @item -mfloat64
16321 @itemx -mno-float32
16322 @opindex mfloat64
16323 @opindex mno-float32
16324 Use 64-bit @code{float}.  This is the default.
16326 @item -mfloat32
16327 @itemx -mno-float64
16328 @opindex mfloat32
16329 @opindex mno-float64
16330 Use 32-bit @code{float}.
16332 @item -mabshi
16333 @opindex mabshi
16334 Use @code{abshi2} pattern.  This is the default.
16336 @item -mno-abshi
16337 @opindex mno-abshi
16338 Do not use @code{abshi2} pattern.
16340 @item -mbranch-expensive
16341 @opindex mbranch-expensive
16342 Pretend that branches are expensive.  This is for experimenting with
16343 code generation only.
16345 @item -mbranch-cheap
16346 @opindex mbranch-cheap
16347 Do not pretend that branches are expensive.  This is the default.
16349 @item -munix-asm
16350 @opindex munix-asm
16351 Use Unix assembler syntax.  This is the default when configured for
16352 @samp{pdp11-*-bsd}.
16354 @item -mdec-asm
16355 @opindex mdec-asm
16356 Use DEC assembler syntax.  This is the default when configured for any
16357 PDP-11 target other than @samp{pdp11-*-bsd}.
16358 @end table
16360 @node picoChip Options
16361 @subsection picoChip Options
16362 @cindex picoChip options
16364 These @samp{-m} options are defined for picoChip implementations:
16366 @table @gcctabopt
16368 @item -mae=@var{ae_type}
16369 @opindex mcpu
16370 Set the instruction set, register set, and instruction scheduling
16371 parameters for array element type @var{ae_type}.  Supported values
16372 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
16374 @option{-mae=ANY} selects a completely generic AE type.  Code
16375 generated with this option will run on any of the other AE types.  The
16376 code will not be as efficient as it would be if compiled for a specific
16377 AE type, and some types of operation (e.g., multiplication) will not
16378 work properly on all types of AE.
16380 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
16381 for compiled code, and is the default.
16383 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
16384 option may suffer from poor performance of byte (char) manipulation,
16385 since the DSP AE does not provide hardware support for byte load/stores.
16387 @item -msymbol-as-address
16388 Enable the compiler to directly use a symbol name as an address in a
16389 load/store instruction, without first loading it into a
16390 register.  Typically, the use of this option will generate larger
16391 programs, which run faster than when the option isn't used.  However, the
16392 results vary from program to program, so it is left as a user option,
16393 rather than being permanently enabled.
16395 @item -mno-inefficient-warnings
16396 Disables warnings about the generation of inefficient code.  These
16397 warnings can be generated, for example, when compiling code that
16398 performs byte-level memory operations on the MAC AE type.  The MAC AE has
16399 no hardware support for byte-level memory operations, so all byte
16400 load/stores must be synthesized from word load/store operations.  This is
16401 inefficient and a warning will be generated indicating to the programmer
16402 that they should rewrite the code to avoid byte operations, or to target
16403 an AE type that has the necessary hardware support.  This option enables
16404 the warning to be turned off.
16406 @end table
16408 @node PowerPC Options
16409 @subsection PowerPC Options
16410 @cindex PowerPC options
16412 These are listed under @xref{RS/6000 and PowerPC Options}.
16414 @node RL78 Options
16415 @subsection RL78 Options
16416 @cindex RL78 Options
16418 @table @gcctabopt
16420 @item -msim
16421 @opindex msim
16422 Links in additional target libraries to support operation within a
16423 simulator.
16425 @item -mmul=none
16426 @itemx -mmul=g13
16427 @itemx -mmul=rl78
16428 @opindex mmul
16429 Specifies the type of hardware multiplication support to be used.  The
16430 default is @code{none}, which uses software multiplication functions.
16431 The @code{g13} option is for the hardware multiply/divide peripheral
16432 only on the RL78/G13 targets.  The @code{rl78} option is for the
16433 standard hardware multiplication defined in the RL78 software manual.
16435 @end table
16437 @node RS/6000 and PowerPC Options
16438 @subsection IBM RS/6000 and PowerPC Options
16439 @cindex RS/6000 and PowerPC Options
16440 @cindex IBM RS/6000 and PowerPC Options
16442 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
16443 @table @gcctabopt
16444 @item -mpower
16445 @itemx -mno-power
16446 @itemx -mpower2
16447 @itemx -mno-power2
16448 @itemx -mpowerpc
16449 @itemx -mno-powerpc
16450 @itemx -mpowerpc-gpopt
16451 @itemx -mno-powerpc-gpopt
16452 @itemx -mpowerpc-gfxopt
16453 @itemx -mno-powerpc-gfxopt
16454 @need 800
16455 @itemx -mpowerpc64
16456 @itemx -mno-powerpc64
16457 @itemx -mmfcrf
16458 @itemx -mno-mfcrf
16459 @itemx -mpopcntb
16460 @itemx -mno-popcntb
16461 @itemx -mpopcntd
16462 @itemx -mno-popcntd
16463 @itemx -mfprnd
16464 @itemx -mno-fprnd
16465 @need 800
16466 @itemx -mcmpb
16467 @itemx -mno-cmpb
16468 @itemx -mmfpgpr
16469 @itemx -mno-mfpgpr
16470 @itemx -mhard-dfp
16471 @itemx -mno-hard-dfp
16472 @opindex mpower
16473 @opindex mno-power
16474 @opindex mpower2
16475 @opindex mno-power2
16476 @opindex mpowerpc
16477 @opindex mno-powerpc
16478 @opindex mpowerpc-gpopt
16479 @opindex mno-powerpc-gpopt
16480 @opindex mpowerpc-gfxopt
16481 @opindex mno-powerpc-gfxopt
16482 @opindex mpowerpc64
16483 @opindex mno-powerpc64
16484 @opindex mmfcrf
16485 @opindex mno-mfcrf
16486 @opindex mpopcntb
16487 @opindex mno-popcntb
16488 @opindex mpopcntd
16489 @opindex mno-popcntd
16490 @opindex mfprnd
16491 @opindex mno-fprnd
16492 @opindex mcmpb
16493 @opindex mno-cmpb
16494 @opindex mmfpgpr
16495 @opindex mno-mfpgpr
16496 @opindex mhard-dfp
16497 @opindex mno-hard-dfp
16498 GCC supports two related instruction set architectures for the
16499 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
16500 instructions supported by the @samp{rios} chip set used in the original
16501 RS/6000 systems and the @dfn{PowerPC} instruction set is the
16502 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
16503 the IBM 4xx, 6xx, and follow-on microprocessors.
16505 Neither architecture is a subset of the other.  However there is a
16506 large common subset of instructions supported by both.  An MQ
16507 register is included in processors supporting the POWER architecture.
16509 You use these options to specify which instructions are available on the
16510 processor you are using.  The default value of these options is
16511 determined when configuring GCC@.  Specifying the
16512 @option{-mcpu=@var{cpu_type}} overrides the specification of these
16513 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
16514 rather than the options listed above.
16516 The @option{-mpower} option allows GCC to generate instructions that
16517 are found only in the POWER architecture and to use the MQ register.
16518 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
16519 to generate instructions that are present in the POWER2 architecture but
16520 not the original POWER architecture.
16522 The @option{-mpowerpc} option allows GCC to generate instructions that
16523 are found only in the 32-bit subset of the PowerPC architecture.
16524 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
16525 GCC to use the optional PowerPC architecture instructions in the
16526 General Purpose group, including floating-point square root.  Specifying
16527 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
16528 use the optional PowerPC architecture instructions in the Graphics
16529 group, including floating-point select.
16531 The @option{-mmfcrf} option allows GCC to generate the move from
16532 condition register field instruction implemented on the POWER4
16533 processor and other processors that support the PowerPC V2.01
16534 architecture.
16535 The @option{-mpopcntb} option allows GCC to generate the popcount and
16536 double-precision FP reciprocal estimate instruction implemented on the
16537 POWER5 processor and other processors that support the PowerPC V2.02
16538 architecture.
16539 The @option{-mpopcntd} option allows GCC to generate the popcount
16540 instruction implemented on the POWER7 processor and other processors
16541 that support the PowerPC V2.06 architecture.
16542 The @option{-mfprnd} option allows GCC to generate the FP round to
16543 integer instructions implemented on the POWER5+ processor and other
16544 processors that support the PowerPC V2.03 architecture.
16545 The @option{-mcmpb} option allows GCC to generate the compare bytes
16546 instruction implemented on the POWER6 processor and other processors
16547 that support the PowerPC V2.05 architecture.
16548 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
16549 general-purpose register instructions implemented on the POWER6X
16550 processor and other processors that support the extended PowerPC V2.05
16551 architecture.
16552 The @option{-mhard-dfp} option allows GCC to generate the decimal
16553 floating-point instructions implemented on some POWER processors.
16555 The @option{-mpowerpc64} option allows GCC to generate the additional
16556 64-bit instructions that are found in the full PowerPC64 architecture
16557 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
16558 @option{-mno-powerpc64}.
16560 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
16561 will use only the instructions in the common subset of both
16562 architectures plus some special AIX common-mode calls, and will not use
16563 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
16564 permits GCC to use any instruction from either architecture and to
16565 allow use of the MQ register; specify this for the Motorola MPC601.
16567 @item -mnew-mnemonics
16568 @itemx -mold-mnemonics
16569 @opindex mnew-mnemonics
16570 @opindex mold-mnemonics
16571 Select which mnemonics to use in the generated assembler code.  With
16572 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
16573 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
16574 assembler mnemonics defined for the POWER architecture.  Instructions
16575 defined in only one architecture have only one mnemonic; GCC uses that
16576 mnemonic irrespective of which of these options is specified.
16578 GCC defaults to the mnemonics appropriate for the architecture in
16579 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
16580 value of these option.  Unless you are building a cross-compiler, you
16581 should normally not specify either @option{-mnew-mnemonics} or
16582 @option{-mold-mnemonics}, but should instead accept the default.
16584 @item -mcpu=@var{cpu_type}
16585 @opindex mcpu
16586 Set architecture type, register usage, choice of mnemonics, and
16587 instruction scheduling parameters for machine type @var{cpu_type}.
16588 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
16589 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
16590 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
16591 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
16592 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
16593 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
16594 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{ec603e}, @samp{G3},
16595 @samp{G4}, @samp{G5}, @samp{titan}, @samp{power}, @samp{power2}, @samp{power3},
16596 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x},
16597 @samp{power7}, @samp{common}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
16598 @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
16600 @option{-mcpu=common} selects a completely generic processor.  Code
16601 generated under this option will run on any POWER or PowerPC processor.
16602 GCC will use only the instructions in the common subset of both
16603 architectures, and will not use the MQ register.  GCC assumes a generic
16604 processor model for scheduling purposes.
16606 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
16607 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
16608 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
16609 types, with an appropriate, generic processor model assumed for
16610 scheduling purposes.
16612 The other options specify a specific processor.  Code generated under
16613 those options will run best on that processor, and may not run at all on
16614 others.
16616 The @option{-mcpu} options automatically enable or disable the
16617 following options:
16619 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
16620 -mnew-mnemonics  -mpopcntb -mpopcntd  -mpower  -mpower2  -mpowerpc64 @gol
16621 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
16622 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx}
16624 The particular options set for any particular CPU will vary between
16625 compiler versions, depending on what setting seems to produce optimal
16626 code for that CPU; it doesn't necessarily reflect the actual hardware's
16627 capabilities.  If you wish to set an individual option to a particular
16628 value, you may specify it after the @option{-mcpu} option, like
16629 @samp{-mcpu=970 -mno-altivec}.
16631 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
16632 not enabled or disabled by the @option{-mcpu} option at present because
16633 AIX does not have full support for these options.  You may still
16634 enable or disable them individually if you're sure it'll work in your
16635 environment.
16637 @item -mtune=@var{cpu_type}
16638 @opindex mtune
16639 Set the instruction scheduling parameters for machine type
16640 @var{cpu_type}, but do not set the architecture type, register usage, or
16641 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
16642 values for @var{cpu_type} are used for @option{-mtune} as for
16643 @option{-mcpu}.  If both are specified, the code generated will use the
16644 architecture, registers, and mnemonics set by @option{-mcpu}, but the
16645 scheduling parameters set by @option{-mtune}.
16647 @item -mcmodel=small
16648 @opindex mcmodel=small
16649 Generate PowerPC64 code for the small model: The TOC is limited to
16650 64k.
16652 @item -mcmodel=medium
16653 @opindex mcmodel=medium
16654 Generate PowerPC64 code for the medium model: The TOC and other static
16655 data may be up to a total of 4G in size.
16657 @item -mcmodel=large
16658 @opindex mcmodel=large
16659 Generate PowerPC64 code for the large model: The TOC may be up to 4G
16660 in size.  Other data and code is only limited by the 64-bit address
16661 space.
16663 @item -maltivec
16664 @itemx -mno-altivec
16665 @opindex maltivec
16666 @opindex mno-altivec
16667 Generate code that uses (does not use) AltiVec instructions, and also
16668 enable the use of built-in functions that allow more direct access to
16669 the AltiVec instruction set.  You may also need to set
16670 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
16671 enhancements.
16673 @item -mvrsave
16674 @itemx -mno-vrsave
16675 @opindex mvrsave
16676 @opindex mno-vrsave
16677 Generate VRSAVE instructions when generating AltiVec code.
16679 @item -mgen-cell-microcode
16680 @opindex mgen-cell-microcode
16681 Generate Cell microcode instructions
16683 @item -mwarn-cell-microcode
16684 @opindex mwarn-cell-microcode
16685 Warning when a Cell microcode instruction is going to emitted.  An example
16686 of a Cell microcode instruction is a variable shift.
16688 @item -msecure-plt
16689 @opindex msecure-plt
16690 Generate code that allows ld and ld.so to build executables and shared
16691 libraries with non-exec .plt and .got sections.  This is a PowerPC
16692 32-bit SYSV ABI option.
16694 @item -mbss-plt
16695 @opindex mbss-plt
16696 Generate code that uses a BSS .plt section that ld.so fills in, and
16697 requires .plt and .got sections that are both writable and executable.
16698 This is a PowerPC 32-bit SYSV ABI option.
16700 @item -misel
16701 @itemx -mno-isel
16702 @opindex misel
16703 @opindex mno-isel
16704 This switch enables or disables the generation of ISEL instructions.
16706 @item -misel=@var{yes/no}
16707 This switch has been deprecated.  Use @option{-misel} and
16708 @option{-mno-isel} instead.
16710 @item -mspe
16711 @itemx -mno-spe
16712 @opindex mspe
16713 @opindex mno-spe
16714 This switch enables or disables the generation of SPE simd
16715 instructions.
16717 @item -mpaired
16718 @itemx -mno-paired
16719 @opindex mpaired
16720 @opindex mno-paired
16721 This switch enables or disables the generation of PAIRED simd
16722 instructions.
16724 @item -mspe=@var{yes/no}
16725 This option has been deprecated.  Use @option{-mspe} and
16726 @option{-mno-spe} instead.
16728 @item -mvsx
16729 @itemx -mno-vsx
16730 @opindex mvsx
16731 @opindex mno-vsx
16732 Generate code that uses (does not use) vector/scalar (VSX)
16733 instructions, and also enable the use of built-in functions that allow
16734 more direct access to the VSX instruction set.
16736 @item -mfloat-gprs=@var{yes/single/double/no}
16737 @itemx -mfloat-gprs
16738 @opindex mfloat-gprs
16739 This switch enables or disables the generation of floating-point
16740 operations on the general-purpose registers for architectures that
16741 support it.
16743 The argument @var{yes} or @var{single} enables the use of
16744 single-precision floating-point operations.
16746 The argument @var{double} enables the use of single and
16747 double-precision floating-point operations.
16749 The argument @var{no} disables floating-point operations on the
16750 general-purpose registers.
16752 This option is currently only available on the MPC854x.
16754 @item -m32
16755 @itemx -m64
16756 @opindex m32
16757 @opindex m64
16758 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
16759 targets (including GNU/Linux).  The 32-bit environment sets int, long
16760 and pointer to 32 bits and generates code that runs on any PowerPC
16761 variant.  The 64-bit environment sets int to 32 bits and long and
16762 pointer to 64 bits, and generates code for PowerPC64, as for
16763 @option{-mpowerpc64}.
16765 @item -mfull-toc
16766 @itemx -mno-fp-in-toc
16767 @itemx -mno-sum-in-toc
16768 @itemx -mminimal-toc
16769 @opindex mfull-toc
16770 @opindex mno-fp-in-toc
16771 @opindex mno-sum-in-toc
16772 @opindex mminimal-toc
16773 Modify generation of the TOC (Table Of Contents), which is created for
16774 every executable file.  The @option{-mfull-toc} option is selected by
16775 default.  In that case, GCC will allocate at least one TOC entry for
16776 each unique non-automatic variable reference in your program.  GCC
16777 will also place floating-point constants in the TOC@.  However, only
16778 16,384 entries are available in the TOC@.
16780 If you receive a linker error message that saying you have overflowed
16781 the available TOC space, you can reduce the amount of TOC space used
16782 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
16783 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
16784 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
16785 generate code to calculate the sum of an address and a constant at
16786 run time instead of putting that sum into the TOC@.  You may specify one
16787 or both of these options.  Each causes GCC to produce very slightly
16788 slower and larger code at the expense of conserving TOC space.
16790 If you still run out of space in the TOC even when you specify both of
16791 these options, specify @option{-mminimal-toc} instead.  This option causes
16792 GCC to make only one TOC entry for every file.  When you specify this
16793 option, GCC will produce code that is slower and larger but which
16794 uses extremely little TOC space.  You may wish to use this option
16795 only on files that contain less frequently executed code.
16797 @item -maix64
16798 @itemx -maix32
16799 @opindex maix64
16800 @opindex maix32
16801 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
16802 @code{long} type, and the infrastructure needed to support them.
16803 Specifying @option{-maix64} implies @option{-mpowerpc64} and
16804 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
16805 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
16807 @item -mxl-compat
16808 @itemx -mno-xl-compat
16809 @opindex mxl-compat
16810 @opindex mno-xl-compat
16811 Produce code that conforms more closely to IBM XL compiler semantics
16812 when using AIX-compatible ABI@.  Pass floating-point arguments to
16813 prototyped functions beyond the register save area (RSA) on the stack
16814 in addition to argument FPRs.  Do not assume that most significant
16815 double in 128-bit long double value is properly rounded when comparing
16816 values and converting to double.  Use XL symbol names for long double
16817 support routines.
16819 The AIX calling convention was extended but not initially documented to
16820 handle an obscure K&R C case of calling a function that takes the
16821 address of its arguments with fewer arguments than declared.  IBM XL
16822 compilers access floating-point arguments that do not fit in the
16823 RSA from the stack when a subroutine is compiled without
16824 optimization.  Because always storing floating-point arguments on the
16825 stack is inefficient and rarely needed, this option is not enabled by
16826 default and only is necessary when calling subroutines compiled by IBM
16827 XL compilers without optimization.
16829 @item -mpe
16830 @opindex mpe
16831 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
16832 application written to use message passing with special startup code to
16833 enable the application to run.  The system must have PE installed in the
16834 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
16835 must be overridden with the @option{-specs=} option to specify the
16836 appropriate directory location.  The Parallel Environment does not
16837 support threads, so the @option{-mpe} option and the @option{-pthread}
16838 option are incompatible.
16840 @item -malign-natural
16841 @itemx -malign-power
16842 @opindex malign-natural
16843 @opindex malign-power
16844 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
16845 @option{-malign-natural} overrides the ABI-defined alignment of larger
16846 types, such as floating-point doubles, on their natural size-based boundary.
16847 The option @option{-malign-power} instructs GCC to follow the ABI-specified
16848 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
16850 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
16851 is not supported.
16853 @item -msoft-float
16854 @itemx -mhard-float
16855 @opindex msoft-float
16856 @opindex mhard-float
16857 Generate code that does not use (uses) the floating-point register set.
16858 Software floating-point emulation is provided if you use the
16859 @option{-msoft-float} option, and pass the option to GCC when linking.
16861 @item -msingle-float
16862 @itemx -mdouble-float
16863 @opindex msingle-float
16864 @opindex mdouble-float
16865 Generate code for single- or double-precision floating-point operations.
16866 @option{-mdouble-float} implies @option{-msingle-float}.
16868 @item -msimple-fpu
16869 @opindex msimple-fpu
16870 Do not generate sqrt and div instructions for hardware floating-point unit.
16872 @item -mfpu
16873 @opindex mfpu
16874 Specify type of floating-point unit.  Valid values are @var{sp_lite}
16875 (equivalent to -msingle-float -msimple-fpu), @var{dp_lite} (equivalent
16876 to -mdouble-float -msimple-fpu), @var{sp_full} (equivalent to -msingle-float),
16877 and @var{dp_full} (equivalent to -mdouble-float).
16879 @item -mxilinx-fpu
16880 @opindex mxilinx-fpu
16881 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
16883 @item -mmultiple
16884 @itemx -mno-multiple
16885 @opindex mmultiple
16886 @opindex mno-multiple
16887 Generate code that uses (does not use) the load multiple word
16888 instructions and the store multiple word instructions.  These
16889 instructions are generated by default on POWER systems, and not
16890 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
16891 PowerPC systems, since those instructions do not work when the
16892 processor is in little-endian mode.  The exceptions are PPC740 and
16893 PPC750 which permit these instructions in little-endian mode.
16895 @item -mstring
16896 @itemx -mno-string
16897 @opindex mstring
16898 @opindex mno-string
16899 Generate code that uses (does not use) the load string instructions
16900 and the store string word instructions to save multiple registers and
16901 do small block moves.  These instructions are generated by default on
16902 POWER systems, and not generated on PowerPC systems.  Do not use
16903 @option{-mstring} on little-endian PowerPC systems, since those
16904 instructions do not work when the processor is in little-endian mode.
16905 The exceptions are PPC740 and PPC750 which permit these instructions
16906 in little-endian mode.
16908 @item -mupdate
16909 @itemx -mno-update
16910 @opindex mupdate
16911 @opindex mno-update
16912 Generate code that uses (does not use) the load or store instructions
16913 that update the base register to the address of the calculated memory
16914 location.  These instructions are generated by default.  If you use
16915 @option{-mno-update}, there is a small window between the time that the
16916 stack pointer is updated and the address of the previous frame is
16917 stored, which means code that walks the stack frame across interrupts or
16918 signals may get corrupted data.
16920 @item -mavoid-indexed-addresses
16921 @itemx -mno-avoid-indexed-addresses
16922 @opindex mavoid-indexed-addresses
16923 @opindex mno-avoid-indexed-addresses
16924 Generate code that tries to avoid (not avoid) the use of indexed load
16925 or store instructions. These instructions can incur a performance
16926 penalty on Power6 processors in certain situations, such as when
16927 stepping through large arrays that cross a 16M boundary.  This option
16928 is enabled by default when targetting Power6 and disabled otherwise.
16930 @item -mfused-madd
16931 @itemx -mno-fused-madd
16932 @opindex mfused-madd
16933 @opindex mno-fused-madd
16934 Generate code that uses (does not use) the floating-point multiply and
16935 accumulate instructions.  These instructions are generated by default
16936 if hardware floating point is used.  The machine-dependent
16937 @option{-mfused-madd} option is now mapped to the machine-independent
16938 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
16939 mapped to @option{-ffp-contract=off}.
16941 @item -mmulhw
16942 @itemx -mno-mulhw
16943 @opindex mmulhw
16944 @opindex mno-mulhw
16945 Generate code that uses (does not use) the half-word multiply and
16946 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
16947 These instructions are generated by default when targetting those
16948 processors.
16950 @item -mdlmzb
16951 @itemx -mno-dlmzb
16952 @opindex mdlmzb
16953 @opindex mno-dlmzb
16954 Generate code that uses (does not use) the string-search @samp{dlmzb}
16955 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
16956 generated by default when targetting those processors.
16958 @item -mno-bit-align
16959 @itemx -mbit-align
16960 @opindex mno-bit-align
16961 @opindex mbit-align
16962 On System V.4 and embedded PowerPC systems do not (do) force structures
16963 and unions that contain bit-fields to be aligned to the base type of the
16964 bit-field.
16966 For example, by default a structure containing nothing but 8
16967 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
16968 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
16969 the structure is aligned to a 1-byte boundary and is 1 byte in
16970 size.
16972 @item -mno-strict-align
16973 @itemx -mstrict-align
16974 @opindex mno-strict-align
16975 @opindex mstrict-align
16976 On System V.4 and embedded PowerPC systems do not (do) assume that
16977 unaligned memory references will be handled by the system.
16979 @item -mrelocatable
16980 @itemx -mno-relocatable
16981 @opindex mrelocatable
16982 @opindex mno-relocatable
16983 Generate code that allows (does not allow) a static executable to be
16984 relocated to a different address at run time.  A simple embedded
16985 PowerPC system loader should relocate the entire contents of
16986 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
16987 a table of 32-bit addresses generated by this option.  For this to
16988 work, all objects linked together must be compiled with
16989 @option{-mrelocatable} or @option{-mrelocatable-lib}.
16990 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
16992 @item -mrelocatable-lib
16993 @itemx -mno-relocatable-lib
16994 @opindex mrelocatable-lib
16995 @opindex mno-relocatable-lib
16996 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
16997 @code{.fixup} section to allow static executables to be relocated at
16998 run time, but @option{-mrelocatable-lib} does not use the smaller stack
16999 alignment of @option{-mrelocatable}.  Objects compiled with
17000 @option{-mrelocatable-lib} may be linked with objects compiled with
17001 any combination of the @option{-mrelocatable} options.
17003 @item -mno-toc
17004 @itemx -mtoc
17005 @opindex mno-toc
17006 @opindex mtoc
17007 On System V.4 and embedded PowerPC systems do not (do) assume that
17008 register 2 contains a pointer to a global area pointing to the addresses
17009 used in the program.
17011 @item -mlittle
17012 @itemx -mlittle-endian
17013 @opindex mlittle
17014 @opindex mlittle-endian
17015 On System V.4 and embedded PowerPC systems compile code for the
17016 processor in little-endian mode.  The @option{-mlittle-endian} option is
17017 the same as @option{-mlittle}.
17019 @item -mbig
17020 @itemx -mbig-endian
17021 @opindex mbig
17022 @opindex mbig-endian
17023 On System V.4 and embedded PowerPC systems compile code for the
17024 processor in big-endian mode.  The @option{-mbig-endian} option is
17025 the same as @option{-mbig}.
17027 @item -mdynamic-no-pic
17028 @opindex mdynamic-no-pic
17029 On Darwin and Mac OS X systems, compile code so that it is not
17030 relocatable, but that its external references are relocatable.  The
17031 resulting code is suitable for applications, but not shared
17032 libraries.
17034 @item -msingle-pic-base
17035 @opindex msingle-pic-base
17036 Treat the register used for PIC addressing as read-only, rather than
17037 loading it in the prologue for each function.  The runtime system is
17038 responsible for initializing this register with an appropriate value
17039 before execution begins.
17041 @item -mprioritize-restricted-insns=@var{priority}
17042 @opindex mprioritize-restricted-insns
17043 This option controls the priority that is assigned to
17044 dispatch-slot restricted instructions during the second scheduling
17045 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
17046 @var{no/highest/second-highest} priority to dispatch slot restricted
17047 instructions.
17049 @item -msched-costly-dep=@var{dependence_type}
17050 @opindex msched-costly-dep
17051 This option controls which dependences are considered costly
17052 by the target during instruction scheduling.  The argument
17053 @var{dependence_type} takes one of the following values:
17054 @var{no}: no dependence is costly,
17055 @var{all}: all dependences are costly,
17056 @var{true_store_to_load}: a true dependence from store to load is costly,
17057 @var{store_to_load}: any dependence from store to load is costly,
17058 @var{number}: any dependence for which latency >= @var{number} is costly.
17060 @item -minsert-sched-nops=@var{scheme}
17061 @opindex minsert-sched-nops
17062 This option controls which nop insertion scheme will be used during
17063 the second scheduling pass.  The argument @var{scheme} takes one of the
17064 following values:
17065 @var{no}: Don't insert nops.
17066 @var{pad}: Pad with nops any dispatch group that has vacant issue slots,
17067 according to the scheduler's grouping.
17068 @var{regroup_exact}: Insert nops to force costly dependent insns into
17069 separate groups.  Insert exactly as many nops as needed to force an insn
17070 to a new group, according to the estimated processor grouping.
17071 @var{number}: Insert nops to force costly dependent insns into
17072 separate groups.  Insert @var{number} nops to force an insn to a new group.
17074 @item -mcall-sysv
17075 @opindex mcall-sysv
17076 On System V.4 and embedded PowerPC systems compile code using calling
17077 conventions that adheres to the March 1995 draft of the System V
17078 Application Binary Interface, PowerPC processor supplement.  This is the
17079 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
17081 @item -mcall-sysv-eabi
17082 @itemx -mcall-eabi
17083 @opindex mcall-sysv-eabi
17084 @opindex mcall-eabi
17085 Specify both @option{-mcall-sysv} and @option{-meabi} options.
17087 @item -mcall-sysv-noeabi
17088 @opindex mcall-sysv-noeabi
17089 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
17091 @item -mcall-aixdesc
17092 @opindex m
17093 On System V.4 and embedded PowerPC systems compile code for the AIX
17094 operating system.
17096 @item -mcall-linux
17097 @opindex mcall-linux
17098 On System V.4 and embedded PowerPC systems compile code for the
17099 Linux-based GNU system.
17101 @item -mcall-freebsd
17102 @opindex mcall-freebsd
17103 On System V.4 and embedded PowerPC systems compile code for the
17104 FreeBSD operating system.
17106 @item -mcall-netbsd
17107 @opindex mcall-netbsd
17108 On System V.4 and embedded PowerPC systems compile code for the
17109 NetBSD operating system.
17111 @item -mcall-openbsd
17112 @opindex mcall-netbsd
17113 On System V.4 and embedded PowerPC systems compile code for the
17114 OpenBSD operating system.
17116 @item -maix-struct-return
17117 @opindex maix-struct-return
17118 Return all structures in memory (as specified by the AIX ABI)@.
17120 @item -msvr4-struct-return
17121 @opindex msvr4-struct-return
17122 Return structures smaller than 8 bytes in registers (as specified by the
17123 SVR4 ABI)@.
17125 @item -mabi=@var{abi-type}
17126 @opindex mabi
17127 Extend the current ABI with a particular extension, or remove such extension.
17128 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
17129 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
17131 @item -mabi=spe
17132 @opindex mabi=spe
17133 Extend the current ABI with SPE ABI extensions.  This does not change
17134 the default ABI, instead it adds the SPE ABI extensions to the current
17135 ABI@.
17137 @item -mabi=no-spe
17138 @opindex mabi=no-spe
17139 Disable Booke SPE ABI extensions for the current ABI@.
17141 @item -mabi=ibmlongdouble
17142 @opindex mabi=ibmlongdouble
17143 Change the current ABI to use IBM extended-precision long double.
17144 This is a PowerPC 32-bit SYSV ABI option.
17146 @item -mabi=ieeelongdouble
17147 @opindex mabi=ieeelongdouble
17148 Change the current ABI to use IEEE extended-precision long double.
17149 This is a PowerPC 32-bit Linux ABI option.
17151 @item -mprototype
17152 @itemx -mno-prototype
17153 @opindex mprototype
17154 @opindex mno-prototype
17155 On System V.4 and embedded PowerPC systems assume that all calls to
17156 variable argument functions are properly prototyped.  Otherwise, the
17157 compiler must insert an instruction before every non prototyped call to
17158 set or clear bit 6 of the condition code register (@var{CR}) to
17159 indicate whether floating-point values were passed in the floating-point
17160 registers in case the function takes variable arguments.  With
17161 @option{-mprototype}, only calls to prototyped variable argument functions
17162 will set or clear the bit.
17164 @item -msim
17165 @opindex msim
17166 On embedded PowerPC systems, assume that the startup module is called
17167 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
17168 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
17169 configurations.
17171 @item -mmvme
17172 @opindex mmvme
17173 On embedded PowerPC systems, assume that the startup module is called
17174 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
17175 @file{libc.a}.
17177 @item -mads
17178 @opindex mads
17179 On embedded PowerPC systems, assume that the startup module is called
17180 @file{crt0.o} and the standard C libraries are @file{libads.a} and
17181 @file{libc.a}.
17183 @item -myellowknife
17184 @opindex myellowknife
17185 On embedded PowerPC systems, assume that the startup module is called
17186 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
17187 @file{libc.a}.
17189 @item -mvxworks
17190 @opindex mvxworks
17191 On System V.4 and embedded PowerPC systems, specify that you are
17192 compiling for a VxWorks system.
17194 @item -memb
17195 @opindex memb
17196 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
17197 header to indicate that @samp{eabi} extended relocations are used.
17199 @item -meabi
17200 @itemx -mno-eabi
17201 @opindex meabi
17202 @opindex mno-eabi
17203 On System V.4 and embedded PowerPC systems do (do not) adhere to the
17204 Embedded Applications Binary Interface (eabi) which is a set of
17205 modifications to the System V.4 specifications.  Selecting @option{-meabi}
17206 means that the stack is aligned to an 8-byte boundary, a function
17207 @code{__eabi} is called to from @code{main} to set up the eabi
17208 environment, and the @option{-msdata} option can use both @code{r2} and
17209 @code{r13} to point to two separate small data areas.  Selecting
17210 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
17211 do not call an initialization function from @code{main}, and the
17212 @option{-msdata} option will only use @code{r13} to point to a single
17213 small data area.  The @option{-meabi} option is on by default if you
17214 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
17216 @item -msdata=eabi
17217 @opindex msdata=eabi
17218 On System V.4 and embedded PowerPC systems, put small initialized
17219 @code{const} global and static data in the @samp{.sdata2} section, which
17220 is pointed to by register @code{r2}.  Put small initialized
17221 non-@code{const} global and static data in the @samp{.sdata} section,
17222 which is pointed to by register @code{r13}.  Put small uninitialized
17223 global and static data in the @samp{.sbss} section, which is adjacent to
17224 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
17225 incompatible with the @option{-mrelocatable} option.  The
17226 @option{-msdata=eabi} option also sets the @option{-memb} option.
17228 @item -msdata=sysv
17229 @opindex msdata=sysv
17230 On System V.4 and embedded PowerPC systems, put small global and static
17231 data in the @samp{.sdata} section, which is pointed to by register
17232 @code{r13}.  Put small uninitialized global and static data in the
17233 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
17234 The @option{-msdata=sysv} option is incompatible with the
17235 @option{-mrelocatable} option.
17237 @item -msdata=default
17238 @itemx -msdata
17239 @opindex msdata=default
17240 @opindex msdata
17241 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
17242 compile code the same as @option{-msdata=eabi}, otherwise compile code the
17243 same as @option{-msdata=sysv}.
17245 @item -msdata=data
17246 @opindex msdata=data
17247 On System V.4 and embedded PowerPC systems, put small global
17248 data in the @samp{.sdata} section.  Put small uninitialized global
17249 data in the @samp{.sbss} section.  Do not use register @code{r13}
17250 to address small data however.  This is the default behavior unless
17251 other @option{-msdata} options are used.
17253 @item -msdata=none
17254 @itemx -mno-sdata
17255 @opindex msdata=none
17256 @opindex mno-sdata
17257 On embedded PowerPC systems, put all initialized global and static data
17258 in the @samp{.data} section, and all uninitialized data in the
17259 @samp{.bss} section.
17261 @item -mblock-move-inline-limit=@var{num}
17262 @opindex mblock-move-inline-limit
17263 Inline all block moves (such as calls to @code{memcpy} or structure
17264 copies) less than or equal to @var{num} bytes.  The minimum value for
17265 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
17266 targets.  The default value is target-specific.
17268 @item -G @var{num}
17269 @opindex G
17270 @cindex smaller data references (PowerPC)
17271 @cindex .sdata/.sdata2 references (PowerPC)
17272 On embedded PowerPC systems, put global and static items less than or
17273 equal to @var{num} bytes into the small data or bss sections instead of
17274 the normal data or bss section.  By default, @var{num} is 8.  The
17275 @option{-G @var{num}} switch is also passed to the linker.
17276 All modules should be compiled with the same @option{-G @var{num}} value.
17278 @item -mregnames
17279 @itemx -mno-regnames
17280 @opindex mregnames
17281 @opindex mno-regnames
17282 On System V.4 and embedded PowerPC systems do (do not) emit register
17283 names in the assembly language output using symbolic forms.
17285 @item -mlongcall
17286 @itemx -mno-longcall
17287 @opindex mlongcall
17288 @opindex mno-longcall
17289 By default assume that all calls are far away so that a longer more
17290 expensive calling sequence is required.  This is required for calls
17291 further than 32 megabytes (33,554,432 bytes) from the current location.
17292 A short call will be generated if the compiler knows
17293 the call cannot be that far away.  This setting can be overridden by
17294 the @code{shortcall} function attribute, or by @code{#pragma
17295 longcall(0)}.
17297 Some linkers are capable of detecting out-of-range calls and generating
17298 glue code on the fly.  On these systems, long calls are unnecessary and
17299 generate slower code.  As of this writing, the AIX linker can do this,
17300 as can the GNU linker for PowerPC/64.  It is planned to add this feature
17301 to the GNU linker for 32-bit PowerPC systems as well.
17303 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
17304 callee, L42'', plus a ``branch island'' (glue code).  The two target
17305 addresses represent the callee and the ``branch island''.  The
17306 Darwin/PPC linker will prefer the first address and generate a ``bl
17307 callee'' if the PPC ``bl'' instruction will reach the callee directly;
17308 otherwise, the linker will generate ``bl L42'' to call the ``branch
17309 island''.  The ``branch island'' is appended to the body of the
17310 calling function; it computes the full 32-bit address of the callee
17311 and jumps to it.
17313 On Mach-O (Darwin) systems, this option directs the compiler emit to
17314 the glue for every direct call, and the Darwin linker decides whether
17315 to use or discard it.
17317 In the future, we may cause GCC to ignore all longcall specifications
17318 when the linker is known to generate glue.
17320 @item -mtls-markers
17321 @itemx -mno-tls-markers
17322 @opindex mtls-markers
17323 @opindex mno-tls-markers
17324 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
17325 specifying the function argument.  The relocation allows ld to
17326 reliably associate function call with argument setup instructions for
17327 TLS optimization, which in turn allows gcc to better schedule the
17328 sequence.
17330 @item -pthread
17331 @opindex pthread
17332 Adds support for multithreading with the @dfn{pthreads} library.
17333 This option sets flags for both the preprocessor and linker.
17335 @item -mrecip
17336 @itemx -mno-recip
17337 @opindex mrecip
17338 This option will enable GCC to use the reciprocal estimate and
17339 reciprocal square root estimate instructions with additional
17340 Newton-Raphson steps to increase precision instead of doing a divide or
17341 square root and divide for floating-point arguments.  You should use
17342 the @option{-ffast-math} option when using @option{-mrecip} (or at
17343 least @option{-funsafe-math-optimizations},
17344 @option{-finite-math-only}, @option{-freciprocal-math} and
17345 @option{-fno-trapping-math}).  Note that while the throughput of the
17346 sequence is generally higher than the throughput of the non-reciprocal
17347 instruction, the precision of the sequence can be decreased by up to 2
17348 ulp (i.e. the inverse of 1.0 equals 0.99999994) for reciprocal square
17349 roots.
17351 @item -mrecip=@var{opt}
17352 @opindex mrecip=opt
17353 This option allows to control which reciprocal estimate instructions
17354 may be used.  @var{opt} is a comma separated list of options, which may
17355 be preceded by a @code{!} to invert the option:
17356 @code{all}: enable all estimate instructions,
17357 @code{default}: enable the default instructions, equivalent to @option{-mrecip},
17358 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
17359 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
17360 @code{divf}: enable the single-precision reciprocal approximation instructions;
17361 @code{divd}: enable the double-precision reciprocal approximation instructions;
17362 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
17363 @code{rsqrtf}: enable the single-precision reciprocal square root approximation instructions;
17364 @code{rsqrtd}: enable the double-precision reciprocal square root approximation instructions;
17366 So for example, @option{-mrecip=all,!rsqrtd} would enable the
17367 all of the reciprocal estimate instructions, except for the
17368 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
17369 which handle the double-precision reciprocal square root calculations.
17371 @item -mrecip-precision
17372 @itemx -mno-recip-precision
17373 @opindex mrecip-precision
17374 Assume (do not assume) that the reciprocal estimate instructions
17375 provide higher-precision estimates than is mandated by the PowerPC
17376 ABI.  Selecting @option{-mcpu=power6} or @option{-mcpu=power7}
17377 automatically selects @option{-mrecip-precision}.  The double-precision 
17378 square root estimate instructions are not generated by
17379 default on low-precision machines, since they do not provide an
17380 estimate that converges after three steps.
17382 @item -mveclibabi=@var{type}
17383 @opindex mveclibabi
17384 Specifies the ABI type to use for vectorizing intrinsics using an
17385 external library.  The only type supported at present is @code{mass},
17386 which specifies to use IBM's Mathematical Acceleration Subsystem
17387 (MASS) libraries for vectorizing intrinsics using external libraries.
17388 GCC will currently emit calls to @code{acosd2}, @code{acosf4},
17389 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
17390 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
17391 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
17392 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
17393 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
17394 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
17395 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
17396 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
17397 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
17398 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
17399 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
17400 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
17401 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
17402 for power7.  Both @option{-ftree-vectorize} and
17403 @option{-funsafe-math-optimizations} have to be enabled.  The MASS
17404 libraries will have to be specified at link time.
17406 @item -mfriz
17407 @itemx -mno-friz
17408 @opindex mfriz
17409 Generate (do not generate) the @code{friz} instruction when the
17410 @option{-funsafe-math-optimizations} option is used to optimize
17411 rounding of floating-point values to 64-bit integer and back to floating
17412 point.  The @code{friz} instruction does not return the same value if
17413 the floating-point number is too large to fit in an integer.
17415 @item -mpointers-to-nested-functions
17416 @itemx -mno-pointers-to-nested-functions
17417 @opindex mpointers-to-nested-functions
17418 Generate (do not generate) code to load up the static chain register
17419 (@var{r11}) when calling through a pointer on AIX and 64-bit Linux
17420 systems where a function pointer points to a 3-word descriptor giving
17421 the function address, TOC value to be loaded in register @var{r2}, and
17422 static chain value to be loaded in register @var{r11}.  The
17423 @option{-mpointers-to-nested-functions} is on by default.  You will
17424 not be able to call through pointers to nested functions or pointers
17425 to functions compiled in other languages that use the static chain if
17426 you use the @option{-mno-pointers-to-nested-functions}.
17428 @item -msave-toc-indirect
17429 @itemx -mno-save-toc-indirect
17430 @opindex msave-toc-indirect
17431 Generate (do not generate) code to save the TOC value in the reserved
17432 stack location in the function prologue if the function calls through
17433 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
17434 saved in the prologue, it is saved just before the call through the
17435 pointer.  The @option{-mno-save-toc-indirect} option is the default.
17436 @end table
17438 @node RX Options
17439 @subsection RX Options
17440 @cindex RX Options
17442 These command-line options are defined for RX targets:
17444 @table @gcctabopt
17445 @item -m64bit-doubles
17446 @itemx -m32bit-doubles
17447 @opindex m64bit-doubles
17448 @opindex m32bit-doubles
17449 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
17450 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
17451 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
17452 works on 32-bit values, which is why the default is
17453 @option{-m32bit-doubles}.
17455 @item -fpu
17456 @itemx -nofpu
17457 @opindex fpu
17458 @opindex nofpu
17459 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
17460 floating-point hardware.  The default is enabled for the @var{RX600}
17461 series and disabled for the @var{RX200} series.
17463 Floating-point instructions will only be generated for 32-bit floating-point 
17464 values however, so if the @option{-m64bit-doubles} option is in
17465 use then the FPU hardware will not be used for doubles.
17467 @emph{Note} If the @option{-fpu} option is enabled then
17468 @option{-funsafe-math-optimizations} is also enabled automatically.
17469 This is because the RX FPU instructions are themselves unsafe.
17471 @item -mcpu=@var{name}
17472 @opindex -mcpu
17473 Selects the type of RX CPU to be targeted.  Currently three types are
17474 supported, the generic @var{RX600} and @var{RX200} series hardware and
17475 the specific @var{RX610} CPU.  The default is @var{RX600}.
17477 The only difference between @var{RX600} and @var{RX610} is that the
17478 @var{RX610} does not support the @code{MVTIPL} instruction.
17480 The @var{RX200} series does not have a hardware floating-point unit
17481 and so @option{-nofpu} is enabled by default when this type is
17482 selected.
17484 @item -mbig-endian-data
17485 @itemx -mlittle-endian-data
17486 @opindex mbig-endian-data
17487 @opindex mlittle-endian-data
17488 Store data (but not code) in the big-endian format.  The default is
17489 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
17490 format.
17492 @item -msmall-data-limit=@var{N}
17493 @opindex msmall-data-limit
17494 Specifies the maximum size in bytes of global and static variables
17495 which can be placed into the small data area.  Using the small data
17496 area can lead to smaller and faster code, but the size of area is
17497 limited and it is up to the programmer to ensure that the area does
17498 not overflow.  Also when the small data area is used one of the RX's
17499 registers (usually @code{r13}) is reserved for use pointing to this
17500 area, so it is no longer available for use by the compiler.  This
17501 could result in slower and/or larger code if variables which once
17502 could have been held in the reserved register are now pushed onto the
17503 stack.
17505 Note, common variables (variables that have not been initialized) and
17506 constants are not placed into the small data area as they are assigned
17507 to other sections in the output executable.
17509 The default value is zero, which disables this feature.  Note, this
17510 feature is not enabled by default with higher optimization levels
17511 (@option{-O2} etc) because of the potentially detrimental effects of
17512 reserving a register.  It is up to the programmer to experiment and
17513 discover whether this feature is of benefit to their program.  See the
17514 description of the @option{-mpid} option for a description of how the
17515 actual register to hold the small data area pointer is chosen.
17517 @item -msim
17518 @itemx -mno-sim
17519 @opindex msim
17520 @opindex mno-sim
17521 Use the simulator runtime.  The default is to use the libgloss board
17522 specific runtime.
17524 @item -mas100-syntax
17525 @itemx -mno-as100-syntax
17526 @opindex mas100-syntax
17527 @opindex mno-as100-syntax
17528 When generating assembler output use a syntax that is compatible with
17529 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
17530 assembler but it has some restrictions so generating it is not the
17531 default option.
17533 @item -mmax-constant-size=@var{N}
17534 @opindex mmax-constant-size
17535 Specifies the maximum size, in bytes, of a constant that can be used as
17536 an operand in a RX instruction.  Although the RX instruction set does
17537 allow constants of up to 4 bytes in length to be used in instructions,
17538 a longer value equates to a longer instruction.  Thus in some
17539 circumstances it can be beneficial to restrict the size of constants
17540 that are used in instructions.  Constants that are too big are instead
17541 placed into a constant pool and referenced via register indirection.
17543 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
17544 or 4 means that constants of any size are allowed.
17546 @item -mrelax
17547 @opindex mrelax
17548 Enable linker relaxation.  Linker relaxation is a process whereby the
17549 linker will attempt to reduce the size of a program by finding shorter
17550 versions of various instructions.  Disabled by default.
17552 @item -mint-register=@var{N}
17553 @opindex mint-register
17554 Specify the number of registers to reserve for fast interrupt handler
17555 functions.  The value @var{N} can be between 0 and 4.  A value of 1
17556 means that register @code{r13} will be reserved for the exclusive use
17557 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
17558 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
17559 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
17560 A value of 0, the default, does not reserve any registers.
17562 @item -msave-acc-in-interrupts
17563 @opindex msave-acc-in-interrupts
17564 Specifies that interrupt handler functions should preserve the
17565 accumulator register.  This is only necessary if normal code might use
17566 the accumulator register, for example because it performs 64-bit
17567 multiplications.  The default is to ignore the accumulator as this
17568 makes the interrupt handlers faster.
17570 @item -mpid
17571 @itemx -mno-pid
17572 @opindex mpid
17573 @opindex mno-pid
17574 Enables the generation of position independent data.  When enabled any
17575 access to constant data will done via an offset from a base address
17576 held in a register.  This allows the location of constant data to be
17577 determined at run time without requiring the executable to be
17578 relocated, which is a benefit to embedded applications with tight
17579 memory constraints.  Data that can be modified is not affected by this
17580 option.
17582 Note, using this feature reserves a register, usually @code{r13}, for
17583 the constant data base address.  This can result in slower and/or
17584 larger code, especially in complicated functions.
17586 The actual register chosen to hold the constant data base address
17587 depends upon whether the @option{-msmall-data-limit} and/or the
17588 @option{-mint-register} command-line options are enabled.  Starting
17589 with register @code{r13} and proceeding downwards, registers are
17590 allocated first to satisfy the requirements of @option{-mint-register},
17591 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
17592 is possible for the small data area register to be @code{r8} if both
17593 @option{-mint-register=4} and @option{-mpid} are specified on the
17594 command line.
17596 By default this feature is not enabled.  The default can be restored
17597 via the @option{-mno-pid} command-line option.
17599 @end table
17601 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
17602 has special significance to the RX port when used with the
17603 @code{interrupt} function attribute.  This attribute indicates a
17604 function intended to process fast interrupts.  GCC will will ensure
17605 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
17606 and/or @code{r13} and only provided that the normal use of the
17607 corresponding registers have been restricted via the
17608 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
17609 options.
17611 @node S/390 and zSeries Options
17612 @subsection S/390 and zSeries Options
17613 @cindex S/390 and zSeries Options
17615 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
17617 @table @gcctabopt
17618 @item -mhard-float
17619 @itemx -msoft-float
17620 @opindex mhard-float
17621 @opindex msoft-float
17622 Use (do not use) the hardware floating-point instructions and registers
17623 for floating-point operations.  When @option{-msoft-float} is specified,
17624 functions in @file{libgcc.a} will be used to perform floating-point
17625 operations.  When @option{-mhard-float} is specified, the compiler
17626 generates IEEE floating-point instructions.  This is the default.
17628 @item -mhard-dfp
17629 @itemx -mno-hard-dfp
17630 @opindex mhard-dfp
17631 @opindex mno-hard-dfp
17632 Use (do not use) the hardware decimal-floating-point instructions for
17633 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
17634 specified, functions in @file{libgcc.a} will be used to perform
17635 decimal-floating-point operations.  When @option{-mhard-dfp} is
17636 specified, the compiler generates decimal-floating-point hardware
17637 instructions.  This is the default for @option{-march=z9-ec} or higher.
17639 @item -mlong-double-64
17640 @itemx -mlong-double-128
17641 @opindex mlong-double-64
17642 @opindex mlong-double-128
17643 These switches control the size of @code{long double} type. A size
17644 of 64 bits makes the @code{long double} type equivalent to the @code{double}
17645 type. This is the default.
17647 @item -mbackchain
17648 @itemx -mno-backchain
17649 @opindex mbackchain
17650 @opindex mno-backchain
17651 Store (do not store) the address of the caller's frame as backchain pointer
17652 into the callee's stack frame.
17653 A backchain may be needed to allow debugging using tools that do not understand
17654 DWARF-2 call frame information.
17655 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
17656 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
17657 the backchain is placed into the topmost word of the 96/160 byte register
17658 save area.
17660 In general, code compiled with @option{-mbackchain} is call-compatible with
17661 code compiled with @option{-mmo-backchain}; however, use of the backchain
17662 for debugging purposes usually requires that the whole binary is built with
17663 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
17664 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
17665 to build a linux kernel use @option{-msoft-float}.
17667 The default is to not maintain the backchain.
17669 @item -mpacked-stack
17670 @itemx -mno-packed-stack
17671 @opindex mpacked-stack
17672 @opindex mno-packed-stack
17673 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
17674 specified, the compiler uses the all fields of the 96/160 byte register save
17675 area only for their default purpose; unused fields still take up stack space.
17676 When @option{-mpacked-stack} is specified, register save slots are densely
17677 packed at the top of the register save area; unused space is reused for other
17678 purposes, allowing for more efficient use of the available stack space.
17679 However, when @option{-mbackchain} is also in effect, the topmost word of
17680 the save area is always used to store the backchain, and the return address
17681 register is always saved two words below the backchain.
17683 As long as the stack frame backchain is not used, code generated with
17684 @option{-mpacked-stack} is call-compatible with code generated with
17685 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
17686 S/390 or zSeries generated code that uses the stack frame backchain at run
17687 time, not just for debugging purposes.  Such code is not call-compatible
17688 with code compiled with @option{-mpacked-stack}.  Also, note that the
17689 combination of @option{-mbackchain},
17690 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
17691 to build a linux kernel use @option{-msoft-float}.
17693 The default is to not use the packed stack layout.
17695 @item -msmall-exec
17696 @itemx -mno-small-exec
17697 @opindex msmall-exec
17698 @opindex mno-small-exec
17699 Generate (or do not generate) code using the @code{bras} instruction
17700 to do subroutine calls.
17701 This only works reliably if the total executable size does not
17702 exceed 64k.  The default is to use the @code{basr} instruction instead,
17703 which does not have this limitation.
17705 @item -m64
17706 @itemx -m31
17707 @opindex m64
17708 @opindex m31
17709 When @option{-m31} is specified, generate code compliant to the
17710 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
17711 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
17712 particular to generate 64-bit instructions.  For the @samp{s390}
17713 targets, the default is @option{-m31}, while the @samp{s390x}
17714 targets default to @option{-m64}.
17716 @item -mzarch
17717 @itemx -mesa
17718 @opindex mzarch
17719 @opindex mesa
17720 When @option{-mzarch} is specified, generate code using the
17721 instructions available on z/Architecture.
17722 When @option{-mesa} is specified, generate code using the
17723 instructions available on ESA/390.  Note that @option{-mesa} is
17724 not possible with @option{-m64}.
17725 When generating code compliant to the GNU/Linux for S/390 ABI,
17726 the default is @option{-mesa}.  When generating code compliant
17727 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
17729 @item -mmvcle
17730 @itemx -mno-mvcle
17731 @opindex mmvcle
17732 @opindex mno-mvcle
17733 Generate (or do not generate) code using the @code{mvcle} instruction
17734 to perform block moves.  When @option{-mno-mvcle} is specified,
17735 use a @code{mvc} loop instead.  This is the default unless optimizing for
17736 size.
17738 @item -mdebug
17739 @itemx -mno-debug
17740 @opindex mdebug
17741 @opindex mno-debug
17742 Print (or do not print) additional debug information when compiling.
17743 The default is to not print debug information.
17745 @item -march=@var{cpu-type}
17746 @opindex march
17747 Generate code that will run on @var{cpu-type}, which is the name of a system
17748 representing a certain processor type.  Possible values for
17749 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
17750 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
17751 When generating code using the instructions available on z/Architecture,
17752 the default is @option{-march=z900}.  Otherwise, the default is
17753 @option{-march=g5}.
17755 @item -mtune=@var{cpu-type}
17756 @opindex mtune
17757 Tune to @var{cpu-type} everything applicable about the generated code,
17758 except for the ABI and the set of available instructions.
17759 The list of @var{cpu-type} values is the same as for @option{-march}.
17760 The default is the value used for @option{-march}.
17762 @item -mtpf-trace
17763 @itemx -mno-tpf-trace
17764 @opindex mtpf-trace
17765 @opindex mno-tpf-trace
17766 Generate code that adds (does not add) in TPF OS specific branches to trace
17767 routines in the operating system.  This option is off by default, even
17768 when compiling for the TPF OS@.
17770 @item -mfused-madd
17771 @itemx -mno-fused-madd
17772 @opindex mfused-madd
17773 @opindex mno-fused-madd
17774 Generate code that uses (does not use) the floating-point multiply and
17775 accumulate instructions.  These instructions are generated by default if
17776 hardware floating point is used.
17778 @item -mwarn-framesize=@var{framesize}
17779 @opindex mwarn-framesize
17780 Emit a warning if the current function exceeds the given frame size.  Because
17781 this is a compile-time check it doesn't need to be a real problem when the program
17782 runs.  It is intended to identify functions that most probably cause
17783 a stack overflow.  It is useful to be used in an environment with limited stack
17784 size e.g.@: the linux kernel.
17786 @item -mwarn-dynamicstack
17787 @opindex mwarn-dynamicstack
17788 Emit a warning if the function calls alloca or uses dynamically
17789 sized arrays.  This is generally a bad idea with a limited stack size.
17791 @item -mstack-guard=@var{stack-guard}
17792 @itemx -mstack-size=@var{stack-size}
17793 @opindex mstack-guard
17794 @opindex mstack-size
17795 If these options are provided the s390 back end emits additional instructions in
17796 the function prologue which trigger a trap if the stack size is @var{stack-guard}
17797 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
17798 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
17799 the frame size of the compiled function is chosen.
17800 These options are intended to be used to help debugging stack overflow problems.
17801 The additionally emitted code causes only little overhead and hence can also be
17802 used in production like systems without greater performance degradation.  The given
17803 values have to be exact powers of 2 and @var{stack-size} has to be greater than
17804 @var{stack-guard} without exceeding 64k.
17805 In order to be efficient the extra code makes the assumption that the stack starts
17806 at an address aligned to the value given by @var{stack-size}.
17807 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
17808 @end table
17810 @node Score Options
17811 @subsection Score Options
17812 @cindex Score Options
17814 These options are defined for Score implementations:
17816 @table @gcctabopt
17817 @item -meb
17818 @opindex meb
17819 Compile code for big-endian mode.  This is the default.
17821 @item -mel
17822 @opindex mel
17823 Compile code for little-endian mode.
17825 @item -mnhwloop
17826 @opindex mnhwloop
17827 Disable generate bcnz instruction.
17829 @item -muls
17830 @opindex muls
17831 Enable generate unaligned load and store instruction.
17833 @item -mmac
17834 @opindex mmac
17835 Enable the use of multiply-accumulate instructions. Disabled by default.
17837 @item -mscore5
17838 @opindex mscore5
17839 Specify the SCORE5 as the target architecture.
17841 @item -mscore5u
17842 @opindex mscore5u
17843 Specify the SCORE5U of the target architecture.
17845 @item -mscore7
17846 @opindex mscore7
17847 Specify the SCORE7 as the target architecture. This is the default.
17849 @item -mscore7d
17850 @opindex mscore7d
17851 Specify the SCORE7D as the target architecture.
17852 @end table
17854 @node SH Options
17855 @subsection SH Options
17857 These @samp{-m} options are defined for the SH implementations:
17859 @table @gcctabopt
17860 @item -m1
17861 @opindex m1
17862 Generate code for the SH1.
17864 @item -m2
17865 @opindex m2
17866 Generate code for the SH2.
17868 @item -m2e
17869 Generate code for the SH2e.
17871 @item -m2a-nofpu
17872 @opindex m2a-nofpu
17873 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
17874 that the floating-point unit is not used.
17876 @item -m2a-single-only
17877 @opindex m2a-single-only
17878 Generate code for the SH2a-FPU, in such a way that no double-precision
17879 floating-point operations are used.
17881 @item -m2a-single
17882 @opindex m2a-single
17883 Generate code for the SH2a-FPU assuming the floating-point unit is in
17884 single-precision mode by default.
17886 @item -m2a
17887 @opindex m2a
17888 Generate code for the SH2a-FPU assuming the floating-point unit is in
17889 double-precision mode by default.
17891 @item -m3
17892 @opindex m3
17893 Generate code for the SH3.
17895 @item -m3e
17896 @opindex m3e
17897 Generate code for the SH3e.
17899 @item -m4-nofpu
17900 @opindex m4-nofpu
17901 Generate code for the SH4 without a floating-point unit.
17903 @item -m4-single-only
17904 @opindex m4-single-only
17905 Generate code for the SH4 with a floating-point unit that only
17906 supports single-precision arithmetic.
17908 @item -m4-single
17909 @opindex m4-single
17910 Generate code for the SH4 assuming the floating-point unit is in
17911 single-precision mode by default.
17913 @item -m4
17914 @opindex m4
17915 Generate code for the SH4.
17917 @item -m4a-nofpu
17918 @opindex m4a-nofpu
17919 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
17920 floating-point unit is not used.
17922 @item -m4a-single-only
17923 @opindex m4a-single-only
17924 Generate code for the SH4a, in such a way that no double-precision
17925 floating-point operations are used.
17927 @item -m4a-single
17928 @opindex m4a-single
17929 Generate code for the SH4a assuming the floating-point unit is in
17930 single-precision mode by default.
17932 @item -m4a
17933 @opindex m4a
17934 Generate code for the SH4a.
17936 @item -m4al
17937 @opindex m4al
17938 Same as @option{-m4a-nofpu}, except that it implicitly passes
17939 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
17940 instructions at the moment.
17942 @item -mb
17943 @opindex mb
17944 Compile code for the processor in big-endian mode.
17946 @item -ml
17947 @opindex ml
17948 Compile code for the processor in little-endian mode.
17950 @item -mdalign
17951 @opindex mdalign
17952 Align doubles at 64-bit boundaries.  Note that this changes the calling
17953 conventions, and thus some functions from the standard C library will
17954 not work unless you recompile it first with @option{-mdalign}.
17956 @item -mrelax
17957 @opindex mrelax
17958 Shorten some address references at link time, when possible; uses the
17959 linker option @option{-relax}.
17961 @item -mbigtable
17962 @opindex mbigtable
17963 Use 32-bit offsets in @code{switch} tables.  The default is to use
17964 16-bit offsets.
17966 @item -mbitops
17967 @opindex mbitops
17968 Enable the use of bit manipulation instructions on SH2A.
17970 @item -mfmovd
17971 @opindex mfmovd
17972 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
17973 alignment constraints.
17975 @item -mhitachi
17976 @opindex mhitachi
17977 Comply with the calling conventions defined by Renesas.
17979 @item -mrenesas
17980 @opindex mhitachi
17981 Comply with the calling conventions defined by Renesas.
17983 @item -mno-renesas
17984 @opindex mhitachi
17985 Comply with the calling conventions defined for GCC before the Renesas
17986 conventions were available.  This option is the default for all
17987 targets of the SH toolchain.
17989 @item -mnomacsave
17990 @opindex mnomacsave
17991 Mark the @code{MAC} register as call-clobbered, even if
17992 @option{-mhitachi} is given.
17994 @item -mieee
17995 @opindex mieee
17996 Increase IEEE compliance of floating-point code.
17997 At the moment, this is equivalent to @option{-fno-finite-math-only}.
17998 When generating 16-bit SH opcodes, getting IEEE-conforming results for
17999 comparisons of NANs / infinities incurs extra overhead in every
18000 floating-point comparison, therefore the default is set to
18001 @option{-ffinite-math-only}.
18003 @item -minline-ic_invalidate
18004 @opindex minline-ic_invalidate
18005 Inline code to invalidate instruction cache entries after setting up
18006 nested function trampolines.
18007 This option has no effect if -musermode is in effect and the selected
18008 code generation option (e.g. -m4) does not allow the use of the icbi
18009 instruction.
18010 If the selected code generation option does not allow the use of the icbi
18011 instruction, and -musermode is not in effect, the inlined code will
18012 manipulate the instruction cache address array directly with an associative
18013 write.  This not only requires privileged mode, but it will also
18014 fail if the cache line had been mapped via the TLB and has become unmapped.
18016 @item -misize
18017 @opindex misize
18018 Dump instruction size and location in the assembly code.
18020 @item -mpadstruct
18021 @opindex mpadstruct
18022 This option is deprecated.  It pads structures to multiple of 4 bytes,
18023 which is incompatible with the SH ABI@.
18025 @item -msoft-atomic
18026 @opindex msoft-atomic
18027 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
18028 built-in functions.  The generated atomic sequences require support from the 
18029 interrupt / exception handling code of the system and are only suitable for
18030 single-core systems.  They will not perform correctly on multi-core systems.
18031 This option is enabled by default when the target is @code{sh-*-linux*}.
18032 For details on the atomic built-in functions see @ref{__atomic Builtins}.
18034 @item -menable-tas
18035 @opindex menable-tas
18036 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
18037 Notice that depending on the particular hardware and software configuration
18038 this can degrade overall performance due to the operand cache line flushes
18039 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
18040 processors the @code{tas.b} instruction must be used with caution since it
18041 can result in data corruption for certain cache configurations.
18043 @item -mspace
18044 @opindex mspace
18045 Optimize for space instead of speed.  Implied by @option{-Os}.
18047 @item -mprefergot
18048 @opindex mprefergot
18049 When generating position-independent code, emit function calls using
18050 the Global Offset Table instead of the Procedure Linkage Table.
18052 @item -musermode
18053 @opindex musermode
18054 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
18055 if the inlined code would not work in user mode.
18056 This is the default when the target is @code{sh-*-linux*}.
18058 @item -multcost=@var{number}
18059 @opindex multcost=@var{number}
18060 Set the cost to assume for a multiply insn.
18062 @item -mdiv=@var{strategy}
18063 @opindex mdiv=@var{strategy}
18064 Set the division strategy to use for SHmedia code.  @var{strategy} must be
18065 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
18066 inv:call2, inv:fp .
18067 "fp" performs the operation in floating point.  This has a very high latency,
18068 but needs only a few instructions, so it might be a good choice if
18069 your code has enough easily-exploitable ILP to allow the compiler to
18070 schedule the floating-point instructions together with other instructions.
18071 Division by zero causes a floating-point exception.
18072 "inv" uses integer operations to calculate the inverse of the divisor,
18073 and then multiplies the dividend with the inverse.  This strategy allows
18074 cse and hoisting of the inverse calculation.  Division by zero calculates
18075 an unspecified result, but does not trap.
18076 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
18077 have been found, or if the entire operation has been hoisted to the same
18078 place, the last stages of the inverse calculation are intertwined with the
18079 final multiply to reduce the overall latency, at the expense of using a few
18080 more instructions, and thus offering fewer scheduling opportunities with
18081 other code.
18082 "call" calls a library function that usually implements the inv:minlat
18083 strategy.
18084 This gives high code density for m5-*media-nofpu compilations.
18085 "call2" uses a different entry point of the same library function, where it
18086 assumes that a pointer to a lookup table has already been set up, which
18087 exposes the pointer load to cse / code hoisting optimizations.
18088 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
18089 code generation, but if the code stays unoptimized, revert to the "call",
18090 "call2", or "fp" strategies, respectively.  Note that the
18091 potentially-trapping side effect of division by zero is carried by a
18092 separate instruction, so it is possible that all the integer instructions
18093 are hoisted out, but the marker for the side effect stays where it is.
18094 A recombination to fp operations or a call is not possible in that case.
18095 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
18096 that the inverse calculation was nor separated from the multiply, they speed
18097 up division where the dividend fits into 20 bits (plus sign where applicable),
18098 by inserting a test to skip a number of operations in this case; this test
18099 slows down the case of larger dividends.  inv20u assumes the case of a such
18100 a small dividend to be unlikely, and inv20l assumes it to be likely.
18102 @item -maccumulate-outgoing-args
18103 @opindex maccumulate-outgoing-args
18104 Reserve space once for outgoing arguments in the function prologue rather
18105 than around each call.  Generally beneficial for performance and size.  Also
18106 needed for unwinding to avoid changing the stack frame around conditional code.
18108 @item -mdivsi3_libfunc=@var{name}
18109 @opindex mdivsi3_libfunc=@var{name}
18110 Set the name of the library function used for 32-bit signed division to
18111 @var{name}.  This only affect the name used in the call and inv:call
18112 division strategies, and the compiler will still expect the same
18113 sets of input/output/clobbered registers as if this option was not present.
18115 @item -mfixed-range=@var{register-range}
18116 @opindex mfixed-range
18117 Generate code treating the given register range as fixed registers.
18118 A fixed register is one that the register allocator can not use.  This is
18119 useful when compiling kernel code.  A register range is specified as
18120 two registers separated by a dash.  Multiple register ranges can be
18121 specified separated by a comma.
18123 @item -madjust-unroll
18124 @opindex madjust-unroll
18125 Throttle unrolling to avoid thrashing target registers.
18126 This option only has an effect if the gcc code base supports the
18127 TARGET_ADJUST_UNROLL_MAX target hook.
18129 @item -mindexed-addressing
18130 @opindex mindexed-addressing
18131 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
18132 This is only safe if the hardware and/or OS implement 32-bit wrap-around
18133 semantics for the indexed addressing mode.  The architecture allows the
18134 implementation of processors with 64-bit MMU, which the OS could use to
18135 get 32-bit addressing, but since no current hardware implementation supports
18136 this or any other way to make the indexed addressing mode safe to use in
18137 the 32-bit ABI, the default is @option{-mno-indexed-addressing}.
18139 @item -mgettrcost=@var{number}
18140 @opindex mgettrcost=@var{number}
18141 Set the cost assumed for the gettr instruction to @var{number}.
18142 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
18144 @item -mpt-fixed
18145 @opindex mpt-fixed
18146 Assume pt* instructions won't trap.  This will generally generate better
18147 scheduled code, but is unsafe on current hardware.  The current architecture
18148 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
18149 This has the unintentional effect of making it unsafe to schedule ptabs /
18150 ptrel before a branch, or hoist it out of a loop.  For example,
18151 __do_global_ctors, a part of libgcc that runs constructors at program
18152 startup, calls functions in a list which is delimited by @minus{}1.  With the
18153 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
18154 That means that all the constructors will be run a bit quicker, but when
18155 the loop comes to the end of the list, the program crashes because ptabs
18156 loads @minus{}1 into a target register.  Since this option is unsafe for any
18157 hardware implementing the current architecture specification, the default
18158 is -mno-pt-fixed.  Unless the user specifies a specific cost with
18159 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
18160 this deters register allocation using target registers for storing
18161 ordinary integers.
18163 @item -minvalid-symbols
18164 @opindex minvalid-symbols
18165 Assume symbols might be invalid.  Ordinary function symbols generated by
18166 the compiler will always be valid to load with movi/shori/ptabs or
18167 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
18168 to generate symbols that will cause ptabs / ptrel to trap.
18169 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
18170 It will then prevent cross-basic-block cse, hoisting and most scheduling
18171 of symbol loads.  The default is @option{-mno-invalid-symbols}.
18173 @item -mbranch-cost=@var{num}
18174 @opindex mbranch-cost=@var{num}
18175 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
18176 will make the compiler try to generate more branch-free code if possible.  
18177 If not specified the value is selected depending on the processor type that
18178 is being compiled for.
18180 @item -mcbranchdi
18181 @opindex mcbranchdi
18182 Enable the @code{cbranchdi4} instruction pattern.
18184 @item -mcmpeqdi
18185 @opindex mcmpeqdi
18186 Emit the @code{cmpeqdi_t} instruction pattern even when @option{-mcbranchdi}
18187 is in effect.
18189 @item -mfused-madd
18190 @opindex mfused-madd
18191 Allow the usage of the @code{fmac} instruction (floating-point
18192 multiply-accumulate) if the processor type supports it.  Enabling this
18193 option might generate code that produces different numeric floating-point
18194 results compared to strict IEEE 754 arithmetic.
18196 @item -mpretend-cmove
18197 @opindex mpretend-cmove
18198 Prefer zero-displacement conditional branches for conditional move instruction
18199 patterns.  This can result in faster code on the SH4 processor.
18201 @end table
18203 @node Solaris 2 Options
18204 @subsection Solaris 2 Options
18205 @cindex Solaris 2 options
18207 These @samp{-m} options are supported on Solaris 2:
18209 @table @gcctabopt
18210 @item -mimpure-text
18211 @opindex mimpure-text
18212 @option{-mimpure-text}, used in addition to @option{-shared}, tells
18213 the compiler to not pass @option{-z text} to the linker when linking a
18214 shared object.  Using this option, you can link position-dependent
18215 code into a shared object.
18217 @option{-mimpure-text} suppresses the ``relocations remain against
18218 allocatable but non-writable sections'' linker error message.
18219 However, the necessary relocations will trigger copy-on-write, and the
18220 shared object is not actually shared across processes.  Instead of
18221 using @option{-mimpure-text}, you should compile all source code with
18222 @option{-fpic} or @option{-fPIC}.
18224 @end table
18226 These switches are supported in addition to the above on Solaris 2:
18228 @table @gcctabopt
18229 @item -pthreads
18230 @opindex pthreads
18231 Add support for multithreading using the POSIX threads library.  This
18232 option sets flags for both the preprocessor and linker.  This option does
18233 not affect the thread safety of object code produced  by the compiler or
18234 that of libraries supplied with it.
18236 @item -pthread
18237 @opindex pthread
18238 This is a synonym for @option{-pthreads}.
18239 @end table
18241 @node SPARC Options
18242 @subsection SPARC Options
18243 @cindex SPARC options
18245 These @samp{-m} options are supported on the SPARC:
18247 @table @gcctabopt
18248 @item -mno-app-regs
18249 @itemx -mapp-regs
18250 @opindex mno-app-regs
18251 @opindex mapp-regs
18252 Specify @option{-mapp-regs} to generate output using the global registers
18253 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
18254 is the default.
18256 To be fully SVR4 ABI compliant at the cost of some performance loss,
18257 specify @option{-mno-app-regs}.  You should compile libraries and system
18258 software with this option.
18260 @item -mflat
18261 @itemx -mno-flat
18262 @opindex mflat
18263 @opindex mno-flat
18264 With @option{-mflat}, the compiler does not generate save/restore instructions
18265 and uses a ``flat'' or single register window model.  This model is compatible
18266 with the regular register window model.  The local registers and the input
18267 registers (0--5) are still treated as ``call-saved'' registers and will be
18268 saved on the stack as needed.
18270 With @option{-mno-flat} (the default), the compiler generates save/restore
18271 instructions (except for leaf functions).  This is the normal operating mode.
18273 @item -mfpu
18274 @itemx -mhard-float
18275 @opindex mfpu
18276 @opindex mhard-float
18277 Generate output containing floating-point instructions.  This is the
18278 default.
18280 @item -mno-fpu
18281 @itemx -msoft-float
18282 @opindex mno-fpu
18283 @opindex msoft-float
18284 Generate output containing library calls for floating point.
18285 @strong{Warning:} the requisite libraries are not available for all SPARC
18286 targets.  Normally the facilities of the machine's usual C compiler are
18287 used, but this cannot be done directly in cross-compilation.  You must make
18288 your own arrangements to provide suitable library functions for
18289 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
18290 @samp{sparclite-*-*} do provide software floating-point support.
18292 @option{-msoft-float} changes the calling convention in the output file;
18293 therefore, it is only useful if you compile @emph{all} of a program with
18294 this option.  In particular, you need to compile @file{libgcc.a}, the
18295 library that comes with GCC, with @option{-msoft-float} in order for
18296 this to work.
18298 @item -mhard-quad-float
18299 @opindex mhard-quad-float
18300 Generate output containing quad-word (long double) floating-point
18301 instructions.
18303 @item -msoft-quad-float
18304 @opindex msoft-quad-float
18305 Generate output containing library calls for quad-word (long double)
18306 floating-point instructions.  The functions called are those specified
18307 in the SPARC ABI@.  This is the default.
18309 As of this writing, there are no SPARC implementations that have hardware
18310 support for the quad-word floating-point instructions.  They all invoke
18311 a trap handler for one of these instructions, and then the trap handler
18312 emulates the effect of the instruction.  Because of the trap handler overhead,
18313 this is much slower than calling the ABI library routines.  Thus the
18314 @option{-msoft-quad-float} option is the default.
18316 @item -mno-unaligned-doubles
18317 @itemx -munaligned-doubles
18318 @opindex mno-unaligned-doubles
18319 @opindex munaligned-doubles
18320 Assume that doubles have 8-byte alignment.  This is the default.
18322 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
18323 alignment only if they are contained in another type, or if they have an
18324 absolute address.  Otherwise, it assumes they have 4-byte alignment.
18325 Specifying this option avoids some rare compatibility problems with code
18326 generated by other compilers.  It is not the default because it results
18327 in a performance loss, especially for floating-point code.
18329 @item -mno-faster-structs
18330 @itemx -mfaster-structs
18331 @opindex mno-faster-structs
18332 @opindex mfaster-structs
18333 With @option{-mfaster-structs}, the compiler assumes that structures
18334 should have 8-byte alignment.  This enables the use of pairs of
18335 @code{ldd} and @code{std} instructions for copies in structure
18336 assignment, in place of twice as many @code{ld} and @code{st} pairs.
18337 However, the use of this changed alignment directly violates the SPARC
18338 ABI@.  Thus, it's intended only for use on targets where the developer
18339 acknowledges that their resulting code will not be directly in line with
18340 the rules of the ABI@.
18342 @item -mcpu=@var{cpu_type}
18343 @opindex mcpu
18344 Set the instruction set, register set, and instruction scheduling parameters
18345 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
18346 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
18347 @samp{leon}, @samp{sparclite}, @samp{f930}, @samp{f934}, @samp{sparclite86x},
18348 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
18349 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3},
18350 and @samp{niagara4}.
18352 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
18353 which selects the best architecture option for the host processor.
18354 @option{-mcpu=native} has no effect if GCC does not recognize
18355 the processor.
18357 Default instruction scheduling parameters are used for values that select
18358 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
18359 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
18361 Here is a list of each supported architecture and their supported
18362 implementations.
18364 @table @asis
18365 @item v7
18366 cypress
18368 @item v8
18369 supersparc, hypersparc, leon
18371 @item sparclite
18372 f930, f934, sparclite86x
18374 @item sparclet
18375 tsc701
18377 @item v9
18378 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4
18379 @end table
18381 By default (unless configured otherwise), GCC generates code for the V7
18382 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
18383 additionally optimizes it for the Cypress CY7C602 chip, as used in the
18384 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
18385 SPARCStation 1, 2, IPX etc.
18387 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
18388 architecture.  The only difference from V7 code is that the compiler emits
18389 the integer multiply and integer divide instructions which exist in SPARC-V8
18390 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
18391 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
18392 2000 series.
18394 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
18395 the SPARC architecture.  This adds the integer multiply, integer divide step
18396 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
18397 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
18398 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
18399 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
18400 MB86934 chip, which is the more recent SPARClite with FPU@.
18402 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
18403 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
18404 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
18405 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
18406 optimizes it for the TEMIC SPARClet chip.
18408 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
18409 architecture.  This adds 64-bit integer and floating-point move instructions,
18410 3 additional floating-point condition code registers and conditional move
18411 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
18412 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
18413 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
18414 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
18415 @option{-mcpu=niagara}, the compiler additionally optimizes it for
18416 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
18417 additionally optimizes it for Sun UltraSPARC T2 chips. With
18418 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
18419 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
18420 additionally optimizes it for Sun UltraSPARC T4 chips.
18422 @item -mtune=@var{cpu_type}
18423 @opindex mtune
18424 Set the instruction scheduling parameters for machine type
18425 @var{cpu_type}, but do not set the instruction set or register set that the
18426 option @option{-mcpu=@var{cpu_type}} would.
18428 The same values for @option{-mcpu=@var{cpu_type}} can be used for
18429 @option{-mtune=@var{cpu_type}}, but the only useful values are those
18430 that select a particular CPU implementation.  Those are @samp{cypress},
18431 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{f930}, @samp{f934},
18432 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc}, @samp{ultrasparc3},
18433 @samp{niagara}, @samp{niagara2}, @samp{niagara3} and @samp{niagara4}.  With
18434 native Solaris and GNU/Linux toolchains, @samp{native} can also be used.
18436 @item -mv8plus
18437 @itemx -mno-v8plus
18438 @opindex mv8plus
18439 @opindex mno-v8plus
18440 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
18441 difference from the V8 ABI is that the global and out registers are
18442 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
18443 mode for all SPARC-V9 processors.
18445 @item -mvis
18446 @itemx -mno-vis
18447 @opindex mvis
18448 @opindex mno-vis
18449 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
18450 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
18452 @item -mvis2
18453 @itemx -mno-vis2
18454 @opindex mvis2
18455 @opindex mno-vis2
18456 With @option{-mvis2}, GCC generates code that takes advantage of
18457 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
18458 default is @option{-mvis2} when targetting a cpu that supports such
18459 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
18460 also sets @option{-mvis}.
18462 @item -mvis3
18463 @itemx -mno-vis3
18464 @opindex mvis3
18465 @opindex mno-vis3
18466 With @option{-mvis3}, GCC generates code that takes advantage of
18467 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
18468 default is @option{-mvis3} when targetting a cpu that supports such
18469 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
18470 also sets @option{-mvis2} and @option{-mvis}.
18472 @item -mpopc
18473 @itemx -mno-popc
18474 @opindex mpopc
18475 @opindex mno-popc
18476 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
18477 population count instruction.  The default is @option{-mpopc}
18478 when targetting a cpu that supports such instructions, such as Niagara-2 and
18479 later.
18481 @item -mfmaf
18482 @itemx -mno-fmaf
18483 @opindex mfmaf
18484 @opindex mno-fmaf
18485 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
18486 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
18487 when targetting a cpu that supports such instructions, such as Niagara-3 and
18488 later.
18490 @item -mfix-at697f
18491 @opindex mfix-at697f
18492 Enable the documented workaround for the single erratum of the Atmel AT697F
18493 processor (which corresponds to erratum #13 of the AT697E processor).
18494 @end table
18496 These @samp{-m} options are supported in addition to the above
18497 on SPARC-V9 processors in 64-bit environments:
18499 @table @gcctabopt
18500 @item -mlittle-endian
18501 @opindex mlittle-endian
18502 Generate code for a processor running in little-endian mode.  It is only
18503 available for a few configurations and most notably not on Solaris and Linux.
18505 @item -m32
18506 @itemx -m64
18507 @opindex m32
18508 @opindex m64
18509 Generate code for a 32-bit or 64-bit environment.
18510 The 32-bit environment sets int, long and pointer to 32 bits.
18511 The 64-bit environment sets int to 32 bits and long and pointer
18512 to 64 bits.
18514 @item -mcmodel=@var{which}
18515 @opindex mcmodel
18516 Set the code model to one of
18518 @table @samp
18519 @item medlow
18520 The Medium/Low code model: 64-bit addresses, programs
18521 must be linked in the low 32 bits of memory.  Programs can be statically
18522 or dynamically linked.
18524 @item medmid
18525 The Medium/Middle code model: 64-bit addresses, programs
18526 must be linked in the low 44 bits of memory, the text and data segments must
18527 be less than 2GB in size and the data segment must be located within 2GB of
18528 the text segment.
18530 @item medany
18531 The Medium/Anywhere code model: 64-bit addresses, programs
18532 may be linked anywhere in memory, the text and data segments must be less
18533 than 2GB in size and the data segment must be located within 2GB of the
18534 text segment.
18536 @item embmedany
18537 The Medium/Anywhere code model for embedded systems:
18538 64-bit addresses, the text and data segments must be less than 2GB in
18539 size, both starting anywhere in memory (determined at link time).  The
18540 global register %g4 points to the base of the data segment.  Programs
18541 are statically linked and PIC is not supported.
18542 @end table
18544 @item -mmemory-model=@var{mem-model}
18545 @opindex mmemory-model
18546 Set the memory model in force on the processor to one of
18548 @table @samp
18549 @item default
18550 The default memory model for the processor and operating system.
18552 @item rmo
18553 Relaxed Memory Order
18555 @item pso
18556 Partial Store Order
18558 @item tso
18559 Total Store Order
18561 @item sc
18562 Sequential Consistency
18563 @end table
18565 These memory models are formally defined in Appendix D of the Sparc V9
18566 architecture manual, as set in the processor's @code{PSTATE.MM} field.
18568 @item -mstack-bias
18569 @itemx -mno-stack-bias
18570 @opindex mstack-bias
18571 @opindex mno-stack-bias
18572 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
18573 frame pointer if present, are offset by @minus{}2047 which must be added back
18574 when making stack frame references.  This is the default in 64-bit mode.
18575 Otherwise, assume no such offset is present.
18576 @end table
18578 @node SPU Options
18579 @subsection SPU Options
18580 @cindex SPU options
18582 These @samp{-m} options are supported on the SPU:
18584 @table @gcctabopt
18585 @item -mwarn-reloc
18586 @itemx -merror-reloc
18587 @opindex mwarn-reloc
18588 @opindex merror-reloc
18590 The loader for SPU does not handle dynamic relocations.  By default, GCC
18591 will give an error when it generates code that requires a dynamic
18592 relocation.  @option{-mno-error-reloc} disables the error,
18593 @option{-mwarn-reloc} will generate a warning instead.
18595 @item -msafe-dma
18596 @itemx -munsafe-dma
18597 @opindex msafe-dma
18598 @opindex munsafe-dma
18600 Instructions that initiate or test completion of DMA must not be
18601 reordered with respect to loads and stores of the memory that is being
18602 accessed.  Users typically address this problem using the volatile
18603 keyword, but that can lead to inefficient code in places where the
18604 memory is known to not change.  Rather than mark the memory as volatile
18605 we treat the DMA instructions as potentially effecting all memory.  With
18606 @option{-munsafe-dma} users must use the volatile keyword to protect
18607 memory accesses.
18609 @item -mbranch-hints
18610 @opindex mbranch-hints
18612 By default, GCC will generate a branch hint instruction to avoid
18613 pipeline stalls for always taken or probably taken branches.  A hint
18614 will not be generated closer than 8 instructions away from its branch.
18615 There is little reason to disable them, except for debugging purposes,
18616 or to make an object a little bit smaller.
18618 @item -msmall-mem
18619 @itemx -mlarge-mem
18620 @opindex msmall-mem
18621 @opindex mlarge-mem
18623 By default, GCC generates code assuming that addresses are never larger
18624 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
18625 a full 32-bit address.
18627 @item -mstdmain
18628 @opindex mstdmain
18630 By default, GCC links against startup code that assumes the SPU-style
18631 main function interface (which has an unconventional parameter list).
18632 With @option{-mstdmain}, GCC will link your program against startup
18633 code that assumes a C99-style interface to @code{main}, including a
18634 local copy of @code{argv} strings.
18636 @item -mfixed-range=@var{register-range}
18637 @opindex mfixed-range
18638 Generate code treating the given register range as fixed registers.
18639 A fixed register is one that the register allocator can not use.  This is
18640 useful when compiling kernel code.  A register range is specified as
18641 two registers separated by a dash.  Multiple register ranges can be
18642 specified separated by a comma.
18644 @item -mea32
18645 @itemx -mea64
18646 @opindex mea32
18647 @opindex mea64
18648 Compile code assuming that pointers to the PPU address space accessed
18649 via the @code{__ea} named address space qualifier are either 32 or 64
18650 bits wide.  The default is 32 bits.  As this is an ABI changing option,
18651 all object code in an executable must be compiled with the same setting.
18653 @item -maddress-space-conversion
18654 @itemx -mno-address-space-conversion
18655 @opindex maddress-space-conversion
18656 @opindex mno-address-space-conversion
18657 Allow/disallow treating the @code{__ea} address space as superset
18658 of the generic address space.  This enables explicit type casts
18659 between @code{__ea} and generic pointer as well as implicit
18660 conversions of generic pointers to @code{__ea} pointers.  The
18661 default is to allow address space pointer conversions.
18663 @item -mcache-size=@var{cache-size}
18664 @opindex mcache-size
18665 This option controls the version of libgcc that the compiler links to an
18666 executable and selects a software-managed cache for accessing variables
18667 in the @code{__ea} address space with a particular cache size.  Possible
18668 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
18669 and @samp{128}.  The default cache size is 64KB.
18671 @item -matomic-updates
18672 @itemx -mno-atomic-updates
18673 @opindex matomic-updates
18674 @opindex mno-atomic-updates
18675 This option controls the version of libgcc that the compiler links to an
18676 executable and selects whether atomic updates to the software-managed
18677 cache of PPU-side variables are used.  If you use atomic updates, changes
18678 to a PPU variable from SPU code using the @code{__ea} named address space
18679 qualifier will not interfere with changes to other PPU variables residing
18680 in the same cache line from PPU code.  If you do not use atomic updates,
18681 such interference may occur; however, writing back cache lines will be
18682 more efficient.  The default behavior is to use atomic updates.
18684 @item -mdual-nops
18685 @itemx -mdual-nops=@var{n}
18686 @opindex mdual-nops
18687 By default, GCC will insert nops to increase dual issue when it expects
18688 it to increase performance.  @var{n} can be a value from 0 to 10.  A
18689 smaller @var{n} will insert fewer nops.  10 is the default, 0 is the
18690 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
18692 @item -mhint-max-nops=@var{n}
18693 @opindex mhint-max-nops
18694 Maximum number of nops to insert for a branch hint.  A branch hint must
18695 be at least 8 instructions away from the branch it is effecting.  GCC
18696 will insert up to @var{n} nops to enforce this, otherwise it will not
18697 generate the branch hint.
18699 @item -mhint-max-distance=@var{n}
18700 @opindex mhint-max-distance
18701 The encoding of the branch hint instruction limits the hint to be within
18702 256 instructions of the branch it is effecting.  By default, GCC makes
18703 sure it is within 125.
18705 @item -msafe-hints
18706 @opindex msafe-hints
18707 Work around a hardware bug that causes the SPU to stall indefinitely.
18708 By default, GCC will insert the @code{hbrp} instruction to make sure
18709 this stall won't happen.
18711 @end table
18713 @node System V Options
18714 @subsection Options for System V
18716 These additional options are available on System V Release 4 for
18717 compatibility with other compilers on those systems:
18719 @table @gcctabopt
18720 @item -G
18721 @opindex G
18722 Create a shared object.
18723 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
18725 @item -Qy
18726 @opindex Qy
18727 Identify the versions of each tool used by the compiler, in a
18728 @code{.ident} assembler directive in the output.
18730 @item -Qn
18731 @opindex Qn
18732 Refrain from adding @code{.ident} directives to the output file (this is
18733 the default).
18735 @item -YP,@var{dirs}
18736 @opindex YP
18737 Search the directories @var{dirs}, and no others, for libraries
18738 specified with @option{-l}.
18740 @item -Ym,@var{dir}
18741 @opindex Ym
18742 Look in the directory @var{dir} to find the M4 preprocessor.
18743 The assembler uses this option.
18744 @c This is supposed to go with a -Yd for predefined M4 macro files, but
18745 @c the generic assembler that comes with Solaris takes just -Ym.
18746 @end table
18748 @node TILE-Gx Options
18749 @subsection TILE-Gx Options
18750 @cindex TILE-Gx options
18752 These @samp{-m} options are supported on the TILE-Gx:
18754 @table @gcctabopt
18755 @item -mcpu=@var{name}
18756 @opindex mcpu
18757 Selects the type of CPU to be targeted.  Currently the only supported
18758 type is @samp{tilegx}.
18760 @item -m32
18761 @itemx -m64
18762 @opindex m32
18763 @opindex m64
18764 Generate code for a 32-bit or 64-bit environment.  The 32-bit
18765 environment sets int, long, and pointer to 32 bits.  The 64-bit
18766 environment sets int to 32 bits and long and pointer to 64 bits.
18767 @end table
18769 @node TILEPro Options
18770 @subsection TILEPro Options
18771 @cindex TILEPro options
18773 These @samp{-m} options are supported on the TILEPro:
18775 @table @gcctabopt
18776 @item -mcpu=@var{name}
18777 @opindex mcpu
18778 Selects the type of CPU to be targeted.  Currently the only supported
18779 type is @samp{tilepro}.
18781 @item -m32
18782 @opindex m32
18783 Generate code for a 32-bit environment, which sets int, long, and
18784 pointer to 32 bits.  This is the only supported behavior so the flag
18785 is essentially ignored.
18786 @end table
18788 @node V850 Options
18789 @subsection V850 Options
18790 @cindex V850 Options
18792 These @samp{-m} options are defined for V850 implementations:
18794 @table @gcctabopt
18795 @item -mlong-calls
18796 @itemx -mno-long-calls
18797 @opindex mlong-calls
18798 @opindex mno-long-calls
18799 Treat all calls as being far away (near).  If calls are assumed to be
18800 far away, the compiler will always load the functions address up into a
18801 register, and call indirect through the pointer.
18803 @item -mno-ep
18804 @itemx -mep
18805 @opindex mno-ep
18806 @opindex mep
18807 Do not optimize (do optimize) basic blocks that use the same index
18808 pointer 4 or more times to copy pointer into the @code{ep} register, and
18809 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
18810 option is on by default if you optimize.
18812 @item -mno-prolog-function
18813 @itemx -mprolog-function
18814 @opindex mno-prolog-function
18815 @opindex mprolog-function
18816 Do not use (do use) external functions to save and restore registers
18817 at the prologue and epilogue of a function.  The external functions
18818 are slower, but use less code space if more than one function saves
18819 the same number of registers.  The @option{-mprolog-function} option
18820 is on by default if you optimize.
18822 @item -mspace
18823 @opindex mspace
18824 Try to make the code as small as possible.  At present, this just turns
18825 on the @option{-mep} and @option{-mprolog-function} options.
18827 @item -mtda=@var{n}
18828 @opindex mtda
18829 Put static or global variables whose size is @var{n} bytes or less into
18830 the tiny data area that register @code{ep} points to.  The tiny data
18831 area can hold up to 256 bytes in total (128 bytes for byte references).
18833 @item -msda=@var{n}
18834 @opindex msda
18835 Put static or global variables whose size is @var{n} bytes or less into
18836 the small data area that register @code{gp} points to.  The small data
18837 area can hold up to 64 kilobytes.
18839 @item -mzda=@var{n}
18840 @opindex mzda
18841 Put static or global variables whose size is @var{n} bytes or less into
18842 the first 32 kilobytes of memory.
18844 @item -mv850
18845 @opindex mv850
18846 Specify that the target processor is the V850.
18848 @item -mbig-switch
18849 @opindex mbig-switch
18850 Generate code suitable for big switch tables.  Use this option only if
18851 the assembler/linker complain about out of range branches within a switch
18852 table.
18854 @item -mapp-regs
18855 @opindex mapp-regs
18856 This option will cause r2 and r5 to be used in the code generated by
18857 the compiler.  This setting is the default.
18859 @item -mno-app-regs
18860 @opindex mno-app-regs
18861 This option will cause r2 and r5 to be treated as fixed registers.
18863 @item -mv850e2v3
18864 @opindex mv850e2v3
18865 Specify that the target processor is the V850E2V3.  The preprocessor
18866 constants @samp{__v850e2v3__} will be defined if
18867 this option is used.
18869 @item -mv850e2
18870 @opindex mv850e2
18871 Specify that the target processor is the V850E2.  The preprocessor
18872 constants @samp{__v850e2__} will be defined if this option is used.
18874 @item -mv850e1
18875 @opindex mv850e1
18876 Specify that the target processor is the V850E1.  The preprocessor
18877 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
18878 this option is used.
18880 @item -mv850es
18881 @opindex mv850es
18882 Specify that the target processor is the V850ES.  This is an alias for
18883 the @option{-mv850e1} option.
18885 @item -mv850e
18886 @opindex mv850e
18887 Specify that the target processor is the V850E@.  The preprocessor
18888 constant @samp{__v850e__} will be defined if this option is used.
18890 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
18891 nor @option{-mv850e2} nor @option{-mv850e2v3}
18892 are defined then a default target processor will be chosen and the
18893 relevant @samp{__v850*__} preprocessor constant will be defined.
18895 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
18896 defined, regardless of which processor variant is the target.
18898 @item -mdisable-callt
18899 @opindex mdisable-callt
18900 This option will suppress generation of the CALLT instruction for the
18901 v850e, v850e1, v850e2 and v850e2v3 flavors of the v850 architecture.  The default is
18902 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
18904 @end table
18906 @node VAX Options
18907 @subsection VAX Options
18908 @cindex VAX options
18910 These @samp{-m} options are defined for the VAX:
18912 @table @gcctabopt
18913 @item -munix
18914 @opindex munix
18915 Do not output certain jump instructions (@code{aobleq} and so on)
18916 that the Unix assembler for the VAX cannot handle across long
18917 ranges.
18919 @item -mgnu
18920 @opindex mgnu
18921 Do output those jump instructions, on the assumption that you
18922 will assemble with the GNU assembler.
18924 @item -mg
18925 @opindex mg
18926 Output code for G-format floating-point numbers instead of D-format.
18927 @end table
18929 @node VxWorks Options
18930 @subsection VxWorks Options
18931 @cindex VxWorks Options
18933 The options in this section are defined for all VxWorks targets.
18934 Options specific to the target hardware are listed with the other
18935 options for that target.
18937 @table @gcctabopt
18938 @item -mrtp
18939 @opindex mrtp
18940 GCC can generate code for both VxWorks kernels and real time processes
18941 (RTPs).  This option switches from the former to the latter.  It also
18942 defines the preprocessor macro @code{__RTP__}.
18944 @item -non-static
18945 @opindex non-static
18946 Link an RTP executable against shared libraries rather than static
18947 libraries.  The options @option{-static} and @option{-shared} can
18948 also be used for RTPs (@pxref{Link Options}); @option{-static}
18949 is the default.
18951 @item -Bstatic
18952 @itemx -Bdynamic
18953 @opindex Bstatic
18954 @opindex Bdynamic
18955 These options are passed down to the linker.  They are defined for
18956 compatibility with Diab.
18958 @item -Xbind-lazy
18959 @opindex Xbind-lazy
18960 Enable lazy binding of function calls.  This option is equivalent to
18961 @option{-Wl,-z,now} and is defined for compatibility with Diab.
18963 @item -Xbind-now
18964 @opindex Xbind-now
18965 Disable lazy binding of function calls.  This option is the default and
18966 is defined for compatibility with Diab.
18967 @end table
18969 @node x86-64 Options
18970 @subsection x86-64 Options
18971 @cindex x86-64 options
18973 These are listed under @xref{i386 and x86-64 Options}.
18975 @node Xstormy16 Options
18976 @subsection Xstormy16 Options
18977 @cindex Xstormy16 Options
18979 These options are defined for Xstormy16:
18981 @table @gcctabopt
18982 @item -msim
18983 @opindex msim
18984 Choose startup files and linker script suitable for the simulator.
18985 @end table
18987 @node Xtensa Options
18988 @subsection Xtensa Options
18989 @cindex Xtensa Options
18991 These options are supported for Xtensa targets:
18993 @table @gcctabopt
18994 @item -mconst16
18995 @itemx -mno-const16
18996 @opindex mconst16
18997 @opindex mno-const16
18998 Enable or disable use of @code{CONST16} instructions for loading
18999 constant values.  The @code{CONST16} instruction is currently not a
19000 standard option from Tensilica.  When enabled, @code{CONST16}
19001 instructions are always used in place of the standard @code{L32R}
19002 instructions.  The use of @code{CONST16} is enabled by default only if
19003 the @code{L32R} instruction is not available.
19005 @item -mfused-madd
19006 @itemx -mno-fused-madd
19007 @opindex mfused-madd
19008 @opindex mno-fused-madd
19009 Enable or disable use of fused multiply/add and multiply/subtract
19010 instructions in the floating-point option.  This has no effect if the
19011 floating-point option is not also enabled.  Disabling fused multiply/add
19012 and multiply/subtract instructions forces the compiler to use separate
19013 instructions for the multiply and add/subtract operations.  This may be
19014 desirable in some cases where strict IEEE 754-compliant results are
19015 required: the fused multiply add/subtract instructions do not round the
19016 intermediate result, thereby producing results with @emph{more} bits of
19017 precision than specified by the IEEE standard.  Disabling fused multiply
19018 add/subtract instructions also ensures that the program output is not
19019 sensitive to the compiler's ability to combine multiply and add/subtract
19020 operations.
19022 @item -mserialize-volatile
19023 @itemx -mno-serialize-volatile
19024 @opindex mserialize-volatile
19025 @opindex mno-serialize-volatile
19026 When this option is enabled, GCC inserts @code{MEMW} instructions before
19027 @code{volatile} memory references to guarantee sequential consistency.
19028 The default is @option{-mserialize-volatile}.  Use
19029 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
19031 @item -mforce-no-pic
19032 @opindex mforce-no-pic
19033 For targets, like GNU/Linux, where all user-mode Xtensa code must be
19034 position-independent code (PIC), this option disables PIC for compiling
19035 kernel code.
19037 @item -mtext-section-literals
19038 @itemx -mno-text-section-literals
19039 @opindex mtext-section-literals
19040 @opindex mno-text-section-literals
19041 Control the treatment of literal pools.  The default is
19042 @option{-mno-text-section-literals}, which places literals in a separate
19043 section in the output file.  This allows the literal pool to be placed
19044 in a data RAM/ROM, and it also allows the linker to combine literal
19045 pools from separate object files to remove redundant literals and
19046 improve code size.  With @option{-mtext-section-literals}, the literals
19047 are interspersed in the text section in order to keep them as close as
19048 possible to their references.  This may be necessary for large assembly
19049 files.
19051 @item -mtarget-align
19052 @itemx -mno-target-align
19053 @opindex mtarget-align
19054 @opindex mno-target-align
19055 When this option is enabled, GCC instructs the assembler to
19056 automatically align instructions to reduce branch penalties at the
19057 expense of some code density.  The assembler attempts to widen density
19058 instructions to align branch targets and the instructions following call
19059 instructions.  If there are not enough preceding safe density
19060 instructions to align a target, no widening will be performed.  The
19061 default is @option{-mtarget-align}.  These options do not affect the
19062 treatment of auto-aligned instructions like @code{LOOP}, which the
19063 assembler will always align, either by widening density instructions or
19064 by inserting no-op instructions.
19066 @item -mlongcalls
19067 @itemx -mno-longcalls
19068 @opindex mlongcalls
19069 @opindex mno-longcalls
19070 When this option is enabled, GCC instructs the assembler to translate
19071 direct calls to indirect calls unless it can determine that the target
19072 of a direct call is in the range allowed by the call instruction.  This
19073 translation typically occurs for calls to functions in other source
19074 files.  Specifically, the assembler translates a direct @code{CALL}
19075 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
19076 The default is @option{-mno-longcalls}.  This option should be used in
19077 programs where the call target can potentially be out of range.  This
19078 option is implemented in the assembler, not the compiler, so the
19079 assembly code generated by GCC will still show direct call
19080 instructions---look at the disassembled object code to see the actual
19081 instructions.  Note that the assembler will use an indirect call for
19082 every cross-file call, not just those that really will be out of range.
19083 @end table
19085 @node zSeries Options
19086 @subsection zSeries Options
19087 @cindex zSeries options
19089 These are listed under @xref{S/390 and zSeries Options}.
19091 @node Code Gen Options
19092 @section Options for Code Generation Conventions
19093 @cindex code generation conventions
19094 @cindex options, code generation
19095 @cindex run-time options
19097 These machine-independent options control the interface conventions
19098 used in code generation.
19100 Most of them have both positive and negative forms; the negative form
19101 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
19102 one of the forms is listed---the one that is not the default.  You
19103 can figure out the other form by either removing @samp{no-} or adding
19106 @table @gcctabopt
19107 @item -fbounds-check
19108 @opindex fbounds-check
19109 For front ends that support it, generate additional code to check that
19110 indices used to access arrays are within the declared range.  This is
19111 currently only supported by the Java and Fortran front ends, where
19112 this option defaults to true and false respectively.
19114 @item -ftrapv
19115 @opindex ftrapv
19116 This option generates traps for signed overflow on addition, subtraction,
19117 multiplication operations.
19119 @item -fwrapv
19120 @opindex fwrapv
19121 This option instructs the compiler to assume that signed arithmetic
19122 overflow of addition, subtraction and multiplication wraps around
19123 using twos-complement representation.  This flag enables some optimizations
19124 and disables others.  This option is enabled by default for the Java
19125 front end, as required by the Java language specification.
19127 @item -fexceptions
19128 @opindex fexceptions
19129 Enable exception handling.  Generates extra code needed to propagate
19130 exceptions.  For some targets, this implies GCC will generate frame
19131 unwind information for all functions, which can produce significant data
19132 size overhead, although it does not affect execution.  If you do not
19133 specify this option, GCC will enable it by default for languages like
19134 C++ that normally require exception handling, and disable it for
19135 languages like C that do not normally require it.  However, you may need
19136 to enable this option when compiling C code that needs to interoperate
19137 properly with exception handlers written in C++.  You may also wish to
19138 disable this option if you are compiling older C++ programs that don't
19139 use exception handling.
19141 @item -fnon-call-exceptions
19142 @opindex fnon-call-exceptions
19143 Generate code that allows trapping instructions to throw exceptions.
19144 Note that this requires platform-specific runtime support that does
19145 not exist everywhere.  Moreover, it only allows @emph{trapping}
19146 instructions to throw exceptions, i.e.@: memory references or floating-point
19147 instructions.  It does not allow exceptions to be thrown from
19148 arbitrary signal handlers such as @code{SIGALRM}.
19150 @item -funwind-tables
19151 @opindex funwind-tables
19152 Similar to @option{-fexceptions}, except that it will just generate any needed
19153 static data, but will not affect the generated code in any other way.
19154 You will normally not enable this option; instead, a language processor
19155 that needs this handling would enable it on your behalf.
19157 @item -fasynchronous-unwind-tables
19158 @opindex fasynchronous-unwind-tables
19159 Generate unwind table in dwarf2 format, if supported by target machine.  The
19160 table is exact at each instruction boundary, so it can be used for stack
19161 unwinding from asynchronous events (such as debugger or garbage collector).
19163 @item -fpcc-struct-return
19164 @opindex fpcc-struct-return
19165 Return ``short'' @code{struct} and @code{union} values in memory like
19166 longer ones, rather than in registers.  This convention is less
19167 efficient, but it has the advantage of allowing intercallability between
19168 GCC-compiled files and files compiled with other compilers, particularly
19169 the Portable C Compiler (pcc).
19171 The precise convention for returning structures in memory depends
19172 on the target configuration macros.
19174 Short structures and unions are those whose size and alignment match
19175 that of some integer type.
19177 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
19178 switch is not binary compatible with code compiled with the
19179 @option{-freg-struct-return} switch.
19180 Use it to conform to a non-default application binary interface.
19182 @item -freg-struct-return
19183 @opindex freg-struct-return
19184 Return @code{struct} and @code{union} values in registers when possible.
19185 This is more efficient for small structures than
19186 @option{-fpcc-struct-return}.
19188 If you specify neither @option{-fpcc-struct-return} nor
19189 @option{-freg-struct-return}, GCC defaults to whichever convention is
19190 standard for the target.  If there is no standard convention, GCC
19191 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
19192 the principal compiler.  In those cases, we can choose the standard, and
19193 we chose the more efficient register return alternative.
19195 @strong{Warning:} code compiled with the @option{-freg-struct-return}
19196 switch is not binary compatible with code compiled with the
19197 @option{-fpcc-struct-return} switch.
19198 Use it to conform to a non-default application binary interface.
19200 @item -fshort-enums
19201 @opindex fshort-enums
19202 Allocate to an @code{enum} type only as many bytes as it needs for the
19203 declared range of possible values.  Specifically, the @code{enum} type
19204 will be equivalent to the smallest integer type that has enough room.
19206 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
19207 code that is not binary compatible with code generated without that switch.
19208 Use it to conform to a non-default application binary interface.
19210 @item -fshort-double
19211 @opindex fshort-double
19212 Use the same size for @code{double} as for @code{float}.
19214 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
19215 code that is not binary compatible with code generated without that switch.
19216 Use it to conform to a non-default application binary interface.
19218 @item -fshort-wchar
19219 @opindex fshort-wchar
19220 Override the underlying type for @samp{wchar_t} to be @samp{short
19221 unsigned int} instead of the default for the target.  This option is
19222 useful for building programs to run under WINE@.
19224 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
19225 code that is not binary compatible with code generated without that switch.
19226 Use it to conform to a non-default application binary interface.
19228 @item -fno-common
19229 @opindex fno-common
19230 In C code, controls the placement of uninitialized global variables.
19231 Unix C compilers have traditionally permitted multiple definitions of
19232 such variables in different compilation units by placing the variables
19233 in a common block.
19234 This is the behavior specified by @option{-fcommon}, and is the default
19235 for GCC on most targets.
19236 On the other hand, this behavior is not required by ISO C, and on some
19237 targets may carry a speed or code size penalty on variable references.
19238 The @option{-fno-common} option specifies that the compiler should place
19239 uninitialized global variables in the data section of the object file,
19240 rather than generating them as common blocks.
19241 This has the effect that if the same variable is declared
19242 (without @code{extern}) in two different compilations,
19243 you will get a multiple-definition error when you link them.
19244 In this case, you must compile with @option{-fcommon} instead.
19245 Compiling with @option{-fno-common} is useful on targets for which
19246 it provides better performance, or if you wish to verify that the
19247 program will work on other systems that always treat uninitialized
19248 variable declarations this way.
19250 @item -fno-ident
19251 @opindex fno-ident
19252 Ignore the @samp{#ident} directive.
19254 @item -finhibit-size-directive
19255 @opindex finhibit-size-directive
19256 Don't output a @code{.size} assembler directive, or anything else that
19257 would cause trouble if the function is split in the middle, and the
19258 two halves are placed at locations far apart in memory.  This option is
19259 used when compiling @file{crtstuff.c}; you should not need to use it
19260 for anything else.
19262 @item -fverbose-asm
19263 @opindex fverbose-asm
19264 Put extra commentary information in the generated assembly code to
19265 make it more readable.  This option is generally only of use to those
19266 who actually need to read the generated assembly code (perhaps while
19267 debugging the compiler itself).
19269 @option{-fno-verbose-asm}, the default, causes the
19270 extra information to be omitted and is useful when comparing two assembler
19271 files.
19273 @item -frecord-gcc-switches
19274 @opindex frecord-gcc-switches
19275 This switch causes the command line that was used to invoke the
19276 compiler to be recorded into the object file that is being created.
19277 This switch is only implemented on some targets and the exact format
19278 of the recording is target and binary file format dependent, but it
19279 usually takes the form of a section containing ASCII text.  This
19280 switch is related to the @option{-fverbose-asm} switch, but that
19281 switch only records information in the assembler output file as
19282 comments, so it never reaches the object file.
19283 See also @option{-grecord-gcc-switches} for another
19284 way of storing compiler options into the object file.
19286 @item -fpic
19287 @opindex fpic
19288 @cindex global offset table
19289 @cindex PIC
19290 Generate position-independent code (PIC) suitable for use in a shared
19291 library, if supported for the target machine.  Such code accesses all
19292 constant addresses through a global offset table (GOT)@.  The dynamic
19293 loader resolves the GOT entries when the program starts (the dynamic
19294 loader is not part of GCC; it is part of the operating system).  If
19295 the GOT size for the linked executable exceeds a machine-specific
19296 maximum size, you get an error message from the linker indicating that
19297 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
19298 instead.  (These maximums are 8k on the SPARC and 32k
19299 on the m68k and RS/6000.  The 386 has no such limit.)
19301 Position-independent code requires special support, and therefore works
19302 only on certain machines.  For the 386, GCC supports PIC for System V
19303 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
19304 position-independent.
19306 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
19307 are defined to 1.
19309 @item -fPIC
19310 @opindex fPIC
19311 If supported for the target machine, emit position-independent code,
19312 suitable for dynamic linking and avoiding any limit on the size of the
19313 global offset table.  This option makes a difference on the m68k,
19314 PowerPC and SPARC@.
19316 Position-independent code requires special support, and therefore works
19317 only on certain machines.
19319 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
19320 are defined to 2.
19322 @item -fpie
19323 @itemx -fPIE
19324 @opindex fpie
19325 @opindex fPIE
19326 These options are similar to @option{-fpic} and @option{-fPIC}, but
19327 generated position independent code can be only linked into executables.
19328 Usually these options are used when @option{-pie} GCC option will be
19329 used during linking.
19331 @option{-fpie} and @option{-fPIE} both define the macros
19332 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
19333 for @option{-fpie} and 2 for @option{-fPIE}.
19335 @item -fno-jump-tables
19336 @opindex fno-jump-tables
19337 Do not use jump tables for switch statements even where it would be
19338 more efficient than other code generation strategies.  This option is
19339 of use in conjunction with @option{-fpic} or @option{-fPIC} for
19340 building code that forms part of a dynamic linker and cannot
19341 reference the address of a jump table.  On some targets, jump tables
19342 do not require a GOT and this option is not needed.
19344 @item -ffixed-@var{reg}
19345 @opindex ffixed
19346 Treat the register named @var{reg} as a fixed register; generated code
19347 should never refer to it (except perhaps as a stack pointer, frame
19348 pointer or in some other fixed role).
19350 @var{reg} must be the name of a register.  The register names accepted
19351 are machine-specific and are defined in the @code{REGISTER_NAMES}
19352 macro in the machine description macro file.
19354 This flag does not have a negative form, because it specifies a
19355 three-way choice.
19357 @item -fcall-used-@var{reg}
19358 @opindex fcall-used
19359 Treat the register named @var{reg} as an allocable register that is
19360 clobbered by function calls.  It may be allocated for temporaries or
19361 variables that do not live across a call.  Functions compiled this way
19362 will not save and restore the register @var{reg}.
19364 It is an error to used this flag with the frame pointer or stack pointer.
19365 Use of this flag for other registers that have fixed pervasive roles in
19366 the machine's execution model will produce disastrous results.
19368 This flag does not have a negative form, because it specifies a
19369 three-way choice.
19371 @item -fcall-saved-@var{reg}
19372 @opindex fcall-saved
19373 Treat the register named @var{reg} as an allocable register saved by
19374 functions.  It may be allocated even for temporaries or variables that
19375 live across a call.  Functions compiled this way will save and restore
19376 the register @var{reg} if they use it.
19378 It is an error to used this flag with the frame pointer or stack pointer.
19379 Use of this flag for other registers that have fixed pervasive roles in
19380 the machine's execution model will produce disastrous results.
19382 A different sort of disaster will result from the use of this flag for
19383 a register in which function values may be returned.
19385 This flag does not have a negative form, because it specifies a
19386 three-way choice.
19388 @item -fpack-struct[=@var{n}]
19389 @opindex fpack-struct
19390 Without a value specified, pack all structure members together without
19391 holes.  When a value is specified (which must be a small power of two), pack
19392 structure members according to this value, representing the maximum
19393 alignment (that is, objects with default alignment requirements larger than
19394 this will be output potentially unaligned at the next fitting location.
19396 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
19397 code that is not binary compatible with code generated without that switch.
19398 Additionally, it makes the code suboptimal.
19399 Use it to conform to a non-default application binary interface.
19401 @item -finstrument-functions
19402 @opindex finstrument-functions
19403 Generate instrumentation calls for entry and exit to functions.  Just
19404 after function entry and just before function exit, the following
19405 profiling functions will be called with the address of the current
19406 function and its call site.  (On some platforms,
19407 @code{__builtin_return_address} does not work beyond the current
19408 function, so the call site information may not be available to the
19409 profiling functions otherwise.)
19411 @smallexample
19412 void __cyg_profile_func_enter (void *this_fn,
19413                                void *call_site);
19414 void __cyg_profile_func_exit  (void *this_fn,
19415                                void *call_site);
19416 @end smallexample
19418 The first argument is the address of the start of the current function,
19419 which may be looked up exactly in the symbol table.
19421 This instrumentation is also done for functions expanded inline in other
19422 functions.  The profiling calls will indicate where, conceptually, the
19423 inline function is entered and exited.  This means that addressable
19424 versions of such functions must be available.  If all your uses of a
19425 function are expanded inline, this may mean an additional expansion of
19426 code size.  If you use @samp{extern inline} in your C code, an
19427 addressable version of such functions must be provided.  (This is
19428 normally the case anyways, but if you get lucky and the optimizer always
19429 expands the functions inline, you might have gotten away without
19430 providing static copies.)
19432 A function may be given the attribute @code{no_instrument_function}, in
19433 which case this instrumentation will not be done.  This can be used, for
19434 example, for the profiling functions listed above, high-priority
19435 interrupt routines, and any functions from which the profiling functions
19436 cannot safely be called (perhaps signal handlers, if the profiling
19437 routines generate output or allocate memory).
19439 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
19440 @opindex finstrument-functions-exclude-file-list
19442 Set the list of functions that are excluded from instrumentation (see
19443 the description of @code{-finstrument-functions}).  If the file that
19444 contains a function definition matches with one of @var{file}, then
19445 that function is not instrumented.  The match is done on substrings:
19446 if the @var{file} parameter is a substring of the file name, it is
19447 considered to be a match.
19449 For example:
19451 @smallexample
19452 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
19453 @end smallexample
19455 @noindent
19456 will exclude any inline function defined in files whose pathnames
19457 contain @code{/bits/stl} or @code{include/sys}.
19459 If, for some reason, you want to include letter @code{','} in one of
19460 @var{sym}, write @code{'\,'}. For example,
19461 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
19462 (note the single quote surrounding the option).
19464 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
19465 @opindex finstrument-functions-exclude-function-list
19467 This is similar to @code{-finstrument-functions-exclude-file-list},
19468 but this option sets the list of function names to be excluded from
19469 instrumentation.  The function name to be matched is its user-visible
19470 name, such as @code{vector<int> blah(const vector<int> &)}, not the
19471 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
19472 match is done on substrings: if the @var{sym} parameter is a substring
19473 of the function name, it is considered to be a match.  For C99 and C++
19474 extended identifiers, the function name must be given in UTF-8, not
19475 using universal character names.
19477 @item -fstack-check
19478 @opindex fstack-check
19479 Generate code to verify that you do not go beyond the boundary of the
19480 stack.  You should specify this flag if you are running in an
19481 environment with multiple threads, but only rarely need to specify it in
19482 a single-threaded environment since stack overflow is automatically
19483 detected on nearly all systems if there is only one stack.
19485 Note that this switch does not actually cause checking to be done; the
19486 operating system or the language runtime must do that.  The switch causes
19487 generation of code to ensure that they see the stack being extended.
19489 You can additionally specify a string parameter: @code{no} means no
19490 checking, @code{generic} means force the use of old-style checking,
19491 @code{specific} means use the best checking method and is equivalent
19492 to bare @option{-fstack-check}.
19494 Old-style checking is a generic mechanism that requires no specific
19495 target support in the compiler but comes with the following drawbacks:
19497 @enumerate
19498 @item
19499 Modified allocation strategy for large objects: they will always be
19500 allocated dynamically if their size exceeds a fixed threshold.
19502 @item
19503 Fixed limit on the size of the static frame of functions: when it is
19504 topped by a particular function, stack checking is not reliable and
19505 a warning is issued by the compiler.
19507 @item
19508 Inefficiency: because of both the modified allocation strategy and the
19509 generic implementation, the performances of the code are hampered.
19510 @end enumerate
19512 Note that old-style stack checking is also the fallback method for
19513 @code{specific} if no target support has been added in the compiler.
19515 @item -fstack-limit-register=@var{reg}
19516 @itemx -fstack-limit-symbol=@var{sym}
19517 @itemx -fno-stack-limit
19518 @opindex fstack-limit-register
19519 @opindex fstack-limit-symbol
19520 @opindex fno-stack-limit
19521 Generate code to ensure that the stack does not grow beyond a certain value,
19522 either the value of a register or the address of a symbol.  If the stack
19523 would grow beyond the value, a signal is raised.  For most targets,
19524 the signal is raised before the stack overruns the boundary, so
19525 it is possible to catch the signal without taking special precautions.
19527 For instance, if the stack starts at absolute address @samp{0x80000000}
19528 and grows downwards, you can use the flags
19529 @option{-fstack-limit-symbol=__stack_limit} and
19530 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
19531 of 128KB@.  Note that this may only work with the GNU linker.
19533 @item -fsplit-stack
19534 @opindex fsplit-stack
19535 Generate code to automatically split the stack before it overflows.
19536 The resulting program has a discontiguous stack which can only
19537 overflow if the program is unable to allocate any more memory.  This
19538 is most useful when running threaded programs, as it is no longer
19539 necessary to calculate a good stack size to use for each thread.  This
19540 is currently only implemented for the i386 and x86_64 back ends running
19541 GNU/Linux.
19543 When code compiled with @option{-fsplit-stack} calls code compiled
19544 without @option{-fsplit-stack}, there may not be much stack space
19545 available for the latter code to run.  If compiling all code,
19546 including library code, with @option{-fsplit-stack} is not an option,
19547 then the linker can fix up these calls so that the code compiled
19548 without @option{-fsplit-stack} always has a large stack.  Support for
19549 this is implemented in the gold linker in GNU binutils release 2.21
19550 and later.
19552 @item -fleading-underscore
19553 @opindex fleading-underscore
19554 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
19555 change the way C symbols are represented in the object file.  One use
19556 is to help link with legacy assembly code.
19558 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
19559 generate code that is not binary compatible with code generated without that
19560 switch.  Use it to conform to a non-default application binary interface.
19561 Not all targets provide complete support for this switch.
19563 @item -ftls-model=@var{model}
19564 @opindex ftls-model
19565 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
19566 The @var{model} argument should be one of @code{global-dynamic},
19567 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
19569 The default without @option{-fpic} is @code{initial-exec}; with
19570 @option{-fpic} the default is @code{global-dynamic}.
19572 @item -fvisibility=@var{default|internal|hidden|protected}
19573 @opindex fvisibility
19574 Set the default ELF image symbol visibility to the specified option---all
19575 symbols will be marked with this unless overridden within the code.
19576 Using this feature can very substantially improve linking and
19577 load times of shared object libraries, produce more optimized
19578 code, provide near-perfect API export and prevent symbol clashes.
19579 It is @strong{strongly} recommended that you use this in any shared objects
19580 you distribute.
19582 Despite the nomenclature, @code{default} always means public; i.e.,
19583 available to be linked against from outside the shared object.
19584 @code{protected} and @code{internal} are pretty useless in real-world
19585 usage so the only other commonly used option will be @code{hidden}.
19586 The default if @option{-fvisibility} isn't specified is
19587 @code{default}, i.e., make every
19588 symbol public---this causes the same behavior as previous versions of
19589 GCC@.
19591 A good explanation of the benefits offered by ensuring ELF
19592 symbols have the correct visibility is given by ``How To Write
19593 Shared Libraries'' by Ulrich Drepper (which can be found at
19594 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
19595 solution made possible by this option to marking things hidden when
19596 the default is public is to make the default hidden and mark things
19597 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
19598 and @code{__attribute__ ((visibility("default")))} instead of
19599 @code{__declspec(dllexport)} you get almost identical semantics with
19600 identical syntax.  This is a great boon to those working with
19601 cross-platform projects.
19603 For those adding visibility support to existing code, you may find
19604 @samp{#pragma GCC visibility} of use.  This works by you enclosing
19605 the declarations you wish to set visibility for with (for example)
19606 @samp{#pragma GCC visibility push(hidden)} and
19607 @samp{#pragma GCC visibility pop}.
19608 Bear in mind that symbol visibility should be viewed @strong{as
19609 part of the API interface contract} and thus all new code should
19610 always specify visibility when it is not the default; i.e., declarations
19611 only for use within the local DSO should @strong{always} be marked explicitly
19612 as hidden as so to avoid PLT indirection overheads---making this
19613 abundantly clear also aids readability and self-documentation of the code.
19614 Note that due to ISO C++ specification requirements, operator new and
19615 operator delete must always be of default visibility.
19617 Be aware that headers from outside your project, in particular system
19618 headers and headers from any other library you use, may not be
19619 expecting to be compiled with visibility other than the default.  You
19620 may need to explicitly say @samp{#pragma GCC visibility push(default)}
19621 before including any such headers.
19623 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
19624 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
19625 no modifications.  However, this means that calls to @samp{extern}
19626 functions with no explicit visibility will use the PLT, so it is more
19627 effective to use @samp{__attribute ((visibility))} and/or
19628 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
19629 declarations should be treated as hidden.
19631 Note that @samp{-fvisibility} does affect C++ vague linkage
19632 entities. This means that, for instance, an exception class that will
19633 be thrown between DSOs must be explicitly marked with default
19634 visibility so that the @samp{type_info} nodes will be unified between
19635 the DSOs.
19637 An overview of these techniques, their benefits and how to use them
19638 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
19640 @item -fstrict-volatile-bitfields
19641 @opindex fstrict-volatile-bitfields
19642 This option should be used if accesses to volatile bit-fields (or other
19643 structure fields, although the compiler usually honors those types
19644 anyway) should use a single access of the width of the
19645 field's type, aligned to a natural alignment if possible.  For
19646 example, targets with memory-mapped peripheral registers might require
19647 all such accesses to be 16 bits wide; with this flag the user could
19648 declare all peripheral bit-fields as ``unsigned short'' (assuming short
19649 is 16 bits on these targets) to force GCC to use 16-bit accesses
19650 instead of, perhaps, a more efficient 32-bit access.
19652 If this option is disabled, the compiler will use the most efficient
19653 instruction.  In the previous example, that might be a 32-bit load
19654 instruction, even though that will access bytes that do not contain
19655 any portion of the bit-field, or memory-mapped registers unrelated to
19656 the one being updated.
19658 If the target requires strict alignment, and honoring the field
19659 type would require violating this alignment, a warning is issued.
19660 If the field has @code{packed} attribute, the access is done without
19661 honoring the field type.  If the field doesn't have @code{packed}
19662 attribute, the access is done honoring the field type.  In both cases,
19663 GCC assumes that the user knows something about the target hardware
19664 that it is unaware of.
19666 The default value of this option is determined by the application binary
19667 interface for the target processor.
19669 @end table
19671 @c man end
19673 @node Environment Variables
19674 @section Environment Variables Affecting GCC
19675 @cindex environment variables
19677 @c man begin ENVIRONMENT
19678 This section describes several environment variables that affect how GCC
19679 operates.  Some of them work by specifying directories or prefixes to use
19680 when searching for various kinds of files.  Some are used to specify other
19681 aspects of the compilation environment.
19683 Note that you can also specify places to search using options such as
19684 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
19685 take precedence over places specified using environment variables, which
19686 in turn take precedence over those specified by the configuration of GCC@.
19687 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
19688 GNU Compiler Collection (GCC) Internals}.
19690 @table @env
19691 @item LANG
19692 @itemx LC_CTYPE
19693 @c @itemx LC_COLLATE
19694 @itemx LC_MESSAGES
19695 @c @itemx LC_MONETARY
19696 @c @itemx LC_NUMERIC
19697 @c @itemx LC_TIME
19698 @itemx LC_ALL
19699 @findex LANG
19700 @findex LC_CTYPE
19701 @c @findex LC_COLLATE
19702 @findex LC_MESSAGES
19703 @c @findex LC_MONETARY
19704 @c @findex LC_NUMERIC
19705 @c @findex LC_TIME
19706 @findex LC_ALL
19707 @cindex locale
19708 These environment variables control the way that GCC uses
19709 localization information which allows GCC to work with different
19710 national conventions.  GCC inspects the locale categories
19711 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
19712 so.  These locale categories can be set to any value supported by your
19713 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
19714 Kingdom encoded in UTF-8.
19716 The @env{LC_CTYPE} environment variable specifies character
19717 classification.  GCC uses it to determine the character boundaries in
19718 a string; this is needed for some multibyte encodings that contain quote
19719 and escape characters that would otherwise be interpreted as a string
19720 end or escape.
19722 The @env{LC_MESSAGES} environment variable specifies the language to
19723 use in diagnostic messages.
19725 If the @env{LC_ALL} environment variable is set, it overrides the value
19726 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
19727 and @env{LC_MESSAGES} default to the value of the @env{LANG}
19728 environment variable.  If none of these variables are set, GCC
19729 defaults to traditional C English behavior.
19731 @item TMPDIR
19732 @findex TMPDIR
19733 If @env{TMPDIR} is set, it specifies the directory to use for temporary
19734 files.  GCC uses temporary files to hold the output of one stage of
19735 compilation which is to be used as input to the next stage: for example,
19736 the output of the preprocessor, which is the input to the compiler
19737 proper.
19739 @item GCC_COMPARE_DEBUG
19740 @findex GCC_COMPARE_DEBUG
19741 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
19742 @option{-fcompare-debug} to the compiler driver.  See the documentation
19743 of this option for more details.
19745 @item GCC_EXEC_PREFIX
19746 @findex GCC_EXEC_PREFIX
19747 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
19748 names of the subprograms executed by the compiler.  No slash is added
19749 when this prefix is combined with the name of a subprogram, but you can
19750 specify a prefix that ends with a slash if you wish.
19752 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
19753 an appropriate prefix to use based on the pathname it was invoked with.
19755 If GCC cannot find the subprogram using the specified prefix, it
19756 tries looking in the usual places for the subprogram.
19758 The default value of @env{GCC_EXEC_PREFIX} is
19759 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
19760 the installed compiler. In many cases @var{prefix} is the value
19761 of @code{prefix} when you ran the @file{configure} script.
19763 Other prefixes specified with @option{-B} take precedence over this prefix.
19765 This prefix is also used for finding files such as @file{crt0.o} that are
19766 used for linking.
19768 In addition, the prefix is used in an unusual way in finding the
19769 directories to search for header files.  For each of the standard
19770 directories whose name normally begins with @samp{/usr/local/lib/gcc}
19771 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
19772 replacing that beginning with the specified prefix to produce an
19773 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
19774 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
19775 These alternate directories are searched first; the standard directories
19776 come next. If a standard directory begins with the configured
19777 @var{prefix} then the value of @var{prefix} is replaced by
19778 @env{GCC_EXEC_PREFIX} when looking for header files.
19780 @item COMPILER_PATH
19781 @findex COMPILER_PATH
19782 The value of @env{COMPILER_PATH} is a colon-separated list of
19783 directories, much like @env{PATH}.  GCC tries the directories thus
19784 specified when searching for subprograms, if it can't find the
19785 subprograms using @env{GCC_EXEC_PREFIX}.
19787 @item LIBRARY_PATH
19788 @findex LIBRARY_PATH
19789 The value of @env{LIBRARY_PATH} is a colon-separated list of
19790 directories, much like @env{PATH}.  When configured as a native compiler,
19791 GCC tries the directories thus specified when searching for special
19792 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
19793 using GCC also uses these directories when searching for ordinary
19794 libraries for the @option{-l} option (but directories specified with
19795 @option{-L} come first).
19797 @item LANG
19798 @findex LANG
19799 @cindex locale definition
19800 This variable is used to pass locale information to the compiler.  One way in
19801 which this information is used is to determine the character set to be used
19802 when character literals, string literals and comments are parsed in C and C++.
19803 When the compiler is configured to allow multibyte characters,
19804 the following values for @env{LANG} are recognized:
19806 @table @samp
19807 @item C-JIS
19808 Recognize JIS characters.
19809 @item C-SJIS
19810 Recognize SJIS characters.
19811 @item C-EUCJP
19812 Recognize EUCJP characters.
19813 @end table
19815 If @env{LANG} is not defined, or if it has some other value, then the
19816 compiler will use mblen and mbtowc as defined by the default locale to
19817 recognize and translate multibyte characters.
19818 @end table
19820 @noindent
19821 Some additional environments variables affect the behavior of the
19822 preprocessor.
19824 @include cppenv.texi
19826 @c man end
19828 @node Precompiled Headers
19829 @section Using Precompiled Headers
19830 @cindex precompiled headers
19831 @cindex speed of compilation
19833 Often large projects have many header files that are included in every
19834 source file.  The time the compiler takes to process these header files
19835 over and over again can account for nearly all of the time required to
19836 build the project.  To make builds faster, GCC allows users to
19837 `precompile' a header file; then, if builds can use the precompiled
19838 header file they will be much faster.
19840 To create a precompiled header file, simply compile it as you would any
19841 other file, if necessary using the @option{-x} option to make the driver
19842 treat it as a C or C++ header file.  You will probably want to use a
19843 tool like @command{make} to keep the precompiled header up-to-date when
19844 the headers it contains change.
19846 A precompiled header file will be searched for when @code{#include} is
19847 seen in the compilation.  As it searches for the included file
19848 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
19849 compiler looks for a precompiled header in each directory just before it
19850 looks for the include file in that directory.  The name searched for is
19851 the name specified in the @code{#include} with @samp{.gch} appended.  If
19852 the precompiled header file can't be used, it is ignored.
19854 For instance, if you have @code{#include "all.h"}, and you have
19855 @file{all.h.gch} in the same directory as @file{all.h}, then the
19856 precompiled header file will be used if possible, and the original
19857 header will be used otherwise.
19859 Alternatively, you might decide to put the precompiled header file in a
19860 directory and use @option{-I} to ensure that directory is searched
19861 before (or instead of) the directory containing the original header.
19862 Then, if you want to check that the precompiled header file is always
19863 used, you can put a file of the same name as the original header in this
19864 directory containing an @code{#error} command.
19866 This also works with @option{-include}.  So yet another way to use
19867 precompiled headers, good for projects not designed with precompiled
19868 header files in mind, is to simply take most of the header files used by
19869 a project, include them from another header file, precompile that header
19870 file, and @option{-include} the precompiled header.  If the header files
19871 have guards against multiple inclusion, they will be skipped because
19872 they've already been included (in the precompiled header).
19874 If you need to precompile the same header file for different
19875 languages, targets, or compiler options, you can instead make a
19876 @emph{directory} named like @file{all.h.gch}, and put each precompiled
19877 header in the directory, perhaps using @option{-o}.  It doesn't matter
19878 what you call the files in the directory, every precompiled header in
19879 the directory will be considered.  The first precompiled header
19880 encountered in the directory that is valid for this compilation will
19881 be used; they're searched in no particular order.
19883 There are many other possibilities, limited only by your imagination,
19884 good sense, and the constraints of your build system.
19886 A precompiled header file can be used only when these conditions apply:
19888 @itemize
19889 @item
19890 Only one precompiled header can be used in a particular compilation.
19892 @item
19893 A precompiled header can't be used once the first C token is seen.  You
19894 can have preprocessor directives before a precompiled header; you cannot
19895 include a precompiled header from inside another header.
19897 @item
19898 The precompiled header file must be produced for the same language as
19899 the current compilation.  You can't use a C precompiled header for a C++
19900 compilation.
19902 @item
19903 The precompiled header file must have been produced by the same compiler
19904 binary as the current compilation is using.
19906 @item
19907 Any macros defined before the precompiled header is included must
19908 either be defined in the same way as when the precompiled header was
19909 generated, or must not affect the precompiled header, which usually
19910 means that they don't appear in the precompiled header at all.
19912 The @option{-D} option is one way to define a macro before a
19913 precompiled header is included; using a @code{#define} can also do it.
19914 There are also some options that define macros implicitly, like
19915 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
19916 defined this way.
19918 @item If debugging information is output when using the precompiled
19919 header, using @option{-g} or similar, the same kind of debugging information
19920 must have been output when building the precompiled header.  However,
19921 a precompiled header built using @option{-g} can be used in a compilation
19922 when no debugging information is being output.
19924 @item The same @option{-m} options must generally be used when building
19925 and using the precompiled header.  @xref{Submodel Options},
19926 for any cases where this rule is relaxed.
19928 @item Each of the following options must be the same when building and using
19929 the precompiled header:
19931 @gccoptlist{-fexceptions}
19933 @item
19934 Some other command-line options starting with @option{-f},
19935 @option{-p}, or @option{-O} must be defined in the same way as when
19936 the precompiled header was generated.  At present, it's not clear
19937 which options are safe to change and which are not; the safest choice
19938 is to use exactly the same options when generating and using the
19939 precompiled header.  The following are known to be safe:
19941 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
19942 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
19943 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
19944 -pedantic-errors}
19946 @end itemize
19948 For all of these except the last, the compiler will automatically
19949 ignore the precompiled header if the conditions aren't met.  If you
19950 find an option combination that doesn't work and doesn't cause the
19951 precompiled header to be ignored, please consider filing a bug report,
19952 see @ref{Bugs}.
19954 If you do use differing options when generating and using the
19955 precompiled header, the actual behavior will be a mixture of the
19956 behavior for the options.  For instance, if you use @option{-g} to
19957 generate the precompiled header but not when using it, you may or may
19958 not get debugging information for routines in the precompiled header.