Define __void_t and SFINAE-friendly iterator_traits.
[official-gcc.git] / gcc / doc / invoke.texi
blob13270bc25eebef62460b24cb4922514ce97dca38
1 @c Copyright (C) 1988-2014 Free Software Foundation, Inc.
2 @c This is part of the GCC manual.
3 @c For copying conditions, see the file gcc.texi.
5 @ignore
6 @c man begin INCLUDE
7 @include gcc-vers.texi
8 @c man end
10 @c man begin COPYRIGHT
11 Copyright @copyright{} 1988-2014 Free Software Foundation, Inc.
13 Permission is granted to copy, distribute and/or modify this document
14 under the terms of the GNU Free Documentation License, Version 1.3 or
15 any later version published by the Free Software Foundation; with the
16 Invariant Sections being ``GNU General Public License'' and ``Funding
17 Free Software'', the Front-Cover texts being (a) (see below), and with
18 the Back-Cover Texts being (b) (see below).  A copy of the license is
19 included in the gfdl(7) man page.
21 (a) The FSF's Front-Cover Text is:
23      A GNU Manual
25 (b) The FSF's Back-Cover Text is:
27      You have freedom to copy and modify this GNU Manual, like GNU
28      software.  Copies published by the Free Software Foundation raise
29      funds for GNU development.
30 @c man end
31 @c Set file name and title for the man page.
32 @setfilename gcc
33 @settitle GNU project C and C++ compiler
34 @c man begin SYNOPSIS
35 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
36     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
37     [@option{-W}@var{warn}@dots{}] [@option{-Wpedantic}]
38     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
39     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
40     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
41     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
43 Only the most useful options are listed here; see below for the
44 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
45 @c man end
46 @c man begin SEEALSO
47 gpl(7), gfdl(7), fsf-funding(7),
48 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
49 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
50 @file{ld}, @file{binutils} and @file{gdb}.
51 @c man end
52 @c man begin BUGS
53 For instructions on reporting bugs, see
54 @w{@value{BUGURL}}.
55 @c man end
56 @c man begin AUTHOR
57 See the Info entry for @command{gcc}, or
58 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
59 for contributors to GCC@.
60 @c man end
61 @end ignore
63 @node Invoking GCC
64 @chapter GCC Command Options
65 @cindex GCC command options
66 @cindex command options
67 @cindex options, GCC command
69 @c man begin DESCRIPTION
70 When you invoke GCC, it normally does preprocessing, compilation,
71 assembly and linking.  The ``overall options'' allow you to stop this
72 process at an intermediate stage.  For example, the @option{-c} option
73 says not to run the linker.  Then the output consists of object files
74 output by the assembler.
76 Other options are passed on to one stage of processing.  Some options
77 control the preprocessor and others the compiler itself.  Yet other
78 options control the assembler and linker; most of these are not
79 documented here, since you rarely need to use any of them.
81 @cindex C compilation options
82 Most of the command-line options that you can use with GCC are useful
83 for C programs; when an option is only useful with another language
84 (usually C++), the explanation says so explicitly.  If the description
85 for a particular option does not mention a source language, you can use
86 that option with all supported languages.
88 @cindex C++ compilation options
89 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
90 options for compiling C++ programs.
92 @cindex grouping options
93 @cindex options, grouping
94 The @command{gcc} program accepts options and file names as operands.  Many
95 options have multi-letter names; therefore multiple single-letter options
96 may @emph{not} be grouped: @option{-dv} is very different from @w{@samp{-d
97 -v}}.
99 @cindex order of options
100 @cindex options, order
101 You can mix options and other arguments.  For the most part, the order
102 you use doesn't matter.  Order does matter when you use several
103 options of the same kind; for example, if you specify @option{-L} more
104 than once, the directories are searched in the order specified.  Also,
105 the placement of the @option{-l} option is significant.
107 Many options have long names starting with @samp{-f} or with
108 @samp{-W}---for example,
109 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
110 these have both positive and negative forms; the negative form of
111 @option{-ffoo} is @option{-fno-foo}.  This manual documents
112 only one of these two forms, whichever one is not the default.
114 @c man end
116 @xref{Option Index}, for an index to GCC's options.
118 @menu
119 * Option Summary::      Brief list of all options, without explanations.
120 * Overall Options::     Controlling the kind of output:
121                         an executable, object files, assembler files,
122                         or preprocessed source.
123 * Invoking G++::        Compiling C++ programs.
124 * C Dialect Options::   Controlling the variant of C language compiled.
125 * C++ Dialect Options:: Variations on C++.
126 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
127                         and Objective-C++.
128 * Language Independent Options:: Controlling how diagnostics should be
129                         formatted.
130 * Warning Options::     How picky should the compiler be?
131 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
132 * Optimize Options::    How much optimization?
133 * Preprocessor Options:: Controlling header files and macro definitions.
134                          Also, getting dependency information for Make.
135 * Assembler Options::   Passing options to the assembler.
136 * Link Options::        Specifying libraries and so on.
137 * Directory Options::   Where to find header files and libraries.
138                         Where to find the compiler executable files.
139 * Spec Files::          How to pass switches to sub-processes.
140 * Target Options::      Running a cross-compiler, or an old version of GCC.
141 * Submodel Options::    Specifying minor hardware or convention variations,
142                         such as 68010 vs 68020.
143 * Code Gen Options::    Specifying conventions for function calls, data layout
144                         and register usage.
145 * Environment Variables:: Env vars that affect GCC.
146 * Precompiled Headers:: Compiling a header once, and using it many times.
147 @end menu
149 @c man begin OPTIONS
151 @node Option Summary
152 @section Option Summary
154 Here is a summary of all the options, grouped by type.  Explanations are
155 in the following sections.
157 @table @emph
158 @item Overall Options
159 @xref{Overall Options,,Options Controlling the Kind of Output}.
160 @gccoptlist{-c  -S  -E  -o @var{file}  -no-canonical-prefixes  @gol
161 -pipe  -pass-exit-codes  @gol
162 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  --target-help  @gol
163 --version -wrapper @@@var{file} -fplugin=@var{file} -fplugin-arg-@var{name}=@var{arg}  @gol
164 -fdump-ada-spec@r{[}-slim@r{]} -fada-spec-parent=@var{unit} -fdump-go-spec=@var{file}}
166 @item C Language Options
167 @xref{C Dialect Options,,Options Controlling C Dialect}.
168 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
169 -aux-info @var{filename} -fallow-parameterless-variadic-functions @gol
170 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
171 -fhosted  -ffreestanding -fopenmp -fopenmp-simd -fms-extensions @gol
172 -fplan9-extensions -trigraphs  -traditional  -traditional-cpp @gol
173 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
174 -fsigned-bitfields  -fsigned-char @gol
175 -funsigned-bitfields  -funsigned-char}
177 @item C++ Language Options
178 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
179 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
180 -fconstexpr-depth=@var{n}  -ffriend-injection @gol
181 -fno-elide-constructors @gol
182 -fno-enforce-eh-specs @gol
183 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
184 -fno-implicit-templates @gol
185 -fno-implicit-inline-templates @gol
186 -fno-implement-inlines  -fms-extensions @gol
187 -fno-nonansi-builtins  -fnothrow-opt  -fno-operator-names @gol
188 -fno-optional-diags  -fpermissive @gol
189 -fno-pretty-templates @gol
190 -frepo  -fno-rtti  -fstats  -ftemplate-backtrace-limit=@var{n} @gol
191 -ftemplate-depth=@var{n} @gol
192 -fno-threadsafe-statics  -fuse-cxa-atexit @gol
193 -fno-weak  -nostdinc++ @gol
194 -fvisibility-inlines-hidden @gol
195 -fvtable-verify=@var{std|preinit|none} @gol
196 -fvtv-counts -fvtv-debug @gol
197 -fvisibility-ms-compat @gol
198 -fext-numeric-literals @gol
199 -Wabi=@var{n}  -Wconversion-null  -Wctor-dtor-privacy @gol
200 -Wdelete-non-virtual-dtor -Wliteral-suffix -Wnarrowing @gol
201 -Wnoexcept -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 -fno-local-ivars @gol
221 -fivar-visibility=@var{public|protected|private|package} @gol
222 -freplace-objc-classes @gol
223 -fzero-link @gol
224 -gen-decls @gol
225 -Wassign-intercept @gol
226 -Wno-protocol  -Wselector @gol
227 -Wstrict-selector-match @gol
228 -Wundeclared-selector}
230 @item Language Independent Options
231 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
232 @gccoptlist{-fmessage-length=@var{n}  @gol
233 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
234 -fdiagnostics-color=@r{[}auto@r{|}never@r{|}always@r{]}  @gol
235 -fno-diagnostics-show-option -fno-diagnostics-show-caret}
237 @item Warning Options
238 @xref{Warning Options,,Options to Request or Suppress Warnings}.
239 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -Wpedantic @gol
240 -pedantic-errors @gol
241 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  @gol
242 -Waggressive-loop-optimizations -Warray-bounds @gol
243 -Wbool-compare @gol
244 -Wno-attributes -Wno-builtin-macro-redefined @gol
245 -Wc90-c99-compat -Wc99-c11-compat @gol
246 -Wc++-compat -Wc++11-compat -Wcast-align  -Wcast-qual  @gol
247 -Wchar-subscripts -Wclobbered  -Wcomment -Wconditionally-supported  @gol
248 -Wconversion -Wcoverage-mismatch -Wdate-time -Wdelete-incomplete -Wno-cpp  @gol
249 -Wno-deprecated -Wno-deprecated-declarations -Wno-designated-init @gol
250 -Wdisabled-optimization -Wno-discarded-qualifiers @gol
251 -Wno-div-by-zero -Wdouble-promotion -Wempty-body  -Wenum-compare @gol
252 -Wno-endif-labels -Werror  -Werror=* @gol
253 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
254 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
255 -Wformat-security  -Wformat-signedness  -Wformat-y2k @gol
256 -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol
257 -Wignored-qualifiers  -Wincompatible-pointer-types @gol
258 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
259 -Winit-self  -Winline  -Wno-int-conversion @gol
260 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
261 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
262 -Wlogical-op -Wlogical-not-parentheses -Wlong-long @gol
263 -Wmain -Wmaybe-uninitialized -Wmemset-transposed-args -Wmissing-braces @gol
264 -Wmissing-field-initializers -Wmissing-include-dirs @gol
265 -Wno-multichar  -Wnonnull  -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]} @gol
266  -Wodr  -Wno-overflow  -Wopenmp-simd @gol
267 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
268 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
269 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
270 -Wredundant-decls  -Wno-return-local-addr @gol
271 -Wreturn-type  -Wsequence-point  -Wshadow  -Wno-shadow-ivar @gol
272 -Wshift-count-negative -Wshift-count-overflow @gol
273 -Wsign-compare  -Wsign-conversion -Wfloat-conversion @gol
274 -Wsizeof-pointer-memaccess  -Wsizeof-array-argument @gol
275 -Wstack-protector -Wstack-usage=@var{len} -Wstrict-aliasing @gol
276 -Wstrict-aliasing=n @gol -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
277 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]} @gol
278 -Wsuggest-final-types @gol -Wsuggest-final-methods @gol
279 -Wmissing-format-attribute @gol
280 -Wswitch  -Wswitch-default  -Wswitch-enum -Wswitch-bool -Wsync-nand @gol
281 -Wsystem-headers  -Wtrampolines  -Wtrigraphs  -Wtype-limits  -Wundef @gol
282 -Wuninitialized  -Wunknown-pragmas  -Wno-pragmas @gol
283 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
284 -Wunused-label  -Wunused-local-typedefs -Wunused-parameter @gol
285 -Wno-unused-result -Wunused-value @gol -Wunused-variable @gol
286 -Wunused-but-set-parameter -Wunused-but-set-variable @gol
287 -Wuseless-cast -Wvariadic-macros -Wvector-operation-performance @gol
288 -Wvla -Wvolatile-register-var  -Wwrite-strings -Wzero-as-null-pointer-constant}
290 @item C and Objective-C-only Warning Options
291 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
292 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
293 -Wold-style-declaration  -Wold-style-definition @gol
294 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
295 -Wdeclaration-after-statement -Wpointer-sign}
297 @item Debugging Options
298 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
299 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
300 -fsanitize=@var{style} -fsanitize-recover -fsanitize-recover=@var{style} @gol
301 -fasan-shadow-offset=@var{number} -fsanitize-undefined-trap-on-error @gol
302 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
303 -fdisable-ipa-@var{pass_name} @gol
304 -fdisable-rtl-@var{pass_name} @gol
305 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
306 -fdisable-tree-@var{pass_name} @gol
307 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
308 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
309 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
310 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
311 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
312 -fdump-passes @gol
313 -fdump-statistics @gol
314 -fdump-tree-all @gol
315 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
316 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
317 -fdump-tree-cfg -fdump-tree-alias @gol
318 -fdump-tree-ch @gol
319 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
320 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
321 -fdump-tree-gimple@r{[}-raw@r{]} @gol
322 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
323 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
324 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
325 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
326 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
327 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
328 -fdump-tree-nrv -fdump-tree-vect @gol
329 -fdump-tree-sink @gol
330 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
331 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
332 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
333 -fdump-tree-vtable-verify @gol
334 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
335 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
336 -fdump-final-insns=@var{file} @gol
337 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
338 -feliminate-dwarf2-dups -fno-eliminate-unused-debug-types @gol
339 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
340 -fenable-@var{kind}-@var{pass} @gol
341 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
342 -fdebug-types-section -fmem-report-wpa @gol
343 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
344 -fopt-info @gol
345 -fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
346 -frandom-seed=@var{number} -fsched-verbose=@var{n} @gol
347 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
348 -fstack-usage  -ftest-coverage  -ftime-report -fvar-tracking @gol
349 -fvar-tracking-assignments  -fvar-tracking-assignments-toggle @gol
350 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
351 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
352 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
353 -gvms  -gxcoff  -gxcoff+ -gz@r{[}=@var{type}@r{]} @gol
354 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
355 -fdebug-prefix-map=@var{old}=@var{new} @gol
356 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
357 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
358 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
359 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
360 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
361 -print-sysroot -print-sysroot-headers-suffix @gol
362 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
364 @item Optimization Options
365 @xref{Optimize Options,,Options that Control Optimization}.
366 @gccoptlist{-faggressive-loop-optimizations -falign-functions[=@var{n}] @gol
367 -falign-jumps[=@var{n}] @gol
368 -falign-labels[=@var{n}] -falign-loops[=@var{n}] @gol
369 -fassociative-math -fauto-profile -fauto-profile[=@var{path}] @gol
370 -fauto-inc-dec -fbranch-probabilities @gol
371 -fbranch-target-load-optimize -fbranch-target-load-optimize2 @gol
372 -fbtr-bb-exclusive -fcaller-saves @gol
373 -fcheck-data-deps -fcombine-stack-adjustments -fconserve-stack @gol
374 -fcompare-elim -fcprop-registers -fcrossjumping @gol
375 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
376 -fcx-limited-range @gol
377 -fdata-sections -fdce -fdelayed-branch @gol
378 -fdelete-null-pointer-checks -fdevirtualize -fdevirtualize-speculatively -fdse @gol
379 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects @gol
380 -ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
381 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
382 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
383 -fgcse-sm -fhoist-adjacent-loads -fif-conversion @gol
384 -fif-conversion2 -findirect-inlining @gol
385 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
386 -finline-small-functions -fipa-cp -fipa-cp-clone @gol
387 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference -fipa-icf @gol
388 -fira-algorithm=@var{algorithm} @gol
389 -fira-region=@var{region} -fira-hoist-pressure @gol
390 -fira-loop-pressure -fno-ira-share-save-slots @gol
391 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
392 -fisolate-erroneous-paths-dereference -fisolate-erroneous-paths-attribute @gol
393 -fivopts -fkeep-inline-functions -fkeep-static-consts -flive-range-shrinkage @gol
394 -floop-block -floop-interchange -floop-strip-mine -floop-nest-optimize @gol
395 -floop-parallelize-all -flto -flto-compression-level @gol
396 -flto-partition=@var{alg} -flto-report -flto-report-wpa -fmerge-all-constants @gol
397 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
398 -fmove-loop-invariants -fno-branch-count-reg @gol
399 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
400 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
401 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
402 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
403 -fomit-frame-pointer -foptimize-sibling-calls @gol
404 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
405 -fprefetch-loop-arrays -fprofile-report @gol
406 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
407 -fprofile-generate=@var{path} @gol
408 -fprofile-use -fprofile-use=@var{path} -fprofile-values -fprofile-reorder-functions @gol
409 -freciprocal-math -free -frename-registers -freorder-blocks @gol
410 -freorder-blocks-and-partition -freorder-functions @gol
411 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
412 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
413 -fsched-spec-load -fsched-spec-load-dangerous @gol
414 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
415 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
416 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
417 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
418 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
419 -fselective-scheduling -fselective-scheduling2 @gol
420 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
421 -fsemantic-interposition @gol
422 -fshrink-wrap -fsignaling-nans -fsingle-precision-constant @gol
423 -fsplit-ivs-in-unroller -fsplit-wide-types -fssa-phiopt -fstack-protector @gol
424 -fstack-protector-all -fstack-protector-strong -fstrict-aliasing @gol
425 -fstrict-overflow -fthread-jumps -ftracer -ftree-bit-ccp @gol
426 -ftree-builtin-call-dce -ftree-ccp -ftree-ch @gol
427 -ftree-coalesce-inline-vars -ftree-coalesce-vars -ftree-copy-prop @gol
428 -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
429 -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
430 -ftree-loop-if-convert-stores -ftree-loop-im @gol
431 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
432 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
433 -ftree-loop-vectorize @gol
434 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-partial-pre -ftree-pta @gol
435 -ftree-reassoc -ftree-sink -ftree-slsr -ftree-sra @gol
436 -ftree-switch-conversion -ftree-tail-merge -ftree-ter @gol
437 -ftree-vectorize -ftree-vrp @gol
438 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
439 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
440 -fuse-caller-save -fvariable-expansion-in-unroller -fvect-cost-model -fvpt @gol
441 -fweb -fwhole-program -fwpa -fuse-ld=@var{linker} -fuse-linker-plugin @gol
442 --param @var{name}=@var{value}
443 -O  -O0  -O1  -O2  -O3  -Os -Ofast -Og}
445 @item Preprocessor Options
446 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
447 @gccoptlist{-A@var{question}=@var{answer} @gol
448 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
449 -C  -dD  -dI  -dM  -dN @gol
450 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
451 -idirafter @var{dir} @gol
452 -include @var{file}  -imacros @var{file} @gol
453 -iprefix @var{file}  -iwithprefix @var{dir} @gol
454 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
455 -imultilib @var{dir} -isysroot @var{dir} @gol
456 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
457 -P  -fdebug-cpp -ftrack-macro-expansion -fworking-directory @gol
458 -remap -trigraphs  -undef  -U@var{macro}  @gol
459 -Wp,@var{option} -Xpreprocessor @var{option} -no-integrated-cpp}
461 @item Assembler Option
462 @xref{Assembler Options,,Passing Options to the Assembler}.
463 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
465 @item Linker Options
466 @xref{Link Options,,Options for Linking}.
467 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
468 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
469 -s  -static -static-libgcc -static-libstdc++ @gol
470 -static-libasan -static-libtsan -static-liblsan -static-libubsan @gol
471 -shared -shared-libgcc  -symbolic @gol
472 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
473 -u @var{symbol} -z @var{keyword}}
475 @item Directory Options
476 @xref{Directory Options,,Options for Directory Search}.
477 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
478 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol
479 --sysroot=@var{dir} --no-sysroot-suffix}
481 @item Machine Dependent Options
482 @xref{Submodel Options,,Hardware Models and Configurations}.
483 @c This list is ordered alphanumerically by subsection name.
484 @c Try and put the significant identifier (CPU or system) first,
485 @c so users have a clue at guessing where the ones they want will be.
487 @emph{AArch64 Options}
488 @gccoptlist{-mabi=@var{name}  -mbig-endian  -mlittle-endian @gol
489 -mgeneral-regs-only @gol
490 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
491 -mstrict-align @gol
492 -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
493 -mtls-dialect=desc  -mtls-dialect=traditional @gol
494 -mfix-cortex-a53-835769  -mno-fix-cortex-a53-835769 @gol
495 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}}
497 @emph{Adapteva Epiphany Options}
498 @gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs @gol
499 -mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf @gol
500 -msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} @gol
501 -mround-nearest -mlong-calls -mshort-calls -msmall16 @gol
502 -mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} @gol
503 -msplit-vecmove-early -m1reg-@var{reg}}
505 @emph{ARC Options}
506 @gccoptlist{-mbarrel-shifter @gol
507 -mcpu=@var{cpu} -mA6 -mARC600 -mA7 -mARC700 @gol
508 -mdpfp -mdpfp-compact -mdpfp-fast -mno-dpfp-lrsr @gol
509 -mea -mno-mpy -mmul32x16 -mmul64 @gol
510 -mnorm -mspfp -mspfp-compact -mspfp-fast -msimd -msoft-float -mswap @gol
511 -mcrc -mdsp-packa -mdvbf -mlock -mmac-d16 -mmac-24 -mrtsc -mswape @gol
512 -mtelephony -mxy -misize -mannotate-align -marclinux -marclinux_prof @gol
513 -mepilogue-cfi -mlong-calls -mmedium-calls -msdata @gol
514 -mucb-mcount -mvolatile-cache @gol
515 -malign-call -mauto-modify-reg -mbbit-peephole -mno-brcc @gol
516 -mcase-vector-pcrel -mcompact-casesi -mno-cond-exec -mearly-cbranchsi @gol
517 -mexpand-adddi -mindexed-loads -mlra -mlra-priority-none @gol
518 -mlra-priority-compact mlra-priority-noncompact -mno-millicode @gol
519 -mmixed-code -mq-class -mRcq -mRcw -msize-level=@var{level} @gol
520 -mtune=@var{cpu} -mmultcost=@var{num} -munalign-prob-threshold=@var{probability}}
522 @emph{ARM Options}
523 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
524 -mabi=@var{name} @gol
525 -mapcs-stack-check  -mno-apcs-stack-check @gol
526 -mapcs-float  -mno-apcs-float @gol
527 -mapcs-reentrant  -mno-apcs-reentrant @gol
528 -msched-prolog  -mno-sched-prolog @gol
529 -mlittle-endian  -mbig-endian @gol
530 -mfloat-abi=@var{name} @gol
531 -mfp16-format=@var{name}
532 -mthumb-interwork  -mno-thumb-interwork @gol
533 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
534 -mstructure-size-boundary=@var{n} @gol
535 -mabort-on-noreturn @gol
536 -mlong-calls  -mno-long-calls @gol
537 -msingle-pic-base  -mno-single-pic-base @gol
538 -mpic-register=@var{reg} @gol
539 -mnop-fun-dllimport @gol
540 -mpoke-function-name @gol
541 -mthumb  -marm @gol
542 -mtpcs-frame  -mtpcs-leaf-frame @gol
543 -mcaller-super-interworking  -mcallee-super-interworking @gol
544 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
545 -mword-relocations @gol
546 -mfix-cortex-m3-ldrd @gol
547 -munaligned-access @gol
548 -mneon-for-64bits @gol
549 -mslow-flash-data @gol
550 -masm-syntax-unified @gol
551 -mrestrict-it}
553 @emph{AVR Options}
554 @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
555 -mcall-prologues -mint8 -mno-interrupts -mrelax @gol
556 -mstrict-X -mtiny-stack -Waddr-space-convert}
558 @emph{Blackfin Options}
559 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
560 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
561 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
562 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
563 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
564 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
565 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
566 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
567 -micplb}
569 @emph{C6X Options}
570 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
571 -msim -msdata=@var{sdata-type}}
573 @emph{CRIS Options}
574 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
575 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
576 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
577 -mstack-align  -mdata-align  -mconst-align @gol
578 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
579 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
580 -mmul-bug-workaround  -mno-mul-bug-workaround}
582 @emph{CR16 Options}
583 @gccoptlist{-mmac @gol
584 -mcr16cplus -mcr16c @gol
585 -msim -mint32 -mbit-ops
586 -mdata-model=@var{model}}
588 @emph{Darwin Options}
589 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
590 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
591 -client_name  -compatibility_version  -current_version @gol
592 -dead_strip @gol
593 -dependency-file  -dylib_file  -dylinker_install_name @gol
594 -dynamic  -dynamiclib  -exported_symbols_list @gol
595 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
596 -force_flat_namespace  -headerpad_max_install_names @gol
597 -iframework @gol
598 -image_base  -init  -install_name  -keep_private_externs @gol
599 -multi_module  -multiply_defined  -multiply_defined_unused @gol
600 -noall_load   -no_dead_strip_inits_and_terms @gol
601 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
602 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
603 -private_bundle  -read_only_relocs  -sectalign @gol
604 -sectobjectsymbols  -whyload  -seg1addr @gol
605 -sectcreate  -sectobjectsymbols  -sectorder @gol
606 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
607 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
608 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
609 -single_module  -static  -sub_library  -sub_umbrella @gol
610 -twolevel_namespace  -umbrella  -undefined @gol
611 -unexported_symbols_list  -weak_reference_mismatches @gol
612 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
613 -mkernel -mone-byte-bool}
615 @emph{DEC Alpha Options}
616 @gccoptlist{-mno-fp-regs  -msoft-float @gol
617 -mieee  -mieee-with-inexact  -mieee-conformant @gol
618 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
619 -mtrap-precision=@var{mode}  -mbuild-constants @gol
620 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
621 -mbwx  -mmax  -mfix  -mcix @gol
622 -mfloat-vax  -mfloat-ieee @gol
623 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
624 -msmall-text  -mlarge-text @gol
625 -mmemory-latency=@var{time}}
627 @emph{FR30 Options}
628 @gccoptlist{-msmall-model -mno-lsim}
630 @emph{FRV Options}
631 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
632 -mhard-float  -msoft-float @gol
633 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
634 -mdouble  -mno-double @gol
635 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
636 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
637 -mlinked-fp  -mlong-calls  -malign-labels @gol
638 -mlibrary-pic  -macc-4  -macc-8 @gol
639 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
640 -moptimize-membar -mno-optimize-membar @gol
641 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
642 -mvliw-branch  -mno-vliw-branch @gol
643 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
644 -mno-nested-cond-exec  -mtomcat-stats @gol
645 -mTLS -mtls @gol
646 -mcpu=@var{cpu}}
648 @emph{GNU/Linux Options}
649 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
650 -tno-android-cc -tno-android-ld}
652 @emph{H8/300 Options}
653 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr -mno-exr  -mint32  -malign-300}
655 @emph{HPPA Options}
656 @gccoptlist{-march=@var{architecture-type} @gol
657 -mdisable-fpregs  -mdisable-indexing @gol
658 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
659 -mfixed-range=@var{register-range} @gol
660 -mjump-in-delay -mlinker-opt -mlong-calls @gol
661 -mlong-load-store  -mno-disable-fpregs @gol
662 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
663 -mno-jump-in-delay  -mno-long-load-store @gol
664 -mno-portable-runtime  -mno-soft-float @gol
665 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
666 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
667 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
668 -munix=@var{unix-std}  -nolibdld  -static  -threads}
670 @emph{i386 and x86-64 Options}
671 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
672 -mtune-ctrl=@var{feature-list} -mdump-tune-features -mno-default @gol
673 -mfpmath=@var{unit} @gol
674 -masm=@var{dialect}  -mno-fancy-math-387 @gol
675 -mno-fp-ret-in-387  -msoft-float @gol
676 -mno-wide-multiply  -mrtd  -malign-double @gol
677 -mpreferred-stack-boundary=@var{num} @gol
678 -mincoming-stack-boundary=@var{num} @gol
679 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
680 -mrecip -mrecip=@var{opt} @gol
681 -mvzeroupper -mprefer-avx128 @gol
682 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
683 -mavx2 -mavx512f -mavx512pf -mavx512er -mavx512cd -msha @gol
684 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma -mprefetchwt1 @gol
685 -mclflushopt -mxsavec -mxsaves @gol
686 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
687 -mbmi2 -mfxsr -mxsave -mxsaveopt -mrtm -mlwp -mmpx -mthreads @gol
688 -mno-align-stringops  -minline-all-stringops @gol
689 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
690 -mmemcpy-strategy=@var{strategy} -mmemset-strategy=@var{strategy}
691 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
692 -m96bit-long-double -mlong-double-64 -mlong-double-80 -mlong-double-128 @gol
693 -mregparm=@var{num}  -msseregparm @gol
694 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
695 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
696 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
697 -mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
698 -m32 -m64 -mx32 -m16 -mlarge-data-threshold=@var{num} @gol
699 -msse2avx -mfentry -mrecord-mcount -mnop-mcount -m8bit-idiv @gol
700 -mavx256-split-unaligned-load -mavx256-split-unaligned-store @gol
701 -mstack-protector-guard=@var{guard}}
703 @emph{i386 and x86-64 Windows Options}
704 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
705 -mnop-fun-dllimport -mthread @gol
706 -municode -mwin32 -mwindows -fno-set-stack-executable}
708 @emph{IA-64 Options}
709 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
710 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
711 -mconstant-gp  -mauto-pic  -mfused-madd @gol
712 -minline-float-divide-min-latency @gol
713 -minline-float-divide-max-throughput @gol
714 -mno-inline-float-divide @gol
715 -minline-int-divide-min-latency @gol
716 -minline-int-divide-max-throughput  @gol
717 -mno-inline-int-divide @gol
718 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
719 -mno-inline-sqrt @gol
720 -mdwarf2-asm -mearly-stop-bits @gol
721 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
722 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
723 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
724 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
725 -msched-spec-ldc -msched-spec-control-ldc @gol
726 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
727 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
728 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
729 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
731 @emph{LM32 Options}
732 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
733 -msign-extend-enabled -muser-enabled}
735 @emph{M32R/D Options}
736 @gccoptlist{-m32r2 -m32rx -m32r @gol
737 -mdebug @gol
738 -malign-loops -mno-align-loops @gol
739 -missue-rate=@var{number} @gol
740 -mbranch-cost=@var{number} @gol
741 -mmodel=@var{code-size-model-type} @gol
742 -msdata=@var{sdata-type} @gol
743 -mno-flush-func -mflush-func=@var{name} @gol
744 -mno-flush-trap -mflush-trap=@var{number} @gol
745 -G @var{num}}
747 @emph{M32C Options}
748 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
750 @emph{M680x0 Options}
751 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
752 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
753 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
754 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
755 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
756 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
757 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
758 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
759 -mxgot -mno-xgot}
761 @emph{MCore Options}
762 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
763 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
764 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
765 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
766 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
768 @emph{MeP Options}
769 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
770 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
771 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
772 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
773 -mtiny=@var{n}}
775 @emph{MicroBlaze Options}
776 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
777 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
778 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
779 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
780 -mbig-endian -mlittle-endian -mxl-reorder -mxl-mode-@var{app-model}}
782 @emph{MIPS Options}
783 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
784 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips32r3  -mips32r5 @gol
785 -mips64  -mips64r2  -mips64r3  -mips64r5 @gol
786 -mips16  -mno-mips16  -mflip-mips16 @gol
787 -minterlink-compressed -mno-interlink-compressed @gol
788 -minterlink-mips16  -mno-interlink-mips16 @gol
789 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
790 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
791 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
792 -mno-float  -msingle-float  -mdouble-float @gol
793 -mabs=@var{mode}  -mnan=@var{encoding} @gol
794 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
795 -mmcu -mmno-mcu @gol
796 -meva -mno-eva @gol
797 -mvirt -mno-virt @gol
798 -mxpa -mno-xpa @gol
799 -mmicromips -mno-micromips @gol
800 -mfpu=@var{fpu-type} @gol
801 -msmartmips  -mno-smartmips @gol
802 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
803 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
804 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
805 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
806 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
807 -membedded-data  -mno-embedded-data @gol
808 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
809 -mcode-readable=@var{setting} @gol
810 -msplit-addresses  -mno-split-addresses @gol
811 -mexplicit-relocs  -mno-explicit-relocs @gol
812 -mcheck-zero-division  -mno-check-zero-division @gol
813 -mdivide-traps  -mdivide-breaks @gol
814 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
815 -mmad -mno-mad -mimadd -mno-imadd -mfused-madd  -mno-fused-madd  -nocpp @gol
816 -mfix-24k -mno-fix-24k @gol
817 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
818 -mfix-r10000 -mno-fix-r10000  -mfix-rm7000 -mno-fix-rm7000 @gol
819 -mfix-vr4120  -mno-fix-vr4120 @gol
820 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
821 -mflush-func=@var{func}  -mno-flush-func @gol
822 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
823 -mfp-exceptions -mno-fp-exceptions @gol
824 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
825 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
827 @emph{MMIX Options}
828 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
829 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
830 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
831 -mno-base-addresses  -msingle-exit  -mno-single-exit}
833 @emph{MN10300 Options}
834 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
835 -mno-am33 -mam33 -mam33-2 -mam34 @gol
836 -mtune=@var{cpu-type} @gol
837 -mreturn-pointer-on-d0 @gol
838 -mno-crt0  -mrelax -mliw -msetlb}
840 @emph{Moxie Options}
841 @gccoptlist{-meb -mel -mno-crt0}
843 @emph{MSP430 Options}
844 @gccoptlist{-msim -masm-hex -mmcu= -mcpu= -mlarge -msmall -mrelax @gol
845 -mhwmult= -minrt}
847 @emph{NDS32 Options}
848 @gccoptlist{-mbig-endian -mlittle-endian @gol
849 -mreduced-regs -mfull-regs @gol
850 -mcmov -mno-cmov @gol
851 -mperf-ext -mno-perf-ext @gol
852 -mv3push -mno-v3push @gol
853 -m16bit -mno-16bit @gol
854 -mgp-direct -mno-gp-direct @gol
855 -misr-vector-size=@var{num} @gol
856 -mcache-block-size=@var{num} @gol
857 -march=@var{arch} @gol
858 -mforce-fp-as-gp -mforbid-fp-as-gp @gol
859 -mex9 -mctor-dtor -mrelax}
861 @emph{Nios II Options}
862 @gccoptlist{-G @var{num} -mgpopt -mno-gpopt -mel -meb @gol
863 -mno-bypass-cache -mbypass-cache @gol
864 -mno-cache-volatile -mcache-volatile @gol
865 -mno-fast-sw-div -mfast-sw-div @gol
866 -mhw-mul -mno-hw-mul -mhw-mulx -mno-hw-mulx -mno-hw-div -mhw-div @gol
867 -mcustom-@var{insn}=@var{N} -mno-custom-@var{insn} @gol
868 -mcustom-fpu-cfg=@var{name} @gol
869 -mhal -msmallc -msys-crt0=@var{name} -msys-lib=@var{name}}
871 @emph{PDP-11 Options}
872 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
873 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
874 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
875 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
876 -mbranch-expensive  -mbranch-cheap @gol
877 -munix-asm  -mdec-asm}
879 @emph{picoChip Options}
880 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
881 -msymbol-as-address -mno-inefficient-warnings}
883 @emph{PowerPC Options}
884 See RS/6000 and PowerPC Options.
886 @emph{RL78 Options}
887 @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=rl78 @gol
888 -m64bit-doubles -m32bit-doubles}
890 @emph{RS/6000 and PowerPC Options}
891 @gccoptlist{-mcpu=@var{cpu-type} @gol
892 -mtune=@var{cpu-type} @gol
893 -mcmodel=@var{code-model} @gol
894 -mpowerpc64 @gol
895 -maltivec  -mno-altivec @gol
896 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
897 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
898 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
899 -mfprnd  -mno-fprnd @gol
900 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
901 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
902 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
903 -malign-power  -malign-natural @gol
904 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
905 -msingle-float -mdouble-float -msimple-fpu @gol
906 -mstring  -mno-string  -mupdate  -mno-update @gol
907 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
908 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
909 -mstrict-align  -mno-strict-align  -mrelocatable @gol
910 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
911 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
912 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
913 -mprioritize-restricted-insns=@var{priority} @gol
914 -msched-costly-dep=@var{dependence_type} @gol
915 -minsert-sched-nops=@var{scheme} @gol
916 -mcall-sysv  -mcall-netbsd @gol
917 -maix-struct-return  -msvr4-struct-return @gol
918 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
919 -mblock-move-inline-limit=@var{num} @gol
920 -misel -mno-isel @gol
921 -misel=yes  -misel=no @gol
922 -mspe -mno-spe @gol
923 -mspe=yes  -mspe=no @gol
924 -mpaired @gol
925 -mgen-cell-microcode -mwarn-cell-microcode @gol
926 -mvrsave -mno-vrsave @gol
927 -mmulhw -mno-mulhw @gol
928 -mdlmzb -mno-dlmzb @gol
929 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
930 -mprototype  -mno-prototype @gol
931 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
932 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
933 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
934 -mno-recip-precision @gol
935 -mveclibabi=@var{type} -mfriz -mno-friz @gol
936 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
937 -msave-toc-indirect -mno-save-toc-indirect @gol
938 -mpower8-fusion -mno-mpower8-fusion -mpower8-vector -mno-power8-vector @gol
939 -mcrypto -mno-crypto -mdirect-move -mno-direct-move @gol
940 -mquad-memory -mno-quad-memory @gol
941 -mquad-memory-atomic -mno-quad-memory-atomic @gol
942 -mcompat-align-parm -mno-compat-align-parm}
944 @emph{RX Options}
945 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
946 -mcpu=@gol
947 -mbig-endian-data -mlittle-endian-data @gol
948 -msmall-data @gol
949 -msim  -mno-sim@gol
950 -mas100-syntax -mno-as100-syntax@gol
951 -mrelax@gol
952 -mmax-constant-size=@gol
953 -mint-register=@gol
954 -mpid@gol
955 -mno-warn-multiple-fast-interrupts@gol
956 -msave-acc-in-interrupts}
958 @emph{S/390 and zSeries Options}
959 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
960 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
961 -mlong-double-64 -mlong-double-128 @gol
962 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
963 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
964 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
965 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
966 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard @gol
967 -mhotpatch[=@var{halfwords}] -mno-hotpatch}
969 @emph{Score Options}
970 @gccoptlist{-meb -mel @gol
971 -mnhwloop @gol
972 -muls @gol
973 -mmac @gol
974 -mscore5 -mscore5u -mscore7 -mscore7d}
976 @emph{SH Options}
977 @gccoptlist{-m1  -m2  -m2e @gol
978 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
979 -m3  -m3e @gol
980 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
981 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
982 -m5-64media  -m5-64media-nofpu @gol
983 -m5-32media  -m5-32media-nofpu @gol
984 -m5-compact  -m5-compact-nofpu @gol
985 -mb  -ml  -mdalign  -mrelax @gol
986 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
987 -mieee -mno-ieee -mbitops  -misize  -minline-ic_invalidate -mpadstruct @gol
988 -mspace -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
989 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
990 -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
991 -maccumulate-outgoing-args -minvalid-symbols @gol
992 -matomic-model=@var{atomic-model} @gol
993 -mbranch-cost=@var{num} -mzdcbranch -mno-zdcbranch @gol
994 -mfused-madd -mno-fused-madd -mfsca -mno-fsca -mfsrra -mno-fsrra @gol
995 -mpretend-cmove -mtas}
997 @emph{Solaris 2 Options}
998 @gccoptlist{-mclear-hwcap -mno-clear-hwcap -mimpure-text  -mno-impure-text @gol
999 -pthreads -pthread}
1001 @emph{SPARC Options}
1002 @gccoptlist{-mcpu=@var{cpu-type} @gol
1003 -mtune=@var{cpu-type} @gol
1004 -mcmodel=@var{code-model} @gol
1005 -mmemory-model=@var{mem-model} @gol
1006 -m32  -m64  -mapp-regs  -mno-app-regs @gol
1007 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
1008 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
1009 -mhard-quad-float  -msoft-quad-float @gol
1010 -mstack-bias  -mno-stack-bias @gol
1011 -munaligned-doubles  -mno-unaligned-doubles @gol
1012 -muser-mode  -mno-user-mode @gol
1013 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
1014 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
1015 -mcbcond -mno-cbcond @gol
1016 -mfmaf  -mno-fmaf  -mpopc  -mno-popc @gol
1017 -mfix-at697f -mfix-ut699}
1019 @emph{SPU Options}
1020 @gccoptlist{-mwarn-reloc -merror-reloc @gol
1021 -msafe-dma -munsafe-dma @gol
1022 -mbranch-hints @gol
1023 -msmall-mem -mlarge-mem -mstdmain @gol
1024 -mfixed-range=@var{register-range} @gol
1025 -mea32 -mea64 @gol
1026 -maddress-space-conversion -mno-address-space-conversion @gol
1027 -mcache-size=@var{cache-size} @gol
1028 -matomic-updates -mno-atomic-updates}
1030 @emph{System V Options}
1031 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
1033 @emph{TILE-Gx Options}
1034 @gccoptlist{-mcpu=CPU -m32 -m64 -mbig-endian -mlittle-endian @gol
1035 -mcmodel=@var{code-model}}
1037 @emph{TILEPro Options}
1038 @gccoptlist{-mcpu=@var{cpu} -m32}
1040 @emph{V850 Options}
1041 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
1042 -mprolog-function  -mno-prolog-function  -mspace @gol
1043 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
1044 -mapp-regs  -mno-app-regs @gol
1045 -mdisable-callt  -mno-disable-callt @gol
1046 -mv850e2v3 -mv850e2 -mv850e1 -mv850es @gol
1047 -mv850e -mv850 -mv850e3v5 @gol
1048 -mloop @gol
1049 -mrelax @gol
1050 -mlong-jumps @gol
1051 -msoft-float @gol
1052 -mhard-float @gol
1053 -mgcc-abi @gol
1054 -mrh850-abi @gol
1055 -mbig-switch}
1057 @emph{VAX Options}
1058 @gccoptlist{-mg  -mgnu  -munix}
1060 @emph{VMS Options}
1061 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64 @gol
1062 -mpointer-size=@var{size}}
1064 @emph{VxWorks Options}
1065 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
1066 -Xbind-lazy  -Xbind-now}
1068 @emph{x86-64 Options}
1069 See i386 and x86-64 Options.
1071 @emph{Xstormy16 Options}
1072 @gccoptlist{-msim}
1074 @emph{Xtensa Options}
1075 @gccoptlist{-mconst16 -mno-const16 @gol
1076 -mfused-madd  -mno-fused-madd @gol
1077 -mforce-no-pic @gol
1078 -mserialize-volatile  -mno-serialize-volatile @gol
1079 -mtext-section-literals  -mno-text-section-literals @gol
1080 -mtarget-align  -mno-target-align @gol
1081 -mlongcalls  -mno-longcalls}
1083 @emph{zSeries Options}
1084 See S/390 and zSeries Options.
1086 @item Code Generation Options
1087 @xref{Code Gen Options,,Options for Code Generation Conventions}.
1088 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
1089 -ffixed-@var{reg}  -fexceptions @gol
1090 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
1091 -fasynchronous-unwind-tables @gol
1092 -fno-gnu-unique @gol
1093 -finhibit-size-directive  -finstrument-functions @gol
1094 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
1095 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
1096 -fno-common  -fno-ident @gol
1097 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
1098 -fno-jump-tables @gol
1099 -frecord-gcc-switches @gol
1100 -freg-struct-return  -fshort-enums @gol
1101 -fshort-double  -fshort-wchar @gol
1102 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
1103 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
1104 -fno-stack-limit -fsplit-stack @gol
1105 -fleading-underscore  -ftls-model=@var{model} @gol
1106 -fstack-reuse=@var{reuse_level} @gol
1107 -ftrapv  -fwrapv  -fbounds-check @gol
1108 -fvisibility -fstrict-volatile-bitfields -fsync-libcalls}
1109 @end table
1112 @node Overall Options
1113 @section Options Controlling the Kind of Output
1115 Compilation can involve up to four stages: preprocessing, compilation
1116 proper, assembly and linking, always in that order.  GCC is capable of
1117 preprocessing and compiling several files either into several
1118 assembler input files, or into one assembler input file; then each
1119 assembler input file produces an object file, and linking combines all
1120 the object files (those newly compiled, and those specified as input)
1121 into an executable file.
1123 @cindex file name suffix
1124 For any given input file, the file name suffix determines what kind of
1125 compilation is done:
1127 @table @gcctabopt
1128 @item @var{file}.c
1129 C source code that must be preprocessed.
1131 @item @var{file}.i
1132 C source code that should not be preprocessed.
1134 @item @var{file}.ii
1135 C++ source code that should not be preprocessed.
1137 @item @var{file}.m
1138 Objective-C source code.  Note that you must link with the @file{libobjc}
1139 library to make an Objective-C program work.
1141 @item @var{file}.mi
1142 Objective-C source code that should not be preprocessed.
1144 @item @var{file}.mm
1145 @itemx @var{file}.M
1146 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1147 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1148 to a literal capital M@.
1150 @item @var{file}.mii
1151 Objective-C++ source code that should not be preprocessed.
1153 @item @var{file}.h
1154 C, C++, Objective-C or Objective-C++ header file to be turned into a
1155 precompiled header (default), or C, C++ header file to be turned into an
1156 Ada spec (via the @option{-fdump-ada-spec} switch).
1158 @item @var{file}.cc
1159 @itemx @var{file}.cp
1160 @itemx @var{file}.cxx
1161 @itemx @var{file}.cpp
1162 @itemx @var{file}.CPP
1163 @itemx @var{file}.c++
1164 @itemx @var{file}.C
1165 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1166 the last two letters must both be literally @samp{x}.  Likewise,
1167 @samp{.C} refers to a literal capital C@.
1169 @item @var{file}.mm
1170 @itemx @var{file}.M
1171 Objective-C++ source code that must be preprocessed.
1173 @item @var{file}.mii
1174 Objective-C++ source code that should not be preprocessed.
1176 @item @var{file}.hh
1177 @itemx @var{file}.H
1178 @itemx @var{file}.hp
1179 @itemx @var{file}.hxx
1180 @itemx @var{file}.hpp
1181 @itemx @var{file}.HPP
1182 @itemx @var{file}.h++
1183 @itemx @var{file}.tcc
1184 C++ header file to be turned into a precompiled header or Ada spec.
1186 @item @var{file}.f
1187 @itemx @var{file}.for
1188 @itemx @var{file}.ftn
1189 Fixed form Fortran source code that should not be preprocessed.
1191 @item @var{file}.F
1192 @itemx @var{file}.FOR
1193 @itemx @var{file}.fpp
1194 @itemx @var{file}.FPP
1195 @itemx @var{file}.FTN
1196 Fixed form Fortran source code that must be preprocessed (with the traditional
1197 preprocessor).
1199 @item @var{file}.f90
1200 @itemx @var{file}.f95
1201 @itemx @var{file}.f03
1202 @itemx @var{file}.f08
1203 Free form Fortran source code that should not be preprocessed.
1205 @item @var{file}.F90
1206 @itemx @var{file}.F95
1207 @itemx @var{file}.F03
1208 @itemx @var{file}.F08
1209 Free form Fortran source code that must be preprocessed (with the
1210 traditional preprocessor).
1212 @item @var{file}.go
1213 Go source code.
1215 @c FIXME: Descriptions of Java file types.
1216 @c @var{file}.java
1217 @c @var{file}.class
1218 @c @var{file}.zip
1219 @c @var{file}.jar
1221 @item @var{file}.ads
1222 Ada source code file that contains a library unit declaration (a
1223 declaration of a package, subprogram, or generic, or a generic
1224 instantiation), or a library unit renaming declaration (a package,
1225 generic, or subprogram renaming declaration).  Such files are also
1226 called @dfn{specs}.
1228 @item @var{file}.adb
1229 Ada source code file containing a library unit body (a subprogram or
1230 package body).  Such files are also called @dfn{bodies}.
1232 @c GCC also knows about some suffixes for languages not yet included:
1233 @c Pascal:
1234 @c @var{file}.p
1235 @c @var{file}.pas
1236 @c Ratfor:
1237 @c @var{file}.r
1239 @item @var{file}.s
1240 Assembler code.
1242 @item @var{file}.S
1243 @itemx @var{file}.sx
1244 Assembler code that must be preprocessed.
1246 @item @var{other}
1247 An object file to be fed straight into linking.
1248 Any file name with no recognized suffix is treated this way.
1249 @end table
1251 @opindex x
1252 You can specify the input language explicitly with the @option{-x} option:
1254 @table @gcctabopt
1255 @item -x @var{language}
1256 Specify explicitly the @var{language} for the following input files
1257 (rather than letting the compiler choose a default based on the file
1258 name suffix).  This option applies to all following input files until
1259 the next @option{-x} option.  Possible values for @var{language} are:
1260 @smallexample
1261 c  c-header  cpp-output
1262 c++  c++-header  c++-cpp-output
1263 objective-c  objective-c-header  objective-c-cpp-output
1264 objective-c++ objective-c++-header objective-c++-cpp-output
1265 assembler  assembler-with-cpp
1267 f77  f77-cpp-input f95  f95-cpp-input
1269 java
1270 @end smallexample
1272 @item -x none
1273 Turn off any specification of a language, so that subsequent files are
1274 handled according to their file name suffixes (as they are if @option{-x}
1275 has not been used at all).
1277 @item -pass-exit-codes
1278 @opindex pass-exit-codes
1279 Normally the @command{gcc} program exits with the code of 1 if any
1280 phase of the compiler returns a non-success return code.  If you specify
1281 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1282 the numerically highest error produced by any phase returning an error
1283 indication.  The C, C++, and Fortran front ends return 4 if an internal
1284 compiler error is encountered.
1285 @end table
1287 If you only want some of the stages of compilation, you can use
1288 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1289 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1290 @command{gcc} is to stop.  Note that some combinations (for example,
1291 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1293 @table @gcctabopt
1294 @item -c
1295 @opindex c
1296 Compile or assemble the source files, but do not link.  The linking
1297 stage simply is not done.  The ultimate output is in the form of an
1298 object file for each source file.
1300 By default, the object file name for a source file is made by replacing
1301 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1303 Unrecognized input files, not requiring compilation or assembly, are
1304 ignored.
1306 @item -S
1307 @opindex S
1308 Stop after the stage of compilation proper; do not assemble.  The output
1309 is in the form of an assembler code file for each non-assembler input
1310 file specified.
1312 By default, the assembler file name for a source file is made by
1313 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1315 Input files that don't require compilation are ignored.
1317 @item -E
1318 @opindex E
1319 Stop after the preprocessing stage; do not run the compiler proper.  The
1320 output is in the form of preprocessed source code, which is sent to the
1321 standard output.
1323 Input files that don't require preprocessing are ignored.
1325 @cindex output file option
1326 @item -o @var{file}
1327 @opindex o
1328 Place output in file @var{file}.  This applies to whatever
1329 sort of output is being produced, whether it be an executable file,
1330 an object file, an assembler file or preprocessed C code.
1332 If @option{-o} is not specified, the default is to put an executable
1333 file in @file{a.out}, the object file for
1334 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1335 assembler file in @file{@var{source}.s}, a precompiled header file in
1336 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1337 standard output.
1339 @item -v
1340 @opindex v
1341 Print (on standard error output) the commands executed to run the stages
1342 of compilation.  Also print the version number of the compiler driver
1343 program and of the preprocessor and the compiler proper.
1345 @item -###
1346 @opindex ###
1347 Like @option{-v} except the commands are not executed and arguments
1348 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1349 This is useful for shell scripts to capture the driver-generated command lines.
1351 @item -pipe
1352 @opindex pipe
1353 Use pipes rather than temporary files for communication between the
1354 various stages of compilation.  This fails to work on some systems where
1355 the assembler is unable to read from a pipe; but the GNU assembler has
1356 no trouble.
1358 @item --help
1359 @opindex help
1360 Print (on the standard output) a description of the command-line options
1361 understood by @command{gcc}.  If the @option{-v} option is also specified
1362 then @option{--help} is also passed on to the various processes
1363 invoked by @command{gcc}, so that they can display the command-line options
1364 they accept.  If the @option{-Wextra} option has also been specified
1365 (prior to the @option{--help} option), then command-line options that
1366 have no documentation associated with them are also displayed.
1368 @item --target-help
1369 @opindex target-help
1370 Print (on the standard output) a description of target-specific command-line
1371 options for each tool.  For some targets extra target-specific
1372 information may also be printed.
1374 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1375 Print (on the standard output) a description of the command-line
1376 options understood by the compiler that fit into all specified classes
1377 and qualifiers.  These are the supported classes:
1379 @table @asis
1380 @item @samp{optimizers}
1381 Display all of the optimization options supported by the
1382 compiler.
1384 @item @samp{warnings}
1385 Display all of the options controlling warning messages
1386 produced by the compiler.
1388 @item @samp{target}
1389 Display target-specific options.  Unlike the
1390 @option{--target-help} option however, target-specific options of the
1391 linker and assembler are not displayed.  This is because those
1392 tools do not currently support the extended @option{--help=} syntax.
1394 @item @samp{params}
1395 Display the values recognized by the @option{--param}
1396 option.
1398 @item @var{language}
1399 Display the options supported for @var{language}, where
1400 @var{language} is the name of one of the languages supported in this
1401 version of GCC@.
1403 @item @samp{common}
1404 Display the options that are common to all languages.
1405 @end table
1407 These are the supported qualifiers:
1409 @table @asis
1410 @item @samp{undocumented}
1411 Display only those options that are undocumented.
1413 @item @samp{joined}
1414 Display options taking an argument that appears after an equal
1415 sign in the same continuous piece of text, such as:
1416 @samp{--help=target}.
1418 @item @samp{separate}
1419 Display options taking an argument that appears as a separate word
1420 following the original option, such as: @samp{-o output-file}.
1421 @end table
1423 Thus for example to display all the undocumented target-specific
1424 switches supported by the compiler, use:
1426 @smallexample
1427 --help=target,undocumented
1428 @end smallexample
1430 The sense of a qualifier can be inverted by prefixing it with the
1431 @samp{^} character, so for example to display all binary warning
1432 options (i.e., ones that are either on or off and that do not take an
1433 argument) that have a description, use:
1435 @smallexample
1436 --help=warnings,^joined,^undocumented
1437 @end smallexample
1439 The argument to @option{--help=} should not consist solely of inverted
1440 qualifiers.
1442 Combining several classes is possible, although this usually
1443 restricts the output so much that there is nothing to display.  One
1444 case where it does work, however, is when one of the classes is
1445 @var{target}.  For example, to display all the target-specific
1446 optimization options, use:
1448 @smallexample
1449 --help=target,optimizers
1450 @end smallexample
1452 The @option{--help=} option can be repeated on the command line.  Each
1453 successive use displays its requested class of options, skipping
1454 those that have already been displayed.
1456 If the @option{-Q} option appears on the command line before the
1457 @option{--help=} option, then the descriptive text displayed by
1458 @option{--help=} is changed.  Instead of describing the displayed
1459 options, an indication is given as to whether the option is enabled,
1460 disabled or set to a specific value (assuming that the compiler
1461 knows this at the point where the @option{--help=} option is used).
1463 Here is a truncated example from the ARM port of @command{gcc}:
1465 @smallexample
1466   % gcc -Q -mabi=2 --help=target -c
1467   The following options are target specific:
1468   -mabi=                                2
1469   -mabort-on-noreturn                   [disabled]
1470   -mapcs                                [disabled]
1471 @end smallexample
1473 The output is sensitive to the effects of previous command-line
1474 options, so for example it is possible to find out which optimizations
1475 are enabled at @option{-O2} by using:
1477 @smallexample
1478 -Q -O2 --help=optimizers
1479 @end smallexample
1481 Alternatively you can discover which binary optimizations are enabled
1482 by @option{-O3} by using:
1484 @smallexample
1485 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1486 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1487 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1488 @end smallexample
1490 @item -no-canonical-prefixes
1491 @opindex no-canonical-prefixes
1492 Do not expand any symbolic links, resolve references to @samp{/../}
1493 or @samp{/./}, or make the path absolute when generating a relative
1494 prefix.
1496 @item --version
1497 @opindex version
1498 Display the version number and copyrights of the invoked GCC@.
1500 @item -wrapper
1501 @opindex wrapper
1502 Invoke all subcommands under a wrapper program.  The name of the
1503 wrapper program and its parameters are passed as a comma separated
1504 list.
1506 @smallexample
1507 gcc -c t.c -wrapper gdb,--args
1508 @end smallexample
1510 @noindent
1511 This invokes all subprograms of @command{gcc} under
1512 @samp{gdb --args}, thus the invocation of @command{cc1} is
1513 @samp{gdb --args cc1 @dots{}}.
1515 @item -fplugin=@var{name}.so
1516 @opindex fplugin
1517 Load the plugin code in file @var{name}.so, assumed to be a
1518 shared object to be dlopen'd by the compiler.  The base name of
1519 the shared object file is used to identify the plugin for the
1520 purposes of argument parsing (See
1521 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1522 Each plugin should define the callback functions specified in the
1523 Plugins API.
1525 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1526 @opindex fplugin-arg
1527 Define an argument called @var{key} with a value of @var{value}
1528 for the plugin called @var{name}.
1530 @item -fdump-ada-spec@r{[}-slim@r{]}
1531 @opindex fdump-ada-spec
1532 For C and C++ source and include files, generate corresponding Ada specs.
1533 @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1534 GNAT User's Guide}, which provides detailed documentation on this feature.
1536 @item -fada-spec-parent=@var{unit}
1537 @opindex fada-spec-parent
1538 In conjunction with @option{-fdump-ada-spec@r{[}-slim@r{]}} above, generate
1539 Ada specs as child units of parent @var{unit}.
1541 @item -fdump-go-spec=@var{file}
1542 @opindex fdump-go-spec
1543 For input files in any language, generate corresponding Go
1544 declarations in @var{file}.  This generates Go @code{const},
1545 @code{type}, @code{var}, and @code{func} declarations which may be a
1546 useful way to start writing a Go interface to code written in some
1547 other language.
1549 @include @value{srcdir}/../libiberty/at-file.texi
1550 @end table
1552 @node Invoking G++
1553 @section Compiling C++ Programs
1555 @cindex suffixes for C++ source
1556 @cindex C++ source file suffixes
1557 C++ source files conventionally use one of the suffixes @samp{.C},
1558 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1559 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1560 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1561 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1562 files with these names and compiles them as C++ programs even if you
1563 call the compiler the same way as for compiling C programs (usually
1564 with the name @command{gcc}).
1566 @findex g++
1567 @findex c++
1568 However, the use of @command{gcc} does not add the C++ library.
1569 @command{g++} is a program that calls GCC and automatically specifies linking
1570 against the C++ library.  It treats @samp{.c},
1571 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1572 files unless @option{-x} is used.  This program is also useful when
1573 precompiling a C header file with a @samp{.h} extension for use in C++
1574 compilations.  On many systems, @command{g++} is also installed with
1575 the name @command{c++}.
1577 @cindex invoking @command{g++}
1578 When you compile C++ programs, you may specify many of the same
1579 command-line options that you use for compiling programs in any
1580 language; or command-line options meaningful for C and related
1581 languages; or options that are meaningful only for C++ programs.
1582 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1583 explanations of options for languages related to C@.
1584 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1585 explanations of options that are meaningful only for C++ programs.
1587 @node C Dialect Options
1588 @section Options Controlling C Dialect
1589 @cindex dialect options
1590 @cindex language dialect options
1591 @cindex options, dialect
1593 The following options control the dialect of C (or languages derived
1594 from C, such as C++, Objective-C and Objective-C++) that the compiler
1595 accepts:
1597 @table @gcctabopt
1598 @cindex ANSI support
1599 @cindex ISO support
1600 @item -ansi
1601 @opindex ansi
1602 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1603 equivalent to @option{-std=c++98}.
1605 This turns off certain features of GCC that are incompatible with ISO
1606 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1607 such as the @code{asm} and @code{typeof} keywords, and
1608 predefined macros such as @code{unix} and @code{vax} that identify the
1609 type of system you are using.  It also enables the undesirable and
1610 rarely used ISO trigraph feature.  For the C compiler,
1611 it disables recognition of C++ style @samp{//} comments as well as
1612 the @code{inline} keyword.
1614 The alternate keywords @code{__asm__}, @code{__extension__},
1615 @code{__inline__} and @code{__typeof__} continue to work despite
1616 @option{-ansi}.  You would not want to use them in an ISO C program, of
1617 course, but it is useful to put them in header files that might be included
1618 in compilations done with @option{-ansi}.  Alternate predefined macros
1619 such as @code{__unix__} and @code{__vax__} are also available, with or
1620 without @option{-ansi}.
1622 The @option{-ansi} option does not cause non-ISO programs to be
1623 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1624 addition to @option{-ansi}.  @xref{Warning Options}.
1626 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1627 option is used.  Some header files may notice this macro and refrain
1628 from declaring certain functions or defining certain macros that the
1629 ISO standard doesn't call for; this is to avoid interfering with any
1630 programs that might use these names for other things.
1632 Functions that are normally built in but do not have semantics
1633 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1634 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1635 built-in functions provided by GCC}, for details of the functions
1636 affected.
1638 @item -std=
1639 @opindex std
1640 Determine the language standard. @xref{Standards,,Language Standards
1641 Supported by GCC}, for details of these standard versions.  This option
1642 is currently only supported when compiling C or C++.
1644 The compiler can accept several base standards, such as @samp{c90} or
1645 @samp{c++98}, and GNU dialects of those standards, such as
1646 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1647 compiler accepts all programs following that standard plus those
1648 using GNU extensions that do not contradict it.  For example,
1649 @option{-std=c90} turns off certain features of GCC that are
1650 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1651 keywords, but not other GNU extensions that do not have a meaning in
1652 ISO C90, such as omitting the middle term of a @code{?:}
1653 expression. On the other hand, when a GNU dialect of a standard is
1654 specified, all features supported by the compiler are enabled, even when
1655 those features change the meaning of the base standard.  As a result, some
1656 strict-conforming programs may be rejected.  The particular standard
1657 is used by @option{-Wpedantic} to identify which features are GNU
1658 extensions given that version of the standard. For example
1659 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1660 comments, while @option{-std=gnu99 -Wpedantic} does not.
1662 A value for this option must be provided; possible values are
1664 @table @samp
1665 @item c90
1666 @itemx c89
1667 @itemx iso9899:1990
1668 Support all ISO C90 programs (certain GNU extensions that conflict
1669 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1671 @item iso9899:199409
1672 ISO C90 as modified in amendment 1.
1674 @item c99
1675 @itemx c9x
1676 @itemx iso9899:1999
1677 @itemx iso9899:199x
1678 ISO C99.  This standard is substantially completely supported, modulo
1679 bugs and floating-point issues
1680 (mainly but not entirely relating to optional C99 features from
1681 Annexes F and G).  See
1682 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1683 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1685 @item c11
1686 @itemx c1x
1687 @itemx iso9899:2011
1688 ISO C11, the 2011 revision of the ISO C standard.  This standard is
1689 substantially completely supported, modulo bugs, floating-point issues
1690 (mainly but not entirely relating to optional C11 features from
1691 Annexes F and G) and the optional Annexes K (Bounds-checking
1692 interfaces) and L (Analyzability).  The name @samp{c1x} is deprecated.
1694 @item gnu90
1695 @itemx gnu89
1696 GNU dialect of ISO C90 (including some C99 features).
1698 @item gnu99
1699 @itemx gnu9x
1700 GNU dialect of ISO C99.  The name @samp{gnu9x} is deprecated.
1702 @item gnu11
1703 @itemx gnu1x
1704 GNU dialect of ISO C11.  This is the default for C code.
1705 The name @samp{gnu1x} is deprecated.
1707 @item c++98
1708 @itemx c++03
1709 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1710 additional defect reports. Same as @option{-ansi} for C++ code.
1712 @item gnu++98
1713 @itemx gnu++03
1714 GNU dialect of @option{-std=c++98}.  This is the default for
1715 C++ code.
1717 @item c++11
1718 @itemx c++0x
1719 The 2011 ISO C++ standard plus amendments.
1720 The name @samp{c++0x} is deprecated.
1722 @item gnu++11
1723 @itemx gnu++0x
1724 GNU dialect of @option{-std=c++11}.
1725 The name @samp{gnu++0x} is deprecated.
1727 @item c++14
1728 @itemx c++1y
1729 The 2014 ISO C++ standard plus amendments.
1730 The name @samp{c++1y} is deprecated.
1732 @item gnu++14
1733 @itemx gnu++1y
1734 GNU dialect of @option{-std=c++14}.
1735 The name @samp{gnu++1y} is deprecated.
1737 @item c++1z
1738 The next revision of the ISO C++ standard, tentatively planned for
1739 2017.  Support is highly experimental, and will almost certainly
1740 change in incompatible ways in future releases.
1742 @item gnu++1z
1743 GNU dialect of @option{-std=c++1z}.  Support is highly experimental,
1744 and will almost certainly change in incompatible ways in future
1745 releases.
1746 @end table
1748 @item -fgnu89-inline
1749 @opindex fgnu89-inline
1750 The option @option{-fgnu89-inline} tells GCC to use the traditional
1751 GNU semantics for @code{inline} functions when in C99 mode.
1752 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1753 is accepted and ignored by GCC versions 4.1.3 up to but not including
1754 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1755 C99 mode.  Using this option is roughly equivalent to adding the
1756 @code{gnu_inline} function attribute to all inline functions
1757 (@pxref{Function Attributes}).
1759 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1760 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1761 specifies the default behavior).  This option was first supported in
1762 GCC 4.3.  This option is not supported in @option{-std=c90} or
1763 @option{-std=gnu90} mode.
1765 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1766 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1767 in effect for @code{inline} functions.  @xref{Common Predefined
1768 Macros,,,cpp,The C Preprocessor}.
1770 @item -aux-info @var{filename}
1771 @opindex aux-info
1772 Output to the given filename prototyped declarations for all functions
1773 declared and/or defined in a translation unit, including those in header
1774 files.  This option is silently ignored in any language other than C@.
1776 Besides declarations, the file indicates, in comments, the origin of
1777 each declaration (source file and line), whether the declaration was
1778 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1779 @samp{O} for old, respectively, in the first character after the line
1780 number and the colon), and whether it came from a declaration or a
1781 definition (@samp{C} or @samp{F}, respectively, in the following
1782 character).  In the case of function definitions, a K&R-style list of
1783 arguments followed by their declarations is also provided, inside
1784 comments, after the declaration.
1786 @item -fallow-parameterless-variadic-functions
1787 @opindex fallow-parameterless-variadic-functions
1788 Accept variadic functions without named parameters.
1790 Although it is possible to define such a function, this is not very
1791 useful as it is not possible to read the arguments.  This is only
1792 supported for C as this construct is allowed by C++.
1794 @item -fno-asm
1795 @opindex fno-asm
1796 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1797 keyword, so that code can use these words as identifiers.  You can use
1798 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1799 instead.  @option{-ansi} implies @option{-fno-asm}.
1801 In C++, this switch only affects the @code{typeof} keyword, since
1802 @code{asm} and @code{inline} are standard keywords.  You may want to
1803 use the @option{-fno-gnu-keywords} flag instead, which has the same
1804 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1805 switch only affects the @code{asm} and @code{typeof} keywords, since
1806 @code{inline} is a standard keyword in ISO C99.
1808 @item -fno-builtin
1809 @itemx -fno-builtin-@var{function}
1810 @opindex fno-builtin
1811 @cindex built-in functions
1812 Don't recognize built-in functions that do not begin with
1813 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1814 functions provided by GCC}, for details of the functions affected,
1815 including those which are not built-in functions when @option{-ansi} or
1816 @option{-std} options for strict ISO C conformance are used because they
1817 do not have an ISO standard meaning.
1819 GCC normally generates special code to handle certain built-in functions
1820 more efficiently; for instance, calls to @code{alloca} may become single
1821 instructions which adjust the stack directly, and calls to @code{memcpy}
1822 may become inline copy loops.  The resulting code is often both smaller
1823 and faster, but since the function calls no longer appear as such, you
1824 cannot set a breakpoint on those calls, nor can you change the behavior
1825 of the functions by linking with a different library.  In addition,
1826 when a function is recognized as a built-in function, GCC may use
1827 information about that function to warn about problems with calls to
1828 that function, or to generate more efficient code, even if the
1829 resulting code still contains calls to that function.  For example,
1830 warnings are given with @option{-Wformat} for bad calls to
1831 @code{printf} when @code{printf} is built in and @code{strlen} is
1832 known not to modify global memory.
1834 With the @option{-fno-builtin-@var{function}} option
1835 only the built-in function @var{function} is
1836 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1837 function is named that is not built-in in this version of GCC, this
1838 option is ignored.  There is no corresponding
1839 @option{-fbuiltin-@var{function}} option; if you wish to enable
1840 built-in functions selectively when using @option{-fno-builtin} or
1841 @option{-ffreestanding}, you may define macros such as:
1843 @smallexample
1844 #define abs(n)          __builtin_abs ((n))
1845 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1846 @end smallexample
1848 @item -fhosted
1849 @opindex fhosted
1850 @cindex hosted environment
1852 Assert that compilation targets a hosted environment.  This implies
1853 @option{-fbuiltin}.  A hosted environment is one in which the
1854 entire standard library is available, and in which @code{main} has a return
1855 type of @code{int}.  Examples are nearly everything except a kernel.
1856 This is equivalent to @option{-fno-freestanding}.
1858 @item -ffreestanding
1859 @opindex ffreestanding
1860 @cindex hosted environment
1862 Assert that compilation targets a freestanding environment.  This
1863 implies @option{-fno-builtin}.  A freestanding environment
1864 is one in which the standard library may not exist, and program startup may
1865 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1866 This is equivalent to @option{-fno-hosted}.
1868 @xref{Standards,,Language Standards Supported by GCC}, for details of
1869 freestanding and hosted environments.
1871 @item -fopenmp
1872 @opindex fopenmp
1873 @cindex OpenMP parallel
1874 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1875 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1876 compiler generates parallel code according to the OpenMP Application
1877 Program Interface v4.0 @w{@uref{http://www.openmp.org/}}.  This option
1878 implies @option{-pthread}, and thus is only supported on targets that
1879 have support for @option{-pthread}. @option{-fopenmp} implies
1880 @option{-fopenmp-simd}.
1882 @item -fopenmp-simd
1883 @opindex fopenmp-simd
1884 @cindex OpenMP SIMD
1885 @cindex SIMD
1886 Enable handling of OpenMP's SIMD directives with @code{#pragma omp}
1887 in C/C++ and @code{!$omp} in Fortran. Other OpenMP directives
1888 are ignored.
1890 @item -fcilkplus
1891 @opindex fcilkplus
1892 @cindex Enable Cilk Plus
1893 Enable the usage of Cilk Plus language extension features for C/C++.
1894 When the option @option{-fcilkplus} is specified, enable the usage of
1895 the Cilk Plus Language extension features for C/C++.  The present
1896 implementation follows ABI version 1.2.  This is an experimental
1897 feature that is only partially complete, and whose interface may
1898 change in future versions of GCC as the official specification
1899 changes.  Currently, all features but @code{_Cilk_for} have been
1900 implemented.
1902 @item -fgnu-tm
1903 @opindex fgnu-tm
1904 When the option @option{-fgnu-tm} is specified, the compiler
1905 generates code for the Linux variant of Intel's current Transactional
1906 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
1907 an experimental feature whose interface may change in future versions
1908 of GCC, as the official specification changes.  Please note that not
1909 all architectures are supported for this feature.
1911 For more information on GCC's support for transactional memory,
1912 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
1913 Transactional Memory Library}.
1915 Note that the transactional memory feature is not supported with
1916 non-call exceptions (@option{-fnon-call-exceptions}).
1918 @item -fms-extensions
1919 @opindex fms-extensions
1920 Accept some non-standard constructs used in Microsoft header files.
1922 In C++ code, this allows member names in structures to be similar
1923 to previous types declarations.
1925 @smallexample
1926 typedef int UOW;
1927 struct ABC @{
1928   UOW UOW;
1930 @end smallexample
1932 Some cases of unnamed fields in structures and unions are only
1933 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1934 fields within structs/unions}, for details.
1936 Note that this option is off for all targets but i?86 and x86_64
1937 targets using ms-abi.
1938 @item -fplan9-extensions
1939 Accept some non-standard constructs used in Plan 9 code.
1941 This enables @option{-fms-extensions}, permits passing pointers to
1942 structures with anonymous fields to functions that expect pointers to
1943 elements of the type of the field, and permits referring to anonymous
1944 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
1945 struct/union fields within structs/unions}, for details.  This is only
1946 supported for C, not C++.
1948 @item -trigraphs
1949 @opindex trigraphs
1950 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1951 options for strict ISO C conformance) implies @option{-trigraphs}.
1953 @cindex traditional C language
1954 @cindex C language, traditional
1955 @item -traditional
1956 @itemx -traditional-cpp
1957 @opindex traditional-cpp
1958 @opindex traditional
1959 Formerly, these options caused GCC to attempt to emulate a pre-standard
1960 C compiler.  They are now only supported with the @option{-E} switch.
1961 The preprocessor continues to support a pre-standard mode.  See the GNU
1962 CPP manual for details.
1964 @item -fcond-mismatch
1965 @opindex fcond-mismatch
1966 Allow conditional expressions with mismatched types in the second and
1967 third arguments.  The value of such an expression is void.  This option
1968 is not supported for C++.
1970 @item -flax-vector-conversions
1971 @opindex flax-vector-conversions
1972 Allow implicit conversions between vectors with differing numbers of
1973 elements and/or incompatible element types.  This option should not be
1974 used for new code.
1976 @item -funsigned-char
1977 @opindex funsigned-char
1978 Let the type @code{char} be unsigned, like @code{unsigned char}.
1980 Each kind of machine has a default for what @code{char} should
1981 be.  It is either like @code{unsigned char} by default or like
1982 @code{signed char} by default.
1984 Ideally, a portable program should always use @code{signed char} or
1985 @code{unsigned char} when it depends on the signedness of an object.
1986 But many programs have been written to use plain @code{char} and
1987 expect it to be signed, or expect it to be unsigned, depending on the
1988 machines they were written for.  This option, and its inverse, let you
1989 make such a program work with the opposite default.
1991 The type @code{char} is always a distinct type from each of
1992 @code{signed char} or @code{unsigned char}, even though its behavior
1993 is always just like one of those two.
1995 @item -fsigned-char
1996 @opindex fsigned-char
1997 Let the type @code{char} be signed, like @code{signed char}.
1999 Note that this is equivalent to @option{-fno-unsigned-char}, which is
2000 the negative form of @option{-funsigned-char}.  Likewise, the option
2001 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
2003 @item -fsigned-bitfields
2004 @itemx -funsigned-bitfields
2005 @itemx -fno-signed-bitfields
2006 @itemx -fno-unsigned-bitfields
2007 @opindex fsigned-bitfields
2008 @opindex funsigned-bitfields
2009 @opindex fno-signed-bitfields
2010 @opindex fno-unsigned-bitfields
2011 These options control whether a bit-field is signed or unsigned, when the
2012 declaration does not use either @code{signed} or @code{unsigned}.  By
2013 default, such a bit-field is signed, because this is consistent: the
2014 basic integer types such as @code{int} are signed types.
2015 @end table
2017 @node C++ Dialect Options
2018 @section Options Controlling C++ Dialect
2020 @cindex compiler options, C++
2021 @cindex C++ options, command-line
2022 @cindex options, C++
2023 This section describes the command-line options that are only meaningful
2024 for C++ programs.  You can also use most of the GNU compiler options
2025 regardless of what language your program is in.  For example, you
2026 might compile a file @code{firstClass.C} like this:
2028 @smallexample
2029 g++ -g -frepo -O -c firstClass.C
2030 @end smallexample
2032 @noindent
2033 In this example, only @option{-frepo} is an option meant
2034 only for C++ programs; you can use the other options with any
2035 language supported by GCC@.
2037 Here is a list of options that are @emph{only} for compiling C++ programs:
2039 @table @gcctabopt
2041 @item -fabi-version=@var{n}
2042 @opindex fabi-version
2043 Use version @var{n} of the C++ ABI@.  The default is version 0.
2045 Version 0 refers to the version conforming most closely to
2046 the C++ ABI specification.  Therefore, the ABI obtained using version 0
2047 will change in different versions of G++ as ABI bugs are fixed.
2049 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.  
2051 Version 2 is the version of the C++ ABI that first appeared in G++
2052 3.4, and was the default through G++ 4.9.
2054 Version 3 corrects an error in mangling a constant address as a
2055 template argument.
2057 Version 4, which first appeared in G++ 4.5, implements a standard
2058 mangling for vector types.
2060 Version 5, which first appeared in G++ 4.6, corrects the mangling of
2061 attribute const/volatile on function pointer types, decltype of a
2062 plain decl, and use of a function parameter in the declaration of
2063 another parameter.
2065 Version 6, which first appeared in G++ 4.7, corrects the promotion
2066 behavior of C++11 scoped enums and the mangling of template argument
2067 packs, const/static_cast, prefix ++ and --, and a class scope function
2068 used as a template argument.
2070 Version 7, which first appeared in G++ 4.8, that treats nullptr_t as a
2071 builtin type and corrects the mangling of lambdas in default argument
2072 scope.
2074 Version 8, which first appeared in G++ 4.9, corrects the substitution
2075 behavior of function types with function-cv-qualifiers.
2077 See also @option{-Wabi}.
2079 @item -fabi-compat-version=@var{n}
2080 @opindex fabi-compat-version
2081 Starting with GCC 4.5, on targets that support strong aliases, G++
2082 works around mangling changes by creating an alias with the correct
2083 mangled name when defining a symbol with an incorrect mangled name.
2084 This switch specifies which ABI version to use for the alias.
2086 With @option{-fabi-version=0} (the default), this defaults to 2.  If
2087 another ABI version is explicitly selected, this defaults to 0.
2089 The compatibility version is also set by @option{-Wabi=@var{n}}.
2091 @item -fno-access-control
2092 @opindex fno-access-control
2093 Turn off all access checking.  This switch is mainly useful for working
2094 around bugs in the access control code.
2096 @item -fcheck-new
2097 @opindex fcheck-new
2098 Check that the pointer returned by @code{operator new} is non-null
2099 before attempting to modify the storage allocated.  This check is
2100 normally unnecessary because the C++ standard specifies that
2101 @code{operator new} only returns @code{0} if it is declared
2102 @samp{throw()}, in which case the compiler always checks the
2103 return value even without this option.  In all other cases, when
2104 @code{operator new} has a non-empty exception specification, memory
2105 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
2106 @samp{new (nothrow)}.
2108 @item -fconstexpr-depth=@var{n}
2109 @opindex fconstexpr-depth
2110 Set the maximum nested evaluation depth for C++11 constexpr functions
2111 to @var{n}.  A limit is needed to detect endless recursion during
2112 constant expression evaluation.  The minimum specified by the standard
2113 is 512.
2115 @item -fdeduce-init-list
2116 @opindex fdeduce-init-list
2117 Enable deduction of a template type parameter as
2118 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
2120 @smallexample
2121 template <class T> auto forward(T t) -> decltype (realfn (t))
2123   return realfn (t);
2126 void f()
2128   forward(@{1,2@}); // call forward<std::initializer_list<int>>
2130 @end smallexample
2132 This deduction was implemented as a possible extension to the
2133 originally proposed semantics for the C++11 standard, but was not part
2134 of the final standard, so it is disabled by default.  This option is
2135 deprecated, and may be removed in a future version of G++.
2137 @item -ffriend-injection
2138 @opindex ffriend-injection
2139 Inject friend functions into the enclosing namespace, so that they are
2140 visible outside the scope of the class in which they are declared.
2141 Friend functions were documented to work this way in the old Annotated
2142 C++ Reference Manual, and versions of G++ before 4.1 always worked
2143 that way.  However, in ISO C++ a friend function that is not declared
2144 in an enclosing scope can only be found using argument dependent
2145 lookup.  This option causes friends to be injected as they were in
2146 earlier releases.
2148 This option is for compatibility, and may be removed in a future
2149 release of G++.
2151 @item -fno-elide-constructors
2152 @opindex fno-elide-constructors
2153 The C++ standard allows an implementation to omit creating a temporary
2154 that is only used to initialize another object of the same type.
2155 Specifying this option disables that optimization, and forces G++ to
2156 call the copy constructor in all cases.
2158 @item -fno-enforce-eh-specs
2159 @opindex fno-enforce-eh-specs
2160 Don't generate code to check for violation of exception specifications
2161 at run time.  This option violates the C++ standard, but may be useful
2162 for reducing code size in production builds, much like defining
2163 @samp{NDEBUG}.  This does not give user code permission to throw
2164 exceptions in violation of the exception specifications; the compiler
2165 still optimizes based on the specifications, so throwing an
2166 unexpected exception results in undefined behavior at run time.
2168 @item -fextern-tls-init
2169 @itemx -fno-extern-tls-init
2170 @opindex fextern-tls-init
2171 @opindex fno-extern-tls-init
2172 The C++11 and OpenMP standards allow @samp{thread_local} and
2173 @samp{threadprivate} variables to have dynamic (runtime)
2174 initialization.  To support this, any use of such a variable goes
2175 through a wrapper function that performs any necessary initialization.
2176 When the use and definition of the variable are in the same
2177 translation unit, this overhead can be optimized away, but when the
2178 use is in a different translation unit there is significant overhead
2179 even if the variable doesn't actually need dynamic initialization.  If
2180 the programmer can be sure that no use of the variable in a
2181 non-defining TU needs to trigger dynamic initialization (either
2182 because the variable is statically initialized, or a use of the
2183 variable in the defining TU will be executed before any uses in
2184 another TU), they can avoid this overhead with the
2185 @option{-fno-extern-tls-init} option.
2187 On targets that support symbol aliases, the default is
2188 @option{-fextern-tls-init}.  On targets that do not support symbol
2189 aliases, the default is @option{-fno-extern-tls-init}.
2191 @item -ffor-scope
2192 @itemx -fno-for-scope
2193 @opindex ffor-scope
2194 @opindex fno-for-scope
2195 If @option{-ffor-scope} is specified, the scope of variables declared in
2196 a @i{for-init-statement} is limited to the @samp{for} loop itself,
2197 as specified by the C++ standard.
2198 If @option{-fno-for-scope} is specified, the scope of variables declared in
2199 a @i{for-init-statement} extends to the end of the enclosing scope,
2200 as was the case in old versions of G++, and other (traditional)
2201 implementations of C++.
2203 If neither flag is given, the default is to follow the standard,
2204 but to allow and give a warning for old-style code that would
2205 otherwise be invalid, or have different behavior.
2207 @item -fno-gnu-keywords
2208 @opindex fno-gnu-keywords
2209 Do not recognize @code{typeof} as a keyword, so that code can use this
2210 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2211 @option{-ansi} implies @option{-fno-gnu-keywords}.
2213 @item -fno-implicit-templates
2214 @opindex fno-implicit-templates
2215 Never emit code for non-inline templates that are instantiated
2216 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2217 @xref{Template Instantiation}, for more information.
2219 @item -fno-implicit-inline-templates
2220 @opindex fno-implicit-inline-templates
2221 Don't emit code for implicit instantiations of inline templates, either.
2222 The default is to handle inlines differently so that compiles with and
2223 without optimization need the same set of explicit instantiations.
2225 @item -fno-implement-inlines
2226 @opindex fno-implement-inlines
2227 To save space, do not emit out-of-line copies of inline functions
2228 controlled by @samp{#pragma implementation}.  This causes linker
2229 errors if these functions are not inlined everywhere they are called.
2231 @item -fms-extensions
2232 @opindex fms-extensions
2233 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2234 int and getting a pointer to member function via non-standard syntax.
2236 @item -fno-nonansi-builtins
2237 @opindex fno-nonansi-builtins
2238 Disable built-in declarations of functions that are not mandated by
2239 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2240 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2242 @item -fnothrow-opt
2243 @opindex fnothrow-opt
2244 Treat a @code{throw()} exception specification as if it were a
2245 @code{noexcept} specification to reduce or eliminate the text size
2246 overhead relative to a function with no exception specification.  If
2247 the function has local variables of types with non-trivial
2248 destructors, the exception specification actually makes the
2249 function smaller because the EH cleanups for those variables can be
2250 optimized away.  The semantic effect is that an exception thrown out of
2251 a function with such an exception specification results in a call
2252 to @code{terminate} rather than @code{unexpected}.
2254 @item -fno-operator-names
2255 @opindex fno-operator-names
2256 Do not treat the operator name keywords @code{and}, @code{bitand},
2257 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2258 synonyms as keywords.
2260 @item -fno-optional-diags
2261 @opindex fno-optional-diags
2262 Disable diagnostics that the standard says a compiler does not need to
2263 issue.  Currently, the only such diagnostic issued by G++ is the one for
2264 a name having multiple meanings within a class.
2266 @item -fpermissive
2267 @opindex fpermissive
2268 Downgrade some diagnostics about nonconformant code from errors to
2269 warnings.  Thus, using @option{-fpermissive} allows some
2270 nonconforming code to compile.
2272 @item -fno-pretty-templates
2273 @opindex fno-pretty-templates
2274 When an error message refers to a specialization of a function
2275 template, the compiler normally prints the signature of the
2276 template followed by the template arguments and any typedefs or
2277 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2278 rather than @code{void f(int)}) so that it's clear which template is
2279 involved.  When an error message refers to a specialization of a class
2280 template, the compiler omits any template arguments that match
2281 the default template arguments for that template.  If either of these
2282 behaviors make it harder to understand the error message rather than
2283 easier, you can use @option{-fno-pretty-templates} to disable them.
2285 @item -frepo
2286 @opindex frepo
2287 Enable automatic template instantiation at link time.  This option also
2288 implies @option{-fno-implicit-templates}.  @xref{Template
2289 Instantiation}, for more information.
2291 @item -fno-rtti
2292 @opindex fno-rtti
2293 Disable generation of information about every class with virtual
2294 functions for use by the C++ run-time type identification features
2295 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
2296 of the language, you can save some space by using this flag.  Note that
2297 exception handling uses the same information, but G++ generates it as
2298 needed. The @samp{dynamic_cast} operator can still be used for casts that
2299 do not require run-time type information, i.e.@: casts to @code{void *} or to
2300 unambiguous base classes.
2302 @item -fstats
2303 @opindex fstats
2304 Emit statistics about front-end processing at the end of the compilation.
2305 This information is generally only useful to the G++ development team.
2307 @item -fstrict-enums
2308 @opindex fstrict-enums
2309 Allow the compiler to optimize using the assumption that a value of
2310 enumerated type can only be one of the values of the enumeration (as
2311 defined in the C++ standard; basically, a value that can be
2312 represented in the minimum number of bits needed to represent all the
2313 enumerators).  This assumption may not be valid if the program uses a
2314 cast to convert an arbitrary integer value to the enumerated type.
2316 @item -ftemplate-backtrace-limit=@var{n}
2317 @opindex ftemplate-backtrace-limit
2318 Set the maximum number of template instantiation notes for a single
2319 warning or error to @var{n}.  The default value is 10.
2321 @item -ftemplate-depth=@var{n}
2322 @opindex ftemplate-depth
2323 Set the maximum instantiation depth for template classes to @var{n}.
2324 A limit on the template instantiation depth is needed to detect
2325 endless recursions during template class instantiation.  ANSI/ISO C++
2326 conforming programs must not rely on a maximum depth greater than 17
2327 (changed to 1024 in C++11).  The default value is 900, as the compiler
2328 can run out of stack space before hitting 1024 in some situations.
2330 @item -fno-threadsafe-statics
2331 @opindex fno-threadsafe-statics
2332 Do not emit the extra code to use the routines specified in the C++
2333 ABI for thread-safe initialization of local statics.  You can use this
2334 option to reduce code size slightly in code that doesn't need to be
2335 thread-safe.
2337 @item -fuse-cxa-atexit
2338 @opindex fuse-cxa-atexit
2339 Register destructors for objects with static storage duration with the
2340 @code{__cxa_atexit} function rather than the @code{atexit} function.
2341 This option is required for fully standards-compliant handling of static
2342 destructors, but only works if your C library supports
2343 @code{__cxa_atexit}.
2345 @item -fno-use-cxa-get-exception-ptr
2346 @opindex fno-use-cxa-get-exception-ptr
2347 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2348 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2349 if the runtime routine is not available.
2351 @item -fvisibility-inlines-hidden
2352 @opindex fvisibility-inlines-hidden
2353 This switch declares that the user does not attempt to compare
2354 pointers to inline functions or methods where the addresses of the two functions
2355 are taken in different shared objects.
2357 The effect of this is that GCC may, effectively, mark inline methods with
2358 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2359 appear in the export table of a DSO and do not require a PLT indirection
2360 when used within the DSO@.  Enabling this option can have a dramatic effect
2361 on load and link times of a DSO as it massively reduces the size of the
2362 dynamic export table when the library makes heavy use of templates.
2364 The behavior of this switch is not quite the same as marking the
2365 methods as hidden directly, because it does not affect static variables
2366 local to the function or cause the compiler to deduce that
2367 the function is defined in only one shared object.
2369 You may mark a method as having a visibility explicitly to negate the
2370 effect of the switch for that method.  For example, if you do want to
2371 compare pointers to a particular inline method, you might mark it as
2372 having default visibility.  Marking the enclosing class with explicit
2373 visibility has no effect.
2375 Explicitly instantiated inline methods are unaffected by this option
2376 as their linkage might otherwise cross a shared library boundary.
2377 @xref{Template Instantiation}.
2379 @item -fvisibility-ms-compat
2380 @opindex fvisibility-ms-compat
2381 This flag attempts to use visibility settings to make GCC's C++
2382 linkage model compatible with that of Microsoft Visual Studio.
2384 The flag makes these changes to GCC's linkage model:
2386 @enumerate
2387 @item
2388 It sets the default visibility to @code{hidden}, like
2389 @option{-fvisibility=hidden}.
2391 @item
2392 Types, but not their members, are not hidden by default.
2394 @item
2395 The One Definition Rule is relaxed for types without explicit
2396 visibility specifications that are defined in more than one
2397 shared object: those declarations are permitted if they are
2398 permitted when this option is not used.
2399 @end enumerate
2401 In new code it is better to use @option{-fvisibility=hidden} and
2402 export those classes that are intended to be externally visible.
2403 Unfortunately it is possible for code to rely, perhaps accidentally,
2404 on the Visual Studio behavior.
2406 Among the consequences of these changes are that static data members
2407 of the same type with the same name but defined in different shared
2408 objects are different, so changing one does not change the other;
2409 and that pointers to function members defined in different shared
2410 objects may not compare equal.  When this flag is given, it is a
2411 violation of the ODR to define types with the same name differently.
2413 @item -fvtable-verify=@var{std|preinit|none}
2414 @opindex fvtable-verify
2415 Turn on (or off, if using @option{-fvtable-verify=none}) the security
2416 feature that verifies at runtime, for every virtual call that is made, that
2417 the vtable pointer through which the call is made is valid for the type of
2418 the object, and has not been corrupted or overwritten.  If an invalid vtable
2419 pointer is detected (at runtime), an error is reported and execution of the
2420 program is immediately halted.
2422 This option causes runtime data structures to be built, at program start up,
2423 for verifying the vtable pointers.  The options @code{std} and @code{preinit}
2424 control the timing of when these data structures are built.  In both cases the
2425 data structures are built before execution reaches 'main'.  The
2426 @option{-fvtable-verify=std} causes these data structure to be built after the
2427 shared libraries have been loaded and initialized.
2428 @option{-fvtable-verify=preinit} causes them to be built before the shared
2429 libraries have been loaded and initialized.
2431 If this option appears multiple times in the compiler line, with different
2432 values specified, 'none' will take highest priority over both 'std' and
2433 'preinit'; 'preinit' will take priority over 'std'.
2435 @item -fvtv-debug
2436 @opindex (fvtv-debug)
2437 Causes debug versions of the runtime functions for the vtable verification 
2438 feature to be called.  This assumes the @option{-fvtable-verify=std} or
2439 @option{-fvtable-verify=preinit} has been used.  This flag will also cause the
2440 compiler to keep track of which vtable pointers it found for each class, and
2441 record that information in the file ``vtv_set_ptr_data.log'', in the dump
2442 file directory on the user's machine.
2444 Note:  This feature APPENDS data to the log file. If you want a fresh log
2445 file, be sure to delete any existing one.
2447 @item -fvtv-counts
2448 @opindex fvtv-counts
2449 This is a debugging flag.  When used in conjunction with
2450 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
2451 causes the compiler to keep track of the total number of virtual calls
2452 it encountered and the number of verifications it inserted.  It also
2453 counts the number of calls to certain runtime library functions
2454 that it inserts.  This information, for each compilation unit, is written
2455 to a file named ``vtv_count_data.log'', in the dump_file directory on
2456 the user's machine.   It also counts the size of the vtable pointer sets
2457 for each class, and writes this information to ``vtv_class_set_sizes.log''
2458 in the same directory.
2460 Note:  This feature APPENDS data to the log files.  To get a fresh log
2461 files, be sure to delete any existing ones.
2463 @item -fno-weak
2464 @opindex fno-weak
2465 Do not use weak symbol support, even if it is provided by the linker.
2466 By default, G++ uses weak symbols if they are available.  This
2467 option exists only for testing, and should not be used by end-users;
2468 it results in inferior code and has no benefits.  This option may
2469 be removed in a future release of G++.
2471 @item -nostdinc++
2472 @opindex nostdinc++
2473 Do not search for header files in the standard directories specific to
2474 C++, but do still search the other standard directories.  (This option
2475 is used when building the C++ library.)
2476 @end table
2478 In addition, these optimization, warning, and code generation options
2479 have meanings only for C++ programs:
2481 @table @gcctabopt
2482 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2483 @opindex Wabi
2484 @opindex Wno-abi
2485 When an explicit @option{-fabi-version=@var{n}} option is used, causes
2486 G++ to warn when it generates code that is probably not compatible with the
2487 vendor-neutral C++ ABI@.  Since G++ now defaults to
2488 @option{-fabi-version=0}, @option{-Wabi} has no effect unless either
2489 an older ABI version is selected (with @option{-fabi-version=@var{n}})
2490 or an older compatibility version is selected (with
2491 @option{-Wabi=@var{n}} or @option{-fabi-compat-version=@var{n}}).
2493 Although an effort has been made to warn about
2494 all such cases, there are probably some cases that are not warned about,
2495 even though G++ is generating incompatible code.  There may also be
2496 cases where warnings are emitted even though the code that is generated
2497 is compatible.
2499 You should rewrite your code to avoid these warnings if you are
2500 concerned about the fact that code generated by G++ may not be binary
2501 compatible with code generated by other compilers.
2503 @option{-Wabi} can also be used with an explicit version number to
2504 warn about compatibility with a particular @option{-fabi-version}
2505 level, e.g. @option{-Wabi=2} to warn about changes relative to
2506 @option{-fabi-version=2}.  Specifying a version number also sets
2507 @option{-fabi-compat-version=@var{n}}.
2509 The known incompatibilities in @option{-fabi-version=2} (which was the
2510 default from GCC 3.4 to 4.9) include:
2512 @itemize @bullet
2514 @item
2515 A template with a non-type template parameter of reference type was
2516 mangled incorrectly:
2517 @smallexample
2518 extern int N;
2519 template <int &> struct S @{@};
2520 void n (S<N>) @{2@}
2521 @end smallexample
2523 This was fixed in @option{-fabi-version=3}.
2525 @item
2526 SIMD vector types declared using @code{__attribute ((vector_size))} were
2527 mangled in a non-standard way that does not allow for overloading of
2528 functions taking vectors of different sizes.
2530 The mangling was changed in @option{-fabi-version=4}.
2532 @item
2533 @code{__attribute ((const))} and @code{noreturn} were mangled as type
2534 qualifiers, and @code{decltype} of a plain declaration was folded away.
2536 These mangling issues were fixed in @option{-fabi-version=5}.
2538 @item
2539 Scoped enumerators passed as arguments to a variadic function are
2540 promoted like unscoped enumerators, causing @samp{va_arg} to complain.
2541 On most targets this does not actually affect the parameter passing
2542 ABI, as there is no way to pass an argument smaller than @samp{int}.
2544 Also, the ABI changed the mangling of template argument packs,
2545 @code{const_cast}, @code{static_cast}, prefix increment/decrement, and
2546 a class scope function used as a template argument.
2548 These issues were corrected in @option{-fabi-version=6}.
2550 @item
2551 Lambdas in default argument scope were mangled incorrectly, and the
2552 ABI changed the mangling of nullptr_t.
2554 These issues were corrected in @option{-fabi-version=7}.
2556 @item
2557 When mangling a function type with function-cv-qualifiers, the
2558 un-qualified function type was incorrectly treated as a substitution
2559 candidate.
2561 This was fixed in @option{-fabi-version=8}.
2562 @end itemize
2564 It also warns about psABI-related changes.  The known psABI changes at this
2565 point include:
2567 @itemize @bullet
2569 @item
2570 For SysV/x86-64, unions with @code{long double} members are 
2571 passed in memory as specified in psABI.  For example:
2573 @smallexample
2574 union U @{
2575   long double ld;
2576   int i;
2578 @end smallexample
2580 @noindent
2581 @code{union U} is always passed in memory.
2583 @end itemize
2585 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2586 @opindex Wctor-dtor-privacy
2587 @opindex Wno-ctor-dtor-privacy
2588 Warn when a class seems unusable because all the constructors or
2589 destructors in that class are private, and it has neither friends nor
2590 public static member functions.  Also warn if there are no non-private
2591 methods, and there's at least one private member function that isn't
2592 a constructor or destructor.
2594 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2595 @opindex Wdelete-non-virtual-dtor
2596 @opindex Wno-delete-non-virtual-dtor
2597 Warn when @samp{delete} is used to destroy an instance of a class that
2598 has virtual functions and non-virtual destructor. It is unsafe to delete
2599 an instance of a derived class through a pointer to a base class if the
2600 base class does not have a virtual destructor.  This warning is enabled
2601 by @option{-Wall}.
2603 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
2604 @opindex Wliteral-suffix
2605 @opindex Wno-literal-suffix
2606 Warn when a string or character literal is followed by a ud-suffix which does
2607 not begin with an underscore.  As a conforming extension, GCC treats such
2608 suffixes as separate preprocessing tokens in order to maintain backwards
2609 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
2610 For example:
2612 @smallexample
2613 #define __STDC_FORMAT_MACROS
2614 #include <inttypes.h>
2615 #include <stdio.h>
2617 int main() @{
2618   int64_t i64 = 123;
2619   printf("My int64: %"PRId64"\n", i64);
2621 @end smallexample
2623 In this case, @code{PRId64} is treated as a separate preprocessing token.
2625 This warning is enabled by default.
2627 @item -Wnarrowing @r{(C++ and Objective-C++ only)}
2628 @opindex Wnarrowing
2629 @opindex Wno-narrowing
2630 Warn when a narrowing conversion prohibited by C++11 occurs within
2631 @samp{@{ @}}, e.g.
2633 @smallexample
2634 int i = @{ 2.2 @}; // error: narrowing from double to int
2635 @end smallexample
2637 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2639 With @option{-std=c++11}, @option{-Wno-narrowing} suppresses for
2640 non-constants the diagnostic required by the standard.  Note that this
2641 does not affect the meaning of well-formed code; narrowing conversions
2642 are still considered ill-formed in SFINAE context.
2644 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2645 @opindex Wnoexcept
2646 @opindex Wno-noexcept
2647 Warn when a noexcept-expression evaluates to false because of a call
2648 to a function that does not have a non-throwing exception
2649 specification (i.e. @samp{throw()} or @samp{noexcept}) but is known by
2650 the compiler to never throw an exception.
2652 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2653 @opindex Wnon-virtual-dtor
2654 @opindex Wno-non-virtual-dtor
2655 Warn when a class has virtual functions and an accessible non-virtual
2656 destructor itself or in an accessible polymorphic base class, in which
2657 case it is possible but unsafe to delete an instance of a derived
2658 class through a pointer to the class itself or base class.  This
2659 warning is automatically enabled if @option{-Weffc++} is specified.
2661 @item -Wreorder @r{(C++ and Objective-C++ only)}
2662 @opindex Wreorder
2663 @opindex Wno-reorder
2664 @cindex reordering, warning
2665 @cindex warning for reordering of member initializers
2666 Warn when the order of member initializers given in the code does not
2667 match the order in which they must be executed.  For instance:
2669 @smallexample
2670 struct A @{
2671   int i;
2672   int j;
2673   A(): j (0), i (1) @{ @}
2675 @end smallexample
2677 @noindent
2678 The compiler rearranges the member initializers for @samp{i}
2679 and @samp{j} to match the declaration order of the members, emitting
2680 a warning to that effect.  This warning is enabled by @option{-Wall}.
2682 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
2683 @opindex fext-numeric-literals
2684 @opindex fno-ext-numeric-literals
2685 Accept imaginary, fixed-point, or machine-defined
2686 literal number suffixes as GNU extensions.
2687 When this option is turned off these suffixes are treated
2688 as C++11 user-defined literal numeric suffixes.
2689 This is on by default for all pre-C++11 dialects and all GNU dialects:
2690 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
2691 @option{-std=gnu++14}.
2692 This option is off by default
2693 for ISO C++11 onwards (@option{-std=c++11}, ...).
2694 @end table
2696 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2698 @table @gcctabopt
2699 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2700 @opindex Weffc++
2701 @opindex Wno-effc++
2702 Warn about violations of the following style guidelines from Scott Meyers'
2703 @cite{Effective C++} series of books:
2705 @itemize @bullet
2706 @item
2707 Define a copy constructor and an assignment operator for classes
2708 with dynamically-allocated memory.
2710 @item
2711 Prefer initialization to assignment in constructors.
2713 @item
2714 Have @code{operator=} return a reference to @code{*this}.
2716 @item
2717 Don't try to return a reference when you must return an object.
2719 @item
2720 Distinguish between prefix and postfix forms of increment and
2721 decrement operators.
2723 @item
2724 Never overload @code{&&}, @code{||}, or @code{,}.
2726 @end itemize
2728 This option also enables @option{-Wnon-virtual-dtor}, which is also
2729 one of the effective C++ recommendations.  However, the check is
2730 extended to warn about the lack of virtual destructor in accessible
2731 non-polymorphic bases classes too.
2733 When selecting this option, be aware that the standard library
2734 headers do not obey all of these guidelines; use @samp{grep -v}
2735 to filter out those warnings.
2737 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2738 @opindex Wstrict-null-sentinel
2739 @opindex Wno-strict-null-sentinel
2740 Warn about the use of an uncasted @code{NULL} as sentinel.  When
2741 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2742 to @code{__null}.  Although it is a null pointer constant rather than a
2743 null pointer, it is guaranteed to be of the same size as a pointer.
2744 But this use is not portable across different compilers.
2746 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2747 @opindex Wno-non-template-friend
2748 @opindex Wnon-template-friend
2749 Disable warnings when non-templatized friend functions are declared
2750 within a template.  Since the advent of explicit template specification
2751 support in G++, if the name of the friend is an unqualified-id (i.e.,
2752 @samp{friend foo(int)}), the C++ language specification demands that the
2753 friend declare or define an ordinary, nontemplate function.  (Section
2754 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2755 could be interpreted as a particular specialization of a templatized
2756 function.  Because this non-conforming behavior is no longer the default
2757 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2758 check existing code for potential trouble spots and is on by default.
2759 This new compiler behavior can be turned off with
2760 @option{-Wno-non-template-friend}, which keeps the conformant compiler code
2761 but disables the helpful warning.
2763 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2764 @opindex Wold-style-cast
2765 @opindex Wno-old-style-cast
2766 Warn if an old-style (C-style) cast to a non-void type is used within
2767 a C++ program.  The new-style casts (@samp{dynamic_cast},
2768 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2769 less vulnerable to unintended effects and much easier to search for.
2771 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2772 @opindex Woverloaded-virtual
2773 @opindex Wno-overloaded-virtual
2774 @cindex overloaded virtual function, warning
2775 @cindex warning for overloaded virtual function
2776 Warn when a function declaration hides virtual functions from a
2777 base class.  For example, in:
2779 @smallexample
2780 struct A @{
2781   virtual void f();
2784 struct B: public A @{
2785   void f(int);
2787 @end smallexample
2789 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2790 like:
2792 @smallexample
2793 B* b;
2794 b->f();
2795 @end smallexample
2797 @noindent
2798 fails to compile.
2800 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2801 @opindex Wno-pmf-conversions
2802 @opindex Wpmf-conversions
2803 Disable the diagnostic for converting a bound pointer to member function
2804 to a plain pointer.
2806 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2807 @opindex Wsign-promo
2808 @opindex Wno-sign-promo
2809 Warn when overload resolution chooses a promotion from unsigned or
2810 enumerated type to a signed type, over a conversion to an unsigned type of
2811 the same size.  Previous versions of G++ tried to preserve
2812 unsignedness, but the standard mandates the current behavior.
2813 @end table
2815 @node Objective-C and Objective-C++ Dialect Options
2816 @section Options Controlling Objective-C and Objective-C++ Dialects
2818 @cindex compiler options, Objective-C and Objective-C++
2819 @cindex Objective-C and Objective-C++ options, command-line
2820 @cindex options, Objective-C and Objective-C++
2821 (NOTE: This manual does not describe the Objective-C and Objective-C++
2822 languages themselves.  @xref{Standards,,Language Standards
2823 Supported by GCC}, for references.)
2825 This section describes the command-line options that are only meaningful
2826 for Objective-C and Objective-C++ programs.  You can also use most of
2827 the language-independent GNU compiler options.
2828 For example, you might compile a file @code{some_class.m} like this:
2830 @smallexample
2831 gcc -g -fgnu-runtime -O -c some_class.m
2832 @end smallexample
2834 @noindent
2835 In this example, @option{-fgnu-runtime} is an option meant only for
2836 Objective-C and Objective-C++ programs; you can use the other options with
2837 any language supported by GCC@.
2839 Note that since Objective-C is an extension of the C language, Objective-C
2840 compilations may also use options specific to the C front-end (e.g.,
2841 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2842 C++-specific options (e.g., @option{-Wabi}).
2844 Here is a list of options that are @emph{only} for compiling Objective-C
2845 and Objective-C++ programs:
2847 @table @gcctabopt
2848 @item -fconstant-string-class=@var{class-name}
2849 @opindex fconstant-string-class
2850 Use @var{class-name} as the name of the class to instantiate for each
2851 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2852 class name is @code{NXConstantString} if the GNU runtime is being used, and
2853 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2854 @option{-fconstant-cfstrings} option, if also present, overrides the
2855 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2856 to be laid out as constant CoreFoundation strings.
2858 @item -fgnu-runtime
2859 @opindex fgnu-runtime
2860 Generate object code compatible with the standard GNU Objective-C
2861 runtime.  This is the default for most types of systems.
2863 @item -fnext-runtime
2864 @opindex fnext-runtime
2865 Generate output compatible with the NeXT runtime.  This is the default
2866 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2867 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2868 used.
2870 @item -fno-nil-receivers
2871 @opindex fno-nil-receivers
2872 Assume that all Objective-C message dispatches (@code{[receiver
2873 message:arg]}) in this translation unit ensure that the receiver is
2874 not @code{nil}.  This allows for more efficient entry points in the
2875 runtime to be used.  This option is only available in conjunction with
2876 the NeXT runtime and ABI version 0 or 1.
2878 @item -fobjc-abi-version=@var{n}
2879 @opindex fobjc-abi-version
2880 Use version @var{n} of the Objective-C ABI for the selected runtime.
2881 This option is currently supported only for the NeXT runtime.  In that
2882 case, Version 0 is the traditional (32-bit) ABI without support for
2883 properties and other Objective-C 2.0 additions.  Version 1 is the
2884 traditional (32-bit) ABI with support for properties and other
2885 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
2886 nothing is specified, the default is Version 0 on 32-bit target
2887 machines, and Version 2 on 64-bit target machines.
2889 @item -fobjc-call-cxx-cdtors
2890 @opindex fobjc-call-cxx-cdtors
2891 For each Objective-C class, check if any of its instance variables is a
2892 C++ object with a non-trivial default constructor.  If so, synthesize a
2893 special @code{- (id) .cxx_construct} instance method which runs
2894 non-trivial default constructors on any such instance variables, in order,
2895 and then return @code{self}.  Similarly, check if any instance variable
2896 is a C++ object with a non-trivial destructor, and if so, synthesize a
2897 special @code{- (void) .cxx_destruct} method which runs
2898 all such default destructors, in reverse order.
2900 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
2901 methods thusly generated only operate on instance variables
2902 declared in the current Objective-C class, and not those inherited
2903 from superclasses.  It is the responsibility of the Objective-C
2904 runtime to invoke all such methods in an object's inheritance
2905 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
2906 by the runtime immediately after a new object instance is allocated;
2907 the @code{- (void) .cxx_destruct} methods are invoked immediately
2908 before the runtime deallocates an object instance.
2910 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2911 support for invoking the @code{- (id) .cxx_construct} and
2912 @code{- (void) .cxx_destruct} methods.
2914 @item -fobjc-direct-dispatch
2915 @opindex fobjc-direct-dispatch
2916 Allow fast jumps to the message dispatcher.  On Darwin this is
2917 accomplished via the comm page.
2919 @item -fobjc-exceptions
2920 @opindex fobjc-exceptions
2921 Enable syntactic support for structured exception handling in
2922 Objective-C, similar to what is offered by C++ and Java.  This option
2923 is required to use the Objective-C keywords @code{@@try},
2924 @code{@@throw}, @code{@@catch}, @code{@@finally} and
2925 @code{@@synchronized}.  This option is available with both the GNU
2926 runtime and the NeXT runtime (but not available in conjunction with
2927 the NeXT runtime on Mac OS X 10.2 and earlier).
2929 @item -fobjc-gc
2930 @opindex fobjc-gc
2931 Enable garbage collection (GC) in Objective-C and Objective-C++
2932 programs.  This option is only available with the NeXT runtime; the
2933 GNU runtime has a different garbage collection implementation that
2934 does not require special compiler flags.
2936 @item -fobjc-nilcheck
2937 @opindex fobjc-nilcheck
2938 For the NeXT runtime with version 2 of the ABI, check for a nil
2939 receiver in method invocations before doing the actual method call.
2940 This is the default and can be disabled using
2941 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
2942 checked for nil in this way no matter what this flag is set to.
2943 Currently this flag does nothing when the GNU runtime, or an older
2944 version of the NeXT runtime ABI, is used.
2946 @item -fobjc-std=objc1
2947 @opindex fobjc-std
2948 Conform to the language syntax of Objective-C 1.0, the language
2949 recognized by GCC 4.0.  This only affects the Objective-C additions to
2950 the C/C++ language; it does not affect conformance to C/C++ standards,
2951 which is controlled by the separate C/C++ dialect option flags.  When
2952 this option is used with the Objective-C or Objective-C++ compiler,
2953 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
2954 This is useful if you need to make sure that your Objective-C code can
2955 be compiled with older versions of GCC@.
2957 @item -freplace-objc-classes
2958 @opindex freplace-objc-classes
2959 Emit a special marker instructing @command{ld(1)} not to statically link in
2960 the resulting object file, and allow @command{dyld(1)} to load it in at
2961 run time instead.  This is used in conjunction with the Fix-and-Continue
2962 debugging mode, where the object file in question may be recompiled and
2963 dynamically reloaded in the course of program execution, without the need
2964 to restart the program itself.  Currently, Fix-and-Continue functionality
2965 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2966 and later.
2968 @item -fzero-link
2969 @opindex fzero-link
2970 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2971 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2972 compile time) with static class references that get initialized at load time,
2973 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2974 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2975 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2976 for individual class implementations to be modified during program execution.
2977 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
2978 regardless of command-line options.
2980 @item -fno-local-ivars
2981 @opindex fno-local-ivars
2982 @opindex flocal-ivars
2983 By default instance variables in Objective-C can be accessed as if
2984 they were local variables from within the methods of the class they're
2985 declared in.  This can lead to shadowing between instance variables
2986 and other variables declared either locally inside a class method or
2987 globally with the same name.  Specifying the @option{-fno-local-ivars}
2988 flag disables this behavior thus avoiding variable shadowing issues.
2990 @item -fivar-visibility=@var{public|protected|private|package}
2991 @opindex fivar-visibility
2992 Set the default instance variable visibility to the specified option
2993 so that instance variables declared outside the scope of any access
2994 modifier directives default to the specified visibility.
2996 @item -gen-decls
2997 @opindex gen-decls
2998 Dump interface declarations for all classes seen in the source file to a
2999 file named @file{@var{sourcename}.decl}.
3001 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
3002 @opindex Wassign-intercept
3003 @opindex Wno-assign-intercept
3004 Warn whenever an Objective-C assignment is being intercepted by the
3005 garbage collector.
3007 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
3008 @opindex Wno-protocol
3009 @opindex Wprotocol
3010 If a class is declared to implement a protocol, a warning is issued for
3011 every method in the protocol that is not implemented by the class.  The
3012 default behavior is to issue a warning for every method not explicitly
3013 implemented in the class, even if a method implementation is inherited
3014 from the superclass.  If you use the @option{-Wno-protocol} option, then
3015 methods inherited from the superclass are considered to be implemented,
3016 and no warning is issued for them.
3018 @item -Wselector @r{(Objective-C and Objective-C++ only)}
3019 @opindex Wselector
3020 @opindex Wno-selector
3021 Warn if multiple methods of different types for the same selector are
3022 found during compilation.  The check is performed on the list of methods
3023 in the final stage of compilation.  Additionally, a check is performed
3024 for each selector appearing in a @code{@@selector(@dots{})}
3025 expression, and a corresponding method for that selector has been found
3026 during compilation.  Because these checks scan the method table only at
3027 the end of compilation, these warnings are not produced if the final
3028 stage of compilation is not reached, for example because an error is
3029 found during compilation, or because the @option{-fsyntax-only} option is
3030 being used.
3032 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
3033 @opindex Wstrict-selector-match
3034 @opindex Wno-strict-selector-match
3035 Warn if multiple methods with differing argument and/or return types are
3036 found for a given selector when attempting to send a message using this
3037 selector to a receiver of type @code{id} or @code{Class}.  When this flag
3038 is off (which is the default behavior), the compiler omits such warnings
3039 if any differences found are confined to types that share the same size
3040 and alignment.
3042 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
3043 @opindex Wundeclared-selector
3044 @opindex Wno-undeclared-selector
3045 Warn if a @code{@@selector(@dots{})} expression referring to an
3046 undeclared selector is found.  A selector is considered undeclared if no
3047 method with that name has been declared before the
3048 @code{@@selector(@dots{})} expression, either explicitly in an
3049 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
3050 an @code{@@implementation} section.  This option always performs its
3051 checks as soon as a @code{@@selector(@dots{})} expression is found,
3052 while @option{-Wselector} only performs its checks in the final stage of
3053 compilation.  This also enforces the coding style convention
3054 that methods and selectors must be declared before being used.
3056 @item -print-objc-runtime-info
3057 @opindex print-objc-runtime-info
3058 Generate C header describing the largest structure that is passed by
3059 value, if any.
3061 @end table
3063 @node Language Independent Options
3064 @section Options to Control Diagnostic Messages Formatting
3065 @cindex options to control diagnostics formatting
3066 @cindex diagnostic messages
3067 @cindex message formatting
3069 Traditionally, diagnostic messages have been formatted irrespective of
3070 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
3071 options described below
3072 to control the formatting algorithm for diagnostic messages, 
3073 e.g.@: how many characters per line, how often source location
3074 information should be reported.  Note that some language front ends may not
3075 honor these options.
3077 @table @gcctabopt
3078 @item -fmessage-length=@var{n}
3079 @opindex fmessage-length
3080 Try to format error messages so that they fit on lines of about
3081 @var{n} characters.  If @var{n} is zero, then no line-wrapping will be
3082 done; each error message will appear on a single line.  This is the
3083 default for all front ends.
3085 @item -fdiagnostics-show-location=once
3086 @opindex fdiagnostics-show-location
3087 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
3088 reporter to emit source location information @emph{once}; that is, in
3089 case the message is too long to fit on a single physical line and has to
3090 be wrapped, the source location won't be emitted (as prefix) again,
3091 over and over, in subsequent continuation lines.  This is the default
3092 behavior.
3094 @item -fdiagnostics-show-location=every-line
3095 Only meaningful in line-wrapping mode.  Instructs the diagnostic
3096 messages reporter to emit the same source location information (as
3097 prefix) for physical lines that result from the process of breaking
3098 a message which is too long to fit on a single line.
3100 @item -fdiagnostics-color[=@var{WHEN}]
3101 @itemx -fno-diagnostics-color
3102 @opindex fdiagnostics-color
3103 @cindex highlight, color, colour
3104 @vindex GCC_COLORS @r{environment variable}
3105 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
3106 or @samp{auto}.  The default is @samp{never} if @env{GCC_COLORS} environment
3107 variable isn't present in the environment, and @samp{auto} otherwise.
3108 @samp{auto} means to use color only when the standard error is a terminal.
3109 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
3110 aliases for @option{-fdiagnostics-color=always} and
3111 @option{-fdiagnostics-color=never}, respectively.
3113 The colors are defined by the environment variable @env{GCC_COLORS}.
3114 Its value is a colon-separated list of capabilities and Select Graphic
3115 Rendition (SGR) substrings. SGR commands are interpreted by the
3116 terminal or terminal emulator.  (See the section in the documentation
3117 of your text terminal for permitted values and their meanings as
3118 character attributes.)  These substring values are integers in decimal
3119 representation and can be concatenated with semicolons.
3120 Common values to concatenate include
3121 @samp{1} for bold,
3122 @samp{4} for underline,
3123 @samp{5} for blink,
3124 @samp{7} for inverse,
3125 @samp{39} for default foreground color,
3126 @samp{30} to @samp{37} for foreground colors,
3127 @samp{90} to @samp{97} for 16-color mode foreground colors,
3128 @samp{38;5;0} to @samp{38;5;255}
3129 for 88-color and 256-color modes foreground colors,
3130 @samp{49} for default background color,
3131 @samp{40} to @samp{47} for background colors,
3132 @samp{100} to @samp{107} for 16-color mode background colors,
3133 and @samp{48;5;0} to @samp{48;5;255}
3134 for 88-color and 256-color modes background colors.
3136 The default @env{GCC_COLORS} is
3137 @samp{error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01}
3138 where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
3139 @samp{01;36} is bold cyan, @samp{01;32} is bold green and
3140 @samp{01} is bold. Setting @env{GCC_COLORS} to the empty
3141 string disables colors.
3142 Supported capabilities are as follows.
3144 @table @code
3145 @item error=
3146 @vindex error GCC_COLORS @r{capability}
3147 SGR substring for error: markers.
3149 @item warning=
3150 @vindex warning GCC_COLORS @r{capability}
3151 SGR substring for warning: markers.
3153 @item note=
3154 @vindex note GCC_COLORS @r{capability}
3155 SGR substring for note: markers.
3157 @item caret=
3158 @vindex caret GCC_COLORS @r{capability}
3159 SGR substring for caret line.
3161 @item locus=
3162 @vindex locus GCC_COLORS @r{capability}
3163 SGR substring for location information, @samp{file:line} or
3164 @samp{file:line:column} etc.
3166 @item quote=
3167 @vindex quote GCC_COLORS @r{capability}
3168 SGR substring for information printed within quotes.
3169 @end table
3171 @item -fno-diagnostics-show-option
3172 @opindex fno-diagnostics-show-option
3173 @opindex fdiagnostics-show-option
3174 By default, each diagnostic emitted includes text indicating the
3175 command-line option that directly controls the diagnostic (if such an
3176 option is known to the diagnostic machinery).  Specifying the
3177 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
3179 @item -fno-diagnostics-show-caret
3180 @opindex fno-diagnostics-show-caret
3181 @opindex fdiagnostics-show-caret
3182 By default, each diagnostic emitted includes the original source line
3183 and a caret '^' indicating the column.  This option suppresses this
3184 information.
3186 @end table
3188 @node Warning Options
3189 @section Options to Request or Suppress Warnings
3190 @cindex options to control warnings
3191 @cindex warning messages
3192 @cindex messages, warning
3193 @cindex suppressing warnings
3195 Warnings are diagnostic messages that report constructions that
3196 are not inherently erroneous but that are risky or suggest there
3197 may have been an error.
3199 The following language-independent options do not enable specific
3200 warnings but control the kinds of diagnostics produced by GCC@.
3202 @table @gcctabopt
3203 @cindex syntax checking
3204 @item -fsyntax-only
3205 @opindex fsyntax-only
3206 Check the code for syntax errors, but don't do anything beyond that.
3208 @item -fmax-errors=@var{n}
3209 @opindex fmax-errors
3210 Limits the maximum number of error messages to @var{n}, at which point
3211 GCC bails out rather than attempting to continue processing the source
3212 code.  If @var{n} is 0 (the default), there is no limit on the number
3213 of error messages produced.  If @option{-Wfatal-errors} is also
3214 specified, then @option{-Wfatal-errors} takes precedence over this
3215 option.
3217 @item -w
3218 @opindex w
3219 Inhibit all warning messages.
3221 @item -Werror
3222 @opindex Werror
3223 @opindex Wno-error
3224 Make all warnings into errors.
3226 @item -Werror=
3227 @opindex Werror=
3228 @opindex Wno-error=
3229 Make the specified warning into an error.  The specifier for a warning
3230 is appended; for example @option{-Werror=switch} turns the warnings
3231 controlled by @option{-Wswitch} into errors.  This switch takes a
3232 negative form, to be used to negate @option{-Werror} for specific
3233 warnings; for example @option{-Wno-error=switch} makes
3234 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3235 is in effect.
3237 The warning message for each controllable warning includes the
3238 option that controls the warning.  That option can then be used with
3239 @option{-Werror=} and @option{-Wno-error=} as described above.
3240 (Printing of the option in the warning message can be disabled using the
3241 @option{-fno-diagnostics-show-option} flag.)
3243 Note that specifying @option{-Werror=}@var{foo} automatically implies
3244 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3245 imply anything.
3247 @item -Wfatal-errors
3248 @opindex Wfatal-errors
3249 @opindex Wno-fatal-errors
3250 This option causes the compiler to abort compilation on the first error
3251 occurred rather than trying to keep going and printing further error
3252 messages.
3254 @end table
3256 You can request many specific warnings with options beginning with
3257 @samp{-W}, for example @option{-Wimplicit} to request warnings on
3258 implicit declarations.  Each of these specific warning options also
3259 has a negative form beginning @samp{-Wno-} to turn off warnings; for
3260 example, @option{-Wno-implicit}.  This manual lists only one of the
3261 two forms, whichever is not the default.  For further
3262 language-specific options also refer to @ref{C++ Dialect Options} and
3263 @ref{Objective-C and Objective-C++ Dialect Options}.
3265 Some options, such as @option{-Wall} and @option{-Wextra}, turn on other
3266 options, such as @option{-Wunused}, which may turn on further options,
3267 such as @option{-Wunused-value}. The combined effect of positive and
3268 negative forms is that more specific options have priority over less
3269 specific ones, independently of their position in the command-line. For
3270 options of the same specificity, the last one takes effect. Options
3271 enabled or disabled via pragmas (@pxref{Diagnostic Pragmas}) take effect
3272 as if they appeared at the end of the command-line.
3274 When an unrecognized warning option is requested (e.g.,
3275 @option{-Wunknown-warning}), GCC emits a diagnostic stating
3276 that the option is not recognized.  However, if the @option{-Wno-} form
3277 is used, the behavior is slightly different: no diagnostic is
3278 produced for @option{-Wno-unknown-warning} unless other diagnostics
3279 are being produced.  This allows the use of new @option{-Wno-} options
3280 with old compilers, but if something goes wrong, the compiler
3281 warns that an unrecognized option is present.
3283 @table @gcctabopt
3284 @item -Wpedantic
3285 @itemx -pedantic
3286 @opindex pedantic
3287 @opindex Wpedantic
3288 Issue all the warnings demanded by strict ISO C and ISO C++;
3289 reject all programs that use forbidden extensions, and some other
3290 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
3291 version of the ISO C standard specified by any @option{-std} option used.
3293 Valid ISO C and ISO C++ programs should compile properly with or without
3294 this option (though a rare few require @option{-ansi} or a
3295 @option{-std} option specifying the required version of ISO C)@.  However,
3296 without this option, certain GNU extensions and traditional C and C++
3297 features are supported as well.  With this option, they are rejected.
3299 @option{-Wpedantic} does not cause warning messages for use of the
3300 alternate keywords whose names begin and end with @samp{__}.  Pedantic
3301 warnings are also disabled in the expression that follows
3302 @code{__extension__}.  However, only system header files should use
3303 these escape routes; application programs should avoid them.
3304 @xref{Alternate Keywords}.
3306 Some users try to use @option{-Wpedantic} to check programs for strict ISO
3307 C conformance.  They soon find that it does not do quite what they want:
3308 it finds some non-ISO practices, but not all---only those for which
3309 ISO C @emph{requires} a diagnostic, and some others for which
3310 diagnostics have been added.
3312 A feature to report any failure to conform to ISO C might be useful in
3313 some instances, but would require considerable additional work and would
3314 be quite different from @option{-Wpedantic}.  We don't have plans to
3315 support such a feature in the near future.
3317 Where the standard specified with @option{-std} represents a GNU
3318 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3319 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3320 extended dialect is based.  Warnings from @option{-Wpedantic} are given
3321 where they are required by the base standard.  (It does not make sense
3322 for such warnings to be given only for features not in the specified GNU
3323 C dialect, since by definition the GNU dialects of C include all
3324 features the compiler supports with the given option, and there would be
3325 nothing to warn about.)
3327 @item -pedantic-errors
3328 @opindex pedantic-errors
3329 Give an error whenever the @dfn{base standard} (see @option{-Wpedantic})
3330 requires a diagnostic, in some cases where there is undefined behavior
3331 at compile-time and in some other cases that do not prevent compilation
3332 of programs that are valid according to the standard. This is not
3333 equivalent to @option{-Werror=pedantic}, since there are errors enabled
3334 by this option and not enabled by the latter and vice versa.
3336 @item -Wall
3337 @opindex Wall
3338 @opindex Wno-all
3339 This enables all the warnings about constructions that some users
3340 consider questionable, and that are easy to avoid (or modify to
3341 prevent the warning), even in conjunction with macros.  This also
3342 enables some language-specific warnings described in @ref{C++ Dialect
3343 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3345 @option{-Wall} turns on the following warning flags:
3347 @gccoptlist{-Waddress   @gol
3348 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
3349 -Wc++11-compat  @gol
3350 -Wchar-subscripts  @gol
3351 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
3352 -Wimplicit-int @r{(C and Objective-C only)} @gol
3353 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3354 -Wcomment  @gol
3355 -Wformat   @gol
3356 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3357 -Wmaybe-uninitialized @gol
3358 -Wmissing-braces @r{(only for C/ObjC)} @gol
3359 -Wnonnull  @gol
3360 -Wopenmp-simd @gol
3361 -Wparentheses  @gol
3362 -Wpointer-sign  @gol
3363 -Wreorder   @gol
3364 -Wreturn-type  @gol
3365 -Wsequence-point  @gol
3366 -Wsign-compare @r{(only in C++)}  @gol
3367 -Wstrict-aliasing  @gol
3368 -Wstrict-overflow=1  @gol
3369 -Wswitch  @gol
3370 -Wtrigraphs  @gol
3371 -Wuninitialized  @gol
3372 -Wunknown-pragmas  @gol
3373 -Wunused-function  @gol
3374 -Wunused-label     @gol
3375 -Wunused-value     @gol
3376 -Wunused-variable  @gol
3377 -Wvolatile-register-var @gol
3380 Note that some warning flags are not implied by @option{-Wall}.  Some of
3381 them warn about constructions that users generally do not consider
3382 questionable, but which occasionally you might wish to check for;
3383 others warn about constructions that are necessary or hard to avoid in
3384 some cases, and there is no simple way to modify the code to suppress
3385 the warning. Some of them are enabled by @option{-Wextra} but many of
3386 them must be enabled individually.
3388 @item -Wextra
3389 @opindex W
3390 @opindex Wextra
3391 @opindex Wno-extra
3392 This enables some extra warning flags that are not enabled by
3393 @option{-Wall}. (This option used to be called @option{-W}.  The older
3394 name is still supported, but the newer name is more descriptive.)
3396 @gccoptlist{-Wclobbered  @gol
3397 -Wempty-body  @gol
3398 -Wignored-qualifiers @gol
3399 -Wmissing-field-initializers  @gol
3400 -Wmissing-parameter-type @r{(C only)}  @gol
3401 -Wold-style-declaration @r{(C only)}  @gol
3402 -Woverride-init  @gol
3403 -Wsign-compare  @gol
3404 -Wtype-limits  @gol
3405 -Wuninitialized  @gol
3406 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3407 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3410 The option @option{-Wextra} also prints warning messages for the
3411 following cases:
3413 @itemize @bullet
3415 @item
3416 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3417 @samp{>}, or @samp{>=}.
3419 @item
3420 (C++ only) An enumerator and a non-enumerator both appear in a
3421 conditional expression.
3423 @item
3424 (C++ only) Ambiguous virtual bases.
3426 @item
3427 (C++ only) Subscripting an array that has been declared @samp{register}.
3429 @item
3430 (C++ only) Taking the address of a variable that has been declared
3431 @samp{register}.
3433 @item
3434 (C++ only) A base class is not initialized in a derived class's copy
3435 constructor.
3437 @end itemize
3439 @item -Wchar-subscripts
3440 @opindex Wchar-subscripts
3441 @opindex Wno-char-subscripts
3442 Warn if an array subscript has type @code{char}.  This is a common cause
3443 of error, as programmers often forget that this type is signed on some
3444 machines.
3445 This warning is enabled by @option{-Wall}.
3447 @item -Wcomment
3448 @opindex Wcomment
3449 @opindex Wno-comment
3450 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3451 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3452 This warning is enabled by @option{-Wall}.
3454 @item -Wno-coverage-mismatch
3455 @opindex Wno-coverage-mismatch
3456 Warn if feedback profiles do not match when using the
3457 @option{-fprofile-use} option.
3458 If a source file is changed between compiling with @option{-fprofile-gen} and
3459 with @option{-fprofile-use}, the files with the profile feedback can fail
3460 to match the source file and GCC cannot use the profile feedback
3461 information.  By default, this warning is enabled and is treated as an
3462 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3463 warning or @option{-Wno-error=coverage-mismatch} can be used to
3464 disable the error.  Disabling the error for this warning can result in
3465 poorly optimized code and is useful only in the
3466 case of very minor changes such as bug fixes to an existing code-base.
3467 Completely disabling the warning is not recommended.
3469 @item -Wno-cpp
3470 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3472 Suppress warning messages emitted by @code{#warning} directives.
3474 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3475 @opindex Wdouble-promotion
3476 @opindex Wno-double-promotion
3477 Give a warning when a value of type @code{float} is implicitly
3478 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3479 floating-point unit implement @code{float} in hardware, but emulate
3480 @code{double} in software.  On such a machine, doing computations
3481 using @code{double} values is much more expensive because of the
3482 overhead required for software emulation.
3484 It is easy to accidentally do computations with @code{double} because
3485 floating-point literals are implicitly of type @code{double}.  For
3486 example, in:
3487 @smallexample
3488 @group
3489 float area(float radius)
3491    return 3.14159 * radius * radius;
3493 @end group
3494 @end smallexample
3495 the compiler performs the entire computation with @code{double}
3496 because the floating-point literal is a @code{double}.
3498 @item -Wformat
3499 @itemx -Wformat=@var{n}
3500 @opindex Wformat
3501 @opindex Wno-format
3502 @opindex ffreestanding
3503 @opindex fno-builtin
3504 @opindex Wformat=
3505 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3506 the arguments supplied have types appropriate to the format string
3507 specified, and that the conversions specified in the format string make
3508 sense.  This includes standard functions, and others specified by format
3509 attributes (@pxref{Function Attributes}), in the @code{printf},
3510 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3511 not in the C standard) families (or other target-specific families).
3512 Which functions are checked without format attributes having been
3513 specified depends on the standard version selected, and such checks of
3514 functions without the attribute specified are disabled by
3515 @option{-ffreestanding} or @option{-fno-builtin}.
3517 The formats are checked against the format features supported by GNU
3518 libc version 2.2.  These include all ISO C90 and C99 features, as well
3519 as features from the Single Unix Specification and some BSD and GNU
3520 extensions.  Other library implementations may not support all these
3521 features; GCC does not support warning about features that go beyond a
3522 particular library's limitations.  However, if @option{-Wpedantic} is used
3523 with @option{-Wformat}, warnings are given about format features not
3524 in the selected standard version (but not for @code{strfmon} formats,
3525 since those are not in any version of the C standard).  @xref{C Dialect
3526 Options,,Options Controlling C Dialect}.
3528 @table @gcctabopt
3529 @item -Wformat=1
3530 @itemx -Wformat
3531 @opindex Wformat
3532 @opindex Wformat=1
3533 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
3534 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
3535 @option{-Wformat} also checks for null format arguments for several
3536 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
3537 aspects of this level of format checking can be disabled by the
3538 options: @option{-Wno-format-contains-nul},
3539 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
3540 @option{-Wformat} is enabled by @option{-Wall}.
3542 @item -Wno-format-contains-nul
3543 @opindex Wno-format-contains-nul
3544 @opindex Wformat-contains-nul
3545 If @option{-Wformat} is specified, do not warn about format strings that
3546 contain NUL bytes.
3548 @item -Wno-format-extra-args
3549 @opindex Wno-format-extra-args
3550 @opindex Wformat-extra-args
3551 If @option{-Wformat} is specified, do not warn about excess arguments to a
3552 @code{printf} or @code{scanf} format function.  The C standard specifies
3553 that such arguments are ignored.
3555 Where the unused arguments lie between used arguments that are
3556 specified with @samp{$} operand number specifications, normally
3557 warnings are still given, since the implementation could not know what
3558 type to pass to @code{va_arg} to skip the unused arguments.  However,
3559 in the case of @code{scanf} formats, this option suppresses the
3560 warning if the unused arguments are all pointers, since the Single
3561 Unix Specification says that such unused arguments are allowed.
3563 @item -Wno-format-zero-length
3564 @opindex Wno-format-zero-length
3565 @opindex Wformat-zero-length
3566 If @option{-Wformat} is specified, do not warn about zero-length formats.
3567 The C standard specifies that zero-length formats are allowed.
3570 @item -Wformat=2
3571 @opindex Wformat=2
3572 Enable @option{-Wformat} plus additional format checks.  Currently
3573 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
3574 -Wformat-signedness -Wformat-y2k}.
3576 @item -Wformat-nonliteral
3577 @opindex Wformat-nonliteral
3578 @opindex Wno-format-nonliteral
3579 If @option{-Wformat} is specified, also warn if the format string is not a
3580 string literal and so cannot be checked, unless the format function
3581 takes its format arguments as a @code{va_list}.
3583 @item -Wformat-security
3584 @opindex Wformat-security
3585 @opindex Wno-format-security
3586 If @option{-Wformat} is specified, also warn about uses of format
3587 functions that represent possible security problems.  At present, this
3588 warns about calls to @code{printf} and @code{scanf} functions where the
3589 format string is not a string literal and there are no format arguments,
3590 as in @code{printf (foo);}.  This may be a security hole if the format
3591 string came from untrusted input and contains @samp{%n}.  (This is
3592 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3593 in future warnings may be added to @option{-Wformat-security} that are not
3594 included in @option{-Wformat-nonliteral}.)
3596 @item -Wformat-signedness
3597 @opindex Wformat-signedness
3598 @opindex Wno-format-signedness
3599 If @option{-Wformat} is specified, also warn if the format string
3600 requires an unsigned argument and the argument is signed and vice versa.
3602 @item -Wformat-y2k
3603 @opindex Wformat-y2k
3604 @opindex Wno-format-y2k
3605 If @option{-Wformat} is specified, also warn about @code{strftime}
3606 formats that may yield only a two-digit year.
3607 @end table
3609 @item -Wnonnull
3610 @opindex Wnonnull
3611 @opindex Wno-nonnull
3612 Warn about passing a null pointer for arguments marked as
3613 requiring a non-null value by the @code{nonnull} function attribute.
3615 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3616 can be disabled with the @option{-Wno-nonnull} option.
3618 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3619 @opindex Winit-self
3620 @opindex Wno-init-self
3621 Warn about uninitialized variables that are initialized with themselves.
3622 Note this option can only be used with the @option{-Wuninitialized} option.
3624 For example, GCC warns about @code{i} being uninitialized in the
3625 following snippet only when @option{-Winit-self} has been specified:
3626 @smallexample
3627 @group
3628 int f()
3630   int i = i;
3631   return i;
3633 @end group
3634 @end smallexample
3636 This warning is enabled by @option{-Wall} in C++.
3638 @item -Wimplicit-int @r{(C and Objective-C only)}
3639 @opindex Wimplicit-int
3640 @opindex Wno-implicit-int
3641 Warn when a declaration does not specify a type.
3642 This warning is enabled by @option{-Wall}.
3644 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3645 @opindex Wimplicit-function-declaration
3646 @opindex Wno-implicit-function-declaration
3647 Give a warning whenever a function is used before being declared. In
3648 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3649 enabled by default and it is made into an error by
3650 @option{-pedantic-errors}. This warning is also enabled by
3651 @option{-Wall}.
3653 @item -Wimplicit @r{(C and Objective-C only)}
3654 @opindex Wimplicit
3655 @opindex Wno-implicit
3656 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3657 This warning is enabled by @option{-Wall}.
3659 @item -Wignored-qualifiers @r{(C and C++ only)}
3660 @opindex Wignored-qualifiers
3661 @opindex Wno-ignored-qualifiers
3662 Warn if the return type of a function has a type qualifier
3663 such as @code{const}.  For ISO C such a type qualifier has no effect,
3664 since the value returned by a function is not an lvalue.
3665 For C++, the warning is only emitted for scalar types or @code{void}.
3666 ISO C prohibits qualified @code{void} return types on function
3667 definitions, so such return types always receive a warning
3668 even without this option.
3670 This warning is also enabled by @option{-Wextra}.
3672 @item -Wmain
3673 @opindex Wmain
3674 @opindex Wno-main
3675 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3676 a function with external linkage, returning int, taking either zero
3677 arguments, two, or three arguments of appropriate types.  This warning
3678 is enabled by default in C++ and is enabled by either @option{-Wall}
3679 or @option{-Wpedantic}.
3681 @item -Wmissing-braces
3682 @opindex Wmissing-braces
3683 @opindex Wno-missing-braces
3684 Warn if an aggregate or union initializer is not fully bracketed.  In
3685 the following example, the initializer for @samp{a} is not fully
3686 bracketed, but that for @samp{b} is fully bracketed.  This warning is
3687 enabled by @option{-Wall} in C.
3689 @smallexample
3690 int a[2][2] = @{ 0, 1, 2, 3 @};
3691 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3692 @end smallexample
3694 This warning is enabled by @option{-Wall}.
3696 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3697 @opindex Wmissing-include-dirs
3698 @opindex Wno-missing-include-dirs
3699 Warn if a user-supplied include directory does not exist.
3701 @item -Wparentheses
3702 @opindex Wparentheses
3703 @opindex Wno-parentheses
3704 Warn if parentheses are omitted in certain contexts, such
3705 as when there is an assignment in a context where a truth value
3706 is expected, or when operators are nested whose precedence people
3707 often get confused about.
3709 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3710 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3711 interpretation from that of ordinary mathematical notation.
3713 Also warn about constructions where there may be confusion to which
3714 @code{if} statement an @code{else} branch belongs.  Here is an example of
3715 such a case:
3717 @smallexample
3718 @group
3720   if (a)
3721     if (b)
3722       foo ();
3723   else
3724     bar ();
3726 @end group
3727 @end smallexample
3729 In C/C++, every @code{else} branch belongs to the innermost possible
3730 @code{if} statement, which in this example is @code{if (b)}.  This is
3731 often not what the programmer expected, as illustrated in the above
3732 example by indentation the programmer chose.  When there is the
3733 potential for this confusion, GCC issues a warning when this flag
3734 is specified.  To eliminate the warning, add explicit braces around
3735 the innermost @code{if} statement so there is no way the @code{else}
3736 can belong to the enclosing @code{if}.  The resulting code
3737 looks like this:
3739 @smallexample
3740 @group
3742   if (a)
3743     @{
3744       if (b)
3745         foo ();
3746       else
3747         bar ();
3748     @}
3750 @end group
3751 @end smallexample
3753 Also warn for dangerous uses of the GNU extension to
3754 @code{?:} with omitted middle operand. When the condition
3755 in the @code{?}: operator is a boolean expression, the omitted value is
3756 always 1.  Often programmers expect it to be a value computed
3757 inside the conditional expression instead.
3759 This warning is enabled by @option{-Wall}.
3761 @item -Wsequence-point
3762 @opindex Wsequence-point
3763 @opindex Wno-sequence-point
3764 Warn about code that may have undefined semantics because of violations
3765 of sequence point rules in the C and C++ standards.
3767 The C and C++ standards define the order in which expressions in a C/C++
3768 program are evaluated in terms of @dfn{sequence points}, which represent
3769 a partial ordering between the execution of parts of the program: those
3770 executed before the sequence point, and those executed after it.  These
3771 occur after the evaluation of a full expression (one which is not part
3772 of a larger expression), after the evaluation of the first operand of a
3773 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3774 function is called (but after the evaluation of its arguments and the
3775 expression denoting the called function), and in certain other places.
3776 Other than as expressed by the sequence point rules, the order of
3777 evaluation of subexpressions of an expression is not specified.  All
3778 these rules describe only a partial order rather than a total order,
3779 since, for example, if two functions are called within one expression
3780 with no sequence point between them, the order in which the functions
3781 are called is not specified.  However, the standards committee have
3782 ruled that function calls do not overlap.
3784 It is not specified when between sequence points modifications to the
3785 values of objects take effect.  Programs whose behavior depends on this
3786 have undefined behavior; the C and C++ standards specify that ``Between
3787 the previous and next sequence point an object shall have its stored
3788 value modified at most once by the evaluation of an expression.
3789 Furthermore, the prior value shall be read only to determine the value
3790 to be stored.''.  If a program breaks these rules, the results on any
3791 particular implementation are entirely unpredictable.
3793 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3794 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3795 diagnosed by this option, and it may give an occasional false positive
3796 result, but in general it has been found fairly effective at detecting
3797 this sort of problem in programs.
3799 The standard is worded confusingly, therefore there is some debate
3800 over the precise meaning of the sequence point rules in subtle cases.
3801 Links to discussions of the problem, including proposed formal
3802 definitions, may be found on the GCC readings page, at
3803 @uref{http://gcc.gnu.org/@/readings.html}.
3805 This warning is enabled by @option{-Wall} for C and C++.
3807 @item -Wno-return-local-addr
3808 @opindex Wno-return-local-addr
3809 @opindex Wreturn-local-addr
3810 Do not warn about returning a pointer (or in C++, a reference) to a
3811 variable that goes out of scope after the function returns.
3813 @item -Wreturn-type
3814 @opindex Wreturn-type
3815 @opindex Wno-return-type
3816 Warn whenever a function is defined with a return type that defaults
3817 to @code{int}.  Also warn about any @code{return} statement with no
3818 return value in a function whose return type is not @code{void}
3819 (falling off the end of the function body is considered returning
3820 without a value), and about a @code{return} statement with an
3821 expression in a function whose return type is @code{void}.
3823 For C++, a function without return type always produces a diagnostic
3824 message, even when @option{-Wno-return-type} is specified.  The only
3825 exceptions are @samp{main} and functions defined in system headers.
3827 This warning is enabled by @option{-Wall}.
3829 @item -Wshift-count-negative
3830 @opindex Wshift-count-negative
3831 @opindex Wno-shift-count-negative
3832 Warn if shift count is negative. This warning is enabled by default.
3834 @item -Wshift-count-overflow
3835 @opindex Wshift-count-overflow
3836 @opindex Wno-shift-count-overflow
3837 Warn if shift count >= width of type. This warning is enabled by default.
3839 @item -Wswitch
3840 @opindex Wswitch
3841 @opindex Wno-switch
3842 Warn whenever a @code{switch} statement has an index of enumerated type
3843 and lacks a @code{case} for one or more of the named codes of that
3844 enumeration.  (The presence of a @code{default} label prevents this
3845 warning.)  @code{case} labels outside the enumeration range also
3846 provoke warnings when this option is used (even if there is a
3847 @code{default} label).
3848 This warning is enabled by @option{-Wall}.
3850 @item -Wswitch-default
3851 @opindex Wswitch-default
3852 @opindex Wno-switch-default
3853 Warn whenever a @code{switch} statement does not have a @code{default}
3854 case.
3856 @item -Wswitch-enum
3857 @opindex Wswitch-enum
3858 @opindex Wno-switch-enum
3859 Warn whenever a @code{switch} statement has an index of enumerated type
3860 and lacks a @code{case} for one or more of the named codes of that
3861 enumeration.  @code{case} labels outside the enumeration range also
3862 provoke warnings when this option is used.  The only difference
3863 between @option{-Wswitch} and this option is that this option gives a
3864 warning about an omitted enumeration code even if there is a
3865 @code{default} label.
3867 @item -Wswitch-bool
3868 @opindex Wswitch-bool
3869 @opindex Wno-switch-bool
3870 Warn whenever a @code{switch} statement has an index of boolean type.
3871 It is possible to suppress this warning by casting the controlling
3872 expression to a type other than @code{bool}.  For example:
3873 @smallexample
3874 @group
3875 switch ((int) (a == 4))
3876   @{
3877   @dots{}
3878   @}
3879 @end group
3880 @end smallexample
3881 This warning is enabled by default for C and C++ programs.
3883 @item -Wsync-nand @r{(C and C++ only)}
3884 @opindex Wsync-nand
3885 @opindex Wno-sync-nand
3886 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3887 built-in functions are used.  These functions changed semantics in GCC 4.4.
3889 @item -Wtrigraphs
3890 @opindex Wtrigraphs
3891 @opindex Wno-trigraphs
3892 Warn if any trigraphs are encountered that might change the meaning of
3893 the program (trigraphs within comments are not warned about).
3894 This warning is enabled by @option{-Wall}.
3896 @item -Wunused-but-set-parameter
3897 @opindex Wunused-but-set-parameter
3898 @opindex Wno-unused-but-set-parameter
3899 Warn whenever a function parameter is assigned to, but otherwise unused
3900 (aside from its declaration).
3902 To suppress this warning use the @samp{unused} attribute
3903 (@pxref{Variable Attributes}).
3905 This warning is also enabled by @option{-Wunused} together with
3906 @option{-Wextra}.
3908 @item -Wunused-but-set-variable
3909 @opindex Wunused-but-set-variable
3910 @opindex Wno-unused-but-set-variable
3911 Warn whenever a local variable is assigned to, but otherwise unused
3912 (aside from its declaration).
3913 This warning is enabled by @option{-Wall}.
3915 To suppress this warning use the @samp{unused} attribute
3916 (@pxref{Variable Attributes}).
3918 This warning is also enabled by @option{-Wunused}, which is enabled
3919 by @option{-Wall}.
3921 @item -Wunused-function
3922 @opindex Wunused-function
3923 @opindex Wno-unused-function
3924 Warn whenever a static function is declared but not defined or a
3925 non-inline static function is unused.
3926 This warning is enabled by @option{-Wall}.
3928 @item -Wunused-label
3929 @opindex Wunused-label
3930 @opindex Wno-unused-label
3931 Warn whenever a label is declared but not used.
3932 This warning is enabled by @option{-Wall}.
3934 To suppress this warning use the @samp{unused} attribute
3935 (@pxref{Variable Attributes}).
3937 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
3938 @opindex Wunused-local-typedefs
3939 Warn when a typedef locally defined in a function is not used.
3940 This warning is enabled by @option{-Wall}.
3942 @item -Wunused-parameter
3943 @opindex Wunused-parameter
3944 @opindex Wno-unused-parameter
3945 Warn whenever a function parameter is unused aside from its declaration.
3947 To suppress this warning use the @samp{unused} attribute
3948 (@pxref{Variable Attributes}).
3950 @item -Wno-unused-result
3951 @opindex Wunused-result
3952 @opindex Wno-unused-result
3953 Do not warn if a caller of a function marked with attribute
3954 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
3955 its return value. The default is @option{-Wunused-result}.
3957 @item -Wunused-variable
3958 @opindex Wunused-variable
3959 @opindex Wno-unused-variable
3960 Warn whenever a local variable or non-constant static variable is unused
3961 aside from its declaration.
3962 This warning is enabled by @option{-Wall}.
3964 To suppress this warning use the @samp{unused} attribute
3965 (@pxref{Variable Attributes}).
3967 @item -Wunused-value
3968 @opindex Wunused-value
3969 @opindex Wno-unused-value
3970 Warn whenever a statement computes a result that is explicitly not
3971 used. To suppress this warning cast the unused expression to
3972 @samp{void}. This includes an expression-statement or the left-hand
3973 side of a comma expression that contains no side effects. For example,
3974 an expression such as @samp{x[i,j]} causes a warning, while
3975 @samp{x[(void)i,j]} does not.
3977 This warning is enabled by @option{-Wall}.
3979 @item -Wunused
3980 @opindex Wunused
3981 @opindex Wno-unused
3982 All the above @option{-Wunused} options combined.
3984 In order to get a warning about an unused function parameter, you must
3985 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
3986 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
3988 @item -Wuninitialized
3989 @opindex Wuninitialized
3990 @opindex Wno-uninitialized
3991 Warn if an automatic variable is used without first being initialized
3992 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3993 warn if a non-static reference or non-static @samp{const} member
3994 appears in a class without constructors.
3996 If you want to warn about code that uses the uninitialized value of the
3997 variable in its own initializer, use the @option{-Winit-self} option.
3999 These warnings occur for individual uninitialized or clobbered
4000 elements of structure, union or array variables as well as for
4001 variables that are uninitialized or clobbered as a whole.  They do
4002 not occur for variables or elements declared @code{volatile}.  Because
4003 these warnings depend on optimization, the exact variables or elements
4004 for which there are warnings depends on the precise optimization
4005 options and version of GCC used.
4007 Note that there may be no warning about a variable that is used only
4008 to compute a value that itself is never used, because such
4009 computations may be deleted by data flow analysis before the warnings
4010 are printed.
4012 @item -Wmaybe-uninitialized
4013 @opindex Wmaybe-uninitialized
4014 @opindex Wno-maybe-uninitialized
4015 For an automatic variable, if there exists a path from the function
4016 entry to a use of the variable that is initialized, but there exist
4017 some other paths for which the variable is not initialized, the compiler
4018 emits a warning if it cannot prove the uninitialized paths are not
4019 executed at run time. These warnings are made optional because GCC is
4020 not smart enough to see all the reasons why the code might be correct
4021 in spite of appearing to have an error.  Here is one example of how
4022 this can happen:
4024 @smallexample
4025 @group
4027   int x;
4028   switch (y)
4029     @{
4030     case 1: x = 1;
4031       break;
4032     case 2: x = 4;
4033       break;
4034     case 3: x = 5;
4035     @}
4036   foo (x);
4038 @end group
4039 @end smallexample
4041 @noindent
4042 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
4043 always initialized, but GCC doesn't know this. To suppress the
4044 warning, you need to provide a default case with assert(0) or
4045 similar code.
4047 @cindex @code{longjmp} warnings
4048 This option also warns when a non-volatile automatic variable might be
4049 changed by a call to @code{longjmp}.  These warnings as well are possible
4050 only in optimizing compilation.
4052 The compiler sees only the calls to @code{setjmp}.  It cannot know
4053 where @code{longjmp} will be called; in fact, a signal handler could
4054 call it at any point in the code.  As a result, you may get a warning
4055 even when there is in fact no problem because @code{longjmp} cannot
4056 in fact be called at the place that would cause a problem.
4058 Some spurious warnings can be avoided if you declare all the functions
4059 you use that never return as @code{noreturn}.  @xref{Function
4060 Attributes}.
4062 This warning is enabled by @option{-Wall} or @option{-Wextra}.
4064 @item -Wunknown-pragmas
4065 @opindex Wunknown-pragmas
4066 @opindex Wno-unknown-pragmas
4067 @cindex warning for unknown pragmas
4068 @cindex unknown pragmas, warning
4069 @cindex pragmas, warning of unknown
4070 Warn when a @code{#pragma} directive is encountered that is not understood by 
4071 GCC@.  If this command-line option is used, warnings are even issued
4072 for unknown pragmas in system header files.  This is not the case if
4073 the warnings are only enabled by the @option{-Wall} command-line option.
4075 @item -Wno-pragmas
4076 @opindex Wno-pragmas
4077 @opindex Wpragmas
4078 Do not warn about misuses of pragmas, such as incorrect parameters,
4079 invalid syntax, or conflicts between pragmas.  See also
4080 @option{-Wunknown-pragmas}.
4082 @item -Wstrict-aliasing
4083 @opindex Wstrict-aliasing
4084 @opindex Wno-strict-aliasing
4085 This option is only active when @option{-fstrict-aliasing} is active.
4086 It warns about code that might break the strict aliasing rules that the
4087 compiler is using for optimization.  The warning does not catch all
4088 cases, but does attempt to catch the more common pitfalls.  It is
4089 included in @option{-Wall}.
4090 It is equivalent to @option{-Wstrict-aliasing=3}
4092 @item -Wstrict-aliasing=n
4093 @opindex Wstrict-aliasing=n
4094 This option is only active when @option{-fstrict-aliasing} is active.
4095 It warns about code that might break the strict aliasing rules that the
4096 compiler is using for optimization.
4097 Higher levels correspond to higher accuracy (fewer false positives).
4098 Higher levels also correspond to more effort, similar to the way @option{-O} 
4099 works.
4100 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
4102 Level 1: Most aggressive, quick, least accurate.
4103 Possibly useful when higher levels
4104 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
4105 false negatives.  However, it has many false positives.
4106 Warns for all pointer conversions between possibly incompatible types,
4107 even if never dereferenced.  Runs in the front end only.
4109 Level 2: Aggressive, quick, not too precise.
4110 May still have many false positives (not as many as level 1 though),
4111 and few false negatives (but possibly more than level 1).
4112 Unlike level 1, it only warns when an address is taken.  Warns about
4113 incomplete types.  Runs in the front end only.
4115 Level 3 (default for @option{-Wstrict-aliasing}):
4116 Should have very few false positives and few false
4117 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
4118 Takes care of the common pun+dereference pattern in the front end:
4119 @code{*(int*)&some_float}.
4120 If optimization is enabled, it also runs in the back end, where it deals
4121 with multiple statement cases using flow-sensitive points-to information.
4122 Only warns when the converted pointer is dereferenced.
4123 Does not warn about incomplete types.
4125 @item -Wstrict-overflow
4126 @itemx -Wstrict-overflow=@var{n}
4127 @opindex Wstrict-overflow
4128 @opindex Wno-strict-overflow
4129 This option is only active when @option{-fstrict-overflow} is active.
4130 It warns about cases where the compiler optimizes based on the
4131 assumption that signed overflow does not occur.  Note that it does not
4132 warn about all cases where the code might overflow: it only warns
4133 about cases where the compiler implements some optimization.  Thus
4134 this warning depends on the optimization level.
4136 An optimization that assumes that signed overflow does not occur is
4137 perfectly safe if the values of the variables involved are such that
4138 overflow never does, in fact, occur.  Therefore this warning can
4139 easily give a false positive: a warning about code that is not
4140 actually a problem.  To help focus on important issues, several
4141 warning levels are defined.  No warnings are issued for the use of
4142 undefined signed overflow when estimating how many iterations a loop
4143 requires, in particular when determining whether a loop will be
4144 executed at all.
4146 @table @gcctabopt
4147 @item -Wstrict-overflow=1
4148 Warn about cases that are both questionable and easy to avoid.  For
4149 example,  with @option{-fstrict-overflow}, the compiler simplifies
4150 @code{x + 1 > x} to @code{1}.  This level of
4151 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
4152 are not, and must be explicitly requested.
4154 @item -Wstrict-overflow=2
4155 Also warn about other cases where a comparison is simplified to a
4156 constant.  For example: @code{abs (x) >= 0}.  This can only be
4157 simplified when @option{-fstrict-overflow} is in effect, because
4158 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
4159 zero.  @option{-Wstrict-overflow} (with no level) is the same as
4160 @option{-Wstrict-overflow=2}.
4162 @item -Wstrict-overflow=3
4163 Also warn about other cases where a comparison is simplified.  For
4164 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
4166 @item -Wstrict-overflow=4
4167 Also warn about other simplifications not covered by the above cases.
4168 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
4170 @item -Wstrict-overflow=5
4171 Also warn about cases where the compiler reduces the magnitude of a
4172 constant involved in a comparison.  For example: @code{x + 2 > y} is
4173 simplified to @code{x + 1 >= y}.  This is reported only at the
4174 highest warning level because this simplification applies to many
4175 comparisons, so this warning level gives a very large number of
4176 false positives.
4177 @end table
4179 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]}
4180 @opindex Wsuggest-attribute=
4181 @opindex Wno-suggest-attribute=
4182 Warn for cases where adding an attribute may be beneficial. The
4183 attributes currently supported are listed below.
4185 @table @gcctabopt
4186 @item -Wsuggest-attribute=pure
4187 @itemx -Wsuggest-attribute=const
4188 @itemx -Wsuggest-attribute=noreturn
4189 @opindex Wsuggest-attribute=pure
4190 @opindex Wno-suggest-attribute=pure
4191 @opindex Wsuggest-attribute=const
4192 @opindex Wno-suggest-attribute=const
4193 @opindex Wsuggest-attribute=noreturn
4194 @opindex Wno-suggest-attribute=noreturn
4196 Warn about functions that might be candidates for attributes
4197 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
4198 functions visible in other compilation units or (in the case of @code{pure} and
4199 @code{const}) if it cannot prove that the function returns normally. A function
4200 returns normally if it doesn't contain an infinite loop or return abnormally
4201 by throwing, calling @code{abort()} or trapping.  This analysis requires option
4202 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
4203 higher.  Higher optimization levels improve the accuracy of the analysis.
4205 @item -Wsuggest-attribute=format
4206 @itemx -Wmissing-format-attribute
4207 @opindex Wsuggest-attribute=format
4208 @opindex Wmissing-format-attribute
4209 @opindex Wno-suggest-attribute=format
4210 @opindex Wno-missing-format-attribute
4211 @opindex Wformat
4212 @opindex Wno-format
4214 Warn about function pointers that might be candidates for @code{format}
4215 attributes.  Note these are only possible candidates, not absolute ones.
4216 GCC guesses that function pointers with @code{format} attributes that
4217 are used in assignment, initialization, parameter passing or return
4218 statements should have a corresponding @code{format} attribute in the
4219 resulting type.  I.e.@: the left-hand side of the assignment or
4220 initialization, the type of the parameter variable, or the return type
4221 of the containing function respectively should also have a @code{format}
4222 attribute to avoid the warning.
4224 GCC also warns about function definitions that might be
4225 candidates for @code{format} attributes.  Again, these are only
4226 possible candidates.  GCC guesses that @code{format} attributes
4227 might be appropriate for any function that calls a function like
4228 @code{vprintf} or @code{vscanf}, but this might not always be the
4229 case, and some functions for which @code{format} attributes are
4230 appropriate may not be detected.
4231 @end table
4233 @item -Wsuggest-final-types
4234 @opindex Wno-suggest-final-types
4235 @opindex Wsuggest-final-types
4236 Warn about types with virtual methods where code quality would be improved
4237 if the type was declared with C++11 final specifier, or, if possible,
4238 declared in anonymous namespace. This allows GCC to devritualize more aggressively
4239 the polymorphic calls. This warning is more effective with link time optimization,
4240 where the information about the class hiearchy graph is more complete.
4242 @item -Wsuggest-final-methods
4243 @opindex Wno-suggest-final-methods
4244 @opindex Wsuggest-final-methods
4245 Warn about virtual methods where code quality would be improved if the method
4246 was declared with C++11 final specifier, or, if possible, its type was declared
4247 in the anonymous namespace or with final specifier. This warning is more
4248 effective with link time optimization, where the information about the class
4249 hiearchy graph is more complete. It is recommended to first consider suggestins
4250 of @option{-Wsuggest-final-types} and then rebuild with new annotations.
4252 @item -Warray-bounds
4253 @opindex Wno-array-bounds
4254 @opindex Warray-bounds
4255 This option is only active when @option{-ftree-vrp} is active
4256 (default for @option{-O2} and above). It warns about subscripts to arrays
4257 that are always out of bounds. This warning is enabled by @option{-Wall}.
4259 @item -Wbool-compare
4260 @opindex Wno-bool-compare
4261 @opindex Wbool-compare
4262 Warn about boolean expression compared with an integer value different from
4263 @code{true}/@code{false}.  For instance, the following comparison is
4264 always false:
4265 @smallexample
4266 int n = 5;
4267 @dots{}
4268 if ((n > 1) == 2) @{ @dots{} @}
4269 @end smallexample
4270 This warning is enabled by @option{-Wall}.
4272 @item -Wno-discarded-qualifiers @r{(C and Objective-C only)}
4273 @opindex Wno-discarded-qualifiers
4274 @opindex Wdiscarded-qualifiers
4275 Do not warn if type qualifiers on pointers are being discarded.
4276 Typically, the compiler will warn if a @code{const char *} variable is
4277 passed to a function that takes @code{char *} parameter.  This option
4278 can be used to suppress such a warning.
4280 @item -Wno-incompatible-pointer-types @r{(C and Objective-C only)}
4281 @opindex Wno-incompatible-pointer-types
4282 @opindex Wincompatible-pointer-types
4283 Do not warn when there is a conversion between pointers that have incompatible
4284 types.  This warning is for cases not covered by @option{-Wno-pointer-sign},
4285 which warns for pointer argument passing or assignment with different signedness
4287 @item -Wno-int-conversion @r{(C and Objective-C only)}
4288 @opindex Wno-int-conversion
4289 @opindex Wint-conversion
4290 Do not warn about incompatible integer to pointer and pointer to integer
4291 conversions.  This warning is about implicit conversions; for explicit
4292 conversions the warnings @option{-Wno-int-to-pointer-cast} and
4293 @option{-Wno-pointer-to-int-cast} may be used.
4295 @item -Wno-div-by-zero
4296 @opindex Wno-div-by-zero
4297 @opindex Wdiv-by-zero
4298 Do not warn about compile-time integer division by zero.  Floating-point
4299 division by zero is not warned about, as it can be a legitimate way of
4300 obtaining infinities and NaNs.
4302 @item -Wsystem-headers
4303 @opindex Wsystem-headers
4304 @opindex Wno-system-headers
4305 @cindex warnings from system headers
4306 @cindex system headers, warnings from
4307 Print warning messages for constructs found in system header files.
4308 Warnings from system headers are normally suppressed, on the assumption
4309 that they usually do not indicate real problems and would only make the
4310 compiler output harder to read.  Using this command-line option tells
4311 GCC to emit warnings from system headers as if they occurred in user
4312 code.  However, note that using @option{-Wall} in conjunction with this
4313 option does @emph{not} warn about unknown pragmas in system
4314 headers---for that, @option{-Wunknown-pragmas} must also be used.
4316 @item -Wtrampolines
4317 @opindex Wtrampolines
4318 @opindex Wno-trampolines
4319 Warn about trampolines generated for pointers to nested functions.
4320 A trampoline is a small piece of data or code that is created at run
4321 time on the stack when the address of a nested function is taken, and is
4322 used to call the nested function indirectly.  For some targets, it is
4323 made up of data only and thus requires no special treatment.  But, for
4324 most targets, it is made up of code and thus requires the stack to be
4325 made executable in order for the program to work properly.
4327 @item -Wfloat-equal
4328 @opindex Wfloat-equal
4329 @opindex Wno-float-equal
4330 Warn if floating-point values are used in equality comparisons.
4332 The idea behind this is that sometimes it is convenient (for the
4333 programmer) to consider floating-point values as approximations to
4334 infinitely precise real numbers.  If you are doing this, then you need
4335 to compute (by analyzing the code, or in some other way) the maximum or
4336 likely maximum error that the computation introduces, and allow for it
4337 when performing comparisons (and when producing output, but that's a
4338 different problem).  In particular, instead of testing for equality, you
4339 should check to see whether the two values have ranges that overlap; and
4340 this is done with the relational operators, so equality comparisons are
4341 probably mistaken.
4343 @item -Wtraditional @r{(C and Objective-C only)}
4344 @opindex Wtraditional
4345 @opindex Wno-traditional
4346 Warn about certain constructs that behave differently in traditional and
4347 ISO C@.  Also warn about ISO C constructs that have no traditional C
4348 equivalent, and/or problematic constructs that should be avoided.
4350 @itemize @bullet
4351 @item
4352 Macro parameters that appear within string literals in the macro body.
4353 In traditional C macro replacement takes place within string literals,
4354 but in ISO C it does not.
4356 @item
4357 In traditional C, some preprocessor directives did not exist.
4358 Traditional preprocessors only considered a line to be a directive
4359 if the @samp{#} appeared in column 1 on the line.  Therefore
4360 @option{-Wtraditional} warns about directives that traditional C
4361 understands but ignores because the @samp{#} does not appear as the
4362 first character on the line.  It also suggests you hide directives like
4363 @samp{#pragma} not understood by traditional C by indenting them.  Some
4364 traditional implementations do not recognize @samp{#elif}, so this option
4365 suggests avoiding it altogether.
4367 @item
4368 A function-like macro that appears without arguments.
4370 @item
4371 The unary plus operator.
4373 @item
4374 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
4375 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
4376 constants.)  Note, these suffixes appear in macros defined in the system
4377 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
4378 Use of these macros in user code might normally lead to spurious
4379 warnings, however GCC's integrated preprocessor has enough context to
4380 avoid warning in these cases.
4382 @item
4383 A function declared external in one block and then used after the end of
4384 the block.
4386 @item
4387 A @code{switch} statement has an operand of type @code{long}.
4389 @item
4390 A non-@code{static} function declaration follows a @code{static} one.
4391 This construct is not accepted by some traditional C compilers.
4393 @item
4394 The ISO type of an integer constant has a different width or
4395 signedness from its traditional type.  This warning is only issued if
4396 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
4397 typically represent bit patterns, are not warned about.
4399 @item
4400 Usage of ISO string concatenation is detected.
4402 @item
4403 Initialization of automatic aggregates.
4405 @item
4406 Identifier conflicts with labels.  Traditional C lacks a separate
4407 namespace for labels.
4409 @item
4410 Initialization of unions.  If the initializer is zero, the warning is
4411 omitted.  This is done under the assumption that the zero initializer in
4412 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
4413 initializer warnings and relies on default initialization to zero in the
4414 traditional C case.
4416 @item
4417 Conversions by prototypes between fixed/floating-point values and vice
4418 versa.  The absence of these prototypes when compiling with traditional
4419 C causes serious problems.  This is a subset of the possible
4420 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
4422 @item
4423 Use of ISO C style function definitions.  This warning intentionally is
4424 @emph{not} issued for prototype declarations or variadic functions
4425 because these ISO C features appear in your code when using
4426 libiberty's traditional C compatibility macros, @code{PARAMS} and
4427 @code{VPARAMS}.  This warning is also bypassed for nested functions
4428 because that feature is already a GCC extension and thus not relevant to
4429 traditional C compatibility.
4430 @end itemize
4432 @item -Wtraditional-conversion @r{(C and Objective-C only)}
4433 @opindex Wtraditional-conversion
4434 @opindex Wno-traditional-conversion
4435 Warn if a prototype causes a type conversion that is different from what
4436 would happen to the same argument in the absence of a prototype.  This
4437 includes conversions of fixed point to floating and vice versa, and
4438 conversions changing the width or signedness of a fixed-point argument
4439 except when the same as the default promotion.
4441 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
4442 @opindex Wdeclaration-after-statement
4443 @opindex Wno-declaration-after-statement
4444 Warn when a declaration is found after a statement in a block.  This
4445 construct, known from C++, was introduced with ISO C99 and is by default
4446 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
4447 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
4449 @item -Wundef
4450 @opindex Wundef
4451 @opindex Wno-undef
4452 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
4454 @item -Wno-endif-labels
4455 @opindex Wno-endif-labels
4456 @opindex Wendif-labels
4457 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
4459 @item -Wshadow
4460 @opindex Wshadow
4461 @opindex Wno-shadow
4462 Warn whenever a local variable or type declaration shadows another
4463 variable, parameter, type, class member (in C++), or instance variable
4464 (in Objective-C) or whenever a built-in function is shadowed. Note
4465 that in C++, the compiler warns if a local variable shadows an
4466 explicit typedef, but not if it shadows a struct/class/enum.
4468 @item -Wno-shadow-ivar @r{(Objective-C only)}
4469 @opindex Wno-shadow-ivar
4470 @opindex Wshadow-ivar
4471 Do not warn whenever a local variable shadows an instance variable in an
4472 Objective-C method.
4474 @item -Wlarger-than=@var{len}
4475 @opindex Wlarger-than=@var{len}
4476 @opindex Wlarger-than-@var{len}
4477 Warn whenever an object of larger than @var{len} bytes is defined.
4479 @item -Wframe-larger-than=@var{len}
4480 @opindex Wframe-larger-than
4481 Warn if the size of a function frame is larger than @var{len} bytes.
4482 The computation done to determine the stack frame size is approximate
4483 and not conservative.
4484 The actual requirements may be somewhat greater than @var{len}
4485 even if you do not get a warning.  In addition, any space allocated
4486 via @code{alloca}, variable-length arrays, or related constructs
4487 is not included by the compiler when determining
4488 whether or not to issue a warning.
4490 @item -Wno-free-nonheap-object
4491 @opindex Wno-free-nonheap-object
4492 @opindex Wfree-nonheap-object
4493 Do not warn when attempting to free an object that was not allocated
4494 on the heap.
4496 @item -Wstack-usage=@var{len}
4497 @opindex Wstack-usage
4498 Warn if the stack usage of a function might be larger than @var{len} bytes.
4499 The computation done to determine the stack usage is conservative.
4500 Any space allocated via @code{alloca}, variable-length arrays, or related
4501 constructs is included by the compiler when determining whether or not to
4502 issue a warning.
4504 The message is in keeping with the output of @option{-fstack-usage}.
4506 @itemize
4507 @item
4508 If the stack usage is fully static but exceeds the specified amount, it's:
4510 @smallexample
4511   warning: stack usage is 1120 bytes
4512 @end smallexample
4513 @item
4514 If the stack usage is (partly) dynamic but bounded, it's:
4516 @smallexample
4517   warning: stack usage might be 1648 bytes
4518 @end smallexample
4519 @item
4520 If the stack usage is (partly) dynamic and not bounded, it's:
4522 @smallexample
4523   warning: stack usage might be unbounded
4524 @end smallexample
4525 @end itemize
4527 @item -Wunsafe-loop-optimizations
4528 @opindex Wunsafe-loop-optimizations
4529 @opindex Wno-unsafe-loop-optimizations
4530 Warn if the loop cannot be optimized because the compiler cannot
4531 assume anything on the bounds of the loop indices.  With
4532 @option{-funsafe-loop-optimizations} warn if the compiler makes
4533 such assumptions.
4535 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
4536 @opindex Wno-pedantic-ms-format
4537 @opindex Wpedantic-ms-format
4538 When used in combination with @option{-Wformat}
4539 and @option{-pedantic} without GNU extensions, this option
4540 disables the warnings about non-ISO @code{printf} / @code{scanf} format
4541 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
4542 which depend on the MS runtime.
4544 @item -Wpointer-arith
4545 @opindex Wpointer-arith
4546 @opindex Wno-pointer-arith
4547 Warn about anything that depends on the ``size of'' a function type or
4548 of @code{void}.  GNU C assigns these types a size of 1, for
4549 convenience in calculations with @code{void *} pointers and pointers
4550 to functions.  In C++, warn also when an arithmetic operation involves
4551 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
4553 @item -Wtype-limits
4554 @opindex Wtype-limits
4555 @opindex Wno-type-limits
4556 Warn if a comparison is always true or always false due to the limited
4557 range of the data type, but do not warn for constant expressions.  For
4558 example, warn if an unsigned variable is compared against zero with
4559 @samp{<} or @samp{>=}.  This warning is also enabled by
4560 @option{-Wextra}.
4562 @item -Wbad-function-cast @r{(C and Objective-C only)}
4563 @opindex Wbad-function-cast
4564 @opindex Wno-bad-function-cast
4565 Warn whenever a function call is cast to a non-matching type.
4566 For example, warn if @code{int malloc()} is cast to @code{anything *}.
4568 @item -Wc90-c99-compat @r{(C and Objective-C only)}
4569 @opindex Wc90-c99-compat
4570 @opindex Wno-c90-c99-compat
4571 Warn about features not present in ISO C90, but present in ISO C99.
4572 For instance, warn about use of variable length arrays, @code{long long}
4573 type, @code{bool} type, compound literals, designated initializers, and so
4574 on.  This option is independent of the standards mode.  Warnings are disabled
4575 in the expression that follows @code{__extension__}.
4577 @item -Wc99-c11-compat @r{(C and Objective-C only)}
4578 @opindex Wc99-c11-compat
4579 @opindex Wno-c99-c11-compat
4580 Warn about features not present in ISO C99, but present in ISO C11.
4581 For instance, warn about use of anonymous structures and unions,
4582 @code{_Atomic} type qualifier, @code{_Thread_local} storage-class specifier,
4583 @code{_Alignas} specifier, @code{Alignof} operator, @code{_Generic} keyword,
4584 and so on.  This option is independent of the standards mode.  Warnings are
4585 disabled in the expression that follows @code{__extension__}.
4587 @item -Wc++-compat @r{(C and Objective-C only)}
4588 Warn about ISO C constructs that are outside of the common subset of
4589 ISO C and ISO C++, e.g.@: request for implicit conversion from
4590 @code{void *} to a pointer to non-@code{void} type.
4592 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
4593 Warn about C++ constructs whose meaning differs between ISO C++ 1998
4594 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
4595 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
4596 enabled by @option{-Wall}.
4598 @item -Wcast-qual
4599 @opindex Wcast-qual
4600 @opindex Wno-cast-qual
4601 Warn whenever a pointer is cast so as to remove a type qualifier from
4602 the target type.  For example, warn if a @code{const char *} is cast
4603 to an ordinary @code{char *}.
4605 Also warn when making a cast that introduces a type qualifier in an
4606 unsafe way.  For example, casting @code{char **} to @code{const char **}
4607 is unsafe, as in this example:
4609 @smallexample
4610   /* p is char ** value.  */
4611   const char **q = (const char **) p;
4612   /* Assignment of readonly string to const char * is OK.  */
4613   *q = "string";
4614   /* Now char** pointer points to read-only memory.  */
4615   **p = 'b';
4616 @end smallexample
4618 @item -Wcast-align
4619 @opindex Wcast-align
4620 @opindex Wno-cast-align
4621 Warn whenever a pointer is cast such that the required alignment of the
4622 target is increased.  For example, warn if a @code{char *} is cast to
4623 an @code{int *} on machines where integers can only be accessed at
4624 two- or four-byte boundaries.
4626 @item -Wwrite-strings
4627 @opindex Wwrite-strings
4628 @opindex Wno-write-strings
4629 When compiling C, give string constants the type @code{const
4630 char[@var{length}]} so that copying the address of one into a
4631 non-@code{const} @code{char *} pointer produces a warning.  These
4632 warnings help you find at compile time code that can try to write
4633 into a string constant, but only if you have been very careful about
4634 using @code{const} in declarations and prototypes.  Otherwise, it is
4635 just a nuisance. This is why we did not make @option{-Wall} request
4636 these warnings.
4638 When compiling C++, warn about the deprecated conversion from string
4639 literals to @code{char *}.  This warning is enabled by default for C++
4640 programs.
4642 @item -Wclobbered
4643 @opindex Wclobbered
4644 @opindex Wno-clobbered
4645 Warn for variables that might be changed by @samp{longjmp} or
4646 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
4648 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
4649 @opindex Wconditionally-supported
4650 @opindex Wno-conditionally-supported
4651 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
4653 @item -Wconversion
4654 @opindex Wconversion
4655 @opindex Wno-conversion
4656 Warn for implicit conversions that may alter a value. This includes
4657 conversions between real and integer, like @code{abs (x)} when
4658 @code{x} is @code{double}; conversions between signed and unsigned,
4659 like @code{unsigned ui = -1}; and conversions to smaller types, like
4660 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4661 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4662 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4663 conversions between signed and unsigned integers can be disabled by
4664 using @option{-Wno-sign-conversion}.
4666 For C++, also warn for confusing overload resolution for user-defined
4667 conversions; and conversions that never use a type conversion
4668 operator: conversions to @code{void}, the same type, a base class or a
4669 reference to them. Warnings about conversions between signed and
4670 unsigned integers are disabled by default in C++ unless
4671 @option{-Wsign-conversion} is explicitly enabled.
4673 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4674 @opindex Wconversion-null
4675 @opindex Wno-conversion-null
4676 Do not warn for conversions between @code{NULL} and non-pointer
4677 types. @option{-Wconversion-null} is enabled by default.
4679 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
4680 @opindex Wzero-as-null-pointer-constant
4681 @opindex Wno-zero-as-null-pointer-constant
4682 Warn when a literal '0' is used as null pointer constant.  This can
4683 be useful to facilitate the conversion to @code{nullptr} in C++11.
4685 @item -Wdate-time
4686 @opindex Wdate-time
4687 @opindex Wno-date-time
4688 Warn when macros @code{__TIME__}, @code{__DATE__} or @code{__TIMESTAMP__}
4689 are encountered as they might prevent bit-wise-identical reproducible
4690 compilations.
4692 @item -Wdelete-incomplete @r{(C++ and Objective-C++ only)}
4693 @opindex Wdelete-incomplete
4694 @opindex Wno-delete-incomplete
4695 Warn when deleting a pointer to incomplete type, which may cause
4696 undefined behavior at runtime.  This warning is enabled by default.
4698 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
4699 @opindex Wuseless-cast
4700 @opindex Wno-useless-cast
4701 Warn when an expression is casted to its own type.
4703 @item -Wempty-body
4704 @opindex Wempty-body
4705 @opindex Wno-empty-body
4706 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4707 while} statement.  This warning is also enabled by @option{-Wextra}.
4709 @item -Wenum-compare
4710 @opindex Wenum-compare
4711 @opindex Wno-enum-compare
4712 Warn about a comparison between values of different enumerated types.
4713 In C++ enumeral mismatches in conditional expressions are also
4714 diagnosed and the warning is enabled by default.  In C this warning is 
4715 enabled by @option{-Wall}.
4717 @item -Wjump-misses-init @r{(C, Objective-C only)}
4718 @opindex Wjump-misses-init
4719 @opindex Wno-jump-misses-init
4720 Warn if a @code{goto} statement or a @code{switch} statement jumps
4721 forward across the initialization of a variable, or jumps backward to a
4722 label after the variable has been initialized.  This only warns about
4723 variables that are initialized when they are declared.  This warning is
4724 only supported for C and Objective-C; in C++ this sort of branch is an
4725 error in any case.
4727 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4728 can be disabled with the @option{-Wno-jump-misses-init} option.
4730 @item -Wsign-compare
4731 @opindex Wsign-compare
4732 @opindex Wno-sign-compare
4733 @cindex warning for comparison of signed and unsigned values
4734 @cindex comparison of signed and unsigned values, warning
4735 @cindex signed and unsigned values, comparison warning
4736 Warn when a comparison between signed and unsigned values could produce
4737 an incorrect result when the signed value is converted to unsigned.
4738 This warning is also enabled by @option{-Wextra}; to get the other warnings
4739 of @option{-Wextra} without this warning, use @option{-Wextra -Wno-sign-compare}.
4741 @item -Wsign-conversion
4742 @opindex Wsign-conversion
4743 @opindex Wno-sign-conversion
4744 Warn for implicit conversions that may change the sign of an integer
4745 value, like assigning a signed integer expression to an unsigned
4746 integer variable. An explicit cast silences the warning. In C, this
4747 option is enabled also by @option{-Wconversion}.
4749 @item -Wfloat-conversion
4750 @opindex Wfloat-conversion
4751 @opindex Wno-float-conversion
4752 Warn for implicit conversions that reduce the precision of a real value.
4753 This includes conversions from real to integer, and from higher precision
4754 real to lower precision real values.  This option is also enabled by
4755 @option{-Wconversion}.
4757 @item -Wsizeof-pointer-memaccess
4758 @opindex Wsizeof-pointer-memaccess
4759 @opindex Wno-sizeof-pointer-memaccess
4760 Warn for suspicious length parameters to certain string and memory built-in
4761 functions if the argument uses @code{sizeof}.  This warning warns e.g.@:
4762 about @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not an array,
4763 but a pointer, and suggests a possible fix, or about
4764 @code{memcpy (&foo, ptr, sizeof (&foo));}.  This warning is enabled by
4765 @option{-Wall}.
4767 @item -Wsizeof-array-argument
4768 @opindex Wsizeof-array-argument
4769 @opindex Wno-sizeof-array-argument
4770 Warn when the @code{sizeof} operator is applied to a parameter that is
4771 declared as an array in a function definition.  This warning is enabled by
4772 default for C and C++ programs.
4774 @item -Wmemset-transposed-args
4775 @opindex Wmemset-transposed-args
4776 @opindex Wno-memset-transposed-args
4777 Warn for suspicious calls to the @code{memset} built-in function, if the
4778 second argument is not zero and the third argument is zero.  This warns e.g.@
4779 about @code{memset (buf, sizeof buf, 0)} where most probably
4780 @code{memset (buf, 0, sizeof buf)} was meant instead.  The diagnostics
4781 is only emitted if the third argument is literal zero, if it is some expression
4782 that is folded to zero, or e.g. a cast of zero to some type etc., it
4783 is far less likely that user has mistakenly exchanged the arguments and
4784 no warning is emitted.  This warning is enabled by @option{-Wall}.
4786 @item -Waddress
4787 @opindex Waddress
4788 @opindex Wno-address
4789 Warn about suspicious uses of memory addresses. These include using
4790 the address of a function in a conditional expression, such as
4791 @code{void func(void); if (func)}, and comparisons against the memory
4792 address of a string literal, such as @code{if (x == "abc")}.  Such
4793 uses typically indicate a programmer error: the address of a function
4794 always evaluates to true, so their use in a conditional usually
4795 indicate that the programmer forgot the parentheses in a function
4796 call; and comparisons against string literals result in unspecified
4797 behavior and are not portable in C, so they usually indicate that the
4798 programmer intended to use @code{strcmp}.  This warning is enabled by
4799 @option{-Wall}.
4801 @item -Wlogical-op
4802 @opindex Wlogical-op
4803 @opindex Wno-logical-op
4804 Warn about suspicious uses of logical operators in expressions.
4805 This includes using logical operators in contexts where a
4806 bit-wise operator is likely to be expected.
4808 @item -Wlogical-not-parentheses
4809 @opindex Wlogical-not-parentheses
4810 @opindex Wno-logical-not-parentheses
4811 Warn about logical not used on the left hand side operand of a comparison.
4812 This option does not warn if the RHS operand is of a boolean type.  Its
4813 purpose is to detect suspicious code like the following:
4814 @smallexample
4815 int a;
4816 @dots{}
4817 if (!a > 1) @{ @dots{} @}
4818 @end smallexample
4820 It is possible to suppress the warning by wrapping the LHS into
4821 parentheses:
4822 @smallexample
4823 if ((!a) > 1) @{ @dots{} @}
4824 @end smallexample
4826 This warning is enabled by @option{-Wall}.
4828 @item -Waggregate-return
4829 @opindex Waggregate-return
4830 @opindex Wno-aggregate-return
4831 Warn if any functions that return structures or unions are defined or
4832 called.  (In languages where you can return an array, this also elicits
4833 a warning.)
4835 @item -Wno-aggressive-loop-optimizations
4836 @opindex Wno-aggressive-loop-optimizations
4837 @opindex Waggressive-loop-optimizations
4838 Warn if in a loop with constant number of iterations the compiler detects
4839 undefined behavior in some statement during one or more of the iterations.
4841 @item -Wno-attributes
4842 @opindex Wno-attributes
4843 @opindex Wattributes
4844 Do not warn if an unexpected @code{__attribute__} is used, such as
4845 unrecognized attributes, function attributes applied to variables,
4846 etc.  This does not stop errors for incorrect use of supported
4847 attributes.
4849 @item -Wno-builtin-macro-redefined
4850 @opindex Wno-builtin-macro-redefined
4851 @opindex Wbuiltin-macro-redefined
4852 Do not warn if certain built-in macros are redefined.  This suppresses
4853 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4854 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4856 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4857 @opindex Wstrict-prototypes
4858 @opindex Wno-strict-prototypes
4859 Warn if a function is declared or defined without specifying the
4860 argument types.  (An old-style function definition is permitted without
4861 a warning if preceded by a declaration that specifies the argument
4862 types.)
4864 @item -Wold-style-declaration @r{(C and Objective-C only)}
4865 @opindex Wold-style-declaration
4866 @opindex Wno-old-style-declaration
4867 Warn for obsolescent usages, according to the C Standard, in a
4868 declaration. For example, warn if storage-class specifiers like
4869 @code{static} are not the first things in a declaration.  This warning
4870 is also enabled by @option{-Wextra}.
4872 @item -Wold-style-definition @r{(C and Objective-C only)}
4873 @opindex Wold-style-definition
4874 @opindex Wno-old-style-definition
4875 Warn if an old-style function definition is used.  A warning is given
4876 even if there is a previous prototype.
4878 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4879 @opindex Wmissing-parameter-type
4880 @opindex Wno-missing-parameter-type
4881 A function parameter is declared without a type specifier in K&R-style
4882 functions:
4884 @smallexample
4885 void foo(bar) @{ @}
4886 @end smallexample
4888 This warning is also enabled by @option{-Wextra}.
4890 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4891 @opindex Wmissing-prototypes
4892 @opindex Wno-missing-prototypes
4893 Warn if a global function is defined without a previous prototype
4894 declaration.  This warning is issued even if the definition itself
4895 provides a prototype.  Use this option to detect global functions
4896 that do not have a matching prototype declaration in a header file.
4897 This option is not valid for C++ because all function declarations
4898 provide prototypes and a non-matching declaration will declare an
4899 overload rather than conflict with an earlier declaration.
4900 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
4902 @item -Wmissing-declarations
4903 @opindex Wmissing-declarations
4904 @opindex Wno-missing-declarations
4905 Warn if a global function is defined without a previous declaration.
4906 Do so even if the definition itself provides a prototype.
4907 Use this option to detect global functions that are not declared in
4908 header files.  In C, no warnings are issued for functions with previous
4909 non-prototype declarations; use @option{-Wmissing-prototypes} to detect
4910 missing prototypes.  In C++, no warnings are issued for function templates,
4911 or for inline functions, or for functions in anonymous namespaces.
4913 @item -Wmissing-field-initializers
4914 @opindex Wmissing-field-initializers
4915 @opindex Wno-missing-field-initializers
4916 @opindex W
4917 @opindex Wextra
4918 @opindex Wno-extra
4919 Warn if a structure's initializer has some fields missing.  For
4920 example, the following code causes such a warning, because
4921 @code{x.h} is implicitly zero:
4923 @smallexample
4924 struct s @{ int f, g, h; @};
4925 struct s x = @{ 3, 4 @};
4926 @end smallexample
4928 This option does not warn about designated initializers, so the following
4929 modification does not trigger a warning:
4931 @smallexample
4932 struct s @{ int f, g, h; @};
4933 struct s x = @{ .f = 3, .g = 4 @};
4934 @end smallexample
4936 In C++ this option does not warn either about the empty @{ @}
4937 initializer, for example:
4939 @smallexample
4940 struct s @{ int f, g, h; @};
4941 s x = @{ @};
4942 @end smallexample
4944 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4945 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
4947 @item -Wno-multichar
4948 @opindex Wno-multichar
4949 @opindex Wmultichar
4950 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4951 Usually they indicate a typo in the user's code, as they have
4952 implementation-defined values, and should not be used in portable code.
4954 @item -Wnormalized@r{[}=@r{<}none@r{|}id@r{|}nfc@r{|}nfkc@r{>]}
4955 @opindex Wnormalized=
4956 @opindex Wnormalized
4957 @opindex Wno-normalized
4958 @cindex NFC
4959 @cindex NFKC
4960 @cindex character set, input normalization
4961 In ISO C and ISO C++, two identifiers are different if they are
4962 different sequences of characters.  However, sometimes when characters
4963 outside the basic ASCII character set are used, you can have two
4964 different character sequences that look the same.  To avoid confusion,
4965 the ISO 10646 standard sets out some @dfn{normalization rules} which
4966 when applied ensure that two sequences that look the same are turned into
4967 the same sequence.  GCC can warn you if you are using identifiers that
4968 have not been normalized; this option controls that warning.
4970 There are four levels of warning supported by GCC@.  The default is
4971 @option{-Wnormalized=nfc}, which warns about any identifier that is
4972 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4973 recommended form for most uses.  It is equivalent to
4974 @option{-Wnormalized}.
4976 Unfortunately, there are some characters allowed in identifiers by
4977 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
4978 identifiers.  That is, there's no way to use these symbols in portable
4979 ISO C or C++ and have all your identifiers in NFC@.
4980 @option{-Wnormalized=id} suppresses the warning for these characters.
4981 It is hoped that future versions of the standards involved will correct
4982 this, which is why this option is not the default.
4984 You can switch the warning off for all characters by writing
4985 @option{-Wnormalized=none} or @option{-Wno-normalized}.  You should
4986 only do this if you are using some other normalization scheme (like
4987 ``D''), because otherwise you can easily create bugs that are
4988 literally impossible to see.
4990 Some characters in ISO 10646 have distinct meanings but look identical
4991 in some fonts or display methodologies, especially once formatting has
4992 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4993 LETTER N'', displays just like a regular @code{n} that has been
4994 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4995 normalization scheme to convert all these into a standard form as
4996 well, and GCC warns if your code is not in NFKC if you use
4997 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4998 about every identifier that contains the letter O because it might be
4999 confused with the digit 0, and so is not the default, but may be
5000 useful as a local coding convention if the programming environment 
5001 cannot be fixed to display these characters distinctly.
5003 @item -Wno-deprecated
5004 @opindex Wno-deprecated
5005 @opindex Wdeprecated
5006 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
5008 @item -Wno-deprecated-declarations
5009 @opindex Wno-deprecated-declarations
5010 @opindex Wdeprecated-declarations
5011 Do not warn about uses of functions (@pxref{Function Attributes}),
5012 variables (@pxref{Variable Attributes}), and types (@pxref{Type
5013 Attributes}) marked as deprecated by using the @code{deprecated}
5014 attribute.
5016 @item -Wno-overflow
5017 @opindex Wno-overflow
5018 @opindex Woverflow
5019 Do not warn about compile-time overflow in constant expressions.
5021 @item -Wno-odr
5022 @opindex Wno-odr
5023 @opindex Wodr
5024 Warn about One Definition Rule violations during link-time optimization.
5025 Requires @option{-flto-odr-type-merging} to be enabled.  Enabled by default.
5027 @item -Wopenmp-simd
5028 @opindex Wopenm-simd
5029 Warn if the vectorizer cost model overrides the OpenMP or the Cilk Plus
5030 simd directive set by user.  The @option{-fsimd-cost-model=unlimited} can
5031 be used to relax the cost model.
5033 @item -Woverride-init @r{(C and Objective-C only)}
5034 @opindex Woverride-init
5035 @opindex Wno-override-init
5036 @opindex W
5037 @opindex Wextra
5038 @opindex Wno-extra
5039 Warn if an initialized field without side effects is overridden when
5040 using designated initializers (@pxref{Designated Inits, , Designated
5041 Initializers}).
5043 This warning is included in @option{-Wextra}.  To get other
5044 @option{-Wextra} warnings without this one, use @option{-Wextra
5045 -Wno-override-init}.
5047 @item -Wpacked
5048 @opindex Wpacked
5049 @opindex Wno-packed
5050 Warn if a structure is given the packed attribute, but the packed
5051 attribute has no effect on the layout or size of the structure.
5052 Such structures may be mis-aligned for little benefit.  For
5053 instance, in this code, the variable @code{f.x} in @code{struct bar}
5054 is misaligned even though @code{struct bar} does not itself
5055 have the packed attribute:
5057 @smallexample
5058 @group
5059 struct foo @{
5060   int x;
5061   char a, b, c, d;
5062 @} __attribute__((packed));
5063 struct bar @{
5064   char z;
5065   struct foo f;
5067 @end group
5068 @end smallexample
5070 @item -Wpacked-bitfield-compat
5071 @opindex Wpacked-bitfield-compat
5072 @opindex Wno-packed-bitfield-compat
5073 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
5074 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
5075 the change can lead to differences in the structure layout.  GCC
5076 informs you when the offset of such a field has changed in GCC 4.4.
5077 For example there is no longer a 4-bit padding between field @code{a}
5078 and @code{b} in this structure:
5080 @smallexample
5081 struct foo
5083   char a:4;
5084   char b:8;
5085 @} __attribute__ ((packed));
5086 @end smallexample
5088 This warning is enabled by default.  Use
5089 @option{-Wno-packed-bitfield-compat} to disable this warning.
5091 @item -Wpadded
5092 @opindex Wpadded
5093 @opindex Wno-padded
5094 Warn if padding is included in a structure, either to align an element
5095 of the structure or to align the whole structure.  Sometimes when this
5096 happens it is possible to rearrange the fields of the structure to
5097 reduce the padding and so make the structure smaller.
5099 @item -Wredundant-decls
5100 @opindex Wredundant-decls
5101 @opindex Wno-redundant-decls
5102 Warn if anything is declared more than once in the same scope, even in
5103 cases where multiple declaration is valid and changes nothing.
5105 @item -Wnested-externs @r{(C and Objective-C only)}
5106 @opindex Wnested-externs
5107 @opindex Wno-nested-externs
5108 Warn if an @code{extern} declaration is encountered within a function.
5110 @item -Wno-inherited-variadic-ctor
5111 @opindex Winherited-variadic-ctor
5112 @opindex Wno-inherited-variadic-ctor
5113 Suppress warnings about use of C++11 inheriting constructors when the
5114 base class inherited from has a C variadic constructor; the warning is
5115 on by default because the ellipsis is not inherited.
5117 @item -Winline
5118 @opindex Winline
5119 @opindex Wno-inline
5120 Warn if a function that is declared as inline cannot be inlined.
5121 Even with this option, the compiler does not warn about failures to
5122 inline functions declared in system headers.
5124 The compiler uses a variety of heuristics to determine whether or not
5125 to inline a function.  For example, the compiler takes into account
5126 the size of the function being inlined and the amount of inlining
5127 that has already been done in the current function.  Therefore,
5128 seemingly insignificant changes in the source program can cause the
5129 warnings produced by @option{-Winline} to appear or disappear.
5131 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
5132 @opindex Wno-invalid-offsetof
5133 @opindex Winvalid-offsetof
5134 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
5135 type.  According to the 2014 ISO C++ standard, applying @samp{offsetof}
5136 to a non-standard-layout type is undefined.  In existing C++ implementations,
5137 however, @samp{offsetof} typically gives meaningful results.
5138 This flag is for users who are aware that they are
5139 writing nonportable code and who have deliberately chosen to ignore the
5140 warning about it.
5142 The restrictions on @samp{offsetof} may be relaxed in a future version
5143 of the C++ standard.
5145 @item -Wno-int-to-pointer-cast
5146 @opindex Wno-int-to-pointer-cast
5147 @opindex Wint-to-pointer-cast
5148 Suppress warnings from casts to pointer type of an integer of a
5149 different size. In C++, casting to a pointer type of smaller size is
5150 an error. @option{Wint-to-pointer-cast} is enabled by default.
5153 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
5154 @opindex Wno-pointer-to-int-cast
5155 @opindex Wpointer-to-int-cast
5156 Suppress warnings from casts from a pointer to an integer type of a
5157 different size.
5159 @item -Winvalid-pch
5160 @opindex Winvalid-pch
5161 @opindex Wno-invalid-pch
5162 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
5163 the search path but can't be used.
5165 @item -Wlong-long
5166 @opindex Wlong-long
5167 @opindex Wno-long-long
5168 Warn if @samp{long long} type is used.  This is enabled by either
5169 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
5170 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
5172 @item -Wvariadic-macros
5173 @opindex Wvariadic-macros
5174 @opindex Wno-variadic-macros
5175 Warn if variadic macros are used in ISO C90 mode, or if the GNU
5176 alternate syntax is used in ISO C99 mode.  This is enabled by either
5177 @option{-Wpedantic} or @option{-Wtraditional}.  To inhibit the warning
5178 messages, use @option{-Wno-variadic-macros}.
5180 @item -Wvarargs
5181 @opindex Wvarargs
5182 @opindex Wno-varargs
5183 Warn upon questionable usage of the macros used to handle variable
5184 arguments like @samp{va_start}.  This is default.  To inhibit the
5185 warning messages, use @option{-Wno-varargs}.
5187 @item -Wvector-operation-performance
5188 @opindex Wvector-operation-performance
5189 @opindex Wno-vector-operation-performance
5190 Warn if vector operation is not implemented via SIMD capabilities of the
5191 architecture.  Mainly useful for the performance tuning.
5192 Vector operation can be implemented @code{piecewise}, which means that the
5193 scalar operation is performed on every vector element; 
5194 @code{in parallel}, which means that the vector operation is implemented
5195 using scalars of wider type, which normally is more performance efficient;
5196 and @code{as a single scalar}, which means that vector fits into a
5197 scalar type.
5199 @item -Wno-virtual-move-assign
5200 @opindex Wvirtual-move-assign
5201 @opindex Wno-virtual-move-assign
5202 Suppress warnings about inheriting from a virtual base with a
5203 non-trivial C++11 move assignment operator.  This is dangerous because
5204 if the virtual base is reachable along more than one path, it will be
5205 moved multiple times, which can mean both objects end up in the
5206 moved-from state.  If the move assignment operator is written to avoid
5207 moving from a moved-from object, this warning can be disabled.
5209 @item -Wvla
5210 @opindex Wvla
5211 @opindex Wno-vla
5212 Warn if variable length array is used in the code.
5213 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
5214 the variable length array.
5216 @item -Wvolatile-register-var
5217 @opindex Wvolatile-register-var
5218 @opindex Wno-volatile-register-var
5219 Warn if a register variable is declared volatile.  The volatile
5220 modifier does not inhibit all optimizations that may eliminate reads
5221 and/or writes to register variables.  This warning is enabled by
5222 @option{-Wall}.
5224 @item -Wdisabled-optimization
5225 @opindex Wdisabled-optimization
5226 @opindex Wno-disabled-optimization
5227 Warn if a requested optimization pass is disabled.  This warning does
5228 not generally indicate that there is anything wrong with your code; it
5229 merely indicates that GCC's optimizers are unable to handle the code
5230 effectively.  Often, the problem is that your code is too big or too
5231 complex; GCC refuses to optimize programs when the optimization
5232 itself is likely to take inordinate amounts of time.
5234 @item -Wpointer-sign @r{(C and Objective-C only)}
5235 @opindex Wpointer-sign
5236 @opindex Wno-pointer-sign
5237 Warn for pointer argument passing or assignment with different signedness.
5238 This option is only supported for C and Objective-C@.  It is implied by
5239 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
5240 @option{-Wno-pointer-sign}.
5242 @item -Wstack-protector
5243 @opindex Wstack-protector
5244 @opindex Wno-stack-protector
5245 This option is only active when @option{-fstack-protector} is active.  It
5246 warns about functions that are not protected against stack smashing.
5248 @item -Woverlength-strings
5249 @opindex Woverlength-strings
5250 @opindex Wno-overlength-strings
5251 Warn about string constants that are longer than the ``minimum
5252 maximum'' length specified in the C standard.  Modern compilers
5253 generally allow string constants that are much longer than the
5254 standard's minimum limit, but very portable programs should avoid
5255 using longer strings.
5257 The limit applies @emph{after} string constant concatenation, and does
5258 not count the trailing NUL@.  In C90, the limit was 509 characters; in
5259 C99, it was raised to 4095.  C++98 does not specify a normative
5260 minimum maximum, so we do not diagnose overlength strings in C++@.
5262 This option is implied by @option{-Wpedantic}, and can be disabled with
5263 @option{-Wno-overlength-strings}.
5265 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
5266 @opindex Wunsuffixed-float-constants
5268 Issue a warning for any floating constant that does not have
5269 a suffix.  When used together with @option{-Wsystem-headers} it
5270 warns about such constants in system header files.  This can be useful
5271 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
5272 from the decimal floating-point extension to C99.
5274 @item -Wno-designated-init @r{(C and Objective-C only)}
5275 Suppress warnings when a positional initializer is used to initialize
5276 a structure that has been marked with the @code{designated_init}
5277 attribute.
5279 @end table
5281 @node Debugging Options
5282 @section Options for Debugging Your Program or GCC
5283 @cindex options, debugging
5284 @cindex debugging information options
5286 GCC has various special options that are used for debugging
5287 either your program or GCC:
5289 @table @gcctabopt
5290 @item -g
5291 @opindex g
5292 Produce debugging information in the operating system's native format
5293 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
5294 information.
5296 On most systems that use stabs format, @option{-g} enables use of extra
5297 debugging information that only GDB can use; this extra information
5298 makes debugging work better in GDB but probably makes other debuggers
5299 crash or
5300 refuse to read the program.  If you want to control for certain whether
5301 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
5302 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
5304 GCC allows you to use @option{-g} with
5305 @option{-O}.  The shortcuts taken by optimized code may occasionally
5306 produce surprising results: some variables you declared may not exist
5307 at all; flow of control may briefly move where you did not expect it;
5308 some statements may not be executed because they compute constant
5309 results or their values are already at hand; some statements may
5310 execute in different places because they have been moved out of loops.
5312 Nevertheless it proves possible to debug optimized output.  This makes
5313 it reasonable to use the optimizer for programs that might have bugs.
5315 The following options are useful when GCC is generated with the
5316 capability for more than one debugging format.
5318 @item -gsplit-dwarf
5319 @opindex gsplit-dwarf
5320 Separate as much dwarf debugging information as possible into a
5321 separate output file with the extension .dwo.  This option allows
5322 the build system to avoid linking files with debug information.  To
5323 be useful, this option requires a debugger capable of reading .dwo
5324 files.
5326 @item -ggdb
5327 @opindex ggdb
5328 Produce debugging information for use by GDB@.  This means to use the
5329 most expressive format available (DWARF 2, stabs, or the native format
5330 if neither of those are supported), including GDB extensions if at all
5331 possible.
5333 @item -gpubnames
5334 @opindex gpubnames
5335 Generate dwarf .debug_pubnames and .debug_pubtypes sections.
5337 @item -ggnu-pubnames
5338 @opindex ggnu-pubnames
5339 Generate .debug_pubnames and .debug_pubtypes sections in a format
5340 suitable for conversion into a GDB@ index.  This option is only useful
5341 with a linker that can produce GDB@ index version 7.
5343 @item -gstabs
5344 @opindex gstabs
5345 Produce debugging information in stabs format (if that is supported),
5346 without GDB extensions.  This is the format used by DBX on most BSD
5347 systems.  On MIPS, Alpha and System V Release 4 systems this option
5348 produces stabs debugging output that is not understood by DBX or SDB@.
5349 On System V Release 4 systems this option requires the GNU assembler.
5351 @item -feliminate-unused-debug-symbols
5352 @opindex feliminate-unused-debug-symbols
5353 Produce debugging information in stabs format (if that is supported),
5354 for only symbols that are actually used.
5356 @item -femit-class-debug-always
5357 Instead of emitting debugging information for a C++ class in only one
5358 object file, emit it in all object files using the class.  This option
5359 should be used only with debuggers that are unable to handle the way GCC
5360 normally emits debugging information for classes because using this
5361 option increases the size of debugging information by as much as a
5362 factor of two.
5364 @item -fdebug-types-section
5365 @opindex fdebug-types-section
5366 @opindex fno-debug-types-section
5367 When using DWARF Version 4 or higher, type DIEs can be put into
5368 their own @code{.debug_types} section instead of making them part of the
5369 @code{.debug_info} section.  It is more efficient to put them in a separate
5370 comdat sections since the linker can then remove duplicates.
5371 But not all DWARF consumers support @code{.debug_types} sections yet
5372 and on some objects @code{.debug_types} produces larger instead of smaller
5373 debugging information.
5375 @item -gstabs+
5376 @opindex gstabs+
5377 Produce debugging information in stabs format (if that is supported),
5378 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5379 use of these extensions is likely to make other debuggers crash or
5380 refuse to read the program.
5382 @item -gcoff
5383 @opindex gcoff
5384 Produce debugging information in COFF format (if that is supported).
5385 This is the format used by SDB on most System V systems prior to
5386 System V Release 4.
5388 @item -gxcoff
5389 @opindex gxcoff
5390 Produce debugging information in XCOFF format (if that is supported).
5391 This is the format used by the DBX debugger on IBM RS/6000 systems.
5393 @item -gxcoff+
5394 @opindex gxcoff+
5395 Produce debugging information in XCOFF format (if that is supported),
5396 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5397 use of these extensions is likely to make other debuggers crash or
5398 refuse to read the program, and may cause assemblers other than the GNU
5399 assembler (GAS) to fail with an error.
5401 @item -gdwarf-@var{version}
5402 @opindex gdwarf-@var{version}
5403 Produce debugging information in DWARF format (if that is supported).
5404 The value of @var{version} may be either 2, 3 or 4; the default version
5405 for most targets is 4.
5407 Note that with DWARF Version 2, some ports require and always
5408 use some non-conflicting DWARF 3 extensions in the unwind tables.
5410 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
5411 for maximum benefit.
5413 @item -grecord-gcc-switches
5414 @opindex grecord-gcc-switches
5415 This switch causes the command-line options used to invoke the
5416 compiler that may affect code generation to be appended to the
5417 DW_AT_producer attribute in DWARF debugging information.  The options
5418 are concatenated with spaces separating them from each other and from
5419 the compiler version.  See also @option{-frecord-gcc-switches} for another
5420 way of storing compiler options into the object file.  This is the default.
5422 @item -gno-record-gcc-switches
5423 @opindex gno-record-gcc-switches
5424 Disallow appending command-line options to the DW_AT_producer attribute
5425 in DWARF debugging information.
5427 @item -gstrict-dwarf
5428 @opindex gstrict-dwarf
5429 Disallow using extensions of later DWARF standard version than selected
5430 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
5431 DWARF extensions from later standard versions is allowed.
5433 @item -gno-strict-dwarf
5434 @opindex gno-strict-dwarf
5435 Allow using extensions of later DWARF standard version than selected with
5436 @option{-gdwarf-@var{version}}.
5438 @item -gz@r{[}=@var{type}@r{]}
5439 @opindex gz
5440 Produce compressed debug sections in DWARF format, if that is supported.
5441 If @var{type} is not given, the default type depends on the capabilities
5442 of the assembler and linker used.  @var{type} may be one of
5443 @option{none} (don't compress debug sections), @option{zlib} (use zlib
5444 compression in ELF gABI format), or @option{zlib-gnu} (use zlib
5445 compression in traditional GNU format).  If the linker doesn't support
5446 writing compressed debug sections, the option is rejected.  Otherwise,
5447 if the assembler does not support them, @option{-gz} is silently ignored
5448 when producing object files.
5450 @item -gvms
5451 @opindex gvms
5452 Produce debugging information in Alpha/VMS debug format (if that is
5453 supported).  This is the format used by DEBUG on Alpha/VMS systems.
5455 @item -g@var{level}
5456 @itemx -ggdb@var{level}
5457 @itemx -gstabs@var{level}
5458 @itemx -gcoff@var{level}
5459 @itemx -gxcoff@var{level}
5460 @itemx -gvms@var{level}
5461 Request debugging information and also use @var{level} to specify how
5462 much information.  The default level is 2.
5464 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
5465 @option{-g}.
5467 Level 1 produces minimal information, enough for making backtraces in
5468 parts of the program that you don't plan to debug.  This includes
5469 descriptions of functions and external variables, and line number
5470 tables, but no information about local variables.
5472 Level 3 includes extra information, such as all the macro definitions
5473 present in the program.  Some debuggers support macro expansion when
5474 you use @option{-g3}.
5476 @option{-gdwarf-2} does not accept a concatenated debug level, because
5477 GCC used to support an option @option{-gdwarf} that meant to generate
5478 debug information in version 1 of the DWARF format (which is very
5479 different from version 2), and it would have been too confusing.  That
5480 debug format is long obsolete, but the option cannot be changed now.
5481 Instead use an additional @option{-g@var{level}} option to change the
5482 debug level for DWARF.
5484 @item -gtoggle
5485 @opindex gtoggle
5486 Turn off generation of debug info, if leaving out this option
5487 generates it, or turn it on at level 2 otherwise.  The position of this
5488 argument in the command line does not matter; it takes effect after all
5489 other options are processed, and it does so only once, no matter how
5490 many times it is given.  This is mainly intended to be used with
5491 @option{-fcompare-debug}.
5493 @item -fsanitize=address
5494 @opindex fsanitize=address
5495 Enable AddressSanitizer, a fast memory error detector.
5496 Memory access instructions will be instrumented to detect
5497 out-of-bounds and use-after-free bugs.
5498 See @uref{http://code.google.com/p/address-sanitizer/} for
5499 more details.  The run-time behavior can be influenced using the
5500 @env{ASAN_OPTIONS} environment variable; see
5501 @url{https://code.google.com/p/address-sanitizer/wiki/Flags#Run-time_flags} for
5502 a list of supported options.
5504 @item -fsanitize=kernel-address
5505 @opindex fsanitize=kernel-address
5506 Enable AddressSanitizer for Linux kernel.
5507 See @uref{http://code.google.com/p/address-sanitizer/wiki/AddressSanitizerForKernel} for more details.
5509 @item -fsanitize=thread
5510 @opindex fsanitize=thread
5511 Enable ThreadSanitizer, a fast data race detector.
5512 Memory access instructions will be instrumented to detect
5513 data race bugs.  See @uref{http://code.google.com/p/thread-sanitizer/} for more
5514 details. The run-time behavior can be influenced using the @env{TSAN_OPTIONS}
5515 environment variable; see
5516 @url{https://code.google.com/p/thread-sanitizer/wiki/Flags} for a list of
5517 supported options.
5519 @item -fsanitize=leak
5520 @opindex fsanitize=leak
5521 Enable LeakSanitizer, a memory leak detector.
5522 This option only matters for linking of executables and if neither
5523 @option{-fsanitize=address} nor @option{-fsanitize=thread} is used.  In that
5524 case it will link the executable against a library that overrides @code{malloc}
5525 and other allocator functions.  See
5526 @uref{https://code.google.com/p/address-sanitizer/wiki/LeakSanitizer} for more
5527 details.  The run-time behavior can be influenced using the
5528 @env{LSAN_OPTIONS} environment variable.
5530 @item -fsanitize=undefined
5531 @opindex fsanitize=undefined
5532 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector.
5533 Various computations will be instrumented to detect undefined behavior
5534 at runtime.  Current suboptions are:
5536 @table @gcctabopt
5538 @item -fsanitize=shift
5539 @opindex fsanitize=shift
5540 This option enables checking that the result of a shift operation is
5541 not undefined.  Note that what exactly is considered undefined differs
5542 slightly between C and C++, as well as between ISO C90 and C99, etc.
5544 @item -fsanitize=integer-divide-by-zero
5545 @opindex fsanitize=integer-divide-by-zero
5546 Detect integer division by zero as well as @code{INT_MIN / -1} division.
5548 @item -fsanitize=unreachable
5549 @opindex fsanitize=unreachable
5550 With this option, the compiler will turn the @code{__builtin_unreachable}
5551 call into a diagnostics message call instead.  When reaching the
5552 @code{__builtin_unreachable} call, the behavior is undefined.
5554 @item -fsanitize=vla-bound
5555 @opindex fsanitize=vla-bound
5556 This option instructs the compiler to check that the size of a variable
5557 length array is positive.  This option does not have any effect in
5558 @option{-std=c++14} mode, as the standard requires the exception be thrown
5559 instead.
5561 @item -fsanitize=null
5562 @opindex fsanitize=null
5563 This option enables pointer checking.  Particularly, the application
5564 built with this option turned on will issue an error message when it
5565 tries to dereference a NULL pointer, or if a reference (possibly an
5566 rvalue reference) is bound to a NULL pointer, or if a method is invoked
5567 on an object pointed by a NULL pointer.
5569 @item -fsanitize=return
5570 @opindex fsanitize=return
5571 This option enables return statement checking.  Programs
5572 built with this option turned on will issue an error message
5573 when the end of a non-void function is reached without actually
5574 returning a value.  This option works in C++ only.
5576 @item -fsanitize=signed-integer-overflow
5577 @opindex fsanitize=signed-integer-overflow
5578 This option enables signed integer overflow checking.  We check that
5579 the result of @code{+}, @code{*}, and both unary and binary @code{-}
5580 does not overflow in the signed arithmetics.  Note, integer promotion
5581 rules must be taken into account.  That is, the following is not an
5582 overflow:
5583 @smallexample
5584 signed char a = SCHAR_MAX;
5585 a++;
5586 @end smallexample
5588 @item -fsanitize=bounds
5589 @opindex fsanitize=bounds
5590 This option enables instrumentation of array bounds.  Various out of bounds
5591 accesses are detected.  Flexible array members and initializers of variables
5592 with static storage are not instrumented.
5594 @item -fsanitize=alignment
5595 @opindex fsanitize=alignment
5597 This option enables checking of alignment of pointers when they are
5598 dereferenced, or when a reference is bound to insufficiently aligned target,
5599 or when a method or constructor is invoked on insufficiently aligned object.
5601 @item -fsanitize=object-size
5602 @opindex fsanitize=object-size
5603 This option enables instrumentation of memory references using the
5604 @code{__builtin_object_size} function.  Various out of bounds pointer
5605 accesses are detected.
5607 @item -fsanitize=float-divide-by-zero
5608 @opindex fsanitize=float-divide-by-zero
5609 Detect floating-point division by zero.  Unlike other similar options,
5610 @option{-fsanitize=float-divide-by-zero} is not enabled by
5611 @option{-fsanitize=undefined}, since floating-point division by zero can
5612 be a legitimate way of obtaining infinities and NaNs.
5614 @item -fsanitize=float-cast-overflow
5615 @opindex fsanitize=float-cast-overflow
5616 This option enables floating-point type to integer conversion checking.
5617 We check that the result of the conversion does not overflow.
5618 This option does not work well with @code{FE_INVALID} exceptions enabled.
5620 @item -fsanitize=nonnull-attribute
5621 @opindex fsanitize=nonnull-attribute
5623 This option enables instrumentation of calls, checking whether null values
5624 are not passed to arguments marked as requiring a non-null value by the
5625 @code{nonnull} function attribute.
5627 @item -fsanitize=returns-nonnull-attribute
5628 @opindex fsanitize=returns-nonnull-attribute
5630 This option enables instrumentation of return statements in functions
5631 marked with @code{returns_nonnull} function attribute, to detect returning
5632 of null values from such functions.
5634 @item -fsanitize=bool
5635 @opindex fsanitize=bool
5637 This option enables instrumentation of loads from bool.  If a value other
5638 than 0/1 is loaded, a run-time error is issued.
5640 @item -fsanitize=enum
5641 @opindex fsanitize=enum
5643 This option enables instrumentation of loads from an enum type.  If
5644 a value outside the range of values for the enum type is loaded,
5645 a run-time error is issued.
5647 @end table
5649 While @option{-ftrapv} causes traps for signed overflows to be emitted,
5650 @option{-fsanitize=undefined} gives a diagnostic message.
5651 This currently works only for the C family of languages.
5653 @item -fasan-shadow-offset=@var{number}
5654 @opindex fasan-shadow-offset
5655 This option forces GCC to use custom shadow offset in AddressSanitizer checks.
5656 It is useful for experimenting with different shadow memory layouts in
5657 Kernel AddressSanitizer.
5659 @item -fsanitize-recover@r{[}=@var{opts}@r{]}
5660 @opindex fsanitize-recover
5661 @opindex fno-sanitize-recover
5662 @option{-fsanitize-recover=} controls error recovery mode for sanitizers
5663 mentioned in comma-separated list of @var{opts}.  Enabling this option
5664 for a sanitizer component would cause it to attempt to continue
5665 running the program as if no error happened.  This means multiple
5666 runtime errors can be reported in a single program run, and the exit
5667 code of the program may indicate success even when errors
5668 have been reported.  The @option{-fno-sanitize-recover=} can be used to alter
5669 this behavior, only the first detected error will be reported
5670 and program will exit after that with non-zero exit code.
5672 Currently this feature only works for @option{-fsanitize=undefined} (and its suboptions
5673 except for @option{-fsanitize=unreachable} and @option{-fsanitize=return}),
5674 @option{-fsanitize=float-cast-overflow}, @option{-fsanitize=float-divide-by-zero} and
5675 @option{-fsanitize=kernel-address}.  For these sanitizers error recovery is turned on by default.
5677 Syntax without explicit @var{opts} parameter is deprecated.  It is equivalent to
5678 @option{-fsanitize-recover=undefined,float-cast-overflow,float-divide-by-zero,kernel-address}.
5679 Similarly @option{-fno-sanitize-recover} is equivalent to
5680 @option{-fno-sanitize-recover=undefined,float-cast-overflow,float-divide-by-zero,kernel-address}.
5682 @item -fsanitize-undefined-trap-on-error
5683 @opindex fsanitize-undefined-trap-on-error
5684 The @option{-fsanitize-undefined-trap-on-error} instructs the compiler to
5685 report undefined behavior using @code{__builtin_trap ()} rather than
5686 a @code{libubsan} library routine.  The advantage of this is that the
5687 @code{libubsan} library is not needed and will not be linked in, so this
5688 is usable even for use in freestanding environments.
5690 @item -fdump-final-insns@r{[}=@var{file}@r{]}
5691 @opindex fdump-final-insns
5692 Dump the final internal representation (RTL) to @var{file}.  If the
5693 optional argument is omitted (or if @var{file} is @code{.}), the name
5694 of the dump file is determined by appending @code{.gkd} to the
5695 compilation output file name.
5697 @item -fcompare-debug@r{[}=@var{opts}@r{]}
5698 @opindex fcompare-debug
5699 @opindex fno-compare-debug
5700 If no error occurs during compilation, run the compiler a second time,
5701 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
5702 passed to the second compilation.  Dump the final internal
5703 representation in both compilations, and print an error if they differ.
5705 If the equal sign is omitted, the default @option{-gtoggle} is used.
5707 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
5708 and nonzero, implicitly enables @option{-fcompare-debug}.  If
5709 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
5710 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
5711 is used.
5713 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
5714 is equivalent to @option{-fno-compare-debug}, which disables the dumping
5715 of the final representation and the second compilation, preventing even
5716 @env{GCC_COMPARE_DEBUG} from taking effect.
5718 To verify full coverage during @option{-fcompare-debug} testing, set
5719 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
5720 which GCC rejects as an invalid option in any actual compilation
5721 (rather than preprocessing, assembly or linking).  To get just a
5722 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
5723 not overridden} will do.
5725 @item -fcompare-debug-second
5726 @opindex fcompare-debug-second
5727 This option is implicitly passed to the compiler for the second
5728 compilation requested by @option{-fcompare-debug}, along with options to
5729 silence warnings, and omitting other options that would cause
5730 side-effect compiler outputs to files or to the standard output.  Dump
5731 files and preserved temporary files are renamed so as to contain the
5732 @code{.gk} additional extension during the second compilation, to avoid
5733 overwriting those generated by the first.
5735 When this option is passed to the compiler driver, it causes the
5736 @emph{first} compilation to be skipped, which makes it useful for little
5737 other than debugging the compiler proper.
5739 @item -feliminate-dwarf2-dups
5740 @opindex feliminate-dwarf2-dups
5741 Compress DWARF 2 debugging information by eliminating duplicated
5742 information about each symbol.  This option only makes sense when
5743 generating DWARF 2 debugging information with @option{-gdwarf-2}.
5745 @item -femit-struct-debug-baseonly
5746 @opindex femit-struct-debug-baseonly
5747 Emit debug information for struct-like types
5748 only when the base name of the compilation source file
5749 matches the base name of file in which the struct is defined.
5751 This option substantially reduces the size of debugging information,
5752 but at significant potential loss in type information to the debugger.
5753 See @option{-femit-struct-debug-reduced} for a less aggressive option.
5754 See @option{-femit-struct-debug-detailed} for more detailed control.
5756 This option works only with DWARF 2.
5758 @item -femit-struct-debug-reduced
5759 @opindex femit-struct-debug-reduced
5760 Emit debug information for struct-like types
5761 only when the base name of the compilation source file
5762 matches the base name of file in which the type is defined,
5763 unless the struct is a template or defined in a system header.
5765 This option significantly reduces the size of debugging information,
5766 with some potential loss in type information to the debugger.
5767 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
5768 See @option{-femit-struct-debug-detailed} for more detailed control.
5770 This option works only with DWARF 2.
5772 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
5773 Specify the struct-like types
5774 for which the compiler generates debug information.
5775 The intent is to reduce duplicate struct debug information
5776 between different object files within the same program.
5778 This option is a detailed version of
5779 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
5780 which serves for most needs.
5782 A specification has the syntax@*
5783 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
5785 The optional first word limits the specification to
5786 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
5787 A struct type is used directly when it is the type of a variable, member.
5788 Indirect uses arise through pointers to structs.
5789 That is, when use of an incomplete struct is valid, the use is indirect.
5790 An example is
5791 @samp{struct one direct; struct two * indirect;}.
5793 The optional second word limits the specification to
5794 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
5795 Generic structs are a bit complicated to explain.
5796 For C++, these are non-explicit specializations of template classes,
5797 or non-template classes within the above.
5798 Other programming languages have generics,
5799 but @option{-femit-struct-debug-detailed} does not yet implement them.
5801 The third word specifies the source files for those
5802 structs for which the compiler should emit debug information.
5803 The values @samp{none} and @samp{any} have the normal meaning.
5804 The value @samp{base} means that
5805 the base of name of the file in which the type declaration appears
5806 must match the base of the name of the main compilation file.
5807 In practice, this means that when compiling @file{foo.c}, debug information
5808 is generated for types declared in that file and @file{foo.h},
5809 but not other header files.
5810 The value @samp{sys} means those types satisfying @samp{base}
5811 or declared in system or compiler headers.
5813 You may need to experiment to determine the best settings for your application.
5815 The default is @option{-femit-struct-debug-detailed=all}.
5817 This option works only with DWARF 2.
5819 @item -fno-merge-debug-strings
5820 @opindex fmerge-debug-strings
5821 @opindex fno-merge-debug-strings
5822 Direct the linker to not merge together strings in the debugging
5823 information that are identical in different object files.  Merging is
5824 not supported by all assemblers or linkers.  Merging decreases the size
5825 of the debug information in the output file at the cost of increasing
5826 link processing time.  Merging is enabled by default.
5828 @item -fdebug-prefix-map=@var{old}=@var{new}
5829 @opindex fdebug-prefix-map
5830 When compiling files in directory @file{@var{old}}, record debugging
5831 information describing them as in @file{@var{new}} instead.
5833 @item -fno-dwarf2-cfi-asm
5834 @opindex fdwarf2-cfi-asm
5835 @opindex fno-dwarf2-cfi-asm
5836 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
5837 instead of using GAS @code{.cfi_*} directives.
5839 @cindex @command{prof}
5840 @item -p
5841 @opindex p
5842 Generate extra code to write profile information suitable for the
5843 analysis program @command{prof}.  You must use this option when compiling
5844 the source files you want data about, and you must also use it when
5845 linking.
5847 @cindex @command{gprof}
5848 @item -pg
5849 @opindex pg
5850 Generate extra code to write profile information suitable for the
5851 analysis program @command{gprof}.  You must use this option when compiling
5852 the source files you want data about, and you must also use it when
5853 linking.
5855 @item -Q
5856 @opindex Q
5857 Makes the compiler print out each function name as it is compiled, and
5858 print some statistics about each pass when it finishes.
5860 @item -ftime-report
5861 @opindex ftime-report
5862 Makes the compiler print some statistics about the time consumed by each
5863 pass when it finishes.
5865 @item -fmem-report
5866 @opindex fmem-report
5867 Makes the compiler print some statistics about permanent memory
5868 allocation when it finishes.
5870 @item -fmem-report-wpa
5871 @opindex fmem-report-wpa
5872 Makes the compiler print some statistics about permanent memory
5873 allocation for the WPA phase only.
5875 @item -fpre-ipa-mem-report
5876 @opindex fpre-ipa-mem-report
5877 @item -fpost-ipa-mem-report
5878 @opindex fpost-ipa-mem-report
5879 Makes the compiler print some statistics about permanent memory
5880 allocation before or after interprocedural optimization.
5882 @item -fprofile-report
5883 @opindex fprofile-report
5884 Makes the compiler print some statistics about consistency of the
5885 (estimated) profile and effect of individual passes.
5887 @item -fstack-usage
5888 @opindex fstack-usage
5889 Makes the compiler output stack usage information for the program, on a
5890 per-function basis.  The filename for the dump is made by appending
5891 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
5892 the output file, if explicitly specified and it is not an executable,
5893 otherwise it is the basename of the source file.  An entry is made up
5894 of three fields:
5896 @itemize
5897 @item
5898 The name of the function.
5899 @item
5900 A number of bytes.
5901 @item
5902 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
5903 @end itemize
5905 The qualifier @code{static} means that the function manipulates the stack
5906 statically: a fixed number of bytes are allocated for the frame on function
5907 entry and released on function exit; no stack adjustments are otherwise made
5908 in the function.  The second field is this fixed number of bytes.
5910 The qualifier @code{dynamic} means that the function manipulates the stack
5911 dynamically: in addition to the static allocation described above, stack
5912 adjustments are made in the body of the function, for example to push/pop
5913 arguments around function calls.  If the qualifier @code{bounded} is also
5914 present, the amount of these adjustments is bounded at compile time and
5915 the second field is an upper bound of the total amount of stack used by
5916 the function.  If it is not present, the amount of these adjustments is
5917 not bounded at compile time and the second field only represents the
5918 bounded part.
5920 @item -fprofile-arcs
5921 @opindex fprofile-arcs
5922 Add code so that program flow @dfn{arcs} are instrumented.  During
5923 execution the program records how many times each branch and call is
5924 executed and how many times it is taken or returns.  When the compiled
5925 program exits it saves this data to a file called
5926 @file{@var{auxname}.gcda} for each source file.  The data may be used for
5927 profile-directed optimizations (@option{-fbranch-probabilities}), or for
5928 test coverage analysis (@option{-ftest-coverage}).  Each object file's
5929 @var{auxname} is generated from the name of the output file, if
5930 explicitly specified and it is not the final executable, otherwise it is
5931 the basename of the source file.  In both cases any suffix is removed
5932 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
5933 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
5934 @xref{Cross-profiling}.
5936 @cindex @command{gcov}
5937 @item --coverage
5938 @opindex coverage
5940 This option is used to compile and link code instrumented for coverage
5941 analysis.  The option is a synonym for @option{-fprofile-arcs}
5942 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
5943 linking).  See the documentation for those options for more details.
5945 @itemize
5947 @item
5948 Compile the source files with @option{-fprofile-arcs} plus optimization
5949 and code generation options.  For test coverage analysis, use the
5950 additional @option{-ftest-coverage} option.  You do not need to profile
5951 every source file in a program.
5953 @item
5954 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
5955 (the latter implies the former).
5957 @item
5958 Run the program on a representative workload to generate the arc profile
5959 information.  This may be repeated any number of times.  You can run
5960 concurrent instances of your program, and provided that the file system
5961 supports locking, the data files will be correctly updated.  Also
5962 @code{fork} calls are detected and correctly handled (double counting
5963 will not happen).
5965 @item
5966 For profile-directed optimizations, compile the source files again with
5967 the same optimization and code generation options plus
5968 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
5969 Control Optimization}).
5971 @item
5972 For test coverage analysis, use @command{gcov} to produce human readable
5973 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
5974 @command{gcov} documentation for further information.
5976 @end itemize
5978 With @option{-fprofile-arcs}, for each function of your program GCC
5979 creates a program flow graph, then finds a spanning tree for the graph.
5980 Only arcs that are not on the spanning tree have to be instrumented: the
5981 compiler adds code to count the number of times that these arcs are
5982 executed.  When an arc is the only exit or only entrance to a block, the
5983 instrumentation code can be added to the block; otherwise, a new basic
5984 block must be created to hold the instrumentation code.
5986 @need 2000
5987 @item -ftest-coverage
5988 @opindex ftest-coverage
5989 Produce a notes file that the @command{gcov} code-coverage utility
5990 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
5991 show program coverage.  Each source file's note file is called
5992 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
5993 above for a description of @var{auxname} and instructions on how to
5994 generate test coverage data.  Coverage data matches the source files
5995 more closely if you do not optimize.
5997 @item -fdbg-cnt-list
5998 @opindex fdbg-cnt-list
5999 Print the name and the counter upper bound for all debug counters.
6002 @item -fdbg-cnt=@var{counter-value-list}
6003 @opindex fdbg-cnt
6004 Set the internal debug counter upper bound.  @var{counter-value-list}
6005 is a comma-separated list of @var{name}:@var{value} pairs
6006 which sets the upper bound of each debug counter @var{name} to @var{value}.
6007 All debug counters have the initial upper bound of @code{UINT_MAX};
6008 thus @code{dbg_cnt()} returns true always unless the upper bound
6009 is set by this option.
6010 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
6011 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
6013 @item -fenable-@var{kind}-@var{pass}
6014 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
6015 @opindex fdisable-
6016 @opindex fenable-
6018 This is a set of options that are used to explicitly disable/enable
6019 optimization passes.  These options are intended for use for debugging GCC.
6020 Compiler users should use regular options for enabling/disabling
6021 passes instead.
6023 @table @gcctabopt
6025 @item -fdisable-ipa-@var{pass}
6026 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
6027 statically invoked in the compiler multiple times, the pass name should be
6028 appended with a sequential number starting from 1.
6030 @item -fdisable-rtl-@var{pass}
6031 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
6032 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
6033 statically invoked in the compiler multiple times, the pass name should be
6034 appended with a sequential number starting from 1.  @var{range-list} is a 
6035 comma-separated list of function ranges or assembler names.  Each range is a number
6036 pair separated by a colon.  The range is inclusive in both ends.  If the range
6037 is trivial, the number pair can be simplified as a single number.  If the
6038 function's call graph node's @var{uid} falls within one of the specified ranges,
6039 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
6040 function header of a dump file, and the pass names can be dumped by using
6041 option @option{-fdump-passes}.
6043 @item -fdisable-tree-@var{pass}
6044 @itemx -fdisable-tree-@var{pass}=@var{range-list}
6045 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
6046 option arguments.
6048 @item -fenable-ipa-@var{pass}
6049 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
6050 statically invoked in the compiler multiple times, the pass name should be
6051 appended with a sequential number starting from 1.
6053 @item -fenable-rtl-@var{pass}
6054 @itemx -fenable-rtl-@var{pass}=@var{range-list}
6055 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
6056 description and examples.
6058 @item -fenable-tree-@var{pass}
6059 @itemx -fenable-tree-@var{pass}=@var{range-list}
6060 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
6061 of option arguments.
6063 @end table
6065 Here are some examples showing uses of these options.
6067 @smallexample
6069 # disable ccp1 for all functions
6070    -fdisable-tree-ccp1
6071 # disable complete unroll for function whose cgraph node uid is 1
6072    -fenable-tree-cunroll=1
6073 # disable gcse2 for functions at the following ranges [1,1],
6074 # [300,400], and [400,1000]
6075 # disable gcse2 for functions foo and foo2
6076    -fdisable-rtl-gcse2=foo,foo2
6077 # disable early inlining
6078    -fdisable-tree-einline
6079 # disable ipa inlining
6080    -fdisable-ipa-inline
6081 # enable tree full unroll
6082    -fenable-tree-unroll
6084 @end smallexample
6086 @item -d@var{letters}
6087 @itemx -fdump-rtl-@var{pass}
6088 @itemx -fdump-rtl-@var{pass}=@var{filename}
6089 @opindex d
6090 @opindex fdump-rtl-@var{pass}
6091 Says to make debugging dumps during compilation at times specified by
6092 @var{letters}.  This is used for debugging the RTL-based passes of the
6093 compiler.  The file names for most of the dumps are made by appending
6094 a pass number and a word to the @var{dumpname}, and the files are
6095 created in the directory of the output file. In case of
6096 @option{=@var{filename}} option, the dump is output on the given file
6097 instead of the pass numbered dump files. Note that the pass number is
6098 computed statically as passes get registered into the pass manager.
6099 Thus the numbering is not related to the dynamic order of execution of
6100 passes.  In particular, a pass installed by a plugin could have a
6101 number over 200 even if it executed quite early.  @var{dumpname} is
6102 generated from the name of the output file, if explicitly specified
6103 and it is not an executable, otherwise it is the basename of the
6104 source file. These switches may have different effects when
6105 @option{-E} is used for preprocessing.
6107 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
6108 @option{-d} option @var{letters}.  Here are the possible
6109 letters for use in @var{pass} and @var{letters}, and their meanings:
6111 @table @gcctabopt
6113 @item -fdump-rtl-alignments
6114 @opindex fdump-rtl-alignments
6115 Dump after branch alignments have been computed.
6117 @item -fdump-rtl-asmcons
6118 @opindex fdump-rtl-asmcons
6119 Dump after fixing rtl statements that have unsatisfied in/out constraints.
6121 @item -fdump-rtl-auto_inc_dec
6122 @opindex fdump-rtl-auto_inc_dec
6123 Dump after auto-inc-dec discovery.  This pass is only run on
6124 architectures that have auto inc or auto dec instructions.
6126 @item -fdump-rtl-barriers
6127 @opindex fdump-rtl-barriers
6128 Dump after cleaning up the barrier instructions.
6130 @item -fdump-rtl-bbpart
6131 @opindex fdump-rtl-bbpart
6132 Dump after partitioning hot and cold basic blocks.
6134 @item -fdump-rtl-bbro
6135 @opindex fdump-rtl-bbro
6136 Dump after block reordering.
6138 @item -fdump-rtl-btl1
6139 @itemx -fdump-rtl-btl2
6140 @opindex fdump-rtl-btl2
6141 @opindex fdump-rtl-btl2
6142 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
6143 after the two branch
6144 target load optimization passes.
6146 @item -fdump-rtl-bypass
6147 @opindex fdump-rtl-bypass
6148 Dump after jump bypassing and control flow optimizations.
6150 @item -fdump-rtl-combine
6151 @opindex fdump-rtl-combine
6152 Dump after the RTL instruction combination pass.
6154 @item -fdump-rtl-compgotos
6155 @opindex fdump-rtl-compgotos
6156 Dump after duplicating the computed gotos.
6158 @item -fdump-rtl-ce1
6159 @itemx -fdump-rtl-ce2
6160 @itemx -fdump-rtl-ce3
6161 @opindex fdump-rtl-ce1
6162 @opindex fdump-rtl-ce2
6163 @opindex fdump-rtl-ce3
6164 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
6165 @option{-fdump-rtl-ce3} enable dumping after the three
6166 if conversion passes.
6168 @item -fdump-rtl-cprop_hardreg
6169 @opindex fdump-rtl-cprop_hardreg
6170 Dump after hard register copy propagation.
6172 @item -fdump-rtl-csa
6173 @opindex fdump-rtl-csa
6174 Dump after combining stack adjustments.
6176 @item -fdump-rtl-cse1
6177 @itemx -fdump-rtl-cse2
6178 @opindex fdump-rtl-cse1
6179 @opindex fdump-rtl-cse2
6180 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
6181 the two common subexpression elimination passes.
6183 @item -fdump-rtl-dce
6184 @opindex fdump-rtl-dce
6185 Dump after the standalone dead code elimination passes.
6187 @item -fdump-rtl-dbr
6188 @opindex fdump-rtl-dbr
6189 Dump after delayed branch scheduling.
6191 @item -fdump-rtl-dce1
6192 @itemx -fdump-rtl-dce2
6193 @opindex fdump-rtl-dce1
6194 @opindex fdump-rtl-dce2
6195 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
6196 the two dead store elimination passes.
6198 @item -fdump-rtl-eh
6199 @opindex fdump-rtl-eh
6200 Dump after finalization of EH handling code.
6202 @item -fdump-rtl-eh_ranges
6203 @opindex fdump-rtl-eh_ranges
6204 Dump after conversion of EH handling range regions.
6206 @item -fdump-rtl-expand
6207 @opindex fdump-rtl-expand
6208 Dump after RTL generation.
6210 @item -fdump-rtl-fwprop1
6211 @itemx -fdump-rtl-fwprop2
6212 @opindex fdump-rtl-fwprop1
6213 @opindex fdump-rtl-fwprop2
6214 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
6215 dumping after the two forward propagation passes.
6217 @item -fdump-rtl-gcse1
6218 @itemx -fdump-rtl-gcse2
6219 @opindex fdump-rtl-gcse1
6220 @opindex fdump-rtl-gcse2
6221 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
6222 after global common subexpression elimination.
6224 @item -fdump-rtl-init-regs
6225 @opindex fdump-rtl-init-regs
6226 Dump after the initialization of the registers.
6228 @item -fdump-rtl-initvals
6229 @opindex fdump-rtl-initvals
6230 Dump after the computation of the initial value sets.
6232 @item -fdump-rtl-into_cfglayout
6233 @opindex fdump-rtl-into_cfglayout
6234 Dump after converting to cfglayout mode.
6236 @item -fdump-rtl-ira
6237 @opindex fdump-rtl-ira
6238 Dump after iterated register allocation.
6240 @item -fdump-rtl-jump
6241 @opindex fdump-rtl-jump
6242 Dump after the second jump optimization.
6244 @item -fdump-rtl-loop2
6245 @opindex fdump-rtl-loop2
6246 @option{-fdump-rtl-loop2} enables dumping after the rtl
6247 loop optimization passes.
6249 @item -fdump-rtl-mach
6250 @opindex fdump-rtl-mach
6251 Dump after performing the machine dependent reorganization pass, if that
6252 pass exists.
6254 @item -fdump-rtl-mode_sw
6255 @opindex fdump-rtl-mode_sw
6256 Dump after removing redundant mode switches.
6258 @item -fdump-rtl-rnreg
6259 @opindex fdump-rtl-rnreg
6260 Dump after register renumbering.
6262 @item -fdump-rtl-outof_cfglayout
6263 @opindex fdump-rtl-outof_cfglayout
6264 Dump after converting from cfglayout mode.
6266 @item -fdump-rtl-peephole2
6267 @opindex fdump-rtl-peephole2
6268 Dump after the peephole pass.
6270 @item -fdump-rtl-postreload
6271 @opindex fdump-rtl-postreload
6272 Dump after post-reload optimizations.
6274 @item -fdump-rtl-pro_and_epilogue
6275 @opindex fdump-rtl-pro_and_epilogue
6276 Dump after generating the function prologues and epilogues.
6278 @item -fdump-rtl-sched1
6279 @itemx -fdump-rtl-sched2
6280 @opindex fdump-rtl-sched1
6281 @opindex fdump-rtl-sched2
6282 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
6283 after the basic block scheduling passes.
6285 @item -fdump-rtl-ree
6286 @opindex fdump-rtl-ree
6287 Dump after sign/zero extension elimination.
6289 @item -fdump-rtl-seqabstr
6290 @opindex fdump-rtl-seqabstr
6291 Dump after common sequence discovery.
6293 @item -fdump-rtl-shorten
6294 @opindex fdump-rtl-shorten
6295 Dump after shortening branches.
6297 @item -fdump-rtl-sibling
6298 @opindex fdump-rtl-sibling
6299 Dump after sibling call optimizations.
6301 @item -fdump-rtl-split1
6302 @itemx -fdump-rtl-split2
6303 @itemx -fdump-rtl-split3
6304 @itemx -fdump-rtl-split4
6305 @itemx -fdump-rtl-split5
6306 @opindex fdump-rtl-split1
6307 @opindex fdump-rtl-split2
6308 @opindex fdump-rtl-split3
6309 @opindex fdump-rtl-split4
6310 @opindex fdump-rtl-split5
6311 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
6312 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
6313 @option{-fdump-rtl-split5} enable dumping after five rounds of
6314 instruction splitting.
6316 @item -fdump-rtl-sms
6317 @opindex fdump-rtl-sms
6318 Dump after modulo scheduling.  This pass is only run on some
6319 architectures.
6321 @item -fdump-rtl-stack
6322 @opindex fdump-rtl-stack
6323 Dump after conversion from GCC's ``flat register file'' registers to the
6324 x87's stack-like registers.  This pass is only run on x86 variants.
6326 @item -fdump-rtl-subreg1
6327 @itemx -fdump-rtl-subreg2
6328 @opindex fdump-rtl-subreg1
6329 @opindex fdump-rtl-subreg2
6330 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
6331 the two subreg expansion passes.
6333 @item -fdump-rtl-unshare
6334 @opindex fdump-rtl-unshare
6335 Dump after all rtl has been unshared.
6337 @item -fdump-rtl-vartrack
6338 @opindex fdump-rtl-vartrack
6339 Dump after variable tracking.
6341 @item -fdump-rtl-vregs
6342 @opindex fdump-rtl-vregs
6343 Dump after converting virtual registers to hard registers.
6345 @item -fdump-rtl-web
6346 @opindex fdump-rtl-web
6347 Dump after live range splitting.
6349 @item -fdump-rtl-regclass
6350 @itemx -fdump-rtl-subregs_of_mode_init
6351 @itemx -fdump-rtl-subregs_of_mode_finish
6352 @itemx -fdump-rtl-dfinit
6353 @itemx -fdump-rtl-dfinish
6354 @opindex fdump-rtl-regclass
6355 @opindex fdump-rtl-subregs_of_mode_init
6356 @opindex fdump-rtl-subregs_of_mode_finish
6357 @opindex fdump-rtl-dfinit
6358 @opindex fdump-rtl-dfinish
6359 These dumps are defined but always produce empty files.
6361 @item -da
6362 @itemx -fdump-rtl-all
6363 @opindex da
6364 @opindex fdump-rtl-all
6365 Produce all the dumps listed above.
6367 @item -dA
6368 @opindex dA
6369 Annotate the assembler output with miscellaneous debugging information.
6371 @item -dD
6372 @opindex dD
6373 Dump all macro definitions, at the end of preprocessing, in addition to
6374 normal output.
6376 @item -dH
6377 @opindex dH
6378 Produce a core dump whenever an error occurs.
6380 @item -dp
6381 @opindex dp
6382 Annotate the assembler output with a comment indicating which
6383 pattern and alternative is used.  The length of each instruction is
6384 also printed.
6386 @item -dP
6387 @opindex dP
6388 Dump the RTL in the assembler output as a comment before each instruction.
6389 Also turns on @option{-dp} annotation.
6391 @item -dx
6392 @opindex dx
6393 Just generate RTL for a function instead of compiling it.  Usually used
6394 with @option{-fdump-rtl-expand}.
6395 @end table
6397 @item -fdump-noaddr
6398 @opindex fdump-noaddr
6399 When doing debugging dumps, suppress address output.  This makes it more
6400 feasible to use diff on debugging dumps for compiler invocations with
6401 different compiler binaries and/or different
6402 text / bss / data / heap / stack / dso start locations.
6404 @item -freport-bug
6405 @opindex freport-bug
6406 Collect and dump debug information into temporary file if ICE in C/C++
6407 compiler occured.
6409 @item -fdump-unnumbered
6410 @opindex fdump-unnumbered
6411 When doing debugging dumps, suppress instruction numbers and address output.
6412 This makes it more feasible to use diff on debugging dumps for compiler
6413 invocations with different options, in particular with and without
6414 @option{-g}.
6416 @item -fdump-unnumbered-links
6417 @opindex fdump-unnumbered-links
6418 When doing debugging dumps (see @option{-d} option above), suppress
6419 instruction numbers for the links to the previous and next instructions
6420 in a sequence.
6422 @item -fdump-translation-unit @r{(C++ only)}
6423 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
6424 @opindex fdump-translation-unit
6425 Dump a representation of the tree structure for the entire translation
6426 unit to a file.  The file name is made by appending @file{.tu} to the
6427 source file name, and the file is created in the same directory as the
6428 output file.  If the @samp{-@var{options}} form is used, @var{options}
6429 controls the details of the dump as described for the
6430 @option{-fdump-tree} options.
6432 @item -fdump-class-hierarchy @r{(C++ only)}
6433 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
6434 @opindex fdump-class-hierarchy
6435 Dump a representation of each class's hierarchy and virtual function
6436 table layout to a file.  The file name is made by appending
6437 @file{.class} to the source file name, and the file is created in the
6438 same directory as the output file.  If the @samp{-@var{options}} form
6439 is used, @var{options} controls the details of the dump as described
6440 for the @option{-fdump-tree} options.
6442 @item -fdump-ipa-@var{switch}
6443 @opindex fdump-ipa
6444 Control the dumping at various stages of inter-procedural analysis
6445 language tree to a file.  The file name is generated by appending a
6446 switch specific suffix to the source file name, and the file is created
6447 in the same directory as the output file.  The following dumps are
6448 possible:
6450 @table @samp
6451 @item all
6452 Enables all inter-procedural analysis dumps.
6454 @item cgraph
6455 Dumps information about call-graph optimization, unused function removal,
6456 and inlining decisions.
6458 @item inline
6459 Dump after function inlining.
6461 @end table
6463 @item -fdump-passes
6464 @opindex fdump-passes
6465 Dump the list of optimization passes that are turned on and off by
6466 the current command-line options.
6468 @item -fdump-statistics-@var{option}
6469 @opindex fdump-statistics
6470 Enable and control dumping of pass statistics in a separate file.  The
6471 file name is generated by appending a suffix ending in
6472 @samp{.statistics} to the source file name, and the file is created in
6473 the same directory as the output file.  If the @samp{-@var{option}}
6474 form is used, @samp{-stats} causes counters to be summed over the
6475 whole compilation unit while @samp{-details} dumps every event as
6476 the passes generate them.  The default with no option is to sum
6477 counters for each function compiled.
6479 @item -fdump-tree-@var{switch}
6480 @itemx -fdump-tree-@var{switch}-@var{options}
6481 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
6482 @opindex fdump-tree
6483 Control the dumping at various stages of processing the intermediate
6484 language tree to a file.  The file name is generated by appending a
6485 switch-specific suffix to the source file name, and the file is
6486 created in the same directory as the output file. In case of
6487 @option{=@var{filename}} option, the dump is output on the given file
6488 instead of the auto named dump files.  If the @samp{-@var{options}}
6489 form is used, @var{options} is a list of @samp{-} separated options
6490 which control the details of the dump.  Not all options are applicable
6491 to all dumps; those that are not meaningful are ignored.  The
6492 following options are available
6494 @table @samp
6495 @item address
6496 Print the address of each node.  Usually this is not meaningful as it
6497 changes according to the environment and source file.  Its primary use
6498 is for tying up a dump file with a debug environment.
6499 @item asmname
6500 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
6501 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
6502 use working backward from mangled names in the assembly file.
6503 @item slim
6504 When dumping front-end intermediate representations, inhibit dumping
6505 of members of a scope or body of a function merely because that scope
6506 has been reached.  Only dump such items when they are directly reachable
6507 by some other path.
6509 When dumping pretty-printed trees, this option inhibits dumping the
6510 bodies of control structures.
6512 When dumping RTL, print the RTL in slim (condensed) form instead of
6513 the default LISP-like representation.
6514 @item raw
6515 Print a raw representation of the tree.  By default, trees are
6516 pretty-printed into a C-like representation.
6517 @item details
6518 Enable more detailed dumps (not honored by every dump option). Also
6519 include information from the optimization passes.
6520 @item stats
6521 Enable dumping various statistics about the pass (not honored by every dump
6522 option).
6523 @item blocks
6524 Enable showing basic block boundaries (disabled in raw dumps).
6525 @item graph
6526 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
6527 dump a representation of the control flow graph suitable for viewing with
6528 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
6529 the file is pretty-printed as a subgraph, so that GraphViz can render them
6530 all in a single plot.
6532 This option currently only works for RTL dumps, and the RTL is always
6533 dumped in slim form.
6534 @item vops
6535 Enable showing virtual operands for every statement.
6536 @item lineno
6537 Enable showing line numbers for statements.
6538 @item uid
6539 Enable showing the unique ID (@code{DECL_UID}) for each variable.
6540 @item verbose
6541 Enable showing the tree dump for each statement.
6542 @item eh
6543 Enable showing the EH region number holding each statement.
6544 @item scev
6545 Enable showing scalar evolution analysis details.
6546 @item optimized
6547 Enable showing optimization information (only available in certain
6548 passes).
6549 @item missed
6550 Enable showing missed optimization information (only available in certain
6551 passes).
6552 @item note
6553 Enable other detailed optimization information (only available in
6554 certain passes).
6555 @item =@var{filename}
6556 Instead of an auto named dump file, output into the given file
6557 name. The file names @file{stdout} and @file{stderr} are treated
6558 specially and are considered already open standard streams. For
6559 example,
6561 @smallexample
6562 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
6563      -fdump-tree-pre=stderr file.c
6564 @end smallexample
6566 outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
6567 output on to @file{stderr}. If two conflicting dump filenames are
6568 given for the same pass, then the latter option overrides the earlier
6569 one.
6571 @item all
6572 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
6573 and @option{lineno}.
6575 @item optall
6576 Turn on all optimization options, i.e., @option{optimized},
6577 @option{missed}, and @option{note}.
6578 @end table
6580 The following tree dumps are possible:
6581 @table @samp
6583 @item original
6584 @opindex fdump-tree-original
6585 Dump before any tree based optimization, to @file{@var{file}.original}.
6587 @item optimized
6588 @opindex fdump-tree-optimized
6589 Dump after all tree based optimization, to @file{@var{file}.optimized}.
6591 @item gimple
6592 @opindex fdump-tree-gimple
6593 Dump each function before and after the gimplification pass to a file.  The
6594 file name is made by appending @file{.gimple} to the source file name.
6596 @item cfg
6597 @opindex fdump-tree-cfg
6598 Dump the control flow graph of each function to a file.  The file name is
6599 made by appending @file{.cfg} to the source file name.
6601 @item ch
6602 @opindex fdump-tree-ch
6603 Dump each function after copying loop headers.  The file name is made by
6604 appending @file{.ch} to the source file name.
6606 @item ssa
6607 @opindex fdump-tree-ssa
6608 Dump SSA related information to a file.  The file name is made by appending
6609 @file{.ssa} to the source file name.
6611 @item alias
6612 @opindex fdump-tree-alias
6613 Dump aliasing information for each function.  The file name is made by
6614 appending @file{.alias} to the source file name.
6616 @item ccp
6617 @opindex fdump-tree-ccp
6618 Dump each function after CCP@.  The file name is made by appending
6619 @file{.ccp} to the source file name.
6621 @item storeccp
6622 @opindex fdump-tree-storeccp
6623 Dump each function after STORE-CCP@.  The file name is made by appending
6624 @file{.storeccp} to the source file name.
6626 @item pre
6627 @opindex fdump-tree-pre
6628 Dump trees after partial redundancy elimination.  The file name is made
6629 by appending @file{.pre} to the source file name.
6631 @item fre
6632 @opindex fdump-tree-fre
6633 Dump trees after full redundancy elimination.  The file name is made
6634 by appending @file{.fre} to the source file name.
6636 @item copyprop
6637 @opindex fdump-tree-copyprop
6638 Dump trees after copy propagation.  The file name is made
6639 by appending @file{.copyprop} to the source file name.
6641 @item store_copyprop
6642 @opindex fdump-tree-store_copyprop
6643 Dump trees after store copy-propagation.  The file name is made
6644 by appending @file{.store_copyprop} to the source file name.
6646 @item dce
6647 @opindex fdump-tree-dce
6648 Dump each function after dead code elimination.  The file name is made by
6649 appending @file{.dce} to the source file name.
6651 @item sra
6652 @opindex fdump-tree-sra
6653 Dump each function after performing scalar replacement of aggregates.  The
6654 file name is made by appending @file{.sra} to the source file name.
6656 @item sink
6657 @opindex fdump-tree-sink
6658 Dump each function after performing code sinking.  The file name is made
6659 by appending @file{.sink} to the source file name.
6661 @item dom
6662 @opindex fdump-tree-dom
6663 Dump each function after applying dominator tree optimizations.  The file
6664 name is made by appending @file{.dom} to the source file name.
6666 @item dse
6667 @opindex fdump-tree-dse
6668 Dump each function after applying dead store elimination.  The file
6669 name is made by appending @file{.dse} to the source file name.
6671 @item phiopt
6672 @opindex fdump-tree-phiopt
6673 Dump each function after optimizing PHI nodes into straightline code.  The file
6674 name is made by appending @file{.phiopt} to the source file name.
6676 @item forwprop
6677 @opindex fdump-tree-forwprop
6678 Dump each function after forward propagating single use variables.  The file
6679 name is made by appending @file{.forwprop} to the source file name.
6681 @item copyrename
6682 @opindex fdump-tree-copyrename
6683 Dump each function after applying the copy rename optimization.  The file
6684 name is made by appending @file{.copyrename} to the source file name.
6686 @item nrv
6687 @opindex fdump-tree-nrv
6688 Dump each function after applying the named return value optimization on
6689 generic trees.  The file name is made by appending @file{.nrv} to the source
6690 file name.
6692 @item vect
6693 @opindex fdump-tree-vect
6694 Dump each function after applying vectorization of loops.  The file name is
6695 made by appending @file{.vect} to the source file name.
6697 @item slp
6698 @opindex fdump-tree-slp
6699 Dump each function after applying vectorization of basic blocks.  The file name
6700 is made by appending @file{.slp} to the source file name.
6702 @item vrp
6703 @opindex fdump-tree-vrp
6704 Dump each function after Value Range Propagation (VRP).  The file name
6705 is made by appending @file{.vrp} to the source file name.
6707 @item all
6708 @opindex fdump-tree-all
6709 Enable all the available tree dumps with the flags provided in this option.
6710 @end table
6712 @item -fopt-info
6713 @itemx -fopt-info-@var{options}
6714 @itemx -fopt-info-@var{options}=@var{filename}
6715 @opindex fopt-info
6716 Controls optimization dumps from various optimization passes. If the
6717 @samp{-@var{options}} form is used, @var{options} is a list of
6718 @samp{-} separated options to select the dump details and
6719 optimizations.  If @var{options} is not specified, it defaults to
6720 @option{optimized} for details and @option{optall} for optimization
6721 groups. If the @var{filename} is not specified, it defaults to
6722 @file{stderr}. Note that the output @var{filename} will be overwritten
6723 in case of multiple translation units. If a combined output from
6724 multiple translation units is desired, @file{stderr} should be used
6725 instead.
6727 The options can be divided into two groups, 1) options describing the
6728 verbosity of the dump, and 2) options describing which optimizations
6729 should be included. The options from both the groups can be freely
6730 mixed as they are non-overlapping. However, in case of any conflicts,
6731 the latter options override the earlier options on the command
6732 line. Though multiple -fopt-info options are accepted, only one of
6733 them can have @option{=filename}. If other filenames are provided then
6734 all but the first one are ignored.
6736 The dump verbosity has the following options
6738 @table @samp
6739 @item optimized
6740 Print information when an optimization is successfully applied. It is
6741 up to a pass to decide which information is relevant. For example, the
6742 vectorizer passes print the source location of loops which got
6743 successfully vectorized.
6744 @item missed
6745 Print information about missed optimizations. Individual passes
6746 control which information to include in the output. For example,
6748 @smallexample
6749 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
6750 @end smallexample
6752 will print information about missed optimization opportunities from
6753 vectorization passes on stderr.
6754 @item note
6755 Print verbose information about optimizations, such as certain
6756 transformations, more detailed messages about decisions etc.
6757 @item all
6758 Print detailed optimization information. This includes
6759 @var{optimized}, @var{missed}, and @var{note}.
6760 @end table
6762 The second set of options describes a group of optimizations and may
6763 include one or more of the following.
6765 @table @samp
6766 @item ipa
6767 Enable dumps from all interprocedural optimizations.
6768 @item loop
6769 Enable dumps from all loop optimizations.
6770 @item inline
6771 Enable dumps from all inlining optimizations.
6772 @item vec
6773 Enable dumps from all vectorization optimizations.
6774 @item optall
6775 Enable dumps from all optimizations. This is a superset of
6776 the optimization groups listed above.
6777 @end table
6779 For example,
6780 @smallexample
6781 gcc -O3 -fopt-info-missed=missed.all
6782 @end smallexample
6784 outputs missed optimization report from all the passes into
6785 @file{missed.all}.
6787 As another example,
6788 @smallexample
6789 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
6790 @end smallexample
6792 will output information about missed optimizations as well as
6793 optimized locations from all the inlining passes into
6794 @file{inline.txt}.
6796 If the @var{filename} is provided, then the dumps from all the
6797 applicable optimizations are concatenated into the @file{filename}.
6798 Otherwise the dump is output onto @file{stderr}. If @var{options} is
6799 omitted, it defaults to @option{all-optall}, which means dump all
6800 available optimization info from all the passes. In the following
6801 example, all optimization info is output on to @file{stderr}.
6803 @smallexample
6804 gcc -O3 -fopt-info
6805 @end smallexample
6807 Note that @option{-fopt-info-vec-missed} behaves the same as
6808 @option{-fopt-info-missed-vec}.
6810 As another example, consider
6812 @smallexample
6813 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
6814 @end smallexample
6816 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
6817 in conflict since only one output file is allowed. In this case, only
6818 the first option takes effect and the subsequent options are
6819 ignored. Thus only the @file{vec.miss} is produced which contains
6820 dumps from the vectorizer about missed opportunities.
6822 @item -frandom-seed=@var{number}
6823 @opindex frandom-seed
6824 This option provides a seed that GCC uses in place of
6825 random numbers in generating certain symbol names
6826 that have to be different in every compiled file.  It is also used to
6827 place unique stamps in coverage data files and the object files that
6828 produce them.  You can use the @option{-frandom-seed} option to produce
6829 reproducibly identical object files.
6831 The @var{number} should be different for every file you compile.
6833 @item -fsched-verbose=@var{n}
6834 @opindex fsched-verbose
6835 On targets that use instruction scheduling, this option controls the
6836 amount of debugging output the scheduler prints.  This information is
6837 written to standard error, unless @option{-fdump-rtl-sched1} or
6838 @option{-fdump-rtl-sched2} is specified, in which case it is output
6839 to the usual dump listing file, @file{.sched1} or @file{.sched2}
6840 respectively.  However for @var{n} greater than nine, the output is
6841 always printed to standard error.
6843 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
6844 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
6845 For @var{n} greater than one, it also output basic block probabilities,
6846 detailed ready list information and unit/insn info.  For @var{n} greater
6847 than two, it includes RTL at abort point, control-flow and regions info.
6848 And for @var{n} over four, @option{-fsched-verbose} also includes
6849 dependence info.
6851 @item -save-temps
6852 @itemx -save-temps=cwd
6853 @opindex save-temps
6854 Store the usual ``temporary'' intermediate files permanently; place them
6855 in the current directory and name them based on the source file.  Thus,
6856 compiling @file{foo.c} with @option{-c -save-temps} produces files
6857 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
6858 preprocessed @file{foo.i} output file even though the compiler now
6859 normally uses an integrated preprocessor.
6861 When used in combination with the @option{-x} command-line option,
6862 @option{-save-temps} is sensible enough to avoid over writing an
6863 input source file with the same extension as an intermediate file.
6864 The corresponding intermediate file may be obtained by renaming the
6865 source file before using @option{-save-temps}.
6867 If you invoke GCC in parallel, compiling several different source
6868 files that share a common base name in different subdirectories or the
6869 same source file compiled for multiple output destinations, it is
6870 likely that the different parallel compilers will interfere with each
6871 other, and overwrite the temporary files.  For instance:
6873 @smallexample
6874 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
6875 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
6876 @end smallexample
6878 may result in @file{foo.i} and @file{foo.o} being written to
6879 simultaneously by both compilers.
6881 @item -save-temps=obj
6882 @opindex save-temps=obj
6883 Store the usual ``temporary'' intermediate files permanently.  If the
6884 @option{-o} option is used, the temporary files are based on the
6885 object file.  If the @option{-o} option is not used, the
6886 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
6888 For example:
6890 @smallexample
6891 gcc -save-temps=obj -c foo.c
6892 gcc -save-temps=obj -c bar.c -o dir/xbar.o
6893 gcc -save-temps=obj foobar.c -o dir2/yfoobar
6894 @end smallexample
6896 @noindent
6897 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
6898 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
6899 @file{dir2/yfoobar.o}.
6901 @item -time@r{[}=@var{file}@r{]}
6902 @opindex time
6903 Report the CPU time taken by each subprocess in the compilation
6904 sequence.  For C source files, this is the compiler proper and assembler
6905 (plus the linker if linking is done).
6907 Without the specification of an output file, the output looks like this:
6909 @smallexample
6910 # cc1 0.12 0.01
6911 # as 0.00 0.01
6912 @end smallexample
6914 The first number on each line is the ``user time'', that is time spent
6915 executing the program itself.  The second number is ``system time'',
6916 time spent executing operating system routines on behalf of the program.
6917 Both numbers are in seconds.
6919 With the specification of an output file, the output is appended to the
6920 named file, and it looks like this:
6922 @smallexample
6923 0.12 0.01 cc1 @var{options}
6924 0.00 0.01 as @var{options}
6925 @end smallexample
6927 The ``user time'' and the ``system time'' are moved before the program
6928 name, and the options passed to the program are displayed, so that one
6929 can later tell what file was being compiled, and with which options.
6931 @item -fvar-tracking
6932 @opindex fvar-tracking
6933 Run variable tracking pass.  It computes where variables are stored at each
6934 position in code.  Better debugging information is then generated
6935 (if the debugging information format supports this information).
6937 It is enabled by default when compiling with optimization (@option{-Os},
6938 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
6939 the debug info format supports it.
6941 @item -fvar-tracking-assignments
6942 @opindex fvar-tracking-assignments
6943 @opindex fno-var-tracking-assignments
6944 Annotate assignments to user variables early in the compilation and
6945 attempt to carry the annotations over throughout the compilation all the
6946 way to the end, in an attempt to improve debug information while
6947 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
6949 It can be enabled even if var-tracking is disabled, in which case
6950 annotations are created and maintained, but discarded at the end.
6952 @item -fvar-tracking-assignments-toggle
6953 @opindex fvar-tracking-assignments-toggle
6954 @opindex fno-var-tracking-assignments-toggle
6955 Toggle @option{-fvar-tracking-assignments}, in the same way that
6956 @option{-gtoggle} toggles @option{-g}.
6958 @item -print-file-name=@var{library}
6959 @opindex print-file-name
6960 Print the full absolute name of the library file @var{library} that
6961 would be used when linking---and don't do anything else.  With this
6962 option, GCC does not compile or link anything; it just prints the
6963 file name.
6965 @item -print-multi-directory
6966 @opindex print-multi-directory
6967 Print the directory name corresponding to the multilib selected by any
6968 other switches present in the command line.  This directory is supposed
6969 to exist in @env{GCC_EXEC_PREFIX}.
6971 @item -print-multi-lib
6972 @opindex print-multi-lib
6973 Print the mapping from multilib directory names to compiler switches
6974 that enable them.  The directory name is separated from the switches by
6975 @samp{;}, and each switch starts with an @samp{@@} instead of the
6976 @samp{-}, without spaces between multiple switches.  This is supposed to
6977 ease shell processing.
6979 @item -print-multi-os-directory
6980 @opindex print-multi-os-directory
6981 Print the path to OS libraries for the selected
6982 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
6983 present in the @file{lib} subdirectory and no multilibs are used, this is
6984 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
6985 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
6986 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
6987 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
6989 @item -print-multiarch
6990 @opindex print-multiarch
6991 Print the path to OS libraries for the selected multiarch,
6992 relative to some @file{lib} subdirectory.
6994 @item -print-prog-name=@var{program}
6995 @opindex print-prog-name
6996 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
6998 @item -print-libgcc-file-name
6999 @opindex print-libgcc-file-name
7000 Same as @option{-print-file-name=libgcc.a}.
7002 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
7003 but you do want to link with @file{libgcc.a}.  You can do:
7005 @smallexample
7006 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
7007 @end smallexample
7009 @item -print-search-dirs
7010 @opindex print-search-dirs
7011 Print the name of the configured installation directory and a list of
7012 program and library directories @command{gcc} searches---and don't do anything else.
7014 This is useful when @command{gcc} prints the error message
7015 @samp{installation problem, cannot exec cpp0: No such file or directory}.
7016 To resolve this you either need to put @file{cpp0} and the other compiler
7017 components where @command{gcc} expects to find them, or you can set the environment
7018 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
7019 Don't forget the trailing @samp{/}.
7020 @xref{Environment Variables}.
7022 @item -print-sysroot
7023 @opindex print-sysroot
7024 Print the target sysroot directory that is used during
7025 compilation.  This is the target sysroot specified either at configure
7026 time or using the @option{--sysroot} option, possibly with an extra
7027 suffix that depends on compilation options.  If no target sysroot is
7028 specified, the option prints nothing.
7030 @item -print-sysroot-headers-suffix
7031 @opindex print-sysroot-headers-suffix
7032 Print the suffix added to the target sysroot when searching for
7033 headers, or give an error if the compiler is not configured with such
7034 a suffix---and don't do anything else.
7036 @item -dumpmachine
7037 @opindex dumpmachine
7038 Print the compiler's target machine (for example,
7039 @samp{i686-pc-linux-gnu})---and don't do anything else.
7041 @item -dumpversion
7042 @opindex dumpversion
7043 Print the compiler version (for example, @samp{3.0})---and don't do
7044 anything else.
7046 @item -dumpspecs
7047 @opindex dumpspecs
7048 Print the compiler's built-in specs---and don't do anything else.  (This
7049 is used when GCC itself is being built.)  @xref{Spec Files}.
7051 @item -fno-eliminate-unused-debug-types
7052 @opindex feliminate-unused-debug-types
7053 @opindex fno-eliminate-unused-debug-types
7054 Normally, when producing DWARF 2 output, GCC avoids producing debug symbol 
7055 output for types that are nowhere used in the source file being compiled.
7056 Sometimes it is useful to have GCC emit debugging
7057 information for all types declared in a compilation
7058 unit, regardless of whether or not they are actually used
7059 in that compilation unit, for example 
7060 if, in the debugger, you want to cast a value to a type that is
7061 not actually used in your program (but is declared).  More often,
7062 however, this results in a significant amount of wasted space.
7063 @end table
7065 @node Optimize Options
7066 @section Options That Control Optimization
7067 @cindex optimize options
7068 @cindex options, optimization
7070 These options control various sorts of optimizations.
7072 Without any optimization option, the compiler's goal is to reduce the
7073 cost of compilation and to make debugging produce the expected
7074 results.  Statements are independent: if you stop the program with a
7075 breakpoint between statements, you can then assign a new value to any
7076 variable or change the program counter to any other statement in the
7077 function and get exactly the results you expect from the source
7078 code.
7080 Turning on optimization flags makes the compiler attempt to improve
7081 the performance and/or code size at the expense of compilation time
7082 and possibly the ability to debug the program.
7084 The compiler performs optimization based on the knowledge it has of the
7085 program.  Compiling multiple files at once to a single output file mode allows
7086 the compiler to use information gained from all of the files when compiling
7087 each of them.
7089 Not all optimizations are controlled directly by a flag.  Only
7090 optimizations that have a flag are listed in this section.
7092 Most optimizations are only enabled if an @option{-O} level is set on
7093 the command line.  Otherwise they are disabled, even if individual
7094 optimization flags are specified.
7096 Depending on the target and how GCC was configured, a slightly different
7097 set of optimizations may be enabled at each @option{-O} level than
7098 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
7099 to find out the exact set of optimizations that are enabled at each level.
7100 @xref{Overall Options}, for examples.
7102 @table @gcctabopt
7103 @item -O
7104 @itemx -O1
7105 @opindex O
7106 @opindex O1
7107 Optimize.  Optimizing compilation takes somewhat more time, and a lot
7108 more memory for a large function.
7110 With @option{-O}, the compiler tries to reduce code size and execution
7111 time, without performing any optimizations that take a great deal of
7112 compilation time.
7114 @option{-O} turns on the following optimization flags:
7115 @gccoptlist{
7116 -fauto-inc-dec @gol
7117 -fbranch-count-reg @gol
7118 -fcombine-stack-adjustments @gol
7119 -fcompare-elim @gol
7120 -fcprop-registers @gol
7121 -fdce @gol
7122 -fdefer-pop @gol
7123 -fdelayed-branch @gol
7124 -fdse @gol
7125 -fforward-propagate @gol
7126 -fguess-branch-probability @gol
7127 -fif-conversion2 @gol
7128 -fif-conversion @gol
7129 -finline-functions-called-once @gol
7130 -fipa-pure-const @gol
7131 -fipa-profile @gol
7132 -fipa-reference @gol
7133 -fmerge-constants @gol
7134 -fmove-loop-invariants @gol
7135 -fshrink-wrap @gol
7136 -fsplit-wide-types @gol
7137 -ftree-bit-ccp @gol
7138 -ftree-ccp @gol
7139 -fssa-phiopt @gol
7140 -ftree-ch @gol
7141 -ftree-copy-prop @gol
7142 -ftree-copyrename @gol
7143 -ftree-dce @gol
7144 -ftree-dominator-opts @gol
7145 -ftree-dse @gol
7146 -ftree-forwprop @gol
7147 -ftree-fre @gol
7148 -ftree-phiprop @gol
7149 -ftree-sink @gol
7150 -ftree-slsr @gol
7151 -ftree-sra @gol
7152 -ftree-pta @gol
7153 -ftree-ter @gol
7154 -funit-at-a-time}
7156 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
7157 where doing so does not interfere with debugging.
7159 @item -O2
7160 @opindex O2
7161 Optimize even more.  GCC performs nearly all supported optimizations
7162 that do not involve a space-speed tradeoff.
7163 As compared to @option{-O}, this option increases both compilation time
7164 and the performance of the generated code.
7166 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
7167 also turns on the following optimization flags:
7168 @gccoptlist{-fthread-jumps @gol
7169 -falign-functions  -falign-jumps @gol
7170 -falign-loops  -falign-labels @gol
7171 -fcaller-saves @gol
7172 -fcrossjumping @gol
7173 -fcse-follow-jumps  -fcse-skip-blocks @gol
7174 -fdelete-null-pointer-checks @gol
7175 -fdevirtualize -fdevirtualize-speculatively @gol
7176 -fexpensive-optimizations @gol
7177 -fgcse  -fgcse-lm  @gol
7178 -fhoist-adjacent-loads @gol
7179 -finline-small-functions @gol
7180 -findirect-inlining @gol
7181 -fipa-cp @gol
7182 -fipa-sra @gol
7183 -fipa-icf @gol
7184 -fisolate-erroneous-paths-dereference @gol
7185 -foptimize-sibling-calls @gol
7186 -foptimize-strlen @gol
7187 -fpartial-inlining @gol
7188 -fpeephole2 @gol
7189 -freorder-blocks -freorder-blocks-and-partition -freorder-functions @gol
7190 -frerun-cse-after-loop  @gol
7191 -fsched-interblock  -fsched-spec @gol
7192 -fschedule-insns  -fschedule-insns2 @gol
7193 -fstrict-aliasing -fstrict-overflow @gol
7194 -ftree-builtin-call-dce @gol
7195 -ftree-switch-conversion -ftree-tail-merge @gol
7196 -ftree-pre @gol
7197 -ftree-vrp @gol
7198 -fuse-caller-save}
7200 Please note the warning under @option{-fgcse} about
7201 invoking @option{-O2} on programs that use computed gotos.
7203 @item -O3
7204 @opindex O3
7205 Optimize yet more.  @option{-O3} turns on all optimizations specified
7206 by @option{-O2} and also turns on the @option{-finline-functions},
7207 @option{-funswitch-loops}, @option{-fpredictive-commoning},
7208 @option{-fgcse-after-reload}, @option{-ftree-loop-vectorize},
7209 @option{-ftree-loop-distribute-patterns},
7210 @option{-ftree-slp-vectorize}, @option{-fvect-cost-model},
7211 @option{-ftree-partial-pre} and @option{-fipa-cp-clone} options.
7213 @item -O0
7214 @opindex O0
7215 Reduce compilation time and make debugging produce the expected
7216 results.  This is the default.
7218 @item -Os
7219 @opindex Os
7220 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
7221 do not typically increase code size.  It also performs further
7222 optimizations designed to reduce code size.
7224 @option{-Os} disables the following optimization flags:
7225 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
7226 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
7227 -fprefetch-loop-arrays}
7229 @item -Ofast
7230 @opindex Ofast
7231 Disregard strict standards compliance.  @option{-Ofast} enables all
7232 @option{-O3} optimizations.  It also enables optimizations that are not
7233 valid for all standard-compliant programs.
7234 It turns on @option{-ffast-math} and the Fortran-specific
7235 @option{-fno-protect-parens} and @option{-fstack-arrays}.
7237 @item -Og
7238 @opindex Og
7239 Optimize debugging experience.  @option{-Og} enables optimizations
7240 that do not interfere with debugging. It should be the optimization
7241 level of choice for the standard edit-compile-debug cycle, offering
7242 a reasonable level of optimization while maintaining fast compilation
7243 and a good debugging experience.
7245 If you use multiple @option{-O} options, with or without level numbers,
7246 the last such option is the one that is effective.
7247 @end table
7249 Options of the form @option{-f@var{flag}} specify machine-independent
7250 flags.  Most flags have both positive and negative forms; the negative
7251 form of @option{-ffoo} is @option{-fno-foo}.  In the table
7252 below, only one of the forms is listed---the one you typically 
7253 use.  You can figure out the other form by either removing @samp{no-}
7254 or adding it.
7256 The following options control specific optimizations.  They are either
7257 activated by @option{-O} options or are related to ones that are.  You
7258 can use the following flags in the rare cases when ``fine-tuning'' of
7259 optimizations to be performed is desired.
7261 @table @gcctabopt
7262 @item -fno-defer-pop
7263 @opindex fno-defer-pop
7264 Always pop the arguments to each function call as soon as that function
7265 returns.  For machines that must pop arguments after a function call,
7266 the compiler normally lets arguments accumulate on the stack for several
7267 function calls and pops them all at once.
7269 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7271 @item -fforward-propagate
7272 @opindex fforward-propagate
7273 Perform a forward propagation pass on RTL@.  The pass tries to combine two
7274 instructions and checks if the result can be simplified.  If loop unrolling
7275 is active, two passes are performed and the second is scheduled after
7276 loop unrolling.
7278 This option is enabled by default at optimization levels @option{-O},
7279 @option{-O2}, @option{-O3}, @option{-Os}.
7281 @item -ffp-contract=@var{style}
7282 @opindex ffp-contract
7283 @option{-ffp-contract=off} disables floating-point expression contraction.
7284 @option{-ffp-contract=fast} enables floating-point expression contraction
7285 such as forming of fused multiply-add operations if the target has
7286 native support for them.
7287 @option{-ffp-contract=on} enables floating-point expression contraction
7288 if allowed by the language standard.  This is currently not implemented
7289 and treated equal to @option{-ffp-contract=off}.
7291 The default is @option{-ffp-contract=fast}.
7293 @item -fomit-frame-pointer
7294 @opindex fomit-frame-pointer
7295 Don't keep the frame pointer in a register for functions that
7296 don't need one.  This avoids the instructions to save, set up and
7297 restore frame pointers; it also makes an extra register available
7298 in many functions.  @strong{It also makes debugging impossible on
7299 some machines.}
7301 On some machines, such as the VAX, this flag has no effect, because
7302 the standard calling sequence automatically handles the frame pointer
7303 and nothing is saved by pretending it doesn't exist.  The
7304 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
7305 whether a target machine supports this flag.  @xref{Registers,,Register
7306 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
7308 Starting with GCC version 4.6, the default setting (when not optimizing for
7309 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets has been changed to
7310 @option{-fomit-frame-pointer}.  The default can be reverted to
7311 @option{-fno-omit-frame-pointer} by configuring GCC with the
7312 @option{--enable-frame-pointer} configure option.
7314 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7316 @item -foptimize-sibling-calls
7317 @opindex foptimize-sibling-calls
7318 Optimize sibling and tail recursive calls.
7320 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7322 @item -foptimize-strlen
7323 @opindex foptimize-strlen
7324 Optimize various standard C string functions (e.g. @code{strlen},
7325 @code{strchr} or @code{strcpy}) and
7326 their @code{_FORTIFY_SOURCE} counterparts into faster alternatives.
7328 Enabled at levels @option{-O2}, @option{-O3}.
7330 @item -fno-inline
7331 @opindex fno-inline
7332 Do not expand any functions inline apart from those marked with
7333 the @code{always_inline} attribute.  This is the default when not
7334 optimizing.
7336 Single functions can be exempted from inlining by marking them
7337 with the @code{noinline} attribute.
7339 @item -finline-small-functions
7340 @opindex finline-small-functions
7341 Integrate functions into their callers when their body is smaller than expected
7342 function call code (so overall size of program gets smaller).  The compiler
7343 heuristically decides which functions are simple enough to be worth integrating
7344 in this way.  This inlining applies to all functions, even those not declared
7345 inline.
7347 Enabled at level @option{-O2}.
7349 @item -findirect-inlining
7350 @opindex findirect-inlining
7351 Inline also indirect calls that are discovered to be known at compile
7352 time thanks to previous inlining.  This option has any effect only
7353 when inlining itself is turned on by the @option{-finline-functions}
7354 or @option{-finline-small-functions} options.
7356 Enabled at level @option{-O2}.
7358 @item -finline-functions
7359 @opindex finline-functions
7360 Consider all functions for inlining, even if they are not declared inline.
7361 The compiler heuristically decides which functions are worth integrating
7362 in this way.
7364 If all calls to a given function are integrated, and the function is
7365 declared @code{static}, then the function is normally not output as
7366 assembler code in its own right.
7368 Enabled at level @option{-O3}.
7370 @item -finline-functions-called-once
7371 @opindex finline-functions-called-once
7372 Consider all @code{static} functions called once for inlining into their
7373 caller even if they are not marked @code{inline}.  If a call to a given
7374 function is integrated, then the function is not output as assembler code
7375 in its own right.
7377 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
7379 @item -fearly-inlining
7380 @opindex fearly-inlining
7381 Inline functions marked by @code{always_inline} and functions whose body seems
7382 smaller than the function call overhead early before doing
7383 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
7384 makes profiling significantly cheaper and usually inlining faster on programs
7385 having large chains of nested wrapper functions.
7387 Enabled by default.
7389 @item -fipa-sra
7390 @opindex fipa-sra
7391 Perform interprocedural scalar replacement of aggregates, removal of
7392 unused parameters and replacement of parameters passed by reference
7393 by parameters passed by value.
7395 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
7397 @item -finline-limit=@var{n}
7398 @opindex finline-limit
7399 By default, GCC limits the size of functions that can be inlined.  This flag
7400 allows coarse control of this limit.  @var{n} is the size of functions that
7401 can be inlined in number of pseudo instructions.
7403 Inlining is actually controlled by a number of parameters, which may be
7404 specified individually by using @option{--param @var{name}=@var{value}}.
7405 The @option{-finline-limit=@var{n}} option sets some of these parameters
7406 as follows:
7408 @table @gcctabopt
7409 @item max-inline-insns-single
7410 is set to @var{n}/2.
7411 @item max-inline-insns-auto
7412 is set to @var{n}/2.
7413 @end table
7415 See below for a documentation of the individual
7416 parameters controlling inlining and for the defaults of these parameters.
7418 @emph{Note:} there may be no value to @option{-finline-limit} that results
7419 in default behavior.
7421 @emph{Note:} pseudo instruction represents, in this particular context, an
7422 abstract measurement of function's size.  In no way does it represent a count
7423 of assembly instructions and as such its exact meaning might change from one
7424 release to an another.
7426 @item -fno-keep-inline-dllexport
7427 @opindex -fno-keep-inline-dllexport
7428 This is a more fine-grained version of @option{-fkeep-inline-functions},
7429 which applies only to functions that are declared using the @code{dllexport}
7430 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
7431 Functions}.)
7433 @item -fkeep-inline-functions
7434 @opindex fkeep-inline-functions
7435 In C, emit @code{static} functions that are declared @code{inline}
7436 into the object file, even if the function has been inlined into all
7437 of its callers.  This switch does not affect functions using the
7438 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
7439 inline functions into the object file.
7441 @item -fkeep-static-consts
7442 @opindex fkeep-static-consts
7443 Emit variables declared @code{static const} when optimization isn't turned
7444 on, even if the variables aren't referenced.
7446 GCC enables this option by default.  If you want to force the compiler to
7447 check if a variable is referenced, regardless of whether or not
7448 optimization is turned on, use the @option{-fno-keep-static-consts} option.
7450 @item -fmerge-constants
7451 @opindex fmerge-constants
7452 Attempt to merge identical constants (string constants and floating-point
7453 constants) across compilation units.
7455 This option is the default for optimized compilation if the assembler and
7456 linker support it.  Use @option{-fno-merge-constants} to inhibit this
7457 behavior.
7459 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7461 @item -fmerge-all-constants
7462 @opindex fmerge-all-constants
7463 Attempt to merge identical constants and identical variables.
7465 This option implies @option{-fmerge-constants}.  In addition to
7466 @option{-fmerge-constants} this considers e.g.@: even constant initialized
7467 arrays or initialized constant variables with integral or floating-point
7468 types.  Languages like C or C++ require each variable, including multiple
7469 instances of the same variable in recursive calls, to have distinct locations,
7470 so using this option results in non-conforming
7471 behavior.
7473 @item -fmodulo-sched
7474 @opindex fmodulo-sched
7475 Perform swing modulo scheduling immediately before the first scheduling
7476 pass.  This pass looks at innermost loops and reorders their
7477 instructions by overlapping different iterations.
7479 @item -fmodulo-sched-allow-regmoves
7480 @opindex fmodulo-sched-allow-regmoves
7481 Perform more aggressive SMS-based modulo scheduling with register moves
7482 allowed.  By setting this flag certain anti-dependences edges are
7483 deleted, which triggers the generation of reg-moves based on the
7484 life-range analysis.  This option is effective only with
7485 @option{-fmodulo-sched} enabled.
7487 @item -fno-branch-count-reg
7488 @opindex fno-branch-count-reg
7489 Do not use ``decrement and branch'' instructions on a count register,
7490 but instead generate a sequence of instructions that decrement a
7491 register, compare it against zero, then branch based upon the result.
7492 This option is only meaningful on architectures that support such
7493 instructions, which include x86, PowerPC, IA-64 and S/390.
7495 Enabled by default at @option{-O1} and higher.
7497 The default is @option{-fbranch-count-reg}.
7499 @item -fno-function-cse
7500 @opindex fno-function-cse
7501 Do not put function addresses in registers; make each instruction that
7502 calls a constant function contain the function's address explicitly.
7504 This option results in less efficient code, but some strange hacks
7505 that alter the assembler output may be confused by the optimizations
7506 performed when this option is not used.
7508 The default is @option{-ffunction-cse}
7510 @item -fno-zero-initialized-in-bss
7511 @opindex fno-zero-initialized-in-bss
7512 If the target supports a BSS section, GCC by default puts variables that
7513 are initialized to zero into BSS@.  This can save space in the resulting
7514 code.
7516 This option turns off this behavior because some programs explicitly
7517 rely on variables going to the data section---e.g., so that the
7518 resulting executable can find the beginning of that section and/or make
7519 assumptions based on that.
7521 The default is @option{-fzero-initialized-in-bss}.
7523 @item -fthread-jumps
7524 @opindex fthread-jumps
7525 Perform optimizations that check to see if a jump branches to a
7526 location where another comparison subsumed by the first is found.  If
7527 so, the first branch is redirected to either the destination of the
7528 second branch or a point immediately following it, depending on whether
7529 the condition is known to be true or false.
7531 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7533 @item -fsplit-wide-types
7534 @opindex fsplit-wide-types
7535 When using a type that occupies multiple registers, such as @code{long
7536 long} on a 32-bit system, split the registers apart and allocate them
7537 independently.  This normally generates better code for those types,
7538 but may make debugging more difficult.
7540 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
7541 @option{-Os}.
7543 @item -fcse-follow-jumps
7544 @opindex fcse-follow-jumps
7545 In common subexpression elimination (CSE), scan through jump instructions
7546 when the target of the jump is not reached by any other path.  For
7547 example, when CSE encounters an @code{if} statement with an
7548 @code{else} clause, CSE follows the jump when the condition
7549 tested is false.
7551 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7553 @item -fcse-skip-blocks
7554 @opindex fcse-skip-blocks
7555 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
7556 follow jumps that conditionally skip over blocks.  When CSE
7557 encounters a simple @code{if} statement with no else clause,
7558 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
7559 body of the @code{if}.
7561 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7563 @item -frerun-cse-after-loop
7564 @opindex frerun-cse-after-loop
7565 Re-run common subexpression elimination after loop optimizations are
7566 performed.
7568 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7570 @item -fgcse
7571 @opindex fgcse
7572 Perform a global common subexpression elimination pass.
7573 This pass also performs global constant and copy propagation.
7575 @emph{Note:} When compiling a program using computed gotos, a GCC
7576 extension, you may get better run-time performance if you disable
7577 the global common subexpression elimination pass by adding
7578 @option{-fno-gcse} to the command line.
7580 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7582 @item -fgcse-lm
7583 @opindex fgcse-lm
7584 When @option{-fgcse-lm} is enabled, global common subexpression elimination
7585 attempts to move loads that are only killed by stores into themselves.  This
7586 allows a loop containing a load/store sequence to be changed to a load outside
7587 the loop, and a copy/store within the loop.
7589 Enabled by default when @option{-fgcse} is enabled.
7591 @item -fgcse-sm
7592 @opindex fgcse-sm
7593 When @option{-fgcse-sm} is enabled, a store motion pass is run after
7594 global common subexpression elimination.  This pass attempts to move
7595 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
7596 loops containing a load/store sequence can be changed to a load before
7597 the loop and a store after the loop.
7599 Not enabled at any optimization level.
7601 @item -fgcse-las
7602 @opindex fgcse-las
7603 When @option{-fgcse-las} is enabled, the global common subexpression
7604 elimination pass eliminates redundant loads that come after stores to the
7605 same memory location (both partial and full redundancies).
7607 Not enabled at any optimization level.
7609 @item -fgcse-after-reload
7610 @opindex fgcse-after-reload
7611 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
7612 pass is performed after reload.  The purpose of this pass is to clean up
7613 redundant spilling.
7615 @item -faggressive-loop-optimizations
7616 @opindex faggressive-loop-optimizations
7617 This option tells the loop optimizer to use language constraints to
7618 derive bounds for the number of iterations of a loop.  This assumes that
7619 loop code does not invoke undefined behavior by for example causing signed
7620 integer overflows or out-of-bound array accesses.  The bounds for the
7621 number of iterations of a loop are used to guide loop unrolling and peeling
7622 and loop exit test optimizations.
7623 This option is enabled by default.
7625 @item -funsafe-loop-optimizations
7626 @opindex funsafe-loop-optimizations
7627 This option tells the loop optimizer to assume that loop indices do not
7628 overflow, and that loops with nontrivial exit condition are not
7629 infinite.  This enables a wider range of loop optimizations even if
7630 the loop optimizer itself cannot prove that these assumptions are valid.
7631 If you use @option{-Wunsafe-loop-optimizations}, the compiler warns you
7632 if it finds this kind of loop.
7634 @item -fcrossjumping
7635 @opindex fcrossjumping
7636 Perform cross-jumping transformation.
7637 This transformation unifies equivalent code and saves code size.  The
7638 resulting code may or may not perform better than without cross-jumping.
7640 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7642 @item -fauto-inc-dec
7643 @opindex fauto-inc-dec
7644 Combine increments or decrements of addresses with memory accesses.
7645 This pass is always skipped on architectures that do not have
7646 instructions to support this.  Enabled by default at @option{-O} and
7647 higher on architectures that support this.
7649 @item -fdce
7650 @opindex fdce
7651 Perform dead code elimination (DCE) on RTL@.
7652 Enabled by default at @option{-O} and higher.
7654 @item -fdse
7655 @opindex fdse
7656 Perform dead store elimination (DSE) on RTL@.
7657 Enabled by default at @option{-O} and higher.
7659 @item -fif-conversion
7660 @opindex fif-conversion
7661 Attempt to transform conditional jumps into branch-less equivalents.  This
7662 includes use of conditional moves, min, max, set flags and abs instructions, and
7663 some tricks doable by standard arithmetics.  The use of conditional execution
7664 on chips where it is available is controlled by @code{if-conversion2}.
7666 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7668 @item -fif-conversion2
7669 @opindex fif-conversion2
7670 Use conditional execution (where available) to transform conditional jumps into
7671 branch-less equivalents.
7673 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7675 @item -fdeclone-ctor-dtor
7676 @opindex fdeclone-ctor-dtor
7677 The C++ ABI requires multiple entry points for constructors and
7678 destructors: one for a base subobject, one for a complete object, and
7679 one for a virtual destructor that calls operator delete afterwards.
7680 For a hierarchy with virtual bases, the base and complete variants are
7681 clones, which means two copies of the function.  With this option, the
7682 base and complete variants are changed to be thunks that call a common
7683 implementation.
7685 Enabled by @option{-Os}.
7687 @item -fdelete-null-pointer-checks
7688 @opindex fdelete-null-pointer-checks
7689 Assume that programs cannot safely dereference null pointers, and that
7690 no code or data element resides there.  This enables simple constant
7691 folding optimizations at all optimization levels.  In addition, other
7692 optimization passes in GCC use this flag to control global dataflow
7693 analyses that eliminate useless checks for null pointers; these assume
7694 that if a pointer is checked after it has already been dereferenced,
7695 it cannot be null.
7697 Note however that in some environments this assumption is not true.
7698 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
7699 for programs that depend on that behavior.
7701 Some targets, especially embedded ones, disable this option at all levels.
7702 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
7703 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
7704 are enabled independently at different optimization levels.
7706 @item -fdevirtualize
7707 @opindex fdevirtualize
7708 Attempt to convert calls to virtual functions to direct calls.  This
7709 is done both within a procedure and interprocedurally as part of
7710 indirect inlining (@code{-findirect-inlining}) and interprocedural constant
7711 propagation (@option{-fipa-cp}).
7712 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7714 @item -fdevirtualize-speculatively
7715 @opindex fdevirtualize-speculatively
7716 Attempt to convert calls to virtual functions to speculative direct calls.
7717 Based on the analysis of the type inheritance graph, determine for a given call
7718 the set of likely targets. If the set is small, preferably of size 1, change
7719 the call into an conditional deciding on direct and indirect call.  The
7720 speculative calls enable more optimizations, such as inlining.  When they seem
7721 useless after further optimization, they are converted back into original form.
7723 @item -fexpensive-optimizations
7724 @opindex fexpensive-optimizations
7725 Perform a number of minor optimizations that are relatively expensive.
7727 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7729 @item -free
7730 @opindex free
7731 Attempt to remove redundant extension instructions.  This is especially
7732 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
7733 registers after writing to their lower 32-bit half.
7735 Enabled for Alpha, AArch64 and x86 at levels @option{-O2},
7736 @option{-O3}, @option{-Os}.
7738 @item -flive-range-shrinkage
7739 @opindex flive-range-shrinkage
7740 Attempt to decrease register pressure through register live range
7741 shrinkage.  This is helpful for fast processors with small or moderate
7742 size register sets.
7744 @item -fira-algorithm=@var{algorithm}
7745 Use the specified coloring algorithm for the integrated register
7746 allocator.  The @var{algorithm} argument can be @samp{priority}, which
7747 specifies Chow's priority coloring, or @samp{CB}, which specifies
7748 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
7749 for all architectures, but for those targets that do support it, it is
7750 the default because it generates better code.
7752 @item -fira-region=@var{region}
7753 Use specified regions for the integrated register allocator.  The
7754 @var{region} argument should be one of the following:
7756 @table @samp
7758 @item all
7759 Use all loops as register allocation regions.
7760 This can give the best results for machines with a small and/or
7761 irregular register set.
7763 @item mixed
7764 Use all loops except for loops with small register pressure 
7765 as the regions.  This value usually gives
7766 the best results in most cases and for most architectures,
7767 and is enabled by default when compiling with optimization for speed
7768 (@option{-O}, @option{-O2}, @dots{}).
7770 @item one
7771 Use all functions as a single region.  
7772 This typically results in the smallest code size, and is enabled by default for
7773 @option{-Os} or @option{-O0}.
7775 @end table
7777 @item -fira-hoist-pressure
7778 @opindex fira-hoist-pressure
7779 Use IRA to evaluate register pressure in the code hoisting pass for
7780 decisions to hoist expressions.  This option usually results in smaller
7781 code, but it can slow the compiler down.
7783 This option is enabled at level @option{-Os} for all targets.
7785 @item -fira-loop-pressure
7786 @opindex fira-loop-pressure
7787 Use IRA to evaluate register pressure in loops for decisions to move
7788 loop invariants.  This option usually results in generation
7789 of faster and smaller code on machines with large register files (>= 32
7790 registers), but it can slow the compiler down.
7792 This option is enabled at level @option{-O3} for some targets.
7794 @item -fno-ira-share-save-slots
7795 @opindex fno-ira-share-save-slots
7796 Disable sharing of stack slots used for saving call-used hard
7797 registers living through a call.  Each hard register gets a
7798 separate stack slot, and as a result function stack frames are
7799 larger.
7801 @item -fno-ira-share-spill-slots
7802 @opindex fno-ira-share-spill-slots
7803 Disable sharing of stack slots allocated for pseudo-registers.  Each
7804 pseudo-register that does not get a hard register gets a separate
7805 stack slot, and as a result function stack frames are larger.
7807 @item -fira-verbose=@var{n}
7808 @opindex fira-verbose
7809 Control the verbosity of the dump file for the integrated register allocator.
7810 The default value is 5.  If the value @var{n} is greater or equal to 10,
7811 the dump output is sent to stderr using the same format as @var{n} minus 10.
7813 @item -fdelayed-branch
7814 @opindex fdelayed-branch
7815 If supported for the target machine, attempt to reorder instructions
7816 to exploit instruction slots available after delayed branch
7817 instructions.
7819 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7821 @item -fschedule-insns
7822 @opindex fschedule-insns
7823 If supported for the target machine, attempt to reorder instructions to
7824 eliminate execution stalls due to required data being unavailable.  This
7825 helps machines that have slow floating point or memory load instructions
7826 by allowing other instructions to be issued until the result of the load
7827 or floating-point instruction is required.
7829 Enabled at levels @option{-O2}, @option{-O3}.
7831 @item -fschedule-insns2
7832 @opindex fschedule-insns2
7833 Similar to @option{-fschedule-insns}, but requests an additional pass of
7834 instruction scheduling after register allocation has been done.  This is
7835 especially useful on machines with a relatively small number of
7836 registers and where memory load instructions take more than one cycle.
7838 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7840 @item -fno-sched-interblock
7841 @opindex fno-sched-interblock
7842 Don't schedule instructions across basic blocks.  This is normally
7843 enabled by default when scheduling before register allocation, i.e.@:
7844 with @option{-fschedule-insns} or at @option{-O2} or higher.
7846 @item -fno-sched-spec
7847 @opindex fno-sched-spec
7848 Don't allow speculative motion of non-load instructions.  This is normally
7849 enabled by default when scheduling before register allocation, i.e.@:
7850 with @option{-fschedule-insns} or at @option{-O2} or higher.
7852 @item -fsched-pressure
7853 @opindex fsched-pressure
7854 Enable register pressure sensitive insn scheduling before register
7855 allocation.  This only makes sense when scheduling before register
7856 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
7857 @option{-O2} or higher.  Usage of this option can improve the
7858 generated code and decrease its size by preventing register pressure
7859 increase above the number of available hard registers and subsequent
7860 spills in register allocation.
7862 @item -fsched-spec-load
7863 @opindex fsched-spec-load
7864 Allow speculative motion of some load instructions.  This only makes
7865 sense when scheduling before register allocation, i.e.@: with
7866 @option{-fschedule-insns} or at @option{-O2} or higher.
7868 @item -fsched-spec-load-dangerous
7869 @opindex fsched-spec-load-dangerous
7870 Allow speculative motion of more load instructions.  This only makes
7871 sense when scheduling before register allocation, i.e.@: with
7872 @option{-fschedule-insns} or at @option{-O2} or higher.
7874 @item -fsched-stalled-insns
7875 @itemx -fsched-stalled-insns=@var{n}
7876 @opindex fsched-stalled-insns
7877 Define how many insns (if any) can be moved prematurely from the queue
7878 of stalled insns into the ready list during the second scheduling pass.
7879 @option{-fno-sched-stalled-insns} means that no insns are moved
7880 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
7881 on how many queued insns can be moved prematurely.
7882 @option{-fsched-stalled-insns} without a value is equivalent to
7883 @option{-fsched-stalled-insns=1}.
7885 @item -fsched-stalled-insns-dep
7886 @itemx -fsched-stalled-insns-dep=@var{n}
7887 @opindex fsched-stalled-insns-dep
7888 Define how many insn groups (cycles) are examined for a dependency
7889 on a stalled insn that is a candidate for premature removal from the queue
7890 of stalled insns.  This has an effect only during the second scheduling pass,
7891 and only if @option{-fsched-stalled-insns} is used.
7892 @option{-fno-sched-stalled-insns-dep} is equivalent to
7893 @option{-fsched-stalled-insns-dep=0}.
7894 @option{-fsched-stalled-insns-dep} without a value is equivalent to
7895 @option{-fsched-stalled-insns-dep=1}.
7897 @item -fsched2-use-superblocks
7898 @opindex fsched2-use-superblocks
7899 When scheduling after register allocation, use superblock scheduling.
7900 This allows motion across basic block boundaries,
7901 resulting in faster schedules.  This option is experimental, as not all machine
7902 descriptions used by GCC model the CPU closely enough to avoid unreliable
7903 results from the algorithm.
7905 This only makes sense when scheduling after register allocation, i.e.@: with
7906 @option{-fschedule-insns2} or at @option{-O2} or higher.
7908 @item -fsched-group-heuristic
7909 @opindex fsched-group-heuristic
7910 Enable the group heuristic in the scheduler.  This heuristic favors
7911 the instruction that belongs to a schedule group.  This is enabled
7912 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7913 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7915 @item -fsched-critical-path-heuristic
7916 @opindex fsched-critical-path-heuristic
7917 Enable the critical-path heuristic in the scheduler.  This heuristic favors
7918 instructions on the critical path.  This is enabled by default when
7919 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7920 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7922 @item -fsched-spec-insn-heuristic
7923 @opindex fsched-spec-insn-heuristic
7924 Enable the speculative instruction heuristic in the scheduler.  This
7925 heuristic favors speculative instructions with greater dependency weakness.
7926 This is enabled by default when scheduling is enabled, i.e.@:
7927 with @option{-fschedule-insns} or @option{-fschedule-insns2}
7928 or at @option{-O2} or higher.
7930 @item -fsched-rank-heuristic
7931 @opindex fsched-rank-heuristic
7932 Enable the rank heuristic in the scheduler.  This heuristic favors
7933 the instruction belonging to a basic block with greater size or frequency.
7934 This is enabled by default when scheduling is enabled, i.e.@:
7935 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7936 at @option{-O2} or higher.
7938 @item -fsched-last-insn-heuristic
7939 @opindex fsched-last-insn-heuristic
7940 Enable the last-instruction heuristic in the scheduler.  This heuristic
7941 favors the instruction that is less dependent on the last instruction
7942 scheduled.  This is enabled by default when scheduling is enabled,
7943 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7944 at @option{-O2} or higher.
7946 @item -fsched-dep-count-heuristic
7947 @opindex fsched-dep-count-heuristic
7948 Enable the dependent-count heuristic in the scheduler.  This heuristic
7949 favors the instruction that has more instructions depending on it.
7950 This is enabled by default when scheduling is enabled, i.e.@:
7951 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7952 at @option{-O2} or higher.
7954 @item -freschedule-modulo-scheduled-loops
7955 @opindex freschedule-modulo-scheduled-loops
7956 Modulo scheduling is performed before traditional scheduling.  If a loop
7957 is modulo scheduled, later scheduling passes may change its schedule.  
7958 Use this option to control that behavior.
7960 @item -fselective-scheduling
7961 @opindex fselective-scheduling
7962 Schedule instructions using selective scheduling algorithm.  Selective
7963 scheduling runs instead of the first scheduler pass.
7965 @item -fselective-scheduling2
7966 @opindex fselective-scheduling2
7967 Schedule instructions using selective scheduling algorithm.  Selective
7968 scheduling runs instead of the second scheduler pass.
7970 @item -fsel-sched-pipelining
7971 @opindex fsel-sched-pipelining
7972 Enable software pipelining of innermost loops during selective scheduling.
7973 This option has no effect unless one of @option{-fselective-scheduling} or
7974 @option{-fselective-scheduling2} is turned on.
7976 @item -fsel-sched-pipelining-outer-loops
7977 @opindex fsel-sched-pipelining-outer-loops
7978 When pipelining loops during selective scheduling, also pipeline outer loops.
7979 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
7981 @item -fsemantic-interposition
7982 @opindex fsemantic-interposition
7983 Some object formats, like ELF, allow interposing of symbols by dynamic linker.
7984 This means that for symbols exported from the DSO compiler can not perform
7985 inter-procedural propagation, inlining and other optimizations in anticipation
7986 that the function or variable in question may change. While this feature is
7987 useful, for example, to rewrite memory allocation functions by a debugging
7988 implementation, it is expensive in the terms of code quality.
7989 With @option{-fno-semantic-inteposition} compiler assumest that if interposition
7990 happens for functions the overwritting function will have
7991 precisely same semantics (and side effects). Similarly if interposition happens
7992 for variables, the constructor of the variable will be the same. The flag
7993 has no effect for functions explicitly declared inline, where
7994 interposition changing semantic is never allowed and for symbols explicitly
7995 declared weak.
7997 @item -fshrink-wrap
7998 @opindex fshrink-wrap
7999 Emit function prologues only before parts of the function that need it,
8000 rather than at the top of the function.  This flag is enabled by default at
8001 @option{-O} and higher.
8003 @item -fcaller-saves
8004 @opindex fcaller-saves
8005 Enable allocation of values to registers that are clobbered by
8006 function calls, by emitting extra instructions to save and restore the
8007 registers around such calls.  Such allocation is done only when it
8008 seems to result in better code.
8010 This option is always enabled by default on certain machines, usually
8011 those which have no call-preserved registers to use instead.
8013 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8015 @item -fcombine-stack-adjustments
8016 @opindex fcombine-stack-adjustments
8017 Tracks stack adjustments (pushes and pops) and stack memory references
8018 and then tries to find ways to combine them.
8020 Enabled by default at @option{-O1} and higher.
8022 @item -fuse-caller-save
8023 Use caller save registers for allocation if those registers are not used by
8024 any called function.  In that case it is not necessary to save and restore
8025 them around calls.  This is only possible if called functions are part of
8026 same compilation unit as current function and they are compiled before it.
8028 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8030 @item -fconserve-stack
8031 @opindex fconserve-stack
8032 Attempt to minimize stack usage.  The compiler attempts to use less
8033 stack space, even if that makes the program slower.  This option
8034 implies setting the @option{large-stack-frame} parameter to 100
8035 and the @option{large-stack-frame-growth} parameter to 400.
8037 @item -ftree-reassoc
8038 @opindex ftree-reassoc
8039 Perform reassociation on trees.  This flag is enabled by default
8040 at @option{-O} and higher.
8042 @item -ftree-pre
8043 @opindex ftree-pre
8044 Perform partial redundancy elimination (PRE) on trees.  This flag is
8045 enabled by default at @option{-O2} and @option{-O3}.
8047 @item -ftree-partial-pre
8048 @opindex ftree-partial-pre
8049 Make partial redundancy elimination (PRE) more aggressive.  This flag is
8050 enabled by default at @option{-O3}.
8052 @item -ftree-forwprop
8053 @opindex ftree-forwprop
8054 Perform forward propagation on trees.  This flag is enabled by default
8055 at @option{-O} and higher.
8057 @item -ftree-fre
8058 @opindex ftree-fre
8059 Perform full redundancy elimination (FRE) on trees.  The difference
8060 between FRE and PRE is that FRE only considers expressions
8061 that are computed on all paths leading to the redundant computation.
8062 This analysis is faster than PRE, though it exposes fewer redundancies.
8063 This flag is enabled by default at @option{-O} and higher.
8065 @item -ftree-phiprop
8066 @opindex ftree-phiprop
8067 Perform hoisting of loads from conditional pointers on trees.  This
8068 pass is enabled by default at @option{-O} and higher.
8070 @item -fhoist-adjacent-loads
8071 @opindex hoist-adjacent-loads
8072 Speculatively hoist loads from both branches of an if-then-else if the
8073 loads are from adjacent locations in the same structure and the target
8074 architecture has a conditional move instruction.  This flag is enabled
8075 by default at @option{-O2} and higher.
8077 @item -ftree-copy-prop
8078 @opindex ftree-copy-prop
8079 Perform copy propagation on trees.  This pass eliminates unnecessary
8080 copy operations.  This flag is enabled by default at @option{-O} and
8081 higher.
8083 @item -fipa-pure-const
8084 @opindex fipa-pure-const
8085 Discover which functions are pure or constant.
8086 Enabled by default at @option{-O} and higher.
8088 @item -fipa-reference
8089 @opindex fipa-reference
8090 Discover which static variables do not escape the
8091 compilation unit.
8092 Enabled by default at @option{-O} and higher.
8094 @item -fipa-pta
8095 @opindex fipa-pta
8096 Perform interprocedural pointer analysis and interprocedural modification
8097 and reference analysis.  This option can cause excessive memory and
8098 compile-time usage on large compilation units.  It is not enabled by
8099 default at any optimization level.
8101 @item -fipa-profile
8102 @opindex fipa-profile
8103 Perform interprocedural profile propagation.  The functions called only from
8104 cold functions are marked as cold. Also functions executed once (such as
8105 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
8106 functions and loop less parts of functions executed once are then optimized for
8107 size.
8108 Enabled by default at @option{-O} and higher.
8110 @item -fipa-cp
8111 @opindex fipa-cp
8112 Perform interprocedural constant propagation.
8113 This optimization analyzes the program to determine when values passed
8114 to functions are constants and then optimizes accordingly.
8115 This optimization can substantially increase performance
8116 if the application has constants passed to functions.
8117 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
8119 @item -fipa-cp-clone
8120 @opindex fipa-cp-clone
8121 Perform function cloning to make interprocedural constant propagation stronger.
8122 When enabled, interprocedural constant propagation performs function cloning
8123 when externally visible function can be called with constant arguments.
8124 Because this optimization can create multiple copies of functions,
8125 it may significantly increase code size
8126 (see @option{--param ipcp-unit-growth=@var{value}}).
8127 This flag is enabled by default at @option{-O3}.
8129 @item -fipa-icf
8130 @opindex fipa-icf
8131 Perform Identical Code Folding for functions and read-only variables.
8132 The optimization reduces code size and may disturb unwind stacks by replacing
8133 a function by equivalent one with a different name. The optimization works
8134 more effectively with link time optimization enabled.
8136 Nevertheless the behavior is similar to Gold Linker ICF optimization, GCC ICF
8137 works on different levels and thus the optimizations are not same - there are
8138 equivalences that are found only by GCC and equivalences found only by Gold.
8140 This flag is enabled by default at @option{-O2} and @option{-Os}.
8142 @item -fisolate-erroneous-paths-dereference
8143 Detect paths which trigger erroneous or undefined behaviour due to
8144 dereferencing a NULL pointer.  Isolate those paths from the main control
8145 flow and turn the statement with erroneous or undefined behaviour into a trap.
8147 @item -fisolate-erroneous-paths-attribute
8148 Detect paths which trigger erroneous or undefined behaviour due a NULL value
8149 being used in a way which is forbidden by a @code{returns_nonnull} or @code{nonnull}
8150 attribute.  Isolate those paths from the main control flow and turn the
8151 statement with erroneous or undefined behaviour into a trap.  This is not
8152 currently enabled, but may be enabled by @code{-O2} in the future.
8154 @item -ftree-sink
8155 @opindex ftree-sink
8156 Perform forward store motion  on trees.  This flag is
8157 enabled by default at @option{-O} and higher.
8159 @item -ftree-bit-ccp
8160 @opindex ftree-bit-ccp
8161 Perform sparse conditional bit constant propagation on trees and propagate
8162 pointer alignment information.
8163 This pass only operates on local scalar variables and is enabled by default
8164 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
8166 @item -ftree-ccp
8167 @opindex ftree-ccp
8168 Perform sparse conditional constant propagation (CCP) on trees.  This
8169 pass only operates on local scalar variables and is enabled by default
8170 at @option{-O} and higher.
8172 @item -fssa-phiopt
8173 @opindex fssa-phiopt
8174 Perform pattern matching on SSA PHI nodes to optimize conditional
8175 code.  This pass is enabled by default at @option{-O} and higher.
8177 @item -ftree-switch-conversion
8178 Perform conversion of simple initializations in a switch to
8179 initializations from a scalar array.  This flag is enabled by default
8180 at @option{-O2} and higher.
8182 @item -ftree-tail-merge
8183 Look for identical code sequences.  When found, replace one with a jump to the
8184 other.  This optimization is known as tail merging or cross jumping.  This flag
8185 is enabled by default at @option{-O2} and higher.  The compilation time
8186 in this pass can
8187 be limited using @option{max-tail-merge-comparisons} parameter and
8188 @option{max-tail-merge-iterations} parameter.
8190 @item -ftree-dce
8191 @opindex ftree-dce
8192 Perform dead code elimination (DCE) on trees.  This flag is enabled by
8193 default at @option{-O} and higher.
8195 @item -ftree-builtin-call-dce
8196 @opindex ftree-builtin-call-dce
8197 Perform conditional dead code elimination (DCE) for calls to built-in functions
8198 that may set @code{errno} but are otherwise side-effect free.  This flag is
8199 enabled by default at @option{-O2} and higher if @option{-Os} is not also
8200 specified.
8202 @item -ftree-dominator-opts
8203 @opindex ftree-dominator-opts
8204 Perform a variety of simple scalar cleanups (constant/copy
8205 propagation, redundancy elimination, range propagation and expression
8206 simplification) based on a dominator tree traversal.  This also
8207 performs jump threading (to reduce jumps to jumps). This flag is
8208 enabled by default at @option{-O} and higher.
8210 @item -ftree-dse
8211 @opindex ftree-dse
8212 Perform dead store elimination (DSE) on trees.  A dead store is a store into
8213 a memory location that is later overwritten by another store without
8214 any intervening loads.  In this case the earlier store can be deleted.  This
8215 flag is enabled by default at @option{-O} and higher.
8217 @item -ftree-ch
8218 @opindex ftree-ch
8219 Perform loop header copying on trees.  This is beneficial since it increases
8220 effectiveness of code motion optimizations.  It also saves one jump.  This flag
8221 is enabled by default at @option{-O} and higher.  It is not enabled
8222 for @option{-Os}, since it usually increases code size.
8224 @item -ftree-loop-optimize
8225 @opindex ftree-loop-optimize
8226 Perform loop optimizations on trees.  This flag is enabled by default
8227 at @option{-O} and higher.
8229 @item -ftree-loop-linear
8230 @opindex ftree-loop-linear
8231 Perform loop interchange transformations on tree.  Same as
8232 @option{-floop-interchange}.  To use this code transformation, GCC has
8233 to be configured with @option{--with-ppl} and @option{--with-cloog} to
8234 enable the Graphite loop transformation infrastructure.
8236 @item -floop-interchange
8237 @opindex floop-interchange
8238 Perform loop interchange transformations on loops.  Interchanging two
8239 nested loops switches the inner and outer loops.  For example, given a
8240 loop like:
8241 @smallexample
8242 DO J = 1, M
8243   DO I = 1, N
8244     A(J, I) = A(J, I) * C
8245   ENDDO
8246 ENDDO
8247 @end smallexample
8248 loop interchange transforms the loop as if it were written:
8249 @smallexample
8250 DO I = 1, N
8251   DO J = 1, M
8252     A(J, I) = A(J, I) * C
8253   ENDDO
8254 ENDDO
8255 @end smallexample
8256 which can be beneficial when @code{N} is larger than the caches,
8257 because in Fortran, the elements of an array are stored in memory
8258 contiguously by column, and the original loop iterates over rows,
8259 potentially creating at each access a cache miss.  This optimization
8260 applies to all the languages supported by GCC and is not limited to
8261 Fortran.  To use this code transformation, GCC has to be configured
8262 with @option{--with-ppl} and @option{--with-cloog} to enable the
8263 Graphite loop transformation infrastructure.
8265 @item -floop-strip-mine
8266 @opindex floop-strip-mine
8267 Perform loop strip mining transformations on loops.  Strip mining
8268 splits a loop into two nested loops.  The outer loop has strides
8269 equal to the strip size and the inner loop has strides of the
8270 original loop within a strip.  The strip length can be changed
8271 using the @option{loop-block-tile-size} parameter.  For example,
8272 given a loop like:
8273 @smallexample
8274 DO I = 1, N
8275   A(I) = A(I) + C
8276 ENDDO
8277 @end smallexample
8278 loop strip mining transforms the loop as if it were written:
8279 @smallexample
8280 DO II = 1, N, 51
8281   DO I = II, min (II + 50, N)
8282     A(I) = A(I) + C
8283   ENDDO
8284 ENDDO
8285 @end smallexample
8286 This optimization applies to all the languages supported by GCC and is
8287 not limited to Fortran.  To use this code transformation, GCC has to
8288 be configured with @option{--with-ppl} and @option{--with-cloog} to
8289 enable the Graphite loop transformation infrastructure.
8291 @item -floop-block
8292 @opindex floop-block
8293 Perform loop blocking transformations on loops.  Blocking strip mines
8294 each loop in the loop nest such that the memory accesses of the
8295 element loops fit inside caches.  The strip length can be changed
8296 using the @option{loop-block-tile-size} parameter.  For example, given
8297 a loop like:
8298 @smallexample
8299 DO I = 1, N
8300   DO J = 1, M
8301     A(J, I) = B(I) + C(J)
8302   ENDDO
8303 ENDDO
8304 @end smallexample
8305 loop blocking transforms the loop as if it were written:
8306 @smallexample
8307 DO II = 1, N, 51
8308   DO JJ = 1, M, 51
8309     DO I = II, min (II + 50, N)
8310       DO J = JJ, min (JJ + 50, M)
8311         A(J, I) = B(I) + C(J)
8312       ENDDO
8313     ENDDO
8314   ENDDO
8315 ENDDO
8316 @end smallexample
8317 which can be beneficial when @code{M} is larger than the caches,
8318 because the innermost loop iterates over a smaller amount of data
8319 which can be kept in the caches.  This optimization applies to all the
8320 languages supported by GCC and is not limited to Fortran.  To use this
8321 code transformation, GCC has to be configured with @option{--with-ppl}
8322 and @option{--with-cloog} to enable the Graphite loop transformation
8323 infrastructure.
8325 @item -fgraphite-identity
8326 @opindex fgraphite-identity
8327 Enable the identity transformation for graphite.  For every SCoP we generate
8328 the polyhedral representation and transform it back to gimple.  Using
8329 @option{-fgraphite-identity} we can check the costs or benefits of the
8330 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
8331 are also performed by the code generator CLooG, like index splitting and
8332 dead code elimination in loops.
8334 @item -floop-nest-optimize
8335 @opindex floop-nest-optimize
8336 Enable the ISL based loop nest optimizer.  This is a generic loop nest
8337 optimizer based on the Pluto optimization algorithms.  It calculates a loop
8338 structure optimized for data-locality and parallelism.  This option
8339 is experimental.
8341 @item -floop-parallelize-all
8342 @opindex floop-parallelize-all
8343 Use the Graphite data dependence analysis to identify loops that can
8344 be parallelized.  Parallelize all the loops that can be analyzed to
8345 not contain loop carried dependences without checking that it is
8346 profitable to parallelize the loops.
8348 @item -fcheck-data-deps
8349 @opindex fcheck-data-deps
8350 Compare the results of several data dependence analyzers.  This option
8351 is used for debugging the data dependence analyzers.
8353 @item -ftree-loop-if-convert
8354 Attempt to transform conditional jumps in the innermost loops to
8355 branch-less equivalents.  The intent is to remove control-flow from
8356 the innermost loops in order to improve the ability of the
8357 vectorization pass to handle these loops.  This is enabled by default
8358 if vectorization is enabled.
8360 @item -ftree-loop-if-convert-stores
8361 Attempt to also if-convert conditional jumps containing memory writes.
8362 This transformation can be unsafe for multi-threaded programs as it
8363 transforms conditional memory writes into unconditional memory writes.
8364 For example,
8365 @smallexample
8366 for (i = 0; i < N; i++)
8367   if (cond)
8368     A[i] = expr;
8369 @end smallexample
8370 is transformed to
8371 @smallexample
8372 for (i = 0; i < N; i++)
8373   A[i] = cond ? expr : A[i];
8374 @end smallexample
8375 potentially producing data races.
8377 @item -ftree-loop-distribution
8378 Perform loop distribution.  This flag can improve cache performance on
8379 big loop bodies and allow further loop optimizations, like
8380 parallelization or vectorization, to take place.  For example, the loop
8381 @smallexample
8382 DO I = 1, N
8383   A(I) = B(I) + C
8384   D(I) = E(I) * F
8385 ENDDO
8386 @end smallexample
8387 is transformed to
8388 @smallexample
8389 DO I = 1, N
8390    A(I) = B(I) + C
8391 ENDDO
8392 DO I = 1, N
8393    D(I) = E(I) * F
8394 ENDDO
8395 @end smallexample
8397 @item -ftree-loop-distribute-patterns
8398 Perform loop distribution of patterns that can be code generated with
8399 calls to a library.  This flag is enabled by default at @option{-O3}.
8401 This pass distributes the initialization loops and generates a call to
8402 memset zero.  For example, the loop
8403 @smallexample
8404 DO I = 1, N
8405   A(I) = 0
8406   B(I) = A(I) + I
8407 ENDDO
8408 @end smallexample
8409 is transformed to
8410 @smallexample
8411 DO I = 1, N
8412    A(I) = 0
8413 ENDDO
8414 DO I = 1, N
8415    B(I) = A(I) + I
8416 ENDDO
8417 @end smallexample
8418 and the initialization loop is transformed into a call to memset zero.
8420 @item -ftree-loop-im
8421 @opindex ftree-loop-im
8422 Perform loop invariant motion on trees.  This pass moves only invariants that
8423 are hard to handle at RTL level (function calls, operations that expand to
8424 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
8425 operands of conditions that are invariant out of the loop, so that we can use
8426 just trivial invariantness analysis in loop unswitching.  The pass also includes
8427 store motion.
8429 @item -ftree-loop-ivcanon
8430 @opindex ftree-loop-ivcanon
8431 Create a canonical counter for number of iterations in loops for which
8432 determining number of iterations requires complicated analysis.  Later
8433 optimizations then may determine the number easily.  Useful especially
8434 in connection with unrolling.
8436 @item -fivopts
8437 @opindex fivopts
8438 Perform induction variable optimizations (strength reduction, induction
8439 variable merging and induction variable elimination) on trees.
8441 @item -ftree-parallelize-loops=n
8442 @opindex ftree-parallelize-loops
8443 Parallelize loops, i.e., split their iteration space to run in n threads.
8444 This is only possible for loops whose iterations are independent
8445 and can be arbitrarily reordered.  The optimization is only
8446 profitable on multiprocessor machines, for loops that are CPU-intensive,
8447 rather than constrained e.g.@: by memory bandwidth.  This option
8448 implies @option{-pthread}, and thus is only supported on targets
8449 that have support for @option{-pthread}.
8451 @item -ftree-pta
8452 @opindex ftree-pta
8453 Perform function-local points-to analysis on trees.  This flag is
8454 enabled by default at @option{-O} and higher.
8456 @item -ftree-sra
8457 @opindex ftree-sra
8458 Perform scalar replacement of aggregates.  This pass replaces structure
8459 references with scalars to prevent committing structures to memory too
8460 early.  This flag is enabled by default at @option{-O} and higher.
8462 @item -ftree-copyrename
8463 @opindex ftree-copyrename
8464 Perform copy renaming on trees.  This pass attempts to rename compiler
8465 temporaries to other variables at copy locations, usually resulting in
8466 variable names which more closely resemble the original variables.  This flag
8467 is enabled by default at @option{-O} and higher.
8469 @item -ftree-coalesce-inlined-vars
8470 @opindex ftree-coalesce-inlined-vars
8471 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
8472 combine small user-defined variables too, but only if they were inlined
8473 from other functions.  It is a more limited form of
8474 @option{-ftree-coalesce-vars}.  This may harm debug information of such
8475 inlined variables, but it will keep variables of the inlined-into
8476 function apart from each other, such that they are more likely to
8477 contain the expected values in a debugging session.  This was the
8478 default in GCC versions older than 4.7.
8480 @item -ftree-coalesce-vars
8481 @opindex ftree-coalesce-vars
8482 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
8483 combine small user-defined variables too, instead of just compiler
8484 temporaries.  This may severely limit the ability to debug an optimized
8485 program compiled with @option{-fno-var-tracking-assignments}.  In the
8486 negated form, this flag prevents SSA coalescing of user variables,
8487 including inlined ones.  This option is enabled by default.
8489 @item -ftree-ter
8490 @opindex ftree-ter
8491 Perform temporary expression replacement during the SSA->normal phase.  Single
8492 use/single def temporaries are replaced at their use location with their
8493 defining expression.  This results in non-GIMPLE code, but gives the expanders
8494 much more complex trees to work on resulting in better RTL generation.  This is
8495 enabled by default at @option{-O} and higher.
8497 @item -ftree-slsr
8498 @opindex ftree-slsr
8499 Perform straight-line strength reduction on trees.  This recognizes related
8500 expressions involving multiplications and replaces them by less expensive
8501 calculations when possible.  This is enabled by default at @option{-O} and
8502 higher.
8504 @item -ftree-vectorize
8505 @opindex ftree-vectorize
8506 Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
8507 and @option{-ftree-slp-vectorize} if not explicitly specified.
8509 @item -ftree-loop-vectorize
8510 @opindex ftree-loop-vectorize
8511 Perform loop vectorization on trees. This flag is enabled by default at
8512 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8514 @item -ftree-slp-vectorize
8515 @opindex ftree-slp-vectorize
8516 Perform basic block vectorization on trees. This flag is enabled by default at
8517 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8519 @item -fvect-cost-model=@var{model}
8520 @opindex fvect-cost-model
8521 Alter the cost model used for vectorization.  The @var{model} argument
8522 should be one of @code{unlimited}, @code{dynamic} or @code{cheap}.
8523 With the @code{unlimited} model the vectorized code-path is assumed
8524 to be profitable while with the @code{dynamic} model a runtime check
8525 will guard the vectorized code-path to enable it only for iteration
8526 counts that will likely execute faster than when executing the original
8527 scalar loop.  The @code{cheap} model will disable vectorization of
8528 loops where doing so would be cost prohibitive for example due to
8529 required runtime checks for data dependence or alignment but otherwise
8530 is equal to the @code{dynamic} model.
8531 The default cost model depends on other optimization flags and is
8532 either @code{dynamic} or @code{cheap}.
8534 @item -fsimd-cost-model=@var{model}
8535 @opindex fsimd-cost-model
8536 Alter the cost model used for vectorization of loops marked with the OpenMP
8537 or Cilk Plus simd directive.  The @var{model} argument should be one of
8538 @code{unlimited}, @code{dynamic}, @code{cheap}.  All values of @var{model}
8539 have the same meaning as described in @option{-fvect-cost-model} and by
8540 default a cost model defined with @option{-fvect-cost-model} is used.
8542 @item -ftree-vrp
8543 @opindex ftree-vrp
8544 Perform Value Range Propagation on trees.  This is similar to the
8545 constant propagation pass, but instead of values, ranges of values are
8546 propagated.  This allows the optimizers to remove unnecessary range
8547 checks like array bound checks and null pointer checks.  This is
8548 enabled by default at @option{-O2} and higher.  Null pointer check
8549 elimination is only done if @option{-fdelete-null-pointer-checks} is
8550 enabled.
8552 @item -ftracer
8553 @opindex ftracer
8554 Perform tail duplication to enlarge superblock size.  This transformation
8555 simplifies the control flow of the function allowing other optimizations to do
8556 a better job.
8558 @item -funroll-loops
8559 @opindex funroll-loops
8560 Unroll loops whose number of iterations can be determined at compile
8561 time or upon entry to the loop.  @option{-funroll-loops} implies
8562 @option{-frerun-cse-after-loop}.  This option makes code larger,
8563 and may or may not make it run faster.
8565 @item -funroll-all-loops
8566 @opindex funroll-all-loops
8567 Unroll all loops, even if their number of iterations is uncertain when
8568 the loop is entered.  This usually makes programs run more slowly.
8569 @option{-funroll-all-loops} implies the same options as
8570 @option{-funroll-loops},
8572 @item -fsplit-ivs-in-unroller
8573 @opindex fsplit-ivs-in-unroller
8574 Enables expression of values of induction variables in later iterations
8575 of the unrolled loop using the value in the first iteration.  This breaks
8576 long dependency chains, thus improving efficiency of the scheduling passes.
8578 A combination of @option{-fweb} and CSE is often sufficient to obtain the
8579 same effect.  However, that is not reliable in cases where the loop body
8580 is more complicated than a single basic block.  It also does not work at all
8581 on some architectures due to restrictions in the CSE pass.
8583 This optimization is enabled by default.
8585 @item -fvariable-expansion-in-unroller
8586 @opindex fvariable-expansion-in-unroller
8587 With this option, the compiler creates multiple copies of some
8588 local variables when unrolling a loop, which can result in superior code.
8590 @item -fpartial-inlining
8591 @opindex fpartial-inlining
8592 Inline parts of functions.  This option has any effect only
8593 when inlining itself is turned on by the @option{-finline-functions}
8594 or @option{-finline-small-functions} options.
8596 Enabled at level @option{-O2}.
8598 @item -fpredictive-commoning
8599 @opindex fpredictive-commoning
8600 Perform predictive commoning optimization, i.e., reusing computations
8601 (especially memory loads and stores) performed in previous
8602 iterations of loops.
8604 This option is enabled at level @option{-O3}.
8606 @item -fprefetch-loop-arrays
8607 @opindex fprefetch-loop-arrays
8608 If supported by the target machine, generate instructions to prefetch
8609 memory to improve the performance of loops that access large arrays.
8611 This option may generate better or worse code; results are highly
8612 dependent on the structure of loops within the source code.
8614 Disabled at level @option{-Os}.
8616 @item -fno-peephole
8617 @itemx -fno-peephole2
8618 @opindex fno-peephole
8619 @opindex fno-peephole2
8620 Disable any machine-specific peephole optimizations.  The difference
8621 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
8622 are implemented in the compiler; some targets use one, some use the
8623 other, a few use both.
8625 @option{-fpeephole} is enabled by default.
8626 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8628 @item -fno-guess-branch-probability
8629 @opindex fno-guess-branch-probability
8630 Do not guess branch probabilities using heuristics.
8632 GCC uses heuristics to guess branch probabilities if they are
8633 not provided by profiling feedback (@option{-fprofile-arcs}).  These
8634 heuristics are based on the control flow graph.  If some branch probabilities
8635 are specified by @samp{__builtin_expect}, then the heuristics are
8636 used to guess branch probabilities for the rest of the control flow graph,
8637 taking the @samp{__builtin_expect} info into account.  The interactions
8638 between the heuristics and @samp{__builtin_expect} can be complex, and in
8639 some cases, it may be useful to disable the heuristics so that the effects
8640 of @samp{__builtin_expect} are easier to understand.
8642 The default is @option{-fguess-branch-probability} at levels
8643 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8645 @item -freorder-blocks
8646 @opindex freorder-blocks
8647 Reorder basic blocks in the compiled function in order to reduce number of
8648 taken branches and improve code locality.
8650 Enabled at levels @option{-O2}, @option{-O3}.
8652 @item -freorder-blocks-and-partition
8653 @opindex freorder-blocks-and-partition
8654 In addition to reordering basic blocks in the compiled function, in order
8655 to reduce number of taken branches, partitions hot and cold basic blocks
8656 into separate sections of the assembly and .o files, to improve
8657 paging and cache locality performance.
8659 This optimization is automatically turned off in the presence of
8660 exception handling, for linkonce sections, for functions with a user-defined
8661 section attribute and on any architecture that does not support named
8662 sections.
8664 Enabled for x86 at levels @option{-O2}, @option{-O3}.
8666 @item -freorder-functions
8667 @opindex freorder-functions
8668 Reorder functions in the object file in order to
8669 improve code locality.  This is implemented by using special
8670 subsections @code{.text.hot} for most frequently executed functions and
8671 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
8672 the linker so object file format must support named sections and linker must
8673 place them in a reasonable way.
8675 Also profile feedback must be available to make this option effective.  See
8676 @option{-fprofile-arcs} for details.
8678 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8680 @item -fstrict-aliasing
8681 @opindex fstrict-aliasing
8682 Allow the compiler to assume the strictest aliasing rules applicable to
8683 the language being compiled.  For C (and C++), this activates
8684 optimizations based on the type of expressions.  In particular, an
8685 object of one type is assumed never to reside at the same address as an
8686 object of a different type, unless the types are almost the same.  For
8687 example, an @code{unsigned int} can alias an @code{int}, but not a
8688 @code{void*} or a @code{double}.  A character type may alias any other
8689 type.
8691 @anchor{Type-punning}Pay special attention to code like this:
8692 @smallexample
8693 union a_union @{
8694   int i;
8695   double d;
8698 int f() @{
8699   union a_union t;
8700   t.d = 3.0;
8701   return t.i;
8703 @end smallexample
8704 The practice of reading from a different union member than the one most
8705 recently written to (called ``type-punning'') is common.  Even with
8706 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
8707 is accessed through the union type.  So, the code above works as
8708 expected.  @xref{Structures unions enumerations and bit-fields
8709 implementation}.  However, this code might not:
8710 @smallexample
8711 int f() @{
8712   union a_union t;
8713   int* ip;
8714   t.d = 3.0;
8715   ip = &t.i;
8716   return *ip;
8718 @end smallexample
8720 Similarly, access by taking the address, casting the resulting pointer
8721 and dereferencing the result has undefined behavior, even if the cast
8722 uses a union type, e.g.:
8723 @smallexample
8724 int f() @{
8725   double d = 3.0;
8726   return ((union a_union *) &d)->i;
8728 @end smallexample
8730 The @option{-fstrict-aliasing} option is enabled at levels
8731 @option{-O2}, @option{-O3}, @option{-Os}.
8733 @item -fstrict-overflow
8734 @opindex fstrict-overflow
8735 Allow the compiler to assume strict signed overflow rules, depending
8736 on the language being compiled.  For C (and C++) this means that
8737 overflow when doing arithmetic with signed numbers is undefined, which
8738 means that the compiler may assume that it does not happen.  This
8739 permits various optimizations.  For example, the compiler assumes
8740 that an expression like @code{i + 10 > i} is always true for
8741 signed @code{i}.  This assumption is only valid if signed overflow is
8742 undefined, as the expression is false if @code{i + 10} overflows when
8743 using twos complement arithmetic.  When this option is in effect any
8744 attempt to determine whether an operation on signed numbers 
8745 overflows must be written carefully to not actually involve overflow.
8747 This option also allows the compiler to assume strict pointer
8748 semantics: given a pointer to an object, if adding an offset to that
8749 pointer does not produce a pointer to the same object, the addition is
8750 undefined.  This permits the compiler to conclude that @code{p + u >
8751 p} is always true for a pointer @code{p} and unsigned integer
8752 @code{u}.  This assumption is only valid because pointer wraparound is
8753 undefined, as the expression is false if @code{p + u} overflows using
8754 twos complement arithmetic.
8756 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
8757 that integer signed overflow is fully defined: it wraps.  When
8758 @option{-fwrapv} is used, there is no difference between
8759 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
8760 integers.  With @option{-fwrapv} certain types of overflow are
8761 permitted.  For example, if the compiler gets an overflow when doing
8762 arithmetic on constants, the overflowed value can still be used with
8763 @option{-fwrapv}, but not otherwise.
8765 The @option{-fstrict-overflow} option is enabled at levels
8766 @option{-O2}, @option{-O3}, @option{-Os}.
8768 @item -falign-functions
8769 @itemx -falign-functions=@var{n}
8770 @opindex falign-functions
8771 Align the start of functions to the next power-of-two greater than
8772 @var{n}, skipping up to @var{n} bytes.  For instance,
8773 @option{-falign-functions=32} aligns functions to the next 32-byte
8774 boundary, but @option{-falign-functions=24} aligns to the next
8775 32-byte boundary only if this can be done by skipping 23 bytes or less.
8777 @option{-fno-align-functions} and @option{-falign-functions=1} are
8778 equivalent and mean that functions are not aligned.
8780 Some assemblers only support this flag when @var{n} is a power of two;
8781 in that case, it is rounded up.
8783 If @var{n} is not specified or is zero, use a machine-dependent default.
8785 Enabled at levels @option{-O2}, @option{-O3}.
8787 @item -falign-labels
8788 @itemx -falign-labels=@var{n}
8789 @opindex falign-labels
8790 Align all branch targets to a power-of-two boundary, skipping up to
8791 @var{n} bytes like @option{-falign-functions}.  This option can easily
8792 make code slower, because it must insert dummy operations for when the
8793 branch target is reached in the usual flow of the code.
8795 @option{-fno-align-labels} and @option{-falign-labels=1} are
8796 equivalent and mean that labels are not aligned.
8798 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
8799 are greater than this value, then their values are used instead.
8801 If @var{n} is not specified or is zero, use a machine-dependent default
8802 which is very likely to be @samp{1}, meaning no alignment.
8804 Enabled at levels @option{-O2}, @option{-O3}.
8806 @item -falign-loops
8807 @itemx -falign-loops=@var{n}
8808 @opindex falign-loops
8809 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
8810 like @option{-falign-functions}.  If the loops are
8811 executed many times, this makes up for any execution of the dummy
8812 operations.
8814 @option{-fno-align-loops} and @option{-falign-loops=1} are
8815 equivalent and mean that loops are not aligned.
8817 If @var{n} is not specified or is zero, use a machine-dependent default.
8819 Enabled at levels @option{-O2}, @option{-O3}.
8821 @item -falign-jumps
8822 @itemx -falign-jumps=@var{n}
8823 @opindex falign-jumps
8824 Align branch targets to a power-of-two boundary, for branch targets
8825 where the targets can only be reached by jumping, skipping up to @var{n}
8826 bytes like @option{-falign-functions}.  In this case, no dummy operations
8827 need be executed.
8829 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
8830 equivalent and mean that loops are not aligned.
8832 If @var{n} is not specified or is zero, use a machine-dependent default.
8834 Enabled at levels @option{-O2}, @option{-O3}.
8836 @item -funit-at-a-time
8837 @opindex funit-at-a-time
8838 This option is left for compatibility reasons. @option{-funit-at-a-time}
8839 has no effect, while @option{-fno-unit-at-a-time} implies
8840 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
8842 Enabled by default.
8844 @item -fno-toplevel-reorder
8845 @opindex fno-toplevel-reorder
8846 Do not reorder top-level functions, variables, and @code{asm}
8847 statements.  Output them in the same order that they appear in the
8848 input file.  When this option is used, unreferenced static variables
8849 are not removed.  This option is intended to support existing code
8850 that relies on a particular ordering.  For new code, it is better to
8851 use attributes when possible.
8853 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
8854 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
8855 targets.
8857 @item -fweb
8858 @opindex fweb
8859 Constructs webs as commonly used for register allocation purposes and assign
8860 each web individual pseudo register.  This allows the register allocation pass
8861 to operate on pseudos directly, but also strengthens several other optimization
8862 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
8863 however, make debugging impossible, since variables no longer stay in a
8864 ``home register''.
8866 Enabled by default with @option{-funroll-loops}.
8868 @item -fwhole-program
8869 @opindex fwhole-program
8870 Assume that the current compilation unit represents the whole program being
8871 compiled.  All public functions and variables with the exception of @code{main}
8872 and those merged by attribute @code{externally_visible} become static functions
8873 and in effect are optimized more aggressively by interprocedural optimizers.
8875 This option should not be used in combination with @code{-flto}.
8876 Instead relying on a linker plugin should provide safer and more precise
8877 information.
8879 @item -flto[=@var{n}]
8880 @opindex flto
8881 This option runs the standard link-time optimizer.  When invoked
8882 with source code, it generates GIMPLE (one of GCC's internal
8883 representations) and writes it to special ELF sections in the object
8884 file.  When the object files are linked together, all the function
8885 bodies are read from these ELF sections and instantiated as if they
8886 had been part of the same translation unit.
8888 To use the link-time optimizer, @option{-flto} and optimization
8889 options should be specified at compile time and during the final link.
8890 For example:
8892 @smallexample
8893 gcc -c -O2 -flto foo.c
8894 gcc -c -O2 -flto bar.c
8895 gcc -o myprog -flto -O2 foo.o bar.o
8896 @end smallexample
8898 The first two invocations to GCC save a bytecode representation
8899 of GIMPLE into special ELF sections inside @file{foo.o} and
8900 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
8901 @file{foo.o} and @file{bar.o}, merges the two files into a single
8902 internal image, and compiles the result as usual.  Since both
8903 @file{foo.o} and @file{bar.o} are merged into a single image, this
8904 causes all the interprocedural analyses and optimizations in GCC to
8905 work across the two files as if they were a single one.  This means,
8906 for example, that the inliner is able to inline functions in
8907 @file{bar.o} into functions in @file{foo.o} and vice-versa.
8909 Another (simpler) way to enable link-time optimization is:
8911 @smallexample
8912 gcc -o myprog -flto -O2 foo.c bar.c
8913 @end smallexample
8915 The above generates bytecode for @file{foo.c} and @file{bar.c},
8916 merges them together into a single GIMPLE representation and optimizes
8917 them as usual to produce @file{myprog}.
8919 The only important thing to keep in mind is that to enable link-time
8920 optimizations you need to use the GCC driver to perform the link-step.
8921 GCC then automatically performs link-time optimization if any of the
8922 objects involved were compiled with the @option{-flto}.  You generally
8923 should specify the optimization options to be used for link-time
8924 optimization though GCC will try to be clever at guessing an
8925 optimization level to use from the options used at compile-time
8926 if you fail to specify one at link-time.  You can always override
8927 the automatic decision to do link-time optimization at link-time
8928 by passing @option{-fno-lto} to the link command.
8930 To make whole program optimization effective, it is necessary to make
8931 certain whole program assumptions.  The compiler needs to know
8932 what functions and variables can be accessed by libraries and runtime
8933 outside of the link-time optimized unit.  When supported by the linker,
8934 the linker plugin (see @option{-fuse-linker-plugin}) passes information
8935 to the compiler about used and externally visible symbols.  When
8936 the linker plugin is not available, @option{-fwhole-program} should be
8937 used to allow the compiler to make these assumptions, which leads
8938 to more aggressive optimization decisions.
8940 When @option{-fuse-linker-plugin} is not enabled then, when a file is
8941 compiled with @option{-flto}, the generated object file is larger than
8942 a regular object file because it contains GIMPLE bytecodes and the usual
8943 final code (see @option{-ffat-lto-objects}.  This means that
8944 object files with LTO information can be linked as normal object
8945 files; if @option{-fno-lto} is passed to the linker, no
8946 interprocedural optimizations are applied.  Note that when
8947 @option{-fno-fat-lto-objects} is enabled the compile-stage is faster
8948 but you cannot perform a regular, non-LTO link on them.
8950 Additionally, the optimization flags used to compile individual files
8951 are not necessarily related to those used at link time.  For instance,
8953 @smallexample
8954 gcc -c -O0 -ffat-lto-objects -flto foo.c
8955 gcc -c -O0 -ffat-lto-objects -flto bar.c
8956 gcc -o myprog -O3 foo.o bar.o
8957 @end smallexample
8959 This produces individual object files with unoptimized assembler
8960 code, but the resulting binary @file{myprog} is optimized at
8961 @option{-O3}.  If, instead, the final binary is generated with
8962 @option{-fno-lto}, then @file{myprog} is not optimized.
8964 When producing the final binary, GCC only
8965 applies link-time optimizations to those files that contain bytecode.
8966 Therefore, you can mix and match object files and libraries with
8967 GIMPLE bytecodes and final object code.  GCC automatically selects
8968 which files to optimize in LTO mode and which files to link without
8969 further processing.
8971 There are some code generation flags preserved by GCC when
8972 generating bytecodes, as they need to be used during the final link
8973 stage.  Generally options specified at link-time override those
8974 specified at compile-time.
8976 If you do not specify an optimization level option @option{-O} at
8977 link-time then GCC will compute one based on the optimization levels
8978 used when compiling the object files.  The highest optimization
8979 level will win here.
8981 Currently, the following options and their setting are take from
8982 the first object file that explicitely specified it: 
8983 @option{-fPIC}, @option{-fpic}, @option{-fpie}, @option{-fcommon},
8984 @option{-fexceptions}, @option{-fnon-call-exceptions}, @option{-fgnu-tm}
8985 and all the @option{-m} target flags.
8987 Certain ABI changing flags are required to match in all compilation-units
8988 and trying to override this at link-time with a conflicting value
8989 is ignored.  This includes options such as @option{-freg-struct-return}
8990 and @option{-fpcc-struct-return}. 
8992 Other options such as @option{-ffp-contract}, @option{-fno-strict-overflow},
8993 @option{-fwrapv}, @option{-fno-trapv} or @option{-fno-strict-aliasing}
8994 are passed through to the link stage and merged conservatively for
8995 conflicting translation units.  Specifically
8996 @option{-fno-strict-overflow}, @option{-fwrapv} and @option{-fno-trapv} take
8997 precedence and for example @option{-ffp-contract=off} takes precedence
8998 over @option{-ffp-contract=fast}.  You can override them at linke-time.
9000 It is recommended that you compile all the files participating in the
9001 same link with the same options and also specify those options at
9002 link time.
9004 If LTO encounters objects with C linkage declared with incompatible
9005 types in separate translation units to be linked together (undefined
9006 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
9007 issued.  The behavior is still undefined at run time.  Similar
9008 diagnostics may be raised for other languages.
9010 Another feature of LTO is that it is possible to apply interprocedural
9011 optimizations on files written in different languages:
9013 @smallexample
9014 gcc -c -flto foo.c
9015 g++ -c -flto bar.cc
9016 gfortran -c -flto baz.f90
9017 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
9018 @end smallexample
9020 Notice that the final link is done with @command{g++} to get the C++
9021 runtime libraries and @option{-lgfortran} is added to get the Fortran
9022 runtime libraries.  In general, when mixing languages in LTO mode, you
9023 should use the same link command options as when mixing languages in a
9024 regular (non-LTO) compilation.
9026 If object files containing GIMPLE bytecode are stored in a library archive, say
9027 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
9028 are using a linker with plugin support.  To create static libraries suitable
9029 for LTO, use @command{gcc-ar} and @command{gcc-ranlib} instead of @command{ar}
9030 and @code{ranlib}; to show the symbols of object files with GIMPLE bytecode, use
9031 @command{gcc-nm}.  Those commands require that @command{ar}, @command{ranlib}
9032 and @command{nm} have been compiled with plugin support.  At link time, use the the
9033 flag @option{-fuse-linker-plugin} to ensure that the library participates in
9034 the LTO optimization process:
9036 @smallexample
9037 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
9038 @end smallexample
9040 With the linker plugin enabled, the linker extracts the needed
9041 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
9042 to make them part of the aggregated GIMPLE image to be optimized.
9044 If you are not using a linker with plugin support and/or do not
9045 enable the linker plugin, then the objects inside @file{libfoo.a}
9046 are extracted and linked as usual, but they do not participate
9047 in the LTO optimization process.  In order to make a static library suitable
9048 for both LTO optimization and usual linkage, compile its object files with
9049 @option{-flto} @code{-ffat-lto-objects}.
9051 Link-time optimizations do not require the presence of the whole program to
9052 operate.  If the program does not require any symbols to be exported, it is
9053 possible to combine @option{-flto} and @option{-fwhole-program} to allow
9054 the interprocedural optimizers to use more aggressive assumptions which may
9055 lead to improved optimization opportunities.
9056 Use of @option{-fwhole-program} is not needed when linker plugin is
9057 active (see @option{-fuse-linker-plugin}).
9059 The current implementation of LTO makes no
9060 attempt to generate bytecode that is portable between different
9061 types of hosts.  The bytecode files are versioned and there is a
9062 strict version check, so bytecode files generated in one version of
9063 GCC will not work with an older or newer version of GCC.
9065 Link-time optimization does not work well with generation of debugging
9066 information.  Combining @option{-flto} with
9067 @option{-g} is currently experimental and expected to produce unexpected
9068 results.
9070 If you specify the optional @var{n}, the optimization and code
9071 generation done at link time is executed in parallel using @var{n}
9072 parallel jobs by utilizing an installed @command{make} program.  The
9073 environment variable @env{MAKE} may be used to override the program
9074 used.  The default value for @var{n} is 1.
9076 You can also specify @option{-flto=jobserver} to use GNU make's
9077 job server mode to determine the number of parallel jobs. This
9078 is useful when the Makefile calling GCC is already executing in parallel.
9079 You must prepend a @samp{+} to the command recipe in the parent Makefile
9080 for this to work.  This option likely only works if @env{MAKE} is
9081 GNU make.
9083 @item -flto-partition=@var{alg}
9084 @opindex flto-partition
9085 Specify the partitioning algorithm used by the link-time optimizer.
9086 The value is either @code{1to1} to specify a partitioning mirroring
9087 the original source files or @code{balanced} to specify partitioning
9088 into equally sized chunks (whenever possible) or @code{max} to create
9089 new partition for every symbol where possible.  Specifying @code{none}
9090 as an algorithm disables partitioning and streaming completely. 
9091 The default value is @code{balanced}. While @code{1to1} can be used
9092 as an workaround for various code ordering issues, the @code{max}
9093 partitioning is intended for internal testing only.
9094 The value @code{one} specifies that exactly one partition should be
9095 used while the value @code{none} bypasses partitioning and executes
9096 the link-time optimization step directly from the WPA phase.
9098 @item -flto-odr-type-merging
9099 @opindex flto-odr-type-merging
9100 Enable streaming of mangled types names of C++ types and their unification
9101 at linktime.  This increases size of LTO object files, but enable
9102 diagnostics about One Definition Rule violations.
9104 @item -flto-compression-level=@var{n}
9105 This option specifies the level of compression used for intermediate
9106 language written to LTO object files, and is only meaningful in
9107 conjunction with LTO mode (@option{-flto}).  Valid
9108 values are 0 (no compression) to 9 (maximum compression).  Values
9109 outside this range are clamped to either 0 or 9.  If the option is not
9110 given, a default balanced compression setting is used.
9112 @item -flto-report
9113 Prints a report with internal details on the workings of the link-time
9114 optimizer.  The contents of this report vary from version to version.
9115 It is meant to be useful to GCC developers when processing object
9116 files in LTO mode (via @option{-flto}).
9118 Disabled by default.
9120 @item -flto-report-wpa
9121 Like @option{-flto-report}, but only print for the WPA phase of Link
9122 Time Optimization.
9124 @item -fuse-linker-plugin
9125 Enables the use of a linker plugin during link-time optimization.  This
9126 option relies on plugin support in the linker, which is available in gold
9127 or in GNU ld 2.21 or newer.
9129 This option enables the extraction of object files with GIMPLE bytecode out
9130 of library archives. This improves the quality of optimization by exposing
9131 more code to the link-time optimizer.  This information specifies what
9132 symbols can be accessed externally (by non-LTO object or during dynamic
9133 linking).  Resulting code quality improvements on binaries (and shared
9134 libraries that use hidden visibility) are similar to @code{-fwhole-program}.
9135 See @option{-flto} for a description of the effect of this flag and how to
9136 use it.
9138 This option is enabled by default when LTO support in GCC is enabled
9139 and GCC was configured for use with
9140 a linker supporting plugins (GNU ld 2.21 or newer or gold).
9142 @item -ffat-lto-objects
9143 @opindex ffat-lto-objects
9144 Fat LTO objects are object files that contain both the intermediate language
9145 and the object code. This makes them usable for both LTO linking and normal
9146 linking. This option is effective only when compiling with @option{-flto}
9147 and is ignored at link time.
9149 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
9150 requires the complete toolchain to be aware of LTO. It requires a linker with
9151 linker plugin support for basic functionality.  Additionally,
9152 @command{nm}, @command{ar} and @command{ranlib}
9153 need to support linker plugins to allow a full-featured build environment
9154 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
9155 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
9156 to these tools. With non fat LTO makefiles need to be modified to use them.
9158 The default is @option{-fno-fat-lto-objects} on targets with linker plugin
9159 support.
9161 @item -fcompare-elim
9162 @opindex fcompare-elim
9163 After register allocation and post-register allocation instruction splitting,
9164 identify arithmetic instructions that compute processor flags similar to a
9165 comparison operation based on that arithmetic.  If possible, eliminate the
9166 explicit comparison operation.
9168 This pass only applies to certain targets that cannot explicitly represent
9169 the comparison operation before register allocation is complete.
9171 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9173 @item -fuse-ld=bfd
9174 @opindex fuse-ld=bfd
9175 Use the @command{bfd} linker instead of the default linker.
9177 @item -fuse-ld=gold
9178 @opindex fuse-ld=gold
9179 Use the @command{gold} linker instead of the default linker.
9181 @item -fcprop-registers
9182 @opindex fcprop-registers
9183 After register allocation and post-register allocation instruction splitting,
9184 perform a copy-propagation pass to try to reduce scheduling dependencies
9185 and occasionally eliminate the copy.
9187 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9189 @item -fprofile-correction
9190 @opindex fprofile-correction
9191 Profiles collected using an instrumented binary for multi-threaded programs may
9192 be inconsistent due to missed counter updates. When this option is specified,
9193 GCC uses heuristics to correct or smooth out such inconsistencies. By
9194 default, GCC emits an error message when an inconsistent profile is detected.
9196 @item -fprofile-dir=@var{path}
9197 @opindex fprofile-dir
9199 Set the directory to search for the profile data files in to @var{path}.
9200 This option affects only the profile data generated by
9201 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
9202 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
9203 and its related options.  Both absolute and relative paths can be used.
9204 By default, GCC uses the current directory as @var{path}, thus the
9205 profile data file appears in the same directory as the object file.
9207 @item -fprofile-generate
9208 @itemx -fprofile-generate=@var{path}
9209 @opindex fprofile-generate
9211 Enable options usually used for instrumenting application to produce
9212 profile useful for later recompilation with profile feedback based
9213 optimization.  You must use @option{-fprofile-generate} both when
9214 compiling and when linking your program.
9216 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
9218 If @var{path} is specified, GCC looks at the @var{path} to find
9219 the profile feedback data files. See @option{-fprofile-dir}.
9221 @item -fprofile-use
9222 @itemx -fprofile-use=@var{path}
9223 @opindex fprofile-use
9224 Enable profile feedback directed optimizations, and optimizations
9225 generally profitable only with profile feedback available.
9227 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
9228 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}, @code{-ftree-vectorize},
9229 @code{ftree-loop-distribute-patterns}
9231 By default, GCC emits an error message if the feedback profiles do not
9232 match the source code.  This error can be turned into a warning by using
9233 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
9234 code.
9236 If @var{path} is specified, GCC looks at the @var{path} to find
9237 the profile feedback data files. See @option{-fprofile-dir}.
9239 @item -fauto-profile
9240 @itemx -fauto-profile=@var{path}
9241 @opindex fauto-profile
9242 Enable sampling based feedback directed optimizations, and optimizations
9243 generally profitable only with profile feedback available.
9245 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
9246 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}, @code{-ftree-vectorize},
9247 @code{-finline-functions}, @code{-fipa-cp}, @code{-fipa-cp-clone},
9248 @code{-fpredictive-commoning}, @code{-funswitch-loops},
9249 @code{-fgcse-after-reload}, @code{-ftree-loop-distribute-patterns},
9251 If @var{path} is specified, GCC looks at the @var{path} to find
9252 the profile feedback data files.
9254 In order to collect AutoFDO profile, you need to have:
9256 1. A linux system with linux perf support
9257 2. (optional) An Intel processor with last branch record (LBR) support. This is
9258    to guarantee accurate instruction level profile, which is important for
9259    AutoFDO performance.
9261 To collect the profile, first use linux perf to collect raw profile
9262 (see @uref{https://perf.wiki.kernel.org/}).
9264 E.g.
9265 @code{perf record -e br_inst_retired:near_taken -b -o perf.data -- your_program}
9267 Then use create_gcov tool, which takes raw profile and unstripped binary to
9268 generate AutoFDO profile that can be used by GCC.
9269 (see @uref{https://github.com/google/autofdo}).
9271 E.g.
9272 @code{create_gcov --binary=your_program.unstripped --profile=perf.data --gcov=profile.afdo}
9273 @end table
9275 The following options control compiler behavior regarding floating-point 
9276 arithmetic.  These options trade off between speed and
9277 correctness.  All must be specifically enabled.
9279 @table @gcctabopt
9280 @item -ffloat-store
9281 @opindex ffloat-store
9282 Do not store floating-point variables in registers, and inhibit other
9283 options that might change whether a floating-point value is taken from a
9284 register or memory.
9286 @cindex floating-point precision
9287 This option prevents undesirable excess precision on machines such as
9288 the 68000 where the floating registers (of the 68881) keep more
9289 precision than a @code{double} is supposed to have.  Similarly for the
9290 x86 architecture.  For most programs, the excess precision does only
9291 good, but a few programs rely on the precise definition of IEEE floating
9292 point.  Use @option{-ffloat-store} for such programs, after modifying
9293 them to store all pertinent intermediate computations into variables.
9295 @item -fexcess-precision=@var{style}
9296 @opindex fexcess-precision
9297 This option allows further control over excess precision on machines
9298 where floating-point registers have more precision than the IEEE
9299 @code{float} and @code{double} types and the processor does not
9300 support operations rounding to those types.  By default,
9301 @option{-fexcess-precision=fast} is in effect; this means that
9302 operations are carried out in the precision of the registers and that
9303 it is unpredictable when rounding to the types specified in the source
9304 code takes place.  When compiling C, if
9305 @option{-fexcess-precision=standard} is specified then excess
9306 precision follows the rules specified in ISO C99; in particular,
9307 both casts and assignments cause values to be rounded to their
9308 semantic types (whereas @option{-ffloat-store} only affects
9309 assignments).  This option is enabled by default for C if a strict
9310 conformance option such as @option{-std=c99} is used.
9312 @opindex mfpmath
9313 @option{-fexcess-precision=standard} is not implemented for languages
9314 other than C, and has no effect if
9315 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
9316 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
9317 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
9318 semantics apply without excess precision, and in the latter, rounding
9319 is unpredictable.
9321 @item -ffast-math
9322 @opindex ffast-math
9323 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
9324 @option{-ffinite-math-only}, @option{-fno-rounding-math},
9325 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
9327 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
9329 This option is not turned on by any @option{-O} option besides
9330 @option{-Ofast} since it can result in incorrect output for programs
9331 that depend on an exact implementation of IEEE or ISO rules/specifications
9332 for math functions. It may, however, yield faster code for programs
9333 that do not require the guarantees of these specifications.
9335 @item -fno-math-errno
9336 @opindex fno-math-errno
9337 Do not set @code{errno} after calling math functions that are executed
9338 with a single instruction, e.g., @code{sqrt}.  A program that relies on
9339 IEEE exceptions for math error handling may want to use this flag
9340 for speed while maintaining IEEE arithmetic compatibility.
9342 This option is not turned on by any @option{-O} option since
9343 it can result in incorrect output for programs that depend on
9344 an exact implementation of IEEE or ISO rules/specifications for
9345 math functions. It may, however, yield faster code for programs
9346 that do not require the guarantees of these specifications.
9348 The default is @option{-fmath-errno}.
9350 On Darwin systems, the math library never sets @code{errno}.  There is
9351 therefore no reason for the compiler to consider the possibility that
9352 it might, and @option{-fno-math-errno} is the default.
9354 @item -funsafe-math-optimizations
9355 @opindex funsafe-math-optimizations
9357 Allow optimizations for floating-point arithmetic that (a) assume
9358 that arguments and results are valid and (b) may violate IEEE or
9359 ANSI standards.  When used at link-time, it may include libraries
9360 or startup files that change the default FPU control word or other
9361 similar optimizations.
9363 This option is not turned on by any @option{-O} option since
9364 it can result in incorrect output for programs that depend on
9365 an exact implementation of IEEE or ISO rules/specifications for
9366 math functions. It may, however, yield faster code for programs
9367 that do not require the guarantees of these specifications.
9368 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
9369 @option{-fassociative-math} and @option{-freciprocal-math}.
9371 The default is @option{-fno-unsafe-math-optimizations}.
9373 @item -fassociative-math
9374 @opindex fassociative-math
9376 Allow re-association of operands in series of floating-point operations.
9377 This violates the ISO C and C++ language standard by possibly changing
9378 computation result.  NOTE: re-ordering may change the sign of zero as
9379 well as ignore NaNs and inhibit or create underflow or overflow (and
9380 thus cannot be used on code that relies on rounding behavior like
9381 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
9382 and thus may not be used when ordered comparisons are required.
9383 This option requires that both @option{-fno-signed-zeros} and
9384 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
9385 much sense with @option{-frounding-math}. For Fortran the option
9386 is automatically enabled when both @option{-fno-signed-zeros} and
9387 @option{-fno-trapping-math} are in effect.
9389 The default is @option{-fno-associative-math}.
9391 @item -freciprocal-math
9392 @opindex freciprocal-math
9394 Allow the reciprocal of a value to be used instead of dividing by
9395 the value if this enables optimizations.  For example @code{x / y}
9396 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
9397 is subject to common subexpression elimination.  Note that this loses
9398 precision and increases the number of flops operating on the value.
9400 The default is @option{-fno-reciprocal-math}.
9402 @item -ffinite-math-only
9403 @opindex ffinite-math-only
9404 Allow optimizations for floating-point arithmetic that assume
9405 that arguments and results are not NaNs or +-Infs.
9407 This option is not turned on by any @option{-O} option since
9408 it can result in incorrect output for programs that depend on
9409 an exact implementation of IEEE or ISO rules/specifications for
9410 math functions. It may, however, yield faster code for programs
9411 that do not require the guarantees of these specifications.
9413 The default is @option{-fno-finite-math-only}.
9415 @item -fno-signed-zeros
9416 @opindex fno-signed-zeros
9417 Allow optimizations for floating-point arithmetic that ignore the
9418 signedness of zero.  IEEE arithmetic specifies the behavior of
9419 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
9420 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
9421 This option implies that the sign of a zero result isn't significant.
9423 The default is @option{-fsigned-zeros}.
9425 @item -fno-trapping-math
9426 @opindex fno-trapping-math
9427 Compile code assuming that floating-point operations cannot generate
9428 user-visible traps.  These traps include division by zero, overflow,
9429 underflow, inexact result and invalid operation.  This option requires
9430 that @option{-fno-signaling-nans} be in effect.  Setting this option may
9431 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
9433 This option should never be turned on by any @option{-O} option since
9434 it can result in incorrect output for programs that depend on
9435 an exact implementation of IEEE or ISO rules/specifications for
9436 math functions.
9438 The default is @option{-ftrapping-math}.
9440 @item -frounding-math
9441 @opindex frounding-math
9442 Disable transformations and optimizations that assume default floating-point
9443 rounding behavior.  This is round-to-zero for all floating point
9444 to integer conversions, and round-to-nearest for all other arithmetic
9445 truncations.  This option should be specified for programs that change
9446 the FP rounding mode dynamically, or that may be executed with a
9447 non-default rounding mode.  This option disables constant folding of
9448 floating-point expressions at compile time (which may be affected by
9449 rounding mode) and arithmetic transformations that are unsafe in the
9450 presence of sign-dependent rounding modes.
9452 The default is @option{-fno-rounding-math}.
9454 This option is experimental and does not currently guarantee to
9455 disable all GCC optimizations that are affected by rounding mode.
9456 Future versions of GCC may provide finer control of this setting
9457 using C99's @code{FENV_ACCESS} pragma.  This command-line option
9458 will be used to specify the default state for @code{FENV_ACCESS}.
9460 @item -fsignaling-nans
9461 @opindex fsignaling-nans
9462 Compile code assuming that IEEE signaling NaNs may generate user-visible
9463 traps during floating-point operations.  Setting this option disables
9464 optimizations that may change the number of exceptions visible with
9465 signaling NaNs.  This option implies @option{-ftrapping-math}.
9467 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
9468 be defined.
9470 The default is @option{-fno-signaling-nans}.
9472 This option is experimental and does not currently guarantee to
9473 disable all GCC optimizations that affect signaling NaN behavior.
9475 @item -fsingle-precision-constant
9476 @opindex fsingle-precision-constant
9477 Treat floating-point constants as single precision instead of
9478 implicitly converting them to double-precision constants.
9480 @item -fcx-limited-range
9481 @opindex fcx-limited-range
9482 When enabled, this option states that a range reduction step is not
9483 needed when performing complex division.  Also, there is no checking
9484 whether the result of a complex multiplication or division is @code{NaN
9485 + I*NaN}, with an attempt to rescue the situation in that case.  The
9486 default is @option{-fno-cx-limited-range}, but is enabled by
9487 @option{-ffast-math}.
9489 This option controls the default setting of the ISO C99
9490 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
9491 all languages.
9493 @item -fcx-fortran-rules
9494 @opindex fcx-fortran-rules
9495 Complex multiplication and division follow Fortran rules.  Range
9496 reduction is done as part of complex division, but there is no checking
9497 whether the result of a complex multiplication or division is @code{NaN
9498 + I*NaN}, with an attempt to rescue the situation in that case.
9500 The default is @option{-fno-cx-fortran-rules}.
9502 @end table
9504 The following options control optimizations that may improve
9505 performance, but are not enabled by any @option{-O} options.  This
9506 section includes experimental options that may produce broken code.
9508 @table @gcctabopt
9509 @item -fbranch-probabilities
9510 @opindex fbranch-probabilities
9511 After running a program compiled with @option{-fprofile-arcs}
9512 (@pxref{Debugging Options,, Options for Debugging Your Program or
9513 @command{gcc}}), you can compile it a second time using
9514 @option{-fbranch-probabilities}, to improve optimizations based on
9515 the number of times each branch was taken.  When a program
9516 compiled with @option{-fprofile-arcs} exits, it saves arc execution
9517 counts to a file called @file{@var{sourcename}.gcda} for each source
9518 file.  The information in this data file is very dependent on the
9519 structure of the generated code, so you must use the same source code
9520 and the same optimization options for both compilations.
9522 With @option{-fbranch-probabilities}, GCC puts a
9523 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
9524 These can be used to improve optimization.  Currently, they are only
9525 used in one place: in @file{reorg.c}, instead of guessing which path a
9526 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
9527 exactly determine which path is taken more often.
9529 @item -fprofile-values
9530 @opindex fprofile-values
9531 If combined with @option{-fprofile-arcs}, it adds code so that some
9532 data about values of expressions in the program is gathered.
9534 With @option{-fbranch-probabilities}, it reads back the data gathered
9535 from profiling values of expressions for usage in optimizations.
9537 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
9539 @item -fprofile-reorder-functions
9540 @opindex fprofile-reorder-functions
9541 Function reordering based on profile instrumentation collects
9542 first time of execution of a function and orders these functions
9543 in ascending order.
9545 Enabled with @option{-fprofile-use}.
9547 @item -fvpt
9548 @opindex fvpt
9549 If combined with @option{-fprofile-arcs}, this option instructs the compiler
9550 to add code to gather information about values of expressions.
9552 With @option{-fbranch-probabilities}, it reads back the data gathered
9553 and actually performs the optimizations based on them.
9554 Currently the optimizations include specialization of division operations
9555 using the knowledge about the value of the denominator.
9557 @item -frename-registers
9558 @opindex frename-registers
9559 Attempt to avoid false dependencies in scheduled code by making use
9560 of registers left over after register allocation.  This optimization
9561 most benefits processors with lots of registers.  Depending on the
9562 debug information format adopted by the target, however, it can
9563 make debugging impossible, since variables no longer stay in
9564 a ``home register''.
9566 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
9568 @item -ftracer
9569 @opindex ftracer
9570 Perform tail duplication to enlarge superblock size.  This transformation
9571 simplifies the control flow of the function allowing other optimizations to do
9572 a better job.
9574 Enabled with @option{-fprofile-use}.
9576 @item -funroll-loops
9577 @opindex funroll-loops
9578 Unroll loops whose number of iterations can be determined at compile time or
9579 upon entry to the loop.  @option{-funroll-loops} implies
9580 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
9581 It also turns on complete loop peeling (i.e.@: complete removal of loops with
9582 a small constant number of iterations).  This option makes code larger, and may
9583 or may not make it run faster.
9585 Enabled with @option{-fprofile-use}.
9587 @item -funroll-all-loops
9588 @opindex funroll-all-loops
9589 Unroll all loops, even if their number of iterations is uncertain when
9590 the loop is entered.  This usually makes programs run more slowly.
9591 @option{-funroll-all-loops} implies the same options as
9592 @option{-funroll-loops}.
9594 @item -fpeel-loops
9595 @opindex fpeel-loops
9596 Peels loops for which there is enough information that they do not
9597 roll much (from profile feedback).  It also turns on complete loop peeling
9598 (i.e.@: complete removal of loops with small constant number of iterations).
9600 Enabled with @option{-fprofile-use}.
9602 @item -fmove-loop-invariants
9603 @opindex fmove-loop-invariants
9604 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
9605 at level @option{-O1}
9607 @item -funswitch-loops
9608 @opindex funswitch-loops
9609 Move branches with loop invariant conditions out of the loop, with duplicates
9610 of the loop on both branches (modified according to result of the condition).
9612 @item -ffunction-sections
9613 @itemx -fdata-sections
9614 @opindex ffunction-sections
9615 @opindex fdata-sections
9616 Place each function or data item into its own section in the output
9617 file if the target supports arbitrary sections.  The name of the
9618 function or the name of the data item determines the section's name
9619 in the output file.
9621 Use these options on systems where the linker can perform optimizations
9622 to improve locality of reference in the instruction space.  Most systems
9623 using the ELF object format and SPARC processors running Solaris 2 have
9624 linkers with such optimizations.  AIX may have these optimizations in
9625 the future.
9627 Only use these options when there are significant benefits from doing
9628 so.  When you specify these options, the assembler and linker
9629 create larger object and executable files and are also slower.
9630 You cannot use @code{gprof} on all systems if you
9631 specify this option, and you may have problems with debugging if
9632 you specify both this option and @option{-g}.
9634 @item -fbranch-target-load-optimize
9635 @opindex fbranch-target-load-optimize
9636 Perform branch target register load optimization before prologue / epilogue
9637 threading.
9638 The use of target registers can typically be exposed only during reload,
9639 thus hoisting loads out of loops and doing inter-block scheduling needs
9640 a separate optimization pass.
9642 @item -fbranch-target-load-optimize2
9643 @opindex fbranch-target-load-optimize2
9644 Perform branch target register load optimization after prologue / epilogue
9645 threading.
9647 @item -fbtr-bb-exclusive
9648 @opindex fbtr-bb-exclusive
9649 When performing branch target register load optimization, don't reuse
9650 branch target registers within any basic block.
9652 @item -fstack-protector
9653 @opindex fstack-protector
9654 Emit extra code to check for buffer overflows, such as stack smashing
9655 attacks.  This is done by adding a guard variable to functions with
9656 vulnerable objects.  This includes functions that call @code{alloca}, and
9657 functions with buffers larger than 8 bytes.  The guards are initialized
9658 when a function is entered and then checked when the function exits.
9659 If a guard check fails, an error message is printed and the program exits.
9661 @item -fstack-protector-all
9662 @opindex fstack-protector-all
9663 Like @option{-fstack-protector} except that all functions are protected.
9665 @item -fstack-protector-strong
9666 @opindex fstack-protector-strong
9667 Like @option{-fstack-protector} but includes additional functions to
9668 be protected --- those that have local array definitions, or have
9669 references to local frame addresses.
9671 @item -fsection-anchors
9672 @opindex fsection-anchors
9673 Try to reduce the number of symbolic address calculations by using
9674 shared ``anchor'' symbols to address nearby objects.  This transformation
9675 can help to reduce the number of GOT entries and GOT accesses on some
9676 targets.
9678 For example, the implementation of the following function @code{foo}:
9680 @smallexample
9681 static int a, b, c;
9682 int foo (void) @{ return a + b + c; @}
9683 @end smallexample
9685 @noindent
9686 usually calculates the addresses of all three variables, but if you
9687 compile it with @option{-fsection-anchors}, it accesses the variables
9688 from a common anchor point instead.  The effect is similar to the
9689 following pseudocode (which isn't valid C):
9691 @smallexample
9692 int foo (void)
9694   register int *xr = &x;
9695   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
9697 @end smallexample
9699 Not all targets support this option.
9701 @item --param @var{name}=@var{value}
9702 @opindex param
9703 In some places, GCC uses various constants to control the amount of
9704 optimization that is done.  For example, GCC does not inline functions
9705 that contain more than a certain number of instructions.  You can
9706 control some of these constants on the command line using the
9707 @option{--param} option.
9709 The names of specific parameters, and the meaning of the values, are
9710 tied to the internals of the compiler, and are subject to change
9711 without notice in future releases.
9713 In each case, the @var{value} is an integer.  The allowable choices for
9714 @var{name} are:
9716 @table @gcctabopt
9717 @item predictable-branch-outcome
9718 When branch is predicted to be taken with probability lower than this threshold
9719 (in percent), then it is considered well predictable. The default is 10.
9721 @item max-crossjump-edges
9722 The maximum number of incoming edges to consider for cross-jumping.
9723 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
9724 the number of edges incoming to each block.  Increasing values mean
9725 more aggressive optimization, making the compilation time increase with
9726 probably small improvement in executable size.
9728 @item min-crossjump-insns
9729 The minimum number of instructions that must be matched at the end
9730 of two blocks before cross-jumping is performed on them.  This
9731 value is ignored in the case where all instructions in the block being
9732 cross-jumped from are matched.  The default value is 5.
9734 @item max-grow-copy-bb-insns
9735 The maximum code size expansion factor when copying basic blocks
9736 instead of jumping.  The expansion is relative to a jump instruction.
9737 The default value is 8.
9739 @item max-goto-duplication-insns
9740 The maximum number of instructions to duplicate to a block that jumps
9741 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
9742 passes, GCC factors computed gotos early in the compilation process,
9743 and unfactors them as late as possible.  Only computed jumps at the
9744 end of a basic blocks with no more than max-goto-duplication-insns are
9745 unfactored.  The default value is 8.
9747 @item max-delay-slot-insn-search
9748 The maximum number of instructions to consider when looking for an
9749 instruction to fill a delay slot.  If more than this arbitrary number of
9750 instructions are searched, the time savings from filling the delay slot
9751 are minimal, so stop searching.  Increasing values mean more
9752 aggressive optimization, making the compilation time increase with probably
9753 small improvement in execution time.
9755 @item max-delay-slot-live-search
9756 When trying to fill delay slots, the maximum number of instructions to
9757 consider when searching for a block with valid live register
9758 information.  Increasing this arbitrarily chosen value means more
9759 aggressive optimization, increasing the compilation time.  This parameter
9760 should be removed when the delay slot code is rewritten to maintain the
9761 control-flow graph.
9763 @item max-gcse-memory
9764 The approximate maximum amount of memory that can be allocated in
9765 order to perform the global common subexpression elimination
9766 optimization.  If more memory than specified is required, the
9767 optimization is not done.
9769 @item max-gcse-insertion-ratio
9770 If the ratio of expression insertions to deletions is larger than this value
9771 for any expression, then RTL PRE inserts or removes the expression and thus
9772 leaves partially redundant computations in the instruction stream.  The default value is 20.
9774 @item max-pending-list-length
9775 The maximum number of pending dependencies scheduling allows
9776 before flushing the current state and starting over.  Large functions
9777 with few branches or calls can create excessively large lists which
9778 needlessly consume memory and resources.
9780 @item max-modulo-backtrack-attempts
9781 The maximum number of backtrack attempts the scheduler should make
9782 when modulo scheduling a loop.  Larger values can exponentially increase
9783 compilation time.
9785 @item max-inline-insns-single
9786 Several parameters control the tree inliner used in GCC@.
9787 This number sets the maximum number of instructions (counted in GCC's
9788 internal representation) in a single function that the tree inliner
9789 considers for inlining.  This only affects functions declared
9790 inline and methods implemented in a class declaration (C++).
9791 The default value is 400.
9793 @item max-inline-insns-auto
9794 When you use @option{-finline-functions} (included in @option{-O3}),
9795 a lot of functions that would otherwise not be considered for inlining
9796 by the compiler are investigated.  To those functions, a different
9797 (more restrictive) limit compared to functions declared inline can
9798 be applied.
9799 The default value is 40.
9801 @item inline-min-speedup
9802 When estimated performance improvement of caller + callee runtime exceeds this
9803 threshold (in precent), the function can be inlined regardless the limit on
9804 @option{--param max-inline-insns-single} and @option{--param
9805 max-inline-insns-auto}.
9807 @item large-function-insns
9808 The limit specifying really large functions.  For functions larger than this
9809 limit after inlining, inlining is constrained by
9810 @option{--param large-function-growth}.  This parameter is useful primarily
9811 to avoid extreme compilation time caused by non-linear algorithms used by the
9812 back end.
9813 The default value is 2700.
9815 @item large-function-growth
9816 Specifies maximal growth of large function caused by inlining in percents.
9817 The default value is 100 which limits large function growth to 2.0 times
9818 the original size.
9820 @item large-unit-insns
9821 The limit specifying large translation unit.  Growth caused by inlining of
9822 units larger than this limit is limited by @option{--param inline-unit-growth}.
9823 For small units this might be too tight.
9824 For example, consider a unit consisting of function A
9825 that is inline and B that just calls A three times.  If B is small relative to
9826 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
9827 large units consisting of small inlineable functions, however, the overall unit
9828 growth limit is needed to avoid exponential explosion of code size.  Thus for
9829 smaller units, the size is increased to @option{--param large-unit-insns}
9830 before applying @option{--param inline-unit-growth}.  The default is 10000.
9832 @item inline-unit-growth
9833 Specifies maximal overall growth of the compilation unit caused by inlining.
9834 The default value is 30 which limits unit growth to 1.3 times the original
9835 size. Cold functions (either marked cold via an attribute or by profile
9836 feedback) are not accounted into the unit size.
9838 @item ipcp-unit-growth
9839 Specifies maximal overall growth of the compilation unit caused by
9840 interprocedural constant propagation.  The default value is 10 which limits
9841 unit growth to 1.1 times the original size.
9843 @item large-stack-frame
9844 The limit specifying large stack frames.  While inlining the algorithm is trying
9845 to not grow past this limit too much.  The default value is 256 bytes.
9847 @item large-stack-frame-growth
9848 Specifies maximal growth of large stack frames caused by inlining in percents.
9849 The default value is 1000 which limits large stack frame growth to 11 times
9850 the original size.
9852 @item max-inline-insns-recursive
9853 @itemx max-inline-insns-recursive-auto
9854 Specifies the maximum number of instructions an out-of-line copy of a
9855 self-recursive inline
9856 function can grow into by performing recursive inlining.
9858 For functions declared inline, @option{--param max-inline-insns-recursive} is
9859 taken into account.  For functions not declared inline, recursive inlining
9860 happens only when @option{-finline-functions} (included in @option{-O3}) is
9861 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
9862 default value is 450.
9864 @item max-inline-recursive-depth
9865 @itemx max-inline-recursive-depth-auto
9866 Specifies the maximum recursion depth used for recursive inlining.
9868 For functions declared inline, @option{--param max-inline-recursive-depth} is
9869 taken into account.  For functions not declared inline, recursive inlining
9870 happens only when @option{-finline-functions} (included in @option{-O3}) is
9871 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
9872 default value is 8.
9874 @item min-inline-recursive-probability
9875 Recursive inlining is profitable only for function having deep recursion
9876 in average and can hurt for function having little recursion depth by
9877 increasing the prologue size or complexity of function body to other
9878 optimizers.
9880 When profile feedback is available (see @option{-fprofile-generate}) the actual
9881 recursion depth can be guessed from probability that function recurses via a
9882 given call expression.  This parameter limits inlining only to call expressions
9883 whose probability exceeds the given threshold (in percents).
9884 The default value is 10.
9886 @item early-inlining-insns
9887 Specify growth that the early inliner can make.  In effect it increases
9888 the amount of inlining for code having a large abstraction penalty.
9889 The default value is 10.
9891 @item max-early-inliner-iterations
9892 @itemx max-early-inliner-iterations
9893 Limit of iterations of the early inliner.  This basically bounds
9894 the number of nested indirect calls the early inliner can resolve.
9895 Deeper chains are still handled by late inlining.
9897 @item comdat-sharing-probability
9898 @itemx comdat-sharing-probability
9899 Probability (in percent) that C++ inline function with comdat visibility
9900 are shared across multiple compilation units.  The default value is 20.
9902 @item profile-func-internal-id
9903 @itemx profile-func-internal-id
9904 A parameter to control whether to use function internal id in profile
9905 database lookup. If the value is 0, the compiler will use id that
9906 is based on function assembler name and filename, which makes old profile
9907 data more tolerant to source changes such as function reordering etc.
9908 The default value is 0.
9910 @item min-vect-loop-bound
9911 The minimum number of iterations under which loops are not vectorized
9912 when @option{-ftree-vectorize} is used.  The number of iterations after
9913 vectorization needs to be greater than the value specified by this option
9914 to allow vectorization.  The default value is 0.
9916 @item gcse-cost-distance-ratio
9917 Scaling factor in calculation of maximum distance an expression
9918 can be moved by GCSE optimizations.  This is currently supported only in the
9919 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
9920 is with simple expressions, i.e., the expressions that have cost
9921 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
9922 hoisting of simple expressions.  The default value is 10.
9924 @item gcse-unrestricted-cost
9925 Cost, roughly measured as the cost of a single typical machine
9926 instruction, at which GCSE optimizations do not constrain
9927 the distance an expression can travel.  This is currently
9928 supported only in the code hoisting pass.  The lesser the cost,
9929 the more aggressive code hoisting is.  Specifying 0 
9930 allows all expressions to travel unrestricted distances.
9931 The default value is 3.
9933 @item max-hoist-depth
9934 The depth of search in the dominator tree for expressions to hoist.
9935 This is used to avoid quadratic behavior in hoisting algorithm.
9936 The value of 0 does not limit on the search, but may slow down compilation
9937 of huge functions.  The default value is 30.
9939 @item max-tail-merge-comparisons
9940 The maximum amount of similar bbs to compare a bb with.  This is used to
9941 avoid quadratic behavior in tree tail merging.  The default value is 10.
9943 @item max-tail-merge-iterations
9944 The maximum amount of iterations of the pass over the function.  This is used to
9945 limit compilation time in tree tail merging.  The default value is 2.
9947 @item max-unrolled-insns
9948 The maximum number of instructions that a loop may have to be unrolled.
9949 If a loop is unrolled, this parameter also determines how many times
9950 the loop code is unrolled.
9952 @item max-average-unrolled-insns
9953 The maximum number of instructions biased by probabilities of their execution
9954 that a loop may have to be unrolled.  If a loop is unrolled,
9955 this parameter also determines how many times the loop code is unrolled.
9957 @item max-unroll-times
9958 The maximum number of unrollings of a single loop.
9960 @item max-peeled-insns
9961 The maximum number of instructions that a loop may have to be peeled.
9962 If a loop is peeled, this parameter also determines how many times
9963 the loop code is peeled.
9965 @item max-peel-times
9966 The maximum number of peelings of a single loop.
9968 @item max-peel-branches
9969 The maximum number of branches on the hot path through the peeled sequence.
9971 @item max-completely-peeled-insns
9972 The maximum number of insns of a completely peeled loop.
9974 @item max-completely-peel-times
9975 The maximum number of iterations of a loop to be suitable for complete peeling.
9977 @item max-completely-peel-loop-nest-depth
9978 The maximum depth of a loop nest suitable for complete peeling.
9980 @item max-unswitch-insns
9981 The maximum number of insns of an unswitched loop.
9983 @item max-unswitch-level
9984 The maximum number of branches unswitched in a single loop.
9986 @item lim-expensive
9987 The minimum cost of an expensive expression in the loop invariant motion.
9989 @item iv-consider-all-candidates-bound
9990 Bound on number of candidates for induction variables, below which
9991 all candidates are considered for each use in induction variable
9992 optimizations.  If there are more candidates than this,
9993 only the most relevant ones are considered to avoid quadratic time complexity.
9995 @item iv-max-considered-uses
9996 The induction variable optimizations give up on loops that contain more
9997 induction variable uses.
9999 @item iv-always-prune-cand-set-bound
10000 If the number of candidates in the set is smaller than this value,
10001 always try to remove unnecessary ivs from the set
10002 when adding a new one.
10004 @item scev-max-expr-size
10005 Bound on size of expressions used in the scalar evolutions analyzer.
10006 Large expressions slow the analyzer.
10008 @item scev-max-expr-complexity
10009 Bound on the complexity of the expressions in the scalar evolutions analyzer.
10010 Complex expressions slow the analyzer.
10012 @item omega-max-vars
10013 The maximum number of variables in an Omega constraint system.
10014 The default value is 128.
10016 @item omega-max-geqs
10017 The maximum number of inequalities in an Omega constraint system.
10018 The default value is 256.
10020 @item omega-max-eqs
10021 The maximum number of equalities in an Omega constraint system.
10022 The default value is 128.
10024 @item omega-max-wild-cards
10025 The maximum number of wildcard variables that the Omega solver is
10026 able to insert.  The default value is 18.
10028 @item omega-hash-table-size
10029 The size of the hash table in the Omega solver.  The default value is
10030 550.
10032 @item omega-max-keys
10033 The maximal number of keys used by the Omega solver.  The default
10034 value is 500.
10036 @item omega-eliminate-redundant-constraints
10037 When set to 1, use expensive methods to eliminate all redundant
10038 constraints.  The default value is 0.
10040 @item vect-max-version-for-alignment-checks
10041 The maximum number of run-time checks that can be performed when
10042 doing loop versioning for alignment in the vectorizer.
10044 @item vect-max-version-for-alias-checks
10045 The maximum number of run-time checks that can be performed when
10046 doing loop versioning for alias in the vectorizer.
10048 @item vect-max-peeling-for-alignment
10049 The maximum number of loop peels to enhance access alignment
10050 for vectorizer. Value -1 means 'no limit'.
10052 @item max-iterations-to-track
10053 The maximum number of iterations of a loop the brute-force algorithm
10054 for analysis of the number of iterations of the loop tries to evaluate.
10056 @item hot-bb-count-ws-permille
10057 A basic block profile count is considered hot if it contributes to 
10058 the given permillage (i.e. 0...1000) of the entire profiled execution.
10060 @item hot-bb-frequency-fraction
10061 Select fraction of the entry block frequency of executions of basic block in
10062 function given basic block needs to have to be considered hot.
10064 @item max-predicted-iterations
10065 The maximum number of loop iterations we predict statically.  This is useful
10066 in cases where a function contains a single loop with known bound and
10067 another loop with unknown bound.
10068 The known number of iterations is predicted correctly, while
10069 the unknown number of iterations average to roughly 10.  This means that the
10070 loop without bounds appears artificially cold relative to the other one.
10072 @item builtin-expect-probability
10073 Control the probability of the expression having the specified value. This
10074 parameter takes a percentage (i.e. 0 ... 100) as input.
10075 The default probability of 90 is obtained empirically.
10077 @item align-threshold
10079 Select fraction of the maximal frequency of executions of a basic block in
10080 a function to align the basic block.
10082 @item align-loop-iterations
10084 A loop expected to iterate at least the selected number of iterations is
10085 aligned.
10087 @item tracer-dynamic-coverage
10088 @itemx tracer-dynamic-coverage-feedback
10090 This value is used to limit superblock formation once the given percentage of
10091 executed instructions is covered.  This limits unnecessary code size
10092 expansion.
10094 The @option{tracer-dynamic-coverage-feedback} is used only when profile
10095 feedback is available.  The real profiles (as opposed to statically estimated
10096 ones) are much less balanced allowing the threshold to be larger value.
10098 @item tracer-max-code-growth
10099 Stop tail duplication once code growth has reached given percentage.  This is
10100 a rather artificial limit, as most of the duplicates are eliminated later in
10101 cross jumping, so it may be set to much higher values than is the desired code
10102 growth.
10104 @item tracer-min-branch-ratio
10106 Stop reverse growth when the reverse probability of best edge is less than this
10107 threshold (in percent).
10109 @item tracer-min-branch-ratio
10110 @itemx tracer-min-branch-ratio-feedback
10112 Stop forward growth if the best edge has probability lower than this
10113 threshold.
10115 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
10116 compilation for profile feedback and one for compilation without.  The value
10117 for compilation with profile feedback needs to be more conservative (higher) in
10118 order to make tracer effective.
10120 @item max-cse-path-length
10122 The maximum number of basic blocks on path that CSE considers.
10123 The default is 10.
10125 @item max-cse-insns
10126 The maximum number of instructions CSE processes before flushing.
10127 The default is 1000.
10129 @item ggc-min-expand
10131 GCC uses a garbage collector to manage its own memory allocation.  This
10132 parameter specifies the minimum percentage by which the garbage
10133 collector's heap should be allowed to expand between collections.
10134 Tuning this may improve compilation speed; it has no effect on code
10135 generation.
10137 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
10138 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
10139 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
10140 GCC is not able to calculate RAM on a particular platform, the lower
10141 bound of 30% is used.  Setting this parameter and
10142 @option{ggc-min-heapsize} to zero causes a full collection to occur at
10143 every opportunity.  This is extremely slow, but can be useful for
10144 debugging.
10146 @item ggc-min-heapsize
10148 Minimum size of the garbage collector's heap before it begins bothering
10149 to collect garbage.  The first collection occurs after the heap expands
10150 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
10151 tuning this may improve compilation speed, and has no effect on code
10152 generation.
10154 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
10155 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
10156 with a lower bound of 4096 (four megabytes) and an upper bound of
10157 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
10158 particular platform, the lower bound is used.  Setting this parameter
10159 very large effectively disables garbage collection.  Setting this
10160 parameter and @option{ggc-min-expand} to zero causes a full collection
10161 to occur at every opportunity.
10163 @item max-reload-search-insns
10164 The maximum number of instruction reload should look backward for equivalent
10165 register.  Increasing values mean more aggressive optimization, making the
10166 compilation time increase with probably slightly better performance.
10167 The default value is 100.
10169 @item max-cselib-memory-locations
10170 The maximum number of memory locations cselib should take into account.
10171 Increasing values mean more aggressive optimization, making the compilation time
10172 increase with probably slightly better performance.  The default value is 500.
10174 @item reorder-blocks-duplicate
10175 @itemx reorder-blocks-duplicate-feedback
10177 Used by the basic block reordering pass to decide whether to use unconditional
10178 branch or duplicate the code on its destination.  Code is duplicated when its
10179 estimated size is smaller than this value multiplied by the estimated size of
10180 unconditional jump in the hot spots of the program.
10182 The @option{reorder-block-duplicate-feedback} is used only when profile
10183 feedback is available.  It may be set to higher values than
10184 @option{reorder-block-duplicate} since information about the hot spots is more
10185 accurate.
10187 @item max-sched-ready-insns
10188 The maximum number of instructions ready to be issued the scheduler should
10189 consider at any given time during the first scheduling pass.  Increasing
10190 values mean more thorough searches, making the compilation time increase
10191 with probably little benefit.  The default value is 100.
10193 @item max-sched-region-blocks
10194 The maximum number of blocks in a region to be considered for
10195 interblock scheduling.  The default value is 10.
10197 @item max-pipeline-region-blocks
10198 The maximum number of blocks in a region to be considered for
10199 pipelining in the selective scheduler.  The default value is 15.
10201 @item max-sched-region-insns
10202 The maximum number of insns in a region to be considered for
10203 interblock scheduling.  The default value is 100.
10205 @item max-pipeline-region-insns
10206 The maximum number of insns in a region to be considered for
10207 pipelining in the selective scheduler.  The default value is 200.
10209 @item min-spec-prob
10210 The minimum probability (in percents) of reaching a source block
10211 for interblock speculative scheduling.  The default value is 40.
10213 @item max-sched-extend-regions-iters
10214 The maximum number of iterations through CFG to extend regions.
10215 A value of 0 (the default) disables region extensions.
10217 @item max-sched-insn-conflict-delay
10218 The maximum conflict delay for an insn to be considered for speculative motion.
10219 The default value is 3.
10221 @item sched-spec-prob-cutoff
10222 The minimal probability of speculation success (in percents), so that
10223 speculative insns are scheduled.
10224 The default value is 40.
10226 @item sched-spec-state-edge-prob-cutoff
10227 The minimum probability an edge must have for the scheduler to save its
10228 state across it.
10229 The default value is 10.
10231 @item sched-mem-true-dep-cost
10232 Minimal distance (in CPU cycles) between store and load targeting same
10233 memory locations.  The default value is 1.
10235 @item selsched-max-lookahead
10236 The maximum size of the lookahead window of selective scheduling.  It is a
10237 depth of search for available instructions.
10238 The default value is 50.
10240 @item selsched-max-sched-times
10241 The maximum number of times that an instruction is scheduled during
10242 selective scheduling.  This is the limit on the number of iterations
10243 through which the instruction may be pipelined.  The default value is 2.
10245 @item selsched-max-insns-to-rename
10246 The maximum number of best instructions in the ready list that are considered
10247 for renaming in the selective scheduler.  The default value is 2.
10249 @item sms-min-sc
10250 The minimum value of stage count that swing modulo scheduler
10251 generates.  The default value is 2.
10253 @item max-last-value-rtl
10254 The maximum size measured as number of RTLs that can be recorded in an expression
10255 in combiner for a pseudo register as last known value of that register.  The default
10256 is 10000.
10258 @item max-combine-insns
10259 The maximum number of instructions the RTL combiner tries to combine.
10260 The default value is 2 at @option{-Og} and 4 otherwise.
10262 @item integer-share-limit
10263 Small integer constants can use a shared data structure, reducing the
10264 compiler's memory usage and increasing its speed.  This sets the maximum
10265 value of a shared integer constant.  The default value is 256.
10267 @item ssp-buffer-size
10268 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
10269 protection when @option{-fstack-protection} is used.
10271 @item min-size-for-stack-sharing
10272 The minimum size of variables taking part in stack slot sharing when not
10273 optimizing. The default value is 32.
10275 @item max-jump-thread-duplication-stmts
10276 Maximum number of statements allowed in a block that needs to be
10277 duplicated when threading jumps.
10279 @item max-fields-for-field-sensitive
10280 Maximum number of fields in a structure treated in
10281 a field sensitive manner during pointer analysis.  The default is zero
10282 for @option{-O0} and @option{-O1},
10283 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
10285 @item prefetch-latency
10286 Estimate on average number of instructions that are executed before
10287 prefetch finishes.  The distance prefetched ahead is proportional
10288 to this constant.  Increasing this number may also lead to less
10289 streams being prefetched (see @option{simultaneous-prefetches}).
10291 @item simultaneous-prefetches
10292 Maximum number of prefetches that can run at the same time.
10294 @item l1-cache-line-size
10295 The size of cache line in L1 cache, in bytes.
10297 @item l1-cache-size
10298 The size of L1 cache, in kilobytes.
10300 @item l2-cache-size
10301 The size of L2 cache, in kilobytes.
10303 @item min-insn-to-prefetch-ratio
10304 The minimum ratio between the number of instructions and the
10305 number of prefetches to enable prefetching in a loop.
10307 @item prefetch-min-insn-to-mem-ratio
10308 The minimum ratio between the number of instructions and the
10309 number of memory references to enable prefetching in a loop.
10311 @item use-canonical-types
10312 Whether the compiler should use the ``canonical'' type system.  By
10313 default, this should always be 1, which uses a more efficient internal
10314 mechanism for comparing types in C++ and Objective-C++.  However, if
10315 bugs in the canonical type system are causing compilation failures,
10316 set this value to 0 to disable canonical types.
10318 @item switch-conversion-max-branch-ratio
10319 Switch initialization conversion refuses to create arrays that are
10320 bigger than @option{switch-conversion-max-branch-ratio} times the number of
10321 branches in the switch.
10323 @item max-partial-antic-length
10324 Maximum length of the partial antic set computed during the tree
10325 partial redundancy elimination optimization (@option{-ftree-pre}) when
10326 optimizing at @option{-O3} and above.  For some sorts of source code
10327 the enhanced partial redundancy elimination optimization can run away,
10328 consuming all of the memory available on the host machine.  This
10329 parameter sets a limit on the length of the sets that are computed,
10330 which prevents the runaway behavior.  Setting a value of 0 for
10331 this parameter allows an unlimited set length.
10333 @item sccvn-max-scc-size
10334 Maximum size of a strongly connected component (SCC) during SCCVN
10335 processing.  If this limit is hit, SCCVN processing for the whole
10336 function is not done and optimizations depending on it are
10337 disabled.  The default maximum SCC size is 10000.
10339 @item sccvn-max-alias-queries-per-access
10340 Maximum number of alias-oracle queries we perform when looking for
10341 redundancies for loads and stores.  If this limit is hit the search
10342 is aborted and the load or store is not considered redundant.  The
10343 number of queries is algorithmically limited to the number of
10344 stores on all paths from the load to the function entry.
10345 The default maxmimum number of queries is 1000.
10347 @item ira-max-loops-num
10348 IRA uses regional register allocation by default.  If a function
10349 contains more loops than the number given by this parameter, only at most
10350 the given number of the most frequently-executed loops form regions
10351 for regional register allocation.  The default value of the
10352 parameter is 100.
10354 @item ira-max-conflict-table-size 
10355 Although IRA uses a sophisticated algorithm to compress the conflict
10356 table, the table can still require excessive amounts of memory for
10357 huge functions.  If the conflict table for a function could be more
10358 than the size in MB given by this parameter, the register allocator
10359 instead uses a faster, simpler, and lower-quality
10360 algorithm that does not require building a pseudo-register conflict table.  
10361 The default value of the parameter is 2000.
10363 @item ira-loop-reserved-regs
10364 IRA can be used to evaluate more accurate register pressure in loops
10365 for decisions to move loop invariants (see @option{-O3}).  The number
10366 of available registers reserved for some other purposes is given
10367 by this parameter.  The default value of the parameter is 2, which is
10368 the minimal number of registers needed by typical instructions.
10369 This value is the best found from numerous experiments.
10371 @item loop-invariant-max-bbs-in-loop
10372 Loop invariant motion can be very expensive, both in compilation time and
10373 in amount of needed compile-time memory, with very large loops.  Loops
10374 with more basic blocks than this parameter won't have loop invariant
10375 motion optimization performed on them.  The default value of the
10376 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
10378 @item loop-max-datarefs-for-datadeps
10379 Building data dapendencies is expensive for very large loops.  This
10380 parameter limits the number of data references in loops that are
10381 considered for data dependence analysis.  These large loops are no
10382 handled by the optimizations using loop data dependencies.
10383 The default value is 1000.
10385 @item max-vartrack-size
10386 Sets a maximum number of hash table slots to use during variable
10387 tracking dataflow analysis of any function.  If this limit is exceeded
10388 with variable tracking at assignments enabled, analysis for that
10389 function is retried without it, after removing all debug insns from
10390 the function.  If the limit is exceeded even without debug insns, var
10391 tracking analysis is completely disabled for the function.  Setting
10392 the parameter to zero makes it unlimited.
10394 @item max-vartrack-expr-depth
10395 Sets a maximum number of recursion levels when attempting to map
10396 variable names or debug temporaries to value expressions.  This trades
10397 compilation time for more complete debug information.  If this is set too
10398 low, value expressions that are available and could be represented in
10399 debug information may end up not being used; setting this higher may
10400 enable the compiler to find more complex debug expressions, but compile
10401 time and memory use may grow.  The default is 12.
10403 @item min-nondebug-insn-uid
10404 Use uids starting at this parameter for nondebug insns.  The range below
10405 the parameter is reserved exclusively for debug insns created by
10406 @option{-fvar-tracking-assignments}, but debug insns may get
10407 (non-overlapping) uids above it if the reserved range is exhausted.
10409 @item ipa-sra-ptr-growth-factor
10410 IPA-SRA replaces a pointer to an aggregate with one or more new
10411 parameters only when their cumulative size is less or equal to
10412 @option{ipa-sra-ptr-growth-factor} times the size of the original
10413 pointer parameter.
10415 @item sra-max-scalarization-size-Ospeed
10416 @item sra-max-scalarization-size-Osize
10417 The two Scalar Reduction of Aggregates passes (SRA and IPA-SRA) aim to
10418 replace scalar parts of aggregates with uses of independent scalar
10419 variables.  These parameters control the maximum size, in storage units,
10420 of aggregate which will be considered for replacement when compiling for
10421 speed
10422 (@option{sra-max-scalarization-size-Ospeed}) or size
10423 (@option{sra-max-scalarization-size-Osize}) respectively.
10425 @item tm-max-aggregate-size
10426 When making copies of thread-local variables in a transaction, this
10427 parameter specifies the size in bytes after which variables are
10428 saved with the logging functions as opposed to save/restore code
10429 sequence pairs.  This option only applies when using
10430 @option{-fgnu-tm}.
10432 @item graphite-max-nb-scop-params
10433 To avoid exponential effects in the Graphite loop transforms, the
10434 number of parameters in a Static Control Part (SCoP) is bounded.  The
10435 default value is 10 parameters.  A variable whose value is unknown at
10436 compilation time and defined outside a SCoP is a parameter of the SCoP.
10438 @item graphite-max-bbs-per-function
10439 To avoid exponential effects in the detection of SCoPs, the size of
10440 the functions analyzed by Graphite is bounded.  The default value is
10441 100 basic blocks.
10443 @item loop-block-tile-size
10444 Loop blocking or strip mining transforms, enabled with
10445 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
10446 loop in the loop nest by a given number of iterations.  The strip
10447 length can be changed using the @option{loop-block-tile-size}
10448 parameter.  The default value is 51 iterations.
10450 @item ipa-cp-value-list-size
10451 IPA-CP attempts to track all possible values and types passed to a function's
10452 parameter in order to propagate them and perform devirtualization.
10453 @option{ipa-cp-value-list-size} is the maximum number of values and types it
10454 stores per one formal parameter of a function.
10456 @item ipa-cp-eval-threshold
10457 IPA-CP calculates its own score of cloning profitability heuristics
10458 and performs those cloning opportunities with scores that exceed
10459 @option{ipa-cp-eval-threshold}.
10461 @item ipa-max-agg-items
10462 IPA-CP is also capable to propagate a number of scalar values passed
10463 in an aggregate. @option{ipa-max-agg-items} controls the maximum
10464 number of such values per one parameter.
10466 @item ipa-cp-loop-hint-bonus
10467 When IPA-CP determines that a cloning candidate would make the number
10468 of iterations of a loop known, it adds a bonus of
10469 @option{ipa-cp-loop-hint-bonus} to the profitability score of
10470 the candidate.
10472 @item ipa-cp-array-index-hint-bonus
10473 When IPA-CP determines that a cloning candidate would make the index of
10474 an array access known, it adds a bonus of
10475 @option{ipa-cp-array-index-hint-bonus} to the profitability
10476 score of the candidate.
10478 @item ipa-max-aa-steps
10479 During its analysis of function bodies, IPA-CP employs alias analysis
10480 in order to track values pointed to by function parameters.  In order
10481 not spend too much time analyzing huge functions, it will give up and
10482 consider all memory clobbered after examining
10483 @option{ipa-max-aa-steps} statements modifying memory.
10485 @item lto-partitions
10486 Specify desired number of partitions produced during WHOPR compilation.
10487 The number of partitions should exceed the number of CPUs used for compilation.
10488 The default value is 32.
10490 @item lto-minpartition
10491 Size of minimal partition for WHOPR (in estimated instructions).
10492 This prevents expenses of splitting very small programs into too many
10493 partitions.
10495 @item cxx-max-namespaces-for-diagnostic-help
10496 The maximum number of namespaces to consult for suggestions when C++
10497 name lookup fails for an identifier.  The default is 1000.
10499 @item sink-frequency-threshold
10500 The maximum relative execution frequency (in percents) of the target block
10501 relative to a statement's original block to allow statement sinking of a
10502 statement.  Larger numbers result in more aggressive statement sinking.
10503 The default value is 75.  A small positive adjustment is applied for
10504 statements with memory operands as those are even more profitable so sink.
10506 @item max-stores-to-sink
10507 The maximum number of conditional stores paires that can be sunk.  Set to 0
10508 if either vectorization (@option{-ftree-vectorize}) or if-conversion
10509 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
10511 @item allow-store-data-races
10512 Allow optimizers to introduce new data races on stores.
10513 Set to 1 to allow, otherwise to 0.  This option is enabled by default
10514 at optimization level @option{-Ofast}.
10516 @item case-values-threshold
10517 The smallest number of different values for which it is best to use a
10518 jump-table instead of a tree of conditional branches.  If the value is
10519 0, use the default for the machine.  The default is 0.
10521 @item tree-reassoc-width
10522 Set the maximum number of instructions executed in parallel in
10523 reassociated tree. This parameter overrides target dependent
10524 heuristics used by default if has non zero value.
10526 @item sched-pressure-algorithm
10527 Choose between the two available implementations of
10528 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
10529 and is the more likely to prevent instructions from being reordered.
10530 Algorithm 2 was designed to be a compromise between the relatively
10531 conservative approach taken by algorithm 1 and the rather aggressive
10532 approach taken by the default scheduler.  It relies more heavily on
10533 having a regular register file and accurate register pressure classes.
10534 See @file{haifa-sched.c} in the GCC sources for more details.
10536 The default choice depends on the target.
10538 @item max-slsr-cand-scan
10539 Set the maximum number of existing candidates that will be considered when
10540 seeking a basis for a new straight-line strength reduction candidate.
10542 @item asan-globals
10543 Enable buffer overflow detection for global objects.  This kind
10544 of protection is enabled by default if you are using
10545 @option{-fsanitize=address} option.
10546 To disable global objects protection use @option{--param asan-globals=0}.
10548 @item asan-stack
10549 Enable buffer overflow detection for stack objects.  This kind of
10550 protection is enabled by default when using@option{-fsanitize=address}.
10551 To disable stack protection use @option{--param asan-stack=0} option.
10553 @item asan-instrument-reads
10554 Enable buffer overflow detection for memory reads.  This kind of
10555 protection is enabled by default when using @option{-fsanitize=address}.
10556 To disable memory reads protection use
10557 @option{--param asan-instrument-reads=0}.
10559 @item asan-instrument-writes
10560 Enable buffer overflow detection for memory writes.  This kind of
10561 protection is enabled by default when using @option{-fsanitize=address}.
10562 To disable memory writes protection use
10563 @option{--param asan-instrument-writes=0} option.
10565 @item asan-memintrin
10566 Enable detection for built-in functions.  This kind of protection
10567 is enabled by default when using @option{-fsanitize=address}.
10568 To disable built-in functions protection use
10569 @option{--param asan-memintrin=0}.
10571 @item asan-use-after-return
10572 Enable detection of use-after-return.  This kind of protection
10573 is enabled by default when using @option{-fsanitize=address} option.
10574 To disable use-after-return detection use 
10575 @option{--param asan-use-after-return=0}.
10577 @item asan-instrumentation-with-call-threshold
10578 If number of memory accesses in function being instrumented
10579 is greater or equal to this number, use callbacks instead of inline checks.
10580 E.g. to disable inline code use
10581 @option{--param asan-instrumentation-with-call-threshold=0}.
10583 @item chkp-max-ctor-size
10584 Static constructors generated by Pointer Bounds Checker may become very
10585 large and significantly increase compile time at optimization level
10586 @option{-O1} and higher.  This parameter is a maximum nubmer of statements
10587 in a single generated constructor.  Default value is 5000.
10589 @end table
10590 @end table
10592 @node Preprocessor Options
10593 @section Options Controlling the Preprocessor
10594 @cindex preprocessor options
10595 @cindex options, preprocessor
10597 These options control the C preprocessor, which is run on each C source
10598 file before actual compilation.
10600 If you use the @option{-E} option, nothing is done except preprocessing.
10601 Some of these options make sense only together with @option{-E} because
10602 they cause the preprocessor output to be unsuitable for actual
10603 compilation.
10605 @table @gcctabopt
10606 @item -Wp,@var{option}
10607 @opindex Wp
10608 You can use @option{-Wp,@var{option}} to bypass the compiler driver
10609 and pass @var{option} directly through to the preprocessor.  If
10610 @var{option} contains commas, it is split into multiple options at the
10611 commas.  However, many options are modified, translated or interpreted
10612 by the compiler driver before being passed to the preprocessor, and
10613 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
10614 interface is undocumented and subject to change, so whenever possible
10615 you should avoid using @option{-Wp} and let the driver handle the
10616 options instead.
10618 @item -Xpreprocessor @var{option}
10619 @opindex Xpreprocessor
10620 Pass @var{option} as an option to the preprocessor.  You can use this to
10621 supply system-specific preprocessor options that GCC does not 
10622 recognize.
10624 If you want to pass an option that takes an argument, you must use
10625 @option{-Xpreprocessor} twice, once for the option and once for the argument.
10627 @item -no-integrated-cpp
10628 @opindex no-integrated-cpp
10629 Perform preprocessing as a separate pass before compilation.
10630 By default, GCC performs preprocessing as an integrated part of
10631 input tokenization and parsing.
10632 If this option is provided, the appropriate language front end
10633 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
10634 and Objective-C, respectively) is instead invoked twice,
10635 once for preprocessing only and once for actual compilation
10636 of the preprocessed input.
10637 This option may be useful in conjunction with the @option{-B} or
10638 @option{-wrapper} options to specify an alternate preprocessor or
10639 perform additional processing of the program source between
10640 normal preprocessing and compilation.
10641 @end table
10643 @include cppopts.texi
10645 @node Assembler Options
10646 @section Passing Options to the Assembler
10648 @c prevent bad page break with this line
10649 You can pass options to the assembler.
10651 @table @gcctabopt
10652 @item -Wa,@var{option}
10653 @opindex Wa
10654 Pass @var{option} as an option to the assembler.  If @var{option}
10655 contains commas, it is split into multiple options at the commas.
10657 @item -Xassembler @var{option}
10658 @opindex Xassembler
10659 Pass @var{option} as an option to the assembler.  You can use this to
10660 supply system-specific assembler options that GCC does not
10661 recognize.
10663 If you want to pass an option that takes an argument, you must use
10664 @option{-Xassembler} twice, once for the option and once for the argument.
10666 @end table
10668 @node Link Options
10669 @section Options for Linking
10670 @cindex link options
10671 @cindex options, linking
10673 These options come into play when the compiler links object files into
10674 an executable output file.  They are meaningless if the compiler is
10675 not doing a link step.
10677 @table @gcctabopt
10678 @cindex file names
10679 @item @var{object-file-name}
10680 A file name that does not end in a special recognized suffix is
10681 considered to name an object file or library.  (Object files are
10682 distinguished from libraries by the linker according to the file
10683 contents.)  If linking is done, these object files are used as input
10684 to the linker.
10686 @item -c
10687 @itemx -S
10688 @itemx -E
10689 @opindex c
10690 @opindex S
10691 @opindex E
10692 If any of these options is used, then the linker is not run, and
10693 object file names should not be used as arguments.  @xref{Overall
10694 Options}.
10696 @cindex Libraries
10697 @item -l@var{library}
10698 @itemx -l @var{library}
10699 @opindex l
10700 Search the library named @var{library} when linking.  (The second
10701 alternative with the library as a separate argument is only for
10702 POSIX compliance and is not recommended.)
10704 It makes a difference where in the command you write this option; the
10705 linker searches and processes libraries and object files in the order they
10706 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
10707 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
10708 to functions in @samp{z}, those functions may not be loaded.
10710 The linker searches a standard list of directories for the library,
10711 which is actually a file named @file{lib@var{library}.a}.  The linker
10712 then uses this file as if it had been specified precisely by name.
10714 The directories searched include several standard system directories
10715 plus any that you specify with @option{-L}.
10717 Normally the files found this way are library files---archive files
10718 whose members are object files.  The linker handles an archive file by
10719 scanning through it for members which define symbols that have so far
10720 been referenced but not defined.  But if the file that is found is an
10721 ordinary object file, it is linked in the usual fashion.  The only
10722 difference between using an @option{-l} option and specifying a file name
10723 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
10724 and searches several directories.
10726 @item -lobjc
10727 @opindex lobjc
10728 You need this special case of the @option{-l} option in order to
10729 link an Objective-C or Objective-C++ program.
10731 @item -nostartfiles
10732 @opindex nostartfiles
10733 Do not use the standard system startup files when linking.
10734 The standard system libraries are used normally, unless @option{-nostdlib}
10735 or @option{-nodefaultlibs} is used.
10737 @item -nodefaultlibs
10738 @opindex nodefaultlibs
10739 Do not use the standard system libraries when linking.
10740 Only the libraries you specify are passed to the linker, and options
10741 specifying linkage of the system libraries, such as @code{-static-libgcc}
10742 or @code{-shared-libgcc}, are ignored.  
10743 The standard startup files are used normally, unless @option{-nostartfiles}
10744 is used.  
10746 The compiler may generate calls to @code{memcmp},
10747 @code{memset}, @code{memcpy} and @code{memmove}.
10748 These entries are usually resolved by entries in
10749 libc.  These entry points should be supplied through some other
10750 mechanism when this option is specified.
10752 @item -nostdlib
10753 @opindex nostdlib
10754 Do not use the standard system startup files or libraries when linking.
10755 No startup files and only the libraries you specify are passed to
10756 the linker, and options specifying linkage of the system libraries, such as
10757 @code{-static-libgcc} or @code{-shared-libgcc}, are ignored.
10759 The compiler may generate calls to @code{memcmp}, @code{memset},
10760 @code{memcpy} and @code{memmove}.
10761 These entries are usually resolved by entries in
10762 libc.  These entry points should be supplied through some other
10763 mechanism when this option is specified.
10765 @cindex @option{-lgcc}, use with @option{-nostdlib}
10766 @cindex @option{-nostdlib} and unresolved references
10767 @cindex unresolved references and @option{-nostdlib}
10768 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
10769 @cindex @option{-nodefaultlibs} and unresolved references
10770 @cindex unresolved references and @option{-nodefaultlibs}
10771 One of the standard libraries bypassed by @option{-nostdlib} and
10772 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
10773 which GCC uses to overcome shortcomings of particular machines, or special
10774 needs for some languages.
10775 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
10776 Collection (GCC) Internals},
10777 for more discussion of @file{libgcc.a}.)
10778 In most cases, you need @file{libgcc.a} even when you want to avoid
10779 other standard libraries.  In other words, when you specify @option{-nostdlib}
10780 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
10781 This ensures that you have no unresolved references to internal GCC
10782 library subroutines.
10783 (An example of such an internal subroutine is @samp{__main}, used to ensure C++
10784 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
10785 GNU Compiler Collection (GCC) Internals}.)
10787 @item -pie
10788 @opindex pie
10789 Produce a position independent executable on targets that support it.
10790 For predictable results, you must also specify the same set of options
10791 used for compilation (@option{-fpie}, @option{-fPIE},
10792 or model suboptions) when you specify this linker option.
10794 @item -rdynamic
10795 @opindex rdynamic
10796 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
10797 that support it. This instructs the linker to add all symbols, not
10798 only used ones, to the dynamic symbol table. This option is needed
10799 for some uses of @code{dlopen} or to allow obtaining backtraces
10800 from within a program.
10802 @item -s
10803 @opindex s
10804 Remove all symbol table and relocation information from the executable.
10806 @item -static
10807 @opindex static
10808 On systems that support dynamic linking, this prevents linking with the shared
10809 libraries.  On other systems, this option has no effect.
10811 @item -shared
10812 @opindex shared
10813 Produce a shared object which can then be linked with other objects to
10814 form an executable.  Not all systems support this option.  For predictable
10815 results, you must also specify the same set of options used for compilation
10816 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
10817 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
10818 needs to build supplementary stub code for constructors to work.  On
10819 multi-libbed systems, @samp{gcc -shared} must select the correct support
10820 libraries to link against.  Failing to supply the correct flags may lead
10821 to subtle defects.  Supplying them in cases where they are not necessary
10822 is innocuous.}
10824 @item -shared-libgcc
10825 @itemx -static-libgcc
10826 @opindex shared-libgcc
10827 @opindex static-libgcc
10828 On systems that provide @file{libgcc} as a shared library, these options
10829 force the use of either the shared or static version, respectively.
10830 If no shared version of @file{libgcc} was built when the compiler was
10831 configured, these options have no effect.
10833 There are several situations in which an application should use the
10834 shared @file{libgcc} instead of the static version.  The most common
10835 of these is when the application wishes to throw and catch exceptions
10836 across different shared libraries.  In that case, each of the libraries
10837 as well as the application itself should use the shared @file{libgcc}.
10839 Therefore, the G++ and GCJ drivers automatically add
10840 @option{-shared-libgcc} whenever you build a shared library or a main
10841 executable, because C++ and Java programs typically use exceptions, so
10842 this is the right thing to do.
10844 If, instead, you use the GCC driver to create shared libraries, you may
10845 find that they are not always linked with the shared @file{libgcc}.
10846 If GCC finds, at its configuration time, that you have a non-GNU linker
10847 or a GNU linker that does not support option @option{--eh-frame-hdr},
10848 it links the shared version of @file{libgcc} into shared libraries
10849 by default.  Otherwise, it takes advantage of the linker and optimizes
10850 away the linking with the shared version of @file{libgcc}, linking with
10851 the static version of libgcc by default.  This allows exceptions to
10852 propagate through such shared libraries, without incurring relocation
10853 costs at library load time.
10855 However, if a library or main executable is supposed to throw or catch
10856 exceptions, you must link it using the G++ or GCJ driver, as appropriate
10857 for the languages used in the program, or using the option
10858 @option{-shared-libgcc}, such that it is linked with the shared
10859 @file{libgcc}.
10861 @item -static-libasan
10862 @opindex static-libasan
10863 When the @option{-fsanitize=address} option is used to link a program,
10864 the GCC driver automatically links against @option{libasan}.  If
10865 @file{libasan} is available as a shared library, and the @option{-static}
10866 option is not used, then this links against the shared version of
10867 @file{libasan}.  The @option{-static-libasan} option directs the GCC
10868 driver to link @file{libasan} statically, without necessarily linking
10869 other libraries statically.
10871 @item -static-libtsan
10872 @opindex static-libtsan
10873 When the @option{-fsanitize=thread} option is used to link a program,
10874 the GCC driver automatically links against @option{libtsan}.  If
10875 @file{libtsan} is available as a shared library, and the @option{-static}
10876 option is not used, then this links against the shared version of
10877 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
10878 driver to link @file{libtsan} statically, without necessarily linking
10879 other libraries statically.
10881 @item -static-liblsan
10882 @opindex static-liblsan
10883 When the @option{-fsanitize=leak} option is used to link a program,
10884 the GCC driver automatically links against @option{liblsan}.  If
10885 @file{liblsan} is available as a shared library, and the @option{-static}
10886 option is not used, then this links against the shared version of
10887 @file{liblsan}.  The @option{-static-liblsan} option directs the GCC
10888 driver to link @file{liblsan} statically, without necessarily linking
10889 other libraries statically.
10891 @item -static-libubsan
10892 @opindex static-libubsan
10893 When the @option{-fsanitize=undefined} option is used to link a program,
10894 the GCC driver automatically links against @option{libubsan}.  If
10895 @file{libubsan} is available as a shared library, and the @option{-static}
10896 option is not used, then this links against the shared version of
10897 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
10898 driver to link @file{libubsan} statically, without necessarily linking
10899 other libraries statically.
10901 @item -static-libstdc++
10902 @opindex static-libstdc++
10903 When the @command{g++} program is used to link a C++ program, it
10904 normally automatically links against @option{libstdc++}.  If
10905 @file{libstdc++} is available as a shared library, and the
10906 @option{-static} option is not used, then this links against the
10907 shared version of @file{libstdc++}.  That is normally fine.  However, it
10908 is sometimes useful to freeze the version of @file{libstdc++} used by
10909 the program without going all the way to a fully static link.  The
10910 @option{-static-libstdc++} option directs the @command{g++} driver to
10911 link @file{libstdc++} statically, without necessarily linking other
10912 libraries statically.
10914 @item -symbolic
10915 @opindex symbolic
10916 Bind references to global symbols when building a shared object.  Warn
10917 about any unresolved references (unless overridden by the link editor
10918 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
10919 this option.
10921 @item -T @var{script}
10922 @opindex T
10923 @cindex linker script
10924 Use @var{script} as the linker script.  This option is supported by most
10925 systems using the GNU linker.  On some targets, such as bare-board
10926 targets without an operating system, the @option{-T} option may be required
10927 when linking to avoid references to undefined symbols.
10929 @item -Xlinker @var{option}
10930 @opindex Xlinker
10931 Pass @var{option} as an option to the linker.  You can use this to
10932 supply system-specific linker options that GCC does not recognize.
10934 If you want to pass an option that takes a separate argument, you must use
10935 @option{-Xlinker} twice, once for the option and once for the argument.
10936 For example, to pass @option{-assert definitions}, you must write
10937 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
10938 @option{-Xlinker "-assert definitions"}, because this passes the entire
10939 string as a single argument, which is not what the linker expects.
10941 When using the GNU linker, it is usually more convenient to pass
10942 arguments to linker options using the @option{@var{option}=@var{value}}
10943 syntax than as separate arguments.  For example, you can specify
10944 @option{-Xlinker -Map=output.map} rather than
10945 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
10946 this syntax for command-line options.
10948 @item -Wl,@var{option}
10949 @opindex Wl
10950 Pass @var{option} as an option to the linker.  If @var{option} contains
10951 commas, it is split into multiple options at the commas.  You can use this
10952 syntax to pass an argument to the option.
10953 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
10954 linker.  When using the GNU linker, you can also get the same effect with
10955 @option{-Wl,-Map=output.map}.
10957 @item -u @var{symbol}
10958 @opindex u
10959 Pretend the symbol @var{symbol} is undefined, to force linking of
10960 library modules to define it.  You can use @option{-u} multiple times with
10961 different symbols to force loading of additional library modules.
10963 @item -z @var{keyword}
10964 @opindex z
10965 @option{-z} is passed directly on to the linker along with the keyword
10966 @var{keyword}. See the section in the documentation of your linker for
10967 permitted values and their meanings.
10968 @end table
10970 @node Directory Options
10971 @section Options for Directory Search
10972 @cindex directory options
10973 @cindex options, directory search
10974 @cindex search path
10976 These options specify directories to search for header files, for
10977 libraries and for parts of the compiler:
10979 @table @gcctabopt
10980 @item -I@var{dir}
10981 @opindex I
10982 Add the directory @var{dir} to the head of the list of directories to be
10983 searched for header files.  This can be used to override a system header
10984 file, substituting your own version, since these directories are
10985 searched before the system header file directories.  However, you should
10986 not use this option to add directories that contain vendor-supplied
10987 system header files (use @option{-isystem} for that).  If you use more than
10988 one @option{-I} option, the directories are scanned in left-to-right
10989 order; the standard system directories come after.
10991 If a standard system include directory, or a directory specified with
10992 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
10993 option is ignored.  The directory is still searched but as a
10994 system directory at its normal position in the system include chain.
10995 This is to ensure that GCC's procedure to fix buggy system headers and
10996 the ordering for the @code{include_next} directive are not inadvertently changed.
10997 If you really need to change the search order for system directories,
10998 use the @option{-nostdinc} and/or @option{-isystem} options.
11000 @item -iplugindir=@var{dir}
11001 @opindex iplugindir=
11002 Set the directory to search for plugins that are passed
11003 by @option{-fplugin=@var{name}} instead of
11004 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
11005 to be used by the user, but only passed by the driver.
11007 @item -iquote@var{dir}
11008 @opindex iquote
11009 Add the directory @var{dir} to the head of the list of directories to
11010 be searched for header files only for the case of @samp{#include
11011 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
11012 otherwise just like @option{-I}.
11014 @item -L@var{dir}
11015 @opindex L
11016 Add directory @var{dir} to the list of directories to be searched
11017 for @option{-l}.
11019 @item -B@var{prefix}
11020 @opindex B
11021 This option specifies where to find the executables, libraries,
11022 include files, and data files of the compiler itself.
11024 The compiler driver program runs one or more of the subprograms
11025 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
11026 @var{prefix} as a prefix for each program it tries to run, both with and
11027 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
11029 For each subprogram to be run, the compiler driver first tries the
11030 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
11031 is not specified, the driver tries two standard prefixes, 
11032 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
11033 those results in a file name that is found, the unmodified program
11034 name is searched for using the directories specified in your
11035 @env{PATH} environment variable.
11037 The compiler checks to see if the path provided by the @option{-B}
11038 refers to a directory, and if necessary it adds a directory
11039 separator character at the end of the path.
11041 @option{-B} prefixes that effectively specify directory names also apply
11042 to libraries in the linker, because the compiler translates these
11043 options into @option{-L} options for the linker.  They also apply to
11044 include files in the preprocessor, because the compiler translates these
11045 options into @option{-isystem} options for the preprocessor.  In this case,
11046 the compiler appends @samp{include} to the prefix.
11048 The runtime support file @file{libgcc.a} can also be searched for using
11049 the @option{-B} prefix, if needed.  If it is not found there, the two
11050 standard prefixes above are tried, and that is all.  The file is left
11051 out of the link if it is not found by those means.
11053 Another way to specify a prefix much like the @option{-B} prefix is to use
11054 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
11055 Variables}.
11057 As a special kludge, if the path provided by @option{-B} is
11058 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
11059 9, then it is replaced by @file{[dir/]include}.  This is to help
11060 with boot-strapping the compiler.
11062 @item -specs=@var{file}
11063 @opindex specs
11064 Process @var{file} after the compiler reads in the standard @file{specs}
11065 file, in order to override the defaults which the @command{gcc} driver
11066 program uses when determining what switches to pass to @command{cc1},
11067 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
11068 @option{-specs=@var{file}} can be specified on the command line, and they
11069 are processed in order, from left to right.
11071 @item --sysroot=@var{dir}
11072 @opindex sysroot
11073 Use @var{dir} as the logical root directory for headers and libraries.
11074 For example, if the compiler normally searches for headers in
11075 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
11076 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
11078 If you use both this option and the @option{-isysroot} option, then
11079 the @option{--sysroot} option applies to libraries, but the
11080 @option{-isysroot} option applies to header files.
11082 The GNU linker (beginning with version 2.16) has the necessary support
11083 for this option.  If your linker does not support this option, the
11084 header file aspect of @option{--sysroot} still works, but the
11085 library aspect does not.
11087 @item --no-sysroot-suffix
11088 @opindex no-sysroot-suffix
11089 For some targets, a suffix is added to the root directory specified
11090 with @option{--sysroot}, depending on the other options used, so that
11091 headers may for example be found in
11092 @file{@var{dir}/@var{suffix}/usr/include} instead of
11093 @file{@var{dir}/usr/include}.  This option disables the addition of
11094 such a suffix.
11096 @item -I-
11097 @opindex I-
11098 This option has been deprecated.  Please use @option{-iquote} instead for
11099 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
11100 Any directories you specify with @option{-I} options before the @option{-I-}
11101 option are searched only for the case of @samp{#include "@var{file}"};
11102 they are not searched for @samp{#include <@var{file}>}.
11104 If additional directories are specified with @option{-I} options after
11105 the @option{-I-}, these directories are searched for all @samp{#include}
11106 directives.  (Ordinarily @emph{all} @option{-I} directories are used
11107 this way.)
11109 In addition, the @option{-I-} option inhibits the use of the current
11110 directory (where the current input file came from) as the first search
11111 directory for @samp{#include "@var{file}"}.  There is no way to
11112 override this effect of @option{-I-}.  With @option{-I.} you can specify
11113 searching the directory that is current when the compiler is
11114 invoked.  That is not exactly the same as what the preprocessor does
11115 by default, but it is often satisfactory.
11117 @option{-I-} does not inhibit the use of the standard system directories
11118 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
11119 independent.
11120 @end table
11122 @c man end
11124 @node Spec Files
11125 @section Specifying subprocesses and the switches to pass to them
11126 @cindex Spec Files
11128 @command{gcc} is a driver program.  It performs its job by invoking a
11129 sequence of other programs to do the work of compiling, assembling and
11130 linking.  GCC interprets its command-line parameters and uses these to
11131 deduce which programs it should invoke, and which command-line options
11132 it ought to place on their command lines.  This behavior is controlled
11133 by @dfn{spec strings}.  In most cases there is one spec string for each
11134 program that GCC can invoke, but a few programs have multiple spec
11135 strings to control their behavior.  The spec strings built into GCC can
11136 be overridden by using the @option{-specs=} command-line switch to specify
11137 a spec file.
11139 @dfn{Spec files} are plaintext files that are used to construct spec
11140 strings.  They consist of a sequence of directives separated by blank
11141 lines.  The type of directive is determined by the first non-whitespace
11142 character on the line, which can be one of the following:
11144 @table @code
11145 @item %@var{command}
11146 Issues a @var{command} to the spec file processor.  The commands that can
11147 appear here are:
11149 @table @code
11150 @item %include <@var{file}>
11151 @cindex @code{%include}
11152 Search for @var{file} and insert its text at the current point in the
11153 specs file.
11155 @item %include_noerr <@var{file}>
11156 @cindex @code{%include_noerr}
11157 Just like @samp{%include}, but do not generate an error message if the include
11158 file cannot be found.
11160 @item %rename @var{old_name} @var{new_name}
11161 @cindex @code{%rename}
11162 Rename the spec string @var{old_name} to @var{new_name}.
11164 @end table
11166 @item *[@var{spec_name}]:
11167 This tells the compiler to create, override or delete the named spec
11168 string.  All lines after this directive up to the next directive or
11169 blank line are considered to be the text for the spec string.  If this
11170 results in an empty string then the spec is deleted.  (Or, if the
11171 spec did not exist, then nothing happens.)  Otherwise, if the spec
11172 does not currently exist a new spec is created.  If the spec does
11173 exist then its contents are overridden by the text of this
11174 directive, unless the first character of that text is the @samp{+}
11175 character, in which case the text is appended to the spec.
11177 @item [@var{suffix}]:
11178 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
11179 and up to the next directive or blank line are considered to make up the
11180 spec string for the indicated suffix.  When the compiler encounters an
11181 input file with the named suffix, it processes the spec string in
11182 order to work out how to compile that file.  For example:
11184 @smallexample
11185 .ZZ:
11186 z-compile -input %i
11187 @end smallexample
11189 This says that any input file whose name ends in @samp{.ZZ} should be
11190 passed to the program @samp{z-compile}, which should be invoked with the
11191 command-line switch @option{-input} and with the result of performing the
11192 @samp{%i} substitution.  (See below.)
11194 As an alternative to providing a spec string, the text following a
11195 suffix directive can be one of the following:
11197 @table @code
11198 @item @@@var{language}
11199 This says that the suffix is an alias for a known @var{language}.  This is
11200 similar to using the @option{-x} command-line switch to GCC to specify a
11201 language explicitly.  For example:
11203 @smallexample
11204 .ZZ:
11205 @@c++
11206 @end smallexample
11208 Says that .ZZ files are, in fact, C++ source files.
11210 @item #@var{name}
11211 This causes an error messages saying:
11213 @smallexample
11214 @var{name} compiler not installed on this system.
11215 @end smallexample
11216 @end table
11218 GCC already has an extensive list of suffixes built into it.
11219 This directive adds an entry to the end of the list of suffixes, but
11220 since the list is searched from the end backwards, it is effectively
11221 possible to override earlier entries using this technique.
11223 @end table
11225 GCC has the following spec strings built into it.  Spec files can
11226 override these strings or create their own.  Note that individual
11227 targets can also add their own spec strings to this list.
11229 @smallexample
11230 asm          Options to pass to the assembler
11231 asm_final    Options to pass to the assembler post-processor
11232 cpp          Options to pass to the C preprocessor
11233 cc1          Options to pass to the C compiler
11234 cc1plus      Options to pass to the C++ compiler
11235 endfile      Object files to include at the end of the link
11236 link         Options to pass to the linker
11237 lib          Libraries to include on the command line to the linker
11238 libgcc       Decides which GCC support library to pass to the linker
11239 linker       Sets the name of the linker
11240 predefines   Defines to be passed to the C preprocessor
11241 signed_char  Defines to pass to CPP to say whether @code{char} is signed
11242              by default
11243 startfile    Object files to include at the start of the link
11244 @end smallexample
11246 Here is a small example of a spec file:
11248 @smallexample
11249 %rename lib                 old_lib
11251 *lib:
11252 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
11253 @end smallexample
11255 This example renames the spec called @samp{lib} to @samp{old_lib} and
11256 then overrides the previous definition of @samp{lib} with a new one.
11257 The new definition adds in some extra command-line options before
11258 including the text of the old definition.
11260 @dfn{Spec strings} are a list of command-line options to be passed to their
11261 corresponding program.  In addition, the spec strings can contain
11262 @samp{%}-prefixed sequences to substitute variable text or to
11263 conditionally insert text into the command line.  Using these constructs
11264 it is possible to generate quite complex command lines.
11266 Here is a table of all defined @samp{%}-sequences for spec
11267 strings.  Note that spaces are not generated automatically around the
11268 results of expanding these sequences.  Therefore you can concatenate them
11269 together or combine them with constant text in a single argument.
11271 @table @code
11272 @item %%
11273 Substitute one @samp{%} into the program name or argument.
11275 @item %i
11276 Substitute the name of the input file being processed.
11278 @item %b
11279 Substitute the basename of the input file being processed.
11280 This is the substring up to (and not including) the last period
11281 and not including the directory.
11283 @item %B
11284 This is the same as @samp{%b}, but include the file suffix (text after
11285 the last period).
11287 @item %d
11288 Marks the argument containing or following the @samp{%d} as a
11289 temporary file name, so that that file is deleted if GCC exits
11290 successfully.  Unlike @samp{%g}, this contributes no text to the
11291 argument.
11293 @item %g@var{suffix}
11294 Substitute a file name that has suffix @var{suffix} and is chosen
11295 once per compilation, and mark the argument in the same way as
11296 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
11297 name is now chosen in a way that is hard to predict even when previously
11298 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
11299 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
11300 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
11301 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
11302 was simply substituted with a file name chosen once per compilation,
11303 without regard to any appended suffix (which was therefore treated
11304 just like ordinary text), making such attacks more likely to succeed.
11306 @item %u@var{suffix}
11307 Like @samp{%g}, but generates a new temporary file name
11308 each time it appears instead of once per compilation.
11310 @item %U@var{suffix}
11311 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
11312 new one if there is no such last file name.  In the absence of any
11313 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
11314 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
11315 involves the generation of two distinct file names, one
11316 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
11317 simply substituted with a file name chosen for the previous @samp{%u},
11318 without regard to any appended suffix.
11320 @item %j@var{suffix}
11321 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
11322 writable, and if @option{-save-temps} is not used; 
11323 otherwise, substitute the name
11324 of a temporary file, just like @samp{%u}.  This temporary file is not
11325 meant for communication between processes, but rather as a junk
11326 disposal mechanism.
11328 @item %|@var{suffix}
11329 @itemx %m@var{suffix}
11330 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
11331 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
11332 all.  These are the two most common ways to instruct a program that it
11333 should read from standard input or write to standard output.  If you
11334 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
11335 construct: see for example @file{f/lang-specs.h}.
11337 @item %.@var{SUFFIX}
11338 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
11339 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
11340 terminated by the next space or %.
11342 @item %w
11343 Marks the argument containing or following the @samp{%w} as the
11344 designated output file of this compilation.  This puts the argument
11345 into the sequence of arguments that @samp{%o} substitutes.
11347 @item %o
11348 Substitutes the names of all the output files, with spaces
11349 automatically placed around them.  You should write spaces
11350 around the @samp{%o} as well or the results are undefined.
11351 @samp{%o} is for use in the specs for running the linker.
11352 Input files whose names have no recognized suffix are not compiled
11353 at all, but they are included among the output files, so they are
11354 linked.
11356 @item %O
11357 Substitutes the suffix for object files.  Note that this is
11358 handled specially when it immediately follows @samp{%g, %u, or %U},
11359 because of the need for those to form complete file names.  The
11360 handling is such that @samp{%O} is treated exactly as if it had already
11361 been substituted, except that @samp{%g, %u, and %U} do not currently
11362 support additional @var{suffix} characters following @samp{%O} as they do
11363 following, for example, @samp{.o}.
11365 @item %p
11366 Substitutes the standard macro predefinitions for the
11367 current target machine.  Use this when running @code{cpp}.
11369 @item %P
11370 Like @samp{%p}, but puts @samp{__} before and after the name of each
11371 predefined macro, except for macros that start with @samp{__} or with
11372 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
11375 @item %I
11376 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
11377 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
11378 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
11379 and @option{-imultilib} as necessary.
11381 @item %s
11382 Current argument is the name of a library or startup file of some sort.
11383 Search for that file in a standard list of directories and substitute
11384 the full name found.  The current working directory is included in the
11385 list of directories scanned.
11387 @item %T
11388 Current argument is the name of a linker script.  Search for that file
11389 in the current list of directories to scan for libraries. If the file
11390 is located insert a @option{--script} option into the command line
11391 followed by the full path name found.  If the file is not found then
11392 generate an error message.  Note: the current working directory is not
11393 searched.
11395 @item %e@var{str}
11396 Print @var{str} as an error message.  @var{str} is terminated by a newline.
11397 Use this when inconsistent options are detected.
11399 @item %(@var{name})
11400 Substitute the contents of spec string @var{name} at this point.
11402 @item %x@{@var{option}@}
11403 Accumulate an option for @samp{%X}.
11405 @item %X
11406 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
11407 spec string.
11409 @item %Y
11410 Output the accumulated assembler options specified by @option{-Wa}.
11412 @item %Z
11413 Output the accumulated preprocessor options specified by @option{-Wp}.
11415 @item %a
11416 Process the @code{asm} spec.  This is used to compute the
11417 switches to be passed to the assembler.
11419 @item %A
11420 Process the @code{asm_final} spec.  This is a spec string for
11421 passing switches to an assembler post-processor, if such a program is
11422 needed.
11424 @item %l
11425 Process the @code{link} spec.  This is the spec for computing the
11426 command line passed to the linker.  Typically it makes use of the
11427 @samp{%L %G %S %D and %E} sequences.
11429 @item %D
11430 Dump out a @option{-L} option for each directory that GCC believes might
11431 contain startup files.  If the target supports multilibs then the
11432 current multilib directory is prepended to each of these paths.
11434 @item %L
11435 Process the @code{lib} spec.  This is a spec string for deciding which
11436 libraries are included on the command line to the linker.
11438 @item %G
11439 Process the @code{libgcc} spec.  This is a spec string for deciding
11440 which GCC support library is included on the command line to the linker.
11442 @item %S
11443 Process the @code{startfile} spec.  This is a spec for deciding which
11444 object files are the first ones passed to the linker.  Typically
11445 this might be a file named @file{crt0.o}.
11447 @item %E
11448 Process the @code{endfile} spec.  This is a spec string that specifies
11449 the last object files that are passed to the linker.
11451 @item %C
11452 Process the @code{cpp} spec.  This is used to construct the arguments
11453 to be passed to the C preprocessor.
11455 @item %1
11456 Process the @code{cc1} spec.  This is used to construct the options to be
11457 passed to the actual C compiler (@samp{cc1}).
11459 @item %2
11460 Process the @code{cc1plus} spec.  This is used to construct the options to be
11461 passed to the actual C++ compiler (@samp{cc1plus}).
11463 @item %*
11464 Substitute the variable part of a matched option.  See below.
11465 Note that each comma in the substituted string is replaced by
11466 a single space.
11468 @item %<@code{S}
11469 Remove all occurrences of @code{-S} from the command line.  Note---this
11470 command is position dependent.  @samp{%} commands in the spec string
11471 before this one see @code{-S}, @samp{%} commands in the spec string
11472 after this one do not.
11474 @item %:@var{function}(@var{args})
11475 Call the named function @var{function}, passing it @var{args}.
11476 @var{args} is first processed as a nested spec string, then split
11477 into an argument vector in the usual fashion.  The function returns
11478 a string which is processed as if it had appeared literally as part
11479 of the current spec.
11481 The following built-in spec functions are provided:
11483 @table @code
11484 @item @code{getenv}
11485 The @code{getenv} spec function takes two arguments: an environment
11486 variable name and a string.  If the environment variable is not
11487 defined, a fatal error is issued.  Otherwise, the return value is the
11488 value of the environment variable concatenated with the string.  For
11489 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
11491 @smallexample
11492 %:getenv(TOPDIR /include)
11493 @end smallexample
11495 expands to @file{/path/to/top/include}.
11497 @item @code{if-exists}
11498 The @code{if-exists} spec function takes one argument, an absolute
11499 pathname to a file.  If the file exists, @code{if-exists} returns the
11500 pathname.  Here is a small example of its usage:
11502 @smallexample
11503 *startfile:
11504 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
11505 @end smallexample
11507 @item @code{if-exists-else}
11508 The @code{if-exists-else} spec function is similar to the @code{if-exists}
11509 spec function, except that it takes two arguments.  The first argument is
11510 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
11511 returns the pathname.  If it does not exist, it returns the second argument.
11512 This way, @code{if-exists-else} can be used to select one file or another,
11513 based on the existence of the first.  Here is a small example of its usage:
11515 @smallexample
11516 *startfile:
11517 crt0%O%s %:if-exists(crti%O%s) \
11518 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
11519 @end smallexample
11521 @item @code{replace-outfile}
11522 The @code{replace-outfile} spec function takes two arguments.  It looks for the
11523 first argument in the outfiles array and replaces it with the second argument.  Here
11524 is a small example of its usage:
11526 @smallexample
11527 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
11528 @end smallexample
11530 @item @code{remove-outfile}
11531 The @code{remove-outfile} spec function takes one argument.  It looks for the
11532 first argument in the outfiles array and removes it.  Here is a small example
11533 its usage:
11535 @smallexample
11536 %:remove-outfile(-lm)
11537 @end smallexample
11539 @item @code{pass-through-libs}
11540 The @code{pass-through-libs} spec function takes any number of arguments.  It
11541 finds any @option{-l} options and any non-options ending in @file{.a} (which it
11542 assumes are the names of linker input library archive files) and returns a
11543 result containing all the found arguments each prepended by
11544 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
11545 intended to be passed to the LTO linker plugin.
11547 @smallexample
11548 %:pass-through-libs(%G %L %G)
11549 @end smallexample
11551 @item @code{print-asm-header}
11552 The @code{print-asm-header} function takes no arguments and simply
11553 prints a banner like:
11555 @smallexample
11556 Assembler options
11557 =================
11559 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
11560 @end smallexample
11562 It is used to separate compiler options from assembler options
11563 in the @option{--target-help} output.
11564 @end table
11566 @item %@{@code{S}@}
11567 Substitutes the @code{-S} switch, if that switch is given to GCC@.
11568 If that switch is not specified, this substitutes nothing.  Note that
11569 the leading dash is omitted when specifying this option, and it is
11570 automatically inserted if the substitution is performed.  Thus the spec
11571 string @samp{%@{foo@}} matches the command-line option @option{-foo}
11572 and outputs the command-line option @option{-foo}.
11574 @item %W@{@code{S}@}
11575 Like %@{@code{S}@} but mark last argument supplied within as a file to be
11576 deleted on failure.
11578 @item %@{@code{S}*@}
11579 Substitutes all the switches specified to GCC whose names start
11580 with @code{-S}, but which also take an argument.  This is used for
11581 switches like @option{-o}, @option{-D}, @option{-I}, etc.
11582 GCC considers @option{-o foo} as being
11583 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
11584 text, including the space.  Thus two arguments are generated.
11586 @item %@{@code{S}*&@code{T}*@}
11587 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
11588 (the order of @code{S} and @code{T} in the spec is not significant).
11589 There can be any number of ampersand-separated variables; for each the
11590 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
11592 @item %@{@code{S}:@code{X}@}
11593 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
11595 @item %@{!@code{S}:@code{X}@}
11596 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
11598 @item %@{@code{S}*:@code{X}@}
11599 Substitutes @code{X} if one or more switches whose names start with
11600 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
11601 once, no matter how many such switches appeared.  However, if @code{%*}
11602 appears somewhere in @code{X}, then @code{X} is substituted once
11603 for each matching switch, with the @code{%*} replaced by the part of
11604 that switch matching the @code{*}.
11606 If @code{%*} appears as the last part of a spec sequence then a space
11607 will be added after the end of the last substitution.  If there is more
11608 text in the sequence however then a space will not be generated.  This
11609 allows the @code{%*} substitution to be used as part of a larger
11610 string.  For example, a spec string like this:
11612 @smallexample
11613 %@{mcu=*:--script=%*/memory.ld@}
11614 @end smallexample
11616 when matching an option like @code{-mcu=newchip} will produce:
11618 @smallexample
11619 --script=newchip/memory.ld
11620 @end smallexample
11622 @item %@{.@code{S}:@code{X}@}
11623 Substitutes @code{X}, if processing a file with suffix @code{S}.
11625 @item %@{!.@code{S}:@code{X}@}
11626 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
11628 @item %@{,@code{S}:@code{X}@}
11629 Substitutes @code{X}, if processing a file for language @code{S}.
11631 @item %@{!,@code{S}:@code{X}@}
11632 Substitutes @code{X}, if not processing a file for language @code{S}.
11634 @item %@{@code{S}|@code{P}:@code{X}@}
11635 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
11636 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
11637 @code{*} sequences as well, although they have a stronger binding than
11638 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
11639 alternatives must be starred, and only the first matching alternative
11640 is substituted.
11642 For example, a spec string like this:
11644 @smallexample
11645 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
11646 @end smallexample
11648 @noindent
11649 outputs the following command-line options from the following input
11650 command-line options:
11652 @smallexample
11653 fred.c        -foo -baz
11654 jim.d         -bar -boggle
11655 -d fred.c     -foo -baz -boggle
11656 -d jim.d      -bar -baz -boggle
11657 @end smallexample
11659 @item %@{S:X; T:Y; :D@}
11661 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
11662 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
11663 be as many clauses as you need.  This may be combined with @code{.},
11664 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
11667 @end table
11669 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
11670 construct may contain other nested @samp{%} constructs or spaces, or
11671 even newlines.  They are processed as usual, as described above.
11672 Trailing white space in @code{X} is ignored.  White space may also
11673 appear anywhere on the left side of the colon in these constructs,
11674 except between @code{.} or @code{*} and the corresponding word.
11676 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
11677 handled specifically in these constructs.  If another value of
11678 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
11679 @option{-W} switch is found later in the command line, the earlier
11680 switch value is ignored, except with @{@code{S}*@} where @code{S} is
11681 just one letter, which passes all matching options.
11683 The character @samp{|} at the beginning of the predicate text is used to
11684 indicate that a command should be piped to the following command, but
11685 only if @option{-pipe} is specified.
11687 It is built into GCC which switches take arguments and which do not.
11688 (You might think it would be useful to generalize this to allow each
11689 compiler's spec to say which switches take arguments.  But this cannot
11690 be done in a consistent fashion.  GCC cannot even decide which input
11691 files have been specified without knowing which switches take arguments,
11692 and it must know which input files to compile in order to tell which
11693 compilers to run).
11695 GCC also knows implicitly that arguments starting in @option{-l} are to be
11696 treated as compiler output files, and passed to the linker in their
11697 proper position among the other output files.
11699 @c man begin OPTIONS
11701 @node Target Options
11702 @section Specifying Target Machine and Compiler Version
11703 @cindex target options
11704 @cindex cross compiling
11705 @cindex specifying machine version
11706 @cindex specifying compiler version and target machine
11707 @cindex compiler version, specifying
11708 @cindex target machine, specifying
11710 The usual way to run GCC is to run the executable called @command{gcc}, or
11711 @command{@var{machine}-gcc} when cross-compiling, or
11712 @command{@var{machine}-gcc-@var{version}} to run a version other than the
11713 one that was installed last.
11715 @node Submodel Options
11716 @section Hardware Models and Configurations
11717 @cindex submodel options
11718 @cindex specifying hardware config
11719 @cindex hardware models and configurations, specifying
11720 @cindex machine dependent options
11722 Each target machine types can have its own
11723 special options, starting with @samp{-m}, to choose among various
11724 hardware models or configurations---for example, 68010 vs 68020,
11725 floating coprocessor or none.  A single installed version of the
11726 compiler can compile for any model or configuration, according to the
11727 options specified.
11729 Some configurations of the compiler also support additional special
11730 options, usually for compatibility with other compilers on the same
11731 platform.
11733 @c This list is ordered alphanumerically by subsection name.
11734 @c It should be the same order and spelling as these options are listed
11735 @c in Machine Dependent Options
11737 @menu
11738 * AArch64 Options::
11739 * Adapteva Epiphany Options::
11740 * ARC Options::
11741 * ARM Options::
11742 * AVR Options::
11743 * Blackfin Options::
11744 * C6X Options::
11745 * CRIS Options::
11746 * CR16 Options::
11747 * Darwin Options::
11748 * DEC Alpha Options::
11749 * FR30 Options::
11750 * FRV Options::
11751 * GNU/Linux Options::
11752 * H8/300 Options::
11753 * HPPA Options::
11754 * i386 and x86-64 Options::
11755 * i386 and x86-64 Windows Options::
11756 * IA-64 Options::
11757 * LM32 Options::
11758 * M32C Options::
11759 * M32R/D Options::
11760 * M680x0 Options::
11761 * MCore Options::
11762 * MeP Options::
11763 * MicroBlaze Options::
11764 * MIPS Options::
11765 * MMIX Options::
11766 * MN10300 Options::
11767 * Moxie Options::
11768 * MSP430 Options::
11769 * NDS32 Options::
11770 * Nios II Options::
11771 * PDP-11 Options::
11772 * picoChip Options::
11773 * PowerPC Options::
11774 * RL78 Options::
11775 * RS/6000 and PowerPC Options::
11776 * RX Options::
11777 * S/390 and zSeries Options::
11778 * Score Options::
11779 * SH Options::
11780 * Solaris 2 Options::
11781 * SPARC Options::
11782 * SPU Options::
11783 * System V Options::
11784 * TILE-Gx Options::
11785 * TILEPro Options::
11786 * V850 Options::
11787 * VAX Options::
11788 * VMS Options::
11789 * VxWorks Options::
11790 * x86-64 Options::
11791 * Xstormy16 Options::
11792 * Xtensa Options::
11793 * zSeries Options::
11794 @end menu
11796 @node AArch64 Options
11797 @subsection AArch64 Options
11798 @cindex AArch64 Options
11800 These options are defined for AArch64 implementations:
11802 @table @gcctabopt
11804 @item -mabi=@var{name}
11805 @opindex mabi
11806 Generate code for the specified data model.  Permissible values
11807 are @samp{ilp32} for SysV-like data model where int, long int and pointer
11808 are 32-bit, and @samp{lp64} for SysV-like data model where int is 32-bit,
11809 but long int and pointer are 64-bit.
11811 The default depends on the specific target configuration.  Note that
11812 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
11813 entire program with the same ABI, and link with a compatible set of libraries.
11815 @item -mbig-endian
11816 @opindex mbig-endian
11817 Generate big-endian code.  This is the default when GCC is configured for an
11818 @samp{aarch64_be-*-*} target.
11820 @item -mgeneral-regs-only
11821 @opindex mgeneral-regs-only
11822 Generate code which uses only the general registers.
11824 @item -mlittle-endian
11825 @opindex mlittle-endian
11826 Generate little-endian code.  This is the default when GCC is configured for an
11827 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
11829 @item -mcmodel=tiny
11830 @opindex mcmodel=tiny
11831 Generate code for the tiny code model.  The program and its statically defined
11832 symbols must be within 1GB of each other.  Pointers are 64 bits.  Programs can
11833 be statically or dynamically linked.  This model is not fully implemented and
11834 mostly treated as @samp{small}.
11836 @item -mcmodel=small
11837 @opindex mcmodel=small
11838 Generate code for the small code model.  The program and its statically defined
11839 symbols must be within 4GB of each other.  Pointers are 64 bits.  Programs can
11840 be statically or dynamically linked.  This is the default code model.
11842 @item -mcmodel=large
11843 @opindex mcmodel=large
11844 Generate code for the large code model.  This makes no assumptions about
11845 addresses and sizes of sections.  Pointers are 64 bits.  Programs can be
11846 statically linked only.
11848 @item -mstrict-align
11849 @opindex mstrict-align
11850 Do not assume that unaligned memory references will be handled by the system.
11852 @item -momit-leaf-frame-pointer
11853 @itemx -mno-omit-leaf-frame-pointer
11854 @opindex momit-leaf-frame-pointer
11855 @opindex mno-omit-leaf-frame-pointer
11856 Omit or keep the frame pointer in leaf functions.  The former behaviour is the
11857 default.
11859 @item -mtls-dialect=desc
11860 @opindex mtls-dialect=desc
11861 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
11862 of TLS variables.  This is the default.
11864 @item -mtls-dialect=traditional
11865 @opindex mtls-dialect=traditional
11866 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
11867 of TLS variables.
11869 @item -mfix-cortex-a53-835769
11870 @itemx -mno-fix-cortex-a53-835769
11871 @opindex -mfix-cortex-a53-835769
11872 @opindex -mno-fix-cortex-a53-835769
11873 Enable or disable the workaround for the ARM Cortex-A53 erratum number 835769.
11874 This will involve inserting a NOP instruction between memory instructions and
11875 64-bit integer multiply-accumulate instructions.
11877 @item -march=@var{name}
11878 @opindex march
11879 Specify the name of the target architecture, optionally suffixed by one or
11880 more feature modifiers.  This option has the form
11881 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
11882 only permissible value for @var{arch} is @samp{armv8-a}.  The permissible
11883 values for @var{feature} are documented in the sub-section below.
11885 Where conflicting feature modifiers are specified, the right-most feature is
11886 used.
11888 GCC uses this name to determine what kind of instructions it can emit when
11889 generating assembly code.
11891 Where @option{-march} is specified without either of @option{-mtune}
11892 or @option{-mcpu} also being specified, the code will be tuned to perform
11893 well across a range of target processors implementing the target
11894 architecture.
11896 @item -mtune=@var{name}
11897 @opindex mtune
11898 Specify the name of the target processor for which GCC should tune the
11899 performance of the code.  Permissible values for this option are:
11900 @samp{generic}, @samp{cortex-a53}, @samp{cortex-a57}, @samp{thunderx}.
11902 Additionally, this option can specify that GCC should tune the performance
11903 of the code for a big.LITTLE system.  The only permissible value is
11904 @samp{cortex-a57.cortex-a53}.
11906 Where none of @option{-mtune=}, @option{-mcpu=} or @option{-march=}
11907 are specified, the code will be tuned to perform well across a range
11908 of target processors.
11910 This option cannot be suffixed by feature modifiers.
11912 @item -mcpu=@var{name}
11913 @opindex mcpu
11914 Specify the name of the target processor, optionally suffixed by one or more
11915 feature modifiers.  This option has the form
11916 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
11917 permissible values for @var{cpu} are the same as those available for
11918 @option{-mtune}.
11920 The permissible values for @var{feature} are documented in the sub-section
11921 below.
11923 Where conflicting feature modifiers are specified, the right-most feature is
11924 used.
11926 GCC uses this name to determine what kind of instructions it can emit when
11927 generating assembly code (as if by @option{-march}) and to determine
11928 the target processor for which to tune for performance (as if
11929 by @option{-mtune}).  Where this option is used in conjunction
11930 with @option{-march} or @option{-mtune}, those options take precedence
11931 over the appropriate part of this option.
11932 @end table
11934 @subsubsection @option{-march} and @option{-mcpu} feature modifiers
11935 @cindex @option{-march} feature modifiers
11936 @cindex @option{-mcpu} feature modifiers
11937 Feature modifiers used with @option{-march} and @option{-mcpu} can be one
11938 the following:
11940 @table @samp
11941 @item crc
11942 Enable CRC extension.
11943 @item crypto
11944 Enable Crypto extension.  This implies Advanced SIMD is enabled.
11945 @item fp
11946 Enable floating-point instructions.
11947 @item simd
11948 Enable Advanced SIMD instructions.  This implies floating-point instructions
11949 are enabled.  This is the default for all current possible values for options
11950 @option{-march} and @option{-mcpu=}.
11951 @end table
11953 @node Adapteva Epiphany Options
11954 @subsection Adapteva Epiphany Options
11956 These @samp{-m} options are defined for Adapteva Epiphany:
11958 @table @gcctabopt
11959 @item -mhalf-reg-file
11960 @opindex mhalf-reg-file
11961 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
11962 That allows code to run on hardware variants that lack these registers.
11964 @item -mprefer-short-insn-regs
11965 @opindex mprefer-short-insn-regs
11966 Preferrentially allocate registers that allow short instruction generation.
11967 This can result in increased instruction count, so this may either reduce or
11968 increase overall code size.
11970 @item -mbranch-cost=@var{num}
11971 @opindex mbranch-cost
11972 Set the cost of branches to roughly @var{num} ``simple'' instructions.
11973 This cost is only a heuristic and is not guaranteed to produce
11974 consistent results across releases.
11976 @item -mcmove
11977 @opindex mcmove
11978 Enable the generation of conditional moves.
11980 @item -mnops=@var{num}
11981 @opindex mnops
11982 Emit @var{num} NOPs before every other generated instruction.
11984 @item -mno-soft-cmpsf
11985 @opindex mno-soft-cmpsf
11986 For single-precision floating-point comparisons, emit an @code{fsub} instruction
11987 and test the flags.  This is faster than a software comparison, but can
11988 get incorrect results in the presence of NaNs, or when two different small
11989 numbers are compared such that their difference is calculated as zero.
11990 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
11991 software comparisons.
11993 @item -mstack-offset=@var{num}
11994 @opindex mstack-offset
11995 Set the offset between the top of the stack and the stack pointer.
11996 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
11997 can be used by leaf functions without stack allocation.
11998 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
11999 Note also that this option changes the ABI; compiling a program with a
12000 different stack offset than the libraries have been compiled with
12001 generally does not work.
12002 This option can be useful if you want to evaluate if a different stack
12003 offset would give you better code, but to actually use a different stack
12004 offset to build working programs, it is recommended to configure the
12005 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
12007 @item -mno-round-nearest
12008 @opindex mno-round-nearest
12009 Make the scheduler assume that the rounding mode has been set to
12010 truncating.  The default is @option{-mround-nearest}.
12012 @item -mlong-calls
12013 @opindex mlong-calls
12014 If not otherwise specified by an attribute, assume all calls might be beyond
12015 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
12016 function address into a register before performing a (otherwise direct) call.
12017 This is the default.
12019 @item -mshort-calls
12020 @opindex short-calls
12021 If not otherwise specified by an attribute, assume all direct calls are
12022 in the range of the @code{b} / @code{bl} instructions, so use these instructions
12023 for direct calls.  The default is @option{-mlong-calls}.
12025 @item -msmall16
12026 @opindex msmall16
12027 Assume addresses can be loaded as 16-bit unsigned values.  This does not
12028 apply to function addresses for which @option{-mlong-calls} semantics
12029 are in effect.
12031 @item -mfp-mode=@var{mode}
12032 @opindex mfp-mode
12033 Set the prevailing mode of the floating-point unit.
12034 This determines the floating-point mode that is provided and expected
12035 at function call and return time.  Making this mode match the mode you
12036 predominantly need at function start can make your programs smaller and
12037 faster by avoiding unnecessary mode switches.
12039 @var{mode} can be set to one the following values:
12041 @table @samp
12042 @item caller
12043 Any mode at function entry is valid, and retained or restored when
12044 the function returns, and when it calls other functions.
12045 This mode is useful for compiling libraries or other compilation units
12046 you might want to incorporate into different programs with different
12047 prevailing FPU modes, and the convenience of being able to use a single
12048 object file outweighs the size and speed overhead for any extra
12049 mode switching that might be needed, compared with what would be needed
12050 with a more specific choice of prevailing FPU mode.
12052 @item truncate
12053 This is the mode used for floating-point calculations with
12054 truncating (i.e.@: round towards zero) rounding mode.  That includes
12055 conversion from floating point to integer.
12057 @item round-nearest
12058 This is the mode used for floating-point calculations with
12059 round-to-nearest-or-even rounding mode.
12061 @item int
12062 This is the mode used to perform integer calculations in the FPU, e.g.@:
12063 integer multiply, or integer multiply-and-accumulate.
12064 @end table
12066 The default is @option{-mfp-mode=caller}
12068 @item -mnosplit-lohi
12069 @itemx -mno-postinc
12070 @itemx -mno-postmodify
12071 @opindex mnosplit-lohi
12072 @opindex mno-postinc
12073 @opindex mno-postmodify
12074 Code generation tweaks that disable, respectively, splitting of 32-bit
12075 loads, generation of post-increment addresses, and generation of
12076 post-modify addresses.  The defaults are @option{msplit-lohi},
12077 @option{-mpost-inc}, and @option{-mpost-modify}.
12079 @item -mnovect-double
12080 @opindex mno-vect-double
12081 Change the preferred SIMD mode to SImode.  The default is
12082 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
12084 @item -max-vect-align=@var{num}
12085 @opindex max-vect-align
12086 The maximum alignment for SIMD vector mode types.
12087 @var{num} may be 4 or 8.  The default is 8.
12088 Note that this is an ABI change, even though many library function
12089 interfaces are unaffected if they don't use SIMD vector modes
12090 in places that affect size and/or alignment of relevant types.
12092 @item -msplit-vecmove-early
12093 @opindex msplit-vecmove-early
12094 Split vector moves into single word moves before reload.  In theory this
12095 can give better register allocation, but so far the reverse seems to be
12096 generally the case.
12098 @item -m1reg-@var{reg}
12099 @opindex m1reg-
12100 Specify a register to hold the constant @minus{}1, which makes loading small negative
12101 constants and certain bitmasks faster.
12102 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
12103 which specify use of that register as a fixed register,
12104 and @samp{none}, which means that no register is used for this
12105 purpose.  The default is @option{-m1reg-none}.
12107 @end table
12109 @node ARC Options
12110 @subsection ARC Options
12111 @cindex ARC options
12113 The following options control the architecture variant for which code
12114 is being compiled:
12116 @c architecture variants
12117 @table @gcctabopt
12119 @item -mbarrel-shifter
12120 @opindex mbarrel-shifter
12121 Generate instructions supported by barrel shifter.  This is the default
12122 unless @samp{-mcpu=ARC601} is in effect.
12124 @item -mcpu=@var{cpu}
12125 @opindex mcpu
12126 Set architecture type, register usage, and instruction scheduling
12127 parameters for @var{cpu}.  There are also shortcut alias options
12128 available for backward compatibility and convenience.  Supported
12129 values for @var{cpu} are
12131 @table @samp
12132 @opindex mA6
12133 @opindex mARC600
12134 @item ARC600
12135 Compile for ARC600.  Aliases: @option{-mA6}, @option{-mARC600}.
12137 @item ARC601
12138 @opindex mARC601
12139 Compile for ARC601.  Alias: @option{-mARC601}.
12141 @item ARC700
12142 @opindex mA7
12143 @opindex mARC700
12144 Compile for ARC700.  Aliases: @option{-mA7}, @option{-mARC700}.
12145 This is the default when configured with @samp{--with-cpu=arc700}@.
12146 @end table
12148 @item -mdpfp
12149 @opindex mdpfp
12150 @itemx -mdpfp-compact
12151 @opindex mdpfp-compact
12152 FPX: Generate Double Precision FPX instructions, tuned for the compact
12153 implementation.
12155 @item -mdpfp-fast
12156 @opindex mdpfp-fast
12157 FPX: Generate Double Precision FPX instructions, tuned for the fast
12158 implementation.
12160 @item -mno-dpfp-lrsr
12161 @opindex mno-dpfp-lrsr
12162 Disable LR and SR instructions from using FPX extension aux registers.
12164 @item -mea
12165 @opindex mea
12166 Generate Extended arithmetic instructions.  Currently only
12167 @code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are
12168 supported.  This is always enabled for @samp{-mcpu=ARC700}.
12170 @item -mno-mpy
12171 @opindex mno-mpy
12172 Do not generate mpy instructions for ARC700.
12174 @item -mmul32x16
12175 @opindex mmul32x16
12176 Generate 32x16 bit multiply and mac instructions.
12178 @item -mmul64
12179 @opindex mmul64
12180 Generate mul64 and mulu64 instructions.  Only valid for @samp{-mcpu=ARC600}.
12182 @item -mnorm
12183 @opindex mnorm
12184 Generate norm instruction.  This is the default if @samp{-mcpu=ARC700}
12185 is in effect.
12187 @item -mspfp
12188 @opindex mspfp
12189 @itemx -mspfp-compact
12190 @opindex mspfp-compact
12191 FPX: Generate Single Precision FPX instructions, tuned for the compact
12192 implementation.
12194 @item -mspfp-fast
12195 @opindex mspfp-fast
12196 FPX: Generate Single Precision FPX instructions, tuned for the fast
12197 implementation.
12199 @item -msimd
12200 @opindex msimd
12201 Enable generation of ARC SIMD instructions via target-specific
12202 builtins.  Only valid for @samp{-mcpu=ARC700}.
12204 @item -msoft-float
12205 @opindex msoft-float
12206 This option ignored; it is provided for compatibility purposes only.
12207 Software floating point code is emitted by default, and this default
12208 can overridden by FPX options; @samp{mspfp}, @samp{mspfp-compact}, or
12209 @samp{mspfp-fast} for single precision, and @samp{mdpfp},
12210 @samp{mdpfp-compact}, or @samp{mdpfp-fast} for double precision.
12212 @item -mswap
12213 @opindex mswap
12214 Generate swap instructions.
12216 @end table
12218 The following options are passed through to the assembler, and also
12219 define preprocessor macro symbols.
12221 @c Flags used by the assembler, but for which we define preprocessor
12222 @c macro symbols as well.
12223 @table @gcctabopt
12224 @item -mdsp-packa
12225 @opindex mdsp-packa
12226 Passed down to the assembler to enable the DSP Pack A extensions.
12227 Also sets the preprocessor symbol @code{__Xdsp_packa}.
12229 @item -mdvbf
12230 @opindex mdvbf
12231 Passed down to the assembler to enable the dual viterbi butterfly
12232 extension.  Also sets the preprocessor symbol @code{__Xdvbf}.
12234 @c ARC700 4.10 extension instruction
12235 @item -mlock
12236 @opindex mlock
12237 Passed down to the assembler to enable the Locked Load/Store
12238 Conditional extension.  Also sets the preprocessor symbol
12239 @code{__Xlock}.
12241 @item -mmac-d16
12242 @opindex mmac-d16
12243 Passed down to the assembler.  Also sets the preprocessor symbol
12244 @code{__Xxmac_d16}.
12246 @item -mmac-24
12247 @opindex mmac-24
12248 Passed down to the assembler.  Also sets the preprocessor symbol
12249 @code{__Xxmac_24}.
12251 @c ARC700 4.10 extension instruction
12252 @item -mrtsc
12253 @opindex mrtsc
12254 Passed down to the assembler to enable the 64-bit Time-Stamp Counter
12255 extension instruction.  Also sets the preprocessor symbol
12256 @code{__Xrtsc}.
12258 @c ARC700 4.10 extension instruction
12259 @item -mswape
12260 @opindex mswape
12261 Passed down to the assembler to enable the swap byte ordering
12262 extension instruction.  Also sets the preprocessor symbol
12263 @code{__Xswape}.
12265 @item -mtelephony
12266 @opindex mtelephony
12267 Passed down to the assembler to enable dual and single operand
12268 instructions for telephony.  Also sets the preprocessor symbol
12269 @code{__Xtelephony}.
12271 @item -mxy
12272 @opindex mxy
12273 Passed down to the assembler to enable the XY Memory extension.  Also
12274 sets the preprocessor symbol @code{__Xxy}.
12276 @end table
12278 The following options control how the assembly code is annotated:
12280 @c Assembly annotation options
12281 @table @gcctabopt
12282 @item -misize
12283 @opindex misize
12284 Annotate assembler instructions with estimated addresses.
12286 @item -mannotate-align
12287 @opindex mannotate-align
12288 Explain what alignment considerations lead to the decision to make an
12289 instruction short or long.
12291 @end table
12293 The following options are passed through to the linker:
12295 @c options passed through to the linker
12296 @table @gcctabopt
12297 @item -marclinux
12298 @opindex marclinux
12299 Passed through to the linker, to specify use of the @code{arclinux} emulation.
12300 This option is enabled by default in tool chains built for
12301 @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets
12302 when profiling is not requested.
12304 @item -marclinux_prof
12305 @opindex marclinux_prof
12306 Passed through to the linker, to specify use of the
12307 @code{arclinux_prof} emulation.  This option is enabled by default in
12308 tool chains built for @w{@code{arc-linux-uclibc}} and
12309 @w{@code{arceb-linux-uclibc}} targets when profiling is requested.
12311 @end table
12313 The following options control the semantics of generated code:
12315 @c semantically relevant code generation options
12316 @table @gcctabopt
12317 @item -mepilogue-cfi
12318 @opindex mepilogue-cfi
12319 Enable generation of call frame information for epilogues.
12321 @item -mno-epilogue-cfi
12322 @opindex mno-epilogue-cfi
12323 Disable generation of call frame information for epilogues.
12325 @item -mlong-calls
12326 @opindex mlong-calls
12327 Generate call insns as register indirect calls, thus providing access
12328 to the full 32-bit address range.
12330 @item -mmedium-calls
12331 @opindex mmedium-calls
12332 Don't use less than 25 bit addressing range for calls, which is the
12333 offset available for an unconditional branch-and-link
12334 instruction.  Conditional execution of function calls is suppressed, to
12335 allow use of the 25-bit range, rather than the 21-bit range with
12336 conditional branch-and-link.  This is the default for tool chains built
12337 for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets.
12339 @item -mno-sdata
12340 @opindex mno-sdata
12341 Do not generate sdata references.  This is the default for tool chains
12342 built for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}}
12343 targets.
12345 @item -mucb-mcount
12346 @opindex mucb-mcount
12347 Instrument with mcount calls as used in UCB code.  I.e. do the
12348 counting in the callee, not the caller.  By default ARC instrumentation
12349 counts in the caller.
12351 @item -mvolatile-cache
12352 @opindex mvolatile-cache
12353 Use ordinarily cached memory accesses for volatile references.  This is the
12354 default.
12356 @item -mno-volatile-cache
12357 @opindex mno-volatile-cache
12358 Enable cache bypass for volatile references.
12360 @end table
12362 The following options fine tune code generation:
12363 @c code generation tuning options
12364 @table @gcctabopt
12365 @item -malign-call
12366 @opindex malign-call
12367 Do alignment optimizations for call instructions.
12369 @item -mauto-modify-reg
12370 @opindex mauto-modify-reg
12371 Enable the use of pre/post modify with register displacement.
12373 @item -mbbit-peephole
12374 @opindex mbbit-peephole
12375 Enable bbit peephole2.
12377 @item -mno-brcc
12378 @opindex mno-brcc
12379 This option disables a target-specific pass in @file{arc_reorg} to
12380 generate @code{BRcc} instructions.  It has no effect on @code{BRcc}
12381 generation driven by the combiner pass.
12383 @item -mcase-vector-pcrel
12384 @opindex mcase-vector-pcrel
12385 Use pc-relative switch case tables - this enables case table shortening.
12386 This is the default for @option{-Os}.
12388 @item -mcompact-casesi
12389 @opindex mcompact-casesi
12390 Enable compact casesi pattern.
12391 This is the default for @option{-Os}.
12393 @item -mno-cond-exec
12394 @opindex mno-cond-exec
12395 Disable ARCompact specific pass to generate conditional execution instructions.
12396 Due to delay slot scheduling and interactions between operand numbers,
12397 literal sizes, instruction lengths, and the support for conditional execution,
12398 the target-independent pass to generate conditional execution is often lacking,
12399 so the ARC port has kept a special pass around that tries to find more
12400 conditional execution generating opportunities after register allocation,
12401 branch shortening, and delay slot scheduling have been done.  This pass
12402 generally, but not always, improves performance and code size, at the cost of
12403 extra compilation time, which is why there is an option to switch it off.
12404 If you have a problem with call instructions exceeding their allowable
12405 offset range because they are conditionalized, you should consider using
12406 @option{-mmedium-calls} instead.
12408 @item -mearly-cbranchsi
12409 @opindex mearly-cbranchsi
12410 Enable pre-reload use of the cbranchsi pattern.
12412 @item -mexpand-adddi
12413 @opindex mexpand-adddi
12414 Expand @code{adddi3} and @code{subdi3} at rtl generation time into
12415 @code{add.f}, @code{adc} etc.
12417 @item -mindexed-loads
12418 @opindex mindexed-loads
12419 Enable the use of indexed loads.  This can be problematic because some
12420 optimizers will then assume the that indexed stores exist, which is not
12421 the case.
12423 @item -mlra
12424 @opindex mlra
12425 Enable Local Register Allocation.  This is still experimental for ARC,
12426 so by default the compiler uses standard reload
12427 (i.e. @samp{-mno-lra}).
12429 @item -mlra-priority-none
12430 @opindex mlra-priority-none
12431 Don't indicate any priority for target registers.
12433 @item -mlra-priority-compact
12434 @opindex mlra-priority-compact
12435 Indicate target register priority for r0..r3 / r12..r15.
12437 @item -mlra-priority-noncompact
12438 @opindex mlra-priority-noncompact
12439 Reduce target regsiter priority for r0..r3 / r12..r15.
12441 @item -mno-millicode
12442 @opindex mno-millicode
12443 When optimizing for size (using @option{-Os}), prologues and epilogues
12444 that have to save or restore a large number of registers are often
12445 shortened by using call to a special function in libgcc; this is
12446 referred to as a @emph{millicode} call.  As these calls can pose
12447 performance issues, and/or cause linking issues when linking in a
12448 nonstandard way, this option is provided to turn off millicode call
12449 generation.
12451 @item -mmixed-code
12452 @opindex mmixed-code
12453 Tweak register allocation to help 16-bit instruction generation.
12454 This generally has the effect of decreasing the average instruction size
12455 while increasing the instruction count.
12457 @item -mq-class
12458 @opindex mq-class
12459 Enable 'q' instruction alternatives.
12460 This is the default for @option{-Os}.
12462 @item -mRcq
12463 @opindex mRcq
12464 Enable Rcq constraint handling - most short code generation depends on this.
12465 This is the default.
12467 @item -mRcw
12468 @opindex mRcw
12469 Enable Rcw constraint handling - ccfsm condexec mostly depends on this.
12470 This is the default.
12472 @item -msize-level=@var{level}
12473 @opindex msize-level
12474 Fine-tune size optimization with regards to instruction lengths and alignment.
12475 The recognized values for @var{level} are:
12476 @table @samp
12477 @item 0
12478 No size optimization.  This level is deprecated and treated like @samp{1}.
12480 @item 1
12481 Short instructions are used opportunistically.
12483 @item 2
12484 In addition, alignment of loops and of code after barriers are dropped.
12486 @item 3
12487 In addition, optional data alignment is dropped, and the option @option{Os} is enabled.
12489 @end table
12491 This defaults to @samp{3} when @option{-Os} is in effect.  Otherwise,
12492 the behavior when this is not set is equivalent to level @samp{1}.
12494 @item -mtune=@var{cpu}
12495 @opindex mtune
12496 Set instruction scheduling parameters for @var{cpu}, overriding any implied
12497 by @option{-mcpu=}.
12499 Supported values for @var{cpu} are
12501 @table @samp
12502 @item ARC600
12503 Tune for ARC600 cpu.
12505 @item ARC601
12506 Tune for ARC601 cpu.
12508 @item ARC700
12509 Tune for ARC700 cpu with standard multiplier block.
12511 @item ARC700-xmac
12512 Tune for ARC700 cpu with XMAC block.
12514 @item ARC725D
12515 Tune for ARC725D cpu.
12517 @item ARC750D
12518 Tune for ARC750D cpu.
12520 @end table
12522 @item -mmultcost=@var{num}
12523 @opindex mmultcost
12524 Cost to assume for a multiply instruction, with @samp{4} being equal to a
12525 normal instruction.
12527 @item -munalign-prob-threshold=@var{probability}
12528 @opindex munalign-prob-threshold
12529 Set probability threshold for unaligning branches.
12530 When tuning for @samp{ARC700} and optimizing for speed, branches without
12531 filled delay slot are preferably emitted unaligned and long, unless
12532 profiling indicates that the probability for the branch to be taken
12533 is below @var{probability}.  @xref{Cross-profiling}.
12534 The default is (REG_BR_PROB_BASE/2), i.e.@: 5000.
12536 @end table
12538 The following options are maintained for backward compatibility, but
12539 are now deprecated and will be removed in a future release:
12541 @c Deprecated options
12542 @table @gcctabopt
12544 @item -margonaut
12545 @opindex margonaut
12546 Obsolete FPX.
12548 @item -mbig-endian
12549 @opindex mbig-endian
12550 @itemx -EB
12551 @opindex EB
12552 Compile code for big endian targets.  Use of these options is now
12553 deprecated.  Users wanting big-endian code, should use the
12554 @w{@code{arceb-elf32}} and @w{@code{arceb-linux-uclibc}} targets when
12555 building the tool chain, for which big-endian is the default.
12557 @item -mlittle-endian
12558 @opindex mlittle-endian
12559 @itemx -EL
12560 @opindex EL
12561 Compile code for little endian targets.  Use of these options is now
12562 deprecated.  Users wanting little-endian code should use the
12563 @w{@code{arc-elf32}} and @w{@code{arc-linux-uclibc}} targets when
12564 building the tool chain, for which little-endian is the default.
12566 @item -mbarrel_shifter
12567 @opindex mbarrel_shifter
12568 Replaced by @samp{-mbarrel-shifter}
12570 @item -mdpfp_compact
12571 @opindex mdpfp_compact
12572 Replaced by @samp{-mdpfp-compact}
12574 @item -mdpfp_fast
12575 @opindex mdpfp_fast
12576 Replaced by @samp{-mdpfp-fast}
12578 @item -mdsp_packa
12579 @opindex mdsp_packa
12580 Replaced by @samp{-mdsp-packa}
12582 @item -mEA
12583 @opindex mEA
12584 Replaced by @samp{-mea}
12586 @item -mmac_24
12587 @opindex mmac_24
12588 Replaced by @samp{-mmac-24}
12590 @item -mmac_d16
12591 @opindex mmac_d16
12592 Replaced by @samp{-mmac-d16}
12594 @item -mspfp_compact
12595 @opindex mspfp_compact
12596 Replaced by @samp{-mspfp-compact}
12598 @item -mspfp_fast
12599 @opindex mspfp_fast
12600 Replaced by @samp{-mspfp-fast}
12602 @item -mtune=@var{cpu}
12603 @opindex mtune
12604 Values @samp{arc600}, @samp{arc601}, @samp{arc700} and
12605 @samp{arc700-xmac} for @var{cpu} are replaced by @samp{ARC600},
12606 @samp{ARC601}, @samp{ARC700} and @samp{ARC700-xmac} respectively
12608 @item -multcost=@var{num}
12609 @opindex multcost
12610 Replaced by @samp{-mmultcost}.
12612 @end table
12614 @node ARM Options
12615 @subsection ARM Options
12616 @cindex ARM options
12618 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
12619 architectures:
12621 @table @gcctabopt
12622 @item -mabi=@var{name}
12623 @opindex mabi
12624 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
12625 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
12627 @item -mapcs-frame
12628 @opindex mapcs-frame
12629 Generate a stack frame that is compliant with the ARM Procedure Call
12630 Standard for all functions, even if this is not strictly necessary for
12631 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
12632 with this option causes the stack frames not to be generated for
12633 leaf functions.  The default is @option{-mno-apcs-frame}.
12635 @item -mapcs
12636 @opindex mapcs
12637 This is a synonym for @option{-mapcs-frame}.
12639 @ignore
12640 @c not currently implemented
12641 @item -mapcs-stack-check
12642 @opindex mapcs-stack-check
12643 Generate code to check the amount of stack space available upon entry to
12644 every function (that actually uses some stack space).  If there is
12645 insufficient space available then either the function
12646 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} is
12647 called, depending upon the amount of stack space required.  The runtime
12648 system is required to provide these functions.  The default is
12649 @option{-mno-apcs-stack-check}, since this produces smaller code.
12651 @c not currently implemented
12652 @item -mapcs-float
12653 @opindex mapcs-float
12654 Pass floating-point arguments using the floating-point registers.  This is
12655 one of the variants of the APCS@.  This option is recommended if the
12656 target hardware has a floating-point unit or if a lot of floating-point
12657 arithmetic is going to be performed by the code.  The default is
12658 @option{-mno-apcs-float}, since the size of integer-only code is 
12659 slightly increased if @option{-mapcs-float} is used.
12661 @c not currently implemented
12662 @item -mapcs-reentrant
12663 @opindex mapcs-reentrant
12664 Generate reentrant, position-independent code.  The default is
12665 @option{-mno-apcs-reentrant}.
12666 @end ignore
12668 @item -mthumb-interwork
12669 @opindex mthumb-interwork
12670 Generate code that supports calling between the ARM and Thumb
12671 instruction sets.  Without this option, on pre-v5 architectures, the
12672 two instruction sets cannot be reliably used inside one program.  The
12673 default is @option{-mno-thumb-interwork}, since slightly larger code
12674 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
12675 configurations this option is meaningless.
12677 @item -mno-sched-prolog
12678 @opindex mno-sched-prolog
12679 Prevent the reordering of instructions in the function prologue, or the
12680 merging of those instruction with the instructions in the function's
12681 body.  This means that all functions start with a recognizable set
12682 of instructions (or in fact one of a choice from a small set of
12683 different function prologues), and this information can be used to
12684 locate the start of functions inside an executable piece of code.  The
12685 default is @option{-msched-prolog}.
12687 @item -mfloat-abi=@var{name}
12688 @opindex mfloat-abi
12689 Specifies which floating-point ABI to use.  Permissible values
12690 are: @samp{soft}, @samp{softfp} and @samp{hard}.
12692 Specifying @samp{soft} causes GCC to generate output containing
12693 library calls for floating-point operations.
12694 @samp{softfp} allows the generation of code using hardware floating-point
12695 instructions, but still uses the soft-float calling conventions.
12696 @samp{hard} allows generation of floating-point instructions
12697 and uses FPU-specific calling conventions.
12699 The default depends on the specific target configuration.  Note that
12700 the hard-float and soft-float ABIs are not link-compatible; you must
12701 compile your entire program with the same ABI, and link with a
12702 compatible set of libraries.
12704 @item -mlittle-endian
12705 @opindex mlittle-endian
12706 Generate code for a processor running in little-endian mode.  This is
12707 the default for all standard configurations.
12709 @item -mbig-endian
12710 @opindex mbig-endian
12711 Generate code for a processor running in big-endian mode; the default is
12712 to compile code for a little-endian processor.
12714 @item -march=@var{name}
12715 @opindex march
12716 This specifies the name of the target ARM architecture.  GCC uses this
12717 name to determine what kind of instructions it can emit when generating
12718 assembly code.  This option can be used in conjunction with or instead
12719 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
12720 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
12721 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
12722 @samp{armv6}, @samp{armv6j},
12723 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
12724 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m}, @samp{armv7e-m},
12725 @samp{armv7ve}, @samp{armv8-a}, @samp{armv8-a+crc},
12726 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
12728 @option{-march=armv7ve} is the armv7-a architecture with virtualization
12729 extensions.
12731 @option{-march=armv8-a+crc} enables code generation for the ARMv8-A
12732 architecture together with the optional CRC32 extensions.
12734 @option{-march=native} causes the compiler to auto-detect the architecture
12735 of the build computer.  At present, this feature is only supported on
12736 GNU/Linux, and not all architectures are recognized.  If the auto-detect
12737 is unsuccessful the option has no effect.
12739 @item -mtune=@var{name}
12740 @opindex mtune
12741 This option specifies the name of the target ARM processor for
12742 which GCC should tune the performance of the code.
12743 For some ARM implementations better performance can be obtained by using
12744 this option.
12745 Permissible names are: @samp{arm2}, @samp{arm250},
12746 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
12747 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
12748 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
12749 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
12750 @samp{arm720},
12751 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
12752 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
12753 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
12754 @samp{strongarm1110},
12755 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
12756 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
12757 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
12758 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
12759 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
12760 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
12761 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
12762 @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8}, @samp{cortex-a9},
12763 @samp{cortex-a12}, @samp{cortex-a15}, @samp{cortex-a53}, @samp{cortex-a57},
12764 @samp{cortex-r4},
12765 @samp{cortex-r4f}, @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-m7},
12766 @samp{cortex-m4},
12767 @samp{cortex-m3},
12768 @samp{cortex-m1},
12769 @samp{cortex-m0},
12770 @samp{cortex-m0plus},
12771 @samp{cortex-m1.small-multiply},
12772 @samp{cortex-m0.small-multiply},
12773 @samp{cortex-m0plus.small-multiply},
12774 @samp{marvell-pj4},
12775 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
12776 @samp{fa526}, @samp{fa626},
12777 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te}.
12779 Additionally, this option can specify that GCC should tune the performance
12780 of the code for a big.LITTLE system.  Permissible names are:
12781 @samp{cortex-a15.cortex-a7}, @samp{cortex-a57.cortex-a53}.
12783 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
12784 performance for a blend of processors within architecture @var{arch}.
12785 The aim is to generate code that run well on the current most popular
12786 processors, balancing between optimizations that benefit some CPUs in the
12787 range, and avoiding performance pitfalls of other CPUs.  The effects of
12788 this option may change in future GCC versions as CPU models come and go.
12790 @option{-mtune=native} causes the compiler to auto-detect the CPU
12791 of the build computer.  At present, this feature is only supported on
12792 GNU/Linux, and not all architectures are recognized.  If the auto-detect is
12793 unsuccessful the option has no effect.
12795 @item -mcpu=@var{name}
12796 @opindex mcpu
12797 This specifies the name of the target ARM processor.  GCC uses this name
12798 to derive the name of the target ARM architecture (as if specified
12799 by @option{-march}) and the ARM processor type for which to tune for
12800 performance (as if specified by @option{-mtune}).  Where this option
12801 is used in conjunction with @option{-march} or @option{-mtune},
12802 those options take precedence over the appropriate part of this option.
12804 Permissible names for this option are the same as those for
12805 @option{-mtune}.
12807 @option{-mcpu=generic-@var{arch}} is also permissible, and is
12808 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
12809 See @option{-mtune} for more information.
12811 @option{-mcpu=native} causes the compiler to auto-detect the CPU
12812 of the build computer.  At present, this feature is only supported on
12813 GNU/Linux, and not all architectures are recognized.  If the auto-detect
12814 is unsuccessful the option has no effect.
12816 @item -mfpu=@var{name}
12817 @opindex mfpu
12818 This specifies what floating-point hardware (or hardware emulation) is
12819 available on the target.  Permissible names are: @samp{vfp}, @samp{vfpv3},
12820 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
12821 @samp{vfpv3xd-fp16}, @samp{neon}, @samp{neon-fp16}, @samp{vfpv4},
12822 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
12823 @samp{fpv5-d16}, @samp{fpv5-sp-d16},
12824 @samp{fp-armv8}, @samp{neon-fp-armv8}, and @samp{crypto-neon-fp-armv8}.
12826 If @option{-msoft-float} is specified this specifies the format of
12827 floating-point values.
12829 If the selected floating-point hardware includes the NEON extension
12830 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
12831 operations are not generated by GCC's auto-vectorization pass unless
12832 @option{-funsafe-math-optimizations} is also specified.  This is
12833 because NEON hardware does not fully implement the IEEE 754 standard for
12834 floating-point arithmetic (in particular denormal values are treated as
12835 zero), so the use of NEON instructions may lead to a loss of precision.
12837 @item -mfp16-format=@var{name}
12838 @opindex mfp16-format
12839 Specify the format of the @code{__fp16} half-precision floating-point type.
12840 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
12841 the default is @samp{none}, in which case the @code{__fp16} type is not
12842 defined.  @xref{Half-Precision}, for more information.
12844 @item -mstructure-size-boundary=@var{n}
12845 @opindex mstructure-size-boundary
12846 The sizes of all structures and unions are rounded up to a multiple
12847 of the number of bits set by this option.  Permissible values are 8, 32
12848 and 64.  The default value varies for different toolchains.  For the COFF
12849 targeted toolchain the default value is 8.  A value of 64 is only allowed
12850 if the underlying ABI supports it.
12852 Specifying a larger number can produce faster, more efficient code, but
12853 can also increase the size of the program.  Different values are potentially
12854 incompatible.  Code compiled with one value cannot necessarily expect to
12855 work with code or libraries compiled with another value, if they exchange
12856 information using structures or unions.
12858 @item -mabort-on-noreturn
12859 @opindex mabort-on-noreturn
12860 Generate a call to the function @code{abort} at the end of a
12861 @code{noreturn} function.  It is executed if the function tries to
12862 return.
12864 @item -mlong-calls
12865 @itemx -mno-long-calls
12866 @opindex mlong-calls
12867 @opindex mno-long-calls
12868 Tells the compiler to perform function calls by first loading the
12869 address of the function into a register and then performing a subroutine
12870 call on this register.  This switch is needed if the target function
12871 lies outside of the 64-megabyte addressing range of the offset-based
12872 version of subroutine call instruction.
12874 Even if this switch is enabled, not all function calls are turned
12875 into long calls.  The heuristic is that static functions, functions
12876 that have the @samp{short-call} attribute, functions that are inside
12877 the scope of a @samp{#pragma no_long_calls} directive, and functions whose
12878 definitions have already been compiled within the current compilation
12879 unit are not turned into long calls.  The exceptions to this rule are
12880 that weak function definitions, functions with the @samp{long-call}
12881 attribute or the @samp{section} attribute, and functions that are within
12882 the scope of a @samp{#pragma long_calls} directive are always
12883 turned into long calls.
12885 This feature is not enabled by default.  Specifying
12886 @option{-mno-long-calls} restores the default behavior, as does
12887 placing the function calls within the scope of a @samp{#pragma
12888 long_calls_off} directive.  Note these switches have no effect on how
12889 the compiler generates code to handle function calls via function
12890 pointers.
12892 @item -msingle-pic-base
12893 @opindex msingle-pic-base
12894 Treat the register used for PIC addressing as read-only, rather than
12895 loading it in the prologue for each function.  The runtime system is
12896 responsible for initializing this register with an appropriate value
12897 before execution begins.
12899 @item -mpic-register=@var{reg}
12900 @opindex mpic-register
12901 Specify the register to be used for PIC addressing.
12902 For standard PIC base case, the default will be any suitable register
12903 determined by compiler.  For single PIC base case, the default is
12904 @samp{R9} if target is EABI based or stack-checking is enabled,
12905 otherwise the default is @samp{R10}.
12907 @item -mpic-data-is-text-relative
12908 @opindex mpic-data-is-text-relative
12909 Assume that each data segments are relative to text segment at load time.
12910 Therefore, it permits addressing data using PC-relative operations.
12911 This option is on by default for targets other than VxWorks RTP.
12913 @item -mpoke-function-name
12914 @opindex mpoke-function-name
12915 Write the name of each function into the text section, directly
12916 preceding the function prologue.  The generated code is similar to this:
12918 @smallexample
12919      t0
12920          .ascii "arm_poke_function_name", 0
12921          .align
12922      t1
12923          .word 0xff000000 + (t1 - t0)
12924      arm_poke_function_name
12925          mov     ip, sp
12926          stmfd   sp!, @{fp, ip, lr, pc@}
12927          sub     fp, ip, #4
12928 @end smallexample
12930 When performing a stack backtrace, code can inspect the value of
12931 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
12932 location @code{pc - 12} and the top 8 bits are set, then we know that
12933 there is a function name embedded immediately preceding this location
12934 and has length @code{((pc[-3]) & 0xff000000)}.
12936 @item -mthumb
12937 @itemx -marm
12938 @opindex marm
12939 @opindex mthumb
12941 Select between generating code that executes in ARM and Thumb
12942 states.  The default for most configurations is to generate code
12943 that executes in ARM state, but the default can be changed by
12944 configuring GCC with the @option{--with-mode=}@var{state}
12945 configure option.
12947 @item -mtpcs-frame
12948 @opindex mtpcs-frame
12949 Generate a stack frame that is compliant with the Thumb Procedure Call
12950 Standard for all non-leaf functions.  (A leaf function is one that does
12951 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
12953 @item -mtpcs-leaf-frame
12954 @opindex mtpcs-leaf-frame
12955 Generate a stack frame that is compliant with the Thumb Procedure Call
12956 Standard for all leaf functions.  (A leaf function is one that does
12957 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
12959 @item -mcallee-super-interworking
12960 @opindex mcallee-super-interworking
12961 Gives all externally visible functions in the file being compiled an ARM
12962 instruction set header which switches to Thumb mode before executing the
12963 rest of the function.  This allows these functions to be called from
12964 non-interworking code.  This option is not valid in AAPCS configurations
12965 because interworking is enabled by default.
12967 @item -mcaller-super-interworking
12968 @opindex mcaller-super-interworking
12969 Allows calls via function pointers (including virtual functions) to
12970 execute correctly regardless of whether the target code has been
12971 compiled for interworking or not.  There is a small overhead in the cost
12972 of executing a function pointer if this option is enabled.  This option
12973 is not valid in AAPCS configurations because interworking is enabled
12974 by default.
12976 @item -mtp=@var{name}
12977 @opindex mtp
12978 Specify the access model for the thread local storage pointer.  The valid
12979 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
12980 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
12981 (supported in the arm6k architecture), and @option{auto}, which uses the
12982 best available method for the selected processor.  The default setting is
12983 @option{auto}.
12985 @item -mtls-dialect=@var{dialect}
12986 @opindex mtls-dialect
12987 Specify the dialect to use for accessing thread local storage.  Two
12988 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
12989 @samp{gnu} dialect selects the original GNU scheme for supporting
12990 local and global dynamic TLS models.  The @samp{gnu2} dialect
12991 selects the GNU descriptor scheme, which provides better performance
12992 for shared libraries.  The GNU descriptor scheme is compatible with
12993 the original scheme, but does require new assembler, linker and
12994 library support.  Initial and local exec TLS models are unaffected by
12995 this option and always use the original scheme.
12997 @item -mword-relocations
12998 @opindex mword-relocations
12999 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
13000 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
13001 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
13002 is specified.
13004 @item -mfix-cortex-m3-ldrd
13005 @opindex mfix-cortex-m3-ldrd
13006 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
13007 with overlapping destination and base registers are used.  This option avoids
13008 generating these instructions.  This option is enabled by default when
13009 @option{-mcpu=cortex-m3} is specified.
13011 @item -munaligned-access
13012 @itemx -mno-unaligned-access
13013 @opindex munaligned-access
13014 @opindex mno-unaligned-access
13015 Enables (or disables) reading and writing of 16- and 32- bit values
13016 from addresses that are not 16- or 32- bit aligned.  By default
13017 unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
13018 architectures, and enabled for all other architectures.  If unaligned
13019 access is not enabled then words in packed data structures will be
13020 accessed a byte at a time.
13022 The ARM attribute @code{Tag_CPU_unaligned_access} will be set in the
13023 generated object file to either true or false, depending upon the
13024 setting of this option.  If unaligned access is enabled then the
13025 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} will also be
13026 defined.
13028 @item -mneon-for-64bits
13029 @opindex mneon-for-64bits
13030 Enables using Neon to handle scalar 64-bits operations. This is
13031 disabled by default since the cost of moving data from core registers
13032 to Neon is high.
13034 @item -mslow-flash-data
13035 @opindex mslow-flash-data
13036 Assume loading data from flash is slower than fetching instruction.
13037 Therefore literal load is minimized for better performance.
13038 This option is only supported when compiling for ARMv7 M-profile and
13039 off by default.
13041 @item -masm-syntax-unified
13042 @opindex masm-syntax-unified
13043 Assume inline assembler is using unified asm syntax.  The default is
13044 currently off which implies divided syntax.  Currently this option is
13045 available only for Thumb1 and has no effect on ARM state and Thumb2.
13046 However, this may change in future releases of GCC.  Divided syntax
13047 should be considered deprecated.
13049 @item -mrestrict-it
13050 @opindex mrestrict-it
13051 Restricts generation of IT blocks to conform to the rules of ARMv8.
13052 IT blocks can only contain a single 16-bit instruction from a select
13053 set of instructions. This option is on by default for ARMv8 Thumb mode.
13054 @end table
13056 @node AVR Options
13057 @subsection AVR Options
13058 @cindex AVR Options
13060 These options are defined for AVR implementations:
13062 @table @gcctabopt
13063 @item -mmcu=@var{mcu}
13064 @opindex mmcu
13065 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
13067 The default for this option is@tie{}@code{avr2}.
13069 GCC supports the following AVR devices and ISAs:
13071 @include avr-mmcu.texi
13073 @item -maccumulate-args
13074 @opindex maccumulate-args
13075 Accumulate outgoing function arguments and acquire/release the needed
13076 stack space for outgoing function arguments once in function
13077 prologue/epilogue.  Without this option, outgoing arguments are pushed
13078 before calling a function and popped afterwards.
13080 Popping the arguments after the function call can be expensive on
13081 AVR so that accumulating the stack space might lead to smaller
13082 executables because arguments need not to be removed from the
13083 stack after such a function call.
13085 This option can lead to reduced code size for functions that perform
13086 several calls to functions that get their arguments on the stack like
13087 calls to printf-like functions.
13089 @item -mbranch-cost=@var{cost}
13090 @opindex mbranch-cost
13091 Set the branch costs for conditional branch instructions to
13092 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
13093 integers. The default branch cost is 0.
13095 @item -mcall-prologues
13096 @opindex mcall-prologues
13097 Functions prologues/epilogues are expanded as calls to appropriate
13098 subroutines.  Code size is smaller.
13100 @item -mint8
13101 @opindex mint8
13102 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
13103 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
13104 and @code{long long} is 4 bytes.  Please note that this option does not
13105 conform to the C standards, but it results in smaller code
13106 size.
13108 @item -mno-interrupts
13109 @opindex mno-interrupts
13110 Generated code is not compatible with hardware interrupts.
13111 Code size is smaller.
13113 @item -mrelax
13114 @opindex mrelax
13115 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
13116 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
13117 Setting @code{-mrelax} just adds the @code{--relax} option to the
13118 linker command line when the linker is called.
13120 Jump relaxing is performed by the linker because jump offsets are not
13121 known before code is located. Therefore, the assembler code generated by the
13122 compiler is the same, but the instructions in the executable may
13123 differ from instructions in the assembler code.
13125 Relaxing must be turned on if linker stubs are needed, see the
13126 section on @code{EIND} and linker stubs below.
13128 @item -msp8
13129 @opindex msp8
13130 Treat the stack pointer register as an 8-bit register,
13131 i.e.@: assume the high byte of the stack pointer is zero.
13132 In general, you don't need to set this option by hand.
13134 This option is used internally by the compiler to select and
13135 build multilibs for architectures @code{avr2} and @code{avr25}.
13136 These architectures mix devices with and without @code{SPH}.
13137 For any setting other than @code{-mmcu=avr2} or @code{-mmcu=avr25}
13138 the compiler driver will add or remove this option from the compiler
13139 proper's command line, because the compiler then knows if the device
13140 or architecture has an 8-bit stack pointer and thus no @code{SPH}
13141 register or not.
13143 @item -mstrict-X
13144 @opindex mstrict-X
13145 Use address register @code{X} in a way proposed by the hardware.  This means
13146 that @code{X} is only used in indirect, post-increment or
13147 pre-decrement addressing.
13149 Without this option, the @code{X} register may be used in the same way
13150 as @code{Y} or @code{Z} which then is emulated by additional
13151 instructions.  
13152 For example, loading a value with @code{X+const} addressing with a
13153 small non-negative @code{const < 64} to a register @var{Rn} is
13154 performed as
13156 @example
13157 adiw r26, const   ; X += const
13158 ld   @var{Rn}, X        ; @var{Rn} = *X
13159 sbiw r26, const   ; X -= const
13160 @end example
13162 @item -mtiny-stack
13163 @opindex mtiny-stack
13164 Only change the lower 8@tie{}bits of the stack pointer.
13166 @item -Waddr-space-convert
13167 @opindex Waddr-space-convert
13168 Warn about conversions between address spaces in the case where the
13169 resulting address space is not contained in the incoming address space.
13170 @end table
13172 @subsubsection @code{EIND} and Devices with more than 128 Ki Bytes of Flash
13173 @cindex @code{EIND}
13174 Pointers in the implementation are 16@tie{}bits wide.
13175 The address of a function or label is represented as word address so
13176 that indirect jumps and calls can target any code address in the
13177 range of 64@tie{}Ki words.
13179 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
13180 bytes of program memory space, there is a special function register called
13181 @code{EIND} that serves as most significant part of the target address
13182 when @code{EICALL} or @code{EIJMP} instructions are used.
13184 Indirect jumps and calls on these devices are handled as follows by
13185 the compiler and are subject to some limitations:
13187 @itemize @bullet
13189 @item
13190 The compiler never sets @code{EIND}.
13192 @item
13193 The compiler uses @code{EIND} implicitely in @code{EICALL}/@code{EIJMP}
13194 instructions or might read @code{EIND} directly in order to emulate an
13195 indirect call/jump by means of a @code{RET} instruction.
13197 @item
13198 The compiler assumes that @code{EIND} never changes during the startup
13199 code or during the application. In particular, @code{EIND} is not
13200 saved/restored in function or interrupt service routine
13201 prologue/epilogue.
13203 @item
13204 For indirect calls to functions and computed goto, the linker
13205 generates @emph{stubs}. Stubs are jump pads sometimes also called
13206 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
13207 The stub contains a direct jump to the desired address.
13209 @item
13210 Linker relaxation must be turned on so that the linker will generate
13211 the stubs correctly an all situaltion. See the compiler option
13212 @code{-mrelax} and the linler option @code{--relax}.
13213 There are corner cases where the linker is supposed to generate stubs
13214 but aborts without relaxation and without a helpful error message.
13216 @item
13217 The default linker script is arranged for code with @code{EIND = 0}.
13218 If code is supposed to work for a setup with @code{EIND != 0}, a custom
13219 linker script has to be used in order to place the sections whose
13220 name start with @code{.trampolines} into the segment where @code{EIND}
13221 points to.
13223 @item
13224 The startup code from libgcc never sets @code{EIND}.
13225 Notice that startup code is a blend of code from libgcc and AVR-LibC.
13226 For the impact of AVR-LibC on @code{EIND}, see the
13227 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
13229 @item
13230 It is legitimate for user-specific startup code to set up @code{EIND}
13231 early, for example by means of initialization code located in
13232 section @code{.init3}. Such code runs prior to general startup code
13233 that initializes RAM and calls constructors, but after the bit
13234 of startup code from AVR-LibC that sets @code{EIND} to the segment
13235 where the vector table is located.
13236 @example
13237 #include <avr/io.h>
13239 static void
13240 __attribute__((section(".init3"),naked,used,no_instrument_function))
13241 init3_set_eind (void)
13243   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
13244                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
13246 @end example
13248 @noindent
13249 The @code{__trampolines_start} symbol is defined in the linker script.
13251 @item
13252 Stubs are generated automatically by the linker if
13253 the following two conditions are met:
13254 @itemize @minus
13256 @item The address of a label is taken by means of the @code{gs} modifier
13257 (short for @emph{generate stubs}) like so:
13258 @example
13259 LDI r24, lo8(gs(@var{func}))
13260 LDI r25, hi8(gs(@var{func}))
13261 @end example
13262 @item The final location of that label is in a code segment
13263 @emph{outside} the segment where the stubs are located.
13264 @end itemize
13266 @item
13267 The compiler emits such @code{gs} modifiers for code labels in the
13268 following situations:
13269 @itemize @minus
13270 @item Taking address of a function or code label.
13271 @item Computed goto.
13272 @item If prologue-save function is used, see @option{-mcall-prologues}
13273 command-line option.
13274 @item Switch/case dispatch tables. If you do not want such dispatch
13275 tables you can specify the @option{-fno-jump-tables} command-line option.
13276 @item C and C++ constructors/destructors called during startup/shutdown.
13277 @item If the tools hit a @code{gs()} modifier explained above.
13278 @end itemize
13280 @item
13281 Jumping to non-symbolic addresses like so is @emph{not} supported:
13283 @example
13284 int main (void)
13286     /* Call function at word address 0x2 */
13287     return ((int(*)(void)) 0x2)();
13289 @end example
13291 Instead, a stub has to be set up, i.e.@: the function has to be called
13292 through a symbol (@code{func_4} in the example):
13294 @example
13295 int main (void)
13297     extern int func_4 (void);
13299     /* Call function at byte address 0x4 */
13300     return func_4();
13302 @end example
13304 and the application be linked with @code{-Wl,--defsym,func_4=0x4}.
13305 Alternatively, @code{func_4} can be defined in the linker script.
13306 @end itemize
13308 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
13309 @cindex @code{RAMPD}
13310 @cindex @code{RAMPX}
13311 @cindex @code{RAMPY}
13312 @cindex @code{RAMPZ}
13313 Some AVR devices support memories larger than the 64@tie{}KiB range
13314 that can be accessed with 16-bit pointers.  To access memory locations
13315 outside this 64@tie{}KiB range, the contentent of a @code{RAMP}
13316 register is used as high part of the address:
13317 The @code{X}, @code{Y}, @code{Z} address register is concatenated
13318 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
13319 register, respectively, to get a wide address. Similarly,
13320 @code{RAMPD} is used together with direct addressing.
13322 @itemize
13323 @item
13324 The startup code initializes the @code{RAMP} special function
13325 registers with zero.
13327 @item
13328 If a @ref{AVR Named Address Spaces,named address space} other than
13329 generic or @code{__flash} is used, then @code{RAMPZ} is set
13330 as needed before the operation.
13332 @item
13333 If the device supports RAM larger than 64@tie{}KiB and the compiler
13334 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
13335 is reset to zero after the operation.
13337 @item
13338 If the device comes with a specific @code{RAMP} register, the ISR
13339 prologue/epilogue saves/restores that SFR and initializes it with
13340 zero in case the ISR code might (implicitly) use it.
13342 @item
13343 RAM larger than 64@tie{}KiB is not supported by GCC for AVR targets.
13344 If you use inline assembler to read from locations outside the
13345 16-bit address range and change one of the @code{RAMP} registers,
13346 you must reset it to zero after the access.
13348 @end itemize
13350 @subsubsection AVR Built-in Macros
13352 GCC defines several built-in macros so that the user code can test
13353 for the presence or absence of features.  Almost any of the following
13354 built-in macros are deduced from device capabilities and thus
13355 triggered by the @code{-mmcu=} command-line option.
13357 For even more AVR-specific built-in macros see
13358 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
13360 @table @code
13362 @item __AVR_ARCH__
13363 Build-in macro that resolves to a decimal number that identifies the
13364 architecture and depends on the @code{-mmcu=@var{mcu}} option.
13365 Possible values are:
13367 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
13368 @code{4}, @code{5}, @code{51}, @code{6}, @code{102}, @code{104},
13369 @code{105}, @code{106}, @code{107}
13371 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3},
13372 @code{avr31}, @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51},
13373 @code{avr6}, @code{avrxmega2}, @code{avrxmega4}, @code{avrxmega5},
13374 @code{avrxmega6}, @code{avrxmega7}, respectively.
13375 If @var{mcu} specifies a device, this built-in macro is set
13376 accordingly. For example, with @code{-mmcu=atmega8} the macro will be
13377 defined to @code{4}.
13379 @item __AVR_@var{Device}__
13380 Setting @code{-mmcu=@var{device}} defines this built-in macro which reflects
13381 the device's name. For example, @code{-mmcu=atmega8} defines the
13382 built-in macro @code{__AVR_ATmega8__}, @code{-mmcu=attiny261a} defines
13383 @code{__AVR_ATtiny261A__}, etc.
13385 The built-in macros' names follow
13386 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
13387 the device name as from the AVR user manual. The difference between
13388 @var{Device} in the built-in macro and @var{device} in
13389 @code{-mmcu=@var{device}} is that the latter is always lowercase.
13391 If @var{device} is not a device but only a core architecture like
13392 @code{avr51}, this macro will not be defined.
13394 @item   __AVR_DEVICE_NAME__
13395 Setting @code{-mmcu=@var{device}} defines this built-in macro to
13396 the device's name. For example, with @code{-mmcu=atmega8} the macro
13397 will be defined to @code{atmega8}.
13399 If @var{device} is not a device but only a core architecture like
13400 @code{avr51}, this macro will not be defined.
13402 @item __AVR_XMEGA__
13403 The device / architecture belongs to the XMEGA family of devices.
13405 @item __AVR_HAVE_ELPM__
13406 The device has the the @code{ELPM} instruction.
13408 @item __AVR_HAVE_ELPMX__
13409 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
13410 R@var{n},Z+} instructions.
13412 @item __AVR_HAVE_MOVW__
13413 The device has the @code{MOVW} instruction to perform 16-bit
13414 register-register moves.
13416 @item __AVR_HAVE_LPMX__
13417 The device has the @code{LPM R@var{n},Z} and
13418 @code{LPM R@var{n},Z+} instructions.
13420 @item __AVR_HAVE_MUL__
13421 The device has a hardware multiplier. 
13423 @item __AVR_HAVE_JMP_CALL__
13424 The device has the @code{JMP} and @code{CALL} instructions.
13425 This is the case for devices with at least 16@tie{}KiB of program
13426 memory.
13428 @item __AVR_HAVE_EIJMP_EICALL__
13429 @itemx __AVR_3_BYTE_PC__
13430 The device has the @code{EIJMP} and @code{EICALL} instructions.
13431 This is the case for devices with more than 128@tie{}KiB of program memory.
13432 This also means that the program counter
13433 (PC) is 3@tie{}bytes wide.
13435 @item __AVR_2_BYTE_PC__
13436 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
13437 with up to 128@tie{}KiB of program memory.
13439 @item __AVR_HAVE_8BIT_SP__
13440 @itemx __AVR_HAVE_16BIT_SP__
13441 The stack pointer (SP) register is treated as 8-bit respectively
13442 16-bit register by the compiler.
13443 The definition of these macros is affected by @code{-mtiny-stack}.
13445 @item __AVR_HAVE_SPH__
13446 @itemx __AVR_SP8__
13447 The device has the SPH (high part of stack pointer) special function
13448 register or has an 8-bit stack pointer, respectively.
13449 The definition of these macros is affected by @code{-mmcu=} and
13450 in the cases of @code{-mmcu=avr2} and @code{-mmcu=avr25} also
13451 by @code{-msp8}.
13453 @item __AVR_HAVE_RAMPD__
13454 @itemx __AVR_HAVE_RAMPX__
13455 @itemx __AVR_HAVE_RAMPY__
13456 @itemx __AVR_HAVE_RAMPZ__
13457 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
13458 @code{RAMPZ} special function register, respectively.
13460 @item __NO_INTERRUPTS__
13461 This macro reflects the @code{-mno-interrupts} command line option.
13463 @item __AVR_ERRATA_SKIP__
13464 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
13465 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
13466 instructions because of a hardware erratum.  Skip instructions are
13467 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
13468 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
13469 set.
13471 @item __AVR_ISA_RMW__
13472 The device has Read-Modify-Write instructions (XCH, LAC, LAS and LAT).
13474 @item __AVR_SFR_OFFSET__=@var{offset}
13475 Instructions that can address I/O special function registers directly
13476 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
13477 address as if addressed by an instruction to access RAM like @code{LD}
13478 or @code{STS}. This offset depends on the device architecture and has
13479 to be subtracted from the RAM address in order to get the
13480 respective I/O@tie{}address.
13482 @item __WITH_AVRLIBC__
13483 The compiler is configured to be used together with AVR-Libc.
13484 See the @code{--with-avrlibc} configure option.
13486 @end table
13488 @node Blackfin Options
13489 @subsection Blackfin Options
13490 @cindex Blackfin Options
13492 @table @gcctabopt
13493 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
13494 @opindex mcpu=
13495 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
13496 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
13497 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
13498 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
13499 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
13500 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
13501 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
13502 @samp{bf561}, @samp{bf592}.
13504 The optional @var{sirevision} specifies the silicon revision of the target
13505 Blackfin processor.  Any workarounds available for the targeted silicon revision
13506 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
13507 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
13508 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
13509 hexadecimal digits representing the major and minor numbers in the silicon
13510 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
13511 is not defined.  If @var{sirevision} is @samp{any}, the
13512 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
13513 If this optional @var{sirevision} is not used, GCC assumes the latest known
13514 silicon revision of the targeted Blackfin processor.
13516 GCC defines a preprocessor macro for the specified @var{cpu}.
13517 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
13518 provided by libgloss to be linked in if @option{-msim} is not given.
13520 Without this option, @samp{bf532} is used as the processor by default.
13522 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
13523 only the preprocessor macro is defined.
13525 @item -msim
13526 @opindex msim
13527 Specifies that the program will be run on the simulator.  This causes
13528 the simulator BSP provided by libgloss to be linked in.  This option
13529 has effect only for @samp{bfin-elf} toolchain.
13530 Certain other options, such as @option{-mid-shared-library} and
13531 @option{-mfdpic}, imply @option{-msim}.
13533 @item -momit-leaf-frame-pointer
13534 @opindex momit-leaf-frame-pointer
13535 Don't keep the frame pointer in a register for leaf functions.  This
13536 avoids the instructions to save, set up and restore frame pointers and
13537 makes an extra register available in leaf functions.  The option
13538 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
13539 which might make debugging harder.
13541 @item -mspecld-anomaly
13542 @opindex mspecld-anomaly
13543 When enabled, the compiler ensures that the generated code does not
13544 contain speculative loads after jump instructions. If this option is used,
13545 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
13547 @item -mno-specld-anomaly
13548 @opindex mno-specld-anomaly
13549 Don't generate extra code to prevent speculative loads from occurring.
13551 @item -mcsync-anomaly
13552 @opindex mcsync-anomaly
13553 When enabled, the compiler ensures that the generated code does not
13554 contain CSYNC or SSYNC instructions too soon after conditional branches.
13555 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
13557 @item -mno-csync-anomaly
13558 @opindex mno-csync-anomaly
13559 Don't generate extra code to prevent CSYNC or SSYNC instructions from
13560 occurring too soon after a conditional branch.
13562 @item -mlow-64k
13563 @opindex mlow-64k
13564 When enabled, the compiler is free to take advantage of the knowledge that
13565 the entire program fits into the low 64k of memory.
13567 @item -mno-low-64k
13568 @opindex mno-low-64k
13569 Assume that the program is arbitrarily large.  This is the default.
13571 @item -mstack-check-l1
13572 @opindex mstack-check-l1
13573 Do stack checking using information placed into L1 scratchpad memory by the
13574 uClinux kernel.
13576 @item -mid-shared-library
13577 @opindex mid-shared-library
13578 Generate code that supports shared libraries via the library ID method.
13579 This allows for execute in place and shared libraries in an environment
13580 without virtual memory management.  This option implies @option{-fPIC}.
13581 With a @samp{bfin-elf} target, this option implies @option{-msim}.
13583 @item -mno-id-shared-library
13584 @opindex mno-id-shared-library
13585 Generate code that doesn't assume ID-based shared libraries are being used.
13586 This is the default.
13588 @item -mleaf-id-shared-library
13589 @opindex mleaf-id-shared-library
13590 Generate code that supports shared libraries via the library ID method,
13591 but assumes that this library or executable won't link against any other
13592 ID shared libraries.  That allows the compiler to use faster code for jumps
13593 and calls.
13595 @item -mno-leaf-id-shared-library
13596 @opindex mno-leaf-id-shared-library
13597 Do not assume that the code being compiled won't link against any ID shared
13598 libraries.  Slower code is generated for jump and call insns.
13600 @item -mshared-library-id=n
13601 @opindex mshared-library-id
13602 Specifies the identification number of the ID-based shared library being
13603 compiled.  Specifying a value of 0 generates more compact code; specifying
13604 other values forces the allocation of that number to the current
13605 library but is no more space- or time-efficient than omitting this option.
13607 @item -msep-data
13608 @opindex msep-data
13609 Generate code that allows the data segment to be located in a different
13610 area of memory from the text segment.  This allows for execute in place in
13611 an environment without virtual memory management by eliminating relocations
13612 against the text section.
13614 @item -mno-sep-data
13615 @opindex mno-sep-data
13616 Generate code that assumes that the data segment follows the text segment.
13617 This is the default.
13619 @item -mlong-calls
13620 @itemx -mno-long-calls
13621 @opindex mlong-calls
13622 @opindex mno-long-calls
13623 Tells the compiler to perform function calls by first loading the
13624 address of the function into a register and then performing a subroutine
13625 call on this register.  This switch is needed if the target function
13626 lies outside of the 24-bit addressing range of the offset-based
13627 version of subroutine call instruction.
13629 This feature is not enabled by default.  Specifying
13630 @option{-mno-long-calls} restores the default behavior.  Note these
13631 switches have no effect on how the compiler generates code to handle
13632 function calls via function pointers.
13634 @item -mfast-fp
13635 @opindex mfast-fp
13636 Link with the fast floating-point library. This library relaxes some of
13637 the IEEE floating-point standard's rules for checking inputs against
13638 Not-a-Number (NAN), in the interest of performance.
13640 @item -minline-plt
13641 @opindex minline-plt
13642 Enable inlining of PLT entries in function calls to functions that are
13643 not known to bind locally.  It has no effect without @option{-mfdpic}.
13645 @item -mmulticore
13646 @opindex mmulticore
13647 Build a standalone application for multicore Blackfin processors. 
13648 This option causes proper start files and link scripts supporting 
13649 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
13650 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
13652 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
13653 selects the one-application-per-core programming model.  Without
13654 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
13655 programming model is used. In this model, the main function of Core B
13656 should be named as @code{coreb_main}.
13658 If this option is not used, the single-core application programming
13659 model is used.
13661 @item -mcorea
13662 @opindex mcorea
13663 Build a standalone application for Core A of BF561 when using
13664 the one-application-per-core programming model. Proper start files
13665 and link scripts are used to support Core A, and the macro
13666 @code{__BFIN_COREA} is defined.
13667 This option can only be used in conjunction with @option{-mmulticore}.
13669 @item -mcoreb
13670 @opindex mcoreb
13671 Build a standalone application for Core B of BF561 when using
13672 the one-application-per-core programming model. Proper start files
13673 and link scripts are used to support Core B, and the macro
13674 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
13675 should be used instead of @code{main}. 
13676 This option can only be used in conjunction with @option{-mmulticore}.
13678 @item -msdram
13679 @opindex msdram
13680 Build a standalone application for SDRAM. Proper start files and
13681 link scripts are used to put the application into SDRAM, and the macro
13682 @code{__BFIN_SDRAM} is defined.
13683 The loader should initialize SDRAM before loading the application.
13685 @item -micplb
13686 @opindex micplb
13687 Assume that ICPLBs are enabled at run time.  This has an effect on certain
13688 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
13689 are enabled; for standalone applications the default is off.
13690 @end table
13692 @node C6X Options
13693 @subsection C6X Options
13694 @cindex C6X Options
13696 @table @gcctabopt
13697 @item -march=@var{name}
13698 @opindex march
13699 This specifies the name of the target architecture.  GCC uses this
13700 name to determine what kind of instructions it can emit when generating
13701 assembly code.  Permissible names are: @samp{c62x},
13702 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
13704 @item -mbig-endian
13705 @opindex mbig-endian
13706 Generate code for a big-endian target.
13708 @item -mlittle-endian
13709 @opindex mlittle-endian
13710 Generate code for a little-endian target.  This is the default.
13712 @item -msim
13713 @opindex msim
13714 Choose startup files and linker script suitable for the simulator.
13716 @item -msdata=default
13717 @opindex msdata=default
13718 Put small global and static data in the @samp{.neardata} section,
13719 which is pointed to by register @code{B14}.  Put small uninitialized
13720 global and static data in the @samp{.bss} section, which is adjacent
13721 to the @samp{.neardata} section.  Put small read-only data into the
13722 @samp{.rodata} section.  The corresponding sections used for large
13723 pieces of data are @samp{.fardata}, @samp{.far} and @samp{.const}.
13725 @item -msdata=all
13726 @opindex msdata=all
13727 Put all data, not just small objects, into the sections reserved for
13728 small data, and use addressing relative to the @code{B14} register to
13729 access them.
13731 @item -msdata=none
13732 @opindex msdata=none
13733 Make no use of the sections reserved for small data, and use absolute
13734 addresses to access all data.  Put all initialized global and static
13735 data in the @samp{.fardata} section, and all uninitialized data in the
13736 @samp{.far} section.  Put all constant data into the @samp{.const}
13737 section.
13738 @end table
13740 @node CRIS Options
13741 @subsection CRIS Options
13742 @cindex CRIS Options
13744 These options are defined specifically for the CRIS ports.
13746 @table @gcctabopt
13747 @item -march=@var{architecture-type}
13748 @itemx -mcpu=@var{architecture-type}
13749 @opindex march
13750 @opindex mcpu
13751 Generate code for the specified architecture.  The choices for
13752 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
13753 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
13754 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
13755 @samp{v10}.
13757 @item -mtune=@var{architecture-type}
13758 @opindex mtune
13759 Tune to @var{architecture-type} everything applicable about the generated
13760 code, except for the ABI and the set of available instructions.  The
13761 choices for @var{architecture-type} are the same as for
13762 @option{-march=@var{architecture-type}}.
13764 @item -mmax-stack-frame=@var{n}
13765 @opindex mmax-stack-frame
13766 Warn when the stack frame of a function exceeds @var{n} bytes.
13768 @item -metrax4
13769 @itemx -metrax100
13770 @opindex metrax4
13771 @opindex metrax100
13772 The options @option{-metrax4} and @option{-metrax100} are synonyms for
13773 @option{-march=v3} and @option{-march=v8} respectively.
13775 @item -mmul-bug-workaround
13776 @itemx -mno-mul-bug-workaround
13777 @opindex mmul-bug-workaround
13778 @opindex mno-mul-bug-workaround
13779 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
13780 models where it applies.  This option is active by default.
13782 @item -mpdebug
13783 @opindex mpdebug
13784 Enable CRIS-specific verbose debug-related information in the assembly
13785 code.  This option also has the effect of turning off the @samp{#NO_APP}
13786 formatted-code indicator to the assembler at the beginning of the
13787 assembly file.
13789 @item -mcc-init
13790 @opindex mcc-init
13791 Do not use condition-code results from previous instruction; always emit
13792 compare and test instructions before use of condition codes.
13794 @item -mno-side-effects
13795 @opindex mno-side-effects
13796 Do not emit instructions with side effects in addressing modes other than
13797 post-increment.
13799 @item -mstack-align
13800 @itemx -mno-stack-align
13801 @itemx -mdata-align
13802 @itemx -mno-data-align
13803 @itemx -mconst-align
13804 @itemx -mno-const-align
13805 @opindex mstack-align
13806 @opindex mno-stack-align
13807 @opindex mdata-align
13808 @opindex mno-data-align
13809 @opindex mconst-align
13810 @opindex mno-const-align
13811 These options (@samp{no-} options) arrange (eliminate arrangements) for the
13812 stack frame, individual data and constants to be aligned for the maximum
13813 single data access size for the chosen CPU model.  The default is to
13814 arrange for 32-bit alignment.  ABI details such as structure layout are
13815 not affected by these options.
13817 @item -m32-bit
13818 @itemx -m16-bit
13819 @itemx -m8-bit
13820 @opindex m32-bit
13821 @opindex m16-bit
13822 @opindex m8-bit
13823 Similar to the stack- data- and const-align options above, these options
13824 arrange for stack frame, writable data and constants to all be 32-bit,
13825 16-bit or 8-bit aligned.  The default is 32-bit alignment.
13827 @item -mno-prologue-epilogue
13828 @itemx -mprologue-epilogue
13829 @opindex mno-prologue-epilogue
13830 @opindex mprologue-epilogue
13831 With @option{-mno-prologue-epilogue}, the normal function prologue and
13832 epilogue which set up the stack frame are omitted and no return
13833 instructions or return sequences are generated in the code.  Use this
13834 option only together with visual inspection of the compiled code: no
13835 warnings or errors are generated when call-saved registers must be saved,
13836 or storage for local variables needs to be allocated.
13838 @item -mno-gotplt
13839 @itemx -mgotplt
13840 @opindex mno-gotplt
13841 @opindex mgotplt
13842 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
13843 instruction sequences that load addresses for functions from the PLT part
13844 of the GOT rather than (traditional on other architectures) calls to the
13845 PLT@.  The default is @option{-mgotplt}.
13847 @item -melf
13848 @opindex melf
13849 Legacy no-op option only recognized with the cris-axis-elf and
13850 cris-axis-linux-gnu targets.
13852 @item -mlinux
13853 @opindex mlinux
13854 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
13856 @item -sim
13857 @opindex sim
13858 This option, recognized for the cris-axis-elf, arranges
13859 to link with input-output functions from a simulator library.  Code,
13860 initialized data and zero-initialized data are allocated consecutively.
13862 @item -sim2
13863 @opindex sim2
13864 Like @option{-sim}, but pass linker options to locate initialized data at
13865 0x40000000 and zero-initialized data at 0x80000000.
13866 @end table
13868 @node CR16 Options
13869 @subsection CR16 Options
13870 @cindex CR16 Options
13872 These options are defined specifically for the CR16 ports.
13874 @table @gcctabopt
13876 @item -mmac
13877 @opindex mmac
13878 Enable the use of multiply-accumulate instructions. Disabled by default.
13880 @item -mcr16cplus
13881 @itemx -mcr16c
13882 @opindex mcr16cplus
13883 @opindex mcr16c
13884 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
13885 is default.
13887 @item -msim
13888 @opindex msim
13889 Links the library libsim.a which is in compatible with simulator. Applicable
13890 to ELF compiler only.
13892 @item -mint32
13893 @opindex mint32
13894 Choose integer type as 32-bit wide.
13896 @item -mbit-ops
13897 @opindex mbit-ops
13898 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
13900 @item -mdata-model=@var{model}
13901 @opindex mdata-model
13902 Choose a data model. The choices for @var{model} are @samp{near},
13903 @samp{far} or @samp{medium}. @samp{medium} is default.
13904 However, @samp{far} is not valid with @option{-mcr16c}, as the
13905 CR16C architecture does not support the far data model.
13906 @end table
13908 @node Darwin Options
13909 @subsection Darwin Options
13910 @cindex Darwin options
13912 These options are defined for all architectures running the Darwin operating
13913 system.
13915 FSF GCC on Darwin does not create ``fat'' object files; it creates
13916 an object file for the single architecture that GCC was built to
13917 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
13918 @option{-arch} options are used; it does so by running the compiler or
13919 linker multiple times and joining the results together with
13920 @file{lipo}.
13922 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
13923 @samp{i686}) is determined by the flags that specify the ISA
13924 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
13925 @option{-force_cpusubtype_ALL} option can be used to override this.
13927 The Darwin tools vary in their behavior when presented with an ISA
13928 mismatch.  The assembler, @file{as}, only permits instructions to
13929 be used that are valid for the subtype of the file it is generating,
13930 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
13931 The linker for shared libraries, @file{/usr/bin/libtool}, fails
13932 and prints an error if asked to create a shared library with a less
13933 restrictive subtype than its input files (for instance, trying to put
13934 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
13935 for executables, @command{ld}, quietly gives the executable the most
13936 restrictive subtype of any of its input files.
13938 @table @gcctabopt
13939 @item -F@var{dir}
13940 @opindex F
13941 Add the framework directory @var{dir} to the head of the list of
13942 directories to be searched for header files.  These directories are
13943 interleaved with those specified by @option{-I} options and are
13944 scanned in a left-to-right order.
13946 A framework directory is a directory with frameworks in it.  A
13947 framework is a directory with a @file{Headers} and/or
13948 @file{PrivateHeaders} directory contained directly in it that ends
13949 in @file{.framework}.  The name of a framework is the name of this
13950 directory excluding the @file{.framework}.  Headers associated with
13951 the framework are found in one of those two directories, with
13952 @file{Headers} being searched first.  A subframework is a framework
13953 directory that is in a framework's @file{Frameworks} directory.
13954 Includes of subframework headers can only appear in a header of a
13955 framework that contains the subframework, or in a sibling subframework
13956 header.  Two subframeworks are siblings if they occur in the same
13957 framework.  A subframework should not have the same name as a
13958 framework; a warning is issued if this is violated.  Currently a
13959 subframework cannot have subframeworks; in the future, the mechanism
13960 may be extended to support this.  The standard frameworks can be found
13961 in @file{/System/Library/Frameworks} and
13962 @file{/Library/Frameworks}.  An example include looks like
13963 @code{#include <Framework/header.h>}, where @file{Framework} denotes
13964 the name of the framework and @file{header.h} is found in the
13965 @file{PrivateHeaders} or @file{Headers} directory.
13967 @item -iframework@var{dir}
13968 @opindex iframework
13969 Like @option{-F} except the directory is a treated as a system
13970 directory.  The main difference between this @option{-iframework} and
13971 @option{-F} is that with @option{-iframework} the compiler does not
13972 warn about constructs contained within header files found via
13973 @var{dir}.  This option is valid only for the C family of languages.
13975 @item -gused
13976 @opindex gused
13977 Emit debugging information for symbols that are used.  For stabs
13978 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
13979 This is by default ON@.
13981 @item -gfull
13982 @opindex gfull
13983 Emit debugging information for all symbols and types.
13985 @item -mmacosx-version-min=@var{version}
13986 The earliest version of MacOS X that this executable will run on
13987 is @var{version}.  Typical values of @var{version} include @code{10.1},
13988 @code{10.2}, and @code{10.3.9}.
13990 If the compiler was built to use the system's headers by default,
13991 then the default for this option is the system version on which the
13992 compiler is running, otherwise the default is to make choices that
13993 are compatible with as many systems and code bases as possible.
13995 @item -mkernel
13996 @opindex mkernel
13997 Enable kernel development mode.  The @option{-mkernel} option sets
13998 @option{-static}, @option{-fno-common}, @option{-fno-use-cxa-atexit},
13999 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
14000 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
14001 applicable.  This mode also sets @option{-mno-altivec},
14002 @option{-msoft-float}, @option{-fno-builtin} and
14003 @option{-mlong-branch} for PowerPC targets.
14005 @item -mone-byte-bool
14006 @opindex mone-byte-bool
14007 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
14008 By default @samp{sizeof(bool)} is @samp{4} when compiling for
14009 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
14010 option has no effect on x86.
14012 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
14013 to generate code that is not binary compatible with code generated
14014 without that switch.  Using this switch may require recompiling all
14015 other modules in a program, including system libraries.  Use this
14016 switch to conform to a non-default data model.
14018 @item -mfix-and-continue
14019 @itemx -ffix-and-continue
14020 @itemx -findirect-data
14021 @opindex mfix-and-continue
14022 @opindex ffix-and-continue
14023 @opindex findirect-data
14024 Generate code suitable for fast turnaround development, such as to
14025 allow GDB to dynamically load @code{.o} files into already-running
14026 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
14027 are provided for backwards compatibility.
14029 @item -all_load
14030 @opindex all_load
14031 Loads all members of static archive libraries.
14032 See man ld(1) for more information.
14034 @item -arch_errors_fatal
14035 @opindex arch_errors_fatal
14036 Cause the errors having to do with files that have the wrong architecture
14037 to be fatal.
14039 @item -bind_at_load
14040 @opindex bind_at_load
14041 Causes the output file to be marked such that the dynamic linker will
14042 bind all undefined references when the file is loaded or launched.
14044 @item -bundle
14045 @opindex bundle
14046 Produce a Mach-o bundle format file.
14047 See man ld(1) for more information.
14049 @item -bundle_loader @var{executable}
14050 @opindex bundle_loader
14051 This option specifies the @var{executable} that will load the build
14052 output file being linked.  See man ld(1) for more information.
14054 @item -dynamiclib
14055 @opindex dynamiclib
14056 When passed this option, GCC produces a dynamic library instead of
14057 an executable when linking, using the Darwin @file{libtool} command.
14059 @item -force_cpusubtype_ALL
14060 @opindex force_cpusubtype_ALL
14061 This causes GCC's output file to have the @var{ALL} subtype, instead of
14062 one controlled by the @option{-mcpu} or @option{-march} option.
14064 @item -allowable_client  @var{client_name}
14065 @itemx -client_name
14066 @itemx -compatibility_version
14067 @itemx -current_version
14068 @itemx -dead_strip
14069 @itemx -dependency-file
14070 @itemx -dylib_file
14071 @itemx -dylinker_install_name
14072 @itemx -dynamic
14073 @itemx -exported_symbols_list
14074 @itemx -filelist
14075 @need 800
14076 @itemx -flat_namespace
14077 @itemx -force_flat_namespace
14078 @itemx -headerpad_max_install_names
14079 @itemx -image_base
14080 @itemx -init
14081 @itemx -install_name
14082 @itemx -keep_private_externs
14083 @itemx -multi_module
14084 @itemx -multiply_defined
14085 @itemx -multiply_defined_unused
14086 @need 800
14087 @itemx -noall_load
14088 @itemx -no_dead_strip_inits_and_terms
14089 @itemx -nofixprebinding
14090 @itemx -nomultidefs
14091 @itemx -noprebind
14092 @itemx -noseglinkedit
14093 @itemx -pagezero_size
14094 @itemx -prebind
14095 @itemx -prebind_all_twolevel_modules
14096 @itemx -private_bundle
14097 @need 800
14098 @itemx -read_only_relocs
14099 @itemx -sectalign
14100 @itemx -sectobjectsymbols
14101 @itemx -whyload
14102 @itemx -seg1addr
14103 @itemx -sectcreate
14104 @itemx -sectobjectsymbols
14105 @itemx -sectorder
14106 @itemx -segaddr
14107 @itemx -segs_read_only_addr
14108 @need 800
14109 @itemx -segs_read_write_addr
14110 @itemx -seg_addr_table
14111 @itemx -seg_addr_table_filename
14112 @itemx -seglinkedit
14113 @itemx -segprot
14114 @itemx -segs_read_only_addr
14115 @itemx -segs_read_write_addr
14116 @itemx -single_module
14117 @itemx -static
14118 @itemx -sub_library
14119 @need 800
14120 @itemx -sub_umbrella
14121 @itemx -twolevel_namespace
14122 @itemx -umbrella
14123 @itemx -undefined
14124 @itemx -unexported_symbols_list
14125 @itemx -weak_reference_mismatches
14126 @itemx -whatsloaded
14127 @opindex allowable_client
14128 @opindex client_name
14129 @opindex compatibility_version
14130 @opindex current_version
14131 @opindex dead_strip
14132 @opindex dependency-file
14133 @opindex dylib_file
14134 @opindex dylinker_install_name
14135 @opindex dynamic
14136 @opindex exported_symbols_list
14137 @opindex filelist
14138 @opindex flat_namespace
14139 @opindex force_flat_namespace
14140 @opindex headerpad_max_install_names
14141 @opindex image_base
14142 @opindex init
14143 @opindex install_name
14144 @opindex keep_private_externs
14145 @opindex multi_module
14146 @opindex multiply_defined
14147 @opindex multiply_defined_unused
14148 @opindex noall_load
14149 @opindex no_dead_strip_inits_and_terms
14150 @opindex nofixprebinding
14151 @opindex nomultidefs
14152 @opindex noprebind
14153 @opindex noseglinkedit
14154 @opindex pagezero_size
14155 @opindex prebind
14156 @opindex prebind_all_twolevel_modules
14157 @opindex private_bundle
14158 @opindex read_only_relocs
14159 @opindex sectalign
14160 @opindex sectobjectsymbols
14161 @opindex whyload
14162 @opindex seg1addr
14163 @opindex sectcreate
14164 @opindex sectobjectsymbols
14165 @opindex sectorder
14166 @opindex segaddr
14167 @opindex segs_read_only_addr
14168 @opindex segs_read_write_addr
14169 @opindex seg_addr_table
14170 @opindex seg_addr_table_filename
14171 @opindex seglinkedit
14172 @opindex segprot
14173 @opindex segs_read_only_addr
14174 @opindex segs_read_write_addr
14175 @opindex single_module
14176 @opindex static
14177 @opindex sub_library
14178 @opindex sub_umbrella
14179 @opindex twolevel_namespace
14180 @opindex umbrella
14181 @opindex undefined
14182 @opindex unexported_symbols_list
14183 @opindex weak_reference_mismatches
14184 @opindex whatsloaded
14185 These options are passed to the Darwin linker.  The Darwin linker man page
14186 describes them in detail.
14187 @end table
14189 @node DEC Alpha Options
14190 @subsection DEC Alpha Options
14192 These @samp{-m} options are defined for the DEC Alpha implementations:
14194 @table @gcctabopt
14195 @item -mno-soft-float
14196 @itemx -msoft-float
14197 @opindex mno-soft-float
14198 @opindex msoft-float
14199 Use (do not use) the hardware floating-point instructions for
14200 floating-point operations.  When @option{-msoft-float} is specified,
14201 functions in @file{libgcc.a} are used to perform floating-point
14202 operations.  Unless they are replaced by routines that emulate the
14203 floating-point operations, or compiled in such a way as to call such
14204 emulations routines, these routines issue floating-point
14205 operations.   If you are compiling for an Alpha without floating-point
14206 operations, you must ensure that the library is built so as not to call
14207 them.
14209 Note that Alpha implementations without floating-point operations are
14210 required to have floating-point registers.
14212 @item -mfp-reg
14213 @itemx -mno-fp-regs
14214 @opindex mfp-reg
14215 @opindex mno-fp-regs
14216 Generate code that uses (does not use) the floating-point register set.
14217 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
14218 register set is not used, floating-point operands are passed in integer
14219 registers as if they were integers and floating-point results are passed
14220 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
14221 so any function with a floating-point argument or return value called by code
14222 compiled with @option{-mno-fp-regs} must also be compiled with that
14223 option.
14225 A typical use of this option is building a kernel that does not use,
14226 and hence need not save and restore, any floating-point registers.
14228 @item -mieee
14229 @opindex mieee
14230 The Alpha architecture implements floating-point hardware optimized for
14231 maximum performance.  It is mostly compliant with the IEEE floating-point
14232 standard.  However, for full compliance, software assistance is
14233 required.  This option generates code fully IEEE-compliant code
14234 @emph{except} that the @var{inexact-flag} is not maintained (see below).
14235 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
14236 defined during compilation.  The resulting code is less efficient but is
14237 able to correctly support denormalized numbers and exceptional IEEE
14238 values such as not-a-number and plus/minus infinity.  Other Alpha
14239 compilers call this option @option{-ieee_with_no_inexact}.
14241 @item -mieee-with-inexact
14242 @opindex mieee-with-inexact
14243 This is like @option{-mieee} except the generated code also maintains
14244 the IEEE @var{inexact-flag}.  Turning on this option causes the
14245 generated code to implement fully-compliant IEEE math.  In addition to
14246 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
14247 macro.  On some Alpha implementations the resulting code may execute
14248 significantly slower than the code generated by default.  Since there is
14249 very little code that depends on the @var{inexact-flag}, you should
14250 normally not specify this option.  Other Alpha compilers call this
14251 option @option{-ieee_with_inexact}.
14253 @item -mfp-trap-mode=@var{trap-mode}
14254 @opindex mfp-trap-mode
14255 This option controls what floating-point related traps are enabled.
14256 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
14257 The trap mode can be set to one of four values:
14259 @table @samp
14260 @item n
14261 This is the default (normal) setting.  The only traps that are enabled
14262 are the ones that cannot be disabled in software (e.g., division by zero
14263 trap).
14265 @item u
14266 In addition to the traps enabled by @samp{n}, underflow traps are enabled
14267 as well.
14269 @item su
14270 Like @samp{u}, but the instructions are marked to be safe for software
14271 completion (see Alpha architecture manual for details).
14273 @item sui
14274 Like @samp{su}, but inexact traps are enabled as well.
14275 @end table
14277 @item -mfp-rounding-mode=@var{rounding-mode}
14278 @opindex mfp-rounding-mode
14279 Selects the IEEE rounding mode.  Other Alpha compilers call this option
14280 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
14283 @table @samp
14284 @item n
14285 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
14286 the nearest machine number or towards the even machine number in case
14287 of a tie.
14289 @item m
14290 Round towards minus infinity.
14292 @item c
14293 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
14295 @item d
14296 Dynamic rounding mode.  A field in the floating-point control register
14297 (@var{fpcr}, see Alpha architecture reference manual) controls the
14298 rounding mode in effect.  The C library initializes this register for
14299 rounding towards plus infinity.  Thus, unless your program modifies the
14300 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
14301 @end table
14303 @item -mtrap-precision=@var{trap-precision}
14304 @opindex mtrap-precision
14305 In the Alpha architecture, floating-point traps are imprecise.  This
14306 means without software assistance it is impossible to recover from a
14307 floating trap and program execution normally needs to be terminated.
14308 GCC can generate code that can assist operating system trap handlers
14309 in determining the exact location that caused a floating-point trap.
14310 Depending on the requirements of an application, different levels of
14311 precisions can be selected:
14313 @table @samp
14314 @item p
14315 Program precision.  This option is the default and means a trap handler
14316 can only identify which program caused a floating-point exception.
14318 @item f
14319 Function precision.  The trap handler can determine the function that
14320 caused a floating-point exception.
14322 @item i
14323 Instruction precision.  The trap handler can determine the exact
14324 instruction that caused a floating-point exception.
14325 @end table
14327 Other Alpha compilers provide the equivalent options called
14328 @option{-scope_safe} and @option{-resumption_safe}.
14330 @item -mieee-conformant
14331 @opindex mieee-conformant
14332 This option marks the generated code as IEEE conformant.  You must not
14333 use this option unless you also specify @option{-mtrap-precision=i} and either
14334 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
14335 is to emit the line @samp{.eflag 48} in the function prologue of the
14336 generated assembly file.
14338 @item -mbuild-constants
14339 @opindex mbuild-constants
14340 Normally GCC examines a 32- or 64-bit integer constant to
14341 see if it can construct it from smaller constants in two or three
14342 instructions.  If it cannot, it outputs the constant as a literal and
14343 generates code to load it from the data segment at run time.
14345 Use this option to require GCC to construct @emph{all} integer constants
14346 using code, even if it takes more instructions (the maximum is six).
14348 You typically use this option to build a shared library dynamic
14349 loader.  Itself a shared library, it must relocate itself in memory
14350 before it can find the variables and constants in its own data segment.
14352 @item -mbwx
14353 @itemx -mno-bwx
14354 @itemx -mcix
14355 @itemx -mno-cix
14356 @itemx -mfix
14357 @itemx -mno-fix
14358 @itemx -mmax
14359 @itemx -mno-max
14360 @opindex mbwx
14361 @opindex mno-bwx
14362 @opindex mcix
14363 @opindex mno-cix
14364 @opindex mfix
14365 @opindex mno-fix
14366 @opindex mmax
14367 @opindex mno-max
14368 Indicate whether GCC should generate code to use the optional BWX,
14369 CIX, FIX and MAX instruction sets.  The default is to use the instruction
14370 sets supported by the CPU type specified via @option{-mcpu=} option or that
14371 of the CPU on which GCC was built if none is specified.
14373 @item -mfloat-vax
14374 @itemx -mfloat-ieee
14375 @opindex mfloat-vax
14376 @opindex mfloat-ieee
14377 Generate code that uses (does not use) VAX F and G floating-point
14378 arithmetic instead of IEEE single and double precision.
14380 @item -mexplicit-relocs
14381 @itemx -mno-explicit-relocs
14382 @opindex mexplicit-relocs
14383 @opindex mno-explicit-relocs
14384 Older Alpha assemblers provided no way to generate symbol relocations
14385 except via assembler macros.  Use of these macros does not allow
14386 optimal instruction scheduling.  GNU binutils as of version 2.12
14387 supports a new syntax that allows the compiler to explicitly mark
14388 which relocations should apply to which instructions.  This option
14389 is mostly useful for debugging, as GCC detects the capabilities of
14390 the assembler when it is built and sets the default accordingly.
14392 @item -msmall-data
14393 @itemx -mlarge-data
14394 @opindex msmall-data
14395 @opindex mlarge-data
14396 When @option{-mexplicit-relocs} is in effect, static data is
14397 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
14398 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
14399 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
14400 16-bit relocations off of the @code{$gp} register.  This limits the
14401 size of the small data area to 64KB, but allows the variables to be
14402 directly accessed via a single instruction.
14404 The default is @option{-mlarge-data}.  With this option the data area
14405 is limited to just below 2GB@.  Programs that require more than 2GB of
14406 data must use @code{malloc} or @code{mmap} to allocate the data in the
14407 heap instead of in the program's data segment.
14409 When generating code for shared libraries, @option{-fpic} implies
14410 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
14412 @item -msmall-text
14413 @itemx -mlarge-text
14414 @opindex msmall-text
14415 @opindex mlarge-text
14416 When @option{-msmall-text} is used, the compiler assumes that the
14417 code of the entire program (or shared library) fits in 4MB, and is
14418 thus reachable with a branch instruction.  When @option{-msmall-data}
14419 is used, the compiler can assume that all local symbols share the
14420 same @code{$gp} value, and thus reduce the number of instructions
14421 required for a function call from 4 to 1.
14423 The default is @option{-mlarge-text}.
14425 @item -mcpu=@var{cpu_type}
14426 @opindex mcpu
14427 Set the instruction set and instruction scheduling parameters for
14428 machine type @var{cpu_type}.  You can specify either the @samp{EV}
14429 style name or the corresponding chip number.  GCC supports scheduling
14430 parameters for the EV4, EV5 and EV6 family of processors and
14431 chooses the default values for the instruction set from the processor
14432 you specify.  If you do not specify a processor type, GCC defaults
14433 to the processor on which the compiler was built.
14435 Supported values for @var{cpu_type} are
14437 @table @samp
14438 @item ev4
14439 @itemx ev45
14440 @itemx 21064
14441 Schedules as an EV4 and has no instruction set extensions.
14443 @item ev5
14444 @itemx 21164
14445 Schedules as an EV5 and has no instruction set extensions.
14447 @item ev56
14448 @itemx 21164a
14449 Schedules as an EV5 and supports the BWX extension.
14451 @item pca56
14452 @itemx 21164pc
14453 @itemx 21164PC
14454 Schedules as an EV5 and supports the BWX and MAX extensions.
14456 @item ev6
14457 @itemx 21264
14458 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
14460 @item ev67
14461 @itemx 21264a
14462 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
14463 @end table
14465 Native toolchains also support the value @samp{native},
14466 which selects the best architecture option for the host processor.
14467 @option{-mcpu=native} has no effect if GCC does not recognize
14468 the processor.
14470 @item -mtune=@var{cpu_type}
14471 @opindex mtune
14472 Set only the instruction scheduling parameters for machine type
14473 @var{cpu_type}.  The instruction set is not changed.
14475 Native toolchains also support the value @samp{native},
14476 which selects the best architecture option for the host processor.
14477 @option{-mtune=native} has no effect if GCC does not recognize
14478 the processor.
14480 @item -mmemory-latency=@var{time}
14481 @opindex mmemory-latency
14482 Sets the latency the scheduler should assume for typical memory
14483 references as seen by the application.  This number is highly
14484 dependent on the memory access patterns used by the application
14485 and the size of the external cache on the machine.
14487 Valid options for @var{time} are
14489 @table @samp
14490 @item @var{number}
14491 A decimal number representing clock cycles.
14493 @item L1
14494 @itemx L2
14495 @itemx L3
14496 @itemx main
14497 The compiler contains estimates of the number of clock cycles for
14498 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
14499 (also called Dcache, Scache, and Bcache), as well as to main memory.
14500 Note that L3 is only valid for EV5.
14502 @end table
14503 @end table
14505 @node FR30 Options
14506 @subsection FR30 Options
14507 @cindex FR30 Options
14509 These options are defined specifically for the FR30 port.
14511 @table @gcctabopt
14513 @item -msmall-model
14514 @opindex msmall-model
14515 Use the small address space model.  This can produce smaller code, but
14516 it does assume that all symbolic values and addresses fit into a
14517 20-bit range.
14519 @item -mno-lsim
14520 @opindex mno-lsim
14521 Assume that runtime support has been provided and so there is no need
14522 to include the simulator library (@file{libsim.a}) on the linker
14523 command line.
14525 @end table
14527 @node FRV Options
14528 @subsection FRV Options
14529 @cindex FRV Options
14531 @table @gcctabopt
14532 @item -mgpr-32
14533 @opindex mgpr-32
14535 Only use the first 32 general-purpose registers.
14537 @item -mgpr-64
14538 @opindex mgpr-64
14540 Use all 64 general-purpose registers.
14542 @item -mfpr-32
14543 @opindex mfpr-32
14545 Use only the first 32 floating-point registers.
14547 @item -mfpr-64
14548 @opindex mfpr-64
14550 Use all 64 floating-point registers.
14552 @item -mhard-float
14553 @opindex mhard-float
14555 Use hardware instructions for floating-point operations.
14557 @item -msoft-float
14558 @opindex msoft-float
14560 Use library routines for floating-point operations.
14562 @item -malloc-cc
14563 @opindex malloc-cc
14565 Dynamically allocate condition code registers.
14567 @item -mfixed-cc
14568 @opindex mfixed-cc
14570 Do not try to dynamically allocate condition code registers, only
14571 use @code{icc0} and @code{fcc0}.
14573 @item -mdword
14574 @opindex mdword
14576 Change ABI to use double word insns.
14578 @item -mno-dword
14579 @opindex mno-dword
14581 Do not use double word instructions.
14583 @item -mdouble
14584 @opindex mdouble
14586 Use floating-point double instructions.
14588 @item -mno-double
14589 @opindex mno-double
14591 Do not use floating-point double instructions.
14593 @item -mmedia
14594 @opindex mmedia
14596 Use media instructions.
14598 @item -mno-media
14599 @opindex mno-media
14601 Do not use media instructions.
14603 @item -mmuladd
14604 @opindex mmuladd
14606 Use multiply and add/subtract instructions.
14608 @item -mno-muladd
14609 @opindex mno-muladd
14611 Do not use multiply and add/subtract instructions.
14613 @item -mfdpic
14614 @opindex mfdpic
14616 Select the FDPIC ABI, which uses function descriptors to represent
14617 pointers to functions.  Without any PIC/PIE-related options, it
14618 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
14619 assumes GOT entries and small data are within a 12-bit range from the
14620 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
14621 are computed with 32 bits.
14622 With a @samp{bfin-elf} target, this option implies @option{-msim}.
14624 @item -minline-plt
14625 @opindex minline-plt
14627 Enable inlining of PLT entries in function calls to functions that are
14628 not known to bind locally.  It has no effect without @option{-mfdpic}.
14629 It's enabled by default if optimizing for speed and compiling for
14630 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
14631 optimization option such as @option{-O3} or above is present in the
14632 command line.
14634 @item -mTLS
14635 @opindex mTLS
14637 Assume a large TLS segment when generating thread-local code.
14639 @item -mtls
14640 @opindex mtls
14642 Do not assume a large TLS segment when generating thread-local code.
14644 @item -mgprel-ro
14645 @opindex mgprel-ro
14647 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
14648 that is known to be in read-only sections.  It's enabled by default,
14649 except for @option{-fpic} or @option{-fpie}: even though it may help
14650 make the global offset table smaller, it trades 1 instruction for 4.
14651 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
14652 one of which may be shared by multiple symbols, and it avoids the need
14653 for a GOT entry for the referenced symbol, so it's more likely to be a
14654 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
14656 @item -multilib-library-pic
14657 @opindex multilib-library-pic
14659 Link with the (library, not FD) pic libraries.  It's implied by
14660 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
14661 @option{-fpic} without @option{-mfdpic}.  You should never have to use
14662 it explicitly.
14664 @item -mlinked-fp
14665 @opindex mlinked-fp
14667 Follow the EABI requirement of always creating a frame pointer whenever
14668 a stack frame is allocated.  This option is enabled by default and can
14669 be disabled with @option{-mno-linked-fp}.
14671 @item -mlong-calls
14672 @opindex mlong-calls
14674 Use indirect addressing to call functions outside the current
14675 compilation unit.  This allows the functions to be placed anywhere
14676 within the 32-bit address space.
14678 @item -malign-labels
14679 @opindex malign-labels
14681 Try to align labels to an 8-byte boundary by inserting NOPs into the
14682 previous packet.  This option only has an effect when VLIW packing
14683 is enabled.  It doesn't create new packets; it merely adds NOPs to
14684 existing ones.
14686 @item -mlibrary-pic
14687 @opindex mlibrary-pic
14689 Generate position-independent EABI code.
14691 @item -macc-4
14692 @opindex macc-4
14694 Use only the first four media accumulator registers.
14696 @item -macc-8
14697 @opindex macc-8
14699 Use all eight media accumulator registers.
14701 @item -mpack
14702 @opindex mpack
14704 Pack VLIW instructions.
14706 @item -mno-pack
14707 @opindex mno-pack
14709 Do not pack VLIW instructions.
14711 @item -mno-eflags
14712 @opindex mno-eflags
14714 Do not mark ABI switches in e_flags.
14716 @item -mcond-move
14717 @opindex mcond-move
14719 Enable the use of conditional-move instructions (default).
14721 This switch is mainly for debugging the compiler and will likely be removed
14722 in a future version.
14724 @item -mno-cond-move
14725 @opindex mno-cond-move
14727 Disable the use of conditional-move instructions.
14729 This switch is mainly for debugging the compiler and will likely be removed
14730 in a future version.
14732 @item -mscc
14733 @opindex mscc
14735 Enable the use of conditional set instructions (default).
14737 This switch is mainly for debugging the compiler and will likely be removed
14738 in a future version.
14740 @item -mno-scc
14741 @opindex mno-scc
14743 Disable the use of conditional set instructions.
14745 This switch is mainly for debugging the compiler and will likely be removed
14746 in a future version.
14748 @item -mcond-exec
14749 @opindex mcond-exec
14751 Enable the use of conditional execution (default).
14753 This switch is mainly for debugging the compiler and will likely be removed
14754 in a future version.
14756 @item -mno-cond-exec
14757 @opindex mno-cond-exec
14759 Disable the use of conditional execution.
14761 This switch is mainly for debugging the compiler and will likely be removed
14762 in a future version.
14764 @item -mvliw-branch
14765 @opindex mvliw-branch
14767 Run a pass to pack branches into VLIW instructions (default).
14769 This switch is mainly for debugging the compiler and will likely be removed
14770 in a future version.
14772 @item -mno-vliw-branch
14773 @opindex mno-vliw-branch
14775 Do not run a pass to pack branches into VLIW instructions.
14777 This switch is mainly for debugging the compiler and will likely be removed
14778 in a future version.
14780 @item -mmulti-cond-exec
14781 @opindex mmulti-cond-exec
14783 Enable optimization of @code{&&} and @code{||} in conditional execution
14784 (default).
14786 This switch is mainly for debugging the compiler and will likely be removed
14787 in a future version.
14789 @item -mno-multi-cond-exec
14790 @opindex mno-multi-cond-exec
14792 Disable optimization of @code{&&} and @code{||} in conditional execution.
14794 This switch is mainly for debugging the compiler and will likely be removed
14795 in a future version.
14797 @item -mnested-cond-exec
14798 @opindex mnested-cond-exec
14800 Enable nested conditional execution optimizations (default).
14802 This switch is mainly for debugging the compiler and will likely be removed
14803 in a future version.
14805 @item -mno-nested-cond-exec
14806 @opindex mno-nested-cond-exec
14808 Disable nested conditional execution optimizations.
14810 This switch is mainly for debugging the compiler and will likely be removed
14811 in a future version.
14813 @item -moptimize-membar
14814 @opindex moptimize-membar
14816 This switch removes redundant @code{membar} instructions from the
14817 compiler-generated code.  It is enabled by default.
14819 @item -mno-optimize-membar
14820 @opindex mno-optimize-membar
14822 This switch disables the automatic removal of redundant @code{membar}
14823 instructions from the generated code.
14825 @item -mtomcat-stats
14826 @opindex mtomcat-stats
14828 Cause gas to print out tomcat statistics.
14830 @item -mcpu=@var{cpu}
14831 @opindex mcpu
14833 Select the processor type for which to generate code.  Possible values are
14834 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
14835 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
14837 @end table
14839 @node GNU/Linux Options
14840 @subsection GNU/Linux Options
14842 These @samp{-m} options are defined for GNU/Linux targets:
14844 @table @gcctabopt
14845 @item -mglibc
14846 @opindex mglibc
14847 Use the GNU C library.  This is the default except
14848 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
14850 @item -muclibc
14851 @opindex muclibc
14852 Use uClibc C library.  This is the default on
14853 @samp{*-*-linux-*uclibc*} targets.
14855 @item -mbionic
14856 @opindex mbionic
14857 Use Bionic C library.  This is the default on
14858 @samp{*-*-linux-*android*} targets.
14860 @item -mandroid
14861 @opindex mandroid
14862 Compile code compatible with Android platform.  This is the default on
14863 @samp{*-*-linux-*android*} targets.
14865 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
14866 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
14867 this option makes the GCC driver pass Android-specific options to the linker.
14868 Finally, this option causes the preprocessor macro @code{__ANDROID__}
14869 to be defined.
14871 @item -tno-android-cc
14872 @opindex tno-android-cc
14873 Disable compilation effects of @option{-mandroid}, i.e., do not enable
14874 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
14875 @option{-fno-rtti} by default.
14877 @item -tno-android-ld
14878 @opindex tno-android-ld
14879 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
14880 linking options to the linker.
14882 @end table
14884 @node H8/300 Options
14885 @subsection H8/300 Options
14887 These @samp{-m} options are defined for the H8/300 implementations:
14889 @table @gcctabopt
14890 @item -mrelax
14891 @opindex mrelax
14892 Shorten some address references at link time, when possible; uses the
14893 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
14894 ld, Using ld}, for a fuller description.
14896 @item -mh
14897 @opindex mh
14898 Generate code for the H8/300H@.
14900 @item -ms
14901 @opindex ms
14902 Generate code for the H8S@.
14904 @item -mn
14905 @opindex mn
14906 Generate code for the H8S and H8/300H in the normal mode.  This switch
14907 must be used either with @option{-mh} or @option{-ms}.
14909 @item -ms2600
14910 @opindex ms2600
14911 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
14913 @item -mexr
14914 @opindex mexr
14915 Extended registers are stored on stack before execution of function
14916 with monitor attribute. Default option is @option{-mexr}.
14917 This option is valid only for H8S targets.
14919 @item -mno-exr
14920 @opindex mno-exr
14921 Extended registers are not stored on stack before execution of function 
14922 with monitor attribute. Default option is @option{-mno-exr}. 
14923 This option is valid only for H8S targets.
14925 @item -mint32
14926 @opindex mint32
14927 Make @code{int} data 32 bits by default.
14929 @item -malign-300
14930 @opindex malign-300
14931 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
14932 The default for the H8/300H and H8S is to align longs and floats on
14933 4-byte boundaries.
14934 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
14935 This option has no effect on the H8/300.
14936 @end table
14938 @node HPPA Options
14939 @subsection HPPA Options
14940 @cindex HPPA Options
14942 These @samp{-m} options are defined for the HPPA family of computers:
14944 @table @gcctabopt
14945 @item -march=@var{architecture-type}
14946 @opindex march
14947 Generate code for the specified architecture.  The choices for
14948 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
14949 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
14950 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
14951 architecture option for your machine.  Code compiled for lower numbered
14952 architectures runs on higher numbered architectures, but not the
14953 other way around.
14955 @item -mpa-risc-1-0
14956 @itemx -mpa-risc-1-1
14957 @itemx -mpa-risc-2-0
14958 @opindex mpa-risc-1-0
14959 @opindex mpa-risc-1-1
14960 @opindex mpa-risc-2-0
14961 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
14963 @item -mjump-in-delay
14964 @opindex mjump-in-delay
14965 This option is ignored and provided for compatibility purposes only.
14967 @item -mdisable-fpregs
14968 @opindex mdisable-fpregs
14969 Prevent floating-point registers from being used in any manner.  This is
14970 necessary for compiling kernels that perform lazy context switching of
14971 floating-point registers.  If you use this option and attempt to perform
14972 floating-point operations, the compiler aborts.
14974 @item -mdisable-indexing
14975 @opindex mdisable-indexing
14976 Prevent the compiler from using indexing address modes.  This avoids some
14977 rather obscure problems when compiling MIG generated code under MACH@.
14979 @item -mno-space-regs
14980 @opindex mno-space-regs
14981 Generate code that assumes the target has no space registers.  This allows
14982 GCC to generate faster indirect calls and use unscaled index address modes.
14984 Such code is suitable for level 0 PA systems and kernels.
14986 @item -mfast-indirect-calls
14987 @opindex mfast-indirect-calls
14988 Generate code that assumes calls never cross space boundaries.  This
14989 allows GCC to emit code that performs faster indirect calls.
14991 This option does not work in the presence of shared libraries or nested
14992 functions.
14994 @item -mfixed-range=@var{register-range}
14995 @opindex mfixed-range
14996 Generate code treating the given register range as fixed registers.
14997 A fixed register is one that the register allocator cannot use.  This is
14998 useful when compiling kernel code.  A register range is specified as
14999 two registers separated by a dash.  Multiple register ranges can be
15000 specified separated by a comma.
15002 @item -mlong-load-store
15003 @opindex mlong-load-store
15004 Generate 3-instruction load and store sequences as sometimes required by
15005 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
15006 the HP compilers.
15008 @item -mportable-runtime
15009 @opindex mportable-runtime
15010 Use the portable calling conventions proposed by HP for ELF systems.
15012 @item -mgas
15013 @opindex mgas
15014 Enable the use of assembler directives only GAS understands.
15016 @item -mschedule=@var{cpu-type}
15017 @opindex mschedule
15018 Schedule code according to the constraints for the machine type
15019 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
15020 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
15021 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
15022 proper scheduling option for your machine.  The default scheduling is
15023 @samp{8000}.
15025 @item -mlinker-opt
15026 @opindex mlinker-opt
15027 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
15028 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
15029 linkers in which they give bogus error messages when linking some programs.
15031 @item -msoft-float
15032 @opindex msoft-float
15033 Generate output containing library calls for floating point.
15034 @strong{Warning:} the requisite libraries are not available for all HPPA
15035 targets.  Normally the facilities of the machine's usual C compiler are
15036 used, but this cannot be done directly in cross-compilation.  You must make
15037 your own arrangements to provide suitable library functions for
15038 cross-compilation.
15040 @option{-msoft-float} changes the calling convention in the output file;
15041 therefore, it is only useful if you compile @emph{all} of a program with
15042 this option.  In particular, you need to compile @file{libgcc.a}, the
15043 library that comes with GCC, with @option{-msoft-float} in order for
15044 this to work.
15046 @item -msio
15047 @opindex msio
15048 Generate the predefine, @code{_SIO}, for server IO@.  The default is
15049 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
15050 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
15051 options are available under HP-UX and HI-UX@.
15053 @item -mgnu-ld
15054 @opindex mgnu-ld
15055 Use options specific to GNU @command{ld}.
15056 This passes @option{-shared} to @command{ld} when
15057 building a shared library.  It is the default when GCC is configured,
15058 explicitly or implicitly, with the GNU linker.  This option does not
15059 affect which @command{ld} is called; it only changes what parameters
15060 are passed to that @command{ld}.
15061 The @command{ld} that is called is determined by the
15062 @option{--with-ld} configure option, GCC's program search path, and
15063 finally by the user's @env{PATH}.  The linker used by GCC can be printed
15064 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
15065 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
15067 @item -mhp-ld
15068 @opindex mhp-ld
15069 Use options specific to HP @command{ld}.
15070 This passes @option{-b} to @command{ld} when building
15071 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
15072 links.  It is the default when GCC is configured, explicitly or
15073 implicitly, with the HP linker.  This option does not affect
15074 which @command{ld} is called; it only changes what parameters are passed to that
15075 @command{ld}.
15076 The @command{ld} that is called is determined by the @option{--with-ld}
15077 configure option, GCC's program search path, and finally by the user's
15078 @env{PATH}.  The linker used by GCC can be printed using @samp{which
15079 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
15080 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
15082 @item -mlong-calls
15083 @opindex mno-long-calls
15084 Generate code that uses long call sequences.  This ensures that a call
15085 is always able to reach linker generated stubs.  The default is to generate
15086 long calls only when the distance from the call site to the beginning
15087 of the function or translation unit, as the case may be, exceeds a
15088 predefined limit set by the branch type being used.  The limits for
15089 normal calls are 7,600,000 and 240,000 bytes, respectively for the
15090 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
15091 240,000 bytes.
15093 Distances are measured from the beginning of functions when using the
15094 @option{-ffunction-sections} option, or when using the @option{-mgas}
15095 and @option{-mno-portable-runtime} options together under HP-UX with
15096 the SOM linker.
15098 It is normally not desirable to use this option as it degrades
15099 performance.  However, it may be useful in large applications,
15100 particularly when partial linking is used to build the application.
15102 The types of long calls used depends on the capabilities of the
15103 assembler and linker, and the type of code being generated.  The
15104 impact on systems that support long absolute calls, and long pic
15105 symbol-difference or pc-relative calls should be relatively small.
15106 However, an indirect call is used on 32-bit ELF systems in pic code
15107 and it is quite long.
15109 @item -munix=@var{unix-std}
15110 @opindex march
15111 Generate compiler predefines and select a startfile for the specified
15112 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
15113 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
15114 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
15115 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
15116 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
15117 and later.
15119 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
15120 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
15121 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
15122 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
15123 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
15124 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
15126 It is @emph{important} to note that this option changes the interfaces
15127 for various library routines.  It also affects the operational behavior
15128 of the C library.  Thus, @emph{extreme} care is needed in using this
15129 option.
15131 Library code that is intended to operate with more than one UNIX
15132 standard must test, set and restore the variable @var{__xpg4_extended_mask}
15133 as appropriate.  Most GNU software doesn't provide this capability.
15135 @item -nolibdld
15136 @opindex nolibdld
15137 Suppress the generation of link options to search libdld.sl when the
15138 @option{-static} option is specified on HP-UX 10 and later.
15140 @item -static
15141 @opindex static
15142 The HP-UX implementation of setlocale in libc has a dependency on
15143 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
15144 when the @option{-static} option is specified, special link options
15145 are needed to resolve this dependency.
15147 On HP-UX 10 and later, the GCC driver adds the necessary options to
15148 link with libdld.sl when the @option{-static} option is specified.
15149 This causes the resulting binary to be dynamic.  On the 64-bit port,
15150 the linkers generate dynamic binaries by default in any case.  The
15151 @option{-nolibdld} option can be used to prevent the GCC driver from
15152 adding these link options.
15154 @item -threads
15155 @opindex threads
15156 Add support for multithreading with the @dfn{dce thread} library
15157 under HP-UX@.  This option sets flags for both the preprocessor and
15158 linker.
15159 @end table
15161 @node i386 and x86-64 Options
15162 @subsection Intel 386 and AMD x86-64 Options
15163 @cindex i386 Options
15164 @cindex x86-64 Options
15165 @cindex Intel 386 Options
15166 @cindex AMD x86-64 Options
15168 These @samp{-m} options are defined for the i386 and x86-64 family of
15169 computers:
15171 @table @gcctabopt
15173 @item -march=@var{cpu-type}
15174 @opindex march
15175 Generate instructions for the machine type @var{cpu-type}.  In contrast to
15176 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
15177 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
15178 to generate code that may not run at all on processors other than the one
15179 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
15180 @option{-mtune=@var{cpu-type}}.
15182 The choices for @var{cpu-type} are:
15184 @table @samp
15185 @item native
15186 This selects the CPU to generate code for at compilation time by determining
15187 the processor type of the compiling machine.  Using @option{-march=native}
15188 enables all instruction subsets supported by the local machine (hence
15189 the result might not run on different machines).  Using @option{-mtune=native}
15190 produces code optimized for the local machine under the constraints
15191 of the selected instruction set.  
15193 @item i386
15194 Original Intel i386 CPU@.
15196 @item i486
15197 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
15199 @item i586
15200 @itemx pentium
15201 Intel Pentium CPU with no MMX support.
15203 @item pentium-mmx
15204 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
15206 @item pentiumpro
15207 Intel Pentium Pro CPU@.
15209 @item i686
15210 When used with @option{-march}, the Pentium Pro
15211 instruction set is used, so the code runs on all i686 family chips.
15212 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
15214 @item pentium2
15215 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
15216 support.
15218 @item pentium3
15219 @itemx pentium3m
15220 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
15221 set support.
15223 @item pentium-m
15224 Intel Pentium M; low-power version of Intel Pentium III CPU
15225 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
15227 @item pentium4
15228 @itemx pentium4m
15229 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
15231 @item prescott
15232 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
15233 set support.
15235 @item nocona
15236 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
15237 SSE2 and SSE3 instruction set support.
15239 @item core2
15240 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
15241 instruction set support.
15243 @item nehalem
15244 Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
15245 SSE4.1, SSE4.2 and POPCNT instruction set support.
15247 @item westmere
15248 Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
15249 SSE4.1, SSE4.2, POPCNT, AES and PCLMUL instruction set support.
15251 @item sandybridge
15252 Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
15253 SSE4.1, SSE4.2, POPCNT, AVX, AES and PCLMUL instruction set support.
15255 @item ivybridge
15256 Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
15257 SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C
15258 instruction set support.
15260 @item haswell
15261 Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
15262 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
15263 BMI, BMI2 and F16C instruction set support.
15265 @item broadwell
15266 Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
15267 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
15268 BMI, BMI2, F16C, RDSEED, ADCX and PREFETCHW instruction set support.
15270 @item bonnell
15271 Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
15272 instruction set support.
15274 @item silvermont
15275 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
15276 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL and RDRND instruction set support.
15278 @item k6
15279 AMD K6 CPU with MMX instruction set support.
15281 @item k6-2
15282 @itemx k6-3
15283 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
15285 @item athlon
15286 @itemx athlon-tbird
15287 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
15288 support.
15290 @item athlon-4
15291 @itemx athlon-xp
15292 @itemx athlon-mp
15293 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
15294 instruction set support.
15296 @item k8
15297 @itemx opteron
15298 @itemx athlon64
15299 @itemx athlon-fx
15300 Processors based on the AMD K8 core with x86-64 instruction set support,
15301 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
15302 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
15303 instruction set extensions.)
15305 @item k8-sse3
15306 @itemx opteron-sse3
15307 @itemx athlon64-sse3
15308 Improved versions of AMD K8 cores with SSE3 instruction set support.
15310 @item amdfam10
15311 @itemx barcelona
15312 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
15313 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
15314 instruction set extensions.)
15316 @item bdver1
15317 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
15318 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
15319 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
15320 @item bdver2
15321 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
15322 supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX,
15323 SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
15324 extensions.)
15325 @item bdver3
15326 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
15327 supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, XOP, LWP, AES, 
15328 PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 
15329 64-bit instruction set extensions.
15330 @item bdver4
15331 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
15332 supersets BMI, BMI2, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, AVX2, XOP, LWP, 
15333 AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, 
15334 SSE4.2, ABM and 64-bit instruction set extensions.
15336 @item btver1
15337 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
15338 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
15339 instruction set extensions.)
15341 @item btver2
15342 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
15343 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
15344 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
15346 @item winchip-c6
15347 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
15348 set support.
15350 @item winchip2
15351 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
15352 instruction set support.
15354 @item c3
15355 VIA C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
15356 implemented for this chip.)
15358 @item c3-2
15359 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
15360 (No scheduling is
15361 implemented for this chip.)
15363 @item geode
15364 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
15365 @end table
15367 @item -mtune=@var{cpu-type}
15368 @opindex mtune
15369 Tune to @var{cpu-type} everything applicable about the generated code, except
15370 for the ABI and the set of available instructions.  
15371 While picking a specific @var{cpu-type} schedules things appropriately
15372 for that particular chip, the compiler does not generate any code that
15373 cannot run on the default machine type unless you use a
15374 @option{-march=@var{cpu-type}} option.
15375 For example, if GCC is configured for i686-pc-linux-gnu
15376 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
15377 but still runs on i686 machines.
15379 The choices for @var{cpu-type} are the same as for @option{-march}.
15380 In addition, @option{-mtune} supports 2 extra choices for @var{cpu-type}:
15382 @table @samp
15383 @item generic
15384 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
15385 If you know the CPU on which your code will run, then you should use
15386 the corresponding @option{-mtune} or @option{-march} option instead of
15387 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
15388 of your application will have, then you should use this option.
15390 As new processors are deployed in the marketplace, the behavior of this
15391 option will change.  Therefore, if you upgrade to a newer version of
15392 GCC, code generation controlled by this option will change to reflect
15393 the processors
15394 that are most common at the time that version of GCC is released.
15396 There is no @option{-march=generic} option because @option{-march}
15397 indicates the instruction set the compiler can use, and there is no
15398 generic instruction set applicable to all processors.  In contrast,
15399 @option{-mtune} indicates the processor (or, in this case, collection of
15400 processors) for which the code is optimized.
15402 @item intel
15403 Produce code optimized for the most current Intel processors, which are
15404 Haswell and Silvermont for this version of GCC.  If you know the CPU
15405 on which your code will run, then you should use the corresponding
15406 @option{-mtune} or @option{-march} option instead of @option{-mtune=intel}.
15407 But, if you want your application performs better on both Haswell and
15408 Silvermont, then you should use this option.
15410 As new Intel processors are deployed in the marketplace, the behavior of
15411 this option will change.  Therefore, if you upgrade to a newer version of
15412 GCC, code generation controlled by this option will change to reflect
15413 the most current Intel processors at the time that version of GCC is
15414 released.
15416 There is no @option{-march=intel} option because @option{-march} indicates
15417 the instruction set the compiler can use, and there is no common
15418 instruction set applicable to all processors.  In contrast,
15419 @option{-mtune} indicates the processor (or, in this case, collection of
15420 processors) for which the code is optimized.
15421 @end table
15423 @item -mcpu=@var{cpu-type}
15424 @opindex mcpu
15425 A deprecated synonym for @option{-mtune}.
15427 @item -mfpmath=@var{unit}
15428 @opindex mfpmath
15429 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
15430 for @var{unit} are:
15432 @table @samp
15433 @item 387
15434 Use the standard 387 floating-point coprocessor present on the majority of chips and
15435 emulated otherwise.  Code compiled with this option runs almost everywhere.
15436 The temporary results are computed in 80-bit precision instead of the precision
15437 specified by the type, resulting in slightly different results compared to most
15438 of other chips.  See @option{-ffloat-store} for more detailed description.
15440 This is the default choice for i386 compiler.
15442 @item sse
15443 Use scalar floating-point instructions present in the SSE instruction set.
15444 This instruction set is supported by Pentium III and newer chips,
15445 and in the AMD line
15446 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
15447 instruction set supports only single-precision arithmetic, thus the double and
15448 extended-precision arithmetic are still done using 387.  A later version, present
15449 only in Pentium 4 and AMD x86-64 chips, supports double-precision
15450 arithmetic too.
15452 For the i386 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
15453 or @option{-msse2} switches to enable SSE extensions and make this option
15454 effective.  For the x86-64 compiler, these extensions are enabled by default.
15456 The resulting code should be considerably faster in the majority of cases and avoid
15457 the numerical instability problems of 387 code, but may break some existing
15458 code that expects temporaries to be 80 bits.
15460 This is the default choice for the x86-64 compiler.
15462 @item sse,387
15463 @itemx sse+387
15464 @itemx both
15465 Attempt to utilize both instruction sets at once.  This effectively doubles the
15466 amount of available registers, and on chips with separate execution units for
15467 387 and SSE the execution resources too.  Use this option with care, as it is
15468 still experimental, because the GCC register allocator does not model separate
15469 functional units well, resulting in unstable performance.
15470 @end table
15472 @item -masm=@var{dialect}
15473 @opindex masm=@var{dialect}
15474 Output assembly instructions using selected @var{dialect}.  Supported
15475 choices are @samp{intel} or @samp{att} (the default).  Darwin does
15476 not support @samp{intel}.
15478 @item -mieee-fp
15479 @itemx -mno-ieee-fp
15480 @opindex mieee-fp
15481 @opindex mno-ieee-fp
15482 Control whether or not the compiler uses IEEE floating-point
15483 comparisons.  These correctly handle the case where the result of a
15484 comparison is unordered.
15486 @item -msoft-float
15487 @opindex msoft-float
15488 Generate output containing library calls for floating point.
15490 @strong{Warning:} the requisite libraries are not part of GCC@.
15491 Normally the facilities of the machine's usual C compiler are used, but
15492 this can't be done directly in cross-compilation.  You must make your
15493 own arrangements to provide suitable library functions for
15494 cross-compilation.
15496 On machines where a function returns floating-point results in the 80387
15497 register stack, some floating-point opcodes may be emitted even if
15498 @option{-msoft-float} is used.
15500 @item -mno-fp-ret-in-387
15501 @opindex mno-fp-ret-in-387
15502 Do not use the FPU registers for return values of functions.
15504 The usual calling convention has functions return values of types
15505 @code{float} and @code{double} in an FPU register, even if there
15506 is no FPU@.  The idea is that the operating system should emulate
15507 an FPU@.
15509 The option @option{-mno-fp-ret-in-387} causes such values to be returned
15510 in ordinary CPU registers instead.
15512 @item -mno-fancy-math-387
15513 @opindex mno-fancy-math-387
15514 Some 387 emulators do not support the @code{sin}, @code{cos} and
15515 @code{sqrt} instructions for the 387.  Specify this option to avoid
15516 generating those instructions.  This option is the default on FreeBSD,
15517 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
15518 indicates that the target CPU always has an FPU and so the
15519 instruction does not need emulation.  These
15520 instructions are not generated unless you also use the
15521 @option{-funsafe-math-optimizations} switch.
15523 @item -malign-double
15524 @itemx -mno-align-double
15525 @opindex malign-double
15526 @opindex mno-align-double
15527 Control whether GCC aligns @code{double}, @code{long double}, and
15528 @code{long long} variables on a two-word boundary or a one-word
15529 boundary.  Aligning @code{double} variables on a two-word boundary
15530 produces code that runs somewhat faster on a Pentium at the
15531 expense of more memory.
15533 On x86-64, @option{-malign-double} is enabled by default.
15535 @strong{Warning:} if you use the @option{-malign-double} switch,
15536 structures containing the above types are aligned differently than
15537 the published application binary interface specifications for the 386
15538 and are not binary compatible with structures in code compiled
15539 without that switch.
15541 @item -m96bit-long-double
15542 @itemx -m128bit-long-double
15543 @opindex m96bit-long-double
15544 @opindex m128bit-long-double
15545 These switches control the size of @code{long double} type.  The i386
15546 application binary interface specifies the size to be 96 bits,
15547 so @option{-m96bit-long-double} is the default in 32-bit mode.
15549 Modern architectures (Pentium and newer) prefer @code{long double}
15550 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
15551 conforming to the ABI, this is not possible.  So specifying
15552 @option{-m128bit-long-double} aligns @code{long double}
15553 to a 16-byte boundary by padding the @code{long double} with an additional
15554 32-bit zero.
15556 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
15557 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
15559 Notice that neither of these options enable any extra precision over the x87
15560 standard of 80 bits for a @code{long double}.
15562 @strong{Warning:} if you override the default value for your target ABI, this
15563 changes the size of 
15564 structures and arrays containing @code{long double} variables,
15565 as well as modifying the function calling convention for functions taking
15566 @code{long double}.  Hence they are not binary-compatible
15567 with code compiled without that switch.
15569 @item -mlong-double-64
15570 @itemx -mlong-double-80
15571 @itemx -mlong-double-128
15572 @opindex mlong-double-64
15573 @opindex mlong-double-80
15574 @opindex mlong-double-128
15575 These switches control the size of @code{long double} type. A size
15576 of 64 bits makes the @code{long double} type equivalent to the @code{double}
15577 type. This is the default for 32-bit Bionic C library.  A size
15578 of 128 bits makes the @code{long double} type equivalent to the
15579 @code{__float128} type. This is the default for 64-bit Bionic C library.
15581 @strong{Warning:} if you override the default value for your target ABI, this
15582 changes the size of
15583 structures and arrays containing @code{long double} variables,
15584 as well as modifying the function calling convention for functions taking
15585 @code{long double}.  Hence they are not binary-compatible
15586 with code compiled without that switch.
15588 @item -mlarge-data-threshold=@var{threshold}
15589 @opindex mlarge-data-threshold
15590 When @option{-mcmodel=medium} is specified, data objects larger than
15591 @var{threshold} are placed in the large data section.  This value must be the
15592 same across all objects linked into the binary, and defaults to 65535.
15594 @item -mrtd
15595 @opindex mrtd
15596 Use a different function-calling convention, in which functions that
15597 take a fixed number of arguments return with the @code{ret @var{num}}
15598 instruction, which pops their arguments while returning.  This saves one
15599 instruction in the caller since there is no need to pop the arguments
15600 there.
15602 You can specify that an individual function is called with this calling
15603 sequence with the function attribute @samp{stdcall}.  You can also
15604 override the @option{-mrtd} option by using the function attribute
15605 @samp{cdecl}.  @xref{Function Attributes}.
15607 @strong{Warning:} this calling convention is incompatible with the one
15608 normally used on Unix, so you cannot use it if you need to call
15609 libraries compiled with the Unix compiler.
15611 Also, you must provide function prototypes for all functions that
15612 take variable numbers of arguments (including @code{printf});
15613 otherwise incorrect code is generated for calls to those
15614 functions.
15616 In addition, seriously incorrect code results if you call a
15617 function with too many arguments.  (Normally, extra arguments are
15618 harmlessly ignored.)
15620 @item -mregparm=@var{num}
15621 @opindex mregparm
15622 Control how many registers are used to pass integer arguments.  By
15623 default, no registers are used to pass arguments, and at most 3
15624 registers can be used.  You can control this behavior for a specific
15625 function by using the function attribute @samp{regparm}.
15626 @xref{Function Attributes}.
15628 @strong{Warning:} if you use this switch, and
15629 @var{num} is nonzero, then you must build all modules with the same
15630 value, including any libraries.  This includes the system libraries and
15631 startup modules.
15633 @item -msseregparm
15634 @opindex msseregparm
15635 Use SSE register passing conventions for float and double arguments
15636 and return values.  You can control this behavior for a specific
15637 function by using the function attribute @samp{sseregparm}.
15638 @xref{Function Attributes}.
15640 @strong{Warning:} if you use this switch then you must build all
15641 modules with the same value, including any libraries.  This includes
15642 the system libraries and startup modules.
15644 @item -mvect8-ret-in-mem
15645 @opindex mvect8-ret-in-mem
15646 Return 8-byte vectors in memory instead of MMX registers.  This is the
15647 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
15648 Studio compilers until version 12.  Later compiler versions (starting
15649 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
15650 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
15651 you need to remain compatible with existing code produced by those
15652 previous compiler versions or older versions of GCC@.
15654 @item -mpc32
15655 @itemx -mpc64
15656 @itemx -mpc80
15657 @opindex mpc32
15658 @opindex mpc64
15659 @opindex mpc80
15661 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
15662 is specified, the significands of results of floating-point operations are
15663 rounded to 24 bits (single precision); @option{-mpc64} rounds the
15664 significands of results of floating-point operations to 53 bits (double
15665 precision) and @option{-mpc80} rounds the significands of results of
15666 floating-point operations to 64 bits (extended double precision), which is
15667 the default.  When this option is used, floating-point operations in higher
15668 precisions are not available to the programmer without setting the FPU
15669 control word explicitly.
15671 Setting the rounding of floating-point operations to less than the default
15672 80 bits can speed some programs by 2% or more.  Note that some mathematical
15673 libraries assume that extended-precision (80-bit) floating-point operations
15674 are enabled by default; routines in such libraries could suffer significant
15675 loss of accuracy, typically through so-called ``catastrophic cancellation'',
15676 when this option is used to set the precision to less than extended precision.
15678 @item -mstackrealign
15679 @opindex mstackrealign
15680 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
15681 option generates an alternate prologue and epilogue that realigns the
15682 run-time stack if necessary.  This supports mixing legacy codes that keep
15683 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
15684 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
15685 applicable to individual functions.
15687 @item -mpreferred-stack-boundary=@var{num}
15688 @opindex mpreferred-stack-boundary
15689 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
15690 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
15691 the default is 4 (16 bytes or 128 bits).
15693 @strong{Warning:} When generating code for the x86-64 architecture with
15694 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
15695 used to keep the stack boundary aligned to 8 byte boundary.  Since
15696 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
15697 intended to be used in controlled environment where stack space is
15698 important limitation.  This option will lead to wrong code when functions
15699 compiled with 16 byte stack alignment (such as functions from a standard
15700 library) are called with misaligned stack.  In this case, SSE
15701 instructions may lead to misaligned memory access traps.  In addition,
15702 variable arguments will be handled incorrectly for 16 byte aligned
15703 objects (including x87 long double and __int128), leading to wrong
15704 results.  You must build all modules with
15705 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
15706 includes the system libraries and startup modules.
15708 @item -mincoming-stack-boundary=@var{num}
15709 @opindex mincoming-stack-boundary
15710 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
15711 boundary.  If @option{-mincoming-stack-boundary} is not specified,
15712 the one specified by @option{-mpreferred-stack-boundary} is used.
15714 On Pentium and Pentium Pro, @code{double} and @code{long double} values
15715 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
15716 suffer significant run time performance penalties.  On Pentium III, the
15717 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
15718 properly if it is not 16-byte aligned.
15720 To ensure proper alignment of this values on the stack, the stack boundary
15721 must be as aligned as that required by any value stored on the stack.
15722 Further, every function must be generated such that it keeps the stack
15723 aligned.  Thus calling a function compiled with a higher preferred
15724 stack boundary from a function compiled with a lower preferred stack
15725 boundary most likely misaligns the stack.  It is recommended that
15726 libraries that use callbacks always use the default setting.
15728 This extra alignment does consume extra stack space, and generally
15729 increases code size.  Code that is sensitive to stack space usage, such
15730 as embedded systems and operating system kernels, may want to reduce the
15731 preferred alignment to @option{-mpreferred-stack-boundary=2}.
15733 @item -mmmx
15734 @itemx -mno-mmx
15735 @itemx -msse
15736 @itemx -mno-sse
15737 @itemx -msse2
15738 @itemx -mno-sse2
15739 @itemx -msse3
15740 @itemx -mno-sse3
15741 @itemx -mssse3
15742 @itemx -mno-ssse3
15743 @itemx -msse4.1
15744 @need 800
15745 @itemx -mno-sse4.1
15746 @itemx -msse4.2
15747 @itemx -mno-sse4.2
15748 @itemx -msse4
15749 @itemx -mno-sse4
15750 @itemx -mavx
15751 @itemx -mno-avx
15752 @itemx -mavx2
15753 @itemx -mno-avx2
15754 @itemx -mavx512f
15755 @itemx -mno-avx512f
15756 @need 800
15757 @itemx -mavx512pf
15758 @itemx -mno-avx512pf
15759 @itemx -mavx512er
15760 @itemx -mno-avx512er
15761 @itemx -mavx512cd
15762 @itemx -mno-avx512cd
15763 @itemx -msha
15764 @itemx -mno-sha
15765 @itemx -maes
15766 @itemx -mno-aes
15767 @itemx -mpclmul
15768 @itemx -mno-pclmul
15769 @itemx -mclfushopt
15770 @itemx -mno-clflsuhopt
15771 @need 800
15772 @itemx -mfsgsbase
15773 @itemx -mno-fsgsbase
15774 @itemx -mrdrnd
15775 @itemx -mno-rdrnd
15776 @itemx -mf16c
15777 @itemx -mno-f16c
15778 @itemx -mfma
15779 @itemx -mno-fma
15780 @itemx -mprefetchwt1
15781 @itemx -mno-prefetchwt1
15782 @itemx -msse4a
15783 @itemx -mno-sse4a
15784 @itemx -mfma4
15785 @itemx -mno-fma4
15786 @need 800
15787 @itemx -mxop
15788 @itemx -mno-xop
15789 @itemx -mlwp
15790 @itemx -mno-lwp
15791 @itemx -m3dnow
15792 @itemx -mno-3dnow
15793 @itemx -mpopcnt
15794 @itemx -mno-popcnt
15795 @itemx -mabm
15796 @itemx -mno-abm
15797 @itemx -mbmi
15798 @itemx -mbmi2
15799 @itemx -mno-bmi
15800 @itemx -mno-bmi2
15801 @itemx -mlzcnt
15802 @itemx -mno-lzcnt
15803 @itemx -mfxsr
15804 @itemx -mxsave
15805 @itemx -mxsaveopt
15806 @itemx -mrtm
15807 @itemx -mtbm
15808 @itemx -mno-tbm
15809 @itemx -mxsavec
15810 @itemx -mno-xsavec
15811 @itemx -mxsaves
15812 @itemx -mno-xsaves
15813 @itemx -mmpx
15814 @itemx -mno-mpx
15815 @opindex mmmx
15816 @opindex mno-mmx
15817 @opindex msse
15818 @opindex mno-sse
15819 @opindex m3dnow
15820 @opindex mno-3dnow
15821 These switches enable or disable the use of instructions in the MMX, SSE,
15822 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER, AVX512CD,
15823 SHA, AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A, FMA4, XOP, LWP, ABM,
15824 BMI, BMI2, FXSR, XSAVE, XSAVEOPT, LZCNT, RTM, MPX or 3DNow!@:
15825 extended instruction sets.
15826 These extensions are also available as built-in functions: see
15827 @ref{X86 Built-in Functions}, for details of the functions enabled and
15828 disabled by these switches.
15830 To generate SSE/SSE2 instructions automatically from floating-point
15831 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
15833 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
15834 generates new AVX instructions or AVX equivalence for all SSEx instructions
15835 when needed.
15837 These options enable GCC to use these extended instructions in
15838 generated code, even without @option{-mfpmath=sse}.  Applications that
15839 perform run-time CPU detection must compile separate files for each
15840 supported architecture, using the appropriate flags.  In particular,
15841 the file containing the CPU detection code should be compiled without
15842 these options.
15844 @item -mdump-tune-features
15845 @opindex mdump-tune-features
15846 This option instructs GCC to dump the names of the x86 performance 
15847 tuning features and default settings. The names can be used in 
15848 @option{-mtune-ctrl=@var{feature-list}}.
15850 @item -mtune-ctrl=@var{feature-list}
15851 @opindex mtune-ctrl=@var{feature-list}
15852 This option is used to do fine grain control of x86 code generation features.
15853 @var{feature-list} is a comma separated list of @var{feature} names. See also
15854 @option{-mdump-tune-features}. When specified, the @var{feature} will be turned
15855 on if it is not preceded with @code{^}, otherwise, it will be turned off. 
15856 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
15857 developers. Using it may lead to code paths not covered by testing and can
15858 potentially result in compiler ICEs or runtime errors.
15860 @item -mno-default
15861 @opindex mno-default
15862 This option instructs GCC to turn off all tunable features. See also 
15863 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
15865 @item -mcld
15866 @opindex mcld
15867 This option instructs GCC to emit a @code{cld} instruction in the prologue
15868 of functions that use string instructions.  String instructions depend on
15869 the DF flag to select between autoincrement or autodecrement mode.  While the
15870 ABI specifies the DF flag to be cleared on function entry, some operating
15871 systems violate this specification by not clearing the DF flag in their
15872 exception dispatchers.  The exception handler can be invoked with the DF flag
15873 set, which leads to wrong direction mode when string instructions are used.
15874 This option can be enabled by default on 32-bit x86 targets by configuring
15875 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
15876 instructions can be suppressed with the @option{-mno-cld} compiler option
15877 in this case.
15879 @item -mvzeroupper
15880 @opindex mvzeroupper
15881 This option instructs GCC to emit a @code{vzeroupper} instruction
15882 before a transfer of control flow out of the function to minimize
15883 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
15884 intrinsics.
15886 @item -mprefer-avx128
15887 @opindex mprefer-avx128
15888 This option instructs GCC to use 128-bit AVX instructions instead of
15889 256-bit AVX instructions in the auto-vectorizer.
15891 @item -mcx16
15892 @opindex mcx16
15893 This option enables GCC to generate @code{CMPXCHG16B} instructions.
15894 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
15895 (or oword) data types.  
15896 This is useful for high-resolution counters that can be updated
15897 by multiple processors (or cores).  This instruction is generated as part of
15898 atomic built-in functions: see @ref{__sync Builtins} or
15899 @ref{__atomic Builtins} for details.
15901 @item -msahf
15902 @opindex msahf
15903 This option enables generation of @code{SAHF} instructions in 64-bit code.
15904 Early Intel Pentium 4 CPUs with Intel 64 support,
15905 prior to the introduction of Pentium 4 G1 step in December 2005,
15906 lacked the @code{LAHF} and @code{SAHF} instructions
15907 which were supported by AMD64.
15908 These are load and store instructions, respectively, for certain status flags.
15909 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
15910 @code{drem}, and @code{remainder} built-in functions;
15911 see @ref{Other Builtins} for details.
15913 @item -mmovbe
15914 @opindex mmovbe
15915 This option enables use of the @code{movbe} instruction to implement
15916 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
15918 @item -mcrc32
15919 @opindex mcrc32
15920 This option enables built-in functions @code{__builtin_ia32_crc32qi},
15921 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
15922 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
15924 @item -mrecip
15925 @opindex mrecip
15926 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
15927 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
15928 with an additional Newton-Raphson step
15929 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
15930 (and their vectorized
15931 variants) for single-precision floating-point arguments.  These instructions
15932 are generated only when @option{-funsafe-math-optimizations} is enabled
15933 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
15934 Note that while the throughput of the sequence is higher than the throughput
15935 of the non-reciprocal instruction, the precision of the sequence can be
15936 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
15938 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
15939 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
15940 combination), and doesn't need @option{-mrecip}.
15942 Also note that GCC emits the above sequence with additional Newton-Raphson step
15943 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
15944 already with @option{-ffast-math} (or the above option combination), and
15945 doesn't need @option{-mrecip}.
15947 @item -mrecip=@var{opt}
15948 @opindex mrecip=opt
15949 This option controls which reciprocal estimate instructions
15950 may be used.  @var{opt} is a comma-separated list of options, which may
15951 be preceded by a @samp{!} to invert the option:
15953 @table @samp
15954 @item all
15955 Enable all estimate instructions.
15957 @item default
15958 Enable the default instructions, equivalent to @option{-mrecip}.
15960 @item none
15961 Disable all estimate instructions, equivalent to @option{-mno-recip}.
15963 @item div
15964 Enable the approximation for scalar division.
15966 @item vec-div
15967 Enable the approximation for vectorized division.
15969 @item sqrt
15970 Enable the approximation for scalar square root.
15972 @item vec-sqrt
15973 Enable the approximation for vectorized square root.
15974 @end table
15976 So, for example, @option{-mrecip=all,!sqrt} enables
15977 all of the reciprocal approximations, except for square root.
15979 @item -mveclibabi=@var{type}
15980 @opindex mveclibabi
15981 Specifies the ABI type to use for vectorizing intrinsics using an
15982 external library.  Supported values for @var{type} are @samp{svml} 
15983 for the Intel short
15984 vector math library and @samp{acml} for the AMD math core library.
15985 To use this option, both @option{-ftree-vectorize} and
15986 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
15987 ABI-compatible library must be specified at link time.
15989 GCC currently emits calls to @code{vmldExp2},
15990 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
15991 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
15992 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
15993 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
15994 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
15995 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
15996 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
15997 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
15998 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
15999 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
16000 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
16001 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
16002 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
16003 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
16004 when @option{-mveclibabi=acml} is used.  
16006 @item -mabi=@var{name}
16007 @opindex mabi
16008 Generate code for the specified calling convention.  Permissible values
16009 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
16010 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
16011 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
16012 You can control this behavior for a specific function by
16013 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
16014 @xref{Function Attributes}.
16016 @item -mtls-dialect=@var{type}
16017 @opindex mtls-dialect
16018 Generate code to access thread-local storage using the @samp{gnu} or
16019 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
16020 @samp{gnu2} is more efficient, but it may add compile- and run-time
16021 requirements that cannot be satisfied on all systems.
16023 @item -mpush-args
16024 @itemx -mno-push-args
16025 @opindex mpush-args
16026 @opindex mno-push-args
16027 Use PUSH operations to store outgoing parameters.  This method is shorter
16028 and usually equally fast as method using SUB/MOV operations and is enabled
16029 by default.  In some cases disabling it may improve performance because of
16030 improved scheduling and reduced dependencies.
16032 @item -maccumulate-outgoing-args
16033 @opindex maccumulate-outgoing-args
16034 If enabled, the maximum amount of space required for outgoing arguments is
16035 computed in the function prologue.  This is faster on most modern CPUs
16036 because of reduced dependencies, improved scheduling and reduced stack usage
16037 when the preferred stack boundary is not equal to 2.  The drawback is a notable
16038 increase in code size.  This switch implies @option{-mno-push-args}.
16040 @item -mthreads
16041 @opindex mthreads
16042 Support thread-safe exception handling on MinGW.  Programs that rely
16043 on thread-safe exception handling must compile and link all code with the
16044 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
16045 @code{-D_MT}; when linking, it links in a special thread helper library
16046 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
16048 @item -mno-align-stringops
16049 @opindex mno-align-stringops
16050 Do not align the destination of inlined string operations.  This switch reduces
16051 code size and improves performance in case the destination is already aligned,
16052 but GCC doesn't know about it.
16054 @item -minline-all-stringops
16055 @opindex minline-all-stringops
16056 By default GCC inlines string operations only when the destination is 
16057 known to be aligned to least a 4-byte boundary.  
16058 This enables more inlining and increases code
16059 size, but may improve performance of code that depends on fast
16060 @code{memcpy}, @code{strlen},
16061 and @code{memset} for short lengths.
16063 @item -minline-stringops-dynamically
16064 @opindex minline-stringops-dynamically
16065 For string operations of unknown size, use run-time checks with
16066 inline code for small blocks and a library call for large blocks.
16068 @item -mstringop-strategy=@var{alg}
16069 @opindex mstringop-strategy=@var{alg}
16070 Override the internal decision heuristic for the particular algorithm to use
16071 for inlining string operations.  The allowed values for @var{alg} are:
16073 @table @samp
16074 @item rep_byte
16075 @itemx rep_4byte
16076 @itemx rep_8byte
16077 Expand using i386 @code{rep} prefix of the specified size.
16079 @item byte_loop
16080 @itemx loop
16081 @itemx unrolled_loop
16082 Expand into an inline loop.
16084 @item libcall
16085 Always use a library call.
16086 @end table
16088 @item -mmemcpy-strategy=@var{strategy}
16089 @opindex mmemcpy-strategy=@var{strategy}
16090 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
16091 should be inlined and what inline algorithm to use when the expected size
16092 of the copy operation is known. @var{strategy} 
16093 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
16094 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
16095 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
16096 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
16097 in the list must be specified in increasing order.  The minimal byte size for 
16098 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
16099 preceding range.
16101 @item -mmemset-strategy=@var{strategy}
16102 @opindex mmemset-strategy=@var{strategy}
16103 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
16104 @code{__builtin_memset} expansion.
16106 @item -momit-leaf-frame-pointer
16107 @opindex momit-leaf-frame-pointer
16108 Don't keep the frame pointer in a register for leaf functions.  This
16109 avoids the instructions to save, set up, and restore frame pointers and
16110 makes an extra register available in leaf functions.  The option
16111 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
16112 which might make debugging harder.
16114 @item -mtls-direct-seg-refs
16115 @itemx -mno-tls-direct-seg-refs
16116 @opindex mtls-direct-seg-refs
16117 Controls whether TLS variables may be accessed with offsets from the
16118 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
16119 or whether the thread base pointer must be added.  Whether or not this
16120 is valid depends on the operating system, and whether it maps the
16121 segment to cover the entire TLS area.
16123 For systems that use the GNU C Library, the default is on.
16125 @item -msse2avx
16126 @itemx -mno-sse2avx
16127 @opindex msse2avx
16128 Specify that the assembler should encode SSE instructions with VEX
16129 prefix.  The option @option{-mavx} turns this on by default.
16131 @item -mfentry
16132 @itemx -mno-fentry
16133 @opindex mfentry
16134 If profiling is active (@option{-pg}), put the profiling
16135 counter call before the prologue.
16136 Note: On x86 architectures the attribute @code{ms_hook_prologue}
16137 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
16139 @item -mrecord-mcount
16140 @itemx -mno-record-mcount
16141 @opindex mrecord-mcount
16142 If profiling is active (@option{-pg}), generate a __mcount_loc section
16143 that contains pointers to each profiling call. This is useful for
16144 automatically patching and out calls.
16146 @item -mnop-mcount
16147 @itemx -mno-nop-mcount
16148 @opindex mnop-mcount
16149 If profiling is active (@option{-pg}), generate the calls to
16150 the profiling functions as nops. This is useful when they
16151 should be patched in later dynamically. This is likely only
16152 useful together with @option{-mrecord-mcount}.
16154 @item -m8bit-idiv
16155 @itemx -mno-8bit-idiv
16156 @opindex 8bit-idiv
16157 On some processors, like Intel Atom, 8-bit unsigned integer divide is
16158 much faster than 32-bit/64-bit integer divide.  This option generates a
16159 run-time check.  If both dividend and divisor are within range of 0
16160 to 255, 8-bit unsigned integer divide is used instead of
16161 32-bit/64-bit integer divide.
16163 @item -mavx256-split-unaligned-load
16164 @itemx -mavx256-split-unaligned-store
16165 @opindex avx256-split-unaligned-load
16166 @opindex avx256-split-unaligned-store
16167 Split 32-byte AVX unaligned load and store.
16169 @item -mstack-protector-guard=@var{guard}
16170 @opindex mstack-protector-guard=@var{guard}
16171 Generate stack protection code using canary at @var{guard}.  Supported
16172 locations are @samp{global} for global canary or @samp{tls} for per-thread
16173 canary in the TLS block (the default).  This option has effect only when
16174 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
16176 @end table
16178 These @samp{-m} switches are supported in addition to the above
16179 on x86-64 processors in 64-bit environments.
16181 @table @gcctabopt
16182 @item -m32
16183 @itemx -m64
16184 @itemx -mx32
16185 @itemx -m16
16186 @opindex m32
16187 @opindex m64
16188 @opindex mx32
16189 @opindex m16
16190 Generate code for a 16-bit, 32-bit or 64-bit environment.
16191 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
16192 to 32 bits, and
16193 generates code that runs on any i386 system.
16195 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
16196 types to 64 bits, and generates code for the x86-64 architecture.
16197 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
16198 and @option{-mdynamic-no-pic} options.
16200 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
16201 to 32 bits, and
16202 generates code for the x86-64 architecture.
16204 The @option{-m16} option is the same as @option{-m32}, except for that
16205 it outputs the @code{.code16gcc} assembly directive at the beginning of
16206 the assembly output so that the binary can run in 16-bit mode.
16208 @item -mno-red-zone
16209 @opindex mno-red-zone
16210 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
16211 by the x86-64 ABI; it is a 128-byte area beyond the location of the
16212 stack pointer that is not modified by signal or interrupt handlers
16213 and therefore can be used for temporary data without adjusting the stack
16214 pointer.  The flag @option{-mno-red-zone} disables this red zone.
16216 @item -mcmodel=small
16217 @opindex mcmodel=small
16218 Generate code for the small code model: the program and its symbols must
16219 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
16220 Programs can be statically or dynamically linked.  This is the default
16221 code model.
16223 @item -mcmodel=kernel
16224 @opindex mcmodel=kernel
16225 Generate code for the kernel code model.  The kernel runs in the
16226 negative 2 GB of the address space.
16227 This model has to be used for Linux kernel code.
16229 @item -mcmodel=medium
16230 @opindex mcmodel=medium
16231 Generate code for the medium model: the program is linked in the lower 2
16232 GB of the address space.  Small symbols are also placed there.  Symbols
16233 with sizes larger than @option{-mlarge-data-threshold} are put into
16234 large data or BSS sections and can be located above 2GB.  Programs can
16235 be statically or dynamically linked.
16237 @item -mcmodel=large
16238 @opindex mcmodel=large
16239 Generate code for the large model.  This model makes no assumptions
16240 about addresses and sizes of sections.
16242 @item -maddress-mode=long
16243 @opindex maddress-mode=long
16244 Generate code for long address mode.  This is only supported for 64-bit
16245 and x32 environments.  It is the default address mode for 64-bit
16246 environments.
16248 @item -maddress-mode=short
16249 @opindex maddress-mode=short
16250 Generate code for short address mode.  This is only supported for 32-bit
16251 and x32 environments.  It is the default address mode for 32-bit and
16252 x32 environments.
16253 @end table
16255 @node i386 and x86-64 Windows Options
16256 @subsection i386 and x86-64 Windows Options
16257 @cindex i386 and x86-64 Windows Options
16259 These additional options are available for Microsoft Windows targets:
16261 @table @gcctabopt
16262 @item -mconsole
16263 @opindex mconsole
16264 This option
16265 specifies that a console application is to be generated, by
16266 instructing the linker to set the PE header subsystem type
16267 required for console applications.
16268 This option is available for Cygwin and MinGW targets and is
16269 enabled by default on those targets.
16271 @item -mdll
16272 @opindex mdll
16273 This option is available for Cygwin and MinGW targets.  It
16274 specifies that a DLL---a dynamic link library---is to be
16275 generated, enabling the selection of the required runtime
16276 startup object and entry point.
16278 @item -mnop-fun-dllimport
16279 @opindex mnop-fun-dllimport
16280 This option is available for Cygwin and MinGW targets.  It
16281 specifies that the @code{dllimport} attribute should be ignored.
16283 @item -mthread
16284 @opindex mthread
16285 This option is available for MinGW targets. It specifies
16286 that MinGW-specific thread support is to be used.
16288 @item -municode
16289 @opindex municode
16290 This option is available for MinGW-w64 targets.  It causes
16291 the @code{UNICODE} preprocessor macro to be predefined, and
16292 chooses Unicode-capable runtime startup code.
16294 @item -mwin32
16295 @opindex mwin32
16296 This option is available for Cygwin and MinGW targets.  It
16297 specifies that the typical Microsoft Windows predefined macros are to
16298 be set in the pre-processor, but does not influence the choice
16299 of runtime library/startup code.
16301 @item -mwindows
16302 @opindex mwindows
16303 This option is available for Cygwin and MinGW targets.  It
16304 specifies that a GUI application is to be generated by
16305 instructing the linker to set the PE header subsystem type
16306 appropriately.
16308 @item -fno-set-stack-executable
16309 @opindex fno-set-stack-executable
16310 This option is available for MinGW targets. It specifies that
16311 the executable flag for the stack used by nested functions isn't
16312 set. This is necessary for binaries running in kernel mode of
16313 Microsoft Windows, as there the User32 API, which is used to set executable
16314 privileges, isn't available.
16316 @item -fwritable-relocated-rdata
16317 @opindex fno-writable-relocated-rdata
16318 This option is available for MinGW and Cygwin targets.  It specifies
16319 that relocated-data in read-only section is put into .data
16320 section.  This is a necessary for older runtimes not supporting
16321 modification of .rdata sections for pseudo-relocation.
16323 @item -mpe-aligned-commons
16324 @opindex mpe-aligned-commons
16325 This option is available for Cygwin and MinGW targets.  It
16326 specifies that the GNU extension to the PE file format that
16327 permits the correct alignment of COMMON variables should be
16328 used when generating code.  It is enabled by default if
16329 GCC detects that the target assembler found during configuration
16330 supports the feature.
16331 @end table
16333 See also under @ref{i386 and x86-64 Options} for standard options.
16335 @node IA-64 Options
16336 @subsection IA-64 Options
16337 @cindex IA-64 Options
16339 These are the @samp{-m} options defined for the Intel IA-64 architecture.
16341 @table @gcctabopt
16342 @item -mbig-endian
16343 @opindex mbig-endian
16344 Generate code for a big-endian target.  This is the default for HP-UX@.
16346 @item -mlittle-endian
16347 @opindex mlittle-endian
16348 Generate code for a little-endian target.  This is the default for AIX5
16349 and GNU/Linux.
16351 @item -mgnu-as
16352 @itemx -mno-gnu-as
16353 @opindex mgnu-as
16354 @opindex mno-gnu-as
16355 Generate (or don't) code for the GNU assembler.  This is the default.
16356 @c Also, this is the default if the configure option @option{--with-gnu-as}
16357 @c is used.
16359 @item -mgnu-ld
16360 @itemx -mno-gnu-ld
16361 @opindex mgnu-ld
16362 @opindex mno-gnu-ld
16363 Generate (or don't) code for the GNU linker.  This is the default.
16364 @c Also, this is the default if the configure option @option{--with-gnu-ld}
16365 @c is used.
16367 @item -mno-pic
16368 @opindex mno-pic
16369 Generate code that does not use a global pointer register.  The result
16370 is not position independent code, and violates the IA-64 ABI@.
16372 @item -mvolatile-asm-stop
16373 @itemx -mno-volatile-asm-stop
16374 @opindex mvolatile-asm-stop
16375 @opindex mno-volatile-asm-stop
16376 Generate (or don't) a stop bit immediately before and after volatile asm
16377 statements.
16379 @item -mregister-names
16380 @itemx -mno-register-names
16381 @opindex mregister-names
16382 @opindex mno-register-names
16383 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
16384 the stacked registers.  This may make assembler output more readable.
16386 @item -mno-sdata
16387 @itemx -msdata
16388 @opindex mno-sdata
16389 @opindex msdata
16390 Disable (or enable) optimizations that use the small data section.  This may
16391 be useful for working around optimizer bugs.
16393 @item -mconstant-gp
16394 @opindex mconstant-gp
16395 Generate code that uses a single constant global pointer value.  This is
16396 useful when compiling kernel code.
16398 @item -mauto-pic
16399 @opindex mauto-pic
16400 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
16401 This is useful when compiling firmware code.
16403 @item -minline-float-divide-min-latency
16404 @opindex minline-float-divide-min-latency
16405 Generate code for inline divides of floating-point values
16406 using the minimum latency algorithm.
16408 @item -minline-float-divide-max-throughput
16409 @opindex minline-float-divide-max-throughput
16410 Generate code for inline divides of floating-point values
16411 using the maximum throughput algorithm.
16413 @item -mno-inline-float-divide
16414 @opindex mno-inline-float-divide
16415 Do not generate inline code for divides of floating-point values.
16417 @item -minline-int-divide-min-latency
16418 @opindex minline-int-divide-min-latency
16419 Generate code for inline divides of integer values
16420 using the minimum latency algorithm.
16422 @item -minline-int-divide-max-throughput
16423 @opindex minline-int-divide-max-throughput
16424 Generate code for inline divides of integer values
16425 using the maximum throughput algorithm.
16427 @item -mno-inline-int-divide
16428 @opindex mno-inline-int-divide
16429 Do not generate inline code for divides of integer values.
16431 @item -minline-sqrt-min-latency
16432 @opindex minline-sqrt-min-latency
16433 Generate code for inline square roots
16434 using the minimum latency algorithm.
16436 @item -minline-sqrt-max-throughput
16437 @opindex minline-sqrt-max-throughput
16438 Generate code for inline square roots
16439 using the maximum throughput algorithm.
16441 @item -mno-inline-sqrt
16442 @opindex mno-inline-sqrt
16443 Do not generate inline code for @code{sqrt}.
16445 @item -mfused-madd
16446 @itemx -mno-fused-madd
16447 @opindex mfused-madd
16448 @opindex mno-fused-madd
16449 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
16450 instructions.  The default is to use these instructions.
16452 @item -mno-dwarf2-asm
16453 @itemx -mdwarf2-asm
16454 @opindex mno-dwarf2-asm
16455 @opindex mdwarf2-asm
16456 Don't (or do) generate assembler code for the DWARF 2 line number debugging
16457 info.  This may be useful when not using the GNU assembler.
16459 @item -mearly-stop-bits
16460 @itemx -mno-early-stop-bits
16461 @opindex mearly-stop-bits
16462 @opindex mno-early-stop-bits
16463 Allow stop bits to be placed earlier than immediately preceding the
16464 instruction that triggered the stop bit.  This can improve instruction
16465 scheduling, but does not always do so.
16467 @item -mfixed-range=@var{register-range}
16468 @opindex mfixed-range
16469 Generate code treating the given register range as fixed registers.
16470 A fixed register is one that the register allocator cannot use.  This is
16471 useful when compiling kernel code.  A register range is specified as
16472 two registers separated by a dash.  Multiple register ranges can be
16473 specified separated by a comma.
16475 @item -mtls-size=@var{tls-size}
16476 @opindex mtls-size
16477 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
16480 @item -mtune=@var{cpu-type}
16481 @opindex mtune
16482 Tune the instruction scheduling for a particular CPU, Valid values are
16483 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
16484 and @samp{mckinley}.
16486 @item -milp32
16487 @itemx -mlp64
16488 @opindex milp32
16489 @opindex mlp64
16490 Generate code for a 32-bit or 64-bit environment.
16491 The 32-bit environment sets int, long and pointer to 32 bits.
16492 The 64-bit environment sets int to 32 bits and long and pointer
16493 to 64 bits.  These are HP-UX specific flags.
16495 @item -mno-sched-br-data-spec
16496 @itemx -msched-br-data-spec
16497 @opindex mno-sched-br-data-spec
16498 @opindex msched-br-data-spec
16499 (Dis/En)able data speculative scheduling before reload.
16500 This results in generation of @code{ld.a} instructions and
16501 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
16502 The default is 'disable'.
16504 @item -msched-ar-data-spec
16505 @itemx -mno-sched-ar-data-spec
16506 @opindex msched-ar-data-spec
16507 @opindex mno-sched-ar-data-spec
16508 (En/Dis)able data speculative scheduling after reload.
16509 This results in generation of @code{ld.a} instructions and
16510 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
16511 The default is 'enable'.
16513 @item -mno-sched-control-spec
16514 @itemx -msched-control-spec
16515 @opindex mno-sched-control-spec
16516 @opindex msched-control-spec
16517 (Dis/En)able control speculative scheduling.  This feature is
16518 available only during region scheduling (i.e.@: before reload).
16519 This results in generation of the @code{ld.s} instructions and
16520 the corresponding check instructions @code{chk.s}.
16521 The default is 'disable'.
16523 @item -msched-br-in-data-spec
16524 @itemx -mno-sched-br-in-data-spec
16525 @opindex msched-br-in-data-spec
16526 @opindex mno-sched-br-in-data-spec
16527 (En/Dis)able speculative scheduling of the instructions that
16528 are dependent on the data speculative loads before reload.
16529 This is effective only with @option{-msched-br-data-spec} enabled.
16530 The default is 'enable'.
16532 @item -msched-ar-in-data-spec
16533 @itemx -mno-sched-ar-in-data-spec
16534 @opindex msched-ar-in-data-spec
16535 @opindex mno-sched-ar-in-data-spec
16536 (En/Dis)able speculative scheduling of the instructions that
16537 are dependent on the data speculative loads after reload.
16538 This is effective only with @option{-msched-ar-data-spec} enabled.
16539 The default is 'enable'.
16541 @item -msched-in-control-spec
16542 @itemx -mno-sched-in-control-spec
16543 @opindex msched-in-control-spec
16544 @opindex mno-sched-in-control-spec
16545 (En/Dis)able speculative scheduling of the instructions that
16546 are dependent on the control speculative loads.
16547 This is effective only with @option{-msched-control-spec} enabled.
16548 The default is 'enable'.
16550 @item -mno-sched-prefer-non-data-spec-insns
16551 @itemx -msched-prefer-non-data-spec-insns
16552 @opindex mno-sched-prefer-non-data-spec-insns
16553 @opindex msched-prefer-non-data-spec-insns
16554 If enabled, data-speculative instructions are chosen for schedule
16555 only if there are no other choices at the moment.  This makes
16556 the use of the data speculation much more conservative.
16557 The default is 'disable'.
16559 @item -mno-sched-prefer-non-control-spec-insns
16560 @itemx -msched-prefer-non-control-spec-insns
16561 @opindex mno-sched-prefer-non-control-spec-insns
16562 @opindex msched-prefer-non-control-spec-insns
16563 If enabled, control-speculative instructions are chosen for schedule
16564 only if there are no other choices at the moment.  This makes
16565 the use of the control speculation much more conservative.
16566 The default is 'disable'.
16568 @item -mno-sched-count-spec-in-critical-path
16569 @itemx -msched-count-spec-in-critical-path
16570 @opindex mno-sched-count-spec-in-critical-path
16571 @opindex msched-count-spec-in-critical-path
16572 If enabled, speculative dependencies are considered during
16573 computation of the instructions priorities.  This makes the use of the
16574 speculation a bit more conservative.
16575 The default is 'disable'.
16577 @item -msched-spec-ldc
16578 @opindex msched-spec-ldc
16579 Use a simple data speculation check.  This option is on by default.
16581 @item -msched-control-spec-ldc
16582 @opindex msched-spec-ldc
16583 Use a simple check for control speculation.  This option is on by default.
16585 @item -msched-stop-bits-after-every-cycle
16586 @opindex msched-stop-bits-after-every-cycle
16587 Place a stop bit after every cycle when scheduling.  This option is on
16588 by default.
16590 @item -msched-fp-mem-deps-zero-cost
16591 @opindex msched-fp-mem-deps-zero-cost
16592 Assume that floating-point stores and loads are not likely to cause a conflict
16593 when placed into the same instruction group.  This option is disabled by
16594 default.
16596 @item -msel-sched-dont-check-control-spec
16597 @opindex msel-sched-dont-check-control-spec
16598 Generate checks for control speculation in selective scheduling.
16599 This flag is disabled by default.
16601 @item -msched-max-memory-insns=@var{max-insns}
16602 @opindex msched-max-memory-insns
16603 Limit on the number of memory insns per instruction group, giving lower
16604 priority to subsequent memory insns attempting to schedule in the same
16605 instruction group. Frequently useful to prevent cache bank conflicts.
16606 The default value is 1.
16608 @item -msched-max-memory-insns-hard-limit
16609 @opindex msched-max-memory-insns-hard-limit
16610 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
16611 disallowing more than that number in an instruction group.
16612 Otherwise, the limit is ``soft'', meaning that non-memory operations
16613 are preferred when the limit is reached, but memory operations may still
16614 be scheduled.
16616 @end table
16618 @node LM32 Options
16619 @subsection LM32 Options
16620 @cindex LM32 options
16622 These @option{-m} options are defined for the LatticeMico32 architecture:
16624 @table @gcctabopt
16625 @item -mbarrel-shift-enabled
16626 @opindex mbarrel-shift-enabled
16627 Enable barrel-shift instructions.
16629 @item -mdivide-enabled
16630 @opindex mdivide-enabled
16631 Enable divide and modulus instructions.
16633 @item -mmultiply-enabled
16634 @opindex multiply-enabled
16635 Enable multiply instructions.
16637 @item -msign-extend-enabled
16638 @opindex msign-extend-enabled
16639 Enable sign extend instructions.
16641 @item -muser-enabled
16642 @opindex muser-enabled
16643 Enable user-defined instructions.
16645 @end table
16647 @node M32C Options
16648 @subsection M32C Options
16649 @cindex M32C options
16651 @table @gcctabopt
16652 @item -mcpu=@var{name}
16653 @opindex mcpu=
16654 Select the CPU for which code is generated.  @var{name} may be one of
16655 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
16656 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
16657 the M32C/80 series.
16659 @item -msim
16660 @opindex msim
16661 Specifies that the program will be run on the simulator.  This causes
16662 an alternate runtime library to be linked in which supports, for
16663 example, file I/O@.  You must not use this option when generating
16664 programs that will run on real hardware; you must provide your own
16665 runtime library for whatever I/O functions are needed.
16667 @item -memregs=@var{number}
16668 @opindex memregs=
16669 Specifies the number of memory-based pseudo-registers GCC uses
16670 during code generation.  These pseudo-registers are used like real
16671 registers, so there is a tradeoff between GCC's ability to fit the
16672 code into available registers, and the performance penalty of using
16673 memory instead of registers.  Note that all modules in a program must
16674 be compiled with the same value for this option.  Because of that, you
16675 must not use this option with GCC's default runtime libraries.
16677 @end table
16679 @node M32R/D Options
16680 @subsection M32R/D Options
16681 @cindex M32R/D options
16683 These @option{-m} options are defined for Renesas M32R/D architectures:
16685 @table @gcctabopt
16686 @item -m32r2
16687 @opindex m32r2
16688 Generate code for the M32R/2@.
16690 @item -m32rx
16691 @opindex m32rx
16692 Generate code for the M32R/X@.
16694 @item -m32r
16695 @opindex m32r
16696 Generate code for the M32R@.  This is the default.
16698 @item -mmodel=small
16699 @opindex mmodel=small
16700 Assume all objects live in the lower 16MB of memory (so that their addresses
16701 can be loaded with the @code{ld24} instruction), and assume all subroutines
16702 are reachable with the @code{bl} instruction.
16703 This is the default.
16705 The addressability of a particular object can be set with the
16706 @code{model} attribute.
16708 @item -mmodel=medium
16709 @opindex mmodel=medium
16710 Assume objects may be anywhere in the 32-bit address space (the compiler
16711 generates @code{seth/add3} instructions to load their addresses), and
16712 assume all subroutines are reachable with the @code{bl} instruction.
16714 @item -mmodel=large
16715 @opindex mmodel=large
16716 Assume objects may be anywhere in the 32-bit address space (the compiler
16717 generates @code{seth/add3} instructions to load their addresses), and
16718 assume subroutines may not be reachable with the @code{bl} instruction
16719 (the compiler generates the much slower @code{seth/add3/jl}
16720 instruction sequence).
16722 @item -msdata=none
16723 @opindex msdata=none
16724 Disable use of the small data area.  Variables are put into
16725 one of @samp{.data}, @samp{.bss}, or @samp{.rodata} (unless the
16726 @code{section} attribute has been specified).
16727 This is the default.
16729 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
16730 Objects may be explicitly put in the small data area with the
16731 @code{section} attribute using one of these sections.
16733 @item -msdata=sdata
16734 @opindex msdata=sdata
16735 Put small global and static data in the small data area, but do not
16736 generate special code to reference them.
16738 @item -msdata=use
16739 @opindex msdata=use
16740 Put small global and static data in the small data area, and generate
16741 special instructions to reference them.
16743 @item -G @var{num}
16744 @opindex G
16745 @cindex smaller data references
16746 Put global and static objects less than or equal to @var{num} bytes
16747 into the small data or BSS sections instead of the normal data or BSS
16748 sections.  The default value of @var{num} is 8.
16749 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
16750 for this option to have any effect.
16752 All modules should be compiled with the same @option{-G @var{num}} value.
16753 Compiling with different values of @var{num} may or may not work; if it
16754 doesn't the linker gives an error message---incorrect code is not
16755 generated.
16757 @item -mdebug
16758 @opindex mdebug
16759 Makes the M32R-specific code in the compiler display some statistics
16760 that might help in debugging programs.
16762 @item -malign-loops
16763 @opindex malign-loops
16764 Align all loops to a 32-byte boundary.
16766 @item -mno-align-loops
16767 @opindex mno-align-loops
16768 Do not enforce a 32-byte alignment for loops.  This is the default.
16770 @item -missue-rate=@var{number}
16771 @opindex missue-rate=@var{number}
16772 Issue @var{number} instructions per cycle.  @var{number} can only be 1
16773 or 2.
16775 @item -mbranch-cost=@var{number}
16776 @opindex mbranch-cost=@var{number}
16777 @var{number} can only be 1 or 2.  If it is 1 then branches are
16778 preferred over conditional code, if it is 2, then the opposite applies.
16780 @item -mflush-trap=@var{number}
16781 @opindex mflush-trap=@var{number}
16782 Specifies the trap number to use to flush the cache.  The default is
16783 12.  Valid numbers are between 0 and 15 inclusive.
16785 @item -mno-flush-trap
16786 @opindex mno-flush-trap
16787 Specifies that the cache cannot be flushed by using a trap.
16789 @item -mflush-func=@var{name}
16790 @opindex mflush-func=@var{name}
16791 Specifies the name of the operating system function to call to flush
16792 the cache.  The default is @emph{_flush_cache}, but a function call
16793 is only used if a trap is not available.
16795 @item -mno-flush-func
16796 @opindex mno-flush-func
16797 Indicates that there is no OS function for flushing the cache.
16799 @end table
16801 @node M680x0 Options
16802 @subsection M680x0 Options
16803 @cindex M680x0 options
16805 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
16806 The default settings depend on which architecture was selected when
16807 the compiler was configured; the defaults for the most common choices
16808 are given below.
16810 @table @gcctabopt
16811 @item -march=@var{arch}
16812 @opindex march
16813 Generate code for a specific M680x0 or ColdFire instruction set
16814 architecture.  Permissible values of @var{arch} for M680x0
16815 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
16816 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
16817 architectures are selected according to Freescale's ISA classification
16818 and the permissible values are: @samp{isaa}, @samp{isaaplus},
16819 @samp{isab} and @samp{isac}.
16821 GCC defines a macro @samp{__mcf@var{arch}__} whenever it is generating
16822 code for a ColdFire target.  The @var{arch} in this macro is one of the
16823 @option{-march} arguments given above.
16825 When used together, @option{-march} and @option{-mtune} select code
16826 that runs on a family of similar processors but that is optimized
16827 for a particular microarchitecture.
16829 @item -mcpu=@var{cpu}
16830 @opindex mcpu
16831 Generate code for a specific M680x0 or ColdFire processor.
16832 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
16833 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
16834 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
16835 below, which also classifies the CPUs into families:
16837 @multitable @columnfractions 0.20 0.80
16838 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
16839 @item @samp{51} @tab @samp{51} @samp{51ac} @samp{51ag} @samp{51cn} @samp{51em} @samp{51je} @samp{51jf} @samp{51jg} @samp{51jm} @samp{51mm} @samp{51qe} @samp{51qm}
16840 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
16841 @item @samp{5206e} @tab @samp{5206e}
16842 @item @samp{5208} @tab @samp{5207} @samp{5208}
16843 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
16844 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
16845 @item @samp{5216} @tab @samp{5214} @samp{5216}
16846 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
16847 @item @samp{5225} @tab @samp{5224} @samp{5225}
16848 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
16849 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
16850 @item @samp{5249} @tab @samp{5249}
16851 @item @samp{5250} @tab @samp{5250}
16852 @item @samp{5271} @tab @samp{5270} @samp{5271}
16853 @item @samp{5272} @tab @samp{5272}
16854 @item @samp{5275} @tab @samp{5274} @samp{5275}
16855 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
16856 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
16857 @item @samp{5307} @tab @samp{5307}
16858 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
16859 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
16860 @item @samp{5407} @tab @samp{5407}
16861 @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}
16862 @end multitable
16864 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
16865 @var{arch} is compatible with @var{cpu}.  Other combinations of
16866 @option{-mcpu} and @option{-march} are rejected.
16868 GCC defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
16869 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
16870 where the value of @var{family} is given by the table above.
16872 @item -mtune=@var{tune}
16873 @opindex mtune
16874 Tune the code for a particular microarchitecture within the
16875 constraints set by @option{-march} and @option{-mcpu}.
16876 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
16877 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
16878 and @samp{cpu32}.  The ColdFire microarchitectures
16879 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
16881 You can also use @option{-mtune=68020-40} for code that needs
16882 to run relatively well on 68020, 68030 and 68040 targets.
16883 @option{-mtune=68020-60} is similar but includes 68060 targets
16884 as well.  These two options select the same tuning decisions as
16885 @option{-m68020-40} and @option{-m68020-60} respectively.
16887 GCC defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
16888 when tuning for 680x0 architecture @var{arch}.  It also defines
16889 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
16890 option is used.  If GCC is tuning for a range of architectures,
16891 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
16892 it defines the macros for every architecture in the range.
16894 GCC also defines the macro @samp{__m@var{uarch}__} when tuning for
16895 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
16896 of the arguments given above.
16898 @item -m68000
16899 @itemx -mc68000
16900 @opindex m68000
16901 @opindex mc68000
16902 Generate output for a 68000.  This is the default
16903 when the compiler is configured for 68000-based systems.
16904 It is equivalent to @option{-march=68000}.
16906 Use this option for microcontrollers with a 68000 or EC000 core,
16907 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
16909 @item -m68010
16910 @opindex m68010
16911 Generate output for a 68010.  This is the default
16912 when the compiler is configured for 68010-based systems.
16913 It is equivalent to @option{-march=68010}.
16915 @item -m68020
16916 @itemx -mc68020
16917 @opindex m68020
16918 @opindex mc68020
16919 Generate output for a 68020.  This is the default
16920 when the compiler is configured for 68020-based systems.
16921 It is equivalent to @option{-march=68020}.
16923 @item -m68030
16924 @opindex m68030
16925 Generate output for a 68030.  This is the default when the compiler is
16926 configured for 68030-based systems.  It is equivalent to
16927 @option{-march=68030}.
16929 @item -m68040
16930 @opindex m68040
16931 Generate output for a 68040.  This is the default when the compiler is
16932 configured for 68040-based systems.  It is equivalent to
16933 @option{-march=68040}.
16935 This option inhibits the use of 68881/68882 instructions that have to be
16936 emulated by software on the 68040.  Use this option if your 68040 does not
16937 have code to emulate those instructions.
16939 @item -m68060
16940 @opindex m68060
16941 Generate output for a 68060.  This is the default when the compiler is
16942 configured for 68060-based systems.  It is equivalent to
16943 @option{-march=68060}.
16945 This option inhibits the use of 68020 and 68881/68882 instructions that
16946 have to be emulated by software on the 68060.  Use this option if your 68060
16947 does not have code to emulate those instructions.
16949 @item -mcpu32
16950 @opindex mcpu32
16951 Generate output for a CPU32.  This is the default
16952 when the compiler is configured for CPU32-based systems.
16953 It is equivalent to @option{-march=cpu32}.
16955 Use this option for microcontrollers with a
16956 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
16957 68336, 68340, 68341, 68349 and 68360.
16959 @item -m5200
16960 @opindex m5200
16961 Generate output for a 520X ColdFire CPU@.  This is the default
16962 when the compiler is configured for 520X-based systems.
16963 It is equivalent to @option{-mcpu=5206}, and is now deprecated
16964 in favor of that option.
16966 Use this option for microcontroller with a 5200 core, including
16967 the MCF5202, MCF5203, MCF5204 and MCF5206.
16969 @item -m5206e
16970 @opindex m5206e
16971 Generate output for a 5206e ColdFire CPU@.  The option is now
16972 deprecated in favor of the equivalent @option{-mcpu=5206e}.
16974 @item -m528x
16975 @opindex m528x
16976 Generate output for a member of the ColdFire 528X family.
16977 The option is now deprecated in favor of the equivalent
16978 @option{-mcpu=528x}.
16980 @item -m5307
16981 @opindex m5307
16982 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
16983 in favor of the equivalent @option{-mcpu=5307}.
16985 @item -m5407
16986 @opindex m5407
16987 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
16988 in favor of the equivalent @option{-mcpu=5407}.
16990 @item -mcfv4e
16991 @opindex mcfv4e
16992 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
16993 This includes use of hardware floating-point instructions.
16994 The option is equivalent to @option{-mcpu=547x}, and is now
16995 deprecated in favor of that option.
16997 @item -m68020-40
16998 @opindex m68020-40
16999 Generate output for a 68040, without using any of the new instructions.
17000 This results in code that can run relatively efficiently on either a
17001 68020/68881 or a 68030 or a 68040.  The generated code does use the
17002 68881 instructions that are emulated on the 68040.
17004 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
17006 @item -m68020-60
17007 @opindex m68020-60
17008 Generate output for a 68060, without using any of the new instructions.
17009 This results in code that can run relatively efficiently on either a
17010 68020/68881 or a 68030 or a 68040.  The generated code does use the
17011 68881 instructions that are emulated on the 68060.
17013 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
17015 @item -mhard-float
17016 @itemx -m68881
17017 @opindex mhard-float
17018 @opindex m68881
17019 Generate floating-point instructions.  This is the default for 68020
17020 and above, and for ColdFire devices that have an FPU@.  It defines the
17021 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
17022 on ColdFire targets.
17024 @item -msoft-float
17025 @opindex msoft-float
17026 Do not generate floating-point instructions; use library calls instead.
17027 This is the default for 68000, 68010, and 68832 targets.  It is also
17028 the default for ColdFire devices that have no FPU.
17030 @item -mdiv
17031 @itemx -mno-div
17032 @opindex mdiv
17033 @opindex mno-div
17034 Generate (do not generate) ColdFire hardware divide and remainder
17035 instructions.  If @option{-march} is used without @option{-mcpu},
17036 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
17037 architectures.  Otherwise, the default is taken from the target CPU
17038 (either the default CPU, or the one specified by @option{-mcpu}).  For
17039 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
17040 @option{-mcpu=5206e}.
17042 GCC defines the macro @samp{__mcfhwdiv__} when this option is enabled.
17044 @item -mshort
17045 @opindex mshort
17046 Consider type @code{int} to be 16 bits wide, like @code{short int}.
17047 Additionally, parameters passed on the stack are also aligned to a
17048 16-bit boundary even on targets whose API mandates promotion to 32-bit.
17050 @item -mno-short
17051 @opindex mno-short
17052 Do not consider type @code{int} to be 16 bits wide.  This is the default.
17054 @item -mnobitfield
17055 @itemx -mno-bitfield
17056 @opindex mnobitfield
17057 @opindex mno-bitfield
17058 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
17059 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
17061 @item -mbitfield
17062 @opindex mbitfield
17063 Do use the bit-field instructions.  The @option{-m68020} option implies
17064 @option{-mbitfield}.  This is the default if you use a configuration
17065 designed for a 68020.
17067 @item -mrtd
17068 @opindex mrtd
17069 Use a different function-calling convention, in which functions
17070 that take a fixed number of arguments return with the @code{rtd}
17071 instruction, which pops their arguments while returning.  This
17072 saves one instruction in the caller since there is no need to pop
17073 the arguments there.
17075 This calling convention is incompatible with the one normally
17076 used on Unix, so you cannot use it if you need to call libraries
17077 compiled with the Unix compiler.
17079 Also, you must provide function prototypes for all functions that
17080 take variable numbers of arguments (including @code{printf});
17081 otherwise incorrect code is generated for calls to those
17082 functions.
17084 In addition, seriously incorrect code results if you call a
17085 function with too many arguments.  (Normally, extra arguments are
17086 harmlessly ignored.)
17088 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
17089 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
17091 @item -mno-rtd
17092 @opindex mno-rtd
17093 Do not use the calling conventions selected by @option{-mrtd}.
17094 This is the default.
17096 @item -malign-int
17097 @itemx -mno-align-int
17098 @opindex malign-int
17099 @opindex mno-align-int
17100 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
17101 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
17102 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
17103 Aligning variables on 32-bit boundaries produces code that runs somewhat
17104 faster on processors with 32-bit busses at the expense of more memory.
17106 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
17107 aligns structures containing the above types differently than
17108 most published application binary interface specifications for the m68k.
17110 @item -mpcrel
17111 @opindex mpcrel
17112 Use the pc-relative addressing mode of the 68000 directly, instead of
17113 using a global offset table.  At present, this option implies @option{-fpic},
17114 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
17115 not presently supported with @option{-mpcrel}, though this could be supported for
17116 68020 and higher processors.
17118 @item -mno-strict-align
17119 @itemx -mstrict-align
17120 @opindex mno-strict-align
17121 @opindex mstrict-align
17122 Do not (do) assume that unaligned memory references are handled by
17123 the system.
17125 @item -msep-data
17126 Generate code that allows the data segment to be located in a different
17127 area of memory from the text segment.  This allows for execute-in-place in
17128 an environment without virtual memory management.  This option implies
17129 @option{-fPIC}.
17131 @item -mno-sep-data
17132 Generate code that assumes that the data segment follows the text segment.
17133 This is the default.
17135 @item -mid-shared-library
17136 Generate code that supports shared libraries via the library ID method.
17137 This allows for execute-in-place and shared libraries in an environment
17138 without virtual memory management.  This option implies @option{-fPIC}.
17140 @item -mno-id-shared-library
17141 Generate code that doesn't assume ID-based shared libraries are being used.
17142 This is the default.
17144 @item -mshared-library-id=n
17145 Specifies the identification number of the ID-based shared library being
17146 compiled.  Specifying a value of 0 generates more compact code; specifying
17147 other values forces the allocation of that number to the current
17148 library, but is no more space- or time-efficient than omitting this option.
17150 @item -mxgot
17151 @itemx -mno-xgot
17152 @opindex mxgot
17153 @opindex mno-xgot
17154 When generating position-independent code for ColdFire, generate code
17155 that works if the GOT has more than 8192 entries.  This code is
17156 larger and slower than code generated without this option.  On M680x0
17157 processors, this option is not needed; @option{-fPIC} suffices.
17159 GCC normally uses a single instruction to load values from the GOT@.
17160 While this is relatively efficient, it only works if the GOT
17161 is smaller than about 64k.  Anything larger causes the linker
17162 to report an error such as:
17164 @cindex relocation truncated to fit (ColdFire)
17165 @smallexample
17166 relocation truncated to fit: R_68K_GOT16O foobar
17167 @end smallexample
17169 If this happens, you should recompile your code with @option{-mxgot}.
17170 It should then work with very large GOTs.  However, code generated with
17171 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
17172 the value of a global symbol.
17174 Note that some linkers, including newer versions of the GNU linker,
17175 can create multiple GOTs and sort GOT entries.  If you have such a linker,
17176 you should only need to use @option{-mxgot} when compiling a single
17177 object file that accesses more than 8192 GOT entries.  Very few do.
17179 These options have no effect unless GCC is generating
17180 position-independent code.
17182 @end table
17184 @node MCore Options
17185 @subsection MCore Options
17186 @cindex MCore options
17188 These are the @samp{-m} options defined for the Motorola M*Core
17189 processors.
17191 @table @gcctabopt
17193 @item -mhardlit
17194 @itemx -mno-hardlit
17195 @opindex mhardlit
17196 @opindex mno-hardlit
17197 Inline constants into the code stream if it can be done in two
17198 instructions or less.
17200 @item -mdiv
17201 @itemx -mno-div
17202 @opindex mdiv
17203 @opindex mno-div
17204 Use the divide instruction.  (Enabled by default).
17206 @item -mrelax-immediate
17207 @itemx -mno-relax-immediate
17208 @opindex mrelax-immediate
17209 @opindex mno-relax-immediate
17210 Allow arbitrary-sized immediates in bit operations.
17212 @item -mwide-bitfields
17213 @itemx -mno-wide-bitfields
17214 @opindex mwide-bitfields
17215 @opindex mno-wide-bitfields
17216 Always treat bit-fields as @code{int}-sized.
17218 @item -m4byte-functions
17219 @itemx -mno-4byte-functions
17220 @opindex m4byte-functions
17221 @opindex mno-4byte-functions
17222 Force all functions to be aligned to a 4-byte boundary.
17224 @item -mcallgraph-data
17225 @itemx -mno-callgraph-data
17226 @opindex mcallgraph-data
17227 @opindex mno-callgraph-data
17228 Emit callgraph information.
17230 @item -mslow-bytes
17231 @itemx -mno-slow-bytes
17232 @opindex mslow-bytes
17233 @opindex mno-slow-bytes
17234 Prefer word access when reading byte quantities.
17236 @item -mlittle-endian
17237 @itemx -mbig-endian
17238 @opindex mlittle-endian
17239 @opindex mbig-endian
17240 Generate code for a little-endian target.
17242 @item -m210
17243 @itemx -m340
17244 @opindex m210
17245 @opindex m340
17246 Generate code for the 210 processor.
17248 @item -mno-lsim
17249 @opindex mno-lsim
17250 Assume that runtime support has been provided and so omit the
17251 simulator library (@file{libsim.a)} from the linker command line.
17253 @item -mstack-increment=@var{size}
17254 @opindex mstack-increment
17255 Set the maximum amount for a single stack increment operation.  Large
17256 values can increase the speed of programs that contain functions
17257 that need a large amount of stack space, but they can also trigger a
17258 segmentation fault if the stack is extended too much.  The default
17259 value is 0x1000.
17261 @end table
17263 @node MeP Options
17264 @subsection MeP Options
17265 @cindex MeP options
17267 @table @gcctabopt
17269 @item -mabsdiff
17270 @opindex mabsdiff
17271 Enables the @code{abs} instruction, which is the absolute difference
17272 between two registers.
17274 @item -mall-opts
17275 @opindex mall-opts
17276 Enables all the optional instructions---average, multiply, divide, bit
17277 operations, leading zero, absolute difference, min/max, clip, and
17278 saturation.
17281 @item -maverage
17282 @opindex maverage
17283 Enables the @code{ave} instruction, which computes the average of two
17284 registers.
17286 @item -mbased=@var{n}
17287 @opindex mbased=
17288 Variables of size @var{n} bytes or smaller are placed in the
17289 @code{.based} section by default.  Based variables use the @code{$tp}
17290 register as a base register, and there is a 128-byte limit to the
17291 @code{.based} section.
17293 @item -mbitops
17294 @opindex mbitops
17295 Enables the bit operation instructions---bit test (@code{btstm}), set
17296 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
17297 test-and-set (@code{tas}).
17299 @item -mc=@var{name}
17300 @opindex mc=
17301 Selects which section constant data is placed in.  @var{name} may
17302 be @code{tiny}, @code{near}, or @code{far}.
17304 @item -mclip
17305 @opindex mclip
17306 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
17307 useful unless you also provide @code{-mminmax}.
17309 @item -mconfig=@var{name}
17310 @opindex mconfig=
17311 Selects one of the built-in core configurations.  Each MeP chip has
17312 one or more modules in it; each module has a core CPU and a variety of
17313 coprocessors, optional instructions, and peripherals.  The
17314 @code{MeP-Integrator} tool, not part of GCC, provides these
17315 configurations through this option; using this option is the same as
17316 using all the corresponding command-line options.  The default
17317 configuration is @code{default}.
17319 @item -mcop
17320 @opindex mcop
17321 Enables the coprocessor instructions.  By default, this is a 32-bit
17322 coprocessor.  Note that the coprocessor is normally enabled via the
17323 @code{-mconfig=} option.
17325 @item -mcop32
17326 @opindex mcop32
17327 Enables the 32-bit coprocessor's instructions.
17329 @item -mcop64
17330 @opindex mcop64
17331 Enables the 64-bit coprocessor's instructions.
17333 @item -mivc2
17334 @opindex mivc2
17335 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
17337 @item -mdc
17338 @opindex mdc
17339 Causes constant variables to be placed in the @code{.near} section.
17341 @item -mdiv
17342 @opindex mdiv
17343 Enables the @code{div} and @code{divu} instructions.
17345 @item -meb
17346 @opindex meb
17347 Generate big-endian code.
17349 @item -mel
17350 @opindex mel
17351 Generate little-endian code.
17353 @item -mio-volatile
17354 @opindex mio-volatile
17355 Tells the compiler that any variable marked with the @code{io}
17356 attribute is to be considered volatile.
17358 @item -ml
17359 @opindex ml
17360 Causes variables to be assigned to the @code{.far} section by default.
17362 @item -mleadz
17363 @opindex mleadz
17364 Enables the @code{leadz} (leading zero) instruction.
17366 @item -mm
17367 @opindex mm
17368 Causes variables to be assigned to the @code{.near} section by default.
17370 @item -mminmax
17371 @opindex mminmax
17372 Enables the @code{min} and @code{max} instructions.
17374 @item -mmult
17375 @opindex mmult
17376 Enables the multiplication and multiply-accumulate instructions.
17378 @item -mno-opts
17379 @opindex mno-opts
17380 Disables all the optional instructions enabled by @code{-mall-opts}.
17382 @item -mrepeat
17383 @opindex mrepeat
17384 Enables the @code{repeat} and @code{erepeat} instructions, used for
17385 low-overhead looping.
17387 @item -ms
17388 @opindex ms
17389 Causes all variables to default to the @code{.tiny} section.  Note
17390 that there is a 65536-byte limit to this section.  Accesses to these
17391 variables use the @code{%gp} base register.
17393 @item -msatur
17394 @opindex msatur
17395 Enables the saturation instructions.  Note that the compiler does not
17396 currently generate these itself, but this option is included for
17397 compatibility with other tools, like @code{as}.
17399 @item -msdram
17400 @opindex msdram
17401 Link the SDRAM-based runtime instead of the default ROM-based runtime.
17403 @item -msim
17404 @opindex msim
17405 Link the simulator run-time libraries.
17407 @item -msimnovec
17408 @opindex msimnovec
17409 Link the simulator runtime libraries, excluding built-in support
17410 for reset and exception vectors and tables.
17412 @item -mtf
17413 @opindex mtf
17414 Causes all functions to default to the @code{.far} section.  Without
17415 this option, functions default to the @code{.near} section.
17417 @item -mtiny=@var{n}
17418 @opindex mtiny=
17419 Variables that are @var{n} bytes or smaller are allocated to the
17420 @code{.tiny} section.  These variables use the @code{$gp} base
17421 register.  The default for this option is 4, but note that there's a
17422 65536-byte limit to the @code{.tiny} section.
17424 @end table
17426 @node MicroBlaze Options
17427 @subsection MicroBlaze Options
17428 @cindex MicroBlaze Options
17430 @table @gcctabopt
17432 @item -msoft-float
17433 @opindex msoft-float
17434 Use software emulation for floating point (default).
17436 @item -mhard-float
17437 @opindex mhard-float
17438 Use hardware floating-point instructions.
17440 @item -mmemcpy
17441 @opindex mmemcpy
17442 Do not optimize block moves, use @code{memcpy}.
17444 @item -mno-clearbss
17445 @opindex mno-clearbss
17446 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
17448 @item -mcpu=@var{cpu-type}
17449 @opindex mcpu=
17450 Use features of, and schedule code for, the given CPU.
17451 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
17452 where @var{X} is a major version, @var{YY} is the minor version, and
17453 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
17454 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
17456 @item -mxl-soft-mul
17457 @opindex mxl-soft-mul
17458 Use software multiply emulation (default).
17460 @item -mxl-soft-div
17461 @opindex mxl-soft-div
17462 Use software emulation for divides (default).
17464 @item -mxl-barrel-shift
17465 @opindex mxl-barrel-shift
17466 Use the hardware barrel shifter.
17468 @item -mxl-pattern-compare
17469 @opindex mxl-pattern-compare
17470 Use pattern compare instructions.
17472 @item -msmall-divides
17473 @opindex msmall-divides
17474 Use table lookup optimization for small signed integer divisions.
17476 @item -mxl-stack-check
17477 @opindex mxl-stack-check
17478 This option is deprecated.  Use @option{-fstack-check} instead.
17480 @item -mxl-gp-opt
17481 @opindex mxl-gp-opt
17482 Use GP-relative @code{.sdata}/@code{.sbss} sections.
17484 @item -mxl-multiply-high
17485 @opindex mxl-multiply-high
17486 Use multiply high instructions for high part of 32x32 multiply.
17488 @item -mxl-float-convert
17489 @opindex mxl-float-convert
17490 Use hardware floating-point conversion instructions.
17492 @item -mxl-float-sqrt
17493 @opindex mxl-float-sqrt
17494 Use hardware floating-point square root instruction.
17496 @item -mbig-endian
17497 @opindex mbig-endian
17498 Generate code for a big-endian target.
17500 @item -mlittle-endian
17501 @opindex mlittle-endian
17502 Generate code for a little-endian target.
17504 @item -mxl-reorder
17505 @opindex mxl-reorder
17506 Use reorder instructions (swap and byte reversed load/store).
17508 @item -mxl-mode-@var{app-model}
17509 Select application model @var{app-model}.  Valid models are
17510 @table @samp
17511 @item executable
17512 normal executable (default), uses startup code @file{crt0.o}.
17514 @item xmdstub
17515 for use with Xilinx Microprocessor Debugger (XMD) based
17516 software intrusive debug agent called xmdstub. This uses startup file
17517 @file{crt1.o} and sets the start address of the program to 0x800.
17519 @item bootstrap
17520 for applications that are loaded using a bootloader.
17521 This model uses startup file @file{crt2.o} which does not contain a processor
17522 reset vector handler. This is suitable for transferring control on a
17523 processor reset to the bootloader rather than the application.
17525 @item novectors
17526 for applications that do not require any of the
17527 MicroBlaze vectors. This option may be useful for applications running
17528 within a monitoring application. This model uses @file{crt3.o} as a startup file.
17529 @end table
17531 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
17532 @option{-mxl-mode-@var{app-model}}.
17534 @end table
17536 @node MIPS Options
17537 @subsection MIPS Options
17538 @cindex MIPS options
17540 @table @gcctabopt
17542 @item -EB
17543 @opindex EB
17544 Generate big-endian code.
17546 @item -EL
17547 @opindex EL
17548 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
17549 configurations.
17551 @item -march=@var{arch}
17552 @opindex march
17553 Generate code that runs on @var{arch}, which can be the name of a
17554 generic MIPS ISA, or the name of a particular processor.
17555 The ISA names are:
17556 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
17557 @samp{mips32}, @samp{mips32r2}, @samp{mips32r3}, @samp{mips32r5}, 
17558 @samp{mips64}, @samp{mips64r2}, @samp{mips64r3} and @samp{mips64r5}.
17559 The processor names are:
17560 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
17561 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
17562 @samp{5kc}, @samp{5kf},
17563 @samp{20kc},
17564 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
17565 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
17566 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
17567 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
17568 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
17569 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
17570 @samp{m4k},
17571 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
17572 @samp{octeon}, @samp{octeon+}, @samp{octeon2}, @samp{octeon3},
17573 @samp{orion},
17574 @samp{p5600},
17575 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
17576 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
17577 @samp{rm7000}, @samp{rm9000},
17578 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
17579 @samp{sb1},
17580 @samp{sr71000},
17581 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
17582 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
17583 @samp{xlr} and @samp{xlp}.
17584 The special value @samp{from-abi} selects the
17585 most compatible architecture for the selected ABI (that is,
17586 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
17588 The native Linux/GNU toolchain also supports the value @samp{native},
17589 which selects the best architecture option for the host processor.
17590 @option{-march=native} has no effect if GCC does not recognize
17591 the processor.
17593 In processor names, a final @samp{000} can be abbreviated as @samp{k}
17594 (for example, @option{-march=r2k}).  Prefixes are optional, and
17595 @samp{vr} may be written @samp{r}.
17597 Names of the form @samp{@var{n}f2_1} refer to processors with
17598 FPUs clocked at half the rate of the core, names of the form
17599 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
17600 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
17601 processors with FPUs clocked a ratio of 3:2 with respect to the core.
17602 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
17603 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
17604 accepted as synonyms for @samp{@var{n}f1_1}.
17606 GCC defines two macros based on the value of this option.  The first
17607 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
17608 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
17609 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
17610 For example, @option{-march=r2000} sets @samp{_MIPS_ARCH}
17611 to @samp{"r2000"} and defines the macro @samp{_MIPS_ARCH_R2000}.
17613 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
17614 above.  In other words, it has the full prefix and does not
17615 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
17616 the macro names the resolved architecture (either @samp{"mips1"} or
17617 @samp{"mips3"}).  It names the default architecture when no
17618 @option{-march} option is given.
17620 @item -mtune=@var{arch}
17621 @opindex mtune
17622 Optimize for @var{arch}.  Among other things, this option controls
17623 the way instructions are scheduled, and the perceived cost of arithmetic
17624 operations.  The list of @var{arch} values is the same as for
17625 @option{-march}.
17627 When this option is not used, GCC optimizes for the processor
17628 specified by @option{-march}.  By using @option{-march} and
17629 @option{-mtune} together, it is possible to generate code that
17630 runs on a family of processors, but optimize the code for one
17631 particular member of that family.
17633 @option{-mtune} defines the macros @samp{_MIPS_TUNE} and
17634 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
17635 @option{-march} ones described above.
17637 @item -mips1
17638 @opindex mips1
17639 Equivalent to @option{-march=mips1}.
17641 @item -mips2
17642 @opindex mips2
17643 Equivalent to @option{-march=mips2}.
17645 @item -mips3
17646 @opindex mips3
17647 Equivalent to @option{-march=mips3}.
17649 @item -mips4
17650 @opindex mips4
17651 Equivalent to @option{-march=mips4}.
17653 @item -mips32
17654 @opindex mips32
17655 Equivalent to @option{-march=mips32}.
17657 @item -mips32r3
17658 @opindex mips32r3
17659 Equivalent to @option{-march=mips32r3}.
17661 @item -mips32r5
17662 @opindex mips32r5
17663 Equivalent to @option{-march=mips32r5}.
17665 @item -mips64
17666 @opindex mips64
17667 Equivalent to @option{-march=mips64}.
17669 @item -mips64r2
17670 @opindex mips64r2
17671 Equivalent to @option{-march=mips64r2}.
17673 @item -mips64r3
17674 @opindex mips64r3
17675 Equivalent to @option{-march=mips64r3}.
17677 @item -mips64r5
17678 @opindex mips64r5
17679 Equivalent to @option{-march=mips64r5}.
17681 @item -mips16
17682 @itemx -mno-mips16
17683 @opindex mips16
17684 @opindex mno-mips16
17685 Generate (do not generate) MIPS16 code.  If GCC is targeting a
17686 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
17688 MIPS16 code generation can also be controlled on a per-function basis
17689 by means of @code{mips16} and @code{nomips16} attributes.
17690 @xref{Function Attributes}, for more information.
17692 @item -mflip-mips16
17693 @opindex mflip-mips16
17694 Generate MIPS16 code on alternating functions.  This option is provided
17695 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
17696 not intended for ordinary use in compiling user code.
17698 @item -minterlink-compressed
17699 @item -mno-interlink-compressed
17700 @opindex minterlink-compressed
17701 @opindex mno-interlink-compressed
17702 Require (do not require) that code using the standard (uncompressed) MIPS ISA
17703 be link-compatible with MIPS16 and microMIPS code, and vice versa.
17705 For example, code using the standard ISA encoding cannot jump directly
17706 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
17707 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
17708 knows that the target of the jump is not compressed.
17710 @item -minterlink-mips16
17711 @itemx -mno-interlink-mips16
17712 @opindex minterlink-mips16
17713 @opindex mno-interlink-mips16
17714 Aliases of @option{-minterlink-compressed} and
17715 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
17716 and are retained for backwards compatibility.
17718 @item -mabi=32
17719 @itemx -mabi=o64
17720 @itemx -mabi=n32
17721 @itemx -mabi=64
17722 @itemx -mabi=eabi
17723 @opindex mabi=32
17724 @opindex mabi=o64
17725 @opindex mabi=n32
17726 @opindex mabi=64
17727 @opindex mabi=eabi
17728 Generate code for the given ABI@.
17730 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
17731 generates 64-bit code when you select a 64-bit architecture, but you
17732 can use @option{-mgp32} to get 32-bit code instead.
17734 For information about the O64 ABI, see
17735 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
17737 GCC supports a variant of the o32 ABI in which floating-point registers
17738 are 64 rather than 32 bits wide.  You can select this combination with
17739 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
17740 and @code{mfhc1} instructions and is therefore only supported for
17741 MIPS32R2, MIPS32R3 and MIPS32R5 processors.
17743 The register assignments for arguments and return values remain the
17744 same, but each scalar value is passed in a single 64-bit register
17745 rather than a pair of 32-bit registers.  For example, scalar
17746 floating-point values are returned in @samp{$f0} only, not a
17747 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
17748 remains the same, but all 64 bits are saved.
17750 @item -mabicalls
17751 @itemx -mno-abicalls
17752 @opindex mabicalls
17753 @opindex mno-abicalls
17754 Generate (do not generate) code that is suitable for SVR4-style
17755 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
17756 systems.
17758 @item -mshared
17759 @itemx -mno-shared
17760 Generate (do not generate) code that is fully position-independent,
17761 and that can therefore be linked into shared libraries.  This option
17762 only affects @option{-mabicalls}.
17764 All @option{-mabicalls} code has traditionally been position-independent,
17765 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
17766 as an extension, the GNU toolchain allows executables to use absolute
17767 accesses for locally-binding symbols.  It can also use shorter GP
17768 initialization sequences and generate direct calls to locally-defined
17769 functions.  This mode is selected by @option{-mno-shared}.
17771 @option{-mno-shared} depends on binutils 2.16 or higher and generates
17772 objects that can only be linked by the GNU linker.  However, the option
17773 does not affect the ABI of the final executable; it only affects the ABI
17774 of relocatable objects.  Using @option{-mno-shared} generally makes
17775 executables both smaller and quicker.
17777 @option{-mshared} is the default.
17779 @item -mplt
17780 @itemx -mno-plt
17781 @opindex mplt
17782 @opindex mno-plt
17783 Assume (do not assume) that the static and dynamic linkers
17784 support PLTs and copy relocations.  This option only affects
17785 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
17786 has no effect without @option{-msym32}.
17788 You can make @option{-mplt} the default by configuring
17789 GCC with @option{--with-mips-plt}.  The default is
17790 @option{-mno-plt} otherwise.
17792 @item -mxgot
17793 @itemx -mno-xgot
17794 @opindex mxgot
17795 @opindex mno-xgot
17796 Lift (do not lift) the usual restrictions on the size of the global
17797 offset table.
17799 GCC normally uses a single instruction to load values from the GOT@.
17800 While this is relatively efficient, it only works if the GOT
17801 is smaller than about 64k.  Anything larger causes the linker
17802 to report an error such as:
17804 @cindex relocation truncated to fit (MIPS)
17805 @smallexample
17806 relocation truncated to fit: R_MIPS_GOT16 foobar
17807 @end smallexample
17809 If this happens, you should recompile your code with @option{-mxgot}.
17810 This works with very large GOTs, although the code is also
17811 less efficient, since it takes three instructions to fetch the
17812 value of a global symbol.
17814 Note that some linkers can create multiple GOTs.  If you have such a
17815 linker, you should only need to use @option{-mxgot} when a single object
17816 file accesses more than 64k's worth of GOT entries.  Very few do.
17818 These options have no effect unless GCC is generating position
17819 independent code.
17821 @item -mgp32
17822 @opindex mgp32
17823 Assume that general-purpose registers are 32 bits wide.
17825 @item -mgp64
17826 @opindex mgp64
17827 Assume that general-purpose registers are 64 bits wide.
17829 @item -mfp32
17830 @opindex mfp32
17831 Assume that floating-point registers are 32 bits wide.
17833 @item -mfp64
17834 @opindex mfp64
17835 Assume that floating-point registers are 64 bits wide.
17837 @item -mhard-float
17838 @opindex mhard-float
17839 Use floating-point coprocessor instructions.
17841 @item -msoft-float
17842 @opindex msoft-float
17843 Do not use floating-point coprocessor instructions.  Implement
17844 floating-point calculations using library calls instead.
17846 @item -mno-float
17847 @opindex mno-float
17848 Equivalent to @option{-msoft-float}, but additionally asserts that the
17849 program being compiled does not perform any floating-point operations.
17850 This option is presently supported only by some bare-metal MIPS
17851 configurations, where it may select a special set of libraries
17852 that lack all floating-point support (including, for example, the
17853 floating-point @code{printf} formats).  
17854 If code compiled with @code{-mno-float} accidentally contains
17855 floating-point operations, it is likely to suffer a link-time
17856 or run-time failure.
17858 @item -msingle-float
17859 @opindex msingle-float
17860 Assume that the floating-point coprocessor only supports single-precision
17861 operations.
17863 @item -mdouble-float
17864 @opindex mdouble-float
17865 Assume that the floating-point coprocessor supports double-precision
17866 operations.  This is the default.
17868 @item -mabs=2008
17869 @itemx -mabs=legacy
17870 @opindex mabs=2008
17871 @opindex mabs=legacy
17872 These options control the treatment of the special not-a-number (NaN)
17873 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
17874 @code{neg.@i{fmt}} machine instructions.
17876 By default or when the @option{-mabs=legacy} is used the legacy
17877 treatment is selected.  In this case these instructions are considered
17878 arithmetic and avoided where correct operation is required and the
17879 input operand might be a NaN.  A longer sequence of instructions that
17880 manipulate the sign bit of floating-point datum manually is used
17881 instead unless the @option{-ffinite-math-only} option has also been
17882 specified.
17884 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
17885 this case these instructions are considered non-arithmetic and therefore
17886 operating correctly in all cases, including in particular where the
17887 input operand is a NaN.  These instructions are therefore always used
17888 for the respective operations.
17890 @item -mnan=2008
17891 @itemx -mnan=legacy
17892 @opindex mnan=2008
17893 @opindex mnan=legacy
17894 These options control the encoding of the special not-a-number (NaN)
17895 IEEE 754 floating-point data.
17897 The @option{-mnan=legacy} option selects the legacy encoding.  In this
17898 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
17899 significand field being 0, whereas signalling NaNs (sNaNs) are denoted
17900 by the first bit of their trailing significand field being 1.
17902 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
17903 this case qNaNs are denoted by the first bit of their trailing
17904 significand field being 1, whereas sNaNs are denoted by the first bit of
17905 their trailing significand field being 0.
17907 The default is @option{-mnan=legacy} unless GCC has been configured with
17908 @option{--with-nan=2008}.
17910 @item -mllsc
17911 @itemx -mno-llsc
17912 @opindex mllsc
17913 @opindex mno-llsc
17914 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
17915 implement atomic memory built-in functions.  When neither option is
17916 specified, GCC uses the instructions if the target architecture
17917 supports them.
17919 @option{-mllsc} is useful if the runtime environment can emulate the
17920 instructions and @option{-mno-llsc} can be useful when compiling for
17921 nonstandard ISAs.  You can make either option the default by
17922 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
17923 respectively.  @option{--with-llsc} is the default for some
17924 configurations; see the installation documentation for details.
17926 @item -mdsp
17927 @itemx -mno-dsp
17928 @opindex mdsp
17929 @opindex mno-dsp
17930 Use (do not use) revision 1 of the MIPS DSP ASE@.
17931 @xref{MIPS DSP Built-in Functions}.  This option defines the
17932 preprocessor macro @samp{__mips_dsp}.  It also defines
17933 @samp{__mips_dsp_rev} to 1.
17935 @item -mdspr2
17936 @itemx -mno-dspr2
17937 @opindex mdspr2
17938 @opindex mno-dspr2
17939 Use (do not use) revision 2 of the MIPS DSP ASE@.
17940 @xref{MIPS DSP Built-in Functions}.  This option defines the
17941 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
17942 It also defines @samp{__mips_dsp_rev} to 2.
17944 @item -msmartmips
17945 @itemx -mno-smartmips
17946 @opindex msmartmips
17947 @opindex mno-smartmips
17948 Use (do not use) the MIPS SmartMIPS ASE.
17950 @item -mpaired-single
17951 @itemx -mno-paired-single
17952 @opindex mpaired-single
17953 @opindex mno-paired-single
17954 Use (do not use) paired-single floating-point instructions.
17955 @xref{MIPS Paired-Single Support}.  This option requires
17956 hardware floating-point support to be enabled.
17958 @item -mdmx
17959 @itemx -mno-mdmx
17960 @opindex mdmx
17961 @opindex mno-mdmx
17962 Use (do not use) MIPS Digital Media Extension instructions.
17963 This option can only be used when generating 64-bit code and requires
17964 hardware floating-point support to be enabled.
17966 @item -mips3d
17967 @itemx -mno-mips3d
17968 @opindex mips3d
17969 @opindex mno-mips3d
17970 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
17971 The option @option{-mips3d} implies @option{-mpaired-single}.
17973 @item -mmicromips
17974 @itemx -mno-micromips
17975 @opindex mmicromips
17976 @opindex mno-mmicromips
17977 Generate (do not generate) microMIPS code.
17979 MicroMIPS code generation can also be controlled on a per-function basis
17980 by means of @code{micromips} and @code{nomicromips} attributes.
17981 @xref{Function Attributes}, for more information.
17983 @item -mmt
17984 @itemx -mno-mt
17985 @opindex mmt
17986 @opindex mno-mt
17987 Use (do not use) MT Multithreading instructions.
17989 @item -mmcu
17990 @itemx -mno-mcu
17991 @opindex mmcu
17992 @opindex mno-mcu
17993 Use (do not use) the MIPS MCU ASE instructions.
17995 @item -meva
17996 @itemx -mno-eva
17997 @opindex meva
17998 @opindex mno-eva
17999 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
18001 @item -mvirt
18002 @itemx -mno-virt
18003 @opindex mvirt
18004 @opindex mno-virt
18005 Use (do not use) the MIPS Virtualization Application Specific instructions.
18007 @item -mxpa
18008 @itemx -mno-xpa
18009 @opindex mxpa
18010 @opindex mno-xpa
18011 Use (do not use) the MIPS eXtended Physical Address (XPA) instructions.
18013 @item -mlong64
18014 @opindex mlong64
18015 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
18016 an explanation of the default and the way that the pointer size is
18017 determined.
18019 @item -mlong32
18020 @opindex mlong32
18021 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
18023 The default size of @code{int}s, @code{long}s and pointers depends on
18024 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
18025 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
18026 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
18027 or the same size as integer registers, whichever is smaller.
18029 @item -msym32
18030 @itemx -mno-sym32
18031 @opindex msym32
18032 @opindex mno-sym32
18033 Assume (do not assume) that all symbols have 32-bit values, regardless
18034 of the selected ABI@.  This option is useful in combination with
18035 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
18036 to generate shorter and faster references to symbolic addresses.
18038 @item -G @var{num}
18039 @opindex G
18040 Put definitions of externally-visible data in a small data section
18041 if that data is no bigger than @var{num} bytes.  GCC can then generate
18042 more efficient accesses to the data; see @option{-mgpopt} for details.
18044 The default @option{-G} option depends on the configuration.
18046 @item -mlocal-sdata
18047 @itemx -mno-local-sdata
18048 @opindex mlocal-sdata
18049 @opindex mno-local-sdata
18050 Extend (do not extend) the @option{-G} behavior to local data too,
18051 such as to static variables in C@.  @option{-mlocal-sdata} is the
18052 default for all configurations.
18054 If the linker complains that an application is using too much small data,
18055 you might want to try rebuilding the less performance-critical parts with
18056 @option{-mno-local-sdata}.  You might also want to build large
18057 libraries with @option{-mno-local-sdata}, so that the libraries leave
18058 more room for the main program.
18060 @item -mextern-sdata
18061 @itemx -mno-extern-sdata
18062 @opindex mextern-sdata
18063 @opindex mno-extern-sdata
18064 Assume (do not assume) that externally-defined data is in
18065 a small data section if the size of that data is within the @option{-G} limit.
18066 @option{-mextern-sdata} is the default for all configurations.
18068 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
18069 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
18070 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
18071 is placed in a small data section.  If @var{Var} is defined by another
18072 module, you must either compile that module with a high-enough
18073 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
18074 definition.  If @var{Var} is common, you must link the application
18075 with a high-enough @option{-G} setting.
18077 The easiest way of satisfying these restrictions is to compile
18078 and link every module with the same @option{-G} option.  However,
18079 you may wish to build a library that supports several different
18080 small data limits.  You can do this by compiling the library with
18081 the highest supported @option{-G} setting and additionally using
18082 @option{-mno-extern-sdata} to stop the library from making assumptions
18083 about externally-defined data.
18085 @item -mgpopt
18086 @itemx -mno-gpopt
18087 @opindex mgpopt
18088 @opindex mno-gpopt
18089 Use (do not use) GP-relative accesses for symbols that are known to be
18090 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
18091 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
18092 configurations.
18094 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
18095 might not hold the value of @code{_gp}.  For example, if the code is
18096 part of a library that might be used in a boot monitor, programs that
18097 call boot monitor routines pass an unknown value in @code{$gp}.
18098 (In such situations, the boot monitor itself is usually compiled
18099 with @option{-G0}.)
18101 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
18102 @option{-mno-extern-sdata}.
18104 @item -membedded-data
18105 @itemx -mno-embedded-data
18106 @opindex membedded-data
18107 @opindex mno-embedded-data
18108 Allocate variables to the read-only data section first if possible, then
18109 next in the small data section if possible, otherwise in data.  This gives
18110 slightly slower code than the default, but reduces the amount of RAM required
18111 when executing, and thus may be preferred for some embedded systems.
18113 @item -muninit-const-in-rodata
18114 @itemx -mno-uninit-const-in-rodata
18115 @opindex muninit-const-in-rodata
18116 @opindex mno-uninit-const-in-rodata
18117 Put uninitialized @code{const} variables in the read-only data section.
18118 This option is only meaningful in conjunction with @option{-membedded-data}.
18120 @item -mcode-readable=@var{setting}
18121 @opindex mcode-readable
18122 Specify whether GCC may generate code that reads from executable sections.
18123 There are three possible settings:
18125 @table @gcctabopt
18126 @item -mcode-readable=yes
18127 Instructions may freely access executable sections.  This is the
18128 default setting.
18130 @item -mcode-readable=pcrel
18131 MIPS16 PC-relative load instructions can access executable sections,
18132 but other instructions must not do so.  This option is useful on 4KSc
18133 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
18134 It is also useful on processors that can be configured to have a dual
18135 instruction/data SRAM interface and that, like the M4K, automatically
18136 redirect PC-relative loads to the instruction RAM.
18138 @item -mcode-readable=no
18139 Instructions must not access executable sections.  This option can be
18140 useful on targets that are configured to have a dual instruction/data
18141 SRAM interface but that (unlike the M4K) do not automatically redirect
18142 PC-relative loads to the instruction RAM.
18143 @end table
18145 @item -msplit-addresses
18146 @itemx -mno-split-addresses
18147 @opindex msplit-addresses
18148 @opindex mno-split-addresses
18149 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
18150 relocation operators.  This option has been superseded by
18151 @option{-mexplicit-relocs} but is retained for backwards compatibility.
18153 @item -mexplicit-relocs
18154 @itemx -mno-explicit-relocs
18155 @opindex mexplicit-relocs
18156 @opindex mno-explicit-relocs
18157 Use (do not use) assembler relocation operators when dealing with symbolic
18158 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
18159 is to use assembler macros instead.
18161 @option{-mexplicit-relocs} is the default if GCC was configured
18162 to use an assembler that supports relocation operators.
18164 @item -mcheck-zero-division
18165 @itemx -mno-check-zero-division
18166 @opindex mcheck-zero-division
18167 @opindex mno-check-zero-division
18168 Trap (do not trap) on integer division by zero.
18170 The default is @option{-mcheck-zero-division}.
18172 @item -mdivide-traps
18173 @itemx -mdivide-breaks
18174 @opindex mdivide-traps
18175 @opindex mdivide-breaks
18176 MIPS systems check for division by zero by generating either a
18177 conditional trap or a break instruction.  Using traps results in
18178 smaller code, but is only supported on MIPS II and later.  Also, some
18179 versions of the Linux kernel have a bug that prevents trap from
18180 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
18181 allow conditional traps on architectures that support them and
18182 @option{-mdivide-breaks} to force the use of breaks.
18184 The default is usually @option{-mdivide-traps}, but this can be
18185 overridden at configure time using @option{--with-divide=breaks}.
18186 Divide-by-zero checks can be completely disabled using
18187 @option{-mno-check-zero-division}.
18189 @item -mmemcpy
18190 @itemx -mno-memcpy
18191 @opindex mmemcpy
18192 @opindex mno-memcpy
18193 Force (do not force) the use of @code{memcpy()} for non-trivial block
18194 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
18195 most constant-sized copies.
18197 @item -mlong-calls
18198 @itemx -mno-long-calls
18199 @opindex mlong-calls
18200 @opindex mno-long-calls
18201 Disable (do not disable) use of the @code{jal} instruction.  Calling
18202 functions using @code{jal} is more efficient but requires the caller
18203 and callee to be in the same 256 megabyte segment.
18205 This option has no effect on abicalls code.  The default is
18206 @option{-mno-long-calls}.
18208 @item -mmad
18209 @itemx -mno-mad
18210 @opindex mmad
18211 @opindex mno-mad
18212 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
18213 instructions, as provided by the R4650 ISA@.
18215 @item -mimadd
18216 @itemx -mno-imadd
18217 @opindex mimadd
18218 @opindex mno-imadd
18219 Enable (disable) use of the @code{madd} and @code{msub} integer
18220 instructions.  The default is @option{-mimadd} on architectures
18221 that support @code{madd} and @code{msub} except for the 74k 
18222 architecture where it was found to generate slower code.
18224 @item -mfused-madd
18225 @itemx -mno-fused-madd
18226 @opindex mfused-madd
18227 @opindex mno-fused-madd
18228 Enable (disable) use of the floating-point multiply-accumulate
18229 instructions, when they are available.  The default is
18230 @option{-mfused-madd}.
18232 On the R8000 CPU when multiply-accumulate instructions are used,
18233 the intermediate product is calculated to infinite precision
18234 and is not subject to the FCSR Flush to Zero bit.  This may be
18235 undesirable in some circumstances.  On other processors the result
18236 is numerically identical to the equivalent computation using
18237 separate multiply, add, subtract and negate instructions.
18239 @item -nocpp
18240 @opindex nocpp
18241 Tell the MIPS assembler to not run its preprocessor over user
18242 assembler files (with a @samp{.s} suffix) when assembling them.
18244 @item -mfix-24k
18245 @item -mno-fix-24k
18246 @opindex mfix-24k
18247 @opindex mno-fix-24k
18248 Work around the 24K E48 (lost data on stores during refill) errata.
18249 The workarounds are implemented by the assembler rather than by GCC@.
18251 @item -mfix-r4000
18252 @itemx -mno-fix-r4000
18253 @opindex mfix-r4000
18254 @opindex mno-fix-r4000
18255 Work around certain R4000 CPU errata:
18256 @itemize @minus
18257 @item
18258 A double-word or a variable shift may give an incorrect result if executed
18259 immediately after starting an integer division.
18260 @item
18261 A double-word or a variable shift may give an incorrect result if executed
18262 while an integer multiplication is in progress.
18263 @item
18264 An integer division may give an incorrect result if started in a delay slot
18265 of a taken branch or a jump.
18266 @end itemize
18268 @item -mfix-r4400
18269 @itemx -mno-fix-r4400
18270 @opindex mfix-r4400
18271 @opindex mno-fix-r4400
18272 Work around certain R4400 CPU errata:
18273 @itemize @minus
18274 @item
18275 A double-word or a variable shift may give an incorrect result if executed
18276 immediately after starting an integer division.
18277 @end itemize
18279 @item -mfix-r10000
18280 @itemx -mno-fix-r10000
18281 @opindex mfix-r10000
18282 @opindex mno-fix-r10000
18283 Work around certain R10000 errata:
18284 @itemize @minus
18285 @item
18286 @code{ll}/@code{sc} sequences may not behave atomically on revisions
18287 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
18288 @end itemize
18290 This option can only be used if the target architecture supports
18291 branch-likely instructions.  @option{-mfix-r10000} is the default when
18292 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
18293 otherwise.
18295 @item -mfix-rm7000
18296 @itemx -mno-fix-rm7000
18297 @opindex mfix-rm7000
18298 Work around the RM7000 @code{dmult}/@code{dmultu} errata.  The
18299 workarounds are implemented by the assembler rather than by GCC@.
18301 @item -mfix-vr4120
18302 @itemx -mno-fix-vr4120
18303 @opindex mfix-vr4120
18304 Work around certain VR4120 errata:
18305 @itemize @minus
18306 @item
18307 @code{dmultu} does not always produce the correct result.
18308 @item
18309 @code{div} and @code{ddiv} do not always produce the correct result if one
18310 of the operands is negative.
18311 @end itemize
18312 The workarounds for the division errata rely on special functions in
18313 @file{libgcc.a}.  At present, these functions are only provided by
18314 the @code{mips64vr*-elf} configurations.
18316 Other VR4120 errata require a NOP to be inserted between certain pairs of
18317 instructions.  These errata are handled by the assembler, not by GCC itself.
18319 @item -mfix-vr4130
18320 @opindex mfix-vr4130
18321 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
18322 workarounds are implemented by the assembler rather than by GCC,
18323 although GCC avoids using @code{mflo} and @code{mfhi} if the
18324 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
18325 instructions are available instead.
18327 @item -mfix-sb1
18328 @itemx -mno-fix-sb1
18329 @opindex mfix-sb1
18330 Work around certain SB-1 CPU core errata.
18331 (This flag currently works around the SB-1 revision 2
18332 ``F1'' and ``F2'' floating-point errata.)
18334 @item -mr10k-cache-barrier=@var{setting}
18335 @opindex mr10k-cache-barrier
18336 Specify whether GCC should insert cache barriers to avoid the
18337 side-effects of speculation on R10K processors.
18339 In common with many processors, the R10K tries to predict the outcome
18340 of a conditional branch and speculatively executes instructions from
18341 the ``taken'' branch.  It later aborts these instructions if the
18342 predicted outcome is wrong.  However, on the R10K, even aborted
18343 instructions can have side effects.
18345 This problem only affects kernel stores and, depending on the system,
18346 kernel loads.  As an example, a speculatively-executed store may load
18347 the target memory into cache and mark the cache line as dirty, even if
18348 the store itself is later aborted.  If a DMA operation writes to the
18349 same area of memory before the ``dirty'' line is flushed, the cached
18350 data overwrites the DMA-ed data.  See the R10K processor manual
18351 for a full description, including other potential problems.
18353 One workaround is to insert cache barrier instructions before every memory
18354 access that might be speculatively executed and that might have side
18355 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
18356 controls GCC's implementation of this workaround.  It assumes that
18357 aborted accesses to any byte in the following regions does not have
18358 side effects:
18360 @enumerate
18361 @item
18362 the memory occupied by the current function's stack frame;
18364 @item
18365 the memory occupied by an incoming stack argument;
18367 @item
18368 the memory occupied by an object with a link-time-constant address.
18369 @end enumerate
18371 It is the kernel's responsibility to ensure that speculative
18372 accesses to these regions are indeed safe.
18374 If the input program contains a function declaration such as:
18376 @smallexample
18377 void foo (void);
18378 @end smallexample
18380 then the implementation of @code{foo} must allow @code{j foo} and
18381 @code{jal foo} to be executed speculatively.  GCC honors this
18382 restriction for functions it compiles itself.  It expects non-GCC
18383 functions (such as hand-written assembly code) to do the same.
18385 The option has three forms:
18387 @table @gcctabopt
18388 @item -mr10k-cache-barrier=load-store
18389 Insert a cache barrier before a load or store that might be
18390 speculatively executed and that might have side effects even
18391 if aborted.
18393 @item -mr10k-cache-barrier=store
18394 Insert a cache barrier before a store that might be speculatively
18395 executed and that might have side effects even if aborted.
18397 @item -mr10k-cache-barrier=none
18398 Disable the insertion of cache barriers.  This is the default setting.
18399 @end table
18401 @item -mflush-func=@var{func}
18402 @itemx -mno-flush-func
18403 @opindex mflush-func
18404 Specifies the function to call to flush the I and D caches, or to not
18405 call any such function.  If called, the function must take the same
18406 arguments as the common @code{_flush_func()}, that is, the address of the
18407 memory range for which the cache is being flushed, the size of the
18408 memory range, and the number 3 (to flush both caches).  The default
18409 depends on the target GCC was configured for, but commonly is either
18410 @samp{_flush_func} or @samp{__cpu_flush}.
18412 @item mbranch-cost=@var{num}
18413 @opindex mbranch-cost
18414 Set the cost of branches to roughly @var{num} ``simple'' instructions.
18415 This cost is only a heuristic and is not guaranteed to produce
18416 consistent results across releases.  A zero cost redundantly selects
18417 the default, which is based on the @option{-mtune} setting.
18419 @item -mbranch-likely
18420 @itemx -mno-branch-likely
18421 @opindex mbranch-likely
18422 @opindex mno-branch-likely
18423 Enable or disable use of Branch Likely instructions, regardless of the
18424 default for the selected architecture.  By default, Branch Likely
18425 instructions may be generated if they are supported by the selected
18426 architecture.  An exception is for the MIPS32 and MIPS64 architectures
18427 and processors that implement those architectures; for those, Branch
18428 Likely instructions are not be generated by default because the MIPS32
18429 and MIPS64 architectures specifically deprecate their use.
18431 @item -mfp-exceptions
18432 @itemx -mno-fp-exceptions
18433 @opindex mfp-exceptions
18434 Specifies whether FP exceptions are enabled.  This affects how
18435 FP instructions are scheduled for some processors.
18436 The default is that FP exceptions are
18437 enabled.
18439 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
18440 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
18441 FP pipe.
18443 @item -mvr4130-align
18444 @itemx -mno-vr4130-align
18445 @opindex mvr4130-align
18446 The VR4130 pipeline is two-way superscalar, but can only issue two
18447 instructions together if the first one is 8-byte aligned.  When this
18448 option is enabled, GCC aligns pairs of instructions that it
18449 thinks should execute in parallel.
18451 This option only has an effect when optimizing for the VR4130.
18452 It normally makes code faster, but at the expense of making it bigger.
18453 It is enabled by default at optimization level @option{-O3}.
18455 @item -msynci
18456 @itemx -mno-synci
18457 @opindex msynci
18458 Enable (disable) generation of @code{synci} instructions on
18459 architectures that support it.  The @code{synci} instructions (if
18460 enabled) are generated when @code{__builtin___clear_cache()} is
18461 compiled.
18463 This option defaults to @code{-mno-synci}, but the default can be
18464 overridden by configuring with @code{--with-synci}.
18466 When compiling code for single processor systems, it is generally safe
18467 to use @code{synci}.  However, on many multi-core (SMP) systems, it
18468 does not invalidate the instruction caches on all cores and may lead
18469 to undefined behavior.
18471 @item -mrelax-pic-calls
18472 @itemx -mno-relax-pic-calls
18473 @opindex mrelax-pic-calls
18474 Try to turn PIC calls that are normally dispatched via register
18475 @code{$25} into direct calls.  This is only possible if the linker can
18476 resolve the destination at link-time and if the destination is within
18477 range for a direct call.
18479 @option{-mrelax-pic-calls} is the default if GCC was configured to use
18480 an assembler and a linker that support the @code{.reloc} assembly
18481 directive and @code{-mexplicit-relocs} is in effect.  With
18482 @code{-mno-explicit-relocs}, this optimization can be performed by the
18483 assembler and the linker alone without help from the compiler.
18485 @item -mmcount-ra-address
18486 @itemx -mno-mcount-ra-address
18487 @opindex mmcount-ra-address
18488 @opindex mno-mcount-ra-address
18489 Emit (do not emit) code that allows @code{_mcount} to modify the
18490 calling function's return address.  When enabled, this option extends
18491 the usual @code{_mcount} interface with a new @var{ra-address}
18492 parameter, which has type @code{intptr_t *} and is passed in register
18493 @code{$12}.  @code{_mcount} can then modify the return address by
18494 doing both of the following:
18495 @itemize
18496 @item
18497 Returning the new address in register @code{$31}.
18498 @item
18499 Storing the new address in @code{*@var{ra-address}},
18500 if @var{ra-address} is nonnull.
18501 @end itemize
18503 The default is @option{-mno-mcount-ra-address}.
18505 @end table
18507 @node MMIX Options
18508 @subsection MMIX Options
18509 @cindex MMIX Options
18511 These options are defined for the MMIX:
18513 @table @gcctabopt
18514 @item -mlibfuncs
18515 @itemx -mno-libfuncs
18516 @opindex mlibfuncs
18517 @opindex mno-libfuncs
18518 Specify that intrinsic library functions are being compiled, passing all
18519 values in registers, no matter the size.
18521 @item -mepsilon
18522 @itemx -mno-epsilon
18523 @opindex mepsilon
18524 @opindex mno-epsilon
18525 Generate floating-point comparison instructions that compare with respect
18526 to the @code{rE} epsilon register.
18528 @item -mabi=mmixware
18529 @itemx -mabi=gnu
18530 @opindex mabi=mmixware
18531 @opindex mabi=gnu
18532 Generate code that passes function parameters and return values that (in
18533 the called function) are seen as registers @code{$0} and up, as opposed to
18534 the GNU ABI which uses global registers @code{$231} and up.
18536 @item -mzero-extend
18537 @itemx -mno-zero-extend
18538 @opindex mzero-extend
18539 @opindex mno-zero-extend
18540 When reading data from memory in sizes shorter than 64 bits, use (do not
18541 use) zero-extending load instructions by default, rather than
18542 sign-extending ones.
18544 @item -mknuthdiv
18545 @itemx -mno-knuthdiv
18546 @opindex mknuthdiv
18547 @opindex mno-knuthdiv
18548 Make the result of a division yielding a remainder have the same sign as
18549 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
18550 remainder follows the sign of the dividend.  Both methods are
18551 arithmetically valid, the latter being almost exclusively used.
18553 @item -mtoplevel-symbols
18554 @itemx -mno-toplevel-symbols
18555 @opindex mtoplevel-symbols
18556 @opindex mno-toplevel-symbols
18557 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
18558 code can be used with the @code{PREFIX} assembly directive.
18560 @item -melf
18561 @opindex melf
18562 Generate an executable in the ELF format, rather than the default
18563 @samp{mmo} format used by the @command{mmix} simulator.
18565 @item -mbranch-predict
18566 @itemx -mno-branch-predict
18567 @opindex mbranch-predict
18568 @opindex mno-branch-predict
18569 Use (do not use) the probable-branch instructions, when static branch
18570 prediction indicates a probable branch.
18572 @item -mbase-addresses
18573 @itemx -mno-base-addresses
18574 @opindex mbase-addresses
18575 @opindex mno-base-addresses
18576 Generate (do not generate) code that uses @emph{base addresses}.  Using a
18577 base address automatically generates a request (handled by the assembler
18578 and the linker) for a constant to be set up in a global register.  The
18579 register is used for one or more base address requests within the range 0
18580 to 255 from the value held in the register.  The generally leads to short
18581 and fast code, but the number of different data items that can be
18582 addressed is limited.  This means that a program that uses lots of static
18583 data may require @option{-mno-base-addresses}.
18585 @item -msingle-exit
18586 @itemx -mno-single-exit
18587 @opindex msingle-exit
18588 @opindex mno-single-exit
18589 Force (do not force) generated code to have a single exit point in each
18590 function.
18591 @end table
18593 @node MN10300 Options
18594 @subsection MN10300 Options
18595 @cindex MN10300 options
18597 These @option{-m} options are defined for Matsushita MN10300 architectures:
18599 @table @gcctabopt
18600 @item -mmult-bug
18601 @opindex mmult-bug
18602 Generate code to avoid bugs in the multiply instructions for the MN10300
18603 processors.  This is the default.
18605 @item -mno-mult-bug
18606 @opindex mno-mult-bug
18607 Do not generate code to avoid bugs in the multiply instructions for the
18608 MN10300 processors.
18610 @item -mam33
18611 @opindex mam33
18612 Generate code using features specific to the AM33 processor.
18614 @item -mno-am33
18615 @opindex mno-am33
18616 Do not generate code using features specific to the AM33 processor.  This
18617 is the default.
18619 @item -mam33-2
18620 @opindex mam33-2
18621 Generate code using features specific to the AM33/2.0 processor.
18623 @item -mam34
18624 @opindex mam34
18625 Generate code using features specific to the AM34 processor.
18627 @item -mtune=@var{cpu-type}
18628 @opindex mtune
18629 Use the timing characteristics of the indicated CPU type when
18630 scheduling instructions.  This does not change the targeted processor
18631 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
18632 @samp{am33-2} or @samp{am34}.
18634 @item -mreturn-pointer-on-d0
18635 @opindex mreturn-pointer-on-d0
18636 When generating a function that returns a pointer, return the pointer
18637 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
18638 only in @code{a0}, and attempts to call such functions without a prototype
18639 result in errors.  Note that this option is on by default; use
18640 @option{-mno-return-pointer-on-d0} to disable it.
18642 @item -mno-crt0
18643 @opindex mno-crt0
18644 Do not link in the C run-time initialization object file.
18646 @item -mrelax
18647 @opindex mrelax
18648 Indicate to the linker that it should perform a relaxation optimization pass
18649 to shorten branches, calls and absolute memory addresses.  This option only
18650 has an effect when used on the command line for the final link step.
18652 This option makes symbolic debugging impossible.
18654 @item -mliw
18655 @opindex mliw
18656 Allow the compiler to generate @emph{Long Instruction Word}
18657 instructions if the target is the @samp{AM33} or later.  This is the
18658 default.  This option defines the preprocessor macro @samp{__LIW__}.
18660 @item -mnoliw
18661 @opindex mnoliw
18662 Do not allow the compiler to generate @emph{Long Instruction Word}
18663 instructions.  This option defines the preprocessor macro
18664 @samp{__NO_LIW__}.
18666 @item -msetlb
18667 @opindex msetlb
18668 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
18669 instructions if the target is the @samp{AM33} or later.  This is the
18670 default.  This option defines the preprocessor macro @samp{__SETLB__}.
18672 @item -mnosetlb
18673 @opindex mnosetlb
18674 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
18675 instructions.  This option defines the preprocessor macro
18676 @samp{__NO_SETLB__}.
18678 @end table
18680 @node Moxie Options
18681 @subsection Moxie Options
18682 @cindex Moxie Options
18684 @table @gcctabopt
18686 @item -meb
18687 @opindex meb
18688 Generate big-endian code.  This is the default for @samp{moxie-*-*}
18689 configurations.
18691 @item -mel
18692 @opindex mel
18693 Generate little-endian code.
18695 @item -mno-crt0
18696 @opindex mno-crt0
18697 Do not link in the C run-time initialization object file.
18699 @end table
18701 @node MSP430 Options
18702 @subsection MSP430 Options
18703 @cindex MSP430 Options
18705 These options are defined for the MSP430:
18707 @table @gcctabopt
18709 @item -masm-hex
18710 @opindex masm-hex
18711 Force assembly output to always use hex constants.  Normally such
18712 constants are signed decimals, but this option is available for
18713 testsuite and/or aesthetic purposes.
18715 @item -mmcu=
18716 @opindex mmcu=
18717 Select the MCU to target.  This is used to create a C preprocessor
18718 symbol based upon the MCU name, converted to upper case and pre- and
18719 post- fixed with @code{__}.  This in turn will be used by the
18720 @code{msp430.h} header file to select an MCU specific supplimentary
18721 header file.
18723 The option also sets the ISA to use.  If the MCU name is one that is
18724 known to only support the 430 ISA then that is selected, otherwise the
18725 430X ISA is selected.  A generic MCU name of @code{msp430} can also be
18726 used to select the 430 ISA.  Similarly the generic @code{msp430x} MCU
18727 name will select the 430X ISA.
18729 In addition an MCU specific linker script will be added to the linker
18730 command line.  The script's name is the name of the MCU with
18731 @code{.ld} appended.  Thus specifying @option{-mmcu=xxx} on the gcc
18732 command line will define the C preprocessor symbol @code{__XXX__} and
18733 cause the linker to search for a script called @file{xxx.ld}.
18735 This option is also passed on to the assembler.
18737 @item -mcpu=
18738 @opindex -mcpu=
18739 Specifies the ISA to use.  Accepted values are @code{msp430},
18740 @code{msp430x} and @code{msp430xv2}.  This option is deprecated.  The
18741 @option{-mmcu=} option should be used to select the ISA.
18743 @item -msim
18744 @opindex msim
18745 Link to the simulator runtime libraries and linker script.  Overrides
18746 any scripts that would be selected by the @option{-mmcu=} option.
18748 @item -mlarge
18749 @opindex mlarge
18750 Use large-model addressing (20-bit pointers, 32-bit @code{size_t}).
18752 @item -msmall
18753 @opindex msmall
18754 Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
18756 @item -mrelax
18757 @opindex mrelax
18758 This option is passed to the assembler and linker, and allows the
18759 linker to perform certain optimizations that cannot be done until
18760 the final link.
18762 @item mhwmult=
18763 @opindex mhwmult=
18764 Describes the type of hardware multiply supported by the target.
18765 Accepted values are @code{none} for no hardware multiply, @code{16bit}
18766 for the original 16-bit-only multiply supported by early MCUs.
18767 @code{32bit} for the 16/32-bit multiply supported by later MCUs and
18768 @code{f5series} for the 16/32-bit multiply supported by F5-series MCUs.
18769 A value of @code{auto} can also be given.  This tells GCC to deduce
18770 the hardware multiply support based upon the MCU name provided by the
18771 @option{-mmcu} option.  If no @option{-mmcu} option is specified then
18772 @code{32bit} hardware multiply support is assumed.  @code{auto} is the
18773 default setting.
18775 Hardware multiplies are normally performed by calling a library
18776 routine.  This saves space in the generated code.  When compiling at
18777 @code{-O3} or higher however the hardware multiplier is invoked
18778 inline.  This makes for bigger, but faster code.
18780 The hardware multiply routines disable interrupts whilst running and
18781 restore the previous interrupt state when they finish.  This makes
18782 them safe to use inside interrupt handlers as well as in normal code.
18784 @item -minrt
18785 @opindex minrt
18786 Enable the use of a minimum runtime environment - no static
18787 initializers or constructors.  This is intended for memory-constrained
18788 devices.  The compiler will include special symbols in some objects
18789 that tell the linker and runtime which code fragments are required.
18791 @end table
18793 @node NDS32 Options
18794 @subsection NDS32 Options
18795 @cindex NDS32 Options
18797 These options are defined for NDS32 implementations:
18799 @table @gcctabopt
18801 @item -mbig-endian
18802 @opindex mbig-endian
18803 Generate code in big-endian mode.
18805 @item -mlittle-endian
18806 @opindex mlittle-endian
18807 Generate code in little-endian mode.
18809 @item -mreduced-regs
18810 @opindex mreduced-regs
18811 Use reduced-set registers for register allocation.
18813 @item -mfull-regs
18814 @opindex mfull-regs
18815 Use full-set registers for register allocation.
18817 @item -mcmov
18818 @opindex mcmov
18819 Generate conditional move instructions.
18821 @item -mno-cmov
18822 @opindex mno-cmov
18823 Do not generate conditional move instructions.
18825 @item -mperf-ext
18826 @opindex mperf-ext
18827 Generate performance extension instructions.
18829 @item -mno-perf-ext
18830 @opindex mno-perf-ext
18831 Do not generate performance extension instructions.
18833 @item -mv3push
18834 @opindex mv3push
18835 Generate v3 push25/pop25 instructions.
18837 @item -mno-v3push
18838 @opindex mno-v3push
18839 Do not generate v3 push25/pop25 instructions.
18841 @item -m16-bit
18842 @opindex m16-bit
18843 Generate 16-bit instructions.
18845 @item -mno-16-bit
18846 @opindex mno-16-bit
18847 Do not generate 16-bit instructions.
18849 @item -mgp-direct
18850 @opindex mgp-direct
18851 Generate GP base instructions directly.
18853 @item -mno-gp-direct
18854 @opindex mno-gp-direct
18855 Do no generate GP base instructions directly.
18857 @item -misr-vector-size=@var{num}
18858 @opindex misr-vector-size
18859 Specify the size of each interrupt vector, which must be 4 or 16.
18861 @item -mcache-block-size=@var{num}
18862 @opindex mcache-block-size
18863 Specify the size of each cache block,
18864 which must be a power of 2 between 4 and 512.
18866 @item -march=@var{arch}
18867 @opindex march
18868 Specify the name of the target architecture.
18870 @item -mforce-fp-as-gp
18871 @opindex mforce-fp-as-gp
18872 Prevent $fp being allocated during register allocation so that compiler
18873 is able to force performing fp-as-gp optimization.
18875 @item -mforbid-fp-as-gp
18876 @opindex mforbid-fp-as-gp
18877 Forbid using $fp to access static and global variables.
18878 This option strictly forbids fp-as-gp optimization
18879 regardless of @option{-mforce-fp-as-gp}.
18881 @item -mex9
18882 @opindex mex9
18883 Use special directives to guide linker doing ex9 optimization.
18885 @item -mctor-dtor
18886 @opindex mctor-dtor
18887 Enable constructor/destructor feature.
18889 @item -mrelax
18890 @opindex mrelax
18891 Guide linker to relax instructions.
18893 @end table
18895 @node Nios II Options
18896 @subsection Nios II Options
18897 @cindex Nios II options
18898 @cindex Altera Nios II options
18900 These are the options defined for the Altera Nios II processor.
18902 @table @gcctabopt
18904 @item -G @var{num}
18905 @opindex G
18906 @cindex smaller data references
18907 Put global and static objects less than or equal to @var{num} bytes
18908 into the small data or BSS sections instead of the normal data or BSS
18909 sections.  The default value of @var{num} is 8.
18911 @item -mgpopt
18912 @itemx -mno-gpopt
18913 @opindex mgpopt
18914 @opindex mno-gpopt
18915 Generate (do not generate) GP-relative accesses for objects in the
18916 small data or BSS sections.  The default is @option{-mgpopt} except
18917 when @option{-fpic} or @option{-fPIC} is specified to generate
18918 position-independent code.  Note that the Nios II ABI does not permit
18919 GP-relative accesses from shared libraries.
18921 You may need to specify @option{-mno-gpopt} explicitly when building
18922 programs that include large amounts of small data, including large
18923 GOT data sections.  In this case, the 16-bit offset for GP-relative
18924 addressing may not be large enough to allow access to the entire 
18925 small data section.
18927 @item -mel
18928 @itemx -meb
18929 @opindex mel
18930 @opindex meb
18931 Generate little-endian (default) or big-endian (experimental) code,
18932 respectively.
18934 @item -mbypass-cache
18935 @itemx -mno-bypass-cache
18936 @opindex mno-bypass-cache
18937 @opindex mbypass-cache
18938 Force all load and store instructions to always bypass cache by 
18939 using I/O variants of the instructions. The default is not to
18940 bypass the cache.
18942 @item -mno-cache-volatile 
18943 @itemx -mcache-volatile       
18944 @opindex mcache-volatile 
18945 @opindex mno-cache-volatile
18946 Volatile memory access bypass the cache using the I/O variants of 
18947 the load and store instructions. The default is not to bypass the cache.
18949 @item -mno-fast-sw-div
18950 @itemx -mfast-sw-div
18951 @opindex mno-fast-sw-div
18952 @opindex mfast-sw-div
18953 Do not use table-based fast divide for small numbers. The default 
18954 is to use the fast divide at @option{-O3} and above.
18956 @item -mno-hw-mul
18957 @itemx -mhw-mul
18958 @itemx -mno-hw-mulx
18959 @itemx -mhw-mulx
18960 @itemx -mno-hw-div
18961 @itemx -mhw-div
18962 @opindex mno-hw-mul
18963 @opindex mhw-mul
18964 @opindex mno-hw-mulx
18965 @opindex mhw-mulx
18966 @opindex mno-hw-div
18967 @opindex mhw-div
18968 Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of 
18969 instructions by the compiler. The default is to emit @code{mul}
18970 and not emit @code{div} and @code{mulx}.
18972 @item -mcustom-@var{insn}=@var{N}
18973 @itemx -mno-custom-@var{insn}
18974 @opindex mcustom-@var{insn}
18975 @opindex mno-custom-@var{insn}
18976 Each @option{-mcustom-@var{insn}=@var{N}} option enables use of a
18977 custom instruction with encoding @var{N} when generating code that uses 
18978 @var{insn}.  For example, @code{-mcustom-fadds=253} generates custom
18979 instruction 253 for single-precision floating-point add operations instead
18980 of the default behavior of using a library call.
18982 The following values of @var{insn} are supported.  Except as otherwise
18983 noted, floating-point operations are expected to be implemented with
18984 normal IEEE 754 semantics and correspond directly to the C operators or the
18985 equivalent GCC built-in functions (@pxref{Other Builtins}).
18987 Single-precision floating point:
18988 @table @asis
18990 @item @samp{fadds}, @samp{fsubs}, @samp{fdivs}, @samp{fmuls}
18991 Binary arithmetic operations.
18993 @item @samp{fnegs}
18994 Unary negation.
18996 @item @samp{fabss}
18997 Unary absolute value.
18999 @item @samp{fcmpeqs}, @samp{fcmpges}, @samp{fcmpgts}, @samp{fcmples}, @samp{fcmplts}, @samp{fcmpnes}
19000 Comparison operations.
19002 @item @samp{fmins}, @samp{fmaxs}
19003 Floating-point minimum and maximum.  These instructions are only
19004 generated if @option{-ffinite-math-only} is specified.
19006 @item @samp{fsqrts}
19007 Unary square root operation.
19009 @item @samp{fcoss}, @samp{fsins}, @samp{ftans}, @samp{fatans}, @samp{fexps}, @samp{flogs}
19010 Floating-point trigonometric and exponential functions.  These instructions
19011 are only generated if @option{-funsafe-math-optimizations} is also specified.
19013 @end table
19015 Double-precision floating point:
19016 @table @asis
19018 @item @samp{faddd}, @samp{fsubd}, @samp{fdivd}, @samp{fmuld}
19019 Binary arithmetic operations.
19021 @item @samp{fnegd}
19022 Unary negation.
19024 @item @samp{fabsd}
19025 Unary absolute value.
19027 @item @samp{fcmpeqd}, @samp{fcmpged}, @samp{fcmpgtd}, @samp{fcmpled}, @samp{fcmpltd}, @samp{fcmpned}
19028 Comparison operations.
19030 @item @samp{fmind}, @samp{fmaxd}
19031 Double-precision minimum and maximum.  These instructions are only
19032 generated if @option{-ffinite-math-only} is specified.
19034 @item @samp{fsqrtd}
19035 Unary square root operation.
19037 @item @samp{fcosd}, @samp{fsind}, @samp{ftand}, @samp{fatand}, @samp{fexpd}, @samp{flogd}
19038 Double-precision trigonometric and exponential functions.  These instructions
19039 are only generated if @option{-funsafe-math-optimizations} is also specified.
19041 @end table
19043 Conversions:
19044 @table @asis
19045 @item @samp{fextsd}
19046 Conversion from single precision to double precision.
19048 @item @samp{ftruncds}
19049 Conversion from double precision to single precision.
19051 @item @samp{fixsi}, @samp{fixsu}, @samp{fixdi}, @samp{fixdu}
19052 Conversion from floating point to signed or unsigned integer types, with
19053 truncation towards zero.
19055 @item @samp{round}
19056 Conversion from single-precision floating point to signed integer,
19057 rounding to the nearest integer and ties away from zero.
19058 This corresponds to the @code{__builtin_lroundf} function when
19059 @option{-fno-math-errno} is used.
19061 @item @samp{floatis}, @samp{floatus}, @samp{floatid}, @samp{floatud}
19062 Conversion from signed or unsigned integer types to floating-point types.
19064 @end table
19066 In addition, all of the following transfer instructions for internal
19067 registers X and Y must be provided to use any of the double-precision
19068 floating-point instructions.  Custom instructions taking two
19069 double-precision source operands expect the first operand in the
19070 64-bit register X.  The other operand (or only operand of a unary
19071 operation) is given to the custom arithmetic instruction with the
19072 least significant half in source register @var{src1} and the most
19073 significant half in @var{src2}.  A custom instruction that returns a
19074 double-precision result returns the most significant 32 bits in the
19075 destination register and the other half in 32-bit register Y.  
19076 GCC automatically generates the necessary code sequences to write
19077 register X and/or read register Y when double-precision floating-point
19078 instructions are used.
19080 @table @asis
19082 @item @samp{fwrx}
19083 Write @var{src1} into the least significant half of X and @var{src2} into
19084 the most significant half of X.
19086 @item @samp{fwry}
19087 Write @var{src1} into Y.
19089 @item @samp{frdxhi}, @samp{frdxlo}
19090 Read the most or least (respectively) significant half of X and store it in
19091 @var{dest}.
19093 @item @samp{frdy}
19094 Read the value of Y and store it into @var{dest}.
19095 @end table
19097 Note that you can gain more local control over generation of Nios II custom
19098 instructions by using the @code{target("custom-@var{insn}=@var{N}")}
19099 and @code{target("no-custom-@var{insn}")} function attributes
19100 (@pxref{Function Attributes})
19101 or pragmas (@pxref{Function Specific Option Pragmas}).
19103 @item -mcustom-fpu-cfg=@var{name}
19104 @opindex mcustom-fpu-cfg
19106 This option enables a predefined, named set of custom instruction encodings
19107 (see @option{-mcustom-@var{insn}} above).  
19108 Currently, the following sets are defined:
19110 @option{-mcustom-fpu-cfg=60-1} is equivalent to:
19111 @gccoptlist{-mcustom-fmuls=252 @gol
19112 -mcustom-fadds=253 @gol
19113 -mcustom-fsubs=254 @gol
19114 -fsingle-precision-constant}
19116 @option{-mcustom-fpu-cfg=60-2} is equivalent to:
19117 @gccoptlist{-mcustom-fmuls=252 @gol
19118 -mcustom-fadds=253 @gol
19119 -mcustom-fsubs=254 @gol
19120 -mcustom-fdivs=255 @gol
19121 -fsingle-precision-constant}
19123 @option{-mcustom-fpu-cfg=72-3} is equivalent to:
19124 @gccoptlist{-mcustom-floatus=243 @gol
19125 -mcustom-fixsi=244 @gol
19126 -mcustom-floatis=245 @gol
19127 -mcustom-fcmpgts=246 @gol
19128 -mcustom-fcmples=249 @gol
19129 -mcustom-fcmpeqs=250 @gol
19130 -mcustom-fcmpnes=251 @gol
19131 -mcustom-fmuls=252 @gol
19132 -mcustom-fadds=253 @gol
19133 -mcustom-fsubs=254 @gol
19134 -mcustom-fdivs=255 @gol
19135 -fsingle-precision-constant}
19137 Custom instruction assignments given by individual
19138 @option{-mcustom-@var{insn}=} options override those given by
19139 @option{-mcustom-fpu-cfg=}, regardless of the
19140 order of the options on the command line.
19142 Note that you can gain more local control over selection of a FPU
19143 configuration by using the @code{target("custom-fpu-cfg=@var{name}")}
19144 function attribute (@pxref{Function Attributes})
19145 or pragma (@pxref{Function Specific Option Pragmas}).
19147 @end table
19149 These additional @samp{-m} options are available for the Altera Nios II
19150 ELF (bare-metal) target:
19152 @table @gcctabopt
19154 @item -mhal
19155 @opindex mhal
19156 Link with HAL BSP.  This suppresses linking with the GCC-provided C runtime
19157 startup and termination code, and is typically used in conjunction with
19158 @option{-msys-crt0=} to specify the location of the alternate startup code
19159 provided by the HAL BSP.
19161 @item -msmallc
19162 @opindex msmallc
19163 Link with a limited version of the C library, @option{-lsmallc}, rather than
19164 Newlib.
19166 @item -msys-crt0=@var{startfile}
19167 @opindex msys-crt0
19168 @var{startfile} is the file name of the startfile (crt0) to use 
19169 when linking.  This option is only useful in conjunction with @option{-mhal}.
19171 @item -msys-lib=@var{systemlib}
19172 @opindex msys-lib
19173 @var{systemlib} is the library name of the library that provides
19174 low-level system calls required by the C library,
19175 e.g. @code{read} and @code{write}.
19176 This option is typically used to link with a library provided by a HAL BSP.
19178 @end table
19180 @node PDP-11 Options
19181 @subsection PDP-11 Options
19182 @cindex PDP-11 Options
19184 These options are defined for the PDP-11:
19186 @table @gcctabopt
19187 @item -mfpu
19188 @opindex mfpu
19189 Use hardware FPP floating point.  This is the default.  (FIS floating
19190 point on the PDP-11/40 is not supported.)
19192 @item -msoft-float
19193 @opindex msoft-float
19194 Do not use hardware floating point.
19196 @item -mac0
19197 @opindex mac0
19198 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
19200 @item -mno-ac0
19201 @opindex mno-ac0
19202 Return floating-point results in memory.  This is the default.
19204 @item -m40
19205 @opindex m40
19206 Generate code for a PDP-11/40.
19208 @item -m45
19209 @opindex m45
19210 Generate code for a PDP-11/45.  This is the default.
19212 @item -m10
19213 @opindex m10
19214 Generate code for a PDP-11/10.
19216 @item -mbcopy-builtin
19217 @opindex mbcopy-builtin
19218 Use inline @code{movmemhi} patterns for copying memory.  This is the
19219 default.
19221 @item -mbcopy
19222 @opindex mbcopy
19223 Do not use inline @code{movmemhi} patterns for copying memory.
19225 @item -mint16
19226 @itemx -mno-int32
19227 @opindex mint16
19228 @opindex mno-int32
19229 Use 16-bit @code{int}.  This is the default.
19231 @item -mint32
19232 @itemx -mno-int16
19233 @opindex mint32
19234 @opindex mno-int16
19235 Use 32-bit @code{int}.
19237 @item -mfloat64
19238 @itemx -mno-float32
19239 @opindex mfloat64
19240 @opindex mno-float32
19241 Use 64-bit @code{float}.  This is the default.
19243 @item -mfloat32
19244 @itemx -mno-float64
19245 @opindex mfloat32
19246 @opindex mno-float64
19247 Use 32-bit @code{float}.
19249 @item -mabshi
19250 @opindex mabshi
19251 Use @code{abshi2} pattern.  This is the default.
19253 @item -mno-abshi
19254 @opindex mno-abshi
19255 Do not use @code{abshi2} pattern.
19257 @item -mbranch-expensive
19258 @opindex mbranch-expensive
19259 Pretend that branches are expensive.  This is for experimenting with
19260 code generation only.
19262 @item -mbranch-cheap
19263 @opindex mbranch-cheap
19264 Do not pretend that branches are expensive.  This is the default.
19266 @item -munix-asm
19267 @opindex munix-asm
19268 Use Unix assembler syntax.  This is the default when configured for
19269 @samp{pdp11-*-bsd}.
19271 @item -mdec-asm
19272 @opindex mdec-asm
19273 Use DEC assembler syntax.  This is the default when configured for any
19274 PDP-11 target other than @samp{pdp11-*-bsd}.
19275 @end table
19277 @node picoChip Options
19278 @subsection picoChip Options
19279 @cindex picoChip options
19281 These @samp{-m} options are defined for picoChip implementations:
19283 @table @gcctabopt
19285 @item -mae=@var{ae_type}
19286 @opindex mcpu
19287 Set the instruction set, register set, and instruction scheduling
19288 parameters for array element type @var{ae_type}.  Supported values
19289 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
19291 @option{-mae=ANY} selects a completely generic AE type.  Code
19292 generated with this option runs on any of the other AE types.  The
19293 code is not as efficient as it would be if compiled for a specific
19294 AE type, and some types of operation (e.g., multiplication) do not
19295 work properly on all types of AE.
19297 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
19298 for compiled code, and is the default.
19300 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
19301 option may suffer from poor performance of byte (char) manipulation,
19302 since the DSP AE does not provide hardware support for byte load/stores.
19304 @item -msymbol-as-address
19305 Enable the compiler to directly use a symbol name as an address in a
19306 load/store instruction, without first loading it into a
19307 register.  Typically, the use of this option generates larger
19308 programs, which run faster than when the option isn't used.  However, the
19309 results vary from program to program, so it is left as a user option,
19310 rather than being permanently enabled.
19312 @item -mno-inefficient-warnings
19313 Disables warnings about the generation of inefficient code.  These
19314 warnings can be generated, for example, when compiling code that
19315 performs byte-level memory operations on the MAC AE type.  The MAC AE has
19316 no hardware support for byte-level memory operations, so all byte
19317 load/stores must be synthesized from word load/store operations.  This is
19318 inefficient and a warning is generated to indicate
19319 that you should rewrite the code to avoid byte operations, or to target
19320 an AE type that has the necessary hardware support.  This option disables
19321 these warnings.
19323 @end table
19325 @node PowerPC Options
19326 @subsection PowerPC Options
19327 @cindex PowerPC options
19329 These are listed under @xref{RS/6000 and PowerPC Options}.
19331 @node RL78 Options
19332 @subsection RL78 Options
19333 @cindex RL78 Options
19335 @table @gcctabopt
19337 @item -msim
19338 @opindex msim
19339 Links in additional target libraries to support operation within a
19340 simulator.
19342 @item -mmul=none
19343 @itemx -mmul=g13
19344 @itemx -mmul=rl78
19345 @opindex mmul
19346 Specifies the type of hardware multiplication support to be used.  The
19347 default is @code{none}, which uses software multiplication functions.
19348 The @code{g13} option is for the hardware multiply/divide peripheral
19349 only on the RL78/G13 targets.  The @code{rl78} option is for the
19350 standard hardware multiplication defined in the RL78 software manual.
19352 @item -m64bit-doubles
19353 @itemx -m32bit-doubles
19354 @opindex m64bit-doubles
19355 @opindex m32bit-doubles
19356 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
19357 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
19358 @option{-m32bit-doubles}.
19360 @end table
19362 @node RS/6000 and PowerPC Options
19363 @subsection IBM RS/6000 and PowerPC Options
19364 @cindex RS/6000 and PowerPC Options
19365 @cindex IBM RS/6000 and PowerPC Options
19367 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
19368 @table @gcctabopt
19369 @item -mpowerpc-gpopt
19370 @itemx -mno-powerpc-gpopt
19371 @itemx -mpowerpc-gfxopt
19372 @itemx -mno-powerpc-gfxopt
19373 @need 800
19374 @itemx -mpowerpc64
19375 @itemx -mno-powerpc64
19376 @itemx -mmfcrf
19377 @itemx -mno-mfcrf
19378 @itemx -mpopcntb
19379 @itemx -mno-popcntb
19380 @itemx -mpopcntd
19381 @itemx -mno-popcntd
19382 @itemx -mfprnd
19383 @itemx -mno-fprnd
19384 @need 800
19385 @itemx -mcmpb
19386 @itemx -mno-cmpb
19387 @itemx -mmfpgpr
19388 @itemx -mno-mfpgpr
19389 @itemx -mhard-dfp
19390 @itemx -mno-hard-dfp
19391 @opindex mpowerpc-gpopt
19392 @opindex mno-powerpc-gpopt
19393 @opindex mpowerpc-gfxopt
19394 @opindex mno-powerpc-gfxopt
19395 @opindex mpowerpc64
19396 @opindex mno-powerpc64
19397 @opindex mmfcrf
19398 @opindex mno-mfcrf
19399 @opindex mpopcntb
19400 @opindex mno-popcntb
19401 @opindex mpopcntd
19402 @opindex mno-popcntd
19403 @opindex mfprnd
19404 @opindex mno-fprnd
19405 @opindex mcmpb
19406 @opindex mno-cmpb
19407 @opindex mmfpgpr
19408 @opindex mno-mfpgpr
19409 @opindex mhard-dfp
19410 @opindex mno-hard-dfp
19411 You use these options to specify which instructions are available on the
19412 processor you are using.  The default value of these options is
19413 determined when configuring GCC@.  Specifying the
19414 @option{-mcpu=@var{cpu_type}} overrides the specification of these
19415 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
19416 rather than the options listed above.
19418 Specifying @option{-mpowerpc-gpopt} allows
19419 GCC to use the optional PowerPC architecture instructions in the
19420 General Purpose group, including floating-point square root.  Specifying
19421 @option{-mpowerpc-gfxopt} allows GCC to
19422 use the optional PowerPC architecture instructions in the Graphics
19423 group, including floating-point select.
19425 The @option{-mmfcrf} option allows GCC to generate the move from
19426 condition register field instruction implemented on the POWER4
19427 processor and other processors that support the PowerPC V2.01
19428 architecture.
19429 The @option{-mpopcntb} option allows GCC to generate the popcount and
19430 double-precision FP reciprocal estimate instruction implemented on the
19431 POWER5 processor and other processors that support the PowerPC V2.02
19432 architecture.
19433 The @option{-mpopcntd} option allows GCC to generate the popcount
19434 instruction implemented on the POWER7 processor and other processors
19435 that support the PowerPC V2.06 architecture.
19436 The @option{-mfprnd} option allows GCC to generate the FP round to
19437 integer instructions implemented on the POWER5+ processor and other
19438 processors that support the PowerPC V2.03 architecture.
19439 The @option{-mcmpb} option allows GCC to generate the compare bytes
19440 instruction implemented on the POWER6 processor and other processors
19441 that support the PowerPC V2.05 architecture.
19442 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
19443 general-purpose register instructions implemented on the POWER6X
19444 processor and other processors that support the extended PowerPC V2.05
19445 architecture.
19446 The @option{-mhard-dfp} option allows GCC to generate the decimal
19447 floating-point instructions implemented on some POWER processors.
19449 The @option{-mpowerpc64} option allows GCC to generate the additional
19450 64-bit instructions that are found in the full PowerPC64 architecture
19451 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
19452 @option{-mno-powerpc64}.
19454 @item -mcpu=@var{cpu_type}
19455 @opindex mcpu
19456 Set architecture type, register usage, and
19457 instruction scheduling parameters for machine type @var{cpu_type}.
19458 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
19459 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
19460 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
19461 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
19462 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
19463 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
19464 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
19465 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
19466 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
19467 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8}, @samp{powerpc},
19468 @samp{powerpc64}, and @samp{rs64}.
19470 @option{-mcpu=powerpc}, and @option{-mcpu=powerpc64} specify pure 32-bit
19471 PowerPC and 64-bit PowerPC architecture machine
19472 types, with an appropriate, generic processor model assumed for
19473 scheduling purposes.
19475 The other options specify a specific processor.  Code generated under
19476 those options runs best on that processor, and may not run at all on
19477 others.
19479 The @option{-mcpu} options automatically enable or disable the
19480 following options:
19482 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
19483 -mpopcntb -mpopcntd  -mpowerpc64 @gol
19484 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
19485 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
19486 -mcrypto -mdirect-move -mpower8-fusion -mpower8-vector @gol
19487 -mquad-memory -mquad-memory-atomic}
19489 The particular options set for any particular CPU varies between
19490 compiler versions, depending on what setting seems to produce optimal
19491 code for that CPU; it doesn't necessarily reflect the actual hardware's
19492 capabilities.  If you wish to set an individual option to a particular
19493 value, you may specify it after the @option{-mcpu} option, like
19494 @option{-mcpu=970 -mno-altivec}.
19496 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
19497 not enabled or disabled by the @option{-mcpu} option at present because
19498 AIX does not have full support for these options.  You may still
19499 enable or disable them individually if you're sure it'll work in your
19500 environment.
19502 @item -mtune=@var{cpu_type}
19503 @opindex mtune
19504 Set the instruction scheduling parameters for machine type
19505 @var{cpu_type}, but do not set the architecture type or register usage,
19506 as @option{-mcpu=@var{cpu_type}} does.  The same
19507 values for @var{cpu_type} are used for @option{-mtune} as for
19508 @option{-mcpu}.  If both are specified, the code generated uses the
19509 architecture and registers set by @option{-mcpu}, but the
19510 scheduling parameters set by @option{-mtune}.
19512 @item -mcmodel=small
19513 @opindex mcmodel=small
19514 Generate PowerPC64 code for the small model: The TOC is limited to
19515 64k.
19517 @item -mcmodel=medium
19518 @opindex mcmodel=medium
19519 Generate PowerPC64 code for the medium model: The TOC and other static
19520 data may be up to a total of 4G in size.
19522 @item -mcmodel=large
19523 @opindex mcmodel=large
19524 Generate PowerPC64 code for the large model: The TOC may be up to 4G
19525 in size.  Other data and code is only limited by the 64-bit address
19526 space.
19528 @item -maltivec
19529 @itemx -mno-altivec
19530 @opindex maltivec
19531 @opindex mno-altivec
19532 Generate code that uses (does not use) AltiVec instructions, and also
19533 enable the use of built-in functions that allow more direct access to
19534 the AltiVec instruction set.  You may also need to set
19535 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
19536 enhancements.
19538 When @option{-maltivec} is used, rather than @option{-maltivec=le} or
19539 @option{-maltivec=be}, the element order for Altivec intrinsics such
19540 as @code{vec_splat}, @code{vec_extract}, and @code{vec_insert} will
19541 match array element order corresponding to the endianness of the
19542 target.  That is, element zero identifies the leftmost element in a
19543 vector register when targeting a big-endian platform, and identifies
19544 the rightmost element in a vector register when targeting a
19545 little-endian platform.
19547 @item -maltivec=be
19548 @opindex maltivec=be
19549 Generate Altivec instructions using big-endian element order,
19550 regardless of whether the target is big- or little-endian.  This is
19551 the default when targeting a big-endian platform.
19553 The element order is used to interpret element numbers in Altivec
19554 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
19555 @code{vec_insert}.  By default, these will match array element order
19556 corresponding to the endianness for the target.
19558 @item -maltivec=le
19559 @opindex maltivec=le
19560 Generate Altivec instructions using little-endian element order,
19561 regardless of whether the target is big- or little-endian.  This is
19562 the default when targeting a little-endian platform.  This option is
19563 currently ignored when targeting a big-endian platform.
19565 The element order is used to interpret element numbers in Altivec
19566 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
19567 @code{vec_insert}.  By default, these will match array element order
19568 corresponding to the endianness for the target.
19570 @item -mvrsave
19571 @itemx -mno-vrsave
19572 @opindex mvrsave
19573 @opindex mno-vrsave
19574 Generate VRSAVE instructions when generating AltiVec code.
19576 @item -mgen-cell-microcode
19577 @opindex mgen-cell-microcode
19578 Generate Cell microcode instructions.
19580 @item -mwarn-cell-microcode
19581 @opindex mwarn-cell-microcode
19582 Warn when a Cell microcode instruction is emitted.  An example
19583 of a Cell microcode instruction is a variable shift.
19585 @item -msecure-plt
19586 @opindex msecure-plt
19587 Generate code that allows @command{ld} and @command{ld.so}
19588 to build executables and shared
19589 libraries with non-executable @code{.plt} and @code{.got} sections.
19590 This is a PowerPC
19591 32-bit SYSV ABI option.
19593 @item -mbss-plt
19594 @opindex mbss-plt
19595 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
19596 fills in, and
19597 requires @code{.plt} and @code{.got}
19598 sections that are both writable and executable.
19599 This is a PowerPC 32-bit SYSV ABI option.
19601 @item -misel
19602 @itemx -mno-isel
19603 @opindex misel
19604 @opindex mno-isel
19605 This switch enables or disables the generation of ISEL instructions.
19607 @item -misel=@var{yes/no}
19608 This switch has been deprecated.  Use @option{-misel} and
19609 @option{-mno-isel} instead.
19611 @item -mspe
19612 @itemx -mno-spe
19613 @opindex mspe
19614 @opindex mno-spe
19615 This switch enables or disables the generation of SPE simd
19616 instructions.
19618 @item -mpaired
19619 @itemx -mno-paired
19620 @opindex mpaired
19621 @opindex mno-paired
19622 This switch enables or disables the generation of PAIRED simd
19623 instructions.
19625 @item -mspe=@var{yes/no}
19626 This option has been deprecated.  Use @option{-mspe} and
19627 @option{-mno-spe} instead.
19629 @item -mvsx
19630 @itemx -mno-vsx
19631 @opindex mvsx
19632 @opindex mno-vsx
19633 Generate code that uses (does not use) vector/scalar (VSX)
19634 instructions, and also enable the use of built-in functions that allow
19635 more direct access to the VSX instruction set.
19637 @item -mcrypto
19638 @itemx -mno-crypto
19639 @opindex mcrypto
19640 @opindex mno-crypto
19641 Enable the use (disable) of the built-in functions that allow direct
19642 access to the cryptographic instructions that were added in version
19643 2.07 of the PowerPC ISA.
19645 @item -mdirect-move
19646 @itemx -mno-direct-move
19647 @opindex mdirect-move
19648 @opindex mno-direct-move
19649 Generate code that uses (does not use) the instructions to move data
19650 between the general purpose registers and the vector/scalar (VSX)
19651 registers that were added in version 2.07 of the PowerPC ISA.
19653 @item -mpower8-fusion
19654 @itemx -mno-power8-fusion
19655 @opindex mpower8-fusion
19656 @opindex mno-power8-fusion
19657 Generate code that keeps (does not keeps) some integer operations
19658 adjacent so that the instructions can be fused together on power8 and
19659 later processors.
19661 @item -mpower8-vector
19662 @itemx -mno-power8-vector
19663 @opindex mpower8-vector
19664 @opindex mno-power8-vector
19665 Generate code that uses (does not use) the vector and scalar
19666 instructions that were added in version 2.07 of the PowerPC ISA.  Also
19667 enable the use of built-in functions that allow more direct access to
19668 the vector instructions.
19670 @item -mquad-memory
19671 @itemx -mno-quad-memory
19672 @opindex mquad-memory
19673 @opindex mno-quad-memory
19674 Generate code that uses (does not use) the non-atomic quad word memory
19675 instructions.  The @option{-mquad-memory} option requires use of
19676 64-bit mode.
19678 @item -mquad-memory-atomic
19679 @itemx -mno-quad-memory-atomic
19680 @opindex mquad-memory-atomic
19681 @opindex mno-quad-memory-atomic
19682 Generate code that uses (does not use) the atomic quad word memory
19683 instructions.  The @option{-mquad-memory-atomic} option requires use of
19684 64-bit mode.
19686 @item -mfloat-gprs=@var{yes/single/double/no}
19687 @itemx -mfloat-gprs
19688 @opindex mfloat-gprs
19689 This switch enables or disables the generation of floating-point
19690 operations on the general-purpose registers for architectures that
19691 support it.
19693 The argument @var{yes} or @var{single} enables the use of
19694 single-precision floating-point operations.
19696 The argument @var{double} enables the use of single and
19697 double-precision floating-point operations.
19699 The argument @var{no} disables floating-point operations on the
19700 general-purpose registers.
19702 This option is currently only available on the MPC854x.
19704 @item -m32
19705 @itemx -m64
19706 @opindex m32
19707 @opindex m64
19708 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
19709 targets (including GNU/Linux).  The 32-bit environment sets int, long
19710 and pointer to 32 bits and generates code that runs on any PowerPC
19711 variant.  The 64-bit environment sets int to 32 bits and long and
19712 pointer to 64 bits, and generates code for PowerPC64, as for
19713 @option{-mpowerpc64}.
19715 @item -mfull-toc
19716 @itemx -mno-fp-in-toc
19717 @itemx -mno-sum-in-toc
19718 @itemx -mminimal-toc
19719 @opindex mfull-toc
19720 @opindex mno-fp-in-toc
19721 @opindex mno-sum-in-toc
19722 @opindex mminimal-toc
19723 Modify generation of the TOC (Table Of Contents), which is created for
19724 every executable file.  The @option{-mfull-toc} option is selected by
19725 default.  In that case, GCC allocates at least one TOC entry for
19726 each unique non-automatic variable reference in your program.  GCC
19727 also places floating-point constants in the TOC@.  However, only
19728 16,384 entries are available in the TOC@.
19730 If you receive a linker error message that saying you have overflowed
19731 the available TOC space, you can reduce the amount of TOC space used
19732 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
19733 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
19734 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
19735 generate code to calculate the sum of an address and a constant at
19736 run time instead of putting that sum into the TOC@.  You may specify one
19737 or both of these options.  Each causes GCC to produce very slightly
19738 slower and larger code at the expense of conserving TOC space.
19740 If you still run out of space in the TOC even when you specify both of
19741 these options, specify @option{-mminimal-toc} instead.  This option causes
19742 GCC to make only one TOC entry for every file.  When you specify this
19743 option, GCC produces code that is slower and larger but which
19744 uses extremely little TOC space.  You may wish to use this option
19745 only on files that contain less frequently-executed code.
19747 @item -maix64
19748 @itemx -maix32
19749 @opindex maix64
19750 @opindex maix32
19751 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
19752 @code{long} type, and the infrastructure needed to support them.
19753 Specifying @option{-maix64} implies @option{-mpowerpc64},
19754 while @option{-maix32} disables the 64-bit ABI and
19755 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
19757 @item -mxl-compat
19758 @itemx -mno-xl-compat
19759 @opindex mxl-compat
19760 @opindex mno-xl-compat
19761 Produce code that conforms more closely to IBM XL compiler semantics
19762 when using AIX-compatible ABI@.  Pass floating-point arguments to
19763 prototyped functions beyond the register save area (RSA) on the stack
19764 in addition to argument FPRs.  Do not assume that most significant
19765 double in 128-bit long double value is properly rounded when comparing
19766 values and converting to double.  Use XL symbol names for long double
19767 support routines.
19769 The AIX calling convention was extended but not initially documented to
19770 handle an obscure K&R C case of calling a function that takes the
19771 address of its arguments with fewer arguments than declared.  IBM XL
19772 compilers access floating-point arguments that do not fit in the
19773 RSA from the stack when a subroutine is compiled without
19774 optimization.  Because always storing floating-point arguments on the
19775 stack is inefficient and rarely needed, this option is not enabled by
19776 default and only is necessary when calling subroutines compiled by IBM
19777 XL compilers without optimization.
19779 @item -mpe
19780 @opindex mpe
19781 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
19782 application written to use message passing with special startup code to
19783 enable the application to run.  The system must have PE installed in the
19784 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
19785 must be overridden with the @option{-specs=} option to specify the
19786 appropriate directory location.  The Parallel Environment does not
19787 support threads, so the @option{-mpe} option and the @option{-pthread}
19788 option are incompatible.
19790 @item -malign-natural
19791 @itemx -malign-power
19792 @opindex malign-natural
19793 @opindex malign-power
19794 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
19795 @option{-malign-natural} overrides the ABI-defined alignment of larger
19796 types, such as floating-point doubles, on their natural size-based boundary.
19797 The option @option{-malign-power} instructs GCC to follow the ABI-specified
19798 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
19800 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
19801 is not supported.
19803 @item -msoft-float
19804 @itemx -mhard-float
19805 @opindex msoft-float
19806 @opindex mhard-float
19807 Generate code that does not use (uses) the floating-point register set.
19808 Software floating-point emulation is provided if you use the
19809 @option{-msoft-float} option, and pass the option to GCC when linking.
19811 @item -msingle-float
19812 @itemx -mdouble-float
19813 @opindex msingle-float
19814 @opindex mdouble-float
19815 Generate code for single- or double-precision floating-point operations.
19816 @option{-mdouble-float} implies @option{-msingle-float}.
19818 @item -msimple-fpu
19819 @opindex msimple-fpu
19820 Do not generate @code{sqrt} and @code{div} instructions for hardware
19821 floating-point unit.
19823 @item -mfpu=@var{name}
19824 @opindex mfpu
19825 Specify type of floating-point unit.  Valid values for @var{name} are
19826 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
19827 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
19828 @samp{sp_full} (equivalent to @option{-msingle-float}),
19829 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
19831 @item -mxilinx-fpu
19832 @opindex mxilinx-fpu
19833 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
19835 @item -mmultiple
19836 @itemx -mno-multiple
19837 @opindex mmultiple
19838 @opindex mno-multiple
19839 Generate code that uses (does not use) the load multiple word
19840 instructions and the store multiple word instructions.  These
19841 instructions are generated by default on POWER systems, and not
19842 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
19843 PowerPC systems, since those instructions do not work when the
19844 processor is in little-endian mode.  The exceptions are PPC740 and
19845 PPC750 which permit these instructions in little-endian mode.
19847 @item -mstring
19848 @itemx -mno-string
19849 @opindex mstring
19850 @opindex mno-string
19851 Generate code that uses (does not use) the load string instructions
19852 and the store string word instructions to save multiple registers and
19853 do small block moves.  These instructions are generated by default on
19854 POWER systems, and not generated on PowerPC systems.  Do not use
19855 @option{-mstring} on little-endian PowerPC systems, since those
19856 instructions do not work when the processor is in little-endian mode.
19857 The exceptions are PPC740 and PPC750 which permit these instructions
19858 in little-endian mode.
19860 @item -mupdate
19861 @itemx -mno-update
19862 @opindex mupdate
19863 @opindex mno-update
19864 Generate code that uses (does not use) the load or store instructions
19865 that update the base register to the address of the calculated memory
19866 location.  These instructions are generated by default.  If you use
19867 @option{-mno-update}, there is a small window between the time that the
19868 stack pointer is updated and the address of the previous frame is
19869 stored, which means code that walks the stack frame across interrupts or
19870 signals may get corrupted data.
19872 @item -mavoid-indexed-addresses
19873 @itemx -mno-avoid-indexed-addresses
19874 @opindex mavoid-indexed-addresses
19875 @opindex mno-avoid-indexed-addresses
19876 Generate code that tries to avoid (not avoid) the use of indexed load
19877 or store instructions. These instructions can incur a performance
19878 penalty on Power6 processors in certain situations, such as when
19879 stepping through large arrays that cross a 16M boundary.  This option
19880 is enabled by default when targeting Power6 and disabled otherwise.
19882 @item -mfused-madd
19883 @itemx -mno-fused-madd
19884 @opindex mfused-madd
19885 @opindex mno-fused-madd
19886 Generate code that uses (does not use) the floating-point multiply and
19887 accumulate instructions.  These instructions are generated by default
19888 if hardware floating point is used.  The machine-dependent
19889 @option{-mfused-madd} option is now mapped to the machine-independent
19890 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
19891 mapped to @option{-ffp-contract=off}.
19893 @item -mmulhw
19894 @itemx -mno-mulhw
19895 @opindex mmulhw
19896 @opindex mno-mulhw
19897 Generate code that uses (does not use) the half-word multiply and
19898 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
19899 These instructions are generated by default when targeting those
19900 processors.
19902 @item -mdlmzb
19903 @itemx -mno-dlmzb
19904 @opindex mdlmzb
19905 @opindex mno-dlmzb
19906 Generate code that uses (does not use) the string-search @samp{dlmzb}
19907 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
19908 generated by default when targeting those processors.
19910 @item -mno-bit-align
19911 @itemx -mbit-align
19912 @opindex mno-bit-align
19913 @opindex mbit-align
19914 On System V.4 and embedded PowerPC systems do not (do) force structures
19915 and unions that contain bit-fields to be aligned to the base type of the
19916 bit-field.
19918 For example, by default a structure containing nothing but 8
19919 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
19920 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
19921 the structure is aligned to a 1-byte boundary and is 1 byte in
19922 size.
19924 @item -mno-strict-align
19925 @itemx -mstrict-align
19926 @opindex mno-strict-align
19927 @opindex mstrict-align
19928 On System V.4 and embedded PowerPC systems do not (do) assume that
19929 unaligned memory references are handled by the system.
19931 @item -mrelocatable
19932 @itemx -mno-relocatable
19933 @opindex mrelocatable
19934 @opindex mno-relocatable
19935 Generate code that allows (does not allow) a static executable to be
19936 relocated to a different address at run time.  A simple embedded
19937 PowerPC system loader should relocate the entire contents of
19938 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
19939 a table of 32-bit addresses generated by this option.  For this to
19940 work, all objects linked together must be compiled with
19941 @option{-mrelocatable} or @option{-mrelocatable-lib}.
19942 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
19944 @item -mrelocatable-lib
19945 @itemx -mno-relocatable-lib
19946 @opindex mrelocatable-lib
19947 @opindex mno-relocatable-lib
19948 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
19949 @code{.fixup} section to allow static executables to be relocated at
19950 run time, but @option{-mrelocatable-lib} does not use the smaller stack
19951 alignment of @option{-mrelocatable}.  Objects compiled with
19952 @option{-mrelocatable-lib} may be linked with objects compiled with
19953 any combination of the @option{-mrelocatable} options.
19955 @item -mno-toc
19956 @itemx -mtoc
19957 @opindex mno-toc
19958 @opindex mtoc
19959 On System V.4 and embedded PowerPC systems do not (do) assume that
19960 register 2 contains a pointer to a global area pointing to the addresses
19961 used in the program.
19963 @item -mlittle
19964 @itemx -mlittle-endian
19965 @opindex mlittle
19966 @opindex mlittle-endian
19967 On System V.4 and embedded PowerPC systems compile code for the
19968 processor in little-endian mode.  The @option{-mlittle-endian} option is
19969 the same as @option{-mlittle}.
19971 @item -mbig
19972 @itemx -mbig-endian
19973 @opindex mbig
19974 @opindex mbig-endian
19975 On System V.4 and embedded PowerPC systems compile code for the
19976 processor in big-endian mode.  The @option{-mbig-endian} option is
19977 the same as @option{-mbig}.
19979 @item -mdynamic-no-pic
19980 @opindex mdynamic-no-pic
19981 On Darwin and Mac OS X systems, compile code so that it is not
19982 relocatable, but that its external references are relocatable.  The
19983 resulting code is suitable for applications, but not shared
19984 libraries.
19986 @item -msingle-pic-base
19987 @opindex msingle-pic-base
19988 Treat the register used for PIC addressing as read-only, rather than
19989 loading it in the prologue for each function.  The runtime system is
19990 responsible for initializing this register with an appropriate value
19991 before execution begins.
19993 @item -mprioritize-restricted-insns=@var{priority}
19994 @opindex mprioritize-restricted-insns
19995 This option controls the priority that is assigned to
19996 dispatch-slot restricted instructions during the second scheduling
19997 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
19998 or @samp{2} to assign no, highest, or second-highest (respectively) 
19999 priority to dispatch-slot restricted
20000 instructions.
20002 @item -msched-costly-dep=@var{dependence_type}
20003 @opindex msched-costly-dep
20004 This option controls which dependences are considered costly
20005 by the target during instruction scheduling.  The argument
20006 @var{dependence_type} takes one of the following values:
20008 @table @asis
20009 @item @samp{no}
20010 No dependence is costly.
20012 @item @samp{all}
20013 All dependences are costly.
20015 @item @samp{true_store_to_load}
20016 A true dependence from store to load is costly.
20018 @item @samp{store_to_load}
20019 Any dependence from store to load is costly.
20021 @item @var{number}
20022 Any dependence for which the latency is greater than or equal to 
20023 @var{number} is costly.
20024 @end table
20026 @item -minsert-sched-nops=@var{scheme}
20027 @opindex minsert-sched-nops
20028 This option controls which NOP insertion scheme is used during
20029 the second scheduling pass.  The argument @var{scheme} takes one of the
20030 following values:
20032 @table @asis
20033 @item @samp{no}
20034 Don't insert NOPs.
20036 @item @samp{pad}
20037 Pad with NOPs any dispatch group that has vacant issue slots,
20038 according to the scheduler's grouping.
20040 @item @samp{regroup_exact}
20041 Insert NOPs to force costly dependent insns into
20042 separate groups.  Insert exactly as many NOPs as needed to force an insn
20043 to a new group, according to the estimated processor grouping.
20045 @item @var{number}
20046 Insert NOPs to force costly dependent insns into
20047 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
20048 @end table
20050 @item -mcall-sysv
20051 @opindex mcall-sysv
20052 On System V.4 and embedded PowerPC systems compile code using calling
20053 conventions that adhere to the March 1995 draft of the System V
20054 Application Binary Interface, PowerPC processor supplement.  This is the
20055 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
20057 @item -mcall-sysv-eabi
20058 @itemx -mcall-eabi
20059 @opindex mcall-sysv-eabi
20060 @opindex mcall-eabi
20061 Specify both @option{-mcall-sysv} and @option{-meabi} options.
20063 @item -mcall-sysv-noeabi
20064 @opindex mcall-sysv-noeabi
20065 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
20067 @item -mcall-aixdesc
20068 @opindex m
20069 On System V.4 and embedded PowerPC systems compile code for the AIX
20070 operating system.
20072 @item -mcall-linux
20073 @opindex mcall-linux
20074 On System V.4 and embedded PowerPC systems compile code for the
20075 Linux-based GNU system.
20077 @item -mcall-freebsd
20078 @opindex mcall-freebsd
20079 On System V.4 and embedded PowerPC systems compile code for the
20080 FreeBSD operating system.
20082 @item -mcall-netbsd
20083 @opindex mcall-netbsd
20084 On System V.4 and embedded PowerPC systems compile code for the
20085 NetBSD operating system.
20087 @item -mcall-openbsd
20088 @opindex mcall-netbsd
20089 On System V.4 and embedded PowerPC systems compile code for the
20090 OpenBSD operating system.
20092 @item -maix-struct-return
20093 @opindex maix-struct-return
20094 Return all structures in memory (as specified by the AIX ABI)@.
20096 @item -msvr4-struct-return
20097 @opindex msvr4-struct-return
20098 Return structures smaller than 8 bytes in registers (as specified by the
20099 SVR4 ABI)@.
20101 @item -mabi=@var{abi-type}
20102 @opindex mabi
20103 Extend the current ABI with a particular extension, or remove such extension.
20104 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
20105 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble},
20106 @var{elfv1}, @var{elfv2}@.
20108 @item -mabi=spe
20109 @opindex mabi=spe
20110 Extend the current ABI with SPE ABI extensions.  This does not change
20111 the default ABI, instead it adds the SPE ABI extensions to the current
20112 ABI@.
20114 @item -mabi=no-spe
20115 @opindex mabi=no-spe
20116 Disable Book-E SPE ABI extensions for the current ABI@.
20118 @item -mabi=ibmlongdouble
20119 @opindex mabi=ibmlongdouble
20120 Change the current ABI to use IBM extended-precision long double.
20121 This is a PowerPC 32-bit SYSV ABI option.
20123 @item -mabi=ieeelongdouble
20124 @opindex mabi=ieeelongdouble
20125 Change the current ABI to use IEEE extended-precision long double.
20126 This is a PowerPC 32-bit Linux ABI option.
20128 @item -mabi=elfv1
20129 @opindex mabi=elfv1
20130 Change the current ABI to use the ELFv1 ABI.
20131 This is the default ABI for big-endian PowerPC 64-bit Linux.
20132 Overriding the default ABI requires special system support and is
20133 likely to fail in spectacular ways.
20135 @item -mabi=elfv2
20136 @opindex mabi=elfv2
20137 Change the current ABI to use the ELFv2 ABI.
20138 This is the default ABI for little-endian PowerPC 64-bit Linux.
20139 Overriding the default ABI requires special system support and is
20140 likely to fail in spectacular ways.
20142 @item -mprototype
20143 @itemx -mno-prototype
20144 @opindex mprototype
20145 @opindex mno-prototype
20146 On System V.4 and embedded PowerPC systems assume that all calls to
20147 variable argument functions are properly prototyped.  Otherwise, the
20148 compiler must insert an instruction before every non-prototyped call to
20149 set or clear bit 6 of the condition code register (@var{CR}) to
20150 indicate whether floating-point values are passed in the floating-point
20151 registers in case the function takes variable arguments.  With
20152 @option{-mprototype}, only calls to prototyped variable argument functions
20153 set or clear the bit.
20155 @item -msim
20156 @opindex msim
20157 On embedded PowerPC systems, assume that the startup module is called
20158 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
20159 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
20160 configurations.
20162 @item -mmvme
20163 @opindex mmvme
20164 On embedded PowerPC systems, assume that the startup module is called
20165 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
20166 @file{libc.a}.
20168 @item -mads
20169 @opindex mads
20170 On embedded PowerPC systems, assume that the startup module is called
20171 @file{crt0.o} and the standard C libraries are @file{libads.a} and
20172 @file{libc.a}.
20174 @item -myellowknife
20175 @opindex myellowknife
20176 On embedded PowerPC systems, assume that the startup module is called
20177 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
20178 @file{libc.a}.
20180 @item -mvxworks
20181 @opindex mvxworks
20182 On System V.4 and embedded PowerPC systems, specify that you are
20183 compiling for a VxWorks system.
20185 @item -memb
20186 @opindex memb
20187 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
20188 header to indicate that @samp{eabi} extended relocations are used.
20190 @item -meabi
20191 @itemx -mno-eabi
20192 @opindex meabi
20193 @opindex mno-eabi
20194 On System V.4 and embedded PowerPC systems do (do not) adhere to the
20195 Embedded Applications Binary Interface (EABI), which is a set of
20196 modifications to the System V.4 specifications.  Selecting @option{-meabi}
20197 means that the stack is aligned to an 8-byte boundary, a function
20198 @code{__eabi} is called from @code{main} to set up the EABI
20199 environment, and the @option{-msdata} option can use both @code{r2} and
20200 @code{r13} to point to two separate small data areas.  Selecting
20201 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
20202 no EABI initialization function is called from @code{main}, and the
20203 @option{-msdata} option only uses @code{r13} to point to a single
20204 small data area.  The @option{-meabi} option is on by default if you
20205 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
20207 @item -msdata=eabi
20208 @opindex msdata=eabi
20209 On System V.4 and embedded PowerPC systems, put small initialized
20210 @code{const} global and static data in the @samp{.sdata2} section, which
20211 is pointed to by register @code{r2}.  Put small initialized
20212 non-@code{const} global and static data in the @samp{.sdata} section,
20213 which is pointed to by register @code{r13}.  Put small uninitialized
20214 global and static data in the @samp{.sbss} section, which is adjacent to
20215 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
20216 incompatible with the @option{-mrelocatable} option.  The
20217 @option{-msdata=eabi} option also sets the @option{-memb} option.
20219 @item -msdata=sysv
20220 @opindex msdata=sysv
20221 On System V.4 and embedded PowerPC systems, put small global and static
20222 data in the @samp{.sdata} section, which is pointed to by register
20223 @code{r13}.  Put small uninitialized global and static data in the
20224 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
20225 The @option{-msdata=sysv} option is incompatible with the
20226 @option{-mrelocatable} option.
20228 @item -msdata=default
20229 @itemx -msdata
20230 @opindex msdata=default
20231 @opindex msdata
20232 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
20233 compile code the same as @option{-msdata=eabi}, otherwise compile code the
20234 same as @option{-msdata=sysv}.
20236 @item -msdata=data
20237 @opindex msdata=data
20238 On System V.4 and embedded PowerPC systems, put small global
20239 data in the @samp{.sdata} section.  Put small uninitialized global
20240 data in the @samp{.sbss} section.  Do not use register @code{r13}
20241 to address small data however.  This is the default behavior unless
20242 other @option{-msdata} options are used.
20244 @item -msdata=none
20245 @itemx -mno-sdata
20246 @opindex msdata=none
20247 @opindex mno-sdata
20248 On embedded PowerPC systems, put all initialized global and static data
20249 in the @samp{.data} section, and all uninitialized data in the
20250 @samp{.bss} section.
20252 @item -mblock-move-inline-limit=@var{num}
20253 @opindex mblock-move-inline-limit
20254 Inline all block moves (such as calls to @code{memcpy} or structure
20255 copies) less than or equal to @var{num} bytes.  The minimum value for
20256 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
20257 targets.  The default value is target-specific.
20259 @item -G @var{num}
20260 @opindex G
20261 @cindex smaller data references (PowerPC)
20262 @cindex .sdata/.sdata2 references (PowerPC)
20263 On embedded PowerPC systems, put global and static items less than or
20264 equal to @var{num} bytes into the small data or BSS sections instead of
20265 the normal data or BSS section.  By default, @var{num} is 8.  The
20266 @option{-G @var{num}} switch is also passed to the linker.
20267 All modules should be compiled with the same @option{-G @var{num}} value.
20269 @item -mregnames
20270 @itemx -mno-regnames
20271 @opindex mregnames
20272 @opindex mno-regnames
20273 On System V.4 and embedded PowerPC systems do (do not) emit register
20274 names in the assembly language output using symbolic forms.
20276 @item -mlongcall
20277 @itemx -mno-longcall
20278 @opindex mlongcall
20279 @opindex mno-longcall
20280 By default assume that all calls are far away so that a longer and more
20281 expensive calling sequence is required.  This is required for calls
20282 farther than 32 megabytes (33,554,432 bytes) from the current location.
20283 A short call is generated if the compiler knows
20284 the call cannot be that far away.  This setting can be overridden by
20285 the @code{shortcall} function attribute, or by @code{#pragma
20286 longcall(0)}.
20288 Some linkers are capable of detecting out-of-range calls and generating
20289 glue code on the fly.  On these systems, long calls are unnecessary and
20290 generate slower code.  As of this writing, the AIX linker can do this,
20291 as can the GNU linker for PowerPC/64.  It is planned to add this feature
20292 to the GNU linker for 32-bit PowerPC systems as well.
20294 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
20295 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
20296 addresses represent the callee and the branch island.  The
20297 Darwin/PPC linker prefers the first address and generates a @code{bl
20298 callee} if the PPC @code{bl} instruction reaches the callee directly;
20299 otherwise, the linker generates @code{bl L42} to call the branch
20300 island.  The branch island is appended to the body of the
20301 calling function; it computes the full 32-bit address of the callee
20302 and jumps to it.
20304 On Mach-O (Darwin) systems, this option directs the compiler emit to
20305 the glue for every direct call, and the Darwin linker decides whether
20306 to use or discard it.
20308 In the future, GCC may ignore all longcall specifications
20309 when the linker is known to generate glue.
20311 @item -mtls-markers
20312 @itemx -mno-tls-markers
20313 @opindex mtls-markers
20314 @opindex mno-tls-markers
20315 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
20316 specifying the function argument.  The relocation allows the linker to
20317 reliably associate function call with argument setup instructions for
20318 TLS optimization, which in turn allows GCC to better schedule the
20319 sequence.
20321 @item -pthread
20322 @opindex pthread
20323 Adds support for multithreading with the @dfn{pthreads} library.
20324 This option sets flags for both the preprocessor and linker.
20326 @item -mrecip
20327 @itemx -mno-recip
20328 @opindex mrecip
20329 This option enables use of the reciprocal estimate and
20330 reciprocal square root estimate instructions with additional
20331 Newton-Raphson steps to increase precision instead of doing a divide or
20332 square root and divide for floating-point arguments.  You should use
20333 the @option{-ffast-math} option when using @option{-mrecip} (or at
20334 least @option{-funsafe-math-optimizations},
20335 @option{-finite-math-only}, @option{-freciprocal-math} and
20336 @option{-fno-trapping-math}).  Note that while the throughput of the
20337 sequence is generally higher than the throughput of the non-reciprocal
20338 instruction, the precision of the sequence can be decreased by up to 2
20339 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
20340 roots.
20342 @item -mrecip=@var{opt}
20343 @opindex mrecip=opt
20344 This option controls which reciprocal estimate instructions
20345 may be used.  @var{opt} is a comma-separated list of options, which may
20346 be preceded by a @code{!} to invert the option:
20347 @code{all}: enable all estimate instructions,
20348 @code{default}: enable the default instructions, equivalent to @option{-mrecip},
20349 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
20350 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
20351 @code{divf}: enable the single-precision reciprocal approximation instructions;
20352 @code{divd}: enable the double-precision reciprocal approximation instructions;
20353 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
20354 @code{rsqrtf}: enable the single-precision reciprocal square root approximation instructions;
20355 @code{rsqrtd}: enable the double-precision reciprocal square root approximation instructions;
20357 So, for example, @option{-mrecip=all,!rsqrtd} enables
20358 all of the reciprocal estimate instructions, except for the
20359 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
20360 which handle the double-precision reciprocal square root calculations.
20362 @item -mrecip-precision
20363 @itemx -mno-recip-precision
20364 @opindex mrecip-precision
20365 Assume (do not assume) that the reciprocal estimate instructions
20366 provide higher-precision estimates than is mandated by the PowerPC
20367 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
20368 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
20369 The double-precision square root estimate instructions are not generated by
20370 default on low-precision machines, since they do not provide an
20371 estimate that converges after three steps.
20373 @item -mveclibabi=@var{type}
20374 @opindex mveclibabi
20375 Specifies the ABI type to use for vectorizing intrinsics using an
20376 external library.  The only type supported at present is @code{mass},
20377 which specifies to use IBM's Mathematical Acceleration Subsystem
20378 (MASS) libraries for vectorizing intrinsics using external libraries.
20379 GCC currently emits calls to @code{acosd2}, @code{acosf4},
20380 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
20381 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
20382 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
20383 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
20384 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
20385 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
20386 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
20387 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
20388 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
20389 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
20390 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
20391 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
20392 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
20393 for power7.  Both @option{-ftree-vectorize} and
20394 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
20395 libraries must be specified at link time.
20397 @item -mfriz
20398 @itemx -mno-friz
20399 @opindex mfriz
20400 Generate (do not generate) the @code{friz} instruction when the
20401 @option{-funsafe-math-optimizations} option is used to optimize
20402 rounding of floating-point values to 64-bit integer and back to floating
20403 point.  The @code{friz} instruction does not return the same value if
20404 the floating-point number is too large to fit in an integer.
20406 @item -mpointers-to-nested-functions
20407 @itemx -mno-pointers-to-nested-functions
20408 @opindex mpointers-to-nested-functions
20409 Generate (do not generate) code to load up the static chain register
20410 (@var{r11}) when calling through a pointer on AIX and 64-bit Linux
20411 systems where a function pointer points to a 3-word descriptor giving
20412 the function address, TOC value to be loaded in register @var{r2}, and
20413 static chain value to be loaded in register @var{r11}.  The
20414 @option{-mpointers-to-nested-functions} is on by default.  You cannot
20415 call through pointers to nested functions or pointers
20416 to functions compiled in other languages that use the static chain if
20417 you use the @option{-mno-pointers-to-nested-functions}.
20419 @item -msave-toc-indirect
20420 @itemx -mno-save-toc-indirect
20421 @opindex msave-toc-indirect
20422 Generate (do not generate) code to save the TOC value in the reserved
20423 stack location in the function prologue if the function calls through
20424 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
20425 saved in the prologue, it is saved just before the call through the
20426 pointer.  The @option{-mno-save-toc-indirect} option is the default.
20428 @item -mcompat-align-parm
20429 @itemx -mno-compat-align-parm
20430 @opindex mcompat-align-parm
20431 Generate (do not generate) code to pass structure parameters with a
20432 maximum alignment of 64 bits, for compatibility with older versions
20433 of GCC.
20435 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
20436 structure parameter on a 128-bit boundary when that structure contained
20437 a member requiring 128-bit alignment.  This is corrected in more
20438 recent versions of GCC.  This option may be used to generate code
20439 that is compatible with functions compiled with older versions of
20440 GCC.
20442 The @option{-mno-compat-align-parm} option is the default.
20443 @end table
20445 @node RX Options
20446 @subsection RX Options
20447 @cindex RX Options
20449 These command-line options are defined for RX targets:
20451 @table @gcctabopt
20452 @item -m64bit-doubles
20453 @itemx -m32bit-doubles
20454 @opindex m64bit-doubles
20455 @opindex m32bit-doubles
20456 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
20457 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
20458 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
20459 works on 32-bit values, which is why the default is
20460 @option{-m32bit-doubles}.
20462 @item -fpu
20463 @itemx -nofpu
20464 @opindex fpu
20465 @opindex nofpu
20466 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
20467 floating-point hardware.  The default is enabled for the @var{RX600}
20468 series and disabled for the @var{RX200} series.
20470 Floating-point instructions are only generated for 32-bit floating-point 
20471 values, however, so the FPU hardware is not used for doubles if the
20472 @option{-m64bit-doubles} option is used.
20474 @emph{Note} If the @option{-fpu} option is enabled then
20475 @option{-funsafe-math-optimizations} is also enabled automatically.
20476 This is because the RX FPU instructions are themselves unsafe.
20478 @item -mcpu=@var{name}
20479 @opindex -mcpu
20480 Selects the type of RX CPU to be targeted.  Currently three types are
20481 supported, the generic @var{RX600} and @var{RX200} series hardware and
20482 the specific @var{RX610} CPU.  The default is @var{RX600}.
20484 The only difference between @var{RX600} and @var{RX610} is that the
20485 @var{RX610} does not support the @code{MVTIPL} instruction.
20487 The @var{RX200} series does not have a hardware floating-point unit
20488 and so @option{-nofpu} is enabled by default when this type is
20489 selected.
20491 @item -mbig-endian-data
20492 @itemx -mlittle-endian-data
20493 @opindex mbig-endian-data
20494 @opindex mlittle-endian-data
20495 Store data (but not code) in the big-endian format.  The default is
20496 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
20497 format.
20499 @item -msmall-data-limit=@var{N}
20500 @opindex msmall-data-limit
20501 Specifies the maximum size in bytes of global and static variables
20502 which can be placed into the small data area.  Using the small data
20503 area can lead to smaller and faster code, but the size of area is
20504 limited and it is up to the programmer to ensure that the area does
20505 not overflow.  Also when the small data area is used one of the RX's
20506 registers (usually @code{r13}) is reserved for use pointing to this
20507 area, so it is no longer available for use by the compiler.  This
20508 could result in slower and/or larger code if variables are pushed onto
20509 the stack instead of being held in this register.
20511 Note, common variables (variables that have not been initialized) and
20512 constants are not placed into the small data area as they are assigned
20513 to other sections in the output executable.
20515 The default value is zero, which disables this feature.  Note, this
20516 feature is not enabled by default with higher optimization levels
20517 (@option{-O2} etc) because of the potentially detrimental effects of
20518 reserving a register.  It is up to the programmer to experiment and
20519 discover whether this feature is of benefit to their program.  See the
20520 description of the @option{-mpid} option for a description of how the
20521 actual register to hold the small data area pointer is chosen.
20523 @item -msim
20524 @itemx -mno-sim
20525 @opindex msim
20526 @opindex mno-sim
20527 Use the simulator runtime.  The default is to use the libgloss
20528 board-specific runtime.
20530 @item -mas100-syntax
20531 @itemx -mno-as100-syntax
20532 @opindex mas100-syntax
20533 @opindex mno-as100-syntax
20534 When generating assembler output use a syntax that is compatible with
20535 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
20536 assembler, but it has some restrictions so it is not generated by default.
20538 @item -mmax-constant-size=@var{N}
20539 @opindex mmax-constant-size
20540 Specifies the maximum size, in bytes, of a constant that can be used as
20541 an operand in a RX instruction.  Although the RX instruction set does
20542 allow constants of up to 4 bytes in length to be used in instructions,
20543 a longer value equates to a longer instruction.  Thus in some
20544 circumstances it can be beneficial to restrict the size of constants
20545 that are used in instructions.  Constants that are too big are instead
20546 placed into a constant pool and referenced via register indirection.
20548 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
20549 or 4 means that constants of any size are allowed.
20551 @item -mrelax
20552 @opindex mrelax
20553 Enable linker relaxation.  Linker relaxation is a process whereby the
20554 linker attempts to reduce the size of a program by finding shorter
20555 versions of various instructions.  Disabled by default.
20557 @item -mint-register=@var{N}
20558 @opindex mint-register
20559 Specify the number of registers to reserve for fast interrupt handler
20560 functions.  The value @var{N} can be between 0 and 4.  A value of 1
20561 means that register @code{r13} is reserved for the exclusive use
20562 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
20563 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
20564 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
20565 A value of 0, the default, does not reserve any registers.
20567 @item -msave-acc-in-interrupts
20568 @opindex msave-acc-in-interrupts
20569 Specifies that interrupt handler functions should preserve the
20570 accumulator register.  This is only necessary if normal code might use
20571 the accumulator register, for example because it performs 64-bit
20572 multiplications.  The default is to ignore the accumulator as this
20573 makes the interrupt handlers faster.
20575 @item -mpid
20576 @itemx -mno-pid
20577 @opindex mpid
20578 @opindex mno-pid
20579 Enables the generation of position independent data.  When enabled any
20580 access to constant data is done via an offset from a base address
20581 held in a register.  This allows the location of constant data to be
20582 determined at run time without requiring the executable to be
20583 relocated, which is a benefit to embedded applications with tight
20584 memory constraints.  Data that can be modified is not affected by this
20585 option.
20587 Note, using this feature reserves a register, usually @code{r13}, for
20588 the constant data base address.  This can result in slower and/or
20589 larger code, especially in complicated functions.
20591 The actual register chosen to hold the constant data base address
20592 depends upon whether the @option{-msmall-data-limit} and/or the
20593 @option{-mint-register} command-line options are enabled.  Starting
20594 with register @code{r13} and proceeding downwards, registers are
20595 allocated first to satisfy the requirements of @option{-mint-register},
20596 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
20597 is possible for the small data area register to be @code{r8} if both
20598 @option{-mint-register=4} and @option{-mpid} are specified on the
20599 command line.
20601 By default this feature is not enabled.  The default can be restored
20602 via the @option{-mno-pid} command-line option.
20604 @item -mno-warn-multiple-fast-interrupts
20605 @itemx -mwarn-multiple-fast-interrupts
20606 @opindex mno-warn-multiple-fast-interrupts
20607 @opindex mwarn-multiple-fast-interrupts
20608 Prevents GCC from issuing a warning message if it finds more than one
20609 fast interrupt handler when it is compiling a file.  The default is to
20610 issue a warning for each extra fast interrupt handler found, as the RX
20611 only supports one such interrupt.
20613 @end table
20615 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
20616 has special significance to the RX port when used with the
20617 @code{interrupt} function attribute.  This attribute indicates a
20618 function intended to process fast interrupts.  GCC ensures
20619 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
20620 and/or @code{r13} and only provided that the normal use of the
20621 corresponding registers have been restricted via the
20622 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
20623 options.
20625 @node S/390 and zSeries Options
20626 @subsection S/390 and zSeries Options
20627 @cindex S/390 and zSeries Options
20629 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
20631 @table @gcctabopt
20632 @item -mhard-float
20633 @itemx -msoft-float
20634 @opindex mhard-float
20635 @opindex msoft-float
20636 Use (do not use) the hardware floating-point instructions and registers
20637 for floating-point operations.  When @option{-msoft-float} is specified,
20638 functions in @file{libgcc.a} are used to perform floating-point
20639 operations.  When @option{-mhard-float} is specified, the compiler
20640 generates IEEE floating-point instructions.  This is the default.
20642 @item -mhard-dfp
20643 @itemx -mno-hard-dfp
20644 @opindex mhard-dfp
20645 @opindex mno-hard-dfp
20646 Use (do not use) the hardware decimal-floating-point instructions for
20647 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
20648 specified, functions in @file{libgcc.a} are used to perform
20649 decimal-floating-point operations.  When @option{-mhard-dfp} is
20650 specified, the compiler generates decimal-floating-point hardware
20651 instructions.  This is the default for @option{-march=z9-ec} or higher.
20653 @item -mlong-double-64
20654 @itemx -mlong-double-128
20655 @opindex mlong-double-64
20656 @opindex mlong-double-128
20657 These switches control the size of @code{long double} type. A size
20658 of 64 bits makes the @code{long double} type equivalent to the @code{double}
20659 type. This is the default.
20661 @item -mbackchain
20662 @itemx -mno-backchain
20663 @opindex mbackchain
20664 @opindex mno-backchain
20665 Store (do not store) the address of the caller's frame as backchain pointer
20666 into the callee's stack frame.
20667 A backchain may be needed to allow debugging using tools that do not understand
20668 DWARF 2 call frame information.
20669 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
20670 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
20671 the backchain is placed into the topmost word of the 96/160 byte register
20672 save area.
20674 In general, code compiled with @option{-mbackchain} is call-compatible with
20675 code compiled with @option{-mmo-backchain}; however, use of the backchain
20676 for debugging purposes usually requires that the whole binary is built with
20677 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
20678 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
20679 to build a linux kernel use @option{-msoft-float}.
20681 The default is to not maintain the backchain.
20683 @item -mpacked-stack
20684 @itemx -mno-packed-stack
20685 @opindex mpacked-stack
20686 @opindex mno-packed-stack
20687 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
20688 specified, the compiler uses the all fields of the 96/160 byte register save
20689 area only for their default purpose; unused fields still take up stack space.
20690 When @option{-mpacked-stack} is specified, register save slots are densely
20691 packed at the top of the register save area; unused space is reused for other
20692 purposes, allowing for more efficient use of the available stack space.
20693 However, when @option{-mbackchain} is also in effect, the topmost word of
20694 the save area is always used to store the backchain, and the return address
20695 register is always saved two words below the backchain.
20697 As long as the stack frame backchain is not used, code generated with
20698 @option{-mpacked-stack} is call-compatible with code generated with
20699 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
20700 S/390 or zSeries generated code that uses the stack frame backchain at run
20701 time, not just for debugging purposes.  Such code is not call-compatible
20702 with code compiled with @option{-mpacked-stack}.  Also, note that the
20703 combination of @option{-mbackchain},
20704 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
20705 to build a linux kernel use @option{-msoft-float}.
20707 The default is to not use the packed stack layout.
20709 @item -msmall-exec
20710 @itemx -mno-small-exec
20711 @opindex msmall-exec
20712 @opindex mno-small-exec
20713 Generate (or do not generate) code using the @code{bras} instruction
20714 to do subroutine calls.
20715 This only works reliably if the total executable size does not
20716 exceed 64k.  The default is to use the @code{basr} instruction instead,
20717 which does not have this limitation.
20719 @item -m64
20720 @itemx -m31
20721 @opindex m64
20722 @opindex m31
20723 When @option{-m31} is specified, generate code compliant to the
20724 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
20725 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
20726 particular to generate 64-bit instructions.  For the @samp{s390}
20727 targets, the default is @option{-m31}, while the @samp{s390x}
20728 targets default to @option{-m64}.
20730 @item -mzarch
20731 @itemx -mesa
20732 @opindex mzarch
20733 @opindex mesa
20734 When @option{-mzarch} is specified, generate code using the
20735 instructions available on z/Architecture.
20736 When @option{-mesa} is specified, generate code using the
20737 instructions available on ESA/390.  Note that @option{-mesa} is
20738 not possible with @option{-m64}.
20739 When generating code compliant to the GNU/Linux for S/390 ABI,
20740 the default is @option{-mesa}.  When generating code compliant
20741 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
20743 @item -mmvcle
20744 @itemx -mno-mvcle
20745 @opindex mmvcle
20746 @opindex mno-mvcle
20747 Generate (or do not generate) code using the @code{mvcle} instruction
20748 to perform block moves.  When @option{-mno-mvcle} is specified,
20749 use a @code{mvc} loop instead.  This is the default unless optimizing for
20750 size.
20752 @item -mdebug
20753 @itemx -mno-debug
20754 @opindex mdebug
20755 @opindex mno-debug
20756 Print (or do not print) additional debug information when compiling.
20757 The default is to not print debug information.
20759 @item -march=@var{cpu-type}
20760 @opindex march
20761 Generate code that runs on @var{cpu-type}, which is the name of a system
20762 representing a certain processor type.  Possible values for
20763 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
20764 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
20765 When generating code using the instructions available on z/Architecture,
20766 the default is @option{-march=z900}.  Otherwise, the default is
20767 @option{-march=g5}.
20769 @item -mtune=@var{cpu-type}
20770 @opindex mtune
20771 Tune to @var{cpu-type} everything applicable about the generated code,
20772 except for the ABI and the set of available instructions.
20773 The list of @var{cpu-type} values is the same as for @option{-march}.
20774 The default is the value used for @option{-march}.
20776 @item -mtpf-trace
20777 @itemx -mno-tpf-trace
20778 @opindex mtpf-trace
20779 @opindex mno-tpf-trace
20780 Generate code that adds (does not add) in TPF OS specific branches to trace
20781 routines in the operating system.  This option is off by default, even
20782 when compiling for the TPF OS@.
20784 @item -mfused-madd
20785 @itemx -mno-fused-madd
20786 @opindex mfused-madd
20787 @opindex mno-fused-madd
20788 Generate code that uses (does not use) the floating-point multiply and
20789 accumulate instructions.  These instructions are generated by default if
20790 hardware floating point is used.
20792 @item -mwarn-framesize=@var{framesize}
20793 @opindex mwarn-framesize
20794 Emit a warning if the current function exceeds the given frame size.  Because
20795 this is a compile-time check it doesn't need to be a real problem when the program
20796 runs.  It is intended to identify functions that most probably cause
20797 a stack overflow.  It is useful to be used in an environment with limited stack
20798 size e.g.@: the linux kernel.
20800 @item -mwarn-dynamicstack
20801 @opindex mwarn-dynamicstack
20802 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
20803 arrays.  This is generally a bad idea with a limited stack size.
20805 @item -mstack-guard=@var{stack-guard}
20806 @itemx -mstack-size=@var{stack-size}
20807 @opindex mstack-guard
20808 @opindex mstack-size
20809 If these options are provided the S/390 back end emits additional instructions in
20810 the function prologue that trigger a trap if the stack size is @var{stack-guard}
20811 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
20812 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
20813 the frame size of the compiled function is chosen.
20814 These options are intended to be used to help debugging stack overflow problems.
20815 The additionally emitted code causes only little overhead and hence can also be
20816 used in production-like systems without greater performance degradation.  The given
20817 values have to be exact powers of 2 and @var{stack-size} has to be greater than
20818 @var{stack-guard} without exceeding 64k.
20819 In order to be efficient the extra code makes the assumption that the stack starts
20820 at an address aligned to the value given by @var{stack-size}.
20821 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
20823 @item -mhotpatch[=@var{halfwords}]
20824 @itemx -mno-hotpatch
20825 @opindex mhotpatch
20826 If the hotpatch option is enabled, a ``hot-patching'' function
20827 prologue is generated for all functions in the compilation unit.
20828 The funtion label is prepended with the given number of two-byte
20829 Nop instructions (@var{halfwords}, maximum 1000000) or 12 Nop
20830 instructions if no argument is present.  Functions with a
20831 hot-patching prologue are never inlined automatically, and a
20832 hot-patching prologue is never generated for functions
20833 that are explicitly inline.
20835 This option can be overridden for individual functions with the
20836 @code{hotpatch} attribute.
20837 @end table
20839 @node Score Options
20840 @subsection Score Options
20841 @cindex Score Options
20843 These options are defined for Score implementations:
20845 @table @gcctabopt
20846 @item -meb
20847 @opindex meb
20848 Compile code for big-endian mode.  This is the default.
20850 @item -mel
20851 @opindex mel
20852 Compile code for little-endian mode.
20854 @item -mnhwloop
20855 @opindex mnhwloop
20856 Disable generation of @code{bcnz} instructions.
20858 @item -muls
20859 @opindex muls
20860 Enable generation of unaligned load and store instructions.
20862 @item -mmac
20863 @opindex mmac
20864 Enable the use of multiply-accumulate instructions. Disabled by default.
20866 @item -mscore5
20867 @opindex mscore5
20868 Specify the SCORE5 as the target architecture.
20870 @item -mscore5u
20871 @opindex mscore5u
20872 Specify the SCORE5U of the target architecture.
20874 @item -mscore7
20875 @opindex mscore7
20876 Specify the SCORE7 as the target architecture. This is the default.
20878 @item -mscore7d
20879 @opindex mscore7d
20880 Specify the SCORE7D as the target architecture.
20881 @end table
20883 @node SH Options
20884 @subsection SH Options
20886 These @samp{-m} options are defined for the SH implementations:
20888 @table @gcctabopt
20889 @item -m1
20890 @opindex m1
20891 Generate code for the SH1.
20893 @item -m2
20894 @opindex m2
20895 Generate code for the SH2.
20897 @item -m2e
20898 Generate code for the SH2e.
20900 @item -m2a-nofpu
20901 @opindex m2a-nofpu
20902 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
20903 that the floating-point unit is not used.
20905 @item -m2a-single-only
20906 @opindex m2a-single-only
20907 Generate code for the SH2a-FPU, in such a way that no double-precision
20908 floating-point operations are used.
20910 @item -m2a-single
20911 @opindex m2a-single
20912 Generate code for the SH2a-FPU assuming the floating-point unit is in
20913 single-precision mode by default.
20915 @item -m2a
20916 @opindex m2a
20917 Generate code for the SH2a-FPU assuming the floating-point unit is in
20918 double-precision mode by default.
20920 @item -m3
20921 @opindex m3
20922 Generate code for the SH3.
20924 @item -m3e
20925 @opindex m3e
20926 Generate code for the SH3e.
20928 @item -m4-nofpu
20929 @opindex m4-nofpu
20930 Generate code for the SH4 without a floating-point unit.
20932 @item -m4-single-only
20933 @opindex m4-single-only
20934 Generate code for the SH4 with a floating-point unit that only
20935 supports single-precision arithmetic.
20937 @item -m4-single
20938 @opindex m4-single
20939 Generate code for the SH4 assuming the floating-point unit is in
20940 single-precision mode by default.
20942 @item -m4
20943 @opindex m4
20944 Generate code for the SH4.
20946 @item -m4-100
20947 @opindex m4-100
20948 Generate code for SH4-100.
20950 @item -m4-100-nofpu
20951 @opindex m4-100-nofpu
20952 Generate code for SH4-100 in such a way that the
20953 floating-point unit is not used.
20955 @item -m4-100-single
20956 @opindex m4-100-single
20957 Generate code for SH4-100 assuming the floating-point unit is in
20958 single-precision mode by default.
20960 @item -m4-100-single-only
20961 @opindex m4-100-single-only
20962 Generate code for SH4-100 in such a way that no double-precision
20963 floating-point operations are used.
20965 @item -m4-200
20966 @opindex m4-200
20967 Generate code for SH4-200.
20969 @item -m4-200-nofpu
20970 @opindex m4-200-nofpu
20971 Generate code for SH4-200 without in such a way that the
20972 floating-point unit is not used.
20974 @item -m4-200-single
20975 @opindex m4-200-single
20976 Generate code for SH4-200 assuming the floating-point unit is in
20977 single-precision mode by default.
20979 @item -m4-200-single-only
20980 @opindex m4-200-single-only
20981 Generate code for SH4-200 in such a way that no double-precision
20982 floating-point operations are used.
20984 @item -m4-300
20985 @opindex m4-300
20986 Generate code for SH4-300.
20988 @item -m4-300-nofpu
20989 @opindex m4-300-nofpu
20990 Generate code for SH4-300 without in such a way that the
20991 floating-point unit is not used.
20993 @item -m4-300-single
20994 @opindex m4-300-single
20995 Generate code for SH4-300 in such a way that no double-precision
20996 floating-point operations are used.
20998 @item -m4-300-single-only
20999 @opindex m4-300-single-only
21000 Generate code for SH4-300 in such a way that no double-precision
21001 floating-point operations are used.
21003 @item -m4-340
21004 @opindex m4-340
21005 Generate code for SH4-340 (no MMU, no FPU).
21007 @item -m4-500
21008 @opindex m4-500
21009 Generate code for SH4-500 (no FPU).  Passes @option{-isa=sh4-nofpu} to the
21010 assembler.
21012 @item -m4a-nofpu
21013 @opindex m4a-nofpu
21014 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
21015 floating-point unit is not used.
21017 @item -m4a-single-only
21018 @opindex m4a-single-only
21019 Generate code for the SH4a, in such a way that no double-precision
21020 floating-point operations are used.
21022 @item -m4a-single
21023 @opindex m4a-single
21024 Generate code for the SH4a assuming the floating-point unit is in
21025 single-precision mode by default.
21027 @item -m4a
21028 @opindex m4a
21029 Generate code for the SH4a.
21031 @item -m4al
21032 @opindex m4al
21033 Same as @option{-m4a-nofpu}, except that it implicitly passes
21034 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
21035 instructions at the moment.
21037 @item -m5-32media
21038 @opindex m5-32media
21039 Generate 32-bit code for SHmedia.
21041 @item -m5-32media-nofpu
21042 @opindex m5-32media-nofpu
21043 Generate 32-bit code for SHmedia in such a way that the
21044 floating-point unit is not used.
21046 @item -m5-64media
21047 @opindex m5-64media
21048 Generate 64-bit code for SHmedia.
21050 @item -m5-64media-nofpu
21051 @opindex m5-64media-nofpu
21052 Generate 64-bit code for SHmedia in such a way that the
21053 floating-point unit is not used.
21055 @item -m5-compact
21056 @opindex m5-compact
21057 Generate code for SHcompact.
21059 @item -m5-compact-nofpu
21060 @opindex m5-compact-nofpu
21061 Generate code for SHcompact in such a way that the
21062 floating-point unit is not used.
21064 @item -mb
21065 @opindex mb
21066 Compile code for the processor in big-endian mode.
21068 @item -ml
21069 @opindex ml
21070 Compile code for the processor in little-endian mode.
21072 @item -mdalign
21073 @opindex mdalign
21074 Align doubles at 64-bit boundaries.  Note that this changes the calling
21075 conventions, and thus some functions from the standard C library do
21076 not work unless you recompile it first with @option{-mdalign}.
21078 @item -mrelax
21079 @opindex mrelax
21080 Shorten some address references at link time, when possible; uses the
21081 linker option @option{-relax}.
21083 @item -mbigtable
21084 @opindex mbigtable
21085 Use 32-bit offsets in @code{switch} tables.  The default is to use
21086 16-bit offsets.
21088 @item -mbitops
21089 @opindex mbitops
21090 Enable the use of bit manipulation instructions on SH2A.
21092 @item -mfmovd
21093 @opindex mfmovd
21094 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
21095 alignment constraints.
21097 @item -mrenesas
21098 @opindex mrenesas
21099 Comply with the calling conventions defined by Renesas.
21101 @item -mno-renesas
21102 @opindex mno-renesas
21103 Comply with the calling conventions defined for GCC before the Renesas
21104 conventions were available.  This option is the default for all
21105 targets of the SH toolchain.
21107 @item -mnomacsave
21108 @opindex mnomacsave
21109 Mark the @code{MAC} register as call-clobbered, even if
21110 @option{-mrenesas} is given.
21112 @item -mieee
21113 @itemx -mno-ieee
21114 @opindex mieee
21115 @opindex mno-ieee
21116 Control the IEEE compliance of floating-point comparisons, which affects the
21117 handling of cases where the result of a comparison is unordered.  By default
21118 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
21119 enabled @option{-mno-ieee} is implicitly set, which results in faster
21120 floating-point greater-equal and less-equal comparisons.  The implcit settings
21121 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
21123 @item -minline-ic_invalidate
21124 @opindex minline-ic_invalidate
21125 Inline code to invalidate instruction cache entries after setting up
21126 nested function trampolines.
21127 This option has no effect if @option{-musermode} is in effect and the selected
21128 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
21129 instruction.
21130 If the selected code generation option does not allow the use of the @code{icbi}
21131 instruction, and @option{-musermode} is not in effect, the inlined code
21132 manipulates the instruction cache address array directly with an associative
21133 write.  This not only requires privileged mode at run time, but it also
21134 fails if the cache line had been mapped via the TLB and has become unmapped.
21136 @item -misize
21137 @opindex misize
21138 Dump instruction size and location in the assembly code.
21140 @item -mpadstruct
21141 @opindex mpadstruct
21142 This option is deprecated.  It pads structures to multiple of 4 bytes,
21143 which is incompatible with the SH ABI@.
21145 @item -matomic-model=@var{model}
21146 @opindex matomic-model=@var{model}
21147 Sets the model of atomic operations and additional parameters as a comma
21148 separated list.  For details on the atomic built-in functions see
21149 @ref{__atomic Builtins}.  The following models and parameters are supported:
21151 @table @samp
21153 @item none
21154 Disable compiler generated atomic sequences and emit library calls for atomic
21155 operations.  This is the default if the target is not @code{sh*-*-linux*}.
21157 @item soft-gusa
21158 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
21159 built-in functions.  The generated atomic sequences require additional support
21160 from the interrupt/exception handling code of the system and are only suitable
21161 for SH3* and SH4* single-core systems.  This option is enabled by default when
21162 the target is @code{sh*-*-linux*} and SH3* or SH4*.  When the target is SH4A,
21163 this option will also partially utilize the hardware atomic instructions
21164 @code{movli.l} and @code{movco.l} to create more efficient code, unless
21165 @samp{strict} is specified.  
21167 @item soft-tcb
21168 Generate software atomic sequences that use a variable in the thread control
21169 block.  This is a variation of the gUSA sequences which can also be used on
21170 SH1* and SH2* targets.  The generated atomic sequences require additional
21171 support from the interrupt/exception handling code of the system and are only
21172 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
21173 parameter has to be specified as well.
21175 @item soft-imask
21176 Generate software atomic sequences that temporarily disable interrupts by
21177 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
21178 in privileged mode and is only suitable for single-core systems.  Additional
21179 support from the interrupt/exception handling code of the system is not
21180 required.  This model is enabled by default when the target is
21181 @code{sh*-*-linux*} and SH1* or SH2*.
21183 @item hard-llcs
21184 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
21185 instructions only.  This is only available on SH4A and is suitable for
21186 multi-core systems.  Since the hardware instructions support only 32 bit atomic
21187 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
21188 Code compiled with this option will also be compatible with other software
21189 atomic model interrupt/exception handling systems if executed on an SH4A
21190 system.  Additional support from the interrupt/exception handling code of the
21191 system is not required for this model.
21193 @item gbr-offset=
21194 This parameter specifies the offset in bytes of the variable in the thread
21195 control block structure that should be used by the generated atomic sequences
21196 when the @samp{soft-tcb} model has been selected.  For other models this
21197 parameter is ignored.  The specified value must be an integer multiple of four
21198 and in the range 0-1020.
21200 @item strict
21201 This parameter prevents mixed usage of multiple atomic models, even though they
21202 would be compatible, and will make the compiler generate atomic sequences of the
21203 specified model only.
21205 @end table
21207 @item -mtas
21208 @opindex mtas
21209 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
21210 Notice that depending on the particular hardware and software configuration
21211 this can degrade overall performance due to the operand cache line flushes
21212 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
21213 processors the @code{tas.b} instruction must be used with caution since it
21214 can result in data corruption for certain cache configurations.
21216 @item -mprefergot
21217 @opindex mprefergot
21218 When generating position-independent code, emit function calls using
21219 the Global Offset Table instead of the Procedure Linkage Table.
21221 @item -musermode
21222 @itemx -mno-usermode
21223 @opindex musermode
21224 @opindex mno-usermode
21225 Don't allow (allow) the compiler generating privileged mode code.  Specifying
21226 @option{-musermode} also implies @option{-mno-inline-ic_invalidate} if the
21227 inlined code would not work in user mode.  @option{-musermode} is the default
21228 when the target is @code{sh*-*-linux*}.  If the target is SH1* or SH2*
21229 @option{-musermode} has no effect, since there is no user mode.
21231 @item -multcost=@var{number}
21232 @opindex multcost=@var{number}
21233 Set the cost to assume for a multiply insn.
21235 @item -mdiv=@var{strategy}
21236 @opindex mdiv=@var{strategy}
21237 Set the division strategy to be used for integer division operations.
21238 For SHmedia @var{strategy} can be one of: 
21240 @table @samp
21242 @item fp 
21243 Performs the operation in floating point.  This has a very high latency,
21244 but needs only a few instructions, so it might be a good choice if
21245 your code has enough easily-exploitable ILP to allow the compiler to
21246 schedule the floating-point instructions together with other instructions.
21247 Division by zero causes a floating-point exception.
21249 @item inv
21250 Uses integer operations to calculate the inverse of the divisor,
21251 and then multiplies the dividend with the inverse.  This strategy allows
21252 CSE and hoisting of the inverse calculation.  Division by zero calculates
21253 an unspecified result, but does not trap.
21255 @item inv:minlat
21256 A variant of @samp{inv} where, if no CSE or hoisting opportunities
21257 have been found, or if the entire operation has been hoisted to the same
21258 place, the last stages of the inverse calculation are intertwined with the
21259 final multiply to reduce the overall latency, at the expense of using a few
21260 more instructions, and thus offering fewer scheduling opportunities with
21261 other code.
21263 @item call
21264 Calls a library function that usually implements the @samp{inv:minlat}
21265 strategy.
21266 This gives high code density for @code{m5-*media-nofpu} compilations.
21268 @item call2
21269 Uses a different entry point of the same library function, where it
21270 assumes that a pointer to a lookup table has already been set up, which
21271 exposes the pointer load to CSE and code hoisting optimizations.
21273 @item inv:call
21274 @itemx inv:call2
21275 @itemx inv:fp
21276 Use the @samp{inv} algorithm for initial
21277 code generation, but if the code stays unoptimized, revert to the @samp{call},
21278 @samp{call2}, or @samp{fp} strategies, respectively.  Note that the
21279 potentially-trapping side effect of division by zero is carried by a
21280 separate instruction, so it is possible that all the integer instructions
21281 are hoisted out, but the marker for the side effect stays where it is.
21282 A recombination to floating-point operations or a call is not possible
21283 in that case.
21285 @item inv20u
21286 @itemx inv20l
21287 Variants of the @samp{inv:minlat} strategy.  In the case
21288 that the inverse calculation is not separated from the multiply, they speed
21289 up division where the dividend fits into 20 bits (plus sign where applicable)
21290 by inserting a test to skip a number of operations in this case; this test
21291 slows down the case of larger dividends.  @samp{inv20u} assumes the case of a such
21292 a small dividend to be unlikely, and @samp{inv20l} assumes it to be likely.
21294 @end table
21296 For targets other than SHmedia @var{strategy} can be one of:
21298 @table @samp
21300 @item call-div1
21301 Calls a library function that uses the single-step division instruction
21302 @code{div1} to perform the operation.  Division by zero calculates an
21303 unspecified result and does not trap.  This is the default except for SH4,
21304 SH2A and SHcompact.
21306 @item call-fp
21307 Calls a library function that performs the operation in double precision
21308 floating point.  Division by zero causes a floating-point exception.  This is
21309 the default for SHcompact with FPU.  Specifying this for targets that do not
21310 have a double precision FPU will default to @code{call-div1}.
21312 @item call-table
21313 Calls a library function that uses a lookup table for small divisors and
21314 the @code{div1} instruction with case distinction for larger divisors.  Division
21315 by zero calculates an unspecified result and does not trap.  This is the default
21316 for SH4.  Specifying this for targets that do not have dynamic shift
21317 instructions will default to @code{call-div1}.
21319 @end table
21321 When a division strategy has not been specified the default strategy will be
21322 selected based on the current target.  For SH2A the default strategy is to
21323 use the @code{divs} and @code{divu} instructions instead of library function
21324 calls.
21326 @item -maccumulate-outgoing-args
21327 @opindex maccumulate-outgoing-args
21328 Reserve space once for outgoing arguments in the function prologue rather
21329 than around each call.  Generally beneficial for performance and size.  Also
21330 needed for unwinding to avoid changing the stack frame around conditional code.
21332 @item -mdivsi3_libfunc=@var{name}
21333 @opindex mdivsi3_libfunc=@var{name}
21334 Set the name of the library function used for 32-bit signed division to
21335 @var{name}.
21336 This only affects the name used in the @samp{call} and @samp{inv:call}
21337 division strategies, and the compiler still expects the same
21338 sets of input/output/clobbered registers as if this option were not present.
21340 @item -mfixed-range=@var{register-range}
21341 @opindex mfixed-range
21342 Generate code treating the given register range as fixed registers.
21343 A fixed register is one that the register allocator can not use.  This is
21344 useful when compiling kernel code.  A register range is specified as
21345 two registers separated by a dash.  Multiple register ranges can be
21346 specified separated by a comma.
21348 @item -mindexed-addressing
21349 @opindex mindexed-addressing
21350 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
21351 This is only safe if the hardware and/or OS implement 32-bit wrap-around
21352 semantics for the indexed addressing mode.  The architecture allows the
21353 implementation of processors with 64-bit MMU, which the OS could use to
21354 get 32-bit addressing, but since no current hardware implementation supports
21355 this or any other way to make the indexed addressing mode safe to use in
21356 the 32-bit ABI, the default is @option{-mno-indexed-addressing}.
21358 @item -mgettrcost=@var{number}
21359 @opindex mgettrcost=@var{number}
21360 Set the cost assumed for the @code{gettr} instruction to @var{number}.
21361 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
21363 @item -mpt-fixed
21364 @opindex mpt-fixed
21365 Assume @code{pt*} instructions won't trap.  This generally generates
21366 better-scheduled code, but is unsafe on current hardware.
21367 The current architecture
21368 definition says that @code{ptabs} and @code{ptrel} trap when the target 
21369 anded with 3 is 3.
21370 This has the unintentional effect of making it unsafe to schedule these
21371 instructions before a branch, or hoist them out of a loop.  For example,
21372 @code{__do_global_ctors}, a part of @file{libgcc}
21373 that runs constructors at program
21374 startup, calls functions in a list which is delimited by @minus{}1.  With the
21375 @option{-mpt-fixed} option, the @code{ptabs} is done before testing against @minus{}1.
21376 That means that all the constructors run a bit more quickly, but when
21377 the loop comes to the end of the list, the program crashes because @code{ptabs}
21378 loads @minus{}1 into a target register.  
21380 Since this option is unsafe for any
21381 hardware implementing the current architecture specification, the default
21382 is @option{-mno-pt-fixed}.  Unless specified explicitly with 
21383 @option{-mgettrcost}, @option{-mno-pt-fixed} also implies @option{-mgettrcost=100};
21384 this deters register allocation from using target registers for storing
21385 ordinary integers.
21387 @item -minvalid-symbols
21388 @opindex minvalid-symbols
21389 Assume symbols might be invalid.  Ordinary function symbols generated by
21390 the compiler are always valid to load with
21391 @code{movi}/@code{shori}/@code{ptabs} or
21392 @code{movi}/@code{shori}/@code{ptrel},
21393 but with assembler and/or linker tricks it is possible
21394 to generate symbols that cause @code{ptabs} or @code{ptrel} to trap.
21395 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
21396 It prevents cross-basic-block CSE, hoisting and most scheduling
21397 of symbol loads.  The default is @option{-mno-invalid-symbols}.
21399 @item -mbranch-cost=@var{num}
21400 @opindex mbranch-cost=@var{num}
21401 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
21402 make the compiler try to generate more branch-free code if possible.  
21403 If not specified the value is selected depending on the processor type that
21404 is being compiled for.
21406 @item -mzdcbranch
21407 @itemx -mno-zdcbranch
21408 @opindex mzdcbranch
21409 @opindex mno-zdcbranch
21410 Assume (do not assume) that zero displacement conditional branch instructions
21411 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
21412 compiler will try to prefer zero displacement branch code sequences.  This is
21413 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
21414 disabled by specifying @option{-mno-zdcbranch}.
21416 @item -mfused-madd
21417 @itemx -mno-fused-madd
21418 @opindex mfused-madd
21419 @opindex mno-fused-madd
21420 Generate code that uses (does not use) the floating-point multiply and
21421 accumulate instructions.  These instructions are generated by default
21422 if hardware floating point is used.  The machine-dependent
21423 @option{-mfused-madd} option is now mapped to the machine-independent
21424 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
21425 mapped to @option{-ffp-contract=off}.
21427 @item -mfsca
21428 @itemx -mno-fsca
21429 @opindex mfsca
21430 @opindex mno-fsca
21431 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
21432 and cosine approximations.  The option @code{-mfsca} must be used in
21433 combination with @code{-funsafe-math-optimizations}.  It is enabled by default
21434 when generating code for SH4A.  Using @code{-mno-fsca} disables sine and cosine
21435 approximations even if @code{-funsafe-math-optimizations} is in effect.
21437 @item -mfsrra
21438 @itemx -mno-fsrra
21439 @opindex mfsrra
21440 @opindex mno-fsrra
21441 Allow or disallow the compiler to emit the @code{fsrra} instruction for
21442 reciprocal square root approximations.  The option @code{-mfsrra} must be used
21443 in combination with @code{-funsafe-math-optimizations} and
21444 @code{-ffinite-math-only}.  It is enabled by default when generating code for
21445 SH4A.  Using @code{-mno-fsrra} disables reciprocal square root approximations
21446 even if @code{-funsafe-math-optimizations} and @code{-ffinite-math-only} are
21447 in effect.
21449 @item -mpretend-cmove
21450 @opindex mpretend-cmove
21451 Prefer zero-displacement conditional branches for conditional move instruction
21452 patterns.  This can result in faster code on the SH4 processor.
21454 @end table
21456 @node Solaris 2 Options
21457 @subsection Solaris 2 Options
21458 @cindex Solaris 2 options
21460 These @samp{-m} options are supported on Solaris 2:
21462 @table @gcctabopt
21463 @item -mclear-hwcap
21464 @opindex mclear-hwcap
21465 @option{-mclear-hwcap} tells the compiler to remove the hardware
21466 capabilities generated by the Solaris assembler.  This is only necessary
21467 when object files use ISA extensions not supported by the current
21468 machine, but check at runtime whether or not to use them.
21470 @item -mimpure-text
21471 @opindex mimpure-text
21472 @option{-mimpure-text}, used in addition to @option{-shared}, tells
21473 the compiler to not pass @option{-z text} to the linker when linking a
21474 shared object.  Using this option, you can link position-dependent
21475 code into a shared object.
21477 @option{-mimpure-text} suppresses the ``relocations remain against
21478 allocatable but non-writable sections'' linker error message.
21479 However, the necessary relocations trigger copy-on-write, and the
21480 shared object is not actually shared across processes.  Instead of
21481 using @option{-mimpure-text}, you should compile all source code with
21482 @option{-fpic} or @option{-fPIC}.
21484 @end table
21486 These switches are supported in addition to the above on Solaris 2:
21488 @table @gcctabopt
21489 @item -pthreads
21490 @opindex pthreads
21491 Add support for multithreading using the POSIX threads library.  This
21492 option sets flags for both the preprocessor and linker.  This option does
21493 not affect the thread safety of object code produced  by the compiler or
21494 that of libraries supplied with it.
21496 @item -pthread
21497 @opindex pthread
21498 This is a synonym for @option{-pthreads}.
21499 @end table
21501 @node SPARC Options
21502 @subsection SPARC Options
21503 @cindex SPARC options
21505 These @samp{-m} options are supported on the SPARC:
21507 @table @gcctabopt
21508 @item -mno-app-regs
21509 @itemx -mapp-regs
21510 @opindex mno-app-regs
21511 @opindex mapp-regs
21512 Specify @option{-mapp-regs} to generate output using the global registers
21513 2 through 4, which the SPARC SVR4 ABI reserves for applications.  Like the
21514 global register 1, each global register 2 through 4 is then treated as an
21515 allocable register that is clobbered by function calls.  This is the default.
21517 To be fully SVR4 ABI-compliant at the cost of some performance loss,
21518 specify @option{-mno-app-regs}.  You should compile libraries and system
21519 software with this option.
21521 @item -mflat
21522 @itemx -mno-flat
21523 @opindex mflat
21524 @opindex mno-flat
21525 With @option{-mflat}, the compiler does not generate save/restore instructions
21526 and uses a ``flat'' or single register window model.  This model is compatible
21527 with the regular register window model.  The local registers and the input
21528 registers (0--5) are still treated as ``call-saved'' registers and are
21529 saved on the stack as needed.
21531 With @option{-mno-flat} (the default), the compiler generates save/restore
21532 instructions (except for leaf functions).  This is the normal operating mode.
21534 @item -mfpu
21535 @itemx -mhard-float
21536 @opindex mfpu
21537 @opindex mhard-float
21538 Generate output containing floating-point instructions.  This is the
21539 default.
21541 @item -mno-fpu
21542 @itemx -msoft-float
21543 @opindex mno-fpu
21544 @opindex msoft-float
21545 Generate output containing library calls for floating point.
21546 @strong{Warning:} the requisite libraries are not available for all SPARC
21547 targets.  Normally the facilities of the machine's usual C compiler are
21548 used, but this cannot be done directly in cross-compilation.  You must make
21549 your own arrangements to provide suitable library functions for
21550 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
21551 @samp{sparclite-*-*} do provide software floating-point support.
21553 @option{-msoft-float} changes the calling convention in the output file;
21554 therefore, it is only useful if you compile @emph{all} of a program with
21555 this option.  In particular, you need to compile @file{libgcc.a}, the
21556 library that comes with GCC, with @option{-msoft-float} in order for
21557 this to work.
21559 @item -mhard-quad-float
21560 @opindex mhard-quad-float
21561 Generate output containing quad-word (long double) floating-point
21562 instructions.
21564 @item -msoft-quad-float
21565 @opindex msoft-quad-float
21566 Generate output containing library calls for quad-word (long double)
21567 floating-point instructions.  The functions called are those specified
21568 in the SPARC ABI@.  This is the default.
21570 As of this writing, there are no SPARC implementations that have hardware
21571 support for the quad-word floating-point instructions.  They all invoke
21572 a trap handler for one of these instructions, and then the trap handler
21573 emulates the effect of the instruction.  Because of the trap handler overhead,
21574 this is much slower than calling the ABI library routines.  Thus the
21575 @option{-msoft-quad-float} option is the default.
21577 @item -mno-unaligned-doubles
21578 @itemx -munaligned-doubles
21579 @opindex mno-unaligned-doubles
21580 @opindex munaligned-doubles
21581 Assume that doubles have 8-byte alignment.  This is the default.
21583 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
21584 alignment only if they are contained in another type, or if they have an
21585 absolute address.  Otherwise, it assumes they have 4-byte alignment.
21586 Specifying this option avoids some rare compatibility problems with code
21587 generated by other compilers.  It is not the default because it results
21588 in a performance loss, especially for floating-point code.
21590 @item -muser-mode
21591 @itemx -mno-user-mode
21592 @opindex muser-mode
21593 @opindex mno-user-mode
21594 Do not generate code that can only run in supervisor mode.  This is relevant
21595 only for the @code{casa} instruction emitted for the LEON3 processor.  The
21596 default is @option{-mno-user-mode}.
21598 @item -mno-faster-structs
21599 @itemx -mfaster-structs
21600 @opindex mno-faster-structs
21601 @opindex mfaster-structs
21602 With @option{-mfaster-structs}, the compiler assumes that structures
21603 should have 8-byte alignment.  This enables the use of pairs of
21604 @code{ldd} and @code{std} instructions for copies in structure
21605 assignment, in place of twice as many @code{ld} and @code{st} pairs.
21606 However, the use of this changed alignment directly violates the SPARC
21607 ABI@.  Thus, it's intended only for use on targets where the developer
21608 acknowledges that their resulting code is not directly in line with
21609 the rules of the ABI@.
21611 @item -mcpu=@var{cpu_type}
21612 @opindex mcpu
21613 Set the instruction set, register set, and instruction scheduling parameters
21614 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
21615 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
21616 @samp{leon}, @samp{leon3}, @samp{leon3v7}, @samp{sparclite}, @samp{f930},
21617 @samp{f934}, @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
21618 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
21619 @samp{niagara3} and @samp{niagara4}.
21621 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
21622 which selects the best architecture option for the host processor.
21623 @option{-mcpu=native} has no effect if GCC does not recognize
21624 the processor.
21626 Default instruction scheduling parameters are used for values that select
21627 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
21628 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
21630 Here is a list of each supported architecture and their supported
21631 implementations.
21633 @table @asis
21634 @item v7
21635 cypress, leon3v7
21637 @item v8
21638 supersparc, hypersparc, leon, leon3
21640 @item sparclite
21641 f930, f934, sparclite86x
21643 @item sparclet
21644 tsc701
21646 @item v9
21647 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4
21648 @end table
21650 By default (unless configured otherwise), GCC generates code for the V7
21651 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
21652 additionally optimizes it for the Cypress CY7C602 chip, as used in the
21653 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
21654 SPARCStation 1, 2, IPX etc.
21656 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
21657 architecture.  The only difference from V7 code is that the compiler emits
21658 the integer multiply and integer divide instructions which exist in SPARC-V8
21659 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
21660 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
21661 2000 series.
21663 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
21664 the SPARC architecture.  This adds the integer multiply, integer divide step
21665 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
21666 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
21667 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
21668 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
21669 MB86934 chip, which is the more recent SPARClite with FPU@.
21671 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
21672 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
21673 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
21674 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
21675 optimizes it for the TEMIC SPARClet chip.
21677 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
21678 architecture.  This adds 64-bit integer and floating-point move instructions,
21679 3 additional floating-point condition code registers and conditional move
21680 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
21681 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
21682 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
21683 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
21684 @option{-mcpu=niagara}, the compiler additionally optimizes it for
21685 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
21686 additionally optimizes it for Sun UltraSPARC T2 chips. With
21687 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
21688 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
21689 additionally optimizes it for Sun UltraSPARC T4 chips.
21691 @item -mtune=@var{cpu_type}
21692 @opindex mtune
21693 Set the instruction scheduling parameters for machine type
21694 @var{cpu_type}, but do not set the instruction set or register set that the
21695 option @option{-mcpu=@var{cpu_type}} does.
21697 The same values for @option{-mcpu=@var{cpu_type}} can be used for
21698 @option{-mtune=@var{cpu_type}}, but the only useful values are those
21699 that select a particular CPU implementation.  Those are @samp{cypress},
21700 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{leon3},
21701 @samp{leon3v7}, @samp{f930}, @samp{f934}, @samp{sparclite86x}, @samp{tsc701},
21702 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
21703 @samp{niagara3} and @samp{niagara4}.  With native Solaris and GNU/Linux
21704 toolchains, @samp{native} can also be used.
21706 @item -mv8plus
21707 @itemx -mno-v8plus
21708 @opindex mv8plus
21709 @opindex mno-v8plus
21710 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
21711 difference from the V8 ABI is that the global and out registers are
21712 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
21713 mode for all SPARC-V9 processors.
21715 @item -mvis
21716 @itemx -mno-vis
21717 @opindex mvis
21718 @opindex mno-vis
21719 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
21720 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
21722 @item -mvis2
21723 @itemx -mno-vis2
21724 @opindex mvis2
21725 @opindex mno-vis2
21726 With @option{-mvis2}, GCC generates code that takes advantage of
21727 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
21728 default is @option{-mvis2} when targeting a cpu that supports such
21729 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
21730 also sets @option{-mvis}.
21732 @item -mvis3
21733 @itemx -mno-vis3
21734 @opindex mvis3
21735 @opindex mno-vis3
21736 With @option{-mvis3}, GCC generates code that takes advantage of
21737 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
21738 default is @option{-mvis3} when targeting a cpu that supports such
21739 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
21740 also sets @option{-mvis2} and @option{-mvis}.
21742 @item -mcbcond
21743 @itemx -mno-cbcond
21744 @opindex mcbcond
21745 @opindex mno-cbcond
21746 With @option{-mcbcond}, GCC generates code that takes advantage of
21747 compare-and-branch instructions, as defined in the Sparc Architecture 2011.
21748 The default is @option{-mcbcond} when targeting a cpu that supports such
21749 instructions, such as niagara-4 and later.
21751 @item -mpopc
21752 @itemx -mno-popc
21753 @opindex mpopc
21754 @opindex mno-popc
21755 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
21756 population count instruction.  The default is @option{-mpopc}
21757 when targeting a cpu that supports such instructions, such as Niagara-2 and
21758 later.
21760 @item -mfmaf
21761 @itemx -mno-fmaf
21762 @opindex mfmaf
21763 @opindex mno-fmaf
21764 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
21765 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
21766 when targeting a cpu that supports such instructions, such as Niagara-3 and
21767 later.
21769 @item -mfix-at697f
21770 @opindex mfix-at697f
21771 Enable the documented workaround for the single erratum of the Atmel AT697F
21772 processor (which corresponds to erratum #13 of the AT697E processor).
21774 @item -mfix-ut699
21775 @opindex mfix-ut699
21776 Enable the documented workarounds for the floating-point errata and the data
21777 cache nullify errata of the UT699 processor.
21778 @end table
21780 These @samp{-m} options are supported in addition to the above
21781 on SPARC-V9 processors in 64-bit environments:
21783 @table @gcctabopt
21784 @item -m32
21785 @itemx -m64
21786 @opindex m32
21787 @opindex m64
21788 Generate code for a 32-bit or 64-bit environment.
21789 The 32-bit environment sets int, long and pointer to 32 bits.
21790 The 64-bit environment sets int to 32 bits and long and pointer
21791 to 64 bits.
21793 @item -mcmodel=@var{which}
21794 @opindex mcmodel
21795 Set the code model to one of
21797 @table @samp
21798 @item medlow
21799 The Medium/Low code model: 64-bit addresses, programs
21800 must be linked in the low 32 bits of memory.  Programs can be statically
21801 or dynamically linked.
21803 @item medmid
21804 The Medium/Middle code model: 64-bit addresses, programs
21805 must be linked in the low 44 bits of memory, the text and data segments must
21806 be less than 2GB in size and the data segment must be located within 2GB of
21807 the text segment.
21809 @item medany
21810 The Medium/Anywhere code model: 64-bit addresses, programs
21811 may be linked anywhere in memory, the text and data segments must be less
21812 than 2GB in size and the data segment must be located within 2GB of the
21813 text segment.
21815 @item embmedany
21816 The Medium/Anywhere code model for embedded systems:
21817 64-bit addresses, the text and data segments must be less than 2GB in
21818 size, both starting anywhere in memory (determined at link time).  The
21819 global register %g4 points to the base of the data segment.  Programs
21820 are statically linked and PIC is not supported.
21821 @end table
21823 @item -mmemory-model=@var{mem-model}
21824 @opindex mmemory-model
21825 Set the memory model in force on the processor to one of
21827 @table @samp
21828 @item default
21829 The default memory model for the processor and operating system.
21831 @item rmo
21832 Relaxed Memory Order
21834 @item pso
21835 Partial Store Order
21837 @item tso
21838 Total Store Order
21840 @item sc
21841 Sequential Consistency
21842 @end table
21844 These memory models are formally defined in Appendix D of the Sparc V9
21845 architecture manual, as set in the processor's @code{PSTATE.MM} field.
21847 @item -mstack-bias
21848 @itemx -mno-stack-bias
21849 @opindex mstack-bias
21850 @opindex mno-stack-bias
21851 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
21852 frame pointer if present, are offset by @minus{}2047 which must be added back
21853 when making stack frame references.  This is the default in 64-bit mode.
21854 Otherwise, assume no such offset is present.
21855 @end table
21857 @node SPU Options
21858 @subsection SPU Options
21859 @cindex SPU options
21861 These @samp{-m} options are supported on the SPU:
21863 @table @gcctabopt
21864 @item -mwarn-reloc
21865 @itemx -merror-reloc
21866 @opindex mwarn-reloc
21867 @opindex merror-reloc
21869 The loader for SPU does not handle dynamic relocations.  By default, GCC
21870 gives an error when it generates code that requires a dynamic
21871 relocation.  @option{-mno-error-reloc} disables the error,
21872 @option{-mwarn-reloc} generates a warning instead.
21874 @item -msafe-dma
21875 @itemx -munsafe-dma
21876 @opindex msafe-dma
21877 @opindex munsafe-dma
21879 Instructions that initiate or test completion of DMA must not be
21880 reordered with respect to loads and stores of the memory that is being
21881 accessed.
21882 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
21883 memory accesses, but that can lead to inefficient code in places where the
21884 memory is known to not change.  Rather than mark the memory as volatile,
21885 you can use @option{-msafe-dma} to tell the compiler to treat
21886 the DMA instructions as potentially affecting all memory.  
21888 @item -mbranch-hints
21889 @opindex mbranch-hints
21891 By default, GCC generates a branch hint instruction to avoid
21892 pipeline stalls for always-taken or probably-taken branches.  A hint
21893 is not generated closer than 8 instructions away from its branch.
21894 There is little reason to disable them, except for debugging purposes,
21895 or to make an object a little bit smaller.
21897 @item -msmall-mem
21898 @itemx -mlarge-mem
21899 @opindex msmall-mem
21900 @opindex mlarge-mem
21902 By default, GCC generates code assuming that addresses are never larger
21903 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
21904 a full 32-bit address.
21906 @item -mstdmain
21907 @opindex mstdmain
21909 By default, GCC links against startup code that assumes the SPU-style
21910 main function interface (which has an unconventional parameter list).
21911 With @option{-mstdmain}, GCC links your program against startup
21912 code that assumes a C99-style interface to @code{main}, including a
21913 local copy of @code{argv} strings.
21915 @item -mfixed-range=@var{register-range}
21916 @opindex mfixed-range
21917 Generate code treating the given register range as fixed registers.
21918 A fixed register is one that the register allocator cannot use.  This is
21919 useful when compiling kernel code.  A register range is specified as
21920 two registers separated by a dash.  Multiple register ranges can be
21921 specified separated by a comma.
21923 @item -mea32
21924 @itemx -mea64
21925 @opindex mea32
21926 @opindex mea64
21927 Compile code assuming that pointers to the PPU address space accessed
21928 via the @code{__ea} named address space qualifier are either 32 or 64
21929 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
21930 all object code in an executable must be compiled with the same setting.
21932 @item -maddress-space-conversion
21933 @itemx -mno-address-space-conversion
21934 @opindex maddress-space-conversion
21935 @opindex mno-address-space-conversion
21936 Allow/disallow treating the @code{__ea} address space as superset
21937 of the generic address space.  This enables explicit type casts
21938 between @code{__ea} and generic pointer as well as implicit
21939 conversions of generic pointers to @code{__ea} pointers.  The
21940 default is to allow address space pointer conversions.
21942 @item -mcache-size=@var{cache-size}
21943 @opindex mcache-size
21944 This option controls the version of libgcc that the compiler links to an
21945 executable and selects a software-managed cache for accessing variables
21946 in the @code{__ea} address space with a particular cache size.  Possible
21947 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
21948 and @samp{128}.  The default cache size is 64KB.
21950 @item -matomic-updates
21951 @itemx -mno-atomic-updates
21952 @opindex matomic-updates
21953 @opindex mno-atomic-updates
21954 This option controls the version of libgcc that the compiler links to an
21955 executable and selects whether atomic updates to the software-managed
21956 cache of PPU-side variables are used.  If you use atomic updates, changes
21957 to a PPU variable from SPU code using the @code{__ea} named address space
21958 qualifier do not interfere with changes to other PPU variables residing
21959 in the same cache line from PPU code.  If you do not use atomic updates,
21960 such interference may occur; however, writing back cache lines is
21961 more efficient.  The default behavior is to use atomic updates.
21963 @item -mdual-nops
21964 @itemx -mdual-nops=@var{n}
21965 @opindex mdual-nops
21966 By default, GCC inserts nops to increase dual issue when it expects
21967 it to increase performance.  @var{n} can be a value from 0 to 10.  A
21968 smaller @var{n} inserts fewer nops.  10 is the default, 0 is the
21969 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
21971 @item -mhint-max-nops=@var{n}
21972 @opindex mhint-max-nops
21973 Maximum number of nops to insert for a branch hint.  A branch hint must
21974 be at least 8 instructions away from the branch it is affecting.  GCC
21975 inserts up to @var{n} nops to enforce this, otherwise it does not
21976 generate the branch hint.
21978 @item -mhint-max-distance=@var{n}
21979 @opindex mhint-max-distance
21980 The encoding of the branch hint instruction limits the hint to be within
21981 256 instructions of the branch it is affecting.  By default, GCC makes
21982 sure it is within 125.
21984 @item -msafe-hints
21985 @opindex msafe-hints
21986 Work around a hardware bug that causes the SPU to stall indefinitely.
21987 By default, GCC inserts the @code{hbrp} instruction to make sure
21988 this stall won't happen.
21990 @end table
21992 @node System V Options
21993 @subsection Options for System V
21995 These additional options are available on System V Release 4 for
21996 compatibility with other compilers on those systems:
21998 @table @gcctabopt
21999 @item -G
22000 @opindex G
22001 Create a shared object.
22002 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
22004 @item -Qy
22005 @opindex Qy
22006 Identify the versions of each tool used by the compiler, in a
22007 @code{.ident} assembler directive in the output.
22009 @item -Qn
22010 @opindex Qn
22011 Refrain from adding @code{.ident} directives to the output file (this is
22012 the default).
22014 @item -YP,@var{dirs}
22015 @opindex YP
22016 Search the directories @var{dirs}, and no others, for libraries
22017 specified with @option{-l}.
22019 @item -Ym,@var{dir}
22020 @opindex Ym
22021 Look in the directory @var{dir} to find the M4 preprocessor.
22022 The assembler uses this option.
22023 @c This is supposed to go with a -Yd for predefined M4 macro files, but
22024 @c the generic assembler that comes with Solaris takes just -Ym.
22025 @end table
22027 @node TILE-Gx Options
22028 @subsection TILE-Gx Options
22029 @cindex TILE-Gx options
22031 These @samp{-m} options are supported on the TILE-Gx:
22033 @table @gcctabopt
22034 @item -mcmodel=small
22035 @opindex mcmodel=small
22036 Generate code for the small model.  The distance for direct calls is
22037 limited to 500M in either direction.  PC-relative addresses are 32
22038 bits.  Absolute addresses support the full address range.
22040 @item -mcmodel=large
22041 @opindex mcmodel=large
22042 Generate code for the large model.  There is no limitation on call
22043 distance, pc-relative addresses, or absolute addresses.
22045 @item -mcpu=@var{name}
22046 @opindex mcpu
22047 Selects the type of CPU to be targeted.  Currently the only supported
22048 type is @samp{tilegx}.
22050 @item -m32
22051 @itemx -m64
22052 @opindex m32
22053 @opindex m64
22054 Generate code for a 32-bit or 64-bit environment.  The 32-bit
22055 environment sets int, long, and pointer to 32 bits.  The 64-bit
22056 environment sets int to 32 bits and long and pointer to 64 bits.
22058 @item -mbig-endian
22059 @itemx -mlittle-endian
22060 @opindex mbig-endian
22061 @opindex mlittle-endian
22062 Generate code in big/little endian mode, respectively.
22063 @end table
22065 @node TILEPro Options
22066 @subsection TILEPro Options
22067 @cindex TILEPro options
22069 These @samp{-m} options are supported on the TILEPro:
22071 @table @gcctabopt
22072 @item -mcpu=@var{name}
22073 @opindex mcpu
22074 Selects the type of CPU to be targeted.  Currently the only supported
22075 type is @samp{tilepro}.
22077 @item -m32
22078 @opindex m32
22079 Generate code for a 32-bit environment, which sets int, long, and
22080 pointer to 32 bits.  This is the only supported behavior so the flag
22081 is essentially ignored.
22082 @end table
22084 @node V850 Options
22085 @subsection V850 Options
22086 @cindex V850 Options
22088 These @samp{-m} options are defined for V850 implementations:
22090 @table @gcctabopt
22091 @item -mlong-calls
22092 @itemx -mno-long-calls
22093 @opindex mlong-calls
22094 @opindex mno-long-calls
22095 Treat all calls as being far away (near).  If calls are assumed to be
22096 far away, the compiler always loads the function's address into a
22097 register, and calls indirect through the pointer.
22099 @item -mno-ep
22100 @itemx -mep
22101 @opindex mno-ep
22102 @opindex mep
22103 Do not optimize (do optimize) basic blocks that use the same index
22104 pointer 4 or more times to copy pointer into the @code{ep} register, and
22105 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
22106 option is on by default if you optimize.
22108 @item -mno-prolog-function
22109 @itemx -mprolog-function
22110 @opindex mno-prolog-function
22111 @opindex mprolog-function
22112 Do not use (do use) external functions to save and restore registers
22113 at the prologue and epilogue of a function.  The external functions
22114 are slower, but use less code space if more than one function saves
22115 the same number of registers.  The @option{-mprolog-function} option
22116 is on by default if you optimize.
22118 @item -mspace
22119 @opindex mspace
22120 Try to make the code as small as possible.  At present, this just turns
22121 on the @option{-mep} and @option{-mprolog-function} options.
22123 @item -mtda=@var{n}
22124 @opindex mtda
22125 Put static or global variables whose size is @var{n} bytes or less into
22126 the tiny data area that register @code{ep} points to.  The tiny data
22127 area can hold up to 256 bytes in total (128 bytes for byte references).
22129 @item -msda=@var{n}
22130 @opindex msda
22131 Put static or global variables whose size is @var{n} bytes or less into
22132 the small data area that register @code{gp} points to.  The small data
22133 area can hold up to 64 kilobytes.
22135 @item -mzda=@var{n}
22136 @opindex mzda
22137 Put static or global variables whose size is @var{n} bytes or less into
22138 the first 32 kilobytes of memory.
22140 @item -mv850
22141 @opindex mv850
22142 Specify that the target processor is the V850.
22144 @item -mv850e3v5
22145 @opindex mv850e3v5
22146 Specify that the target processor is the V850E3V5.  The preprocessor
22147 constant @samp{__v850e3v5__} is defined if this option is used.
22149 @item -mv850e2v4
22150 @opindex mv850e2v4
22151 Specify that the target processor is the V850E3V5.  This is an alias for
22152 the @option{-mv850e3v5} option.
22154 @item -mv850e2v3
22155 @opindex mv850e2v3
22156 Specify that the target processor is the V850E2V3.  The preprocessor
22157 constant @samp{__v850e2v3__} is defined if this option is used.
22159 @item -mv850e2
22160 @opindex mv850e2
22161 Specify that the target processor is the V850E2.  The preprocessor
22162 constant @samp{__v850e2__} is defined if this option is used.
22164 @item -mv850e1
22165 @opindex mv850e1
22166 Specify that the target processor is the V850E1.  The preprocessor
22167 constants @samp{__v850e1__} and @samp{__v850e__} are defined if
22168 this option is used.
22170 @item -mv850es
22171 @opindex mv850es
22172 Specify that the target processor is the V850ES.  This is an alias for
22173 the @option{-mv850e1} option.
22175 @item -mv850e
22176 @opindex mv850e
22177 Specify that the target processor is the V850E@.  The preprocessor
22178 constant @samp{__v850e__} is defined if this option is used.
22180 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
22181 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
22182 are defined then a default target processor is chosen and the
22183 relevant @samp{__v850*__} preprocessor constant is defined.
22185 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
22186 defined, regardless of which processor variant is the target.
22188 @item -mdisable-callt
22189 @itemx -mno-disable-callt
22190 @opindex mdisable-callt
22191 @opindex mno-disable-callt
22192 This option suppresses generation of the @code{CALLT} instruction for the
22193 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
22194 architecture.
22196 This option is enabled by default when the RH850 ABI is
22197 in use (see @option{-mrh850-abi}), and disabled by default when the
22198 GCC ABI is in use.  If @code{CALLT} instructions are being generated
22199 then the C preprocessor symbol @code{__V850_CALLT__} will be defined.
22201 @item -mrelax
22202 @itemx -mno-relax
22203 @opindex mrelax
22204 @opindex mno-relax
22205 Pass on (or do not pass on) the @option{-mrelax} command line option
22206 to the assembler.
22208 @item -mlong-jumps
22209 @itemx -mno-long-jumps
22210 @opindex mlong-jumps
22211 @opindex mno-long-jumps
22212 Disable (or re-enable) the generation of PC-relative jump instructions.
22214 @item -msoft-float
22215 @itemx -mhard-float
22216 @opindex msoft-float
22217 @opindex mhard-float
22218 Disable (or re-enable) the generation of hardware floating point
22219 instructions.  This option is only significant when the target
22220 architecture is @samp{V850E2V3} or higher.  If hardware floating point
22221 instructions are being generated then the C preprocessor symbol
22222 @code{__FPU_OK__} will be defined, otherwise the symbol
22223 @code{__NO_FPU__} will be defined.
22225 @item -mloop
22226 @opindex mloop
22227 Enables the use of the e3v5 LOOP instruction.  The use of this
22228 instruction is not enabled by default when the e3v5 architecture is
22229 selected because its use is still experimental.
22231 @item -mrh850-abi
22232 @itemx -mghs
22233 @opindex mrh850-abi
22234 @opindex mghs
22235 Enables support for the RH850 version of the V850 ABI.  This is the
22236 default.  With this version of the ABI the following rules apply:
22238 @itemize
22239 @item
22240 Integer sized structures and unions are returned via a memory pointer
22241 rather than a register.
22243 @item
22244 Large structures and unions (more than 8 bytes in size) are passed by
22245 value.
22247 @item
22248 Functions are aligned to 16-bit boundaries.
22250 @item
22251 The @option{-m8byte-align} command line option is supported.
22253 @item
22254 The @option{-mdisable-callt} command line option is enabled by
22255 default.  The @option{-mno-disable-callt} command line option is not
22256 supported.
22257 @end itemize
22259 When this version of the ABI is enabled the C preprocessor symbol
22260 @code{__V850_RH850_ABI__} is defined.
22262 @item -mgcc-abi
22263 @opindex mgcc-abi
22264 Enables support for the old GCC version of the V850 ABI.  With this
22265 version of the ABI the following rules apply:
22267 @itemize
22268 @item
22269 Integer sized structures and unions are returned in register @code{r10}.
22271 @item
22272 Large structures and unions (more than 8 bytes in size) are passed by
22273 reference.
22275 @item
22276 Functions are aligned to 32-bit boundaries, unless optimizing for
22277 size.
22279 @item
22280 The @option{-m8byte-align} command line option is not supported.
22282 @item
22283 The @option{-mdisable-callt} command line option is supported but not
22284 enabled by default.
22285 @end itemize
22287 When this version of the ABI is enabled the C preprocessor symbol
22288 @code{__V850_GCC_ABI__} is defined.
22290 @item -m8byte-align
22291 @itemx -mno-8byte-align
22292 @opindex m8byte-align
22293 @opindex mno-8byte-align
22294 Enables support for @code{doubles} and @code{long long} types to be
22295 aligned on 8-byte boundaries.  The default is to restrict the
22296 alignment of all objects to at most 4-bytes.  When
22297 @option{-m8byte-align} is in effect the C preprocessor symbol
22298 @code{__V850_8BYTE_ALIGN__} will be defined.
22300 @item -mbig-switch
22301 @opindex mbig-switch
22302 Generate code suitable for big switch tables.  Use this option only if
22303 the assembler/linker complain about out of range branches within a switch
22304 table.
22306 @item -mapp-regs
22307 @opindex mapp-regs
22308 This option causes r2 and r5 to be used in the code generated by
22309 the compiler.  This setting is the default.
22311 @item -mno-app-regs
22312 @opindex mno-app-regs
22313 This option causes r2 and r5 to be treated as fixed registers.
22315 @end table
22317 @node VAX Options
22318 @subsection VAX Options
22319 @cindex VAX options
22321 These @samp{-m} options are defined for the VAX:
22323 @table @gcctabopt
22324 @item -munix
22325 @opindex munix
22326 Do not output certain jump instructions (@code{aobleq} and so on)
22327 that the Unix assembler for the VAX cannot handle across long
22328 ranges.
22330 @item -mgnu
22331 @opindex mgnu
22332 Do output those jump instructions, on the assumption that the
22333 GNU assembler is being used.
22335 @item -mg
22336 @opindex mg
22337 Output code for G-format floating-point numbers instead of D-format.
22338 @end table
22340 @node VMS Options
22341 @subsection VMS Options
22343 These @samp{-m} options are defined for the VMS implementations:
22345 @table @gcctabopt
22346 @item -mvms-return-codes
22347 @opindex mvms-return-codes
22348 Return VMS condition codes from @code{main}. The default is to return POSIX-style
22349 condition (e.g.@ error) codes.
22351 @item -mdebug-main=@var{prefix}
22352 @opindex mdebug-main=@var{prefix}
22353 Flag the first routine whose name starts with @var{prefix} as the main
22354 routine for the debugger.
22356 @item -mmalloc64
22357 @opindex mmalloc64
22358 Default to 64-bit memory allocation routines.
22360 @item -mpointer-size=@var{size}
22361 @opindex -mpointer-size=@var{size}
22362 Set the default size of pointers. Possible options for @var{size} are
22363 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
22364 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
22365 The later option disables @code{pragma pointer_size}.
22366 @end table
22368 @node VxWorks Options
22369 @subsection VxWorks Options
22370 @cindex VxWorks Options
22372 The options in this section are defined for all VxWorks targets.
22373 Options specific to the target hardware are listed with the other
22374 options for that target.
22376 @table @gcctabopt
22377 @item -mrtp
22378 @opindex mrtp
22379 GCC can generate code for both VxWorks kernels and real time processes
22380 (RTPs).  This option switches from the former to the latter.  It also
22381 defines the preprocessor macro @code{__RTP__}.
22383 @item -non-static
22384 @opindex non-static
22385 Link an RTP executable against shared libraries rather than static
22386 libraries.  The options @option{-static} and @option{-shared} can
22387 also be used for RTPs (@pxref{Link Options}); @option{-static}
22388 is the default.
22390 @item -Bstatic
22391 @itemx -Bdynamic
22392 @opindex Bstatic
22393 @opindex Bdynamic
22394 These options are passed down to the linker.  They are defined for
22395 compatibility with Diab.
22397 @item -Xbind-lazy
22398 @opindex Xbind-lazy
22399 Enable lazy binding of function calls.  This option is equivalent to
22400 @option{-Wl,-z,now} and is defined for compatibility with Diab.
22402 @item -Xbind-now
22403 @opindex Xbind-now
22404 Disable lazy binding of function calls.  This option is the default and
22405 is defined for compatibility with Diab.
22406 @end table
22408 @node x86-64 Options
22409 @subsection x86-64 Options
22410 @cindex x86-64 options
22412 These are listed under @xref{i386 and x86-64 Options}.
22414 @node Xstormy16 Options
22415 @subsection Xstormy16 Options
22416 @cindex Xstormy16 Options
22418 These options are defined for Xstormy16:
22420 @table @gcctabopt
22421 @item -msim
22422 @opindex msim
22423 Choose startup files and linker script suitable for the simulator.
22424 @end table
22426 @node Xtensa Options
22427 @subsection Xtensa Options
22428 @cindex Xtensa Options
22430 These options are supported for Xtensa targets:
22432 @table @gcctabopt
22433 @item -mconst16
22434 @itemx -mno-const16
22435 @opindex mconst16
22436 @opindex mno-const16
22437 Enable or disable use of @code{CONST16} instructions for loading
22438 constant values.  The @code{CONST16} instruction is currently not a
22439 standard option from Tensilica.  When enabled, @code{CONST16}
22440 instructions are always used in place of the standard @code{L32R}
22441 instructions.  The use of @code{CONST16} is enabled by default only if
22442 the @code{L32R} instruction is not available.
22444 @item -mfused-madd
22445 @itemx -mno-fused-madd
22446 @opindex mfused-madd
22447 @opindex mno-fused-madd
22448 Enable or disable use of fused multiply/add and multiply/subtract
22449 instructions in the floating-point option.  This has no effect if the
22450 floating-point option is not also enabled.  Disabling fused multiply/add
22451 and multiply/subtract instructions forces the compiler to use separate
22452 instructions for the multiply and add/subtract operations.  This may be
22453 desirable in some cases where strict IEEE 754-compliant results are
22454 required: the fused multiply add/subtract instructions do not round the
22455 intermediate result, thereby producing results with @emph{more} bits of
22456 precision than specified by the IEEE standard.  Disabling fused multiply
22457 add/subtract instructions also ensures that the program output is not
22458 sensitive to the compiler's ability to combine multiply and add/subtract
22459 operations.
22461 @item -mserialize-volatile
22462 @itemx -mno-serialize-volatile
22463 @opindex mserialize-volatile
22464 @opindex mno-serialize-volatile
22465 When this option is enabled, GCC inserts @code{MEMW} instructions before
22466 @code{volatile} memory references to guarantee sequential consistency.
22467 The default is @option{-mserialize-volatile}.  Use
22468 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
22470 @item -mforce-no-pic
22471 @opindex mforce-no-pic
22472 For targets, like GNU/Linux, where all user-mode Xtensa code must be
22473 position-independent code (PIC), this option disables PIC for compiling
22474 kernel code.
22476 @item -mtext-section-literals
22477 @itemx -mno-text-section-literals
22478 @opindex mtext-section-literals
22479 @opindex mno-text-section-literals
22480 Control the treatment of literal pools.  The default is
22481 @option{-mno-text-section-literals}, which places literals in a separate
22482 section in the output file.  This allows the literal pool to be placed
22483 in a data RAM/ROM, and it also allows the linker to combine literal
22484 pools from separate object files to remove redundant literals and
22485 improve code size.  With @option{-mtext-section-literals}, the literals
22486 are interspersed in the text section in order to keep them as close as
22487 possible to their references.  This may be necessary for large assembly
22488 files.
22490 @item -mtarget-align
22491 @itemx -mno-target-align
22492 @opindex mtarget-align
22493 @opindex mno-target-align
22494 When this option is enabled, GCC instructs the assembler to
22495 automatically align instructions to reduce branch penalties at the
22496 expense of some code density.  The assembler attempts to widen density
22497 instructions to align branch targets and the instructions following call
22498 instructions.  If there are not enough preceding safe density
22499 instructions to align a target, no widening is performed.  The
22500 default is @option{-mtarget-align}.  These options do not affect the
22501 treatment of auto-aligned instructions like @code{LOOP}, which the
22502 assembler always aligns, either by widening density instructions or
22503 by inserting NOP instructions.
22505 @item -mlongcalls
22506 @itemx -mno-longcalls
22507 @opindex mlongcalls
22508 @opindex mno-longcalls
22509 When this option is enabled, GCC instructs the assembler to translate
22510 direct calls to indirect calls unless it can determine that the target
22511 of a direct call is in the range allowed by the call instruction.  This
22512 translation typically occurs for calls to functions in other source
22513 files.  Specifically, the assembler translates a direct @code{CALL}
22514 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
22515 The default is @option{-mno-longcalls}.  This option should be used in
22516 programs where the call target can potentially be out of range.  This
22517 option is implemented in the assembler, not the compiler, so the
22518 assembly code generated by GCC still shows direct call
22519 instructions---look at the disassembled object code to see the actual
22520 instructions.  Note that the assembler uses an indirect call for
22521 every cross-file call, not just those that really are out of range.
22522 @end table
22524 @node zSeries Options
22525 @subsection zSeries Options
22526 @cindex zSeries options
22528 These are listed under @xref{S/390 and zSeries Options}.
22530 @node Code Gen Options
22531 @section Options for Code Generation Conventions
22532 @cindex code generation conventions
22533 @cindex options, code generation
22534 @cindex run-time options
22536 These machine-independent options control the interface conventions
22537 used in code generation.
22539 Most of them have both positive and negative forms; the negative form
22540 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
22541 one of the forms is listed---the one that is not the default.  You
22542 can figure out the other form by either removing @samp{no-} or adding
22545 @table @gcctabopt
22546 @item -fbounds-check
22547 @opindex fbounds-check
22548 For front ends that support it, generate additional code to check that
22549 indices used to access arrays are within the declared range.  This is
22550 currently only supported by the Java and Fortran front ends, where
22551 this option defaults to true and false respectively.
22553 @item -fstack-reuse=@var{reuse-level}
22554 @opindex fstack_reuse
22555 This option controls stack space reuse for user declared local/auto variables
22556 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
22557 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
22558 local variables and temporaries, @samp{named_vars} enables the reuse only for
22559 user defined local variables with names, and @samp{none} disables stack reuse
22560 completely. The default value is @samp{all}. The option is needed when the
22561 program extends the lifetime of a scoped local variable or a compiler generated
22562 temporary beyond the end point defined by the language.  When a lifetime of
22563 a variable ends, and if the variable lives in memory, the optimizing compiler
22564 has the freedom to reuse its stack space with other temporaries or scoped
22565 local variables whose live range does not overlap with it. Legacy code extending
22566 local lifetime will likely to break with the stack reuse optimization.
22568 For example,
22570 @smallexample
22571    int *p;
22572    @{
22573      int local1;
22575      p = &local1;
22576      local1 = 10;
22577      ....
22578    @}
22579    @{
22580       int local2;
22581       local2 = 20;
22582       ...
22583    @}
22585    if (*p == 10)  // out of scope use of local1
22586      @{
22588      @}
22589 @end smallexample
22591 Another example:
22592 @smallexample
22594    struct A
22595    @{
22596        A(int k) : i(k), j(k) @{ @}
22597        int i;
22598        int j;
22599    @};
22601    A *ap;
22603    void foo(const A& ar)
22604    @{
22605       ap = &ar;
22606    @}
22608    void bar()
22609    @{
22610       foo(A(10)); // temp object's lifetime ends when foo returns
22612       @{
22613         A a(20);
22614         ....
22615       @}
22616       ap->i+= 10;  // ap references out of scope temp whose space
22617                    // is reused with a. What is the value of ap->i?
22618    @}
22620 @end smallexample
22622 The lifetime of a compiler generated temporary is well defined by the C++
22623 standard. When a lifetime of a temporary ends, and if the temporary lives
22624 in memory, the optimizing compiler has the freedom to reuse its stack
22625 space with other temporaries or scoped local variables whose live range
22626 does not overlap with it. However some of the legacy code relies on
22627 the behavior of older compilers in which temporaries' stack space is
22628 not reused, the aggressive stack reuse can lead to runtime errors. This
22629 option is used to control the temporary stack reuse optimization.
22631 @item -ftrapv
22632 @opindex ftrapv
22633 This option generates traps for signed overflow on addition, subtraction,
22634 multiplication operations.
22636 @item -fwrapv
22637 @opindex fwrapv
22638 This option instructs the compiler to assume that signed arithmetic
22639 overflow of addition, subtraction and multiplication wraps around
22640 using twos-complement representation.  This flag enables some optimizations
22641 and disables others.  This option is enabled by default for the Java
22642 front end, as required by the Java language specification.
22644 @item -fexceptions
22645 @opindex fexceptions
22646 Enable exception handling.  Generates extra code needed to propagate
22647 exceptions.  For some targets, this implies GCC generates frame
22648 unwind information for all functions, which can produce significant data
22649 size overhead, although it does not affect execution.  If you do not
22650 specify this option, GCC enables it by default for languages like
22651 C++ that normally require exception handling, and disables it for
22652 languages like C that do not normally require it.  However, you may need
22653 to enable this option when compiling C code that needs to interoperate
22654 properly with exception handlers written in C++.  You may also wish to
22655 disable this option if you are compiling older C++ programs that don't
22656 use exception handling.
22658 @item -fnon-call-exceptions
22659 @opindex fnon-call-exceptions
22660 Generate code that allows trapping instructions to throw exceptions.
22661 Note that this requires platform-specific runtime support that does
22662 not exist everywhere.  Moreover, it only allows @emph{trapping}
22663 instructions to throw exceptions, i.e.@: memory references or floating-point
22664 instructions.  It does not allow exceptions to be thrown from
22665 arbitrary signal handlers such as @code{SIGALRM}.
22667 @item -fdelete-dead-exceptions
22668 @opindex fdelete-dead-exceptions
22669 Consider that instructions that may throw exceptions but don't otherwise
22670 contribute to the execution of the program can be optimized away.
22671 This option is enabled by default for the Ada front end, as permitted by
22672 the Ada language specification.
22673 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
22675 @item -funwind-tables
22676 @opindex funwind-tables
22677 Similar to @option{-fexceptions}, except that it just generates any needed
22678 static data, but does not affect the generated code in any other way.
22679 You normally do not need to enable this option; instead, a language processor
22680 that needs this handling enables it on your behalf.
22682 @item -fasynchronous-unwind-tables
22683 @opindex fasynchronous-unwind-tables
22684 Generate unwind table in DWARF 2 format, if supported by target machine.  The
22685 table is exact at each instruction boundary, so it can be used for stack
22686 unwinding from asynchronous events (such as debugger or garbage collector).
22688 @item -fno-gnu-unique
22689 @opindex fno-gnu-unique
22690 On systems with recent GNU assembler and C library, the C++ compiler
22691 uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
22692 of template static data members and static local variables in inline
22693 functions are unique even in the presence of @code{RTLD_LOCAL}; this
22694 is necessary to avoid problems with a library used by two different
22695 @code{RTLD_LOCAL} plugins depending on a definition in one of them and
22696 therefore disagreeing with the other one about the binding of the
22697 symbol.  But this causes @code{dlclose} to be ignored for affected
22698 DSOs; if your program relies on reinitialization of a DSO via
22699 @code{dlclose} and @code{dlopen}, you can use
22700 @option{-fno-gnu-unique}.
22702 @item -fpcc-struct-return
22703 @opindex fpcc-struct-return
22704 Return ``short'' @code{struct} and @code{union} values in memory like
22705 longer ones, rather than in registers.  This convention is less
22706 efficient, but it has the advantage of allowing intercallability between
22707 GCC-compiled files and files compiled with other compilers, particularly
22708 the Portable C Compiler (pcc).
22710 The precise convention for returning structures in memory depends
22711 on the target configuration macros.
22713 Short structures and unions are those whose size and alignment match
22714 that of some integer type.
22716 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
22717 switch is not binary compatible with code compiled with the
22718 @option{-freg-struct-return} switch.
22719 Use it to conform to a non-default application binary interface.
22721 @item -freg-struct-return
22722 @opindex freg-struct-return
22723 Return @code{struct} and @code{union} values in registers when possible.
22724 This is more efficient for small structures than
22725 @option{-fpcc-struct-return}.
22727 If you specify neither @option{-fpcc-struct-return} nor
22728 @option{-freg-struct-return}, GCC defaults to whichever convention is
22729 standard for the target.  If there is no standard convention, GCC
22730 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
22731 the principal compiler.  In those cases, we can choose the standard, and
22732 we chose the more efficient register return alternative.
22734 @strong{Warning:} code compiled with the @option{-freg-struct-return}
22735 switch is not binary compatible with code compiled with the
22736 @option{-fpcc-struct-return} switch.
22737 Use it to conform to a non-default application binary interface.
22739 @item -fshort-enums
22740 @opindex fshort-enums
22741 Allocate to an @code{enum} type only as many bytes as it needs for the
22742 declared range of possible values.  Specifically, the @code{enum} type
22743 is equivalent to the smallest integer type that has enough room.
22745 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
22746 code that is not binary compatible with code generated without that switch.
22747 Use it to conform to a non-default application binary interface.
22749 @item -fshort-double
22750 @opindex fshort-double
22751 Use the same size for @code{double} as for @code{float}.
22753 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
22754 code that is not binary compatible with code generated without that switch.
22755 Use it to conform to a non-default application binary interface.
22757 @item -fshort-wchar
22758 @opindex fshort-wchar
22759 Override the underlying type for @samp{wchar_t} to be @samp{short
22760 unsigned int} instead of the default for the target.  This option is
22761 useful for building programs to run under WINE@.
22763 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
22764 code that is not binary compatible with code generated without that switch.
22765 Use it to conform to a non-default application binary interface.
22767 @item -fno-common
22768 @opindex fno-common
22769 In C code, controls the placement of uninitialized global variables.
22770 Unix C compilers have traditionally permitted multiple definitions of
22771 such variables in different compilation units by placing the variables
22772 in a common block.
22773 This is the behavior specified by @option{-fcommon}, and is the default
22774 for GCC on most targets.
22775 On the other hand, this behavior is not required by ISO C, and on some
22776 targets may carry a speed or code size penalty on variable references.
22777 The @option{-fno-common} option specifies that the compiler should place
22778 uninitialized global variables in the data section of the object file,
22779 rather than generating them as common blocks.
22780 This has the effect that if the same variable is declared
22781 (without @code{extern}) in two different compilations,
22782 you get a multiple-definition error when you link them.
22783 In this case, you must compile with @option{-fcommon} instead.
22784 Compiling with @option{-fno-common} is useful on targets for which
22785 it provides better performance, or if you wish to verify that the
22786 program will work on other systems that always treat uninitialized
22787 variable declarations this way.
22789 @item -fno-ident
22790 @opindex fno-ident
22791 Ignore the @samp{#ident} directive.
22793 @item -finhibit-size-directive
22794 @opindex finhibit-size-directive
22795 Don't output a @code{.size} assembler directive, or anything else that
22796 would cause trouble if the function is split in the middle, and the
22797 two halves are placed at locations far apart in memory.  This option is
22798 used when compiling @file{crtstuff.c}; you should not need to use it
22799 for anything else.
22801 @item -fverbose-asm
22802 @opindex fverbose-asm
22803 Put extra commentary information in the generated assembly code to
22804 make it more readable.  This option is generally only of use to those
22805 who actually need to read the generated assembly code (perhaps while
22806 debugging the compiler itself).
22808 @option{-fno-verbose-asm}, the default, causes the
22809 extra information to be omitted and is useful when comparing two assembler
22810 files.
22812 @item -frecord-gcc-switches
22813 @opindex frecord-gcc-switches
22814 This switch causes the command line used to invoke the
22815 compiler to be recorded into the object file that is being created.
22816 This switch is only implemented on some targets and the exact format
22817 of the recording is target and binary file format dependent, but it
22818 usually takes the form of a section containing ASCII text.  This
22819 switch is related to the @option{-fverbose-asm} switch, but that
22820 switch only records information in the assembler output file as
22821 comments, so it never reaches the object file.
22822 See also @option{-grecord-gcc-switches} for another
22823 way of storing compiler options into the object file.
22825 @item -fpic
22826 @opindex fpic
22827 @cindex global offset table
22828 @cindex PIC
22829 Generate position-independent code (PIC) suitable for use in a shared
22830 library, if supported for the target machine.  Such code accesses all
22831 constant addresses through a global offset table (GOT)@.  The dynamic
22832 loader resolves the GOT entries when the program starts (the dynamic
22833 loader is not part of GCC; it is part of the operating system).  If
22834 the GOT size for the linked executable exceeds a machine-specific
22835 maximum size, you get an error message from the linker indicating that
22836 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
22837 instead.  (These maximums are 8k on the SPARC and 32k
22838 on the m68k and RS/6000.  The 386 has no such limit.)
22840 Position-independent code requires special support, and therefore works
22841 only on certain machines.  For the 386, GCC supports PIC for System V
22842 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
22843 position-independent.
22845 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
22846 are defined to 1.
22848 @item -fPIC
22849 @opindex fPIC
22850 If supported for the target machine, emit position-independent code,
22851 suitable for dynamic linking and avoiding any limit on the size of the
22852 global offset table.  This option makes a difference on the m68k,
22853 PowerPC and SPARC@.
22855 Position-independent code requires special support, and therefore works
22856 only on certain machines.
22858 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
22859 are defined to 2.
22861 @item -fpie
22862 @itemx -fPIE
22863 @opindex fpie
22864 @opindex fPIE
22865 These options are similar to @option{-fpic} and @option{-fPIC}, but
22866 generated position independent code can be only linked into executables.
22867 Usually these options are used when @option{-pie} GCC option is
22868 used during linking.
22870 @option{-fpie} and @option{-fPIE} both define the macros
22871 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
22872 for @option{-fpie} and 2 for @option{-fPIE}.
22874 @item -fno-jump-tables
22875 @opindex fno-jump-tables
22876 Do not use jump tables for switch statements even where it would be
22877 more efficient than other code generation strategies.  This option is
22878 of use in conjunction with @option{-fpic} or @option{-fPIC} for
22879 building code that forms part of a dynamic linker and cannot
22880 reference the address of a jump table.  On some targets, jump tables
22881 do not require a GOT and this option is not needed.
22883 @item -ffixed-@var{reg}
22884 @opindex ffixed
22885 Treat the register named @var{reg} as a fixed register; generated code
22886 should never refer to it (except perhaps as a stack pointer, frame
22887 pointer or in some other fixed role).
22889 @var{reg} must be the name of a register.  The register names accepted
22890 are machine-specific and are defined in the @code{REGISTER_NAMES}
22891 macro in the machine description macro file.
22893 This flag does not have a negative form, because it specifies a
22894 three-way choice.
22896 @item -fcall-used-@var{reg}
22897 @opindex fcall-used
22898 Treat the register named @var{reg} as an allocable register that is
22899 clobbered by function calls.  It may be allocated for temporaries or
22900 variables that do not live across a call.  Functions compiled this way
22901 do not save and restore the register @var{reg}.
22903 It is an error to use this flag with the frame pointer or stack pointer.
22904 Use of this flag for other registers that have fixed pervasive roles in
22905 the machine's execution model produces disastrous results.
22907 This flag does not have a negative form, because it specifies a
22908 three-way choice.
22910 @item -fcall-saved-@var{reg}
22911 @opindex fcall-saved
22912 Treat the register named @var{reg} as an allocable register saved by
22913 functions.  It may be allocated even for temporaries or variables that
22914 live across a call.  Functions compiled this way save and restore
22915 the register @var{reg} if they use it.
22917 It is an error to use this flag with the frame pointer or stack pointer.
22918 Use of this flag for other registers that have fixed pervasive roles in
22919 the machine's execution model produces disastrous results.
22921 A different sort of disaster results from the use of this flag for
22922 a register in which function values may be returned.
22924 This flag does not have a negative form, because it specifies a
22925 three-way choice.
22927 @item -fpack-struct[=@var{n}]
22928 @opindex fpack-struct
22929 Without a value specified, pack all structure members together without
22930 holes.  When a value is specified (which must be a small power of two), pack
22931 structure members according to this value, representing the maximum
22932 alignment (that is, objects with default alignment requirements larger than
22933 this are output potentially unaligned at the next fitting location.
22935 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
22936 code that is not binary compatible with code generated without that switch.
22937 Additionally, it makes the code suboptimal.
22938 Use it to conform to a non-default application binary interface.
22940 @item -finstrument-functions
22941 @opindex finstrument-functions
22942 Generate instrumentation calls for entry and exit to functions.  Just
22943 after function entry and just before function exit, the following
22944 profiling functions are called with the address of the current
22945 function and its call site.  (On some platforms,
22946 @code{__builtin_return_address} does not work beyond the current
22947 function, so the call site information may not be available to the
22948 profiling functions otherwise.)
22950 @smallexample
22951 void __cyg_profile_func_enter (void *this_fn,
22952                                void *call_site);
22953 void __cyg_profile_func_exit  (void *this_fn,
22954                                void *call_site);
22955 @end smallexample
22957 The first argument is the address of the start of the current function,
22958 which may be looked up exactly in the symbol table.
22960 This instrumentation is also done for functions expanded inline in other
22961 functions.  The profiling calls indicate where, conceptually, the
22962 inline function is entered and exited.  This means that addressable
22963 versions of such functions must be available.  If all your uses of a
22964 function are expanded inline, this may mean an additional expansion of
22965 code size.  If you use @samp{extern inline} in your C code, an
22966 addressable version of such functions must be provided.  (This is
22967 normally the case anyway, but if you get lucky and the optimizer always
22968 expands the functions inline, you might have gotten away without
22969 providing static copies.)
22971 A function may be given the attribute @code{no_instrument_function}, in
22972 which case this instrumentation is not done.  This can be used, for
22973 example, for the profiling functions listed above, high-priority
22974 interrupt routines, and any functions from which the profiling functions
22975 cannot safely be called (perhaps signal handlers, if the profiling
22976 routines generate output or allocate memory).
22978 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
22979 @opindex finstrument-functions-exclude-file-list
22981 Set the list of functions that are excluded from instrumentation (see
22982 the description of @code{-finstrument-functions}).  If the file that
22983 contains a function definition matches with one of @var{file}, then
22984 that function is not instrumented.  The match is done on substrings:
22985 if the @var{file} parameter is a substring of the file name, it is
22986 considered to be a match.
22988 For example:
22990 @smallexample
22991 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
22992 @end smallexample
22994 @noindent
22995 excludes any inline function defined in files whose pathnames
22996 contain @code{/bits/stl} or @code{include/sys}.
22998 If, for some reason, you want to include letter @code{','} in one of
22999 @var{sym}, write @code{'\,'}. For example,
23000 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
23001 (note the single quote surrounding the option).
23003 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
23004 @opindex finstrument-functions-exclude-function-list
23006 This is similar to @code{-finstrument-functions-exclude-file-list},
23007 but this option sets the list of function names to be excluded from
23008 instrumentation.  The function name to be matched is its user-visible
23009 name, such as @code{vector<int> blah(const vector<int> &)}, not the
23010 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
23011 match is done on substrings: if the @var{sym} parameter is a substring
23012 of the function name, it is considered to be a match.  For C99 and C++
23013 extended identifiers, the function name must be given in UTF-8, not
23014 using universal character names.
23016 @item -fstack-check
23017 @opindex fstack-check
23018 Generate code to verify that you do not go beyond the boundary of the
23019 stack.  You should specify this flag if you are running in an
23020 environment with multiple threads, but you only rarely need to specify it in
23021 a single-threaded environment since stack overflow is automatically
23022 detected on nearly all systems if there is only one stack.
23024 Note that this switch does not actually cause checking to be done; the
23025 operating system or the language runtime must do that.  The switch causes
23026 generation of code to ensure that they see the stack being extended.
23028 You can additionally specify a string parameter: @code{no} means no
23029 checking, @code{generic} means force the use of old-style checking,
23030 @code{specific} means use the best checking method and is equivalent
23031 to bare @option{-fstack-check}.
23033 Old-style checking is a generic mechanism that requires no specific
23034 target support in the compiler but comes with the following drawbacks:
23036 @enumerate
23037 @item
23038 Modified allocation strategy for large objects: they are always
23039 allocated dynamically if their size exceeds a fixed threshold.
23041 @item
23042 Fixed limit on the size of the static frame of functions: when it is
23043 topped by a particular function, stack checking is not reliable and
23044 a warning is issued by the compiler.
23046 @item
23047 Inefficiency: because of both the modified allocation strategy and the
23048 generic implementation, code performance is hampered.
23049 @end enumerate
23051 Note that old-style stack checking is also the fallback method for
23052 @code{specific} if no target support has been added in the compiler.
23054 @item -fstack-limit-register=@var{reg}
23055 @itemx -fstack-limit-symbol=@var{sym}
23056 @itemx -fno-stack-limit
23057 @opindex fstack-limit-register
23058 @opindex fstack-limit-symbol
23059 @opindex fno-stack-limit
23060 Generate code to ensure that the stack does not grow beyond a certain value,
23061 either the value of a register or the address of a symbol.  If a larger
23062 stack is required, a signal is raised at run time.  For most targets,
23063 the signal is raised before the stack overruns the boundary, so
23064 it is possible to catch the signal without taking special precautions.
23066 For instance, if the stack starts at absolute address @samp{0x80000000}
23067 and grows downwards, you can use the flags
23068 @option{-fstack-limit-symbol=__stack_limit} and
23069 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
23070 of 128KB@.  Note that this may only work with the GNU linker.
23072 @item -fsplit-stack
23073 @opindex fsplit-stack
23074 Generate code to automatically split the stack before it overflows.
23075 The resulting program has a discontiguous stack which can only
23076 overflow if the program is unable to allocate any more memory.  This
23077 is most useful when running threaded programs, as it is no longer
23078 necessary to calculate a good stack size to use for each thread.  This
23079 is currently only implemented for the i386 and x86_64 back ends running
23080 GNU/Linux.
23082 When code compiled with @option{-fsplit-stack} calls code compiled
23083 without @option{-fsplit-stack}, there may not be much stack space
23084 available for the latter code to run.  If compiling all code,
23085 including library code, with @option{-fsplit-stack} is not an option,
23086 then the linker can fix up these calls so that the code compiled
23087 without @option{-fsplit-stack} always has a large stack.  Support for
23088 this is implemented in the gold linker in GNU binutils release 2.21
23089 and later.
23091 @item -fleading-underscore
23092 @opindex fleading-underscore
23093 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
23094 change the way C symbols are represented in the object file.  One use
23095 is to help link with legacy assembly code.
23097 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
23098 generate code that is not binary compatible with code generated without that
23099 switch.  Use it to conform to a non-default application binary interface.
23100 Not all targets provide complete support for this switch.
23102 @item -ftls-model=@var{model}
23103 @opindex ftls-model
23104 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
23105 The @var{model} argument should be one of @code{global-dynamic},
23106 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
23107 Note that the choice is subject to optimization: the compiler may use
23108 a more efficient model for symbols not visible outside of the translation
23109 unit, or if @option{-fpic} is not given on the command line.
23111 The default without @option{-fpic} is @code{initial-exec}; with
23112 @option{-fpic} the default is @code{global-dynamic}.
23114 @item -fvisibility=@var{default|internal|hidden|protected}
23115 @opindex fvisibility
23116 Set the default ELF image symbol visibility to the specified option---all
23117 symbols are marked with this unless overridden within the code.
23118 Using this feature can very substantially improve linking and
23119 load times of shared object libraries, produce more optimized
23120 code, provide near-perfect API export and prevent symbol clashes.
23121 It is @strong{strongly} recommended that you use this in any shared objects
23122 you distribute.
23124 Despite the nomenclature, @code{default} always means public; i.e.,
23125 available to be linked against from outside the shared object.
23126 @code{protected} and @code{internal} are pretty useless in real-world
23127 usage so the only other commonly used option is @code{hidden}.
23128 The default if @option{-fvisibility} isn't specified is
23129 @code{default}, i.e., make every
23130 symbol public---this causes the same behavior as previous versions of
23131 GCC@.
23133 A good explanation of the benefits offered by ensuring ELF
23134 symbols have the correct visibility is given by ``How To Write
23135 Shared Libraries'' by Ulrich Drepper (which can be found at
23136 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
23137 solution made possible by this option to marking things hidden when
23138 the default is public is to make the default hidden and mark things
23139 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
23140 and @code{__attribute__ ((visibility("default")))} instead of
23141 @code{__declspec(dllexport)} you get almost identical semantics with
23142 identical syntax.  This is a great boon to those working with
23143 cross-platform projects.
23145 For those adding visibility support to existing code, you may find
23146 @samp{#pragma GCC visibility} of use.  This works by you enclosing
23147 the declarations you wish to set visibility for with (for example)
23148 @samp{#pragma GCC visibility push(hidden)} and
23149 @samp{#pragma GCC visibility pop}.
23150 Bear in mind that symbol visibility should be viewed @strong{as
23151 part of the API interface contract} and thus all new code should
23152 always specify visibility when it is not the default; i.e., declarations
23153 only for use within the local DSO should @strong{always} be marked explicitly
23154 as hidden as so to avoid PLT indirection overheads---making this
23155 abundantly clear also aids readability and self-documentation of the code.
23156 Note that due to ISO C++ specification requirements, @code{operator new} and
23157 @code{operator delete} must always be of default visibility.
23159 Be aware that headers from outside your project, in particular system
23160 headers and headers from any other library you use, may not be
23161 expecting to be compiled with visibility other than the default.  You
23162 may need to explicitly say @samp{#pragma GCC visibility push(default)}
23163 before including any such headers.
23165 @samp{extern} declarations are not affected by @option{-fvisibility}, so
23166 a lot of code can be recompiled with @option{-fvisibility=hidden} with
23167 no modifications.  However, this means that calls to @code{extern}
23168 functions with no explicit visibility use the PLT, so it is more
23169 effective to use @code{__attribute ((visibility))} and/or
23170 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
23171 declarations should be treated as hidden.
23173 Note that @option{-fvisibility} does affect C++ vague linkage
23174 entities. This means that, for instance, an exception class that is
23175 be thrown between DSOs must be explicitly marked with default
23176 visibility so that the @samp{type_info} nodes are unified between
23177 the DSOs.
23179 An overview of these techniques, their benefits and how to use them
23180 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
23182 @item -fstrict-volatile-bitfields
23183 @opindex fstrict-volatile-bitfields
23184 This option should be used if accesses to volatile bit-fields (or other
23185 structure fields, although the compiler usually honors those types
23186 anyway) should use a single access of the width of the
23187 field's type, aligned to a natural alignment if possible.  For
23188 example, targets with memory-mapped peripheral registers might require
23189 all such accesses to be 16 bits wide; with this flag you can
23190 declare all peripheral bit-fields as @code{unsigned short} (assuming short
23191 is 16 bits on these targets) to force GCC to use 16-bit accesses
23192 instead of, perhaps, a more efficient 32-bit access.
23194 If this option is disabled, the compiler uses the most efficient
23195 instruction.  In the previous example, that might be a 32-bit load
23196 instruction, even though that accesses bytes that do not contain
23197 any portion of the bit-field, or memory-mapped registers unrelated to
23198 the one being updated.
23200 In some cases, such as when the @code{packed} attribute is applied to a 
23201 structure field, it may not be possible to access the field with a single
23202 read or write that is correctly aligned for the target machine.  In this
23203 case GCC falls back to generating multiple accesses rather than code that 
23204 will fault or truncate the result at run time.
23206 Note:  Due to restrictions of the C/C++11 memory model, write accesses are
23207 not allowed to touch non bit-field members.  It is therefore recommended
23208 to define all bits of the field's type as bit-field members.
23210 The default value of this option is determined by the application binary
23211 interface for the target processor.
23213 @item -fsync-libcalls
23214 @opindex fsync-libcalls
23215 This option controls whether any out-of-line instance of the @code{__sync}
23216 family of functions may be used to implement the C++11 @code{__atomic}
23217 family of functions.
23219 The default value of this option is enabled, thus the only useful form
23220 of the option is @option{-fno-sync-libcalls}.  This option is used in
23221 the implementation of the @file{libatomic} runtime library.
23223 @end table
23225 @c man end
23227 @node Environment Variables
23228 @section Environment Variables Affecting GCC
23229 @cindex environment variables
23231 @c man begin ENVIRONMENT
23232 This section describes several environment variables that affect how GCC
23233 operates.  Some of them work by specifying directories or prefixes to use
23234 when searching for various kinds of files.  Some are used to specify other
23235 aspects of the compilation environment.
23237 Note that you can also specify places to search using options such as
23238 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
23239 take precedence over places specified using environment variables, which
23240 in turn take precedence over those specified by the configuration of GCC@.
23241 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
23242 GNU Compiler Collection (GCC) Internals}.
23244 @table @env
23245 @item LANG
23246 @itemx LC_CTYPE
23247 @c @itemx LC_COLLATE
23248 @itemx LC_MESSAGES
23249 @c @itemx LC_MONETARY
23250 @c @itemx LC_NUMERIC
23251 @c @itemx LC_TIME
23252 @itemx LC_ALL
23253 @findex LANG
23254 @findex LC_CTYPE
23255 @c @findex LC_COLLATE
23256 @findex LC_MESSAGES
23257 @c @findex LC_MONETARY
23258 @c @findex LC_NUMERIC
23259 @c @findex LC_TIME
23260 @findex LC_ALL
23261 @cindex locale
23262 These environment variables control the way that GCC uses
23263 localization information which allows GCC to work with different
23264 national conventions.  GCC inspects the locale categories
23265 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
23266 so.  These locale categories can be set to any value supported by your
23267 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
23268 Kingdom encoded in UTF-8.
23270 The @env{LC_CTYPE} environment variable specifies character
23271 classification.  GCC uses it to determine the character boundaries in
23272 a string; this is needed for some multibyte encodings that contain quote
23273 and escape characters that are otherwise interpreted as a string
23274 end or escape.
23276 The @env{LC_MESSAGES} environment variable specifies the language to
23277 use in diagnostic messages.
23279 If the @env{LC_ALL} environment variable is set, it overrides the value
23280 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
23281 and @env{LC_MESSAGES} default to the value of the @env{LANG}
23282 environment variable.  If none of these variables are set, GCC
23283 defaults to traditional C English behavior.
23285 @item TMPDIR
23286 @findex TMPDIR
23287 If @env{TMPDIR} is set, it specifies the directory to use for temporary
23288 files.  GCC uses temporary files to hold the output of one stage of
23289 compilation which is to be used as input to the next stage: for example,
23290 the output of the preprocessor, which is the input to the compiler
23291 proper.
23293 @item GCC_COMPARE_DEBUG
23294 @findex GCC_COMPARE_DEBUG
23295 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
23296 @option{-fcompare-debug} to the compiler driver.  See the documentation
23297 of this option for more details.
23299 @item GCC_EXEC_PREFIX
23300 @findex GCC_EXEC_PREFIX
23301 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
23302 names of the subprograms executed by the compiler.  No slash is added
23303 when this prefix is combined with the name of a subprogram, but you can
23304 specify a prefix that ends with a slash if you wish.
23306 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
23307 an appropriate prefix to use based on the pathname it is invoked with.
23309 If GCC cannot find the subprogram using the specified prefix, it
23310 tries looking in the usual places for the subprogram.
23312 The default value of @env{GCC_EXEC_PREFIX} is
23313 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
23314 the installed compiler. In many cases @var{prefix} is the value
23315 of @code{prefix} when you ran the @file{configure} script.
23317 Other prefixes specified with @option{-B} take precedence over this prefix.
23319 This prefix is also used for finding files such as @file{crt0.o} that are
23320 used for linking.
23322 In addition, the prefix is used in an unusual way in finding the
23323 directories to search for header files.  For each of the standard
23324 directories whose name normally begins with @samp{/usr/local/lib/gcc}
23325 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
23326 replacing that beginning with the specified prefix to produce an
23327 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
23328 @file{foo/bar} just before it searches the standard directory 
23329 @file{/usr/local/lib/bar}.
23330 If a standard directory begins with the configured
23331 @var{prefix} then the value of @var{prefix} is replaced by
23332 @env{GCC_EXEC_PREFIX} when looking for header files.
23334 @item COMPILER_PATH
23335 @findex COMPILER_PATH
23336 The value of @env{COMPILER_PATH} is a colon-separated list of
23337 directories, much like @env{PATH}.  GCC tries the directories thus
23338 specified when searching for subprograms, if it can't find the
23339 subprograms using @env{GCC_EXEC_PREFIX}.
23341 @item LIBRARY_PATH
23342 @findex LIBRARY_PATH
23343 The value of @env{LIBRARY_PATH} is a colon-separated list of
23344 directories, much like @env{PATH}.  When configured as a native compiler,
23345 GCC tries the directories thus specified when searching for special
23346 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
23347 using GCC also uses these directories when searching for ordinary
23348 libraries for the @option{-l} option (but directories specified with
23349 @option{-L} come first).
23351 @item LANG
23352 @findex LANG
23353 @cindex locale definition
23354 This variable is used to pass locale information to the compiler.  One way in
23355 which this information is used is to determine the character set to be used
23356 when character literals, string literals and comments are parsed in C and C++.
23357 When the compiler is configured to allow multibyte characters,
23358 the following values for @env{LANG} are recognized:
23360 @table @samp
23361 @item C-JIS
23362 Recognize JIS characters.
23363 @item C-SJIS
23364 Recognize SJIS characters.
23365 @item C-EUCJP
23366 Recognize EUCJP characters.
23367 @end table
23369 If @env{LANG} is not defined, or if it has some other value, then the
23370 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
23371 recognize and translate multibyte characters.
23372 @end table
23374 @noindent
23375 Some additional environment variables affect the behavior of the
23376 preprocessor.
23378 @include cppenv.texi
23380 @c man end
23382 @node Precompiled Headers
23383 @section Using Precompiled Headers
23384 @cindex precompiled headers
23385 @cindex speed of compilation
23387 Often large projects have many header files that are included in every
23388 source file.  The time the compiler takes to process these header files
23389 over and over again can account for nearly all of the time required to
23390 build the project.  To make builds faster, GCC allows you to
23391 @dfn{precompile} a header file.
23393 To create a precompiled header file, simply compile it as you would any
23394 other file, if necessary using the @option{-x} option to make the driver
23395 treat it as a C or C++ header file.  You may want to use a
23396 tool like @command{make} to keep the precompiled header up-to-date when
23397 the headers it contains change.
23399 A precompiled header file is searched for when @code{#include} is
23400 seen in the compilation.  As it searches for the included file
23401 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
23402 compiler looks for a precompiled header in each directory just before it
23403 looks for the include file in that directory.  The name searched for is
23404 the name specified in the @code{#include} with @samp{.gch} appended.  If
23405 the precompiled header file can't be used, it is ignored.
23407 For instance, if you have @code{#include "all.h"}, and you have
23408 @file{all.h.gch} in the same directory as @file{all.h}, then the
23409 precompiled header file is used if possible, and the original
23410 header is used otherwise.
23412 Alternatively, you might decide to put the precompiled header file in a
23413 directory and use @option{-I} to ensure that directory is searched
23414 before (or instead of) the directory containing the original header.
23415 Then, if you want to check that the precompiled header file is always
23416 used, you can put a file of the same name as the original header in this
23417 directory containing an @code{#error} command.
23419 This also works with @option{-include}.  So yet another way to use
23420 precompiled headers, good for projects not designed with precompiled
23421 header files in mind, is to simply take most of the header files used by
23422 a project, include them from another header file, precompile that header
23423 file, and @option{-include} the precompiled header.  If the header files
23424 have guards against multiple inclusion, they are skipped because
23425 they've already been included (in the precompiled header).
23427 If you need to precompile the same header file for different
23428 languages, targets, or compiler options, you can instead make a
23429 @emph{directory} named like @file{all.h.gch}, and put each precompiled
23430 header in the directory, perhaps using @option{-o}.  It doesn't matter
23431 what you call the files in the directory; every precompiled header in
23432 the directory is considered.  The first precompiled header
23433 encountered in the directory that is valid for this compilation is
23434 used; they're searched in no particular order.
23436 There are many other possibilities, limited only by your imagination,
23437 good sense, and the constraints of your build system.
23439 A precompiled header file can be used only when these conditions apply:
23441 @itemize
23442 @item
23443 Only one precompiled header can be used in a particular compilation.
23445 @item
23446 A precompiled header can't be used once the first C token is seen.  You
23447 can have preprocessor directives before a precompiled header; you cannot
23448 include a precompiled header from inside another header.
23450 @item
23451 The precompiled header file must be produced for the same language as
23452 the current compilation.  You can't use a C precompiled header for a C++
23453 compilation.
23455 @item
23456 The precompiled header file must have been produced by the same compiler
23457 binary as the current compilation is using.
23459 @item
23460 Any macros defined before the precompiled header is included must
23461 either be defined in the same way as when the precompiled header was
23462 generated, or must not affect the precompiled header, which usually
23463 means that they don't appear in the precompiled header at all.
23465 The @option{-D} option is one way to define a macro before a
23466 precompiled header is included; using a @code{#define} can also do it.
23467 There are also some options that define macros implicitly, like
23468 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
23469 defined this way.
23471 @item If debugging information is output when using the precompiled
23472 header, using @option{-g} or similar, the same kind of debugging information
23473 must have been output when building the precompiled header.  However,
23474 a precompiled header built using @option{-g} can be used in a compilation
23475 when no debugging information is being output.
23477 @item The same @option{-m} options must generally be used when building
23478 and using the precompiled header.  @xref{Submodel Options},
23479 for any cases where this rule is relaxed.
23481 @item Each of the following options must be the same when building and using
23482 the precompiled header:
23484 @gccoptlist{-fexceptions}
23486 @item
23487 Some other command-line options starting with @option{-f},
23488 @option{-p}, or @option{-O} must be defined in the same way as when
23489 the precompiled header was generated.  At present, it's not clear
23490 which options are safe to change and which are not; the safest choice
23491 is to use exactly the same options when generating and using the
23492 precompiled header.  The following are known to be safe:
23494 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
23495 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
23496 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
23497 -pedantic-errors}
23499 @end itemize
23501 For all of these except the last, the compiler automatically
23502 ignores the precompiled header if the conditions aren't met.  If you
23503 find an option combination that doesn't work and doesn't cause the
23504 precompiled header to be ignored, please consider filing a bug report,
23505 see @ref{Bugs}.
23507 If you do use differing options when generating and using the
23508 precompiled header, the actual behavior is a mixture of the
23509 behavior for the options.  For instance, if you use @option{-g} to
23510 generate the precompiled header but not when using it, you may or may
23511 not get debugging information for routines in the precompiled header.