[PR64164] Drop copyrename, use coalescible partition as base when optimizing.
[official-gcc.git] / gcc / doc / invoke.texi
blob3daf1608231c9ed6520c7391542a11da67a0949a
1 @c Copyright (C) 1988-2015 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-2015 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.  @command{g++} accepts mostly the same options as @command{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 * Diagnostic Message Formatting Options:: Controlling how diagnostics should
129                         be 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 -fopenacc -fopenmp -fopenmp-simd @gol
172 -fms-extensions -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 -fsized-deallocation @gol
191 -fstats  -ftemplate-backtrace-limit=@var{n} @gol
192 -ftemplate-depth=@var{n} @gol
193 -fno-threadsafe-statics  -fuse-cxa-atexit @gol
194 -fno-weak  -nostdinc++ @gol
195 -fvisibility-inlines-hidden @gol
196 -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]} @gol
197 -fvtv-counts -fvtv-debug @gol
198 -fvisibility-ms-compat @gol
199 -fext-numeric-literals @gol
200 -Wabi=@var{n}  -Wabi-tag  -Wconversion-null  -Wctor-dtor-privacy @gol
201 -Wdelete-non-virtual-dtor -Wliteral-suffix -Wnarrowing @gol
202 -Wnoexcept -Wnon-virtual-dtor  -Wreorder @gol
203 -Weffc++  -Wstrict-null-sentinel @gol
204 -Wno-non-template-friend  -Wold-style-cast @gol
205 -Woverloaded-virtual  -Wno-pmf-conversions @gol
206 -Wsign-promo}
208 @item Objective-C and Objective-C++ Language Options
209 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
210 Objective-C and Objective-C++ Dialects}.
211 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
212 -fgnu-runtime  -fnext-runtime @gol
213 -fno-nil-receivers @gol
214 -fobjc-abi-version=@var{n} @gol
215 -fobjc-call-cxx-cdtors @gol
216 -fobjc-direct-dispatch @gol
217 -fobjc-exceptions @gol
218 -fobjc-gc @gol
219 -fobjc-nilcheck @gol
220 -fobjc-std=objc1 @gol
221 -fno-local-ivars @gol
222 -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]} @gol
223 -freplace-objc-classes @gol
224 -fzero-link @gol
225 -gen-decls @gol
226 -Wassign-intercept @gol
227 -Wno-protocol  -Wselector @gol
228 -Wstrict-selector-match @gol
229 -Wundeclared-selector}
231 @item Diagnostic Message Formatting Options
232 @xref{Diagnostic Message Formatting Options,,Options to Control Diagnostic Messages Formatting}.
233 @gccoptlist{-fmessage-length=@var{n}  @gol
234 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
235 -fdiagnostics-color=@r{[}auto@r{|}never@r{|}always@r{]}  @gol
236 -fno-diagnostics-show-option -fno-diagnostics-show-caret}
238 @item Warning Options
239 @xref{Warning Options,,Options to Request or Suppress Warnings}.
240 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -Wpedantic @gol
241 -pedantic-errors @gol
242 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  @gol
243 -Waggressive-loop-optimizations -Warray-bounds -Warray-bounds=@var{n} @gol
244 -Wbool-compare @gol
245 -Wno-attributes -Wno-builtin-macro-redefined @gol
246 -Wc90-c99-compat -Wc99-c11-compat @gol
247 -Wc++-compat -Wc++11-compat -Wc++14-compat -Wcast-align  -Wcast-qual  @gol
248 -Wchar-subscripts -Wclobbered  -Wcomment -Wconditionally-supported  @gol
249 -Wconversion -Wcoverage-mismatch -Wdate-time -Wdelete-incomplete -Wno-cpp  @gol
250 -Wno-deprecated -Wno-deprecated-declarations -Wno-designated-init @gol
251 -Wdisabled-optimization @gol
252 -Wno-discarded-qualifiers -Wno-discarded-array-qualifiers @gol
253 -Wno-div-by-zero -Wdouble-promotion -Wempty-body  -Wenum-compare @gol
254 -Wno-endif-labels -Werror  -Werror=* @gol
255 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
256 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
257 -Wformat-security  -Wformat-signedness  -Wformat-y2k @gol
258 -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol
259 -Wignored-qualifiers  -Wincompatible-pointer-types @gol
260 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
261 -Winit-self  -Winline  -Wno-int-conversion @gol
262 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
263 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
264 -Wlogical-op -Wlogical-not-parentheses -Wlong-long @gol
265 -Wmain -Wmaybe-uninitialized -Wmemset-transposed-args @gol
266 -Wmisleading-indentation -Wmissing-braces @gol
267 -Wmissing-field-initializers -Wmissing-include-dirs @gol
268 -Wno-multichar  -Wnonnull  -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]} @gol
269 -Wodr  -Wno-overflow  -Wopenmp-simd @gol
270 -Woverride-init-side-effects @gol
271 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
272 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
273 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
274 -Wredundant-decls  -Wno-return-local-addr @gol
275 -Wreturn-type  -Wsequence-point  -Wshadow  -Wno-shadow-ivar @gol
276 -Wshift-overflow -Wshift-overflow=@var{n} @gol
277 -Wshift-count-negative -Wshift-count-overflow -Wshift-negative-value @gol
278 -Wsign-compare  -Wsign-conversion -Wfloat-conversion @gol
279 -Wsizeof-pointer-memaccess  -Wsizeof-array-argument @gol
280 -Wstack-protector -Wstack-usage=@var{len} -Wstrict-aliasing @gol
281 -Wstrict-aliasing=n @gol -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
282 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]} @gol
283 -Wsuggest-final-types @gol -Wsuggest-final-methods -Wsuggest-override @gol
284 -Wmissing-format-attribute @gol
285 -Wswitch  -Wswitch-default  -Wswitch-enum -Wswitch-bool -Wsync-nand @gol
286 -Wsystem-headers  -Wtrampolines  -Wtrigraphs  -Wtype-limits  -Wundef @gol
287 -Wuninitialized  -Wunknown-pragmas  -Wno-pragmas @gol
288 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
289 -Wunused-label  -Wunused-local-typedefs -Wunused-parameter @gol
290 -Wno-unused-result -Wunused-value @gol -Wunused-variable @gol
291 -Wunused-but-set-parameter -Wunused-but-set-variable @gol
292 -Wuseless-cast -Wvariadic-macros -Wvector-operation-performance @gol
293 -Wvla -Wvolatile-register-var  -Wwrite-strings @gol
294 -Wzero-as-null-pointer-constant}
296 @item C and Objective-C-only Warning Options
297 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
298 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
299 -Wold-style-declaration  -Wold-style-definition @gol
300 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
301 -Wdeclaration-after-statement -Wpointer-sign}
303 @item Debugging Options
304 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
305 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
306 -fsanitize=@var{style} -fsanitize-recover -fsanitize-recover=@var{style} @gol
307 -fasan-shadow-offset=@var{number} -fsanitize-sections=@var{s1},@var{s2},... @gol
308 -fsanitize-undefined-trap-on-error @gol
309 -fcheck-pointer-bounds -fchkp-check-incomplete-type @gol
310 -fchkp-first-field-has-own-bounds -fchkp-narrow-bounds @gol
311 -fchkp-narrow-to-innermost-array -fchkp-optimize @gol
312 -fchkp-use-fast-string-functions -fchkp-use-nochk-string-functions @gol
313 -fchkp-use-static-bounds -fchkp-use-static-const-bounds @gol
314 -fchkp-treat-zero-dynamic-size-as-infinite -fchkp-check-read @gol
315 -fchkp-check-read -fchkp-check-write -fchkp-store-bounds @gol
316 -fchkp-instrument-calls -fchkp-instrument-marked-only @gol
317 -fchkp-use-wrappers @gol
318 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
319 -fdisable-ipa-@var{pass_name} @gol
320 -fdisable-rtl-@var{pass_name} @gol
321 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
322 -fdisable-tree-@var{pass_name} @gol
323 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
324 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
325 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
326 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
327 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
328 -fdump-passes @gol
329 -fdump-statistics @gol
330 -fdump-tree-all @gol
331 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
332 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
333 -fdump-tree-cfg -fdump-tree-alias @gol
334 -fdump-tree-ch @gol
335 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
336 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
337 -fdump-tree-gimple@r{[}-raw@r{]} @gol
338 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
339 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
340 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
341 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
342 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
343 -fdump-tree-nrv -fdump-tree-vect @gol
344 -fdump-tree-sink @gol
345 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
346 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
347 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
348 -fdump-tree-vtable-verify @gol
349 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
350 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
351 -fdump-final-insns=@var{file} @gol
352 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
353 -feliminate-dwarf2-dups -fno-eliminate-unused-debug-types @gol
354 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
355 -fenable-@var{kind}-@var{pass} @gol
356 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
357 -fdebug-types-section -fmem-report-wpa @gol
358 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
359 -fopt-info @gol
360 -fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
361 -frandom-seed=@var{number} -fsched-verbose=@var{n} @gol
362 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
363 -fstack-usage  -ftest-coverage  -ftime-report -fvar-tracking @gol
364 -fvar-tracking-assignments  -fvar-tracking-assignments-toggle @gol
365 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
366 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
367 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
368 -gvms  -gxcoff  -gxcoff+ -gz@r{[}=@var{type}@r{]} @gol
369 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
370 -fdebug-prefix-map=@var{old}=@var{new} @gol
371 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
372 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
373 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
374 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
375 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
376 -print-sysroot -print-sysroot-headers-suffix @gol
377 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
379 @item Optimization Options
380 @xref{Optimize Options,,Options that Control Optimization}.
381 @gccoptlist{-faggressive-loop-optimizations -falign-functions[=@var{n}] @gol
382 -falign-jumps[=@var{n}] @gol
383 -falign-labels[=@var{n}] -falign-loops[=@var{n}] @gol
384 -fassociative-math -fauto-profile -fauto-profile[=@var{path}] @gol
385 -fauto-inc-dec -fbranch-probabilities @gol
386 -fbranch-target-load-optimize -fbranch-target-load-optimize2 @gol
387 -fbtr-bb-exclusive -fcaller-saves @gol
388 -fcombine-stack-adjustments -fconserve-stack @gol
389 -fcompare-elim -fcprop-registers -fcrossjumping @gol
390 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
391 -fcx-limited-range @gol
392 -fdata-sections -fdce -fdelayed-branch @gol
393 -fdelete-null-pointer-checks -fdevirtualize -fdevirtualize-speculatively @gol
394 -fdevirtualize-at-ltrans -fdse @gol
395 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects @gol
396 -ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
397 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
398 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
399 -fgcse-sm -fhoist-adjacent-loads -fif-conversion @gol
400 -fif-conversion2 -findirect-inlining @gol
401 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
402 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-cp-alignment @gol
403 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference -fipa-icf @gol
404 -fira-algorithm=@var{algorithm} @gol
405 -fira-region=@var{region} -fira-hoist-pressure @gol
406 -fira-loop-pressure -fno-ira-share-save-slots @gol
407 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
408 -fisolate-erroneous-paths-dereference -fisolate-erroneous-paths-attribute @gol
409 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
410 -flive-range-shrinkage @gol
411 -floop-block -floop-interchange -floop-strip-mine @gol
412 -floop-unroll-and-jam -floop-nest-optimize @gol
413 -floop-parallelize-all -flra-remat -flto -flto-compression-level @gol
414 -flto-partition=@var{alg} -flto-report -flto-report-wpa -fmerge-all-constants @gol
415 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
416 -fmove-loop-invariants -fno-branch-count-reg @gol
417 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
418 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
419 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
420 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
421 -fomit-frame-pointer -foptimize-sibling-calls @gol
422 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
423 -fprefetch-loop-arrays -fprofile-report @gol
424 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
425 -fprofile-generate=@var{path} @gol
426 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
427 -fprofile-reorder-functions @gol
428 -freciprocal-math -free -frename-registers -freorder-blocks @gol
429 -freorder-blocks-and-partition -freorder-functions @gol
430 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
431 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
432 -fsched-spec-load -fsched-spec-load-dangerous @gol
433 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
434 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
435 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
436 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
437 -fschedule-fusion @gol
438 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
439 -fselective-scheduling -fselective-scheduling2 @gol
440 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
441 -fsemantic-interposition @gol
442 -fshrink-wrap -fsignaling-nans -fsingle-precision-constant @gol
443 -fsplit-ivs-in-unroller -fsplit-wide-types -fssa-phiopt @gol
444 -fstack-protector -fstack-protector-all -fstack-protector-strong @gol
445 -fstack-protector-explicit -fstdarg-opt -fstrict-aliasing @gol
446 -fstrict-overflow -fthread-jumps -ftracer -ftree-bit-ccp @gol
447 -ftree-builtin-call-dce -ftree-ccp -ftree-ch @gol
448 -ftree-coalesce-vars -ftree-copy-prop -ftree-dce -ftree-dominator-opts @gol
449 -ftree-dse -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
450 -ftree-loop-if-convert-stores -ftree-loop-im @gol
451 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
452 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
453 -ftree-loop-vectorize @gol
454 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-partial-pre -ftree-pta @gol
455 -ftree-reassoc -ftree-sink -ftree-slsr -ftree-sra @gol
456 -ftree-switch-conversion -ftree-tail-merge -ftree-ter @gol
457 -ftree-vectorize -ftree-vrp @gol
458 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
459 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
460 -fipa-ra -fvariable-expansion-in-unroller -fvect-cost-model -fvpt @gol
461 -fweb -fwhole-program -fwpa -fuse-linker-plugin @gol
462 --param @var{name}=@var{value}
463 -O  -O0  -O1  -O2  -O3  -Os -Ofast -Og}
465 @item Preprocessor Options
466 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
467 @gccoptlist{-A@var{question}=@var{answer} @gol
468 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
469 -C  -dD  -dI  -dM  -dN @gol
470 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
471 -idirafter @var{dir} @gol
472 -include @var{file}  -imacros @var{file} @gol
473 -iprefix @var{file}  -iwithprefix @var{dir} @gol
474 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
475 -imultilib @var{dir} -isysroot @var{dir} @gol
476 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
477 -P  -fdebug-cpp -ftrack-macro-expansion -fworking-directory @gol
478 -remap -trigraphs  -undef  -U@var{macro}  @gol
479 -Wp,@var{option} -Xpreprocessor @var{option} -no-integrated-cpp}
481 @item Assembler Option
482 @xref{Assembler Options,,Passing Options to the Assembler}.
483 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
485 @item Linker Options
486 @xref{Link Options,,Options for Linking}.
487 @gccoptlist{@var{object-file-name}  -fuse-ld=@var{linker} -l@var{library} @gol
488 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
489 -s  -static -static-libgcc -static-libstdc++ @gol
490 -static-libasan -static-libtsan -static-liblsan -static-libubsan @gol
491 -static-libmpx -static-libmpxwrappers @gol
492 -shared -shared-libgcc  -symbolic @gol
493 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
494 -u @var{symbol} -z @var{keyword}}
496 @item Directory Options
497 @xref{Directory Options,,Options for Directory Search}.
498 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
499 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol
500 --sysroot=@var{dir} --no-sysroot-suffix}
502 @item Machine Dependent Options
503 @xref{Submodel Options,,Hardware Models and Configurations}.
504 @c This list is ordered alphanumerically by subsection name.
505 @c Try and put the significant identifier (CPU or system) first,
506 @c so users have a clue at guessing where the ones they want will be.
508 @emph{AArch64 Options}
509 @gccoptlist{-mabi=@var{name}  -mbig-endian  -mlittle-endian @gol
510 -mgeneral-regs-only @gol
511 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
512 -mstrict-align @gol
513 -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
514 -mtls-dialect=desc  -mtls-dialect=traditional @gol
515 -mfix-cortex-a53-835769  -mno-fix-cortex-a53-835769 @gol
516 -mfix-cortex-a53-843419  -mno-fix-cortex-a53-843419 @gol
517 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}}
519 @emph{Adapteva Epiphany Options}
520 @gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs @gol
521 -mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf @gol
522 -msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} @gol
523 -mround-nearest -mlong-calls -mshort-calls -msmall16 @gol
524 -mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} @gol
525 -msplit-vecmove-early -m1reg-@var{reg}}
527 @emph{ARC Options}
528 @gccoptlist{-mbarrel-shifter @gol
529 -mcpu=@var{cpu} -mA6 -mARC600 -mA7 -mARC700 @gol
530 -mdpfp -mdpfp-compact -mdpfp-fast -mno-dpfp-lrsr @gol
531 -mea -mno-mpy -mmul32x16 -mmul64 @gol
532 -mnorm -mspfp -mspfp-compact -mspfp-fast -msimd -msoft-float -mswap @gol
533 -mcrc -mdsp-packa -mdvbf -mlock -mmac-d16 -mmac-24 -mrtsc -mswape @gol
534 -mtelephony -mxy -misize -mannotate-align -marclinux -marclinux_prof @gol
535 -mepilogue-cfi -mlong-calls -mmedium-calls -msdata @gol
536 -mucb-mcount -mvolatile-cache @gol
537 -malign-call -mauto-modify-reg -mbbit-peephole -mno-brcc @gol
538 -mcase-vector-pcrel -mcompact-casesi -mno-cond-exec -mearly-cbranchsi @gol
539 -mexpand-adddi -mindexed-loads -mlra -mlra-priority-none @gol
540 -mlra-priority-compact mlra-priority-noncompact -mno-millicode @gol
541 -mmixed-code -mq-class -mRcq -mRcw -msize-level=@var{level} @gol
542 -mtune=@var{cpu} -mmultcost=@var{num} -munalign-prob-threshold=@var{probability}}
544 @emph{ARM Options}
545 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
546 -mabi=@var{name} @gol
547 -mapcs-stack-check  -mno-apcs-stack-check @gol
548 -mapcs-float  -mno-apcs-float @gol
549 -mapcs-reentrant  -mno-apcs-reentrant @gol
550 -msched-prolog  -mno-sched-prolog @gol
551 -mlittle-endian  -mbig-endian @gol
552 -mfloat-abi=@var{name} @gol
553 -mfp16-format=@var{name}
554 -mthumb-interwork  -mno-thumb-interwork @gol
555 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
556 -mtune=@var{name} -mprint-tune-info @gol
557 -mstructure-size-boundary=@var{n} @gol
558 -mabort-on-noreturn @gol
559 -mlong-calls  -mno-long-calls @gol
560 -msingle-pic-base  -mno-single-pic-base @gol
561 -mpic-register=@var{reg} @gol
562 -mnop-fun-dllimport @gol
563 -mpoke-function-name @gol
564 -mthumb  -marm @gol
565 -mtpcs-frame  -mtpcs-leaf-frame @gol
566 -mcaller-super-interworking  -mcallee-super-interworking @gol
567 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
568 -mword-relocations @gol
569 -mfix-cortex-m3-ldrd @gol
570 -munaligned-access @gol
571 -mneon-for-64bits @gol
572 -mslow-flash-data @gol
573 -masm-syntax-unified @gol
574 -mrestrict-it}
576 @emph{AVR Options}
577 @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
578 -mcall-prologues -mint8 -mn_flash=@var{size} -mno-interrupts @gol
579 -mrelax -mrmw -mstrict-X -mtiny-stack -nodevicelib -Waddr-space-convert}
581 @emph{Blackfin Options}
582 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
583 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
584 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
585 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
586 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
587 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
588 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
589 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
590 -micplb}
592 @emph{C6X Options}
593 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
594 -msim -msdata=@var{sdata-type}}
596 @emph{CRIS Options}
597 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
598 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
599 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
600 -mstack-align  -mdata-align  -mconst-align @gol
601 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
602 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
603 -mmul-bug-workaround  -mno-mul-bug-workaround}
605 @emph{CR16 Options}
606 @gccoptlist{-mmac @gol
607 -mcr16cplus -mcr16c @gol
608 -msim -mint32 -mbit-ops
609 -mdata-model=@var{model}}
611 @emph{Darwin Options}
612 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
613 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
614 -client_name  -compatibility_version  -current_version @gol
615 -dead_strip @gol
616 -dependency-file  -dylib_file  -dylinker_install_name @gol
617 -dynamic  -dynamiclib  -exported_symbols_list @gol
618 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
619 -force_flat_namespace  -headerpad_max_install_names @gol
620 -iframework @gol
621 -image_base  -init  -install_name  -keep_private_externs @gol
622 -multi_module  -multiply_defined  -multiply_defined_unused @gol
623 -noall_load   -no_dead_strip_inits_and_terms @gol
624 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
625 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
626 -private_bundle  -read_only_relocs  -sectalign @gol
627 -sectobjectsymbols  -whyload  -seg1addr @gol
628 -sectcreate  -sectobjectsymbols  -sectorder @gol
629 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
630 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
631 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
632 -single_module  -static  -sub_library  -sub_umbrella @gol
633 -twolevel_namespace  -umbrella  -undefined @gol
634 -unexported_symbols_list  -weak_reference_mismatches @gol
635 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
636 -mkernel -mone-byte-bool}
638 @emph{DEC Alpha Options}
639 @gccoptlist{-mno-fp-regs  -msoft-float @gol
640 -mieee  -mieee-with-inexact  -mieee-conformant @gol
641 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
642 -mtrap-precision=@var{mode}  -mbuild-constants @gol
643 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
644 -mbwx  -mmax  -mfix  -mcix @gol
645 -mfloat-vax  -mfloat-ieee @gol
646 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
647 -msmall-text  -mlarge-text @gol
648 -mmemory-latency=@var{time}}
650 @emph{FR30 Options}
651 @gccoptlist{-msmall-model -mno-lsim}
653 @emph{FT32 Options}
654 @gccoptlist{-msim -mlra}
656 @emph{FRV Options}
657 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
658 -mhard-float  -msoft-float @gol
659 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
660 -mdouble  -mno-double @gol
661 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
662 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
663 -mlinked-fp  -mlong-calls  -malign-labels @gol
664 -mlibrary-pic  -macc-4  -macc-8 @gol
665 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
666 -moptimize-membar -mno-optimize-membar @gol
667 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
668 -mvliw-branch  -mno-vliw-branch @gol
669 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
670 -mno-nested-cond-exec  -mtomcat-stats @gol
671 -mTLS -mtls @gol
672 -mcpu=@var{cpu}}
674 @emph{GNU/Linux Options}
675 @gccoptlist{-mglibc -muclibc -mmusl -mbionic -mandroid @gol
676 -tno-android-cc -tno-android-ld}
678 @emph{H8/300 Options}
679 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr -mno-exr  -mint32  -malign-300}
681 @emph{HPPA Options}
682 @gccoptlist{-march=@var{architecture-type} @gol
683 -mdisable-fpregs  -mdisable-indexing @gol
684 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
685 -mfixed-range=@var{register-range} @gol
686 -mjump-in-delay -mlinker-opt -mlong-calls @gol
687 -mlong-load-store  -mno-disable-fpregs @gol
688 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
689 -mno-jump-in-delay  -mno-long-load-store @gol
690 -mno-portable-runtime  -mno-soft-float @gol
691 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
692 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
693 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
694 -munix=@var{unix-std}  -nolibdld  -static  -threads}
696 @emph{IA-64 Options}
697 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
698 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
699 -mconstant-gp  -mauto-pic  -mfused-madd @gol
700 -minline-float-divide-min-latency @gol
701 -minline-float-divide-max-throughput @gol
702 -mno-inline-float-divide @gol
703 -minline-int-divide-min-latency @gol
704 -minline-int-divide-max-throughput  @gol
705 -mno-inline-int-divide @gol
706 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
707 -mno-inline-sqrt @gol
708 -mdwarf2-asm -mearly-stop-bits @gol
709 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
710 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
711 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
712 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
713 -msched-spec-ldc -msched-spec-control-ldc @gol
714 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
715 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
716 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
717 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
719 @emph{LM32 Options}
720 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
721 -msign-extend-enabled -muser-enabled}
723 @emph{M32R/D Options}
724 @gccoptlist{-m32r2 -m32rx -m32r @gol
725 -mdebug @gol
726 -malign-loops -mno-align-loops @gol
727 -missue-rate=@var{number} @gol
728 -mbranch-cost=@var{number} @gol
729 -mmodel=@var{code-size-model-type} @gol
730 -msdata=@var{sdata-type} @gol
731 -mno-flush-func -mflush-func=@var{name} @gol
732 -mno-flush-trap -mflush-trap=@var{number} @gol
733 -G @var{num}}
735 @emph{M32C Options}
736 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
738 @emph{M680x0 Options}
739 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune} @gol
740 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
741 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
742 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
743 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
744 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
745 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
746 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
747 -mxgot -mno-xgot}
749 @emph{MCore Options}
750 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
751 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
752 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
753 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
754 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
756 @emph{MeP Options}
757 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
758 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
759 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
760 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
761 -mtiny=@var{n}}
763 @emph{MicroBlaze Options}
764 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
765 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
766 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
767 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
768 -mbig-endian -mlittle-endian -mxl-reorder -mxl-mode-@var{app-model}}
770 @emph{MIPS Options}
771 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
772 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips32r3  -mips32r5 @gol
773 -mips32r6  -mips64  -mips64r2  -mips64r3  -mips64r5  -mips64r6 @gol
774 -mips16  -mno-mips16  -mflip-mips16 @gol
775 -minterlink-compressed -mno-interlink-compressed @gol
776 -minterlink-mips16  -mno-interlink-mips16 @gol
777 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
778 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
779 -mgp32  -mgp64  -mfp32  -mfpxx  -mfp64  -mhard-float  -msoft-float @gol
780 -mno-float  -msingle-float  -mdouble-float @gol
781 -modd-spreg -mno-odd-spreg @gol
782 -mabs=@var{mode}  -mnan=@var{encoding} @gol
783 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
784 -mmcu -mmno-mcu @gol
785 -meva -mno-eva @gol
786 -mvirt -mno-virt @gol
787 -mxpa -mno-xpa @gol
788 -mmicromips -mno-micromips @gol
789 -mfpu=@var{fpu-type} @gol
790 -msmartmips  -mno-smartmips @gol
791 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
792 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
793 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
794 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
795 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
796 -membedded-data  -mno-embedded-data @gol
797 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
798 -mcode-readable=@var{setting} @gol
799 -msplit-addresses  -mno-split-addresses @gol
800 -mexplicit-relocs  -mno-explicit-relocs @gol
801 -mcheck-zero-division  -mno-check-zero-division @gol
802 -mdivide-traps  -mdivide-breaks @gol
803 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
804 -mmad -mno-mad -mimadd -mno-imadd -mfused-madd  -mno-fused-madd  -nocpp @gol
805 -mfix-24k -mno-fix-24k @gol
806 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
807 -mfix-r10000 -mno-fix-r10000  -mfix-rm7000 -mno-fix-rm7000 @gol
808 -mfix-vr4120  -mno-fix-vr4120 @gol
809 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
810 -mflush-func=@var{func}  -mno-flush-func @gol
811 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
812 -mfp-exceptions -mno-fp-exceptions @gol
813 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
814 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
816 @emph{MMIX Options}
817 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
818 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
819 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
820 -mno-base-addresses  -msingle-exit  -mno-single-exit}
822 @emph{MN10300 Options}
823 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
824 -mno-am33 -mam33 -mam33-2 -mam34 @gol
825 -mtune=@var{cpu-type} @gol
826 -mreturn-pointer-on-d0 @gol
827 -mno-crt0  -mrelax -mliw -msetlb}
829 @emph{Moxie Options}
830 @gccoptlist{-meb -mel -mmul.x -mno-crt0}
832 @emph{MSP430 Options}
833 @gccoptlist{-msim -masm-hex -mmcu= -mcpu= -mlarge -msmall -mrelax @gol
834 -mcode-region= -mdata-region= @gol
835 -mhwmult= -minrt}
837 @emph{NDS32 Options}
838 @gccoptlist{-mbig-endian -mlittle-endian @gol
839 -mreduced-regs -mfull-regs @gol
840 -mcmov -mno-cmov @gol
841 -mperf-ext -mno-perf-ext @gol
842 -mv3push -mno-v3push @gol
843 -m16bit -mno-16bit @gol
844 -misr-vector-size=@var{num} @gol
845 -mcache-block-size=@var{num} @gol
846 -march=@var{arch} @gol
847 -mcmodel=@var{code-model} @gol
848 -mctor-dtor -mrelax}
850 @emph{Nios II Options}
851 @gccoptlist{-G @var{num} -mgpopt=@var{option} -mgpopt -mno-gpopt @gol
852 -mel -meb @gol
853 -mno-bypass-cache -mbypass-cache @gol
854 -mno-cache-volatile -mcache-volatile @gol
855 -mno-fast-sw-div -mfast-sw-div @gol
856 -mhw-mul -mno-hw-mul -mhw-mulx -mno-hw-mulx -mno-hw-div -mhw-div @gol
857 -mcustom-@var{insn}=@var{N} -mno-custom-@var{insn} @gol
858 -mcustom-fpu-cfg=@var{name} @gol
859 -mhal -msmallc -msys-crt0=@var{name} -msys-lib=@var{name} @gol
860 -march=@var{arch} -mbmx -mno-bmx -mcdx -mno-cdx}
862 @emph{Nvidia PTX Options}
863 @gccoptlist{-m32 -m64 -mmainkernel}
865 @emph{PDP-11 Options}
866 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
867 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
868 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
869 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
870 -mbranch-expensive  -mbranch-cheap @gol
871 -munix-asm  -mdec-asm}
873 @emph{picoChip Options}
874 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
875 -msymbol-as-address -mno-inefficient-warnings}
877 @emph{PowerPC Options}
878 See RS/6000 and PowerPC Options.
880 @emph{RL78 Options}
881 @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=g14 -mallregs @gol
882 -mcpu=g10 -mcpu=g13 -mcpu=g14 -mg10 -mg13 -mg14 @gol
883 -m64bit-doubles -m32bit-doubles}
885 @emph{RS/6000 and PowerPC Options}
886 @gccoptlist{-mcpu=@var{cpu-type} @gol
887 -mtune=@var{cpu-type} @gol
888 -mcmodel=@var{code-model} @gol
889 -mpowerpc64 @gol
890 -maltivec  -mno-altivec @gol
891 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
892 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
893 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
894 -mfprnd  -mno-fprnd @gol
895 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
896 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
897 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
898 -malign-power  -malign-natural @gol
899 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
900 -msingle-float -mdouble-float -msimple-fpu @gol
901 -mstring  -mno-string  -mupdate  -mno-update @gol
902 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
903 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
904 -mstrict-align  -mno-strict-align  -mrelocatable @gol
905 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
906 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
907 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
908 -mprioritize-restricted-insns=@var{priority} @gol
909 -msched-costly-dep=@var{dependence_type} @gol
910 -minsert-sched-nops=@var{scheme} @gol
911 -mcall-sysv  -mcall-netbsd @gol
912 -maix-struct-return  -msvr4-struct-return @gol
913 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
914 -mblock-move-inline-limit=@var{num} @gol
915 -misel -mno-isel @gol
916 -misel=yes  -misel=no @gol
917 -mspe -mno-spe @gol
918 -mspe=yes  -mspe=no @gol
919 -mpaired @gol
920 -mgen-cell-microcode -mwarn-cell-microcode @gol
921 -mvrsave -mno-vrsave @gol
922 -mmulhw -mno-mulhw @gol
923 -mdlmzb -mno-dlmzb @gol
924 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
925 -mprototype  -mno-prototype @gol
926 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
927 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
928 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
929 -mno-recip-precision @gol
930 -mveclibabi=@var{type} -mfriz -mno-friz @gol
931 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
932 -msave-toc-indirect -mno-save-toc-indirect @gol
933 -mpower8-fusion -mno-mpower8-fusion -mpower8-vector -mno-power8-vector @gol
934 -mcrypto -mno-crypto -mdirect-move -mno-direct-move @gol
935 -mquad-memory -mno-quad-memory @gol
936 -mquad-memory-atomic -mno-quad-memory-atomic @gol
937 -mcompat-align-parm -mno-compat-align-parm @gol
938 -mupper-regs-df -mno-upper-regs-df -mupper-regs-sf -mno-upper-regs-sf @gol
939 -mupper-regs -mno-upper-regs}
941 @emph{RX Options}
942 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
943 -mcpu=@gol
944 -mbig-endian-data -mlittle-endian-data @gol
945 -msmall-data @gol
946 -msim  -mno-sim@gol
947 -mas100-syntax -mno-as100-syntax@gol
948 -mrelax@gol
949 -mmax-constant-size=@gol
950 -mint-register=@gol
951 -mpid@gol
952 -mallow-string-insns -mno-allow-string-insns@gol
953 -mno-warn-multiple-fast-interrupts@gol
954 -msave-acc-in-interrupts}
956 @emph{S/390 and zSeries Options}
957 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
958 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
959 -mlong-double-64 -mlong-double-128 @gol
960 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
961 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
962 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
963 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
964 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard @gol
965 -mhotpatch=@var{halfwords},@var{halfwords}}
967 @emph{Score Options}
968 @gccoptlist{-meb -mel @gol
969 -mnhwloop @gol
970 -muls @gol
971 -mmac @gol
972 -mscore5 -mscore5u -mscore7 -mscore7d}
974 @emph{SH Options}
975 @gccoptlist{-m1  -m2  -m2e @gol
976 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
977 -m3  -m3e @gol
978 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
979 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
980 -m5-64media  -m5-64media-nofpu @gol
981 -m5-32media  -m5-32media-nofpu @gol
982 -m5-compact  -m5-compact-nofpu @gol
983 -mb  -ml  -mdalign  -mrelax @gol
984 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
985 -mieee -mno-ieee -mbitops  -misize  -minline-ic_invalidate -mpadstruct @gol
986 -mspace -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
987 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
988 -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
989 -maccumulate-outgoing-args -minvalid-symbols @gol
990 -matomic-model=@var{atomic-model} @gol
991 -mbranch-cost=@var{num} -mzdcbranch -mno-zdcbranch @gol
992 -mcbranch-force-delay-slot @gol
993 -mfused-madd -mno-fused-madd -mfsca -mno-fsca -mfsrra -mno-fsrra @gol
994 -mpretend-cmove -mtas}
996 @emph{Solaris 2 Options}
997 @gccoptlist{-mclear-hwcap -mno-clear-hwcap -mimpure-text  -mno-impure-text @gol
998 -pthreads -pthread}
1000 @emph{SPARC Options}
1001 @gccoptlist{-mcpu=@var{cpu-type} @gol
1002 -mtune=@var{cpu-type} @gol
1003 -mcmodel=@var{code-model} @gol
1004 -mmemory-model=@var{mem-model} @gol
1005 -m32  -m64  -mapp-regs  -mno-app-regs @gol
1006 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
1007 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
1008 -mhard-quad-float  -msoft-quad-float @gol
1009 -mstack-bias  -mno-stack-bias @gol
1010 -munaligned-doubles  -mno-unaligned-doubles @gol
1011 -muser-mode  -mno-user-mode @gol
1012 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
1013 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
1014 -mcbcond -mno-cbcond @gol
1015 -mfmaf  -mno-fmaf  -mpopc  -mno-popc @gol
1016 -mfix-at697f -mfix-ut699}
1018 @emph{SPU Options}
1019 @gccoptlist{-mwarn-reloc -merror-reloc @gol
1020 -msafe-dma -munsafe-dma @gol
1021 -mbranch-hints @gol
1022 -msmall-mem -mlarge-mem -mstdmain @gol
1023 -mfixed-range=@var{register-range} @gol
1024 -mea32 -mea64 @gol
1025 -maddress-space-conversion -mno-address-space-conversion @gol
1026 -mcache-size=@var{cache-size} @gol
1027 -matomic-updates -mno-atomic-updates}
1029 @emph{System V Options}
1030 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
1032 @emph{TILE-Gx Options}
1033 @gccoptlist{-mcpu=CPU -m32 -m64 -mbig-endian -mlittle-endian @gol
1034 -mcmodel=@var{code-model}}
1036 @emph{TILEPro Options}
1037 @gccoptlist{-mcpu=@var{cpu} -m32}
1039 @emph{V850 Options}
1040 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
1041 -mprolog-function  -mno-prolog-function  -mspace @gol
1042 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
1043 -mapp-regs  -mno-app-regs @gol
1044 -mdisable-callt  -mno-disable-callt @gol
1045 -mv850e2v3 -mv850e2 -mv850e1 -mv850es @gol
1046 -mv850e -mv850 -mv850e3v5 @gol
1047 -mloop @gol
1048 -mrelax @gol
1049 -mlong-jumps @gol
1050 -msoft-float @gol
1051 -mhard-float @gol
1052 -mgcc-abi @gol
1053 -mrh850-abi @gol
1054 -mbig-switch}
1056 @emph{VAX Options}
1057 @gccoptlist{-mg  -mgnu  -munix}
1059 @emph{Visium Options}
1060 @gccoptlist{-mdebug -msim -mfpu -mno-fpu -mhard-float -msoft-float @gol
1061 -mcpu=@var{cpu-type} -mtune=@var{cpu-type} -msv-mode -muser-mode}
1063 @emph{VMS Options}
1064 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64 @gol
1065 -mpointer-size=@var{size}}
1067 @emph{VxWorks Options}
1068 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
1069 -Xbind-lazy  -Xbind-now}
1071 @emph{x86 Options}
1072 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1073 -mtune-ctrl=@var{feature-list} -mdump-tune-features -mno-default @gol
1074 -mfpmath=@var{unit} @gol
1075 -masm=@var{dialect}  -mno-fancy-math-387 @gol
1076 -mno-fp-ret-in-387  -msoft-float @gol
1077 -mno-wide-multiply  -mrtd  -malign-double @gol
1078 -mpreferred-stack-boundary=@var{num} @gol
1079 -mincoming-stack-boundary=@var{num} @gol
1080 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
1081 -mrecip -mrecip=@var{opt} @gol
1082 -mvzeroupper -mprefer-avx128 @gol
1083 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
1084 -mavx2 -mavx512f -mavx512pf -mavx512er -mavx512cd -msha @gol
1085 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma -mprefetchwt1 @gol
1086 -mclflushopt -mxsavec -mxsaves @gol
1087 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
1088 -mbmi2 -mfxsr -mxsave -mxsaveopt -mrtm -mlwp -mmpx -mmwaitx -mthreads @gol
1089 -mno-align-stringops  -minline-all-stringops @gol
1090 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
1091 -mmemcpy-strategy=@var{strategy} -mmemset-strategy=@var{strategy} @gol
1092 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
1093 -m96bit-long-double -mlong-double-64 -mlong-double-80 -mlong-double-128 @gol
1094 -mregparm=@var{num}  -msseregparm @gol
1095 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
1096 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
1097 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
1098 -mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
1099 -m32 -m64 -mx32 -m16 -miamcu -mlarge-data-threshold=@var{num} @gol
1100 -msse2avx -mfentry -mrecord-mcount -mnop-mcount -m8bit-idiv @gol
1101 -mavx256-split-unaligned-load -mavx256-split-unaligned-store @gol
1102 -malign-data=@var{type} -mstack-protector-guard=@var{guard}}
1104 @emph{x86 Windows Options}
1105 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
1106 -mnop-fun-dllimport -mthread @gol
1107 -municode -mwin32 -mwindows -fno-set-stack-executable}
1109 @emph{Xstormy16 Options}
1110 @gccoptlist{-msim}
1112 @emph{Xtensa Options}
1113 @gccoptlist{-mconst16 -mno-const16 @gol
1114 -mfused-madd  -mno-fused-madd @gol
1115 -mforce-no-pic @gol
1116 -mserialize-volatile  -mno-serialize-volatile @gol
1117 -mtext-section-literals  -mno-text-section-literals @gol
1118 -mtarget-align  -mno-target-align @gol
1119 -mlongcalls  -mno-longcalls}
1121 @emph{zSeries Options}
1122 See S/390 and zSeries Options.
1124 @item Code Generation Options
1125 @xref{Code Gen Options,,Options for Code Generation Conventions}.
1126 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
1127 -ffixed-@var{reg}  -fexceptions @gol
1128 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
1129 -fasynchronous-unwind-tables @gol
1130 -fno-gnu-unique @gol
1131 -finhibit-size-directive  -finstrument-functions @gol
1132 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
1133 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
1134 -fno-common  -fno-ident @gol
1135 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE -fno-plt @gol
1136 -fno-jump-tables @gol
1137 -frecord-gcc-switches @gol
1138 -freg-struct-return  -fshort-enums @gol
1139 -fshort-double  -fshort-wchar @gol
1140 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
1141 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
1142 -fno-stack-limit -fsplit-stack @gol
1143 -fleading-underscore  -ftls-model=@var{model} @gol
1144 -fstack-reuse=@var{reuse_level} @gol
1145 -ftrapv  -fwrapv  -fbounds-check @gol
1146 -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]} @gol
1147 -fstrict-volatile-bitfields -fsync-libcalls}
1148 @end table
1151 @node Overall Options
1152 @section Options Controlling the Kind of Output
1154 Compilation can involve up to four stages: preprocessing, compilation
1155 proper, assembly and linking, always in that order.  GCC is capable of
1156 preprocessing and compiling several files either into several
1157 assembler input files, or into one assembler input file; then each
1158 assembler input file produces an object file, and linking combines all
1159 the object files (those newly compiled, and those specified as input)
1160 into an executable file.
1162 @cindex file name suffix
1163 For any given input file, the file name suffix determines what kind of
1164 compilation is done:
1166 @table @gcctabopt
1167 @item @var{file}.c
1168 C source code that must be preprocessed.
1170 @item @var{file}.i
1171 C source code that should not be preprocessed.
1173 @item @var{file}.ii
1174 C++ source code that should not be preprocessed.
1176 @item @var{file}.m
1177 Objective-C source code.  Note that you must link with the @file{libobjc}
1178 library to make an Objective-C program work.
1180 @item @var{file}.mi
1181 Objective-C source code that should not be preprocessed.
1183 @item @var{file}.mm
1184 @itemx @var{file}.M
1185 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1186 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1187 to a literal capital M@.
1189 @item @var{file}.mii
1190 Objective-C++ source code that should not be preprocessed.
1192 @item @var{file}.h
1193 C, C++, Objective-C or Objective-C++ header file to be turned into a
1194 precompiled header (default), or C, C++ header file to be turned into an
1195 Ada spec (via the @option{-fdump-ada-spec} switch).
1197 @item @var{file}.cc
1198 @itemx @var{file}.cp
1199 @itemx @var{file}.cxx
1200 @itemx @var{file}.cpp
1201 @itemx @var{file}.CPP
1202 @itemx @var{file}.c++
1203 @itemx @var{file}.C
1204 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1205 the last two letters must both be literally @samp{x}.  Likewise,
1206 @samp{.C} refers to a literal capital C@.
1208 @item @var{file}.mm
1209 @itemx @var{file}.M
1210 Objective-C++ source code that must be preprocessed.
1212 @item @var{file}.mii
1213 Objective-C++ source code that should not be preprocessed.
1215 @item @var{file}.hh
1216 @itemx @var{file}.H
1217 @itemx @var{file}.hp
1218 @itemx @var{file}.hxx
1219 @itemx @var{file}.hpp
1220 @itemx @var{file}.HPP
1221 @itemx @var{file}.h++
1222 @itemx @var{file}.tcc
1223 C++ header file to be turned into a precompiled header or Ada spec.
1225 @item @var{file}.f
1226 @itemx @var{file}.for
1227 @itemx @var{file}.ftn
1228 Fixed form Fortran source code that should not be preprocessed.
1230 @item @var{file}.F
1231 @itemx @var{file}.FOR
1232 @itemx @var{file}.fpp
1233 @itemx @var{file}.FPP
1234 @itemx @var{file}.FTN
1235 Fixed form Fortran source code that must be preprocessed (with the traditional
1236 preprocessor).
1238 @item @var{file}.f90
1239 @itemx @var{file}.f95
1240 @itemx @var{file}.f03
1241 @itemx @var{file}.f08
1242 Free form Fortran source code that should not be preprocessed.
1244 @item @var{file}.F90
1245 @itemx @var{file}.F95
1246 @itemx @var{file}.F03
1247 @itemx @var{file}.F08
1248 Free form Fortran source code that must be preprocessed (with the
1249 traditional preprocessor).
1251 @item @var{file}.go
1252 Go source code.
1254 @c FIXME: Descriptions of Java file types.
1255 @c @var{file}.java
1256 @c @var{file}.class
1257 @c @var{file}.zip
1258 @c @var{file}.jar
1260 @item @var{file}.ads
1261 Ada source code file that contains a library unit declaration (a
1262 declaration of a package, subprogram, or generic, or a generic
1263 instantiation), or a library unit renaming declaration (a package,
1264 generic, or subprogram renaming declaration).  Such files are also
1265 called @dfn{specs}.
1267 @item @var{file}.adb
1268 Ada source code file containing a library unit body (a subprogram or
1269 package body).  Such files are also called @dfn{bodies}.
1271 @c GCC also knows about some suffixes for languages not yet included:
1272 @c Pascal:
1273 @c @var{file}.p
1274 @c @var{file}.pas
1275 @c Ratfor:
1276 @c @var{file}.r
1278 @item @var{file}.s
1279 Assembler code.
1281 @item @var{file}.S
1282 @itemx @var{file}.sx
1283 Assembler code that must be preprocessed.
1285 @item @var{other}
1286 An object file to be fed straight into linking.
1287 Any file name with no recognized suffix is treated this way.
1288 @end table
1290 @opindex x
1291 You can specify the input language explicitly with the @option{-x} option:
1293 @table @gcctabopt
1294 @item -x @var{language}
1295 Specify explicitly the @var{language} for the following input files
1296 (rather than letting the compiler choose a default based on the file
1297 name suffix).  This option applies to all following input files until
1298 the next @option{-x} option.  Possible values for @var{language} are:
1299 @smallexample
1300 c  c-header  cpp-output
1301 c++  c++-header  c++-cpp-output
1302 objective-c  objective-c-header  objective-c-cpp-output
1303 objective-c++ objective-c++-header objective-c++-cpp-output
1304 assembler  assembler-with-cpp
1306 f77  f77-cpp-input f95  f95-cpp-input
1308 java
1309 @end smallexample
1311 @item -x none
1312 Turn off any specification of a language, so that subsequent files are
1313 handled according to their file name suffixes (as they are if @option{-x}
1314 has not been used at all).
1316 @item -pass-exit-codes
1317 @opindex pass-exit-codes
1318 Normally the @command{gcc} program exits with the code of 1 if any
1319 phase of the compiler returns a non-success return code.  If you specify
1320 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1321 the numerically highest error produced by any phase returning an error
1322 indication.  The C, C++, and Fortran front ends return 4 if an internal
1323 compiler error is encountered.
1324 @end table
1326 If you only want some of the stages of compilation, you can use
1327 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1328 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1329 @command{gcc} is to stop.  Note that some combinations (for example,
1330 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1332 @table @gcctabopt
1333 @item -c
1334 @opindex c
1335 Compile or assemble the source files, but do not link.  The linking
1336 stage simply is not done.  The ultimate output is in the form of an
1337 object file for each source file.
1339 By default, the object file name for a source file is made by replacing
1340 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1342 Unrecognized input files, not requiring compilation or assembly, are
1343 ignored.
1345 @item -S
1346 @opindex S
1347 Stop after the stage of compilation proper; do not assemble.  The output
1348 is in the form of an assembler code file for each non-assembler input
1349 file specified.
1351 By default, the assembler file name for a source file is made by
1352 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1354 Input files that don't require compilation are ignored.
1356 @item -E
1357 @opindex E
1358 Stop after the preprocessing stage; do not run the compiler proper.  The
1359 output is in the form of preprocessed source code, which is sent to the
1360 standard output.
1362 Input files that don't require preprocessing are ignored.
1364 @cindex output file option
1365 @item -o @var{file}
1366 @opindex o
1367 Place output in file @var{file}.  This applies to whatever
1368 sort of output is being produced, whether it be an executable file,
1369 an object file, an assembler file or preprocessed C code.
1371 If @option{-o} is not specified, the default is to put an executable
1372 file in @file{a.out}, the object file for
1373 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1374 assembler file in @file{@var{source}.s}, a precompiled header file in
1375 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1376 standard output.
1378 @item -v
1379 @opindex v
1380 Print (on standard error output) the commands executed to run the stages
1381 of compilation.  Also print the version number of the compiler driver
1382 program and of the preprocessor and the compiler proper.
1384 @item -###
1385 @opindex ###
1386 Like @option{-v} except the commands are not executed and arguments
1387 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1388 This is useful for shell scripts to capture the driver-generated command lines.
1390 @item -pipe
1391 @opindex pipe
1392 Use pipes rather than temporary files for communication between the
1393 various stages of compilation.  This fails to work on some systems where
1394 the assembler is unable to read from a pipe; but the GNU assembler has
1395 no trouble.
1397 @item --help
1398 @opindex help
1399 Print (on the standard output) a description of the command-line options
1400 understood by @command{gcc}.  If the @option{-v} option is also specified
1401 then @option{--help} is also passed on to the various processes
1402 invoked by @command{gcc}, so that they can display the command-line options
1403 they accept.  If the @option{-Wextra} option has also been specified
1404 (prior to the @option{--help} option), then command-line options that
1405 have no documentation associated with them are also displayed.
1407 @item --target-help
1408 @opindex target-help
1409 Print (on the standard output) a description of target-specific command-line
1410 options for each tool.  For some targets extra target-specific
1411 information may also be printed.
1413 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1414 Print (on the standard output) a description of the command-line
1415 options understood by the compiler that fit into all specified classes
1416 and qualifiers.  These are the supported classes:
1418 @table @asis
1419 @item @samp{optimizers}
1420 Display all of the optimization options supported by the
1421 compiler.
1423 @item @samp{warnings}
1424 Display all of the options controlling warning messages
1425 produced by the compiler.
1427 @item @samp{target}
1428 Display target-specific options.  Unlike the
1429 @option{--target-help} option however, target-specific options of the
1430 linker and assembler are not displayed.  This is because those
1431 tools do not currently support the extended @option{--help=} syntax.
1433 @item @samp{params}
1434 Display the values recognized by the @option{--param}
1435 option.
1437 @item @var{language}
1438 Display the options supported for @var{language}, where
1439 @var{language} is the name of one of the languages supported in this
1440 version of GCC@.
1442 @item @samp{common}
1443 Display the options that are common to all languages.
1444 @end table
1446 These are the supported qualifiers:
1448 @table @asis
1449 @item @samp{undocumented}
1450 Display only those options that are undocumented.
1452 @item @samp{joined}
1453 Display options taking an argument that appears after an equal
1454 sign in the same continuous piece of text, such as:
1455 @samp{--help=target}.
1457 @item @samp{separate}
1458 Display options taking an argument that appears as a separate word
1459 following the original option, such as: @samp{-o output-file}.
1460 @end table
1462 Thus for example to display all the undocumented target-specific
1463 switches supported by the compiler, use:
1465 @smallexample
1466 --help=target,undocumented
1467 @end smallexample
1469 The sense of a qualifier can be inverted by prefixing it with the
1470 @samp{^} character, so for example to display all binary warning
1471 options (i.e., ones that are either on or off and that do not take an
1472 argument) that have a description, use:
1474 @smallexample
1475 --help=warnings,^joined,^undocumented
1476 @end smallexample
1478 The argument to @option{--help=} should not consist solely of inverted
1479 qualifiers.
1481 Combining several classes is possible, although this usually
1482 restricts the output so much that there is nothing to display.  One
1483 case where it does work, however, is when one of the classes is
1484 @var{target}.  For example, to display all the target-specific
1485 optimization options, use:
1487 @smallexample
1488 --help=target,optimizers
1489 @end smallexample
1491 The @option{--help=} option can be repeated on the command line.  Each
1492 successive use displays its requested class of options, skipping
1493 those that have already been displayed.
1495 If the @option{-Q} option appears on the command line before the
1496 @option{--help=} option, then the descriptive text displayed by
1497 @option{--help=} is changed.  Instead of describing the displayed
1498 options, an indication is given as to whether the option is enabled,
1499 disabled or set to a specific value (assuming that the compiler
1500 knows this at the point where the @option{--help=} option is used).
1502 Here is a truncated example from the ARM port of @command{gcc}:
1504 @smallexample
1505   % gcc -Q -mabi=2 --help=target -c
1506   The following options are target specific:
1507   -mabi=                                2
1508   -mabort-on-noreturn                   [disabled]
1509   -mapcs                                [disabled]
1510 @end smallexample
1512 The output is sensitive to the effects of previous command-line
1513 options, so for example it is possible to find out which optimizations
1514 are enabled at @option{-O2} by using:
1516 @smallexample
1517 -Q -O2 --help=optimizers
1518 @end smallexample
1520 Alternatively you can discover which binary optimizations are enabled
1521 by @option{-O3} by using:
1523 @smallexample
1524 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1525 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1526 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1527 @end smallexample
1529 @item -no-canonical-prefixes
1530 @opindex no-canonical-prefixes
1531 Do not expand any symbolic links, resolve references to @samp{/../}
1532 or @samp{/./}, or make the path absolute when generating a relative
1533 prefix.
1535 @item --version
1536 @opindex version
1537 Display the version number and copyrights of the invoked GCC@.
1539 @item -wrapper
1540 @opindex wrapper
1541 Invoke all subcommands under a wrapper program.  The name of the
1542 wrapper program and its parameters are passed as a comma separated
1543 list.
1545 @smallexample
1546 gcc -c t.c -wrapper gdb,--args
1547 @end smallexample
1549 @noindent
1550 This invokes all subprograms of @command{gcc} under
1551 @samp{gdb --args}, thus the invocation of @command{cc1} is
1552 @samp{gdb --args cc1 @dots{}}.
1554 @item -fplugin=@var{name}.so
1555 @opindex fplugin
1556 Load the plugin code in file @var{name}.so, assumed to be a
1557 shared object to be dlopen'd by the compiler.  The base name of
1558 the shared object file is used to identify the plugin for the
1559 purposes of argument parsing (See
1560 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1561 Each plugin should define the callback functions specified in the
1562 Plugins API.
1564 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1565 @opindex fplugin-arg
1566 Define an argument called @var{key} with a value of @var{value}
1567 for the plugin called @var{name}.
1569 @item -fdump-ada-spec@r{[}-slim@r{]}
1570 @opindex fdump-ada-spec
1571 For C and C++ source and include files, generate corresponding Ada specs.
1572 @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1573 GNAT User's Guide}, which provides detailed documentation on this feature.
1575 @item -fada-spec-parent=@var{unit}
1576 @opindex fada-spec-parent
1577 In conjunction with @option{-fdump-ada-spec@r{[}-slim@r{]}} above, generate
1578 Ada specs as child units of parent @var{unit}.
1580 @item -fdump-go-spec=@var{file}
1581 @opindex fdump-go-spec
1582 For input files in any language, generate corresponding Go
1583 declarations in @var{file}.  This generates Go @code{const},
1584 @code{type}, @code{var}, and @code{func} declarations which may be a
1585 useful way to start writing a Go interface to code written in some
1586 other language.
1588 @include @value{srcdir}/../libiberty/at-file.texi
1589 @end table
1591 @node Invoking G++
1592 @section Compiling C++ Programs
1594 @cindex suffixes for C++ source
1595 @cindex C++ source file suffixes
1596 C++ source files conventionally use one of the suffixes @samp{.C},
1597 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1598 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1599 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1600 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1601 files with these names and compiles them as C++ programs even if you
1602 call the compiler the same way as for compiling C programs (usually
1603 with the name @command{gcc}).
1605 @findex g++
1606 @findex c++
1607 However, the use of @command{gcc} does not add the C++ library.
1608 @command{g++} is a program that calls GCC and automatically specifies linking
1609 against the C++ library.  It treats @samp{.c},
1610 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1611 files unless @option{-x} is used.  This program is also useful when
1612 precompiling a C header file with a @samp{.h} extension for use in C++
1613 compilations.  On many systems, @command{g++} is also installed with
1614 the name @command{c++}.
1616 @cindex invoking @command{g++}
1617 When you compile C++ programs, you may specify many of the same
1618 command-line options that you use for compiling programs in any
1619 language; or command-line options meaningful for C and related
1620 languages; or options that are meaningful only for C++ programs.
1621 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1622 explanations of options for languages related to C@.
1623 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1624 explanations of options that are meaningful only for C++ programs.
1626 @node C Dialect Options
1627 @section Options Controlling C Dialect
1628 @cindex dialect options
1629 @cindex language dialect options
1630 @cindex options, dialect
1632 The following options control the dialect of C (or languages derived
1633 from C, such as C++, Objective-C and Objective-C++) that the compiler
1634 accepts:
1636 @table @gcctabopt
1637 @cindex ANSI support
1638 @cindex ISO support
1639 @item -ansi
1640 @opindex ansi
1641 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1642 equivalent to @option{-std=c++98}.
1644 This turns off certain features of GCC that are incompatible with ISO
1645 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1646 such as the @code{asm} and @code{typeof} keywords, and
1647 predefined macros such as @code{unix} and @code{vax} that identify the
1648 type of system you are using.  It also enables the undesirable and
1649 rarely used ISO trigraph feature.  For the C compiler,
1650 it disables recognition of C++ style @samp{//} comments as well as
1651 the @code{inline} keyword.
1653 The alternate keywords @code{__asm__}, @code{__extension__},
1654 @code{__inline__} and @code{__typeof__} continue to work despite
1655 @option{-ansi}.  You would not want to use them in an ISO C program, of
1656 course, but it is useful to put them in header files that might be included
1657 in compilations done with @option{-ansi}.  Alternate predefined macros
1658 such as @code{__unix__} and @code{__vax__} are also available, with or
1659 without @option{-ansi}.
1661 The @option{-ansi} option does not cause non-ISO programs to be
1662 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1663 addition to @option{-ansi}.  @xref{Warning Options}.
1665 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1666 option is used.  Some header files may notice this macro and refrain
1667 from declaring certain functions or defining certain macros that the
1668 ISO standard doesn't call for; this is to avoid interfering with any
1669 programs that might use these names for other things.
1671 Functions that are normally built in but do not have semantics
1672 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1673 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1674 built-in functions provided by GCC}, for details of the functions
1675 affected.
1677 @item -std=
1678 @opindex std
1679 Determine the language standard. @xref{Standards,,Language Standards
1680 Supported by GCC}, for details of these standard versions.  This option
1681 is currently only supported when compiling C or C++.
1683 The compiler can accept several base standards, such as @samp{c90} or
1684 @samp{c++98}, and GNU dialects of those standards, such as
1685 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1686 compiler accepts all programs following that standard plus those
1687 using GNU extensions that do not contradict it.  For example,
1688 @option{-std=c90} turns off certain features of GCC that are
1689 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1690 keywords, but not other GNU extensions that do not have a meaning in
1691 ISO C90, such as omitting the middle term of a @code{?:}
1692 expression. On the other hand, when a GNU dialect of a standard is
1693 specified, all features supported by the compiler are enabled, even when
1694 those features change the meaning of the base standard.  As a result, some
1695 strict-conforming programs may be rejected.  The particular standard
1696 is used by @option{-Wpedantic} to identify which features are GNU
1697 extensions given that version of the standard. For example
1698 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1699 comments, while @option{-std=gnu99 -Wpedantic} does not.
1701 A value for this option must be provided; possible values are
1703 @table @samp
1704 @item c90
1705 @itemx c89
1706 @itemx iso9899:1990
1707 Support all ISO C90 programs (certain GNU extensions that conflict
1708 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1710 @item iso9899:199409
1711 ISO C90 as modified in amendment 1.
1713 @item c99
1714 @itemx c9x
1715 @itemx iso9899:1999
1716 @itemx iso9899:199x
1717 ISO C99.  This standard is substantially completely supported, modulo
1718 bugs and floating-point issues
1719 (mainly but not entirely relating to optional C99 features from
1720 Annexes F and G).  See
1721 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1722 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1724 @item c11
1725 @itemx c1x
1726 @itemx iso9899:2011
1727 ISO C11, the 2011 revision of the ISO C standard.  This standard is
1728 substantially completely supported, modulo bugs, floating-point issues
1729 (mainly but not entirely relating to optional C11 features from
1730 Annexes F and G) and the optional Annexes K (Bounds-checking
1731 interfaces) and L (Analyzability).  The name @samp{c1x} is deprecated.
1733 @item gnu90
1734 @itemx gnu89
1735 GNU dialect of ISO C90 (including some C99 features).
1737 @item gnu99
1738 @itemx gnu9x
1739 GNU dialect of ISO C99.  The name @samp{gnu9x} is deprecated.
1741 @item gnu11
1742 @itemx gnu1x
1743 GNU dialect of ISO C11.  This is the default for C code.
1744 The name @samp{gnu1x} is deprecated.
1746 @item c++98
1747 @itemx c++03
1748 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1749 additional defect reports. Same as @option{-ansi} for C++ code.
1751 @item gnu++98
1752 @itemx gnu++03
1753 GNU dialect of @option{-std=c++98}.  This is the default for
1754 C++ code.
1756 @item c++11
1757 @itemx c++0x
1758 The 2011 ISO C++ standard plus amendments.
1759 The name @samp{c++0x} is deprecated.
1761 @item gnu++11
1762 @itemx gnu++0x
1763 GNU dialect of @option{-std=c++11}.
1764 The name @samp{gnu++0x} is deprecated.
1766 @item c++14
1767 @itemx c++1y
1768 The 2014 ISO C++ standard plus amendments.
1769 The name @samp{c++1y} is deprecated.
1771 @item gnu++14
1772 @itemx gnu++1y
1773 GNU dialect of @option{-std=c++14}.
1774 The name @samp{gnu++1y} is deprecated.
1776 @item c++1z
1777 The next revision of the ISO C++ standard, tentatively planned for
1778 2017.  Support is highly experimental, and will almost certainly
1779 change in incompatible ways in future releases.
1781 @item gnu++1z
1782 GNU dialect of @option{-std=c++1z}.  Support is highly experimental,
1783 and will almost certainly change in incompatible ways in future
1784 releases.
1785 @end table
1787 @item -fgnu89-inline
1788 @opindex fgnu89-inline
1789 The option @option{-fgnu89-inline} tells GCC to use the traditional
1790 GNU semantics for @code{inline} functions when in C99 mode.
1791 @xref{Inline,,An Inline Function is As Fast As a Macro}.
1792 Using this option is roughly equivalent to adding the
1793 @code{gnu_inline} function attribute to all inline functions
1794 (@pxref{Function Attributes}).
1796 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1797 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1798 specifies the default behavior).
1799 This option is not supported in @option{-std=c90} or
1800 @option{-std=gnu90} mode.
1802 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1803 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1804 in effect for @code{inline} functions.  @xref{Common Predefined
1805 Macros,,,cpp,The C Preprocessor}.
1807 @item -aux-info @var{filename}
1808 @opindex aux-info
1809 Output to the given filename prototyped declarations for all functions
1810 declared and/or defined in a translation unit, including those in header
1811 files.  This option is silently ignored in any language other than C@.
1813 Besides declarations, the file indicates, in comments, the origin of
1814 each declaration (source file and line), whether the declaration was
1815 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1816 @samp{O} for old, respectively, in the first character after the line
1817 number and the colon), and whether it came from a declaration or a
1818 definition (@samp{C} or @samp{F}, respectively, in the following
1819 character).  In the case of function definitions, a K&R-style list of
1820 arguments followed by their declarations is also provided, inside
1821 comments, after the declaration.
1823 @item -fallow-parameterless-variadic-functions
1824 @opindex fallow-parameterless-variadic-functions
1825 Accept variadic functions without named parameters.
1827 Although it is possible to define such a function, this is not very
1828 useful as it is not possible to read the arguments.  This is only
1829 supported for C as this construct is allowed by C++.
1831 @item -fno-asm
1832 @opindex fno-asm
1833 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1834 keyword, so that code can use these words as identifiers.  You can use
1835 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1836 instead.  @option{-ansi} implies @option{-fno-asm}.
1838 In C++, this switch only affects the @code{typeof} keyword, since
1839 @code{asm} and @code{inline} are standard keywords.  You may want to
1840 use the @option{-fno-gnu-keywords} flag instead, which has the same
1841 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1842 switch only affects the @code{asm} and @code{typeof} keywords, since
1843 @code{inline} is a standard keyword in ISO C99.
1845 @item -fno-builtin
1846 @itemx -fno-builtin-@var{function}
1847 @opindex fno-builtin
1848 @cindex built-in functions
1849 Don't recognize built-in functions that do not begin with
1850 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1851 functions provided by GCC}, for details of the functions affected,
1852 including those which are not built-in functions when @option{-ansi} or
1853 @option{-std} options for strict ISO C conformance are used because they
1854 do not have an ISO standard meaning.
1856 GCC normally generates special code to handle certain built-in functions
1857 more efficiently; for instance, calls to @code{alloca} may become single
1858 instructions which adjust the stack directly, and calls to @code{memcpy}
1859 may become inline copy loops.  The resulting code is often both smaller
1860 and faster, but since the function calls no longer appear as such, you
1861 cannot set a breakpoint on those calls, nor can you change the behavior
1862 of the functions by linking with a different library.  In addition,
1863 when a function is recognized as a built-in function, GCC may use
1864 information about that function to warn about problems with calls to
1865 that function, or to generate more efficient code, even if the
1866 resulting code still contains calls to that function.  For example,
1867 warnings are given with @option{-Wformat} for bad calls to
1868 @code{printf} when @code{printf} is built in and @code{strlen} is
1869 known not to modify global memory.
1871 With the @option{-fno-builtin-@var{function}} option
1872 only the built-in function @var{function} is
1873 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1874 function is named that is not built-in in this version of GCC, this
1875 option is ignored.  There is no corresponding
1876 @option{-fbuiltin-@var{function}} option; if you wish to enable
1877 built-in functions selectively when using @option{-fno-builtin} or
1878 @option{-ffreestanding}, you may define macros such as:
1880 @smallexample
1881 #define abs(n)          __builtin_abs ((n))
1882 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1883 @end smallexample
1885 @item -fhosted
1886 @opindex fhosted
1887 @cindex hosted environment
1889 Assert that compilation targets a hosted environment.  This implies
1890 @option{-fbuiltin}.  A hosted environment is one in which the
1891 entire standard library is available, and in which @code{main} has a return
1892 type of @code{int}.  Examples are nearly everything except a kernel.
1893 This is equivalent to @option{-fno-freestanding}.
1895 @item -ffreestanding
1896 @opindex ffreestanding
1897 @cindex hosted environment
1899 Assert that compilation targets a freestanding environment.  This
1900 implies @option{-fno-builtin}.  A freestanding environment
1901 is one in which the standard library may not exist, and program startup may
1902 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1903 This is equivalent to @option{-fno-hosted}.
1905 @xref{Standards,,Language Standards Supported by GCC}, for details of
1906 freestanding and hosted environments.
1908 @item -fopenacc
1909 @opindex fopenacc
1910 @cindex OpenACC accelerator programming
1911 Enable handling of OpenACC directives @code{#pragma acc} in C/C++ and
1912 @code{!$acc} in Fortran.  When @option{-fopenacc} is specified, the
1913 compiler generates accelerated code according to the OpenACC Application
1914 Programming Interface v2.0 @w{@uref{http://www.openacc.org/}}.  This option
1915 implies @option{-pthread}, and thus is only supported on targets that
1916 have support for @option{-pthread}.
1918 Note that this is an experimental feature, incomplete, and subject to
1919 change in future versions of GCC.  See
1920 @w{@uref{https://gcc.gnu.org/wiki/OpenACC}} for more information.
1922 @item -fopenmp
1923 @opindex fopenmp
1924 @cindex OpenMP parallel
1925 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1926 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1927 compiler generates parallel code according to the OpenMP Application
1928 Program Interface v4.0 @w{@uref{http://www.openmp.org/}}.  This option
1929 implies @option{-pthread}, and thus is only supported on targets that
1930 have support for @option{-pthread}. @option{-fopenmp} implies
1931 @option{-fopenmp-simd}.
1933 @item -fopenmp-simd
1934 @opindex fopenmp-simd
1935 @cindex OpenMP SIMD
1936 @cindex SIMD
1937 Enable handling of OpenMP's SIMD directives with @code{#pragma omp}
1938 in C/C++ and @code{!$omp} in Fortran. Other OpenMP directives
1939 are ignored.
1941 @item -fcilkplus
1942 @opindex fcilkplus
1943 @cindex Enable Cilk Plus
1944 Enable the usage of Cilk Plus language extension features for C/C++.
1945 When the option @option{-fcilkplus} is specified, enable the usage of
1946 the Cilk Plus Language extension features for C/C++.  The present
1947 implementation follows ABI version 1.2.  This is an experimental
1948 feature that is only partially complete, and whose interface may
1949 change in future versions of GCC as the official specification
1950 changes.  Currently, all features but @code{_Cilk_for} have been
1951 implemented.
1953 @item -fgnu-tm
1954 @opindex fgnu-tm
1955 When the option @option{-fgnu-tm} is specified, the compiler
1956 generates code for the Linux variant of Intel's current Transactional
1957 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
1958 an experimental feature whose interface may change in future versions
1959 of GCC, as the official specification changes.  Please note that not
1960 all architectures are supported for this feature.
1962 For more information on GCC's support for transactional memory,
1963 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
1964 Transactional Memory Library}.
1966 Note that the transactional memory feature is not supported with
1967 non-call exceptions (@option{-fnon-call-exceptions}).
1969 @item -fms-extensions
1970 @opindex fms-extensions
1971 Accept some non-standard constructs used in Microsoft header files.
1973 In C++ code, this allows member names in structures to be similar
1974 to previous types declarations.
1976 @smallexample
1977 typedef int UOW;
1978 struct ABC @{
1979   UOW UOW;
1981 @end smallexample
1983 Some cases of unnamed fields in structures and unions are only
1984 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1985 fields within structs/unions}, for details.
1987 Note that this option is off for all targets but x86 
1988 targets using ms-abi.
1990 @item -fplan9-extensions
1991 @opindex fplan9-extensions
1992 Accept some non-standard constructs used in Plan 9 code.
1994 This enables @option{-fms-extensions}, permits passing pointers to
1995 structures with anonymous fields to functions that expect pointers to
1996 elements of the type of the field, and permits referring to anonymous
1997 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
1998 struct/union fields within structs/unions}, for details.  This is only
1999 supported for C, not C++.
2001 @item -trigraphs
2002 @opindex trigraphs
2003 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
2004 options for strict ISO C conformance) implies @option{-trigraphs}.
2006 @cindex traditional C language
2007 @cindex C language, traditional
2008 @item -traditional
2009 @itemx -traditional-cpp
2010 @opindex traditional-cpp
2011 @opindex traditional
2012 Formerly, these options caused GCC to attempt to emulate a pre-standard
2013 C compiler.  They are now only supported with the @option{-E} switch.
2014 The preprocessor continues to support a pre-standard mode.  See the GNU
2015 CPP manual for details.
2017 @item -fcond-mismatch
2018 @opindex fcond-mismatch
2019 Allow conditional expressions with mismatched types in the second and
2020 third arguments.  The value of such an expression is void.  This option
2021 is not supported for C++.
2023 @item -flax-vector-conversions
2024 @opindex flax-vector-conversions
2025 Allow implicit conversions between vectors with differing numbers of
2026 elements and/or incompatible element types.  This option should not be
2027 used for new code.
2029 @item -funsigned-char
2030 @opindex funsigned-char
2031 Let the type @code{char} be unsigned, like @code{unsigned char}.
2033 Each kind of machine has a default for what @code{char} should
2034 be.  It is either like @code{unsigned char} by default or like
2035 @code{signed char} by default.
2037 Ideally, a portable program should always use @code{signed char} or
2038 @code{unsigned char} when it depends on the signedness of an object.
2039 But many programs have been written to use plain @code{char} and
2040 expect it to be signed, or expect it to be unsigned, depending on the
2041 machines they were written for.  This option, and its inverse, let you
2042 make such a program work with the opposite default.
2044 The type @code{char} is always a distinct type from each of
2045 @code{signed char} or @code{unsigned char}, even though its behavior
2046 is always just like one of those two.
2048 @item -fsigned-char
2049 @opindex fsigned-char
2050 Let the type @code{char} be signed, like @code{signed char}.
2052 Note that this is equivalent to @option{-fno-unsigned-char}, which is
2053 the negative form of @option{-funsigned-char}.  Likewise, the option
2054 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
2056 @item -fsigned-bitfields
2057 @itemx -funsigned-bitfields
2058 @itemx -fno-signed-bitfields
2059 @itemx -fno-unsigned-bitfields
2060 @opindex fsigned-bitfields
2061 @opindex funsigned-bitfields
2062 @opindex fno-signed-bitfields
2063 @opindex fno-unsigned-bitfields
2064 These options control whether a bit-field is signed or unsigned, when the
2065 declaration does not use either @code{signed} or @code{unsigned}.  By
2066 default, such a bit-field is signed, because this is consistent: the
2067 basic integer types such as @code{int} are signed types.
2068 @end table
2070 @node C++ Dialect Options
2071 @section Options Controlling C++ Dialect
2073 @cindex compiler options, C++
2074 @cindex C++ options, command-line
2075 @cindex options, C++
2076 This section describes the command-line options that are only meaningful
2077 for C++ programs.  You can also use most of the GNU compiler options
2078 regardless of what language your program is in.  For example, you
2079 might compile a file @file{firstClass.C} like this:
2081 @smallexample
2082 g++ -g -frepo -O -c firstClass.C
2083 @end smallexample
2085 @noindent
2086 In this example, only @option{-frepo} is an option meant
2087 only for C++ programs; you can use the other options with any
2088 language supported by GCC@.
2090 Here is a list of options that are @emph{only} for compiling C++ programs:
2092 @table @gcctabopt
2094 @item -fabi-version=@var{n}
2095 @opindex fabi-version
2096 Use version @var{n} of the C++ ABI@.  The default is version 0.
2098 Version 0 refers to the version conforming most closely to
2099 the C++ ABI specification.  Therefore, the ABI obtained using version 0
2100 will change in different versions of G++ as ABI bugs are fixed.
2102 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.
2104 Version 2 is the version of the C++ ABI that first appeared in G++
2105 3.4, and was the default through G++ 4.9.
2107 Version 3 corrects an error in mangling a constant address as a
2108 template argument.
2110 Version 4, which first appeared in G++ 4.5, implements a standard
2111 mangling for vector types.
2113 Version 5, which first appeared in G++ 4.6, corrects the mangling of
2114 attribute const/volatile on function pointer types, decltype of a
2115 plain decl, and use of a function parameter in the declaration of
2116 another parameter.
2118 Version 6, which first appeared in G++ 4.7, corrects the promotion
2119 behavior of C++11 scoped enums and the mangling of template argument
2120 packs, const/static_cast, prefix ++ and --, and a class scope function
2121 used as a template argument.
2123 Version 7, which first appeared in G++ 4.8, that treats nullptr_t as a
2124 builtin type and corrects the mangling of lambdas in default argument
2125 scope.
2127 Version 8, which first appeared in G++ 4.9, corrects the substitution
2128 behavior of function types with function-cv-qualifiers.
2130 See also @option{-Wabi}.
2132 @item -fabi-compat-version=@var{n}
2133 @opindex fabi-compat-version
2134 On targets that support strong aliases, G++
2135 works around mangling changes by creating an alias with the correct
2136 mangled name when defining a symbol with an incorrect mangled name.
2137 This switch specifies which ABI version to use for the alias.
2139 With @option{-fabi-version=0} (the default), this defaults to 2.  If
2140 another ABI version is explicitly selected, this defaults to 0.
2142 The compatibility version is also set by @option{-Wabi=@var{n}}.
2144 @item -fno-access-control
2145 @opindex fno-access-control
2146 Turn off all access checking.  This switch is mainly useful for working
2147 around bugs in the access control code.
2149 @item -fcheck-new
2150 @opindex fcheck-new
2151 Check that the pointer returned by @code{operator new} is non-null
2152 before attempting to modify the storage allocated.  This check is
2153 normally unnecessary because the C++ standard specifies that
2154 @code{operator new} only returns @code{0} if it is declared
2155 @code{throw()}, in which case the compiler always checks the
2156 return value even without this option.  In all other cases, when
2157 @code{operator new} has a non-empty exception specification, memory
2158 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
2159 @samp{new (nothrow)}.
2161 @item -fconstexpr-depth=@var{n}
2162 @opindex fconstexpr-depth
2163 Set the maximum nested evaluation depth for C++11 constexpr functions
2164 to @var{n}.  A limit is needed to detect endless recursion during
2165 constant expression evaluation.  The minimum specified by the standard
2166 is 512.
2168 @item -fdeduce-init-list
2169 @opindex fdeduce-init-list
2170 Enable deduction of a template type parameter as
2171 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
2173 @smallexample
2174 template <class T> auto forward(T t) -> decltype (realfn (t))
2176   return realfn (t);
2179 void f()
2181   forward(@{1,2@}); // call forward<std::initializer_list<int>>
2183 @end smallexample
2185 This deduction was implemented as a possible extension to the
2186 originally proposed semantics for the C++11 standard, but was not part
2187 of the final standard, so it is disabled by default.  This option is
2188 deprecated, and may be removed in a future version of G++.
2190 @item -ffriend-injection
2191 @opindex ffriend-injection
2192 Inject friend functions into the enclosing namespace, so that they are
2193 visible outside the scope of the class in which they are declared.
2194 Friend functions were documented to work this way in the old Annotated
2195 C++ Reference Manual.  
2196 However, in ISO C++ a friend function that is not declared
2197 in an enclosing scope can only be found using argument dependent
2198 lookup.  GCC defaults to the standard behavior.
2200 This option is for compatibility, and may be removed in a future
2201 release of G++.
2203 @item -fno-elide-constructors
2204 @opindex fno-elide-constructors
2205 The C++ standard allows an implementation to omit creating a temporary
2206 that is only used to initialize another object of the same type.
2207 Specifying this option disables that optimization, and forces G++ to
2208 call the copy constructor in all cases.
2210 @item -fno-enforce-eh-specs
2211 @opindex fno-enforce-eh-specs
2212 Don't generate code to check for violation of exception specifications
2213 at run time.  This option violates the C++ standard, but may be useful
2214 for reducing code size in production builds, much like defining
2215 @code{NDEBUG}.  This does not give user code permission to throw
2216 exceptions in violation of the exception specifications; the compiler
2217 still optimizes based on the specifications, so throwing an
2218 unexpected exception results in undefined behavior at run time.
2220 @item -fextern-tls-init
2221 @itemx -fno-extern-tls-init
2222 @opindex fextern-tls-init
2223 @opindex fno-extern-tls-init
2224 The C++11 and OpenMP standards allow @code{thread_local} and
2225 @code{threadprivate} variables to have dynamic (runtime)
2226 initialization.  To support this, any use of such a variable goes
2227 through a wrapper function that performs any necessary initialization.
2228 When the use and definition of the variable are in the same
2229 translation unit, this overhead can be optimized away, but when the
2230 use is in a different translation unit there is significant overhead
2231 even if the variable doesn't actually need dynamic initialization.  If
2232 the programmer can be sure that no use of the variable in a
2233 non-defining TU needs to trigger dynamic initialization (either
2234 because the variable is statically initialized, or a use of the
2235 variable in the defining TU will be executed before any uses in
2236 another TU), they can avoid this overhead with the
2237 @option{-fno-extern-tls-init} option.
2239 On targets that support symbol aliases, the default is
2240 @option{-fextern-tls-init}.  On targets that do not support symbol
2241 aliases, the default is @option{-fno-extern-tls-init}.
2243 @item -ffor-scope
2244 @itemx -fno-for-scope
2245 @opindex ffor-scope
2246 @opindex fno-for-scope
2247 If @option{-ffor-scope} is specified, the scope of variables declared in
2248 a @i{for-init-statement} is limited to the @code{for} loop itself,
2249 as specified by the C++ standard.
2250 If @option{-fno-for-scope} is specified, the scope of variables declared in
2251 a @i{for-init-statement} extends to the end of the enclosing scope,
2252 as was the case in old versions of G++, and other (traditional)
2253 implementations of C++.
2255 If neither flag is given, the default is to follow the standard,
2256 but to allow and give a warning for old-style code that would
2257 otherwise be invalid, or have different behavior.
2259 @item -fno-gnu-keywords
2260 @opindex fno-gnu-keywords
2261 Do not recognize @code{typeof} as a keyword, so that code can use this
2262 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2263 @option{-ansi} implies @option{-fno-gnu-keywords}.
2265 @item -fno-implicit-templates
2266 @opindex fno-implicit-templates
2267 Never emit code for non-inline templates that are instantiated
2268 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2269 @xref{Template Instantiation}, for more information.
2271 @item -fno-implicit-inline-templates
2272 @opindex fno-implicit-inline-templates
2273 Don't emit code for implicit instantiations of inline templates, either.
2274 The default is to handle inlines differently so that compiles with and
2275 without optimization need the same set of explicit instantiations.
2277 @item -fno-implement-inlines
2278 @opindex fno-implement-inlines
2279 To save space, do not emit out-of-line copies of inline functions
2280 controlled by @code{#pragma implementation}.  This causes linker
2281 errors if these functions are not inlined everywhere they are called.
2283 @item -fms-extensions
2284 @opindex fms-extensions
2285 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2286 int and getting a pointer to member function via non-standard syntax.
2288 @item -fno-nonansi-builtins
2289 @opindex fno-nonansi-builtins
2290 Disable built-in declarations of functions that are not mandated by
2291 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2292 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2294 @item -fnothrow-opt
2295 @opindex fnothrow-opt
2296 Treat a @code{throw()} exception specification as if it were a
2297 @code{noexcept} specification to reduce or eliminate the text size
2298 overhead relative to a function with no exception specification.  If
2299 the function has local variables of types with non-trivial
2300 destructors, the exception specification actually makes the
2301 function smaller because the EH cleanups for those variables can be
2302 optimized away.  The semantic effect is that an exception thrown out of
2303 a function with such an exception specification results in a call
2304 to @code{terminate} rather than @code{unexpected}.
2306 @item -fno-operator-names
2307 @opindex fno-operator-names
2308 Do not treat the operator name keywords @code{and}, @code{bitand},
2309 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2310 synonyms as keywords.
2312 @item -fno-optional-diags
2313 @opindex fno-optional-diags
2314 Disable diagnostics that the standard says a compiler does not need to
2315 issue.  Currently, the only such diagnostic issued by G++ is the one for
2316 a name having multiple meanings within a class.
2318 @item -fpermissive
2319 @opindex fpermissive
2320 Downgrade some diagnostics about nonconformant code from errors to
2321 warnings.  Thus, using @option{-fpermissive} allows some
2322 nonconforming code to compile.
2324 @item -fno-pretty-templates
2325 @opindex fno-pretty-templates
2326 When an error message refers to a specialization of a function
2327 template, the compiler normally prints the signature of the
2328 template followed by the template arguments and any typedefs or
2329 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2330 rather than @code{void f(int)}) so that it's clear which template is
2331 involved.  When an error message refers to a specialization of a class
2332 template, the compiler omits any template arguments that match
2333 the default template arguments for that template.  If either of these
2334 behaviors make it harder to understand the error message rather than
2335 easier, you can use @option{-fno-pretty-templates} to disable them.
2337 @item -frepo
2338 @opindex frepo
2339 Enable automatic template instantiation at link time.  This option also
2340 implies @option{-fno-implicit-templates}.  @xref{Template
2341 Instantiation}, for more information.
2343 @item -fno-rtti
2344 @opindex fno-rtti
2345 Disable generation of information about every class with virtual
2346 functions for use by the C++ run-time type identification features
2347 (@code{dynamic_cast} and @code{typeid}).  If you don't use those parts
2348 of the language, you can save some space by using this flag.  Note that
2349 exception handling uses the same information, but G++ generates it as
2350 needed. The @code{dynamic_cast} operator can still be used for casts that
2351 do not require run-time type information, i.e.@: casts to @code{void *} or to
2352 unambiguous base classes.
2354 @item -fsized-deallocation
2355 @opindex fsized-deallocation
2356 Enable the built-in global declarations
2357 @smallexample
2358 void operator delete (void *, std::size_t) noexcept;
2359 void operator delete[] (void *, std::size_t) noexcept;
2360 @end smallexample
2361 as introduced in C++14.  This is useful for user-defined replacement
2362 deallocation functions that, for example, use the size of the object
2363 to make deallocation faster.  Enabled by default under
2364 @option{-std=c++14} and above.  The flag @option{-Wsized-deallocation}
2365 warns about places that might want to add a definition.
2367 @item -fstats
2368 @opindex fstats
2369 Emit statistics about front-end processing at the end of the compilation.
2370 This information is generally only useful to the G++ development team.
2372 @item -fstrict-enums
2373 @opindex fstrict-enums
2374 Allow the compiler to optimize using the assumption that a value of
2375 enumerated type can only be one of the values of the enumeration (as
2376 defined in the C++ standard; basically, a value that can be
2377 represented in the minimum number of bits needed to represent all the
2378 enumerators).  This assumption may not be valid if the program uses a
2379 cast to convert an arbitrary integer value to the enumerated type.
2381 @item -ftemplate-backtrace-limit=@var{n}
2382 @opindex ftemplate-backtrace-limit
2383 Set the maximum number of template instantiation notes for a single
2384 warning or error to @var{n}.  The default value is 10.
2386 @item -ftemplate-depth=@var{n}
2387 @opindex ftemplate-depth
2388 Set the maximum instantiation depth for template classes to @var{n}.
2389 A limit on the template instantiation depth is needed to detect
2390 endless recursions during template class instantiation.  ANSI/ISO C++
2391 conforming programs must not rely on a maximum depth greater than 17
2392 (changed to 1024 in C++11).  The default value is 900, as the compiler
2393 can run out of stack space before hitting 1024 in some situations.
2395 @item -fno-threadsafe-statics
2396 @opindex fno-threadsafe-statics
2397 Do not emit the extra code to use the routines specified in the C++
2398 ABI for thread-safe initialization of local statics.  You can use this
2399 option to reduce code size slightly in code that doesn't need to be
2400 thread-safe.
2402 @item -fuse-cxa-atexit
2403 @opindex fuse-cxa-atexit
2404 Register destructors for objects with static storage duration with the
2405 @code{__cxa_atexit} function rather than the @code{atexit} function.
2406 This option is required for fully standards-compliant handling of static
2407 destructors, but only works if your C library supports
2408 @code{__cxa_atexit}.
2410 @item -fno-use-cxa-get-exception-ptr
2411 @opindex fno-use-cxa-get-exception-ptr
2412 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2413 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2414 if the runtime routine is not available.
2416 @item -fvisibility-inlines-hidden
2417 @opindex fvisibility-inlines-hidden
2418 This switch declares that the user does not attempt to compare
2419 pointers to inline functions or methods where the addresses of the two functions
2420 are taken in different shared objects.
2422 The effect of this is that GCC may, effectively, mark inline methods with
2423 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2424 appear in the export table of a DSO and do not require a PLT indirection
2425 when used within the DSO@.  Enabling this option can have a dramatic effect
2426 on load and link times of a DSO as it massively reduces the size of the
2427 dynamic export table when the library makes heavy use of templates.
2429 The behavior of this switch is not quite the same as marking the
2430 methods as hidden directly, because it does not affect static variables
2431 local to the function or cause the compiler to deduce that
2432 the function is defined in only one shared object.
2434 You may mark a method as having a visibility explicitly to negate the
2435 effect of the switch for that method.  For example, if you do want to
2436 compare pointers to a particular inline method, you might mark it as
2437 having default visibility.  Marking the enclosing class with explicit
2438 visibility has no effect.
2440 Explicitly instantiated inline methods are unaffected by this option
2441 as their linkage might otherwise cross a shared library boundary.
2442 @xref{Template Instantiation}.
2444 @item -fvisibility-ms-compat
2445 @opindex fvisibility-ms-compat
2446 This flag attempts to use visibility settings to make GCC's C++
2447 linkage model compatible with that of Microsoft Visual Studio.
2449 The flag makes these changes to GCC's linkage model:
2451 @enumerate
2452 @item
2453 It sets the default visibility to @code{hidden}, like
2454 @option{-fvisibility=hidden}.
2456 @item
2457 Types, but not their members, are not hidden by default.
2459 @item
2460 The One Definition Rule is relaxed for types without explicit
2461 visibility specifications that are defined in more than one
2462 shared object: those declarations are permitted if they are
2463 permitted when this option is not used.
2464 @end enumerate
2466 In new code it is better to use @option{-fvisibility=hidden} and
2467 export those classes that are intended to be externally visible.
2468 Unfortunately it is possible for code to rely, perhaps accidentally,
2469 on the Visual Studio behavior.
2471 Among the consequences of these changes are that static data members
2472 of the same type with the same name but defined in different shared
2473 objects are different, so changing one does not change the other;
2474 and that pointers to function members defined in different shared
2475 objects may not compare equal.  When this flag is given, it is a
2476 violation of the ODR to define types with the same name differently.
2478 @item -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]}
2479 @opindex fvtable-verify
2480 Turn on (or off, if using @option{-fvtable-verify=none}) the security
2481 feature that verifies at run time, for every virtual call, that
2482 the vtable pointer through which the call is made is valid for the type of
2483 the object, and has not been corrupted or overwritten.  If an invalid vtable
2484 pointer is detected at run time, an error is reported and execution of the
2485 program is immediately halted.
2487 This option causes run-time data structures to be built at program startup,
2488 which are used for verifying the vtable pointers.  
2489 The options @samp{std} and @samp{preinit}
2490 control the timing of when these data structures are built.  In both cases the
2491 data structures are built before execution reaches @code{main}.  Using
2492 @option{-fvtable-verify=std} causes the data structures to be built after
2493 shared libraries have been loaded and initialized.
2494 @option{-fvtable-verify=preinit} causes them to be built before shared
2495 libraries have been loaded and initialized.
2497 If this option appears multiple times in the command line with different
2498 values specified, @samp{none} takes highest priority over both @samp{std} and
2499 @samp{preinit}; @samp{preinit} takes priority over @samp{std}.
2501 @item -fvtv-debug
2502 @opindex fvtv-debug
2503 When used in conjunction with @option{-fvtable-verify=std} or 
2504 @option{-fvtable-verify=preinit}, causes debug versions of the 
2505 runtime functions for the vtable verification feature to be called.  
2506 This flag also causes the compiler to log information about which 
2507 vtable pointers it finds for each class.
2508 This information is written to a file named @file{vtv_set_ptr_data.log} 
2509 in the directory named by the environment variable @env{VTV_LOGS_DIR} 
2510 if that is defined or the current working directory otherwise.
2512 Note:  This feature @emph{appends} data to the log file. If you want a fresh log
2513 file, be sure to delete any existing one.
2515 @item -fvtv-counts
2516 @opindex fvtv-counts
2517 This is a debugging flag.  When used in conjunction with
2518 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
2519 causes the compiler to keep track of the total number of virtual calls
2520 it encounters and the number of verifications it inserts.  It also
2521 counts the number of calls to certain run-time library functions
2522 that it inserts and logs this information for each compilation unit.
2523 The compiler writes this information to a file named
2524 @file{vtv_count_data.log} in the directory named by the environment
2525 variable @env{VTV_LOGS_DIR} if that is defined or the current working
2526 directory otherwise.  It also counts the size of the vtable pointer sets
2527 for each class, and writes this information to @file{vtv_class_set_sizes.log}
2528 in the same directory.
2530 Note:  This feature @emph{appends} data to the log files.  To get fresh log
2531 files, be sure to delete any existing ones.
2533 @item -fno-weak
2534 @opindex fno-weak
2535 Do not use weak symbol support, even if it is provided by the linker.
2536 By default, G++ uses weak symbols if they are available.  This
2537 option exists only for testing, and should not be used by end-users;
2538 it results in inferior code and has no benefits.  This option may
2539 be removed in a future release of G++.
2541 @item -nostdinc++
2542 @opindex nostdinc++
2543 Do not search for header files in the standard directories specific to
2544 C++, but do still search the other standard directories.  (This option
2545 is used when building the C++ library.)
2546 @end table
2548 In addition, these optimization, warning, and code generation options
2549 have meanings only for C++ programs:
2551 @table @gcctabopt
2552 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2553 @opindex Wabi
2554 @opindex Wno-abi
2555 When an explicit @option{-fabi-version=@var{n}} option is used, causes
2556 G++ to warn when it generates code that is probably not compatible with the
2557 vendor-neutral C++ ABI@.  Since G++ now defaults to
2558 @option{-fabi-version=0}, @option{-Wabi} has no effect unless either
2559 an older ABI version is selected (with @option{-fabi-version=@var{n}})
2560 or an older compatibility version is selected (with
2561 @option{-Wabi=@var{n}} or @option{-fabi-compat-version=@var{n}}).
2563 Although an effort has been made to warn about
2564 all such cases, there are probably some cases that are not warned about,
2565 even though G++ is generating incompatible code.  There may also be
2566 cases where warnings are emitted even though the code that is generated
2567 is compatible.
2569 You should rewrite your code to avoid these warnings if you are
2570 concerned about the fact that code generated by G++ may not be binary
2571 compatible with code generated by other compilers.
2573 @option{-Wabi} can also be used with an explicit version number to
2574 warn about compatibility with a particular @option{-fabi-version}
2575 level, e.g. @option{-Wabi=2} to warn about changes relative to
2576 @option{-fabi-version=2}.  Specifying a version number also sets
2577 @option{-fabi-compat-version=@var{n}}.
2579 The known incompatibilities in @option{-fabi-version=2} (which was the
2580 default from GCC 3.4 to 4.9) include:
2582 @itemize @bullet
2584 @item
2585 A template with a non-type template parameter of reference type was
2586 mangled incorrectly:
2587 @smallexample
2588 extern int N;
2589 template <int &> struct S @{@};
2590 void n (S<N>) @{2@}
2591 @end smallexample
2593 This was fixed in @option{-fabi-version=3}.
2595 @item
2596 SIMD vector types declared using @code{__attribute ((vector_size))} were
2597 mangled in a non-standard way that does not allow for overloading of
2598 functions taking vectors of different sizes.
2600 The mangling was changed in @option{-fabi-version=4}.
2602 @item
2603 @code{__attribute ((const))} and @code{noreturn} were mangled as type
2604 qualifiers, and @code{decltype} of a plain declaration was folded away.
2606 These mangling issues were fixed in @option{-fabi-version=5}.
2608 @item
2609 Scoped enumerators passed as arguments to a variadic function are
2610 promoted like unscoped enumerators, causing @code{va_arg} to complain.
2611 On most targets this does not actually affect the parameter passing
2612 ABI, as there is no way to pass an argument smaller than @code{int}.
2614 Also, the ABI changed the mangling of template argument packs,
2615 @code{const_cast}, @code{static_cast}, prefix increment/decrement, and
2616 a class scope function used as a template argument.
2618 These issues were corrected in @option{-fabi-version=6}.
2620 @item
2621 Lambdas in default argument scope were mangled incorrectly, and the
2622 ABI changed the mangling of @code{nullptr_t}.
2624 These issues were corrected in @option{-fabi-version=7}.
2626 @item
2627 When mangling a function type with function-cv-qualifiers, the
2628 un-qualified function type was incorrectly treated as a substitution
2629 candidate.
2631 This was fixed in @option{-fabi-version=8}.
2632 @end itemize
2634 It also warns about psABI-related changes.  The known psABI changes at this
2635 point include:
2637 @itemize @bullet
2639 @item
2640 For SysV/x86-64, unions with @code{long double} members are 
2641 passed in memory as specified in psABI.  For example:
2643 @smallexample
2644 union U @{
2645   long double ld;
2646   int i;
2648 @end smallexample
2650 @noindent
2651 @code{union U} is always passed in memory.
2653 @end itemize
2655 @item -Wabi-tag @r{(C++ and Objective-C++ only)}
2656 @opindex Wabi-tag
2657 @opindex -Wabi-tag
2658 Warn when a type with an ABI tag is used in a context that does not
2659 have that ABI tag.  See @ref{C++ Attributes} for more information
2660 about ABI tags.
2662 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2663 @opindex Wctor-dtor-privacy
2664 @opindex Wno-ctor-dtor-privacy
2665 Warn when a class seems unusable because all the constructors or
2666 destructors in that class are private, and it has neither friends nor
2667 public static member functions.  Also warn if there are no non-private
2668 methods, and there's at least one private member function that isn't
2669 a constructor or destructor.
2671 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2672 @opindex Wdelete-non-virtual-dtor
2673 @opindex Wno-delete-non-virtual-dtor
2674 Warn when @code{delete} is used to destroy an instance of a class that
2675 has virtual functions and non-virtual destructor. It is unsafe to delete
2676 an instance of a derived class through a pointer to a base class if the
2677 base class does not have a virtual destructor.  This warning is enabled
2678 by @option{-Wall}.
2680 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
2681 @opindex Wliteral-suffix
2682 @opindex Wno-literal-suffix
2683 Warn when a string or character literal is followed by a ud-suffix which does
2684 not begin with an underscore.  As a conforming extension, GCC treats such
2685 suffixes as separate preprocessing tokens in order to maintain backwards
2686 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
2687 For example:
2689 @smallexample
2690 #define __STDC_FORMAT_MACROS
2691 #include <inttypes.h>
2692 #include <stdio.h>
2694 int main() @{
2695   int64_t i64 = 123;
2696   printf("My int64: %" PRId64"\n", i64);
2698 @end smallexample
2700 In this case, @code{PRId64} is treated as a separate preprocessing token.
2702 This warning is enabled by default.
2704 @item -Wlto-type-mismatch
2705 @opindex Wlto-type-mismatch
2706 @opindex Wno-lto-type-mistmach
2708 During the link-time optimization warn about type mismatches in between
2709 global declarations from different compilation units.
2710 Requires @option{-flto} to be enabled.  Enabled by default.
2712 @item -Wnarrowing @r{(C++ and Objective-C++ only)}
2713 @opindex Wnarrowing
2714 @opindex Wno-narrowing
2715 Warn when a narrowing conversion prohibited by C++11 occurs within
2716 @samp{@{ @}}, e.g.
2718 @smallexample
2719 int i = @{ 2.2 @}; // error: narrowing from double to int
2720 @end smallexample
2722 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2724 With @option{-std=c++11}, @option{-Wno-narrowing} suppresses the diagnostic
2725 required by the standard.  Note that this does not affect the meaning
2726 of well-formed code; narrowing conversions are still considered
2727 ill-formed in SFINAE context.
2729 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2730 @opindex Wnoexcept
2731 @opindex Wno-noexcept
2732 Warn when a noexcept-expression evaluates to false because of a call
2733 to a function that does not have a non-throwing exception
2734 specification (i.e. @code{throw()} or @code{noexcept}) but is known by
2735 the compiler to never throw an exception.
2737 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2738 @opindex Wnon-virtual-dtor
2739 @opindex Wno-non-virtual-dtor
2740 Warn when a class has virtual functions and an accessible non-virtual
2741 destructor itself or in an accessible polymorphic base class, in which
2742 case it is possible but unsafe to delete an instance of a derived
2743 class through a pointer to the class itself or base class.  This
2744 warning is automatically enabled if @option{-Weffc++} is specified.
2746 @item -Wreorder @r{(C++ and Objective-C++ only)}
2747 @opindex Wreorder
2748 @opindex Wno-reorder
2749 @cindex reordering, warning
2750 @cindex warning for reordering of member initializers
2751 Warn when the order of member initializers given in the code does not
2752 match the order in which they must be executed.  For instance:
2754 @smallexample
2755 struct A @{
2756   int i;
2757   int j;
2758   A(): j (0), i (1) @{ @}
2760 @end smallexample
2762 @noindent
2763 The compiler rearranges the member initializers for @code{i}
2764 and @code{j} to match the declaration order of the members, emitting
2765 a warning to that effect.  This warning is enabled by @option{-Wall}.
2767 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
2768 @opindex fext-numeric-literals
2769 @opindex fno-ext-numeric-literals
2770 Accept imaginary, fixed-point, or machine-defined
2771 literal number suffixes as GNU extensions.
2772 When this option is turned off these suffixes are treated
2773 as C++11 user-defined literal numeric suffixes.
2774 This is on by default for all pre-C++11 dialects and all GNU dialects:
2775 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
2776 @option{-std=gnu++14}.
2777 This option is off by default
2778 for ISO C++11 onwards (@option{-std=c++11}, ...).
2779 @end table
2781 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2783 @table @gcctabopt
2784 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2785 @opindex Weffc++
2786 @opindex Wno-effc++
2787 Warn about violations of the following style guidelines from Scott Meyers'
2788 @cite{Effective C++} series of books:
2790 @itemize @bullet
2791 @item
2792 Define a copy constructor and an assignment operator for classes
2793 with dynamically-allocated memory.
2795 @item
2796 Prefer initialization to assignment in constructors.
2798 @item
2799 Have @code{operator=} return a reference to @code{*this}.
2801 @item
2802 Don't try to return a reference when you must return an object.
2804 @item
2805 Distinguish between prefix and postfix forms of increment and
2806 decrement operators.
2808 @item
2809 Never overload @code{&&}, @code{||}, or @code{,}.
2811 @end itemize
2813 This option also enables @option{-Wnon-virtual-dtor}, which is also
2814 one of the effective C++ recommendations.  However, the check is
2815 extended to warn about the lack of virtual destructor in accessible
2816 non-polymorphic bases classes too.
2818 When selecting this option, be aware that the standard library
2819 headers do not obey all of these guidelines; use @samp{grep -v}
2820 to filter out those warnings.
2822 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2823 @opindex Wstrict-null-sentinel
2824 @opindex Wno-strict-null-sentinel
2825 Warn about the use of an uncasted @code{NULL} as sentinel.  When
2826 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2827 to @code{__null}.  Although it is a null pointer constant rather than a
2828 null pointer, it is guaranteed to be of the same size as a pointer.
2829 But this use is not portable across different compilers.
2831 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2832 @opindex Wno-non-template-friend
2833 @opindex Wnon-template-friend
2834 Disable warnings when non-templatized friend functions are declared
2835 within a template.  Since the advent of explicit template specification
2836 support in G++, if the name of the friend is an unqualified-id (i.e.,
2837 @samp{friend foo(int)}), the C++ language specification demands that the
2838 friend declare or define an ordinary, nontemplate function.  (Section
2839 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2840 could be interpreted as a particular specialization of a templatized
2841 function.  Because this non-conforming behavior is no longer the default
2842 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2843 check existing code for potential trouble spots and is on by default.
2844 This new compiler behavior can be turned off with
2845 @option{-Wno-non-template-friend}, which keeps the conformant compiler code
2846 but disables the helpful warning.
2848 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2849 @opindex Wold-style-cast
2850 @opindex Wno-old-style-cast
2851 Warn if an old-style (C-style) cast to a non-void type is used within
2852 a C++ program.  The new-style casts (@code{dynamic_cast},
2853 @code{static_cast}, @code{reinterpret_cast}, and @code{const_cast}) are
2854 less vulnerable to unintended effects and much easier to search for.
2856 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2857 @opindex Woverloaded-virtual
2858 @opindex Wno-overloaded-virtual
2859 @cindex overloaded virtual function, warning
2860 @cindex warning for overloaded virtual function
2861 Warn when a function declaration hides virtual functions from a
2862 base class.  For example, in:
2864 @smallexample
2865 struct A @{
2866   virtual void f();
2869 struct B: public A @{
2870   void f(int);
2872 @end smallexample
2874 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2875 like:
2877 @smallexample
2878 B* b;
2879 b->f();
2880 @end smallexample
2882 @noindent
2883 fails to compile.
2885 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2886 @opindex Wno-pmf-conversions
2887 @opindex Wpmf-conversions
2888 Disable the diagnostic for converting a bound pointer to member function
2889 to a plain pointer.
2891 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2892 @opindex Wsign-promo
2893 @opindex Wno-sign-promo
2894 Warn when overload resolution chooses a promotion from unsigned or
2895 enumerated type to a signed type, over a conversion to an unsigned type of
2896 the same size.  Previous versions of G++ tried to preserve
2897 unsignedness, but the standard mandates the current behavior.
2899 @item -Wno-terminate @r{(C++ and Objective-C++ only)}
2900 @opindex Wterminate
2901 @opindex Wno-terminate
2902 Disable the warning about a throw-expression that will immediately
2903 result in a call to @code{terminate}.
2904 @end table
2906 @node Objective-C and Objective-C++ Dialect Options
2907 @section Options Controlling Objective-C and Objective-C++ Dialects
2909 @cindex compiler options, Objective-C and Objective-C++
2910 @cindex Objective-C and Objective-C++ options, command-line
2911 @cindex options, Objective-C and Objective-C++
2912 (NOTE: This manual does not describe the Objective-C and Objective-C++
2913 languages themselves.  @xref{Standards,,Language Standards
2914 Supported by GCC}, for references.)
2916 This section describes the command-line options that are only meaningful
2917 for Objective-C and Objective-C++ programs.  You can also use most of
2918 the language-independent GNU compiler options.
2919 For example, you might compile a file @file{some_class.m} like this:
2921 @smallexample
2922 gcc -g -fgnu-runtime -O -c some_class.m
2923 @end smallexample
2925 @noindent
2926 In this example, @option{-fgnu-runtime} is an option meant only for
2927 Objective-C and Objective-C++ programs; you can use the other options with
2928 any language supported by GCC@.
2930 Note that since Objective-C is an extension of the C language, Objective-C
2931 compilations may also use options specific to the C front-end (e.g.,
2932 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2933 C++-specific options (e.g., @option{-Wabi}).
2935 Here is a list of options that are @emph{only} for compiling Objective-C
2936 and Objective-C++ programs:
2938 @table @gcctabopt
2939 @item -fconstant-string-class=@var{class-name}
2940 @opindex fconstant-string-class
2941 Use @var{class-name} as the name of the class to instantiate for each
2942 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2943 class name is @code{NXConstantString} if the GNU runtime is being used, and
2944 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2945 @option{-fconstant-cfstrings} option, if also present, overrides the
2946 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2947 to be laid out as constant CoreFoundation strings.
2949 @item -fgnu-runtime
2950 @opindex fgnu-runtime
2951 Generate object code compatible with the standard GNU Objective-C
2952 runtime.  This is the default for most types of systems.
2954 @item -fnext-runtime
2955 @opindex fnext-runtime
2956 Generate output compatible with the NeXT runtime.  This is the default
2957 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2958 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2959 used.
2961 @item -fno-nil-receivers
2962 @opindex fno-nil-receivers
2963 Assume that all Objective-C message dispatches (@code{[receiver
2964 message:arg]}) in this translation unit ensure that the receiver is
2965 not @code{nil}.  This allows for more efficient entry points in the
2966 runtime to be used.  This option is only available in conjunction with
2967 the NeXT runtime and ABI version 0 or 1.
2969 @item -fobjc-abi-version=@var{n}
2970 @opindex fobjc-abi-version
2971 Use version @var{n} of the Objective-C ABI for the selected runtime.
2972 This option is currently supported only for the NeXT runtime.  In that
2973 case, Version 0 is the traditional (32-bit) ABI without support for
2974 properties and other Objective-C 2.0 additions.  Version 1 is the
2975 traditional (32-bit) ABI with support for properties and other
2976 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
2977 nothing is specified, the default is Version 0 on 32-bit target
2978 machines, and Version 2 on 64-bit target machines.
2980 @item -fobjc-call-cxx-cdtors
2981 @opindex fobjc-call-cxx-cdtors
2982 For each Objective-C class, check if any of its instance variables is a
2983 C++ object with a non-trivial default constructor.  If so, synthesize a
2984 special @code{- (id) .cxx_construct} instance method which runs
2985 non-trivial default constructors on any such instance variables, in order,
2986 and then return @code{self}.  Similarly, check if any instance variable
2987 is a C++ object with a non-trivial destructor, and if so, synthesize a
2988 special @code{- (void) .cxx_destruct} method which runs
2989 all such default destructors, in reverse order.
2991 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
2992 methods thusly generated only operate on instance variables
2993 declared in the current Objective-C class, and not those inherited
2994 from superclasses.  It is the responsibility of the Objective-C
2995 runtime to invoke all such methods in an object's inheritance
2996 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
2997 by the runtime immediately after a new object instance is allocated;
2998 the @code{- (void) .cxx_destruct} methods are invoked immediately
2999 before the runtime deallocates an object instance.
3001 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
3002 support for invoking the @code{- (id) .cxx_construct} and
3003 @code{- (void) .cxx_destruct} methods.
3005 @item -fobjc-direct-dispatch
3006 @opindex fobjc-direct-dispatch
3007 Allow fast jumps to the message dispatcher.  On Darwin this is
3008 accomplished via the comm page.
3010 @item -fobjc-exceptions
3011 @opindex fobjc-exceptions
3012 Enable syntactic support for structured exception handling in
3013 Objective-C, similar to what is offered by C++ and Java.  This option
3014 is required to use the Objective-C keywords @code{@@try},
3015 @code{@@throw}, @code{@@catch}, @code{@@finally} and
3016 @code{@@synchronized}.  This option is available with both the GNU
3017 runtime and the NeXT runtime (but not available in conjunction with
3018 the NeXT runtime on Mac OS X 10.2 and earlier).
3020 @item -fobjc-gc
3021 @opindex fobjc-gc
3022 Enable garbage collection (GC) in Objective-C and Objective-C++
3023 programs.  This option is only available with the NeXT runtime; the
3024 GNU runtime has a different garbage collection implementation that
3025 does not require special compiler flags.
3027 @item -fobjc-nilcheck
3028 @opindex fobjc-nilcheck
3029 For the NeXT runtime with version 2 of the ABI, check for a nil
3030 receiver in method invocations before doing the actual method call.
3031 This is the default and can be disabled using
3032 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
3033 checked for nil in this way no matter what this flag is set to.
3034 Currently this flag does nothing when the GNU runtime, or an older
3035 version of the NeXT runtime ABI, is used.
3037 @item -fobjc-std=objc1
3038 @opindex fobjc-std
3039 Conform to the language syntax of Objective-C 1.0, the language
3040 recognized by GCC 4.0.  This only affects the Objective-C additions to
3041 the C/C++ language; it does not affect conformance to C/C++ standards,
3042 which is controlled by the separate C/C++ dialect option flags.  When
3043 this option is used with the Objective-C or Objective-C++ compiler,
3044 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
3045 This is useful if you need to make sure that your Objective-C code can
3046 be compiled with older versions of GCC@.
3048 @item -freplace-objc-classes
3049 @opindex freplace-objc-classes
3050 Emit a special marker instructing @command{ld(1)} not to statically link in
3051 the resulting object file, and allow @command{dyld(1)} to load it in at
3052 run time instead.  This is used in conjunction with the Fix-and-Continue
3053 debugging mode, where the object file in question may be recompiled and
3054 dynamically reloaded in the course of program execution, without the need
3055 to restart the program itself.  Currently, Fix-and-Continue functionality
3056 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
3057 and later.
3059 @item -fzero-link
3060 @opindex fzero-link
3061 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
3062 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
3063 compile time) with static class references that get initialized at load time,
3064 which improves run-time performance.  Specifying the @option{-fzero-link} flag
3065 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
3066 to be retained.  This is useful in Zero-Link debugging mode, since it allows
3067 for individual class implementations to be modified during program execution.
3068 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
3069 regardless of command-line options.
3071 @item -fno-local-ivars
3072 @opindex fno-local-ivars
3073 @opindex flocal-ivars
3074 By default instance variables in Objective-C can be accessed as if
3075 they were local variables from within the methods of the class they're
3076 declared in.  This can lead to shadowing between instance variables
3077 and other variables declared either locally inside a class method or
3078 globally with the same name.  Specifying the @option{-fno-local-ivars}
3079 flag disables this behavior thus avoiding variable shadowing issues.
3081 @item -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]}
3082 @opindex fivar-visibility
3083 Set the default instance variable visibility to the specified option
3084 so that instance variables declared outside the scope of any access
3085 modifier directives default to the specified visibility.
3087 @item -gen-decls
3088 @opindex gen-decls
3089 Dump interface declarations for all classes seen in the source file to a
3090 file named @file{@var{sourcename}.decl}.
3092 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
3093 @opindex Wassign-intercept
3094 @opindex Wno-assign-intercept
3095 Warn whenever an Objective-C assignment is being intercepted by the
3096 garbage collector.
3098 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
3099 @opindex Wno-protocol
3100 @opindex Wprotocol
3101 If a class is declared to implement a protocol, a warning is issued for
3102 every method in the protocol that is not implemented by the class.  The
3103 default behavior is to issue a warning for every method not explicitly
3104 implemented in the class, even if a method implementation is inherited
3105 from the superclass.  If you use the @option{-Wno-protocol} option, then
3106 methods inherited from the superclass are considered to be implemented,
3107 and no warning is issued for them.
3109 @item -Wselector @r{(Objective-C and Objective-C++ only)}
3110 @opindex Wselector
3111 @opindex Wno-selector
3112 Warn if multiple methods of different types for the same selector are
3113 found during compilation.  The check is performed on the list of methods
3114 in the final stage of compilation.  Additionally, a check is performed
3115 for each selector appearing in a @code{@@selector(@dots{})}
3116 expression, and a corresponding method for that selector has been found
3117 during compilation.  Because these checks scan the method table only at
3118 the end of compilation, these warnings are not produced if the final
3119 stage of compilation is not reached, for example because an error is
3120 found during compilation, or because the @option{-fsyntax-only} option is
3121 being used.
3123 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
3124 @opindex Wstrict-selector-match
3125 @opindex Wno-strict-selector-match
3126 Warn if multiple methods with differing argument and/or return types are
3127 found for a given selector when attempting to send a message using this
3128 selector to a receiver of type @code{id} or @code{Class}.  When this flag
3129 is off (which is the default behavior), the compiler omits such warnings
3130 if any differences found are confined to types that share the same size
3131 and alignment.
3133 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
3134 @opindex Wundeclared-selector
3135 @opindex Wno-undeclared-selector
3136 Warn if a @code{@@selector(@dots{})} expression referring to an
3137 undeclared selector is found.  A selector is considered undeclared if no
3138 method with that name has been declared before the
3139 @code{@@selector(@dots{})} expression, either explicitly in an
3140 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
3141 an @code{@@implementation} section.  This option always performs its
3142 checks as soon as a @code{@@selector(@dots{})} expression is found,
3143 while @option{-Wselector} only performs its checks in the final stage of
3144 compilation.  This also enforces the coding style convention
3145 that methods and selectors must be declared before being used.
3147 @item -print-objc-runtime-info
3148 @opindex print-objc-runtime-info
3149 Generate C header describing the largest structure that is passed by
3150 value, if any.
3152 @end table
3154 @node Diagnostic Message Formatting Options
3155 @section Options to Control Diagnostic Messages Formatting
3156 @cindex options to control diagnostics formatting
3157 @cindex diagnostic messages
3158 @cindex message formatting
3160 Traditionally, diagnostic messages have been formatted irrespective of
3161 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
3162 options described below
3163 to control the formatting algorithm for diagnostic messages, 
3164 e.g.@: how many characters per line, how often source location
3165 information should be reported.  Note that some language front ends may not
3166 honor these options.
3168 @table @gcctabopt
3169 @item -fmessage-length=@var{n}
3170 @opindex fmessage-length
3171 Try to format error messages so that they fit on lines of about
3172 @var{n} characters.  If @var{n} is zero, then no line-wrapping is
3173 done; each error message appears on a single line.  This is the
3174 default for all front ends.
3176 @item -fdiagnostics-show-location=once
3177 @opindex fdiagnostics-show-location
3178 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
3179 reporter to emit source location information @emph{once}; that is, in
3180 case the message is too long to fit on a single physical line and has to
3181 be wrapped, the source location won't be emitted (as prefix) again,
3182 over and over, in subsequent continuation lines.  This is the default
3183 behavior.
3185 @item -fdiagnostics-show-location=every-line
3186 Only meaningful in line-wrapping mode.  Instructs the diagnostic
3187 messages reporter to emit the same source location information (as
3188 prefix) for physical lines that result from the process of breaking
3189 a message which is too long to fit on a single line.
3191 @item -fdiagnostics-color[=@var{WHEN}]
3192 @itemx -fno-diagnostics-color
3193 @opindex fdiagnostics-color
3194 @cindex highlight, color, colour
3195 @vindex GCC_COLORS @r{environment variable}
3196 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
3197 or @samp{auto}.  The default depends on how the compiler has been configured,
3198 it can be any of the above @var{WHEN} options or also @samp{never}
3199 if @env{GCC_COLORS} environment variable isn't present in the environment,
3200 and @samp{auto} otherwise.
3201 @samp{auto} means to use color only when the standard error is a terminal.
3202 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
3203 aliases for @option{-fdiagnostics-color=always} and
3204 @option{-fdiagnostics-color=never}, respectively.
3206 The colors are defined by the environment variable @env{GCC_COLORS}.
3207 Its value is a colon-separated list of capabilities and Select Graphic
3208 Rendition (SGR) substrings. SGR commands are interpreted by the
3209 terminal or terminal emulator.  (See the section in the documentation
3210 of your text terminal for permitted values and their meanings as
3211 character attributes.)  These substring values are integers in decimal
3212 representation and can be concatenated with semicolons.
3213 Common values to concatenate include
3214 @samp{1} for bold,
3215 @samp{4} for underline,
3216 @samp{5} for blink,
3217 @samp{7} for inverse,
3218 @samp{39} for default foreground color,
3219 @samp{30} to @samp{37} for foreground colors,
3220 @samp{90} to @samp{97} for 16-color mode foreground colors,
3221 @samp{38;5;0} to @samp{38;5;255}
3222 for 88-color and 256-color modes foreground colors,
3223 @samp{49} for default background color,
3224 @samp{40} to @samp{47} for background colors,
3225 @samp{100} to @samp{107} for 16-color mode background colors,
3226 and @samp{48;5;0} to @samp{48;5;255}
3227 for 88-color and 256-color modes background colors.
3229 The default @env{GCC_COLORS} is
3230 @smallexample
3231 error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01
3232 @end smallexample
3233 @noindent
3234 where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
3235 @samp{01;36} is bold cyan, @samp{01;32} is bold green and
3236 @samp{01} is bold. Setting @env{GCC_COLORS} to the empty
3237 string disables colors.
3238 Supported capabilities are as follows.
3240 @table @code
3241 @item error=
3242 @vindex error GCC_COLORS @r{capability}
3243 SGR substring for error: markers.
3245 @item warning=
3246 @vindex warning GCC_COLORS @r{capability}
3247 SGR substring for warning: markers.
3249 @item note=
3250 @vindex note GCC_COLORS @r{capability}
3251 SGR substring for note: markers.
3253 @item caret=
3254 @vindex caret GCC_COLORS @r{capability}
3255 SGR substring for caret line.
3257 @item locus=
3258 @vindex locus GCC_COLORS @r{capability}
3259 SGR substring for location information, @samp{file:line} or
3260 @samp{file:line:column} etc.
3262 @item quote=
3263 @vindex quote GCC_COLORS @r{capability}
3264 SGR substring for information printed within quotes.
3265 @end table
3267 @item -fno-diagnostics-show-option
3268 @opindex fno-diagnostics-show-option
3269 @opindex fdiagnostics-show-option
3270 By default, each diagnostic emitted includes text indicating the
3271 command-line option that directly controls the diagnostic (if such an
3272 option is known to the diagnostic machinery).  Specifying the
3273 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
3275 @item -fno-diagnostics-show-caret
3276 @opindex fno-diagnostics-show-caret
3277 @opindex fdiagnostics-show-caret
3278 By default, each diagnostic emitted includes the original source line
3279 and a caret '^' indicating the column.  This option suppresses this
3280 information.  The source line is truncated to @var{n} characters, if
3281 the @option{-fmessage-length=n} option is given.  When the output is done
3282 to the terminal, the width is limited to the width given by the
3283 @env{COLUMNS} environment variable or, if not set, to the terminal width.
3285 @end table
3287 @node Warning Options
3288 @section Options to Request or Suppress Warnings
3289 @cindex options to control warnings
3290 @cindex warning messages
3291 @cindex messages, warning
3292 @cindex suppressing warnings
3294 Warnings are diagnostic messages that report constructions that
3295 are not inherently erroneous but that are risky or suggest there
3296 may have been an error.
3298 The following language-independent options do not enable specific
3299 warnings but control the kinds of diagnostics produced by GCC@.
3301 @table @gcctabopt
3302 @cindex syntax checking
3303 @item -fsyntax-only
3304 @opindex fsyntax-only
3305 Check the code for syntax errors, but don't do anything beyond that.
3307 @item -fmax-errors=@var{n}
3308 @opindex fmax-errors
3309 Limits the maximum number of error messages to @var{n}, at which point
3310 GCC bails out rather than attempting to continue processing the source
3311 code.  If @var{n} is 0 (the default), there is no limit on the number
3312 of error messages produced.  If @option{-Wfatal-errors} is also
3313 specified, then @option{-Wfatal-errors} takes precedence over this
3314 option.
3316 @item -w
3317 @opindex w
3318 Inhibit all warning messages.
3320 @item -Werror
3321 @opindex Werror
3322 @opindex Wno-error
3323 Make all warnings into errors.
3325 @item -Werror=
3326 @opindex Werror=
3327 @opindex Wno-error=
3328 Make the specified warning into an error.  The specifier for a warning
3329 is appended; for example @option{-Werror=switch} turns the warnings
3330 controlled by @option{-Wswitch} into errors.  This switch takes a
3331 negative form, to be used to negate @option{-Werror} for specific
3332 warnings; for example @option{-Wno-error=switch} makes
3333 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3334 is in effect.
3336 The warning message for each controllable warning includes the
3337 option that controls the warning.  That option can then be used with
3338 @option{-Werror=} and @option{-Wno-error=} as described above.
3339 (Printing of the option in the warning message can be disabled using the
3340 @option{-fno-diagnostics-show-option} flag.)
3342 Note that specifying @option{-Werror=}@var{foo} automatically implies
3343 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3344 imply anything.
3346 @item -Wfatal-errors
3347 @opindex Wfatal-errors
3348 @opindex Wno-fatal-errors
3349 This option causes the compiler to abort compilation on the first error
3350 occurred rather than trying to keep going and printing further error
3351 messages.
3353 @end table
3355 You can request many specific warnings with options beginning with
3356 @samp{-W}, for example @option{-Wimplicit} to request warnings on
3357 implicit declarations.  Each of these specific warning options also
3358 has a negative form beginning @samp{-Wno-} to turn off warnings; for
3359 example, @option{-Wno-implicit}.  This manual lists only one of the
3360 two forms, whichever is not the default.  For further
3361 language-specific options also refer to @ref{C++ Dialect Options} and
3362 @ref{Objective-C and Objective-C++ Dialect Options}.
3364 Some options, such as @option{-Wall} and @option{-Wextra}, turn on other
3365 options, such as @option{-Wunused}, which may turn on further options,
3366 such as @option{-Wunused-value}. The combined effect of positive and
3367 negative forms is that more specific options have priority over less
3368 specific ones, independently of their position in the command-line. For
3369 options of the same specificity, the last one takes effect. Options
3370 enabled or disabled via pragmas (@pxref{Diagnostic Pragmas}) take effect
3371 as if they appeared at the end of the command-line.
3373 When an unrecognized warning option is requested (e.g.,
3374 @option{-Wunknown-warning}), GCC emits a diagnostic stating
3375 that the option is not recognized.  However, if the @option{-Wno-} form
3376 is used, the behavior is slightly different: no diagnostic is
3377 produced for @option{-Wno-unknown-warning} unless other diagnostics
3378 are being produced.  This allows the use of new @option{-Wno-} options
3379 with old compilers, but if something goes wrong, the compiler
3380 warns that an unrecognized option is present.
3382 @table @gcctabopt
3383 @item -Wpedantic
3384 @itemx -pedantic
3385 @opindex pedantic
3386 @opindex Wpedantic
3387 Issue all the warnings demanded by strict ISO C and ISO C++;
3388 reject all programs that use forbidden extensions, and some other
3389 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
3390 version of the ISO C standard specified by any @option{-std} option used.
3392 Valid ISO C and ISO C++ programs should compile properly with or without
3393 this option (though a rare few require @option{-ansi} or a
3394 @option{-std} option specifying the required version of ISO C)@.  However,
3395 without this option, certain GNU extensions and traditional C and C++
3396 features are supported as well.  With this option, they are rejected.
3398 @option{-Wpedantic} does not cause warning messages for use of the
3399 alternate keywords whose names begin and end with @samp{__}.  Pedantic
3400 warnings are also disabled in the expression that follows
3401 @code{__extension__}.  However, only system header files should use
3402 these escape routes; application programs should avoid them.
3403 @xref{Alternate Keywords}.
3405 Some users try to use @option{-Wpedantic} to check programs for strict ISO
3406 C conformance.  They soon find that it does not do quite what they want:
3407 it finds some non-ISO practices, but not all---only those for which
3408 ISO C @emph{requires} a diagnostic, and some others for which
3409 diagnostics have been added.
3411 A feature to report any failure to conform to ISO C might be useful in
3412 some instances, but would require considerable additional work and would
3413 be quite different from @option{-Wpedantic}.  We don't have plans to
3414 support such a feature in the near future.
3416 Where the standard specified with @option{-std} represents a GNU
3417 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3418 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3419 extended dialect is based.  Warnings from @option{-Wpedantic} are given
3420 where they are required by the base standard.  (It does not make sense
3421 for such warnings to be given only for features not in the specified GNU
3422 C dialect, since by definition the GNU dialects of C include all
3423 features the compiler supports with the given option, and there would be
3424 nothing to warn about.)
3426 @item -pedantic-errors
3427 @opindex pedantic-errors
3428 Give an error whenever the @dfn{base standard} (see @option{-Wpedantic})
3429 requires a diagnostic, in some cases where there is undefined behavior
3430 at compile-time and in some other cases that do not prevent compilation
3431 of programs that are valid according to the standard. This is not
3432 equivalent to @option{-Werror=pedantic}, since there are errors enabled
3433 by this option and not enabled by the latter and vice versa.
3435 @item -Wall
3436 @opindex Wall
3437 @opindex Wno-all
3438 This enables all the warnings about constructions that some users
3439 consider questionable, and that are easy to avoid (or modify to
3440 prevent the warning), even in conjunction with macros.  This also
3441 enables some language-specific warnings described in @ref{C++ Dialect
3442 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3444 @option{-Wall} turns on the following warning flags:
3446 @gccoptlist{-Waddress   @gol
3447 -Warray-bounds=1 @r{(only with} @option{-O2}@r{)}  @gol
3448 -Wc++11-compat  -Wc++14-compat@gol
3449 -Wchar-subscripts  @gol
3450 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
3451 -Wimplicit-int @r{(C and Objective-C only)} @gol
3452 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3453 -Wcomment  @gol
3454 -Wformat   @gol
3455 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3456 -Wmaybe-uninitialized @gol
3457 -Wmissing-braces @r{(only for C/ObjC)} @gol
3458 -Wnonnull  @gol
3459 -Wopenmp-simd @gol
3460 -Wparentheses  @gol
3461 -Wpointer-sign  @gol
3462 -Wreorder   @gol
3463 -Wreturn-type  @gol
3464 -Wsequence-point  @gol
3465 -Wsign-compare @r{(only in C++)}  @gol
3466 -Wstrict-aliasing  @gol
3467 -Wstrict-overflow=1  @gol
3468 -Wswitch  @gol
3469 -Wtrigraphs  @gol
3470 -Wuninitialized  @gol
3471 -Wunknown-pragmas  @gol
3472 -Wunused-function  @gol
3473 -Wunused-label     @gol
3474 -Wunused-value     @gol
3475 -Wunused-variable  @gol
3476 -Wvolatile-register-var @gol
3479 Note that some warning flags are not implied by @option{-Wall}.  Some of
3480 them warn about constructions that users generally do not consider
3481 questionable, but which occasionally you might wish to check for;
3482 others warn about constructions that are necessary or hard to avoid in
3483 some cases, and there is no simple way to modify the code to suppress
3484 the warning. Some of them are enabled by @option{-Wextra} but many of
3485 them must be enabled individually.
3487 @item -Wextra
3488 @opindex W
3489 @opindex Wextra
3490 @opindex Wno-extra
3491 This enables some extra warning flags that are not enabled by
3492 @option{-Wall}. (This option used to be called @option{-W}.  The older
3493 name is still supported, but the newer name is more descriptive.)
3495 @gccoptlist{-Wclobbered  @gol
3496 -Wempty-body  @gol
3497 -Wignored-qualifiers @gol
3498 -Wmissing-field-initializers  @gol
3499 -Wmissing-parameter-type @r{(C only)}  @gol
3500 -Wold-style-declaration @r{(C only)}  @gol
3501 -Woverride-init  @gol
3502 -Wsign-compare  @gol
3503 -Wtype-limits  @gol
3504 -Wuninitialized  @gol
3505 -Wshift-negative-value  @gol
3506 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3507 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3510 The option @option{-Wextra} also prints warning messages for the
3511 following cases:
3513 @itemize @bullet
3515 @item
3516 A pointer is compared against integer zero with @code{<}, @code{<=},
3517 @code{>}, or @code{>=}.
3519 @item
3520 (C++ only) An enumerator and a non-enumerator both appear in a
3521 conditional expression.
3523 @item
3524 (C++ only) Ambiguous virtual bases.
3526 @item
3527 (C++ only) Subscripting an array that has been declared @code{register}.
3529 @item
3530 (C++ only) Taking the address of a variable that has been declared
3531 @code{register}.
3533 @item
3534 (C++ only) A base class is not initialized in a derived class's copy
3535 constructor.
3537 @end itemize
3539 @item -Wchar-subscripts
3540 @opindex Wchar-subscripts
3541 @opindex Wno-char-subscripts
3542 Warn if an array subscript has type @code{char}.  This is a common cause
3543 of error, as programmers often forget that this type is signed on some
3544 machines.
3545 This warning is enabled by @option{-Wall}.
3547 @item -Wcomment
3548 @opindex Wcomment
3549 @opindex Wno-comment
3550 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3551 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3552 This warning is enabled by @option{-Wall}.
3554 @item -Wno-coverage-mismatch
3555 @opindex Wno-coverage-mismatch
3556 Warn if feedback profiles do not match when using the
3557 @option{-fprofile-use} option.
3558 If a source file is changed between compiling with @option{-fprofile-gen} and
3559 with @option{-fprofile-use}, the files with the profile feedback can fail
3560 to match the source file and GCC cannot use the profile feedback
3561 information.  By default, this warning is enabled and is treated as an
3562 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3563 warning or @option{-Wno-error=coverage-mismatch} can be used to
3564 disable the error.  Disabling the error for this warning can result in
3565 poorly optimized code and is useful only in the
3566 case of very minor changes such as bug fixes to an existing code-base.
3567 Completely disabling the warning is not recommended.
3569 @item -Wno-cpp
3570 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3572 Suppress warning messages emitted by @code{#warning} directives.
3574 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3575 @opindex Wdouble-promotion
3576 @opindex Wno-double-promotion
3577 Give a warning when a value of type @code{float} is implicitly
3578 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3579 floating-point unit implement @code{float} in hardware, but emulate
3580 @code{double} in software.  On such a machine, doing computations
3581 using @code{double} values is much more expensive because of the
3582 overhead required for software emulation.
3584 It is easy to accidentally do computations with @code{double} because
3585 floating-point literals are implicitly of type @code{double}.  For
3586 example, in:
3587 @smallexample
3588 @group
3589 float area(float radius)
3591    return 3.14159 * radius * radius;
3593 @end group
3594 @end smallexample
3595 the compiler performs the entire computation with @code{double}
3596 because the floating-point literal is a @code{double}.
3598 @item -Wformat
3599 @itemx -Wformat=@var{n}
3600 @opindex Wformat
3601 @opindex Wno-format
3602 @opindex ffreestanding
3603 @opindex fno-builtin
3604 @opindex Wformat=
3605 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3606 the arguments supplied have types appropriate to the format string
3607 specified, and that the conversions specified in the format string make
3608 sense.  This includes standard functions, and others specified by format
3609 attributes (@pxref{Function Attributes}), in the @code{printf},
3610 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3611 not in the C standard) families (or other target-specific families).
3612 Which functions are checked without format attributes having been
3613 specified depends on the standard version selected, and such checks of
3614 functions without the attribute specified are disabled by
3615 @option{-ffreestanding} or @option{-fno-builtin}.
3617 The formats are checked against the format features supported by GNU
3618 libc version 2.2.  These include all ISO C90 and C99 features, as well
3619 as features from the Single Unix Specification and some BSD and GNU
3620 extensions.  Other library implementations may not support all these
3621 features; GCC does not support warning about features that go beyond a
3622 particular library's limitations.  However, if @option{-Wpedantic} is used
3623 with @option{-Wformat}, warnings are given about format features not
3624 in the selected standard version (but not for @code{strfmon} formats,
3625 since those are not in any version of the C standard).  @xref{C Dialect
3626 Options,,Options Controlling C Dialect}.
3628 @table @gcctabopt
3629 @item -Wformat=1
3630 @itemx -Wformat
3631 @opindex Wformat
3632 @opindex Wformat=1
3633 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
3634 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
3635 @option{-Wformat} also checks for null format arguments for several
3636 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
3637 aspects of this level of format checking can be disabled by the
3638 options: @option{-Wno-format-contains-nul},
3639 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
3640 @option{-Wformat} is enabled by @option{-Wall}.
3642 @item -Wno-format-contains-nul
3643 @opindex Wno-format-contains-nul
3644 @opindex Wformat-contains-nul
3645 If @option{-Wformat} is specified, do not warn about format strings that
3646 contain NUL bytes.
3648 @item -Wno-format-extra-args
3649 @opindex Wno-format-extra-args
3650 @opindex Wformat-extra-args
3651 If @option{-Wformat} is specified, do not warn about excess arguments to a
3652 @code{printf} or @code{scanf} format function.  The C standard specifies
3653 that such arguments are ignored.
3655 Where the unused arguments lie between used arguments that are
3656 specified with @samp{$} operand number specifications, normally
3657 warnings are still given, since the implementation could not know what
3658 type to pass to @code{va_arg} to skip the unused arguments.  However,
3659 in the case of @code{scanf} formats, this option suppresses the
3660 warning if the unused arguments are all pointers, since the Single
3661 Unix Specification says that such unused arguments are allowed.
3663 @item -Wno-format-zero-length
3664 @opindex Wno-format-zero-length
3665 @opindex Wformat-zero-length
3666 If @option{-Wformat} is specified, do not warn about zero-length formats.
3667 The C standard specifies that zero-length formats are allowed.
3670 @item -Wformat=2
3671 @opindex Wformat=2
3672 Enable @option{-Wformat} plus additional format checks.  Currently
3673 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
3674 -Wformat-y2k}.
3676 @item -Wformat-nonliteral
3677 @opindex Wformat-nonliteral
3678 @opindex Wno-format-nonliteral
3679 If @option{-Wformat} is specified, also warn if the format string is not a
3680 string literal and so cannot be checked, unless the format function
3681 takes its format arguments as a @code{va_list}.
3683 @item -Wformat-security
3684 @opindex Wformat-security
3685 @opindex Wno-format-security
3686 If @option{-Wformat} is specified, also warn about uses of format
3687 functions that represent possible security problems.  At present, this
3688 warns about calls to @code{printf} and @code{scanf} functions where the
3689 format string is not a string literal and there are no format arguments,
3690 as in @code{printf (foo);}.  This may be a security hole if the format
3691 string came from untrusted input and contains @samp{%n}.  (This is
3692 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3693 in future warnings may be added to @option{-Wformat-security} that are not
3694 included in @option{-Wformat-nonliteral}.)
3696 @item -Wformat-signedness
3697 @opindex Wformat-signedness
3698 @opindex Wno-format-signedness
3699 If @option{-Wformat} is specified, also warn if the format string
3700 requires an unsigned argument and the argument is signed and vice versa.
3702 @item -Wformat-y2k
3703 @opindex Wformat-y2k
3704 @opindex Wno-format-y2k
3705 If @option{-Wformat} is specified, also warn about @code{strftime}
3706 formats that may yield only a two-digit year.
3707 @end table
3709 @item -Wnonnull
3710 @opindex Wnonnull
3711 @opindex Wno-nonnull
3712 Warn about passing a null pointer for arguments marked as
3713 requiring a non-null value by the @code{nonnull} function attribute.
3715 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3716 can be disabled with the @option{-Wno-nonnull} option.
3718 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3719 @opindex Winit-self
3720 @opindex Wno-init-self
3721 Warn about uninitialized variables that are initialized with themselves.
3722 Note this option can only be used with the @option{-Wuninitialized} option.
3724 For example, GCC warns about @code{i} being uninitialized in the
3725 following snippet only when @option{-Winit-self} has been specified:
3726 @smallexample
3727 @group
3728 int f()
3730   int i = i;
3731   return i;
3733 @end group
3734 @end smallexample
3736 This warning is enabled by @option{-Wall} in C++.
3738 @item -Wimplicit-int @r{(C and Objective-C only)}
3739 @opindex Wimplicit-int
3740 @opindex Wno-implicit-int
3741 Warn when a declaration does not specify a type.
3742 This warning is enabled by @option{-Wall}.
3744 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3745 @opindex Wimplicit-function-declaration
3746 @opindex Wno-implicit-function-declaration
3747 Give a warning whenever a function is used before being declared. In
3748 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3749 enabled by default and it is made into an error by
3750 @option{-pedantic-errors}. This warning is also enabled by
3751 @option{-Wall}.
3753 @item -Wimplicit @r{(C and Objective-C only)}
3754 @opindex Wimplicit
3755 @opindex Wno-implicit
3756 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3757 This warning is enabled by @option{-Wall}.
3759 @item -Wignored-qualifiers @r{(C and C++ only)}
3760 @opindex Wignored-qualifiers
3761 @opindex Wno-ignored-qualifiers
3762 Warn if the return type of a function has a type qualifier
3763 such as @code{const}.  For ISO C such a type qualifier has no effect,
3764 since the value returned by a function is not an lvalue.
3765 For C++, the warning is only emitted for scalar types or @code{void}.
3766 ISO C prohibits qualified @code{void} return types on function
3767 definitions, so such return types always receive a warning
3768 even without this option.
3770 This warning is also enabled by @option{-Wextra}.
3772 @item -Wmain
3773 @opindex Wmain
3774 @opindex Wno-main
3775 Warn if the type of @code{main} is suspicious.  @code{main} should be
3776 a function with external linkage, returning int, taking either zero
3777 arguments, two, or three arguments of appropriate types.  This warning
3778 is enabled by default in C++ and is enabled by either @option{-Wall}
3779 or @option{-Wpedantic}.
3781 @item -Wmisleading-indentation @r{(C and C++ only)}
3782 @opindex Wmisleading-indentation
3783 @opindex Wno-misleading-indentation
3784 Warn when the indentation of the code does not reflect the block structure.
3785 Specifically, a warning is issued for @code{if}, @code{else}, @code{while}, and
3786 @code{for} clauses with a guarded statement that does not use braces,
3787 followed by an unguarded statement with the same indentation.
3789 This warning is disabled by default.
3791 In the following example, the call to ``bar'' is misleadingly indented as
3792 if it were guarded by the ``if'' conditional.
3794 @smallexample
3795   if (some_condition ())
3796     foo ();
3797     bar ();  /* Gotcha: this is not guarded by the "if".  */
3798 @end smallexample
3800 In the case of mixed tabs and spaces, the warning uses the
3801 @option{-ftabstop=} option to determine if the statements line up
3802 (defaulting to 8).
3804 The warning is not issued for code involving multiline preprocessor logic
3805 such as the following example.
3807 @smallexample
3808   if (flagA)
3809     foo (0);
3810 #if SOME_CONDITION_THAT_DOES_NOT_HOLD
3811   if (flagB)
3812 #endif
3813     foo (1);
3814 @end smallexample
3816 The warning is not issued after a @code{#line} directive, since this
3817 typically indicates autogenerated code, and no assumptions can be made
3818 about the layout of the file that the directive references.
3820 @item -Wmissing-braces
3821 @opindex Wmissing-braces
3822 @opindex Wno-missing-braces
3823 Warn if an aggregate or union initializer is not fully bracketed.  In
3824 the following example, the initializer for @code{a} is not fully
3825 bracketed, but that for @code{b} is fully bracketed.  This warning is
3826 enabled by @option{-Wall} in C.
3828 @smallexample
3829 int a[2][2] = @{ 0, 1, 2, 3 @};
3830 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3831 @end smallexample
3833 This warning is enabled by @option{-Wall}.
3835 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3836 @opindex Wmissing-include-dirs
3837 @opindex Wno-missing-include-dirs
3838 Warn if a user-supplied include directory does not exist.
3840 @item -Wparentheses
3841 @opindex Wparentheses
3842 @opindex Wno-parentheses
3843 Warn if parentheses are omitted in certain contexts, such
3844 as when there is an assignment in a context where a truth value
3845 is expected, or when operators are nested whose precedence people
3846 often get confused about.
3848 Also warn if a comparison like @code{x<=y<=z} appears; this is
3849 equivalent to @code{(x<=y ? 1 : 0) <= z}, which is a different
3850 interpretation from that of ordinary mathematical notation.
3852 Also warn about constructions where there may be confusion to which
3853 @code{if} statement an @code{else} branch belongs.  Here is an example of
3854 such a case:
3856 @smallexample
3857 @group
3859   if (a)
3860     if (b)
3861       foo ();
3862   else
3863     bar ();
3865 @end group
3866 @end smallexample
3868 In C/C++, every @code{else} branch belongs to the innermost possible
3869 @code{if} statement, which in this example is @code{if (b)}.  This is
3870 often not what the programmer expected, as illustrated in the above
3871 example by indentation the programmer chose.  When there is the
3872 potential for this confusion, GCC issues a warning when this flag
3873 is specified.  To eliminate the warning, add explicit braces around
3874 the innermost @code{if} statement so there is no way the @code{else}
3875 can belong to the enclosing @code{if}.  The resulting code
3876 looks like this:
3878 @smallexample
3879 @group
3881   if (a)
3882     @{
3883       if (b)
3884         foo ();
3885       else
3886         bar ();
3887     @}
3889 @end group
3890 @end smallexample
3892 Also warn for dangerous uses of the GNU extension to
3893 @code{?:} with omitted middle operand. When the condition
3894 in the @code{?}: operator is a boolean expression, the omitted value is
3895 always 1.  Often programmers expect it to be a value computed
3896 inside the conditional expression instead.
3898 This warning is enabled by @option{-Wall}.
3900 @item -Wsequence-point
3901 @opindex Wsequence-point
3902 @opindex Wno-sequence-point
3903 Warn about code that may have undefined semantics because of violations
3904 of sequence point rules in the C and C++ standards.
3906 The C and C++ standards define the order in which expressions in a C/C++
3907 program are evaluated in terms of @dfn{sequence points}, which represent
3908 a partial ordering between the execution of parts of the program: those
3909 executed before the sequence point, and those executed after it.  These
3910 occur after the evaluation of a full expression (one which is not part
3911 of a larger expression), after the evaluation of the first operand of a
3912 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3913 function is called (but after the evaluation of its arguments and the
3914 expression denoting the called function), and in certain other places.
3915 Other than as expressed by the sequence point rules, the order of
3916 evaluation of subexpressions of an expression is not specified.  All
3917 these rules describe only a partial order rather than a total order,
3918 since, for example, if two functions are called within one expression
3919 with no sequence point between them, the order in which the functions
3920 are called is not specified.  However, the standards committee have
3921 ruled that function calls do not overlap.
3923 It is not specified when between sequence points modifications to the
3924 values of objects take effect.  Programs whose behavior depends on this
3925 have undefined behavior; the C and C++ standards specify that ``Between
3926 the previous and next sequence point an object shall have its stored
3927 value modified at most once by the evaluation of an expression.
3928 Furthermore, the prior value shall be read only to determine the value
3929 to be stored.''.  If a program breaks these rules, the results on any
3930 particular implementation are entirely unpredictable.
3932 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3933 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3934 diagnosed by this option, and it may give an occasional false positive
3935 result, but in general it has been found fairly effective at detecting
3936 this sort of problem in programs.
3938 The standard is worded confusingly, therefore there is some debate
3939 over the precise meaning of the sequence point rules in subtle cases.
3940 Links to discussions of the problem, including proposed formal
3941 definitions, may be found on the GCC readings page, at
3942 @uref{http://gcc.gnu.org/@/readings.html}.
3944 This warning is enabled by @option{-Wall} for C and C++.
3946 @item -Wno-return-local-addr
3947 @opindex Wno-return-local-addr
3948 @opindex Wreturn-local-addr
3949 Do not warn about returning a pointer (or in C++, a reference) to a
3950 variable that goes out of scope after the function returns.
3952 @item -Wreturn-type
3953 @opindex Wreturn-type
3954 @opindex Wno-return-type
3955 Warn whenever a function is defined with a return type that defaults
3956 to @code{int}.  Also warn about any @code{return} statement with no
3957 return value in a function whose return type is not @code{void}
3958 (falling off the end of the function body is considered returning
3959 without a value), and about a @code{return} statement with an
3960 expression in a function whose return type is @code{void}.
3962 For C++, a function without return type always produces a diagnostic
3963 message, even when @option{-Wno-return-type} is specified.  The only
3964 exceptions are @code{main} and functions defined in system headers.
3966 This warning is enabled by @option{-Wall}.
3968 @item -Wshift-count-negative
3969 @opindex Wshift-count-negative
3970 @opindex Wno-shift-count-negative
3971 Warn if shift count is negative. This warning is enabled by default.
3973 @item -Wshift-count-overflow
3974 @opindex Wshift-count-overflow
3975 @opindex Wno-shift-count-overflow
3976 Warn if shift count >= width of type. This warning is enabled by default.
3978 @item -Wshift-negative-value
3979 @opindex Wshift-negative-value
3980 @opindex Wno-shift-negative-value
3981 Warn if left shifting a negative value.  This warning is enabled by
3982 @option{-Wextra} in C99 and C++11 modes (and newer).
3984 @item -Wshift-overflow
3985 @itemx -Wshift-overflow=@var{n}
3986 @opindex Wshift-overflow
3987 @opindex Wno-shift-overflow
3988 Warn about left shift overflows.  This warning is enabled by
3989 default in C99 and C++11 modes (and newer).
3991 @table @gcctabopt
3992 @item -Wshift-overflow=1
3993 This is the warning level of @option{-Wshift-overflow} and is enabled
3994 by default in C99 and C++11 modes (and newer).  This warning level does
3995 not warn about left-shifting 1 into the sign bit.  (However, in C, such
3996 an overflow is still rejected in contexts where an integer constant expression
3997 is required.)
3999 @item -Wshift-overflow=2
4000 This warning level also warns about left-shifting 1 into the sign bit,
4001 unless C++14 mode is active.
4002 @end table
4004 @item -Wswitch
4005 @opindex Wswitch
4006 @opindex Wno-switch
4007 Warn whenever a @code{switch} statement has an index of enumerated type
4008 and lacks a @code{case} for one or more of the named codes of that
4009 enumeration.  (The presence of a @code{default} label prevents this
4010 warning.)  @code{case} labels outside the enumeration range also
4011 provoke warnings when this option is used (even if there is a
4012 @code{default} label).
4013 This warning is enabled by @option{-Wall}.
4015 @item -Wswitch-default
4016 @opindex Wswitch-default
4017 @opindex Wno-switch-default
4018 Warn whenever a @code{switch} statement does not have a @code{default}
4019 case.
4021 @item -Wswitch-enum
4022 @opindex Wswitch-enum
4023 @opindex Wno-switch-enum
4024 Warn whenever a @code{switch} statement has an index of enumerated type
4025 and lacks a @code{case} for one or more of the named codes of that
4026 enumeration.  @code{case} labels outside the enumeration range also
4027 provoke warnings when this option is used.  The only difference
4028 between @option{-Wswitch} and this option is that this option gives a
4029 warning about an omitted enumeration code even if there is a
4030 @code{default} label.
4032 @item -Wswitch-bool
4033 @opindex Wswitch-bool
4034 @opindex Wno-switch-bool
4035 Warn whenever a @code{switch} statement has an index of boolean type
4036 and the case values are outside the range of a boolean type.
4037 It is possible to suppress this warning by casting the controlling
4038 expression to a type other than @code{bool}.  For example:
4039 @smallexample
4040 @group
4041 switch ((int) (a == 4))
4042   @{
4043   @dots{}
4044   @}
4045 @end group
4046 @end smallexample
4047 This warning is enabled by default for C and C++ programs.
4049 @item -Wsync-nand @r{(C and C++ only)}
4050 @opindex Wsync-nand
4051 @opindex Wno-sync-nand
4052 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
4053 built-in functions are used.  These functions changed semantics in GCC 4.4.
4055 @item -Wtrigraphs
4056 @opindex Wtrigraphs
4057 @opindex Wno-trigraphs
4058 Warn if any trigraphs are encountered that might change the meaning of
4059 the program (trigraphs within comments are not warned about).
4060 This warning is enabled by @option{-Wall}.
4062 @item -Wunused-but-set-parameter
4063 @opindex Wunused-but-set-parameter
4064 @opindex Wno-unused-but-set-parameter
4065 Warn whenever a function parameter is assigned to, but otherwise unused
4066 (aside from its declaration).
4068 To suppress this warning use the @code{unused} attribute
4069 (@pxref{Variable Attributes}).
4071 This warning is also enabled by @option{-Wunused} together with
4072 @option{-Wextra}.
4074 @item -Wunused-but-set-variable
4075 @opindex Wunused-but-set-variable
4076 @opindex Wno-unused-but-set-variable
4077 Warn whenever a local variable is assigned to, but otherwise unused
4078 (aside from its declaration).
4079 This warning is enabled by @option{-Wall}.
4081 To suppress this warning use the @code{unused} attribute
4082 (@pxref{Variable Attributes}).
4084 This warning is also enabled by @option{-Wunused}, which is enabled
4085 by @option{-Wall}.
4087 @item -Wunused-function
4088 @opindex Wunused-function
4089 @opindex Wno-unused-function
4090 Warn whenever a static function is declared but not defined or a
4091 non-inline static function is unused.
4092 This warning is enabled by @option{-Wall}.
4094 @item -Wunused-label
4095 @opindex Wunused-label
4096 @opindex Wno-unused-label
4097 Warn whenever a label is declared but not used.
4098 This warning is enabled by @option{-Wall}.
4100 To suppress this warning use the @code{unused} attribute
4101 (@pxref{Variable Attributes}).
4103 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
4104 @opindex Wunused-local-typedefs
4105 Warn when a typedef locally defined in a function is not used.
4106 This warning is enabled by @option{-Wall}.
4108 @item -Wunused-parameter
4109 @opindex Wunused-parameter
4110 @opindex Wno-unused-parameter
4111 Warn whenever a function parameter is unused aside from its declaration.
4113 To suppress this warning use the @code{unused} attribute
4114 (@pxref{Variable Attributes}).
4116 @item -Wno-unused-result
4117 @opindex Wunused-result
4118 @opindex Wno-unused-result
4119 Do not warn if a caller of a function marked with attribute
4120 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
4121 its return value. The default is @option{-Wunused-result}.
4123 @item -Wunused-variable
4124 @opindex Wunused-variable
4125 @opindex Wno-unused-variable
4126 Warn whenever a local variable or non-constant static variable is unused
4127 aside from its declaration.
4128 This warning is enabled by @option{-Wall}.
4130 To suppress this warning use the @code{unused} attribute
4131 (@pxref{Variable Attributes}).
4133 @item -Wunused-value
4134 @opindex Wunused-value
4135 @opindex Wno-unused-value
4136 Warn whenever a statement computes a result that is explicitly not
4137 used. To suppress this warning cast the unused expression to
4138 @code{void}. This includes an expression-statement or the left-hand
4139 side of a comma expression that contains no side effects. For example,
4140 an expression such as @code{x[i,j]} causes a warning, while
4141 @code{x[(void)i,j]} does not.
4143 This warning is enabled by @option{-Wall}.
4145 @item -Wunused
4146 @opindex Wunused
4147 @opindex Wno-unused
4148 All the above @option{-Wunused} options combined.
4150 In order to get a warning about an unused function parameter, you must
4151 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
4152 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
4154 @item -Wuninitialized
4155 @opindex Wuninitialized
4156 @opindex Wno-uninitialized
4157 Warn if an automatic variable is used without first being initialized
4158 or if a variable may be clobbered by a @code{setjmp} call. In C++,
4159 warn if a non-static reference or non-static @code{const} member
4160 appears in a class without constructors.
4162 If you want to warn about code that uses the uninitialized value of the
4163 variable in its own initializer, use the @option{-Winit-self} option.
4165 These warnings occur for individual uninitialized or clobbered
4166 elements of structure, union or array variables as well as for
4167 variables that are uninitialized or clobbered as a whole.  They do
4168 not occur for variables or elements declared @code{volatile}.  Because
4169 these warnings depend on optimization, the exact variables or elements
4170 for which there are warnings depends on the precise optimization
4171 options and version of GCC used.
4173 Note that there may be no warning about a variable that is used only
4174 to compute a value that itself is never used, because such
4175 computations may be deleted by data flow analysis before the warnings
4176 are printed.
4178 @item -Wmaybe-uninitialized
4179 @opindex Wmaybe-uninitialized
4180 @opindex Wno-maybe-uninitialized
4181 For an automatic variable, if there exists a path from the function
4182 entry to a use of the variable that is initialized, but there exist
4183 some other paths for which the variable is not initialized, the compiler
4184 emits a warning if it cannot prove the uninitialized paths are not
4185 executed at run time. These warnings are made optional because GCC is
4186 not smart enough to see all the reasons why the code might be correct
4187 in spite of appearing to have an error.  Here is one example of how
4188 this can happen:
4190 @smallexample
4191 @group
4193   int x;
4194   switch (y)
4195     @{
4196     case 1: x = 1;
4197       break;
4198     case 2: x = 4;
4199       break;
4200     case 3: x = 5;
4201     @}
4202   foo (x);
4204 @end group
4205 @end smallexample
4207 @noindent
4208 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
4209 always initialized, but GCC doesn't know this. To suppress the
4210 warning, you need to provide a default case with assert(0) or
4211 similar code.
4213 @cindex @code{longjmp} warnings
4214 This option also warns when a non-volatile automatic variable might be
4215 changed by a call to @code{longjmp}.  These warnings as well are possible
4216 only in optimizing compilation.
4218 The compiler sees only the calls to @code{setjmp}.  It cannot know
4219 where @code{longjmp} will be called; in fact, a signal handler could
4220 call it at any point in the code.  As a result, you may get a warning
4221 even when there is in fact no problem because @code{longjmp} cannot
4222 in fact be called at the place that would cause a problem.
4224 Some spurious warnings can be avoided if you declare all the functions
4225 you use that never return as @code{noreturn}.  @xref{Function
4226 Attributes}.
4228 This warning is enabled by @option{-Wall} or @option{-Wextra}.
4230 @item -Wunknown-pragmas
4231 @opindex Wunknown-pragmas
4232 @opindex Wno-unknown-pragmas
4233 @cindex warning for unknown pragmas
4234 @cindex unknown pragmas, warning
4235 @cindex pragmas, warning of unknown
4236 Warn when a @code{#pragma} directive is encountered that is not understood by 
4237 GCC@.  If this command-line option is used, warnings are even issued
4238 for unknown pragmas in system header files.  This is not the case if
4239 the warnings are only enabled by the @option{-Wall} command-line option.
4241 @item -Wno-pragmas
4242 @opindex Wno-pragmas
4243 @opindex Wpragmas
4244 Do not warn about misuses of pragmas, such as incorrect parameters,
4245 invalid syntax, or conflicts between pragmas.  See also
4246 @option{-Wunknown-pragmas}.
4248 @item -Wstrict-aliasing
4249 @opindex Wstrict-aliasing
4250 @opindex Wno-strict-aliasing
4251 This option is only active when @option{-fstrict-aliasing} is active.
4252 It warns about code that might break the strict aliasing rules that the
4253 compiler is using for optimization.  The warning does not catch all
4254 cases, but does attempt to catch the more common pitfalls.  It is
4255 included in @option{-Wall}.
4256 It is equivalent to @option{-Wstrict-aliasing=3}
4258 @item -Wstrict-aliasing=n
4259 @opindex Wstrict-aliasing=n
4260 This option is only active when @option{-fstrict-aliasing} is active.
4261 It warns about code that might break the strict aliasing rules that the
4262 compiler is using for optimization.
4263 Higher levels correspond to higher accuracy (fewer false positives).
4264 Higher levels also correspond to more effort, similar to the way @option{-O} 
4265 works.
4266 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
4268 Level 1: Most aggressive, quick, least accurate.
4269 Possibly useful when higher levels
4270 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
4271 false negatives.  However, it has many false positives.
4272 Warns for all pointer conversions between possibly incompatible types,
4273 even if never dereferenced.  Runs in the front end only.
4275 Level 2: Aggressive, quick, not too precise.
4276 May still have many false positives (not as many as level 1 though),
4277 and few false negatives (but possibly more than level 1).
4278 Unlike level 1, it only warns when an address is taken.  Warns about
4279 incomplete types.  Runs in the front end only.
4281 Level 3 (default for @option{-Wstrict-aliasing}):
4282 Should have very few false positives and few false
4283 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
4284 Takes care of the common pun+dereference pattern in the front end:
4285 @code{*(int*)&some_float}.
4286 If optimization is enabled, it also runs in the back end, where it deals
4287 with multiple statement cases using flow-sensitive points-to information.
4288 Only warns when the converted pointer is dereferenced.
4289 Does not warn about incomplete types.
4291 @item -Wstrict-overflow
4292 @itemx -Wstrict-overflow=@var{n}
4293 @opindex Wstrict-overflow
4294 @opindex Wno-strict-overflow
4295 This option is only active when @option{-fstrict-overflow} is active.
4296 It warns about cases where the compiler optimizes based on the
4297 assumption that signed overflow does not occur.  Note that it does not
4298 warn about all cases where the code might overflow: it only warns
4299 about cases where the compiler implements some optimization.  Thus
4300 this warning depends on the optimization level.
4302 An optimization that assumes that signed overflow does not occur is
4303 perfectly safe if the values of the variables involved are such that
4304 overflow never does, in fact, occur.  Therefore this warning can
4305 easily give a false positive: a warning about code that is not
4306 actually a problem.  To help focus on important issues, several
4307 warning levels are defined.  No warnings are issued for the use of
4308 undefined signed overflow when estimating how many iterations a loop
4309 requires, in particular when determining whether a loop will be
4310 executed at all.
4312 @table @gcctabopt
4313 @item -Wstrict-overflow=1
4314 Warn about cases that are both questionable and easy to avoid.  For
4315 example,  with @option{-fstrict-overflow}, the compiler simplifies
4316 @code{x + 1 > x} to @code{1}.  This level of
4317 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
4318 are not, and must be explicitly requested.
4320 @item -Wstrict-overflow=2
4321 Also warn about other cases where a comparison is simplified to a
4322 constant.  For example: @code{abs (x) >= 0}.  This can only be
4323 simplified when @option{-fstrict-overflow} is in effect, because
4324 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
4325 zero.  @option{-Wstrict-overflow} (with no level) is the same as
4326 @option{-Wstrict-overflow=2}.
4328 @item -Wstrict-overflow=3
4329 Also warn about other cases where a comparison is simplified.  For
4330 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
4332 @item -Wstrict-overflow=4
4333 Also warn about other simplifications not covered by the above cases.
4334 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
4336 @item -Wstrict-overflow=5
4337 Also warn about cases where the compiler reduces the magnitude of a
4338 constant involved in a comparison.  For example: @code{x + 2 > y} is
4339 simplified to @code{x + 1 >= y}.  This is reported only at the
4340 highest warning level because this simplification applies to many
4341 comparisons, so this warning level gives a very large number of
4342 false positives.
4343 @end table
4345 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]}
4346 @opindex Wsuggest-attribute=
4347 @opindex Wno-suggest-attribute=
4348 Warn for cases where adding an attribute may be beneficial. The
4349 attributes currently supported are listed below.
4351 @table @gcctabopt
4352 @item -Wsuggest-attribute=pure
4353 @itemx -Wsuggest-attribute=const
4354 @itemx -Wsuggest-attribute=noreturn
4355 @opindex Wsuggest-attribute=pure
4356 @opindex Wno-suggest-attribute=pure
4357 @opindex Wsuggest-attribute=const
4358 @opindex Wno-suggest-attribute=const
4359 @opindex Wsuggest-attribute=noreturn
4360 @opindex Wno-suggest-attribute=noreturn
4362 Warn about functions that might be candidates for attributes
4363 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
4364 functions visible in other compilation units or (in the case of @code{pure} and
4365 @code{const}) if it cannot prove that the function returns normally. A function
4366 returns normally if it doesn't contain an infinite loop or return abnormally
4367 by throwing, calling @code{abort} or trapping.  This analysis requires option
4368 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
4369 higher.  Higher optimization levels improve the accuracy of the analysis.
4371 @item -Wsuggest-attribute=format
4372 @itemx -Wmissing-format-attribute
4373 @opindex Wsuggest-attribute=format
4374 @opindex Wmissing-format-attribute
4375 @opindex Wno-suggest-attribute=format
4376 @opindex Wno-missing-format-attribute
4377 @opindex Wformat
4378 @opindex Wno-format
4380 Warn about function pointers that might be candidates for @code{format}
4381 attributes.  Note these are only possible candidates, not absolute ones.
4382 GCC guesses that function pointers with @code{format} attributes that
4383 are used in assignment, initialization, parameter passing or return
4384 statements should have a corresponding @code{format} attribute in the
4385 resulting type.  I.e.@: the left-hand side of the assignment or
4386 initialization, the type of the parameter variable, or the return type
4387 of the containing function respectively should also have a @code{format}
4388 attribute to avoid the warning.
4390 GCC also warns about function definitions that might be
4391 candidates for @code{format} attributes.  Again, these are only
4392 possible candidates.  GCC guesses that @code{format} attributes
4393 might be appropriate for any function that calls a function like
4394 @code{vprintf} or @code{vscanf}, but this might not always be the
4395 case, and some functions for which @code{format} attributes are
4396 appropriate may not be detected.
4397 @end table
4399 @item -Wsuggest-final-types
4400 @opindex Wno-suggest-final-types
4401 @opindex Wsuggest-final-types
4402 Warn about types with virtual methods where code quality would be improved
4403 if the type were declared with the C++11 @code{final} specifier, 
4404 or, if possible,
4405 declared in an anonymous namespace. This allows GCC to more aggressively
4406 devirtualize the polymorphic calls. This warning is more effective with link
4407 time optimization, where the information about the class hierarchy graph is
4408 more complete.
4410 @item -Wsuggest-final-methods
4411 @opindex Wno-suggest-final-methods
4412 @opindex Wsuggest-final-methods
4413 Warn about virtual methods where code quality would be improved if the method
4414 were declared with the C++11 @code{final} specifier, 
4415 or, if possible, its type were
4416 declared in an anonymous namespace or with the @code{final} specifier.
4417 This warning is
4418 more effective with link time optimization, where the information about the
4419 class hierarchy graph is more complete. It is recommended to first consider
4420 suggestions of @option{-Wsuggest-final-types} and then rebuild with new
4421 annotations.
4423 @item -Wsuggest-override
4424 Warn about overriding virtual functions that are not marked with the override
4425 keyword.
4427 @item -Warray-bounds
4428 @itemx -Warray-bounds=@var{n}
4429 @opindex Wno-array-bounds
4430 @opindex Warray-bounds
4431 This option is only active when @option{-ftree-vrp} is active
4432 (default for @option{-O2} and above). It warns about subscripts to arrays
4433 that are always out of bounds. This warning is enabled by @option{-Wall}.
4435 @table @gcctabopt
4436 @item -Warray-bounds=1
4437 This is the warning level of @option{-Warray-bounds} and is enabled
4438 by @option{-Wall}; higher levels are not, and must be explicitly requested.
4440 @item -Warray-bounds=2
4441 This warning level also warns about out of bounds access for
4442 arrays at the end of a struct and for arrays accessed through
4443 pointers. This warning level may give a larger number of
4444 false positives and is deactivated by default.
4445 @end table
4447 @item -Wbool-compare
4448 @opindex Wno-bool-compare
4449 @opindex Wbool-compare
4450 Warn about boolean expression compared with an integer value different from
4451 @code{true}/@code{false}.  For instance, the following comparison is
4452 always false:
4453 @smallexample
4454 int n = 5;
4455 @dots{}
4456 if ((n > 1) == 2) @{ @dots{} @}
4457 @end smallexample
4458 This warning is enabled by @option{-Wall}.
4460 @item -Wno-discarded-qualifiers @r{(C and Objective-C only)}
4461 @opindex Wno-discarded-qualifiers
4462 @opindex Wdiscarded-qualifiers
4463 Do not warn if type qualifiers on pointers are being discarded.
4464 Typically, the compiler warns if a @code{const char *} variable is
4465 passed to a function that takes a @code{char *} parameter.  This option
4466 can be used to suppress such a warning.
4468 @item -Wno-discarded-array-qualifiers @r{(C and Objective-C only)}
4469 @opindex Wno-discarded-array-qualifiers
4470 @opindex Wdiscarded-array-qualifiers
4471 Do not warn if type qualifiers on arrays which are pointer targets
4472 are being discarded. Typically, the compiler warns if a
4473 @code{const int (*)[]} variable is passed to a function that
4474 takes a @code{int (*)[]} parameter.  This option can be used to
4475 suppress such a warning.
4477 @item -Wno-incompatible-pointer-types @r{(C and Objective-C only)}
4478 @opindex Wno-incompatible-pointer-types
4479 @opindex Wincompatible-pointer-types
4480 Do not warn when there is a conversion between pointers that have incompatible
4481 types.  This warning is for cases not covered by @option{-Wno-pointer-sign},
4482 which warns for pointer argument passing or assignment with different
4483 signedness.
4485 @item -Wno-int-conversion @r{(C and Objective-C only)}
4486 @opindex Wno-int-conversion
4487 @opindex Wint-conversion
4488 Do not warn about incompatible integer to pointer and pointer to integer
4489 conversions.  This warning is about implicit conversions; for explicit
4490 conversions the warnings @option{-Wno-int-to-pointer-cast} and
4491 @option{-Wno-pointer-to-int-cast} may be used.
4493 @item -Wno-div-by-zero
4494 @opindex Wno-div-by-zero
4495 @opindex Wdiv-by-zero
4496 Do not warn about compile-time integer division by zero.  Floating-point
4497 division by zero is not warned about, as it can be a legitimate way of
4498 obtaining infinities and NaNs.
4500 @item -Wsystem-headers
4501 @opindex Wsystem-headers
4502 @opindex Wno-system-headers
4503 @cindex warnings from system headers
4504 @cindex system headers, warnings from
4505 Print warning messages for constructs found in system header files.
4506 Warnings from system headers are normally suppressed, on the assumption
4507 that they usually do not indicate real problems and would only make the
4508 compiler output harder to read.  Using this command-line option tells
4509 GCC to emit warnings from system headers as if they occurred in user
4510 code.  However, note that using @option{-Wall} in conjunction with this
4511 option does @emph{not} warn about unknown pragmas in system
4512 headers---for that, @option{-Wunknown-pragmas} must also be used.
4514 @item -Wtrampolines
4515 @opindex Wtrampolines
4516 @opindex Wno-trampolines
4517 Warn about trampolines generated for pointers to nested functions.
4518 A trampoline is a small piece of data or code that is created at run
4519 time on the stack when the address of a nested function is taken, and is
4520 used to call the nested function indirectly.  For some targets, it is
4521 made up of data only and thus requires no special treatment.  But, for
4522 most targets, it is made up of code and thus requires the stack to be
4523 made executable in order for the program to work properly.
4525 @item -Wfloat-equal
4526 @opindex Wfloat-equal
4527 @opindex Wno-float-equal
4528 Warn if floating-point values are used in equality comparisons.
4530 The idea behind this is that sometimes it is convenient (for the
4531 programmer) to consider floating-point values as approximations to
4532 infinitely precise real numbers.  If you are doing this, then you need
4533 to compute (by analyzing the code, or in some other way) the maximum or
4534 likely maximum error that the computation introduces, and allow for it
4535 when performing comparisons (and when producing output, but that's a
4536 different problem).  In particular, instead of testing for equality, you
4537 should check to see whether the two values have ranges that overlap; and
4538 this is done with the relational operators, so equality comparisons are
4539 probably mistaken.
4541 @item -Wtraditional @r{(C and Objective-C only)}
4542 @opindex Wtraditional
4543 @opindex Wno-traditional
4544 Warn about certain constructs that behave differently in traditional and
4545 ISO C@.  Also warn about ISO C constructs that have no traditional C
4546 equivalent, and/or problematic constructs that should be avoided.
4548 @itemize @bullet
4549 @item
4550 Macro parameters that appear within string literals in the macro body.
4551 In traditional C macro replacement takes place within string literals,
4552 but in ISO C it does not.
4554 @item
4555 In traditional C, some preprocessor directives did not exist.
4556 Traditional preprocessors only considered a line to be a directive
4557 if the @samp{#} appeared in column 1 on the line.  Therefore
4558 @option{-Wtraditional} warns about directives that traditional C
4559 understands but ignores because the @samp{#} does not appear as the
4560 first character on the line.  It also suggests you hide directives like
4561 @code{#pragma} not understood by traditional C by indenting them.  Some
4562 traditional implementations do not recognize @code{#elif}, so this option
4563 suggests avoiding it altogether.
4565 @item
4566 A function-like macro that appears without arguments.
4568 @item
4569 The unary plus operator.
4571 @item
4572 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
4573 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
4574 constants.)  Note, these suffixes appear in macros defined in the system
4575 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
4576 Use of these macros in user code might normally lead to spurious
4577 warnings, however GCC's integrated preprocessor has enough context to
4578 avoid warning in these cases.
4580 @item
4581 A function declared external in one block and then used after the end of
4582 the block.
4584 @item
4585 A @code{switch} statement has an operand of type @code{long}.
4587 @item
4588 A non-@code{static} function declaration follows a @code{static} one.
4589 This construct is not accepted by some traditional C compilers.
4591 @item
4592 The ISO type of an integer constant has a different width or
4593 signedness from its traditional type.  This warning is only issued if
4594 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
4595 typically represent bit patterns, are not warned about.
4597 @item
4598 Usage of ISO string concatenation is detected.
4600 @item
4601 Initialization of automatic aggregates.
4603 @item
4604 Identifier conflicts with labels.  Traditional C lacks a separate
4605 namespace for labels.
4607 @item
4608 Initialization of unions.  If the initializer is zero, the warning is
4609 omitted.  This is done under the assumption that the zero initializer in
4610 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
4611 initializer warnings and relies on default initialization to zero in the
4612 traditional C case.
4614 @item
4615 Conversions by prototypes between fixed/floating-point values and vice
4616 versa.  The absence of these prototypes when compiling with traditional
4617 C causes serious problems.  This is a subset of the possible
4618 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
4620 @item
4621 Use of ISO C style function definitions.  This warning intentionally is
4622 @emph{not} issued for prototype declarations or variadic functions
4623 because these ISO C features appear in your code when using
4624 libiberty's traditional C compatibility macros, @code{PARAMS} and
4625 @code{VPARAMS}.  This warning is also bypassed for nested functions
4626 because that feature is already a GCC extension and thus not relevant to
4627 traditional C compatibility.
4628 @end itemize
4630 @item -Wtraditional-conversion @r{(C and Objective-C only)}
4631 @opindex Wtraditional-conversion
4632 @opindex Wno-traditional-conversion
4633 Warn if a prototype causes a type conversion that is different from what
4634 would happen to the same argument in the absence of a prototype.  This
4635 includes conversions of fixed point to floating and vice versa, and
4636 conversions changing the width or signedness of a fixed-point argument
4637 except when the same as the default promotion.
4639 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
4640 @opindex Wdeclaration-after-statement
4641 @opindex Wno-declaration-after-statement
4642 Warn when a declaration is found after a statement in a block.  This
4643 construct, known from C++, was introduced with ISO C99 and is by default
4644 allowed in GCC@.  It is not supported by ISO C90.  @xref{Mixed Declarations}.
4646 @item -Wundef
4647 @opindex Wundef
4648 @opindex Wno-undef
4649 Warn if an undefined identifier is evaluated in an @code{#if} directive.
4651 @item -Wno-endif-labels
4652 @opindex Wno-endif-labels
4653 @opindex Wendif-labels
4654 Do not warn whenever an @code{#else} or an @code{#endif} are followed by text.
4656 @item -Wshadow
4657 @opindex Wshadow
4658 @opindex Wno-shadow
4659 Warn whenever a local variable or type declaration shadows another
4660 variable, parameter, type, class member (in C++), or instance variable
4661 (in Objective-C) or whenever a built-in function is shadowed. Note
4662 that in C++, the compiler warns if a local variable shadows an
4663 explicit typedef, but not if it shadows a struct/class/enum.
4665 @item -Wno-shadow-ivar @r{(Objective-C only)}
4666 @opindex Wno-shadow-ivar
4667 @opindex Wshadow-ivar
4668 Do not warn whenever a local variable shadows an instance variable in an
4669 Objective-C method.
4671 @item -Wlarger-than=@var{len}
4672 @opindex Wlarger-than=@var{len}
4673 @opindex Wlarger-than-@var{len}
4674 Warn whenever an object of larger than @var{len} bytes is defined.
4676 @item -Wframe-larger-than=@var{len}
4677 @opindex Wframe-larger-than
4678 Warn if the size of a function frame is larger than @var{len} bytes.
4679 The computation done to determine the stack frame size is approximate
4680 and not conservative.
4681 The actual requirements may be somewhat greater than @var{len}
4682 even if you do not get a warning.  In addition, any space allocated
4683 via @code{alloca}, variable-length arrays, or related constructs
4684 is not included by the compiler when determining
4685 whether or not to issue a warning.
4687 @item -Wno-free-nonheap-object
4688 @opindex Wno-free-nonheap-object
4689 @opindex Wfree-nonheap-object
4690 Do not warn when attempting to free an object that was not allocated
4691 on the heap.
4693 @item -Wstack-usage=@var{len}
4694 @opindex Wstack-usage
4695 Warn if the stack usage of a function might be larger than @var{len} bytes.
4696 The computation done to determine the stack usage is conservative.
4697 Any space allocated via @code{alloca}, variable-length arrays, or related
4698 constructs is included by the compiler when determining whether or not to
4699 issue a warning.
4701 The message is in keeping with the output of @option{-fstack-usage}.
4703 @itemize
4704 @item
4705 If the stack usage is fully static but exceeds the specified amount, it's:
4707 @smallexample
4708   warning: stack usage is 1120 bytes
4709 @end smallexample
4710 @item
4711 If the stack usage is (partly) dynamic but bounded, it's:
4713 @smallexample
4714   warning: stack usage might be 1648 bytes
4715 @end smallexample
4716 @item
4717 If the stack usage is (partly) dynamic and not bounded, it's:
4719 @smallexample
4720   warning: stack usage might be unbounded
4721 @end smallexample
4722 @end itemize
4724 @item -Wunsafe-loop-optimizations
4725 @opindex Wunsafe-loop-optimizations
4726 @opindex Wno-unsafe-loop-optimizations
4727 Warn if the loop cannot be optimized because the compiler cannot
4728 assume anything on the bounds of the loop indices.  With
4729 @option{-funsafe-loop-optimizations} warn if the compiler makes
4730 such assumptions.
4732 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
4733 @opindex Wno-pedantic-ms-format
4734 @opindex Wpedantic-ms-format
4735 When used in combination with @option{-Wformat}
4736 and @option{-pedantic} without GNU extensions, this option
4737 disables the warnings about non-ISO @code{printf} / @code{scanf} format
4738 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
4739 which depend on the MS runtime.
4741 @item -Wpointer-arith
4742 @opindex Wpointer-arith
4743 @opindex Wno-pointer-arith
4744 Warn about anything that depends on the ``size of'' a function type or
4745 of @code{void}.  GNU C assigns these types a size of 1, for
4746 convenience in calculations with @code{void *} pointers and pointers
4747 to functions.  In C++, warn also when an arithmetic operation involves
4748 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
4750 @item -Wtype-limits
4751 @opindex Wtype-limits
4752 @opindex Wno-type-limits
4753 Warn if a comparison is always true or always false due to the limited
4754 range of the data type, but do not warn for constant expressions.  For
4755 example, warn if an unsigned variable is compared against zero with
4756 @code{<} or @code{>=}.  This warning is also enabled by
4757 @option{-Wextra}.
4759 @item -Wbad-function-cast @r{(C and Objective-C only)}
4760 @opindex Wbad-function-cast
4761 @opindex Wno-bad-function-cast
4762 Warn when a function call is cast to a non-matching type.
4763 For example, warn if a call to a function returning an integer type 
4764 is cast to a pointer type.
4766 @item -Wc90-c99-compat @r{(C and Objective-C only)}
4767 @opindex Wc90-c99-compat
4768 @opindex Wno-c90-c99-compat
4769 Warn about features not present in ISO C90, but present in ISO C99.
4770 For instance, warn about use of variable length arrays, @code{long long}
4771 type, @code{bool} type, compound literals, designated initializers, and so
4772 on.  This option is independent of the standards mode.  Warnings are disabled
4773 in the expression that follows @code{__extension__}.
4775 @item -Wc99-c11-compat @r{(C and Objective-C only)}
4776 @opindex Wc99-c11-compat
4777 @opindex Wno-c99-c11-compat
4778 Warn about features not present in ISO C99, but present in ISO C11.
4779 For instance, warn about use of anonymous structures and unions,
4780 @code{_Atomic} type qualifier, @code{_Thread_local} storage-class specifier,
4781 @code{_Alignas} specifier, @code{Alignof} operator, @code{_Generic} keyword,
4782 and so on.  This option is independent of the standards mode.  Warnings are
4783 disabled in the expression that follows @code{__extension__}.
4785 @item -Wc++-compat @r{(C and Objective-C only)}
4786 @opindex Wc++-compat
4787 Warn about ISO C constructs that are outside of the common subset of
4788 ISO C and ISO C++, e.g.@: request for implicit conversion from
4789 @code{void *} to a pointer to non-@code{void} type.
4791 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
4792 @opindex Wc++11-compat
4793 Warn about C++ constructs whose meaning differs between ISO C++ 1998
4794 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
4795 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
4796 enabled by @option{-Wall}.
4798 @item -Wc++14-compat @r{(C++ and Objective-C++ only)}
4799 @opindex Wc++14-compat
4800 Warn about C++ constructs whose meaning differs between ISO C++ 2011
4801 and ISO C++ 2014.  This warning is enabled by @option{-Wall}.
4803 @item -Wcast-qual
4804 @opindex Wcast-qual
4805 @opindex Wno-cast-qual
4806 Warn whenever a pointer is cast so as to remove a type qualifier from
4807 the target type.  For example, warn if a @code{const char *} is cast
4808 to an ordinary @code{char *}.
4810 Also warn when making a cast that introduces a type qualifier in an
4811 unsafe way.  For example, casting @code{char **} to @code{const char **}
4812 is unsafe, as in this example:
4814 @smallexample
4815   /* p is char ** value.  */
4816   const char **q = (const char **) p;
4817   /* Assignment of readonly string to const char * is OK.  */
4818   *q = "string";
4819   /* Now char** pointer points to read-only memory.  */
4820   **p = 'b';
4821 @end smallexample
4823 @item -Wcast-align
4824 @opindex Wcast-align
4825 @opindex Wno-cast-align
4826 Warn whenever a pointer is cast such that the required alignment of the
4827 target is increased.  For example, warn if a @code{char *} is cast to
4828 an @code{int *} on machines where integers can only be accessed at
4829 two- or four-byte boundaries.
4831 @item -Wwrite-strings
4832 @opindex Wwrite-strings
4833 @opindex Wno-write-strings
4834 When compiling C, give string constants the type @code{const
4835 char[@var{length}]} so that copying the address of one into a
4836 non-@code{const} @code{char *} pointer produces a warning.  These
4837 warnings help you find at compile time code that can try to write
4838 into a string constant, but only if you have been very careful about
4839 using @code{const} in declarations and prototypes.  Otherwise, it is
4840 just a nuisance. This is why we did not make @option{-Wall} request
4841 these warnings.
4843 When compiling C++, warn about the deprecated conversion from string
4844 literals to @code{char *}.  This warning is enabled by default for C++
4845 programs.
4847 @item -Wclobbered
4848 @opindex Wclobbered
4849 @opindex Wno-clobbered
4850 Warn for variables that might be changed by @code{longjmp} or
4851 @code{vfork}.  This warning is also enabled by @option{-Wextra}.
4853 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
4854 @opindex Wconditionally-supported
4855 @opindex Wno-conditionally-supported
4856 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
4858 @item -Wconversion
4859 @opindex Wconversion
4860 @opindex Wno-conversion
4861 Warn for implicit conversions that may alter a value. This includes
4862 conversions between real and integer, like @code{abs (x)} when
4863 @code{x} is @code{double}; conversions between signed and unsigned,
4864 like @code{unsigned ui = -1}; and conversions to smaller types, like
4865 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4866 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4867 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4868 conversions between signed and unsigned integers can be disabled by
4869 using @option{-Wno-sign-conversion}.
4871 For C++, also warn for confusing overload resolution for user-defined
4872 conversions; and conversions that never use a type conversion
4873 operator: conversions to @code{void}, the same type, a base class or a
4874 reference to them. Warnings about conversions between signed and
4875 unsigned integers are disabled by default in C++ unless
4876 @option{-Wsign-conversion} is explicitly enabled.
4878 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4879 @opindex Wconversion-null
4880 @opindex Wno-conversion-null
4881 Do not warn for conversions between @code{NULL} and non-pointer
4882 types. @option{-Wconversion-null} is enabled by default.
4884 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
4885 @opindex Wzero-as-null-pointer-constant
4886 @opindex Wno-zero-as-null-pointer-constant
4887 Warn when a literal '0' is used as null pointer constant.  This can
4888 be useful to facilitate the conversion to @code{nullptr} in C++11.
4890 @item -Wdate-time
4891 @opindex Wdate-time
4892 @opindex Wno-date-time
4893 Warn when macros @code{__TIME__}, @code{__DATE__} or @code{__TIMESTAMP__}
4894 are encountered as they might prevent bit-wise-identical reproducible
4895 compilations.
4897 @item -Wdelete-incomplete @r{(C++ and Objective-C++ only)}
4898 @opindex Wdelete-incomplete
4899 @opindex Wno-delete-incomplete
4900 Warn when deleting a pointer to incomplete type, which may cause
4901 undefined behavior at runtime.  This warning is enabled by default.
4903 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
4904 @opindex Wuseless-cast
4905 @opindex Wno-useless-cast
4906 Warn when an expression is casted to its own type.
4908 @item -Wempty-body
4909 @opindex Wempty-body
4910 @opindex Wno-empty-body
4911 Warn if an empty body occurs in an @code{if}, @code{else} or @code{do
4912 while} statement.  This warning is also enabled by @option{-Wextra}.
4914 @item -Wenum-compare
4915 @opindex Wenum-compare
4916 @opindex Wno-enum-compare
4917 Warn about a comparison between values of different enumerated types.
4918 In C++ enumeral mismatches in conditional expressions are also
4919 diagnosed and the warning is enabled by default.  In C this warning is 
4920 enabled by @option{-Wall}.
4922 @item -Wjump-misses-init @r{(C, Objective-C only)}
4923 @opindex Wjump-misses-init
4924 @opindex Wno-jump-misses-init
4925 Warn if a @code{goto} statement or a @code{switch} statement jumps
4926 forward across the initialization of a variable, or jumps backward to a
4927 label after the variable has been initialized.  This only warns about
4928 variables that are initialized when they are declared.  This warning is
4929 only supported for C and Objective-C; in C++ this sort of branch is an
4930 error in any case.
4932 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4933 can be disabled with the @option{-Wno-jump-misses-init} option.
4935 @item -Wsign-compare
4936 @opindex Wsign-compare
4937 @opindex Wno-sign-compare
4938 @cindex warning for comparison of signed and unsigned values
4939 @cindex comparison of signed and unsigned values, warning
4940 @cindex signed and unsigned values, comparison warning
4941 Warn when a comparison between signed and unsigned values could produce
4942 an incorrect result when the signed value is converted to unsigned.
4943 This warning is also enabled by @option{-Wextra}; to get the other warnings
4944 of @option{-Wextra} without this warning, use @option{-Wextra -Wno-sign-compare}.
4946 @item -Wsign-conversion
4947 @opindex Wsign-conversion
4948 @opindex Wno-sign-conversion
4949 Warn for implicit conversions that may change the sign of an integer
4950 value, like assigning a signed integer expression to an unsigned
4951 integer variable. An explicit cast silences the warning. In C, this
4952 option is enabled also by @option{-Wconversion}.
4954 @item -Wfloat-conversion
4955 @opindex Wfloat-conversion
4956 @opindex Wno-float-conversion
4957 Warn for implicit conversions that reduce the precision of a real value.
4958 This includes conversions from real to integer, and from higher precision
4959 real to lower precision real values.  This option is also enabled by
4960 @option{-Wconversion}.
4962 @item -Wsized-deallocation @r{(C++ and Objective-C++ only)}
4963 @opindex Wsized-deallocation
4964 @opindex Wno-sized-deallocation
4965 Warn about a definition of an unsized deallocation function
4966 @smallexample
4967 void operator delete (void *) noexcept;
4968 void operator delete[] (void *) noexcept;
4969 @end smallexample
4970 without a definition of the corresponding sized deallocation function
4971 @smallexample
4972 void operator delete (void *, std::size_t) noexcept;
4973 void operator delete[] (void *, std::size_t) noexcept;
4974 @end smallexample
4975 or vice versa.  Enabled by @option{-Wextra} along with
4976 @option{-fsized-deallocation}.
4978 @item -Wsizeof-pointer-memaccess
4979 @opindex Wsizeof-pointer-memaccess
4980 @opindex Wno-sizeof-pointer-memaccess
4981 Warn for suspicious length parameters to certain string and memory built-in
4982 functions if the argument uses @code{sizeof}.  This warning warns e.g.@:
4983 about @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not an array,
4984 but a pointer, and suggests a possible fix, or about
4985 @code{memcpy (&foo, ptr, sizeof (&foo));}.  This warning is enabled by
4986 @option{-Wall}.
4988 @item -Wsizeof-array-argument
4989 @opindex Wsizeof-array-argument
4990 @opindex Wno-sizeof-array-argument
4991 Warn when the @code{sizeof} operator is applied to a parameter that is
4992 declared as an array in a function definition.  This warning is enabled by
4993 default for C and C++ programs.
4995 @item -Wmemset-transposed-args
4996 @opindex Wmemset-transposed-args
4997 @opindex Wno-memset-transposed-args
4998 Warn for suspicious calls to the @code{memset} built-in function, if the
4999 second argument is not zero and the third argument is zero.  This warns e.g.@
5000 about @code{memset (buf, sizeof buf, 0)} where most probably
5001 @code{memset (buf, 0, sizeof buf)} was meant instead.  The diagnostics
5002 is only emitted if the third argument is literal zero.  If it is some
5003 expression that is folded to zero, a cast of zero to some type, etc., 
5004 it is far less likely that the user has mistakenly exchanged the arguments 
5005 and no warning is emitted.  This warning is enabled by @option{-Wall}.
5007 @item -Waddress
5008 @opindex Waddress
5009 @opindex Wno-address
5010 Warn about suspicious uses of memory addresses. These include using
5011 the address of a function in a conditional expression, such as
5012 @code{void func(void); if (func)}, and comparisons against the memory
5013 address of a string literal, such as @code{if (x == "abc")}.  Such
5014 uses typically indicate a programmer error: the address of a function
5015 always evaluates to true, so their use in a conditional usually
5016 indicate that the programmer forgot the parentheses in a function
5017 call; and comparisons against string literals result in unspecified
5018 behavior and are not portable in C, so they usually indicate that the
5019 programmer intended to use @code{strcmp}.  This warning is enabled by
5020 @option{-Wall}.
5022 @item -Wlogical-op
5023 @opindex Wlogical-op
5024 @opindex Wno-logical-op
5025 Warn about suspicious uses of logical operators in expressions.
5026 This includes using logical operators in contexts where a
5027 bit-wise operator is likely to be expected.  Also warns when
5028 the operands of a logical operator are the same:
5029 @smallexample
5030 extern int a;
5031 if (a < 0 && a < 0) @{ @dots{} @}
5032 @end smallexample
5034 @item -Wlogical-not-parentheses
5035 @opindex Wlogical-not-parentheses
5036 @opindex Wno-logical-not-parentheses
5037 Warn about logical not used on the left hand side operand of a comparison.
5038 This option does not warn if the RHS operand is of a boolean type.  Its
5039 purpose is to detect suspicious code like the following:
5040 @smallexample
5041 int a;
5042 @dots{}
5043 if (!a > 1) @{ @dots{} @}
5044 @end smallexample
5046 It is possible to suppress the warning by wrapping the LHS into
5047 parentheses:
5048 @smallexample
5049 if ((!a) > 1) @{ @dots{} @}
5050 @end smallexample
5052 This warning is enabled by @option{-Wall}.
5054 @item -Waggregate-return
5055 @opindex Waggregate-return
5056 @opindex Wno-aggregate-return
5057 Warn if any functions that return structures or unions are defined or
5058 called.  (In languages where you can return an array, this also elicits
5059 a warning.)
5061 @item -Wno-aggressive-loop-optimizations
5062 @opindex Wno-aggressive-loop-optimizations
5063 @opindex Waggressive-loop-optimizations
5064 Warn if in a loop with constant number of iterations the compiler detects
5065 undefined behavior in some statement during one or more of the iterations.
5067 @item -Wno-attributes
5068 @opindex Wno-attributes
5069 @opindex Wattributes
5070 Do not warn if an unexpected @code{__attribute__} is used, such as
5071 unrecognized attributes, function attributes applied to variables,
5072 etc.  This does not stop errors for incorrect use of supported
5073 attributes.
5075 @item -Wno-builtin-macro-redefined
5076 @opindex Wno-builtin-macro-redefined
5077 @opindex Wbuiltin-macro-redefined
5078 Do not warn if certain built-in macros are redefined.  This suppresses
5079 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
5080 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
5082 @item -Wstrict-prototypes @r{(C and Objective-C only)}
5083 @opindex Wstrict-prototypes
5084 @opindex Wno-strict-prototypes
5085 Warn if a function is declared or defined without specifying the
5086 argument types.  (An old-style function definition is permitted without
5087 a warning if preceded by a declaration that specifies the argument
5088 types.)
5090 @item -Wold-style-declaration @r{(C and Objective-C only)}
5091 @opindex Wold-style-declaration
5092 @opindex Wno-old-style-declaration
5093 Warn for obsolescent usages, according to the C Standard, in a
5094 declaration. For example, warn if storage-class specifiers like
5095 @code{static} are not the first things in a declaration.  This warning
5096 is also enabled by @option{-Wextra}.
5098 @item -Wold-style-definition @r{(C and Objective-C only)}
5099 @opindex Wold-style-definition
5100 @opindex Wno-old-style-definition
5101 Warn if an old-style function definition is used.  A warning is given
5102 even if there is a previous prototype.
5104 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
5105 @opindex Wmissing-parameter-type
5106 @opindex Wno-missing-parameter-type
5107 A function parameter is declared without a type specifier in K&R-style
5108 functions:
5110 @smallexample
5111 void foo(bar) @{ @}
5112 @end smallexample
5114 This warning is also enabled by @option{-Wextra}.
5116 @item -Wmissing-prototypes @r{(C and Objective-C only)}
5117 @opindex Wmissing-prototypes
5118 @opindex Wno-missing-prototypes
5119 Warn if a global function is defined without a previous prototype
5120 declaration.  This warning is issued even if the definition itself
5121 provides a prototype.  Use this option to detect global functions
5122 that do not have a matching prototype declaration in a header file.
5123 This option is not valid for C++ because all function declarations
5124 provide prototypes and a non-matching declaration declares an
5125 overload rather than conflict with an earlier declaration.
5126 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
5128 @item -Wmissing-declarations
5129 @opindex Wmissing-declarations
5130 @opindex Wno-missing-declarations
5131 Warn if a global function is defined without a previous declaration.
5132 Do so even if the definition itself provides a prototype.
5133 Use this option to detect global functions that are not declared in
5134 header files.  In C, no warnings are issued for functions with previous
5135 non-prototype declarations; use @option{-Wmissing-prototypes} to detect
5136 missing prototypes.  In C++, no warnings are issued for function templates,
5137 or for inline functions, or for functions in anonymous namespaces.
5139 @item -Wmissing-field-initializers
5140 @opindex Wmissing-field-initializers
5141 @opindex Wno-missing-field-initializers
5142 @opindex W
5143 @opindex Wextra
5144 @opindex Wno-extra
5145 Warn if a structure's initializer has some fields missing.  For
5146 example, the following code causes such a warning, because
5147 @code{x.h} is implicitly zero:
5149 @smallexample
5150 struct s @{ int f, g, h; @};
5151 struct s x = @{ 3, 4 @};
5152 @end smallexample
5154 This option does not warn about designated initializers, so the following
5155 modification does not trigger a warning:
5157 @smallexample
5158 struct s @{ int f, g, h; @};
5159 struct s x = @{ .f = 3, .g = 4 @};
5160 @end smallexample
5162 In C++ this option does not warn either about the empty @{ @}
5163 initializer, for example:
5165 @smallexample
5166 struct s @{ int f, g, h; @};
5167 s x = @{ @};
5168 @end smallexample
5170 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
5171 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
5173 @item -Wno-multichar
5174 @opindex Wno-multichar
5175 @opindex Wmultichar
5176 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
5177 Usually they indicate a typo in the user's code, as they have
5178 implementation-defined values, and should not be used in portable code.
5180 @item -Wnormalized@r{[}=@r{<}none@r{|}id@r{|}nfc@r{|}nfkc@r{>]}
5181 @opindex Wnormalized=
5182 @opindex Wnormalized
5183 @opindex Wno-normalized
5184 @cindex NFC
5185 @cindex NFKC
5186 @cindex character set, input normalization
5187 In ISO C and ISO C++, two identifiers are different if they are
5188 different sequences of characters.  However, sometimes when characters
5189 outside the basic ASCII character set are used, you can have two
5190 different character sequences that look the same.  To avoid confusion,
5191 the ISO 10646 standard sets out some @dfn{normalization rules} which
5192 when applied ensure that two sequences that look the same are turned into
5193 the same sequence.  GCC can warn you if you are using identifiers that
5194 have not been normalized; this option controls that warning.
5196 There are four levels of warning supported by GCC@.  The default is
5197 @option{-Wnormalized=nfc}, which warns about any identifier that is
5198 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
5199 recommended form for most uses.  It is equivalent to
5200 @option{-Wnormalized}.
5202 Unfortunately, there are some characters allowed in identifiers by
5203 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
5204 identifiers.  That is, there's no way to use these symbols in portable
5205 ISO C or C++ and have all your identifiers in NFC@.
5206 @option{-Wnormalized=id} suppresses the warning for these characters.
5207 It is hoped that future versions of the standards involved will correct
5208 this, which is why this option is not the default.
5210 You can switch the warning off for all characters by writing
5211 @option{-Wnormalized=none} or @option{-Wno-normalized}.  You should
5212 only do this if you are using some other normalization scheme (like
5213 ``D''), because otherwise you can easily create bugs that are
5214 literally impossible to see.
5216 Some characters in ISO 10646 have distinct meanings but look identical
5217 in some fonts or display methodologies, especially once formatting has
5218 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
5219 LETTER N'', displays just like a regular @code{n} that has been
5220 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
5221 normalization scheme to convert all these into a standard form as
5222 well, and GCC warns if your code is not in NFKC if you use
5223 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
5224 about every identifier that contains the letter O because it might be
5225 confused with the digit 0, and so is not the default, but may be
5226 useful as a local coding convention if the programming environment 
5227 cannot be fixed to display these characters distinctly.
5229 @item -Wno-deprecated
5230 @opindex Wno-deprecated
5231 @opindex Wdeprecated
5232 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
5234 @item -Wno-deprecated-declarations
5235 @opindex Wno-deprecated-declarations
5236 @opindex Wdeprecated-declarations
5237 Do not warn about uses of functions (@pxref{Function Attributes}),
5238 variables (@pxref{Variable Attributes}), and types (@pxref{Type
5239 Attributes}) marked as deprecated by using the @code{deprecated}
5240 attribute.
5242 @item -Wno-overflow
5243 @opindex Wno-overflow
5244 @opindex Woverflow
5245 Do not warn about compile-time overflow in constant expressions.
5247 @item -Wno-odr
5248 @opindex Wno-odr
5249 @opindex Wodr
5250 Warn about One Definition Rule violations during link-time optimization.
5251 Requires @option{-flto-odr-type-merging} to be enabled.  Enabled by default.
5253 @item -Wopenmp-simd
5254 @opindex Wopenm-simd
5255 Warn if the vectorizer cost model overrides the OpenMP or the Cilk Plus
5256 simd directive set by user.  The @option{-fsimd-cost-model=unlimited}
5257 option can be used to relax the cost model.
5259 @item -Woverride-init @r{(C and Objective-C only)}
5260 @opindex Woverride-init
5261 @opindex Wno-override-init
5262 @opindex W
5263 @opindex Wextra
5264 @opindex Wno-extra
5265 Warn if an initialized field without side effects is overridden when
5266 using designated initializers (@pxref{Designated Inits, , Designated
5267 Initializers}).
5269 This warning is included in @option{-Wextra}.  To get other
5270 @option{-Wextra} warnings without this one, use @option{-Wextra
5271 -Wno-override-init}.
5273 @item -Woverride-init-side-effects @r{(C and Objective-C only)}
5274 @opindex Woverride-init-side-effects
5275 @opindex Wno-override-init-side-effects
5276 Warn if an initialized field with side effects is overridden when
5277 using designated initializers (@pxref{Designated Inits, , Designated
5278 Initializers}).  This warning is enabled by default.
5280 @item -Wpacked
5281 @opindex Wpacked
5282 @opindex Wno-packed
5283 Warn if a structure is given the packed attribute, but the packed
5284 attribute has no effect on the layout or size of the structure.
5285 Such structures may be mis-aligned for little benefit.  For
5286 instance, in this code, the variable @code{f.x} in @code{struct bar}
5287 is misaligned even though @code{struct bar} does not itself
5288 have the packed attribute:
5290 @smallexample
5291 @group
5292 struct foo @{
5293   int x;
5294   char a, b, c, d;
5295 @} __attribute__((packed));
5296 struct bar @{
5297   char z;
5298   struct foo f;
5300 @end group
5301 @end smallexample
5303 @item -Wpacked-bitfield-compat
5304 @opindex Wpacked-bitfield-compat
5305 @opindex Wno-packed-bitfield-compat
5306 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
5307 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
5308 the change can lead to differences in the structure layout.  GCC
5309 informs you when the offset of such a field has changed in GCC 4.4.
5310 For example there is no longer a 4-bit padding between field @code{a}
5311 and @code{b} in this structure:
5313 @smallexample
5314 struct foo
5316   char a:4;
5317   char b:8;
5318 @} __attribute__ ((packed));
5319 @end smallexample
5321 This warning is enabled by default.  Use
5322 @option{-Wno-packed-bitfield-compat} to disable this warning.
5324 @item -Wpadded
5325 @opindex Wpadded
5326 @opindex Wno-padded
5327 Warn if padding is included in a structure, either to align an element
5328 of the structure or to align the whole structure.  Sometimes when this
5329 happens it is possible to rearrange the fields of the structure to
5330 reduce the padding and so make the structure smaller.
5332 @item -Wredundant-decls
5333 @opindex Wredundant-decls
5334 @opindex Wno-redundant-decls
5335 Warn if anything is declared more than once in the same scope, even in
5336 cases where multiple declaration is valid and changes nothing.
5338 @item -Wnested-externs @r{(C and Objective-C only)}
5339 @opindex Wnested-externs
5340 @opindex Wno-nested-externs
5341 Warn if an @code{extern} declaration is encountered within a function.
5343 @item -Wno-inherited-variadic-ctor
5344 @opindex Winherited-variadic-ctor
5345 @opindex Wno-inherited-variadic-ctor
5346 Suppress warnings about use of C++11 inheriting constructors when the
5347 base class inherited from has a C variadic constructor; the warning is
5348 on by default because the ellipsis is not inherited.
5350 @item -Winline
5351 @opindex Winline
5352 @opindex Wno-inline
5353 Warn if a function that is declared as inline cannot be inlined.
5354 Even with this option, the compiler does not warn about failures to
5355 inline functions declared in system headers.
5357 The compiler uses a variety of heuristics to determine whether or not
5358 to inline a function.  For example, the compiler takes into account
5359 the size of the function being inlined and the amount of inlining
5360 that has already been done in the current function.  Therefore,
5361 seemingly insignificant changes in the source program can cause the
5362 warnings produced by @option{-Winline} to appear or disappear.
5364 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
5365 @opindex Wno-invalid-offsetof
5366 @opindex Winvalid-offsetof
5367 Suppress warnings from applying the @code{offsetof} macro to a non-POD
5368 type.  According to the 2014 ISO C++ standard, applying @code{offsetof}
5369 to a non-standard-layout type is undefined.  In existing C++ implementations,
5370 however, @code{offsetof} typically gives meaningful results.
5371 This flag is for users who are aware that they are
5372 writing nonportable code and who have deliberately chosen to ignore the
5373 warning about it.
5375 The restrictions on @code{offsetof} may be relaxed in a future version
5376 of the C++ standard.
5378 @item -Wno-int-to-pointer-cast
5379 @opindex Wno-int-to-pointer-cast
5380 @opindex Wint-to-pointer-cast
5381 Suppress warnings from casts to pointer type of an integer of a
5382 different size. In C++, casting to a pointer type of smaller size is
5383 an error. @option{Wint-to-pointer-cast} is enabled by default.
5386 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
5387 @opindex Wno-pointer-to-int-cast
5388 @opindex Wpointer-to-int-cast
5389 Suppress warnings from casts from a pointer to an integer type of a
5390 different size.
5392 @item -Winvalid-pch
5393 @opindex Winvalid-pch
5394 @opindex Wno-invalid-pch
5395 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
5396 the search path but can't be used.
5398 @item -Wlong-long
5399 @opindex Wlong-long
5400 @opindex Wno-long-long
5401 Warn if @code{long long} type is used.  This is enabled by either
5402 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
5403 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
5405 @item -Wvariadic-macros
5406 @opindex Wvariadic-macros
5407 @opindex Wno-variadic-macros
5408 Warn if variadic macros are used in ISO C90 mode, or if the GNU
5409 alternate syntax is used in ISO C99 mode.  This is enabled by either
5410 @option{-Wpedantic} or @option{-Wtraditional}.  To inhibit the warning
5411 messages, use @option{-Wno-variadic-macros}.
5413 @item -Wvarargs
5414 @opindex Wvarargs
5415 @opindex Wno-varargs
5416 Warn upon questionable usage of the macros used to handle variable
5417 arguments like @code{va_start}.  This is default.  To inhibit the
5418 warning messages, use @option{-Wno-varargs}.
5420 @item -Wvector-operation-performance
5421 @opindex Wvector-operation-performance
5422 @opindex Wno-vector-operation-performance
5423 Warn if vector operation is not implemented via SIMD capabilities of the
5424 architecture.  Mainly useful for the performance tuning.
5425 Vector operation can be implemented @code{piecewise}, which means that the
5426 scalar operation is performed on every vector element; 
5427 @code{in parallel}, which means that the vector operation is implemented
5428 using scalars of wider type, which normally is more performance efficient;
5429 and @code{as a single scalar}, which means that vector fits into a
5430 scalar type.
5432 @item -Wno-virtual-move-assign
5433 @opindex Wvirtual-move-assign
5434 @opindex Wno-virtual-move-assign
5435 Suppress warnings about inheriting from a virtual base with a
5436 non-trivial C++11 move assignment operator.  This is dangerous because
5437 if the virtual base is reachable along more than one path, it is
5438 moved multiple times, which can mean both objects end up in the
5439 moved-from state.  If the move assignment operator is written to avoid
5440 moving from a moved-from object, this warning can be disabled.
5442 @item -Wvla
5443 @opindex Wvla
5444 @opindex Wno-vla
5445 Warn if variable length array is used in the code.
5446 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
5447 the variable length array.
5449 @item -Wvolatile-register-var
5450 @opindex Wvolatile-register-var
5451 @opindex Wno-volatile-register-var
5452 Warn if a register variable is declared volatile.  The volatile
5453 modifier does not inhibit all optimizations that may eliminate reads
5454 and/or writes to register variables.  This warning is enabled by
5455 @option{-Wall}.
5457 @item -Wdisabled-optimization
5458 @opindex Wdisabled-optimization
5459 @opindex Wno-disabled-optimization
5460 Warn if a requested optimization pass is disabled.  This warning does
5461 not generally indicate that there is anything wrong with your code; it
5462 merely indicates that GCC's optimizers are unable to handle the code
5463 effectively.  Often, the problem is that your code is too big or too
5464 complex; GCC refuses to optimize programs when the optimization
5465 itself is likely to take inordinate amounts of time.
5467 @item -Wpointer-sign @r{(C and Objective-C only)}
5468 @opindex Wpointer-sign
5469 @opindex Wno-pointer-sign
5470 Warn for pointer argument passing or assignment with different signedness.
5471 This option is only supported for C and Objective-C@.  It is implied by
5472 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
5473 @option{-Wno-pointer-sign}.
5475 @item -Wstack-protector
5476 @opindex Wstack-protector
5477 @opindex Wno-stack-protector
5478 This option is only active when @option{-fstack-protector} is active.  It
5479 warns about functions that are not protected against stack smashing.
5481 @item -Woverlength-strings
5482 @opindex Woverlength-strings
5483 @opindex Wno-overlength-strings
5484 Warn about string constants that are longer than the ``minimum
5485 maximum'' length specified in the C standard.  Modern compilers
5486 generally allow string constants that are much longer than the
5487 standard's minimum limit, but very portable programs should avoid
5488 using longer strings.
5490 The limit applies @emph{after} string constant concatenation, and does
5491 not count the trailing NUL@.  In C90, the limit was 509 characters; in
5492 C99, it was raised to 4095.  C++98 does not specify a normative
5493 minimum maximum, so we do not diagnose overlength strings in C++@.
5495 This option is implied by @option{-Wpedantic}, and can be disabled with
5496 @option{-Wno-overlength-strings}.
5498 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
5499 @opindex Wunsuffixed-float-constants
5501 Issue a warning for any floating constant that does not have
5502 a suffix.  When used together with @option{-Wsystem-headers} it
5503 warns about such constants in system header files.  This can be useful
5504 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
5505 from the decimal floating-point extension to C99.
5507 @item -Wno-designated-init @r{(C and Objective-C only)}
5508 Suppress warnings when a positional initializer is used to initialize
5509 a structure that has been marked with the @code{designated_init}
5510 attribute.
5512 @end table
5514 @node Debugging Options
5515 @section Options for Debugging Your Program or GCC
5516 @cindex options, debugging
5517 @cindex debugging information options
5519 GCC has various special options that are used for debugging
5520 either your program or GCC:
5522 @table @gcctabopt
5523 @item -g
5524 @opindex g
5525 Produce debugging information in the operating system's native format
5526 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
5527 information.
5529 On most systems that use stabs format, @option{-g} enables use of extra
5530 debugging information that only GDB can use; this extra information
5531 makes debugging work better in GDB but probably makes other debuggers
5532 crash or
5533 refuse to read the program.  If you want to control for certain whether
5534 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
5535 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
5537 GCC allows you to use @option{-g} with
5538 @option{-O}.  The shortcuts taken by optimized code may occasionally
5539 produce surprising results: some variables you declared may not exist
5540 at all; flow of control may briefly move where you did not expect it;
5541 some statements may not be executed because they compute constant
5542 results or their values are already at hand; some statements may
5543 execute in different places because they have been moved out of loops.
5545 Nevertheless it proves possible to debug optimized output.  This makes
5546 it reasonable to use the optimizer for programs that might have bugs.
5548 The following options are useful when GCC is generated with the
5549 capability for more than one debugging format.
5551 @item -gsplit-dwarf
5552 @opindex gsplit-dwarf
5553 Separate as much dwarf debugging information as possible into a
5554 separate output file with the extension .dwo.  This option allows
5555 the build system to avoid linking files with debug information.  To
5556 be useful, this option requires a debugger capable of reading .dwo
5557 files.
5559 @item -ggdb
5560 @opindex ggdb
5561 Produce debugging information for use by GDB@.  This means to use the
5562 most expressive format available (DWARF 2, stabs, or the native format
5563 if neither of those are supported), including GDB extensions if at all
5564 possible.
5566 @item -gpubnames
5567 @opindex gpubnames
5568 Generate dwarf .debug_pubnames and .debug_pubtypes sections.
5570 @item -ggnu-pubnames
5571 @opindex ggnu-pubnames
5572 Generate .debug_pubnames and .debug_pubtypes sections in a format
5573 suitable for conversion into a GDB@ index.  This option is only useful
5574 with a linker that can produce GDB@ index version 7.
5576 @item -gstabs
5577 @opindex gstabs
5578 Produce debugging information in stabs format (if that is supported),
5579 without GDB extensions.  This is the format used by DBX on most BSD
5580 systems.  On MIPS, Alpha and System V Release 4 systems this option
5581 produces stabs debugging output that is not understood by DBX or SDB@.
5582 On System V Release 4 systems this option requires the GNU assembler.
5584 @item -feliminate-unused-debug-symbols
5585 @opindex feliminate-unused-debug-symbols
5586 Produce debugging information in stabs format (if that is supported),
5587 for only symbols that are actually used.
5589 @item -femit-class-debug-always
5590 @opindex femit-class-debug-always
5591 Instead of emitting debugging information for a C++ class in only one
5592 object file, emit it in all object files using the class.  This option
5593 should be used only with debuggers that are unable to handle the way GCC
5594 normally emits debugging information for classes because using this
5595 option increases the size of debugging information by as much as a
5596 factor of two.
5598 @item -fdebug-types-section
5599 @opindex fdebug-types-section
5600 @opindex fno-debug-types-section
5601 When using DWARF Version 4 or higher, type DIEs can be put into
5602 their own @code{.debug_types} section instead of making them part of the
5603 @code{.debug_info} section.  It is more efficient to put them in a separate
5604 comdat sections since the linker can then remove duplicates.
5605 But not all DWARF consumers support @code{.debug_types} sections yet
5606 and on some objects @code{.debug_types} produces larger instead of smaller
5607 debugging information.
5609 @item -gstabs+
5610 @opindex gstabs+
5611 Produce debugging information in stabs format (if that is supported),
5612 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5613 use of these extensions is likely to make other debuggers crash or
5614 refuse to read the program.
5616 @item -gcoff
5617 @opindex gcoff
5618 Produce debugging information in COFF format (if that is supported).
5619 This is the format used by SDB on most System V systems prior to
5620 System V Release 4.
5622 @item -gxcoff
5623 @opindex gxcoff
5624 Produce debugging information in XCOFF format (if that is supported).
5625 This is the format used by the DBX debugger on IBM RS/6000 systems.
5627 @item -gxcoff+
5628 @opindex gxcoff+
5629 Produce debugging information in XCOFF format (if that is supported),
5630 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5631 use of these extensions is likely to make other debuggers crash or
5632 refuse to read the program, and may cause assemblers other than the GNU
5633 assembler (GAS) to fail with an error.
5635 @item -gdwarf-@var{version}
5636 @opindex gdwarf-@var{version}
5637 Produce debugging information in DWARF format (if that is supported).
5638 The value of @var{version} may be either 2, 3, 4 or 5; the default version
5639 for most targets is 4.  DWARF Version 5 is only experimental.
5641 Note that with DWARF Version 2, some ports require and always
5642 use some non-conflicting DWARF 3 extensions in the unwind tables.
5644 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
5645 for maximum benefit.
5647 @item -grecord-gcc-switches
5648 @opindex grecord-gcc-switches
5649 This switch causes the command-line options used to invoke the
5650 compiler that may affect code generation to be appended to the
5651 DW_AT_producer attribute in DWARF debugging information.  The options
5652 are concatenated with spaces separating them from each other and from
5653 the compiler version.  See also @option{-frecord-gcc-switches} for another
5654 way of storing compiler options into the object file.  This is the default.
5656 @item -gno-record-gcc-switches
5657 @opindex gno-record-gcc-switches
5658 Disallow appending command-line options to the DW_AT_producer attribute
5659 in DWARF debugging information.
5661 @item -gstrict-dwarf
5662 @opindex gstrict-dwarf
5663 Disallow using extensions of later DWARF standard version than selected
5664 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
5665 DWARF extensions from later standard versions is allowed.
5667 @item -gno-strict-dwarf
5668 @opindex gno-strict-dwarf
5669 Allow using extensions of later DWARF standard version than selected with
5670 @option{-gdwarf-@var{version}}.
5672 @item -gz@r{[}=@var{type}@r{]}
5673 @opindex gz
5674 Produce compressed debug sections in DWARF format, if that is supported.
5675 If @var{type} is not given, the default type depends on the capabilities
5676 of the assembler and linker used.  @var{type} may be one of
5677 @samp{none} (don't compress debug sections), @samp{zlib} (use zlib
5678 compression in ELF gABI format), or @samp{zlib-gnu} (use zlib
5679 compression in traditional GNU format).  If the linker doesn't support
5680 writing compressed debug sections, the option is rejected.  Otherwise,
5681 if the assembler does not support them, @option{-gz} is silently ignored
5682 when producing object files.
5684 @item -gvms
5685 @opindex gvms
5686 Produce debugging information in Alpha/VMS debug format (if that is
5687 supported).  This is the format used by DEBUG on Alpha/VMS systems.
5689 @item -g@var{level}
5690 @itemx -ggdb@var{level}
5691 @itemx -gstabs@var{level}
5692 @itemx -gcoff@var{level}
5693 @itemx -gxcoff@var{level}
5694 @itemx -gvms@var{level}
5695 Request debugging information and also use @var{level} to specify how
5696 much information.  The default level is 2.
5698 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
5699 @option{-g}.
5701 Level 1 produces minimal information, enough for making backtraces in
5702 parts of the program that you don't plan to debug.  This includes
5703 descriptions of functions and external variables, and line number
5704 tables, but no information about local variables.
5706 Level 3 includes extra information, such as all the macro definitions
5707 present in the program.  Some debuggers support macro expansion when
5708 you use @option{-g3}.
5710 @option{-gdwarf-2} does not accept a concatenated debug level, because
5711 GCC used to support an option @option{-gdwarf} that meant to generate
5712 debug information in version 1 of the DWARF format (which is very
5713 different from version 2), and it would have been too confusing.  That
5714 debug format is long obsolete, but the option cannot be changed now.
5715 Instead use an additional @option{-g@var{level}} option to change the
5716 debug level for DWARF.
5718 @item -gtoggle
5719 @opindex gtoggle
5720 Turn off generation of debug info, if leaving out this option
5721 generates it, or turn it on at level 2 otherwise.  The position of this
5722 argument in the command line does not matter; it takes effect after all
5723 other options are processed, and it does so only once, no matter how
5724 many times it is given.  This is mainly intended to be used with
5725 @option{-fcompare-debug}.
5727 @item -fsanitize=address
5728 @opindex fsanitize=address
5729 Enable AddressSanitizer, a fast memory error detector.
5730 Memory access instructions are instrumented to detect
5731 out-of-bounds and use-after-free bugs.
5732 See @uref{http://code.google.com/p/address-sanitizer/} for
5733 more details.  The run-time behavior can be influenced using the
5734 @env{ASAN_OPTIONS} environment variable; see
5735 @url{https://code.google.com/p/address-sanitizer/wiki/Flags#Run-time_flags} for
5736 a list of supported options.
5738 @item -fsanitize=kernel-address
5739 @opindex fsanitize=kernel-address
5740 Enable AddressSanitizer for Linux kernel.
5741 See @uref{http://code.google.com/p/address-sanitizer/wiki/AddressSanitizerForKernel} for more details.
5743 @item -fsanitize=thread
5744 @opindex fsanitize=thread
5745 Enable ThreadSanitizer, a fast data race detector.
5746 Memory access instructions are instrumented to detect
5747 data race bugs.  See @uref{http://code.google.com/p/thread-sanitizer/} for more
5748 details. The run-time behavior can be influenced using the @env{TSAN_OPTIONS}
5749 environment variable; see
5750 @url{https://code.google.com/p/thread-sanitizer/wiki/Flags} for a list of
5751 supported options.
5753 @item -fsanitize=leak
5754 @opindex fsanitize=leak
5755 Enable LeakSanitizer, a memory leak detector.
5756 This option only matters for linking of executables and if neither
5757 @option{-fsanitize=address} nor @option{-fsanitize=thread} is used.  In that
5758 case the executable is linked against a library that overrides @code{malloc}
5759 and other allocator functions.  See
5760 @uref{https://code.google.com/p/address-sanitizer/wiki/LeakSanitizer} for more
5761 details.  The run-time behavior can be influenced using the
5762 @env{LSAN_OPTIONS} environment variable.
5764 @item -fsanitize=undefined
5765 @opindex fsanitize=undefined
5766 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector.
5767 Various computations are instrumented to detect undefined behavior
5768 at runtime.  Current suboptions are:
5770 @table @gcctabopt
5772 @item -fsanitize=shift
5773 @opindex fsanitize=shift
5774 This option enables checking that the result of a shift operation is
5775 not undefined.  Note that what exactly is considered undefined differs
5776 slightly between C and C++, as well as between ISO C90 and C99, etc.
5778 @item -fsanitize=integer-divide-by-zero
5779 @opindex fsanitize=integer-divide-by-zero
5780 Detect integer division by zero as well as @code{INT_MIN / -1} division.
5782 @item -fsanitize=unreachable
5783 @opindex fsanitize=unreachable
5784 With this option, the compiler turns the @code{__builtin_unreachable}
5785 call into a diagnostics message call instead.  When reaching the
5786 @code{__builtin_unreachable} call, the behavior is undefined.
5788 @item -fsanitize=vla-bound
5789 @opindex fsanitize=vla-bound
5790 This option instructs the compiler to check that the size of a variable
5791 length array is positive.
5793 @item -fsanitize=null
5794 @opindex fsanitize=null
5795 This option enables pointer checking.  Particularly, the application
5796 built with this option turned on will issue an error message when it
5797 tries to dereference a NULL pointer, or if a reference (possibly an
5798 rvalue reference) is bound to a NULL pointer, or if a method is invoked
5799 on an object pointed by a NULL pointer.
5801 @item -fsanitize=return
5802 @opindex fsanitize=return
5803 This option enables return statement checking.  Programs
5804 built with this option turned on will issue an error message
5805 when the end of a non-void function is reached without actually
5806 returning a value.  This option works in C++ only.
5808 @item -fsanitize=signed-integer-overflow
5809 @opindex fsanitize=signed-integer-overflow
5810 This option enables signed integer overflow checking.  We check that
5811 the result of @code{+}, @code{*}, and both unary and binary @code{-}
5812 does not overflow in the signed arithmetics.  Note, integer promotion
5813 rules must be taken into account.  That is, the following is not an
5814 overflow:
5815 @smallexample
5816 signed char a = SCHAR_MAX;
5817 a++;
5818 @end smallexample
5820 @item -fsanitize=bounds
5821 @opindex fsanitize=bounds
5822 This option enables instrumentation of array bounds.  Various out of bounds
5823 accesses are detected.  Flexible array members, flexible array member-like
5824 arrays, and initializers of variables with static storage are not instrumented.
5826 @item -fsanitize=bounds-strict
5827 @opindex fsanitize=bounds-strict
5828 This option enables strict instrumentation of array bounds.  Most out of bounds
5829 accesses are detected, including flexible array members and flexible array
5830 member-like arrays.  Initializers of variables with static storage are not
5831 instrumented.
5833 @item -fsanitize=alignment
5834 @opindex fsanitize=alignment
5836 This option enables checking of alignment of pointers when they are
5837 dereferenced, or when a reference is bound to insufficiently aligned target,
5838 or when a method or constructor is invoked on insufficiently aligned object.
5840 @item -fsanitize=object-size
5841 @opindex fsanitize=object-size
5842 This option enables instrumentation of memory references using the
5843 @code{__builtin_object_size} function.  Various out of bounds pointer
5844 accesses are detected.
5846 @item -fsanitize=float-divide-by-zero
5847 @opindex fsanitize=float-divide-by-zero
5848 Detect floating-point division by zero.  Unlike other similar options,
5849 @option{-fsanitize=float-divide-by-zero} is not enabled by
5850 @option{-fsanitize=undefined}, since floating-point division by zero can
5851 be a legitimate way of obtaining infinities and NaNs.
5853 @item -fsanitize=float-cast-overflow
5854 @opindex fsanitize=float-cast-overflow
5855 This option enables floating-point type to integer conversion checking.
5856 We check that the result of the conversion does not overflow.
5857 Unlike other similar options, @option{-fsanitize=float-cast-overflow} is
5858 not enabled by @option{-fsanitize=undefined}.
5859 This option does not work well with @code{FE_INVALID} exceptions enabled.
5861 @item -fsanitize=nonnull-attribute
5862 @opindex fsanitize=nonnull-attribute
5864 This option enables instrumentation of calls, checking whether null values
5865 are not passed to arguments marked as requiring a non-null value by the
5866 @code{nonnull} function attribute.
5868 @item -fsanitize=returns-nonnull-attribute
5869 @opindex fsanitize=returns-nonnull-attribute
5871 This option enables instrumentation of return statements in functions
5872 marked with @code{returns_nonnull} function attribute, to detect returning
5873 of null values from such functions.
5875 @item -fsanitize=bool
5876 @opindex fsanitize=bool
5878 This option enables instrumentation of loads from bool.  If a value other
5879 than 0/1 is loaded, a run-time error is issued.
5881 @item -fsanitize=enum
5882 @opindex fsanitize=enum
5884 This option enables instrumentation of loads from an enum type.  If
5885 a value outside the range of values for the enum type is loaded,
5886 a run-time error is issued.
5888 @item -fsanitize=vptr
5889 @opindex fsanitize=vptr
5891 This option enables instrumentation of C++ member function calls, member
5892 accesses and some conversions between pointers to base and derived classes,
5893 to verify the referenced object has the correct dynamic type.
5895 @end table
5897 While @option{-ftrapv} causes traps for signed overflows to be emitted,
5898 @option{-fsanitize=undefined} gives a diagnostic message.
5899 This currently works only for the C family of languages.
5901 @item -fno-sanitize=all
5902 @opindex fno-sanitize=all
5904 This option disables all previously enabled sanitizers.
5905 @option{-fsanitize=all} is not allowed, as some sanitizers cannot be used
5906 together.
5908 @item -fasan-shadow-offset=@var{number}
5909 @opindex fasan-shadow-offset
5910 This option forces GCC to use custom shadow offset in AddressSanitizer checks.
5911 It is useful for experimenting with different shadow memory layouts in
5912 Kernel AddressSanitizer.
5914 @item -fsanitize-sections=@var{s1},@var{s2},...
5915 @opindex fsanitize-sections
5916 Sanitize global variables in selected user-defined sections.  @var{si} may
5917 contain wildcards.
5919 @item -fsanitize-recover@r{[}=@var{opts}@r{]}
5920 @opindex fsanitize-recover
5921 @opindex fno-sanitize-recover
5922 @option{-fsanitize-recover=} controls error recovery mode for sanitizers
5923 mentioned in comma-separated list of @var{opts}.  Enabling this option
5924 for a sanitizer component causes it to attempt to continue
5925 running the program as if no error happened.  This means multiple
5926 runtime errors can be reported in a single program run, and the exit
5927 code of the program may indicate success even when errors
5928 have been reported.  The @option{-fno-sanitize-recover=} option
5929 can be used to alter
5930 this behavior: only the first detected error is reported
5931 and program then exits with a non-zero exit code.
5933 Currently this feature only works for @option{-fsanitize=undefined} (and its suboptions
5934 except for @option{-fsanitize=unreachable} and @option{-fsanitize=return}),
5935 @option{-fsanitize=float-cast-overflow}, @option{-fsanitize=float-divide-by-zero} and
5936 @option{-fsanitize=kernel-address}.  For these sanitizers error recovery is turned on by default.
5937 @option{-fsanitize-recover=all} and @option{-fno-sanitize-recover=all} is also
5938 accepted, the former enables recovery for all sanitizers that support it,
5939 the latter disables recovery for all sanitizers that support it.
5941 Syntax without explicit @var{opts} parameter is deprecated.  It is equivalent to
5942 @smallexample
5943 -fsanitize-recover=undefined,float-cast-overflow,float-divide-by-zero
5944 @end smallexample
5945 @noindent
5946 Similarly @option{-fno-sanitize-recover} is equivalent to
5947 @smallexample
5948 -fno-sanitize-recover=undefined,float-cast-overflow,float-divide-by-zero
5949 @end smallexample
5951 @item -fsanitize-undefined-trap-on-error
5952 @opindex fsanitize-undefined-trap-on-error
5953 The @option{-fsanitize-undefined-trap-on-error} option instructs the compiler to
5954 report undefined behavior using @code{__builtin_trap} rather than
5955 a @code{libubsan} library routine.  The advantage of this is that the
5956 @code{libubsan} library is not needed and is not linked in, so this
5957 is usable even in freestanding environments.
5959 @item -fcheck-pointer-bounds
5960 @opindex fcheck-pointer-bounds
5961 @opindex fno-check-pointer-bounds
5962 @cindex Pointer Bounds Checker options
5963 Enable Pointer Bounds Checker instrumentation.  Each memory reference
5964 is instrumented with checks of the pointer used for memory access against
5965 bounds associated with that pointer.  
5967 Currently there
5968 is only an implementation for Intel MPX available, thus x86 target
5969 and @option{-mmpx} are required to enable this feature.  
5970 MPX-based instrumentation requires
5971 a runtime library to enable MPX in hardware and handle bounds
5972 violation signals.  By default when @option{-fcheck-pointer-bounds}
5973 and @option{-mmpx} options are used to link a program, the GCC driver
5974 links against the @file{libmpx} runtime library and @file{libmpxwrappers}
5975 library.  It also passes '-z bndplt' to a linker in case it supports this
5976 option (which is checked on libmpx configuration).  Note that old versions
5977 of linker may ignore option.  Gold linker doesn't support '-z bndplt'
5978 option.  With no '-z bndplt' support in linker all calls to dynamic libraries
5979 lose passed bounds reducing overall protection level.  It's highly
5980 recommended to use linker with '-z bndplt' support.  In case such linker
5981 is not available it is adviced to always use @option{-static-libmpxwrappers}
5982 for better protection level or use @option{-static} to completely avoid
5983 external calls to dynamic libraries.  MPX-based instrumentation
5984 may be used for debugging and also may be included in production code
5985 to increase program security.  Depending on usage, you may
5986 have different requirements for the runtime library.  The current version
5987 of the MPX runtime library is more oriented for use as a debugging
5988 tool.  MPX runtime library usage implies @option{-lpthread}.  See
5989 also @option{-static-libmpx}.  The runtime library  behavior can be
5990 influenced using various @env{CHKP_RT_*} environment variables.  See
5991 @uref{https://gcc.gnu.org/wiki/Intel%20MPX%20support%20in%20the%20GCC%20compiler}
5992 for more details.
5994 Generated instrumentation may be controlled by various
5995 @option{-fchkp-*} options and by the @code{bnd_variable_size}
5996 structure field attribute (@pxref{Type Attributes}) and
5997 @code{bnd_legacy}, and @code{bnd_instrument} function attributes
5998 (@pxref{Function Attributes}).  GCC also provides a number of built-in
5999 functions for controlling the Pointer Bounds Checker.  @xref{Pointer
6000 Bounds Checker builtins}, for more information.
6002 @item -fchkp-check-incomplete-type
6003 @opindex fchkp-check-incomplete-type
6004 @opindex fno-chkp-check-incomplete-type
6005 Generate pointer bounds checks for variables with incomplete type.
6006 Enabled by default.
6008 @item -fchkp-narrow-bounds
6009 @opindex fchkp-narrow-bounds
6010 @opindex fno-chkp-narrow-bounds
6011 Controls bounds used by Pointer Bounds Checker for pointers to object
6012 fields.  If narrowing is enabled then field bounds are used.  Otherwise
6013 object bounds are used.  See also @option{-fchkp-narrow-to-innermost-array}
6014 and @option{-fchkp-first-field-has-own-bounds}.  Enabled by default.
6016 @item -fchkp-first-field-has-own-bounds
6017 @opindex fchkp-first-field-has-own-bounds
6018 @opindex fno-chkp-first-field-has-own-bounds
6019 Forces Pointer Bounds Checker to use narrowed bounds for the address of the
6020 first field in the structure.  By default a pointer to the first field has
6021 the same bounds as a pointer to the whole structure.
6023 @item -fchkp-narrow-to-innermost-array
6024 @opindex fchkp-narrow-to-innermost-array
6025 @opindex fno-chkp-narrow-to-innermost-array
6026 Forces Pointer Bounds Checker to use bounds of the innermost arrays in
6027 case of nested static array access.  By default this option is disabled and
6028 bounds of the outermost array are used.
6030 @item -fchkp-optimize
6031 @opindex fchkp-optimize
6032 @opindex fno-chkp-optimize
6033 Enables Pointer Bounds Checker optimizations.  Enabled by default at
6034 optimization levels @option{-O}, @option{-O2}, @option{-O3}.
6036 @item -fchkp-use-fast-string-functions
6037 @opindex fchkp-use-fast-string-functions
6038 @opindex fno-chkp-use-fast-string-functions
6039 Enables use of @code{*_nobnd} versions of string functions (not copying bounds)
6040 by Pointer Bounds Checker.  Disabled by default.
6042 @item -fchkp-use-nochk-string-functions
6043 @opindex fchkp-use-nochk-string-functions
6044 @opindex fno-chkp-use-nochk-string-functions
6045 Enables use of @code{*_nochk} versions of string functions (not checking bounds)
6046 by Pointer Bounds Checker.  Disabled by default.
6048 @item -fchkp-use-static-bounds
6049 @opindex fchkp-use-static-bounds
6050 @opindex fno-chkp-use-static-bounds
6051 Allow Pointer Bounds Checker to generate static bounds holding
6052 bounds of static variables.  Enabled by default.
6054 @item -fchkp-use-static-const-bounds
6055 @opindex fchkp-use-static-const-bounds
6056 @opindex fno-chkp-use-static-const-bounds
6057 Use statically-initialized bounds for constant bounds instead of
6058 generating them each time they are required.  By default enabled when
6059 @option{-fchkp-use-static-bounds} is enabled.
6061 @item -fchkp-treat-zero-dynamic-size-as-infinite
6062 @opindex fchkp-treat-zero-dynamic-size-as-infinite
6063 @opindex fno-chkp-treat-zero-dynamic-size-as-infinite
6064 With this option, objects with incomplete type whose
6065 dynamically-obtained size is zero are treated as having infinite size
6066 instead by Pointer Bounds
6067 Checker.  This option may be helpful if a program is linked with a library
6068 missing size information for some symbols.  Disabled by default.
6070 @item -fchkp-check-read
6071 @opindex fchkp-check-read
6072 @opindex fno-chkp-check-read
6073 Instructs Pointer Bounds Checker to generate checks for all read
6074 accesses to memory.  Enabled by default.
6076 @item -fchkp-check-write
6077 @opindex fchkp-check-write
6078 @opindex fno-chkp-check-write
6079 Instructs Pointer Bounds Checker to generate checks for all write
6080 accesses to memory.  Enabled by default.
6082 @item -fchkp-store-bounds
6083 @opindex fchkp-store-bounds
6084 @opindex fno-chkp-store-bounds
6085 Instructs Pointer Bounds Checker to generate bounds stores for
6086 pointer writes.  Enabled by default.
6088 @item -fchkp-instrument-calls
6089 @opindex fchkp-instrument-calls
6090 @opindex fno-chkp-instrument-calls
6091 Instructs Pointer Bounds Checker to pass pointer bounds to calls.
6092 Enabled by default.
6094 @item -fchkp-instrument-marked-only
6095 @opindex fchkp-instrument-marked-only
6096 @opindex fno-chkp-instrument-marked-only
6097 Instructs Pointer Bounds Checker to instrument only functions
6098 marked with the @code{bnd_instrument} attribute
6099 (@pxref{Function Attributes}).  Disabled by default.
6101 @item -fchkp-use-wrappers
6102 @opindex fchkp-use-wrappers
6103 @opindex fno-chkp-use-wrappers
6104 Allows Pointer Bounds Checker to replace calls to built-in functions
6105 with calls to wrapper functions.  When @option{-fchkp-use-wrappers}
6106 is used to link a program, the GCC driver automatically links
6107 against @file{libmpxwrappers}.  See also @option{-static-libmpxwrappers}.
6108 Enabled by default.
6110 @item -fdump-final-insns@r{[}=@var{file}@r{]}
6111 @opindex fdump-final-insns
6112 Dump the final internal representation (RTL) to @var{file}.  If the
6113 optional argument is omitted (or if @var{file} is @code{.}), the name
6114 of the dump file is determined by appending @code{.gkd} to the
6115 compilation output file name.
6117 @item -fcompare-debug@r{[}=@var{opts}@r{]}
6118 @opindex fcompare-debug
6119 @opindex fno-compare-debug
6120 If no error occurs during compilation, run the compiler a second time,
6121 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
6122 passed to the second compilation.  Dump the final internal
6123 representation in both compilations, and print an error if they differ.
6125 If the equal sign is omitted, the default @option{-gtoggle} is used.
6127 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
6128 and nonzero, implicitly enables @option{-fcompare-debug}.  If
6129 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
6130 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
6131 is used.
6133 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
6134 is equivalent to @option{-fno-compare-debug}, which disables the dumping
6135 of the final representation and the second compilation, preventing even
6136 @env{GCC_COMPARE_DEBUG} from taking effect.
6138 To verify full coverage during @option{-fcompare-debug} testing, set
6139 @env{GCC_COMPARE_DEBUG} to say @option{-fcompare-debug-not-overridden},
6140 which GCC rejects as an invalid option in any actual compilation
6141 (rather than preprocessing, assembly or linking).  To get just a
6142 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
6143 not overridden} will do.
6145 @item -fcompare-debug-second
6146 @opindex fcompare-debug-second
6147 This option is implicitly passed to the compiler for the second
6148 compilation requested by @option{-fcompare-debug}, along with options to
6149 silence warnings, and omitting other options that would cause
6150 side-effect compiler outputs to files or to the standard output.  Dump
6151 files and preserved temporary files are renamed so as to contain the
6152 @code{.gk} additional extension during the second compilation, to avoid
6153 overwriting those generated by the first.
6155 When this option is passed to the compiler driver, it causes the
6156 @emph{first} compilation to be skipped, which makes it useful for little
6157 other than debugging the compiler proper.
6159 @item -feliminate-dwarf2-dups
6160 @opindex feliminate-dwarf2-dups
6161 Compress DWARF 2 debugging information by eliminating duplicated
6162 information about each symbol.  This option only makes sense when
6163 generating DWARF 2 debugging information with @option{-gdwarf-2}.
6165 @item -femit-struct-debug-baseonly
6166 @opindex femit-struct-debug-baseonly
6167 Emit debug information for struct-like types
6168 only when the base name of the compilation source file
6169 matches the base name of file in which the struct is defined.
6171 This option substantially reduces the size of debugging information,
6172 but at significant potential loss in type information to the debugger.
6173 See @option{-femit-struct-debug-reduced} for a less aggressive option.
6174 See @option{-femit-struct-debug-detailed} for more detailed control.
6176 This option works only with DWARF 2.
6178 @item -femit-struct-debug-reduced
6179 @opindex femit-struct-debug-reduced
6180 Emit debug information for struct-like types
6181 only when the base name of the compilation source file
6182 matches the base name of file in which the type is defined,
6183 unless the struct is a template or defined in a system header.
6185 This option significantly reduces the size of debugging information,
6186 with some potential loss in type information to the debugger.
6187 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
6188 See @option{-femit-struct-debug-detailed} for more detailed control.
6190 This option works only with DWARF 2.
6192 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
6193 @opindex femit-struct-debug-detailed
6194 Specify the struct-like types
6195 for which the compiler generates debug information.
6196 The intent is to reduce duplicate struct debug information
6197 between different object files within the same program.
6199 This option is a detailed version of
6200 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
6201 which serves for most needs.
6203 A specification has the syntax@*
6204 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
6206 The optional first word limits the specification to
6207 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
6208 A struct type is used directly when it is the type of a variable, member.
6209 Indirect uses arise through pointers to structs.
6210 That is, when use of an incomplete struct is valid, the use is indirect.
6211 An example is
6212 @samp{struct one direct; struct two * indirect;}.
6214 The optional second word limits the specification to
6215 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
6216 Generic structs are a bit complicated to explain.
6217 For C++, these are non-explicit specializations of template classes,
6218 or non-template classes within the above.
6219 Other programming languages have generics,
6220 but @option{-femit-struct-debug-detailed} does not yet implement them.
6222 The third word specifies the source files for those
6223 structs for which the compiler should emit debug information.
6224 The values @samp{none} and @samp{any} have the normal meaning.
6225 The value @samp{base} means that
6226 the base of name of the file in which the type declaration appears
6227 must match the base of the name of the main compilation file.
6228 In practice, this means that when compiling @file{foo.c}, debug information
6229 is generated for types declared in that file and @file{foo.h},
6230 but not other header files.
6231 The value @samp{sys} means those types satisfying @samp{base}
6232 or declared in system or compiler headers.
6234 You may need to experiment to determine the best settings for your application.
6236 The default is @option{-femit-struct-debug-detailed=all}.
6238 This option works only with DWARF 2.
6240 @item -fno-merge-debug-strings
6241 @opindex fmerge-debug-strings
6242 @opindex fno-merge-debug-strings
6243 Direct the linker to not merge together strings in the debugging
6244 information that are identical in different object files.  Merging is
6245 not supported by all assemblers or linkers.  Merging decreases the size
6246 of the debug information in the output file at the cost of increasing
6247 link processing time.  Merging is enabled by default.
6249 @item -fdebug-prefix-map=@var{old}=@var{new}
6250 @opindex fdebug-prefix-map
6251 When compiling files in directory @file{@var{old}}, record debugging
6252 information describing them as in @file{@var{new}} instead.
6254 @item -fno-dwarf2-cfi-asm
6255 @opindex fdwarf2-cfi-asm
6256 @opindex fno-dwarf2-cfi-asm
6257 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
6258 instead of using GAS @code{.cfi_*} directives.
6260 @cindex @command{prof}
6261 @item -p
6262 @opindex p
6263 Generate extra code to write profile information suitable for the
6264 analysis program @command{prof}.  You must use this option when compiling
6265 the source files you want data about, and you must also use it when
6266 linking.
6268 @cindex @command{gprof}
6269 @item -pg
6270 @opindex pg
6271 Generate extra code to write profile information suitable for the
6272 analysis program @command{gprof}.  You must use this option when compiling
6273 the source files you want data about, and you must also use it when
6274 linking.
6276 @item -Q
6277 @opindex Q
6278 Makes the compiler print out each function name as it is compiled, and
6279 print some statistics about each pass when it finishes.
6281 @item -ftime-report
6282 @opindex ftime-report
6283 Makes the compiler print some statistics about the time consumed by each
6284 pass when it finishes.
6286 @item -fmem-report
6287 @opindex fmem-report
6288 Makes the compiler print some statistics about permanent memory
6289 allocation when it finishes.
6291 @item -fmem-report-wpa
6292 @opindex fmem-report-wpa
6293 Makes the compiler print some statistics about permanent memory
6294 allocation for the WPA phase only.
6296 @item -fpre-ipa-mem-report
6297 @opindex fpre-ipa-mem-report
6298 @item -fpost-ipa-mem-report
6299 @opindex fpost-ipa-mem-report
6300 Makes the compiler print some statistics about permanent memory
6301 allocation before or after interprocedural optimization.
6303 @item -fprofile-report
6304 @opindex fprofile-report
6305 Makes the compiler print some statistics about consistency of the
6306 (estimated) profile and effect of individual passes.
6308 @item -fstack-usage
6309 @opindex fstack-usage
6310 Makes the compiler output stack usage information for the program, on a
6311 per-function basis.  The filename for the dump is made by appending
6312 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
6313 the output file, if explicitly specified and it is not an executable,
6314 otherwise it is the basename of the source file.  An entry is made up
6315 of three fields:
6317 @itemize
6318 @item
6319 The name of the function.
6320 @item
6321 A number of bytes.
6322 @item
6323 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
6324 @end itemize
6326 The qualifier @code{static} means that the function manipulates the stack
6327 statically: a fixed number of bytes are allocated for the frame on function
6328 entry and released on function exit; no stack adjustments are otherwise made
6329 in the function.  The second field is this fixed number of bytes.
6331 The qualifier @code{dynamic} means that the function manipulates the stack
6332 dynamically: in addition to the static allocation described above, stack
6333 adjustments are made in the body of the function, for example to push/pop
6334 arguments around function calls.  If the qualifier @code{bounded} is also
6335 present, the amount of these adjustments is bounded at compile time and
6336 the second field is an upper bound of the total amount of stack used by
6337 the function.  If it is not present, the amount of these adjustments is
6338 not bounded at compile time and the second field only represents the
6339 bounded part.
6341 @item -fprofile-arcs
6342 @opindex fprofile-arcs
6343 Add code so that program flow @dfn{arcs} are instrumented.  During
6344 execution the program records how many times each branch and call is
6345 executed and how many times it is taken or returns.  When the compiled
6346 program exits it saves this data to a file called
6347 @file{@var{auxname}.gcda} for each source file.  The data may be used for
6348 profile-directed optimizations (@option{-fbranch-probabilities}), or for
6349 test coverage analysis (@option{-ftest-coverage}).  Each object file's
6350 @var{auxname} is generated from the name of the output file, if
6351 explicitly specified and it is not the final executable, otherwise it is
6352 the basename of the source file.  In both cases any suffix is removed
6353 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
6354 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
6355 @xref{Cross-profiling}.
6357 @cindex @command{gcov}
6358 @item --coverage
6359 @opindex coverage
6361 This option is used to compile and link code instrumented for coverage
6362 analysis.  The option is a synonym for @option{-fprofile-arcs}
6363 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
6364 linking).  See the documentation for those options for more details.
6366 @itemize
6368 @item
6369 Compile the source files with @option{-fprofile-arcs} plus optimization
6370 and code generation options.  For test coverage analysis, use the
6371 additional @option{-ftest-coverage} option.  You do not need to profile
6372 every source file in a program.
6374 @item
6375 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
6376 (the latter implies the former).
6378 @item
6379 Run the program on a representative workload to generate the arc profile
6380 information.  This may be repeated any number of times.  You can run
6381 concurrent instances of your program, and provided that the file system
6382 supports locking, the data files will be correctly updated.  Also
6383 @code{fork} calls are detected and correctly handled (double counting
6384 will not happen).
6386 @item
6387 For profile-directed optimizations, compile the source files again with
6388 the same optimization and code generation options plus
6389 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
6390 Control Optimization}).
6392 @item
6393 For test coverage analysis, use @command{gcov} to produce human readable
6394 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
6395 @command{gcov} documentation for further information.
6397 @end itemize
6399 With @option{-fprofile-arcs}, for each function of your program GCC
6400 creates a program flow graph, then finds a spanning tree for the graph.
6401 Only arcs that are not on the spanning tree have to be instrumented: the
6402 compiler adds code to count the number of times that these arcs are
6403 executed.  When an arc is the only exit or only entrance to a block, the
6404 instrumentation code can be added to the block; otherwise, a new basic
6405 block must be created to hold the instrumentation code.
6407 @need 2000
6408 @item -ftest-coverage
6409 @opindex ftest-coverage
6410 Produce a notes file that the @command{gcov} code-coverage utility
6411 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
6412 show program coverage.  Each source file's note file is called
6413 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
6414 above for a description of @var{auxname} and instructions on how to
6415 generate test coverage data.  Coverage data matches the source files
6416 more closely if you do not optimize.
6418 @item -fdbg-cnt-list
6419 @opindex fdbg-cnt-list
6420 Print the name and the counter upper bound for all debug counters.
6423 @item -fdbg-cnt=@var{counter-value-list}
6424 @opindex fdbg-cnt
6425 Set the internal debug counter upper bound.  @var{counter-value-list}
6426 is a comma-separated list of @var{name}:@var{value} pairs
6427 which sets the upper bound of each debug counter @var{name} to @var{value}.
6428 All debug counters have the initial upper bound of @code{UINT_MAX};
6429 thus @code{dbg_cnt} returns true always unless the upper bound
6430 is set by this option.
6431 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
6432 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
6434 @item -fenable-@var{kind}-@var{pass}
6435 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
6436 @opindex fdisable-
6437 @opindex fenable-
6439 This is a set of options that are used to explicitly disable/enable
6440 optimization passes.  These options are intended for use for debugging GCC.
6441 Compiler users should use regular options for enabling/disabling
6442 passes instead.
6444 @table @gcctabopt
6446 @item -fdisable-ipa-@var{pass}
6447 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
6448 statically invoked in the compiler multiple times, the pass name should be
6449 appended with a sequential number starting from 1.
6451 @item -fdisable-rtl-@var{pass}
6452 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
6453 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
6454 statically invoked in the compiler multiple times, the pass name should be
6455 appended with a sequential number starting from 1.  @var{range-list} is a 
6456 comma-separated list of function ranges or assembler names.  Each range is a number
6457 pair separated by a colon.  The range is inclusive in both ends.  If the range
6458 is trivial, the number pair can be simplified as a single number.  If the
6459 function's call graph node's @var{uid} falls within one of the specified ranges,
6460 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
6461 function header of a dump file, and the pass names can be dumped by using
6462 option @option{-fdump-passes}.
6464 @item -fdisable-tree-@var{pass}
6465 @itemx -fdisable-tree-@var{pass}=@var{range-list}
6466 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
6467 option arguments.
6469 @item -fenable-ipa-@var{pass}
6470 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
6471 statically invoked in the compiler multiple times, the pass name should be
6472 appended with a sequential number starting from 1.
6474 @item -fenable-rtl-@var{pass}
6475 @itemx -fenable-rtl-@var{pass}=@var{range-list}
6476 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
6477 description and examples.
6479 @item -fenable-tree-@var{pass}
6480 @itemx -fenable-tree-@var{pass}=@var{range-list}
6481 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
6482 of option arguments.
6484 @end table
6486 Here are some examples showing uses of these options.
6488 @smallexample
6490 # disable ccp1 for all functions
6491    -fdisable-tree-ccp1
6492 # disable complete unroll for function whose cgraph node uid is 1
6493    -fenable-tree-cunroll=1
6494 # disable gcse2 for functions at the following ranges [1,1],
6495 # [300,400], and [400,1000]
6496 # disable gcse2 for functions foo and foo2
6497    -fdisable-rtl-gcse2=foo,foo2
6498 # disable early inlining
6499    -fdisable-tree-einline
6500 # disable ipa inlining
6501    -fdisable-ipa-inline
6502 # enable tree full unroll
6503    -fenable-tree-unroll
6505 @end smallexample
6507 @item -d@var{letters}
6508 @itemx -fdump-rtl-@var{pass}
6509 @itemx -fdump-rtl-@var{pass}=@var{filename}
6510 @opindex d
6511 @opindex fdump-rtl-@var{pass}
6512 Says to make debugging dumps during compilation at times specified by
6513 @var{letters}.  This is used for debugging the RTL-based passes of the
6514 compiler.  The file names for most of the dumps are made by appending
6515 a pass number and a word to the @var{dumpname}, and the files are
6516 created in the directory of the output file. In case of
6517 @option{=@var{filename}} option, the dump is output on the given file
6518 instead of the pass numbered dump files. Note that the pass number is
6519 computed statically as passes get registered into the pass manager.
6520 Thus the numbering is not related to the dynamic order of execution of
6521 passes.  In particular, a pass installed by a plugin could have a
6522 number over 200 even if it executed quite early.  @var{dumpname} is
6523 generated from the name of the output file, if explicitly specified
6524 and it is not an executable, otherwise it is the basename of the
6525 source file. These switches may have different effects when
6526 @option{-E} is used for preprocessing.
6528 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
6529 @option{-d} option @var{letters}.  Here are the possible
6530 letters for use in @var{pass} and @var{letters}, and their meanings:
6532 @table @gcctabopt
6534 @item -fdump-rtl-alignments
6535 @opindex fdump-rtl-alignments
6536 Dump after branch alignments have been computed.
6538 @item -fdump-rtl-asmcons
6539 @opindex fdump-rtl-asmcons
6540 Dump after fixing rtl statements that have unsatisfied in/out constraints.
6542 @item -fdump-rtl-auto_inc_dec
6543 @opindex fdump-rtl-auto_inc_dec
6544 Dump after auto-inc-dec discovery.  This pass is only run on
6545 architectures that have auto inc or auto dec instructions.
6547 @item -fdump-rtl-barriers
6548 @opindex fdump-rtl-barriers
6549 Dump after cleaning up the barrier instructions.
6551 @item -fdump-rtl-bbpart
6552 @opindex fdump-rtl-bbpart
6553 Dump after partitioning hot and cold basic blocks.
6555 @item -fdump-rtl-bbro
6556 @opindex fdump-rtl-bbro
6557 Dump after block reordering.
6559 @item -fdump-rtl-btl1
6560 @itemx -fdump-rtl-btl2
6561 @opindex fdump-rtl-btl2
6562 @opindex fdump-rtl-btl2
6563 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
6564 after the two branch
6565 target load optimization passes.
6567 @item -fdump-rtl-bypass
6568 @opindex fdump-rtl-bypass
6569 Dump after jump bypassing and control flow optimizations.
6571 @item -fdump-rtl-combine
6572 @opindex fdump-rtl-combine
6573 Dump after the RTL instruction combination pass.
6575 @item -fdump-rtl-compgotos
6576 @opindex fdump-rtl-compgotos
6577 Dump after duplicating the computed gotos.
6579 @item -fdump-rtl-ce1
6580 @itemx -fdump-rtl-ce2
6581 @itemx -fdump-rtl-ce3
6582 @opindex fdump-rtl-ce1
6583 @opindex fdump-rtl-ce2
6584 @opindex fdump-rtl-ce3
6585 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
6586 @option{-fdump-rtl-ce3} enable dumping after the three
6587 if conversion passes.
6589 @item -fdump-rtl-cprop_hardreg
6590 @opindex fdump-rtl-cprop_hardreg
6591 Dump after hard register copy propagation.
6593 @item -fdump-rtl-csa
6594 @opindex fdump-rtl-csa
6595 Dump after combining stack adjustments.
6597 @item -fdump-rtl-cse1
6598 @itemx -fdump-rtl-cse2
6599 @opindex fdump-rtl-cse1
6600 @opindex fdump-rtl-cse2
6601 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
6602 the two common subexpression elimination passes.
6604 @item -fdump-rtl-dce
6605 @opindex fdump-rtl-dce
6606 Dump after the standalone dead code elimination passes.
6608 @item -fdump-rtl-dbr
6609 @opindex fdump-rtl-dbr
6610 Dump after delayed branch scheduling.
6612 @item -fdump-rtl-dce1
6613 @itemx -fdump-rtl-dce2
6614 @opindex fdump-rtl-dce1
6615 @opindex fdump-rtl-dce2
6616 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
6617 the two dead store elimination passes.
6619 @item -fdump-rtl-eh
6620 @opindex fdump-rtl-eh
6621 Dump after finalization of EH handling code.
6623 @item -fdump-rtl-eh_ranges
6624 @opindex fdump-rtl-eh_ranges
6625 Dump after conversion of EH handling range regions.
6627 @item -fdump-rtl-expand
6628 @opindex fdump-rtl-expand
6629 Dump after RTL generation.
6631 @item -fdump-rtl-fwprop1
6632 @itemx -fdump-rtl-fwprop2
6633 @opindex fdump-rtl-fwprop1
6634 @opindex fdump-rtl-fwprop2
6635 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
6636 dumping after the two forward propagation passes.
6638 @item -fdump-rtl-gcse1
6639 @itemx -fdump-rtl-gcse2
6640 @opindex fdump-rtl-gcse1
6641 @opindex fdump-rtl-gcse2
6642 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
6643 after global common subexpression elimination.
6645 @item -fdump-rtl-init-regs
6646 @opindex fdump-rtl-init-regs
6647 Dump after the initialization of the registers.
6649 @item -fdump-rtl-initvals
6650 @opindex fdump-rtl-initvals
6651 Dump after the computation of the initial value sets.
6653 @item -fdump-rtl-into_cfglayout
6654 @opindex fdump-rtl-into_cfglayout
6655 Dump after converting to cfglayout mode.
6657 @item -fdump-rtl-ira
6658 @opindex fdump-rtl-ira
6659 Dump after iterated register allocation.
6661 @item -fdump-rtl-jump
6662 @opindex fdump-rtl-jump
6663 Dump after the second jump optimization.
6665 @item -fdump-rtl-loop2
6666 @opindex fdump-rtl-loop2
6667 @option{-fdump-rtl-loop2} enables dumping after the rtl
6668 loop optimization passes.
6670 @item -fdump-rtl-mach
6671 @opindex fdump-rtl-mach
6672 Dump after performing the machine dependent reorganization pass, if that
6673 pass exists.
6675 @item -fdump-rtl-mode_sw
6676 @opindex fdump-rtl-mode_sw
6677 Dump after removing redundant mode switches.
6679 @item -fdump-rtl-rnreg
6680 @opindex fdump-rtl-rnreg
6681 Dump after register renumbering.
6683 @item -fdump-rtl-outof_cfglayout
6684 @opindex fdump-rtl-outof_cfglayout
6685 Dump after converting from cfglayout mode.
6687 @item -fdump-rtl-peephole2
6688 @opindex fdump-rtl-peephole2
6689 Dump after the peephole pass.
6691 @item -fdump-rtl-postreload
6692 @opindex fdump-rtl-postreload
6693 Dump after post-reload optimizations.
6695 @item -fdump-rtl-pro_and_epilogue
6696 @opindex fdump-rtl-pro_and_epilogue
6697 Dump after generating the function prologues and epilogues.
6699 @item -fdump-rtl-sched1
6700 @itemx -fdump-rtl-sched2
6701 @opindex fdump-rtl-sched1
6702 @opindex fdump-rtl-sched2
6703 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
6704 after the basic block scheduling passes.
6706 @item -fdump-rtl-ree
6707 @opindex fdump-rtl-ree
6708 Dump after sign/zero extension elimination.
6710 @item -fdump-rtl-seqabstr
6711 @opindex fdump-rtl-seqabstr
6712 Dump after common sequence discovery.
6714 @item -fdump-rtl-shorten
6715 @opindex fdump-rtl-shorten
6716 Dump after shortening branches.
6718 @item -fdump-rtl-sibling
6719 @opindex fdump-rtl-sibling
6720 Dump after sibling call optimizations.
6722 @item -fdump-rtl-split1
6723 @itemx -fdump-rtl-split2
6724 @itemx -fdump-rtl-split3
6725 @itemx -fdump-rtl-split4
6726 @itemx -fdump-rtl-split5
6727 @opindex fdump-rtl-split1
6728 @opindex fdump-rtl-split2
6729 @opindex fdump-rtl-split3
6730 @opindex fdump-rtl-split4
6731 @opindex fdump-rtl-split5
6732 These options enable dumping after five rounds of
6733 instruction splitting.
6735 @item -fdump-rtl-sms
6736 @opindex fdump-rtl-sms
6737 Dump after modulo scheduling.  This pass is only run on some
6738 architectures.
6740 @item -fdump-rtl-stack
6741 @opindex fdump-rtl-stack
6742 Dump after conversion from GCC's ``flat register file'' registers to the
6743 x87's stack-like registers.  This pass is only run on x86 variants.
6745 @item -fdump-rtl-subreg1
6746 @itemx -fdump-rtl-subreg2
6747 @opindex fdump-rtl-subreg1
6748 @opindex fdump-rtl-subreg2
6749 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
6750 the two subreg expansion passes.
6752 @item -fdump-rtl-unshare
6753 @opindex fdump-rtl-unshare
6754 Dump after all rtl has been unshared.
6756 @item -fdump-rtl-vartrack
6757 @opindex fdump-rtl-vartrack
6758 Dump after variable tracking.
6760 @item -fdump-rtl-vregs
6761 @opindex fdump-rtl-vregs
6762 Dump after converting virtual registers to hard registers.
6764 @item -fdump-rtl-web
6765 @opindex fdump-rtl-web
6766 Dump after live range splitting.
6768 @item -fdump-rtl-regclass
6769 @itemx -fdump-rtl-subregs_of_mode_init
6770 @itemx -fdump-rtl-subregs_of_mode_finish
6771 @itemx -fdump-rtl-dfinit
6772 @itemx -fdump-rtl-dfinish
6773 @opindex fdump-rtl-regclass
6774 @opindex fdump-rtl-subregs_of_mode_init
6775 @opindex fdump-rtl-subregs_of_mode_finish
6776 @opindex fdump-rtl-dfinit
6777 @opindex fdump-rtl-dfinish
6778 These dumps are defined but always produce empty files.
6780 @item -da
6781 @itemx -fdump-rtl-all
6782 @opindex da
6783 @opindex fdump-rtl-all
6784 Produce all the dumps listed above.
6786 @item -dA
6787 @opindex dA
6788 Annotate the assembler output with miscellaneous debugging information.
6790 @item -dD
6791 @opindex dD
6792 Dump all macro definitions, at the end of preprocessing, in addition to
6793 normal output.
6795 @item -dH
6796 @opindex dH
6797 Produce a core dump whenever an error occurs.
6799 @item -dp
6800 @opindex dp
6801 Annotate the assembler output with a comment indicating which
6802 pattern and alternative is used.  The length of each instruction is
6803 also printed.
6805 @item -dP
6806 @opindex dP
6807 Dump the RTL in the assembler output as a comment before each instruction.
6808 Also turns on @option{-dp} annotation.
6810 @item -dx
6811 @opindex dx
6812 Just generate RTL for a function instead of compiling it.  Usually used
6813 with @option{-fdump-rtl-expand}.
6814 @end table
6816 @item -fdump-noaddr
6817 @opindex fdump-noaddr
6818 When doing debugging dumps, suppress address output.  This makes it more
6819 feasible to use diff on debugging dumps for compiler invocations with
6820 different compiler binaries and/or different
6821 text / bss / data / heap / stack / dso start locations.
6823 @item -freport-bug
6824 @opindex freport-bug
6825 Collect and dump debug information into temporary file if ICE in C/C++
6826 compiler occured.
6828 @item -fdump-unnumbered
6829 @opindex fdump-unnumbered
6830 When doing debugging dumps, suppress instruction numbers and address output.
6831 This makes it more feasible to use diff on debugging dumps for compiler
6832 invocations with different options, in particular with and without
6833 @option{-g}.
6835 @item -fdump-unnumbered-links
6836 @opindex fdump-unnumbered-links
6837 When doing debugging dumps (see @option{-d} option above), suppress
6838 instruction numbers for the links to the previous and next instructions
6839 in a sequence.
6841 @item -fdump-translation-unit @r{(C++ only)}
6842 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
6843 @opindex fdump-translation-unit
6844 Dump a representation of the tree structure for the entire translation
6845 unit to a file.  The file name is made by appending @file{.tu} to the
6846 source file name, and the file is created in the same directory as the
6847 output file.  If the @samp{-@var{options}} form is used, @var{options}
6848 controls the details of the dump as described for the
6849 @option{-fdump-tree} options.
6851 @item -fdump-class-hierarchy @r{(C++ only)}
6852 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
6853 @opindex fdump-class-hierarchy
6854 Dump a representation of each class's hierarchy and virtual function
6855 table layout to a file.  The file name is made by appending
6856 @file{.class} to the source file name, and the file is created in the
6857 same directory as the output file.  If the @samp{-@var{options}} form
6858 is used, @var{options} controls the details of the dump as described
6859 for the @option{-fdump-tree} options.
6861 @item -fdump-ipa-@var{switch}
6862 @opindex fdump-ipa
6863 Control the dumping at various stages of inter-procedural analysis
6864 language tree to a file.  The file name is generated by appending a
6865 switch specific suffix to the source file name, and the file is created
6866 in the same directory as the output file.  The following dumps are
6867 possible:
6869 @table @samp
6870 @item all
6871 Enables all inter-procedural analysis dumps.
6873 @item cgraph
6874 Dumps information about call-graph optimization, unused function removal,
6875 and inlining decisions.
6877 @item inline
6878 Dump after function inlining.
6880 @end table
6882 @item -fdump-passes
6883 @opindex fdump-passes
6884 Dump the list of optimization passes that are turned on and off by
6885 the current command-line options.
6887 @item -fdump-statistics-@var{option}
6888 @opindex fdump-statistics
6889 Enable and control dumping of pass statistics in a separate file.  The
6890 file name is generated by appending a suffix ending in
6891 @samp{.statistics} to the source file name, and the file is created in
6892 the same directory as the output file.  If the @samp{-@var{option}}
6893 form is used, @samp{-stats} causes counters to be summed over the
6894 whole compilation unit while @samp{-details} dumps every event as
6895 the passes generate them.  The default with no option is to sum
6896 counters for each function compiled.
6898 @item -fdump-tree-@var{switch}
6899 @itemx -fdump-tree-@var{switch}-@var{options}
6900 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
6901 @opindex fdump-tree
6902 Control the dumping at various stages of processing the intermediate
6903 language tree to a file.  The file name is generated by appending a
6904 switch-specific suffix to the source file name, and the file is
6905 created in the same directory as the output file. In case of
6906 @option{=@var{filename}} option, the dump is output on the given file
6907 instead of the auto named dump files.  If the @samp{-@var{options}}
6908 form is used, @var{options} is a list of @samp{-} separated options
6909 which control the details of the dump.  Not all options are applicable
6910 to all dumps; those that are not meaningful are ignored.  The
6911 following options are available
6913 @table @samp
6914 @item address
6915 Print the address of each node.  Usually this is not meaningful as it
6916 changes according to the environment and source file.  Its primary use
6917 is for tying up a dump file with a debug environment.
6918 @item asmname
6919 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
6920 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
6921 use working backward from mangled names in the assembly file.
6922 @item slim
6923 When dumping front-end intermediate representations, inhibit dumping
6924 of members of a scope or body of a function merely because that scope
6925 has been reached.  Only dump such items when they are directly reachable
6926 by some other path.
6928 When dumping pretty-printed trees, this option inhibits dumping the
6929 bodies of control structures.
6931 When dumping RTL, print the RTL in slim (condensed) form instead of
6932 the default LISP-like representation.
6933 @item raw
6934 Print a raw representation of the tree.  By default, trees are
6935 pretty-printed into a C-like representation.
6936 @item details
6937 Enable more detailed dumps (not honored by every dump option). Also
6938 include information from the optimization passes.
6939 @item stats
6940 Enable dumping various statistics about the pass (not honored by every dump
6941 option).
6942 @item blocks
6943 Enable showing basic block boundaries (disabled in raw dumps).
6944 @item graph
6945 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
6946 dump a representation of the control flow graph suitable for viewing with
6947 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
6948 the file is pretty-printed as a subgraph, so that GraphViz can render them
6949 all in a single plot.
6951 This option currently only works for RTL dumps, and the RTL is always
6952 dumped in slim form.
6953 @item vops
6954 Enable showing virtual operands for every statement.
6955 @item lineno
6956 Enable showing line numbers for statements.
6957 @item uid
6958 Enable showing the unique ID (@code{DECL_UID}) for each variable.
6959 @item verbose
6960 Enable showing the tree dump for each statement.
6961 @item eh
6962 Enable showing the EH region number holding each statement.
6963 @item scev
6964 Enable showing scalar evolution analysis details.
6965 @item optimized
6966 Enable showing optimization information (only available in certain
6967 passes).
6968 @item missed
6969 Enable showing missed optimization information (only available in certain
6970 passes).
6971 @item note
6972 Enable other detailed optimization information (only available in
6973 certain passes).
6974 @item =@var{filename}
6975 Instead of an auto named dump file, output into the given file
6976 name. The file names @file{stdout} and @file{stderr} are treated
6977 specially and are considered already open standard streams. For
6978 example,
6980 @smallexample
6981 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
6982      -fdump-tree-pre=stderr file.c
6983 @end smallexample
6985 outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
6986 output on to @file{stderr}. If two conflicting dump filenames are
6987 given for the same pass, then the latter option overrides the earlier
6988 one.
6990 @item all
6991 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
6992 and @option{lineno}.
6994 @item optall
6995 Turn on all optimization options, i.e., @option{optimized},
6996 @option{missed}, and @option{note}.
6997 @end table
6999 The following tree dumps are possible:
7000 @table @samp
7002 @item original
7003 @opindex fdump-tree-original
7004 Dump before any tree based optimization, to @file{@var{file}.original}.
7006 @item optimized
7007 @opindex fdump-tree-optimized
7008 Dump after all tree based optimization, to @file{@var{file}.optimized}.
7010 @item gimple
7011 @opindex fdump-tree-gimple
7012 Dump each function before and after the gimplification pass to a file.  The
7013 file name is made by appending @file{.gimple} to the source file name.
7015 @item cfg
7016 @opindex fdump-tree-cfg
7017 Dump the control flow graph of each function to a file.  The file name is
7018 made by appending @file{.cfg} to the source file name.
7020 @item ch
7021 @opindex fdump-tree-ch
7022 Dump each function after copying loop headers.  The file name is made by
7023 appending @file{.ch} to the source file name.
7025 @item ssa
7026 @opindex fdump-tree-ssa
7027 Dump SSA related information to a file.  The file name is made by appending
7028 @file{.ssa} to the source file name.
7030 @item alias
7031 @opindex fdump-tree-alias
7032 Dump aliasing information for each function.  The file name is made by
7033 appending @file{.alias} to the source file name.
7035 @item ccp
7036 @opindex fdump-tree-ccp
7037 Dump each function after CCP@.  The file name is made by appending
7038 @file{.ccp} to the source file name.
7040 @item storeccp
7041 @opindex fdump-tree-storeccp
7042 Dump each function after STORE-CCP@.  The file name is made by appending
7043 @file{.storeccp} to the source file name.
7045 @item pre
7046 @opindex fdump-tree-pre
7047 Dump trees after partial redundancy elimination.  The file name is made
7048 by appending @file{.pre} to the source file name.
7050 @item fre
7051 @opindex fdump-tree-fre
7052 Dump trees after full redundancy elimination.  The file name is made
7053 by appending @file{.fre} to the source file name.
7055 @item copyprop
7056 @opindex fdump-tree-copyprop
7057 Dump trees after copy propagation.  The file name is made
7058 by appending @file{.copyprop} to the source file name.
7060 @item store_copyprop
7061 @opindex fdump-tree-store_copyprop
7062 Dump trees after store copy-propagation.  The file name is made
7063 by appending @file{.store_copyprop} to the source file name.
7065 @item dce
7066 @opindex fdump-tree-dce
7067 Dump each function after dead code elimination.  The file name is made by
7068 appending @file{.dce} to the source file name.
7070 @item sra
7071 @opindex fdump-tree-sra
7072 Dump each function after performing scalar replacement of aggregates.  The
7073 file name is made by appending @file{.sra} to the source file name.
7075 @item sink
7076 @opindex fdump-tree-sink
7077 Dump each function after performing code sinking.  The file name is made
7078 by appending @file{.sink} to the source file name.
7080 @item dom
7081 @opindex fdump-tree-dom
7082 Dump each function after applying dominator tree optimizations.  The file
7083 name is made by appending @file{.dom} to the source file name.
7085 @item dse
7086 @opindex fdump-tree-dse
7087 Dump each function after applying dead store elimination.  The file
7088 name is made by appending @file{.dse} to the source file name.
7090 @item phiopt
7091 @opindex fdump-tree-phiopt
7092 Dump each function after optimizing PHI nodes into straightline code.  The file
7093 name is made by appending @file{.phiopt} to the source file name.
7095 @item forwprop
7096 @opindex fdump-tree-forwprop
7097 Dump each function after forward propagating single use variables.  The file
7098 name is made by appending @file{.forwprop} to the source file name.
7100 @item nrv
7101 @opindex fdump-tree-nrv
7102 Dump each function after applying the named return value optimization on
7103 generic trees.  The file name is made by appending @file{.nrv} to the source
7104 file name.
7106 @item vect
7107 @opindex fdump-tree-vect
7108 Dump each function after applying vectorization of loops.  The file name is
7109 made by appending @file{.vect} to the source file name.
7111 @item slp
7112 @opindex fdump-tree-slp
7113 Dump each function after applying vectorization of basic blocks.  The file name
7114 is made by appending @file{.slp} to the source file name.
7116 @item vrp
7117 @opindex fdump-tree-vrp
7118 Dump each function after Value Range Propagation (VRP).  The file name
7119 is made by appending @file{.vrp} to the source file name.
7121 @item all
7122 @opindex fdump-tree-all
7123 Enable all the available tree dumps with the flags provided in this option.
7124 @end table
7126 @item -fopt-info
7127 @itemx -fopt-info-@var{options}
7128 @itemx -fopt-info-@var{options}=@var{filename}
7129 @opindex fopt-info
7130 Controls optimization dumps from various optimization passes. If the
7131 @samp{-@var{options}} form is used, @var{options} is a list of
7132 @samp{-} separated option keywords to select the dump details and
7133 optimizations.  
7135 The @var{options} can be divided into two groups: options describing the
7136 verbosity of the dump, and options describing which optimizations
7137 should be included. The options from both the groups can be freely
7138 mixed as they are non-overlapping. However, in case of any conflicts,
7139 the later options override the earlier options on the command
7140 line. 
7142 The following options control the dump verbosity:
7144 @table @samp
7145 @item optimized
7146 Print information when an optimization is successfully applied. It is
7147 up to a pass to decide which information is relevant. For example, the
7148 vectorizer passes print the source location of loops which are
7149 successfully vectorized.
7150 @item missed
7151 Print information about missed optimizations. Individual passes
7152 control which information to include in the output. 
7153 @item note
7154 Print verbose information about optimizations, such as certain
7155 transformations, more detailed messages about decisions etc.
7156 @item all
7157 Print detailed optimization information. This includes
7158 @samp{optimized}, @samp{missed}, and @samp{note}.
7159 @end table
7161 One or more of the following option keywords can be used to describe a
7162 group of optimizations:
7164 @table @samp
7165 @item ipa
7166 Enable dumps from all interprocedural optimizations.
7167 @item loop
7168 Enable dumps from all loop optimizations.
7169 @item inline
7170 Enable dumps from all inlining optimizations.
7171 @item vec
7172 Enable dumps from all vectorization optimizations.
7173 @item optall
7174 Enable dumps from all optimizations. This is a superset of
7175 the optimization groups listed above.
7176 @end table
7178 If @var{options} is
7179 omitted, it defaults to @samp{optimized-optall}, which means to dump all
7180 info about successful optimizations from all the passes.  
7182 If the @var{filename} is provided, then the dumps from all the
7183 applicable optimizations are concatenated into the @var{filename}.
7184 Otherwise the dump is output onto @file{stderr}. Though multiple
7185 @option{-fopt-info} options are accepted, only one of them can include
7186 a @var{filename}. If other filenames are provided then all but the
7187 first such option are ignored.
7189 Note that the output @var{filename} is overwritten
7190 in case of multiple translation units. If a combined output from
7191 multiple translation units is desired, @file{stderr} should be used
7192 instead.
7194 In the following example, the optimization info is output to
7195 @file{stderr}:
7197 @smallexample
7198 gcc -O3 -fopt-info
7199 @end smallexample
7201 This example:
7202 @smallexample
7203 gcc -O3 -fopt-info-missed=missed.all
7204 @end smallexample
7206 @noindent
7207 outputs missed optimization report from all the passes into
7208 @file{missed.all}, and this one:
7210 @smallexample
7211 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
7212 @end smallexample
7214 @noindent
7215 prints information about missed optimization opportunities from
7216 vectorization passes on @file{stderr}.  
7217 Note that @option{-fopt-info-vec-missed} is equivalent to 
7218 @option{-fopt-info-missed-vec}.
7220 As another example,
7221 @smallexample
7222 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
7223 @end smallexample
7225 @noindent
7226 outputs information about missed optimizations as well as
7227 optimized locations from all the inlining passes into
7228 @file{inline.txt}.
7230 Finally, consider:
7232 @smallexample
7233 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
7234 @end smallexample
7236 @noindent
7237 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
7238 in conflict since only one output file is allowed. In this case, only
7239 the first option takes effect and the subsequent options are
7240 ignored. Thus only @file{vec.miss} is produced which contains
7241 dumps from the vectorizer about missed opportunities.
7243 @item -frandom-seed=@var{number}
7244 @opindex frandom-seed
7245 This option provides a seed that GCC uses in place of
7246 random numbers in generating certain symbol names
7247 that have to be different in every compiled file.  It is also used to
7248 place unique stamps in coverage data files and the object files that
7249 produce them.  You can use the @option{-frandom-seed} option to produce
7250 reproducibly identical object files.
7252 The @var{number} should be different for every file you compile.
7254 @item -fsched-verbose=@var{n}
7255 @opindex fsched-verbose
7256 On targets that use instruction scheduling, this option controls the
7257 amount of debugging output the scheduler prints.  This information is
7258 written to standard error, unless @option{-fdump-rtl-sched1} or
7259 @option{-fdump-rtl-sched2} is specified, in which case it is output
7260 to the usual dump listing file, @file{.sched1} or @file{.sched2}
7261 respectively.  However for @var{n} greater than nine, the output is
7262 always printed to standard error.
7264 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
7265 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
7266 For @var{n} greater than one, it also output basic block probabilities,
7267 detailed ready list information and unit/insn info.  For @var{n} greater
7268 than two, it includes RTL at abort point, control-flow and regions info.
7269 And for @var{n} over four, @option{-fsched-verbose} also includes
7270 dependence info.
7272 @item -save-temps
7273 @itemx -save-temps=cwd
7274 @opindex save-temps
7275 Store the usual ``temporary'' intermediate files permanently; place them
7276 in the current directory and name them based on the source file.  Thus,
7277 compiling @file{foo.c} with @option{-c -save-temps} produces files
7278 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
7279 preprocessed @file{foo.i} output file even though the compiler now
7280 normally uses an integrated preprocessor.
7282 When used in combination with the @option{-x} command-line option,
7283 @option{-save-temps} is sensible enough to avoid over writing an
7284 input source file with the same extension as an intermediate file.
7285 The corresponding intermediate file may be obtained by renaming the
7286 source file before using @option{-save-temps}.
7288 If you invoke GCC in parallel, compiling several different source
7289 files that share a common base name in different subdirectories or the
7290 same source file compiled for multiple output destinations, it is
7291 likely that the different parallel compilers will interfere with each
7292 other, and overwrite the temporary files.  For instance:
7294 @smallexample
7295 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
7296 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
7297 @end smallexample
7299 may result in @file{foo.i} and @file{foo.o} being written to
7300 simultaneously by both compilers.
7302 @item -save-temps=obj
7303 @opindex save-temps=obj
7304 Store the usual ``temporary'' intermediate files permanently.  If the
7305 @option{-o} option is used, the temporary files are based on the
7306 object file.  If the @option{-o} option is not used, the
7307 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
7309 For example:
7311 @smallexample
7312 gcc -save-temps=obj -c foo.c
7313 gcc -save-temps=obj -c bar.c -o dir/xbar.o
7314 gcc -save-temps=obj foobar.c -o dir2/yfoobar
7315 @end smallexample
7317 @noindent
7318 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
7319 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
7320 @file{dir2/yfoobar.o}.
7322 @item -time@r{[}=@var{file}@r{]}
7323 @opindex time
7324 Report the CPU time taken by each subprocess in the compilation
7325 sequence.  For C source files, this is the compiler proper and assembler
7326 (plus the linker if linking is done).
7328 Without the specification of an output file, the output looks like this:
7330 @smallexample
7331 # cc1 0.12 0.01
7332 # as 0.00 0.01
7333 @end smallexample
7335 The first number on each line is the ``user time'', that is time spent
7336 executing the program itself.  The second number is ``system time'',
7337 time spent executing operating system routines on behalf of the program.
7338 Both numbers are in seconds.
7340 With the specification of an output file, the output is appended to the
7341 named file, and it looks like this:
7343 @smallexample
7344 0.12 0.01 cc1 @var{options}
7345 0.00 0.01 as @var{options}
7346 @end smallexample
7348 The ``user time'' and the ``system time'' are moved before the program
7349 name, and the options passed to the program are displayed, so that one
7350 can later tell what file was being compiled, and with which options.
7352 @item -fvar-tracking
7353 @opindex fvar-tracking
7354 Run variable tracking pass.  It computes where variables are stored at each
7355 position in code.  Better debugging information is then generated
7356 (if the debugging information format supports this information).
7358 It is enabled by default when compiling with optimization (@option{-Os},
7359 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
7360 the debug info format supports it.
7362 @item -fvar-tracking-assignments
7363 @opindex fvar-tracking-assignments
7364 @opindex fno-var-tracking-assignments
7365 Annotate assignments to user variables early in the compilation and
7366 attempt to carry the annotations over throughout the compilation all the
7367 way to the end, in an attempt to improve debug information while
7368 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
7370 It can be enabled even if var-tracking is disabled, in which case
7371 annotations are created and maintained, but discarded at the end.
7372 By default, this flag is enabled together with @option{-fvar-tracking},
7373 except when selective scheduling is enabled.
7375 @item -fvar-tracking-assignments-toggle
7376 @opindex fvar-tracking-assignments-toggle
7377 @opindex fno-var-tracking-assignments-toggle
7378 Toggle @option{-fvar-tracking-assignments}, in the same way that
7379 @option{-gtoggle} toggles @option{-g}.
7381 @item -print-file-name=@var{library}
7382 @opindex print-file-name
7383 Print the full absolute name of the library file @var{library} that
7384 would be used when linking---and don't do anything else.  With this
7385 option, GCC does not compile or link anything; it just prints the
7386 file name.
7388 @item -print-multi-directory
7389 @opindex print-multi-directory
7390 Print the directory name corresponding to the multilib selected by any
7391 other switches present in the command line.  This directory is supposed
7392 to exist in @env{GCC_EXEC_PREFIX}.
7394 @item -print-multi-lib
7395 @opindex print-multi-lib
7396 Print the mapping from multilib directory names to compiler switches
7397 that enable them.  The directory name is separated from the switches by
7398 @samp{;}, and each switch starts with an @samp{@@} instead of the
7399 @samp{-}, without spaces between multiple switches.  This is supposed to
7400 ease shell processing.
7402 @item -print-multi-os-directory
7403 @opindex print-multi-os-directory
7404 Print the path to OS libraries for the selected
7405 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
7406 present in the @file{lib} subdirectory and no multilibs are used, this is
7407 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
7408 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
7409 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
7410 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
7412 @item -print-multiarch
7413 @opindex print-multiarch
7414 Print the path to OS libraries for the selected multiarch,
7415 relative to some @file{lib} subdirectory.
7417 @item -print-prog-name=@var{program}
7418 @opindex print-prog-name
7419 Like @option{-print-file-name}, but searches for a program such as @command{cpp}.
7421 @item -print-libgcc-file-name
7422 @opindex print-libgcc-file-name
7423 Same as @option{-print-file-name=libgcc.a}.
7425 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
7426 but you do want to link with @file{libgcc.a}.  You can do:
7428 @smallexample
7429 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
7430 @end smallexample
7432 @item -print-search-dirs
7433 @opindex print-search-dirs
7434 Print the name of the configured installation directory and a list of
7435 program and library directories @command{gcc} searches---and don't do anything else.
7437 This is useful when @command{gcc} prints the error message
7438 @samp{installation problem, cannot exec cpp0: No such file or directory}.
7439 To resolve this you either need to put @file{cpp0} and the other compiler
7440 components where @command{gcc} expects to find them, or you can set the environment
7441 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
7442 Don't forget the trailing @samp{/}.
7443 @xref{Environment Variables}.
7445 @item -print-sysroot
7446 @opindex print-sysroot
7447 Print the target sysroot directory that is used during
7448 compilation.  This is the target sysroot specified either at configure
7449 time or using the @option{--sysroot} option, possibly with an extra
7450 suffix that depends on compilation options.  If no target sysroot is
7451 specified, the option prints nothing.
7453 @item -print-sysroot-headers-suffix
7454 @opindex print-sysroot-headers-suffix
7455 Print the suffix added to the target sysroot when searching for
7456 headers, or give an error if the compiler is not configured with such
7457 a suffix---and don't do anything else.
7459 @item -dumpmachine
7460 @opindex dumpmachine
7461 Print the compiler's target machine (for example,
7462 @samp{i686-pc-linux-gnu})---and don't do anything else.
7464 @item -dumpversion
7465 @opindex dumpversion
7466 Print the compiler version (for example, @code{3.0})---and don't do
7467 anything else.
7469 @item -dumpspecs
7470 @opindex dumpspecs
7471 Print the compiler's built-in specs---and don't do anything else.  (This
7472 is used when GCC itself is being built.)  @xref{Spec Files}.
7474 @item -fno-eliminate-unused-debug-types
7475 @opindex feliminate-unused-debug-types
7476 @opindex fno-eliminate-unused-debug-types
7477 Normally, when producing DWARF 2 output, GCC avoids producing debug symbol 
7478 output for types that are nowhere used in the source file being compiled.
7479 Sometimes it is useful to have GCC emit debugging
7480 information for all types declared in a compilation
7481 unit, regardless of whether or not they are actually used
7482 in that compilation unit, for example 
7483 if, in the debugger, you want to cast a value to a type that is
7484 not actually used in your program (but is declared).  More often,
7485 however, this results in a significant amount of wasted space.
7486 @end table
7488 @node Optimize Options
7489 @section Options That Control Optimization
7490 @cindex optimize options
7491 @cindex options, optimization
7493 These options control various sorts of optimizations.
7495 Without any optimization option, the compiler's goal is to reduce the
7496 cost of compilation and to make debugging produce the expected
7497 results.  Statements are independent: if you stop the program with a
7498 breakpoint between statements, you can then assign a new value to any
7499 variable or change the program counter to any other statement in the
7500 function and get exactly the results you expect from the source
7501 code.
7503 Turning on optimization flags makes the compiler attempt to improve
7504 the performance and/or code size at the expense of compilation time
7505 and possibly the ability to debug the program.
7507 The compiler performs optimization based on the knowledge it has of the
7508 program.  Compiling multiple files at once to a single output file mode allows
7509 the compiler to use information gained from all of the files when compiling
7510 each of them.
7512 Not all optimizations are controlled directly by a flag.  Only
7513 optimizations that have a flag are listed in this section.
7515 Most optimizations are only enabled if an @option{-O} level is set on
7516 the command line.  Otherwise they are disabled, even if individual
7517 optimization flags are specified.
7519 Depending on the target and how GCC was configured, a slightly different
7520 set of optimizations may be enabled at each @option{-O} level than
7521 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
7522 to find out the exact set of optimizations that are enabled at each level.
7523 @xref{Overall Options}, for examples.
7525 @table @gcctabopt
7526 @item -O
7527 @itemx -O1
7528 @opindex O
7529 @opindex O1
7530 Optimize.  Optimizing compilation takes somewhat more time, and a lot
7531 more memory for a large function.
7533 With @option{-O}, the compiler tries to reduce code size and execution
7534 time, without performing any optimizations that take a great deal of
7535 compilation time.
7537 @option{-O} turns on the following optimization flags:
7538 @gccoptlist{
7539 -fauto-inc-dec @gol
7540 -fbranch-count-reg @gol
7541 -fcombine-stack-adjustments @gol
7542 -fcompare-elim @gol
7543 -fcprop-registers @gol
7544 -fdce @gol
7545 -fdefer-pop @gol
7546 -fdelayed-branch @gol
7547 -fdse @gol
7548 -fforward-propagate @gol
7549 -fguess-branch-probability @gol
7550 -fif-conversion2 @gol
7551 -fif-conversion @gol
7552 -finline-functions-called-once @gol
7553 -fipa-pure-const @gol
7554 -fipa-profile @gol
7555 -fipa-reference @gol
7556 -fmerge-constants @gol
7557 -fmove-loop-invariants @gol
7558 -fshrink-wrap @gol
7559 -fsplit-wide-types @gol
7560 -ftree-bit-ccp @gol
7561 -ftree-ccp @gol
7562 -fssa-phiopt @gol
7563 -ftree-ch @gol
7564 -ftree-coalesce-vars @gol
7565 -ftree-copy-prop @gol
7566 -ftree-dce @gol
7567 -ftree-dominator-opts @gol
7568 -ftree-dse @gol
7569 -ftree-forwprop @gol
7570 -ftree-fre @gol
7571 -ftree-phiprop @gol
7572 -ftree-sink @gol
7573 -ftree-slsr @gol
7574 -ftree-sra @gol
7575 -ftree-pta @gol
7576 -ftree-ter @gol
7577 -funit-at-a-time}
7579 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
7580 where doing so does not interfere with debugging.
7582 @item -O2
7583 @opindex O2
7584 Optimize even more.  GCC performs nearly all supported optimizations
7585 that do not involve a space-speed tradeoff.
7586 As compared to @option{-O}, this option increases both compilation time
7587 and the performance of the generated code.
7589 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
7590 also turns on the following optimization flags:
7591 @gccoptlist{-fthread-jumps @gol
7592 -falign-functions  -falign-jumps @gol
7593 -falign-loops  -falign-labels @gol
7594 -fcaller-saves @gol
7595 -fcrossjumping @gol
7596 -fcse-follow-jumps  -fcse-skip-blocks @gol
7597 -fdelete-null-pointer-checks @gol
7598 -fdevirtualize -fdevirtualize-speculatively @gol
7599 -fexpensive-optimizations @gol
7600 -fgcse  -fgcse-lm  @gol
7601 -fhoist-adjacent-loads @gol
7602 -finline-small-functions @gol
7603 -findirect-inlining @gol
7604 -fipa-cp @gol
7605 -fipa-cp-alignment @gol
7606 -fipa-sra @gol
7607 -fipa-icf @gol
7608 -fisolate-erroneous-paths-dereference @gol
7609 -flra-remat @gol
7610 -foptimize-sibling-calls @gol
7611 -foptimize-strlen @gol
7612 -fpartial-inlining @gol
7613 -fpeephole2 @gol
7614 -freorder-blocks -freorder-blocks-and-partition -freorder-functions @gol
7615 -frerun-cse-after-loop  @gol
7616 -fsched-interblock  -fsched-spec @gol
7617 -fschedule-insns  -fschedule-insns2 @gol
7618 -fstrict-aliasing -fstrict-overflow @gol
7619 -ftree-builtin-call-dce @gol
7620 -ftree-switch-conversion -ftree-tail-merge @gol
7621 -ftree-pre @gol
7622 -ftree-vrp @gol
7623 -fipa-ra}
7625 Please note the warning under @option{-fgcse} about
7626 invoking @option{-O2} on programs that use computed gotos.
7628 @item -O3
7629 @opindex O3
7630 Optimize yet more.  @option{-O3} turns on all optimizations specified
7631 by @option{-O2} and also turns on the @option{-finline-functions},
7632 @option{-funswitch-loops}, @option{-fpredictive-commoning},
7633 @option{-fgcse-after-reload}, @option{-ftree-loop-vectorize},
7634 @option{-ftree-loop-distribute-patterns},
7635 @option{-ftree-slp-vectorize}, @option{-fvect-cost-model},
7636 @option{-ftree-partial-pre} and @option{-fipa-cp-clone} options.
7638 @item -O0
7639 @opindex O0
7640 Reduce compilation time and make debugging produce the expected
7641 results.  This is the default.
7643 @item -Os
7644 @opindex Os
7645 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
7646 do not typically increase code size.  It also performs further
7647 optimizations designed to reduce code size.
7649 @option{-Os} disables the following optimization flags:
7650 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
7651 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
7652 -fprefetch-loop-arrays}
7654 @item -Ofast
7655 @opindex Ofast
7656 Disregard strict standards compliance.  @option{-Ofast} enables all
7657 @option{-O3} optimizations.  It also enables optimizations that are not
7658 valid for all standard-compliant programs.
7659 It turns on @option{-ffast-math} and the Fortran-specific
7660 @option{-fno-protect-parens} and @option{-fstack-arrays}.
7662 @item -Og
7663 @opindex Og
7664 Optimize debugging experience.  @option{-Og} enables optimizations
7665 that do not interfere with debugging. It should be the optimization
7666 level of choice for the standard edit-compile-debug cycle, offering
7667 a reasonable level of optimization while maintaining fast compilation
7668 and a good debugging experience.
7670 If you use multiple @option{-O} options, with or without level numbers,
7671 the last such option is the one that is effective.
7672 @end table
7674 Options of the form @option{-f@var{flag}} specify machine-independent
7675 flags.  Most flags have both positive and negative forms; the negative
7676 form of @option{-ffoo} is @option{-fno-foo}.  In the table
7677 below, only one of the forms is listed---the one you typically 
7678 use.  You can figure out the other form by either removing @samp{no-}
7679 or adding it.
7681 The following options control specific optimizations.  They are either
7682 activated by @option{-O} options or are related to ones that are.  You
7683 can use the following flags in the rare cases when ``fine-tuning'' of
7684 optimizations to be performed is desired.
7686 @table @gcctabopt
7687 @item -fno-defer-pop
7688 @opindex fno-defer-pop
7689 Always pop the arguments to each function call as soon as that function
7690 returns.  For machines that must pop arguments after a function call,
7691 the compiler normally lets arguments accumulate on the stack for several
7692 function calls and pops them all at once.
7694 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7696 @item -fforward-propagate
7697 @opindex fforward-propagate
7698 Perform a forward propagation pass on RTL@.  The pass tries to combine two
7699 instructions and checks if the result can be simplified.  If loop unrolling
7700 is active, two passes are performed and the second is scheduled after
7701 loop unrolling.
7703 This option is enabled by default at optimization levels @option{-O},
7704 @option{-O2}, @option{-O3}, @option{-Os}.
7706 @item -ffp-contract=@var{style}
7707 @opindex ffp-contract
7708 @option{-ffp-contract=off} disables floating-point expression contraction.
7709 @option{-ffp-contract=fast} enables floating-point expression contraction
7710 such as forming of fused multiply-add operations if the target has
7711 native support for them.
7712 @option{-ffp-contract=on} enables floating-point expression contraction
7713 if allowed by the language standard.  This is currently not implemented
7714 and treated equal to @option{-ffp-contract=off}.
7716 The default is @option{-ffp-contract=fast}.
7718 @item -fomit-frame-pointer
7719 @opindex fomit-frame-pointer
7720 Don't keep the frame pointer in a register for functions that
7721 don't need one.  This avoids the instructions to save, set up and
7722 restore frame pointers; it also makes an extra register available
7723 in many functions.  @strong{It also makes debugging impossible on
7724 some machines.}
7726 On some machines, such as the VAX, this flag has no effect, because
7727 the standard calling sequence automatically handles the frame pointer
7728 and nothing is saved by pretending it doesn't exist.  The
7729 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
7730 whether a target machine supports this flag.  @xref{Registers,,Register
7731 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
7733 The default setting (when not optimizing for
7734 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets is
7735 @option{-fomit-frame-pointer}.  You can configure GCC with the
7736 @option{--enable-frame-pointer} configure option to change the default.
7738 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7740 @item -foptimize-sibling-calls
7741 @opindex foptimize-sibling-calls
7742 Optimize sibling and tail recursive calls.
7744 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7746 @item -foptimize-strlen
7747 @opindex foptimize-strlen
7748 Optimize various standard C string functions (e.g. @code{strlen},
7749 @code{strchr} or @code{strcpy}) and
7750 their @code{_FORTIFY_SOURCE} counterparts into faster alternatives.
7752 Enabled at levels @option{-O2}, @option{-O3}.
7754 @item -fno-inline
7755 @opindex fno-inline
7756 Do not expand any functions inline apart from those marked with
7757 the @code{always_inline} attribute.  This is the default when not
7758 optimizing.
7760 Single functions can be exempted from inlining by marking them
7761 with the @code{noinline} attribute.
7763 @item -finline-small-functions
7764 @opindex finline-small-functions
7765 Integrate functions into their callers when their body is smaller than expected
7766 function call code (so overall size of program gets smaller).  The compiler
7767 heuristically decides which functions are simple enough to be worth integrating
7768 in this way.  This inlining applies to all functions, even those not declared
7769 inline.
7771 Enabled at level @option{-O2}.
7773 @item -findirect-inlining
7774 @opindex findirect-inlining
7775 Inline also indirect calls that are discovered to be known at compile
7776 time thanks to previous inlining.  This option has any effect only
7777 when inlining itself is turned on by the @option{-finline-functions}
7778 or @option{-finline-small-functions} options.
7780 Enabled at level @option{-O2}.
7782 @item -finline-functions
7783 @opindex finline-functions
7784 Consider all functions for inlining, even if they are not declared inline.
7785 The compiler heuristically decides which functions are worth integrating
7786 in this way.
7788 If all calls to a given function are integrated, and the function is
7789 declared @code{static}, then the function is normally not output as
7790 assembler code in its own right.
7792 Enabled at level @option{-O3}.
7794 @item -finline-functions-called-once
7795 @opindex finline-functions-called-once
7796 Consider all @code{static} functions called once for inlining into their
7797 caller even if they are not marked @code{inline}.  If a call to a given
7798 function is integrated, then the function is not output as assembler code
7799 in its own right.
7801 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
7803 @item -fearly-inlining
7804 @opindex fearly-inlining
7805 Inline functions marked by @code{always_inline} and functions whose body seems
7806 smaller than the function call overhead early before doing
7807 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
7808 makes profiling significantly cheaper and usually inlining faster on programs
7809 having large chains of nested wrapper functions.
7811 Enabled by default.
7813 @item -fipa-sra
7814 @opindex fipa-sra
7815 Perform interprocedural scalar replacement of aggregates, removal of
7816 unused parameters and replacement of parameters passed by reference
7817 by parameters passed by value.
7819 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
7821 @item -finline-limit=@var{n}
7822 @opindex finline-limit
7823 By default, GCC limits the size of functions that can be inlined.  This flag
7824 allows coarse control of this limit.  @var{n} is the size of functions that
7825 can be inlined in number of pseudo instructions.
7827 Inlining is actually controlled by a number of parameters, which may be
7828 specified individually by using @option{--param @var{name}=@var{value}}.
7829 The @option{-finline-limit=@var{n}} option sets some of these parameters
7830 as follows:
7832 @table @gcctabopt
7833 @item max-inline-insns-single
7834 is set to @var{n}/2.
7835 @item max-inline-insns-auto
7836 is set to @var{n}/2.
7837 @end table
7839 See below for a documentation of the individual
7840 parameters controlling inlining and for the defaults of these parameters.
7842 @emph{Note:} there may be no value to @option{-finline-limit} that results
7843 in default behavior.
7845 @emph{Note:} pseudo instruction represents, in this particular context, an
7846 abstract measurement of function's size.  In no way does it represent a count
7847 of assembly instructions and as such its exact meaning might change from one
7848 release to an another.
7850 @item -fno-keep-inline-dllexport
7851 @opindex fno-keep-inline-dllexport
7852 This is a more fine-grained version of @option{-fkeep-inline-functions},
7853 which applies only to functions that are declared using the @code{dllexport}
7854 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
7855 Functions}.)
7857 @item -fkeep-inline-functions
7858 @opindex fkeep-inline-functions
7859 In C, emit @code{static} functions that are declared @code{inline}
7860 into the object file, even if the function has been inlined into all
7861 of its callers.  This switch does not affect functions using the
7862 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
7863 inline functions into the object file.
7865 @item -fkeep-static-consts
7866 @opindex fkeep-static-consts
7867 Emit variables declared @code{static const} when optimization isn't turned
7868 on, even if the variables aren't referenced.
7870 GCC enables this option by default.  If you want to force the compiler to
7871 check if a variable is referenced, regardless of whether or not
7872 optimization is turned on, use the @option{-fno-keep-static-consts} option.
7874 @item -fmerge-constants
7875 @opindex fmerge-constants
7876 Attempt to merge identical constants (string constants and floating-point
7877 constants) across compilation units.
7879 This option is the default for optimized compilation if the assembler and
7880 linker support it.  Use @option{-fno-merge-constants} to inhibit this
7881 behavior.
7883 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7885 @item -fmerge-all-constants
7886 @opindex fmerge-all-constants
7887 Attempt to merge identical constants and identical variables.
7889 This option implies @option{-fmerge-constants}.  In addition to
7890 @option{-fmerge-constants} this considers e.g.@: even constant initialized
7891 arrays or initialized constant variables with integral or floating-point
7892 types.  Languages like C or C++ require each variable, including multiple
7893 instances of the same variable in recursive calls, to have distinct locations,
7894 so using this option results in non-conforming
7895 behavior.
7897 @item -fmodulo-sched
7898 @opindex fmodulo-sched
7899 Perform swing modulo scheduling immediately before the first scheduling
7900 pass.  This pass looks at innermost loops and reorders their
7901 instructions by overlapping different iterations.
7903 @item -fmodulo-sched-allow-regmoves
7904 @opindex fmodulo-sched-allow-regmoves
7905 Perform more aggressive SMS-based modulo scheduling with register moves
7906 allowed.  By setting this flag certain anti-dependences edges are
7907 deleted, which triggers the generation of reg-moves based on the
7908 life-range analysis.  This option is effective only with
7909 @option{-fmodulo-sched} enabled.
7911 @item -fno-branch-count-reg
7912 @opindex fno-branch-count-reg
7913 Do not use ``decrement and branch'' instructions on a count register,
7914 but instead generate a sequence of instructions that decrement a
7915 register, compare it against zero, then branch based upon the result.
7916 This option is only meaningful on architectures that support such
7917 instructions, which include x86, PowerPC, IA-64 and S/390.
7919 Enabled by default at @option{-O1} and higher.
7921 The default is @option{-fbranch-count-reg}.
7923 @item -fno-function-cse
7924 @opindex fno-function-cse
7925 Do not put function addresses in registers; make each instruction that
7926 calls a constant function contain the function's address explicitly.
7928 This option results in less efficient code, but some strange hacks
7929 that alter the assembler output may be confused by the optimizations
7930 performed when this option is not used.
7932 The default is @option{-ffunction-cse}
7934 @item -fno-zero-initialized-in-bss
7935 @opindex fno-zero-initialized-in-bss
7936 If the target supports a BSS section, GCC by default puts variables that
7937 are initialized to zero into BSS@.  This can save space in the resulting
7938 code.
7940 This option turns off this behavior because some programs explicitly
7941 rely on variables going to the data section---e.g., so that the
7942 resulting executable can find the beginning of that section and/or make
7943 assumptions based on that.
7945 The default is @option{-fzero-initialized-in-bss}.
7947 @item -fthread-jumps
7948 @opindex fthread-jumps
7949 Perform optimizations that check to see if a jump branches to a
7950 location where another comparison subsumed by the first is found.  If
7951 so, the first branch is redirected to either the destination of the
7952 second branch or a point immediately following it, depending on whether
7953 the condition is known to be true or false.
7955 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7957 @item -fsplit-wide-types
7958 @opindex fsplit-wide-types
7959 When using a type that occupies multiple registers, such as @code{long
7960 long} on a 32-bit system, split the registers apart and allocate them
7961 independently.  This normally generates better code for those types,
7962 but may make debugging more difficult.
7964 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
7965 @option{-Os}.
7967 @item -fcse-follow-jumps
7968 @opindex fcse-follow-jumps
7969 In common subexpression elimination (CSE), scan through jump instructions
7970 when the target of the jump is not reached by any other path.  For
7971 example, when CSE encounters an @code{if} statement with an
7972 @code{else} clause, CSE follows the jump when the condition
7973 tested is false.
7975 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7977 @item -fcse-skip-blocks
7978 @opindex fcse-skip-blocks
7979 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
7980 follow jumps that conditionally skip over blocks.  When CSE
7981 encounters a simple @code{if} statement with no else clause,
7982 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
7983 body of the @code{if}.
7985 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7987 @item -frerun-cse-after-loop
7988 @opindex frerun-cse-after-loop
7989 Re-run common subexpression elimination after loop optimizations are
7990 performed.
7992 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7994 @item -fgcse
7995 @opindex fgcse
7996 Perform a global common subexpression elimination pass.
7997 This pass also performs global constant and copy propagation.
7999 @emph{Note:} When compiling a program using computed gotos, a GCC
8000 extension, you may get better run-time performance if you disable
8001 the global common subexpression elimination pass by adding
8002 @option{-fno-gcse} to the command line.
8004 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8006 @item -fgcse-lm
8007 @opindex fgcse-lm
8008 When @option{-fgcse-lm} is enabled, global common subexpression elimination
8009 attempts to move loads that are only killed by stores into themselves.  This
8010 allows a loop containing a load/store sequence to be changed to a load outside
8011 the loop, and a copy/store within the loop.
8013 Enabled by default when @option{-fgcse} is enabled.
8015 @item -fgcse-sm
8016 @opindex fgcse-sm
8017 When @option{-fgcse-sm} is enabled, a store motion pass is run after
8018 global common subexpression elimination.  This pass attempts to move
8019 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
8020 loops containing a load/store sequence can be changed to a load before
8021 the loop and a store after the loop.
8023 Not enabled at any optimization level.
8025 @item -fgcse-las
8026 @opindex fgcse-las
8027 When @option{-fgcse-las} is enabled, the global common subexpression
8028 elimination pass eliminates redundant loads that come after stores to the
8029 same memory location (both partial and full redundancies).
8031 Not enabled at any optimization level.
8033 @item -fgcse-after-reload
8034 @opindex fgcse-after-reload
8035 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
8036 pass is performed after reload.  The purpose of this pass is to clean up
8037 redundant spilling.
8039 @item -faggressive-loop-optimizations
8040 @opindex faggressive-loop-optimizations
8041 This option tells the loop optimizer to use language constraints to
8042 derive bounds for the number of iterations of a loop.  This assumes that
8043 loop code does not invoke undefined behavior by for example causing signed
8044 integer overflows or out-of-bound array accesses.  The bounds for the
8045 number of iterations of a loop are used to guide loop unrolling and peeling
8046 and loop exit test optimizations.
8047 This option is enabled by default.
8049 @item -funsafe-loop-optimizations
8050 @opindex funsafe-loop-optimizations
8051 This option tells the loop optimizer to assume that loop indices do not
8052 overflow, and that loops with nontrivial exit condition are not
8053 infinite.  This enables a wider range of loop optimizations even if
8054 the loop optimizer itself cannot prove that these assumptions are valid.
8055 If you use @option{-Wunsafe-loop-optimizations}, the compiler warns you
8056 if it finds this kind of loop.
8058 @item -fcrossjumping
8059 @opindex fcrossjumping
8060 Perform cross-jumping transformation.
8061 This transformation unifies equivalent code and saves code size.  The
8062 resulting code may or may not perform better than without cross-jumping.
8064 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8066 @item -fauto-inc-dec
8067 @opindex fauto-inc-dec
8068 Combine increments or decrements of addresses with memory accesses.
8069 This pass is always skipped on architectures that do not have
8070 instructions to support this.  Enabled by default at @option{-O} and
8071 higher on architectures that support this.
8073 @item -fdce
8074 @opindex fdce
8075 Perform dead code elimination (DCE) on RTL@.
8076 Enabled by default at @option{-O} and higher.
8078 @item -fdse
8079 @opindex fdse
8080 Perform dead store elimination (DSE) on RTL@.
8081 Enabled by default at @option{-O} and higher.
8083 @item -fif-conversion
8084 @opindex fif-conversion
8085 Attempt to transform conditional jumps into branch-less equivalents.  This
8086 includes use of conditional moves, min, max, set flags and abs instructions, and
8087 some tricks doable by standard arithmetics.  The use of conditional execution
8088 on chips where it is available is controlled by @option{-fif-conversion2}.
8090 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8092 @item -fif-conversion2
8093 @opindex fif-conversion2
8094 Use conditional execution (where available) to transform conditional jumps into
8095 branch-less equivalents.
8097 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8099 @item -fdeclone-ctor-dtor
8100 @opindex fdeclone-ctor-dtor
8101 The C++ ABI requires multiple entry points for constructors and
8102 destructors: one for a base subobject, one for a complete object, and
8103 one for a virtual destructor that calls operator delete afterwards.
8104 For a hierarchy with virtual bases, the base and complete variants are
8105 clones, which means two copies of the function.  With this option, the
8106 base and complete variants are changed to be thunks that call a common
8107 implementation.
8109 Enabled by @option{-Os}.
8111 @item -fdelete-null-pointer-checks
8112 @opindex fdelete-null-pointer-checks
8113 Assume that programs cannot safely dereference null pointers, and that
8114 no code or data element resides at address zero.
8115 This option enables simple constant
8116 folding optimizations at all optimization levels.  In addition, other
8117 optimization passes in GCC use this flag to control global dataflow
8118 analyses that eliminate useless checks for null pointers; these assume
8119 that a memory access to address zero always results in a trap, so
8120 that if a pointer is checked after it has already been dereferenced,
8121 it cannot be null.
8123 Note however that in some environments this assumption is not true.
8124 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
8125 for programs that depend on that behavior.
8127 This option is enabled by default on most targets.  On Nios II ELF, it
8128 defaults to off.  On AVR and CR16, this option is completely disabled.  
8130 Passes that use the dataflow information
8131 are enabled independently at different optimization levels.
8133 @item -fdevirtualize
8134 @opindex fdevirtualize
8135 Attempt to convert calls to virtual functions to direct calls.  This
8136 is done both within a procedure and interprocedurally as part of
8137 indirect inlining (@option{-findirect-inlining}) and interprocedural constant
8138 propagation (@option{-fipa-cp}).
8139 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8141 @item -fdevirtualize-speculatively
8142 @opindex fdevirtualize-speculatively
8143 Attempt to convert calls to virtual functions to speculative direct calls.
8144 Based on the analysis of the type inheritance graph, determine for a given call
8145 the set of likely targets. If the set is small, preferably of size 1, change
8146 the call into a conditional deciding between direct and indirect calls.  The
8147 speculative calls enable more optimizations, such as inlining.  When they seem
8148 useless after further optimization, they are converted back into original form.
8150 @item -fdevirtualize-at-ltrans
8151 @opindex fdevirtualize-at-ltrans
8152 Stream extra information needed for aggressive devirtualization when running
8153 the link-time optimizer in local transformation mode.  
8154 This option enables more devirtualization but
8155 significantly increases the size of streamed data. For this reason it is
8156 disabled by default.
8158 @item -fexpensive-optimizations
8159 @opindex fexpensive-optimizations
8160 Perform a number of minor optimizations that are relatively expensive.
8162 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8164 @item -free
8165 @opindex free
8166 Attempt to remove redundant extension instructions.  This is especially
8167 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
8168 registers after writing to their lower 32-bit half.
8170 Enabled for Alpha, AArch64 and x86 at levels @option{-O2},
8171 @option{-O3}, @option{-Os}.
8173 @item -fno-lifetime-dse
8174 @opindex fno-lifetime-dse
8175 In C++ the value of an object is only affected by changes within its
8176 lifetime: when the constructor begins, the object has an indeterminate
8177 value, and any changes during the lifetime of the object are dead when
8178 the object is destroyed.  Normally dead store elimination will take
8179 advantage of this; if your code relies on the value of the object
8180 storage persisting beyond the lifetime of the object, you can use this
8181 flag to disable this optimization.
8183 @item -flive-range-shrinkage
8184 @opindex flive-range-shrinkage
8185 Attempt to decrease register pressure through register live range
8186 shrinkage.  This is helpful for fast processors with small or moderate
8187 size register sets.
8189 @item -fira-algorithm=@var{algorithm}
8190 @opindex fira-algorithm
8191 Use the specified coloring algorithm for the integrated register
8192 allocator.  The @var{algorithm} argument can be @samp{priority}, which
8193 specifies Chow's priority coloring, or @samp{CB}, which specifies
8194 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
8195 for all architectures, but for those targets that do support it, it is
8196 the default because it generates better code.
8198 @item -fira-region=@var{region}
8199 @opindex fira-region
8200 Use specified regions for the integrated register allocator.  The
8201 @var{region} argument should be one of the following:
8203 @table @samp
8205 @item all
8206 Use all loops as register allocation regions.
8207 This can give the best results for machines with a small and/or
8208 irregular register set.
8210 @item mixed
8211 Use all loops except for loops with small register pressure 
8212 as the regions.  This value usually gives
8213 the best results in most cases and for most architectures,
8214 and is enabled by default when compiling with optimization for speed
8215 (@option{-O}, @option{-O2}, @dots{}).
8217 @item one
8218 Use all functions as a single region.  
8219 This typically results in the smallest code size, and is enabled by default for
8220 @option{-Os} or @option{-O0}.
8222 @end table
8224 @item -fira-hoist-pressure
8225 @opindex fira-hoist-pressure
8226 Use IRA to evaluate register pressure in the code hoisting pass for
8227 decisions to hoist expressions.  This option usually results in smaller
8228 code, but it can slow the compiler down.
8230 This option is enabled at level @option{-Os} for all targets.
8232 @item -fira-loop-pressure
8233 @opindex fira-loop-pressure
8234 Use IRA to evaluate register pressure in loops for decisions to move
8235 loop invariants.  This option usually results in generation
8236 of faster and smaller code on machines with large register files (>= 32
8237 registers), but it can slow the compiler down.
8239 This option is enabled at level @option{-O3} for some targets.
8241 @item -fno-ira-share-save-slots
8242 @opindex fno-ira-share-save-slots
8243 Disable sharing of stack slots used for saving call-used hard
8244 registers living through a call.  Each hard register gets a
8245 separate stack slot, and as a result function stack frames are
8246 larger.
8248 @item -fno-ira-share-spill-slots
8249 @opindex fno-ira-share-spill-slots
8250 Disable sharing of stack slots allocated for pseudo-registers.  Each
8251 pseudo-register that does not get a hard register gets a separate
8252 stack slot, and as a result function stack frames are larger.
8254 @item -fira-verbose=@var{n}
8255 @opindex fira-verbose
8256 Control the verbosity of the dump file for the integrated register allocator.
8257 The default value is 5.  If the value @var{n} is greater or equal to 10,
8258 the dump output is sent to stderr using the same format as @var{n} minus 10.
8260 @item -flra-remat
8261 @opindex flra-remat
8262 Enable CFG-sensitive rematerialization in LRA.  Instead of loading
8263 values of spilled pseudos, LRA tries to rematerialize (recalculate)
8264 values if it is profitable.
8266 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8268 @item -fdelayed-branch
8269 @opindex fdelayed-branch
8270 If supported for the target machine, attempt to reorder instructions
8271 to exploit instruction slots available after delayed branch
8272 instructions.
8274 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8276 @item -fschedule-insns
8277 @opindex fschedule-insns
8278 If supported for the target machine, attempt to reorder instructions to
8279 eliminate execution stalls due to required data being unavailable.  This
8280 helps machines that have slow floating point or memory load instructions
8281 by allowing other instructions to be issued until the result of the load
8282 or floating-point instruction is required.
8284 Enabled at levels @option{-O2}, @option{-O3}.
8286 @item -fschedule-insns2
8287 @opindex fschedule-insns2
8288 Similar to @option{-fschedule-insns}, but requests an additional pass of
8289 instruction scheduling after register allocation has been done.  This is
8290 especially useful on machines with a relatively small number of
8291 registers and where memory load instructions take more than one cycle.
8293 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8295 @item -fno-sched-interblock
8296 @opindex fno-sched-interblock
8297 Don't schedule instructions across basic blocks.  This is normally
8298 enabled by default when scheduling before register allocation, i.e.@:
8299 with @option{-fschedule-insns} or at @option{-O2} or higher.
8301 @item -fno-sched-spec
8302 @opindex fno-sched-spec
8303 Don't allow speculative motion of non-load instructions.  This is normally
8304 enabled by default when scheduling before register allocation, i.e.@:
8305 with @option{-fschedule-insns} or at @option{-O2} or higher.
8307 @item -fsched-pressure
8308 @opindex fsched-pressure
8309 Enable register pressure sensitive insn scheduling before register
8310 allocation.  This only makes sense when scheduling before register
8311 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
8312 @option{-O2} or higher.  Usage of this option can improve the
8313 generated code and decrease its size by preventing register pressure
8314 increase above the number of available hard registers and subsequent
8315 spills in register allocation.
8317 @item -fsched-spec-load
8318 @opindex fsched-spec-load
8319 Allow speculative motion of some load instructions.  This only makes
8320 sense when scheduling before register allocation, i.e.@: with
8321 @option{-fschedule-insns} or at @option{-O2} or higher.
8323 @item -fsched-spec-load-dangerous
8324 @opindex fsched-spec-load-dangerous
8325 Allow speculative motion of more load instructions.  This only makes
8326 sense when scheduling before register allocation, i.e.@: with
8327 @option{-fschedule-insns} or at @option{-O2} or higher.
8329 @item -fsched-stalled-insns
8330 @itemx -fsched-stalled-insns=@var{n}
8331 @opindex fsched-stalled-insns
8332 Define how many insns (if any) can be moved prematurely from the queue
8333 of stalled insns into the ready list during the second scheduling pass.
8334 @option{-fno-sched-stalled-insns} means that no insns are moved
8335 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
8336 on how many queued insns can be moved prematurely.
8337 @option{-fsched-stalled-insns} without a value is equivalent to
8338 @option{-fsched-stalled-insns=1}.
8340 @item -fsched-stalled-insns-dep
8341 @itemx -fsched-stalled-insns-dep=@var{n}
8342 @opindex fsched-stalled-insns-dep
8343 Define how many insn groups (cycles) are examined for a dependency
8344 on a stalled insn that is a candidate for premature removal from the queue
8345 of stalled insns.  This has an effect only during the second scheduling pass,
8346 and only if @option{-fsched-stalled-insns} is used.
8347 @option{-fno-sched-stalled-insns-dep} is equivalent to
8348 @option{-fsched-stalled-insns-dep=0}.
8349 @option{-fsched-stalled-insns-dep} without a value is equivalent to
8350 @option{-fsched-stalled-insns-dep=1}.
8352 @item -fsched2-use-superblocks
8353 @opindex fsched2-use-superblocks
8354 When scheduling after register allocation, use superblock scheduling.
8355 This allows motion across basic block boundaries,
8356 resulting in faster schedules.  This option is experimental, as not all machine
8357 descriptions used by GCC model the CPU closely enough to avoid unreliable
8358 results from the algorithm.
8360 This only makes sense when scheduling after register allocation, i.e.@: with
8361 @option{-fschedule-insns2} or at @option{-O2} or higher.
8363 @item -fsched-group-heuristic
8364 @opindex fsched-group-heuristic
8365 Enable the group heuristic in the scheduler.  This heuristic favors
8366 the instruction that belongs to a schedule group.  This is enabled
8367 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
8368 or @option{-fschedule-insns2} or at @option{-O2} or higher.
8370 @item -fsched-critical-path-heuristic
8371 @opindex fsched-critical-path-heuristic
8372 Enable the critical-path heuristic in the scheduler.  This heuristic favors
8373 instructions on the critical path.  This is enabled by default when
8374 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
8375 or @option{-fschedule-insns2} or at @option{-O2} or higher.
8377 @item -fsched-spec-insn-heuristic
8378 @opindex fsched-spec-insn-heuristic
8379 Enable the speculative instruction heuristic in the scheduler.  This
8380 heuristic favors speculative instructions with greater dependency weakness.
8381 This is enabled by default when scheduling is enabled, i.e.@:
8382 with @option{-fschedule-insns} or @option{-fschedule-insns2}
8383 or at @option{-O2} or higher.
8385 @item -fsched-rank-heuristic
8386 @opindex fsched-rank-heuristic
8387 Enable the rank heuristic in the scheduler.  This heuristic favors
8388 the instruction belonging to a basic block with greater size or frequency.
8389 This is enabled by default when scheduling is enabled, i.e.@:
8390 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8391 at @option{-O2} or higher.
8393 @item -fsched-last-insn-heuristic
8394 @opindex fsched-last-insn-heuristic
8395 Enable the last-instruction heuristic in the scheduler.  This heuristic
8396 favors the instruction that is less dependent on the last instruction
8397 scheduled.  This is enabled by default when scheduling is enabled,
8398 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8399 at @option{-O2} or higher.
8401 @item -fsched-dep-count-heuristic
8402 @opindex fsched-dep-count-heuristic
8403 Enable the dependent-count heuristic in the scheduler.  This heuristic
8404 favors the instruction that has more instructions depending on it.
8405 This is enabled by default when scheduling is enabled, i.e.@:
8406 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8407 at @option{-O2} or higher.
8409 @item -freschedule-modulo-scheduled-loops
8410 @opindex freschedule-modulo-scheduled-loops
8411 Modulo scheduling is performed before traditional scheduling.  If a loop
8412 is modulo scheduled, later scheduling passes may change its schedule.  
8413 Use this option to control that behavior.
8415 @item -fselective-scheduling
8416 @opindex fselective-scheduling
8417 Schedule instructions using selective scheduling algorithm.  Selective
8418 scheduling runs instead of the first scheduler pass.
8420 @item -fselective-scheduling2
8421 @opindex fselective-scheduling2
8422 Schedule instructions using selective scheduling algorithm.  Selective
8423 scheduling runs instead of the second scheduler pass.
8425 @item -fsel-sched-pipelining
8426 @opindex fsel-sched-pipelining
8427 Enable software pipelining of innermost loops during selective scheduling.
8428 This option has no effect unless one of @option{-fselective-scheduling} or
8429 @option{-fselective-scheduling2} is turned on.
8431 @item -fsel-sched-pipelining-outer-loops
8432 @opindex fsel-sched-pipelining-outer-loops
8433 When pipelining loops during selective scheduling, also pipeline outer loops.
8434 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
8436 @item -fsemantic-interposition
8437 @opindex fsemantic-interposition
8438 Some object formats, like ELF, allow interposing of symbols by the 
8439 dynamic linker.
8440 This means that for symbols exported from the DSO, the compiler cannot perform
8441 interprocedural propagation, inlining and other optimizations in anticipation
8442 that the function or variable in question may change. While this feature is
8443 useful, for example, to rewrite memory allocation functions by a debugging
8444 implementation, it is expensive in the terms of code quality.
8445 With @option{-fno-semantic-interposition} the compiler assumes that 
8446 if interposition happens for functions the overwriting function will have 
8447 precisely the same semantics (and side effects). 
8448 Similarly if interposition happens
8449 for variables, the constructor of the variable will be the same. The flag
8450 has no effect for functions explicitly declared inline 
8451 (where it is never allowed for interposition to change semantics) 
8452 and for symbols explicitly declared weak.
8454 @item -fshrink-wrap
8455 @opindex fshrink-wrap
8456 Emit function prologues only before parts of the function that need it,
8457 rather than at the top of the function.  This flag is enabled by default at
8458 @option{-O} and higher.
8460 @item -fcaller-saves
8461 @opindex fcaller-saves
8462 Enable allocation of values to registers that are clobbered by
8463 function calls, by emitting extra instructions to save and restore the
8464 registers around such calls.  Such allocation is done only when it
8465 seems to result in better code.
8467 This option is always enabled by default on certain machines, usually
8468 those which have no call-preserved registers to use instead.
8470 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8472 @item -fcombine-stack-adjustments
8473 @opindex fcombine-stack-adjustments
8474 Tracks stack adjustments (pushes and pops) and stack memory references
8475 and then tries to find ways to combine them.
8477 Enabled by default at @option{-O1} and higher.
8479 @item -fipa-ra
8480 @opindex fipa-ra
8481 Use caller save registers for allocation if those registers are not used by
8482 any called function.  In that case it is not necessary to save and restore
8483 them around calls.  This is only possible if called functions are part of
8484 same compilation unit as current function and they are compiled before it.
8486 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8488 @item -fconserve-stack
8489 @opindex fconserve-stack
8490 Attempt to minimize stack usage.  The compiler attempts to use less
8491 stack space, even if that makes the program slower.  This option
8492 implies setting the @option{large-stack-frame} parameter to 100
8493 and the @option{large-stack-frame-growth} parameter to 400.
8495 @item -ftree-reassoc
8496 @opindex ftree-reassoc
8497 Perform reassociation on trees.  This flag is enabled by default
8498 at @option{-O} and higher.
8500 @item -ftree-pre
8501 @opindex ftree-pre
8502 Perform partial redundancy elimination (PRE) on trees.  This flag is
8503 enabled by default at @option{-O2} and @option{-O3}.
8505 @item -ftree-partial-pre
8506 @opindex ftree-partial-pre
8507 Make partial redundancy elimination (PRE) more aggressive.  This flag is
8508 enabled by default at @option{-O3}.
8510 @item -ftree-forwprop
8511 @opindex ftree-forwprop
8512 Perform forward propagation on trees.  This flag is enabled by default
8513 at @option{-O} and higher.
8515 @item -ftree-fre
8516 @opindex ftree-fre
8517 Perform full redundancy elimination (FRE) on trees.  The difference
8518 between FRE and PRE is that FRE only considers expressions
8519 that are computed on all paths leading to the redundant computation.
8520 This analysis is faster than PRE, though it exposes fewer redundancies.
8521 This flag is enabled by default at @option{-O} and higher.
8523 @item -ftree-phiprop
8524 @opindex ftree-phiprop
8525 Perform hoisting of loads from conditional pointers on trees.  This
8526 pass is enabled by default at @option{-O} and higher.
8528 @item -fhoist-adjacent-loads
8529 @opindex fhoist-adjacent-loads
8530 Speculatively hoist loads from both branches of an if-then-else if the
8531 loads are from adjacent locations in the same structure and the target
8532 architecture has a conditional move instruction.  This flag is enabled
8533 by default at @option{-O2} and higher.
8535 @item -ftree-copy-prop
8536 @opindex ftree-copy-prop
8537 Perform copy propagation on trees.  This pass eliminates unnecessary
8538 copy operations.  This flag is enabled by default at @option{-O} and
8539 higher.
8541 @item -fipa-pure-const
8542 @opindex fipa-pure-const
8543 Discover which functions are pure or constant.
8544 Enabled by default at @option{-O} and higher.
8546 @item -fipa-reference
8547 @opindex fipa-reference
8548 Discover which static variables do not escape the
8549 compilation unit.
8550 Enabled by default at @option{-O} and higher.
8552 @item -fipa-pta
8553 @opindex fipa-pta
8554 Perform interprocedural pointer analysis and interprocedural modification
8555 and reference analysis.  This option can cause excessive memory and
8556 compile-time usage on large compilation units.  It is not enabled by
8557 default at any optimization level.
8559 @item -fipa-profile
8560 @opindex fipa-profile
8561 Perform interprocedural profile propagation.  The functions called only from
8562 cold functions are marked as cold. Also functions executed once (such as
8563 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
8564 functions and loop less parts of functions executed once are then optimized for
8565 size.
8566 Enabled by default at @option{-O} and higher.
8568 @item -fipa-cp
8569 @opindex fipa-cp
8570 Perform interprocedural constant propagation.
8571 This optimization analyzes the program to determine when values passed
8572 to functions are constants and then optimizes accordingly.
8573 This optimization can substantially increase performance
8574 if the application has constants passed to functions.
8575 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
8577 @item -fipa-cp-clone
8578 @opindex fipa-cp-clone
8579 Perform function cloning to make interprocedural constant propagation stronger.
8580 When enabled, interprocedural constant propagation performs function cloning
8581 when externally visible function can be called with constant arguments.
8582 Because this optimization can create multiple copies of functions,
8583 it may significantly increase code size
8584 (see @option{--param ipcp-unit-growth=@var{value}}).
8585 This flag is enabled by default at @option{-O3}.
8587 @item -fipa-cp-alignment
8588 @opindex -fipa-cp-alignment
8589 When enabled, this optimization propagates alignment of function
8590 parameters to support better vectorization and string operations.
8592 This flag is enabled by default at @option{-O2} and @option{-Os}.  It
8593 requires that @option{-fipa-cp} is enabled.
8595 @item -fipa-icf
8596 @opindex fipa-icf
8597 Perform Identical Code Folding for functions and read-only variables.
8598 The optimization reduces code size and may disturb unwind stacks by replacing
8599 a function by equivalent one with a different name. The optimization works
8600 more effectively with link time optimization enabled.
8602 Nevertheless the behavior is similar to Gold Linker ICF optimization, GCC ICF
8603 works on different levels and thus the optimizations are not same - there are
8604 equivalences that are found only by GCC and equivalences found only by Gold.
8606 This flag is enabled by default at @option{-O2} and @option{-Os}.
8608 @item -fisolate-erroneous-paths-dereference
8609 @opindex fisolate-erroneous-paths-dereference
8610 Detect paths that trigger erroneous or undefined behavior due to
8611 dereferencing a null pointer.  Isolate those paths from the main control
8612 flow and turn the statement with erroneous or undefined behavior into a trap.
8613 This flag is enabled by default at @option{-O2} and higher and depends on
8614 @option{-fdelete-null-pointer-checks} also being enabled.
8616 @item -fisolate-erroneous-paths-attribute
8617 @opindex fisolate-erroneous-paths-attribute
8618 Detect paths that trigger erroneous or undefined behavior due a null value
8619 being used in a way forbidden by a @code{returns_nonnull} or @code{nonnull}
8620 attribute.  Isolate those paths from the main control flow and turn the
8621 statement with erroneous or undefined behavior into a trap.  This is not
8622 currently enabled, but may be enabled by @option{-O2} in the future.
8624 @item -ftree-sink
8625 @opindex ftree-sink
8626 Perform forward store motion  on trees.  This flag is
8627 enabled by default at @option{-O} and higher.
8629 @item -ftree-bit-ccp
8630 @opindex ftree-bit-ccp
8631 Perform sparse conditional bit constant propagation on trees and propagate
8632 pointer alignment information.
8633 This pass only operates on local scalar variables and is enabled by default
8634 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
8636 @item -ftree-ccp
8637 @opindex ftree-ccp
8638 Perform sparse conditional constant propagation (CCP) on trees.  This
8639 pass only operates on local scalar variables and is enabled by default
8640 at @option{-O} and higher.
8642 @item -fssa-phiopt
8643 @opindex fssa-phiopt
8644 Perform pattern matching on SSA PHI nodes to optimize conditional
8645 code.  This pass is enabled by default at @option{-O} and higher.
8647 @item -ftree-switch-conversion
8648 @opindex ftree-switch-conversion
8649 Perform conversion of simple initializations in a switch to
8650 initializations from a scalar array.  This flag is enabled by default
8651 at @option{-O2} and higher.
8653 @item -ftree-tail-merge
8654 @opindex ftree-tail-merge
8655 Look for identical code sequences.  When found, replace one with a jump to the
8656 other.  This optimization is known as tail merging or cross jumping.  This flag
8657 is enabled by default at @option{-O2} and higher.  The compilation time
8658 in this pass can
8659 be limited using @option{max-tail-merge-comparisons} parameter and
8660 @option{max-tail-merge-iterations} parameter.
8662 @item -ftree-dce
8663 @opindex ftree-dce
8664 Perform dead code elimination (DCE) on trees.  This flag is enabled by
8665 default at @option{-O} and higher.
8667 @item -ftree-builtin-call-dce
8668 @opindex ftree-builtin-call-dce
8669 Perform conditional dead code elimination (DCE) for calls to built-in functions
8670 that may set @code{errno} but are otherwise side-effect free.  This flag is
8671 enabled by default at @option{-O2} and higher if @option{-Os} is not also
8672 specified.
8674 @item -ftree-dominator-opts
8675 @opindex ftree-dominator-opts
8676 Perform a variety of simple scalar cleanups (constant/copy
8677 propagation, redundancy elimination, range propagation and expression
8678 simplification) based on a dominator tree traversal.  This also
8679 performs jump threading (to reduce jumps to jumps). This flag is
8680 enabled by default at @option{-O} and higher.
8682 @item -ftree-dse
8683 @opindex ftree-dse
8684 Perform dead store elimination (DSE) on trees.  A dead store is a store into
8685 a memory location that is later overwritten by another store without
8686 any intervening loads.  In this case the earlier store can be deleted.  This
8687 flag is enabled by default at @option{-O} and higher.
8689 @item -ftree-ch
8690 @opindex ftree-ch
8691 Perform loop header copying on trees.  This is beneficial since it increases
8692 effectiveness of code motion optimizations.  It also saves one jump.  This flag
8693 is enabled by default at @option{-O} and higher.  It is not enabled
8694 for @option{-Os}, since it usually increases code size.
8696 @item -ftree-loop-optimize
8697 @opindex ftree-loop-optimize
8698 Perform loop optimizations on trees.  This flag is enabled by default
8699 at @option{-O} and higher.
8701 @item -ftree-loop-linear
8702 @opindex ftree-loop-linear
8703 Perform loop interchange transformations on tree.  Same as
8704 @option{-floop-interchange}.  To use this code transformation, GCC has
8705 to be configured with @option{--with-isl} to enable the Graphite loop
8706 transformation infrastructure.
8708 @item -floop-interchange
8709 @opindex floop-interchange
8710 Perform loop interchange transformations on loops.  Interchanging two
8711 nested loops switches the inner and outer loops.  For example, given a
8712 loop like:
8713 @smallexample
8714 DO J = 1, M
8715   DO I = 1, N
8716     A(J, I) = A(J, I) * C
8717   ENDDO
8718 ENDDO
8719 @end smallexample
8720 @noindent
8721 loop interchange transforms the loop as if it were written:
8722 @smallexample
8723 DO I = 1, N
8724   DO J = 1, M
8725     A(J, I) = A(J, I) * C
8726   ENDDO
8727 ENDDO
8728 @end smallexample
8729 which can be beneficial when @code{N} is larger than the caches,
8730 because in Fortran, the elements of an array are stored in memory
8731 contiguously by column, and the original loop iterates over rows,
8732 potentially creating at each access a cache miss.  This optimization
8733 applies to all the languages supported by GCC and is not limited to
8734 Fortran.  To use this code transformation, GCC has to be configured
8735 with @option{--with-isl} to enable the Graphite loop transformation
8736 infrastructure.
8738 @item -floop-strip-mine
8739 @opindex floop-strip-mine
8740 Perform loop strip mining transformations on loops.  Strip mining
8741 splits a loop into two nested loops.  The outer loop has strides
8742 equal to the strip size and the inner loop has strides of the
8743 original loop within a strip.  The strip length can be changed
8744 using the @option{loop-block-tile-size} parameter.  For example,
8745 given a loop like:
8746 @smallexample
8747 DO I = 1, N
8748   A(I) = A(I) + C
8749 ENDDO
8750 @end smallexample
8751 @noindent
8752 loop strip mining transforms the loop as if it were written:
8753 @smallexample
8754 DO II = 1, N, 51
8755   DO I = II, min (II + 50, N)
8756     A(I) = A(I) + C
8757   ENDDO
8758 ENDDO
8759 @end smallexample
8760 This optimization applies to all the languages supported by GCC and is
8761 not limited to Fortran.  To use this code transformation, GCC has to
8762 be configured with @option{--with-isl} to enable the Graphite loop
8763 transformation infrastructure.
8765 @item -floop-block
8766 @opindex floop-block
8767 Perform loop blocking transformations on loops.  Blocking strip mines
8768 each loop in the loop nest such that the memory accesses of the
8769 element loops fit inside caches.  The strip length can be changed
8770 using the @option{loop-block-tile-size} parameter.  For example, given
8771 a loop like:
8772 @smallexample
8773 DO I = 1, N
8774   DO J = 1, M
8775     A(J, I) = B(I) + C(J)
8776   ENDDO
8777 ENDDO
8778 @end smallexample
8779 @noindent
8780 loop blocking transforms the loop as if it were written:
8781 @smallexample
8782 DO II = 1, N, 51
8783   DO JJ = 1, M, 51
8784     DO I = II, min (II + 50, N)
8785       DO J = JJ, min (JJ + 50, M)
8786         A(J, I) = B(I) + C(J)
8787       ENDDO
8788     ENDDO
8789   ENDDO
8790 ENDDO
8791 @end smallexample
8792 which can be beneficial when @code{M} is larger than the caches,
8793 because the innermost loop iterates over a smaller amount of data
8794 which can be kept in the caches.  This optimization applies to all the
8795 languages supported by GCC and is not limited to Fortran.  To use this
8796 code transformation, GCC has to be configured with @option{--with-isl}
8797 to enable the Graphite loop transformation infrastructure.
8799 @item -fgraphite-identity
8800 @opindex fgraphite-identity
8801 Enable the identity transformation for graphite.  For every SCoP we generate
8802 the polyhedral representation and transform it back to gimple.  Using
8803 @option{-fgraphite-identity} we can check the costs or benefits of the
8804 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
8805 are also performed by the code generator ISL, like index splitting and
8806 dead code elimination in loops.
8808 @item -floop-nest-optimize
8809 @opindex floop-nest-optimize
8810 Enable the ISL based loop nest optimizer.  This is a generic loop nest
8811 optimizer based on the Pluto optimization algorithms.  It calculates a loop
8812 structure optimized for data-locality and parallelism.  This option
8813 is experimental.
8815 @item -floop-unroll-and-jam
8816 @opindex floop-unroll-and-jam
8817 Enable unroll and jam for the ISL based loop nest optimizer.  The unroll 
8818 factor can be changed using the @option{loop-unroll-jam-size} parameter.
8819 The unrolled dimension (counting from the most inner one) can be changed 
8820 using the @option{loop-unroll-jam-depth} parameter.                 .
8822 @item -floop-parallelize-all
8823 @opindex floop-parallelize-all
8824 Use the Graphite data dependence analysis to identify loops that can
8825 be parallelized.  Parallelize all the loops that can be analyzed to
8826 not contain loop carried dependences without checking that it is
8827 profitable to parallelize the loops.
8829 @item -ftree-coalesce-vars
8830 @opindex ftree-coalesce-vars
8831 Tell the compiler to attempt to combine small user-defined variables
8832 too, instead of just compiler temporaries.  This may severely limit the
8833 ability to debug an optimized program compiled with
8834 @option{-fno-var-tracking-assignments}.  In the negated form, this flag
8835 prevents SSA coalescing of user variables.  This option is enabled by
8836 default if optimization is enabled.
8838 @item -ftree-loop-if-convert
8839 @opindex ftree-loop-if-convert
8840 Attempt to transform conditional jumps in the innermost loops to
8841 branch-less equivalents.  The intent is to remove control-flow from
8842 the innermost loops in order to improve the ability of the
8843 vectorization pass to handle these loops.  This is enabled by default
8844 if vectorization is enabled.
8846 @item -ftree-loop-if-convert-stores
8847 @opindex ftree-loop-if-convert-stores
8848 Attempt to also if-convert conditional jumps containing memory writes.
8849 This transformation can be unsafe for multi-threaded programs as it
8850 transforms conditional memory writes into unconditional memory writes.
8851 For example,
8852 @smallexample
8853 for (i = 0; i < N; i++)
8854   if (cond)
8855     A[i] = expr;
8856 @end smallexample
8857 is transformed to
8858 @smallexample
8859 for (i = 0; i < N; i++)
8860   A[i] = cond ? expr : A[i];
8861 @end smallexample
8862 potentially producing data races.
8864 @item -ftree-loop-distribution
8865 @opindex ftree-loop-distribution
8866 Perform loop distribution.  This flag can improve cache performance on
8867 big loop bodies and allow further loop optimizations, like
8868 parallelization or vectorization, to take place.  For example, the loop
8869 @smallexample
8870 DO I = 1, N
8871   A(I) = B(I) + C
8872   D(I) = E(I) * F
8873 ENDDO
8874 @end smallexample
8875 is transformed to
8876 @smallexample
8877 DO I = 1, N
8878    A(I) = B(I) + C
8879 ENDDO
8880 DO I = 1, N
8881    D(I) = E(I) * F
8882 ENDDO
8883 @end smallexample
8885 @item -ftree-loop-distribute-patterns
8886 @opindex ftree-loop-distribute-patterns
8887 Perform loop distribution of patterns that can be code generated with
8888 calls to a library.  This flag is enabled by default at @option{-O3}.
8890 This pass distributes the initialization loops and generates a call to
8891 memset zero.  For example, the loop
8892 @smallexample
8893 DO I = 1, N
8894   A(I) = 0
8895   B(I) = A(I) + I
8896 ENDDO
8897 @end smallexample
8898 is transformed to
8899 @smallexample
8900 DO I = 1, N
8901    A(I) = 0
8902 ENDDO
8903 DO I = 1, N
8904    B(I) = A(I) + I
8905 ENDDO
8906 @end smallexample
8907 and the initialization loop is transformed into a call to memset zero.
8909 @item -ftree-loop-im
8910 @opindex ftree-loop-im
8911 Perform loop invariant motion on trees.  This pass moves only invariants that
8912 are hard to handle at RTL level (function calls, operations that expand to
8913 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
8914 operands of conditions that are invariant out of the loop, so that we can use
8915 just trivial invariantness analysis in loop unswitching.  The pass also includes
8916 store motion.
8918 @item -ftree-loop-ivcanon
8919 @opindex ftree-loop-ivcanon
8920 Create a canonical counter for number of iterations in loops for which
8921 determining number of iterations requires complicated analysis.  Later
8922 optimizations then may determine the number easily.  Useful especially
8923 in connection with unrolling.
8925 @item -fivopts
8926 @opindex fivopts
8927 Perform induction variable optimizations (strength reduction, induction
8928 variable merging and induction variable elimination) on trees.
8930 @item -ftree-parallelize-loops=n
8931 @opindex ftree-parallelize-loops
8932 Parallelize loops, i.e., split their iteration space to run in n threads.
8933 This is only possible for loops whose iterations are independent
8934 and can be arbitrarily reordered.  The optimization is only
8935 profitable on multiprocessor machines, for loops that are CPU-intensive,
8936 rather than constrained e.g.@: by memory bandwidth.  This option
8937 implies @option{-pthread}, and thus is only supported on targets
8938 that have support for @option{-pthread}.
8940 @item -ftree-pta
8941 @opindex ftree-pta
8942 Perform function-local points-to analysis on trees.  This flag is
8943 enabled by default at @option{-O} and higher.
8945 @item -ftree-sra
8946 @opindex ftree-sra
8947 Perform scalar replacement of aggregates.  This pass replaces structure
8948 references with scalars to prevent committing structures to memory too
8949 early.  This flag is enabled by default at @option{-O} and higher.
8951 @item -ftree-ter
8952 @opindex ftree-ter
8953 Perform temporary expression replacement during the SSA->normal phase.  Single
8954 use/single def temporaries are replaced at their use location with their
8955 defining expression.  This results in non-GIMPLE code, but gives the expanders
8956 much more complex trees to work on resulting in better RTL generation.  This is
8957 enabled by default at @option{-O} and higher.
8959 @item -ftree-slsr
8960 @opindex ftree-slsr
8961 Perform straight-line strength reduction on trees.  This recognizes related
8962 expressions involving multiplications and replaces them by less expensive
8963 calculations when possible.  This is enabled by default at @option{-O} and
8964 higher.
8966 @item -ftree-vectorize
8967 @opindex ftree-vectorize
8968 Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
8969 and @option{-ftree-slp-vectorize} if not explicitly specified.
8971 @item -ftree-loop-vectorize
8972 @opindex ftree-loop-vectorize
8973 Perform loop vectorization on trees. This flag is enabled by default at
8974 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8976 @item -ftree-slp-vectorize
8977 @opindex ftree-slp-vectorize
8978 Perform basic block vectorization on trees. This flag is enabled by default at
8979 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8981 @item -fvect-cost-model=@var{model}
8982 @opindex fvect-cost-model
8983 Alter the cost model used for vectorization.  The @var{model} argument
8984 should be one of @samp{unlimited}, @samp{dynamic} or @samp{cheap}.
8985 With the @samp{unlimited} model the vectorized code-path is assumed
8986 to be profitable while with the @samp{dynamic} model a runtime check
8987 guards the vectorized code-path to enable it only for iteration
8988 counts that will likely execute faster than when executing the original
8989 scalar loop.  The @samp{cheap} model disables vectorization of
8990 loops where doing so would be cost prohibitive for example due to
8991 required runtime checks for data dependence or alignment but otherwise
8992 is equal to the @samp{dynamic} model.
8993 The default cost model depends on other optimization flags and is
8994 either @samp{dynamic} or @samp{cheap}.
8996 @item -fsimd-cost-model=@var{model}
8997 @opindex fsimd-cost-model
8998 Alter the cost model used for vectorization of loops marked with the OpenMP
8999 or Cilk Plus simd directive.  The @var{model} argument should be one of
9000 @samp{unlimited}, @samp{dynamic}, @samp{cheap}.  All values of @var{model}
9001 have the same meaning as described in @option{-fvect-cost-model} and by
9002 default a cost model defined with @option{-fvect-cost-model} is used.
9004 @item -ftree-vrp
9005 @opindex ftree-vrp
9006 Perform Value Range Propagation on trees.  This is similar to the
9007 constant propagation pass, but instead of values, ranges of values are
9008 propagated.  This allows the optimizers to remove unnecessary range
9009 checks like array bound checks and null pointer checks.  This is
9010 enabled by default at @option{-O2} and higher.  Null pointer check
9011 elimination is only done if @option{-fdelete-null-pointer-checks} is
9012 enabled.
9014 @item -fsplit-ivs-in-unroller
9015 @opindex fsplit-ivs-in-unroller
9016 Enables expression of values of induction variables in later iterations
9017 of the unrolled loop using the value in the first iteration.  This breaks
9018 long dependency chains, thus improving efficiency of the scheduling passes.
9020 A combination of @option{-fweb} and CSE is often sufficient to obtain the
9021 same effect.  However, that is not reliable in cases where the loop body
9022 is more complicated than a single basic block.  It also does not work at all
9023 on some architectures due to restrictions in the CSE pass.
9025 This optimization is enabled by default.
9027 @item -fvariable-expansion-in-unroller
9028 @opindex fvariable-expansion-in-unroller
9029 With this option, the compiler creates multiple copies of some
9030 local variables when unrolling a loop, which can result in superior code.
9032 @item -fpartial-inlining
9033 @opindex fpartial-inlining
9034 Inline parts of functions.  This option has any effect only
9035 when inlining itself is turned on by the @option{-finline-functions}
9036 or @option{-finline-small-functions} options.
9038 Enabled at level @option{-O2}.
9040 @item -fpredictive-commoning
9041 @opindex fpredictive-commoning
9042 Perform predictive commoning optimization, i.e., reusing computations
9043 (especially memory loads and stores) performed in previous
9044 iterations of loops.
9046 This option is enabled at level @option{-O3}.
9048 @item -fprefetch-loop-arrays
9049 @opindex fprefetch-loop-arrays
9050 If supported by the target machine, generate instructions to prefetch
9051 memory to improve the performance of loops that access large arrays.
9053 This option may generate better or worse code; results are highly
9054 dependent on the structure of loops within the source code.
9056 Disabled at level @option{-Os}.
9058 @item -fno-peephole
9059 @itemx -fno-peephole2
9060 @opindex fno-peephole
9061 @opindex fno-peephole2
9062 Disable any machine-specific peephole optimizations.  The difference
9063 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
9064 are implemented in the compiler; some targets use one, some use the
9065 other, a few use both.
9067 @option{-fpeephole} is enabled by default.
9068 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9070 @item -fno-guess-branch-probability
9071 @opindex fno-guess-branch-probability
9072 Do not guess branch probabilities using heuristics.
9074 GCC uses heuristics to guess branch probabilities if they are
9075 not provided by profiling feedback (@option{-fprofile-arcs}).  These
9076 heuristics are based on the control flow graph.  If some branch probabilities
9077 are specified by @code{__builtin_expect}, then the heuristics are
9078 used to guess branch probabilities for the rest of the control flow graph,
9079 taking the @code{__builtin_expect} info into account.  The interactions
9080 between the heuristics and @code{__builtin_expect} can be complex, and in
9081 some cases, it may be useful to disable the heuristics so that the effects
9082 of @code{__builtin_expect} are easier to understand.
9084 The default is @option{-fguess-branch-probability} at levels
9085 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9087 @item -freorder-blocks
9088 @opindex freorder-blocks
9089 Reorder basic blocks in the compiled function in order to reduce number of
9090 taken branches and improve code locality.
9092 Enabled at levels @option{-O2}, @option{-O3}.
9094 @item -freorder-blocks-and-partition
9095 @opindex freorder-blocks-and-partition
9096 In addition to reordering basic blocks in the compiled function, in order
9097 to reduce number of taken branches, partitions hot and cold basic blocks
9098 into separate sections of the assembly and .o files, to improve
9099 paging and cache locality performance.
9101 This optimization is automatically turned off in the presence of
9102 exception handling, for linkonce sections, for functions with a user-defined
9103 section attribute and on any architecture that does not support named
9104 sections.
9106 Enabled for x86 at levels @option{-O2}, @option{-O3}.
9108 @item -freorder-functions
9109 @opindex freorder-functions
9110 Reorder functions in the object file in order to
9111 improve code locality.  This is implemented by using special
9112 subsections @code{.text.hot} for most frequently executed functions and
9113 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
9114 the linker so object file format must support named sections and linker must
9115 place them in a reasonable way.
9117 Also profile feedback must be available to make this option effective.  See
9118 @option{-fprofile-arcs} for details.
9120 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9122 @item -fstrict-aliasing
9123 @opindex fstrict-aliasing
9124 Allow the compiler to assume the strictest aliasing rules applicable to
9125 the language being compiled.  For C (and C++), this activates
9126 optimizations based on the type of expressions.  In particular, an
9127 object of one type is assumed never to reside at the same address as an
9128 object of a different type, unless the types are almost the same.  For
9129 example, an @code{unsigned int} can alias an @code{int}, but not a
9130 @code{void*} or a @code{double}.  A character type may alias any other
9131 type.
9133 @anchor{Type-punning}Pay special attention to code like this:
9134 @smallexample
9135 union a_union @{
9136   int i;
9137   double d;
9140 int f() @{
9141   union a_union t;
9142   t.d = 3.0;
9143   return t.i;
9145 @end smallexample
9146 The practice of reading from a different union member than the one most
9147 recently written to (called ``type-punning'') is common.  Even with
9148 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
9149 is accessed through the union type.  So, the code above works as
9150 expected.  @xref{Structures unions enumerations and bit-fields
9151 implementation}.  However, this code might not:
9152 @smallexample
9153 int f() @{
9154   union a_union t;
9155   int* ip;
9156   t.d = 3.0;
9157   ip = &t.i;
9158   return *ip;
9160 @end smallexample
9162 Similarly, access by taking the address, casting the resulting pointer
9163 and dereferencing the result has undefined behavior, even if the cast
9164 uses a union type, e.g.:
9165 @smallexample
9166 int f() @{
9167   double d = 3.0;
9168   return ((union a_union *) &d)->i;
9170 @end smallexample
9172 The @option{-fstrict-aliasing} option is enabled at levels
9173 @option{-O2}, @option{-O3}, @option{-Os}.
9175 @item -fstrict-overflow
9176 @opindex fstrict-overflow
9177 Allow the compiler to assume strict signed overflow rules, depending
9178 on the language being compiled.  For C (and C++) this means that
9179 overflow when doing arithmetic with signed numbers is undefined, which
9180 means that the compiler may assume that it does not happen.  This
9181 permits various optimizations.  For example, the compiler assumes
9182 that an expression like @code{i + 10 > i} is always true for
9183 signed @code{i}.  This assumption is only valid if signed overflow is
9184 undefined, as the expression is false if @code{i + 10} overflows when
9185 using twos complement arithmetic.  When this option is in effect any
9186 attempt to determine whether an operation on signed numbers 
9187 overflows must be written carefully to not actually involve overflow.
9189 This option also allows the compiler to assume strict pointer
9190 semantics: given a pointer to an object, if adding an offset to that
9191 pointer does not produce a pointer to the same object, the addition is
9192 undefined.  This permits the compiler to conclude that @code{p + u >
9193 p} is always true for a pointer @code{p} and unsigned integer
9194 @code{u}.  This assumption is only valid because pointer wraparound is
9195 undefined, as the expression is false if @code{p + u} overflows using
9196 twos complement arithmetic.
9198 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
9199 that integer signed overflow is fully defined: it wraps.  When
9200 @option{-fwrapv} is used, there is no difference between
9201 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
9202 integers.  With @option{-fwrapv} certain types of overflow are
9203 permitted.  For example, if the compiler gets an overflow when doing
9204 arithmetic on constants, the overflowed value can still be used with
9205 @option{-fwrapv}, but not otherwise.
9207 The @option{-fstrict-overflow} option is enabled at levels
9208 @option{-O2}, @option{-O3}, @option{-Os}.
9210 @item -falign-functions
9211 @itemx -falign-functions=@var{n}
9212 @opindex falign-functions
9213 Align the start of functions to the next power-of-two greater than
9214 @var{n}, skipping up to @var{n} bytes.  For instance,
9215 @option{-falign-functions=32} aligns functions to the next 32-byte
9216 boundary, but @option{-falign-functions=24} aligns to the next
9217 32-byte boundary only if this can be done by skipping 23 bytes or less.
9219 @option{-fno-align-functions} and @option{-falign-functions=1} are
9220 equivalent and mean that functions are not aligned.
9222 Some assemblers only support this flag when @var{n} is a power of two;
9223 in that case, it is rounded up.
9225 If @var{n} is not specified or is zero, use a machine-dependent default.
9227 Enabled at levels @option{-O2}, @option{-O3}.
9229 @item -falign-labels
9230 @itemx -falign-labels=@var{n}
9231 @opindex falign-labels
9232 Align all branch targets to a power-of-two boundary, skipping up to
9233 @var{n} bytes like @option{-falign-functions}.  This option can easily
9234 make code slower, because it must insert dummy operations for when the
9235 branch target is reached in the usual flow of the code.
9237 @option{-fno-align-labels} and @option{-falign-labels=1} are
9238 equivalent and mean that labels are not aligned.
9240 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
9241 are greater than this value, then their values are used instead.
9243 If @var{n} is not specified or is zero, use a machine-dependent default
9244 which is very likely to be @samp{1}, meaning no alignment.
9246 Enabled at levels @option{-O2}, @option{-O3}.
9248 @item -falign-loops
9249 @itemx -falign-loops=@var{n}
9250 @opindex falign-loops
9251 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
9252 like @option{-falign-functions}.  If the loops are
9253 executed many times, this makes up for any execution of the dummy
9254 operations.
9256 @option{-fno-align-loops} and @option{-falign-loops=1} are
9257 equivalent and mean that loops are not aligned.
9259 If @var{n} is not specified or is zero, use a machine-dependent default.
9261 Enabled at levels @option{-O2}, @option{-O3}.
9263 @item -falign-jumps
9264 @itemx -falign-jumps=@var{n}
9265 @opindex falign-jumps
9266 Align branch targets to a power-of-two boundary, for branch targets
9267 where the targets can only be reached by jumping, skipping up to @var{n}
9268 bytes like @option{-falign-functions}.  In this case, no dummy operations
9269 need be executed.
9271 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
9272 equivalent and mean that loops are not aligned.
9274 If @var{n} is not specified or is zero, use a machine-dependent default.
9276 Enabled at levels @option{-O2}, @option{-O3}.
9278 @item -funit-at-a-time
9279 @opindex funit-at-a-time
9280 This option is left for compatibility reasons. @option{-funit-at-a-time}
9281 has no effect, while @option{-fno-unit-at-a-time} implies
9282 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
9284 Enabled by default.
9286 @item -fno-toplevel-reorder
9287 @opindex fno-toplevel-reorder
9288 Do not reorder top-level functions, variables, and @code{asm}
9289 statements.  Output them in the same order that they appear in the
9290 input file.  When this option is used, unreferenced static variables
9291 are not removed.  This option is intended to support existing code
9292 that relies on a particular ordering.  For new code, it is better to
9293 use attributes when possible.
9295 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
9296 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
9297 targets.
9299 @item -fweb
9300 @opindex fweb
9301 Constructs webs as commonly used for register allocation purposes and assign
9302 each web individual pseudo register.  This allows the register allocation pass
9303 to operate on pseudos directly, but also strengthens several other optimization
9304 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
9305 however, make debugging impossible, since variables no longer stay in a
9306 ``home register''.
9308 Enabled by default with @option{-funroll-loops}.
9310 @item -fwhole-program
9311 @opindex fwhole-program
9312 Assume that the current compilation unit represents the whole program being
9313 compiled.  All public functions and variables with the exception of @code{main}
9314 and those merged by attribute @code{externally_visible} become static functions
9315 and in effect are optimized more aggressively by interprocedural optimizers.
9317 This option should not be used in combination with @option{-flto}.
9318 Instead relying on a linker plugin should provide safer and more precise
9319 information.
9321 @item -flto[=@var{n}]
9322 @opindex flto
9323 This option runs the standard link-time optimizer.  When invoked
9324 with source code, it generates GIMPLE (one of GCC's internal
9325 representations) and writes it to special ELF sections in the object
9326 file.  When the object files are linked together, all the function
9327 bodies are read from these ELF sections and instantiated as if they
9328 had been part of the same translation unit.
9330 To use the link-time optimizer, @option{-flto} and optimization
9331 options should be specified at compile time and during the final link.
9332 For example:
9334 @smallexample
9335 gcc -c -O2 -flto foo.c
9336 gcc -c -O2 -flto bar.c
9337 gcc -o myprog -flto -O2 foo.o bar.o
9338 @end smallexample
9340 The first two invocations to GCC save a bytecode representation
9341 of GIMPLE into special ELF sections inside @file{foo.o} and
9342 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
9343 @file{foo.o} and @file{bar.o}, merges the two files into a single
9344 internal image, and compiles the result as usual.  Since both
9345 @file{foo.o} and @file{bar.o} are merged into a single image, this
9346 causes all the interprocedural analyses and optimizations in GCC to
9347 work across the two files as if they were a single one.  This means,
9348 for example, that the inliner is able to inline functions in
9349 @file{bar.o} into functions in @file{foo.o} and vice-versa.
9351 Another (simpler) way to enable link-time optimization is:
9353 @smallexample
9354 gcc -o myprog -flto -O2 foo.c bar.c
9355 @end smallexample
9357 The above generates bytecode for @file{foo.c} and @file{bar.c},
9358 merges them together into a single GIMPLE representation and optimizes
9359 them as usual to produce @file{myprog}.
9361 The only important thing to keep in mind is that to enable link-time
9362 optimizations you need to use the GCC driver to perform the link-step.
9363 GCC then automatically performs link-time optimization if any of the
9364 objects involved were compiled with the @option{-flto} command-line option.  
9365 You generally
9366 should specify the optimization options to be used for link-time
9367 optimization though GCC tries to be clever at guessing an
9368 optimization level to use from the options used at compile-time
9369 if you fail to specify one at link-time.  You can always override
9370 the automatic decision to do link-time optimization at link-time
9371 by passing @option{-fno-lto} to the link command.
9373 To make whole program optimization effective, it is necessary to make
9374 certain whole program assumptions.  The compiler needs to know
9375 what functions and variables can be accessed by libraries and runtime
9376 outside of the link-time optimized unit.  When supported by the linker,
9377 the linker plugin (see @option{-fuse-linker-plugin}) passes information
9378 to the compiler about used and externally visible symbols.  When
9379 the linker plugin is not available, @option{-fwhole-program} should be
9380 used to allow the compiler to make these assumptions, which leads
9381 to more aggressive optimization decisions.
9383 When @option{-fuse-linker-plugin} is not enabled then, when a file is
9384 compiled with @option{-flto}, the generated object file is larger than
9385 a regular object file because it contains GIMPLE bytecodes and the usual
9386 final code (see @option{-ffat-lto-objects}.  This means that
9387 object files with LTO information can be linked as normal object
9388 files; if @option{-fno-lto} is passed to the linker, no
9389 interprocedural optimizations are applied.  Note that when
9390 @option{-fno-fat-lto-objects} is enabled the compile-stage is faster
9391 but you cannot perform a regular, non-LTO link on them.
9393 Additionally, the optimization flags used to compile individual files
9394 are not necessarily related to those used at link time.  For instance,
9396 @smallexample
9397 gcc -c -O0 -ffat-lto-objects -flto foo.c
9398 gcc -c -O0 -ffat-lto-objects -flto bar.c
9399 gcc -o myprog -O3 foo.o bar.o
9400 @end smallexample
9402 This produces individual object files with unoptimized assembler
9403 code, but the resulting binary @file{myprog} is optimized at
9404 @option{-O3}.  If, instead, the final binary is generated with
9405 @option{-fno-lto}, then @file{myprog} is not optimized.
9407 When producing the final binary, GCC only
9408 applies link-time optimizations to those files that contain bytecode.
9409 Therefore, you can mix and match object files and libraries with
9410 GIMPLE bytecodes and final object code.  GCC automatically selects
9411 which files to optimize in LTO mode and which files to link without
9412 further processing.
9414 There are some code generation flags preserved by GCC when
9415 generating bytecodes, as they need to be used during the final link
9416 stage.  Generally options specified at link-time override those
9417 specified at compile-time.
9419 If you do not specify an optimization level option @option{-O} at
9420 link-time then GCC computes one based on the optimization levels
9421 used when compiling the object files.  The highest optimization
9422 level wins here.
9424 Currently, the following options and their setting are take from
9425 the first object file that explicitely specified it: 
9426 @option{-fPIC}, @option{-fpic}, @option{-fpie}, @option{-fcommon},
9427 @option{-fexceptions}, @option{-fnon-call-exceptions}, @option{-fgnu-tm}
9428 and all the @option{-m} target flags.
9430 Certain ABI changing flags are required to match in all compilation-units
9431 and trying to override this at link-time with a conflicting value
9432 is ignored.  This includes options such as @option{-freg-struct-return}
9433 and @option{-fpcc-struct-return}. 
9435 Other options such as @option{-ffp-contract}, @option{-fno-strict-overflow},
9436 @option{-fwrapv}, @option{-fno-trapv} or @option{-fno-strict-aliasing}
9437 are passed through to the link stage and merged conservatively for
9438 conflicting translation units.  Specifically
9439 @option{-fno-strict-overflow}, @option{-fwrapv} and @option{-fno-trapv} take
9440 precedence and for example @option{-ffp-contract=off} takes precedence
9441 over @option{-ffp-contract=fast}.  You can override them at linke-time.
9443 It is recommended that you compile all the files participating in the
9444 same link with the same options and also specify those options at
9445 link time.
9447 If LTO encounters objects with C linkage declared with incompatible
9448 types in separate translation units to be linked together (undefined
9449 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
9450 issued.  The behavior is still undefined at run time.  Similar
9451 diagnostics may be raised for other languages.
9453 Another feature of LTO is that it is possible to apply interprocedural
9454 optimizations on files written in different languages:
9456 @smallexample
9457 gcc -c -flto foo.c
9458 g++ -c -flto bar.cc
9459 gfortran -c -flto baz.f90
9460 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
9461 @end smallexample
9463 Notice that the final link is done with @command{g++} to get the C++
9464 runtime libraries and @option{-lgfortran} is added to get the Fortran
9465 runtime libraries.  In general, when mixing languages in LTO mode, you
9466 should use the same link command options as when mixing languages in a
9467 regular (non-LTO) compilation.
9469 If object files containing GIMPLE bytecode are stored in a library archive, say
9470 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
9471 are using a linker with plugin support.  To create static libraries suitable
9472 for LTO, use @command{gcc-ar} and @command{gcc-ranlib} instead of @command{ar}
9473 and @command{ranlib}; 
9474 to show the symbols of object files with GIMPLE bytecode, use
9475 @command{gcc-nm}.  Those commands require that @command{ar}, @command{ranlib}
9476 and @command{nm} have been compiled with plugin support.  At link time, use the the
9477 flag @option{-fuse-linker-plugin} to ensure that the library participates in
9478 the LTO optimization process:
9480 @smallexample
9481 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
9482 @end smallexample
9484 With the linker plugin enabled, the linker extracts the needed
9485 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
9486 to make them part of the aggregated GIMPLE image to be optimized.
9488 If you are not using a linker with plugin support and/or do not
9489 enable the linker plugin, then the objects inside @file{libfoo.a}
9490 are extracted and linked as usual, but they do not participate
9491 in the LTO optimization process.  In order to make a static library suitable
9492 for both LTO optimization and usual linkage, compile its object files with
9493 @option{-flto} @option{-ffat-lto-objects}.
9495 Link-time optimizations do not require the presence of the whole program to
9496 operate.  If the program does not require any symbols to be exported, it is
9497 possible to combine @option{-flto} and @option{-fwhole-program} to allow
9498 the interprocedural optimizers to use more aggressive assumptions which may
9499 lead to improved optimization opportunities.
9500 Use of @option{-fwhole-program} is not needed when linker plugin is
9501 active (see @option{-fuse-linker-plugin}).
9503 The current implementation of LTO makes no
9504 attempt to generate bytecode that is portable between different
9505 types of hosts.  The bytecode files are versioned and there is a
9506 strict version check, so bytecode files generated in one version of
9507 GCC do not work with an older or newer version of GCC.
9509 Link-time optimization does not work well with generation of debugging
9510 information.  Combining @option{-flto} with
9511 @option{-g} is currently experimental and expected to produce unexpected
9512 results.
9514 If you specify the optional @var{n}, the optimization and code
9515 generation done at link time is executed in parallel using @var{n}
9516 parallel jobs by utilizing an installed @command{make} program.  The
9517 environment variable @env{MAKE} may be used to override the program
9518 used.  The default value for @var{n} is 1.
9520 You can also specify @option{-flto=jobserver} to use GNU make's
9521 job server mode to determine the number of parallel jobs. This
9522 is useful when the Makefile calling GCC is already executing in parallel.
9523 You must prepend a @samp{+} to the command recipe in the parent Makefile
9524 for this to work.  This option likely only works if @env{MAKE} is
9525 GNU make.
9527 @item -flto-partition=@var{alg}
9528 @opindex flto-partition
9529 Specify the partitioning algorithm used by the link-time optimizer.
9530 The value is either @samp{1to1} to specify a partitioning mirroring
9531 the original source files or @samp{balanced} to specify partitioning
9532 into equally sized chunks (whenever possible) or @samp{max} to create
9533 new partition for every symbol where possible.  Specifying @samp{none}
9534 as an algorithm disables partitioning and streaming completely. 
9535 The default value is @samp{balanced}. While @samp{1to1} can be used
9536 as an workaround for various code ordering issues, the @samp{max}
9537 partitioning is intended for internal testing only.
9538 The value @samp{one} specifies that exactly one partition should be
9539 used while the value @samp{none} bypasses partitioning and executes
9540 the link-time optimization step directly from the WPA phase.
9542 @item -flto-odr-type-merging
9543 @opindex flto-odr-type-merging
9544 Enable streaming of mangled types names of C++ types and their unification
9545 at linktime.  This increases size of LTO object files, but enable
9546 diagnostics about One Definition Rule violations.
9548 @item -flto-compression-level=@var{n}
9549 @opindex flto-compression-level
9550 This option specifies the level of compression used for intermediate
9551 language written to LTO object files, and is only meaningful in
9552 conjunction with LTO mode (@option{-flto}).  Valid
9553 values are 0 (no compression) to 9 (maximum compression).  Values
9554 outside this range are clamped to either 0 or 9.  If the option is not
9555 given, a default balanced compression setting is used.
9557 @item -flto-report
9558 @opindex flto-report
9559 Prints a report with internal details on the workings of the link-time
9560 optimizer.  The contents of this report vary from version to version.
9561 It is meant to be useful to GCC developers when processing object
9562 files in LTO mode (via @option{-flto}).
9564 Disabled by default.
9566 @item -flto-report-wpa
9567 @opindex flto-report-wpa
9568 Like @option{-flto-report}, but only print for the WPA phase of Link
9569 Time Optimization.
9571 @item -fuse-linker-plugin
9572 @opindex fuse-linker-plugin
9573 Enables the use of a linker plugin during link-time optimization.  This
9574 option relies on plugin support in the linker, which is available in gold
9575 or in GNU ld 2.21 or newer.
9577 This option enables the extraction of object files with GIMPLE bytecode out
9578 of library archives. This improves the quality of optimization by exposing
9579 more code to the link-time optimizer.  This information specifies what
9580 symbols can be accessed externally (by non-LTO object or during dynamic
9581 linking).  Resulting code quality improvements on binaries (and shared
9582 libraries that use hidden visibility) are similar to @option{-fwhole-program}.
9583 See @option{-flto} for a description of the effect of this flag and how to
9584 use it.
9586 This option is enabled by default when LTO support in GCC is enabled
9587 and GCC was configured for use with
9588 a linker supporting plugins (GNU ld 2.21 or newer or gold).
9590 @item -ffat-lto-objects
9591 @opindex ffat-lto-objects
9592 Fat LTO objects are object files that contain both the intermediate language
9593 and the object code. This makes them usable for both LTO linking and normal
9594 linking. This option is effective only when compiling with @option{-flto}
9595 and is ignored at link time.
9597 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
9598 requires the complete toolchain to be aware of LTO. It requires a linker with
9599 linker plugin support for basic functionality.  Additionally,
9600 @command{nm}, @command{ar} and @command{ranlib}
9601 need to support linker plugins to allow a full-featured build environment
9602 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
9603 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
9604 to these tools. With non fat LTO makefiles need to be modified to use them.
9606 The default is @option{-fno-fat-lto-objects} on targets with linker plugin
9607 support.
9609 @item -fcompare-elim
9610 @opindex fcompare-elim
9611 After register allocation and post-register allocation instruction splitting,
9612 identify arithmetic instructions that compute processor flags similar to a
9613 comparison operation based on that arithmetic.  If possible, eliminate the
9614 explicit comparison operation.
9616 This pass only applies to certain targets that cannot explicitly represent
9617 the comparison operation before register allocation is complete.
9619 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9621 @item -fcprop-registers
9622 @opindex fcprop-registers
9623 After register allocation and post-register allocation instruction splitting,
9624 perform a copy-propagation pass to try to reduce scheduling dependencies
9625 and occasionally eliminate the copy.
9627 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9629 @item -fprofile-correction
9630 @opindex fprofile-correction
9631 Profiles collected using an instrumented binary for multi-threaded programs may
9632 be inconsistent due to missed counter updates. When this option is specified,
9633 GCC uses heuristics to correct or smooth out such inconsistencies. By
9634 default, GCC emits an error message when an inconsistent profile is detected.
9636 @item -fprofile-dir=@var{path}
9637 @opindex fprofile-dir
9639 Set the directory to search for the profile data files in to @var{path}.
9640 This option affects only the profile data generated by
9641 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
9642 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
9643 and its related options.  Both absolute and relative paths can be used.
9644 By default, GCC uses the current directory as @var{path}, thus the
9645 profile data file appears in the same directory as the object file.
9647 @item -fprofile-generate
9648 @itemx -fprofile-generate=@var{path}
9649 @opindex fprofile-generate
9651 Enable options usually used for instrumenting application to produce
9652 profile useful for later recompilation with profile feedback based
9653 optimization.  You must use @option{-fprofile-generate} both when
9654 compiling and when linking your program.
9656 The following options are enabled: @option{-fprofile-arcs}, @option{-fprofile-values}, @option{-fvpt}.
9658 If @var{path} is specified, GCC looks at the @var{path} to find
9659 the profile feedback data files. See @option{-fprofile-dir}.
9661 @item -fprofile-use
9662 @itemx -fprofile-use=@var{path}
9663 @opindex fprofile-use
9664 Enable profile feedback-directed optimizations, 
9665 and the following optimizations
9666 which are generally profitable only with profile feedback available:
9667 @option{-fbranch-probabilities}, @option{-fvpt},
9668 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
9669 @option{-ftree-vectorize}, and @option{ftree-loop-distribute-patterns}.
9671 By default, GCC emits an error message if the feedback profiles do not
9672 match the source code.  This error can be turned into a warning by using
9673 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
9674 code.
9676 If @var{path} is specified, GCC looks at the @var{path} to find
9677 the profile feedback data files. See @option{-fprofile-dir}.
9679 @item -fauto-profile
9680 @itemx -fauto-profile=@var{path}
9681 @opindex fauto-profile
9682 Enable sampling-based feedback-directed optimizations, 
9683 and the following optimizations
9684 which are generally profitable only with profile feedback available:
9685 @option{-fbranch-probabilities}, @option{-fvpt},
9686 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
9687 @option{-ftree-vectorize},
9688 @option{-finline-functions}, @option{-fipa-cp}, @option{-fipa-cp-clone},
9689 @option{-fpredictive-commoning}, @option{-funswitch-loops},
9690 @option{-fgcse-after-reload}, and @option{-ftree-loop-distribute-patterns}.
9692 @var{path} is the name of a file containing AutoFDO profile information.
9693 If omitted, it defaults to @file{fbdata.afdo} in the current directory.
9695 Producing an AutoFDO profile data file requires running your program
9696 with the @command{perf} utility on a supported GNU/Linux target system.
9697 For more information, see @uref{https://perf.wiki.kernel.org/}.
9699 E.g.
9700 @smallexample
9701 perf record -e br_inst_retired:near_taken -b -o perf.data \
9702     -- your_program
9703 @end smallexample
9705 Then use the @command{create_gcov} tool to convert the raw profile data
9706 to a format that can be used by GCC.@  You must also supply the 
9707 unstripped binary for your program to this tool.  
9708 See @uref{https://github.com/google/autofdo}.
9710 E.g.
9711 @smallexample
9712 create_gcov --binary=your_program.unstripped --profile=perf.data \
9713     --gcov=profile.afdo
9714 @end smallexample
9715 @end table
9717 The following options control compiler behavior regarding floating-point 
9718 arithmetic.  These options trade off between speed and
9719 correctness.  All must be specifically enabled.
9721 @table @gcctabopt
9722 @item -ffloat-store
9723 @opindex ffloat-store
9724 Do not store floating-point variables in registers, and inhibit other
9725 options that might change whether a floating-point value is taken from a
9726 register or memory.
9728 @cindex floating-point precision
9729 This option prevents undesirable excess precision on machines such as
9730 the 68000 where the floating registers (of the 68881) keep more
9731 precision than a @code{double} is supposed to have.  Similarly for the
9732 x86 architecture.  For most programs, the excess precision does only
9733 good, but a few programs rely on the precise definition of IEEE floating
9734 point.  Use @option{-ffloat-store} for such programs, after modifying
9735 them to store all pertinent intermediate computations into variables.
9737 @item -fexcess-precision=@var{style}
9738 @opindex fexcess-precision
9739 This option allows further control over excess precision on machines
9740 where floating-point registers have more precision than the IEEE
9741 @code{float} and @code{double} types and the processor does not
9742 support operations rounding to those types.  By default,
9743 @option{-fexcess-precision=fast} is in effect; this means that
9744 operations are carried out in the precision of the registers and that
9745 it is unpredictable when rounding to the types specified in the source
9746 code takes place.  When compiling C, if
9747 @option{-fexcess-precision=standard} is specified then excess
9748 precision follows the rules specified in ISO C99; in particular,
9749 both casts and assignments cause values to be rounded to their
9750 semantic types (whereas @option{-ffloat-store} only affects
9751 assignments).  This option is enabled by default for C if a strict
9752 conformance option such as @option{-std=c99} is used.
9754 @opindex mfpmath
9755 @option{-fexcess-precision=standard} is not implemented for languages
9756 other than C, and has no effect if
9757 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
9758 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
9759 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
9760 semantics apply without excess precision, and in the latter, rounding
9761 is unpredictable.
9763 @item -ffast-math
9764 @opindex ffast-math
9765 Sets the options @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
9766 @option{-ffinite-math-only}, @option{-fno-rounding-math},
9767 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
9769 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
9771 This option is not turned on by any @option{-O} option besides
9772 @option{-Ofast} since it can result in incorrect output for programs
9773 that depend on an exact implementation of IEEE or ISO rules/specifications
9774 for math functions. It may, however, yield faster code for programs
9775 that do not require the guarantees of these specifications.
9777 @item -fno-math-errno
9778 @opindex fno-math-errno
9779 Do not set @code{errno} after calling math functions that are executed
9780 with a single instruction, e.g., @code{sqrt}.  A program that relies on
9781 IEEE exceptions for math error handling may want to use this flag
9782 for speed while maintaining IEEE arithmetic compatibility.
9784 This option is not turned on by any @option{-O} option since
9785 it can result in incorrect output for programs that depend on
9786 an exact implementation of IEEE or ISO rules/specifications for
9787 math functions. It may, however, yield faster code for programs
9788 that do not require the guarantees of these specifications.
9790 The default is @option{-fmath-errno}.
9792 On Darwin systems, the math library never sets @code{errno}.  There is
9793 therefore no reason for the compiler to consider the possibility that
9794 it might, and @option{-fno-math-errno} is the default.
9796 @item -funsafe-math-optimizations
9797 @opindex funsafe-math-optimizations
9799 Allow optimizations for floating-point arithmetic that (a) assume
9800 that arguments and results are valid and (b) may violate IEEE or
9801 ANSI standards.  When used at link-time, it may include libraries
9802 or startup files that change the default FPU control word or other
9803 similar optimizations.
9805 This option is not turned on by any @option{-O} option since
9806 it can result in incorrect output for programs that depend on
9807 an exact implementation of IEEE or ISO rules/specifications for
9808 math functions. It may, however, yield faster code for programs
9809 that do not require the guarantees of these specifications.
9810 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
9811 @option{-fassociative-math} and @option{-freciprocal-math}.
9813 The default is @option{-fno-unsafe-math-optimizations}.
9815 @item -fassociative-math
9816 @opindex fassociative-math
9818 Allow re-association of operands in series of floating-point operations.
9819 This violates the ISO C and C++ language standard by possibly changing
9820 computation result.  NOTE: re-ordering may change the sign of zero as
9821 well as ignore NaNs and inhibit or create underflow or overflow (and
9822 thus cannot be used on code that relies on rounding behavior like
9823 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
9824 and thus may not be used when ordered comparisons are required.
9825 This option requires that both @option{-fno-signed-zeros} and
9826 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
9827 much sense with @option{-frounding-math}. For Fortran the option
9828 is automatically enabled when both @option{-fno-signed-zeros} and
9829 @option{-fno-trapping-math} are in effect.
9831 The default is @option{-fno-associative-math}.
9833 @item -freciprocal-math
9834 @opindex freciprocal-math
9836 Allow the reciprocal of a value to be used instead of dividing by
9837 the value if this enables optimizations.  For example @code{x / y}
9838 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
9839 is subject to common subexpression elimination.  Note that this loses
9840 precision and increases the number of flops operating on the value.
9842 The default is @option{-fno-reciprocal-math}.
9844 @item -ffinite-math-only
9845 @opindex ffinite-math-only
9846 Allow optimizations for floating-point arithmetic that assume
9847 that arguments and results are not NaNs or +-Infs.
9849 This option is not turned on by any @option{-O} option since
9850 it can result in incorrect output for programs that depend on
9851 an exact implementation of IEEE or ISO rules/specifications for
9852 math functions. It may, however, yield faster code for programs
9853 that do not require the guarantees of these specifications.
9855 The default is @option{-fno-finite-math-only}.
9857 @item -fno-signed-zeros
9858 @opindex fno-signed-zeros
9859 Allow optimizations for floating-point arithmetic that ignore the
9860 signedness of zero.  IEEE arithmetic specifies the behavior of
9861 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
9862 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
9863 This option implies that the sign of a zero result isn't significant.
9865 The default is @option{-fsigned-zeros}.
9867 @item -fno-trapping-math
9868 @opindex fno-trapping-math
9869 Compile code assuming that floating-point operations cannot generate
9870 user-visible traps.  These traps include division by zero, overflow,
9871 underflow, inexact result and invalid operation.  This option requires
9872 that @option{-fno-signaling-nans} be in effect.  Setting this option may
9873 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
9875 This option should never be turned on by any @option{-O} option since
9876 it can result in incorrect output for programs that depend on
9877 an exact implementation of IEEE or ISO rules/specifications for
9878 math functions.
9880 The default is @option{-ftrapping-math}.
9882 @item -frounding-math
9883 @opindex frounding-math
9884 Disable transformations and optimizations that assume default floating-point
9885 rounding behavior.  This is round-to-zero for all floating point
9886 to integer conversions, and round-to-nearest for all other arithmetic
9887 truncations.  This option should be specified for programs that change
9888 the FP rounding mode dynamically, or that may be executed with a
9889 non-default rounding mode.  This option disables constant folding of
9890 floating-point expressions at compile time (which may be affected by
9891 rounding mode) and arithmetic transformations that are unsafe in the
9892 presence of sign-dependent rounding modes.
9894 The default is @option{-fno-rounding-math}.
9896 This option is experimental and does not currently guarantee to
9897 disable all GCC optimizations that are affected by rounding mode.
9898 Future versions of GCC may provide finer control of this setting
9899 using C99's @code{FENV_ACCESS} pragma.  This command-line option
9900 will be used to specify the default state for @code{FENV_ACCESS}.
9902 @item -fsignaling-nans
9903 @opindex fsignaling-nans
9904 Compile code assuming that IEEE signaling NaNs may generate user-visible
9905 traps during floating-point operations.  Setting this option disables
9906 optimizations that may change the number of exceptions visible with
9907 signaling NaNs.  This option implies @option{-ftrapping-math}.
9909 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
9910 be defined.
9912 The default is @option{-fno-signaling-nans}.
9914 This option is experimental and does not currently guarantee to
9915 disable all GCC optimizations that affect signaling NaN behavior.
9917 @item -fsingle-precision-constant
9918 @opindex fsingle-precision-constant
9919 Treat floating-point constants as single precision instead of
9920 implicitly converting them to double-precision constants.
9922 @item -fcx-limited-range
9923 @opindex fcx-limited-range
9924 When enabled, this option states that a range reduction step is not
9925 needed when performing complex division.  Also, there is no checking
9926 whether the result of a complex multiplication or division is @code{NaN
9927 + I*NaN}, with an attempt to rescue the situation in that case.  The
9928 default is @option{-fno-cx-limited-range}, but is enabled by
9929 @option{-ffast-math}.
9931 This option controls the default setting of the ISO C99
9932 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
9933 all languages.
9935 @item -fcx-fortran-rules
9936 @opindex fcx-fortran-rules
9937 Complex multiplication and division follow Fortran rules.  Range
9938 reduction is done as part of complex division, but there is no checking
9939 whether the result of a complex multiplication or division is @code{NaN
9940 + I*NaN}, with an attempt to rescue the situation in that case.
9942 The default is @option{-fno-cx-fortran-rules}.
9944 @end table
9946 The following options control optimizations that may improve
9947 performance, but are not enabled by any @option{-O} options.  This
9948 section includes experimental options that may produce broken code.
9950 @table @gcctabopt
9951 @item -fbranch-probabilities
9952 @opindex fbranch-probabilities
9953 After running a program compiled with @option{-fprofile-arcs}
9954 (@pxref{Debugging Options,, Options for Debugging Your Program or
9955 @command{gcc}}), you can compile it a second time using
9956 @option{-fbranch-probabilities}, to improve optimizations based on
9957 the number of times each branch was taken.  When a program
9958 compiled with @option{-fprofile-arcs} exits, it saves arc execution
9959 counts to a file called @file{@var{sourcename}.gcda} for each source
9960 file.  The information in this data file is very dependent on the
9961 structure of the generated code, so you must use the same source code
9962 and the same optimization options for both compilations.
9964 With @option{-fbranch-probabilities}, GCC puts a
9965 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
9966 These can be used to improve optimization.  Currently, they are only
9967 used in one place: in @file{reorg.c}, instead of guessing which path a
9968 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
9969 exactly determine which path is taken more often.
9971 @item -fprofile-values
9972 @opindex fprofile-values
9973 If combined with @option{-fprofile-arcs}, it adds code so that some
9974 data about values of expressions in the program is gathered.
9976 With @option{-fbranch-probabilities}, it reads back the data gathered
9977 from profiling values of expressions for usage in optimizations.
9979 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
9981 @item -fprofile-reorder-functions
9982 @opindex fprofile-reorder-functions
9983 Function reordering based on profile instrumentation collects
9984 first time of execution of a function and orders these functions
9985 in ascending order.
9987 Enabled with @option{-fprofile-use}.
9989 @item -fvpt
9990 @opindex fvpt
9991 If combined with @option{-fprofile-arcs}, this option instructs the compiler
9992 to add code to gather information about values of expressions.
9994 With @option{-fbranch-probabilities}, it reads back the data gathered
9995 and actually performs the optimizations based on them.
9996 Currently the optimizations include specialization of division operations
9997 using the knowledge about the value of the denominator.
9999 @item -frename-registers
10000 @opindex frename-registers
10001 Attempt to avoid false dependencies in scheduled code by making use
10002 of registers left over after register allocation.  This optimization
10003 most benefits processors with lots of registers.  Depending on the
10004 debug information format adopted by the target, however, it can
10005 make debugging impossible, since variables no longer stay in
10006 a ``home register''.
10008 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
10010 @item -fschedule-fusion
10011 @opindex fschedule-fusion
10012 Performs a target dependent pass over the instruction stream to schedule
10013 instructions of same type together because target machine can execute them
10014 more efficiently if they are adjacent to each other in the instruction flow.
10016 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
10018 @item -ftracer
10019 @opindex ftracer
10020 Perform tail duplication to enlarge superblock size.  This transformation
10021 simplifies the control flow of the function allowing other optimizations to do
10022 a better job.
10024 Enabled with @option{-fprofile-use}.
10026 @item -funroll-loops
10027 @opindex funroll-loops
10028 Unroll loops whose number of iterations can be determined at compile time or
10029 upon entry to the loop.  @option{-funroll-loops} implies
10030 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
10031 It also turns on complete loop peeling (i.e.@: complete removal of loops with
10032 a small constant number of iterations).  This option makes code larger, and may
10033 or may not make it run faster.
10035 Enabled with @option{-fprofile-use}.
10037 @item -funroll-all-loops
10038 @opindex funroll-all-loops
10039 Unroll all loops, even if their number of iterations is uncertain when
10040 the loop is entered.  This usually makes programs run more slowly.
10041 @option{-funroll-all-loops} implies the same options as
10042 @option{-funroll-loops}.
10044 @item -fpeel-loops
10045 @opindex fpeel-loops
10046 Peels loops for which there is enough information that they do not
10047 roll much (from profile feedback).  It also turns on complete loop peeling
10048 (i.e.@: complete removal of loops with small constant number of iterations).
10050 Enabled with @option{-fprofile-use}.
10052 @item -fmove-loop-invariants
10053 @opindex fmove-loop-invariants
10054 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
10055 at level @option{-O1}
10057 @item -funswitch-loops
10058 @opindex funswitch-loops
10059 Move branches with loop invariant conditions out of the loop, with duplicates
10060 of the loop on both branches (modified according to result of the condition).
10062 @item -ffunction-sections
10063 @itemx -fdata-sections
10064 @opindex ffunction-sections
10065 @opindex fdata-sections
10066 Place each function or data item into its own section in the output
10067 file if the target supports arbitrary sections.  The name of the
10068 function or the name of the data item determines the section's name
10069 in the output file.
10071 Use these options on systems where the linker can perform optimizations
10072 to improve locality of reference in the instruction space.  Most systems
10073 using the ELF object format and SPARC processors running Solaris 2 have
10074 linkers with such optimizations.  AIX may have these optimizations in
10075 the future.
10077 Only use these options when there are significant benefits from doing
10078 so.  When you specify these options, the assembler and linker
10079 create larger object and executable files and are also slower.
10080 You cannot use @command{gprof} on all systems if you
10081 specify this option, and you may have problems with debugging if
10082 you specify both this option and @option{-g}.
10084 @item -fbranch-target-load-optimize
10085 @opindex fbranch-target-load-optimize
10086 Perform branch target register load optimization before prologue / epilogue
10087 threading.
10088 The use of target registers can typically be exposed only during reload,
10089 thus hoisting loads out of loops and doing inter-block scheduling needs
10090 a separate optimization pass.
10092 @item -fbranch-target-load-optimize2
10093 @opindex fbranch-target-load-optimize2
10094 Perform branch target register load optimization after prologue / epilogue
10095 threading.
10097 @item -fbtr-bb-exclusive
10098 @opindex fbtr-bb-exclusive
10099 When performing branch target register load optimization, don't reuse
10100 branch target registers within any basic block.
10102 @item -fstack-protector
10103 @opindex fstack-protector
10104 Emit extra code to check for buffer overflows, such as stack smashing
10105 attacks.  This is done by adding a guard variable to functions with
10106 vulnerable objects.  This includes functions that call @code{alloca}, and
10107 functions with buffers larger than 8 bytes.  The guards are initialized
10108 when a function is entered and then checked when the function exits.
10109 If a guard check fails, an error message is printed and the program exits.
10111 @item -fstack-protector-all
10112 @opindex fstack-protector-all
10113 Like @option{-fstack-protector} except that all functions are protected.
10115 @item -fstack-protector-strong
10116 @opindex fstack-protector-strong
10117 Like @option{-fstack-protector} but includes additional functions to
10118 be protected --- those that have local array definitions, or have
10119 references to local frame addresses.
10121 @item -fstack-protector-explicit
10122 @opindex fstack-protector-explicit
10123 Like @option{-fstack-protector} but only protects those functions which
10124 have the @code{stack_protect} attribute
10126 @item -fstdarg-opt
10127 @opindex fstdarg-opt
10128 Optimize the prologue of variadic argument functions with respect to usage of
10129 those arguments.
10131 @item -fsection-anchors
10132 @opindex fsection-anchors
10133 Try to reduce the number of symbolic address calculations by using
10134 shared ``anchor'' symbols to address nearby objects.  This transformation
10135 can help to reduce the number of GOT entries and GOT accesses on some
10136 targets.
10138 For example, the implementation of the following function @code{foo}:
10140 @smallexample
10141 static int a, b, c;
10142 int foo (void) @{ return a + b + c; @}
10143 @end smallexample
10145 @noindent
10146 usually calculates the addresses of all three variables, but if you
10147 compile it with @option{-fsection-anchors}, it accesses the variables
10148 from a common anchor point instead.  The effect is similar to the
10149 following pseudocode (which isn't valid C):
10151 @smallexample
10152 int foo (void)
10154   register int *xr = &x;
10155   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
10157 @end smallexample
10159 Not all targets support this option.
10161 @item --param @var{name}=@var{value}
10162 @opindex param
10163 In some places, GCC uses various constants to control the amount of
10164 optimization that is done.  For example, GCC does not inline functions
10165 that contain more than a certain number of instructions.  You can
10166 control some of these constants on the command line using the
10167 @option{--param} option.
10169 The names of specific parameters, and the meaning of the values, are
10170 tied to the internals of the compiler, and are subject to change
10171 without notice in future releases.
10173 In each case, the @var{value} is an integer.  The allowable choices for
10174 @var{name} are:
10176 @table @gcctabopt
10177 @item predictable-branch-outcome
10178 When branch is predicted to be taken with probability lower than this threshold
10179 (in percent), then it is considered well predictable. The default is 10.
10181 @item max-crossjump-edges
10182 The maximum number of incoming edges to consider for cross-jumping.
10183 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
10184 the number of edges incoming to each block.  Increasing values mean
10185 more aggressive optimization, making the compilation time increase with
10186 probably small improvement in executable size.
10188 @item min-crossjump-insns
10189 The minimum number of instructions that must be matched at the end
10190 of two blocks before cross-jumping is performed on them.  This
10191 value is ignored in the case where all instructions in the block being
10192 cross-jumped from are matched.  The default value is 5.
10194 @item max-grow-copy-bb-insns
10195 The maximum code size expansion factor when copying basic blocks
10196 instead of jumping.  The expansion is relative to a jump instruction.
10197 The default value is 8.
10199 @item max-goto-duplication-insns
10200 The maximum number of instructions to duplicate to a block that jumps
10201 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
10202 passes, GCC factors computed gotos early in the compilation process,
10203 and unfactors them as late as possible.  Only computed jumps at the
10204 end of a basic blocks with no more than max-goto-duplication-insns are
10205 unfactored.  The default value is 8.
10207 @item max-delay-slot-insn-search
10208 The maximum number of instructions to consider when looking for an
10209 instruction to fill a delay slot.  If more than this arbitrary number of
10210 instructions are searched, the time savings from filling the delay slot
10211 are minimal, so stop searching.  Increasing values mean more
10212 aggressive optimization, making the compilation time increase with probably
10213 small improvement in execution time.
10215 @item max-delay-slot-live-search
10216 When trying to fill delay slots, the maximum number of instructions to
10217 consider when searching for a block with valid live register
10218 information.  Increasing this arbitrarily chosen value means more
10219 aggressive optimization, increasing the compilation time.  This parameter
10220 should be removed when the delay slot code is rewritten to maintain the
10221 control-flow graph.
10223 @item max-gcse-memory
10224 The approximate maximum amount of memory that can be allocated in
10225 order to perform the global common subexpression elimination
10226 optimization.  If more memory than specified is required, the
10227 optimization is not done.
10229 @item max-gcse-insertion-ratio
10230 If the ratio of expression insertions to deletions is larger than this value
10231 for any expression, then RTL PRE inserts or removes the expression and thus
10232 leaves partially redundant computations in the instruction stream.  The default value is 20.
10234 @item max-pending-list-length
10235 The maximum number of pending dependencies scheduling allows
10236 before flushing the current state and starting over.  Large functions
10237 with few branches or calls can create excessively large lists which
10238 needlessly consume memory and resources.
10240 @item max-modulo-backtrack-attempts
10241 The maximum number of backtrack attempts the scheduler should make
10242 when modulo scheduling a loop.  Larger values can exponentially increase
10243 compilation time.
10245 @item max-inline-insns-single
10246 Several parameters control the tree inliner used in GCC@.
10247 This number sets the maximum number of instructions (counted in GCC's
10248 internal representation) in a single function that the tree inliner
10249 considers for inlining.  This only affects functions declared
10250 inline and methods implemented in a class declaration (C++).
10251 The default value is 400.
10253 @item max-inline-insns-auto
10254 When you use @option{-finline-functions} (included in @option{-O3}),
10255 a lot of functions that would otherwise not be considered for inlining
10256 by the compiler are investigated.  To those functions, a different
10257 (more restrictive) limit compared to functions declared inline can
10258 be applied.
10259 The default value is 40.
10261 @item inline-min-speedup
10262 When estimated performance improvement of caller + callee runtime exceeds this
10263 threshold (in precent), the function can be inlined regardless the limit on
10264 @option{--param max-inline-insns-single} and @option{--param
10265 max-inline-insns-auto}.
10267 @item large-function-insns
10268 The limit specifying really large functions.  For functions larger than this
10269 limit after inlining, inlining is constrained by
10270 @option{--param large-function-growth}.  This parameter is useful primarily
10271 to avoid extreme compilation time caused by non-linear algorithms used by the
10272 back end.
10273 The default value is 2700.
10275 @item large-function-growth
10276 Specifies maximal growth of large function caused by inlining in percents.
10277 The default value is 100 which limits large function growth to 2.0 times
10278 the original size.
10280 @item large-unit-insns
10281 The limit specifying large translation unit.  Growth caused by inlining of
10282 units larger than this limit is limited by @option{--param inline-unit-growth}.
10283 For small units this might be too tight.
10284 For example, consider a unit consisting of function A
10285 that is inline and B that just calls A three times.  If B is small relative to
10286 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
10287 large units consisting of small inlineable functions, however, the overall unit
10288 growth limit is needed to avoid exponential explosion of code size.  Thus for
10289 smaller units, the size is increased to @option{--param large-unit-insns}
10290 before applying @option{--param inline-unit-growth}.  The default is 10000.
10292 @item inline-unit-growth
10293 Specifies maximal overall growth of the compilation unit caused by inlining.
10294 The default value is 20 which limits unit growth to 1.2 times the original
10295 size. Cold functions (either marked cold via an attribute or by profile
10296 feedback) are not accounted into the unit size.
10298 @item ipcp-unit-growth
10299 Specifies maximal overall growth of the compilation unit caused by
10300 interprocedural constant propagation.  The default value is 10 which limits
10301 unit growth to 1.1 times the original size.
10303 @item large-stack-frame
10304 The limit specifying large stack frames.  While inlining the algorithm is trying
10305 to not grow past this limit too much.  The default value is 256 bytes.
10307 @item large-stack-frame-growth
10308 Specifies maximal growth of large stack frames caused by inlining in percents.
10309 The default value is 1000 which limits large stack frame growth to 11 times
10310 the original size.
10312 @item max-inline-insns-recursive
10313 @itemx max-inline-insns-recursive-auto
10314 Specifies the maximum number of instructions an out-of-line copy of a
10315 self-recursive inline
10316 function can grow into by performing recursive inlining.
10318 @option{--param max-inline-insns-recursive} applies to functions
10319 declared inline.
10320 For functions not declared inline, recursive inlining
10321 happens only when @option{-finline-functions} (included in @option{-O3}) is
10322 enabled; @option{--param max-inline-insns-recursive-auto} applies instead.  The
10323 default value is 450.
10325 @item max-inline-recursive-depth
10326 @itemx max-inline-recursive-depth-auto
10327 Specifies the maximum recursion depth used for recursive inlining.
10329 @option{--param max-inline-recursive-depth} applies to functions
10330 declared inline.  For functions not declared inline, recursive inlining
10331 happens only when @option{-finline-functions} (included in @option{-O3}) is
10332 enabled; @option{--param max-inline-recursive-depth-auto} applies instead.  The
10333 default value is 8.
10335 @item min-inline-recursive-probability
10336 Recursive inlining is profitable only for function having deep recursion
10337 in average and can hurt for function having little recursion depth by
10338 increasing the prologue size or complexity of function body to other
10339 optimizers.
10341 When profile feedback is available (see @option{-fprofile-generate}) the actual
10342 recursion depth can be guessed from probability that function recurses via a
10343 given call expression.  This parameter limits inlining only to call expressions
10344 whose probability exceeds the given threshold (in percents).
10345 The default value is 10.
10347 @item early-inlining-insns
10348 Specify growth that the early inliner can make.  In effect it increases
10349 the amount of inlining for code having a large abstraction penalty.
10350 The default value is 14.
10352 @item max-early-inliner-iterations
10353 Limit of iterations of the early inliner.  This basically bounds
10354 the number of nested indirect calls the early inliner can resolve.
10355 Deeper chains are still handled by late inlining.
10357 @item comdat-sharing-probability
10358 Probability (in percent) that C++ inline function with comdat visibility
10359 are shared across multiple compilation units.  The default value is 20.
10361 @item profile-func-internal-id
10362 A parameter to control whether to use function internal id in profile
10363 database lookup. If the value is 0, the compiler uses an id that
10364 is based on function assembler name and filename, which makes old profile
10365 data more tolerant to source changes such as function reordering etc.
10366 The default value is 0.
10368 @item min-vect-loop-bound
10369 The minimum number of iterations under which loops are not vectorized
10370 when @option{-ftree-vectorize} is used.  The number of iterations after
10371 vectorization needs to be greater than the value specified by this option
10372 to allow vectorization.  The default value is 0.
10374 @item gcse-cost-distance-ratio
10375 Scaling factor in calculation of maximum distance an expression
10376 can be moved by GCSE optimizations.  This is currently supported only in the
10377 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
10378 is with simple expressions, i.e., the expressions that have cost
10379 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
10380 hoisting of simple expressions.  The default value is 10.
10382 @item gcse-unrestricted-cost
10383 Cost, roughly measured as the cost of a single typical machine
10384 instruction, at which GCSE optimizations do not constrain
10385 the distance an expression can travel.  This is currently
10386 supported only in the code hoisting pass.  The lesser the cost,
10387 the more aggressive code hoisting is.  Specifying 0 
10388 allows all expressions to travel unrestricted distances.
10389 The default value is 3.
10391 @item max-hoist-depth
10392 The depth of search in the dominator tree for expressions to hoist.
10393 This is used to avoid quadratic behavior in hoisting algorithm.
10394 The value of 0 does not limit on the search, but may slow down compilation
10395 of huge functions.  The default value is 30.
10397 @item max-tail-merge-comparisons
10398 The maximum amount of similar bbs to compare a bb with.  This is used to
10399 avoid quadratic behavior in tree tail merging.  The default value is 10.
10401 @item max-tail-merge-iterations
10402 The maximum amount of iterations of the pass over the function.  This is used to
10403 limit compilation time in tree tail merging.  The default value is 2.
10405 @item max-unrolled-insns
10406 The maximum number of instructions that a loop may have to be unrolled.
10407 If a loop is unrolled, this parameter also determines how many times
10408 the loop code is unrolled.
10410 @item max-average-unrolled-insns
10411 The maximum number of instructions biased by probabilities of their execution
10412 that a loop may have to be unrolled.  If a loop is unrolled,
10413 this parameter also determines how many times the loop code is unrolled.
10415 @item max-unroll-times
10416 The maximum number of unrollings of a single loop.
10418 @item max-peeled-insns
10419 The maximum number of instructions that a loop may have to be peeled.
10420 If a loop is peeled, this parameter also determines how many times
10421 the loop code is peeled.
10423 @item max-peel-times
10424 The maximum number of peelings of a single loop.
10426 @item max-peel-branches
10427 The maximum number of branches on the hot path through the peeled sequence.
10429 @item max-completely-peeled-insns
10430 The maximum number of insns of a completely peeled loop.
10432 @item max-completely-peel-times
10433 The maximum number of iterations of a loop to be suitable for complete peeling.
10435 @item max-completely-peel-loop-nest-depth
10436 The maximum depth of a loop nest suitable for complete peeling.
10438 @item max-unswitch-insns
10439 The maximum number of insns of an unswitched loop.
10441 @item max-unswitch-level
10442 The maximum number of branches unswitched in a single loop.
10444 @item lim-expensive
10445 The minimum cost of an expensive expression in the loop invariant motion.
10447 @item iv-consider-all-candidates-bound
10448 Bound on number of candidates for induction variables, below which
10449 all candidates are considered for each use in induction variable
10450 optimizations.  If there are more candidates than this,
10451 only the most relevant ones are considered to avoid quadratic time complexity.
10453 @item iv-max-considered-uses
10454 The induction variable optimizations give up on loops that contain more
10455 induction variable uses.
10457 @item iv-always-prune-cand-set-bound
10458 If the number of candidates in the set is smaller than this value,
10459 always try to remove unnecessary ivs from the set
10460 when adding a new one.
10462 @item scev-max-expr-size
10463 Bound on size of expressions used in the scalar evolutions analyzer.
10464 Large expressions slow the analyzer.
10466 @item scev-max-expr-complexity
10467 Bound on the complexity of the expressions in the scalar evolutions analyzer.
10468 Complex expressions slow the analyzer.
10470 @item vect-max-version-for-alignment-checks
10471 The maximum number of run-time checks that can be performed when
10472 doing loop versioning for alignment in the vectorizer.
10474 @item vect-max-version-for-alias-checks
10475 The maximum number of run-time checks that can be performed when
10476 doing loop versioning for alias in the vectorizer.
10478 @item vect-max-peeling-for-alignment
10479 The maximum number of loop peels to enhance access alignment
10480 for vectorizer. Value -1 means 'no limit'.
10482 @item max-iterations-to-track
10483 The maximum number of iterations of a loop the brute-force algorithm
10484 for analysis of the number of iterations of the loop tries to evaluate.
10486 @item hot-bb-count-ws-permille
10487 A basic block profile count is considered hot if it contributes to 
10488 the given permillage (i.e. 0...1000) of the entire profiled execution.
10490 @item hot-bb-frequency-fraction
10491 Select fraction of the entry block frequency of executions of basic block in
10492 function given basic block needs to have to be considered hot.
10494 @item max-predicted-iterations
10495 The maximum number of loop iterations we predict statically.  This is useful
10496 in cases where a function contains a single loop with known bound and
10497 another loop with unknown bound.
10498 The known number of iterations is predicted correctly, while
10499 the unknown number of iterations average to roughly 10.  This means that the
10500 loop without bounds appears artificially cold relative to the other one.
10502 @item builtin-expect-probability
10503 Control the probability of the expression having the specified value. This
10504 parameter takes a percentage (i.e. 0 ... 100) as input.
10505 The default probability of 90 is obtained empirically.
10507 @item align-threshold
10509 Select fraction of the maximal frequency of executions of a basic block in
10510 a function to align the basic block.
10512 @item align-loop-iterations
10514 A loop expected to iterate at least the selected number of iterations is
10515 aligned.
10517 @item tracer-dynamic-coverage
10518 @itemx tracer-dynamic-coverage-feedback
10520 This value is used to limit superblock formation once the given percentage of
10521 executed instructions is covered.  This limits unnecessary code size
10522 expansion.
10524 The @option{tracer-dynamic-coverage-feedback} parameter
10525 is used only when profile
10526 feedback is available.  The real profiles (as opposed to statically estimated
10527 ones) are much less balanced allowing the threshold to be larger value.
10529 @item tracer-max-code-growth
10530 Stop tail duplication once code growth has reached given percentage.  This is
10531 a rather artificial limit, as most of the duplicates are eliminated later in
10532 cross jumping, so it may be set to much higher values than is the desired code
10533 growth.
10535 @item tracer-min-branch-ratio
10537 Stop reverse growth when the reverse probability of best edge is less than this
10538 threshold (in percent).
10540 @item tracer-min-branch-ratio
10541 @itemx tracer-min-branch-ratio-feedback
10543 Stop forward growth if the best edge has probability lower than this
10544 threshold.
10546 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
10547 compilation for profile feedback and one for compilation without.  The value
10548 for compilation with profile feedback needs to be more conservative (higher) in
10549 order to make tracer effective.
10551 @item max-cse-path-length
10553 The maximum number of basic blocks on path that CSE considers.
10554 The default is 10.
10556 @item max-cse-insns
10557 The maximum number of instructions CSE processes before flushing.
10558 The default is 1000.
10560 @item ggc-min-expand
10562 GCC uses a garbage collector to manage its own memory allocation.  This
10563 parameter specifies the minimum percentage by which the garbage
10564 collector's heap should be allowed to expand between collections.
10565 Tuning this may improve compilation speed; it has no effect on code
10566 generation.
10568 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
10569 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
10570 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
10571 GCC is not able to calculate RAM on a particular platform, the lower
10572 bound of 30% is used.  Setting this parameter and
10573 @option{ggc-min-heapsize} to zero causes a full collection to occur at
10574 every opportunity.  This is extremely slow, but can be useful for
10575 debugging.
10577 @item ggc-min-heapsize
10579 Minimum size of the garbage collector's heap before it begins bothering
10580 to collect garbage.  The first collection occurs after the heap expands
10581 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
10582 tuning this may improve compilation speed, and has no effect on code
10583 generation.
10585 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
10586 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
10587 with a lower bound of 4096 (four megabytes) and an upper bound of
10588 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
10589 particular platform, the lower bound is used.  Setting this parameter
10590 very large effectively disables garbage collection.  Setting this
10591 parameter and @option{ggc-min-expand} to zero causes a full collection
10592 to occur at every opportunity.
10594 @item max-reload-search-insns
10595 The maximum number of instruction reload should look backward for equivalent
10596 register.  Increasing values mean more aggressive optimization, making the
10597 compilation time increase with probably slightly better performance.
10598 The default value is 100.
10600 @item max-cselib-memory-locations
10601 The maximum number of memory locations cselib should take into account.
10602 Increasing values mean more aggressive optimization, making the compilation time
10603 increase with probably slightly better performance.  The default value is 500.
10605 @item reorder-blocks-duplicate
10606 @itemx reorder-blocks-duplicate-feedback
10608 Used by the basic block reordering pass to decide whether to use unconditional
10609 branch or duplicate the code on its destination.  Code is duplicated when its
10610 estimated size is smaller than this value multiplied by the estimated size of
10611 unconditional jump in the hot spots of the program.
10613 The @option{reorder-block-duplicate-feedback} parameter
10614 is used only when profile
10615 feedback is available.  It may be set to higher values than
10616 @option{reorder-block-duplicate} since information about the hot spots is more
10617 accurate.
10619 @item max-sched-ready-insns
10620 The maximum number of instructions ready to be issued the scheduler should
10621 consider at any given time during the first scheduling pass.  Increasing
10622 values mean more thorough searches, making the compilation time increase
10623 with probably little benefit.  The default value is 100.
10625 @item max-sched-region-blocks
10626 The maximum number of blocks in a region to be considered for
10627 interblock scheduling.  The default value is 10.
10629 @item max-pipeline-region-blocks
10630 The maximum number of blocks in a region to be considered for
10631 pipelining in the selective scheduler.  The default value is 15.
10633 @item max-sched-region-insns
10634 The maximum number of insns in a region to be considered for
10635 interblock scheduling.  The default value is 100.
10637 @item max-pipeline-region-insns
10638 The maximum number of insns in a region to be considered for
10639 pipelining in the selective scheduler.  The default value is 200.
10641 @item min-spec-prob
10642 The minimum probability (in percents) of reaching a source block
10643 for interblock speculative scheduling.  The default value is 40.
10645 @item max-sched-extend-regions-iters
10646 The maximum number of iterations through CFG to extend regions.
10647 A value of 0 (the default) disables region extensions.
10649 @item max-sched-insn-conflict-delay
10650 The maximum conflict delay for an insn to be considered for speculative motion.
10651 The default value is 3.
10653 @item sched-spec-prob-cutoff
10654 The minimal probability of speculation success (in percents), so that
10655 speculative insns are scheduled.
10656 The default value is 40.
10658 @item sched-spec-state-edge-prob-cutoff
10659 The minimum probability an edge must have for the scheduler to save its
10660 state across it.
10661 The default value is 10.
10663 @item sched-mem-true-dep-cost
10664 Minimal distance (in CPU cycles) between store and load targeting same
10665 memory locations.  The default value is 1.
10667 @item selsched-max-lookahead
10668 The maximum size of the lookahead window of selective scheduling.  It is a
10669 depth of search for available instructions.
10670 The default value is 50.
10672 @item selsched-max-sched-times
10673 The maximum number of times that an instruction is scheduled during
10674 selective scheduling.  This is the limit on the number of iterations
10675 through which the instruction may be pipelined.  The default value is 2.
10677 @item selsched-max-insns-to-rename
10678 The maximum number of best instructions in the ready list that are considered
10679 for renaming in the selective scheduler.  The default value is 2.
10681 @item sms-min-sc
10682 The minimum value of stage count that swing modulo scheduler
10683 generates.  The default value is 2.
10685 @item max-last-value-rtl
10686 The maximum size measured as number of RTLs that can be recorded in an expression
10687 in combiner for a pseudo register as last known value of that register.  The default
10688 is 10000.
10690 @item max-combine-insns
10691 The maximum number of instructions the RTL combiner tries to combine.
10692 The default value is 2 at @option{-Og} and 4 otherwise.
10694 @item integer-share-limit
10695 Small integer constants can use a shared data structure, reducing the
10696 compiler's memory usage and increasing its speed.  This sets the maximum
10697 value of a shared integer constant.  The default value is 256.
10699 @item ssp-buffer-size
10700 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
10701 protection when @option{-fstack-protection} is used.
10703 @item min-size-for-stack-sharing
10704 The minimum size of variables taking part in stack slot sharing when not
10705 optimizing. The default value is 32.
10707 @item max-jump-thread-duplication-stmts
10708 Maximum number of statements allowed in a block that needs to be
10709 duplicated when threading jumps.
10711 @item max-fields-for-field-sensitive
10712 Maximum number of fields in a structure treated in
10713 a field sensitive manner during pointer analysis.  The default is zero
10714 for @option{-O0} and @option{-O1},
10715 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
10717 @item prefetch-latency
10718 Estimate on average number of instructions that are executed before
10719 prefetch finishes.  The distance prefetched ahead is proportional
10720 to this constant.  Increasing this number may also lead to less
10721 streams being prefetched (see @option{simultaneous-prefetches}).
10723 @item simultaneous-prefetches
10724 Maximum number of prefetches that can run at the same time.
10726 @item l1-cache-line-size
10727 The size of cache line in L1 cache, in bytes.
10729 @item l1-cache-size
10730 The size of L1 cache, in kilobytes.
10732 @item l2-cache-size
10733 The size of L2 cache, in kilobytes.
10735 @item min-insn-to-prefetch-ratio
10736 The minimum ratio between the number of instructions and the
10737 number of prefetches to enable prefetching in a loop.
10739 @item prefetch-min-insn-to-mem-ratio
10740 The minimum ratio between the number of instructions and the
10741 number of memory references to enable prefetching in a loop.
10743 @item use-canonical-types
10744 Whether the compiler should use the ``canonical'' type system.  By
10745 default, this should always be 1, which uses a more efficient internal
10746 mechanism for comparing types in C++ and Objective-C++.  However, if
10747 bugs in the canonical type system are causing compilation failures,
10748 set this value to 0 to disable canonical types.
10750 @item switch-conversion-max-branch-ratio
10751 Switch initialization conversion refuses to create arrays that are
10752 bigger than @option{switch-conversion-max-branch-ratio} times the number of
10753 branches in the switch.
10755 @item max-partial-antic-length
10756 Maximum length of the partial antic set computed during the tree
10757 partial redundancy elimination optimization (@option{-ftree-pre}) when
10758 optimizing at @option{-O3} and above.  For some sorts of source code
10759 the enhanced partial redundancy elimination optimization can run away,
10760 consuming all of the memory available on the host machine.  This
10761 parameter sets a limit on the length of the sets that are computed,
10762 which prevents the runaway behavior.  Setting a value of 0 for
10763 this parameter allows an unlimited set length.
10765 @item sccvn-max-scc-size
10766 Maximum size of a strongly connected component (SCC) during SCCVN
10767 processing.  If this limit is hit, SCCVN processing for the whole
10768 function is not done and optimizations depending on it are
10769 disabled.  The default maximum SCC size is 10000.
10771 @item sccvn-max-alias-queries-per-access
10772 Maximum number of alias-oracle queries we perform when looking for
10773 redundancies for loads and stores.  If this limit is hit the search
10774 is aborted and the load or store is not considered redundant.  The
10775 number of queries is algorithmically limited to the number of
10776 stores on all paths from the load to the function entry.
10777 The default maxmimum number of queries is 1000.
10779 @item ira-max-loops-num
10780 IRA uses regional register allocation by default.  If a function
10781 contains more loops than the number given by this parameter, only at most
10782 the given number of the most frequently-executed loops form regions
10783 for regional register allocation.  The default value of the
10784 parameter is 100.
10786 @item ira-max-conflict-table-size 
10787 Although IRA uses a sophisticated algorithm to compress the conflict
10788 table, the table can still require excessive amounts of memory for
10789 huge functions.  If the conflict table for a function could be more
10790 than the size in MB given by this parameter, the register allocator
10791 instead uses a faster, simpler, and lower-quality
10792 algorithm that does not require building a pseudo-register conflict table.  
10793 The default value of the parameter is 2000.
10795 @item ira-loop-reserved-regs
10796 IRA can be used to evaluate more accurate register pressure in loops
10797 for decisions to move loop invariants (see @option{-O3}).  The number
10798 of available registers reserved for some other purposes is given
10799 by this parameter.  The default value of the parameter is 2, which is
10800 the minimal number of registers needed by typical instructions.
10801 This value is the best found from numerous experiments.
10803 @item lra-inheritance-ebb-probability-cutoff
10804 LRA tries to reuse values reloaded in registers in subsequent insns.
10805 This optimization is called inheritance.  EBB is used as a region to
10806 do this optimization.  The parameter defines a minimal fall-through
10807 edge probability in percentage used to add BB to inheritance EBB in
10808 LRA.  The default value of the parameter is 40.  The value was chosen
10809 from numerous runs of SPEC2000 on x86-64.
10811 @item loop-invariant-max-bbs-in-loop
10812 Loop invariant motion can be very expensive, both in compilation time and
10813 in amount of needed compile-time memory, with very large loops.  Loops
10814 with more basic blocks than this parameter won't have loop invariant
10815 motion optimization performed on them.  The default value of the
10816 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
10818 @item loop-max-datarefs-for-datadeps
10819 Building data dapendencies is expensive for very large loops.  This
10820 parameter limits the number of data references in loops that are
10821 considered for data dependence analysis.  These large loops are no
10822 handled by the optimizations using loop data dependencies.
10823 The default value is 1000.
10825 @item max-vartrack-size
10826 Sets a maximum number of hash table slots to use during variable
10827 tracking dataflow analysis of any function.  If this limit is exceeded
10828 with variable tracking at assignments enabled, analysis for that
10829 function is retried without it, after removing all debug insns from
10830 the function.  If the limit is exceeded even without debug insns, var
10831 tracking analysis is completely disabled for the function.  Setting
10832 the parameter to zero makes it unlimited.
10834 @item max-vartrack-expr-depth
10835 Sets a maximum number of recursion levels when attempting to map
10836 variable names or debug temporaries to value expressions.  This trades
10837 compilation time for more complete debug information.  If this is set too
10838 low, value expressions that are available and could be represented in
10839 debug information may end up not being used; setting this higher may
10840 enable the compiler to find more complex debug expressions, but compile
10841 time and memory use may grow.  The default is 12.
10843 @item min-nondebug-insn-uid
10844 Use uids starting at this parameter for nondebug insns.  The range below
10845 the parameter is reserved exclusively for debug insns created by
10846 @option{-fvar-tracking-assignments}, but debug insns may get
10847 (non-overlapping) uids above it if the reserved range is exhausted.
10849 @item ipa-sra-ptr-growth-factor
10850 IPA-SRA replaces a pointer to an aggregate with one or more new
10851 parameters only when their cumulative size is less or equal to
10852 @option{ipa-sra-ptr-growth-factor} times the size of the original
10853 pointer parameter.
10855 @item sra-max-scalarization-size-Ospeed
10856 @item sra-max-scalarization-size-Osize
10857 The two Scalar Reduction of Aggregates passes (SRA and IPA-SRA) aim to
10858 replace scalar parts of aggregates with uses of independent scalar
10859 variables.  These parameters control the maximum size, in storage units,
10860 of aggregate which is considered for replacement when compiling for
10861 speed
10862 (@option{sra-max-scalarization-size-Ospeed}) or size
10863 (@option{sra-max-scalarization-size-Osize}) respectively.
10865 @item tm-max-aggregate-size
10866 When making copies of thread-local variables in a transaction, this
10867 parameter specifies the size in bytes after which variables are
10868 saved with the logging functions as opposed to save/restore code
10869 sequence pairs.  This option only applies when using
10870 @option{-fgnu-tm}.
10872 @item graphite-max-nb-scop-params
10873 To avoid exponential effects in the Graphite loop transforms, the
10874 number of parameters in a Static Control Part (SCoP) is bounded.  The
10875 default value is 10 parameters.  A variable whose value is unknown at
10876 compilation time and defined outside a SCoP is a parameter of the SCoP.
10878 @item graphite-max-bbs-per-function
10879 To avoid exponential effects in the detection of SCoPs, the size of
10880 the functions analyzed by Graphite is bounded.  The default value is
10881 100 basic blocks.
10883 @item loop-block-tile-size
10884 Loop blocking or strip mining transforms, enabled with
10885 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
10886 loop in the loop nest by a given number of iterations.  The strip
10887 length can be changed using the @option{loop-block-tile-size}
10888 parameter.  The default value is 51 iterations.
10890 @item loop-unroll-jam-size
10891 Specify the unroll factor for the @option{-floop-unroll-and-jam} option.  The 
10892 default value is 4.
10894 @item loop-unroll-jam-depth
10895 Specify the dimension to be unrolled (counting from the most inner loop)
10896 for the  @option{-floop-unroll-and-jam}.  The default value is 2.
10898 @item ipa-cp-value-list-size
10899 IPA-CP attempts to track all possible values and types passed to a function's
10900 parameter in order to propagate them and perform devirtualization.
10901 @option{ipa-cp-value-list-size} is the maximum number of values and types it
10902 stores per one formal parameter of a function.
10904 @item ipa-cp-eval-threshold
10905 IPA-CP calculates its own score of cloning profitability heuristics
10906 and performs those cloning opportunities with scores that exceed
10907 @option{ipa-cp-eval-threshold}.
10909 @item ipa-cp-recursion-penalty
10910 Percentage penalty the recursive functions will receive when they
10911 are evaluated for cloning.
10913 @item ipa-cp-single-call-penalty
10914 Percentage penalty functions containg a single call to another
10915 function will receive when they are evaluated for cloning.
10918 @item ipa-max-agg-items
10919 IPA-CP is also capable to propagate a number of scalar values passed
10920 in an aggregate. @option{ipa-max-agg-items} controls the maximum
10921 number of such values per one parameter.
10923 @item ipa-cp-loop-hint-bonus
10924 When IPA-CP determines that a cloning candidate would make the number
10925 of iterations of a loop known, it adds a bonus of
10926 @option{ipa-cp-loop-hint-bonus} to the profitability score of
10927 the candidate.
10929 @item ipa-cp-array-index-hint-bonus
10930 When IPA-CP determines that a cloning candidate would make the index of
10931 an array access known, it adds a bonus of
10932 @option{ipa-cp-array-index-hint-bonus} to the profitability
10933 score of the candidate.
10935 @item ipa-max-aa-steps
10936 During its analysis of function bodies, IPA-CP employs alias analysis
10937 in order to track values pointed to by function parameters.  In order
10938 not spend too much time analyzing huge functions, it gives up and
10939 consider all memory clobbered after examining
10940 @option{ipa-max-aa-steps} statements modifying memory.
10942 @item lto-partitions
10943 Specify desired number of partitions produced during WHOPR compilation.
10944 The number of partitions should exceed the number of CPUs used for compilation.
10945 The default value is 32.
10947 @item lto-minpartition
10948 Size of minimal partition for WHOPR (in estimated instructions).
10949 This prevents expenses of splitting very small programs into too many
10950 partitions.
10952 @item cxx-max-namespaces-for-diagnostic-help
10953 The maximum number of namespaces to consult for suggestions when C++
10954 name lookup fails for an identifier.  The default is 1000.
10956 @item sink-frequency-threshold
10957 The maximum relative execution frequency (in percents) of the target block
10958 relative to a statement's original block to allow statement sinking of a
10959 statement.  Larger numbers result in more aggressive statement sinking.
10960 The default value is 75.  A small positive adjustment is applied for
10961 statements with memory operands as those are even more profitable so sink.
10963 @item max-stores-to-sink
10964 The maximum number of conditional stores paires that can be sunk.  Set to 0
10965 if either vectorization (@option{-ftree-vectorize}) or if-conversion
10966 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
10968 @item allow-store-data-races
10969 Allow optimizers to introduce new data races on stores.
10970 Set to 1 to allow, otherwise to 0.  This option is enabled by default
10971 at optimization level @option{-Ofast}.
10973 @item case-values-threshold
10974 The smallest number of different values for which it is best to use a
10975 jump-table instead of a tree of conditional branches.  If the value is
10976 0, use the default for the machine.  The default is 0.
10978 @item tree-reassoc-width
10979 Set the maximum number of instructions executed in parallel in
10980 reassociated tree. This parameter overrides target dependent
10981 heuristics used by default if has non zero value.
10983 @item sched-pressure-algorithm
10984 Choose between the two available implementations of
10985 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
10986 and is the more likely to prevent instructions from being reordered.
10987 Algorithm 2 was designed to be a compromise between the relatively
10988 conservative approach taken by algorithm 1 and the rather aggressive
10989 approach taken by the default scheduler.  It relies more heavily on
10990 having a regular register file and accurate register pressure classes.
10991 See @file{haifa-sched.c} in the GCC sources for more details.
10993 The default choice depends on the target.
10995 @item max-slsr-cand-scan
10996 Set the maximum number of existing candidates that are considered when
10997 seeking a basis for a new straight-line strength reduction candidate.
10999 @item asan-globals
11000 Enable buffer overflow detection for global objects.  This kind
11001 of protection is enabled by default if you are using
11002 @option{-fsanitize=address} option.
11003 To disable global objects protection use @option{--param asan-globals=0}.
11005 @item asan-stack
11006 Enable buffer overflow detection for stack objects.  This kind of
11007 protection is enabled by default when using@option{-fsanitize=address}.
11008 To disable stack protection use @option{--param asan-stack=0} option.
11010 @item asan-instrument-reads
11011 Enable buffer overflow detection for memory reads.  This kind of
11012 protection is enabled by default when using @option{-fsanitize=address}.
11013 To disable memory reads protection use
11014 @option{--param asan-instrument-reads=0}.
11016 @item asan-instrument-writes
11017 Enable buffer overflow detection for memory writes.  This kind of
11018 protection is enabled by default when using @option{-fsanitize=address}.
11019 To disable memory writes protection use
11020 @option{--param asan-instrument-writes=0} option.
11022 @item asan-memintrin
11023 Enable detection for built-in functions.  This kind of protection
11024 is enabled by default when using @option{-fsanitize=address}.
11025 To disable built-in functions protection use
11026 @option{--param asan-memintrin=0}.
11028 @item asan-use-after-return
11029 Enable detection of use-after-return.  This kind of protection
11030 is enabled by default when using @option{-fsanitize=address} option.
11031 To disable use-after-return detection use 
11032 @option{--param asan-use-after-return=0}.
11034 @item asan-instrumentation-with-call-threshold
11035 If number of memory accesses in function being instrumented
11036 is greater or equal to this number, use callbacks instead of inline checks.
11037 E.g. to disable inline code use
11038 @option{--param asan-instrumentation-with-call-threshold=0}.
11040 @item chkp-max-ctor-size
11041 Static constructors generated by Pointer Bounds Checker may become very
11042 large and significantly increase compile time at optimization level
11043 @option{-O1} and higher.  This parameter is a maximum nubmer of statements
11044 in a single generated constructor.  Default value is 5000.
11046 @item max-fsm-thread-path-insns
11047 Maximum number of instructions to copy when duplicating blocks on a
11048 finite state automaton jump thread path.  The default is 100.
11050 @item max-fsm-thread-length
11051 Maximum number of basic blocks on a finite state automaton jump thread
11052 path.  The default is 10.
11054 @item max-fsm-thread-paths
11055 Maximum number of new jump thread paths to create for a finite state
11056 automaton.  The default is 50.
11058 @end table
11059 @end table
11061 @node Preprocessor Options
11062 @section Options Controlling the Preprocessor
11063 @cindex preprocessor options
11064 @cindex options, preprocessor
11066 These options control the C preprocessor, which is run on each C source
11067 file before actual compilation.
11069 If you use the @option{-E} option, nothing is done except preprocessing.
11070 Some of these options make sense only together with @option{-E} because
11071 they cause the preprocessor output to be unsuitable for actual
11072 compilation.
11074 @table @gcctabopt
11075 @item -Wp,@var{option}
11076 @opindex Wp
11077 You can use @option{-Wp,@var{option}} to bypass the compiler driver
11078 and pass @var{option} directly through to the preprocessor.  If
11079 @var{option} contains commas, it is split into multiple options at the
11080 commas.  However, many options are modified, translated or interpreted
11081 by the compiler driver before being passed to the preprocessor, and
11082 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
11083 interface is undocumented and subject to change, so whenever possible
11084 you should avoid using @option{-Wp} and let the driver handle the
11085 options instead.
11087 @item -Xpreprocessor @var{option}
11088 @opindex Xpreprocessor
11089 Pass @var{option} as an option to the preprocessor.  You can use this to
11090 supply system-specific preprocessor options that GCC does not 
11091 recognize.
11093 If you want to pass an option that takes an argument, you must use
11094 @option{-Xpreprocessor} twice, once for the option and once for the argument.
11096 @item -no-integrated-cpp
11097 @opindex no-integrated-cpp
11098 Perform preprocessing as a separate pass before compilation.
11099 By default, GCC performs preprocessing as an integrated part of
11100 input tokenization and parsing.
11101 If this option is provided, the appropriate language front end
11102 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
11103 and Objective-C, respectively) is instead invoked twice,
11104 once for preprocessing only and once for actual compilation
11105 of the preprocessed input.
11106 This option may be useful in conjunction with the @option{-B} or
11107 @option{-wrapper} options to specify an alternate preprocessor or
11108 perform additional processing of the program source between
11109 normal preprocessing and compilation.
11110 @end table
11112 @include cppopts.texi
11114 @node Assembler Options
11115 @section Passing Options to the Assembler
11117 @c prevent bad page break with this line
11118 You can pass options to the assembler.
11120 @table @gcctabopt
11121 @item -Wa,@var{option}
11122 @opindex Wa
11123 Pass @var{option} as an option to the assembler.  If @var{option}
11124 contains commas, it is split into multiple options at the commas.
11126 @item -Xassembler @var{option}
11127 @opindex Xassembler
11128 Pass @var{option} as an option to the assembler.  You can use this to
11129 supply system-specific assembler options that GCC does not
11130 recognize.
11132 If you want to pass an option that takes an argument, you must use
11133 @option{-Xassembler} twice, once for the option and once for the argument.
11135 @end table
11137 @node Link Options
11138 @section Options for Linking
11139 @cindex link options
11140 @cindex options, linking
11142 These options come into play when the compiler links object files into
11143 an executable output file.  They are meaningless if the compiler is
11144 not doing a link step.
11146 @table @gcctabopt
11147 @cindex file names
11148 @item @var{object-file-name}
11149 A file name that does not end in a special recognized suffix is
11150 considered to name an object file or library.  (Object files are
11151 distinguished from libraries by the linker according to the file
11152 contents.)  If linking is done, these object files are used as input
11153 to the linker.
11155 @item -c
11156 @itemx -S
11157 @itemx -E
11158 @opindex c
11159 @opindex S
11160 @opindex E
11161 If any of these options is used, then the linker is not run, and
11162 object file names should not be used as arguments.  @xref{Overall
11163 Options}.
11165 @item -fuse-ld=bfd
11166 @opindex fuse-ld=bfd
11167 Use the @command{bfd} linker instead of the default linker.
11169 @item -fuse-ld=gold
11170 @opindex fuse-ld=gold
11171 Use the @command{gold} linker instead of the default linker.
11173 @cindex Libraries
11174 @item -l@var{library}
11175 @itemx -l @var{library}
11176 @opindex l
11177 Search the library named @var{library} when linking.  (The second
11178 alternative with the library as a separate argument is only for
11179 POSIX compliance and is not recommended.)
11181 It makes a difference where in the command you write this option; the
11182 linker searches and processes libraries and object files in the order they
11183 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
11184 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
11185 to functions in @samp{z}, those functions may not be loaded.
11187 The linker searches a standard list of directories for the library,
11188 which is actually a file named @file{lib@var{library}.a}.  The linker
11189 then uses this file as if it had been specified precisely by name.
11191 The directories searched include several standard system directories
11192 plus any that you specify with @option{-L}.
11194 Normally the files found this way are library files---archive files
11195 whose members are object files.  The linker handles an archive file by
11196 scanning through it for members which define symbols that have so far
11197 been referenced but not defined.  But if the file that is found is an
11198 ordinary object file, it is linked in the usual fashion.  The only
11199 difference between using an @option{-l} option and specifying a file name
11200 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
11201 and searches several directories.
11203 @item -lobjc
11204 @opindex lobjc
11205 You need this special case of the @option{-l} option in order to
11206 link an Objective-C or Objective-C++ program.
11208 @item -nostartfiles
11209 @opindex nostartfiles
11210 Do not use the standard system startup files when linking.
11211 The standard system libraries are used normally, unless @option{-nostdlib}
11212 or @option{-nodefaultlibs} is used.
11214 @item -nodefaultlibs
11215 @opindex nodefaultlibs
11216 Do not use the standard system libraries when linking.
11217 Only the libraries you specify are passed to the linker, and options
11218 specifying linkage of the system libraries, such as @option{-static-libgcc}
11219 or @option{-shared-libgcc}, are ignored.  
11220 The standard startup files are used normally, unless @option{-nostartfiles}
11221 is used.  
11223 The compiler may generate calls to @code{memcmp},
11224 @code{memset}, @code{memcpy} and @code{memmove}.
11225 These entries are usually resolved by entries in
11226 libc.  These entry points should be supplied through some other
11227 mechanism when this option is specified.
11229 @item -nostdlib
11230 @opindex nostdlib
11231 Do not use the standard system startup files or libraries when linking.
11232 No startup files and only the libraries you specify are passed to
11233 the linker, and options specifying linkage of the system libraries, such as
11234 @option{-static-libgcc} or @option{-shared-libgcc}, are ignored.
11236 The compiler may generate calls to @code{memcmp}, @code{memset},
11237 @code{memcpy} and @code{memmove}.
11238 These entries are usually resolved by entries in
11239 libc.  These entry points should be supplied through some other
11240 mechanism when this option is specified.
11242 @cindex @option{-lgcc}, use with @option{-nostdlib}
11243 @cindex @option{-nostdlib} and unresolved references
11244 @cindex unresolved references and @option{-nostdlib}
11245 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
11246 @cindex @option{-nodefaultlibs} and unresolved references
11247 @cindex unresolved references and @option{-nodefaultlibs}
11248 One of the standard libraries bypassed by @option{-nostdlib} and
11249 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
11250 which GCC uses to overcome shortcomings of particular machines, or special
11251 needs for some languages.
11252 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
11253 Collection (GCC) Internals},
11254 for more discussion of @file{libgcc.a}.)
11255 In most cases, you need @file{libgcc.a} even when you want to avoid
11256 other standard libraries.  In other words, when you specify @option{-nostdlib}
11257 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
11258 This ensures that you have no unresolved references to internal GCC
11259 library subroutines.
11260 (An example of such an internal subroutine is @code{__main}, used to ensure C++
11261 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
11262 GNU Compiler Collection (GCC) Internals}.)
11264 @item -pie
11265 @opindex pie
11266 Produce a position independent executable on targets that support it.
11267 For predictable results, you must also specify the same set of options
11268 used for compilation (@option{-fpie}, @option{-fPIE},
11269 or model suboptions) when you specify this linker option.
11271 @item -no-pie
11272 @opindex no-pie
11273 Don't produce a position independent executable.
11275 @item -rdynamic
11276 @opindex rdynamic
11277 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
11278 that support it. This instructs the linker to add all symbols, not
11279 only used ones, to the dynamic symbol table. This option is needed
11280 for some uses of @code{dlopen} or to allow obtaining backtraces
11281 from within a program.
11283 @item -s
11284 @opindex s
11285 Remove all symbol table and relocation information from the executable.
11287 @item -static
11288 @opindex static
11289 On systems that support dynamic linking, this prevents linking with the shared
11290 libraries.  On other systems, this option has no effect.
11292 @item -shared
11293 @opindex shared
11294 Produce a shared object which can then be linked with other objects to
11295 form an executable.  Not all systems support this option.  For predictable
11296 results, you must also specify the same set of options used for compilation
11297 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
11298 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
11299 needs to build supplementary stub code for constructors to work.  On
11300 multi-libbed systems, @samp{gcc -shared} must select the correct support
11301 libraries to link against.  Failing to supply the correct flags may lead
11302 to subtle defects.  Supplying them in cases where they are not necessary
11303 is innocuous.}
11305 @item -shared-libgcc
11306 @itemx -static-libgcc
11307 @opindex shared-libgcc
11308 @opindex static-libgcc
11309 On systems that provide @file{libgcc} as a shared library, these options
11310 force the use of either the shared or static version, respectively.
11311 If no shared version of @file{libgcc} was built when the compiler was
11312 configured, these options have no effect.
11314 There are several situations in which an application should use the
11315 shared @file{libgcc} instead of the static version.  The most common
11316 of these is when the application wishes to throw and catch exceptions
11317 across different shared libraries.  In that case, each of the libraries
11318 as well as the application itself should use the shared @file{libgcc}.
11320 Therefore, the G++ and GCJ drivers automatically add
11321 @option{-shared-libgcc} whenever you build a shared library or a main
11322 executable, because C++ and Java programs typically use exceptions, so
11323 this is the right thing to do.
11325 If, instead, you use the GCC driver to create shared libraries, you may
11326 find that they are not always linked with the shared @file{libgcc}.
11327 If GCC finds, at its configuration time, that you have a non-GNU linker
11328 or a GNU linker that does not support option @option{--eh-frame-hdr},
11329 it links the shared version of @file{libgcc} into shared libraries
11330 by default.  Otherwise, it takes advantage of the linker and optimizes
11331 away the linking with the shared version of @file{libgcc}, linking with
11332 the static version of libgcc by default.  This allows exceptions to
11333 propagate through such shared libraries, without incurring relocation
11334 costs at library load time.
11336 However, if a library or main executable is supposed to throw or catch
11337 exceptions, you must link it using the G++ or GCJ driver, as appropriate
11338 for the languages used in the program, or using the option
11339 @option{-shared-libgcc}, such that it is linked with the shared
11340 @file{libgcc}.
11342 @item -static-libasan
11343 @opindex static-libasan
11344 When the @option{-fsanitize=address} option is used to link a program,
11345 the GCC driver automatically links against @option{libasan}.  If
11346 @file{libasan} is available as a shared library, and the @option{-static}
11347 option is not used, then this links against the shared version of
11348 @file{libasan}.  The @option{-static-libasan} option directs the GCC
11349 driver to link @file{libasan} statically, without necessarily linking
11350 other libraries statically.
11352 @item -static-libtsan
11353 @opindex static-libtsan
11354 When the @option{-fsanitize=thread} option is used to link a program,
11355 the GCC driver automatically links against @option{libtsan}.  If
11356 @file{libtsan} is available as a shared library, and the @option{-static}
11357 option is not used, then this links against the shared version of
11358 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
11359 driver to link @file{libtsan} statically, without necessarily linking
11360 other libraries statically.
11362 @item -static-liblsan
11363 @opindex static-liblsan
11364 When the @option{-fsanitize=leak} option is used to link a program,
11365 the GCC driver automatically links against @option{liblsan}.  If
11366 @file{liblsan} is available as a shared library, and the @option{-static}
11367 option is not used, then this links against the shared version of
11368 @file{liblsan}.  The @option{-static-liblsan} option directs the GCC
11369 driver to link @file{liblsan} statically, without necessarily linking
11370 other libraries statically.
11372 @item -static-libubsan
11373 @opindex static-libubsan
11374 When the @option{-fsanitize=undefined} option is used to link a program,
11375 the GCC driver automatically links against @option{libubsan}.  If
11376 @file{libubsan} is available as a shared library, and the @option{-static}
11377 option is not used, then this links against the shared version of
11378 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
11379 driver to link @file{libubsan} statically, without necessarily linking
11380 other libraries statically.
11382 @item -static-libmpx
11383 @opindex static-libmpx
11384 When the @option{-fcheck-pointer bounds} and @option{-mmpx} options are
11385 used to link a program, the GCC driver automatically links against
11386 @file{libmpx}.  If @file{libmpx} is available as a shared library,
11387 and the @option{-static} option is not used, then this links against
11388 the shared version of @file{libmpx}.  The @option{-static-libmpx}
11389 option directs the GCC driver to link @file{libmpx} statically,
11390 without necessarily linking other libraries statically.
11392 @item -static-libmpxwrappers
11393 @opindex static-libmpxwrappers
11394 When the @option{-fcheck-pointer bounds} and @option{-mmpx} options are used
11395 to link a program without also using @option{-fno-chkp-use-wrappers}, the
11396 GCC driver automatically links against @file{libmpxwrappers}.  If
11397 @file{libmpxwrappers} is available as a shared library, and the
11398 @option{-static} option is not used, then this links against the shared
11399 version of @file{libmpxwrappers}.  The @option{-static-libmpxwrappers}
11400 option directs the GCC driver to link @file{libmpxwrappers} statically,
11401 without necessarily linking other libraries statically.
11403 @item -static-libstdc++
11404 @opindex static-libstdc++
11405 When the @command{g++} program is used to link a C++ program, it
11406 normally automatically links against @option{libstdc++}.  If
11407 @file{libstdc++} is available as a shared library, and the
11408 @option{-static} option is not used, then this links against the
11409 shared version of @file{libstdc++}.  That is normally fine.  However, it
11410 is sometimes useful to freeze the version of @file{libstdc++} used by
11411 the program without going all the way to a fully static link.  The
11412 @option{-static-libstdc++} option directs the @command{g++} driver to
11413 link @file{libstdc++} statically, without necessarily linking other
11414 libraries statically.
11416 @item -symbolic
11417 @opindex symbolic
11418 Bind references to global symbols when building a shared object.  Warn
11419 about any unresolved references (unless overridden by the link editor
11420 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
11421 this option.
11423 @item -T @var{script}
11424 @opindex T
11425 @cindex linker script
11426 Use @var{script} as the linker script.  This option is supported by most
11427 systems using the GNU linker.  On some targets, such as bare-board
11428 targets without an operating system, the @option{-T} option may be required
11429 when linking to avoid references to undefined symbols.
11431 @item -Xlinker @var{option}
11432 @opindex Xlinker
11433 Pass @var{option} as an option to the linker.  You can use this to
11434 supply system-specific linker options that GCC does not recognize.
11436 If you want to pass an option that takes a separate argument, you must use
11437 @option{-Xlinker} twice, once for the option and once for the argument.
11438 For example, to pass @option{-assert definitions}, you must write
11439 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
11440 @option{-Xlinker "-assert definitions"}, because this passes the entire
11441 string as a single argument, which is not what the linker expects.
11443 When using the GNU linker, it is usually more convenient to pass
11444 arguments to linker options using the @option{@var{option}=@var{value}}
11445 syntax than as separate arguments.  For example, you can specify
11446 @option{-Xlinker -Map=output.map} rather than
11447 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
11448 this syntax for command-line options.
11450 @item -Wl,@var{option}
11451 @opindex Wl
11452 Pass @var{option} as an option to the linker.  If @var{option} contains
11453 commas, it is split into multiple options at the commas.  You can use this
11454 syntax to pass an argument to the option.
11455 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
11456 linker.  When using the GNU linker, you can also get the same effect with
11457 @option{-Wl,-Map=output.map}.
11459 @item -u @var{symbol}
11460 @opindex u
11461 Pretend the symbol @var{symbol} is undefined, to force linking of
11462 library modules to define it.  You can use @option{-u} multiple times with
11463 different symbols to force loading of additional library modules.
11465 @item -z @var{keyword}
11466 @opindex z
11467 @option{-z} is passed directly on to the linker along with the keyword
11468 @var{keyword}. See the section in the documentation of your linker for
11469 permitted values and their meanings.
11470 @end table
11472 @node Directory Options
11473 @section Options for Directory Search
11474 @cindex directory options
11475 @cindex options, directory search
11476 @cindex search path
11478 These options specify directories to search for header files, for
11479 libraries and for parts of the compiler:
11481 @table @gcctabopt
11482 @item -I@var{dir}
11483 @opindex I
11484 Add the directory @var{dir} to the head of the list of directories to be
11485 searched for header files.  This can be used to override a system header
11486 file, substituting your own version, since these directories are
11487 searched before the system header file directories.  However, you should
11488 not use this option to add directories that contain vendor-supplied
11489 system header files (use @option{-isystem} for that).  If you use more than
11490 one @option{-I} option, the directories are scanned in left-to-right
11491 order; the standard system directories come after.
11493 If a standard system include directory, or a directory specified with
11494 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
11495 option is ignored.  The directory is still searched but as a
11496 system directory at its normal position in the system include chain.
11497 This is to ensure that GCC's procedure to fix buggy system headers and
11498 the ordering for the @code{include_next} directive are not inadvertently changed.
11499 If you really need to change the search order for system directories,
11500 use the @option{-nostdinc} and/or @option{-isystem} options.
11502 @item -iplugindir=@var{dir}
11503 @opindex iplugindir=
11504 Set the directory to search for plugins that are passed
11505 by @option{-fplugin=@var{name}} instead of
11506 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
11507 to be used by the user, but only passed by the driver.
11509 @item -iquote@var{dir}
11510 @opindex iquote
11511 Add the directory @var{dir} to the head of the list of directories to
11512 be searched for header files only for the case of @code{#include
11513 "@var{file}"}; they are not searched for @code{#include <@var{file}>},
11514 otherwise just like @option{-I}.
11516 @item -L@var{dir}
11517 @opindex L
11518 Add directory @var{dir} to the list of directories to be searched
11519 for @option{-l}.
11521 @item -B@var{prefix}
11522 @opindex B
11523 This option specifies where to find the executables, libraries,
11524 include files, and data files of the compiler itself.
11526 The compiler driver program runs one or more of the subprograms
11527 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
11528 @var{prefix} as a prefix for each program it tries to run, both with and
11529 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
11531 For each subprogram to be run, the compiler driver first tries the
11532 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
11533 is not specified, the driver tries two standard prefixes, 
11534 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
11535 those results in a file name that is found, the unmodified program
11536 name is searched for using the directories specified in your
11537 @env{PATH} environment variable.
11539 The compiler checks to see if the path provided by @option{-B}
11540 refers to a directory, and if necessary it adds a directory
11541 separator character at the end of the path.
11543 @option{-B} prefixes that effectively specify directory names also apply
11544 to libraries in the linker, because the compiler translates these
11545 options into @option{-L} options for the linker.  They also apply to
11546 include files in the preprocessor, because the compiler translates these
11547 options into @option{-isystem} options for the preprocessor.  In this case,
11548 the compiler appends @samp{include} to the prefix.
11550 The runtime support file @file{libgcc.a} can also be searched for using
11551 the @option{-B} prefix, if needed.  If it is not found there, the two
11552 standard prefixes above are tried, and that is all.  The file is left
11553 out of the link if it is not found by those means.
11555 Another way to specify a prefix much like the @option{-B} prefix is to use
11556 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
11557 Variables}.
11559 As a special kludge, if the path provided by @option{-B} is
11560 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
11561 9, then it is replaced by @file{[dir/]include}.  This is to help
11562 with boot-strapping the compiler.
11564 @item -specs=@var{file}
11565 @opindex specs
11566 Process @var{file} after the compiler reads in the standard @file{specs}
11567 file, in order to override the defaults which the @command{gcc} driver
11568 program uses when determining what switches to pass to @command{cc1},
11569 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
11570 @option{-specs=@var{file}} can be specified on the command line, and they
11571 are processed in order, from left to right.
11573 @item --sysroot=@var{dir}
11574 @opindex sysroot
11575 Use @var{dir} as the logical root directory for headers and libraries.
11576 For example, if the compiler normally searches for headers in
11577 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
11578 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
11580 If you use both this option and the @option{-isysroot} option, then
11581 the @option{--sysroot} option applies to libraries, but the
11582 @option{-isysroot} option applies to header files.
11584 The GNU linker (beginning with version 2.16) has the necessary support
11585 for this option.  If your linker does not support this option, the
11586 header file aspect of @option{--sysroot} still works, but the
11587 library aspect does not.
11589 @item --no-sysroot-suffix
11590 @opindex no-sysroot-suffix
11591 For some targets, a suffix is added to the root directory specified
11592 with @option{--sysroot}, depending on the other options used, so that
11593 headers may for example be found in
11594 @file{@var{dir}/@var{suffix}/usr/include} instead of
11595 @file{@var{dir}/usr/include}.  This option disables the addition of
11596 such a suffix.
11598 @item -I-
11599 @opindex I-
11600 This option has been deprecated.  Please use @option{-iquote} instead for
11601 @option{-I} directories before the @option{-I-} and remove the @option{-I-}
11602 option.
11603 Any directories you specify with @option{-I} options before the @option{-I-}
11604 option are searched only for the case of @code{#include "@var{file}"};
11605 they are not searched for @code{#include <@var{file}>}.
11607 If additional directories are specified with @option{-I} options after
11608 the @option{-I-} option, these directories are searched for all @code{#include}
11609 directives.  (Ordinarily @emph{all} @option{-I} directories are used
11610 this way.)
11612 In addition, the @option{-I-} option inhibits the use of the current
11613 directory (where the current input file came from) as the first search
11614 directory for @code{#include "@var{file}"}.  There is no way to
11615 override this effect of @option{-I-}.  With @option{-I.} you can specify
11616 searching the directory that is current when the compiler is
11617 invoked.  That is not exactly the same as what the preprocessor does
11618 by default, but it is often satisfactory.
11620 @option{-I-} does not inhibit the use of the standard system directories
11621 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
11622 independent.
11623 @end table
11625 @c man end
11627 @node Spec Files
11628 @section Specifying Subprocesses and the Switches to Pass to Them
11629 @cindex Spec Files
11631 @command{gcc} is a driver program.  It performs its job by invoking a
11632 sequence of other programs to do the work of compiling, assembling and
11633 linking.  GCC interprets its command-line parameters and uses these to
11634 deduce which programs it should invoke, and which command-line options
11635 it ought to place on their command lines.  This behavior is controlled
11636 by @dfn{spec strings}.  In most cases there is one spec string for each
11637 program that GCC can invoke, but a few programs have multiple spec
11638 strings to control their behavior.  The spec strings built into GCC can
11639 be overridden by using the @option{-specs=} command-line switch to specify
11640 a spec file.
11642 @dfn{Spec files} are plaintext files that are used to construct spec
11643 strings.  They consist of a sequence of directives separated by blank
11644 lines.  The type of directive is determined by the first non-whitespace
11645 character on the line, which can be one of the following:
11647 @table @code
11648 @item %@var{command}
11649 Issues a @var{command} to the spec file processor.  The commands that can
11650 appear here are:
11652 @table @code
11653 @item %include <@var{file}>
11654 @cindex @code{%include}
11655 Search for @var{file} and insert its text at the current point in the
11656 specs file.
11658 @item %include_noerr <@var{file}>
11659 @cindex @code{%include_noerr}
11660 Just like @samp{%include}, but do not generate an error message if the include
11661 file cannot be found.
11663 @item %rename @var{old_name} @var{new_name}
11664 @cindex @code{%rename}
11665 Rename the spec string @var{old_name} to @var{new_name}.
11667 @end table
11669 @item *[@var{spec_name}]:
11670 This tells the compiler to create, override or delete the named spec
11671 string.  All lines after this directive up to the next directive or
11672 blank line are considered to be the text for the spec string.  If this
11673 results in an empty string then the spec is deleted.  (Or, if the
11674 spec did not exist, then nothing happens.)  Otherwise, if the spec
11675 does not currently exist a new spec is created.  If the spec does
11676 exist then its contents are overridden by the text of this
11677 directive, unless the first character of that text is the @samp{+}
11678 character, in which case the text is appended to the spec.
11680 @item [@var{suffix}]:
11681 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
11682 and up to the next directive or blank line are considered to make up the
11683 spec string for the indicated suffix.  When the compiler encounters an
11684 input file with the named suffix, it processes the spec string in
11685 order to work out how to compile that file.  For example:
11687 @smallexample
11688 .ZZ:
11689 z-compile -input %i
11690 @end smallexample
11692 This says that any input file whose name ends in @samp{.ZZ} should be
11693 passed to the program @samp{z-compile}, which should be invoked with the
11694 command-line switch @option{-input} and with the result of performing the
11695 @samp{%i} substitution.  (See below.)
11697 As an alternative to providing a spec string, the text following a
11698 suffix directive can be one of the following:
11700 @table @code
11701 @item @@@var{language}
11702 This says that the suffix is an alias for a known @var{language}.  This is
11703 similar to using the @option{-x} command-line switch to GCC to specify a
11704 language explicitly.  For example:
11706 @smallexample
11707 .ZZ:
11708 @@c++
11709 @end smallexample
11711 Says that .ZZ files are, in fact, C++ source files.
11713 @item #@var{name}
11714 This causes an error messages saying:
11716 @smallexample
11717 @var{name} compiler not installed on this system.
11718 @end smallexample
11719 @end table
11721 GCC already has an extensive list of suffixes built into it.
11722 This directive adds an entry to the end of the list of suffixes, but
11723 since the list is searched from the end backwards, it is effectively
11724 possible to override earlier entries using this technique.
11726 @end table
11728 GCC has the following spec strings built into it.  Spec files can
11729 override these strings or create their own.  Note that individual
11730 targets can also add their own spec strings to this list.
11732 @smallexample
11733 asm          Options to pass to the assembler
11734 asm_final    Options to pass to the assembler post-processor
11735 cpp          Options to pass to the C preprocessor
11736 cc1          Options to pass to the C compiler
11737 cc1plus      Options to pass to the C++ compiler
11738 endfile      Object files to include at the end of the link
11739 link         Options to pass to the linker
11740 lib          Libraries to include on the command line to the linker
11741 libgcc       Decides which GCC support library to pass to the linker
11742 linker       Sets the name of the linker
11743 predefines   Defines to be passed to the C preprocessor
11744 signed_char  Defines to pass to CPP to say whether @code{char} is signed
11745              by default
11746 startfile    Object files to include at the start of the link
11747 @end smallexample
11749 Here is a small example of a spec file:
11751 @smallexample
11752 %rename lib                 old_lib
11754 *lib:
11755 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
11756 @end smallexample
11758 This example renames the spec called @samp{lib} to @samp{old_lib} and
11759 then overrides the previous definition of @samp{lib} with a new one.
11760 The new definition adds in some extra command-line options before
11761 including the text of the old definition.
11763 @dfn{Spec strings} are a list of command-line options to be passed to their
11764 corresponding program.  In addition, the spec strings can contain
11765 @samp{%}-prefixed sequences to substitute variable text or to
11766 conditionally insert text into the command line.  Using these constructs
11767 it is possible to generate quite complex command lines.
11769 Here is a table of all defined @samp{%}-sequences for spec
11770 strings.  Note that spaces are not generated automatically around the
11771 results of expanding these sequences.  Therefore you can concatenate them
11772 together or combine them with constant text in a single argument.
11774 @table @code
11775 @item %%
11776 Substitute one @samp{%} into the program name or argument.
11778 @item %i
11779 Substitute the name of the input file being processed.
11781 @item %b
11782 Substitute the basename of the input file being processed.
11783 This is the substring up to (and not including) the last period
11784 and not including the directory.
11786 @item %B
11787 This is the same as @samp{%b}, but include the file suffix (text after
11788 the last period).
11790 @item %d
11791 Marks the argument containing or following the @samp{%d} as a
11792 temporary file name, so that that file is deleted if GCC exits
11793 successfully.  Unlike @samp{%g}, this contributes no text to the
11794 argument.
11796 @item %g@var{suffix}
11797 Substitute a file name that has suffix @var{suffix} and is chosen
11798 once per compilation, and mark the argument in the same way as
11799 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
11800 name is now chosen in a way that is hard to predict even when previously
11801 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
11802 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
11803 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
11804 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
11805 was simply substituted with a file name chosen once per compilation,
11806 without regard to any appended suffix (which was therefore treated
11807 just like ordinary text), making such attacks more likely to succeed.
11809 @item %u@var{suffix}
11810 Like @samp{%g}, but generates a new temporary file name
11811 each time it appears instead of once per compilation.
11813 @item %U@var{suffix}
11814 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
11815 new one if there is no such last file name.  In the absence of any
11816 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
11817 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
11818 involves the generation of two distinct file names, one
11819 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
11820 simply substituted with a file name chosen for the previous @samp{%u},
11821 without regard to any appended suffix.
11823 @item %j@var{suffix}
11824 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
11825 writable, and if @option{-save-temps} is not used; 
11826 otherwise, substitute the name
11827 of a temporary file, just like @samp{%u}.  This temporary file is not
11828 meant for communication between processes, but rather as a junk
11829 disposal mechanism.
11831 @item %|@var{suffix}
11832 @itemx %m@var{suffix}
11833 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
11834 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
11835 all.  These are the two most common ways to instruct a program that it
11836 should read from standard input or write to standard output.  If you
11837 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
11838 construct: see for example @file{f/lang-specs.h}.
11840 @item %.@var{SUFFIX}
11841 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
11842 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
11843 terminated by the next space or %.
11845 @item %w
11846 Marks the argument containing or following the @samp{%w} as the
11847 designated output file of this compilation.  This puts the argument
11848 into the sequence of arguments that @samp{%o} substitutes.
11850 @item %o
11851 Substitutes the names of all the output files, with spaces
11852 automatically placed around them.  You should write spaces
11853 around the @samp{%o} as well or the results are undefined.
11854 @samp{%o} is for use in the specs for running the linker.
11855 Input files whose names have no recognized suffix are not compiled
11856 at all, but they are included among the output files, so they are
11857 linked.
11859 @item %O
11860 Substitutes the suffix for object files.  Note that this is
11861 handled specially when it immediately follows @samp{%g, %u, or %U},
11862 because of the need for those to form complete file names.  The
11863 handling is such that @samp{%O} is treated exactly as if it had already
11864 been substituted, except that @samp{%g, %u, and %U} do not currently
11865 support additional @var{suffix} characters following @samp{%O} as they do
11866 following, for example, @samp{.o}.
11868 @item %p
11869 Substitutes the standard macro predefinitions for the
11870 current target machine.  Use this when running @command{cpp}.
11872 @item %P
11873 Like @samp{%p}, but puts @samp{__} before and after the name of each
11874 predefined macro, except for macros that start with @samp{__} or with
11875 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
11878 @item %I
11879 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
11880 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
11881 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
11882 and @option{-imultilib} as necessary.
11884 @item %s
11885 Current argument is the name of a library or startup file of some sort.
11886 Search for that file in a standard list of directories and substitute
11887 the full name found.  The current working directory is included in the
11888 list of directories scanned.
11890 @item %T
11891 Current argument is the name of a linker script.  Search for that file
11892 in the current list of directories to scan for libraries. If the file
11893 is located insert a @option{--script} option into the command line
11894 followed by the full path name found.  If the file is not found then
11895 generate an error message.  Note: the current working directory is not
11896 searched.
11898 @item %e@var{str}
11899 Print @var{str} as an error message.  @var{str} is terminated by a newline.
11900 Use this when inconsistent options are detected.
11902 @item %(@var{name})
11903 Substitute the contents of spec string @var{name} at this point.
11905 @item %x@{@var{option}@}
11906 Accumulate an option for @samp{%X}.
11908 @item %X
11909 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
11910 spec string.
11912 @item %Y
11913 Output the accumulated assembler options specified by @option{-Wa}.
11915 @item %Z
11916 Output the accumulated preprocessor options specified by @option{-Wp}.
11918 @item %a
11919 Process the @code{asm} spec.  This is used to compute the
11920 switches to be passed to the assembler.
11922 @item %A
11923 Process the @code{asm_final} spec.  This is a spec string for
11924 passing switches to an assembler post-processor, if such a program is
11925 needed.
11927 @item %l
11928 Process the @code{link} spec.  This is the spec for computing the
11929 command line passed to the linker.  Typically it makes use of the
11930 @samp{%L %G %S %D and %E} sequences.
11932 @item %D
11933 Dump out a @option{-L} option for each directory that GCC believes might
11934 contain startup files.  If the target supports multilibs then the
11935 current multilib directory is prepended to each of these paths.
11937 @item %L
11938 Process the @code{lib} spec.  This is a spec string for deciding which
11939 libraries are included on the command line to the linker.
11941 @item %G
11942 Process the @code{libgcc} spec.  This is a spec string for deciding
11943 which GCC support library is included on the command line to the linker.
11945 @item %S
11946 Process the @code{startfile} spec.  This is a spec for deciding which
11947 object files are the first ones passed to the linker.  Typically
11948 this might be a file named @file{crt0.o}.
11950 @item %E
11951 Process the @code{endfile} spec.  This is a spec string that specifies
11952 the last object files that are passed to the linker.
11954 @item %C
11955 Process the @code{cpp} spec.  This is used to construct the arguments
11956 to be passed to the C preprocessor.
11958 @item %1
11959 Process the @code{cc1} spec.  This is used to construct the options to be
11960 passed to the actual C compiler (@command{cc1}).
11962 @item %2
11963 Process the @code{cc1plus} spec.  This is used to construct the options to be
11964 passed to the actual C++ compiler (@command{cc1plus}).
11966 @item %*
11967 Substitute the variable part of a matched option.  See below.
11968 Note that each comma in the substituted string is replaced by
11969 a single space.
11971 @item %<@code{S}
11972 Remove all occurrences of @code{-S} from the command line.  Note---this
11973 command is position dependent.  @samp{%} commands in the spec string
11974 before this one see @code{-S}, @samp{%} commands in the spec string
11975 after this one do not.
11977 @item %:@var{function}(@var{args})
11978 Call the named function @var{function}, passing it @var{args}.
11979 @var{args} is first processed as a nested spec string, then split
11980 into an argument vector in the usual fashion.  The function returns
11981 a string which is processed as if it had appeared literally as part
11982 of the current spec.
11984 The following built-in spec functions are provided:
11986 @table @code
11987 @item @code{getenv}
11988 The @code{getenv} spec function takes two arguments: an environment
11989 variable name and a string.  If the environment variable is not
11990 defined, a fatal error is issued.  Otherwise, the return value is the
11991 value of the environment variable concatenated with the string.  For
11992 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
11994 @smallexample
11995 %:getenv(TOPDIR /include)
11996 @end smallexample
11998 expands to @file{/path/to/top/include}.
12000 @item @code{if-exists}
12001 The @code{if-exists} spec function takes one argument, an absolute
12002 pathname to a file.  If the file exists, @code{if-exists} returns the
12003 pathname.  Here is a small example of its usage:
12005 @smallexample
12006 *startfile:
12007 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
12008 @end smallexample
12010 @item @code{if-exists-else}
12011 The @code{if-exists-else} spec function is similar to the @code{if-exists}
12012 spec function, except that it takes two arguments.  The first argument is
12013 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
12014 returns the pathname.  If it does not exist, it returns the second argument.
12015 This way, @code{if-exists-else} can be used to select one file or another,
12016 based on the existence of the first.  Here is a small example of its usage:
12018 @smallexample
12019 *startfile:
12020 crt0%O%s %:if-exists(crti%O%s) \
12021 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
12022 @end smallexample
12024 @item @code{replace-outfile}
12025 The @code{replace-outfile} spec function takes two arguments.  It looks for the
12026 first argument in the outfiles array and replaces it with the second argument.  Here
12027 is a small example of its usage:
12029 @smallexample
12030 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
12031 @end smallexample
12033 @item @code{remove-outfile}
12034 The @code{remove-outfile} spec function takes one argument.  It looks for the
12035 first argument in the outfiles array and removes it.  Here is a small example
12036 its usage:
12038 @smallexample
12039 %:remove-outfile(-lm)
12040 @end smallexample
12042 @item @code{pass-through-libs}
12043 The @code{pass-through-libs} spec function takes any number of arguments.  It
12044 finds any @option{-l} options and any non-options ending in @file{.a} (which it
12045 assumes are the names of linker input library archive files) and returns a
12046 result containing all the found arguments each prepended by
12047 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
12048 intended to be passed to the LTO linker plugin.
12050 @smallexample
12051 %:pass-through-libs(%G %L %G)
12052 @end smallexample
12054 @item @code{print-asm-header}
12055 The @code{print-asm-header} function takes no arguments and simply
12056 prints a banner like:
12058 @smallexample
12059 Assembler options
12060 =================
12062 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
12063 @end smallexample
12065 It is used to separate compiler options from assembler options
12066 in the @option{--target-help} output.
12067 @end table
12069 @item %@{@code{S}@}
12070 Substitutes the @code{-S} switch, if that switch is given to GCC@.
12071 If that switch is not specified, this substitutes nothing.  Note that
12072 the leading dash is omitted when specifying this option, and it is
12073 automatically inserted if the substitution is performed.  Thus the spec
12074 string @samp{%@{foo@}} matches the command-line option @option{-foo}
12075 and outputs the command-line option @option{-foo}.
12077 @item %W@{@code{S}@}
12078 Like %@{@code{S}@} but mark last argument supplied within as a file to be
12079 deleted on failure.
12081 @item %@{@code{S}*@}
12082 Substitutes all the switches specified to GCC whose names start
12083 with @code{-S}, but which also take an argument.  This is used for
12084 switches like @option{-o}, @option{-D}, @option{-I}, etc.
12085 GCC considers @option{-o foo} as being
12086 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
12087 text, including the space.  Thus two arguments are generated.
12089 @item %@{@code{S}*&@code{T}*@}
12090 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
12091 (the order of @code{S} and @code{T} in the spec is not significant).
12092 There can be any number of ampersand-separated variables; for each the
12093 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
12095 @item %@{@code{S}:@code{X}@}
12096 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
12098 @item %@{!@code{S}:@code{X}@}
12099 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
12101 @item %@{@code{S}*:@code{X}@}
12102 Substitutes @code{X} if one or more switches whose names start with
12103 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
12104 once, no matter how many such switches appeared.  However, if @code{%*}
12105 appears somewhere in @code{X}, then @code{X} is substituted once
12106 for each matching switch, with the @code{%*} replaced by the part of
12107 that switch matching the @code{*}.
12109 If @code{%*} appears as the last part of a spec sequence then a space
12110 is added after the end of the last substitution.  If there is more
12111 text in the sequence, however, then a space is not generated.  This
12112 allows the @code{%*} substitution to be used as part of a larger
12113 string.  For example, a spec string like this:
12115 @smallexample
12116 %@{mcu=*:--script=%*/memory.ld@}
12117 @end smallexample
12119 @noindent
12120 when matching an option like @option{-mcu=newchip} produces:
12122 @smallexample
12123 --script=newchip/memory.ld
12124 @end smallexample
12126 @item %@{.@code{S}:@code{X}@}
12127 Substitutes @code{X}, if processing a file with suffix @code{S}.
12129 @item %@{!.@code{S}:@code{X}@}
12130 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
12132 @item %@{,@code{S}:@code{X}@}
12133 Substitutes @code{X}, if processing a file for language @code{S}.
12135 @item %@{!,@code{S}:@code{X}@}
12136 Substitutes @code{X}, if not processing a file for language @code{S}.
12138 @item %@{@code{S}|@code{P}:@code{X}@}
12139 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
12140 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
12141 @code{*} sequences as well, although they have a stronger binding than
12142 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
12143 alternatives must be starred, and only the first matching alternative
12144 is substituted.
12146 For example, a spec string like this:
12148 @smallexample
12149 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
12150 @end smallexample
12152 @noindent
12153 outputs the following command-line options from the following input
12154 command-line options:
12156 @smallexample
12157 fred.c        -foo -baz
12158 jim.d         -bar -boggle
12159 -d fred.c     -foo -baz -boggle
12160 -d jim.d      -bar -baz -boggle
12161 @end smallexample
12163 @item %@{S:X; T:Y; :D@}
12165 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
12166 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
12167 be as many clauses as you need.  This may be combined with @code{.},
12168 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
12171 @end table
12173 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
12174 construct may contain other nested @samp{%} constructs or spaces, or
12175 even newlines.  They are processed as usual, as described above.
12176 Trailing white space in @code{X} is ignored.  White space may also
12177 appear anywhere on the left side of the colon in these constructs,
12178 except between @code{.} or @code{*} and the corresponding word.
12180 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
12181 handled specifically in these constructs.  If another value of
12182 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
12183 @option{-W} switch is found later in the command line, the earlier
12184 switch value is ignored, except with @{@code{S}*@} where @code{S} is
12185 just one letter, which passes all matching options.
12187 The character @samp{|} at the beginning of the predicate text is used to
12188 indicate that a command should be piped to the following command, but
12189 only if @option{-pipe} is specified.
12191 It is built into GCC which switches take arguments and which do not.
12192 (You might think it would be useful to generalize this to allow each
12193 compiler's spec to say which switches take arguments.  But this cannot
12194 be done in a consistent fashion.  GCC cannot even decide which input
12195 files have been specified without knowing which switches take arguments,
12196 and it must know which input files to compile in order to tell which
12197 compilers to run).
12199 GCC also knows implicitly that arguments starting in @option{-l} are to be
12200 treated as compiler output files, and passed to the linker in their
12201 proper position among the other output files.
12203 @c man begin OPTIONS
12205 @node Target Options
12206 @section Specifying Target Machine and Compiler Version
12207 @cindex target options
12208 @cindex cross compiling
12209 @cindex specifying machine version
12210 @cindex specifying compiler version and target machine
12211 @cindex compiler version, specifying
12212 @cindex target machine, specifying
12214 The usual way to run GCC is to run the executable called @command{gcc}, or
12215 @command{@var{machine}-gcc} when cross-compiling, or
12216 @command{@var{machine}-gcc-@var{version}} to run a version other than the
12217 one that was installed last.
12219 @node Submodel Options
12220 @section Hardware Models and Configurations
12221 @cindex submodel options
12222 @cindex specifying hardware config
12223 @cindex hardware models and configurations, specifying
12224 @cindex machine dependent options
12226 Each target machine types can have its own
12227 special options, starting with @samp{-m}, to choose among various
12228 hardware models or configurations---for example, 68010 vs 68020,
12229 floating coprocessor or none.  A single installed version of the
12230 compiler can compile for any model or configuration, according to the
12231 options specified.
12233 Some configurations of the compiler also support additional special
12234 options, usually for compatibility with other compilers on the same
12235 platform.
12237 @c This list is ordered alphanumerically by subsection name.
12238 @c It should be the same order and spelling as these options are listed
12239 @c in Machine Dependent Options
12241 @menu
12242 * AArch64 Options::
12243 * Adapteva Epiphany Options::
12244 * ARC Options::
12245 * ARM Options::
12246 * AVR Options::
12247 * Blackfin Options::
12248 * C6X Options::
12249 * CRIS Options::
12250 * CR16 Options::
12251 * Darwin Options::
12252 * DEC Alpha Options::
12253 * FR30 Options::
12254 * FT32 Options::
12255 * FRV Options::
12256 * GNU/Linux Options::
12257 * H8/300 Options::
12258 * HPPA Options::
12259 * IA-64 Options::
12260 * LM32 Options::
12261 * M32C Options::
12262 * M32R/D Options::
12263 * M680x0 Options::
12264 * MCore Options::
12265 * MeP Options::
12266 * MicroBlaze Options::
12267 * MIPS Options::
12268 * MMIX Options::
12269 * MN10300 Options::
12270 * Moxie Options::
12271 * MSP430 Options::
12272 * NDS32 Options::
12273 * Nios II Options::
12274 * Nvidia PTX Options::
12275 * PDP-11 Options::
12276 * picoChip Options::
12277 * PowerPC Options::
12278 * RL78 Options::
12279 * RS/6000 and PowerPC Options::
12280 * RX Options::
12281 * S/390 and zSeries Options::
12282 * Score Options::
12283 * SH Options::
12284 * Solaris 2 Options::
12285 * SPARC Options::
12286 * SPU Options::
12287 * System V Options::
12288 * TILE-Gx Options::
12289 * TILEPro Options::
12290 * V850 Options::
12291 * VAX Options::
12292 * Visium Options::
12293 * VMS Options::
12294 * VxWorks Options::
12295 * x86 Options::
12296 * x86 Windows Options::
12297 * Xstormy16 Options::
12298 * Xtensa Options::
12299 * zSeries Options::
12300 @end menu
12302 @node AArch64 Options
12303 @subsection AArch64 Options
12304 @cindex AArch64 Options
12306 These options are defined for AArch64 implementations:
12308 @table @gcctabopt
12310 @item -mabi=@var{name}
12311 @opindex mabi
12312 Generate code for the specified data model.  Permissible values
12313 are @samp{ilp32} for SysV-like data model where int, long int and pointer
12314 are 32-bit, and @samp{lp64} for SysV-like data model where int is 32-bit,
12315 but long int and pointer are 64-bit.
12317 The default depends on the specific target configuration.  Note that
12318 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
12319 entire program with the same ABI, and link with a compatible set of libraries.
12321 @item -mbig-endian
12322 @opindex mbig-endian
12323 Generate big-endian code.  This is the default when GCC is configured for an
12324 @samp{aarch64_be-*-*} target.
12326 @item -mgeneral-regs-only
12327 @opindex mgeneral-regs-only
12328 Generate code which uses only the general-purpose registers.  This is equivalent
12329 to feature modifier @option{nofp} of @option{-march} or @option{-mcpu}, except
12330 that @option{-mgeneral-regs-only} takes precedence over any conflicting feature
12331 modifier regardless of sequence.
12333 @item -mlittle-endian
12334 @opindex mlittle-endian
12335 Generate little-endian code.  This is the default when GCC is configured for an
12336 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
12338 @item -mcmodel=tiny
12339 @opindex mcmodel=tiny
12340 Generate code for the tiny code model.  The program and its statically defined
12341 symbols must be within 1GB of each other.  Pointers are 64 bits.  Programs can
12342 be statically or dynamically linked.  This model is not fully implemented and
12343 mostly treated as @samp{small}.
12345 @item -mcmodel=small
12346 @opindex mcmodel=small
12347 Generate code for the small code model.  The program and its statically defined
12348 symbols must be within 4GB of each other.  Pointers are 64 bits.  Programs can
12349 be statically or dynamically linked.  This is the default code model.
12351 @item -mcmodel=large
12352 @opindex mcmodel=large
12353 Generate code for the large code model.  This makes no assumptions about
12354 addresses and sizes of sections.  Pointers are 64 bits.  Programs can be
12355 statically linked only.
12357 @item -mstrict-align
12358 @opindex mstrict-align
12359 Do not assume that unaligned memory references are handled by the system.
12361 @item -momit-leaf-frame-pointer
12362 @itemx -mno-omit-leaf-frame-pointer
12363 @opindex momit-leaf-frame-pointer
12364 @opindex mno-omit-leaf-frame-pointer
12365 Omit or keep the frame pointer in leaf functions.  The former behaviour is the
12366 default.
12368 @item -mtls-dialect=desc
12369 @opindex mtls-dialect=desc
12370 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
12371 of TLS variables.  This is the default.
12373 @item -mtls-dialect=traditional
12374 @opindex mtls-dialect=traditional
12375 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
12376 of TLS variables.
12378 @item -mfix-cortex-a53-835769
12379 @itemx -mno-fix-cortex-a53-835769
12380 @opindex mfix-cortex-a53-835769
12381 @opindex mno-fix-cortex-a53-835769
12382 Enable or disable the workaround for the ARM Cortex-A53 erratum number 835769.
12383 This involves inserting a NOP instruction between memory instructions and
12384 64-bit integer multiply-accumulate instructions.
12386 @item -mfix-cortex-a53-843419
12387 @itemx -mno-fix-cortex-a53-843419
12388 @opindex mfix-cortex-a53-843419
12389 @opindex mno-fix-cortex-a53-843419
12390 Enable or disable the workaround for the ARM Cortex-A53 erratum number 843419.
12391 This erratum workaround is made at link time and this will only pass the
12392 corresponding flag to the linker.
12394 @item -march=@var{name}
12395 @opindex march
12396 Specify the name of the target architecture, optionally suffixed by one or
12397 more feature modifiers.  This option has the form
12398 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}.
12400 The permissible values for @var{arch} are @samp{armv8-a} or
12401 @samp{armv8.1-a}.
12403 For the permissible values for @var{feature}, see the sub-section on
12404 @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
12405 Feature Modifiers}.  Where conflicting feature modifiers are
12406 specified, the right-most feature is used.
12408 Additionally on native AArch64 GNU/Linux systems the value
12409 @samp{native} is available.  This option causes the compiler to pick the
12410 architecture of the host system.  If the compiler is unable to recognize the
12411 architecture of the host system this option has no effect.
12413 GCC uses @var{name} to determine what kind of instructions it can emit
12414 when generating assembly code.  If @option{-march} is specified
12415 without either of @option{-mtune} or @option{-mcpu} also being
12416 specified, the code is tuned to perform well across a range of target
12417 processors implementing the target architecture.
12419 @item -mtune=@var{name}
12420 @opindex mtune
12421 Specify the name of the target processor for which GCC should tune the
12422 performance of the code.  Permissible values for this option are:
12423 @samp{generic}, @samp{cortex-a53}, @samp{cortex-a57}, @samp{cortex-a72},
12424 @samp{exynos-m1}, @samp{thunderx}, @samp{xgene1}.
12426 Additionally, this option can specify that GCC should tune the performance
12427 of the code for a big.LITTLE system.  Permissible values for this
12428 option are: @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53}.
12430 Additionally on native AArch64 GNU/Linux systems the value
12431 @samp{native} is available.  This option causes the compiler to pick
12432 the architecture of and tune the performance of the code for the
12433 processor of the host system.  If the compiler is unable to recognize
12434 the processor of the host system this option has no effect.
12436 Where none of @option{-mtune=}, @option{-mcpu=} or @option{-march=}
12437 are specified, the code is tuned to perform well across a range
12438 of target processors.
12440 This option cannot be suffixed by feature modifiers.
12442 @item -mcpu=@var{name}
12443 @opindex mcpu
12444 Specify the name of the target processor, optionally suffixed by one
12445 or more feature modifiers.  This option has the form
12446 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where
12447 the permissible values for @var{cpu} are the same as those available
12448 for @option{-mtune}.  The permissible values for @var{feature} are
12449 documented in the sub-section on
12450 @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
12451 Feature Modifiers}.  Where conflicting feature modifiers are
12452 specified, the right-most feature is used.
12454 Additionally on native AArch64 GNU/Linux systems the value
12455 @samp{native} is available.  This option causes the compiler to tune
12456 the performance of the code for the processor of the host system.  If
12457 the compiler is unable to recognize the processor of the host system
12458 this option has no effect.
12460 GCC uses @var{name} to determine what kind of instructions it can emit when
12461 generating assembly code (as if by @option{-march}) and to determine
12462 the target processor for which to tune for performance (as if
12463 by @option{-mtune}).  Where this option is used in conjunction
12464 with @option{-march} or @option{-mtune}, those options take precedence
12465 over the appropriate part of this option.
12467 @item -moverride=@var{string}
12468 @opindex moverride
12469 Override tuning decisions made by the back-end in response to a
12470 @option{-mtune=} switch.  The syntax, semantics, and accepted values
12471 for @var{string} in this option are not guaranteed to be consistent
12472 across releases.
12474 This option is only intended to be useful when developing GCC.
12475 @end table
12477 @subsubsection @option{-march} and @option{-mcpu} Feature Modifiers
12478 @anchor{aarch64-feature-modifiers}
12479 @cindex @option{-march} feature modifiers
12480 @cindex @option{-mcpu} feature modifiers
12481 Feature modifiers used with @option{-march} and @option{-mcpu} can be any of
12482 the following and their inverses @option{no@var{feature}}:
12484 @table @samp
12485 @item crc
12486 Enable CRC extension.
12487 @item crypto
12488 Enable Crypto extension.  This also enables Advanced SIMD and floating-point
12489 instructions.
12490 @item fp
12491 Enable floating-point instructions.  This is on by default for all possible
12492 values for options @option{-march} and @option{-mcpu}.
12493 @item simd
12494 Enable Advanced SIMD instructions.  This also enables floating-point
12495 instructions.  This is on by default for all possible values for options
12496 @option{-march} and @option{-mcpu}.
12497 @item lse
12498 Enable Large System Extension instructions.
12499 @item pan
12500 Enable Privileged Access Never support.
12501 @item lor
12502 Enable Limited Ordering Regions support.
12503 @item rdma
12504 Enable ARMv8.1 Advanced SIMD instructions.  This implies Advanced SIMD
12505 is enabled.
12507 @end table
12509 That is, @option{crypto} implies @option{simd} implies @option{fp}.
12510 Conversely, @option{nofp} (or equivalently, @option{-mgeneral-regs-only})
12511 implies @option{nosimd} implies @option{nocrypto}.
12513 @node Adapteva Epiphany Options
12514 @subsection Adapteva Epiphany Options
12516 These @samp{-m} options are defined for Adapteva Epiphany:
12518 @table @gcctabopt
12519 @item -mhalf-reg-file
12520 @opindex mhalf-reg-file
12521 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
12522 That allows code to run on hardware variants that lack these registers.
12524 @item -mprefer-short-insn-regs
12525 @opindex mprefer-short-insn-regs
12526 Preferrentially allocate registers that allow short instruction generation.
12527 This can result in increased instruction count, so this may either reduce or
12528 increase overall code size.
12530 @item -mbranch-cost=@var{num}
12531 @opindex mbranch-cost
12532 Set the cost of branches to roughly @var{num} ``simple'' instructions.
12533 This cost is only a heuristic and is not guaranteed to produce
12534 consistent results across releases.
12536 @item -mcmove
12537 @opindex mcmove
12538 Enable the generation of conditional moves.
12540 @item -mnops=@var{num}
12541 @opindex mnops
12542 Emit @var{num} NOPs before every other generated instruction.
12544 @item -mno-soft-cmpsf
12545 @opindex mno-soft-cmpsf
12546 For single-precision floating-point comparisons, emit an @code{fsub} instruction
12547 and test the flags.  This is faster than a software comparison, but can
12548 get incorrect results in the presence of NaNs, or when two different small
12549 numbers are compared such that their difference is calculated as zero.
12550 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
12551 software comparisons.
12553 @item -mstack-offset=@var{num}
12554 @opindex mstack-offset
12555 Set the offset between the top of the stack and the stack pointer.
12556 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
12557 can be used by leaf functions without stack allocation.
12558 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
12559 Note also that this option changes the ABI; compiling a program with a
12560 different stack offset than the libraries have been compiled with
12561 generally does not work.
12562 This option can be useful if you want to evaluate if a different stack
12563 offset would give you better code, but to actually use a different stack
12564 offset to build working programs, it is recommended to configure the
12565 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
12567 @item -mno-round-nearest
12568 @opindex mno-round-nearest
12569 Make the scheduler assume that the rounding mode has been set to
12570 truncating.  The default is @option{-mround-nearest}.
12572 @item -mlong-calls
12573 @opindex mlong-calls
12574 If not otherwise specified by an attribute, assume all calls might be beyond
12575 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
12576 function address into a register before performing a (otherwise direct) call.
12577 This is the default.
12579 @item -mshort-calls
12580 @opindex short-calls
12581 If not otherwise specified by an attribute, assume all direct calls are
12582 in the range of the @code{b} / @code{bl} instructions, so use these instructions
12583 for direct calls.  The default is @option{-mlong-calls}.
12585 @item -msmall16
12586 @opindex msmall16
12587 Assume addresses can be loaded as 16-bit unsigned values.  This does not
12588 apply to function addresses for which @option{-mlong-calls} semantics
12589 are in effect.
12591 @item -mfp-mode=@var{mode}
12592 @opindex mfp-mode
12593 Set the prevailing mode of the floating-point unit.
12594 This determines the floating-point mode that is provided and expected
12595 at function call and return time.  Making this mode match the mode you
12596 predominantly need at function start can make your programs smaller and
12597 faster by avoiding unnecessary mode switches.
12599 @var{mode} can be set to one the following values:
12601 @table @samp
12602 @item caller
12603 Any mode at function entry is valid, and retained or restored when
12604 the function returns, and when it calls other functions.
12605 This mode is useful for compiling libraries or other compilation units
12606 you might want to incorporate into different programs with different
12607 prevailing FPU modes, and the convenience of being able to use a single
12608 object file outweighs the size and speed overhead for any extra
12609 mode switching that might be needed, compared with what would be needed
12610 with a more specific choice of prevailing FPU mode.
12612 @item truncate
12613 This is the mode used for floating-point calculations with
12614 truncating (i.e.@: round towards zero) rounding mode.  That includes
12615 conversion from floating point to integer.
12617 @item round-nearest
12618 This is the mode used for floating-point calculations with
12619 round-to-nearest-or-even rounding mode.
12621 @item int
12622 This is the mode used to perform integer calculations in the FPU, e.g.@:
12623 integer multiply, or integer multiply-and-accumulate.
12624 @end table
12626 The default is @option{-mfp-mode=caller}
12628 @item -mnosplit-lohi
12629 @itemx -mno-postinc
12630 @itemx -mno-postmodify
12631 @opindex mnosplit-lohi
12632 @opindex mno-postinc
12633 @opindex mno-postmodify
12634 Code generation tweaks that disable, respectively, splitting of 32-bit
12635 loads, generation of post-increment addresses, and generation of
12636 post-modify addresses.  The defaults are @option{msplit-lohi},
12637 @option{-mpost-inc}, and @option{-mpost-modify}.
12639 @item -mnovect-double
12640 @opindex mno-vect-double
12641 Change the preferred SIMD mode to SImode.  The default is
12642 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
12644 @item -max-vect-align=@var{num}
12645 @opindex max-vect-align
12646 The maximum alignment for SIMD vector mode types.
12647 @var{num} may be 4 or 8.  The default is 8.
12648 Note that this is an ABI change, even though many library function
12649 interfaces are unaffected if they don't use SIMD vector modes
12650 in places that affect size and/or alignment of relevant types.
12652 @item -msplit-vecmove-early
12653 @opindex msplit-vecmove-early
12654 Split vector moves into single word moves before reload.  In theory this
12655 can give better register allocation, but so far the reverse seems to be
12656 generally the case.
12658 @item -m1reg-@var{reg}
12659 @opindex m1reg-
12660 Specify a register to hold the constant @minus{}1, which makes loading small negative
12661 constants and certain bitmasks faster.
12662 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
12663 which specify use of that register as a fixed register,
12664 and @samp{none}, which means that no register is used for this
12665 purpose.  The default is @option{-m1reg-none}.
12667 @end table
12669 @node ARC Options
12670 @subsection ARC Options
12671 @cindex ARC options
12673 The following options control the architecture variant for which code
12674 is being compiled:
12676 @c architecture variants
12677 @table @gcctabopt
12679 @item -mbarrel-shifter
12680 @opindex mbarrel-shifter
12681 Generate instructions supported by barrel shifter.  This is the default
12682 unless @option{-mcpu=ARC601} is in effect.
12684 @item -mcpu=@var{cpu}
12685 @opindex mcpu
12686 Set architecture type, register usage, and instruction scheduling
12687 parameters for @var{cpu}.  There are also shortcut alias options
12688 available for backward compatibility and convenience.  Supported
12689 values for @var{cpu} are
12691 @table @samp
12692 @opindex mA6
12693 @opindex mARC600
12694 @item ARC600
12695 Compile for ARC600.  Aliases: @option{-mA6}, @option{-mARC600}.
12697 @item ARC601
12698 @opindex mARC601
12699 Compile for ARC601.  Alias: @option{-mARC601}.
12701 @item ARC700
12702 @opindex mA7
12703 @opindex mARC700
12704 Compile for ARC700.  Aliases: @option{-mA7}, @option{-mARC700}.
12705 This is the default when configured with @option{--with-cpu=arc700}@.
12706 @end table
12708 @item -mdpfp
12709 @opindex mdpfp
12710 @itemx -mdpfp-compact
12711 @opindex mdpfp-compact
12712 FPX: Generate Double Precision FPX instructions, tuned for the compact
12713 implementation.
12715 @item -mdpfp-fast
12716 @opindex mdpfp-fast
12717 FPX: Generate Double Precision FPX instructions, tuned for the fast
12718 implementation.
12720 @item -mno-dpfp-lrsr
12721 @opindex mno-dpfp-lrsr
12722 Disable LR and SR instructions from using FPX extension aux registers.
12724 @item -mea
12725 @opindex mea
12726 Generate Extended arithmetic instructions.  Currently only
12727 @code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are
12728 supported.  This is always enabled for @option{-mcpu=ARC700}.
12730 @item -mno-mpy
12731 @opindex mno-mpy
12732 Do not generate mpy instructions for ARC700.
12734 @item -mmul32x16
12735 @opindex mmul32x16
12736 Generate 32x16 bit multiply and mac instructions.
12738 @item -mmul64
12739 @opindex mmul64
12740 Generate mul64 and mulu64 instructions.  Only valid for @option{-mcpu=ARC600}.
12742 @item -mnorm
12743 @opindex mnorm
12744 Generate norm instruction.  This is the default if @option{-mcpu=ARC700}
12745 is in effect.
12747 @item -mspfp
12748 @opindex mspfp
12749 @itemx -mspfp-compact
12750 @opindex mspfp-compact
12751 FPX: Generate Single Precision FPX instructions, tuned for the compact
12752 implementation.
12754 @item -mspfp-fast
12755 @opindex mspfp-fast
12756 FPX: Generate Single Precision FPX instructions, tuned for the fast
12757 implementation.
12759 @item -msimd
12760 @opindex msimd
12761 Enable generation of ARC SIMD instructions via target-specific
12762 builtins.  Only valid for @option{-mcpu=ARC700}.
12764 @item -msoft-float
12765 @opindex msoft-float
12766 This option ignored; it is provided for compatibility purposes only.
12767 Software floating point code is emitted by default, and this default
12768 can overridden by FPX options; @samp{mspfp}, @samp{mspfp-compact}, or
12769 @samp{mspfp-fast} for single precision, and @samp{mdpfp},
12770 @samp{mdpfp-compact}, or @samp{mdpfp-fast} for double precision.
12772 @item -mswap
12773 @opindex mswap
12774 Generate swap instructions.
12776 @end table
12778 The following options are passed through to the assembler, and also
12779 define preprocessor macro symbols.
12781 @c Flags used by the assembler, but for which we define preprocessor
12782 @c macro symbols as well.
12783 @table @gcctabopt
12784 @item -mdsp-packa
12785 @opindex mdsp-packa
12786 Passed down to the assembler to enable the DSP Pack A extensions.
12787 Also sets the preprocessor symbol @code{__Xdsp_packa}.
12789 @item -mdvbf
12790 @opindex mdvbf
12791 Passed down to the assembler to enable the dual viterbi butterfly
12792 extension.  Also sets the preprocessor symbol @code{__Xdvbf}.
12794 @c ARC700 4.10 extension instruction
12795 @item -mlock
12796 @opindex mlock
12797 Passed down to the assembler to enable the Locked Load/Store
12798 Conditional extension.  Also sets the preprocessor symbol
12799 @code{__Xlock}.
12801 @item -mmac-d16
12802 @opindex mmac-d16
12803 Passed down to the assembler.  Also sets the preprocessor symbol
12804 @code{__Xxmac_d16}.
12806 @item -mmac-24
12807 @opindex mmac-24
12808 Passed down to the assembler.  Also sets the preprocessor symbol
12809 @code{__Xxmac_24}.
12811 @c ARC700 4.10 extension instruction
12812 @item -mrtsc
12813 @opindex mrtsc
12814 Passed down to the assembler to enable the 64-bit Time-Stamp Counter
12815 extension instruction.  Also sets the preprocessor symbol
12816 @code{__Xrtsc}.
12818 @c ARC700 4.10 extension instruction
12819 @item -mswape
12820 @opindex mswape
12821 Passed down to the assembler to enable the swap byte ordering
12822 extension instruction.  Also sets the preprocessor symbol
12823 @code{__Xswape}.
12825 @item -mtelephony
12826 @opindex mtelephony
12827 Passed down to the assembler to enable dual and single operand
12828 instructions for telephony.  Also sets the preprocessor symbol
12829 @code{__Xtelephony}.
12831 @item -mxy
12832 @opindex mxy
12833 Passed down to the assembler to enable the XY Memory extension.  Also
12834 sets the preprocessor symbol @code{__Xxy}.
12836 @end table
12838 The following options control how the assembly code is annotated:
12840 @c Assembly annotation options
12841 @table @gcctabopt
12842 @item -misize
12843 @opindex misize
12844 Annotate assembler instructions with estimated addresses.
12846 @item -mannotate-align
12847 @opindex mannotate-align
12848 Explain what alignment considerations lead to the decision to make an
12849 instruction short or long.
12851 @end table
12853 The following options are passed through to the linker:
12855 @c options passed through to the linker
12856 @table @gcctabopt
12857 @item -marclinux
12858 @opindex marclinux
12859 Passed through to the linker, to specify use of the @code{arclinux} emulation.
12860 This option is enabled by default in tool chains built for
12861 @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets
12862 when profiling is not requested.
12864 @item -marclinux_prof
12865 @opindex marclinux_prof
12866 Passed through to the linker, to specify use of the
12867 @code{arclinux_prof} emulation.  This option is enabled by default in
12868 tool chains built for @w{@code{arc-linux-uclibc}} and
12869 @w{@code{arceb-linux-uclibc}} targets when profiling is requested.
12871 @end table
12873 The following options control the semantics of generated code:
12875 @c semantically relevant code generation options
12876 @table @gcctabopt
12877 @item -mepilogue-cfi
12878 @opindex mepilogue-cfi
12879 Enable generation of call frame information for epilogues.
12881 @item -mno-epilogue-cfi
12882 @opindex mno-epilogue-cfi
12883 Disable generation of call frame information for epilogues.
12885 @item -mlong-calls
12886 @opindex mlong-calls
12887 Generate call insns as register indirect calls, thus providing access
12888 to the full 32-bit address range.
12890 @item -mmedium-calls
12891 @opindex mmedium-calls
12892 Don't use less than 25 bit addressing range for calls, which is the
12893 offset available for an unconditional branch-and-link
12894 instruction.  Conditional execution of function calls is suppressed, to
12895 allow use of the 25-bit range, rather than the 21-bit range with
12896 conditional branch-and-link.  This is the default for tool chains built
12897 for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets.
12899 @item -mno-sdata
12900 @opindex mno-sdata
12901 Do not generate sdata references.  This is the default for tool chains
12902 built for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}}
12903 targets.
12905 @item -mucb-mcount
12906 @opindex mucb-mcount
12907 Instrument with mcount calls as used in UCB code.  I.e. do the
12908 counting in the callee, not the caller.  By default ARC instrumentation
12909 counts in the caller.
12911 @item -mvolatile-cache
12912 @opindex mvolatile-cache
12913 Use ordinarily cached memory accesses for volatile references.  This is the
12914 default.
12916 @item -mno-volatile-cache
12917 @opindex mno-volatile-cache
12918 Enable cache bypass for volatile references.
12920 @end table
12922 The following options fine tune code generation:
12923 @c code generation tuning options
12924 @table @gcctabopt
12925 @item -malign-call
12926 @opindex malign-call
12927 Do alignment optimizations for call instructions.
12929 @item -mauto-modify-reg
12930 @opindex mauto-modify-reg
12931 Enable the use of pre/post modify with register displacement.
12933 @item -mbbit-peephole
12934 @opindex mbbit-peephole
12935 Enable bbit peephole2.
12937 @item -mno-brcc
12938 @opindex mno-brcc
12939 This option disables a target-specific pass in @file{arc_reorg} to
12940 generate @code{BRcc} instructions.  It has no effect on @code{BRcc}
12941 generation driven by the combiner pass.
12943 @item -mcase-vector-pcrel
12944 @opindex mcase-vector-pcrel
12945 Use pc-relative switch case tables - this enables case table shortening.
12946 This is the default for @option{-Os}.
12948 @item -mcompact-casesi
12949 @opindex mcompact-casesi
12950 Enable compact casesi pattern.
12951 This is the default for @option{-Os}.
12953 @item -mno-cond-exec
12954 @opindex mno-cond-exec
12955 Disable ARCompact specific pass to generate conditional execution instructions.
12956 Due to delay slot scheduling and interactions between operand numbers,
12957 literal sizes, instruction lengths, and the support for conditional execution,
12958 the target-independent pass to generate conditional execution is often lacking,
12959 so the ARC port has kept a special pass around that tries to find more
12960 conditional execution generating opportunities after register allocation,
12961 branch shortening, and delay slot scheduling have been done.  This pass
12962 generally, but not always, improves performance and code size, at the cost of
12963 extra compilation time, which is why there is an option to switch it off.
12964 If you have a problem with call instructions exceeding their allowable
12965 offset range because they are conditionalized, you should consider using
12966 @option{-mmedium-calls} instead.
12968 @item -mearly-cbranchsi
12969 @opindex mearly-cbranchsi
12970 Enable pre-reload use of the cbranchsi pattern.
12972 @item -mexpand-adddi
12973 @opindex mexpand-adddi
12974 Expand @code{adddi3} and @code{subdi3} at rtl generation time into
12975 @code{add.f}, @code{adc} etc.
12977 @item -mindexed-loads
12978 @opindex mindexed-loads
12979 Enable the use of indexed loads.  This can be problematic because some
12980 optimizers then assume that indexed stores exist, which is not
12981 the case.
12983 @item -mlra
12984 @opindex mlra
12985 Enable Local Register Allocation.  This is still experimental for ARC,
12986 so by default the compiler uses standard reload
12987 (i.e. @option{-mno-lra}).
12989 @item -mlra-priority-none
12990 @opindex mlra-priority-none
12991 Don't indicate any priority for target registers.
12993 @item -mlra-priority-compact
12994 @opindex mlra-priority-compact
12995 Indicate target register priority for r0..r3 / r12..r15.
12997 @item -mlra-priority-noncompact
12998 @opindex mlra-priority-noncompact
12999 Reduce target regsiter priority for r0..r3 / r12..r15.
13001 @item -mno-millicode
13002 @opindex mno-millicode
13003 When optimizing for size (using @option{-Os}), prologues and epilogues
13004 that have to save or restore a large number of registers are often
13005 shortened by using call to a special function in libgcc; this is
13006 referred to as a @emph{millicode} call.  As these calls can pose
13007 performance issues, and/or cause linking issues when linking in a
13008 nonstandard way, this option is provided to turn off millicode call
13009 generation.
13011 @item -mmixed-code
13012 @opindex mmixed-code
13013 Tweak register allocation to help 16-bit instruction generation.
13014 This generally has the effect of decreasing the average instruction size
13015 while increasing the instruction count.
13017 @item -mq-class
13018 @opindex mq-class
13019 Enable 'q' instruction alternatives.
13020 This is the default for @option{-Os}.
13022 @item -mRcq
13023 @opindex mRcq
13024 Enable Rcq constraint handling - most short code generation depends on this.
13025 This is the default.
13027 @item -mRcw
13028 @opindex mRcw
13029 Enable Rcw constraint handling - ccfsm condexec mostly depends on this.
13030 This is the default.
13032 @item -msize-level=@var{level}
13033 @opindex msize-level
13034 Fine-tune size optimization with regards to instruction lengths and alignment.
13035 The recognized values for @var{level} are:
13036 @table @samp
13037 @item 0
13038 No size optimization.  This level is deprecated and treated like @samp{1}.
13040 @item 1
13041 Short instructions are used opportunistically.
13043 @item 2
13044 In addition, alignment of loops and of code after barriers are dropped.
13046 @item 3
13047 In addition, optional data alignment is dropped, and the option @option{Os} is enabled.
13049 @end table
13051 This defaults to @samp{3} when @option{-Os} is in effect.  Otherwise,
13052 the behavior when this is not set is equivalent to level @samp{1}.
13054 @item -mtune=@var{cpu}
13055 @opindex mtune
13056 Set instruction scheduling parameters for @var{cpu}, overriding any implied
13057 by @option{-mcpu=}.
13059 Supported values for @var{cpu} are
13061 @table @samp
13062 @item ARC600
13063 Tune for ARC600 cpu.
13065 @item ARC601
13066 Tune for ARC601 cpu.
13068 @item ARC700
13069 Tune for ARC700 cpu with standard multiplier block.
13071 @item ARC700-xmac
13072 Tune for ARC700 cpu with XMAC block.
13074 @item ARC725D
13075 Tune for ARC725D cpu.
13077 @item ARC750D
13078 Tune for ARC750D cpu.
13080 @end table
13082 @item -mmultcost=@var{num}
13083 @opindex mmultcost
13084 Cost to assume for a multiply instruction, with @samp{4} being equal to a
13085 normal instruction.
13087 @item -munalign-prob-threshold=@var{probability}
13088 @opindex munalign-prob-threshold
13089 Set probability threshold for unaligning branches.
13090 When tuning for @samp{ARC700} and optimizing for speed, branches without
13091 filled delay slot are preferably emitted unaligned and long, unless
13092 profiling indicates that the probability for the branch to be taken
13093 is below @var{probability}.  @xref{Cross-profiling}.
13094 The default is (REG_BR_PROB_BASE/2), i.e.@: 5000.
13096 @end table
13098 The following options are maintained for backward compatibility, but
13099 are now deprecated and will be removed in a future release:
13101 @c Deprecated options
13102 @table @gcctabopt
13104 @item -margonaut
13105 @opindex margonaut
13106 Obsolete FPX.
13108 @item -mbig-endian
13109 @opindex mbig-endian
13110 @itemx -EB
13111 @opindex EB
13112 Compile code for big endian targets.  Use of these options is now
13113 deprecated.  Users wanting big-endian code, should use the
13114 @w{@code{arceb-elf32}} and @w{@code{arceb-linux-uclibc}} targets when
13115 building the tool chain, for which big-endian is the default.
13117 @item -mlittle-endian
13118 @opindex mlittle-endian
13119 @itemx -EL
13120 @opindex EL
13121 Compile code for little endian targets.  Use of these options is now
13122 deprecated.  Users wanting little-endian code should use the
13123 @w{@code{arc-elf32}} and @w{@code{arc-linux-uclibc}} targets when
13124 building the tool chain, for which little-endian is the default.
13126 @item -mbarrel_shifter
13127 @opindex mbarrel_shifter
13128 Replaced by @option{-mbarrel-shifter}.
13130 @item -mdpfp_compact
13131 @opindex mdpfp_compact
13132 Replaced by @option{-mdpfp-compact}.
13134 @item -mdpfp_fast
13135 @opindex mdpfp_fast
13136 Replaced by @option{-mdpfp-fast}.
13138 @item -mdsp_packa
13139 @opindex mdsp_packa
13140 Replaced by @option{-mdsp-packa}.
13142 @item -mEA
13143 @opindex mEA
13144 Replaced by @option{-mea}.
13146 @item -mmac_24
13147 @opindex mmac_24
13148 Replaced by @option{-mmac-24}.
13150 @item -mmac_d16
13151 @opindex mmac_d16
13152 Replaced by @option{-mmac-d16}.
13154 @item -mspfp_compact
13155 @opindex mspfp_compact
13156 Replaced by @option{-mspfp-compact}.
13158 @item -mspfp_fast
13159 @opindex mspfp_fast
13160 Replaced by @option{-mspfp-fast}.
13162 @item -mtune=@var{cpu}
13163 @opindex mtune
13164 Values @samp{arc600}, @samp{arc601}, @samp{arc700} and
13165 @samp{arc700-xmac} for @var{cpu} are replaced by @samp{ARC600},
13166 @samp{ARC601}, @samp{ARC700} and @samp{ARC700-xmac} respectively
13168 @item -multcost=@var{num}
13169 @opindex multcost
13170 Replaced by @option{-mmultcost}.
13172 @end table
13174 @node ARM Options
13175 @subsection ARM Options
13176 @cindex ARM options
13178 These @samp{-m} options are defined for the ARM port:
13180 @table @gcctabopt
13181 @item -mabi=@var{name}
13182 @opindex mabi
13183 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
13184 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
13186 @item -mapcs-frame
13187 @opindex mapcs-frame
13188 Generate a stack frame that is compliant with the ARM Procedure Call
13189 Standard for all functions, even if this is not strictly necessary for
13190 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
13191 with this option causes the stack frames not to be generated for
13192 leaf functions.  The default is @option{-mno-apcs-frame}.
13193 This option is deprecated.
13195 @item -mapcs
13196 @opindex mapcs
13197 This is a synonym for @option{-mapcs-frame} and is deprecated.
13199 @ignore
13200 @c not currently implemented
13201 @item -mapcs-stack-check
13202 @opindex mapcs-stack-check
13203 Generate code to check the amount of stack space available upon entry to
13204 every function (that actually uses some stack space).  If there is
13205 insufficient space available then either the function
13206 @code{__rt_stkovf_split_small} or @code{__rt_stkovf_split_big} is
13207 called, depending upon the amount of stack space required.  The runtime
13208 system is required to provide these functions.  The default is
13209 @option{-mno-apcs-stack-check}, since this produces smaller code.
13211 @c not currently implemented
13212 @item -mapcs-float
13213 @opindex mapcs-float
13214 Pass floating-point arguments using the floating-point registers.  This is
13215 one of the variants of the APCS@.  This option is recommended if the
13216 target hardware has a floating-point unit or if a lot of floating-point
13217 arithmetic is going to be performed by the code.  The default is
13218 @option{-mno-apcs-float}, since the size of integer-only code is 
13219 slightly increased if @option{-mapcs-float} is used.
13221 @c not currently implemented
13222 @item -mapcs-reentrant
13223 @opindex mapcs-reentrant
13224 Generate reentrant, position-independent code.  The default is
13225 @option{-mno-apcs-reentrant}.
13226 @end ignore
13228 @item -mthumb-interwork
13229 @opindex mthumb-interwork
13230 Generate code that supports calling between the ARM and Thumb
13231 instruction sets.  Without this option, on pre-v5 architectures, the
13232 two instruction sets cannot be reliably used inside one program.  The
13233 default is @option{-mno-thumb-interwork}, since slightly larger code
13234 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
13235 configurations this option is meaningless.
13237 @item -mno-sched-prolog
13238 @opindex mno-sched-prolog
13239 Prevent the reordering of instructions in the function prologue, or the
13240 merging of those instruction with the instructions in the function's
13241 body.  This means that all functions start with a recognizable set
13242 of instructions (or in fact one of a choice from a small set of
13243 different function prologues), and this information can be used to
13244 locate the start of functions inside an executable piece of code.  The
13245 default is @option{-msched-prolog}.
13247 @item -mfloat-abi=@var{name}
13248 @opindex mfloat-abi
13249 Specifies which floating-point ABI to use.  Permissible values
13250 are: @samp{soft}, @samp{softfp} and @samp{hard}.
13252 Specifying @samp{soft} causes GCC to generate output containing
13253 library calls for floating-point operations.
13254 @samp{softfp} allows the generation of code using hardware floating-point
13255 instructions, but still uses the soft-float calling conventions.
13256 @samp{hard} allows generation of floating-point instructions
13257 and uses FPU-specific calling conventions.
13259 The default depends on the specific target configuration.  Note that
13260 the hard-float and soft-float ABIs are not link-compatible; you must
13261 compile your entire program with the same ABI, and link with a
13262 compatible set of libraries.
13264 @item -mlittle-endian
13265 @opindex mlittle-endian
13266 Generate code for a processor running in little-endian mode.  This is
13267 the default for all standard configurations.
13269 @item -mbig-endian
13270 @opindex mbig-endian
13271 Generate code for a processor running in big-endian mode; the default is
13272 to compile code for a little-endian processor.
13274 @item -march=@var{name}
13275 @opindex march
13276 This specifies the name of the target ARM architecture.  GCC uses this
13277 name to determine what kind of instructions it can emit when generating
13278 assembly code.  This option can be used in conjunction with or instead
13279 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
13280 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
13281 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
13282 @samp{armv6}, @samp{armv6j},
13283 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
13284 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m}, @samp{armv7e-m},
13285 @samp{armv7ve}, @samp{armv8-a}, @samp{armv8-a+crc},
13286 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
13288 @option{-march=armv7ve} is the armv7-a architecture with virtualization
13289 extensions.
13291 @option{-march=armv8-a+crc} enables code generation for the ARMv8-A
13292 architecture together with the optional CRC32 extensions.
13294 @option{-march=native} causes the compiler to auto-detect the architecture
13295 of the build computer.  At present, this feature is only supported on
13296 GNU/Linux, and not all architectures are recognized.  If the auto-detect
13297 is unsuccessful the option has no effect.
13299 @item -mtune=@var{name}
13300 @opindex mtune
13301 This option specifies the name of the target ARM processor for
13302 which GCC should tune the performance of the code.
13303 For some ARM implementations better performance can be obtained by using
13304 this option.
13305 Permissible names are: @samp{arm2}, @samp{arm250},
13306 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
13307 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
13308 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
13309 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
13310 @samp{arm720},
13311 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
13312 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
13313 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
13314 @samp{strongarm1110},
13315 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
13316 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
13317 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
13318 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
13319 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
13320 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
13321 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
13322 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8},
13323 @samp{cortex-a9}, @samp{cortex-a12}, @samp{cortex-a15}, @samp{cortex-a17},
13324 @samp{cortex-a53}, @samp{cortex-a57}, @samp{cortex-a72},
13325 @samp{cortex-r4},
13326 @samp{cortex-r4f}, @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-m7},
13327 @samp{cortex-m4},
13328 @samp{cortex-m3},
13329 @samp{cortex-m1},
13330 @samp{cortex-m0},
13331 @samp{cortex-m0plus},
13332 @samp{cortex-m1.small-multiply},
13333 @samp{cortex-m0.small-multiply},
13334 @samp{cortex-m0plus.small-multiply},
13335 @samp{exynos-m1},
13336 @samp{marvell-pj4},
13337 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
13338 @samp{fa526}, @samp{fa626},
13339 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te},
13340 @samp{xgene1}.
13342 Additionally, this option can specify that GCC should tune the performance
13343 of the code for a big.LITTLE system.  Permissible names are:
13344 @samp{cortex-a15.cortex-a7}, @samp{cortex-a17.cortex-a7},
13345 @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53}.
13347 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
13348 performance for a blend of processors within architecture @var{arch}.
13349 The aim is to generate code that run well on the current most popular
13350 processors, balancing between optimizations that benefit some CPUs in the
13351 range, and avoiding performance pitfalls of other CPUs.  The effects of
13352 this option may change in future GCC versions as CPU models come and go.
13354 @option{-mtune=native} causes the compiler to auto-detect the CPU
13355 of the build computer.  At present, this feature is only supported on
13356 GNU/Linux, and not all architectures are recognized.  If the auto-detect is
13357 unsuccessful the option has no effect.
13359 @item -mcpu=@var{name}
13360 @opindex mcpu
13361 This specifies the name of the target ARM processor.  GCC uses this name
13362 to derive the name of the target ARM architecture (as if specified
13363 by @option{-march}) and the ARM processor type for which to tune for
13364 performance (as if specified by @option{-mtune}).  Where this option
13365 is used in conjunction with @option{-march} or @option{-mtune},
13366 those options take precedence over the appropriate part of this option.
13368 Permissible names for this option are the same as those for
13369 @option{-mtune}.
13371 @option{-mcpu=generic-@var{arch}} is also permissible, and is
13372 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
13373 See @option{-mtune} for more information.
13375 @option{-mcpu=native} causes the compiler to auto-detect the CPU
13376 of the build computer.  At present, this feature is only supported on
13377 GNU/Linux, and not all architectures are recognized.  If the auto-detect
13378 is unsuccessful the option has no effect.
13380 @item -mfpu=@var{name}
13381 @opindex mfpu
13382 This specifies what floating-point hardware (or hardware emulation) is
13383 available on the target.  Permissible names are: @samp{vfp}, @samp{vfpv3},
13384 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
13385 @samp{vfpv3xd-fp16}, @samp{neon}, @samp{neon-fp16}, @samp{vfpv4},
13386 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
13387 @samp{fpv5-d16}, @samp{fpv5-sp-d16},
13388 @samp{fp-armv8}, @samp{neon-fp-armv8}, and @samp{crypto-neon-fp-armv8}.
13390 If @option{-msoft-float} is specified this specifies the format of
13391 floating-point values.
13393 If the selected floating-point hardware includes the NEON extension
13394 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
13395 operations are not generated by GCC's auto-vectorization pass unless
13396 @option{-funsafe-math-optimizations} is also specified.  This is
13397 because NEON hardware does not fully implement the IEEE 754 standard for
13398 floating-point arithmetic (in particular denormal values are treated as
13399 zero), so the use of NEON instructions may lead to a loss of precision.
13401 @item -mfp16-format=@var{name}
13402 @opindex mfp16-format
13403 Specify the format of the @code{__fp16} half-precision floating-point type.
13404 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
13405 the default is @samp{none}, in which case the @code{__fp16} type is not
13406 defined.  @xref{Half-Precision}, for more information.
13408 @item -mstructure-size-boundary=@var{n}
13409 @opindex mstructure-size-boundary
13410 The sizes of all structures and unions are rounded up to a multiple
13411 of the number of bits set by this option.  Permissible values are 8, 32
13412 and 64.  The default value varies for different toolchains.  For the COFF
13413 targeted toolchain the default value is 8.  A value of 64 is only allowed
13414 if the underlying ABI supports it.
13416 Specifying a larger number can produce faster, more efficient code, but
13417 can also increase the size of the program.  Different values are potentially
13418 incompatible.  Code compiled with one value cannot necessarily expect to
13419 work with code or libraries compiled with another value, if they exchange
13420 information using structures or unions.
13422 @item -mabort-on-noreturn
13423 @opindex mabort-on-noreturn
13424 Generate a call to the function @code{abort} at the end of a
13425 @code{noreturn} function.  It is executed if the function tries to
13426 return.
13428 @item -mlong-calls
13429 @itemx -mno-long-calls
13430 @opindex mlong-calls
13431 @opindex mno-long-calls
13432 Tells the compiler to perform function calls by first loading the
13433 address of the function into a register and then performing a subroutine
13434 call on this register.  This switch is needed if the target function
13435 lies outside of the 64-megabyte addressing range of the offset-based
13436 version of subroutine call instruction.
13438 Even if this switch is enabled, not all function calls are turned
13439 into long calls.  The heuristic is that static functions, functions
13440 that have the @code{short_call} attribute, functions that are inside
13441 the scope of a @code{#pragma no_long_calls} directive, and functions whose
13442 definitions have already been compiled within the current compilation
13443 unit are not turned into long calls.  The exceptions to this rule are
13444 that weak function definitions, functions with the @code{long_call}
13445 attribute or the @code{section} attribute, and functions that are within
13446 the scope of a @code{#pragma long_calls} directive are always
13447 turned into long calls.
13449 This feature is not enabled by default.  Specifying
13450 @option{-mno-long-calls} restores the default behavior, as does
13451 placing the function calls within the scope of a @code{#pragma
13452 long_calls_off} directive.  Note these switches have no effect on how
13453 the compiler generates code to handle function calls via function
13454 pointers.
13456 @item -msingle-pic-base
13457 @opindex msingle-pic-base
13458 Treat the register used for PIC addressing as read-only, rather than
13459 loading it in the prologue for each function.  The runtime system is
13460 responsible for initializing this register with an appropriate value
13461 before execution begins.
13463 @item -mpic-register=@var{reg}
13464 @opindex mpic-register
13465 Specify the register to be used for PIC addressing.
13466 For standard PIC base case, the default is any suitable register
13467 determined by compiler.  For single PIC base case, the default is
13468 @samp{R9} if target is EABI based or stack-checking is enabled,
13469 otherwise the default is @samp{R10}.
13471 @item -mpic-data-is-text-relative
13472 @opindex mpic-data-is-text-relative
13473 Assume that each data segments are relative to text segment at load time.
13474 Therefore, it permits addressing data using PC-relative operations.
13475 This option is on by default for targets other than VxWorks RTP.
13477 @item -mpoke-function-name
13478 @opindex mpoke-function-name
13479 Write the name of each function into the text section, directly
13480 preceding the function prologue.  The generated code is similar to this:
13482 @smallexample
13483      t0
13484          .ascii "arm_poke_function_name", 0
13485          .align
13486      t1
13487          .word 0xff000000 + (t1 - t0)
13488      arm_poke_function_name
13489          mov     ip, sp
13490          stmfd   sp!, @{fp, ip, lr, pc@}
13491          sub     fp, ip, #4
13492 @end smallexample
13494 When performing a stack backtrace, code can inspect the value of
13495 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
13496 location @code{pc - 12} and the top 8 bits are set, then we know that
13497 there is a function name embedded immediately preceding this location
13498 and has length @code{((pc[-3]) & 0xff000000)}.
13500 @item -mthumb
13501 @itemx -marm
13502 @opindex marm
13503 @opindex mthumb
13505 Select between generating code that executes in ARM and Thumb
13506 states.  The default for most configurations is to generate code
13507 that executes in ARM state, but the default can be changed by
13508 configuring GCC with the @option{--with-mode=}@var{state}
13509 configure option.
13511 You can also override the ARM and Thumb mode for each function
13512 by using the @code{target("thumb")} and @code{target("arm")} function attributes
13513 (@pxref{ARM Function Attributes}) or pragmas (@pxref{Function Specific Option Pragmas}).
13515 @item -mtpcs-frame
13516 @opindex mtpcs-frame
13517 Generate a stack frame that is compliant with the Thumb Procedure Call
13518 Standard for all non-leaf functions.  (A leaf function is one that does
13519 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
13521 @item -mtpcs-leaf-frame
13522 @opindex mtpcs-leaf-frame
13523 Generate a stack frame that is compliant with the Thumb Procedure Call
13524 Standard for all leaf functions.  (A leaf function is one that does
13525 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
13527 @item -mcallee-super-interworking
13528 @opindex mcallee-super-interworking
13529 Gives all externally visible functions in the file being compiled an ARM
13530 instruction set header which switches to Thumb mode before executing the
13531 rest of the function.  This allows these functions to be called from
13532 non-interworking code.  This option is not valid in AAPCS configurations
13533 because interworking is enabled by default.
13535 @item -mcaller-super-interworking
13536 @opindex mcaller-super-interworking
13537 Allows calls via function pointers (including virtual functions) to
13538 execute correctly regardless of whether the target code has been
13539 compiled for interworking or not.  There is a small overhead in the cost
13540 of executing a function pointer if this option is enabled.  This option
13541 is not valid in AAPCS configurations because interworking is enabled
13542 by default.
13544 @item -mtp=@var{name}
13545 @opindex mtp
13546 Specify the access model for the thread local storage pointer.  The valid
13547 models are @samp{soft}, which generates calls to @code{__aeabi_read_tp},
13548 @samp{cp15}, which fetches the thread pointer from @code{cp15} directly
13549 (supported in the arm6k architecture), and @samp{auto}, which uses the
13550 best available method for the selected processor.  The default setting is
13551 @samp{auto}.
13553 @item -mtls-dialect=@var{dialect}
13554 @opindex mtls-dialect
13555 Specify the dialect to use for accessing thread local storage.  Two
13556 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
13557 @samp{gnu} dialect selects the original GNU scheme for supporting
13558 local and global dynamic TLS models.  The @samp{gnu2} dialect
13559 selects the GNU descriptor scheme, which provides better performance
13560 for shared libraries.  The GNU descriptor scheme is compatible with
13561 the original scheme, but does require new assembler, linker and
13562 library support.  Initial and local exec TLS models are unaffected by
13563 this option and always use the original scheme.
13565 @item -mword-relocations
13566 @opindex mword-relocations
13567 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
13568 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
13569 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
13570 is specified.
13572 @item -mfix-cortex-m3-ldrd
13573 @opindex mfix-cortex-m3-ldrd
13574 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
13575 with overlapping destination and base registers are used.  This option avoids
13576 generating these instructions.  This option is enabled by default when
13577 @option{-mcpu=cortex-m3} is specified.
13579 @item -munaligned-access
13580 @itemx -mno-unaligned-access
13581 @opindex munaligned-access
13582 @opindex mno-unaligned-access
13583 Enables (or disables) reading and writing of 16- and 32- bit values
13584 from addresses that are not 16- or 32- bit aligned.  By default
13585 unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
13586 architectures, and enabled for all other architectures.  If unaligned
13587 access is not enabled then words in packed data structures are
13588 accessed a byte at a time.
13590 The ARM attribute @code{Tag_CPU_unaligned_access} is set in the
13591 generated object file to either true or false, depending upon the
13592 setting of this option.  If unaligned access is enabled then the
13593 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} is also
13594 defined.
13596 @item -mneon-for-64bits
13597 @opindex mneon-for-64bits
13598 Enables using Neon to handle scalar 64-bits operations. This is
13599 disabled by default since the cost of moving data from core registers
13600 to Neon is high.
13602 @item -mslow-flash-data
13603 @opindex mslow-flash-data
13604 Assume loading data from flash is slower than fetching instruction.
13605 Therefore literal load is minimized for better performance.
13606 This option is only supported when compiling for ARMv7 M-profile and
13607 off by default.
13609 @item -masm-syntax-unified
13610 @opindex masm-syntax-unified
13611 Assume inline assembler is using unified asm syntax.  The default is
13612 currently off which implies divided syntax.  Currently this option is
13613 available only for Thumb1 and has no effect on ARM state and Thumb2.
13614 However, this may change in future releases of GCC.  Divided syntax
13615 should be considered deprecated.
13617 @item -mrestrict-it
13618 @opindex mrestrict-it
13619 Restricts generation of IT blocks to conform to the rules of ARMv8.
13620 IT blocks can only contain a single 16-bit instruction from a select
13621 set of instructions. This option is on by default for ARMv8 Thumb mode.
13623 @item -mprint-tune-info
13624 @opindex mprint-tune-info
13625 Print CPU tuning information as comment in assembler file.  This is
13626 an option used only for regression testing of the compiler and not
13627 intended for ordinary use in compiling code.  This option is disabled
13628 by default.
13629 @end table
13631 @node AVR Options
13632 @subsection AVR Options
13633 @cindex AVR Options
13635 These options are defined for AVR implementations:
13637 @table @gcctabopt
13638 @item -mmcu=@var{mcu}
13639 @opindex mmcu
13640 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
13642 The default for this option is@tie{}@samp{avr2}.
13644 GCC supports the following AVR devices and ISAs:
13646 @include avr-mmcu.texi
13648 @item -maccumulate-args
13649 @opindex maccumulate-args
13650 Accumulate outgoing function arguments and acquire/release the needed
13651 stack space for outgoing function arguments once in function
13652 prologue/epilogue.  Without this option, outgoing arguments are pushed
13653 before calling a function and popped afterwards.
13655 Popping the arguments after the function call can be expensive on
13656 AVR so that accumulating the stack space might lead to smaller
13657 executables because arguments need not to be removed from the
13658 stack after such a function call.
13660 This option can lead to reduced code size for functions that perform
13661 several calls to functions that get their arguments on the stack like
13662 calls to printf-like functions.
13664 @item -mbranch-cost=@var{cost}
13665 @opindex mbranch-cost
13666 Set the branch costs for conditional branch instructions to
13667 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
13668 integers. The default branch cost is 0.
13670 @item -mcall-prologues
13671 @opindex mcall-prologues
13672 Functions prologues/epilogues are expanded as calls to appropriate
13673 subroutines.  Code size is smaller.
13675 @item -mint8
13676 @opindex mint8
13677 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
13678 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
13679 and @code{long long} is 4 bytes.  Please note that this option does not
13680 conform to the C standards, but it results in smaller code
13681 size.
13683 @item -mn-flash=@var{num}
13684 @opindex mn-flash
13685 Assume that the flash memory has a size of 
13686 @var{num} times 64@tie{}KiB.
13688 @item -mno-interrupts
13689 @opindex mno-interrupts
13690 Generated code is not compatible with hardware interrupts.
13691 Code size is smaller.
13693 @item -mrelax
13694 @opindex mrelax
13695 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
13696 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
13697 Setting @option{-mrelax} just adds the @option{--mlink-relax} option to
13698 the assembler's command line and the @option{--relax} option to the
13699 linker's command line.
13701 Jump relaxing is performed by the linker because jump offsets are not
13702 known before code is located. Therefore, the assembler code generated by the
13703 compiler is the same, but the instructions in the executable may
13704 differ from instructions in the assembler code.
13706 Relaxing must be turned on if linker stubs are needed, see the
13707 section on @code{EIND} and linker stubs below.
13709 @item -mrmw
13710 @opindex mrmw
13711 Assume that the device supports the Read-Modify-Write
13712 instructions @code{XCH}, @code{LAC}, @code{LAS} and @code{LAT}.
13714 @item -msp8
13715 @opindex msp8
13716 Treat the stack pointer register as an 8-bit register,
13717 i.e.@: assume the high byte of the stack pointer is zero.
13718 In general, you don't need to set this option by hand.
13720 This option is used internally by the compiler to select and
13721 build multilibs for architectures @code{avr2} and @code{avr25}.
13722 These architectures mix devices with and without @code{SPH}.
13723 For any setting other than @option{-mmcu=avr2} or @option{-mmcu=avr25}
13724 the compiler driver adds or removes this option from the compiler
13725 proper's command line, because the compiler then knows if the device
13726 or architecture has an 8-bit stack pointer and thus no @code{SPH}
13727 register or not.
13729 @item -mstrict-X
13730 @opindex mstrict-X
13731 Use address register @code{X} in a way proposed by the hardware.  This means
13732 that @code{X} is only used in indirect, post-increment or
13733 pre-decrement addressing.
13735 Without this option, the @code{X} register may be used in the same way
13736 as @code{Y} or @code{Z} which then is emulated by additional
13737 instructions.  
13738 For example, loading a value with @code{X+const} addressing with a
13739 small non-negative @code{const < 64} to a register @var{Rn} is
13740 performed as
13742 @example
13743 adiw r26, const   ; X += const
13744 ld   @var{Rn}, X        ; @var{Rn} = *X
13745 sbiw r26, const   ; X -= const
13746 @end example
13748 @item -mtiny-stack
13749 @opindex mtiny-stack
13750 Only change the lower 8@tie{}bits of the stack pointer.
13752 @item -nodevicelib
13753 @opindex nodevicelib
13754 Don't link against AVR-LibC's device specific library @code{libdev.a}.
13756 @item -Waddr-space-convert
13757 @opindex Waddr-space-convert
13758 Warn about conversions between address spaces in the case where the
13759 resulting address space is not contained in the incoming address space.
13760 @end table
13762 @subsubsection @code{EIND} and Devices with More Than 128 Ki Bytes of Flash
13763 @cindex @code{EIND}
13764 Pointers in the implementation are 16@tie{}bits wide.
13765 The address of a function or label is represented as word address so
13766 that indirect jumps and calls can target any code address in the
13767 range of 64@tie{}Ki words.
13769 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
13770 bytes of program memory space, there is a special function register called
13771 @code{EIND} that serves as most significant part of the target address
13772 when @code{EICALL} or @code{EIJMP} instructions are used.
13774 Indirect jumps and calls on these devices are handled as follows by
13775 the compiler and are subject to some limitations:
13777 @itemize @bullet
13779 @item
13780 The compiler never sets @code{EIND}.
13782 @item
13783 The compiler uses @code{EIND} implicitely in @code{EICALL}/@code{EIJMP}
13784 instructions or might read @code{EIND} directly in order to emulate an
13785 indirect call/jump by means of a @code{RET} instruction.
13787 @item
13788 The compiler assumes that @code{EIND} never changes during the startup
13789 code or during the application. In particular, @code{EIND} is not
13790 saved/restored in function or interrupt service routine
13791 prologue/epilogue.
13793 @item
13794 For indirect calls to functions and computed goto, the linker
13795 generates @emph{stubs}. Stubs are jump pads sometimes also called
13796 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
13797 The stub contains a direct jump to the desired address.
13799 @item
13800 Linker relaxation must be turned on so that the linker generates
13801 the stubs correctly in all situations. See the compiler option
13802 @option{-mrelax} and the linker option @option{--relax}.
13803 There are corner cases where the linker is supposed to generate stubs
13804 but aborts without relaxation and without a helpful error message.
13806 @item
13807 The default linker script is arranged for code with @code{EIND = 0}.
13808 If code is supposed to work for a setup with @code{EIND != 0}, a custom
13809 linker script has to be used in order to place the sections whose
13810 name start with @code{.trampolines} into the segment where @code{EIND}
13811 points to.
13813 @item
13814 The startup code from libgcc never sets @code{EIND}.
13815 Notice that startup code is a blend of code from libgcc and AVR-LibC.
13816 For the impact of AVR-LibC on @code{EIND}, see the
13817 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
13819 @item
13820 It is legitimate for user-specific startup code to set up @code{EIND}
13821 early, for example by means of initialization code located in
13822 section @code{.init3}. Such code runs prior to general startup code
13823 that initializes RAM and calls constructors, but after the bit
13824 of startup code from AVR-LibC that sets @code{EIND} to the segment
13825 where the vector table is located.
13826 @example
13827 #include <avr/io.h>
13829 static void
13830 __attribute__((section(".init3"),naked,used,no_instrument_function))
13831 init3_set_eind (void)
13833   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
13834                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
13836 @end example
13838 @noindent
13839 The @code{__trampolines_start} symbol is defined in the linker script.
13841 @item
13842 Stubs are generated automatically by the linker if
13843 the following two conditions are met:
13844 @itemize @minus
13846 @item The address of a label is taken by means of the @code{gs} modifier
13847 (short for @emph{generate stubs}) like so:
13848 @example
13849 LDI r24, lo8(gs(@var{func}))
13850 LDI r25, hi8(gs(@var{func}))
13851 @end example
13852 @item The final location of that label is in a code segment
13853 @emph{outside} the segment where the stubs are located.
13854 @end itemize
13856 @item
13857 The compiler emits such @code{gs} modifiers for code labels in the
13858 following situations:
13859 @itemize @minus
13860 @item Taking address of a function or code label.
13861 @item Computed goto.
13862 @item If prologue-save function is used, see @option{-mcall-prologues}
13863 command-line option.
13864 @item Switch/case dispatch tables. If you do not want such dispatch
13865 tables you can specify the @option{-fno-jump-tables} command-line option.
13866 @item C and C++ constructors/destructors called during startup/shutdown.
13867 @item If the tools hit a @code{gs()} modifier explained above.
13868 @end itemize
13870 @item
13871 Jumping to non-symbolic addresses like so is @emph{not} supported:
13873 @example
13874 int main (void)
13876     /* Call function at word address 0x2 */
13877     return ((int(*)(void)) 0x2)();
13879 @end example
13881 Instead, a stub has to be set up, i.e.@: the function has to be called
13882 through a symbol (@code{func_4} in the example):
13884 @example
13885 int main (void)
13887     extern int func_4 (void);
13889     /* Call function at byte address 0x4 */
13890     return func_4();
13892 @end example
13894 and the application be linked with @option{-Wl,--defsym,func_4=0x4}.
13895 Alternatively, @code{func_4} can be defined in the linker script.
13896 @end itemize
13898 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
13899 @cindex @code{RAMPD}
13900 @cindex @code{RAMPX}
13901 @cindex @code{RAMPY}
13902 @cindex @code{RAMPZ}
13903 Some AVR devices support memories larger than the 64@tie{}KiB range
13904 that can be accessed with 16-bit pointers.  To access memory locations
13905 outside this 64@tie{}KiB range, the contentent of a @code{RAMP}
13906 register is used as high part of the address:
13907 The @code{X}, @code{Y}, @code{Z} address register is concatenated
13908 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
13909 register, respectively, to get a wide address. Similarly,
13910 @code{RAMPD} is used together with direct addressing.
13912 @itemize
13913 @item
13914 The startup code initializes the @code{RAMP} special function
13915 registers with zero.
13917 @item
13918 If a @ref{AVR Named Address Spaces,named address space} other than
13919 generic or @code{__flash} is used, then @code{RAMPZ} is set
13920 as needed before the operation.
13922 @item
13923 If the device supports RAM larger than 64@tie{}KiB and the compiler
13924 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
13925 is reset to zero after the operation.
13927 @item
13928 If the device comes with a specific @code{RAMP} register, the ISR
13929 prologue/epilogue saves/restores that SFR and initializes it with
13930 zero in case the ISR code might (implicitly) use it.
13932 @item
13933 RAM larger than 64@tie{}KiB is not supported by GCC for AVR targets.
13934 If you use inline assembler to read from locations outside the
13935 16-bit address range and change one of the @code{RAMP} registers,
13936 you must reset it to zero after the access.
13938 @end itemize
13940 @subsubsection AVR Built-in Macros
13942 GCC defines several built-in macros so that the user code can test
13943 for the presence or absence of features.  Almost any of the following
13944 built-in macros are deduced from device capabilities and thus
13945 triggered by the @option{-mmcu=} command-line option.
13947 For even more AVR-specific built-in macros see
13948 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
13950 @table @code
13952 @item __AVR_ARCH__
13953 Build-in macro that resolves to a decimal number that identifies the
13954 architecture and depends on the @option{-mmcu=@var{mcu}} option.
13955 Possible values are:
13957 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
13958 @code{4}, @code{5}, @code{51}, @code{6}
13960 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3}, @code{avr31},
13961 @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51}, @code{avr6},
13963 respectively and
13965 @code{100}, @code{102}, @code{104},
13966 @code{105}, @code{106}, @code{107}
13968 for @var{mcu}=@code{avrtiny}, @code{avrxmega2}, @code{avrxmega4},
13969 @code{avrxmega5}, @code{avrxmega6}, @code{avrxmega7}, respectively.
13970 If @var{mcu} specifies a device, this built-in macro is set
13971 accordingly. For example, with @option{-mmcu=atmega8} the macro is
13972 defined to @code{4}.
13974 @item __AVR_@var{Device}__
13975 Setting @option{-mmcu=@var{device}} defines this built-in macro which reflects
13976 the device's name. For example, @option{-mmcu=atmega8} defines the
13977 built-in macro @code{__AVR_ATmega8__}, @option{-mmcu=attiny261a} defines
13978 @code{__AVR_ATtiny261A__}, etc.
13980 The built-in macros' names follow
13981 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
13982 the device name as from the AVR user manual. The difference between
13983 @var{Device} in the built-in macro and @var{device} in
13984 @option{-mmcu=@var{device}} is that the latter is always lowercase.
13986 If @var{device} is not a device but only a core architecture like
13987 @samp{avr51}, this macro is not defined.
13989 @item __AVR_DEVICE_NAME__
13990 Setting @option{-mmcu=@var{device}} defines this built-in macro to
13991 the device's name. For example, with @option{-mmcu=atmega8} the macro
13992 is defined to @code{atmega8}.
13994 If @var{device} is not a device but only a core architecture like
13995 @samp{avr51}, this macro is not defined.
13997 @item __AVR_XMEGA__
13998 The device / architecture belongs to the XMEGA family of devices.
14000 @item __AVR_HAVE_ELPM__
14001 The device has the @code{ELPM} instruction.
14003 @item __AVR_HAVE_ELPMX__
14004 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
14005 R@var{n},Z+} instructions.
14007 @item __AVR_HAVE_MOVW__
14008 The device has the @code{MOVW} instruction to perform 16-bit
14009 register-register moves.
14011 @item __AVR_HAVE_LPMX__
14012 The device has the @code{LPM R@var{n},Z} and
14013 @code{LPM R@var{n},Z+} instructions.
14015 @item __AVR_HAVE_MUL__
14016 The device has a hardware multiplier. 
14018 @item __AVR_HAVE_JMP_CALL__
14019 The device has the @code{JMP} and @code{CALL} instructions.
14020 This is the case for devices with at least 16@tie{}KiB of program
14021 memory.
14023 @item __AVR_HAVE_EIJMP_EICALL__
14024 @itemx __AVR_3_BYTE_PC__
14025 The device has the @code{EIJMP} and @code{EICALL} instructions.
14026 This is the case for devices with more than 128@tie{}KiB of program memory.
14027 This also means that the program counter
14028 (PC) is 3@tie{}bytes wide.
14030 @item __AVR_2_BYTE_PC__
14031 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
14032 with up to 128@tie{}KiB of program memory.
14034 @item __AVR_HAVE_8BIT_SP__
14035 @itemx __AVR_HAVE_16BIT_SP__
14036 The stack pointer (SP) register is treated as 8-bit respectively
14037 16-bit register by the compiler.
14038 The definition of these macros is affected by @option{-mtiny-stack}.
14040 @item __AVR_HAVE_SPH__
14041 @itemx __AVR_SP8__
14042 The device has the SPH (high part of stack pointer) special function
14043 register or has an 8-bit stack pointer, respectively.
14044 The definition of these macros is affected by @option{-mmcu=} and
14045 in the cases of @option{-mmcu=avr2} and @option{-mmcu=avr25} also
14046 by @option{-msp8}.
14048 @item __AVR_HAVE_RAMPD__
14049 @itemx __AVR_HAVE_RAMPX__
14050 @itemx __AVR_HAVE_RAMPY__
14051 @itemx __AVR_HAVE_RAMPZ__
14052 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
14053 @code{RAMPZ} special function register, respectively.
14055 @item __NO_INTERRUPTS__
14056 This macro reflects the @option{-mno-interrupts} command-line option.
14058 @item __AVR_ERRATA_SKIP__
14059 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
14060 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
14061 instructions because of a hardware erratum.  Skip instructions are
14062 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
14063 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
14064 set.
14066 @item __AVR_ISA_RMW__
14067 The device has Read-Modify-Write instructions (XCH, LAC, LAS and LAT).
14069 @item __AVR_SFR_OFFSET__=@var{offset}
14070 Instructions that can address I/O special function registers directly
14071 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
14072 address as if addressed by an instruction to access RAM like @code{LD}
14073 or @code{STS}. This offset depends on the device architecture and has
14074 to be subtracted from the RAM address in order to get the
14075 respective I/O@tie{}address.
14077 @item __WITH_AVRLIBC__
14078 The compiler is configured to be used together with AVR-Libc.
14079 See the @option{--with-avrlibc} configure option.
14081 @end table
14083 @node Blackfin Options
14084 @subsection Blackfin Options
14085 @cindex Blackfin Options
14087 @table @gcctabopt
14088 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
14089 @opindex mcpu=
14090 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
14091 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
14092 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
14093 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
14094 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
14095 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
14096 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
14097 @samp{bf561}, @samp{bf592}.
14099 The optional @var{sirevision} specifies the silicon revision of the target
14100 Blackfin processor.  Any workarounds available for the targeted silicon revision
14101 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
14102 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
14103 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
14104 hexadecimal digits representing the major and minor numbers in the silicon
14105 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
14106 is not defined.  If @var{sirevision} is @samp{any}, the
14107 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
14108 If this optional @var{sirevision} is not used, GCC assumes the latest known
14109 silicon revision of the targeted Blackfin processor.
14111 GCC defines a preprocessor macro for the specified @var{cpu}.
14112 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
14113 provided by libgloss to be linked in if @option{-msim} is not given.
14115 Without this option, @samp{bf532} is used as the processor by default.
14117 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
14118 only the preprocessor macro is defined.
14120 @item -msim
14121 @opindex msim
14122 Specifies that the program will be run on the simulator.  This causes
14123 the simulator BSP provided by libgloss to be linked in.  This option
14124 has effect only for @samp{bfin-elf} toolchain.
14125 Certain other options, such as @option{-mid-shared-library} and
14126 @option{-mfdpic}, imply @option{-msim}.
14128 @item -momit-leaf-frame-pointer
14129 @opindex momit-leaf-frame-pointer
14130 Don't keep the frame pointer in a register for leaf functions.  This
14131 avoids the instructions to save, set up and restore frame pointers and
14132 makes an extra register available in leaf functions.  The option
14133 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
14134 which might make debugging harder.
14136 @item -mspecld-anomaly
14137 @opindex mspecld-anomaly
14138 When enabled, the compiler ensures that the generated code does not
14139 contain speculative loads after jump instructions. If this option is used,
14140 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
14142 @item -mno-specld-anomaly
14143 @opindex mno-specld-anomaly
14144 Don't generate extra code to prevent speculative loads from occurring.
14146 @item -mcsync-anomaly
14147 @opindex mcsync-anomaly
14148 When enabled, the compiler ensures that the generated code does not
14149 contain CSYNC or SSYNC instructions too soon after conditional branches.
14150 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
14152 @item -mno-csync-anomaly
14153 @opindex mno-csync-anomaly
14154 Don't generate extra code to prevent CSYNC or SSYNC instructions from
14155 occurring too soon after a conditional branch.
14157 @item -mlow-64k
14158 @opindex mlow-64k
14159 When enabled, the compiler is free to take advantage of the knowledge that
14160 the entire program fits into the low 64k of memory.
14162 @item -mno-low-64k
14163 @opindex mno-low-64k
14164 Assume that the program is arbitrarily large.  This is the default.
14166 @item -mstack-check-l1
14167 @opindex mstack-check-l1
14168 Do stack checking using information placed into L1 scratchpad memory by the
14169 uClinux kernel.
14171 @item -mid-shared-library
14172 @opindex mid-shared-library
14173 Generate code that supports shared libraries via the library ID method.
14174 This allows for execute in place and shared libraries in an environment
14175 without virtual memory management.  This option implies @option{-fPIC}.
14176 With a @samp{bfin-elf} target, this option implies @option{-msim}.
14178 @item -mno-id-shared-library
14179 @opindex mno-id-shared-library
14180 Generate code that doesn't assume ID-based shared libraries are being used.
14181 This is the default.
14183 @item -mleaf-id-shared-library
14184 @opindex mleaf-id-shared-library
14185 Generate code that supports shared libraries via the library ID method,
14186 but assumes that this library or executable won't link against any other
14187 ID shared libraries.  That allows the compiler to use faster code for jumps
14188 and calls.
14190 @item -mno-leaf-id-shared-library
14191 @opindex mno-leaf-id-shared-library
14192 Do not assume that the code being compiled won't link against any ID shared
14193 libraries.  Slower code is generated for jump and call insns.
14195 @item -mshared-library-id=n
14196 @opindex mshared-library-id
14197 Specifies the identification number of the ID-based shared library being
14198 compiled.  Specifying a value of 0 generates more compact code; specifying
14199 other values forces the allocation of that number to the current
14200 library but is no more space- or time-efficient than omitting this option.
14202 @item -msep-data
14203 @opindex msep-data
14204 Generate code that allows the data segment to be located in a different
14205 area of memory from the text segment.  This allows for execute in place in
14206 an environment without virtual memory management by eliminating relocations
14207 against the text section.
14209 @item -mno-sep-data
14210 @opindex mno-sep-data
14211 Generate code that assumes that the data segment follows the text segment.
14212 This is the default.
14214 @item -mlong-calls
14215 @itemx -mno-long-calls
14216 @opindex mlong-calls
14217 @opindex mno-long-calls
14218 Tells the compiler to perform function calls by first loading the
14219 address of the function into a register and then performing a subroutine
14220 call on this register.  This switch is needed if the target function
14221 lies outside of the 24-bit addressing range of the offset-based
14222 version of subroutine call instruction.
14224 This feature is not enabled by default.  Specifying
14225 @option{-mno-long-calls} restores the default behavior.  Note these
14226 switches have no effect on how the compiler generates code to handle
14227 function calls via function pointers.
14229 @item -mfast-fp
14230 @opindex mfast-fp
14231 Link with the fast floating-point library. This library relaxes some of
14232 the IEEE floating-point standard's rules for checking inputs against
14233 Not-a-Number (NAN), in the interest of performance.
14235 @item -minline-plt
14236 @opindex minline-plt
14237 Enable inlining of PLT entries in function calls to functions that are
14238 not known to bind locally.  It has no effect without @option{-mfdpic}.
14240 @item -mmulticore
14241 @opindex mmulticore
14242 Build a standalone application for multicore Blackfin processors. 
14243 This option causes proper start files and link scripts supporting 
14244 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
14245 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
14247 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
14248 selects the one-application-per-core programming model.  Without
14249 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
14250 programming model is used. In this model, the main function of Core B
14251 should be named as @code{coreb_main}.
14253 If this option is not used, the single-core application programming
14254 model is used.
14256 @item -mcorea
14257 @opindex mcorea
14258 Build a standalone application for Core A of BF561 when using
14259 the one-application-per-core programming model. Proper start files
14260 and link scripts are used to support Core A, and the macro
14261 @code{__BFIN_COREA} is defined.
14262 This option can only be used in conjunction with @option{-mmulticore}.
14264 @item -mcoreb
14265 @opindex mcoreb
14266 Build a standalone application for Core B of BF561 when using
14267 the one-application-per-core programming model. Proper start files
14268 and link scripts are used to support Core B, and the macro
14269 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
14270 should be used instead of @code{main}. 
14271 This option can only be used in conjunction with @option{-mmulticore}.
14273 @item -msdram
14274 @opindex msdram
14275 Build a standalone application for SDRAM. Proper start files and
14276 link scripts are used to put the application into SDRAM, and the macro
14277 @code{__BFIN_SDRAM} is defined.
14278 The loader should initialize SDRAM before loading the application.
14280 @item -micplb
14281 @opindex micplb
14282 Assume that ICPLBs are enabled at run time.  This has an effect on certain
14283 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
14284 are enabled; for standalone applications the default is off.
14285 @end table
14287 @node C6X Options
14288 @subsection C6X Options
14289 @cindex C6X Options
14291 @table @gcctabopt
14292 @item -march=@var{name}
14293 @opindex march
14294 This specifies the name of the target architecture.  GCC uses this
14295 name to determine what kind of instructions it can emit when generating
14296 assembly code.  Permissible names are: @samp{c62x},
14297 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
14299 @item -mbig-endian
14300 @opindex mbig-endian
14301 Generate code for a big-endian target.
14303 @item -mlittle-endian
14304 @opindex mlittle-endian
14305 Generate code for a little-endian target.  This is the default.
14307 @item -msim
14308 @opindex msim
14309 Choose startup files and linker script suitable for the simulator.
14311 @item -msdata=default
14312 @opindex msdata=default
14313 Put small global and static data in the @code{.neardata} section,
14314 which is pointed to by register @code{B14}.  Put small uninitialized
14315 global and static data in the @code{.bss} section, which is adjacent
14316 to the @code{.neardata} section.  Put small read-only data into the
14317 @code{.rodata} section.  The corresponding sections used for large
14318 pieces of data are @code{.fardata}, @code{.far} and @code{.const}.
14320 @item -msdata=all
14321 @opindex msdata=all
14322 Put all data, not just small objects, into the sections reserved for
14323 small data, and use addressing relative to the @code{B14} register to
14324 access them.
14326 @item -msdata=none
14327 @opindex msdata=none
14328 Make no use of the sections reserved for small data, and use absolute
14329 addresses to access all data.  Put all initialized global and static
14330 data in the @code{.fardata} section, and all uninitialized data in the
14331 @code{.far} section.  Put all constant data into the @code{.const}
14332 section.
14333 @end table
14335 @node CRIS Options
14336 @subsection CRIS Options
14337 @cindex CRIS Options
14339 These options are defined specifically for the CRIS ports.
14341 @table @gcctabopt
14342 @item -march=@var{architecture-type}
14343 @itemx -mcpu=@var{architecture-type}
14344 @opindex march
14345 @opindex mcpu
14346 Generate code for the specified architecture.  The choices for
14347 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
14348 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
14349 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
14350 @samp{v10}.
14352 @item -mtune=@var{architecture-type}
14353 @opindex mtune
14354 Tune to @var{architecture-type} everything applicable about the generated
14355 code, except for the ABI and the set of available instructions.  The
14356 choices for @var{architecture-type} are the same as for
14357 @option{-march=@var{architecture-type}}.
14359 @item -mmax-stack-frame=@var{n}
14360 @opindex mmax-stack-frame
14361 Warn when the stack frame of a function exceeds @var{n} bytes.
14363 @item -metrax4
14364 @itemx -metrax100
14365 @opindex metrax4
14366 @opindex metrax100
14367 The options @option{-metrax4} and @option{-metrax100} are synonyms for
14368 @option{-march=v3} and @option{-march=v8} respectively.
14370 @item -mmul-bug-workaround
14371 @itemx -mno-mul-bug-workaround
14372 @opindex mmul-bug-workaround
14373 @opindex mno-mul-bug-workaround
14374 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
14375 models where it applies.  This option is active by default.
14377 @item -mpdebug
14378 @opindex mpdebug
14379 Enable CRIS-specific verbose debug-related information in the assembly
14380 code.  This option also has the effect of turning off the @samp{#NO_APP}
14381 formatted-code indicator to the assembler at the beginning of the
14382 assembly file.
14384 @item -mcc-init
14385 @opindex mcc-init
14386 Do not use condition-code results from previous instruction; always emit
14387 compare and test instructions before use of condition codes.
14389 @item -mno-side-effects
14390 @opindex mno-side-effects
14391 Do not emit instructions with side effects in addressing modes other than
14392 post-increment.
14394 @item -mstack-align
14395 @itemx -mno-stack-align
14396 @itemx -mdata-align
14397 @itemx -mno-data-align
14398 @itemx -mconst-align
14399 @itemx -mno-const-align
14400 @opindex mstack-align
14401 @opindex mno-stack-align
14402 @opindex mdata-align
14403 @opindex mno-data-align
14404 @opindex mconst-align
14405 @opindex mno-const-align
14406 These options (@samp{no-} options) arrange (eliminate arrangements) for the
14407 stack frame, individual data and constants to be aligned for the maximum
14408 single data access size for the chosen CPU model.  The default is to
14409 arrange for 32-bit alignment.  ABI details such as structure layout are
14410 not affected by these options.
14412 @item -m32-bit
14413 @itemx -m16-bit
14414 @itemx -m8-bit
14415 @opindex m32-bit
14416 @opindex m16-bit
14417 @opindex m8-bit
14418 Similar to the stack- data- and const-align options above, these options
14419 arrange for stack frame, writable data and constants to all be 32-bit,
14420 16-bit or 8-bit aligned.  The default is 32-bit alignment.
14422 @item -mno-prologue-epilogue
14423 @itemx -mprologue-epilogue
14424 @opindex mno-prologue-epilogue
14425 @opindex mprologue-epilogue
14426 With @option{-mno-prologue-epilogue}, the normal function prologue and
14427 epilogue which set up the stack frame are omitted and no return
14428 instructions or return sequences are generated in the code.  Use this
14429 option only together with visual inspection of the compiled code: no
14430 warnings or errors are generated when call-saved registers must be saved,
14431 or storage for local variables needs to be allocated.
14433 @item -mno-gotplt
14434 @itemx -mgotplt
14435 @opindex mno-gotplt
14436 @opindex mgotplt
14437 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
14438 instruction sequences that load addresses for functions from the PLT part
14439 of the GOT rather than (traditional on other architectures) calls to the
14440 PLT@.  The default is @option{-mgotplt}.
14442 @item -melf
14443 @opindex melf
14444 Legacy no-op option only recognized with the cris-axis-elf and
14445 cris-axis-linux-gnu targets.
14447 @item -mlinux
14448 @opindex mlinux
14449 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
14451 @item -sim
14452 @opindex sim
14453 This option, recognized for the cris-axis-elf, arranges
14454 to link with input-output functions from a simulator library.  Code,
14455 initialized data and zero-initialized data are allocated consecutively.
14457 @item -sim2
14458 @opindex sim2
14459 Like @option{-sim}, but pass linker options to locate initialized data at
14460 0x40000000 and zero-initialized data at 0x80000000.
14461 @end table
14463 @node CR16 Options
14464 @subsection CR16 Options
14465 @cindex CR16 Options
14467 These options are defined specifically for the CR16 ports.
14469 @table @gcctabopt
14471 @item -mmac
14472 @opindex mmac
14473 Enable the use of multiply-accumulate instructions. Disabled by default.
14475 @item -mcr16cplus
14476 @itemx -mcr16c
14477 @opindex mcr16cplus
14478 @opindex mcr16c
14479 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
14480 is default.
14482 @item -msim
14483 @opindex msim
14484 Links the library libsim.a which is in compatible with simulator. Applicable
14485 to ELF compiler only.
14487 @item -mint32
14488 @opindex mint32
14489 Choose integer type as 32-bit wide.
14491 @item -mbit-ops
14492 @opindex mbit-ops
14493 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
14495 @item -mdata-model=@var{model}
14496 @opindex mdata-model
14497 Choose a data model. The choices for @var{model} are @samp{near},
14498 @samp{far} or @samp{medium}. @samp{medium} is default.
14499 However, @samp{far} is not valid with @option{-mcr16c}, as the
14500 CR16C architecture does not support the far data model.
14501 @end table
14503 @node Darwin Options
14504 @subsection Darwin Options
14505 @cindex Darwin options
14507 These options are defined for all architectures running the Darwin operating
14508 system.
14510 FSF GCC on Darwin does not create ``fat'' object files; it creates
14511 an object file for the single architecture that GCC was built to
14512 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
14513 @option{-arch} options are used; it does so by running the compiler or
14514 linker multiple times and joining the results together with
14515 @file{lipo}.
14517 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
14518 @samp{i686}) is determined by the flags that specify the ISA
14519 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
14520 @option{-force_cpusubtype_ALL} option can be used to override this.
14522 The Darwin tools vary in their behavior when presented with an ISA
14523 mismatch.  The assembler, @file{as}, only permits instructions to
14524 be used that are valid for the subtype of the file it is generating,
14525 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
14526 The linker for shared libraries, @file{/usr/bin/libtool}, fails
14527 and prints an error if asked to create a shared library with a less
14528 restrictive subtype than its input files (for instance, trying to put
14529 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
14530 for executables, @command{ld}, quietly gives the executable the most
14531 restrictive subtype of any of its input files.
14533 @table @gcctabopt
14534 @item -F@var{dir}
14535 @opindex F
14536 Add the framework directory @var{dir} to the head of the list of
14537 directories to be searched for header files.  These directories are
14538 interleaved with those specified by @option{-I} options and are
14539 scanned in a left-to-right order.
14541 A framework directory is a directory with frameworks in it.  A
14542 framework is a directory with a @file{Headers} and/or
14543 @file{PrivateHeaders} directory contained directly in it that ends
14544 in @file{.framework}.  The name of a framework is the name of this
14545 directory excluding the @file{.framework}.  Headers associated with
14546 the framework are found in one of those two directories, with
14547 @file{Headers} being searched first.  A subframework is a framework
14548 directory that is in a framework's @file{Frameworks} directory.
14549 Includes of subframework headers can only appear in a header of a
14550 framework that contains the subframework, or in a sibling subframework
14551 header.  Two subframeworks are siblings if they occur in the same
14552 framework.  A subframework should not have the same name as a
14553 framework; a warning is issued if this is violated.  Currently a
14554 subframework cannot have subframeworks; in the future, the mechanism
14555 may be extended to support this.  The standard frameworks can be found
14556 in @file{/System/Library/Frameworks} and
14557 @file{/Library/Frameworks}.  An example include looks like
14558 @code{#include <Framework/header.h>}, where @file{Framework} denotes
14559 the name of the framework and @file{header.h} is found in the
14560 @file{PrivateHeaders} or @file{Headers} directory.
14562 @item -iframework@var{dir}
14563 @opindex iframework
14564 Like @option{-F} except the directory is a treated as a system
14565 directory.  The main difference between this @option{-iframework} and
14566 @option{-F} is that with @option{-iframework} the compiler does not
14567 warn about constructs contained within header files found via
14568 @var{dir}.  This option is valid only for the C family of languages.
14570 @item -gused
14571 @opindex gused
14572 Emit debugging information for symbols that are used.  For stabs
14573 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
14574 This is by default ON@.
14576 @item -gfull
14577 @opindex gfull
14578 Emit debugging information for all symbols and types.
14580 @item -mmacosx-version-min=@var{version}
14581 The earliest version of MacOS X that this executable will run on
14582 is @var{version}.  Typical values of @var{version} include @code{10.1},
14583 @code{10.2}, and @code{10.3.9}.
14585 If the compiler was built to use the system's headers by default,
14586 then the default for this option is the system version on which the
14587 compiler is running, otherwise the default is to make choices that
14588 are compatible with as many systems and code bases as possible.
14590 @item -mkernel
14591 @opindex mkernel
14592 Enable kernel development mode.  The @option{-mkernel} option sets
14593 @option{-static}, @option{-fno-common}, @option{-fno-use-cxa-atexit},
14594 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
14595 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
14596 applicable.  This mode also sets @option{-mno-altivec},
14597 @option{-msoft-float}, @option{-fno-builtin} and
14598 @option{-mlong-branch} for PowerPC targets.
14600 @item -mone-byte-bool
14601 @opindex mone-byte-bool
14602 Override the defaults for @code{bool} so that @code{sizeof(bool)==1}.
14603 By default @code{sizeof(bool)} is @code{4} when compiling for
14604 Darwin/PowerPC and @code{1} when compiling for Darwin/x86, so this
14605 option has no effect on x86.
14607 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
14608 to generate code that is not binary compatible with code generated
14609 without that switch.  Using this switch may require recompiling all
14610 other modules in a program, including system libraries.  Use this
14611 switch to conform to a non-default data model.
14613 @item -mfix-and-continue
14614 @itemx -ffix-and-continue
14615 @itemx -findirect-data
14616 @opindex mfix-and-continue
14617 @opindex ffix-and-continue
14618 @opindex findirect-data
14619 Generate code suitable for fast turnaround development, such as to
14620 allow GDB to dynamically load @file{.o} files into already-running
14621 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
14622 are provided for backwards compatibility.
14624 @item -all_load
14625 @opindex all_load
14626 Loads all members of static archive libraries.
14627 See man ld(1) for more information.
14629 @item -arch_errors_fatal
14630 @opindex arch_errors_fatal
14631 Cause the errors having to do with files that have the wrong architecture
14632 to be fatal.
14634 @item -bind_at_load
14635 @opindex bind_at_load
14636 Causes the output file to be marked such that the dynamic linker will
14637 bind all undefined references when the file is loaded or launched.
14639 @item -bundle
14640 @opindex bundle
14641 Produce a Mach-o bundle format file.
14642 See man ld(1) for more information.
14644 @item -bundle_loader @var{executable}
14645 @opindex bundle_loader
14646 This option specifies the @var{executable} that will load the build
14647 output file being linked.  See man ld(1) for more information.
14649 @item -dynamiclib
14650 @opindex dynamiclib
14651 When passed this option, GCC produces a dynamic library instead of
14652 an executable when linking, using the Darwin @file{libtool} command.
14654 @item -force_cpusubtype_ALL
14655 @opindex force_cpusubtype_ALL
14656 This causes GCC's output file to have the @samp{ALL} subtype, instead of
14657 one controlled by the @option{-mcpu} or @option{-march} option.
14659 @item -allowable_client  @var{client_name}
14660 @itemx -client_name
14661 @itemx -compatibility_version
14662 @itemx -current_version
14663 @itemx -dead_strip
14664 @itemx -dependency-file
14665 @itemx -dylib_file
14666 @itemx -dylinker_install_name
14667 @itemx -dynamic
14668 @itemx -exported_symbols_list
14669 @itemx -filelist
14670 @need 800
14671 @itemx -flat_namespace
14672 @itemx -force_flat_namespace
14673 @itemx -headerpad_max_install_names
14674 @itemx -image_base
14675 @itemx -init
14676 @itemx -install_name
14677 @itemx -keep_private_externs
14678 @itemx -multi_module
14679 @itemx -multiply_defined
14680 @itemx -multiply_defined_unused
14681 @need 800
14682 @itemx -noall_load
14683 @itemx -no_dead_strip_inits_and_terms
14684 @itemx -nofixprebinding
14685 @itemx -nomultidefs
14686 @itemx -noprebind
14687 @itemx -noseglinkedit
14688 @itemx -pagezero_size
14689 @itemx -prebind
14690 @itemx -prebind_all_twolevel_modules
14691 @itemx -private_bundle
14692 @need 800
14693 @itemx -read_only_relocs
14694 @itemx -sectalign
14695 @itemx -sectobjectsymbols
14696 @itemx -whyload
14697 @itemx -seg1addr
14698 @itemx -sectcreate
14699 @itemx -sectobjectsymbols
14700 @itemx -sectorder
14701 @itemx -segaddr
14702 @itemx -segs_read_only_addr
14703 @need 800
14704 @itemx -segs_read_write_addr
14705 @itemx -seg_addr_table
14706 @itemx -seg_addr_table_filename
14707 @itemx -seglinkedit
14708 @itemx -segprot
14709 @itemx -segs_read_only_addr
14710 @itemx -segs_read_write_addr
14711 @itemx -single_module
14712 @itemx -static
14713 @itemx -sub_library
14714 @need 800
14715 @itemx -sub_umbrella
14716 @itemx -twolevel_namespace
14717 @itemx -umbrella
14718 @itemx -undefined
14719 @itemx -unexported_symbols_list
14720 @itemx -weak_reference_mismatches
14721 @itemx -whatsloaded
14722 @opindex allowable_client
14723 @opindex client_name
14724 @opindex compatibility_version
14725 @opindex current_version
14726 @opindex dead_strip
14727 @opindex dependency-file
14728 @opindex dylib_file
14729 @opindex dylinker_install_name
14730 @opindex dynamic
14731 @opindex exported_symbols_list
14732 @opindex filelist
14733 @opindex flat_namespace
14734 @opindex force_flat_namespace
14735 @opindex headerpad_max_install_names
14736 @opindex image_base
14737 @opindex init
14738 @opindex install_name
14739 @opindex keep_private_externs
14740 @opindex multi_module
14741 @opindex multiply_defined
14742 @opindex multiply_defined_unused
14743 @opindex noall_load
14744 @opindex no_dead_strip_inits_and_terms
14745 @opindex nofixprebinding
14746 @opindex nomultidefs
14747 @opindex noprebind
14748 @opindex noseglinkedit
14749 @opindex pagezero_size
14750 @opindex prebind
14751 @opindex prebind_all_twolevel_modules
14752 @opindex private_bundle
14753 @opindex read_only_relocs
14754 @opindex sectalign
14755 @opindex sectobjectsymbols
14756 @opindex whyload
14757 @opindex seg1addr
14758 @opindex sectcreate
14759 @opindex sectobjectsymbols
14760 @opindex sectorder
14761 @opindex segaddr
14762 @opindex segs_read_only_addr
14763 @opindex segs_read_write_addr
14764 @opindex seg_addr_table
14765 @opindex seg_addr_table_filename
14766 @opindex seglinkedit
14767 @opindex segprot
14768 @opindex segs_read_only_addr
14769 @opindex segs_read_write_addr
14770 @opindex single_module
14771 @opindex static
14772 @opindex sub_library
14773 @opindex sub_umbrella
14774 @opindex twolevel_namespace
14775 @opindex umbrella
14776 @opindex undefined
14777 @opindex unexported_symbols_list
14778 @opindex weak_reference_mismatches
14779 @opindex whatsloaded
14780 These options are passed to the Darwin linker.  The Darwin linker man page
14781 describes them in detail.
14782 @end table
14784 @node DEC Alpha Options
14785 @subsection DEC Alpha Options
14787 These @samp{-m} options are defined for the DEC Alpha implementations:
14789 @table @gcctabopt
14790 @item -mno-soft-float
14791 @itemx -msoft-float
14792 @opindex mno-soft-float
14793 @opindex msoft-float
14794 Use (do not use) the hardware floating-point instructions for
14795 floating-point operations.  When @option{-msoft-float} is specified,
14796 functions in @file{libgcc.a} are used to perform floating-point
14797 operations.  Unless they are replaced by routines that emulate the
14798 floating-point operations, or compiled in such a way as to call such
14799 emulations routines, these routines issue floating-point
14800 operations.   If you are compiling for an Alpha without floating-point
14801 operations, you must ensure that the library is built so as not to call
14802 them.
14804 Note that Alpha implementations without floating-point operations are
14805 required to have floating-point registers.
14807 @item -mfp-reg
14808 @itemx -mno-fp-regs
14809 @opindex mfp-reg
14810 @opindex mno-fp-regs
14811 Generate code that uses (does not use) the floating-point register set.
14812 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
14813 register set is not used, floating-point operands are passed in integer
14814 registers as if they were integers and floating-point results are passed
14815 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
14816 so any function with a floating-point argument or return value called by code
14817 compiled with @option{-mno-fp-regs} must also be compiled with that
14818 option.
14820 A typical use of this option is building a kernel that does not use,
14821 and hence need not save and restore, any floating-point registers.
14823 @item -mieee
14824 @opindex mieee
14825 The Alpha architecture implements floating-point hardware optimized for
14826 maximum performance.  It is mostly compliant with the IEEE floating-point
14827 standard.  However, for full compliance, software assistance is
14828 required.  This option generates code fully IEEE-compliant code
14829 @emph{except} that the @var{inexact-flag} is not maintained (see below).
14830 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
14831 defined during compilation.  The resulting code is less efficient but is
14832 able to correctly support denormalized numbers and exceptional IEEE
14833 values such as not-a-number and plus/minus infinity.  Other Alpha
14834 compilers call this option @option{-ieee_with_no_inexact}.
14836 @item -mieee-with-inexact
14837 @opindex mieee-with-inexact
14838 This is like @option{-mieee} except the generated code also maintains
14839 the IEEE @var{inexact-flag}.  Turning on this option causes the
14840 generated code to implement fully-compliant IEEE math.  In addition to
14841 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
14842 macro.  On some Alpha implementations the resulting code may execute
14843 significantly slower than the code generated by default.  Since there is
14844 very little code that depends on the @var{inexact-flag}, you should
14845 normally not specify this option.  Other Alpha compilers call this
14846 option @option{-ieee_with_inexact}.
14848 @item -mfp-trap-mode=@var{trap-mode}
14849 @opindex mfp-trap-mode
14850 This option controls what floating-point related traps are enabled.
14851 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
14852 The trap mode can be set to one of four values:
14854 @table @samp
14855 @item n
14856 This is the default (normal) setting.  The only traps that are enabled
14857 are the ones that cannot be disabled in software (e.g., division by zero
14858 trap).
14860 @item u
14861 In addition to the traps enabled by @samp{n}, underflow traps are enabled
14862 as well.
14864 @item su
14865 Like @samp{u}, but the instructions are marked to be safe for software
14866 completion (see Alpha architecture manual for details).
14868 @item sui
14869 Like @samp{su}, but inexact traps are enabled as well.
14870 @end table
14872 @item -mfp-rounding-mode=@var{rounding-mode}
14873 @opindex mfp-rounding-mode
14874 Selects the IEEE rounding mode.  Other Alpha compilers call this option
14875 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
14878 @table @samp
14879 @item n
14880 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
14881 the nearest machine number or towards the even machine number in case
14882 of a tie.
14884 @item m
14885 Round towards minus infinity.
14887 @item c
14888 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
14890 @item d
14891 Dynamic rounding mode.  A field in the floating-point control register
14892 (@var{fpcr}, see Alpha architecture reference manual) controls the
14893 rounding mode in effect.  The C library initializes this register for
14894 rounding towards plus infinity.  Thus, unless your program modifies the
14895 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
14896 @end table
14898 @item -mtrap-precision=@var{trap-precision}
14899 @opindex mtrap-precision
14900 In the Alpha architecture, floating-point traps are imprecise.  This
14901 means without software assistance it is impossible to recover from a
14902 floating trap and program execution normally needs to be terminated.
14903 GCC can generate code that can assist operating system trap handlers
14904 in determining the exact location that caused a floating-point trap.
14905 Depending on the requirements of an application, different levels of
14906 precisions can be selected:
14908 @table @samp
14909 @item p
14910 Program precision.  This option is the default and means a trap handler
14911 can only identify which program caused a floating-point exception.
14913 @item f
14914 Function precision.  The trap handler can determine the function that
14915 caused a floating-point exception.
14917 @item i
14918 Instruction precision.  The trap handler can determine the exact
14919 instruction that caused a floating-point exception.
14920 @end table
14922 Other Alpha compilers provide the equivalent options called
14923 @option{-scope_safe} and @option{-resumption_safe}.
14925 @item -mieee-conformant
14926 @opindex mieee-conformant
14927 This option marks the generated code as IEEE conformant.  You must not
14928 use this option unless you also specify @option{-mtrap-precision=i} and either
14929 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
14930 is to emit the line @samp{.eflag 48} in the function prologue of the
14931 generated assembly file.
14933 @item -mbuild-constants
14934 @opindex mbuild-constants
14935 Normally GCC examines a 32- or 64-bit integer constant to
14936 see if it can construct it from smaller constants in two or three
14937 instructions.  If it cannot, it outputs the constant as a literal and
14938 generates code to load it from the data segment at run time.
14940 Use this option to require GCC to construct @emph{all} integer constants
14941 using code, even if it takes more instructions (the maximum is six).
14943 You typically use this option to build a shared library dynamic
14944 loader.  Itself a shared library, it must relocate itself in memory
14945 before it can find the variables and constants in its own data segment.
14947 @item -mbwx
14948 @itemx -mno-bwx
14949 @itemx -mcix
14950 @itemx -mno-cix
14951 @itemx -mfix
14952 @itemx -mno-fix
14953 @itemx -mmax
14954 @itemx -mno-max
14955 @opindex mbwx
14956 @opindex mno-bwx
14957 @opindex mcix
14958 @opindex mno-cix
14959 @opindex mfix
14960 @opindex mno-fix
14961 @opindex mmax
14962 @opindex mno-max
14963 Indicate whether GCC should generate code to use the optional BWX,
14964 CIX, FIX and MAX instruction sets.  The default is to use the instruction
14965 sets supported by the CPU type specified via @option{-mcpu=} option or that
14966 of the CPU on which GCC was built if none is specified.
14968 @item -mfloat-vax
14969 @itemx -mfloat-ieee
14970 @opindex mfloat-vax
14971 @opindex mfloat-ieee
14972 Generate code that uses (does not use) VAX F and G floating-point
14973 arithmetic instead of IEEE single and double precision.
14975 @item -mexplicit-relocs
14976 @itemx -mno-explicit-relocs
14977 @opindex mexplicit-relocs
14978 @opindex mno-explicit-relocs
14979 Older Alpha assemblers provided no way to generate symbol relocations
14980 except via assembler macros.  Use of these macros does not allow
14981 optimal instruction scheduling.  GNU binutils as of version 2.12
14982 supports a new syntax that allows the compiler to explicitly mark
14983 which relocations should apply to which instructions.  This option
14984 is mostly useful for debugging, as GCC detects the capabilities of
14985 the assembler when it is built and sets the default accordingly.
14987 @item -msmall-data
14988 @itemx -mlarge-data
14989 @opindex msmall-data
14990 @opindex mlarge-data
14991 When @option{-mexplicit-relocs} is in effect, static data is
14992 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
14993 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
14994 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
14995 16-bit relocations off of the @code{$gp} register.  This limits the
14996 size of the small data area to 64KB, but allows the variables to be
14997 directly accessed via a single instruction.
14999 The default is @option{-mlarge-data}.  With this option the data area
15000 is limited to just below 2GB@.  Programs that require more than 2GB of
15001 data must use @code{malloc} or @code{mmap} to allocate the data in the
15002 heap instead of in the program's data segment.
15004 When generating code for shared libraries, @option{-fpic} implies
15005 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
15007 @item -msmall-text
15008 @itemx -mlarge-text
15009 @opindex msmall-text
15010 @opindex mlarge-text
15011 When @option{-msmall-text} is used, the compiler assumes that the
15012 code of the entire program (or shared library) fits in 4MB, and is
15013 thus reachable with a branch instruction.  When @option{-msmall-data}
15014 is used, the compiler can assume that all local symbols share the
15015 same @code{$gp} value, and thus reduce the number of instructions
15016 required for a function call from 4 to 1.
15018 The default is @option{-mlarge-text}.
15020 @item -mcpu=@var{cpu_type}
15021 @opindex mcpu
15022 Set the instruction set and instruction scheduling parameters for
15023 machine type @var{cpu_type}.  You can specify either the @samp{EV}
15024 style name or the corresponding chip number.  GCC supports scheduling
15025 parameters for the EV4, EV5 and EV6 family of processors and
15026 chooses the default values for the instruction set from the processor
15027 you specify.  If you do not specify a processor type, GCC defaults
15028 to the processor on which the compiler was built.
15030 Supported values for @var{cpu_type} are
15032 @table @samp
15033 @item ev4
15034 @itemx ev45
15035 @itemx 21064
15036 Schedules as an EV4 and has no instruction set extensions.
15038 @item ev5
15039 @itemx 21164
15040 Schedules as an EV5 and has no instruction set extensions.
15042 @item ev56
15043 @itemx 21164a
15044 Schedules as an EV5 and supports the BWX extension.
15046 @item pca56
15047 @itemx 21164pc
15048 @itemx 21164PC
15049 Schedules as an EV5 and supports the BWX and MAX extensions.
15051 @item ev6
15052 @itemx 21264
15053 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
15055 @item ev67
15056 @itemx 21264a
15057 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
15058 @end table
15060 Native toolchains also support the value @samp{native},
15061 which selects the best architecture option for the host processor.
15062 @option{-mcpu=native} has no effect if GCC does not recognize
15063 the processor.
15065 @item -mtune=@var{cpu_type}
15066 @opindex mtune
15067 Set only the instruction scheduling parameters for machine type
15068 @var{cpu_type}.  The instruction set is not changed.
15070 Native toolchains also support the value @samp{native},
15071 which selects the best architecture option for the host processor.
15072 @option{-mtune=native} has no effect if GCC does not recognize
15073 the processor.
15075 @item -mmemory-latency=@var{time}
15076 @opindex mmemory-latency
15077 Sets the latency the scheduler should assume for typical memory
15078 references as seen by the application.  This number is highly
15079 dependent on the memory access patterns used by the application
15080 and the size of the external cache on the machine.
15082 Valid options for @var{time} are
15084 @table @samp
15085 @item @var{number}
15086 A decimal number representing clock cycles.
15088 @item L1
15089 @itemx L2
15090 @itemx L3
15091 @itemx main
15092 The compiler contains estimates of the number of clock cycles for
15093 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
15094 (also called Dcache, Scache, and Bcache), as well as to main memory.
15095 Note that L3 is only valid for EV5.
15097 @end table
15098 @end table
15100 @node FR30 Options
15101 @subsection FR30 Options
15102 @cindex FR30 Options
15104 These options are defined specifically for the FR30 port.
15106 @table @gcctabopt
15108 @item -msmall-model
15109 @opindex msmall-model
15110 Use the small address space model.  This can produce smaller code, but
15111 it does assume that all symbolic values and addresses fit into a
15112 20-bit range.
15114 @item -mno-lsim
15115 @opindex mno-lsim
15116 Assume that runtime support has been provided and so there is no need
15117 to include the simulator library (@file{libsim.a}) on the linker
15118 command line.
15120 @end table
15122 @node FT32 Options
15123 @subsection FT32 Options
15124 @cindex FT32 Options
15126 These options are defined specifically for the FT32 port.
15128 @table @gcctabopt
15130 @item -msim
15131 @opindex msim
15132 Specifies that the program will be run on the simulator.  This causes
15133 an alternate runtime startup and library to be linked.
15134 You must not use this option when generating programs that will run on
15135 real hardware; you must provide your own runtime library for whatever
15136 I/O functions are needed.
15138 @item -mlra
15139 @opindex mlra
15140 Enable Local Register Allocation.  This is still experimental for FT32,
15141 so by default the compiler uses standard reload.
15143 @end table
15145 @node FRV Options
15146 @subsection FRV Options
15147 @cindex FRV Options
15149 @table @gcctabopt
15150 @item -mgpr-32
15151 @opindex mgpr-32
15153 Only use the first 32 general-purpose registers.
15155 @item -mgpr-64
15156 @opindex mgpr-64
15158 Use all 64 general-purpose registers.
15160 @item -mfpr-32
15161 @opindex mfpr-32
15163 Use only the first 32 floating-point registers.
15165 @item -mfpr-64
15166 @opindex mfpr-64
15168 Use all 64 floating-point registers.
15170 @item -mhard-float
15171 @opindex mhard-float
15173 Use hardware instructions for floating-point operations.
15175 @item -msoft-float
15176 @opindex msoft-float
15178 Use library routines for floating-point operations.
15180 @item -malloc-cc
15181 @opindex malloc-cc
15183 Dynamically allocate condition code registers.
15185 @item -mfixed-cc
15186 @opindex mfixed-cc
15188 Do not try to dynamically allocate condition code registers, only
15189 use @code{icc0} and @code{fcc0}.
15191 @item -mdword
15192 @opindex mdword
15194 Change ABI to use double word insns.
15196 @item -mno-dword
15197 @opindex mno-dword
15199 Do not use double word instructions.
15201 @item -mdouble
15202 @opindex mdouble
15204 Use floating-point double instructions.
15206 @item -mno-double
15207 @opindex mno-double
15209 Do not use floating-point double instructions.
15211 @item -mmedia
15212 @opindex mmedia
15214 Use media instructions.
15216 @item -mno-media
15217 @opindex mno-media
15219 Do not use media instructions.
15221 @item -mmuladd
15222 @opindex mmuladd
15224 Use multiply and add/subtract instructions.
15226 @item -mno-muladd
15227 @opindex mno-muladd
15229 Do not use multiply and add/subtract instructions.
15231 @item -mfdpic
15232 @opindex mfdpic
15234 Select the FDPIC ABI, which uses function descriptors to represent
15235 pointers to functions.  Without any PIC/PIE-related options, it
15236 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
15237 assumes GOT entries and small data are within a 12-bit range from the
15238 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
15239 are computed with 32 bits.
15240 With a @samp{bfin-elf} target, this option implies @option{-msim}.
15242 @item -minline-plt
15243 @opindex minline-plt
15245 Enable inlining of PLT entries in function calls to functions that are
15246 not known to bind locally.  It has no effect without @option{-mfdpic}.
15247 It's enabled by default if optimizing for speed and compiling for
15248 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
15249 optimization option such as @option{-O3} or above is present in the
15250 command line.
15252 @item -mTLS
15253 @opindex mTLS
15255 Assume a large TLS segment when generating thread-local code.
15257 @item -mtls
15258 @opindex mtls
15260 Do not assume a large TLS segment when generating thread-local code.
15262 @item -mgprel-ro
15263 @opindex mgprel-ro
15265 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
15266 that is known to be in read-only sections.  It's enabled by default,
15267 except for @option{-fpic} or @option{-fpie}: even though it may help
15268 make the global offset table smaller, it trades 1 instruction for 4.
15269 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
15270 one of which may be shared by multiple symbols, and it avoids the need
15271 for a GOT entry for the referenced symbol, so it's more likely to be a
15272 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
15274 @item -multilib-library-pic
15275 @opindex multilib-library-pic
15277 Link with the (library, not FD) pic libraries.  It's implied by
15278 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
15279 @option{-fpic} without @option{-mfdpic}.  You should never have to use
15280 it explicitly.
15282 @item -mlinked-fp
15283 @opindex mlinked-fp
15285 Follow the EABI requirement of always creating a frame pointer whenever
15286 a stack frame is allocated.  This option is enabled by default and can
15287 be disabled with @option{-mno-linked-fp}.
15289 @item -mlong-calls
15290 @opindex mlong-calls
15292 Use indirect addressing to call functions outside the current
15293 compilation unit.  This allows the functions to be placed anywhere
15294 within the 32-bit address space.
15296 @item -malign-labels
15297 @opindex malign-labels
15299 Try to align labels to an 8-byte boundary by inserting NOPs into the
15300 previous packet.  This option only has an effect when VLIW packing
15301 is enabled.  It doesn't create new packets; it merely adds NOPs to
15302 existing ones.
15304 @item -mlibrary-pic
15305 @opindex mlibrary-pic
15307 Generate position-independent EABI code.
15309 @item -macc-4
15310 @opindex macc-4
15312 Use only the first four media accumulator registers.
15314 @item -macc-8
15315 @opindex macc-8
15317 Use all eight media accumulator registers.
15319 @item -mpack
15320 @opindex mpack
15322 Pack VLIW instructions.
15324 @item -mno-pack
15325 @opindex mno-pack
15327 Do not pack VLIW instructions.
15329 @item -mno-eflags
15330 @opindex mno-eflags
15332 Do not mark ABI switches in e_flags.
15334 @item -mcond-move
15335 @opindex mcond-move
15337 Enable the use of conditional-move instructions (default).
15339 This switch is mainly for debugging the compiler and will likely be removed
15340 in a future version.
15342 @item -mno-cond-move
15343 @opindex mno-cond-move
15345 Disable the use of conditional-move instructions.
15347 This switch is mainly for debugging the compiler and will likely be removed
15348 in a future version.
15350 @item -mscc
15351 @opindex mscc
15353 Enable the use of conditional set instructions (default).
15355 This switch is mainly for debugging the compiler and will likely be removed
15356 in a future version.
15358 @item -mno-scc
15359 @opindex mno-scc
15361 Disable the use of conditional set instructions.
15363 This switch is mainly for debugging the compiler and will likely be removed
15364 in a future version.
15366 @item -mcond-exec
15367 @opindex mcond-exec
15369 Enable the use of conditional execution (default).
15371 This switch is mainly for debugging the compiler and will likely be removed
15372 in a future version.
15374 @item -mno-cond-exec
15375 @opindex mno-cond-exec
15377 Disable the use of conditional execution.
15379 This switch is mainly for debugging the compiler and will likely be removed
15380 in a future version.
15382 @item -mvliw-branch
15383 @opindex mvliw-branch
15385 Run a pass to pack branches into VLIW instructions (default).
15387 This switch is mainly for debugging the compiler and will likely be removed
15388 in a future version.
15390 @item -mno-vliw-branch
15391 @opindex mno-vliw-branch
15393 Do not run a pass to pack branches into VLIW instructions.
15395 This switch is mainly for debugging the compiler and will likely be removed
15396 in a future version.
15398 @item -mmulti-cond-exec
15399 @opindex mmulti-cond-exec
15401 Enable optimization of @code{&&} and @code{||} in conditional execution
15402 (default).
15404 This switch is mainly for debugging the compiler and will likely be removed
15405 in a future version.
15407 @item -mno-multi-cond-exec
15408 @opindex mno-multi-cond-exec
15410 Disable optimization of @code{&&} and @code{||} in conditional execution.
15412 This switch is mainly for debugging the compiler and will likely be removed
15413 in a future version.
15415 @item -mnested-cond-exec
15416 @opindex mnested-cond-exec
15418 Enable nested conditional execution optimizations (default).
15420 This switch is mainly for debugging the compiler and will likely be removed
15421 in a future version.
15423 @item -mno-nested-cond-exec
15424 @opindex mno-nested-cond-exec
15426 Disable nested conditional execution optimizations.
15428 This switch is mainly for debugging the compiler and will likely be removed
15429 in a future version.
15431 @item -moptimize-membar
15432 @opindex moptimize-membar
15434 This switch removes redundant @code{membar} instructions from the
15435 compiler-generated code.  It is enabled by default.
15437 @item -mno-optimize-membar
15438 @opindex mno-optimize-membar
15440 This switch disables the automatic removal of redundant @code{membar}
15441 instructions from the generated code.
15443 @item -mtomcat-stats
15444 @opindex mtomcat-stats
15446 Cause gas to print out tomcat statistics.
15448 @item -mcpu=@var{cpu}
15449 @opindex mcpu
15451 Select the processor type for which to generate code.  Possible values are
15452 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
15453 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
15455 @end table
15457 @node GNU/Linux Options
15458 @subsection GNU/Linux Options
15460 These @samp{-m} options are defined for GNU/Linux targets:
15462 @table @gcctabopt
15463 @item -mglibc
15464 @opindex mglibc
15465 Use the GNU C library.  This is the default except
15466 on @samp{*-*-linux-*uclibc*}, @samp{*-*-linux-*musl*} and
15467 @samp{*-*-linux-*android*} targets.
15469 @item -muclibc
15470 @opindex muclibc
15471 Use uClibc C library.  This is the default on
15472 @samp{*-*-linux-*uclibc*} targets.
15474 @item -mmusl
15475 @opindex mmusl
15476 Use the musl C library.  This is the default on
15477 @samp{*-*-linux-*musl*} targets.
15479 @item -mbionic
15480 @opindex mbionic
15481 Use Bionic C library.  This is the default on
15482 @samp{*-*-linux-*android*} targets.
15484 @item -mandroid
15485 @opindex mandroid
15486 Compile code compatible with Android platform.  This is the default on
15487 @samp{*-*-linux-*android*} targets.
15489 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
15490 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
15491 this option makes the GCC driver pass Android-specific options to the linker.
15492 Finally, this option causes the preprocessor macro @code{__ANDROID__}
15493 to be defined.
15495 @item -tno-android-cc
15496 @opindex tno-android-cc
15497 Disable compilation effects of @option{-mandroid}, i.e., do not enable
15498 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
15499 @option{-fno-rtti} by default.
15501 @item -tno-android-ld
15502 @opindex tno-android-ld
15503 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
15504 linking options to the linker.
15506 @end table
15508 @node H8/300 Options
15509 @subsection H8/300 Options
15511 These @samp{-m} options are defined for the H8/300 implementations:
15513 @table @gcctabopt
15514 @item -mrelax
15515 @opindex mrelax
15516 Shorten some address references at link time, when possible; uses the
15517 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
15518 ld, Using ld}, for a fuller description.
15520 @item -mh
15521 @opindex mh
15522 Generate code for the H8/300H@.
15524 @item -ms
15525 @opindex ms
15526 Generate code for the H8S@.
15528 @item -mn
15529 @opindex mn
15530 Generate code for the H8S and H8/300H in the normal mode.  This switch
15531 must be used either with @option{-mh} or @option{-ms}.
15533 @item -ms2600
15534 @opindex ms2600
15535 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
15537 @item -mexr
15538 @opindex mexr
15539 Extended registers are stored on stack before execution of function
15540 with monitor attribute. Default option is @option{-mexr}.
15541 This option is valid only for H8S targets.
15543 @item -mno-exr
15544 @opindex mno-exr
15545 Extended registers are not stored on stack before execution of function 
15546 with monitor attribute. Default option is @option{-mno-exr}. 
15547 This option is valid only for H8S targets.
15549 @item -mint32
15550 @opindex mint32
15551 Make @code{int} data 32 bits by default.
15553 @item -malign-300
15554 @opindex malign-300
15555 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
15556 The default for the H8/300H and H8S is to align longs and floats on
15557 4-byte boundaries.
15558 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
15559 This option has no effect on the H8/300.
15560 @end table
15562 @node HPPA Options
15563 @subsection HPPA Options
15564 @cindex HPPA Options
15566 These @samp{-m} options are defined for the HPPA family of computers:
15568 @table @gcctabopt
15569 @item -march=@var{architecture-type}
15570 @opindex march
15571 Generate code for the specified architecture.  The choices for
15572 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
15573 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
15574 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
15575 architecture option for your machine.  Code compiled for lower numbered
15576 architectures runs on higher numbered architectures, but not the
15577 other way around.
15579 @item -mpa-risc-1-0
15580 @itemx -mpa-risc-1-1
15581 @itemx -mpa-risc-2-0
15582 @opindex mpa-risc-1-0
15583 @opindex mpa-risc-1-1
15584 @opindex mpa-risc-2-0
15585 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
15587 @item -mjump-in-delay
15588 @opindex mjump-in-delay
15589 This option is ignored and provided for compatibility purposes only.
15591 @item -mdisable-fpregs
15592 @opindex mdisable-fpregs
15593 Prevent floating-point registers from being used in any manner.  This is
15594 necessary for compiling kernels that perform lazy context switching of
15595 floating-point registers.  If you use this option and attempt to perform
15596 floating-point operations, the compiler aborts.
15598 @item -mdisable-indexing
15599 @opindex mdisable-indexing
15600 Prevent the compiler from using indexing address modes.  This avoids some
15601 rather obscure problems when compiling MIG generated code under MACH@.
15603 @item -mno-space-regs
15604 @opindex mno-space-regs
15605 Generate code that assumes the target has no space registers.  This allows
15606 GCC to generate faster indirect calls and use unscaled index address modes.
15608 Such code is suitable for level 0 PA systems and kernels.
15610 @item -mfast-indirect-calls
15611 @opindex mfast-indirect-calls
15612 Generate code that assumes calls never cross space boundaries.  This
15613 allows GCC to emit code that performs faster indirect calls.
15615 This option does not work in the presence of shared libraries or nested
15616 functions.
15618 @item -mfixed-range=@var{register-range}
15619 @opindex mfixed-range
15620 Generate code treating the given register range as fixed registers.
15621 A fixed register is one that the register allocator cannot use.  This is
15622 useful when compiling kernel code.  A register range is specified as
15623 two registers separated by a dash.  Multiple register ranges can be
15624 specified separated by a comma.
15626 @item -mlong-load-store
15627 @opindex mlong-load-store
15628 Generate 3-instruction load and store sequences as sometimes required by
15629 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
15630 the HP compilers.
15632 @item -mportable-runtime
15633 @opindex mportable-runtime
15634 Use the portable calling conventions proposed by HP for ELF systems.
15636 @item -mgas
15637 @opindex mgas
15638 Enable the use of assembler directives only GAS understands.
15640 @item -mschedule=@var{cpu-type}
15641 @opindex mschedule
15642 Schedule code according to the constraints for the machine type
15643 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
15644 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
15645 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
15646 proper scheduling option for your machine.  The default scheduling is
15647 @samp{8000}.
15649 @item -mlinker-opt
15650 @opindex mlinker-opt
15651 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
15652 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
15653 linkers in which they give bogus error messages when linking some programs.
15655 @item -msoft-float
15656 @opindex msoft-float
15657 Generate output containing library calls for floating point.
15658 @strong{Warning:} the requisite libraries are not available for all HPPA
15659 targets.  Normally the facilities of the machine's usual C compiler are
15660 used, but this cannot be done directly in cross-compilation.  You must make
15661 your own arrangements to provide suitable library functions for
15662 cross-compilation.
15664 @option{-msoft-float} changes the calling convention in the output file;
15665 therefore, it is only useful if you compile @emph{all} of a program with
15666 this option.  In particular, you need to compile @file{libgcc.a}, the
15667 library that comes with GCC, with @option{-msoft-float} in order for
15668 this to work.
15670 @item -msio
15671 @opindex msio
15672 Generate the predefine, @code{_SIO}, for server IO@.  The default is
15673 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
15674 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
15675 options are available under HP-UX and HI-UX@.
15677 @item -mgnu-ld
15678 @opindex mgnu-ld
15679 Use options specific to GNU @command{ld}.
15680 This passes @option{-shared} to @command{ld} when
15681 building a shared library.  It is the default when GCC is configured,
15682 explicitly or implicitly, with the GNU linker.  This option does not
15683 affect which @command{ld} is called; it only changes what parameters
15684 are passed to that @command{ld}.
15685 The @command{ld} that is called is determined by the
15686 @option{--with-ld} configure option, GCC's program search path, and
15687 finally by the user's @env{PATH}.  The linker used by GCC can be printed
15688 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
15689 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
15691 @item -mhp-ld
15692 @opindex mhp-ld
15693 Use options specific to HP @command{ld}.
15694 This passes @option{-b} to @command{ld} when building
15695 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
15696 links.  It is the default when GCC is configured, explicitly or
15697 implicitly, with the HP linker.  This option does not affect
15698 which @command{ld} is called; it only changes what parameters are passed to that
15699 @command{ld}.
15700 The @command{ld} that is called is determined by the @option{--with-ld}
15701 configure option, GCC's program search path, and finally by the user's
15702 @env{PATH}.  The linker used by GCC can be printed using @samp{which
15703 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
15704 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
15706 @item -mlong-calls
15707 @opindex mno-long-calls
15708 Generate code that uses long call sequences.  This ensures that a call
15709 is always able to reach linker generated stubs.  The default is to generate
15710 long calls only when the distance from the call site to the beginning
15711 of the function or translation unit, as the case may be, exceeds a
15712 predefined limit set by the branch type being used.  The limits for
15713 normal calls are 7,600,000 and 240,000 bytes, respectively for the
15714 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
15715 240,000 bytes.
15717 Distances are measured from the beginning of functions when using the
15718 @option{-ffunction-sections} option, or when using the @option{-mgas}
15719 and @option{-mno-portable-runtime} options together under HP-UX with
15720 the SOM linker.
15722 It is normally not desirable to use this option as it degrades
15723 performance.  However, it may be useful in large applications,
15724 particularly when partial linking is used to build the application.
15726 The types of long calls used depends on the capabilities of the
15727 assembler and linker, and the type of code being generated.  The
15728 impact on systems that support long absolute calls, and long pic
15729 symbol-difference or pc-relative calls should be relatively small.
15730 However, an indirect call is used on 32-bit ELF systems in pic code
15731 and it is quite long.
15733 @item -munix=@var{unix-std}
15734 @opindex march
15735 Generate compiler predefines and select a startfile for the specified
15736 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
15737 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
15738 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
15739 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
15740 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
15741 and later.
15743 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
15744 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
15745 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
15746 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
15747 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
15748 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
15750 It is @emph{important} to note that this option changes the interfaces
15751 for various library routines.  It also affects the operational behavior
15752 of the C library.  Thus, @emph{extreme} care is needed in using this
15753 option.
15755 Library code that is intended to operate with more than one UNIX
15756 standard must test, set and restore the variable @code{__xpg4_extended_mask}
15757 as appropriate.  Most GNU software doesn't provide this capability.
15759 @item -nolibdld
15760 @opindex nolibdld
15761 Suppress the generation of link options to search libdld.sl when the
15762 @option{-static} option is specified on HP-UX 10 and later.
15764 @item -static
15765 @opindex static
15766 The HP-UX implementation of setlocale in libc has a dependency on
15767 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
15768 when the @option{-static} option is specified, special link options
15769 are needed to resolve this dependency.
15771 On HP-UX 10 and later, the GCC driver adds the necessary options to
15772 link with libdld.sl when the @option{-static} option is specified.
15773 This causes the resulting binary to be dynamic.  On the 64-bit port,
15774 the linkers generate dynamic binaries by default in any case.  The
15775 @option{-nolibdld} option can be used to prevent the GCC driver from
15776 adding these link options.
15778 @item -threads
15779 @opindex threads
15780 Add support for multithreading with the @dfn{dce thread} library
15781 under HP-UX@.  This option sets flags for both the preprocessor and
15782 linker.
15783 @end table
15785 @node IA-64 Options
15786 @subsection IA-64 Options
15787 @cindex IA-64 Options
15789 These are the @samp{-m} options defined for the Intel IA-64 architecture.
15791 @table @gcctabopt
15792 @item -mbig-endian
15793 @opindex mbig-endian
15794 Generate code for a big-endian target.  This is the default for HP-UX@.
15796 @item -mlittle-endian
15797 @opindex mlittle-endian
15798 Generate code for a little-endian target.  This is the default for AIX5
15799 and GNU/Linux.
15801 @item -mgnu-as
15802 @itemx -mno-gnu-as
15803 @opindex mgnu-as
15804 @opindex mno-gnu-as
15805 Generate (or don't) code for the GNU assembler.  This is the default.
15806 @c Also, this is the default if the configure option @option{--with-gnu-as}
15807 @c is used.
15809 @item -mgnu-ld
15810 @itemx -mno-gnu-ld
15811 @opindex mgnu-ld
15812 @opindex mno-gnu-ld
15813 Generate (or don't) code for the GNU linker.  This is the default.
15814 @c Also, this is the default if the configure option @option{--with-gnu-ld}
15815 @c is used.
15817 @item -mno-pic
15818 @opindex mno-pic
15819 Generate code that does not use a global pointer register.  The result
15820 is not position independent code, and violates the IA-64 ABI@.
15822 @item -mvolatile-asm-stop
15823 @itemx -mno-volatile-asm-stop
15824 @opindex mvolatile-asm-stop
15825 @opindex mno-volatile-asm-stop
15826 Generate (or don't) a stop bit immediately before and after volatile asm
15827 statements.
15829 @item -mregister-names
15830 @itemx -mno-register-names
15831 @opindex mregister-names
15832 @opindex mno-register-names
15833 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
15834 the stacked registers.  This may make assembler output more readable.
15836 @item -mno-sdata
15837 @itemx -msdata
15838 @opindex mno-sdata
15839 @opindex msdata
15840 Disable (or enable) optimizations that use the small data section.  This may
15841 be useful for working around optimizer bugs.
15843 @item -mconstant-gp
15844 @opindex mconstant-gp
15845 Generate code that uses a single constant global pointer value.  This is
15846 useful when compiling kernel code.
15848 @item -mauto-pic
15849 @opindex mauto-pic
15850 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
15851 This is useful when compiling firmware code.
15853 @item -minline-float-divide-min-latency
15854 @opindex minline-float-divide-min-latency
15855 Generate code for inline divides of floating-point values
15856 using the minimum latency algorithm.
15858 @item -minline-float-divide-max-throughput
15859 @opindex minline-float-divide-max-throughput
15860 Generate code for inline divides of floating-point values
15861 using the maximum throughput algorithm.
15863 @item -mno-inline-float-divide
15864 @opindex mno-inline-float-divide
15865 Do not generate inline code for divides of floating-point values.
15867 @item -minline-int-divide-min-latency
15868 @opindex minline-int-divide-min-latency
15869 Generate code for inline divides of integer values
15870 using the minimum latency algorithm.
15872 @item -minline-int-divide-max-throughput
15873 @opindex minline-int-divide-max-throughput
15874 Generate code for inline divides of integer values
15875 using the maximum throughput algorithm.
15877 @item -mno-inline-int-divide
15878 @opindex mno-inline-int-divide
15879 Do not generate inline code for divides of integer values.
15881 @item -minline-sqrt-min-latency
15882 @opindex minline-sqrt-min-latency
15883 Generate code for inline square roots
15884 using the minimum latency algorithm.
15886 @item -minline-sqrt-max-throughput
15887 @opindex minline-sqrt-max-throughput
15888 Generate code for inline square roots
15889 using the maximum throughput algorithm.
15891 @item -mno-inline-sqrt
15892 @opindex mno-inline-sqrt
15893 Do not generate inline code for @code{sqrt}.
15895 @item -mfused-madd
15896 @itemx -mno-fused-madd
15897 @opindex mfused-madd
15898 @opindex mno-fused-madd
15899 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
15900 instructions.  The default is to use these instructions.
15902 @item -mno-dwarf2-asm
15903 @itemx -mdwarf2-asm
15904 @opindex mno-dwarf2-asm
15905 @opindex mdwarf2-asm
15906 Don't (or do) generate assembler code for the DWARF 2 line number debugging
15907 info.  This may be useful when not using the GNU assembler.
15909 @item -mearly-stop-bits
15910 @itemx -mno-early-stop-bits
15911 @opindex mearly-stop-bits
15912 @opindex mno-early-stop-bits
15913 Allow stop bits to be placed earlier than immediately preceding the
15914 instruction that triggered the stop bit.  This can improve instruction
15915 scheduling, but does not always do so.
15917 @item -mfixed-range=@var{register-range}
15918 @opindex mfixed-range
15919 Generate code treating the given register range as fixed registers.
15920 A fixed register is one that the register allocator cannot use.  This is
15921 useful when compiling kernel code.  A register range is specified as
15922 two registers separated by a dash.  Multiple register ranges can be
15923 specified separated by a comma.
15925 @item -mtls-size=@var{tls-size}
15926 @opindex mtls-size
15927 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
15930 @item -mtune=@var{cpu-type}
15931 @opindex mtune
15932 Tune the instruction scheduling for a particular CPU, Valid values are
15933 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
15934 and @samp{mckinley}.
15936 @item -milp32
15937 @itemx -mlp64
15938 @opindex milp32
15939 @opindex mlp64
15940 Generate code for a 32-bit or 64-bit environment.
15941 The 32-bit environment sets int, long and pointer to 32 bits.
15942 The 64-bit environment sets int to 32 bits and long and pointer
15943 to 64 bits.  These are HP-UX specific flags.
15945 @item -mno-sched-br-data-spec
15946 @itemx -msched-br-data-spec
15947 @opindex mno-sched-br-data-spec
15948 @opindex msched-br-data-spec
15949 (Dis/En)able data speculative scheduling before reload.
15950 This results in generation of @code{ld.a} instructions and
15951 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
15952 The default is 'disable'.
15954 @item -msched-ar-data-spec
15955 @itemx -mno-sched-ar-data-spec
15956 @opindex msched-ar-data-spec
15957 @opindex mno-sched-ar-data-spec
15958 (En/Dis)able data speculative scheduling after reload.
15959 This results in generation of @code{ld.a} instructions and
15960 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
15961 The default is 'enable'.
15963 @item -mno-sched-control-spec
15964 @itemx -msched-control-spec
15965 @opindex mno-sched-control-spec
15966 @opindex msched-control-spec
15967 (Dis/En)able control speculative scheduling.  This feature is
15968 available only during region scheduling (i.e.@: before reload).
15969 This results in generation of the @code{ld.s} instructions and
15970 the corresponding check instructions @code{chk.s}.
15971 The default is 'disable'.
15973 @item -msched-br-in-data-spec
15974 @itemx -mno-sched-br-in-data-spec
15975 @opindex msched-br-in-data-spec
15976 @opindex mno-sched-br-in-data-spec
15977 (En/Dis)able speculative scheduling of the instructions that
15978 are dependent on the data speculative loads before reload.
15979 This is effective only with @option{-msched-br-data-spec} enabled.
15980 The default is 'enable'.
15982 @item -msched-ar-in-data-spec
15983 @itemx -mno-sched-ar-in-data-spec
15984 @opindex msched-ar-in-data-spec
15985 @opindex mno-sched-ar-in-data-spec
15986 (En/Dis)able speculative scheduling of the instructions that
15987 are dependent on the data speculative loads after reload.
15988 This is effective only with @option{-msched-ar-data-spec} enabled.
15989 The default is 'enable'.
15991 @item -msched-in-control-spec
15992 @itemx -mno-sched-in-control-spec
15993 @opindex msched-in-control-spec
15994 @opindex mno-sched-in-control-spec
15995 (En/Dis)able speculative scheduling of the instructions that
15996 are dependent on the control speculative loads.
15997 This is effective only with @option{-msched-control-spec} enabled.
15998 The default is 'enable'.
16000 @item -mno-sched-prefer-non-data-spec-insns
16001 @itemx -msched-prefer-non-data-spec-insns
16002 @opindex mno-sched-prefer-non-data-spec-insns
16003 @opindex msched-prefer-non-data-spec-insns
16004 If enabled, data-speculative instructions are chosen for schedule
16005 only if there are no other choices at the moment.  This makes
16006 the use of the data speculation much more conservative.
16007 The default is 'disable'.
16009 @item -mno-sched-prefer-non-control-spec-insns
16010 @itemx -msched-prefer-non-control-spec-insns
16011 @opindex mno-sched-prefer-non-control-spec-insns
16012 @opindex msched-prefer-non-control-spec-insns
16013 If enabled, control-speculative instructions are chosen for schedule
16014 only if there are no other choices at the moment.  This makes
16015 the use of the control speculation much more conservative.
16016 The default is 'disable'.
16018 @item -mno-sched-count-spec-in-critical-path
16019 @itemx -msched-count-spec-in-critical-path
16020 @opindex mno-sched-count-spec-in-critical-path
16021 @opindex msched-count-spec-in-critical-path
16022 If enabled, speculative dependencies are considered during
16023 computation of the instructions priorities.  This makes the use of the
16024 speculation a bit more conservative.
16025 The default is 'disable'.
16027 @item -msched-spec-ldc
16028 @opindex msched-spec-ldc
16029 Use a simple data speculation check.  This option is on by default.
16031 @item -msched-control-spec-ldc
16032 @opindex msched-spec-ldc
16033 Use a simple check for control speculation.  This option is on by default.
16035 @item -msched-stop-bits-after-every-cycle
16036 @opindex msched-stop-bits-after-every-cycle
16037 Place a stop bit after every cycle when scheduling.  This option is on
16038 by default.
16040 @item -msched-fp-mem-deps-zero-cost
16041 @opindex msched-fp-mem-deps-zero-cost
16042 Assume that floating-point stores and loads are not likely to cause a conflict
16043 when placed into the same instruction group.  This option is disabled by
16044 default.
16046 @item -msel-sched-dont-check-control-spec
16047 @opindex msel-sched-dont-check-control-spec
16048 Generate checks for control speculation in selective scheduling.
16049 This flag is disabled by default.
16051 @item -msched-max-memory-insns=@var{max-insns}
16052 @opindex msched-max-memory-insns
16053 Limit on the number of memory insns per instruction group, giving lower
16054 priority to subsequent memory insns attempting to schedule in the same
16055 instruction group. Frequently useful to prevent cache bank conflicts.
16056 The default value is 1.
16058 @item -msched-max-memory-insns-hard-limit
16059 @opindex msched-max-memory-insns-hard-limit
16060 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
16061 disallowing more than that number in an instruction group.
16062 Otherwise, the limit is ``soft'', meaning that non-memory operations
16063 are preferred when the limit is reached, but memory operations may still
16064 be scheduled.
16066 @end table
16068 @node LM32 Options
16069 @subsection LM32 Options
16070 @cindex LM32 options
16072 These @option{-m} options are defined for the LatticeMico32 architecture:
16074 @table @gcctabopt
16075 @item -mbarrel-shift-enabled
16076 @opindex mbarrel-shift-enabled
16077 Enable barrel-shift instructions.
16079 @item -mdivide-enabled
16080 @opindex mdivide-enabled
16081 Enable divide and modulus instructions.
16083 @item -mmultiply-enabled
16084 @opindex multiply-enabled
16085 Enable multiply instructions.
16087 @item -msign-extend-enabled
16088 @opindex msign-extend-enabled
16089 Enable sign extend instructions.
16091 @item -muser-enabled
16092 @opindex muser-enabled
16093 Enable user-defined instructions.
16095 @end table
16097 @node M32C Options
16098 @subsection M32C Options
16099 @cindex M32C options
16101 @table @gcctabopt
16102 @item -mcpu=@var{name}
16103 @opindex mcpu=
16104 Select the CPU for which code is generated.  @var{name} may be one of
16105 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
16106 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
16107 the M32C/80 series.
16109 @item -msim
16110 @opindex msim
16111 Specifies that the program will be run on the simulator.  This causes
16112 an alternate runtime library to be linked in which supports, for
16113 example, file I/O@.  You must not use this option when generating
16114 programs that will run on real hardware; you must provide your own
16115 runtime library for whatever I/O functions are needed.
16117 @item -memregs=@var{number}
16118 @opindex memregs=
16119 Specifies the number of memory-based pseudo-registers GCC uses
16120 during code generation.  These pseudo-registers are used like real
16121 registers, so there is a tradeoff between GCC's ability to fit the
16122 code into available registers, and the performance penalty of using
16123 memory instead of registers.  Note that all modules in a program must
16124 be compiled with the same value for this option.  Because of that, you
16125 must not use this option with GCC's default runtime libraries.
16127 @end table
16129 @node M32R/D Options
16130 @subsection M32R/D Options
16131 @cindex M32R/D options
16133 These @option{-m} options are defined for Renesas M32R/D architectures:
16135 @table @gcctabopt
16136 @item -m32r2
16137 @opindex m32r2
16138 Generate code for the M32R/2@.
16140 @item -m32rx
16141 @opindex m32rx
16142 Generate code for the M32R/X@.
16144 @item -m32r
16145 @opindex m32r
16146 Generate code for the M32R@.  This is the default.
16148 @item -mmodel=small
16149 @opindex mmodel=small
16150 Assume all objects live in the lower 16MB of memory (so that their addresses
16151 can be loaded with the @code{ld24} instruction), and assume all subroutines
16152 are reachable with the @code{bl} instruction.
16153 This is the default.
16155 The addressability of a particular object can be set with the
16156 @code{model} attribute.
16158 @item -mmodel=medium
16159 @opindex mmodel=medium
16160 Assume objects may be anywhere in the 32-bit address space (the compiler
16161 generates @code{seth/add3} instructions to load their addresses), and
16162 assume all subroutines are reachable with the @code{bl} instruction.
16164 @item -mmodel=large
16165 @opindex mmodel=large
16166 Assume objects may be anywhere in the 32-bit address space (the compiler
16167 generates @code{seth/add3} instructions to load their addresses), and
16168 assume subroutines may not be reachable with the @code{bl} instruction
16169 (the compiler generates the much slower @code{seth/add3/jl}
16170 instruction sequence).
16172 @item -msdata=none
16173 @opindex msdata=none
16174 Disable use of the small data area.  Variables are put into
16175 one of @code{.data}, @code{.bss}, or @code{.rodata} (unless the
16176 @code{section} attribute has been specified).
16177 This is the default.
16179 The small data area consists of sections @code{.sdata} and @code{.sbss}.
16180 Objects may be explicitly put in the small data area with the
16181 @code{section} attribute using one of these sections.
16183 @item -msdata=sdata
16184 @opindex msdata=sdata
16185 Put small global and static data in the small data area, but do not
16186 generate special code to reference them.
16188 @item -msdata=use
16189 @opindex msdata=use
16190 Put small global and static data in the small data area, and generate
16191 special instructions to reference them.
16193 @item -G @var{num}
16194 @opindex G
16195 @cindex smaller data references
16196 Put global and static objects less than or equal to @var{num} bytes
16197 into the small data or BSS sections instead of the normal data or BSS
16198 sections.  The default value of @var{num} is 8.
16199 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
16200 for this option to have any effect.
16202 All modules should be compiled with the same @option{-G @var{num}} value.
16203 Compiling with different values of @var{num} may or may not work; if it
16204 doesn't the linker gives an error message---incorrect code is not
16205 generated.
16207 @item -mdebug
16208 @opindex mdebug
16209 Makes the M32R-specific code in the compiler display some statistics
16210 that might help in debugging programs.
16212 @item -malign-loops
16213 @opindex malign-loops
16214 Align all loops to a 32-byte boundary.
16216 @item -mno-align-loops
16217 @opindex mno-align-loops
16218 Do not enforce a 32-byte alignment for loops.  This is the default.
16220 @item -missue-rate=@var{number}
16221 @opindex missue-rate=@var{number}
16222 Issue @var{number} instructions per cycle.  @var{number} can only be 1
16223 or 2.
16225 @item -mbranch-cost=@var{number}
16226 @opindex mbranch-cost=@var{number}
16227 @var{number} can only be 1 or 2.  If it is 1 then branches are
16228 preferred over conditional code, if it is 2, then the opposite applies.
16230 @item -mflush-trap=@var{number}
16231 @opindex mflush-trap=@var{number}
16232 Specifies the trap number to use to flush the cache.  The default is
16233 12.  Valid numbers are between 0 and 15 inclusive.
16235 @item -mno-flush-trap
16236 @opindex mno-flush-trap
16237 Specifies that the cache cannot be flushed by using a trap.
16239 @item -mflush-func=@var{name}
16240 @opindex mflush-func=@var{name}
16241 Specifies the name of the operating system function to call to flush
16242 the cache.  The default is @samp{_flush_cache}, but a function call
16243 is only used if a trap is not available.
16245 @item -mno-flush-func
16246 @opindex mno-flush-func
16247 Indicates that there is no OS function for flushing the cache.
16249 @end table
16251 @node M680x0 Options
16252 @subsection M680x0 Options
16253 @cindex M680x0 options
16255 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
16256 The default settings depend on which architecture was selected when
16257 the compiler was configured; the defaults for the most common choices
16258 are given below.
16260 @table @gcctabopt
16261 @item -march=@var{arch}
16262 @opindex march
16263 Generate code for a specific M680x0 or ColdFire instruction set
16264 architecture.  Permissible values of @var{arch} for M680x0
16265 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
16266 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
16267 architectures are selected according to Freescale's ISA classification
16268 and the permissible values are: @samp{isaa}, @samp{isaaplus},
16269 @samp{isab} and @samp{isac}.
16271 GCC defines a macro @code{__mcf@var{arch}__} whenever it is generating
16272 code for a ColdFire target.  The @var{arch} in this macro is one of the
16273 @option{-march} arguments given above.
16275 When used together, @option{-march} and @option{-mtune} select code
16276 that runs on a family of similar processors but that is optimized
16277 for a particular microarchitecture.
16279 @item -mcpu=@var{cpu}
16280 @opindex mcpu
16281 Generate code for a specific M680x0 or ColdFire processor.
16282 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
16283 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
16284 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
16285 below, which also classifies the CPUs into families:
16287 @multitable @columnfractions 0.20 0.80
16288 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
16289 @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}
16290 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
16291 @item @samp{5206e} @tab @samp{5206e}
16292 @item @samp{5208} @tab @samp{5207} @samp{5208}
16293 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
16294 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
16295 @item @samp{5216} @tab @samp{5214} @samp{5216}
16296 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
16297 @item @samp{5225} @tab @samp{5224} @samp{5225}
16298 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
16299 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
16300 @item @samp{5249} @tab @samp{5249}
16301 @item @samp{5250} @tab @samp{5250}
16302 @item @samp{5271} @tab @samp{5270} @samp{5271}
16303 @item @samp{5272} @tab @samp{5272}
16304 @item @samp{5275} @tab @samp{5274} @samp{5275}
16305 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
16306 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
16307 @item @samp{5307} @tab @samp{5307}
16308 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
16309 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
16310 @item @samp{5407} @tab @samp{5407}
16311 @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}
16312 @end multitable
16314 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
16315 @var{arch} is compatible with @var{cpu}.  Other combinations of
16316 @option{-mcpu} and @option{-march} are rejected.
16318 GCC defines the macro @code{__mcf_cpu_@var{cpu}} when ColdFire target
16319 @var{cpu} is selected.  It also defines @code{__mcf_family_@var{family}},
16320 where the value of @var{family} is given by the table above.
16322 @item -mtune=@var{tune}
16323 @opindex mtune
16324 Tune the code for a particular microarchitecture within the
16325 constraints set by @option{-march} and @option{-mcpu}.
16326 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
16327 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
16328 and @samp{cpu32}.  The ColdFire microarchitectures
16329 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
16331 You can also use @option{-mtune=68020-40} for code that needs
16332 to run relatively well on 68020, 68030 and 68040 targets.
16333 @option{-mtune=68020-60} is similar but includes 68060 targets
16334 as well.  These two options select the same tuning decisions as
16335 @option{-m68020-40} and @option{-m68020-60} respectively.
16337 GCC defines the macros @code{__mc@var{arch}} and @code{__mc@var{arch}__}
16338 when tuning for 680x0 architecture @var{arch}.  It also defines
16339 @code{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
16340 option is used.  If GCC is tuning for a range of architectures,
16341 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
16342 it defines the macros for every architecture in the range.
16344 GCC also defines the macro @code{__m@var{uarch}__} when tuning for
16345 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
16346 of the arguments given above.
16348 @item -m68000
16349 @itemx -mc68000
16350 @opindex m68000
16351 @opindex mc68000
16352 Generate output for a 68000.  This is the default
16353 when the compiler is configured for 68000-based systems.
16354 It is equivalent to @option{-march=68000}.
16356 Use this option for microcontrollers with a 68000 or EC000 core,
16357 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
16359 @item -m68010
16360 @opindex m68010
16361 Generate output for a 68010.  This is the default
16362 when the compiler is configured for 68010-based systems.
16363 It is equivalent to @option{-march=68010}.
16365 @item -m68020
16366 @itemx -mc68020
16367 @opindex m68020
16368 @opindex mc68020
16369 Generate output for a 68020.  This is the default
16370 when the compiler is configured for 68020-based systems.
16371 It is equivalent to @option{-march=68020}.
16373 @item -m68030
16374 @opindex m68030
16375 Generate output for a 68030.  This is the default when the compiler is
16376 configured for 68030-based systems.  It is equivalent to
16377 @option{-march=68030}.
16379 @item -m68040
16380 @opindex m68040
16381 Generate output for a 68040.  This is the default when the compiler is
16382 configured for 68040-based systems.  It is equivalent to
16383 @option{-march=68040}.
16385 This option inhibits the use of 68881/68882 instructions that have to be
16386 emulated by software on the 68040.  Use this option if your 68040 does not
16387 have code to emulate those instructions.
16389 @item -m68060
16390 @opindex m68060
16391 Generate output for a 68060.  This is the default when the compiler is
16392 configured for 68060-based systems.  It is equivalent to
16393 @option{-march=68060}.
16395 This option inhibits the use of 68020 and 68881/68882 instructions that
16396 have to be emulated by software on the 68060.  Use this option if your 68060
16397 does not have code to emulate those instructions.
16399 @item -mcpu32
16400 @opindex mcpu32
16401 Generate output for a CPU32.  This is the default
16402 when the compiler is configured for CPU32-based systems.
16403 It is equivalent to @option{-march=cpu32}.
16405 Use this option for microcontrollers with a
16406 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
16407 68336, 68340, 68341, 68349 and 68360.
16409 @item -m5200
16410 @opindex m5200
16411 Generate output for a 520X ColdFire CPU@.  This is the default
16412 when the compiler is configured for 520X-based systems.
16413 It is equivalent to @option{-mcpu=5206}, and is now deprecated
16414 in favor of that option.
16416 Use this option for microcontroller with a 5200 core, including
16417 the MCF5202, MCF5203, MCF5204 and MCF5206.
16419 @item -m5206e
16420 @opindex m5206e
16421 Generate output for a 5206e ColdFire CPU@.  The option is now
16422 deprecated in favor of the equivalent @option{-mcpu=5206e}.
16424 @item -m528x
16425 @opindex m528x
16426 Generate output for a member of the ColdFire 528X family.
16427 The option is now deprecated in favor of the equivalent
16428 @option{-mcpu=528x}.
16430 @item -m5307
16431 @opindex m5307
16432 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
16433 in favor of the equivalent @option{-mcpu=5307}.
16435 @item -m5407
16436 @opindex m5407
16437 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
16438 in favor of the equivalent @option{-mcpu=5407}.
16440 @item -mcfv4e
16441 @opindex mcfv4e
16442 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
16443 This includes use of hardware floating-point instructions.
16444 The option is equivalent to @option{-mcpu=547x}, and is now
16445 deprecated in favor of that option.
16447 @item -m68020-40
16448 @opindex m68020-40
16449 Generate output for a 68040, without using any of the new instructions.
16450 This results in code that can run relatively efficiently on either a
16451 68020/68881 or a 68030 or a 68040.  The generated code does use the
16452 68881 instructions that are emulated on the 68040.
16454 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
16456 @item -m68020-60
16457 @opindex m68020-60
16458 Generate output for a 68060, without using any of the new instructions.
16459 This results in code that can run relatively efficiently on either a
16460 68020/68881 or a 68030 or a 68040.  The generated code does use the
16461 68881 instructions that are emulated on the 68060.
16463 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
16465 @item -mhard-float
16466 @itemx -m68881
16467 @opindex mhard-float
16468 @opindex m68881
16469 Generate floating-point instructions.  This is the default for 68020
16470 and above, and for ColdFire devices that have an FPU@.  It defines the
16471 macro @code{__HAVE_68881__} on M680x0 targets and @code{__mcffpu__}
16472 on ColdFire targets.
16474 @item -msoft-float
16475 @opindex msoft-float
16476 Do not generate floating-point instructions; use library calls instead.
16477 This is the default for 68000, 68010, and 68832 targets.  It is also
16478 the default for ColdFire devices that have no FPU.
16480 @item -mdiv
16481 @itemx -mno-div
16482 @opindex mdiv
16483 @opindex mno-div
16484 Generate (do not generate) ColdFire hardware divide and remainder
16485 instructions.  If @option{-march} is used without @option{-mcpu},
16486 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
16487 architectures.  Otherwise, the default is taken from the target CPU
16488 (either the default CPU, or the one specified by @option{-mcpu}).  For
16489 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
16490 @option{-mcpu=5206e}.
16492 GCC defines the macro @code{__mcfhwdiv__} when this option is enabled.
16494 @item -mshort
16495 @opindex mshort
16496 Consider type @code{int} to be 16 bits wide, like @code{short int}.
16497 Additionally, parameters passed on the stack are also aligned to a
16498 16-bit boundary even on targets whose API mandates promotion to 32-bit.
16500 @item -mno-short
16501 @opindex mno-short
16502 Do not consider type @code{int} to be 16 bits wide.  This is the default.
16504 @item -mnobitfield
16505 @itemx -mno-bitfield
16506 @opindex mnobitfield
16507 @opindex mno-bitfield
16508 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
16509 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
16511 @item -mbitfield
16512 @opindex mbitfield
16513 Do use the bit-field instructions.  The @option{-m68020} option implies
16514 @option{-mbitfield}.  This is the default if you use a configuration
16515 designed for a 68020.
16517 @item -mrtd
16518 @opindex mrtd
16519 Use a different function-calling convention, in which functions
16520 that take a fixed number of arguments return with the @code{rtd}
16521 instruction, which pops their arguments while returning.  This
16522 saves one instruction in the caller since there is no need to pop
16523 the arguments there.
16525 This calling convention is incompatible with the one normally
16526 used on Unix, so you cannot use it if you need to call libraries
16527 compiled with the Unix compiler.
16529 Also, you must provide function prototypes for all functions that
16530 take variable numbers of arguments (including @code{printf});
16531 otherwise incorrect code is generated for calls to those
16532 functions.
16534 In addition, seriously incorrect code results if you call a
16535 function with too many arguments.  (Normally, extra arguments are
16536 harmlessly ignored.)
16538 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
16539 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
16541 @item -mno-rtd
16542 @opindex mno-rtd
16543 Do not use the calling conventions selected by @option{-mrtd}.
16544 This is the default.
16546 @item -malign-int
16547 @itemx -mno-align-int
16548 @opindex malign-int
16549 @opindex mno-align-int
16550 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
16551 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
16552 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
16553 Aligning variables on 32-bit boundaries produces code that runs somewhat
16554 faster on processors with 32-bit busses at the expense of more memory.
16556 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
16557 aligns structures containing the above types differently than
16558 most published application binary interface specifications for the m68k.
16560 @item -mpcrel
16561 @opindex mpcrel
16562 Use the pc-relative addressing mode of the 68000 directly, instead of
16563 using a global offset table.  At present, this option implies @option{-fpic},
16564 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
16565 not presently supported with @option{-mpcrel}, though this could be supported for
16566 68020 and higher processors.
16568 @item -mno-strict-align
16569 @itemx -mstrict-align
16570 @opindex mno-strict-align
16571 @opindex mstrict-align
16572 Do not (do) assume that unaligned memory references are handled by
16573 the system.
16575 @item -msep-data
16576 Generate code that allows the data segment to be located in a different
16577 area of memory from the text segment.  This allows for execute-in-place in
16578 an environment without virtual memory management.  This option implies
16579 @option{-fPIC}.
16581 @item -mno-sep-data
16582 Generate code that assumes that the data segment follows the text segment.
16583 This is the default.
16585 @item -mid-shared-library
16586 Generate code that supports shared libraries via the library ID method.
16587 This allows for execute-in-place and shared libraries in an environment
16588 without virtual memory management.  This option implies @option{-fPIC}.
16590 @item -mno-id-shared-library
16591 Generate code that doesn't assume ID-based shared libraries are being used.
16592 This is the default.
16594 @item -mshared-library-id=n
16595 Specifies the identification number of the ID-based shared library being
16596 compiled.  Specifying a value of 0 generates more compact code; specifying
16597 other values forces the allocation of that number to the current
16598 library, but is no more space- or time-efficient than omitting this option.
16600 @item -mxgot
16601 @itemx -mno-xgot
16602 @opindex mxgot
16603 @opindex mno-xgot
16604 When generating position-independent code for ColdFire, generate code
16605 that works if the GOT has more than 8192 entries.  This code is
16606 larger and slower than code generated without this option.  On M680x0
16607 processors, this option is not needed; @option{-fPIC} suffices.
16609 GCC normally uses a single instruction to load values from the GOT@.
16610 While this is relatively efficient, it only works if the GOT
16611 is smaller than about 64k.  Anything larger causes the linker
16612 to report an error such as:
16614 @cindex relocation truncated to fit (ColdFire)
16615 @smallexample
16616 relocation truncated to fit: R_68K_GOT16O foobar
16617 @end smallexample
16619 If this happens, you should recompile your code with @option{-mxgot}.
16620 It should then work with very large GOTs.  However, code generated with
16621 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
16622 the value of a global symbol.
16624 Note that some linkers, including newer versions of the GNU linker,
16625 can create multiple GOTs and sort GOT entries.  If you have such a linker,
16626 you should only need to use @option{-mxgot} when compiling a single
16627 object file that accesses more than 8192 GOT entries.  Very few do.
16629 These options have no effect unless GCC is generating
16630 position-independent code.
16632 @end table
16634 @node MCore Options
16635 @subsection MCore Options
16636 @cindex MCore options
16638 These are the @samp{-m} options defined for the Motorola M*Core
16639 processors.
16641 @table @gcctabopt
16643 @item -mhardlit
16644 @itemx -mno-hardlit
16645 @opindex mhardlit
16646 @opindex mno-hardlit
16647 Inline constants into the code stream if it can be done in two
16648 instructions or less.
16650 @item -mdiv
16651 @itemx -mno-div
16652 @opindex mdiv
16653 @opindex mno-div
16654 Use the divide instruction.  (Enabled by default).
16656 @item -mrelax-immediate
16657 @itemx -mno-relax-immediate
16658 @opindex mrelax-immediate
16659 @opindex mno-relax-immediate
16660 Allow arbitrary-sized immediates in bit operations.
16662 @item -mwide-bitfields
16663 @itemx -mno-wide-bitfields
16664 @opindex mwide-bitfields
16665 @opindex mno-wide-bitfields
16666 Always treat bit-fields as @code{int}-sized.
16668 @item -m4byte-functions
16669 @itemx -mno-4byte-functions
16670 @opindex m4byte-functions
16671 @opindex mno-4byte-functions
16672 Force all functions to be aligned to a 4-byte boundary.
16674 @item -mcallgraph-data
16675 @itemx -mno-callgraph-data
16676 @opindex mcallgraph-data
16677 @opindex mno-callgraph-data
16678 Emit callgraph information.
16680 @item -mslow-bytes
16681 @itemx -mno-slow-bytes
16682 @opindex mslow-bytes
16683 @opindex mno-slow-bytes
16684 Prefer word access when reading byte quantities.
16686 @item -mlittle-endian
16687 @itemx -mbig-endian
16688 @opindex mlittle-endian
16689 @opindex mbig-endian
16690 Generate code for a little-endian target.
16692 @item -m210
16693 @itemx -m340
16694 @opindex m210
16695 @opindex m340
16696 Generate code for the 210 processor.
16698 @item -mno-lsim
16699 @opindex mno-lsim
16700 Assume that runtime support has been provided and so omit the
16701 simulator library (@file{libsim.a)} from the linker command line.
16703 @item -mstack-increment=@var{size}
16704 @opindex mstack-increment
16705 Set the maximum amount for a single stack increment operation.  Large
16706 values can increase the speed of programs that contain functions
16707 that need a large amount of stack space, but they can also trigger a
16708 segmentation fault if the stack is extended too much.  The default
16709 value is 0x1000.
16711 @end table
16713 @node MeP Options
16714 @subsection MeP Options
16715 @cindex MeP options
16717 @table @gcctabopt
16719 @item -mabsdiff
16720 @opindex mabsdiff
16721 Enables the @code{abs} instruction, which is the absolute difference
16722 between two registers.
16724 @item -mall-opts
16725 @opindex mall-opts
16726 Enables all the optional instructions---average, multiply, divide, bit
16727 operations, leading zero, absolute difference, min/max, clip, and
16728 saturation.
16731 @item -maverage
16732 @opindex maverage
16733 Enables the @code{ave} instruction, which computes the average of two
16734 registers.
16736 @item -mbased=@var{n}
16737 @opindex mbased=
16738 Variables of size @var{n} bytes or smaller are placed in the
16739 @code{.based} section by default.  Based variables use the @code{$tp}
16740 register as a base register, and there is a 128-byte limit to the
16741 @code{.based} section.
16743 @item -mbitops
16744 @opindex mbitops
16745 Enables the bit operation instructions---bit test (@code{btstm}), set
16746 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
16747 test-and-set (@code{tas}).
16749 @item -mc=@var{name}
16750 @opindex mc=
16751 Selects which section constant data is placed in.  @var{name} may
16752 be @samp{tiny}, @samp{near}, or @samp{far}.
16754 @item -mclip
16755 @opindex mclip
16756 Enables the @code{clip} instruction.  Note that @option{-mclip} is not
16757 useful unless you also provide @option{-mminmax}.
16759 @item -mconfig=@var{name}
16760 @opindex mconfig=
16761 Selects one of the built-in core configurations.  Each MeP chip has
16762 one or more modules in it; each module has a core CPU and a variety of
16763 coprocessors, optional instructions, and peripherals.  The
16764 @code{MeP-Integrator} tool, not part of GCC, provides these
16765 configurations through this option; using this option is the same as
16766 using all the corresponding command-line options.  The default
16767 configuration is @samp{default}.
16769 @item -mcop
16770 @opindex mcop
16771 Enables the coprocessor instructions.  By default, this is a 32-bit
16772 coprocessor.  Note that the coprocessor is normally enabled via the
16773 @option{-mconfig=} option.
16775 @item -mcop32
16776 @opindex mcop32
16777 Enables the 32-bit coprocessor's instructions.
16779 @item -mcop64
16780 @opindex mcop64
16781 Enables the 64-bit coprocessor's instructions.
16783 @item -mivc2
16784 @opindex mivc2
16785 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
16787 @item -mdc
16788 @opindex mdc
16789 Causes constant variables to be placed in the @code{.near} section.
16791 @item -mdiv
16792 @opindex mdiv
16793 Enables the @code{div} and @code{divu} instructions.
16795 @item -meb
16796 @opindex meb
16797 Generate big-endian code.
16799 @item -mel
16800 @opindex mel
16801 Generate little-endian code.
16803 @item -mio-volatile
16804 @opindex mio-volatile
16805 Tells the compiler that any variable marked with the @code{io}
16806 attribute is to be considered volatile.
16808 @item -ml
16809 @opindex ml
16810 Causes variables to be assigned to the @code{.far} section by default.
16812 @item -mleadz
16813 @opindex mleadz
16814 Enables the @code{leadz} (leading zero) instruction.
16816 @item -mm
16817 @opindex mm
16818 Causes variables to be assigned to the @code{.near} section by default.
16820 @item -mminmax
16821 @opindex mminmax
16822 Enables the @code{min} and @code{max} instructions.
16824 @item -mmult
16825 @opindex mmult
16826 Enables the multiplication and multiply-accumulate instructions.
16828 @item -mno-opts
16829 @opindex mno-opts
16830 Disables all the optional instructions enabled by @option{-mall-opts}.
16832 @item -mrepeat
16833 @opindex mrepeat
16834 Enables the @code{repeat} and @code{erepeat} instructions, used for
16835 low-overhead looping.
16837 @item -ms
16838 @opindex ms
16839 Causes all variables to default to the @code{.tiny} section.  Note
16840 that there is a 65536-byte limit to this section.  Accesses to these
16841 variables use the @code{%gp} base register.
16843 @item -msatur
16844 @opindex msatur
16845 Enables the saturation instructions.  Note that the compiler does not
16846 currently generate these itself, but this option is included for
16847 compatibility with other tools, like @code{as}.
16849 @item -msdram
16850 @opindex msdram
16851 Link the SDRAM-based runtime instead of the default ROM-based runtime.
16853 @item -msim
16854 @opindex msim
16855 Link the simulator run-time libraries.
16857 @item -msimnovec
16858 @opindex msimnovec
16859 Link the simulator runtime libraries, excluding built-in support
16860 for reset and exception vectors and tables.
16862 @item -mtf
16863 @opindex mtf
16864 Causes all functions to default to the @code{.far} section.  Without
16865 this option, functions default to the @code{.near} section.
16867 @item -mtiny=@var{n}
16868 @opindex mtiny=
16869 Variables that are @var{n} bytes or smaller are allocated to the
16870 @code{.tiny} section.  These variables use the @code{$gp} base
16871 register.  The default for this option is 4, but note that there's a
16872 65536-byte limit to the @code{.tiny} section.
16874 @end table
16876 @node MicroBlaze Options
16877 @subsection MicroBlaze Options
16878 @cindex MicroBlaze Options
16880 @table @gcctabopt
16882 @item -msoft-float
16883 @opindex msoft-float
16884 Use software emulation for floating point (default).
16886 @item -mhard-float
16887 @opindex mhard-float
16888 Use hardware floating-point instructions.
16890 @item -mmemcpy
16891 @opindex mmemcpy
16892 Do not optimize block moves, use @code{memcpy}.
16894 @item -mno-clearbss
16895 @opindex mno-clearbss
16896 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
16898 @item -mcpu=@var{cpu-type}
16899 @opindex mcpu=
16900 Use features of, and schedule code for, the given CPU.
16901 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
16902 where @var{X} is a major version, @var{YY} is the minor version, and
16903 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
16904 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
16906 @item -mxl-soft-mul
16907 @opindex mxl-soft-mul
16908 Use software multiply emulation (default).
16910 @item -mxl-soft-div
16911 @opindex mxl-soft-div
16912 Use software emulation for divides (default).
16914 @item -mxl-barrel-shift
16915 @opindex mxl-barrel-shift
16916 Use the hardware barrel shifter.
16918 @item -mxl-pattern-compare
16919 @opindex mxl-pattern-compare
16920 Use pattern compare instructions.
16922 @item -msmall-divides
16923 @opindex msmall-divides
16924 Use table lookup optimization for small signed integer divisions.
16926 @item -mxl-stack-check
16927 @opindex mxl-stack-check
16928 This option is deprecated.  Use @option{-fstack-check} instead.
16930 @item -mxl-gp-opt
16931 @opindex mxl-gp-opt
16932 Use GP-relative @code{.sdata}/@code{.sbss} sections.
16934 @item -mxl-multiply-high
16935 @opindex mxl-multiply-high
16936 Use multiply high instructions for high part of 32x32 multiply.
16938 @item -mxl-float-convert
16939 @opindex mxl-float-convert
16940 Use hardware floating-point conversion instructions.
16942 @item -mxl-float-sqrt
16943 @opindex mxl-float-sqrt
16944 Use hardware floating-point square root instruction.
16946 @item -mbig-endian
16947 @opindex mbig-endian
16948 Generate code for a big-endian target.
16950 @item -mlittle-endian
16951 @opindex mlittle-endian
16952 Generate code for a little-endian target.
16954 @item -mxl-reorder
16955 @opindex mxl-reorder
16956 Use reorder instructions (swap and byte reversed load/store).
16958 @item -mxl-mode-@var{app-model}
16959 Select application model @var{app-model}.  Valid models are
16960 @table @samp
16961 @item executable
16962 normal executable (default), uses startup code @file{crt0.o}.
16964 @item xmdstub
16965 for use with Xilinx Microprocessor Debugger (XMD) based
16966 software intrusive debug agent called xmdstub. This uses startup file
16967 @file{crt1.o} and sets the start address of the program to 0x800.
16969 @item bootstrap
16970 for applications that are loaded using a bootloader.
16971 This model uses startup file @file{crt2.o} which does not contain a processor
16972 reset vector handler. This is suitable for transferring control on a
16973 processor reset to the bootloader rather than the application.
16975 @item novectors
16976 for applications that do not require any of the
16977 MicroBlaze vectors. This option may be useful for applications running
16978 within a monitoring application. This model uses @file{crt3.o} as a startup file.
16979 @end table
16981 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
16982 @option{-mxl-mode-@var{app-model}}.
16984 @end table
16986 @node MIPS Options
16987 @subsection MIPS Options
16988 @cindex MIPS options
16990 @table @gcctabopt
16992 @item -EB
16993 @opindex EB
16994 Generate big-endian code.
16996 @item -EL
16997 @opindex EL
16998 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
16999 configurations.
17001 @item -march=@var{arch}
17002 @opindex march
17003 Generate code that runs on @var{arch}, which can be the name of a
17004 generic MIPS ISA, or the name of a particular processor.
17005 The ISA names are:
17006 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
17007 @samp{mips32}, @samp{mips32r2}, @samp{mips32r3}, @samp{mips32r5},
17008 @samp{mips32r6}, @samp{mips64}, @samp{mips64r2}, @samp{mips64r3},
17009 @samp{mips64r5} and @samp{mips64r6}.
17010 The processor names are:
17011 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
17012 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
17013 @samp{5kc}, @samp{5kf},
17014 @samp{20kc},
17015 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
17016 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
17017 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
17018 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
17019 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
17020 @samp{i6400},
17021 @samp{interaptiv},
17022 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
17023 @samp{m4k},
17024 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
17025 @samp{m5100}, @samp{m5101},
17026 @samp{octeon}, @samp{octeon+}, @samp{octeon2}, @samp{octeon3},
17027 @samp{orion},
17028 @samp{p5600},
17029 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
17030 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
17031 @samp{rm7000}, @samp{rm9000},
17032 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
17033 @samp{sb1},
17034 @samp{sr71000},
17035 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
17036 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
17037 @samp{xlr} and @samp{xlp}.
17038 The special value @samp{from-abi} selects the
17039 most compatible architecture for the selected ABI (that is,
17040 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
17042 The native Linux/GNU toolchain also supports the value @samp{native},
17043 which selects the best architecture option for the host processor.
17044 @option{-march=native} has no effect if GCC does not recognize
17045 the processor.
17047 In processor names, a final @samp{000} can be abbreviated as @samp{k}
17048 (for example, @option{-march=r2k}).  Prefixes are optional, and
17049 @samp{vr} may be written @samp{r}.
17051 Names of the form @samp{@var{n}f2_1} refer to processors with
17052 FPUs clocked at half the rate of the core, names of the form
17053 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
17054 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
17055 processors with FPUs clocked a ratio of 3:2 with respect to the core.
17056 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
17057 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
17058 accepted as synonyms for @samp{@var{n}f1_1}.
17060 GCC defines two macros based on the value of this option.  The first
17061 is @code{_MIPS_ARCH}, which gives the name of target architecture, as
17062 a string.  The second has the form @code{_MIPS_ARCH_@var{foo}},
17063 where @var{foo} is the capitalized value of @code{_MIPS_ARCH}@.
17064 For example, @option{-march=r2000} sets @code{_MIPS_ARCH}
17065 to @code{"r2000"} and defines the macro @code{_MIPS_ARCH_R2000}.
17067 Note that the @code{_MIPS_ARCH} macro uses the processor names given
17068 above.  In other words, it has the full prefix and does not
17069 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
17070 the macro names the resolved architecture (either @code{"mips1"} or
17071 @code{"mips3"}).  It names the default architecture when no
17072 @option{-march} option is given.
17074 @item -mtune=@var{arch}
17075 @opindex mtune
17076 Optimize for @var{arch}.  Among other things, this option controls
17077 the way instructions are scheduled, and the perceived cost of arithmetic
17078 operations.  The list of @var{arch} values is the same as for
17079 @option{-march}.
17081 When this option is not used, GCC optimizes for the processor
17082 specified by @option{-march}.  By using @option{-march} and
17083 @option{-mtune} together, it is possible to generate code that
17084 runs on a family of processors, but optimize the code for one
17085 particular member of that family.
17087 @option{-mtune} defines the macros @code{_MIPS_TUNE} and
17088 @code{_MIPS_TUNE_@var{foo}}, which work in the same way as the
17089 @option{-march} ones described above.
17091 @item -mips1
17092 @opindex mips1
17093 Equivalent to @option{-march=mips1}.
17095 @item -mips2
17096 @opindex mips2
17097 Equivalent to @option{-march=mips2}.
17099 @item -mips3
17100 @opindex mips3
17101 Equivalent to @option{-march=mips3}.
17103 @item -mips4
17104 @opindex mips4
17105 Equivalent to @option{-march=mips4}.
17107 @item -mips32
17108 @opindex mips32
17109 Equivalent to @option{-march=mips32}.
17111 @item -mips32r3
17112 @opindex mips32r3
17113 Equivalent to @option{-march=mips32r3}.
17115 @item -mips32r5
17116 @opindex mips32r5
17117 Equivalent to @option{-march=mips32r5}.
17119 @item -mips32r6
17120 @opindex mips32r6
17121 Equivalent to @option{-march=mips32r6}.
17123 @item -mips64
17124 @opindex mips64
17125 Equivalent to @option{-march=mips64}.
17127 @item -mips64r2
17128 @opindex mips64r2
17129 Equivalent to @option{-march=mips64r2}.
17131 @item -mips64r3
17132 @opindex mips64r3
17133 Equivalent to @option{-march=mips64r3}.
17135 @item -mips64r5
17136 @opindex mips64r5
17137 Equivalent to @option{-march=mips64r5}.
17139 @item -mips64r6
17140 @opindex mips64r6
17141 Equivalent to @option{-march=mips64r6}.
17143 @item -mips16
17144 @itemx -mno-mips16
17145 @opindex mips16
17146 @opindex mno-mips16
17147 Generate (do not generate) MIPS16 code.  If GCC is targeting a
17148 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
17150 MIPS16 code generation can also be controlled on a per-function basis
17151 by means of @code{mips16} and @code{nomips16} attributes.
17152 @xref{Function Attributes}, for more information.
17154 @item -mflip-mips16
17155 @opindex mflip-mips16
17156 Generate MIPS16 code on alternating functions.  This option is provided
17157 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
17158 not intended for ordinary use in compiling user code.
17160 @item -minterlink-compressed
17161 @item -mno-interlink-compressed
17162 @opindex minterlink-compressed
17163 @opindex mno-interlink-compressed
17164 Require (do not require) that code using the standard (uncompressed) MIPS ISA
17165 be link-compatible with MIPS16 and microMIPS code, and vice versa.
17167 For example, code using the standard ISA encoding cannot jump directly
17168 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
17169 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
17170 knows that the target of the jump is not compressed.
17172 @item -minterlink-mips16
17173 @itemx -mno-interlink-mips16
17174 @opindex minterlink-mips16
17175 @opindex mno-interlink-mips16
17176 Aliases of @option{-minterlink-compressed} and
17177 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
17178 and are retained for backwards compatibility.
17180 @item -mabi=32
17181 @itemx -mabi=o64
17182 @itemx -mabi=n32
17183 @itemx -mabi=64
17184 @itemx -mabi=eabi
17185 @opindex mabi=32
17186 @opindex mabi=o64
17187 @opindex mabi=n32
17188 @opindex mabi=64
17189 @opindex mabi=eabi
17190 Generate code for the given ABI@.
17192 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
17193 generates 64-bit code when you select a 64-bit architecture, but you
17194 can use @option{-mgp32} to get 32-bit code instead.
17196 For information about the O64 ABI, see
17197 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
17199 GCC supports a variant of the o32 ABI in which floating-point registers
17200 are 64 rather than 32 bits wide.  You can select this combination with
17201 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
17202 and @code{mfhc1} instructions and is therefore only supported for
17203 MIPS32R2, MIPS32R3 and MIPS32R5 processors.
17205 The register assignments for arguments and return values remain the
17206 same, but each scalar value is passed in a single 64-bit register
17207 rather than a pair of 32-bit registers.  For example, scalar
17208 floating-point values are returned in @samp{$f0} only, not a
17209 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
17210 remains the same in that the even-numbered double-precision registers
17211 are saved.
17213 Two additional variants of the o32 ABI are supported to enable
17214 a transition from 32-bit to 64-bit registers.  These are FPXX
17215 (@option{-mfpxx}) and FP64A (@option{-mfp64} @option{-mno-odd-spreg}).
17216 The FPXX extension mandates that all code must execute correctly
17217 when run using 32-bit or 64-bit registers.  The code can be interlinked
17218 with either FP32 or FP64, but not both.
17219 The FP64A extension is similar to the FP64 extension but forbids the
17220 use of odd-numbered single-precision registers.  This can be used
17221 in conjunction with the @code{FRE} mode of FPUs in MIPS32R5
17222 processors and allows both FP32 and FP64A code to interlink and
17223 run in the same process without changing FPU modes.
17225 @item -mabicalls
17226 @itemx -mno-abicalls
17227 @opindex mabicalls
17228 @opindex mno-abicalls
17229 Generate (do not generate) code that is suitable for SVR4-style
17230 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
17231 systems.
17233 @item -mshared
17234 @itemx -mno-shared
17235 Generate (do not generate) code that is fully position-independent,
17236 and that can therefore be linked into shared libraries.  This option
17237 only affects @option{-mabicalls}.
17239 All @option{-mabicalls} code has traditionally been position-independent,
17240 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
17241 as an extension, the GNU toolchain allows executables to use absolute
17242 accesses for locally-binding symbols.  It can also use shorter GP
17243 initialization sequences and generate direct calls to locally-defined
17244 functions.  This mode is selected by @option{-mno-shared}.
17246 @option{-mno-shared} depends on binutils 2.16 or higher and generates
17247 objects that can only be linked by the GNU linker.  However, the option
17248 does not affect the ABI of the final executable; it only affects the ABI
17249 of relocatable objects.  Using @option{-mno-shared} generally makes
17250 executables both smaller and quicker.
17252 @option{-mshared} is the default.
17254 @item -mplt
17255 @itemx -mno-plt
17256 @opindex mplt
17257 @opindex mno-plt
17258 Assume (do not assume) that the static and dynamic linkers
17259 support PLTs and copy relocations.  This option only affects
17260 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
17261 has no effect without @option{-msym32}.
17263 You can make @option{-mplt} the default by configuring
17264 GCC with @option{--with-mips-plt}.  The default is
17265 @option{-mno-plt} otherwise.
17267 @item -mxgot
17268 @itemx -mno-xgot
17269 @opindex mxgot
17270 @opindex mno-xgot
17271 Lift (do not lift) the usual restrictions on the size of the global
17272 offset table.
17274 GCC normally uses a single instruction to load values from the GOT@.
17275 While this is relatively efficient, it only works if the GOT
17276 is smaller than about 64k.  Anything larger causes the linker
17277 to report an error such as:
17279 @cindex relocation truncated to fit (MIPS)
17280 @smallexample
17281 relocation truncated to fit: R_MIPS_GOT16 foobar
17282 @end smallexample
17284 If this happens, you should recompile your code with @option{-mxgot}.
17285 This works with very large GOTs, although the code is also
17286 less efficient, since it takes three instructions to fetch the
17287 value of a global symbol.
17289 Note that some linkers can create multiple GOTs.  If you have such a
17290 linker, you should only need to use @option{-mxgot} when a single object
17291 file accesses more than 64k's worth of GOT entries.  Very few do.
17293 These options have no effect unless GCC is generating position
17294 independent code.
17296 @item -mgp32
17297 @opindex mgp32
17298 Assume that general-purpose registers are 32 bits wide.
17300 @item -mgp64
17301 @opindex mgp64
17302 Assume that general-purpose registers are 64 bits wide.
17304 @item -mfp32
17305 @opindex mfp32
17306 Assume that floating-point registers are 32 bits wide.
17308 @item -mfp64
17309 @opindex mfp64
17310 Assume that floating-point registers are 64 bits wide.
17312 @item -mfpxx
17313 @opindex mfpxx
17314 Do not assume the width of floating-point registers.
17316 @item -mhard-float
17317 @opindex mhard-float
17318 Use floating-point coprocessor instructions.
17320 @item -msoft-float
17321 @opindex msoft-float
17322 Do not use floating-point coprocessor instructions.  Implement
17323 floating-point calculations using library calls instead.
17325 @item -mno-float
17326 @opindex mno-float
17327 Equivalent to @option{-msoft-float}, but additionally asserts that the
17328 program being compiled does not perform any floating-point operations.
17329 This option is presently supported only by some bare-metal MIPS
17330 configurations, where it may select a special set of libraries
17331 that lack all floating-point support (including, for example, the
17332 floating-point @code{printf} formats).  
17333 If code compiled with @option{-mno-float} accidentally contains
17334 floating-point operations, it is likely to suffer a link-time
17335 or run-time failure.
17337 @item -msingle-float
17338 @opindex msingle-float
17339 Assume that the floating-point coprocessor only supports single-precision
17340 operations.
17342 @item -mdouble-float
17343 @opindex mdouble-float
17344 Assume that the floating-point coprocessor supports double-precision
17345 operations.  This is the default.
17347 @item -modd-spreg
17348 @itemx -mno-odd-spreg
17349 @opindex modd-spreg
17350 @opindex mno-odd-spreg
17351 Enable the use of odd-numbered single-precision floating-point registers
17352 for the o32 ABI.  This is the default for processors that are known to
17353 support these registers.  When using the o32 FPXX ABI, @option{-mno-odd-spreg}
17354 is set by default.
17356 @item -mabs=2008
17357 @itemx -mabs=legacy
17358 @opindex mabs=2008
17359 @opindex mabs=legacy
17360 These options control the treatment of the special not-a-number (NaN)
17361 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
17362 @code{neg.@i{fmt}} machine instructions.
17364 By default or when @option{-mabs=legacy} is used the legacy
17365 treatment is selected.  In this case these instructions are considered
17366 arithmetic and avoided where correct operation is required and the
17367 input operand might be a NaN.  A longer sequence of instructions that
17368 manipulate the sign bit of floating-point datum manually is used
17369 instead unless the @option{-ffinite-math-only} option has also been
17370 specified.
17372 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
17373 this case these instructions are considered non-arithmetic and therefore
17374 operating correctly in all cases, including in particular where the
17375 input operand is a NaN.  These instructions are therefore always used
17376 for the respective operations.
17378 @item -mnan=2008
17379 @itemx -mnan=legacy
17380 @opindex mnan=2008
17381 @opindex mnan=legacy
17382 These options control the encoding of the special not-a-number (NaN)
17383 IEEE 754 floating-point data.
17385 The @option{-mnan=legacy} option selects the legacy encoding.  In this
17386 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
17387 significand field being 0, whereas signalling NaNs (sNaNs) are denoted
17388 by the first bit of their trailing significand field being 1.
17390 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
17391 this case qNaNs are denoted by the first bit of their trailing
17392 significand field being 1, whereas sNaNs are denoted by the first bit of
17393 their trailing significand field being 0.
17395 The default is @option{-mnan=legacy} unless GCC has been configured with
17396 @option{--with-nan=2008}.
17398 @item -mllsc
17399 @itemx -mno-llsc
17400 @opindex mllsc
17401 @opindex mno-llsc
17402 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
17403 implement atomic memory built-in functions.  When neither option is
17404 specified, GCC uses the instructions if the target architecture
17405 supports them.
17407 @option{-mllsc} is useful if the runtime environment can emulate the
17408 instructions and @option{-mno-llsc} can be useful when compiling for
17409 nonstandard ISAs.  You can make either option the default by
17410 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
17411 respectively.  @option{--with-llsc} is the default for some
17412 configurations; see the installation documentation for details.
17414 @item -mdsp
17415 @itemx -mno-dsp
17416 @opindex mdsp
17417 @opindex mno-dsp
17418 Use (do not use) revision 1 of the MIPS DSP ASE@.
17419 @xref{MIPS DSP Built-in Functions}.  This option defines the
17420 preprocessor macro @code{__mips_dsp}.  It also defines
17421 @code{__mips_dsp_rev} to 1.
17423 @item -mdspr2
17424 @itemx -mno-dspr2
17425 @opindex mdspr2
17426 @opindex mno-dspr2
17427 Use (do not use) revision 2 of the MIPS DSP ASE@.
17428 @xref{MIPS DSP Built-in Functions}.  This option defines the
17429 preprocessor macros @code{__mips_dsp} and @code{__mips_dspr2}.
17430 It also defines @code{__mips_dsp_rev} to 2.
17432 @item -msmartmips
17433 @itemx -mno-smartmips
17434 @opindex msmartmips
17435 @opindex mno-smartmips
17436 Use (do not use) the MIPS SmartMIPS ASE.
17438 @item -mpaired-single
17439 @itemx -mno-paired-single
17440 @opindex mpaired-single
17441 @opindex mno-paired-single
17442 Use (do not use) paired-single floating-point instructions.
17443 @xref{MIPS Paired-Single Support}.  This option requires
17444 hardware floating-point support to be enabled.
17446 @item -mdmx
17447 @itemx -mno-mdmx
17448 @opindex mdmx
17449 @opindex mno-mdmx
17450 Use (do not use) MIPS Digital Media Extension instructions.
17451 This option can only be used when generating 64-bit code and requires
17452 hardware floating-point support to be enabled.
17454 @item -mips3d
17455 @itemx -mno-mips3d
17456 @opindex mips3d
17457 @opindex mno-mips3d
17458 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
17459 The option @option{-mips3d} implies @option{-mpaired-single}.
17461 @item -mmicromips
17462 @itemx -mno-micromips
17463 @opindex mmicromips
17464 @opindex mno-mmicromips
17465 Generate (do not generate) microMIPS code.
17467 MicroMIPS code generation can also be controlled on a per-function basis
17468 by means of @code{micromips} and @code{nomicromips} attributes.
17469 @xref{Function Attributes}, for more information.
17471 @item -mmt
17472 @itemx -mno-mt
17473 @opindex mmt
17474 @opindex mno-mt
17475 Use (do not use) MT Multithreading instructions.
17477 @item -mmcu
17478 @itemx -mno-mcu
17479 @opindex mmcu
17480 @opindex mno-mcu
17481 Use (do not use) the MIPS MCU ASE instructions.
17483 @item -meva
17484 @itemx -mno-eva
17485 @opindex meva
17486 @opindex mno-eva
17487 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
17489 @item -mvirt
17490 @itemx -mno-virt
17491 @opindex mvirt
17492 @opindex mno-virt
17493 Use (do not use) the MIPS Virtualization Application Specific instructions.
17495 @item -mxpa
17496 @itemx -mno-xpa
17497 @opindex mxpa
17498 @opindex mno-xpa
17499 Use (do not use) the MIPS eXtended Physical Address (XPA) instructions.
17501 @item -mlong64
17502 @opindex mlong64
17503 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
17504 an explanation of the default and the way that the pointer size is
17505 determined.
17507 @item -mlong32
17508 @opindex mlong32
17509 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
17511 The default size of @code{int}s, @code{long}s and pointers depends on
17512 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
17513 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
17514 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
17515 or the same size as integer registers, whichever is smaller.
17517 @item -msym32
17518 @itemx -mno-sym32
17519 @opindex msym32
17520 @opindex mno-sym32
17521 Assume (do not assume) that all symbols have 32-bit values, regardless
17522 of the selected ABI@.  This option is useful in combination with
17523 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
17524 to generate shorter and faster references to symbolic addresses.
17526 @item -G @var{num}
17527 @opindex G
17528 Put definitions of externally-visible data in a small data section
17529 if that data is no bigger than @var{num} bytes.  GCC can then generate
17530 more efficient accesses to the data; see @option{-mgpopt} for details.
17532 The default @option{-G} option depends on the configuration.
17534 @item -mlocal-sdata
17535 @itemx -mno-local-sdata
17536 @opindex mlocal-sdata
17537 @opindex mno-local-sdata
17538 Extend (do not extend) the @option{-G} behavior to local data too,
17539 such as to static variables in C@.  @option{-mlocal-sdata} is the
17540 default for all configurations.
17542 If the linker complains that an application is using too much small data,
17543 you might want to try rebuilding the less performance-critical parts with
17544 @option{-mno-local-sdata}.  You might also want to build large
17545 libraries with @option{-mno-local-sdata}, so that the libraries leave
17546 more room for the main program.
17548 @item -mextern-sdata
17549 @itemx -mno-extern-sdata
17550 @opindex mextern-sdata
17551 @opindex mno-extern-sdata
17552 Assume (do not assume) that externally-defined data is in
17553 a small data section if the size of that data is within the @option{-G} limit.
17554 @option{-mextern-sdata} is the default for all configurations.
17556 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
17557 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
17558 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
17559 is placed in a small data section.  If @var{Var} is defined by another
17560 module, you must either compile that module with a high-enough
17561 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
17562 definition.  If @var{Var} is common, you must link the application
17563 with a high-enough @option{-G} setting.
17565 The easiest way of satisfying these restrictions is to compile
17566 and link every module with the same @option{-G} option.  However,
17567 you may wish to build a library that supports several different
17568 small data limits.  You can do this by compiling the library with
17569 the highest supported @option{-G} setting and additionally using
17570 @option{-mno-extern-sdata} to stop the library from making assumptions
17571 about externally-defined data.
17573 @item -mgpopt
17574 @itemx -mno-gpopt
17575 @opindex mgpopt
17576 @opindex mno-gpopt
17577 Use (do not use) GP-relative accesses for symbols that are known to be
17578 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
17579 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
17580 configurations.
17582 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
17583 might not hold the value of @code{_gp}.  For example, if the code is
17584 part of a library that might be used in a boot monitor, programs that
17585 call boot monitor routines pass an unknown value in @code{$gp}.
17586 (In such situations, the boot monitor itself is usually compiled
17587 with @option{-G0}.)
17589 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
17590 @option{-mno-extern-sdata}.
17592 @item -membedded-data
17593 @itemx -mno-embedded-data
17594 @opindex membedded-data
17595 @opindex mno-embedded-data
17596 Allocate variables to the read-only data section first if possible, then
17597 next in the small data section if possible, otherwise in data.  This gives
17598 slightly slower code than the default, but reduces the amount of RAM required
17599 when executing, and thus may be preferred for some embedded systems.
17601 @item -muninit-const-in-rodata
17602 @itemx -mno-uninit-const-in-rodata
17603 @opindex muninit-const-in-rodata
17604 @opindex mno-uninit-const-in-rodata
17605 Put uninitialized @code{const} variables in the read-only data section.
17606 This option is only meaningful in conjunction with @option{-membedded-data}.
17608 @item -mcode-readable=@var{setting}
17609 @opindex mcode-readable
17610 Specify whether GCC may generate code that reads from executable sections.
17611 There are three possible settings:
17613 @table @gcctabopt
17614 @item -mcode-readable=yes
17615 Instructions may freely access executable sections.  This is the
17616 default setting.
17618 @item -mcode-readable=pcrel
17619 MIPS16 PC-relative load instructions can access executable sections,
17620 but other instructions must not do so.  This option is useful on 4KSc
17621 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
17622 It is also useful on processors that can be configured to have a dual
17623 instruction/data SRAM interface and that, like the M4K, automatically
17624 redirect PC-relative loads to the instruction RAM.
17626 @item -mcode-readable=no
17627 Instructions must not access executable sections.  This option can be
17628 useful on targets that are configured to have a dual instruction/data
17629 SRAM interface but that (unlike the M4K) do not automatically redirect
17630 PC-relative loads to the instruction RAM.
17631 @end table
17633 @item -msplit-addresses
17634 @itemx -mno-split-addresses
17635 @opindex msplit-addresses
17636 @opindex mno-split-addresses
17637 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
17638 relocation operators.  This option has been superseded by
17639 @option{-mexplicit-relocs} but is retained for backwards compatibility.
17641 @item -mexplicit-relocs
17642 @itemx -mno-explicit-relocs
17643 @opindex mexplicit-relocs
17644 @opindex mno-explicit-relocs
17645 Use (do not use) assembler relocation operators when dealing with symbolic
17646 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
17647 is to use assembler macros instead.
17649 @option{-mexplicit-relocs} is the default if GCC was configured
17650 to use an assembler that supports relocation operators.
17652 @item -mcheck-zero-division
17653 @itemx -mno-check-zero-division
17654 @opindex mcheck-zero-division
17655 @opindex mno-check-zero-division
17656 Trap (do not trap) on integer division by zero.
17658 The default is @option{-mcheck-zero-division}.
17660 @item -mdivide-traps
17661 @itemx -mdivide-breaks
17662 @opindex mdivide-traps
17663 @opindex mdivide-breaks
17664 MIPS systems check for division by zero by generating either a
17665 conditional trap or a break instruction.  Using traps results in
17666 smaller code, but is only supported on MIPS II and later.  Also, some
17667 versions of the Linux kernel have a bug that prevents trap from
17668 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
17669 allow conditional traps on architectures that support them and
17670 @option{-mdivide-breaks} to force the use of breaks.
17672 The default is usually @option{-mdivide-traps}, but this can be
17673 overridden at configure time using @option{--with-divide=breaks}.
17674 Divide-by-zero checks can be completely disabled using
17675 @option{-mno-check-zero-division}.
17677 @item -mmemcpy
17678 @itemx -mno-memcpy
17679 @opindex mmemcpy
17680 @opindex mno-memcpy
17681 Force (do not force) the use of @code{memcpy} for non-trivial block
17682 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
17683 most constant-sized copies.
17685 @item -mlong-calls
17686 @itemx -mno-long-calls
17687 @opindex mlong-calls
17688 @opindex mno-long-calls
17689 Disable (do not disable) use of the @code{jal} instruction.  Calling
17690 functions using @code{jal} is more efficient but requires the caller
17691 and callee to be in the same 256 megabyte segment.
17693 This option has no effect on abicalls code.  The default is
17694 @option{-mno-long-calls}.
17696 @item -mmad
17697 @itemx -mno-mad
17698 @opindex mmad
17699 @opindex mno-mad
17700 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
17701 instructions, as provided by the R4650 ISA@.
17703 @item -mimadd
17704 @itemx -mno-imadd
17705 @opindex mimadd
17706 @opindex mno-imadd
17707 Enable (disable) use of the @code{madd} and @code{msub} integer
17708 instructions.  The default is @option{-mimadd} on architectures
17709 that support @code{madd} and @code{msub} except for the 74k 
17710 architecture where it was found to generate slower code.
17712 @item -mfused-madd
17713 @itemx -mno-fused-madd
17714 @opindex mfused-madd
17715 @opindex mno-fused-madd
17716 Enable (disable) use of the floating-point multiply-accumulate
17717 instructions, when they are available.  The default is
17718 @option{-mfused-madd}.
17720 On the R8000 CPU when multiply-accumulate instructions are used,
17721 the intermediate product is calculated to infinite precision
17722 and is not subject to the FCSR Flush to Zero bit.  This may be
17723 undesirable in some circumstances.  On other processors the result
17724 is numerically identical to the equivalent computation using
17725 separate multiply, add, subtract and negate instructions.
17727 @item -nocpp
17728 @opindex nocpp
17729 Tell the MIPS assembler to not run its preprocessor over user
17730 assembler files (with a @samp{.s} suffix) when assembling them.
17732 @item -mfix-24k
17733 @item -mno-fix-24k
17734 @opindex mfix-24k
17735 @opindex mno-fix-24k
17736 Work around the 24K E48 (lost data on stores during refill) errata.
17737 The workarounds are implemented by the assembler rather than by GCC@.
17739 @item -mfix-r4000
17740 @itemx -mno-fix-r4000
17741 @opindex mfix-r4000
17742 @opindex mno-fix-r4000
17743 Work around certain R4000 CPU errata:
17744 @itemize @minus
17745 @item
17746 A double-word or a variable shift may give an incorrect result if executed
17747 immediately after starting an integer division.
17748 @item
17749 A double-word or a variable shift may give an incorrect result if executed
17750 while an integer multiplication is in progress.
17751 @item
17752 An integer division may give an incorrect result if started in a delay slot
17753 of a taken branch or a jump.
17754 @end itemize
17756 @item -mfix-r4400
17757 @itemx -mno-fix-r4400
17758 @opindex mfix-r4400
17759 @opindex mno-fix-r4400
17760 Work around certain R4400 CPU errata:
17761 @itemize @minus
17762 @item
17763 A double-word or a variable shift may give an incorrect result if executed
17764 immediately after starting an integer division.
17765 @end itemize
17767 @item -mfix-r10000
17768 @itemx -mno-fix-r10000
17769 @opindex mfix-r10000
17770 @opindex mno-fix-r10000
17771 Work around certain R10000 errata:
17772 @itemize @minus
17773 @item
17774 @code{ll}/@code{sc} sequences may not behave atomically on revisions
17775 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
17776 @end itemize
17778 This option can only be used if the target architecture supports
17779 branch-likely instructions.  @option{-mfix-r10000} is the default when
17780 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
17781 otherwise.
17783 @item -mfix-rm7000
17784 @itemx -mno-fix-rm7000
17785 @opindex mfix-rm7000
17786 Work around the RM7000 @code{dmult}/@code{dmultu} errata.  The
17787 workarounds are implemented by the assembler rather than by GCC@.
17789 @item -mfix-vr4120
17790 @itemx -mno-fix-vr4120
17791 @opindex mfix-vr4120
17792 Work around certain VR4120 errata:
17793 @itemize @minus
17794 @item
17795 @code{dmultu} does not always produce the correct result.
17796 @item
17797 @code{div} and @code{ddiv} do not always produce the correct result if one
17798 of the operands is negative.
17799 @end itemize
17800 The workarounds for the division errata rely on special functions in
17801 @file{libgcc.a}.  At present, these functions are only provided by
17802 the @code{mips64vr*-elf} configurations.
17804 Other VR4120 errata require a NOP to be inserted between certain pairs of
17805 instructions.  These errata are handled by the assembler, not by GCC itself.
17807 @item -mfix-vr4130
17808 @opindex mfix-vr4130
17809 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
17810 workarounds are implemented by the assembler rather than by GCC,
17811 although GCC avoids using @code{mflo} and @code{mfhi} if the
17812 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
17813 instructions are available instead.
17815 @item -mfix-sb1
17816 @itemx -mno-fix-sb1
17817 @opindex mfix-sb1
17818 Work around certain SB-1 CPU core errata.
17819 (This flag currently works around the SB-1 revision 2
17820 ``F1'' and ``F2'' floating-point errata.)
17822 @item -mr10k-cache-barrier=@var{setting}
17823 @opindex mr10k-cache-barrier
17824 Specify whether GCC should insert cache barriers to avoid the
17825 side-effects of speculation on R10K processors.
17827 In common with many processors, the R10K tries to predict the outcome
17828 of a conditional branch and speculatively executes instructions from
17829 the ``taken'' branch.  It later aborts these instructions if the
17830 predicted outcome is wrong.  However, on the R10K, even aborted
17831 instructions can have side effects.
17833 This problem only affects kernel stores and, depending on the system,
17834 kernel loads.  As an example, a speculatively-executed store may load
17835 the target memory into cache and mark the cache line as dirty, even if
17836 the store itself is later aborted.  If a DMA operation writes to the
17837 same area of memory before the ``dirty'' line is flushed, the cached
17838 data overwrites the DMA-ed data.  See the R10K processor manual
17839 for a full description, including other potential problems.
17841 One workaround is to insert cache barrier instructions before every memory
17842 access that might be speculatively executed and that might have side
17843 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
17844 controls GCC's implementation of this workaround.  It assumes that
17845 aborted accesses to any byte in the following regions does not have
17846 side effects:
17848 @enumerate
17849 @item
17850 the memory occupied by the current function's stack frame;
17852 @item
17853 the memory occupied by an incoming stack argument;
17855 @item
17856 the memory occupied by an object with a link-time-constant address.
17857 @end enumerate
17859 It is the kernel's responsibility to ensure that speculative
17860 accesses to these regions are indeed safe.
17862 If the input program contains a function declaration such as:
17864 @smallexample
17865 void foo (void);
17866 @end smallexample
17868 then the implementation of @code{foo} must allow @code{j foo} and
17869 @code{jal foo} to be executed speculatively.  GCC honors this
17870 restriction for functions it compiles itself.  It expects non-GCC
17871 functions (such as hand-written assembly code) to do the same.
17873 The option has three forms:
17875 @table @gcctabopt
17876 @item -mr10k-cache-barrier=load-store
17877 Insert a cache barrier before a load or store that might be
17878 speculatively executed and that might have side effects even
17879 if aborted.
17881 @item -mr10k-cache-barrier=store
17882 Insert a cache barrier before a store that might be speculatively
17883 executed and that might have side effects even if aborted.
17885 @item -mr10k-cache-barrier=none
17886 Disable the insertion of cache barriers.  This is the default setting.
17887 @end table
17889 @item -mflush-func=@var{func}
17890 @itemx -mno-flush-func
17891 @opindex mflush-func
17892 Specifies the function to call to flush the I and D caches, or to not
17893 call any such function.  If called, the function must take the same
17894 arguments as the common @code{_flush_func}, that is, the address of the
17895 memory range for which the cache is being flushed, the size of the
17896 memory range, and the number 3 (to flush both caches).  The default
17897 depends on the target GCC was configured for, but commonly is either
17898 @code{_flush_func} or @code{__cpu_flush}.
17900 @item mbranch-cost=@var{num}
17901 @opindex mbranch-cost
17902 Set the cost of branches to roughly @var{num} ``simple'' instructions.
17903 This cost is only a heuristic and is not guaranteed to produce
17904 consistent results across releases.  A zero cost redundantly selects
17905 the default, which is based on the @option{-mtune} setting.
17907 @item -mbranch-likely
17908 @itemx -mno-branch-likely
17909 @opindex mbranch-likely
17910 @opindex mno-branch-likely
17911 Enable or disable use of Branch Likely instructions, regardless of the
17912 default for the selected architecture.  By default, Branch Likely
17913 instructions may be generated if they are supported by the selected
17914 architecture.  An exception is for the MIPS32 and MIPS64 architectures
17915 and processors that implement those architectures; for those, Branch
17916 Likely instructions are not be generated by default because the MIPS32
17917 and MIPS64 architectures specifically deprecate their use.
17919 @item -mfp-exceptions
17920 @itemx -mno-fp-exceptions
17921 @opindex mfp-exceptions
17922 Specifies whether FP exceptions are enabled.  This affects how
17923 FP instructions are scheduled for some processors.
17924 The default is that FP exceptions are
17925 enabled.
17927 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
17928 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
17929 FP pipe.
17931 @item -mvr4130-align
17932 @itemx -mno-vr4130-align
17933 @opindex mvr4130-align
17934 The VR4130 pipeline is two-way superscalar, but can only issue two
17935 instructions together if the first one is 8-byte aligned.  When this
17936 option is enabled, GCC aligns pairs of instructions that it
17937 thinks should execute in parallel.
17939 This option only has an effect when optimizing for the VR4130.
17940 It normally makes code faster, but at the expense of making it bigger.
17941 It is enabled by default at optimization level @option{-O3}.
17943 @item -msynci
17944 @itemx -mno-synci
17945 @opindex msynci
17946 Enable (disable) generation of @code{synci} instructions on
17947 architectures that support it.  The @code{synci} instructions (if
17948 enabled) are generated when @code{__builtin___clear_cache} is
17949 compiled.
17951 This option defaults to @option{-mno-synci}, but the default can be
17952 overridden by configuring GCC with @option{--with-synci}.
17954 When compiling code for single processor systems, it is generally safe
17955 to use @code{synci}.  However, on many multi-core (SMP) systems, it
17956 does not invalidate the instruction caches on all cores and may lead
17957 to undefined behavior.
17959 @item -mrelax-pic-calls
17960 @itemx -mno-relax-pic-calls
17961 @opindex mrelax-pic-calls
17962 Try to turn PIC calls that are normally dispatched via register
17963 @code{$25} into direct calls.  This is only possible if the linker can
17964 resolve the destination at link-time and if the destination is within
17965 range for a direct call.
17967 @option{-mrelax-pic-calls} is the default if GCC was configured to use
17968 an assembler and a linker that support the @code{.reloc} assembly
17969 directive and @option{-mexplicit-relocs} is in effect.  With
17970 @option{-mno-explicit-relocs}, this optimization can be performed by the
17971 assembler and the linker alone without help from the compiler.
17973 @item -mmcount-ra-address
17974 @itemx -mno-mcount-ra-address
17975 @opindex mmcount-ra-address
17976 @opindex mno-mcount-ra-address
17977 Emit (do not emit) code that allows @code{_mcount} to modify the
17978 calling function's return address.  When enabled, this option extends
17979 the usual @code{_mcount} interface with a new @var{ra-address}
17980 parameter, which has type @code{intptr_t *} and is passed in register
17981 @code{$12}.  @code{_mcount} can then modify the return address by
17982 doing both of the following:
17983 @itemize
17984 @item
17985 Returning the new address in register @code{$31}.
17986 @item
17987 Storing the new address in @code{*@var{ra-address}},
17988 if @var{ra-address} is nonnull.
17989 @end itemize
17991 The default is @option{-mno-mcount-ra-address}.
17993 @end table
17995 @node MMIX Options
17996 @subsection MMIX Options
17997 @cindex MMIX Options
17999 These options are defined for the MMIX:
18001 @table @gcctabopt
18002 @item -mlibfuncs
18003 @itemx -mno-libfuncs
18004 @opindex mlibfuncs
18005 @opindex mno-libfuncs
18006 Specify that intrinsic library functions are being compiled, passing all
18007 values in registers, no matter the size.
18009 @item -mepsilon
18010 @itemx -mno-epsilon
18011 @opindex mepsilon
18012 @opindex mno-epsilon
18013 Generate floating-point comparison instructions that compare with respect
18014 to the @code{rE} epsilon register.
18016 @item -mabi=mmixware
18017 @itemx -mabi=gnu
18018 @opindex mabi=mmixware
18019 @opindex mabi=gnu
18020 Generate code that passes function parameters and return values that (in
18021 the called function) are seen as registers @code{$0} and up, as opposed to
18022 the GNU ABI which uses global registers @code{$231} and up.
18024 @item -mzero-extend
18025 @itemx -mno-zero-extend
18026 @opindex mzero-extend
18027 @opindex mno-zero-extend
18028 When reading data from memory in sizes shorter than 64 bits, use (do not
18029 use) zero-extending load instructions by default, rather than
18030 sign-extending ones.
18032 @item -mknuthdiv
18033 @itemx -mno-knuthdiv
18034 @opindex mknuthdiv
18035 @opindex mno-knuthdiv
18036 Make the result of a division yielding a remainder have the same sign as
18037 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
18038 remainder follows the sign of the dividend.  Both methods are
18039 arithmetically valid, the latter being almost exclusively used.
18041 @item -mtoplevel-symbols
18042 @itemx -mno-toplevel-symbols
18043 @opindex mtoplevel-symbols
18044 @opindex mno-toplevel-symbols
18045 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
18046 code can be used with the @code{PREFIX} assembly directive.
18048 @item -melf
18049 @opindex melf
18050 Generate an executable in the ELF format, rather than the default
18051 @samp{mmo} format used by the @command{mmix} simulator.
18053 @item -mbranch-predict
18054 @itemx -mno-branch-predict
18055 @opindex mbranch-predict
18056 @opindex mno-branch-predict
18057 Use (do not use) the probable-branch instructions, when static branch
18058 prediction indicates a probable branch.
18060 @item -mbase-addresses
18061 @itemx -mno-base-addresses
18062 @opindex mbase-addresses
18063 @opindex mno-base-addresses
18064 Generate (do not generate) code that uses @emph{base addresses}.  Using a
18065 base address automatically generates a request (handled by the assembler
18066 and the linker) for a constant to be set up in a global register.  The
18067 register is used for one or more base address requests within the range 0
18068 to 255 from the value held in the register.  The generally leads to short
18069 and fast code, but the number of different data items that can be
18070 addressed is limited.  This means that a program that uses lots of static
18071 data may require @option{-mno-base-addresses}.
18073 @item -msingle-exit
18074 @itemx -mno-single-exit
18075 @opindex msingle-exit
18076 @opindex mno-single-exit
18077 Force (do not force) generated code to have a single exit point in each
18078 function.
18079 @end table
18081 @node MN10300 Options
18082 @subsection MN10300 Options
18083 @cindex MN10300 options
18085 These @option{-m} options are defined for Matsushita MN10300 architectures:
18087 @table @gcctabopt
18088 @item -mmult-bug
18089 @opindex mmult-bug
18090 Generate code to avoid bugs in the multiply instructions for the MN10300
18091 processors.  This is the default.
18093 @item -mno-mult-bug
18094 @opindex mno-mult-bug
18095 Do not generate code to avoid bugs in the multiply instructions for the
18096 MN10300 processors.
18098 @item -mam33
18099 @opindex mam33
18100 Generate code using features specific to the AM33 processor.
18102 @item -mno-am33
18103 @opindex mno-am33
18104 Do not generate code using features specific to the AM33 processor.  This
18105 is the default.
18107 @item -mam33-2
18108 @opindex mam33-2
18109 Generate code using features specific to the AM33/2.0 processor.
18111 @item -mam34
18112 @opindex mam34
18113 Generate code using features specific to the AM34 processor.
18115 @item -mtune=@var{cpu-type}
18116 @opindex mtune
18117 Use the timing characteristics of the indicated CPU type when
18118 scheduling instructions.  This does not change the targeted processor
18119 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
18120 @samp{am33-2} or @samp{am34}.
18122 @item -mreturn-pointer-on-d0
18123 @opindex mreturn-pointer-on-d0
18124 When generating a function that returns a pointer, return the pointer
18125 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
18126 only in @code{a0}, and attempts to call such functions without a prototype
18127 result in errors.  Note that this option is on by default; use
18128 @option{-mno-return-pointer-on-d0} to disable it.
18130 @item -mno-crt0
18131 @opindex mno-crt0
18132 Do not link in the C run-time initialization object file.
18134 @item -mrelax
18135 @opindex mrelax
18136 Indicate to the linker that it should perform a relaxation optimization pass
18137 to shorten branches, calls and absolute memory addresses.  This option only
18138 has an effect when used on the command line for the final link step.
18140 This option makes symbolic debugging impossible.
18142 @item -mliw
18143 @opindex mliw
18144 Allow the compiler to generate @emph{Long Instruction Word}
18145 instructions if the target is the @samp{AM33} or later.  This is the
18146 default.  This option defines the preprocessor macro @code{__LIW__}.
18148 @item -mnoliw
18149 @opindex mnoliw
18150 Do not allow the compiler to generate @emph{Long Instruction Word}
18151 instructions.  This option defines the preprocessor macro
18152 @code{__NO_LIW__}.
18154 @item -msetlb
18155 @opindex msetlb
18156 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
18157 instructions if the target is the @samp{AM33} or later.  This is the
18158 default.  This option defines the preprocessor macro @code{__SETLB__}.
18160 @item -mnosetlb
18161 @opindex mnosetlb
18162 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
18163 instructions.  This option defines the preprocessor macro
18164 @code{__NO_SETLB__}.
18166 @end table
18168 @node Moxie Options
18169 @subsection Moxie Options
18170 @cindex Moxie Options
18172 @table @gcctabopt
18174 @item -meb
18175 @opindex meb
18176 Generate big-endian code.  This is the default for @samp{moxie-*-*}
18177 configurations.
18179 @item -mel
18180 @opindex mel
18181 Generate little-endian code.
18183 @item -mmul.x
18184 @opindex mmul.x
18185 Generate mul.x and umul.x instructions.  This is the default for
18186 @samp{moxiebox-*-*} configurations.
18188 @item -mno-crt0
18189 @opindex mno-crt0
18190 Do not link in the C run-time initialization object file.
18192 @end table
18194 @node MSP430 Options
18195 @subsection MSP430 Options
18196 @cindex MSP430 Options
18198 These options are defined for the MSP430:
18200 @table @gcctabopt
18202 @item -masm-hex
18203 @opindex masm-hex
18204 Force assembly output to always use hex constants.  Normally such
18205 constants are signed decimals, but this option is available for
18206 testsuite and/or aesthetic purposes.
18208 @item -mmcu=
18209 @opindex mmcu=
18210 Select the MCU to target.  This is used to create a C preprocessor
18211 symbol based upon the MCU name, converted to upper case and pre- and
18212 post-fixed with @samp{__}.  This in turn is used by the
18213 @file{msp430.h} header file to select an MCU-specific supplementary
18214 header file.
18216 The option also sets the ISA to use.  If the MCU name is one that is
18217 known to only support the 430 ISA then that is selected, otherwise the
18218 430X ISA is selected.  A generic MCU name of @samp{msp430} can also be
18219 used to select the 430 ISA.  Similarly the generic @samp{msp430x} MCU
18220 name selects the 430X ISA.
18222 In addition an MCU-specific linker script is added to the linker
18223 command line.  The script's name is the name of the MCU with
18224 @file{.ld} appended.  Thus specifying @option{-mmcu=xxx} on the @command{gcc}
18225 command line defines the C preprocessor symbol @code{__XXX__} and
18226 cause the linker to search for a script called @file{xxx.ld}.
18228 This option is also passed on to the assembler.
18230 @item -mcpu=
18231 @opindex mcpu=
18232 Specifies the ISA to use.  Accepted values are @samp{msp430},
18233 @samp{msp430x} and @samp{msp430xv2}.  This option is deprecated.  The
18234 @option{-mmcu=} option should be used to select the ISA.
18236 @item -msim
18237 @opindex msim
18238 Link to the simulator runtime libraries and linker script.  Overrides
18239 any scripts that would be selected by the @option{-mmcu=} option.
18241 @item -mlarge
18242 @opindex mlarge
18243 Use large-model addressing (20-bit pointers, 32-bit @code{size_t}).
18245 @item -msmall
18246 @opindex msmall
18247 Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
18249 @item -mrelax
18250 @opindex mrelax
18251 This option is passed to the assembler and linker, and allows the
18252 linker to perform certain optimizations that cannot be done until
18253 the final link.
18255 @item mhwmult=
18256 @opindex mhwmult=
18257 Describes the type of hardware multiply supported by the target.
18258 Accepted values are @samp{none} for no hardware multiply, @samp{16bit}
18259 for the original 16-bit-only multiply supported by early MCUs.
18260 @samp{32bit} for the 16/32-bit multiply supported by later MCUs and
18261 @samp{f5series} for the 16/32-bit multiply supported by F5-series MCUs.
18262 A value of @samp{auto} can also be given.  This tells GCC to deduce
18263 the hardware multiply support based upon the MCU name provided by the
18264 @option{-mmcu} option.  If no @option{-mmcu} option is specified then
18265 @samp{32bit} hardware multiply support is assumed.  @samp{auto} is the
18266 default setting.
18268 Hardware multiplies are normally performed by calling a library
18269 routine.  This saves space in the generated code.  When compiling at
18270 @option{-O3} or higher however the hardware multiplier is invoked
18271 inline.  This makes for bigger, but faster code.
18273 The hardware multiply routines disable interrupts whilst running and
18274 restore the previous interrupt state when they finish.  This makes
18275 them safe to use inside interrupt handlers as well as in normal code.
18277 @item -minrt
18278 @opindex minrt
18279 Enable the use of a minimum runtime environment - no static
18280 initializers or constructors.  This is intended for memory-constrained
18281 devices.  The compiler includes special symbols in some objects
18282 that tell the linker and runtime which code fragments are required.
18284 @item -mcode-region=
18285 @itemx -mdata-region=
18286 @opindex mcode-region
18287 @opindex mdata-region
18288 These options tell the compiler where to place functions and data that
18289 do not have one of the @code{lower}, @code{upper}, @code{either} or
18290 @code{section} attributes.  Possible values are @code{lower},
18291 @code{upper}, @code{either} or @code{any}.  The first three behave
18292 like the corresponding attribute.  The fourth possible value -
18293 @code{any} - is the default.  It leaves placement entirely up to the
18294 linker script and how it assigns the standard sections (.text, .data
18295 etc) to the memory regions.
18297 @end table
18299 @node NDS32 Options
18300 @subsection NDS32 Options
18301 @cindex NDS32 Options
18303 These options are defined for NDS32 implementations:
18305 @table @gcctabopt
18307 @item -mbig-endian
18308 @opindex mbig-endian
18309 Generate code in big-endian mode.
18311 @item -mlittle-endian
18312 @opindex mlittle-endian
18313 Generate code in little-endian mode.
18315 @item -mreduced-regs
18316 @opindex mreduced-regs
18317 Use reduced-set registers for register allocation.
18319 @item -mfull-regs
18320 @opindex mfull-regs
18321 Use full-set registers for register allocation.
18323 @item -mcmov
18324 @opindex mcmov
18325 Generate conditional move instructions.
18327 @item -mno-cmov
18328 @opindex mno-cmov
18329 Do not generate conditional move instructions.
18331 @item -mperf-ext
18332 @opindex mperf-ext
18333 Generate performance extension instructions.
18335 @item -mno-perf-ext
18336 @opindex mno-perf-ext
18337 Do not generate performance extension instructions.
18339 @item -mv3push
18340 @opindex mv3push
18341 Generate v3 push25/pop25 instructions.
18343 @item -mno-v3push
18344 @opindex mno-v3push
18345 Do not generate v3 push25/pop25 instructions.
18347 @item -m16-bit
18348 @opindex m16-bit
18349 Generate 16-bit instructions.
18351 @item -mno-16-bit
18352 @opindex mno-16-bit
18353 Do not generate 16-bit instructions.
18355 @item -misr-vector-size=@var{num}
18356 @opindex misr-vector-size
18357 Specify the size of each interrupt vector, which must be 4 or 16.
18359 @item -mcache-block-size=@var{num}
18360 @opindex mcache-block-size
18361 Specify the size of each cache block,
18362 which must be a power of 2 between 4 and 512.
18364 @item -march=@var{arch}
18365 @opindex march
18366 Specify the name of the target architecture.
18368 @item -mcmodel=@var{code-model}
18369 @opindex mcmodel
18370 Set the code model to one of
18371 @table @asis
18372 @item @samp{small}
18373 All the data and read-only data segments must be within 512KB addressing space.
18374 The text segment must be within 16MB addressing space.
18375 @item @samp{medium}
18376 The data segment must be within 512KB while the read-only data segment can be
18377 within 4GB addressing space.  The text segment should be still within 16MB
18378 addressing space.
18379 @item @samp{large}
18380 All the text and data segments can be within 4GB addressing space.
18381 @end table
18383 @item -mctor-dtor
18384 @opindex mctor-dtor
18385 Enable constructor/destructor feature.
18387 @item -mrelax
18388 @opindex mrelax
18389 Guide linker to relax instructions.
18391 @end table
18393 @node Nios II Options
18394 @subsection Nios II Options
18395 @cindex Nios II options
18396 @cindex Altera Nios II options
18398 These are the options defined for the Altera Nios II processor.
18400 @table @gcctabopt
18402 @item -G @var{num}
18403 @opindex G
18404 @cindex smaller data references
18405 Put global and static objects less than or equal to @var{num} bytes
18406 into the small data or BSS sections instead of the normal data or BSS
18407 sections.  The default value of @var{num} is 8.
18409 @item -mgpopt=@var{option}
18410 @item -mgpopt
18411 @itemx -mno-gpopt
18412 @opindex mgpopt
18413 @opindex mno-gpopt
18414 Generate (do not generate) GP-relative accesses.  The following 
18415 @var{option} names are recognized:
18417 @table @samp
18419 @item none
18420 Do not generate GP-relative accesses.
18422 @item local
18423 Generate GP-relative accesses for small data objects that are not 
18424 external or weak.  Also use GP-relative addressing for objects that
18425 have been explicitly placed in a small data section via a @code{section}
18426 attribute.
18428 @item global
18429 As for @samp{local}, but also generate GP-relative accesses for
18430 small data objects that are external or weak.  If you use this option,
18431 you must ensure that all parts of your program (including libraries) are
18432 compiled with the same @option{-G} setting.
18434 @item data
18435 Generate GP-relative accesses for all data objects in the program.  If you
18436 use this option, the entire data and BSS segments
18437 of your program must fit in 64K of memory and you must use an appropriate
18438 linker script to allocate them within the addressible range of the
18439 global pointer.
18441 @item all
18442 Generate GP-relative addresses for function pointers as well as data
18443 pointers.  If you use this option, the entire text, data, and BSS segments
18444 of your program must fit in 64K of memory and you must use an appropriate
18445 linker script to allocate them within the addressible range of the
18446 global pointer.
18448 @end table
18450 @option{-mgpopt} is equivalent to @option{-mgpopt=local}, and
18451 @option{-mno-gpopt} is equivalent to @option{-mgpopt=none}.
18453 The default is @option{-mgpopt} except when @option{-fpic} or
18454 @option{-fPIC} is specified to generate position-independent code.
18455 Note that the Nios II ABI does not permit GP-relative accesses from
18456 shared libraries.
18458 You may need to specify @option{-mno-gpopt} explicitly when building
18459 programs that include large amounts of small data, including large
18460 GOT data sections.  In this case, the 16-bit offset for GP-relative
18461 addressing may not be large enough to allow access to the entire 
18462 small data section.
18464 @item -mel
18465 @itemx -meb
18466 @opindex mel
18467 @opindex meb
18468 Generate little-endian (default) or big-endian (experimental) code,
18469 respectively.
18471 @item -march=@var{arch}
18472 @opindex march
18473 This specifies the name of the target Nios II architecture.  GCC uses this
18474 name to determine what kind of instructions it can emit when generating
18475 assembly code.  Permissible names are: @samp{r1}, @samp{r2}.
18477 The preprocessor macro @code{__nios2_arch__} is available to programs,
18478 with value 1 or 2, indicating the targeted ISA level.
18480 @item -mbypass-cache
18481 @itemx -mno-bypass-cache
18482 @opindex mno-bypass-cache
18483 @opindex mbypass-cache
18484 Force all load and store instructions to always bypass cache by 
18485 using I/O variants of the instructions. The default is not to
18486 bypass the cache.
18488 @item -mno-cache-volatile 
18489 @itemx -mcache-volatile       
18490 @opindex mcache-volatile 
18491 @opindex mno-cache-volatile
18492 Volatile memory access bypass the cache using the I/O variants of 
18493 the load and store instructions. The default is not to bypass the cache.
18495 @item -mno-fast-sw-div
18496 @itemx -mfast-sw-div
18497 @opindex mno-fast-sw-div
18498 @opindex mfast-sw-div
18499 Do not use table-based fast divide for small numbers. The default 
18500 is to use the fast divide at @option{-O3} and above.
18502 @item -mno-hw-mul
18503 @itemx -mhw-mul
18504 @itemx -mno-hw-mulx
18505 @itemx -mhw-mulx
18506 @itemx -mno-hw-div
18507 @itemx -mhw-div
18508 @opindex mno-hw-mul
18509 @opindex mhw-mul
18510 @opindex mno-hw-mulx
18511 @opindex mhw-mulx
18512 @opindex mno-hw-div
18513 @opindex mhw-div
18514 Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of 
18515 instructions by the compiler. The default is to emit @code{mul}
18516 and not emit @code{div} and @code{mulx}.
18518 @item -mbmx
18519 @itemx -mno-bmx
18520 @itemx -mcdx
18521 @itemx -mno-cdx
18522 Enable or disable generation of Nios II R2 BMX (bit manipulation) and
18523 CDX (code density) instructions.  Enabling these instructions also
18524 requires @option{-march=r2}.  Since these instructions are optional
18525 extensions to the R2 architecture, the default is not to emit them.
18527 @item -mcustom-@var{insn}=@var{N}
18528 @itemx -mno-custom-@var{insn}
18529 @opindex mcustom-@var{insn}
18530 @opindex mno-custom-@var{insn}
18531 Each @option{-mcustom-@var{insn}=@var{N}} option enables use of a
18532 custom instruction with encoding @var{N} when generating code that uses 
18533 @var{insn}.  For example, @option{-mcustom-fadds=253} generates custom
18534 instruction 253 for single-precision floating-point add operations instead
18535 of the default behavior of using a library call.
18537 The following values of @var{insn} are supported.  Except as otherwise
18538 noted, floating-point operations are expected to be implemented with
18539 normal IEEE 754 semantics and correspond directly to the C operators or the
18540 equivalent GCC built-in functions (@pxref{Other Builtins}).
18542 Single-precision floating point:
18543 @table @asis
18545 @item @samp{fadds}, @samp{fsubs}, @samp{fdivs}, @samp{fmuls}
18546 Binary arithmetic operations.
18548 @item @samp{fnegs}
18549 Unary negation.
18551 @item @samp{fabss}
18552 Unary absolute value.
18554 @item @samp{fcmpeqs}, @samp{fcmpges}, @samp{fcmpgts}, @samp{fcmples}, @samp{fcmplts}, @samp{fcmpnes}
18555 Comparison operations.
18557 @item @samp{fmins}, @samp{fmaxs}
18558 Floating-point minimum and maximum.  These instructions are only
18559 generated if @option{-ffinite-math-only} is specified.
18561 @item @samp{fsqrts}
18562 Unary square root operation.
18564 @item @samp{fcoss}, @samp{fsins}, @samp{ftans}, @samp{fatans}, @samp{fexps}, @samp{flogs}
18565 Floating-point trigonometric and exponential functions.  These instructions
18566 are only generated if @option{-funsafe-math-optimizations} is also specified.
18568 @end table
18570 Double-precision floating point:
18571 @table @asis
18573 @item @samp{faddd}, @samp{fsubd}, @samp{fdivd}, @samp{fmuld}
18574 Binary arithmetic operations.
18576 @item @samp{fnegd}
18577 Unary negation.
18579 @item @samp{fabsd}
18580 Unary absolute value.
18582 @item @samp{fcmpeqd}, @samp{fcmpged}, @samp{fcmpgtd}, @samp{fcmpled}, @samp{fcmpltd}, @samp{fcmpned}
18583 Comparison operations.
18585 @item @samp{fmind}, @samp{fmaxd}
18586 Double-precision minimum and maximum.  These instructions are only
18587 generated if @option{-ffinite-math-only} is specified.
18589 @item @samp{fsqrtd}
18590 Unary square root operation.
18592 @item @samp{fcosd}, @samp{fsind}, @samp{ftand}, @samp{fatand}, @samp{fexpd}, @samp{flogd}
18593 Double-precision trigonometric and exponential functions.  These instructions
18594 are only generated if @option{-funsafe-math-optimizations} is also specified.
18596 @end table
18598 Conversions:
18599 @table @asis
18600 @item @samp{fextsd}
18601 Conversion from single precision to double precision.
18603 @item @samp{ftruncds}
18604 Conversion from double precision to single precision.
18606 @item @samp{fixsi}, @samp{fixsu}, @samp{fixdi}, @samp{fixdu}
18607 Conversion from floating point to signed or unsigned integer types, with
18608 truncation towards zero.
18610 @item @samp{round}
18611 Conversion from single-precision floating point to signed integer,
18612 rounding to the nearest integer and ties away from zero.
18613 This corresponds to the @code{__builtin_lroundf} function when
18614 @option{-fno-math-errno} is used.
18616 @item @samp{floatis}, @samp{floatus}, @samp{floatid}, @samp{floatud}
18617 Conversion from signed or unsigned integer types to floating-point types.
18619 @end table
18621 In addition, all of the following transfer instructions for internal
18622 registers X and Y must be provided to use any of the double-precision
18623 floating-point instructions.  Custom instructions taking two
18624 double-precision source operands expect the first operand in the
18625 64-bit register X.  The other operand (or only operand of a unary
18626 operation) is given to the custom arithmetic instruction with the
18627 least significant half in source register @var{src1} and the most
18628 significant half in @var{src2}.  A custom instruction that returns a
18629 double-precision result returns the most significant 32 bits in the
18630 destination register and the other half in 32-bit register Y.  
18631 GCC automatically generates the necessary code sequences to write
18632 register X and/or read register Y when double-precision floating-point
18633 instructions are used.
18635 @table @asis
18637 @item @samp{fwrx}
18638 Write @var{src1} into the least significant half of X and @var{src2} into
18639 the most significant half of X.
18641 @item @samp{fwry}
18642 Write @var{src1} into Y.
18644 @item @samp{frdxhi}, @samp{frdxlo}
18645 Read the most or least (respectively) significant half of X and store it in
18646 @var{dest}.
18648 @item @samp{frdy}
18649 Read the value of Y and store it into @var{dest}.
18650 @end table
18652 Note that you can gain more local control over generation of Nios II custom
18653 instructions by using the @code{target("custom-@var{insn}=@var{N}")}
18654 and @code{target("no-custom-@var{insn}")} function attributes
18655 (@pxref{Function Attributes})
18656 or pragmas (@pxref{Function Specific Option Pragmas}).
18658 @item -mcustom-fpu-cfg=@var{name}
18659 @opindex mcustom-fpu-cfg
18661 This option enables a predefined, named set of custom instruction encodings
18662 (see @option{-mcustom-@var{insn}} above).  
18663 Currently, the following sets are defined:
18665 @option{-mcustom-fpu-cfg=60-1} is equivalent to:
18666 @gccoptlist{-mcustom-fmuls=252 @gol
18667 -mcustom-fadds=253 @gol
18668 -mcustom-fsubs=254 @gol
18669 -fsingle-precision-constant}
18671 @option{-mcustom-fpu-cfg=60-2} is equivalent to:
18672 @gccoptlist{-mcustom-fmuls=252 @gol
18673 -mcustom-fadds=253 @gol
18674 -mcustom-fsubs=254 @gol
18675 -mcustom-fdivs=255 @gol
18676 -fsingle-precision-constant}
18678 @option{-mcustom-fpu-cfg=72-3} is equivalent to:
18679 @gccoptlist{-mcustom-floatus=243 @gol
18680 -mcustom-fixsi=244 @gol
18681 -mcustom-floatis=245 @gol
18682 -mcustom-fcmpgts=246 @gol
18683 -mcustom-fcmples=249 @gol
18684 -mcustom-fcmpeqs=250 @gol
18685 -mcustom-fcmpnes=251 @gol
18686 -mcustom-fmuls=252 @gol
18687 -mcustom-fadds=253 @gol
18688 -mcustom-fsubs=254 @gol
18689 -mcustom-fdivs=255 @gol
18690 -fsingle-precision-constant}
18692 Custom instruction assignments given by individual
18693 @option{-mcustom-@var{insn}=} options override those given by
18694 @option{-mcustom-fpu-cfg=}, regardless of the
18695 order of the options on the command line.
18697 Note that you can gain more local control over selection of a FPU
18698 configuration by using the @code{target("custom-fpu-cfg=@var{name}")}
18699 function attribute (@pxref{Function Attributes})
18700 or pragma (@pxref{Function Specific Option Pragmas}).
18702 @end table
18704 These additional @samp{-m} options are available for the Altera Nios II
18705 ELF (bare-metal) target:
18707 @table @gcctabopt
18709 @item -mhal
18710 @opindex mhal
18711 Link with HAL BSP.  This suppresses linking with the GCC-provided C runtime
18712 startup and termination code, and is typically used in conjunction with
18713 @option{-msys-crt0=} to specify the location of the alternate startup code
18714 provided by the HAL BSP.
18716 @item -msmallc
18717 @opindex msmallc
18718 Link with a limited version of the C library, @option{-lsmallc}, rather than
18719 Newlib.
18721 @item -msys-crt0=@var{startfile}
18722 @opindex msys-crt0
18723 @var{startfile} is the file name of the startfile (crt0) to use 
18724 when linking.  This option is only useful in conjunction with @option{-mhal}.
18726 @item -msys-lib=@var{systemlib}
18727 @opindex msys-lib
18728 @var{systemlib} is the library name of the library that provides
18729 low-level system calls required by the C library,
18730 e.g. @code{read} and @code{write}.
18731 This option is typically used to link with a library provided by a HAL BSP.
18733 @end table
18735 @node Nvidia PTX Options
18736 @subsection Nvidia PTX Options
18737 @cindex Nvidia PTX options
18738 @cindex nvptx options
18740 These options are defined for Nvidia PTX:
18742 @table @gcctabopt
18744 @item -m32
18745 @itemx -m64
18746 @opindex m32
18747 @opindex m64
18748 Generate code for 32-bit or 64-bit ABI.
18750 @item -mmainkernel
18751 @opindex mmainkernel
18752 Link in code for a __main kernel.  This is for stand-alone instead of
18753 offloading execution.
18755 @end table
18757 @node PDP-11 Options
18758 @subsection PDP-11 Options
18759 @cindex PDP-11 Options
18761 These options are defined for the PDP-11:
18763 @table @gcctabopt
18764 @item -mfpu
18765 @opindex mfpu
18766 Use hardware FPP floating point.  This is the default.  (FIS floating
18767 point on the PDP-11/40 is not supported.)
18769 @item -msoft-float
18770 @opindex msoft-float
18771 Do not use hardware floating point.
18773 @item -mac0
18774 @opindex mac0
18775 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
18777 @item -mno-ac0
18778 @opindex mno-ac0
18779 Return floating-point results in memory.  This is the default.
18781 @item -m40
18782 @opindex m40
18783 Generate code for a PDP-11/40.
18785 @item -m45
18786 @opindex m45
18787 Generate code for a PDP-11/45.  This is the default.
18789 @item -m10
18790 @opindex m10
18791 Generate code for a PDP-11/10.
18793 @item -mbcopy-builtin
18794 @opindex mbcopy-builtin
18795 Use inline @code{movmemhi} patterns for copying memory.  This is the
18796 default.
18798 @item -mbcopy
18799 @opindex mbcopy
18800 Do not use inline @code{movmemhi} patterns for copying memory.
18802 @item -mint16
18803 @itemx -mno-int32
18804 @opindex mint16
18805 @opindex mno-int32
18806 Use 16-bit @code{int}.  This is the default.
18808 @item -mint32
18809 @itemx -mno-int16
18810 @opindex mint32
18811 @opindex mno-int16
18812 Use 32-bit @code{int}.
18814 @item -mfloat64
18815 @itemx -mno-float32
18816 @opindex mfloat64
18817 @opindex mno-float32
18818 Use 64-bit @code{float}.  This is the default.
18820 @item -mfloat32
18821 @itemx -mno-float64
18822 @opindex mfloat32
18823 @opindex mno-float64
18824 Use 32-bit @code{float}.
18826 @item -mabshi
18827 @opindex mabshi
18828 Use @code{abshi2} pattern.  This is the default.
18830 @item -mno-abshi
18831 @opindex mno-abshi
18832 Do not use @code{abshi2} pattern.
18834 @item -mbranch-expensive
18835 @opindex mbranch-expensive
18836 Pretend that branches are expensive.  This is for experimenting with
18837 code generation only.
18839 @item -mbranch-cheap
18840 @opindex mbranch-cheap
18841 Do not pretend that branches are expensive.  This is the default.
18843 @item -munix-asm
18844 @opindex munix-asm
18845 Use Unix assembler syntax.  This is the default when configured for
18846 @samp{pdp11-*-bsd}.
18848 @item -mdec-asm
18849 @opindex mdec-asm
18850 Use DEC assembler syntax.  This is the default when configured for any
18851 PDP-11 target other than @samp{pdp11-*-bsd}.
18852 @end table
18854 @node picoChip Options
18855 @subsection picoChip Options
18856 @cindex picoChip options
18858 These @samp{-m} options are defined for picoChip implementations:
18860 @table @gcctabopt
18862 @item -mae=@var{ae_type}
18863 @opindex mcpu
18864 Set the instruction set, register set, and instruction scheduling
18865 parameters for array element type @var{ae_type}.  Supported values
18866 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
18868 @option{-mae=ANY} selects a completely generic AE type.  Code
18869 generated with this option runs on any of the other AE types.  The
18870 code is not as efficient as it would be if compiled for a specific
18871 AE type, and some types of operation (e.g., multiplication) do not
18872 work properly on all types of AE.
18874 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
18875 for compiled code, and is the default.
18877 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
18878 option may suffer from poor performance of byte (char) manipulation,
18879 since the DSP AE does not provide hardware support for byte load/stores.
18881 @item -msymbol-as-address
18882 Enable the compiler to directly use a symbol name as an address in a
18883 load/store instruction, without first loading it into a
18884 register.  Typically, the use of this option generates larger
18885 programs, which run faster than when the option isn't used.  However, the
18886 results vary from program to program, so it is left as a user option,
18887 rather than being permanently enabled.
18889 @item -mno-inefficient-warnings
18890 Disables warnings about the generation of inefficient code.  These
18891 warnings can be generated, for example, when compiling code that
18892 performs byte-level memory operations on the MAC AE type.  The MAC AE has
18893 no hardware support for byte-level memory operations, so all byte
18894 load/stores must be synthesized from word load/store operations.  This is
18895 inefficient and a warning is generated to indicate
18896 that you should rewrite the code to avoid byte operations, or to target
18897 an AE type that has the necessary hardware support.  This option disables
18898 these warnings.
18900 @end table
18902 @node PowerPC Options
18903 @subsection PowerPC Options
18904 @cindex PowerPC options
18906 These are listed under @xref{RS/6000 and PowerPC Options}.
18908 @node RL78 Options
18909 @subsection RL78 Options
18910 @cindex RL78 Options
18912 @table @gcctabopt
18914 @item -msim
18915 @opindex msim
18916 Links in additional target libraries to support operation within a
18917 simulator.
18919 @item -mmul=none
18920 @itemx -mmul=g10
18921 @itemx -mmul=g13
18922 @itemx -mmul=g14
18923 @itemx -mmul=rl78
18924 @opindex mmul
18925 Specifies the type of hardware multiplication and division support to
18926 be used.  The simplest is @code{none}, which uses software for both
18927 multiplication and division.  This is the default.  The @code{g13}
18928 value is for the hardware multiply/divide peripheral found on the
18929 RL78/G13 (S2 core) targets.  The @code{g14} value selects the use of
18930 the multiplication and division instructions supported by the RL78/G14
18931 (S3 core) parts.  The value @code{rl78} is an alias for @code{g14} and
18932 the value @code{mg10} is an alias for @code{none}.
18934 In addition a C preprocessor macro is defined, based upon the setting
18935 of this option.  Possible values are: @code{__RL78_MUL_NONE__},
18936 @code{__RL78_MUL_G13__} or @code{__RL78_MUL_G14__}.
18938 @item -mcpu=g10
18939 @itemx -mcpu=g13
18940 @itemx -mcpu=g14
18941 @itemx -mcpu=rl78
18942 @opindex mcpu
18943 Specifies the RL78 core to target.  The default is the G14 core, also
18944 known as an S3 core or just RL78.  The G13 or S2 core does not have
18945 multiply or divide instructions, instead it uses a hardware peripheral
18946 for these operations.  The G10 or S1 core does not have register
18947 banks, so it uses a different calling convention.
18949 If this option is set it also selects the type of hardware multiply
18950 support to use, unless this is overridden by an explicit
18951 @option{-mmul=none} option on the command line.  Thus specifying
18952 @option{-mcpu=g13} enables the use of the G13 hardware multiply
18953 peripheral and specifying @option{-mcpu=g10} disables the use of
18954 hardware multipications altogether.
18956 Note, although the RL78/G14 core is the default target, specifying
18957 @option{-mcpu=g14} or @option{-mcpu=rl78} on the command line does
18958 change the behaviour of the toolchain since it also enables G14
18959 hardware multiply support.  If these options are not specified on the
18960 command line then software multiplication routines will be used even
18961 though the code targets the RL78 core.  This is for backwards
18962 compatibility with older toolchains which did not have hardware
18963 multiply and divide support.
18965 In addition a C preprocessor macro is defined, based upon the setting
18966 of this option.  Possible values are: @code{__RL78_G10__},
18967 @code{__RL78_G13__} or @code{__RL78_G14__}.
18969 @item -mg10
18970 @itemx -mg13
18971 @itemx -mg14
18972 @itemx -mrl78
18973 @opindex mg10
18974 @opindex mg13
18975 @opindex mg14
18976 @opindex mrl78
18977 These are aliases for the corresponding @option{-mcpu=} option.  They
18978 are provided for backwards compatibility.
18980 @item -mallregs
18981 @opindex mallregs
18982 Allow the compiler to use all of the available registers.  By default
18983 registers @code{r24..r31} are reserved for use in interrupt handlers.
18984 With this option enabled these registers can be used in ordinary
18985 functions as well.
18987 @item -m64bit-doubles
18988 @itemx -m32bit-doubles
18989 @opindex m64bit-doubles
18990 @opindex m32bit-doubles
18991 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
18992 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
18993 @option{-m32bit-doubles}.
18995 @end table
18997 @node RS/6000 and PowerPC Options
18998 @subsection IBM RS/6000 and PowerPC Options
18999 @cindex RS/6000 and PowerPC Options
19000 @cindex IBM RS/6000 and PowerPC Options
19002 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
19003 @table @gcctabopt
19004 @item -mpowerpc-gpopt
19005 @itemx -mno-powerpc-gpopt
19006 @itemx -mpowerpc-gfxopt
19007 @itemx -mno-powerpc-gfxopt
19008 @need 800
19009 @itemx -mpowerpc64
19010 @itemx -mno-powerpc64
19011 @itemx -mmfcrf
19012 @itemx -mno-mfcrf
19013 @itemx -mpopcntb
19014 @itemx -mno-popcntb
19015 @itemx -mpopcntd
19016 @itemx -mno-popcntd
19017 @itemx -mfprnd
19018 @itemx -mno-fprnd
19019 @need 800
19020 @itemx -mcmpb
19021 @itemx -mno-cmpb
19022 @itemx -mmfpgpr
19023 @itemx -mno-mfpgpr
19024 @itemx -mhard-dfp
19025 @itemx -mno-hard-dfp
19026 @opindex mpowerpc-gpopt
19027 @opindex mno-powerpc-gpopt
19028 @opindex mpowerpc-gfxopt
19029 @opindex mno-powerpc-gfxopt
19030 @opindex mpowerpc64
19031 @opindex mno-powerpc64
19032 @opindex mmfcrf
19033 @opindex mno-mfcrf
19034 @opindex mpopcntb
19035 @opindex mno-popcntb
19036 @opindex mpopcntd
19037 @opindex mno-popcntd
19038 @opindex mfprnd
19039 @opindex mno-fprnd
19040 @opindex mcmpb
19041 @opindex mno-cmpb
19042 @opindex mmfpgpr
19043 @opindex mno-mfpgpr
19044 @opindex mhard-dfp
19045 @opindex mno-hard-dfp
19046 You use these options to specify which instructions are available on the
19047 processor you are using.  The default value of these options is
19048 determined when configuring GCC@.  Specifying the
19049 @option{-mcpu=@var{cpu_type}} overrides the specification of these
19050 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
19051 rather than the options listed above.
19053 Specifying @option{-mpowerpc-gpopt} allows
19054 GCC to use the optional PowerPC architecture instructions in the
19055 General Purpose group, including floating-point square root.  Specifying
19056 @option{-mpowerpc-gfxopt} allows GCC to
19057 use the optional PowerPC architecture instructions in the Graphics
19058 group, including floating-point select.
19060 The @option{-mmfcrf} option allows GCC to generate the move from
19061 condition register field instruction implemented on the POWER4
19062 processor and other processors that support the PowerPC V2.01
19063 architecture.
19064 The @option{-mpopcntb} option allows GCC to generate the popcount and
19065 double-precision FP reciprocal estimate instruction implemented on the
19066 POWER5 processor and other processors that support the PowerPC V2.02
19067 architecture.
19068 The @option{-mpopcntd} option allows GCC to generate the popcount
19069 instruction implemented on the POWER7 processor and other processors
19070 that support the PowerPC V2.06 architecture.
19071 The @option{-mfprnd} option allows GCC to generate the FP round to
19072 integer instructions implemented on the POWER5+ processor and other
19073 processors that support the PowerPC V2.03 architecture.
19074 The @option{-mcmpb} option allows GCC to generate the compare bytes
19075 instruction implemented on the POWER6 processor and other processors
19076 that support the PowerPC V2.05 architecture.
19077 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
19078 general-purpose register instructions implemented on the POWER6X
19079 processor and other processors that support the extended PowerPC V2.05
19080 architecture.
19081 The @option{-mhard-dfp} option allows GCC to generate the decimal
19082 floating-point instructions implemented on some POWER processors.
19084 The @option{-mpowerpc64} option allows GCC to generate the additional
19085 64-bit instructions that are found in the full PowerPC64 architecture
19086 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
19087 @option{-mno-powerpc64}.
19089 @item -mcpu=@var{cpu_type}
19090 @opindex mcpu
19091 Set architecture type, register usage, and
19092 instruction scheduling parameters for machine type @var{cpu_type}.
19093 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
19094 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
19095 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
19096 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
19097 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
19098 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
19099 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
19100 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
19101 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
19102 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8}, @samp{powerpc},
19103 @samp{powerpc64}, @samp{powerpc64le}, and @samp{rs64}.
19105 @option{-mcpu=powerpc}, @option{-mcpu=powerpc64}, and
19106 @option{-mcpu=powerpc64le} specify pure 32-bit PowerPC (either
19107 endian), 64-bit big endian PowerPC and 64-bit little endian PowerPC
19108 architecture machine types, with an appropriate, generic processor
19109 model assumed for scheduling purposes.
19111 The other options specify a specific processor.  Code generated under
19112 those options runs best on that processor, and may not run at all on
19113 others.
19115 The @option{-mcpu} options automatically enable or disable the
19116 following options:
19118 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
19119 -mpopcntb -mpopcntd  -mpowerpc64 @gol
19120 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
19121 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
19122 -mcrypto -mdirect-move -mpower8-fusion -mpower8-vector @gol
19123 -mquad-memory -mquad-memory-atomic}
19125 The particular options set for any particular CPU varies between
19126 compiler versions, depending on what setting seems to produce optimal
19127 code for that CPU; it doesn't necessarily reflect the actual hardware's
19128 capabilities.  If you wish to set an individual option to a particular
19129 value, you may specify it after the @option{-mcpu} option, like
19130 @option{-mcpu=970 -mno-altivec}.
19132 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
19133 not enabled or disabled by the @option{-mcpu} option at present because
19134 AIX does not have full support for these options.  You may still
19135 enable or disable them individually if you're sure it'll work in your
19136 environment.
19138 @item -mtune=@var{cpu_type}
19139 @opindex mtune
19140 Set the instruction scheduling parameters for machine type
19141 @var{cpu_type}, but do not set the architecture type or register usage,
19142 as @option{-mcpu=@var{cpu_type}} does.  The same
19143 values for @var{cpu_type} are used for @option{-mtune} as for
19144 @option{-mcpu}.  If both are specified, the code generated uses the
19145 architecture and registers set by @option{-mcpu}, but the
19146 scheduling parameters set by @option{-mtune}.
19148 @item -mcmodel=small
19149 @opindex mcmodel=small
19150 Generate PowerPC64 code for the small model: The TOC is limited to
19151 64k.
19153 @item -mcmodel=medium
19154 @opindex mcmodel=medium
19155 Generate PowerPC64 code for the medium model: The TOC and other static
19156 data may be up to a total of 4G in size.
19158 @item -mcmodel=large
19159 @opindex mcmodel=large
19160 Generate PowerPC64 code for the large model: The TOC may be up to 4G
19161 in size.  Other data and code is only limited by the 64-bit address
19162 space.
19164 @item -maltivec
19165 @itemx -mno-altivec
19166 @opindex maltivec
19167 @opindex mno-altivec
19168 Generate code that uses (does not use) AltiVec instructions, and also
19169 enable the use of built-in functions that allow more direct access to
19170 the AltiVec instruction set.  You may also need to set
19171 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
19172 enhancements.
19174 When @option{-maltivec} is used, rather than @option{-maltivec=le} or
19175 @option{-maltivec=be}, the element order for Altivec intrinsics such
19176 as @code{vec_splat}, @code{vec_extract}, and @code{vec_insert} 
19177 match array element order corresponding to the endianness of the
19178 target.  That is, element zero identifies the leftmost element in a
19179 vector register when targeting a big-endian platform, and identifies
19180 the rightmost element in a vector register when targeting a
19181 little-endian platform.
19183 @item -maltivec=be
19184 @opindex maltivec=be
19185 Generate Altivec instructions using big-endian element order,
19186 regardless of whether the target is big- or little-endian.  This is
19187 the default when targeting a big-endian platform.
19189 The element order is used to interpret element numbers in Altivec
19190 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
19191 @code{vec_insert}.  By default, these match array element order
19192 corresponding to the endianness for the target.
19194 @item -maltivec=le
19195 @opindex maltivec=le
19196 Generate Altivec instructions using little-endian element order,
19197 regardless of whether the target is big- or little-endian.  This is
19198 the default when targeting a little-endian platform.  This option is
19199 currently ignored when targeting a big-endian platform.
19201 The element order is used to interpret element numbers in Altivec
19202 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
19203 @code{vec_insert}.  By default, these match array element order
19204 corresponding to the endianness for the target.
19206 @item -mvrsave
19207 @itemx -mno-vrsave
19208 @opindex mvrsave
19209 @opindex mno-vrsave
19210 Generate VRSAVE instructions when generating AltiVec code.
19212 @item -mgen-cell-microcode
19213 @opindex mgen-cell-microcode
19214 Generate Cell microcode instructions.
19216 @item -mwarn-cell-microcode
19217 @opindex mwarn-cell-microcode
19218 Warn when a Cell microcode instruction is emitted.  An example
19219 of a Cell microcode instruction is a variable shift.
19221 @item -msecure-plt
19222 @opindex msecure-plt
19223 Generate code that allows @command{ld} and @command{ld.so}
19224 to build executables and shared
19225 libraries with non-executable @code{.plt} and @code{.got} sections.
19226 This is a PowerPC
19227 32-bit SYSV ABI option.
19229 @item -mbss-plt
19230 @opindex mbss-plt
19231 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
19232 fills in, and
19233 requires @code{.plt} and @code{.got}
19234 sections that are both writable and executable.
19235 This is a PowerPC 32-bit SYSV ABI option.
19237 @item -misel
19238 @itemx -mno-isel
19239 @opindex misel
19240 @opindex mno-isel
19241 This switch enables or disables the generation of ISEL instructions.
19243 @item -misel=@var{yes/no}
19244 This switch has been deprecated.  Use @option{-misel} and
19245 @option{-mno-isel} instead.
19247 @item -mspe
19248 @itemx -mno-spe
19249 @opindex mspe
19250 @opindex mno-spe
19251 This switch enables or disables the generation of SPE simd
19252 instructions.
19254 @item -mpaired
19255 @itemx -mno-paired
19256 @opindex mpaired
19257 @opindex mno-paired
19258 This switch enables or disables the generation of PAIRED simd
19259 instructions.
19261 @item -mspe=@var{yes/no}
19262 This option has been deprecated.  Use @option{-mspe} and
19263 @option{-mno-spe} instead.
19265 @item -mvsx
19266 @itemx -mno-vsx
19267 @opindex mvsx
19268 @opindex mno-vsx
19269 Generate code that uses (does not use) vector/scalar (VSX)
19270 instructions, and also enable the use of built-in functions that allow
19271 more direct access to the VSX instruction set.
19273 @item -mcrypto
19274 @itemx -mno-crypto
19275 @opindex mcrypto
19276 @opindex mno-crypto
19277 Enable the use (disable) of the built-in functions that allow direct
19278 access to the cryptographic instructions that were added in version
19279 2.07 of the PowerPC ISA.
19281 @item -mdirect-move
19282 @itemx -mno-direct-move
19283 @opindex mdirect-move
19284 @opindex mno-direct-move
19285 Generate code that uses (does not use) the instructions to move data
19286 between the general purpose registers and the vector/scalar (VSX)
19287 registers that were added in version 2.07 of the PowerPC ISA.
19289 @item -mpower8-fusion
19290 @itemx -mno-power8-fusion
19291 @opindex mpower8-fusion
19292 @opindex mno-power8-fusion
19293 Generate code that keeps (does not keeps) some integer operations
19294 adjacent so that the instructions can be fused together on power8 and
19295 later processors.
19297 @item -mpower8-vector
19298 @itemx -mno-power8-vector
19299 @opindex mpower8-vector
19300 @opindex mno-power8-vector
19301 Generate code that uses (does not use) the vector and scalar
19302 instructions that were added in version 2.07 of the PowerPC ISA.  Also
19303 enable the use of built-in functions that allow more direct access to
19304 the vector instructions.
19306 @item -mquad-memory
19307 @itemx -mno-quad-memory
19308 @opindex mquad-memory
19309 @opindex mno-quad-memory
19310 Generate code that uses (does not use) the non-atomic quad word memory
19311 instructions.  The @option{-mquad-memory} option requires use of
19312 64-bit mode.
19314 @item -mquad-memory-atomic
19315 @itemx -mno-quad-memory-atomic
19316 @opindex mquad-memory-atomic
19317 @opindex mno-quad-memory-atomic
19318 Generate code that uses (does not use) the atomic quad word memory
19319 instructions.  The @option{-mquad-memory-atomic} option requires use of
19320 64-bit mode.
19322 @item -mupper-regs-df
19323 @itemx -mno-upper-regs-df
19324 @opindex mupper-regs-df
19325 @opindex mno-upper-regs-df
19326 Generate code that uses (does not use) the scalar double precision
19327 instructions that target all 64 registers in the vector/scalar
19328 floating point register set that were added in version 2.06 of the
19329 PowerPC ISA.  @option{-mupper-regs-df} is turned on by default if you
19330 use any of the @option{-mcpu=power7}, @option{-mcpu=power8}, or
19331 @option{-mvsx} options.
19333 @item -mupper-regs-sf
19334 @itemx -mno-upper-regs-sf
19335 @opindex mupper-regs-sf
19336 @opindex mno-upper-regs-sf
19337 Generate code that uses (does not use) the scalar single precision
19338 instructions that target all 64 registers in the vector/scalar
19339 floating point register set that were added in version 2.07 of the
19340 PowerPC ISA.  @option{-mupper-regs-sf} is turned on by default if you
19341 use either of the @option{-mcpu=power8} or @option{-mpower8-vector}
19342 options.
19344 @item -mupper-regs
19345 @itemx -mno-upper-regs
19346 @opindex mupper-regs
19347 @opindex mno-upper-regs
19348 Generate code that uses (does not use) the scalar
19349 instructions that target all 64 registers in the vector/scalar
19350 floating point register set, depending on the model of the machine.
19352 If the @option{-mno-upper-regs} option is used, it turns off both
19353 @option{-mupper-regs-sf} and @option{-mupper-regs-df} options.
19355 @item -mfloat-gprs=@var{yes/single/double/no}
19356 @itemx -mfloat-gprs
19357 @opindex mfloat-gprs
19358 This switch enables or disables the generation of floating-point
19359 operations on the general-purpose registers for architectures that
19360 support it.
19362 The argument @samp{yes} or @samp{single} enables the use of
19363 single-precision floating-point operations.
19365 The argument @samp{double} enables the use of single and
19366 double-precision floating-point operations.
19368 The argument @samp{no} disables floating-point operations on the
19369 general-purpose registers.
19371 This option is currently only available on the MPC854x.
19373 @item -m32
19374 @itemx -m64
19375 @opindex m32
19376 @opindex m64
19377 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
19378 targets (including GNU/Linux).  The 32-bit environment sets int, long
19379 and pointer to 32 bits and generates code that runs on any PowerPC
19380 variant.  The 64-bit environment sets int to 32 bits and long and
19381 pointer to 64 bits, and generates code for PowerPC64, as for
19382 @option{-mpowerpc64}.
19384 @item -mfull-toc
19385 @itemx -mno-fp-in-toc
19386 @itemx -mno-sum-in-toc
19387 @itemx -mminimal-toc
19388 @opindex mfull-toc
19389 @opindex mno-fp-in-toc
19390 @opindex mno-sum-in-toc
19391 @opindex mminimal-toc
19392 Modify generation of the TOC (Table Of Contents), which is created for
19393 every executable file.  The @option{-mfull-toc} option is selected by
19394 default.  In that case, GCC allocates at least one TOC entry for
19395 each unique non-automatic variable reference in your program.  GCC
19396 also places floating-point constants in the TOC@.  However, only
19397 16,384 entries are available in the TOC@.
19399 If you receive a linker error message that saying you have overflowed
19400 the available TOC space, you can reduce the amount of TOC space used
19401 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
19402 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
19403 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
19404 generate code to calculate the sum of an address and a constant at
19405 run time instead of putting that sum into the TOC@.  You may specify one
19406 or both of these options.  Each causes GCC to produce very slightly
19407 slower and larger code at the expense of conserving TOC space.
19409 If you still run out of space in the TOC even when you specify both of
19410 these options, specify @option{-mminimal-toc} instead.  This option causes
19411 GCC to make only one TOC entry for every file.  When you specify this
19412 option, GCC produces code that is slower and larger but which
19413 uses extremely little TOC space.  You may wish to use this option
19414 only on files that contain less frequently-executed code.
19416 @item -maix64
19417 @itemx -maix32
19418 @opindex maix64
19419 @opindex maix32
19420 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
19421 @code{long} type, and the infrastructure needed to support them.
19422 Specifying @option{-maix64} implies @option{-mpowerpc64},
19423 while @option{-maix32} disables the 64-bit ABI and
19424 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
19426 @item -mxl-compat
19427 @itemx -mno-xl-compat
19428 @opindex mxl-compat
19429 @opindex mno-xl-compat
19430 Produce code that conforms more closely to IBM XL compiler semantics
19431 when using AIX-compatible ABI@.  Pass floating-point arguments to
19432 prototyped functions beyond the register save area (RSA) on the stack
19433 in addition to argument FPRs.  Do not assume that most significant
19434 double in 128-bit long double value is properly rounded when comparing
19435 values and converting to double.  Use XL symbol names for long double
19436 support routines.
19438 The AIX calling convention was extended but not initially documented to
19439 handle an obscure K&R C case of calling a function that takes the
19440 address of its arguments with fewer arguments than declared.  IBM XL
19441 compilers access floating-point arguments that do not fit in the
19442 RSA from the stack when a subroutine is compiled without
19443 optimization.  Because always storing floating-point arguments on the
19444 stack is inefficient and rarely needed, this option is not enabled by
19445 default and only is necessary when calling subroutines compiled by IBM
19446 XL compilers without optimization.
19448 @item -mpe
19449 @opindex mpe
19450 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
19451 application written to use message passing with special startup code to
19452 enable the application to run.  The system must have PE installed in the
19453 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
19454 must be overridden with the @option{-specs=} option to specify the
19455 appropriate directory location.  The Parallel Environment does not
19456 support threads, so the @option{-mpe} option and the @option{-pthread}
19457 option are incompatible.
19459 @item -malign-natural
19460 @itemx -malign-power
19461 @opindex malign-natural
19462 @opindex malign-power
19463 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
19464 @option{-malign-natural} overrides the ABI-defined alignment of larger
19465 types, such as floating-point doubles, on their natural size-based boundary.
19466 The option @option{-malign-power} instructs GCC to follow the ABI-specified
19467 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
19469 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
19470 is not supported.
19472 @item -msoft-float
19473 @itemx -mhard-float
19474 @opindex msoft-float
19475 @opindex mhard-float
19476 Generate code that does not use (uses) the floating-point register set.
19477 Software floating-point emulation is provided if you use the
19478 @option{-msoft-float} option, and pass the option to GCC when linking.
19480 @item -msingle-float
19481 @itemx -mdouble-float
19482 @opindex msingle-float
19483 @opindex mdouble-float
19484 Generate code for single- or double-precision floating-point operations.
19485 @option{-mdouble-float} implies @option{-msingle-float}.
19487 @item -msimple-fpu
19488 @opindex msimple-fpu
19489 Do not generate @code{sqrt} and @code{div} instructions for hardware
19490 floating-point unit.
19492 @item -mfpu=@var{name}
19493 @opindex mfpu
19494 Specify type of floating-point unit.  Valid values for @var{name} are
19495 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
19496 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
19497 @samp{sp_full} (equivalent to @option{-msingle-float}),
19498 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
19500 @item -mxilinx-fpu
19501 @opindex mxilinx-fpu
19502 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
19504 @item -mmultiple
19505 @itemx -mno-multiple
19506 @opindex mmultiple
19507 @opindex mno-multiple
19508 Generate code that uses (does not use) the load multiple word
19509 instructions and the store multiple word instructions.  These
19510 instructions are generated by default on POWER systems, and not
19511 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
19512 PowerPC systems, since those instructions do not work when the
19513 processor is in little-endian mode.  The exceptions are PPC740 and
19514 PPC750 which permit these instructions in little-endian mode.
19516 @item -mstring
19517 @itemx -mno-string
19518 @opindex mstring
19519 @opindex mno-string
19520 Generate code that uses (does not use) the load string instructions
19521 and the store string word instructions to save multiple registers and
19522 do small block moves.  These instructions are generated by default on
19523 POWER systems, and not generated on PowerPC systems.  Do not use
19524 @option{-mstring} on little-endian PowerPC systems, since those
19525 instructions do not work when the processor is in little-endian mode.
19526 The exceptions are PPC740 and PPC750 which permit these instructions
19527 in little-endian mode.
19529 @item -mupdate
19530 @itemx -mno-update
19531 @opindex mupdate
19532 @opindex mno-update
19533 Generate code that uses (does not use) the load or store instructions
19534 that update the base register to the address of the calculated memory
19535 location.  These instructions are generated by default.  If you use
19536 @option{-mno-update}, there is a small window between the time that the
19537 stack pointer is updated and the address of the previous frame is
19538 stored, which means code that walks the stack frame across interrupts or
19539 signals may get corrupted data.
19541 @item -mavoid-indexed-addresses
19542 @itemx -mno-avoid-indexed-addresses
19543 @opindex mavoid-indexed-addresses
19544 @opindex mno-avoid-indexed-addresses
19545 Generate code that tries to avoid (not avoid) the use of indexed load
19546 or store instructions. These instructions can incur a performance
19547 penalty on Power6 processors in certain situations, such as when
19548 stepping through large arrays that cross a 16M boundary.  This option
19549 is enabled by default when targeting Power6 and disabled otherwise.
19551 @item -mfused-madd
19552 @itemx -mno-fused-madd
19553 @opindex mfused-madd
19554 @opindex mno-fused-madd
19555 Generate code that uses (does not use) the floating-point multiply and
19556 accumulate instructions.  These instructions are generated by default
19557 if hardware floating point is used.  The machine-dependent
19558 @option{-mfused-madd} option is now mapped to the machine-independent
19559 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
19560 mapped to @option{-ffp-contract=off}.
19562 @item -mmulhw
19563 @itemx -mno-mulhw
19564 @opindex mmulhw
19565 @opindex mno-mulhw
19566 Generate code that uses (does not use) the half-word multiply and
19567 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
19568 These instructions are generated by default when targeting those
19569 processors.
19571 @item -mdlmzb
19572 @itemx -mno-dlmzb
19573 @opindex mdlmzb
19574 @opindex mno-dlmzb
19575 Generate code that uses (does not use) the string-search @samp{dlmzb}
19576 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
19577 generated by default when targeting those processors.
19579 @item -mno-bit-align
19580 @itemx -mbit-align
19581 @opindex mno-bit-align
19582 @opindex mbit-align
19583 On System V.4 and embedded PowerPC systems do not (do) force structures
19584 and unions that contain bit-fields to be aligned to the base type of the
19585 bit-field.
19587 For example, by default a structure containing nothing but 8
19588 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
19589 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
19590 the structure is aligned to a 1-byte boundary and is 1 byte in
19591 size.
19593 @item -mno-strict-align
19594 @itemx -mstrict-align
19595 @opindex mno-strict-align
19596 @opindex mstrict-align
19597 On System V.4 and embedded PowerPC systems do not (do) assume that
19598 unaligned memory references are handled by the system.
19600 @item -mrelocatable
19601 @itemx -mno-relocatable
19602 @opindex mrelocatable
19603 @opindex mno-relocatable
19604 Generate code that allows (does not allow) a static executable to be
19605 relocated to a different address at run time.  A simple embedded
19606 PowerPC system loader should relocate the entire contents of
19607 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
19608 a table of 32-bit addresses generated by this option.  For this to
19609 work, all objects linked together must be compiled with
19610 @option{-mrelocatable} or @option{-mrelocatable-lib}.
19611 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
19613 @item -mrelocatable-lib
19614 @itemx -mno-relocatable-lib
19615 @opindex mrelocatable-lib
19616 @opindex mno-relocatable-lib
19617 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
19618 @code{.fixup} section to allow static executables to be relocated at
19619 run time, but @option{-mrelocatable-lib} does not use the smaller stack
19620 alignment of @option{-mrelocatable}.  Objects compiled with
19621 @option{-mrelocatable-lib} may be linked with objects compiled with
19622 any combination of the @option{-mrelocatable} options.
19624 @item -mno-toc
19625 @itemx -mtoc
19626 @opindex mno-toc
19627 @opindex mtoc
19628 On System V.4 and embedded PowerPC systems do not (do) assume that
19629 register 2 contains a pointer to a global area pointing to the addresses
19630 used in the program.
19632 @item -mlittle
19633 @itemx -mlittle-endian
19634 @opindex mlittle
19635 @opindex mlittle-endian
19636 On System V.4 and embedded PowerPC systems compile code for the
19637 processor in little-endian mode.  The @option{-mlittle-endian} option is
19638 the same as @option{-mlittle}.
19640 @item -mbig
19641 @itemx -mbig-endian
19642 @opindex mbig
19643 @opindex mbig-endian
19644 On System V.4 and embedded PowerPC systems compile code for the
19645 processor in big-endian mode.  The @option{-mbig-endian} option is
19646 the same as @option{-mbig}.
19648 @item -mdynamic-no-pic
19649 @opindex mdynamic-no-pic
19650 On Darwin and Mac OS X systems, compile code so that it is not
19651 relocatable, but that its external references are relocatable.  The
19652 resulting code is suitable for applications, but not shared
19653 libraries.
19655 @item -msingle-pic-base
19656 @opindex msingle-pic-base
19657 Treat the register used for PIC addressing as read-only, rather than
19658 loading it in the prologue for each function.  The runtime system is
19659 responsible for initializing this register with an appropriate value
19660 before execution begins.
19662 @item -mprioritize-restricted-insns=@var{priority}
19663 @opindex mprioritize-restricted-insns
19664 This option controls the priority that is assigned to
19665 dispatch-slot restricted instructions during the second scheduling
19666 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
19667 or @samp{2} to assign no, highest, or second-highest (respectively) 
19668 priority to dispatch-slot restricted
19669 instructions.
19671 @item -msched-costly-dep=@var{dependence_type}
19672 @opindex msched-costly-dep
19673 This option controls which dependences are considered costly
19674 by the target during instruction scheduling.  The argument
19675 @var{dependence_type} takes one of the following values:
19677 @table @asis
19678 @item @samp{no}
19679 No dependence is costly.
19681 @item @samp{all}
19682 All dependences are costly.
19684 @item @samp{true_store_to_load}
19685 A true dependence from store to load is costly.
19687 @item @samp{store_to_load}
19688 Any dependence from store to load is costly.
19690 @item @var{number}
19691 Any dependence for which the latency is greater than or equal to 
19692 @var{number} is costly.
19693 @end table
19695 @item -minsert-sched-nops=@var{scheme}
19696 @opindex minsert-sched-nops
19697 This option controls which NOP insertion scheme is used during
19698 the second scheduling pass.  The argument @var{scheme} takes one of the
19699 following values:
19701 @table @asis
19702 @item @samp{no}
19703 Don't insert NOPs.
19705 @item @samp{pad}
19706 Pad with NOPs any dispatch group that has vacant issue slots,
19707 according to the scheduler's grouping.
19709 @item @samp{regroup_exact}
19710 Insert NOPs to force costly dependent insns into
19711 separate groups.  Insert exactly as many NOPs as needed to force an insn
19712 to a new group, according to the estimated processor grouping.
19714 @item @var{number}
19715 Insert NOPs to force costly dependent insns into
19716 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
19717 @end table
19719 @item -mcall-sysv
19720 @opindex mcall-sysv
19721 On System V.4 and embedded PowerPC systems compile code using calling
19722 conventions that adhere to the March 1995 draft of the System V
19723 Application Binary Interface, PowerPC processor supplement.  This is the
19724 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
19726 @item -mcall-sysv-eabi
19727 @itemx -mcall-eabi
19728 @opindex mcall-sysv-eabi
19729 @opindex mcall-eabi
19730 Specify both @option{-mcall-sysv} and @option{-meabi} options.
19732 @item -mcall-sysv-noeabi
19733 @opindex mcall-sysv-noeabi
19734 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
19736 @item -mcall-aixdesc
19737 @opindex m
19738 On System V.4 and embedded PowerPC systems compile code for the AIX
19739 operating system.
19741 @item -mcall-linux
19742 @opindex mcall-linux
19743 On System V.4 and embedded PowerPC systems compile code for the
19744 Linux-based GNU system.
19746 @item -mcall-freebsd
19747 @opindex mcall-freebsd
19748 On System V.4 and embedded PowerPC systems compile code for the
19749 FreeBSD operating system.
19751 @item -mcall-netbsd
19752 @opindex mcall-netbsd
19753 On System V.4 and embedded PowerPC systems compile code for the
19754 NetBSD operating system.
19756 @item -mcall-openbsd
19757 @opindex mcall-netbsd
19758 On System V.4 and embedded PowerPC systems compile code for the
19759 OpenBSD operating system.
19761 @item -maix-struct-return
19762 @opindex maix-struct-return
19763 Return all structures in memory (as specified by the AIX ABI)@.
19765 @item -msvr4-struct-return
19766 @opindex msvr4-struct-return
19767 Return structures smaller than 8 bytes in registers (as specified by the
19768 SVR4 ABI)@.
19770 @item -mabi=@var{abi-type}
19771 @opindex mabi
19772 Extend the current ABI with a particular extension, or remove such extension.
19773 Valid values are @samp{altivec}, @samp{no-altivec}, @samp{spe},
19774 @samp{no-spe}, @samp{ibmlongdouble}, @samp{ieeelongdouble},
19775 @samp{elfv1}, @samp{elfv2}@.
19777 @item -mabi=spe
19778 @opindex mabi=spe
19779 Extend the current ABI with SPE ABI extensions.  This does not change
19780 the default ABI, instead it adds the SPE ABI extensions to the current
19781 ABI@.
19783 @item -mabi=no-spe
19784 @opindex mabi=no-spe
19785 Disable Book-E SPE ABI extensions for the current ABI@.
19787 @item -mabi=ibmlongdouble
19788 @opindex mabi=ibmlongdouble
19789 Change the current ABI to use IBM extended-precision long double.
19790 This is a PowerPC 32-bit SYSV ABI option.
19792 @item -mabi=ieeelongdouble
19793 @opindex mabi=ieeelongdouble
19794 Change the current ABI to use IEEE extended-precision long double.
19795 This is a PowerPC 32-bit Linux ABI option.
19797 @item -mabi=elfv1
19798 @opindex mabi=elfv1
19799 Change the current ABI to use the ELFv1 ABI.
19800 This is the default ABI for big-endian PowerPC 64-bit Linux.
19801 Overriding the default ABI requires special system support and is
19802 likely to fail in spectacular ways.
19804 @item -mabi=elfv2
19805 @opindex mabi=elfv2
19806 Change the current ABI to use the ELFv2 ABI.
19807 This is the default ABI for little-endian PowerPC 64-bit Linux.
19808 Overriding the default ABI requires special system support and is
19809 likely to fail in spectacular ways.
19811 @item -mprototype
19812 @itemx -mno-prototype
19813 @opindex mprototype
19814 @opindex mno-prototype
19815 On System V.4 and embedded PowerPC systems assume that all calls to
19816 variable argument functions are properly prototyped.  Otherwise, the
19817 compiler must insert an instruction before every non-prototyped call to
19818 set or clear bit 6 of the condition code register (@code{CR}) to
19819 indicate whether floating-point values are passed in the floating-point
19820 registers in case the function takes variable arguments.  With
19821 @option{-mprototype}, only calls to prototyped variable argument functions
19822 set or clear the bit.
19824 @item -msim
19825 @opindex msim
19826 On embedded PowerPC systems, assume that the startup module is called
19827 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
19828 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
19829 configurations.
19831 @item -mmvme
19832 @opindex mmvme
19833 On embedded PowerPC systems, assume that the startup module is called
19834 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
19835 @file{libc.a}.
19837 @item -mads
19838 @opindex mads
19839 On embedded PowerPC systems, assume that the startup module is called
19840 @file{crt0.o} and the standard C libraries are @file{libads.a} and
19841 @file{libc.a}.
19843 @item -myellowknife
19844 @opindex myellowknife
19845 On embedded PowerPC systems, assume that the startup module is called
19846 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
19847 @file{libc.a}.
19849 @item -mvxworks
19850 @opindex mvxworks
19851 On System V.4 and embedded PowerPC systems, specify that you are
19852 compiling for a VxWorks system.
19854 @item -memb
19855 @opindex memb
19856 On embedded PowerPC systems, set the @code{PPC_EMB} bit in the ELF flags
19857 header to indicate that @samp{eabi} extended relocations are used.
19859 @item -meabi
19860 @itemx -mno-eabi
19861 @opindex meabi
19862 @opindex mno-eabi
19863 On System V.4 and embedded PowerPC systems do (do not) adhere to the
19864 Embedded Applications Binary Interface (EABI), which is a set of
19865 modifications to the System V.4 specifications.  Selecting @option{-meabi}
19866 means that the stack is aligned to an 8-byte boundary, a function
19867 @code{__eabi} is called from @code{main} to set up the EABI
19868 environment, and the @option{-msdata} option can use both @code{r2} and
19869 @code{r13} to point to two separate small data areas.  Selecting
19870 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
19871 no EABI initialization function is called from @code{main}, and the
19872 @option{-msdata} option only uses @code{r13} to point to a single
19873 small data area.  The @option{-meabi} option is on by default if you
19874 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
19876 @item -msdata=eabi
19877 @opindex msdata=eabi
19878 On System V.4 and embedded PowerPC systems, put small initialized
19879 @code{const} global and static data in the @code{.sdata2} section, which
19880 is pointed to by register @code{r2}.  Put small initialized
19881 non-@code{const} global and static data in the @code{.sdata} section,
19882 which is pointed to by register @code{r13}.  Put small uninitialized
19883 global and static data in the @code{.sbss} section, which is adjacent to
19884 the @code{.sdata} section.  The @option{-msdata=eabi} option is
19885 incompatible with the @option{-mrelocatable} option.  The
19886 @option{-msdata=eabi} option also sets the @option{-memb} option.
19888 @item -msdata=sysv
19889 @opindex msdata=sysv
19890 On System V.4 and embedded PowerPC systems, put small global and static
19891 data in the @code{.sdata} section, which is pointed to by register
19892 @code{r13}.  Put small uninitialized global and static data in the
19893 @code{.sbss} section, which is adjacent to the @code{.sdata} section.
19894 The @option{-msdata=sysv} option is incompatible with the
19895 @option{-mrelocatable} option.
19897 @item -msdata=default
19898 @itemx -msdata
19899 @opindex msdata=default
19900 @opindex msdata
19901 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
19902 compile code the same as @option{-msdata=eabi}, otherwise compile code the
19903 same as @option{-msdata=sysv}.
19905 @item -msdata=data
19906 @opindex msdata=data
19907 On System V.4 and embedded PowerPC systems, put small global
19908 data in the @code{.sdata} section.  Put small uninitialized global
19909 data in the @code{.sbss} section.  Do not use register @code{r13}
19910 to address small data however.  This is the default behavior unless
19911 other @option{-msdata} options are used.
19913 @item -msdata=none
19914 @itemx -mno-sdata
19915 @opindex msdata=none
19916 @opindex mno-sdata
19917 On embedded PowerPC systems, put all initialized global and static data
19918 in the @code{.data} section, and all uninitialized data in the
19919 @code{.bss} section.
19921 @item -mblock-move-inline-limit=@var{num}
19922 @opindex mblock-move-inline-limit
19923 Inline all block moves (such as calls to @code{memcpy} or structure
19924 copies) less than or equal to @var{num} bytes.  The minimum value for
19925 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
19926 targets.  The default value is target-specific.
19928 @item -G @var{num}
19929 @opindex G
19930 @cindex smaller data references (PowerPC)
19931 @cindex .sdata/.sdata2 references (PowerPC)
19932 On embedded PowerPC systems, put global and static items less than or
19933 equal to @var{num} bytes into the small data or BSS sections instead of
19934 the normal data or BSS section.  By default, @var{num} is 8.  The
19935 @option{-G @var{num}} switch is also passed to the linker.
19936 All modules should be compiled with the same @option{-G @var{num}} value.
19938 @item -mregnames
19939 @itemx -mno-regnames
19940 @opindex mregnames
19941 @opindex mno-regnames
19942 On System V.4 and embedded PowerPC systems do (do not) emit register
19943 names in the assembly language output using symbolic forms.
19945 @item -mlongcall
19946 @itemx -mno-longcall
19947 @opindex mlongcall
19948 @opindex mno-longcall
19949 By default assume that all calls are far away so that a longer and more
19950 expensive calling sequence is required.  This is required for calls
19951 farther than 32 megabytes (33,554,432 bytes) from the current location.
19952 A short call is generated if the compiler knows
19953 the call cannot be that far away.  This setting can be overridden by
19954 the @code{shortcall} function attribute, or by @code{#pragma
19955 longcall(0)}.
19957 Some linkers are capable of detecting out-of-range calls and generating
19958 glue code on the fly.  On these systems, long calls are unnecessary and
19959 generate slower code.  As of this writing, the AIX linker can do this,
19960 as can the GNU linker for PowerPC/64.  It is planned to add this feature
19961 to the GNU linker for 32-bit PowerPC systems as well.
19963 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
19964 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
19965 addresses represent the callee and the branch island.  The
19966 Darwin/PPC linker prefers the first address and generates a @code{bl
19967 callee} if the PPC @code{bl} instruction reaches the callee directly;
19968 otherwise, the linker generates @code{bl L42} to call the branch
19969 island.  The branch island is appended to the body of the
19970 calling function; it computes the full 32-bit address of the callee
19971 and jumps to it.
19973 On Mach-O (Darwin) systems, this option directs the compiler emit to
19974 the glue for every direct call, and the Darwin linker decides whether
19975 to use or discard it.
19977 In the future, GCC may ignore all longcall specifications
19978 when the linker is known to generate glue.
19980 @item -mtls-markers
19981 @itemx -mno-tls-markers
19982 @opindex mtls-markers
19983 @opindex mno-tls-markers
19984 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
19985 specifying the function argument.  The relocation allows the linker to
19986 reliably associate function call with argument setup instructions for
19987 TLS optimization, which in turn allows GCC to better schedule the
19988 sequence.
19990 @item -pthread
19991 @opindex pthread
19992 Adds support for multithreading with the @dfn{pthreads} library.
19993 This option sets flags for both the preprocessor and linker.
19995 @item -mrecip
19996 @itemx -mno-recip
19997 @opindex mrecip
19998 This option enables use of the reciprocal estimate and
19999 reciprocal square root estimate instructions with additional
20000 Newton-Raphson steps to increase precision instead of doing a divide or
20001 square root and divide for floating-point arguments.  You should use
20002 the @option{-ffast-math} option when using @option{-mrecip} (or at
20003 least @option{-funsafe-math-optimizations},
20004 @option{-finite-math-only}, @option{-freciprocal-math} and
20005 @option{-fno-trapping-math}).  Note that while the throughput of the
20006 sequence is generally higher than the throughput of the non-reciprocal
20007 instruction, the precision of the sequence can be decreased by up to 2
20008 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
20009 roots.
20011 @item -mrecip=@var{opt}
20012 @opindex mrecip=opt
20013 This option controls which reciprocal estimate instructions
20014 may be used.  @var{opt} is a comma-separated list of options, which may
20015 be preceded by a @code{!} to invert the option:
20017 @table @samp
20019 @item all
20020 Enable all estimate instructions.
20022 @item default 
20023 Enable the default instructions, equivalent to @option{-mrecip}.
20025 @item none 
20026 Disable all estimate instructions, equivalent to @option{-mno-recip}.
20028 @item div 
20029 Enable the reciprocal approximation instructions for both 
20030 single and double precision.
20032 @item divf 
20033 Enable the single-precision reciprocal approximation instructions.
20035 @item divd 
20036 Enable the double-precision reciprocal approximation instructions.
20038 @item rsqrt 
20039 Enable the reciprocal square root approximation instructions for both
20040 single and double precision.
20042 @item rsqrtf 
20043 Enable the single-precision reciprocal square root approximation instructions.
20045 @item rsqrtd 
20046 Enable the double-precision reciprocal square root approximation instructions.
20048 @end table
20050 So, for example, @option{-mrecip=all,!rsqrtd} enables
20051 all of the reciprocal estimate instructions, except for the
20052 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
20053 which handle the double-precision reciprocal square root calculations.
20055 @item -mrecip-precision
20056 @itemx -mno-recip-precision
20057 @opindex mrecip-precision
20058 Assume (do not assume) that the reciprocal estimate instructions
20059 provide higher-precision estimates than is mandated by the PowerPC
20060 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
20061 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
20062 The double-precision square root estimate instructions are not generated by
20063 default on low-precision machines, since they do not provide an
20064 estimate that converges after three steps.
20066 @item -mveclibabi=@var{type}
20067 @opindex mveclibabi
20068 Specifies the ABI type to use for vectorizing intrinsics using an
20069 external library.  The only type supported at present is @samp{mass},
20070 which specifies to use IBM's Mathematical Acceleration Subsystem
20071 (MASS) libraries for vectorizing intrinsics using external libraries.
20072 GCC currently emits calls to @code{acosd2}, @code{acosf4},
20073 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
20074 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
20075 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
20076 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
20077 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
20078 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
20079 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
20080 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
20081 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
20082 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
20083 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
20084 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
20085 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
20086 for power7.  Both @option{-ftree-vectorize} and
20087 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
20088 libraries must be specified at link time.
20090 @item -mfriz
20091 @itemx -mno-friz
20092 @opindex mfriz
20093 Generate (do not generate) the @code{friz} instruction when the
20094 @option{-funsafe-math-optimizations} option is used to optimize
20095 rounding of floating-point values to 64-bit integer and back to floating
20096 point.  The @code{friz} instruction does not return the same value if
20097 the floating-point number is too large to fit in an integer.
20099 @item -mpointers-to-nested-functions
20100 @itemx -mno-pointers-to-nested-functions
20101 @opindex mpointers-to-nested-functions
20102 Generate (do not generate) code to load up the static chain register
20103 (@code{r11}) when calling through a pointer on AIX and 64-bit Linux
20104 systems where a function pointer points to a 3-word descriptor giving
20105 the function address, TOC value to be loaded in register @code{r2}, and
20106 static chain value to be loaded in register @code{r11}.  The
20107 @option{-mpointers-to-nested-functions} is on by default.  You cannot
20108 call through pointers to nested functions or pointers
20109 to functions compiled in other languages that use the static chain if
20110 you use @option{-mno-pointers-to-nested-functions}.
20112 @item -msave-toc-indirect
20113 @itemx -mno-save-toc-indirect
20114 @opindex msave-toc-indirect
20115 Generate (do not generate) code to save the TOC value in the reserved
20116 stack location in the function prologue if the function calls through
20117 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
20118 saved in the prologue, it is saved just before the call through the
20119 pointer.  The @option{-mno-save-toc-indirect} option is the default.
20121 @item -mcompat-align-parm
20122 @itemx -mno-compat-align-parm
20123 @opindex mcompat-align-parm
20124 Generate (do not generate) code to pass structure parameters with a
20125 maximum alignment of 64 bits, for compatibility with older versions
20126 of GCC.
20128 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
20129 structure parameter on a 128-bit boundary when that structure contained
20130 a member requiring 128-bit alignment.  This is corrected in more
20131 recent versions of GCC.  This option may be used to generate code
20132 that is compatible with functions compiled with older versions of
20133 GCC.
20135 The @option{-mno-compat-align-parm} option is the default.
20136 @end table
20138 @node RX Options
20139 @subsection RX Options
20140 @cindex RX Options
20142 These command-line options are defined for RX targets:
20144 @table @gcctabopt
20145 @item -m64bit-doubles
20146 @itemx -m32bit-doubles
20147 @opindex m64bit-doubles
20148 @opindex m32bit-doubles
20149 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
20150 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
20151 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
20152 works on 32-bit values, which is why the default is
20153 @option{-m32bit-doubles}.
20155 @item -fpu
20156 @itemx -nofpu
20157 @opindex fpu
20158 @opindex nofpu
20159 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
20160 floating-point hardware.  The default is enabled for the RX600
20161 series and disabled for the RX200 series.
20163 Floating-point instructions are only generated for 32-bit floating-point 
20164 values, however, so the FPU hardware is not used for doubles if the
20165 @option{-m64bit-doubles} option is used.
20167 @emph{Note} If the @option{-fpu} option is enabled then
20168 @option{-funsafe-math-optimizations} is also enabled automatically.
20169 This is because the RX FPU instructions are themselves unsafe.
20171 @item -mcpu=@var{name}
20172 @opindex mcpu
20173 Selects the type of RX CPU to be targeted.  Currently three types are
20174 supported, the generic @samp{RX600} and @samp{RX200} series hardware and
20175 the specific @samp{RX610} CPU.  The default is @samp{RX600}.
20177 The only difference between @samp{RX600} and @samp{RX610} is that the
20178 @samp{RX610} does not support the @code{MVTIPL} instruction.
20180 The @samp{RX200} series does not have a hardware floating-point unit
20181 and so @option{-nofpu} is enabled by default when this type is
20182 selected.
20184 @item -mbig-endian-data
20185 @itemx -mlittle-endian-data
20186 @opindex mbig-endian-data
20187 @opindex mlittle-endian-data
20188 Store data (but not code) in the big-endian format.  The default is
20189 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
20190 format.
20192 @item -msmall-data-limit=@var{N}
20193 @opindex msmall-data-limit
20194 Specifies the maximum size in bytes of global and static variables
20195 which can be placed into the small data area.  Using the small data
20196 area can lead to smaller and faster code, but the size of area is
20197 limited and it is up to the programmer to ensure that the area does
20198 not overflow.  Also when the small data area is used one of the RX's
20199 registers (usually @code{r13}) is reserved for use pointing to this
20200 area, so it is no longer available for use by the compiler.  This
20201 could result in slower and/or larger code if variables are pushed onto
20202 the stack instead of being held in this register.
20204 Note, common variables (variables that have not been initialized) and
20205 constants are not placed into the small data area as they are assigned
20206 to other sections in the output executable.
20208 The default value is zero, which disables this feature.  Note, this
20209 feature is not enabled by default with higher optimization levels
20210 (@option{-O2} etc) because of the potentially detrimental effects of
20211 reserving a register.  It is up to the programmer to experiment and
20212 discover whether this feature is of benefit to their program.  See the
20213 description of the @option{-mpid} option for a description of how the
20214 actual register to hold the small data area pointer is chosen.
20216 @item -msim
20217 @itemx -mno-sim
20218 @opindex msim
20219 @opindex mno-sim
20220 Use the simulator runtime.  The default is to use the libgloss
20221 board-specific runtime.
20223 @item -mas100-syntax
20224 @itemx -mno-as100-syntax
20225 @opindex mas100-syntax
20226 @opindex mno-as100-syntax
20227 When generating assembler output use a syntax that is compatible with
20228 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
20229 assembler, but it has some restrictions so it is not generated by default.
20231 @item -mmax-constant-size=@var{N}
20232 @opindex mmax-constant-size
20233 Specifies the maximum size, in bytes, of a constant that can be used as
20234 an operand in a RX instruction.  Although the RX instruction set does
20235 allow constants of up to 4 bytes in length to be used in instructions,
20236 a longer value equates to a longer instruction.  Thus in some
20237 circumstances it can be beneficial to restrict the size of constants
20238 that are used in instructions.  Constants that are too big are instead
20239 placed into a constant pool and referenced via register indirection.
20241 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
20242 or 4 means that constants of any size are allowed.
20244 @item -mrelax
20245 @opindex mrelax
20246 Enable linker relaxation.  Linker relaxation is a process whereby the
20247 linker attempts to reduce the size of a program by finding shorter
20248 versions of various instructions.  Disabled by default.
20250 @item -mint-register=@var{N}
20251 @opindex mint-register
20252 Specify the number of registers to reserve for fast interrupt handler
20253 functions.  The value @var{N} can be between 0 and 4.  A value of 1
20254 means that register @code{r13} is reserved for the exclusive use
20255 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
20256 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
20257 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
20258 A value of 0, the default, does not reserve any registers.
20260 @item -msave-acc-in-interrupts
20261 @opindex msave-acc-in-interrupts
20262 Specifies that interrupt handler functions should preserve the
20263 accumulator register.  This is only necessary if normal code might use
20264 the accumulator register, for example because it performs 64-bit
20265 multiplications.  The default is to ignore the accumulator as this
20266 makes the interrupt handlers faster.
20268 @item -mpid
20269 @itemx -mno-pid
20270 @opindex mpid
20271 @opindex mno-pid
20272 Enables the generation of position independent data.  When enabled any
20273 access to constant data is done via an offset from a base address
20274 held in a register.  This allows the location of constant data to be
20275 determined at run time without requiring the executable to be
20276 relocated, which is a benefit to embedded applications with tight
20277 memory constraints.  Data that can be modified is not affected by this
20278 option.
20280 Note, using this feature reserves a register, usually @code{r13}, for
20281 the constant data base address.  This can result in slower and/or
20282 larger code, especially in complicated functions.
20284 The actual register chosen to hold the constant data base address
20285 depends upon whether the @option{-msmall-data-limit} and/or the
20286 @option{-mint-register} command-line options are enabled.  Starting
20287 with register @code{r13} and proceeding downwards, registers are
20288 allocated first to satisfy the requirements of @option{-mint-register},
20289 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
20290 is possible for the small data area register to be @code{r8} if both
20291 @option{-mint-register=4} and @option{-mpid} are specified on the
20292 command line.
20294 By default this feature is not enabled.  The default can be restored
20295 via the @option{-mno-pid} command-line option.
20297 @item -mno-warn-multiple-fast-interrupts
20298 @itemx -mwarn-multiple-fast-interrupts
20299 @opindex mno-warn-multiple-fast-interrupts
20300 @opindex mwarn-multiple-fast-interrupts
20301 Prevents GCC from issuing a warning message if it finds more than one
20302 fast interrupt handler when it is compiling a file.  The default is to
20303 issue a warning for each extra fast interrupt handler found, as the RX
20304 only supports one such interrupt.
20306 @item -mallow-string-insns
20307 @itemx -mno-allow-string-insns
20308 @opindex mallow-string-insns
20309 @opindex mno-allow-string-insns
20310 Enables or disables the use of the string manipulation instructions
20311 @code{SMOVF}, @code{SCMPU}, @code{SMOVB}, @code{SMOVU}, @code{SUNTIL}
20312 @code{SWHILE} and also the @code{RMPA} instruction.  These
20313 instructions may prefetch data, which is not safe to do if accessing
20314 an I/O register.  (See section 12.2.7 of the RX62N Group User's Manual
20315 for more information).
20317 The default is to allow these instructions, but it is not possible for
20318 GCC to reliably detect all circumstances where a string instruction
20319 might be used to access an I/O register, so their use cannot be
20320 disabled automatically.  Instead it is reliant upon the programmer to
20321 use the @option{-mno-allow-string-insns} option if their program
20322 accesses I/O space.
20324 When the instructions are enabled GCC defines the C preprocessor
20325 symbol @code{__RX_ALLOW_STRING_INSNS__}, otherwise it defines the
20326 symbol @code{__RX_DISALLOW_STRING_INSNS__}.
20327 @end table
20329 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
20330 has special significance to the RX port when used with the
20331 @code{interrupt} function attribute.  This attribute indicates a
20332 function intended to process fast interrupts.  GCC ensures
20333 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
20334 and/or @code{r13} and only provided that the normal use of the
20335 corresponding registers have been restricted via the
20336 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
20337 options.
20339 @node S/390 and zSeries Options
20340 @subsection S/390 and zSeries Options
20341 @cindex S/390 and zSeries Options
20343 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
20345 @table @gcctabopt
20346 @item -mhard-float
20347 @itemx -msoft-float
20348 @opindex mhard-float
20349 @opindex msoft-float
20350 Use (do not use) the hardware floating-point instructions and registers
20351 for floating-point operations.  When @option{-msoft-float} is specified,
20352 functions in @file{libgcc.a} are used to perform floating-point
20353 operations.  When @option{-mhard-float} is specified, the compiler
20354 generates IEEE floating-point instructions.  This is the default.
20356 @item -mhard-dfp
20357 @itemx -mno-hard-dfp
20358 @opindex mhard-dfp
20359 @opindex mno-hard-dfp
20360 Use (do not use) the hardware decimal-floating-point instructions for
20361 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
20362 specified, functions in @file{libgcc.a} are used to perform
20363 decimal-floating-point operations.  When @option{-mhard-dfp} is
20364 specified, the compiler generates decimal-floating-point hardware
20365 instructions.  This is the default for @option{-march=z9-ec} or higher.
20367 @item -mlong-double-64
20368 @itemx -mlong-double-128
20369 @opindex mlong-double-64
20370 @opindex mlong-double-128
20371 These switches control the size of @code{long double} type. A size
20372 of 64 bits makes the @code{long double} type equivalent to the @code{double}
20373 type. This is the default.
20375 @item -mbackchain
20376 @itemx -mno-backchain
20377 @opindex mbackchain
20378 @opindex mno-backchain
20379 Store (do not store) the address of the caller's frame as backchain pointer
20380 into the callee's stack frame.
20381 A backchain may be needed to allow debugging using tools that do not understand
20382 DWARF 2 call frame information.
20383 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
20384 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
20385 the backchain is placed into the topmost word of the 96/160 byte register
20386 save area.
20388 In general, code compiled with @option{-mbackchain} is call-compatible with
20389 code compiled with @option{-mmo-backchain}; however, use of the backchain
20390 for debugging purposes usually requires that the whole binary is built with
20391 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
20392 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
20393 to build a linux kernel use @option{-msoft-float}.
20395 The default is to not maintain the backchain.
20397 @item -mpacked-stack
20398 @itemx -mno-packed-stack
20399 @opindex mpacked-stack
20400 @opindex mno-packed-stack
20401 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
20402 specified, the compiler uses the all fields of the 96/160 byte register save
20403 area only for their default purpose; unused fields still take up stack space.
20404 When @option{-mpacked-stack} is specified, register save slots are densely
20405 packed at the top of the register save area; unused space is reused for other
20406 purposes, allowing for more efficient use of the available stack space.
20407 However, when @option{-mbackchain} is also in effect, the topmost word of
20408 the save area is always used to store the backchain, and the return address
20409 register is always saved two words below the backchain.
20411 As long as the stack frame backchain is not used, code generated with
20412 @option{-mpacked-stack} is call-compatible with code generated with
20413 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
20414 S/390 or zSeries generated code that uses the stack frame backchain at run
20415 time, not just for debugging purposes.  Such code is not call-compatible
20416 with code compiled with @option{-mpacked-stack}.  Also, note that the
20417 combination of @option{-mbackchain},
20418 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
20419 to build a linux kernel use @option{-msoft-float}.
20421 The default is to not use the packed stack layout.
20423 @item -msmall-exec
20424 @itemx -mno-small-exec
20425 @opindex msmall-exec
20426 @opindex mno-small-exec
20427 Generate (or do not generate) code using the @code{bras} instruction
20428 to do subroutine calls.
20429 This only works reliably if the total executable size does not
20430 exceed 64k.  The default is to use the @code{basr} instruction instead,
20431 which does not have this limitation.
20433 @item -m64
20434 @itemx -m31
20435 @opindex m64
20436 @opindex m31
20437 When @option{-m31} is specified, generate code compliant to the
20438 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
20439 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
20440 particular to generate 64-bit instructions.  For the @samp{s390}
20441 targets, the default is @option{-m31}, while the @samp{s390x}
20442 targets default to @option{-m64}.
20444 @item -mzarch
20445 @itemx -mesa
20446 @opindex mzarch
20447 @opindex mesa
20448 When @option{-mzarch} is specified, generate code using the
20449 instructions available on z/Architecture.
20450 When @option{-mesa} is specified, generate code using the
20451 instructions available on ESA/390.  Note that @option{-mesa} is
20452 not possible with @option{-m64}.
20453 When generating code compliant to the GNU/Linux for S/390 ABI,
20454 the default is @option{-mesa}.  When generating code compliant
20455 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
20457 @item -mmvcle
20458 @itemx -mno-mvcle
20459 @opindex mmvcle
20460 @opindex mno-mvcle
20461 Generate (or do not generate) code using the @code{mvcle} instruction
20462 to perform block moves.  When @option{-mno-mvcle} is specified,
20463 use a @code{mvc} loop instead.  This is the default unless optimizing for
20464 size.
20466 @item -mdebug
20467 @itemx -mno-debug
20468 @opindex mdebug
20469 @opindex mno-debug
20470 Print (or do not print) additional debug information when compiling.
20471 The default is to not print debug information.
20473 @item -march=@var{cpu-type}
20474 @opindex march
20475 Generate code that runs on @var{cpu-type}, which is the name of a system
20476 representing a certain processor type.  Possible values for
20477 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
20478 @samp{z9-109}, @samp{z9-ec}, @samp{z10},  @samp{z196}, @samp{zEC12},
20479 and @samp{z13}.
20480 When generating code using the instructions available on z/Architecture,
20481 the default is @option{-march=z900}.  Otherwise, the default is
20482 @option{-march=g5}.
20484 @item -mtune=@var{cpu-type}
20485 @opindex mtune
20486 Tune to @var{cpu-type} everything applicable about the generated code,
20487 except for the ABI and the set of available instructions.
20488 The list of @var{cpu-type} values is the same as for @option{-march}.
20489 The default is the value used for @option{-march}.
20491 @item -mtpf-trace
20492 @itemx -mno-tpf-trace
20493 @opindex mtpf-trace
20494 @opindex mno-tpf-trace
20495 Generate code that adds (does not add) in TPF OS specific branches to trace
20496 routines in the operating system.  This option is off by default, even
20497 when compiling for the TPF OS@.
20499 @item -mfused-madd
20500 @itemx -mno-fused-madd
20501 @opindex mfused-madd
20502 @opindex mno-fused-madd
20503 Generate code that uses (does not use) the floating-point multiply and
20504 accumulate instructions.  These instructions are generated by default if
20505 hardware floating point is used.
20507 @item -mwarn-framesize=@var{framesize}
20508 @opindex mwarn-framesize
20509 Emit a warning if the current function exceeds the given frame size.  Because
20510 this is a compile-time check it doesn't need to be a real problem when the program
20511 runs.  It is intended to identify functions that most probably cause
20512 a stack overflow.  It is useful to be used in an environment with limited stack
20513 size e.g.@: the linux kernel.
20515 @item -mwarn-dynamicstack
20516 @opindex mwarn-dynamicstack
20517 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
20518 arrays.  This is generally a bad idea with a limited stack size.
20520 @item -mstack-guard=@var{stack-guard}
20521 @itemx -mstack-size=@var{stack-size}
20522 @opindex mstack-guard
20523 @opindex mstack-size
20524 If these options are provided the S/390 back end emits additional instructions in
20525 the function prologue that trigger a trap if the stack size is @var{stack-guard}
20526 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
20527 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
20528 the frame size of the compiled function is chosen.
20529 These options are intended to be used to help debugging stack overflow problems.
20530 The additionally emitted code causes only little overhead and hence can also be
20531 used in production-like systems without greater performance degradation.  The given
20532 values have to be exact powers of 2 and @var{stack-size} has to be greater than
20533 @var{stack-guard} without exceeding 64k.
20534 In order to be efficient the extra code makes the assumption that the stack starts
20535 at an address aligned to the value given by @var{stack-size}.
20536 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
20538 @item -mhotpatch=@var{pre-halfwords},@var{post-halfwords}
20539 @opindex mhotpatch
20540 If the hotpatch option is enabled, a ``hot-patching'' function
20541 prologue is generated for all functions in the compilation unit.
20542 The funtion label is prepended with the given number of two-byte
20543 NOP instructions (@var{pre-halfwords}, maximum 1000000).  After
20544 the label, 2 * @var{post-halfwords} bytes are appended, using the
20545 largest NOP like instructions the architecture allows (maximum
20546 1000000).
20548 If both arguments are zero, hotpatching is disabled.
20550 This option can be overridden for individual functions with the
20551 @code{hotpatch} attribute.
20552 @end table
20554 @node Score Options
20555 @subsection Score Options
20556 @cindex Score Options
20558 These options are defined for Score implementations:
20560 @table @gcctabopt
20561 @item -meb
20562 @opindex meb
20563 Compile code for big-endian mode.  This is the default.
20565 @item -mel
20566 @opindex mel
20567 Compile code for little-endian mode.
20569 @item -mnhwloop
20570 @opindex mnhwloop
20571 Disable generation of @code{bcnz} instructions.
20573 @item -muls
20574 @opindex muls
20575 Enable generation of unaligned load and store instructions.
20577 @item -mmac
20578 @opindex mmac
20579 Enable the use of multiply-accumulate instructions. Disabled by default.
20581 @item -mscore5
20582 @opindex mscore5
20583 Specify the SCORE5 as the target architecture.
20585 @item -mscore5u
20586 @opindex mscore5u
20587 Specify the SCORE5U of the target architecture.
20589 @item -mscore7
20590 @opindex mscore7
20591 Specify the SCORE7 as the target architecture. This is the default.
20593 @item -mscore7d
20594 @opindex mscore7d
20595 Specify the SCORE7D as the target architecture.
20596 @end table
20598 @node SH Options
20599 @subsection SH Options
20601 These @samp{-m} options are defined for the SH implementations:
20603 @table @gcctabopt
20604 @item -m1
20605 @opindex m1
20606 Generate code for the SH1.
20608 @item -m2
20609 @opindex m2
20610 Generate code for the SH2.
20612 @item -m2e
20613 Generate code for the SH2e.
20615 @item -m2a-nofpu
20616 @opindex m2a-nofpu
20617 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
20618 that the floating-point unit is not used.
20620 @item -m2a-single-only
20621 @opindex m2a-single-only
20622 Generate code for the SH2a-FPU, in such a way that no double-precision
20623 floating-point operations are used.
20625 @item -m2a-single
20626 @opindex m2a-single
20627 Generate code for the SH2a-FPU assuming the floating-point unit is in
20628 single-precision mode by default.
20630 @item -m2a
20631 @opindex m2a
20632 Generate code for the SH2a-FPU assuming the floating-point unit is in
20633 double-precision mode by default.
20635 @item -m3
20636 @opindex m3
20637 Generate code for the SH3.
20639 @item -m3e
20640 @opindex m3e
20641 Generate code for the SH3e.
20643 @item -m4-nofpu
20644 @opindex m4-nofpu
20645 Generate code for the SH4 without a floating-point unit.
20647 @item -m4-single-only
20648 @opindex m4-single-only
20649 Generate code for the SH4 with a floating-point unit that only
20650 supports single-precision arithmetic.
20652 @item -m4-single
20653 @opindex m4-single
20654 Generate code for the SH4 assuming the floating-point unit is in
20655 single-precision mode by default.
20657 @item -m4
20658 @opindex m4
20659 Generate code for the SH4.
20661 @item -m4-100
20662 @opindex m4-100
20663 Generate code for SH4-100.
20665 @item -m4-100-nofpu
20666 @opindex m4-100-nofpu
20667 Generate code for SH4-100 in such a way that the
20668 floating-point unit is not used.
20670 @item -m4-100-single
20671 @opindex m4-100-single
20672 Generate code for SH4-100 assuming the floating-point unit is in
20673 single-precision mode by default.
20675 @item -m4-100-single-only
20676 @opindex m4-100-single-only
20677 Generate code for SH4-100 in such a way that no double-precision
20678 floating-point operations are used.
20680 @item -m4-200
20681 @opindex m4-200
20682 Generate code for SH4-200.
20684 @item -m4-200-nofpu
20685 @opindex m4-200-nofpu
20686 Generate code for SH4-200 without in such a way that the
20687 floating-point unit is not used.
20689 @item -m4-200-single
20690 @opindex m4-200-single
20691 Generate code for SH4-200 assuming the floating-point unit is in
20692 single-precision mode by default.
20694 @item -m4-200-single-only
20695 @opindex m4-200-single-only
20696 Generate code for SH4-200 in such a way that no double-precision
20697 floating-point operations are used.
20699 @item -m4-300
20700 @opindex m4-300
20701 Generate code for SH4-300.
20703 @item -m4-300-nofpu
20704 @opindex m4-300-nofpu
20705 Generate code for SH4-300 without in such a way that the
20706 floating-point unit is not used.
20708 @item -m4-300-single
20709 @opindex m4-300-single
20710 Generate code for SH4-300 in such a way that no double-precision
20711 floating-point operations are used.
20713 @item -m4-300-single-only
20714 @opindex m4-300-single-only
20715 Generate code for SH4-300 in such a way that no double-precision
20716 floating-point operations are used.
20718 @item -m4-340
20719 @opindex m4-340
20720 Generate code for SH4-340 (no MMU, no FPU).
20722 @item -m4-500
20723 @opindex m4-500
20724 Generate code for SH4-500 (no FPU).  Passes @option{-isa=sh4-nofpu} to the
20725 assembler.
20727 @item -m4a-nofpu
20728 @opindex m4a-nofpu
20729 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
20730 floating-point unit is not used.
20732 @item -m4a-single-only
20733 @opindex m4a-single-only
20734 Generate code for the SH4a, in such a way that no double-precision
20735 floating-point operations are used.
20737 @item -m4a-single
20738 @opindex m4a-single
20739 Generate code for the SH4a assuming the floating-point unit is in
20740 single-precision mode by default.
20742 @item -m4a
20743 @opindex m4a
20744 Generate code for the SH4a.
20746 @item -m4al
20747 @opindex m4al
20748 Same as @option{-m4a-nofpu}, except that it implicitly passes
20749 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
20750 instructions at the moment.
20752 @item -m5-32media
20753 @opindex m5-32media
20754 Generate 32-bit code for SHmedia.
20756 @item -m5-32media-nofpu
20757 @opindex m5-32media-nofpu
20758 Generate 32-bit code for SHmedia in such a way that the
20759 floating-point unit is not used.
20761 @item -m5-64media
20762 @opindex m5-64media
20763 Generate 64-bit code for SHmedia.
20765 @item -m5-64media-nofpu
20766 @opindex m5-64media-nofpu
20767 Generate 64-bit code for SHmedia in such a way that the
20768 floating-point unit is not used.
20770 @item -m5-compact
20771 @opindex m5-compact
20772 Generate code for SHcompact.
20774 @item -m5-compact-nofpu
20775 @opindex m5-compact-nofpu
20776 Generate code for SHcompact in such a way that the
20777 floating-point unit is not used.
20779 @item -mb
20780 @opindex mb
20781 Compile code for the processor in big-endian mode.
20783 @item -ml
20784 @opindex ml
20785 Compile code for the processor in little-endian mode.
20787 @item -mdalign
20788 @opindex mdalign
20789 Align doubles at 64-bit boundaries.  Note that this changes the calling
20790 conventions, and thus some functions from the standard C library do
20791 not work unless you recompile it first with @option{-mdalign}.
20793 @item -mrelax
20794 @opindex mrelax
20795 Shorten some address references at link time, when possible; uses the
20796 linker option @option{-relax}.
20798 @item -mbigtable
20799 @opindex mbigtable
20800 Use 32-bit offsets in @code{switch} tables.  The default is to use
20801 16-bit offsets.
20803 @item -mbitops
20804 @opindex mbitops
20805 Enable the use of bit manipulation instructions on SH2A.
20807 @item -mfmovd
20808 @opindex mfmovd
20809 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
20810 alignment constraints.
20812 @item -mrenesas
20813 @opindex mrenesas
20814 Comply with the calling conventions defined by Renesas.
20816 @item -mno-renesas
20817 @opindex mno-renesas
20818 Comply with the calling conventions defined for GCC before the Renesas
20819 conventions were available.  This option is the default for all
20820 targets of the SH toolchain.
20822 @item -mnomacsave
20823 @opindex mnomacsave
20824 Mark the @code{MAC} register as call-clobbered, even if
20825 @option{-mrenesas} is given.
20827 @item -mieee
20828 @itemx -mno-ieee
20829 @opindex mieee
20830 @opindex mno-ieee
20831 Control the IEEE compliance of floating-point comparisons, which affects the
20832 handling of cases where the result of a comparison is unordered.  By default
20833 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
20834 enabled @option{-mno-ieee} is implicitly set, which results in faster
20835 floating-point greater-equal and less-equal comparisons.  The implcit settings
20836 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
20838 @item -minline-ic_invalidate
20839 @opindex minline-ic_invalidate
20840 Inline code to invalidate instruction cache entries after setting up
20841 nested function trampolines.
20842 This option has no effect if @option{-musermode} is in effect and the selected
20843 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
20844 instruction.
20845 If the selected code generation option does not allow the use of the @code{icbi}
20846 instruction, and @option{-musermode} is not in effect, the inlined code
20847 manipulates the instruction cache address array directly with an associative
20848 write.  This not only requires privileged mode at run time, but it also
20849 fails if the cache line had been mapped via the TLB and has become unmapped.
20851 @item -misize
20852 @opindex misize
20853 Dump instruction size and location in the assembly code.
20855 @item -mpadstruct
20856 @opindex mpadstruct
20857 This option is deprecated.  It pads structures to multiple of 4 bytes,
20858 which is incompatible with the SH ABI@.
20860 @item -matomic-model=@var{model}
20861 @opindex matomic-model=@var{model}
20862 Sets the model of atomic operations and additional parameters as a comma
20863 separated list.  For details on the atomic built-in functions see
20864 @ref{__atomic Builtins}.  The following models and parameters are supported:
20866 @table @samp
20868 @item none
20869 Disable compiler generated atomic sequences and emit library calls for atomic
20870 operations.  This is the default if the target is not @code{sh*-*-linux*}.
20872 @item soft-gusa
20873 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
20874 built-in functions.  The generated atomic sequences require additional support
20875 from the interrupt/exception handling code of the system and are only suitable
20876 for SH3* and SH4* single-core systems.  This option is enabled by default when
20877 the target is @code{sh*-*-linux*} and SH3* or SH4*.  When the target is SH4A,
20878 this option also partially utilizes the hardware atomic instructions
20879 @code{movli.l} and @code{movco.l} to create more efficient code, unless
20880 @samp{strict} is specified.  
20882 @item soft-tcb
20883 Generate software atomic sequences that use a variable in the thread control
20884 block.  This is a variation of the gUSA sequences which can also be used on
20885 SH1* and SH2* targets.  The generated atomic sequences require additional
20886 support from the interrupt/exception handling code of the system and are only
20887 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
20888 parameter has to be specified as well.
20890 @item soft-imask
20891 Generate software atomic sequences that temporarily disable interrupts by
20892 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
20893 in privileged mode and is only suitable for single-core systems.  Additional
20894 support from the interrupt/exception handling code of the system is not
20895 required.  This model is enabled by default when the target is
20896 @code{sh*-*-linux*} and SH1* or SH2*.
20898 @item hard-llcs
20899 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
20900 instructions only.  This is only available on SH4A and is suitable for
20901 multi-core systems.  Since the hardware instructions support only 32 bit atomic
20902 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
20903 Code compiled with this option is also compatible with other software
20904 atomic model interrupt/exception handling systems if executed on an SH4A
20905 system.  Additional support from the interrupt/exception handling code of the
20906 system is not required for this model.
20908 @item gbr-offset=
20909 This parameter specifies the offset in bytes of the variable in the thread
20910 control block structure that should be used by the generated atomic sequences
20911 when the @samp{soft-tcb} model has been selected.  For other models this
20912 parameter is ignored.  The specified value must be an integer multiple of four
20913 and in the range 0-1020.
20915 @item strict
20916 This parameter prevents mixed usage of multiple atomic models, even if they
20917 are compatible, and makes the compiler generate atomic sequences of the
20918 specified model only.
20920 @end table
20922 @item -mtas
20923 @opindex mtas
20924 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
20925 Notice that depending on the particular hardware and software configuration
20926 this can degrade overall performance due to the operand cache line flushes
20927 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
20928 processors the @code{tas.b} instruction must be used with caution since it
20929 can result in data corruption for certain cache configurations.
20931 @item -mprefergot
20932 @opindex mprefergot
20933 When generating position-independent code, emit function calls using
20934 the Global Offset Table instead of the Procedure Linkage Table.
20936 @item -musermode
20937 @itemx -mno-usermode
20938 @opindex musermode
20939 @opindex mno-usermode
20940 Don't allow (allow) the compiler generating privileged mode code.  Specifying
20941 @option{-musermode} also implies @option{-mno-inline-ic_invalidate} if the
20942 inlined code would not work in user mode.  @option{-musermode} is the default
20943 when the target is @code{sh*-*-linux*}.  If the target is SH1* or SH2*
20944 @option{-musermode} has no effect, since there is no user mode.
20946 @item -multcost=@var{number}
20947 @opindex multcost=@var{number}
20948 Set the cost to assume for a multiply insn.
20950 @item -mdiv=@var{strategy}
20951 @opindex mdiv=@var{strategy}
20952 Set the division strategy to be used for integer division operations.
20953 For SHmedia @var{strategy} can be one of: 
20955 @table @samp
20957 @item fp 
20958 Performs the operation in floating point.  This has a very high latency,
20959 but needs only a few instructions, so it might be a good choice if
20960 your code has enough easily-exploitable ILP to allow the compiler to
20961 schedule the floating-point instructions together with other instructions.
20962 Division by zero causes a floating-point exception.
20964 @item inv
20965 Uses integer operations to calculate the inverse of the divisor,
20966 and then multiplies the dividend with the inverse.  This strategy allows
20967 CSE and hoisting of the inverse calculation.  Division by zero calculates
20968 an unspecified result, but does not trap.
20970 @item inv:minlat
20971 A variant of @samp{inv} where, if no CSE or hoisting opportunities
20972 have been found, or if the entire operation has been hoisted to the same
20973 place, the last stages of the inverse calculation are intertwined with the
20974 final multiply to reduce the overall latency, at the expense of using a few
20975 more instructions, and thus offering fewer scheduling opportunities with
20976 other code.
20978 @item call
20979 Calls a library function that usually implements the @samp{inv:minlat}
20980 strategy.
20981 This gives high code density for @code{m5-*media-nofpu} compilations.
20983 @item call2
20984 Uses a different entry point of the same library function, where it
20985 assumes that a pointer to a lookup table has already been set up, which
20986 exposes the pointer load to CSE and code hoisting optimizations.
20988 @item inv:call
20989 @itemx inv:call2
20990 @itemx inv:fp
20991 Use the @samp{inv} algorithm for initial
20992 code generation, but if the code stays unoptimized, revert to the @samp{call},
20993 @samp{call2}, or @samp{fp} strategies, respectively.  Note that the
20994 potentially-trapping side effect of division by zero is carried by a
20995 separate instruction, so it is possible that all the integer instructions
20996 are hoisted out, but the marker for the side effect stays where it is.
20997 A recombination to floating-point operations or a call is not possible
20998 in that case.
21000 @item inv20u
21001 @itemx inv20l
21002 Variants of the @samp{inv:minlat} strategy.  In the case
21003 that the inverse calculation is not separated from the multiply, they speed
21004 up division where the dividend fits into 20 bits (plus sign where applicable)
21005 by inserting a test to skip a number of operations in this case; this test
21006 slows down the case of larger dividends.  @samp{inv20u} assumes the case of a such
21007 a small dividend to be unlikely, and @samp{inv20l} assumes it to be likely.
21009 @end table
21011 For targets other than SHmedia @var{strategy} can be one of:
21013 @table @samp
21015 @item call-div1
21016 Calls a library function that uses the single-step division instruction
21017 @code{div1} to perform the operation.  Division by zero calculates an
21018 unspecified result and does not trap.  This is the default except for SH4,
21019 SH2A and SHcompact.
21021 @item call-fp
21022 Calls a library function that performs the operation in double precision
21023 floating point.  Division by zero causes a floating-point exception.  This is
21024 the default for SHcompact with FPU.  Specifying this for targets that do not
21025 have a double precision FPU defaults to @code{call-div1}.
21027 @item call-table
21028 Calls a library function that uses a lookup table for small divisors and
21029 the @code{div1} instruction with case distinction for larger divisors.  Division
21030 by zero calculates an unspecified result and does not trap.  This is the default
21031 for SH4.  Specifying this for targets that do not have dynamic shift
21032 instructions defaults to @code{call-div1}.
21034 @end table
21036 When a division strategy has not been specified the default strategy is
21037 selected based on the current target.  For SH2A the default strategy is to
21038 use the @code{divs} and @code{divu} instructions instead of library function
21039 calls.
21041 @item -maccumulate-outgoing-args
21042 @opindex maccumulate-outgoing-args
21043 Reserve space once for outgoing arguments in the function prologue rather
21044 than around each call.  Generally beneficial for performance and size.  Also
21045 needed for unwinding to avoid changing the stack frame around conditional code.
21047 @item -mdivsi3_libfunc=@var{name}
21048 @opindex mdivsi3_libfunc=@var{name}
21049 Set the name of the library function used for 32-bit signed division to
21050 @var{name}.
21051 This only affects the name used in the @samp{call} and @samp{inv:call}
21052 division strategies, and the compiler still expects the same
21053 sets of input/output/clobbered registers as if this option were not present.
21055 @item -mfixed-range=@var{register-range}
21056 @opindex mfixed-range
21057 Generate code treating the given register range as fixed registers.
21058 A fixed register is one that the register allocator can not use.  This is
21059 useful when compiling kernel code.  A register range is specified as
21060 two registers separated by a dash.  Multiple register ranges can be
21061 specified separated by a comma.
21063 @item -mindexed-addressing
21064 @opindex mindexed-addressing
21065 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
21066 This is only safe if the hardware and/or OS implement 32-bit wrap-around
21067 semantics for the indexed addressing mode.  The architecture allows the
21068 implementation of processors with 64-bit MMU, which the OS could use to
21069 get 32-bit addressing, but since no current hardware implementation supports
21070 this or any other way to make the indexed addressing mode safe to use in
21071 the 32-bit ABI, the default is @option{-mno-indexed-addressing}.
21073 @item -mgettrcost=@var{number}
21074 @opindex mgettrcost=@var{number}
21075 Set the cost assumed for the @code{gettr} instruction to @var{number}.
21076 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
21078 @item -mpt-fixed
21079 @opindex mpt-fixed
21080 Assume @code{pt*} instructions won't trap.  This generally generates
21081 better-scheduled code, but is unsafe on current hardware.
21082 The current architecture
21083 definition says that @code{ptabs} and @code{ptrel} trap when the target 
21084 anded with 3 is 3.
21085 This has the unintentional effect of making it unsafe to schedule these
21086 instructions before a branch, or hoist them out of a loop.  For example,
21087 @code{__do_global_ctors}, a part of @file{libgcc}
21088 that runs constructors at program
21089 startup, calls functions in a list which is delimited by @minus{}1.  With the
21090 @option{-mpt-fixed} option, the @code{ptabs} is done before testing against @minus{}1.
21091 That means that all the constructors run a bit more quickly, but when
21092 the loop comes to the end of the list, the program crashes because @code{ptabs}
21093 loads @minus{}1 into a target register.  
21095 Since this option is unsafe for any
21096 hardware implementing the current architecture specification, the default
21097 is @option{-mno-pt-fixed}.  Unless specified explicitly with 
21098 @option{-mgettrcost}, @option{-mno-pt-fixed} also implies @option{-mgettrcost=100};
21099 this deters register allocation from using target registers for storing
21100 ordinary integers.
21102 @item -minvalid-symbols
21103 @opindex minvalid-symbols
21104 Assume symbols might be invalid.  Ordinary function symbols generated by
21105 the compiler are always valid to load with
21106 @code{movi}/@code{shori}/@code{ptabs} or
21107 @code{movi}/@code{shori}/@code{ptrel},
21108 but with assembler and/or linker tricks it is possible
21109 to generate symbols that cause @code{ptabs} or @code{ptrel} to trap.
21110 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
21111 It prevents cross-basic-block CSE, hoisting and most scheduling
21112 of symbol loads.  The default is @option{-mno-invalid-symbols}.
21114 @item -mbranch-cost=@var{num}
21115 @opindex mbranch-cost=@var{num}
21116 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
21117 make the compiler try to generate more branch-free code if possible.  
21118 If not specified the value is selected depending on the processor type that
21119 is being compiled for.
21121 @item -mzdcbranch
21122 @itemx -mno-zdcbranch
21123 @opindex mzdcbranch
21124 @opindex mno-zdcbranch
21125 Assume (do not assume) that zero displacement conditional branch instructions
21126 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
21127 compiler prefers zero displacement branch code sequences.  This is
21128 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
21129 disabled by specifying @option{-mno-zdcbranch}.
21131 @item -mcbranch-force-delay-slot
21132 @opindex mcbranch-force-delay-slot
21133 Force the usage of delay slots for conditional branches, which stuffs the delay
21134 slot with a @code{nop} if a suitable instruction can't be found.  By default
21135 this option is disabled.  It can be enabled to work around hardware bugs as
21136 found in the original SH7055.
21138 @item -mfused-madd
21139 @itemx -mno-fused-madd
21140 @opindex mfused-madd
21141 @opindex mno-fused-madd
21142 Generate code that uses (does not use) the floating-point multiply and
21143 accumulate instructions.  These instructions are generated by default
21144 if hardware floating point is used.  The machine-dependent
21145 @option{-mfused-madd} option is now mapped to the machine-independent
21146 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
21147 mapped to @option{-ffp-contract=off}.
21149 @item -mfsca
21150 @itemx -mno-fsca
21151 @opindex mfsca
21152 @opindex mno-fsca
21153 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
21154 and cosine approximations.  The option @option{-mfsca} must be used in
21155 combination with @option{-funsafe-math-optimizations}.  It is enabled by default
21156 when generating code for SH4A.  Using @option{-mno-fsca} disables sine and cosine
21157 approximations even if @option{-funsafe-math-optimizations} is in effect.
21159 @item -mfsrra
21160 @itemx -mno-fsrra
21161 @opindex mfsrra
21162 @opindex mno-fsrra
21163 Allow or disallow the compiler to emit the @code{fsrra} instruction for
21164 reciprocal square root approximations.  The option @option{-mfsrra} must be used
21165 in combination with @option{-funsafe-math-optimizations} and
21166 @option{-ffinite-math-only}.  It is enabled by default when generating code for
21167 SH4A.  Using @option{-mno-fsrra} disables reciprocal square root approximations
21168 even if @option{-funsafe-math-optimizations} and @option{-ffinite-math-only} are
21169 in effect.
21171 @item -mpretend-cmove
21172 @opindex mpretend-cmove
21173 Prefer zero-displacement conditional branches for conditional move instruction
21174 patterns.  This can result in faster code on the SH4 processor.
21176 @end table
21178 @node Solaris 2 Options
21179 @subsection Solaris 2 Options
21180 @cindex Solaris 2 options
21182 These @samp{-m} options are supported on Solaris 2:
21184 @table @gcctabopt
21185 @item -mclear-hwcap
21186 @opindex mclear-hwcap
21187 @option{-mclear-hwcap} tells the compiler to remove the hardware
21188 capabilities generated by the Solaris assembler.  This is only necessary
21189 when object files use ISA extensions not supported by the current
21190 machine, but check at runtime whether or not to use them.
21192 @item -mimpure-text
21193 @opindex mimpure-text
21194 @option{-mimpure-text}, used in addition to @option{-shared}, tells
21195 the compiler to not pass @option{-z text} to the linker when linking a
21196 shared object.  Using this option, you can link position-dependent
21197 code into a shared object.
21199 @option{-mimpure-text} suppresses the ``relocations remain against
21200 allocatable but non-writable sections'' linker error message.
21201 However, the necessary relocations trigger copy-on-write, and the
21202 shared object is not actually shared across processes.  Instead of
21203 using @option{-mimpure-text}, you should compile all source code with
21204 @option{-fpic} or @option{-fPIC}.
21206 @end table
21208 These switches are supported in addition to the above on Solaris 2:
21210 @table @gcctabopt
21211 @item -pthreads
21212 @opindex pthreads
21213 Add support for multithreading using the POSIX threads library.  This
21214 option sets flags for both the preprocessor and linker.  This option does
21215 not affect the thread safety of object code produced  by the compiler or
21216 that of libraries supplied with it.
21218 @item -pthread
21219 @opindex pthread
21220 This is a synonym for @option{-pthreads}.
21221 @end table
21223 @node SPARC Options
21224 @subsection SPARC Options
21225 @cindex SPARC options
21227 These @samp{-m} options are supported on the SPARC:
21229 @table @gcctabopt
21230 @item -mno-app-regs
21231 @itemx -mapp-regs
21232 @opindex mno-app-regs
21233 @opindex mapp-regs
21234 Specify @option{-mapp-regs} to generate output using the global registers
21235 2 through 4, which the SPARC SVR4 ABI reserves for applications.  Like the
21236 global register 1, each global register 2 through 4 is then treated as an
21237 allocable register that is clobbered by function calls.  This is the default.
21239 To be fully SVR4 ABI-compliant at the cost of some performance loss,
21240 specify @option{-mno-app-regs}.  You should compile libraries and system
21241 software with this option.
21243 @item -mflat
21244 @itemx -mno-flat
21245 @opindex mflat
21246 @opindex mno-flat
21247 With @option{-mflat}, the compiler does not generate save/restore instructions
21248 and uses a ``flat'' or single register window model.  This model is compatible
21249 with the regular register window model.  The local registers and the input
21250 registers (0--5) are still treated as ``call-saved'' registers and are
21251 saved on the stack as needed.
21253 With @option{-mno-flat} (the default), the compiler generates save/restore
21254 instructions (except for leaf functions).  This is the normal operating mode.
21256 @item -mfpu
21257 @itemx -mhard-float
21258 @opindex mfpu
21259 @opindex mhard-float
21260 Generate output containing floating-point instructions.  This is the
21261 default.
21263 @item -mno-fpu
21264 @itemx -msoft-float
21265 @opindex mno-fpu
21266 @opindex msoft-float
21267 Generate output containing library calls for floating point.
21268 @strong{Warning:} the requisite libraries are not available for all SPARC
21269 targets.  Normally the facilities of the machine's usual C compiler are
21270 used, but this cannot be done directly in cross-compilation.  You must make
21271 your own arrangements to provide suitable library functions for
21272 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
21273 @samp{sparclite-*-*} do provide software floating-point support.
21275 @option{-msoft-float} changes the calling convention in the output file;
21276 therefore, it is only useful if you compile @emph{all} of a program with
21277 this option.  In particular, you need to compile @file{libgcc.a}, the
21278 library that comes with GCC, with @option{-msoft-float} in order for
21279 this to work.
21281 @item -mhard-quad-float
21282 @opindex mhard-quad-float
21283 Generate output containing quad-word (long double) floating-point
21284 instructions.
21286 @item -msoft-quad-float
21287 @opindex msoft-quad-float
21288 Generate output containing library calls for quad-word (long double)
21289 floating-point instructions.  The functions called are those specified
21290 in the SPARC ABI@.  This is the default.
21292 As of this writing, there are no SPARC implementations that have hardware
21293 support for the quad-word floating-point instructions.  They all invoke
21294 a trap handler for one of these instructions, and then the trap handler
21295 emulates the effect of the instruction.  Because of the trap handler overhead,
21296 this is much slower than calling the ABI library routines.  Thus the
21297 @option{-msoft-quad-float} option is the default.
21299 @item -mno-unaligned-doubles
21300 @itemx -munaligned-doubles
21301 @opindex mno-unaligned-doubles
21302 @opindex munaligned-doubles
21303 Assume that doubles have 8-byte alignment.  This is the default.
21305 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
21306 alignment only if they are contained in another type, or if they have an
21307 absolute address.  Otherwise, it assumes they have 4-byte alignment.
21308 Specifying this option avoids some rare compatibility problems with code
21309 generated by other compilers.  It is not the default because it results
21310 in a performance loss, especially for floating-point code.
21312 @item -muser-mode
21313 @itemx -mno-user-mode
21314 @opindex muser-mode
21315 @opindex mno-user-mode
21316 Do not generate code that can only run in supervisor mode.  This is relevant
21317 only for the @code{casa} instruction emitted for the LEON3 processor.  The
21318 default is @option{-mno-user-mode}.
21320 @item -mno-faster-structs
21321 @itemx -mfaster-structs
21322 @opindex mno-faster-structs
21323 @opindex mfaster-structs
21324 With @option{-mfaster-structs}, the compiler assumes that structures
21325 should have 8-byte alignment.  This enables the use of pairs of
21326 @code{ldd} and @code{std} instructions for copies in structure
21327 assignment, in place of twice as many @code{ld} and @code{st} pairs.
21328 However, the use of this changed alignment directly violates the SPARC
21329 ABI@.  Thus, it's intended only for use on targets where the developer
21330 acknowledges that their resulting code is not directly in line with
21331 the rules of the ABI@.
21333 @item -mcpu=@var{cpu_type}
21334 @opindex mcpu
21335 Set the instruction set, register set, and instruction scheduling parameters
21336 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
21337 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
21338 @samp{leon}, @samp{leon3}, @samp{leon3v7}, @samp{sparclite}, @samp{f930},
21339 @samp{f934}, @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
21340 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
21341 @samp{niagara3} and @samp{niagara4}.
21343 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
21344 which selects the best architecture option for the host processor.
21345 @option{-mcpu=native} has no effect if GCC does not recognize
21346 the processor.
21348 Default instruction scheduling parameters are used for values that select
21349 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
21350 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
21352 Here is a list of each supported architecture and their supported
21353 implementations.
21355 @table @asis
21356 @item v7
21357 cypress, leon3v7
21359 @item v8
21360 supersparc, hypersparc, leon, leon3
21362 @item sparclite
21363 f930, f934, sparclite86x
21365 @item sparclet
21366 tsc701
21368 @item v9
21369 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4
21370 @end table
21372 By default (unless configured otherwise), GCC generates code for the V7
21373 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
21374 additionally optimizes it for the Cypress CY7C602 chip, as used in the
21375 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
21376 SPARCStation 1, 2, IPX etc.
21378 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
21379 architecture.  The only difference from V7 code is that the compiler emits
21380 the integer multiply and integer divide instructions which exist in SPARC-V8
21381 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
21382 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
21383 2000 series.
21385 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
21386 the SPARC architecture.  This adds the integer multiply, integer divide step
21387 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
21388 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
21389 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
21390 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
21391 MB86934 chip, which is the more recent SPARClite with FPU@.
21393 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
21394 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
21395 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
21396 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
21397 optimizes it for the TEMIC SPARClet chip.
21399 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
21400 architecture.  This adds 64-bit integer and floating-point move instructions,
21401 3 additional floating-point condition code registers and conditional move
21402 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
21403 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
21404 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
21405 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
21406 @option{-mcpu=niagara}, the compiler additionally optimizes it for
21407 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
21408 additionally optimizes it for Sun UltraSPARC T2 chips. With
21409 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
21410 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
21411 additionally optimizes it for Sun UltraSPARC T4 chips.
21413 @item -mtune=@var{cpu_type}
21414 @opindex mtune
21415 Set the instruction scheduling parameters for machine type
21416 @var{cpu_type}, but do not set the instruction set or register set that the
21417 option @option{-mcpu=@var{cpu_type}} does.
21419 The same values for @option{-mcpu=@var{cpu_type}} can be used for
21420 @option{-mtune=@var{cpu_type}}, but the only useful values are those
21421 that select a particular CPU implementation.  Those are @samp{cypress},
21422 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{leon3},
21423 @samp{leon3v7}, @samp{f930}, @samp{f934}, @samp{sparclite86x}, @samp{tsc701},
21424 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
21425 @samp{niagara3} and @samp{niagara4}.  With native Solaris and GNU/Linux
21426 toolchains, @samp{native} can also be used.
21428 @item -mv8plus
21429 @itemx -mno-v8plus
21430 @opindex mv8plus
21431 @opindex mno-v8plus
21432 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
21433 difference from the V8 ABI is that the global and out registers are
21434 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
21435 mode for all SPARC-V9 processors.
21437 @item -mvis
21438 @itemx -mno-vis
21439 @opindex mvis
21440 @opindex mno-vis
21441 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
21442 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
21444 @item -mvis2
21445 @itemx -mno-vis2
21446 @opindex mvis2
21447 @opindex mno-vis2
21448 With @option{-mvis2}, GCC generates code that takes advantage of
21449 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
21450 default is @option{-mvis2} when targeting a cpu that supports such
21451 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
21452 also sets @option{-mvis}.
21454 @item -mvis3
21455 @itemx -mno-vis3
21456 @opindex mvis3
21457 @opindex mno-vis3
21458 With @option{-mvis3}, GCC generates code that takes advantage of
21459 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
21460 default is @option{-mvis3} when targeting a cpu that supports such
21461 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
21462 also sets @option{-mvis2} and @option{-mvis}.
21464 @item -mcbcond
21465 @itemx -mno-cbcond
21466 @opindex mcbcond
21467 @opindex mno-cbcond
21468 With @option{-mcbcond}, GCC generates code that takes advantage of
21469 compare-and-branch instructions, as defined in the Sparc Architecture 2011.
21470 The default is @option{-mcbcond} when targeting a cpu that supports such
21471 instructions, such as niagara-4 and later.
21473 @item -mpopc
21474 @itemx -mno-popc
21475 @opindex mpopc
21476 @opindex mno-popc
21477 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
21478 population count instruction.  The default is @option{-mpopc}
21479 when targeting a cpu that supports such instructions, such as Niagara-2 and
21480 later.
21482 @item -mfmaf
21483 @itemx -mno-fmaf
21484 @opindex mfmaf
21485 @opindex mno-fmaf
21486 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
21487 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
21488 when targeting a cpu that supports such instructions, such as Niagara-3 and
21489 later.
21491 @item -mfix-at697f
21492 @opindex mfix-at697f
21493 Enable the documented workaround for the single erratum of the Atmel AT697F
21494 processor (which corresponds to erratum #13 of the AT697E processor).
21496 @item -mfix-ut699
21497 @opindex mfix-ut699
21498 Enable the documented workarounds for the floating-point errata and the data
21499 cache nullify errata of the UT699 processor.
21500 @end table
21502 These @samp{-m} options are supported in addition to the above
21503 on SPARC-V9 processors in 64-bit environments:
21505 @table @gcctabopt
21506 @item -m32
21507 @itemx -m64
21508 @opindex m32
21509 @opindex m64
21510 Generate code for a 32-bit or 64-bit environment.
21511 The 32-bit environment sets int, long and pointer to 32 bits.
21512 The 64-bit environment sets int to 32 bits and long and pointer
21513 to 64 bits.
21515 @item -mcmodel=@var{which}
21516 @opindex mcmodel
21517 Set the code model to one of
21519 @table @samp
21520 @item medlow
21521 The Medium/Low code model: 64-bit addresses, programs
21522 must be linked in the low 32 bits of memory.  Programs can be statically
21523 or dynamically linked.
21525 @item medmid
21526 The Medium/Middle code model: 64-bit addresses, programs
21527 must be linked in the low 44 bits of memory, the text and data segments must
21528 be less than 2GB in size and the data segment must be located within 2GB of
21529 the text segment.
21531 @item medany
21532 The Medium/Anywhere code model: 64-bit addresses, programs
21533 may be linked anywhere in memory, the text and data segments must be less
21534 than 2GB in size and the data segment must be located within 2GB of the
21535 text segment.
21537 @item embmedany
21538 The Medium/Anywhere code model for embedded systems:
21539 64-bit addresses, the text and data segments must be less than 2GB in
21540 size, both starting anywhere in memory (determined at link time).  The
21541 global register %g4 points to the base of the data segment.  Programs
21542 are statically linked and PIC is not supported.
21543 @end table
21545 @item -mmemory-model=@var{mem-model}
21546 @opindex mmemory-model
21547 Set the memory model in force on the processor to one of
21549 @table @samp
21550 @item default
21551 The default memory model for the processor and operating system.
21553 @item rmo
21554 Relaxed Memory Order
21556 @item pso
21557 Partial Store Order
21559 @item tso
21560 Total Store Order
21562 @item sc
21563 Sequential Consistency
21564 @end table
21566 These memory models are formally defined in Appendix D of the Sparc V9
21567 architecture manual, as set in the processor's @code{PSTATE.MM} field.
21569 @item -mstack-bias
21570 @itemx -mno-stack-bias
21571 @opindex mstack-bias
21572 @opindex mno-stack-bias
21573 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
21574 frame pointer if present, are offset by @minus{}2047 which must be added back
21575 when making stack frame references.  This is the default in 64-bit mode.
21576 Otherwise, assume no such offset is present.
21577 @end table
21579 @node SPU Options
21580 @subsection SPU Options
21581 @cindex SPU options
21583 These @samp{-m} options are supported on the SPU:
21585 @table @gcctabopt
21586 @item -mwarn-reloc
21587 @itemx -merror-reloc
21588 @opindex mwarn-reloc
21589 @opindex merror-reloc
21591 The loader for SPU does not handle dynamic relocations.  By default, GCC
21592 gives an error when it generates code that requires a dynamic
21593 relocation.  @option{-mno-error-reloc} disables the error,
21594 @option{-mwarn-reloc} generates a warning instead.
21596 @item -msafe-dma
21597 @itemx -munsafe-dma
21598 @opindex msafe-dma
21599 @opindex munsafe-dma
21601 Instructions that initiate or test completion of DMA must not be
21602 reordered with respect to loads and stores of the memory that is being
21603 accessed.
21604 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
21605 memory accesses, but that can lead to inefficient code in places where the
21606 memory is known to not change.  Rather than mark the memory as volatile,
21607 you can use @option{-msafe-dma} to tell the compiler to treat
21608 the DMA instructions as potentially affecting all memory.  
21610 @item -mbranch-hints
21611 @opindex mbranch-hints
21613 By default, GCC generates a branch hint instruction to avoid
21614 pipeline stalls for always-taken or probably-taken branches.  A hint
21615 is not generated closer than 8 instructions away from its branch.
21616 There is little reason to disable them, except for debugging purposes,
21617 or to make an object a little bit smaller.
21619 @item -msmall-mem
21620 @itemx -mlarge-mem
21621 @opindex msmall-mem
21622 @opindex mlarge-mem
21624 By default, GCC generates code assuming that addresses are never larger
21625 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
21626 a full 32-bit address.
21628 @item -mstdmain
21629 @opindex mstdmain
21631 By default, GCC links against startup code that assumes the SPU-style
21632 main function interface (which has an unconventional parameter list).
21633 With @option{-mstdmain}, GCC links your program against startup
21634 code that assumes a C99-style interface to @code{main}, including a
21635 local copy of @code{argv} strings.
21637 @item -mfixed-range=@var{register-range}
21638 @opindex mfixed-range
21639 Generate code treating the given register range as fixed registers.
21640 A fixed register is one that the register allocator cannot use.  This is
21641 useful when compiling kernel code.  A register range is specified as
21642 two registers separated by a dash.  Multiple register ranges can be
21643 specified separated by a comma.
21645 @item -mea32
21646 @itemx -mea64
21647 @opindex mea32
21648 @opindex mea64
21649 Compile code assuming that pointers to the PPU address space accessed
21650 via the @code{__ea} named address space qualifier are either 32 or 64
21651 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
21652 all object code in an executable must be compiled with the same setting.
21654 @item -maddress-space-conversion
21655 @itemx -mno-address-space-conversion
21656 @opindex maddress-space-conversion
21657 @opindex mno-address-space-conversion
21658 Allow/disallow treating the @code{__ea} address space as superset
21659 of the generic address space.  This enables explicit type casts
21660 between @code{__ea} and generic pointer as well as implicit
21661 conversions of generic pointers to @code{__ea} pointers.  The
21662 default is to allow address space pointer conversions.
21664 @item -mcache-size=@var{cache-size}
21665 @opindex mcache-size
21666 This option controls the version of libgcc that the compiler links to an
21667 executable and selects a software-managed cache for accessing variables
21668 in the @code{__ea} address space with a particular cache size.  Possible
21669 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
21670 and @samp{128}.  The default cache size is 64KB.
21672 @item -matomic-updates
21673 @itemx -mno-atomic-updates
21674 @opindex matomic-updates
21675 @opindex mno-atomic-updates
21676 This option controls the version of libgcc that the compiler links to an
21677 executable and selects whether atomic updates to the software-managed
21678 cache of PPU-side variables are used.  If you use atomic updates, changes
21679 to a PPU variable from SPU code using the @code{__ea} named address space
21680 qualifier do not interfere with changes to other PPU variables residing
21681 in the same cache line from PPU code.  If you do not use atomic updates,
21682 such interference may occur; however, writing back cache lines is
21683 more efficient.  The default behavior is to use atomic updates.
21685 @item -mdual-nops
21686 @itemx -mdual-nops=@var{n}
21687 @opindex mdual-nops
21688 By default, GCC inserts nops to increase dual issue when it expects
21689 it to increase performance.  @var{n} can be a value from 0 to 10.  A
21690 smaller @var{n} inserts fewer nops.  10 is the default, 0 is the
21691 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
21693 @item -mhint-max-nops=@var{n}
21694 @opindex mhint-max-nops
21695 Maximum number of nops to insert for a branch hint.  A branch hint must
21696 be at least 8 instructions away from the branch it is affecting.  GCC
21697 inserts up to @var{n} nops to enforce this, otherwise it does not
21698 generate the branch hint.
21700 @item -mhint-max-distance=@var{n}
21701 @opindex mhint-max-distance
21702 The encoding of the branch hint instruction limits the hint to be within
21703 256 instructions of the branch it is affecting.  By default, GCC makes
21704 sure it is within 125.
21706 @item -msafe-hints
21707 @opindex msafe-hints
21708 Work around a hardware bug that causes the SPU to stall indefinitely.
21709 By default, GCC inserts the @code{hbrp} instruction to make sure
21710 this stall won't happen.
21712 @end table
21714 @node System V Options
21715 @subsection Options for System V
21717 These additional options are available on System V Release 4 for
21718 compatibility with other compilers on those systems:
21720 @table @gcctabopt
21721 @item -G
21722 @opindex G
21723 Create a shared object.
21724 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
21726 @item -Qy
21727 @opindex Qy
21728 Identify the versions of each tool used by the compiler, in a
21729 @code{.ident} assembler directive in the output.
21731 @item -Qn
21732 @opindex Qn
21733 Refrain from adding @code{.ident} directives to the output file (this is
21734 the default).
21736 @item -YP,@var{dirs}
21737 @opindex YP
21738 Search the directories @var{dirs}, and no others, for libraries
21739 specified with @option{-l}.
21741 @item -Ym,@var{dir}
21742 @opindex Ym
21743 Look in the directory @var{dir} to find the M4 preprocessor.
21744 The assembler uses this option.
21745 @c This is supposed to go with a -Yd for predefined M4 macro files, but
21746 @c the generic assembler that comes with Solaris takes just -Ym.
21747 @end table
21749 @node TILE-Gx Options
21750 @subsection TILE-Gx Options
21751 @cindex TILE-Gx options
21753 These @samp{-m} options are supported on the TILE-Gx:
21755 @table @gcctabopt
21756 @item -mcmodel=small
21757 @opindex mcmodel=small
21758 Generate code for the small model.  The distance for direct calls is
21759 limited to 500M in either direction.  PC-relative addresses are 32
21760 bits.  Absolute addresses support the full address range.
21762 @item -mcmodel=large
21763 @opindex mcmodel=large
21764 Generate code for the large model.  There is no limitation on call
21765 distance, pc-relative addresses, or absolute addresses.
21767 @item -mcpu=@var{name}
21768 @opindex mcpu
21769 Selects the type of CPU to be targeted.  Currently the only supported
21770 type is @samp{tilegx}.
21772 @item -m32
21773 @itemx -m64
21774 @opindex m32
21775 @opindex m64
21776 Generate code for a 32-bit or 64-bit environment.  The 32-bit
21777 environment sets int, long, and pointer to 32 bits.  The 64-bit
21778 environment sets int to 32 bits and long and pointer to 64 bits.
21780 @item -mbig-endian
21781 @itemx -mlittle-endian
21782 @opindex mbig-endian
21783 @opindex mlittle-endian
21784 Generate code in big/little endian mode, respectively.
21785 @end table
21787 @node TILEPro Options
21788 @subsection TILEPro Options
21789 @cindex TILEPro options
21791 These @samp{-m} options are supported on the TILEPro:
21793 @table @gcctabopt
21794 @item -mcpu=@var{name}
21795 @opindex mcpu
21796 Selects the type of CPU to be targeted.  Currently the only supported
21797 type is @samp{tilepro}.
21799 @item -m32
21800 @opindex m32
21801 Generate code for a 32-bit environment, which sets int, long, and
21802 pointer to 32 bits.  This is the only supported behavior so the flag
21803 is essentially ignored.
21804 @end table
21806 @node V850 Options
21807 @subsection V850 Options
21808 @cindex V850 Options
21810 These @samp{-m} options are defined for V850 implementations:
21812 @table @gcctabopt
21813 @item -mlong-calls
21814 @itemx -mno-long-calls
21815 @opindex mlong-calls
21816 @opindex mno-long-calls
21817 Treat all calls as being far away (near).  If calls are assumed to be
21818 far away, the compiler always loads the function's address into a
21819 register, and calls indirect through the pointer.
21821 @item -mno-ep
21822 @itemx -mep
21823 @opindex mno-ep
21824 @opindex mep
21825 Do not optimize (do optimize) basic blocks that use the same index
21826 pointer 4 or more times to copy pointer into the @code{ep} register, and
21827 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
21828 option is on by default if you optimize.
21830 @item -mno-prolog-function
21831 @itemx -mprolog-function
21832 @opindex mno-prolog-function
21833 @opindex mprolog-function
21834 Do not use (do use) external functions to save and restore registers
21835 at the prologue and epilogue of a function.  The external functions
21836 are slower, but use less code space if more than one function saves
21837 the same number of registers.  The @option{-mprolog-function} option
21838 is on by default if you optimize.
21840 @item -mspace
21841 @opindex mspace
21842 Try to make the code as small as possible.  At present, this just turns
21843 on the @option{-mep} and @option{-mprolog-function} options.
21845 @item -mtda=@var{n}
21846 @opindex mtda
21847 Put static or global variables whose size is @var{n} bytes or less into
21848 the tiny data area that register @code{ep} points to.  The tiny data
21849 area can hold up to 256 bytes in total (128 bytes for byte references).
21851 @item -msda=@var{n}
21852 @opindex msda
21853 Put static or global variables whose size is @var{n} bytes or less into
21854 the small data area that register @code{gp} points to.  The small data
21855 area can hold up to 64 kilobytes.
21857 @item -mzda=@var{n}
21858 @opindex mzda
21859 Put static or global variables whose size is @var{n} bytes or less into
21860 the first 32 kilobytes of memory.
21862 @item -mv850
21863 @opindex mv850
21864 Specify that the target processor is the V850.
21866 @item -mv850e3v5
21867 @opindex mv850e3v5
21868 Specify that the target processor is the V850E3V5.  The preprocessor
21869 constant @code{__v850e3v5__} is defined if this option is used.
21871 @item -mv850e2v4
21872 @opindex mv850e2v4
21873 Specify that the target processor is the V850E3V5.  This is an alias for
21874 the @option{-mv850e3v5} option.
21876 @item -mv850e2v3
21877 @opindex mv850e2v3
21878 Specify that the target processor is the V850E2V3.  The preprocessor
21879 constant @code{__v850e2v3__} is defined if this option is used.
21881 @item -mv850e2
21882 @opindex mv850e2
21883 Specify that the target processor is the V850E2.  The preprocessor
21884 constant @code{__v850e2__} is defined if this option is used.
21886 @item -mv850e1
21887 @opindex mv850e1
21888 Specify that the target processor is the V850E1.  The preprocessor
21889 constants @code{__v850e1__} and @code{__v850e__} are defined if
21890 this option is used.
21892 @item -mv850es
21893 @opindex mv850es
21894 Specify that the target processor is the V850ES.  This is an alias for
21895 the @option{-mv850e1} option.
21897 @item -mv850e
21898 @opindex mv850e
21899 Specify that the target processor is the V850E@.  The preprocessor
21900 constant @code{__v850e__} is defined if this option is used.
21902 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
21903 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
21904 are defined then a default target processor is chosen and the
21905 relevant @samp{__v850*__} preprocessor constant is defined.
21907 The preprocessor constants @code{__v850} and @code{__v851__} are always
21908 defined, regardless of which processor variant is the target.
21910 @item -mdisable-callt
21911 @itemx -mno-disable-callt
21912 @opindex mdisable-callt
21913 @opindex mno-disable-callt
21914 This option suppresses generation of the @code{CALLT} instruction for the
21915 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
21916 architecture.
21918 This option is enabled by default when the RH850 ABI is
21919 in use (see @option{-mrh850-abi}), and disabled by default when the
21920 GCC ABI is in use.  If @code{CALLT} instructions are being generated
21921 then the C preprocessor symbol @code{__V850_CALLT__} is defined.
21923 @item -mrelax
21924 @itemx -mno-relax
21925 @opindex mrelax
21926 @opindex mno-relax
21927 Pass on (or do not pass on) the @option{-mrelax} command-line option
21928 to the assembler.
21930 @item -mlong-jumps
21931 @itemx -mno-long-jumps
21932 @opindex mlong-jumps
21933 @opindex mno-long-jumps
21934 Disable (or re-enable) the generation of PC-relative jump instructions.
21936 @item -msoft-float
21937 @itemx -mhard-float
21938 @opindex msoft-float
21939 @opindex mhard-float
21940 Disable (or re-enable) the generation of hardware floating point
21941 instructions.  This option is only significant when the target
21942 architecture is @samp{V850E2V3} or higher.  If hardware floating point
21943 instructions are being generated then the C preprocessor symbol
21944 @code{__FPU_OK__} is defined, otherwise the symbol
21945 @code{__NO_FPU__} is defined.
21947 @item -mloop
21948 @opindex mloop
21949 Enables the use of the e3v5 LOOP instruction.  The use of this
21950 instruction is not enabled by default when the e3v5 architecture is
21951 selected because its use is still experimental.
21953 @item -mrh850-abi
21954 @itemx -mghs
21955 @opindex mrh850-abi
21956 @opindex mghs
21957 Enables support for the RH850 version of the V850 ABI.  This is the
21958 default.  With this version of the ABI the following rules apply:
21960 @itemize
21961 @item
21962 Integer sized structures and unions are returned via a memory pointer
21963 rather than a register.
21965 @item
21966 Large structures and unions (more than 8 bytes in size) are passed by
21967 value.
21969 @item
21970 Functions are aligned to 16-bit boundaries.
21972 @item
21973 The @option{-m8byte-align} command-line option is supported.
21975 @item
21976 The @option{-mdisable-callt} command-line option is enabled by
21977 default.  The @option{-mno-disable-callt} command-line option is not
21978 supported.
21979 @end itemize
21981 When this version of the ABI is enabled the C preprocessor symbol
21982 @code{__V850_RH850_ABI__} is defined.
21984 @item -mgcc-abi
21985 @opindex mgcc-abi
21986 Enables support for the old GCC version of the V850 ABI.  With this
21987 version of the ABI the following rules apply:
21989 @itemize
21990 @item
21991 Integer sized structures and unions are returned in register @code{r10}.
21993 @item
21994 Large structures and unions (more than 8 bytes in size) are passed by
21995 reference.
21997 @item
21998 Functions are aligned to 32-bit boundaries, unless optimizing for
21999 size.
22001 @item
22002 The @option{-m8byte-align} command-line option is not supported.
22004 @item
22005 The @option{-mdisable-callt} command-line option is supported but not
22006 enabled by default.
22007 @end itemize
22009 When this version of the ABI is enabled the C preprocessor symbol
22010 @code{__V850_GCC_ABI__} is defined.
22012 @item -m8byte-align
22013 @itemx -mno-8byte-align
22014 @opindex m8byte-align
22015 @opindex mno-8byte-align
22016 Enables support for @code{double} and @code{long long} types to be
22017 aligned on 8-byte boundaries.  The default is to restrict the
22018 alignment of all objects to at most 4-bytes.  When
22019 @option{-m8byte-align} is in effect the C preprocessor symbol
22020 @code{__V850_8BYTE_ALIGN__} is defined.
22022 @item -mbig-switch
22023 @opindex mbig-switch
22024 Generate code suitable for big switch tables.  Use this option only if
22025 the assembler/linker complain about out of range branches within a switch
22026 table.
22028 @item -mapp-regs
22029 @opindex mapp-regs
22030 This option causes r2 and r5 to be used in the code generated by
22031 the compiler.  This setting is the default.
22033 @item -mno-app-regs
22034 @opindex mno-app-regs
22035 This option causes r2 and r5 to be treated as fixed registers.
22037 @end table
22039 @node VAX Options
22040 @subsection VAX Options
22041 @cindex VAX options
22043 These @samp{-m} options are defined for the VAX:
22045 @table @gcctabopt
22046 @item -munix
22047 @opindex munix
22048 Do not output certain jump instructions (@code{aobleq} and so on)
22049 that the Unix assembler for the VAX cannot handle across long
22050 ranges.
22052 @item -mgnu
22053 @opindex mgnu
22054 Do output those jump instructions, on the assumption that the
22055 GNU assembler is being used.
22057 @item -mg
22058 @opindex mg
22059 Output code for G-format floating-point numbers instead of D-format.
22060 @end table
22062 @node Visium Options
22063 @subsection Visium Options
22064 @cindex Visium options
22066 @table @gcctabopt
22068 @item -mdebug
22069 @opindex mdebug
22070 A program which performs file I/O and is destined to run on an MCM target
22071 should be linked with this option.  It causes the libraries libc.a and
22072 libdebug.a to be linked.  The program should be run on the target under
22073 the control of the GDB remote debugging stub.
22075 @item -msim
22076 @opindex msim
22077 A program which performs file I/O and is destined to run on the simulator
22078 should be linked with option.  This causes libraries libc.a and libsim.a to
22079 be linked.
22081 @item -mfpu
22082 @itemx -mhard-float
22083 @opindex mfpu
22084 @opindex mhard-float
22085 Generate code containing floating-point instructions.  This is the
22086 default.
22088 @item -mno-fpu
22089 @itemx -msoft-float
22090 @opindex mno-fpu
22091 @opindex msoft-float
22092 Generate code containing library calls for floating-point.
22094 @option{-msoft-float} changes the calling convention in the output file;
22095 therefore, it is only useful if you compile @emph{all} of a program with
22096 this option.  In particular, you need to compile @file{libgcc.a}, the
22097 library that comes with GCC, with @option{-msoft-float} in order for
22098 this to work.
22100 @item -mcpu=@var{cpu_type}
22101 @opindex mcpu
22102 Set the instruction set, register set, and instruction scheduling parameters
22103 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
22104 @samp{mcm}, @samp{gr5} and @samp{gr6}.
22106 @samp{mcm} is a synonym of @samp{gr5} present for backward compatibility.
22108 By default (unless configured otherwise), GCC generates code for the GR5
22109 variant of the Visium architecture.  
22111 With @option{-mcpu=gr6}, GCC generates code for the GR6 variant of the Visium
22112 architecture.  The only difference from GR5 code is that the compiler will
22113 generate block move instructions.
22115 @item -mtune=@var{cpu_type}
22116 @opindex mtune
22117 Set the instruction scheduling parameters for machine type @var{cpu_type},
22118 but do not set the instruction set or register set that the option
22119 @option{-mcpu=@var{cpu_type}} would.
22121 @item -msv-mode
22122 @opindex msv-mode
22123 Generate code for the supervisor mode, where there are no restrictions on
22124 the access to general registers.  This is the default.
22126 @item -muser-mode
22127 @opindex muser-mode
22128 Generate code for the user mode, where the access to some general registers
22129 is forbidden: on the GR5, registers r24 to r31 cannot be accessed in this
22130 mode; on the GR6, only registers r29 to r31 are affected.
22131 @end table
22133 @node VMS Options
22134 @subsection VMS Options
22136 These @samp{-m} options are defined for the VMS implementations:
22138 @table @gcctabopt
22139 @item -mvms-return-codes
22140 @opindex mvms-return-codes
22141 Return VMS condition codes from @code{main}. The default is to return POSIX-style
22142 condition (e.g.@ error) codes.
22144 @item -mdebug-main=@var{prefix}
22145 @opindex mdebug-main=@var{prefix}
22146 Flag the first routine whose name starts with @var{prefix} as the main
22147 routine for the debugger.
22149 @item -mmalloc64
22150 @opindex mmalloc64
22151 Default to 64-bit memory allocation routines.
22153 @item -mpointer-size=@var{size}
22154 @opindex mpointer-size=@var{size}
22155 Set the default size of pointers. Possible options for @var{size} are
22156 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
22157 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
22158 The later option disables @code{pragma pointer_size}.
22159 @end table
22161 @node VxWorks Options
22162 @subsection VxWorks Options
22163 @cindex VxWorks Options
22165 The options in this section are defined for all VxWorks targets.
22166 Options specific to the target hardware are listed with the other
22167 options for that target.
22169 @table @gcctabopt
22170 @item -mrtp
22171 @opindex mrtp
22172 GCC can generate code for both VxWorks kernels and real time processes
22173 (RTPs).  This option switches from the former to the latter.  It also
22174 defines the preprocessor macro @code{__RTP__}.
22176 @item -non-static
22177 @opindex non-static
22178 Link an RTP executable against shared libraries rather than static
22179 libraries.  The options @option{-static} and @option{-shared} can
22180 also be used for RTPs (@pxref{Link Options}); @option{-static}
22181 is the default.
22183 @item -Bstatic
22184 @itemx -Bdynamic
22185 @opindex Bstatic
22186 @opindex Bdynamic
22187 These options are passed down to the linker.  They are defined for
22188 compatibility with Diab.
22190 @item -Xbind-lazy
22191 @opindex Xbind-lazy
22192 Enable lazy binding of function calls.  This option is equivalent to
22193 @option{-Wl,-z,now} and is defined for compatibility with Diab.
22195 @item -Xbind-now
22196 @opindex Xbind-now
22197 Disable lazy binding of function calls.  This option is the default and
22198 is defined for compatibility with Diab.
22199 @end table
22201 @node x86 Options
22202 @subsection x86 Options
22203 @cindex x86 Options
22205 These @samp{-m} options are defined for the x86 family of computers.
22207 @table @gcctabopt
22209 @item -march=@var{cpu-type}
22210 @opindex march
22211 Generate instructions for the machine type @var{cpu-type}.  In contrast to
22212 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
22213 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
22214 to generate code that may not run at all on processors other than the one
22215 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
22216 @option{-mtune=@var{cpu-type}}.
22218 The choices for @var{cpu-type} are:
22220 @table @samp
22221 @item native
22222 This selects the CPU to generate code for at compilation time by determining
22223 the processor type of the compiling machine.  Using @option{-march=native}
22224 enables all instruction subsets supported by the local machine (hence
22225 the result might not run on different machines).  Using @option{-mtune=native}
22226 produces code optimized for the local machine under the constraints
22227 of the selected instruction set.  
22229 @item i386
22230 Original Intel i386 CPU@.
22232 @item i486
22233 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
22235 @item i586
22236 @itemx pentium
22237 Intel Pentium CPU with no MMX support.
22239 @item iamcu
22240 Intel MCU, based on Intel Pentium CPU.
22242 @item pentium-mmx
22243 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
22245 @item pentiumpro
22246 Intel Pentium Pro CPU@.
22248 @item i686
22249 When used with @option{-march}, the Pentium Pro
22250 instruction set is used, so the code runs on all i686 family chips.
22251 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
22253 @item pentium2
22254 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
22255 support.
22257 @item pentium3
22258 @itemx pentium3m
22259 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
22260 set support.
22262 @item pentium-m
22263 Intel Pentium M; low-power version of Intel Pentium III CPU
22264 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
22266 @item pentium4
22267 @itemx pentium4m
22268 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
22270 @item prescott
22271 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
22272 set support.
22274 @item nocona
22275 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
22276 SSE2 and SSE3 instruction set support.
22278 @item core2
22279 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
22280 instruction set support.
22282 @item nehalem
22283 Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
22284 SSE4.1, SSE4.2 and POPCNT instruction set support.
22286 @item westmere
22287 Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
22288 SSE4.1, SSE4.2, POPCNT, AES and PCLMUL instruction set support.
22290 @item sandybridge
22291 Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
22292 SSE4.1, SSE4.2, POPCNT, AVX, AES and PCLMUL instruction set support.
22294 @item ivybridge
22295 Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
22296 SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C
22297 instruction set support.
22299 @item haswell
22300 Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
22301 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
22302 BMI, BMI2 and F16C instruction set support.
22304 @item broadwell
22305 Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
22306 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
22307 BMI, BMI2, F16C, RDSEED, ADCX and PREFETCHW instruction set support.
22309 @item bonnell
22310 Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
22311 instruction set support.
22313 @item silvermont
22314 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
22315 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL and RDRND instruction set support.
22317 @item knl
22318 Intel Knight's Landing CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
22319 SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
22320 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER and
22321 AVX512CD instruction set support.
22323 @item k6
22324 AMD K6 CPU with MMX instruction set support.
22326 @item k6-2
22327 @itemx k6-3
22328 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
22330 @item athlon
22331 @itemx athlon-tbird
22332 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
22333 support.
22335 @item athlon-4
22336 @itemx athlon-xp
22337 @itemx athlon-mp
22338 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
22339 instruction set support.
22341 @item k8
22342 @itemx opteron
22343 @itemx athlon64
22344 @itemx athlon-fx
22345 Processors based on the AMD K8 core with x86-64 instruction set support,
22346 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
22347 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
22348 instruction set extensions.)
22350 @item k8-sse3
22351 @itemx opteron-sse3
22352 @itemx athlon64-sse3
22353 Improved versions of AMD K8 cores with SSE3 instruction set support.
22355 @item amdfam10
22356 @itemx barcelona
22357 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
22358 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
22359 instruction set extensions.)
22361 @item bdver1
22362 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
22363 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
22364 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
22365 @item bdver2
22366 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
22367 supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX,
22368 SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
22369 extensions.)
22370 @item bdver3
22371 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
22372 supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, XOP, LWP, AES, 
22373 PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 
22374 64-bit instruction set extensions.
22375 @item bdver4
22376 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
22377 supersets BMI, BMI2, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, AVX2, XOP, LWP, 
22378 AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, 
22379 SSE4.2, ABM and 64-bit instruction set extensions.
22381 @item btver1
22382 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
22383 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
22384 instruction set extensions.)
22386 @item btver2
22387 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
22388 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
22389 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
22391 @item winchip-c6
22392 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
22393 set support.
22395 @item winchip2
22396 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
22397 instruction set support.
22399 @item c3
22400 VIA C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
22401 implemented for this chip.)
22403 @item c3-2
22404 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
22405 (No scheduling is
22406 implemented for this chip.)
22408 @item geode
22409 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
22410 @end table
22412 @item -mtune=@var{cpu-type}
22413 @opindex mtune
22414 Tune to @var{cpu-type} everything applicable about the generated code, except
22415 for the ABI and the set of available instructions.  
22416 While picking a specific @var{cpu-type} schedules things appropriately
22417 for that particular chip, the compiler does not generate any code that
22418 cannot run on the default machine type unless you use a
22419 @option{-march=@var{cpu-type}} option.
22420 For example, if GCC is configured for i686-pc-linux-gnu
22421 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
22422 but still runs on i686 machines.
22424 The choices for @var{cpu-type} are the same as for @option{-march}.
22425 In addition, @option{-mtune} supports 2 extra choices for @var{cpu-type}:
22427 @table @samp
22428 @item generic
22429 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
22430 If you know the CPU on which your code will run, then you should use
22431 the corresponding @option{-mtune} or @option{-march} option instead of
22432 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
22433 of your application will have, then you should use this option.
22435 As new processors are deployed in the marketplace, the behavior of this
22436 option will change.  Therefore, if you upgrade to a newer version of
22437 GCC, code generation controlled by this option will change to reflect
22438 the processors
22439 that are most common at the time that version of GCC is released.
22441 There is no @option{-march=generic} option because @option{-march}
22442 indicates the instruction set the compiler can use, and there is no
22443 generic instruction set applicable to all processors.  In contrast,
22444 @option{-mtune} indicates the processor (or, in this case, collection of
22445 processors) for which the code is optimized.
22447 @item intel
22448 Produce code optimized for the most current Intel processors, which are
22449 Haswell and Silvermont for this version of GCC.  If you know the CPU
22450 on which your code will run, then you should use the corresponding
22451 @option{-mtune} or @option{-march} option instead of @option{-mtune=intel}.
22452 But, if you want your application performs better on both Haswell and
22453 Silvermont, then you should use this option.
22455 As new Intel processors are deployed in the marketplace, the behavior of
22456 this option will change.  Therefore, if you upgrade to a newer version of
22457 GCC, code generation controlled by this option will change to reflect
22458 the most current Intel processors at the time that version of GCC is
22459 released.
22461 There is no @option{-march=intel} option because @option{-march} indicates
22462 the instruction set the compiler can use, and there is no common
22463 instruction set applicable to all processors.  In contrast,
22464 @option{-mtune} indicates the processor (or, in this case, collection of
22465 processors) for which the code is optimized.
22466 @end table
22468 @item -mcpu=@var{cpu-type}
22469 @opindex mcpu
22470 A deprecated synonym for @option{-mtune}.
22472 @item -mfpmath=@var{unit}
22473 @opindex mfpmath
22474 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
22475 for @var{unit} are:
22477 @table @samp
22478 @item 387
22479 Use the standard 387 floating-point coprocessor present on the majority of chips and
22480 emulated otherwise.  Code compiled with this option runs almost everywhere.
22481 The temporary results are computed in 80-bit precision instead of the precision
22482 specified by the type, resulting in slightly different results compared to most
22483 of other chips.  See @option{-ffloat-store} for more detailed description.
22485 This is the default choice for x86-32 targets.
22487 @item sse
22488 Use scalar floating-point instructions present in the SSE instruction set.
22489 This instruction set is supported by Pentium III and newer chips,
22490 and in the AMD line
22491 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
22492 instruction set supports only single-precision arithmetic, thus the double and
22493 extended-precision arithmetic are still done using 387.  A later version, present
22494 only in Pentium 4 and AMD x86-64 chips, supports double-precision
22495 arithmetic too.
22497 For the x86-32 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
22498 or @option{-msse2} switches to enable SSE extensions and make this option
22499 effective.  For the x86-64 compiler, these extensions are enabled by default.
22501 The resulting code should be considerably faster in the majority of cases and avoid
22502 the numerical instability problems of 387 code, but may break some existing
22503 code that expects temporaries to be 80 bits.
22505 This is the default choice for the x86-64 compiler.
22507 @item sse,387
22508 @itemx sse+387
22509 @itemx both
22510 Attempt to utilize both instruction sets at once.  This effectively doubles the
22511 amount of available registers, and on chips with separate execution units for
22512 387 and SSE the execution resources too.  Use this option with care, as it is
22513 still experimental, because the GCC register allocator does not model separate
22514 functional units well, resulting in unstable performance.
22515 @end table
22517 @item -masm=@var{dialect}
22518 @opindex masm=@var{dialect}
22519 Output assembly instructions using selected @var{dialect}.  Also affects
22520 which dialect is used for basic @code{asm} (@pxref{Basic Asm}) and
22521 extended @code{asm} (@pxref{Extended Asm}). Supported choices (in dialect
22522 order) are @samp{att} or @samp{intel}. The default is @samp{att}. Darwin does
22523 not support @samp{intel}.
22525 @item -mieee-fp
22526 @itemx -mno-ieee-fp
22527 @opindex mieee-fp
22528 @opindex mno-ieee-fp
22529 Control whether or not the compiler uses IEEE floating-point
22530 comparisons.  These correctly handle the case where the result of a
22531 comparison is unordered.
22533 @item -msoft-float
22534 @opindex msoft-float
22535 Generate output containing library calls for floating point.
22537 @strong{Warning:} the requisite libraries are not part of GCC@.
22538 Normally the facilities of the machine's usual C compiler are used, but
22539 this can't be done directly in cross-compilation.  You must make your
22540 own arrangements to provide suitable library functions for
22541 cross-compilation.
22543 On machines where a function returns floating-point results in the 80387
22544 register stack, some floating-point opcodes may be emitted even if
22545 @option{-msoft-float} is used.
22547 @item -mno-fp-ret-in-387
22548 @opindex mno-fp-ret-in-387
22549 Do not use the FPU registers for return values of functions.
22551 The usual calling convention has functions return values of types
22552 @code{float} and @code{double} in an FPU register, even if there
22553 is no FPU@.  The idea is that the operating system should emulate
22554 an FPU@.
22556 The option @option{-mno-fp-ret-in-387} causes such values to be returned
22557 in ordinary CPU registers instead.
22559 @item -mno-fancy-math-387
22560 @opindex mno-fancy-math-387
22561 Some 387 emulators do not support the @code{sin}, @code{cos} and
22562 @code{sqrt} instructions for the 387.  Specify this option to avoid
22563 generating those instructions.  This option is the default on
22564 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
22565 indicates that the target CPU always has an FPU and so the
22566 instruction does not need emulation.  These
22567 instructions are not generated unless you also use the
22568 @option{-funsafe-math-optimizations} switch.
22570 @item -malign-double
22571 @itemx -mno-align-double
22572 @opindex malign-double
22573 @opindex mno-align-double
22574 Control whether GCC aligns @code{double}, @code{long double}, and
22575 @code{long long} variables on a two-word boundary or a one-word
22576 boundary.  Aligning @code{double} variables on a two-word boundary
22577 produces code that runs somewhat faster on a Pentium at the
22578 expense of more memory.
22580 On x86-64, @option{-malign-double} is enabled by default.
22582 @strong{Warning:} if you use the @option{-malign-double} switch,
22583 structures containing the above types are aligned differently than
22584 the published application binary interface specifications for the x86-32
22585 and are not binary compatible with structures in code compiled
22586 without that switch.
22588 @item -m96bit-long-double
22589 @itemx -m128bit-long-double
22590 @opindex m96bit-long-double
22591 @opindex m128bit-long-double
22592 These switches control the size of @code{long double} type.  The x86-32
22593 application binary interface specifies the size to be 96 bits,
22594 so @option{-m96bit-long-double} is the default in 32-bit mode.
22596 Modern architectures (Pentium and newer) prefer @code{long double}
22597 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
22598 conforming to the ABI, this is not possible.  So specifying
22599 @option{-m128bit-long-double} aligns @code{long double}
22600 to a 16-byte boundary by padding the @code{long double} with an additional
22601 32-bit zero.
22603 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
22604 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
22606 Notice that neither of these options enable any extra precision over the x87
22607 standard of 80 bits for a @code{long double}.
22609 @strong{Warning:} if you override the default value for your target ABI, this
22610 changes the size of 
22611 structures and arrays containing @code{long double} variables,
22612 as well as modifying the function calling convention for functions taking
22613 @code{long double}.  Hence they are not binary-compatible
22614 with code compiled without that switch.
22616 @item -mlong-double-64
22617 @itemx -mlong-double-80
22618 @itemx -mlong-double-128
22619 @opindex mlong-double-64
22620 @opindex mlong-double-80
22621 @opindex mlong-double-128
22622 These switches control the size of @code{long double} type. A size
22623 of 64 bits makes the @code{long double} type equivalent to the @code{double}
22624 type. This is the default for 32-bit Bionic C library.  A size
22625 of 128 bits makes the @code{long double} type equivalent to the
22626 @code{__float128} type. This is the default for 64-bit Bionic C library.
22628 @strong{Warning:} if you override the default value for your target ABI, this
22629 changes the size of
22630 structures and arrays containing @code{long double} variables,
22631 as well as modifying the function calling convention for functions taking
22632 @code{long double}.  Hence they are not binary-compatible
22633 with code compiled without that switch.
22635 @item -malign-data=@var{type}
22636 @opindex malign-data
22637 Control how GCC aligns variables.  Supported values for @var{type} are
22638 @samp{compat} uses increased alignment value compatible uses GCC 4.8
22639 and earlier, @samp{abi} uses alignment value as specified by the
22640 psABI, and @samp{cacheline} uses increased alignment value to match
22641 the cache line size.  @samp{compat} is the default.
22643 @item -mlarge-data-threshold=@var{threshold}
22644 @opindex mlarge-data-threshold
22645 When @option{-mcmodel=medium} is specified, data objects larger than
22646 @var{threshold} are placed in the large data section.  This value must be the
22647 same across all objects linked into the binary, and defaults to 65535.
22649 @item -mrtd
22650 @opindex mrtd
22651 Use a different function-calling convention, in which functions that
22652 take a fixed number of arguments return with the @code{ret @var{num}}
22653 instruction, which pops their arguments while returning.  This saves one
22654 instruction in the caller since there is no need to pop the arguments
22655 there.
22657 You can specify that an individual function is called with this calling
22658 sequence with the function attribute @code{stdcall}.  You can also
22659 override the @option{-mrtd} option by using the function attribute
22660 @code{cdecl}.  @xref{Function Attributes}.
22662 @strong{Warning:} this calling convention is incompatible with the one
22663 normally used on Unix, so you cannot use it if you need to call
22664 libraries compiled with the Unix compiler.
22666 Also, you must provide function prototypes for all functions that
22667 take variable numbers of arguments (including @code{printf});
22668 otherwise incorrect code is generated for calls to those
22669 functions.
22671 In addition, seriously incorrect code results if you call a
22672 function with too many arguments.  (Normally, extra arguments are
22673 harmlessly ignored.)
22675 @item -mregparm=@var{num}
22676 @opindex mregparm
22677 Control how many registers are used to pass integer arguments.  By
22678 default, no registers are used to pass arguments, and at most 3
22679 registers can be used.  You can control this behavior for a specific
22680 function by using the function attribute @code{regparm}.
22681 @xref{Function Attributes}.
22683 @strong{Warning:} if you use this switch, and
22684 @var{num} is nonzero, then you must build all modules with the same
22685 value, including any libraries.  This includes the system libraries and
22686 startup modules.
22688 @item -msseregparm
22689 @opindex msseregparm
22690 Use SSE register passing conventions for float and double arguments
22691 and return values.  You can control this behavior for a specific
22692 function by using the function attribute @code{sseregparm}.
22693 @xref{Function Attributes}.
22695 @strong{Warning:} if you use this switch then you must build all
22696 modules with the same value, including any libraries.  This includes
22697 the system libraries and startup modules.
22699 @item -mvect8-ret-in-mem
22700 @opindex mvect8-ret-in-mem
22701 Return 8-byte vectors in memory instead of MMX registers.  This is the
22702 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
22703 Studio compilers until version 12.  Later compiler versions (starting
22704 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
22705 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
22706 you need to remain compatible with existing code produced by those
22707 previous compiler versions or older versions of GCC@.
22709 @item -mpc32
22710 @itemx -mpc64
22711 @itemx -mpc80
22712 @opindex mpc32
22713 @opindex mpc64
22714 @opindex mpc80
22716 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
22717 is specified, the significands of results of floating-point operations are
22718 rounded to 24 bits (single precision); @option{-mpc64} rounds the
22719 significands of results of floating-point operations to 53 bits (double
22720 precision) and @option{-mpc80} rounds the significands of results of
22721 floating-point operations to 64 bits (extended double precision), which is
22722 the default.  When this option is used, floating-point operations in higher
22723 precisions are not available to the programmer without setting the FPU
22724 control word explicitly.
22726 Setting the rounding of floating-point operations to less than the default
22727 80 bits can speed some programs by 2% or more.  Note that some mathematical
22728 libraries assume that extended-precision (80-bit) floating-point operations
22729 are enabled by default; routines in such libraries could suffer significant
22730 loss of accuracy, typically through so-called ``catastrophic cancellation'',
22731 when this option is used to set the precision to less than extended precision.
22733 @item -mstackrealign
22734 @opindex mstackrealign
22735 Realign the stack at entry.  On the x86, the @option{-mstackrealign}
22736 option generates an alternate prologue and epilogue that realigns the
22737 run-time stack if necessary.  This supports mixing legacy codes that keep
22738 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
22739 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
22740 applicable to individual functions.
22742 @item -mpreferred-stack-boundary=@var{num}
22743 @opindex mpreferred-stack-boundary
22744 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
22745 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
22746 the default is 4 (16 bytes or 128 bits).
22748 @strong{Warning:} When generating code for the x86-64 architecture with
22749 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
22750 used to keep the stack boundary aligned to 8 byte boundary.  Since
22751 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
22752 intended to be used in controlled environment where stack space is
22753 important limitation.  This option leads to wrong code when functions
22754 compiled with 16 byte stack alignment (such as functions from a standard
22755 library) are called with misaligned stack.  In this case, SSE
22756 instructions may lead to misaligned memory access traps.  In addition,
22757 variable arguments are handled incorrectly for 16 byte aligned
22758 objects (including x87 long double and __int128), leading to wrong
22759 results.  You must build all modules with
22760 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
22761 includes the system libraries and startup modules.
22763 @item -mincoming-stack-boundary=@var{num}
22764 @opindex mincoming-stack-boundary
22765 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
22766 boundary.  If @option{-mincoming-stack-boundary} is not specified,
22767 the one specified by @option{-mpreferred-stack-boundary} is used.
22769 On Pentium and Pentium Pro, @code{double} and @code{long double} values
22770 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
22771 suffer significant run time performance penalties.  On Pentium III, the
22772 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
22773 properly if it is not 16-byte aligned.
22775 To ensure proper alignment of this values on the stack, the stack boundary
22776 must be as aligned as that required by any value stored on the stack.
22777 Further, every function must be generated such that it keeps the stack
22778 aligned.  Thus calling a function compiled with a higher preferred
22779 stack boundary from a function compiled with a lower preferred stack
22780 boundary most likely misaligns the stack.  It is recommended that
22781 libraries that use callbacks always use the default setting.
22783 This extra alignment does consume extra stack space, and generally
22784 increases code size.  Code that is sensitive to stack space usage, such
22785 as embedded systems and operating system kernels, may want to reduce the
22786 preferred alignment to @option{-mpreferred-stack-boundary=2}.
22788 @need 200
22789 @item -mmmx
22790 @opindex mmmx
22791 @need 200
22792 @itemx -msse
22793 @opindex msse
22794 @need 200
22795 @itemx -msse2
22796 @need 200
22797 @itemx -msse3
22798 @need 200
22799 @itemx -mssse3
22800 @need 200
22801 @itemx -msse4
22802 @need 200
22803 @itemx -msse4a
22804 @need 200
22805 @itemx -msse4.1
22806 @need 200
22807 @itemx -msse4.2
22808 @need 200
22809 @itemx -mavx
22810 @opindex mavx
22811 @need 200
22812 @itemx -mavx2
22813 @need 200
22814 @itemx -mavx512f
22815 @need 200
22816 @itemx -mavx512pf
22817 @need 200
22818 @itemx -mavx512er
22819 @need 200
22820 @itemx -mavx512cd
22821 @need 200
22822 @itemx -msha
22823 @opindex msha
22824 @need 200
22825 @itemx -maes
22826 @opindex maes
22827 @need 200
22828 @itemx -mpclmul
22829 @opindex mpclmul
22830 @need 200
22831 @itemx -mclfushopt
22832 @opindex mclfushopt
22833 @need 200
22834 @itemx -mfsgsbase
22835 @opindex mfsgsbase
22836 @need 200
22837 @itemx -mrdrnd
22838 @opindex mrdrnd
22839 @need 200
22840 @itemx -mf16c
22841 @opindex mf16c
22842 @need 200
22843 @itemx -mfma
22844 @opindex mfma
22845 @need 200
22846 @itemx -mfma4
22847 @need 200
22848 @itemx -mno-fma4
22849 @need 200
22850 @itemx -mprefetchwt1
22851 @opindex mprefetchwt1
22852 @need 200
22853 @itemx -mxop
22854 @opindex mxop
22855 @need 200
22856 @itemx -mlwp
22857 @opindex mlwp
22858 @need 200
22859 @itemx -m3dnow
22860 @opindex m3dnow
22861 @need 200
22862 @itemx -mpopcnt
22863 @opindex mpopcnt
22864 @need 200
22865 @itemx -mabm
22866 @opindex mabm
22867 @need 200
22868 @itemx -mbmi
22869 @opindex mbmi
22870 @need 200
22871 @itemx -mbmi2
22872 @need 200
22873 @itemx -mlzcnt
22874 @opindex mlzcnt
22875 @need 200
22876 @itemx -mfxsr
22877 @opindex mfxsr
22878 @need 200
22879 @itemx -mxsave
22880 @opindex mxsave
22881 @need 200
22882 @itemx -mxsaveopt
22883 @opindex mxsaveopt
22884 @need 200
22885 @itemx -mxsavec
22886 @opindex mxsavec
22887 @need 200
22888 @itemx -mxsaves
22889 @opindex mxsaves
22890 @need 200
22891 @itemx -mrtm
22892 @opindex mrtm
22893 @need 200
22894 @itemx -mtbm
22895 @opindex mtbm
22896 @need 200
22897 @itemx -mmpx
22898 @opindex mmpx
22899 @need 200
22900 @itemx -mmwaitx
22901 @opindex mmwaitx
22902 These switches enable the use of instructions in the MMX, SSE,
22903 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER, AVX512CD,
22904 SHA, AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A, FMA4, XOP, LWP, ABM,
22905 BMI, BMI2, FXSR, XSAVE, XSAVEOPT, LZCNT, RTM, MPX, MWAITX or 3DNow!@:
22906 extended instruction sets.  Each has a corresponding @option{-mno-} option
22907 to disable use of these instructions.
22909 These extensions are also available as built-in functions: see
22910 @ref{x86 Built-in Functions}, for details of the functions enabled and
22911 disabled by these switches.
22913 To generate SSE/SSE2 instructions automatically from floating-point
22914 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
22916 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
22917 generates new AVX instructions or AVX equivalence for all SSEx instructions
22918 when needed.
22920 These options enable GCC to use these extended instructions in
22921 generated code, even without @option{-mfpmath=sse}.  Applications that
22922 perform run-time CPU detection must compile separate files for each
22923 supported architecture, using the appropriate flags.  In particular,
22924 the file containing the CPU detection code should be compiled without
22925 these options.
22927 @item -mdump-tune-features
22928 @opindex mdump-tune-features
22929 This option instructs GCC to dump the names of the x86 performance 
22930 tuning features and default settings. The names can be used in 
22931 @option{-mtune-ctrl=@var{feature-list}}.
22933 @item -mtune-ctrl=@var{feature-list}
22934 @opindex mtune-ctrl=@var{feature-list}
22935 This option is used to do fine grain control of x86 code generation features.
22936 @var{feature-list} is a comma separated list of @var{feature} names. See also
22937 @option{-mdump-tune-features}. When specified, the @var{feature} is turned
22938 on if it is not preceded with @samp{^}, otherwise, it is turned off. 
22939 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
22940 developers. Using it may lead to code paths not covered by testing and can
22941 potentially result in compiler ICEs or runtime errors.
22943 @item -mno-default
22944 @opindex mno-default
22945 This option instructs GCC to turn off all tunable features. See also 
22946 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
22948 @item -mcld
22949 @opindex mcld
22950 This option instructs GCC to emit a @code{cld} instruction in the prologue
22951 of functions that use string instructions.  String instructions depend on
22952 the DF flag to select between autoincrement or autodecrement mode.  While the
22953 ABI specifies the DF flag to be cleared on function entry, some operating
22954 systems violate this specification by not clearing the DF flag in their
22955 exception dispatchers.  The exception handler can be invoked with the DF flag
22956 set, which leads to wrong direction mode when string instructions are used.
22957 This option can be enabled by default on 32-bit x86 targets by configuring
22958 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
22959 instructions can be suppressed with the @option{-mno-cld} compiler option
22960 in this case.
22962 @item -mvzeroupper
22963 @opindex mvzeroupper
22964 This option instructs GCC to emit a @code{vzeroupper} instruction
22965 before a transfer of control flow out of the function to minimize
22966 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
22967 intrinsics.
22969 @item -mprefer-avx128
22970 @opindex mprefer-avx128
22971 This option instructs GCC to use 128-bit AVX instructions instead of
22972 256-bit AVX instructions in the auto-vectorizer.
22974 @item -mcx16
22975 @opindex mcx16
22976 This option enables GCC to generate @code{CMPXCHG16B} instructions.
22977 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
22978 (or oword) data types.  
22979 This is useful for high-resolution counters that can be updated
22980 by multiple processors (or cores).  This instruction is generated as part of
22981 atomic built-in functions: see @ref{__sync Builtins} or
22982 @ref{__atomic Builtins} for details.
22984 @item -msahf
22985 @opindex msahf
22986 This option enables generation of @code{SAHF} instructions in 64-bit code.
22987 Early Intel Pentium 4 CPUs with Intel 64 support,
22988 prior to the introduction of Pentium 4 G1 step in December 2005,
22989 lacked the @code{LAHF} and @code{SAHF} instructions
22990 which are supported by AMD64.
22991 These are load and store instructions, respectively, for certain status flags.
22992 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
22993 @code{drem}, and @code{remainder} built-in functions;
22994 see @ref{Other Builtins} for details.
22996 @item -mmovbe
22997 @opindex mmovbe
22998 This option enables use of the @code{movbe} instruction to implement
22999 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
23001 @item -mcrc32
23002 @opindex mcrc32
23003 This option enables built-in functions @code{__builtin_ia32_crc32qi},
23004 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
23005 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
23007 @item -mrecip
23008 @opindex mrecip
23009 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
23010 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
23011 with an additional Newton-Raphson step
23012 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
23013 (and their vectorized
23014 variants) for single-precision floating-point arguments.  These instructions
23015 are generated only when @option{-funsafe-math-optimizations} is enabled
23016 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
23017 Note that while the throughput of the sequence is higher than the throughput
23018 of the non-reciprocal instruction, the precision of the sequence can be
23019 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
23021 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
23022 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
23023 combination), and doesn't need @option{-mrecip}.
23025 Also note that GCC emits the above sequence with additional Newton-Raphson step
23026 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
23027 already with @option{-ffast-math} (or the above option combination), and
23028 doesn't need @option{-mrecip}.
23030 @item -mrecip=@var{opt}
23031 @opindex mrecip=opt
23032 This option controls which reciprocal estimate instructions
23033 may be used.  @var{opt} is a comma-separated list of options, which may
23034 be preceded by a @samp{!} to invert the option:
23036 @table @samp
23037 @item all
23038 Enable all estimate instructions.
23040 @item default
23041 Enable the default instructions, equivalent to @option{-mrecip}.
23043 @item none
23044 Disable all estimate instructions, equivalent to @option{-mno-recip}.
23046 @item div
23047 Enable the approximation for scalar division.
23049 @item vec-div
23050 Enable the approximation for vectorized division.
23052 @item sqrt
23053 Enable the approximation for scalar square root.
23055 @item vec-sqrt
23056 Enable the approximation for vectorized square root.
23057 @end table
23059 So, for example, @option{-mrecip=all,!sqrt} enables
23060 all of the reciprocal approximations, except for square root.
23062 @item -mveclibabi=@var{type}
23063 @opindex mveclibabi
23064 Specifies the ABI type to use for vectorizing intrinsics using an
23065 external library.  Supported values for @var{type} are @samp{svml} 
23066 for the Intel short
23067 vector math library and @samp{acml} for the AMD math core library.
23068 To use this option, both @option{-ftree-vectorize} and
23069 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
23070 ABI-compatible library must be specified at link time.
23072 GCC currently emits calls to @code{vmldExp2},
23073 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
23074 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
23075 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
23076 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
23077 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
23078 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
23079 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
23080 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
23081 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
23082 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
23083 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
23084 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
23085 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
23086 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
23087 when @option{-mveclibabi=acml} is used.  
23089 @item -mabi=@var{name}
23090 @opindex mabi
23091 Generate code for the specified calling convention.  Permissible values
23092 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
23093 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
23094 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
23095 You can control this behavior for specific functions by
23096 using the function attributes @code{ms_abi} and @code{sysv_abi}.
23097 @xref{Function Attributes}.
23099 @item -mtls-dialect=@var{type}
23100 @opindex mtls-dialect
23101 Generate code to access thread-local storage using the @samp{gnu} or
23102 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
23103 @samp{gnu2} is more efficient, but it may add compile- and run-time
23104 requirements that cannot be satisfied on all systems.
23106 @item -mpush-args
23107 @itemx -mno-push-args
23108 @opindex mpush-args
23109 @opindex mno-push-args
23110 Use PUSH operations to store outgoing parameters.  This method is shorter
23111 and usually equally fast as method using SUB/MOV operations and is enabled
23112 by default.  In some cases disabling it may improve performance because of
23113 improved scheduling and reduced dependencies.
23115 @item -maccumulate-outgoing-args
23116 @opindex maccumulate-outgoing-args
23117 If enabled, the maximum amount of space required for outgoing arguments is
23118 computed in the function prologue.  This is faster on most modern CPUs
23119 because of reduced dependencies, improved scheduling and reduced stack usage
23120 when the preferred stack boundary is not equal to 2.  The drawback is a notable
23121 increase in code size.  This switch implies @option{-mno-push-args}.
23123 @item -mthreads
23124 @opindex mthreads
23125 Support thread-safe exception handling on MinGW.  Programs that rely
23126 on thread-safe exception handling must compile and link all code with the
23127 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
23128 @option{-D_MT}; when linking, it links in a special thread helper library
23129 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
23131 @item -mno-align-stringops
23132 @opindex mno-align-stringops
23133 Do not align the destination of inlined string operations.  This switch reduces
23134 code size and improves performance in case the destination is already aligned,
23135 but GCC doesn't know about it.
23137 @item -minline-all-stringops
23138 @opindex minline-all-stringops
23139 By default GCC inlines string operations only when the destination is 
23140 known to be aligned to least a 4-byte boundary.  
23141 This enables more inlining and increases code
23142 size, but may improve performance of code that depends on fast
23143 @code{memcpy}, @code{strlen},
23144 and @code{memset} for short lengths.
23146 @item -minline-stringops-dynamically
23147 @opindex minline-stringops-dynamically
23148 For string operations of unknown size, use run-time checks with
23149 inline code for small blocks and a library call for large blocks.
23151 @item -mstringop-strategy=@var{alg}
23152 @opindex mstringop-strategy=@var{alg}
23153 Override the internal decision heuristic for the particular algorithm to use
23154 for inlining string operations.  The allowed values for @var{alg} are:
23156 @table @samp
23157 @item rep_byte
23158 @itemx rep_4byte
23159 @itemx rep_8byte
23160 Expand using i386 @code{rep} prefix of the specified size.
23162 @item byte_loop
23163 @itemx loop
23164 @itemx unrolled_loop
23165 Expand into an inline loop.
23167 @item libcall
23168 Always use a library call.
23169 @end table
23171 @item -mmemcpy-strategy=@var{strategy}
23172 @opindex mmemcpy-strategy=@var{strategy}
23173 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
23174 should be inlined and what inline algorithm to use when the expected size
23175 of the copy operation is known. @var{strategy} 
23176 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
23177 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
23178 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
23179 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
23180 in the list must be specified in increasing order.  The minimal byte size for 
23181 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
23182 preceding range.
23184 @item -mmemset-strategy=@var{strategy}
23185 @opindex mmemset-strategy=@var{strategy}
23186 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
23187 @code{__builtin_memset} expansion.
23189 @item -momit-leaf-frame-pointer
23190 @opindex momit-leaf-frame-pointer
23191 Don't keep the frame pointer in a register for leaf functions.  This
23192 avoids the instructions to save, set up, and restore frame pointers and
23193 makes an extra register available in leaf functions.  The option
23194 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
23195 which might make debugging harder.
23197 @item -mtls-direct-seg-refs
23198 @itemx -mno-tls-direct-seg-refs
23199 @opindex mtls-direct-seg-refs
23200 Controls whether TLS variables may be accessed with offsets from the
23201 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
23202 or whether the thread base pointer must be added.  Whether or not this
23203 is valid depends on the operating system, and whether it maps the
23204 segment to cover the entire TLS area.
23206 For systems that use the GNU C Library, the default is on.
23208 @item -msse2avx
23209 @itemx -mno-sse2avx
23210 @opindex msse2avx
23211 Specify that the assembler should encode SSE instructions with VEX
23212 prefix.  The option @option{-mavx} turns this on by default.
23214 @item -mfentry
23215 @itemx -mno-fentry
23216 @opindex mfentry
23217 If profiling is active (@option{-pg}), put the profiling
23218 counter call before the prologue.
23219 Note: On x86 architectures the attribute @code{ms_hook_prologue}
23220 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
23222 @item -mrecord-mcount
23223 @itemx -mno-record-mcount
23224 @opindex mrecord-mcount
23225 If profiling is active (@option{-pg}), generate a __mcount_loc section
23226 that contains pointers to each profiling call. This is useful for
23227 automatically patching and out calls.
23229 @item -mnop-mcount
23230 @itemx -mno-nop-mcount
23231 @opindex mnop-mcount
23232 If profiling is active (@option{-pg}), generate the calls to
23233 the profiling functions as nops. This is useful when they
23234 should be patched in later dynamically. This is likely only
23235 useful together with @option{-mrecord-mcount}.
23237 @item -mskip-rax-setup
23238 @itemx -mno-skip-rax-setup
23239 @opindex mskip-rax-setup
23240 When generating code for the x86-64 architecture with SSE extensions
23241 disabled, @option{-skip-rax-setup} can be used to skip setting up RAX
23242 register when there are no variable arguments passed in vector registers.
23244 @strong{Warning:} Since RAX register is used to avoid unnecessarily
23245 saving vector registers on stack when passing variable arguments, the
23246 impacts of this option are callees may waste some stack space,
23247 misbehave or jump to a random location.  GCC 4.4 or newer don't have
23248 those issues, regardless the RAX register value.
23250 @item -m8bit-idiv
23251 @itemx -mno-8bit-idiv
23252 @opindex m8bit-idiv
23253 On some processors, like Intel Atom, 8-bit unsigned integer divide is
23254 much faster than 32-bit/64-bit integer divide.  This option generates a
23255 run-time check.  If both dividend and divisor are within range of 0
23256 to 255, 8-bit unsigned integer divide is used instead of
23257 32-bit/64-bit integer divide.
23259 @item -mavx256-split-unaligned-load
23260 @itemx -mavx256-split-unaligned-store
23261 @opindex mavx256-split-unaligned-load
23262 @opindex mavx256-split-unaligned-store
23263 Split 32-byte AVX unaligned load and store.
23265 @item -mstack-protector-guard=@var{guard}
23266 @opindex mstack-protector-guard=@var{guard}
23267 Generate stack protection code using canary at @var{guard}.  Supported
23268 locations are @samp{global} for global canary or @samp{tls} for per-thread
23269 canary in the TLS block (the default).  This option has effect only when
23270 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
23272 @end table
23274 These @samp{-m} switches are supported in addition to the above
23275 on x86-64 processors in 64-bit environments.
23277 @table @gcctabopt
23278 @item -m32
23279 @itemx -m64
23280 @itemx -mx32
23281 @itemx -m16
23282 @itemx -miamcu
23283 @opindex m32
23284 @opindex m64
23285 @opindex mx32
23286 @opindex m16
23287 @opindex miamcu
23288 Generate code for a 16-bit, 32-bit or 64-bit environment.
23289 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
23290 to 32 bits, and
23291 generates code that runs on any i386 system.
23293 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
23294 types to 64 bits, and generates code for the x86-64 architecture.
23295 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
23296 and @option{-mdynamic-no-pic} options.
23298 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
23299 to 32 bits, and
23300 generates code for the x86-64 architecture.
23302 The @option{-m16} option is the same as @option{-m32}, except for that
23303 it outputs the @code{.code16gcc} assembly directive at the beginning of
23304 the assembly output so that the binary can run in 16-bit mode.
23306 The @option{-miamcu} option generates code which conforms to Intel MCU
23307 psABI.  It requires the @option{-m32} option to be turned on.
23309 @item -mno-red-zone
23310 @opindex mno-red-zone
23311 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
23312 by the x86-64 ABI; it is a 128-byte area beyond the location of the
23313 stack pointer that is not modified by signal or interrupt handlers
23314 and therefore can be used for temporary data without adjusting the stack
23315 pointer.  The flag @option{-mno-red-zone} disables this red zone.
23317 @item -mcmodel=small
23318 @opindex mcmodel=small
23319 Generate code for the small code model: the program and its symbols must
23320 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
23321 Programs can be statically or dynamically linked.  This is the default
23322 code model.
23324 @item -mcmodel=kernel
23325 @opindex mcmodel=kernel
23326 Generate code for the kernel code model.  The kernel runs in the
23327 negative 2 GB of the address space.
23328 This model has to be used for Linux kernel code.
23330 @item -mcmodel=medium
23331 @opindex mcmodel=medium
23332 Generate code for the medium model: the program is linked in the lower 2
23333 GB of the address space.  Small symbols are also placed there.  Symbols
23334 with sizes larger than @option{-mlarge-data-threshold} are put into
23335 large data or BSS sections and can be located above 2GB.  Programs can
23336 be statically or dynamically linked.
23338 @item -mcmodel=large
23339 @opindex mcmodel=large
23340 Generate code for the large model.  This model makes no assumptions
23341 about addresses and sizes of sections.
23343 @item -maddress-mode=long
23344 @opindex maddress-mode=long
23345 Generate code for long address mode.  This is only supported for 64-bit
23346 and x32 environments.  It is the default address mode for 64-bit
23347 environments.
23349 @item -maddress-mode=short
23350 @opindex maddress-mode=short
23351 Generate code for short address mode.  This is only supported for 32-bit
23352 and x32 environments.  It is the default address mode for 32-bit and
23353 x32 environments.
23354 @end table
23356 @node x86 Windows Options
23357 @subsection x86 Windows Options
23358 @cindex x86 Windows Options
23359 @cindex Windows Options for x86
23361 These additional options are available for Microsoft Windows targets:
23363 @table @gcctabopt
23364 @item -mconsole
23365 @opindex mconsole
23366 This option
23367 specifies that a console application is to be generated, by
23368 instructing the linker to set the PE header subsystem type
23369 required for console applications.
23370 This option is available for Cygwin and MinGW targets and is
23371 enabled by default on those targets.
23373 @item -mdll
23374 @opindex mdll
23375 This option is available for Cygwin and MinGW targets.  It
23376 specifies that a DLL---a dynamic link library---is to be
23377 generated, enabling the selection of the required runtime
23378 startup object and entry point.
23380 @item -mnop-fun-dllimport
23381 @opindex mnop-fun-dllimport
23382 This option is available for Cygwin and MinGW targets.  It
23383 specifies that the @code{dllimport} attribute should be ignored.
23385 @item -mthread
23386 @opindex mthread
23387 This option is available for MinGW targets. It specifies
23388 that MinGW-specific thread support is to be used.
23390 @item -municode
23391 @opindex municode
23392 This option is available for MinGW-w64 targets.  It causes
23393 the @code{UNICODE} preprocessor macro to be predefined, and
23394 chooses Unicode-capable runtime startup code.
23396 @item -mwin32
23397 @opindex mwin32
23398 This option is available for Cygwin and MinGW targets.  It
23399 specifies that the typical Microsoft Windows predefined macros are to
23400 be set in the pre-processor, but does not influence the choice
23401 of runtime library/startup code.
23403 @item -mwindows
23404 @opindex mwindows
23405 This option is available for Cygwin and MinGW targets.  It
23406 specifies that a GUI application is to be generated by
23407 instructing the linker to set the PE header subsystem type
23408 appropriately.
23410 @item -fno-set-stack-executable
23411 @opindex fno-set-stack-executable
23412 This option is available for MinGW targets. It specifies that
23413 the executable flag for the stack used by nested functions isn't
23414 set. This is necessary for binaries running in kernel mode of
23415 Microsoft Windows, as there the User32 API, which is used to set executable
23416 privileges, isn't available.
23418 @item -fwritable-relocated-rdata
23419 @opindex fno-writable-relocated-rdata
23420 This option is available for MinGW and Cygwin targets.  It specifies
23421 that relocated-data in read-only section is put into .data
23422 section.  This is a necessary for older runtimes not supporting
23423 modification of .rdata sections for pseudo-relocation.
23425 @item -mpe-aligned-commons
23426 @opindex mpe-aligned-commons
23427 This option is available for Cygwin and MinGW targets.  It
23428 specifies that the GNU extension to the PE file format that
23429 permits the correct alignment of COMMON variables should be
23430 used when generating code.  It is enabled by default if
23431 GCC detects that the target assembler found during configuration
23432 supports the feature.
23433 @end table
23435 See also under @ref{x86 Options} for standard options.
23437 @node Xstormy16 Options
23438 @subsection Xstormy16 Options
23439 @cindex Xstormy16 Options
23441 These options are defined for Xstormy16:
23443 @table @gcctabopt
23444 @item -msim
23445 @opindex msim
23446 Choose startup files and linker script suitable for the simulator.
23447 @end table
23449 @node Xtensa Options
23450 @subsection Xtensa Options
23451 @cindex Xtensa Options
23453 These options are supported for Xtensa targets:
23455 @table @gcctabopt
23456 @item -mconst16
23457 @itemx -mno-const16
23458 @opindex mconst16
23459 @opindex mno-const16
23460 Enable or disable use of @code{CONST16} instructions for loading
23461 constant values.  The @code{CONST16} instruction is currently not a
23462 standard option from Tensilica.  When enabled, @code{CONST16}
23463 instructions are always used in place of the standard @code{L32R}
23464 instructions.  The use of @code{CONST16} is enabled by default only if
23465 the @code{L32R} instruction is not available.
23467 @item -mfused-madd
23468 @itemx -mno-fused-madd
23469 @opindex mfused-madd
23470 @opindex mno-fused-madd
23471 Enable or disable use of fused multiply/add and multiply/subtract
23472 instructions in the floating-point option.  This has no effect if the
23473 floating-point option is not also enabled.  Disabling fused multiply/add
23474 and multiply/subtract instructions forces the compiler to use separate
23475 instructions for the multiply and add/subtract operations.  This may be
23476 desirable in some cases where strict IEEE 754-compliant results are
23477 required: the fused multiply add/subtract instructions do not round the
23478 intermediate result, thereby producing results with @emph{more} bits of
23479 precision than specified by the IEEE standard.  Disabling fused multiply
23480 add/subtract instructions also ensures that the program output is not
23481 sensitive to the compiler's ability to combine multiply and add/subtract
23482 operations.
23484 @item -mserialize-volatile
23485 @itemx -mno-serialize-volatile
23486 @opindex mserialize-volatile
23487 @opindex mno-serialize-volatile
23488 When this option is enabled, GCC inserts @code{MEMW} instructions before
23489 @code{volatile} memory references to guarantee sequential consistency.
23490 The default is @option{-mserialize-volatile}.  Use
23491 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
23493 @item -mforce-no-pic
23494 @opindex mforce-no-pic
23495 For targets, like GNU/Linux, where all user-mode Xtensa code must be
23496 position-independent code (PIC), this option disables PIC for compiling
23497 kernel code.
23499 @item -mtext-section-literals
23500 @itemx -mno-text-section-literals
23501 @opindex mtext-section-literals
23502 @opindex mno-text-section-literals
23503 These options control the treatment of literal pools.  The default is
23504 @option{-mno-text-section-literals}, which places literals in a separate
23505 section in the output file.  This allows the literal pool to be placed
23506 in a data RAM/ROM, and it also allows the linker to combine literal
23507 pools from separate object files to remove redundant literals and
23508 improve code size.  With @option{-mtext-section-literals}, the literals
23509 are interspersed in the text section in order to keep them as close as
23510 possible to their references.  This may be necessary for large assembly
23511 files.
23513 @item -mtarget-align
23514 @itemx -mno-target-align
23515 @opindex mtarget-align
23516 @opindex mno-target-align
23517 When this option is enabled, GCC instructs the assembler to
23518 automatically align instructions to reduce branch penalties at the
23519 expense of some code density.  The assembler attempts to widen density
23520 instructions to align branch targets and the instructions following call
23521 instructions.  If there are not enough preceding safe density
23522 instructions to align a target, no widening is performed.  The
23523 default is @option{-mtarget-align}.  These options do not affect the
23524 treatment of auto-aligned instructions like @code{LOOP}, which the
23525 assembler always aligns, either by widening density instructions or
23526 by inserting NOP instructions.
23528 @item -mlongcalls
23529 @itemx -mno-longcalls
23530 @opindex mlongcalls
23531 @opindex mno-longcalls
23532 When this option is enabled, GCC instructs the assembler to translate
23533 direct calls to indirect calls unless it can determine that the target
23534 of a direct call is in the range allowed by the call instruction.  This
23535 translation typically occurs for calls to functions in other source
23536 files.  Specifically, the assembler translates a direct @code{CALL}
23537 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
23538 The default is @option{-mno-longcalls}.  This option should be used in
23539 programs where the call target can potentially be out of range.  This
23540 option is implemented in the assembler, not the compiler, so the
23541 assembly code generated by GCC still shows direct call
23542 instructions---look at the disassembled object code to see the actual
23543 instructions.  Note that the assembler uses an indirect call for
23544 every cross-file call, not just those that really are out of range.
23545 @end table
23547 @node zSeries Options
23548 @subsection zSeries Options
23549 @cindex zSeries options
23551 These are listed under @xref{S/390 and zSeries Options}.
23553 @node Code Gen Options
23554 @section Options for Code Generation Conventions
23555 @cindex code generation conventions
23556 @cindex options, code generation
23557 @cindex run-time options
23559 These machine-independent options control the interface conventions
23560 used in code generation.
23562 Most of them have both positive and negative forms; the negative form
23563 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
23564 one of the forms is listed---the one that is not the default.  You
23565 can figure out the other form by either removing @samp{no-} or adding
23568 @table @gcctabopt
23569 @item -fbounds-check
23570 @opindex fbounds-check
23571 For front ends that support it, generate additional code to check that
23572 indices used to access arrays are within the declared range.  This is
23573 currently only supported by the Java and Fortran front ends, where
23574 this option defaults to true and false respectively.
23576 @item -fstack-reuse=@var{reuse-level}
23577 @opindex fstack_reuse
23578 This option controls stack space reuse for user declared local/auto variables
23579 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
23580 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
23581 local variables and temporaries, @samp{named_vars} enables the reuse only for
23582 user defined local variables with names, and @samp{none} disables stack reuse
23583 completely. The default value is @samp{all}. The option is needed when the
23584 program extends the lifetime of a scoped local variable or a compiler generated
23585 temporary beyond the end point defined by the language.  When a lifetime of
23586 a variable ends, and if the variable lives in memory, the optimizing compiler
23587 has the freedom to reuse its stack space with other temporaries or scoped
23588 local variables whose live range does not overlap with it. Legacy code extending
23589 local lifetime is likely to break with the stack reuse optimization.
23591 For example,
23593 @smallexample
23594    int *p;
23595    @{
23596      int local1;
23598      p = &local1;
23599      local1 = 10;
23600      ....
23601    @}
23602    @{
23603       int local2;
23604       local2 = 20;
23605       ...
23606    @}
23608    if (*p == 10)  // out of scope use of local1
23609      @{
23611      @}
23612 @end smallexample
23614 Another example:
23615 @smallexample
23617    struct A
23618    @{
23619        A(int k) : i(k), j(k) @{ @}
23620        int i;
23621        int j;
23622    @};
23624    A *ap;
23626    void foo(const A& ar)
23627    @{
23628       ap = &ar;
23629    @}
23631    void bar()
23632    @{
23633       foo(A(10)); // temp object's lifetime ends when foo returns
23635       @{
23636         A a(20);
23637         ....
23638       @}
23639       ap->i+= 10;  // ap references out of scope temp whose space
23640                    // is reused with a. What is the value of ap->i?
23641    @}
23643 @end smallexample
23645 The lifetime of a compiler generated temporary is well defined by the C++
23646 standard. When a lifetime of a temporary ends, and if the temporary lives
23647 in memory, the optimizing compiler has the freedom to reuse its stack
23648 space with other temporaries or scoped local variables whose live range
23649 does not overlap with it. However some of the legacy code relies on
23650 the behavior of older compilers in which temporaries' stack space is
23651 not reused, the aggressive stack reuse can lead to runtime errors. This
23652 option is used to control the temporary stack reuse optimization.
23654 @item -ftrapv
23655 @opindex ftrapv
23656 This option generates traps for signed overflow on addition, subtraction,
23657 multiplication operations.
23659 @item -fwrapv
23660 @opindex fwrapv
23661 This option instructs the compiler to assume that signed arithmetic
23662 overflow of addition, subtraction and multiplication wraps around
23663 using twos-complement representation.  This flag enables some optimizations
23664 and disables others.  This option is enabled by default for the Java
23665 front end, as required by the Java language specification.
23667 @item -fexceptions
23668 @opindex fexceptions
23669 Enable exception handling.  Generates extra code needed to propagate
23670 exceptions.  For some targets, this implies GCC generates frame
23671 unwind information for all functions, which can produce significant data
23672 size overhead, although it does not affect execution.  If you do not
23673 specify this option, GCC enables it by default for languages like
23674 C++ that normally require exception handling, and disables it for
23675 languages like C that do not normally require it.  However, you may need
23676 to enable this option when compiling C code that needs to interoperate
23677 properly with exception handlers written in C++.  You may also wish to
23678 disable this option if you are compiling older C++ programs that don't
23679 use exception handling.
23681 @item -fnon-call-exceptions
23682 @opindex fnon-call-exceptions
23683 Generate code that allows trapping instructions to throw exceptions.
23684 Note that this requires platform-specific runtime support that does
23685 not exist everywhere.  Moreover, it only allows @emph{trapping}
23686 instructions to throw exceptions, i.e.@: memory references or floating-point
23687 instructions.  It does not allow exceptions to be thrown from
23688 arbitrary signal handlers such as @code{SIGALRM}.
23690 @item -fdelete-dead-exceptions
23691 @opindex fdelete-dead-exceptions
23692 Consider that instructions that may throw exceptions but don't otherwise
23693 contribute to the execution of the program can be optimized away.
23694 This option is enabled by default for the Ada front end, as permitted by
23695 the Ada language specification.
23696 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
23698 @item -funwind-tables
23699 @opindex funwind-tables
23700 Similar to @option{-fexceptions}, except that it just generates any needed
23701 static data, but does not affect the generated code in any other way.
23702 You normally do not need to enable this option; instead, a language processor
23703 that needs this handling enables it on your behalf.
23705 @item -fasynchronous-unwind-tables
23706 @opindex fasynchronous-unwind-tables
23707 Generate unwind table in DWARF 2 format, if supported by target machine.  The
23708 table is exact at each instruction boundary, so it can be used for stack
23709 unwinding from asynchronous events (such as debugger or garbage collector).
23711 @item -fno-gnu-unique
23712 @opindex fno-gnu-unique
23713 On systems with recent GNU assembler and C library, the C++ compiler
23714 uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
23715 of template static data members and static local variables in inline
23716 functions are unique even in the presence of @code{RTLD_LOCAL}; this
23717 is necessary to avoid problems with a library used by two different
23718 @code{RTLD_LOCAL} plugins depending on a definition in one of them and
23719 therefore disagreeing with the other one about the binding of the
23720 symbol.  But this causes @code{dlclose} to be ignored for affected
23721 DSOs; if your program relies on reinitialization of a DSO via
23722 @code{dlclose} and @code{dlopen}, you can use
23723 @option{-fno-gnu-unique}.
23725 @item -fpcc-struct-return
23726 @opindex fpcc-struct-return
23727 Return ``short'' @code{struct} and @code{union} values in memory like
23728 longer ones, rather than in registers.  This convention is less
23729 efficient, but it has the advantage of allowing intercallability between
23730 GCC-compiled files and files compiled with other compilers, particularly
23731 the Portable C Compiler (pcc).
23733 The precise convention for returning structures in memory depends
23734 on the target configuration macros.
23736 Short structures and unions are those whose size and alignment match
23737 that of some integer type.
23739 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
23740 switch is not binary compatible with code compiled with the
23741 @option{-freg-struct-return} switch.
23742 Use it to conform to a non-default application binary interface.
23744 @item -freg-struct-return
23745 @opindex freg-struct-return
23746 Return @code{struct} and @code{union} values in registers when possible.
23747 This is more efficient for small structures than
23748 @option{-fpcc-struct-return}.
23750 If you specify neither @option{-fpcc-struct-return} nor
23751 @option{-freg-struct-return}, GCC defaults to whichever convention is
23752 standard for the target.  If there is no standard convention, GCC
23753 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
23754 the principal compiler.  In those cases, we can choose the standard, and
23755 we chose the more efficient register return alternative.
23757 @strong{Warning:} code compiled with the @option{-freg-struct-return}
23758 switch is not binary compatible with code compiled with the
23759 @option{-fpcc-struct-return} switch.
23760 Use it to conform to a non-default application binary interface.
23762 @item -fshort-enums
23763 @opindex fshort-enums
23764 Allocate to an @code{enum} type only as many bytes as it needs for the
23765 declared range of possible values.  Specifically, the @code{enum} type
23766 is equivalent to the smallest integer type that has enough room.
23768 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
23769 code that is not binary compatible with code generated without that switch.
23770 Use it to conform to a non-default application binary interface.
23772 @item -fshort-double
23773 @opindex fshort-double
23774 Use the same size for @code{double} as for @code{float}.
23776 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
23777 code that is not binary compatible with code generated without that switch.
23778 Use it to conform to a non-default application binary interface.
23780 @item -fshort-wchar
23781 @opindex fshort-wchar
23782 Override the underlying type for @code{wchar_t} to be @code{short
23783 unsigned int} instead of the default for the target.  This option is
23784 useful for building programs to run under WINE@.
23786 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
23787 code that is not binary compatible with code generated without that switch.
23788 Use it to conform to a non-default application binary interface.
23790 @item -fno-common
23791 @opindex fno-common
23792 In C code, controls the placement of uninitialized global variables.
23793 Unix C compilers have traditionally permitted multiple definitions of
23794 such variables in different compilation units by placing the variables
23795 in a common block.
23796 This is the behavior specified by @option{-fcommon}, and is the default
23797 for GCC on most targets.
23798 On the other hand, this behavior is not required by ISO C, and on some
23799 targets may carry a speed or code size penalty on variable references.
23800 The @option{-fno-common} option specifies that the compiler should place
23801 uninitialized global variables in the data section of the object file,
23802 rather than generating them as common blocks.
23803 This has the effect that if the same variable is declared
23804 (without @code{extern}) in two different compilations,
23805 you get a multiple-definition error when you link them.
23806 In this case, you must compile with @option{-fcommon} instead.
23807 Compiling with @option{-fno-common} is useful on targets for which
23808 it provides better performance, or if you wish to verify that the
23809 program will work on other systems that always treat uninitialized
23810 variable declarations this way.
23812 @item -fno-ident
23813 @opindex fno-ident
23814 Ignore the @code{#ident} directive.
23816 @item -finhibit-size-directive
23817 @opindex finhibit-size-directive
23818 Don't output a @code{.size} assembler directive, or anything else that
23819 would cause trouble if the function is split in the middle, and the
23820 two halves are placed at locations far apart in memory.  This option is
23821 used when compiling @file{crtstuff.c}; you should not need to use it
23822 for anything else.
23824 @item -fverbose-asm
23825 @opindex fverbose-asm
23826 Put extra commentary information in the generated assembly code to
23827 make it more readable.  This option is generally only of use to those
23828 who actually need to read the generated assembly code (perhaps while
23829 debugging the compiler itself).
23831 @option{-fno-verbose-asm}, the default, causes the
23832 extra information to be omitted and is useful when comparing two assembler
23833 files.
23835 @item -frecord-gcc-switches
23836 @opindex frecord-gcc-switches
23837 This switch causes the command line used to invoke the
23838 compiler to be recorded into the object file that is being created.
23839 This switch is only implemented on some targets and the exact format
23840 of the recording is target and binary file format dependent, but it
23841 usually takes the form of a section containing ASCII text.  This
23842 switch is related to the @option{-fverbose-asm} switch, but that
23843 switch only records information in the assembler output file as
23844 comments, so it never reaches the object file.
23845 See also @option{-grecord-gcc-switches} for another
23846 way of storing compiler options into the object file.
23848 @item -fpic
23849 @opindex fpic
23850 @cindex global offset table
23851 @cindex PIC
23852 Generate position-independent code (PIC) suitable for use in a shared
23853 library, if supported for the target machine.  Such code accesses all
23854 constant addresses through a global offset table (GOT)@.  The dynamic
23855 loader resolves the GOT entries when the program starts (the dynamic
23856 loader is not part of GCC; it is part of the operating system).  If
23857 the GOT size for the linked executable exceeds a machine-specific
23858 maximum size, you get an error message from the linker indicating that
23859 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
23860 instead.  (These maximums are 8k on the SPARC and 32k
23861 on the m68k and RS/6000.  The x86 has no such limit.)
23863 Position-independent code requires special support, and therefore works
23864 only on certain machines.  For the x86, GCC supports PIC for System V
23865 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
23866 position-independent.
23868 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
23869 are defined to 1.
23871 @item -fPIC
23872 @opindex fPIC
23873 If supported for the target machine, emit position-independent code,
23874 suitable for dynamic linking and avoiding any limit on the size of the
23875 global offset table.  This option makes a difference on the m68k,
23876 PowerPC and SPARC@.
23878 Position-independent code requires special support, and therefore works
23879 only on certain machines.
23881 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
23882 are defined to 2.
23884 @item -fpie
23885 @itemx -fPIE
23886 @opindex fpie
23887 @opindex fPIE
23888 These options are similar to @option{-fpic} and @option{-fPIC}, but
23889 generated position independent code can be only linked into executables.
23890 Usually these options are used when @option{-pie} GCC option is
23891 used during linking.
23893 @option{-fpie} and @option{-fPIE} both define the macros
23894 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
23895 for @option{-fpie} and 2 for @option{-fPIE}.
23897 @item -fno-plt
23898 @opindex fno-plt
23899 Do not use PLT for external function calls in position-independent code.
23900 Instead, load callee address at call site from GOT and branch to it.
23901 This leads to more efficient code by eliminating PLT stubs and exposing
23902 GOT load to optimizations.  On architectures such as 32-bit x86 where
23903 PLT stubs expect GOT pointer in a specific register, this gives more
23904 register allocation freedom to the compiler.  Lazy binding requires PLT:
23905 with @option{-fno-plt} all external symbols are resolved at load time.
23907 Alternatively, function attribute @code{noplt} can be used to avoid PLT
23908 for calls to specific external functions by marking those functions with
23909 this attribute.
23911 Additionally, a few targets also convert calls to those functions that are
23912 marked to not use the PLT to use the GOT instead for non-position independent
23913 code.
23915 @item -fno-jump-tables
23916 @opindex fno-jump-tables
23917 Do not use jump tables for switch statements even where it would be
23918 more efficient than other code generation strategies.  This option is
23919 of use in conjunction with @option{-fpic} or @option{-fPIC} for
23920 building code that forms part of a dynamic linker and cannot
23921 reference the address of a jump table.  On some targets, jump tables
23922 do not require a GOT and this option is not needed.
23924 @item -ffixed-@var{reg}
23925 @opindex ffixed
23926 Treat the register named @var{reg} as a fixed register; generated code
23927 should never refer to it (except perhaps as a stack pointer, frame
23928 pointer or in some other fixed role).
23930 @var{reg} must be the name of a register.  The register names accepted
23931 are machine-specific and are defined in the @code{REGISTER_NAMES}
23932 macro in the machine description macro file.
23934 This flag does not have a negative form, because it specifies a
23935 three-way choice.
23937 @item -fcall-used-@var{reg}
23938 @opindex fcall-used
23939 Treat the register named @var{reg} as an allocable register that is
23940 clobbered by function calls.  It may be allocated for temporaries or
23941 variables that do not live across a call.  Functions compiled this way
23942 do not save and restore the register @var{reg}.
23944 It is an error to use this flag with the frame pointer or stack pointer.
23945 Use of this flag for other registers that have fixed pervasive roles in
23946 the machine's execution model produces disastrous results.
23948 This flag does not have a negative form, because it specifies a
23949 three-way choice.
23951 @item -fcall-saved-@var{reg}
23952 @opindex fcall-saved
23953 Treat the register named @var{reg} as an allocable register saved by
23954 functions.  It may be allocated even for temporaries or variables that
23955 live across a call.  Functions compiled this way save and restore
23956 the register @var{reg} if they use it.
23958 It is an error to use this flag with the frame pointer or stack pointer.
23959 Use of this flag for other registers that have fixed pervasive roles in
23960 the machine's execution model produces disastrous results.
23962 A different sort of disaster results from the use of this flag for
23963 a register in which function values may be returned.
23965 This flag does not have a negative form, because it specifies a
23966 three-way choice.
23968 @item -fpack-struct[=@var{n}]
23969 @opindex fpack-struct
23970 Without a value specified, pack all structure members together without
23971 holes.  When a value is specified (which must be a small power of two), pack
23972 structure members according to this value, representing the maximum
23973 alignment (that is, objects with default alignment requirements larger than
23974 this are output potentially unaligned at the next fitting location.
23976 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
23977 code that is not binary compatible with code generated without that switch.
23978 Additionally, it makes the code suboptimal.
23979 Use it to conform to a non-default application binary interface.
23981 @item -finstrument-functions
23982 @opindex finstrument-functions
23983 Generate instrumentation calls for entry and exit to functions.  Just
23984 after function entry and just before function exit, the following
23985 profiling functions are called with the address of the current
23986 function and its call site.  (On some platforms,
23987 @code{__builtin_return_address} does not work beyond the current
23988 function, so the call site information may not be available to the
23989 profiling functions otherwise.)
23991 @smallexample
23992 void __cyg_profile_func_enter (void *this_fn,
23993                                void *call_site);
23994 void __cyg_profile_func_exit  (void *this_fn,
23995                                void *call_site);
23996 @end smallexample
23998 The first argument is the address of the start of the current function,
23999 which may be looked up exactly in the symbol table.
24001 This instrumentation is also done for functions expanded inline in other
24002 functions.  The profiling calls indicate where, conceptually, the
24003 inline function is entered and exited.  This means that addressable
24004 versions of such functions must be available.  If all your uses of a
24005 function are expanded inline, this may mean an additional expansion of
24006 code size.  If you use @code{extern inline} in your C code, an
24007 addressable version of such functions must be provided.  (This is
24008 normally the case anyway, but if you get lucky and the optimizer always
24009 expands the functions inline, you might have gotten away without
24010 providing static copies.)
24012 A function may be given the attribute @code{no_instrument_function}, in
24013 which case this instrumentation is not done.  This can be used, for
24014 example, for the profiling functions listed above, high-priority
24015 interrupt routines, and any functions from which the profiling functions
24016 cannot safely be called (perhaps signal handlers, if the profiling
24017 routines generate output or allocate memory).
24019 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
24020 @opindex finstrument-functions-exclude-file-list
24022 Set the list of functions that are excluded from instrumentation (see
24023 the description of @option{-finstrument-functions}).  If the file that
24024 contains a function definition matches with one of @var{file}, then
24025 that function is not instrumented.  The match is done on substrings:
24026 if the @var{file} parameter is a substring of the file name, it is
24027 considered to be a match.
24029 For example:
24031 @smallexample
24032 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
24033 @end smallexample
24035 @noindent
24036 excludes any inline function defined in files whose pathnames
24037 contain @file{/bits/stl} or @file{include/sys}.
24039 If, for some reason, you want to include letter @samp{,} in one of
24040 @var{sym}, write @samp{\,}. For example,
24041 @option{-finstrument-functions-exclude-file-list='\,\,tmp'}
24042 (note the single quote surrounding the option).
24044 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
24045 @opindex finstrument-functions-exclude-function-list
24047 This is similar to @option{-finstrument-functions-exclude-file-list},
24048 but this option sets the list of function names to be excluded from
24049 instrumentation.  The function name to be matched is its user-visible
24050 name, such as @code{vector<int> blah(const vector<int> &)}, not the
24051 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
24052 match is done on substrings: if the @var{sym} parameter is a substring
24053 of the function name, it is considered to be a match.  For C99 and C++
24054 extended identifiers, the function name must be given in UTF-8, not
24055 using universal character names.
24057 @item -fstack-check
24058 @opindex fstack-check
24059 Generate code to verify that you do not go beyond the boundary of the
24060 stack.  You should specify this flag if you are running in an
24061 environment with multiple threads, but you only rarely need to specify it in
24062 a single-threaded environment since stack overflow is automatically
24063 detected on nearly all systems if there is only one stack.
24065 Note that this switch does not actually cause checking to be done; the
24066 operating system or the language runtime must do that.  The switch causes
24067 generation of code to ensure that they see the stack being extended.
24069 You can additionally specify a string parameter: @samp{no} means no
24070 checking, @samp{generic} means force the use of old-style checking,
24071 @samp{specific} means use the best checking method and is equivalent
24072 to bare @option{-fstack-check}.
24074 Old-style checking is a generic mechanism that requires no specific
24075 target support in the compiler but comes with the following drawbacks:
24077 @enumerate
24078 @item
24079 Modified allocation strategy for large objects: they are always
24080 allocated dynamically if their size exceeds a fixed threshold.
24082 @item
24083 Fixed limit on the size of the static frame of functions: when it is
24084 topped by a particular function, stack checking is not reliable and
24085 a warning is issued by the compiler.
24087 @item
24088 Inefficiency: because of both the modified allocation strategy and the
24089 generic implementation, code performance is hampered.
24090 @end enumerate
24092 Note that old-style stack checking is also the fallback method for
24093 @samp{specific} if no target support has been added in the compiler.
24095 @item -fstack-limit-register=@var{reg}
24096 @itemx -fstack-limit-symbol=@var{sym}
24097 @itemx -fno-stack-limit
24098 @opindex fstack-limit-register
24099 @opindex fstack-limit-symbol
24100 @opindex fno-stack-limit
24101 Generate code to ensure that the stack does not grow beyond a certain value,
24102 either the value of a register or the address of a symbol.  If a larger
24103 stack is required, a signal is raised at run time.  For most targets,
24104 the signal is raised before the stack overruns the boundary, so
24105 it is possible to catch the signal without taking special precautions.
24107 For instance, if the stack starts at absolute address @samp{0x80000000}
24108 and grows downwards, you can use the flags
24109 @option{-fstack-limit-symbol=__stack_limit} and
24110 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
24111 of 128KB@.  Note that this may only work with the GNU linker.
24113 @item -fsplit-stack
24114 @opindex fsplit-stack
24115 Generate code to automatically split the stack before it overflows.
24116 The resulting program has a discontiguous stack which can only
24117 overflow if the program is unable to allocate any more memory.  This
24118 is most useful when running threaded programs, as it is no longer
24119 necessary to calculate a good stack size to use for each thread.  This
24120 is currently only implemented for the x86 targets running
24121 GNU/Linux.
24123 When code compiled with @option{-fsplit-stack} calls code compiled
24124 without @option{-fsplit-stack}, there may not be much stack space
24125 available for the latter code to run.  If compiling all code,
24126 including library code, with @option{-fsplit-stack} is not an option,
24127 then the linker can fix up these calls so that the code compiled
24128 without @option{-fsplit-stack} always has a large stack.  Support for
24129 this is implemented in the gold linker in GNU binutils release 2.21
24130 and later.
24132 @item -fleading-underscore
24133 @opindex fleading-underscore
24134 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
24135 change the way C symbols are represented in the object file.  One use
24136 is to help link with legacy assembly code.
24138 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
24139 generate code that is not binary compatible with code generated without that
24140 switch.  Use it to conform to a non-default application binary interface.
24141 Not all targets provide complete support for this switch.
24143 @item -ftls-model=@var{model}
24144 @opindex ftls-model
24145 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
24146 The @var{model} argument should be one of @samp{global-dynamic},
24147 @samp{local-dynamic}, @samp{initial-exec} or @samp{local-exec}.
24148 Note that the choice is subject to optimization: the compiler may use
24149 a more efficient model for symbols not visible outside of the translation
24150 unit, or if @option{-fpic} is not given on the command line.
24152 The default without @option{-fpic} is @samp{initial-exec}; with
24153 @option{-fpic} the default is @samp{global-dynamic}.
24155 @item -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]}
24156 @opindex fvisibility
24157 Set the default ELF image symbol visibility to the specified option---all
24158 symbols are marked with this unless overridden within the code.
24159 Using this feature can very substantially improve linking and
24160 load times of shared object libraries, produce more optimized
24161 code, provide near-perfect API export and prevent symbol clashes.
24162 It is @strong{strongly} recommended that you use this in any shared objects
24163 you distribute.
24165 Despite the nomenclature, @samp{default} always means public; i.e.,
24166 available to be linked against from outside the shared object.
24167 @samp{protected} and @samp{internal} are pretty useless in real-world
24168 usage so the only other commonly used option is @samp{hidden}.
24169 The default if @option{-fvisibility} isn't specified is
24170 @samp{default}, i.e., make every symbol public.
24172 A good explanation of the benefits offered by ensuring ELF
24173 symbols have the correct visibility is given by ``How To Write
24174 Shared Libraries'' by Ulrich Drepper (which can be found at
24175 @w{@uref{http://www.akkadia.org/drepper/}})---however a superior
24176 solution made possible by this option to marking things hidden when
24177 the default is public is to make the default hidden and mark things
24178 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
24179 and @code{__attribute__ ((visibility("default")))} instead of
24180 @code{__declspec(dllexport)} you get almost identical semantics with
24181 identical syntax.  This is a great boon to those working with
24182 cross-platform projects.
24184 For those adding visibility support to existing code, you may find
24185 @code{#pragma GCC visibility} of use.  This works by you enclosing
24186 the declarations you wish to set visibility for with (for example)
24187 @code{#pragma GCC visibility push(hidden)} and
24188 @code{#pragma GCC visibility pop}.
24189 Bear in mind that symbol visibility should be viewed @strong{as
24190 part of the API interface contract} and thus all new code should
24191 always specify visibility when it is not the default; i.e., declarations
24192 only for use within the local DSO should @strong{always} be marked explicitly
24193 as hidden as so to avoid PLT indirection overheads---making this
24194 abundantly clear also aids readability and self-documentation of the code.
24195 Note that due to ISO C++ specification requirements, @code{operator new} and
24196 @code{operator delete} must always be of default visibility.
24198 Be aware that headers from outside your project, in particular system
24199 headers and headers from any other library you use, may not be
24200 expecting to be compiled with visibility other than the default.  You
24201 may need to explicitly say @code{#pragma GCC visibility push(default)}
24202 before including any such headers.
24204 @code{extern} declarations are not affected by @option{-fvisibility}, so
24205 a lot of code can be recompiled with @option{-fvisibility=hidden} with
24206 no modifications.  However, this means that calls to @code{extern}
24207 functions with no explicit visibility use the PLT, so it is more
24208 effective to use @code{__attribute ((visibility))} and/or
24209 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
24210 declarations should be treated as hidden.
24212 Note that @option{-fvisibility} does affect C++ vague linkage
24213 entities. This means that, for instance, an exception class that is
24214 be thrown between DSOs must be explicitly marked with default
24215 visibility so that the @samp{type_info} nodes are unified between
24216 the DSOs.
24218 An overview of these techniques, their benefits and how to use them
24219 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
24221 @item -fstrict-volatile-bitfields
24222 @opindex fstrict-volatile-bitfields
24223 This option should be used if accesses to volatile bit-fields (or other
24224 structure fields, although the compiler usually honors those types
24225 anyway) should use a single access of the width of the
24226 field's type, aligned to a natural alignment if possible.  For
24227 example, targets with memory-mapped peripheral registers might require
24228 all such accesses to be 16 bits wide; with this flag you can
24229 declare all peripheral bit-fields as @code{unsigned short} (assuming short
24230 is 16 bits on these targets) to force GCC to use 16-bit accesses
24231 instead of, perhaps, a more efficient 32-bit access.
24233 If this option is disabled, the compiler uses the most efficient
24234 instruction.  In the previous example, that might be a 32-bit load
24235 instruction, even though that accesses bytes that do not contain
24236 any portion of the bit-field, or memory-mapped registers unrelated to
24237 the one being updated.
24239 In some cases, such as when the @code{packed} attribute is applied to a 
24240 structure field, it may not be possible to access the field with a single
24241 read or write that is correctly aligned for the target machine.  In this
24242 case GCC falls back to generating multiple accesses rather than code that 
24243 will fault or truncate the result at run time.
24245 Note:  Due to restrictions of the C/C++11 memory model, write accesses are
24246 not allowed to touch non bit-field members.  It is therefore recommended
24247 to define all bits of the field's type as bit-field members.
24249 The default value of this option is determined by the application binary
24250 interface for the target processor.
24252 @item -fsync-libcalls
24253 @opindex fsync-libcalls
24254 This option controls whether any out-of-line instance of the @code{__sync}
24255 family of functions may be used to implement the C++11 @code{__atomic}
24256 family of functions.
24258 The default value of this option is enabled, thus the only useful form
24259 of the option is @option{-fno-sync-libcalls}.  This option is used in
24260 the implementation of the @file{libatomic} runtime library.
24262 @end table
24264 @c man end
24266 @node Environment Variables
24267 @section Environment Variables Affecting GCC
24268 @cindex environment variables
24270 @c man begin ENVIRONMENT
24271 This section describes several environment variables that affect how GCC
24272 operates.  Some of them work by specifying directories or prefixes to use
24273 when searching for various kinds of files.  Some are used to specify other
24274 aspects of the compilation environment.
24276 Note that you can also specify places to search using options such as
24277 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
24278 take precedence over places specified using environment variables, which
24279 in turn take precedence over those specified by the configuration of GCC@.
24280 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
24281 GNU Compiler Collection (GCC) Internals}.
24283 @table @env
24284 @item LANG
24285 @itemx LC_CTYPE
24286 @c @itemx LC_COLLATE
24287 @itemx LC_MESSAGES
24288 @c @itemx LC_MONETARY
24289 @c @itemx LC_NUMERIC
24290 @c @itemx LC_TIME
24291 @itemx LC_ALL
24292 @findex LANG
24293 @findex LC_CTYPE
24294 @c @findex LC_COLLATE
24295 @findex LC_MESSAGES
24296 @c @findex LC_MONETARY
24297 @c @findex LC_NUMERIC
24298 @c @findex LC_TIME
24299 @findex LC_ALL
24300 @cindex locale
24301 These environment variables control the way that GCC uses
24302 localization information which allows GCC to work with different
24303 national conventions.  GCC inspects the locale categories
24304 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
24305 so.  These locale categories can be set to any value supported by your
24306 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
24307 Kingdom encoded in UTF-8.
24309 The @env{LC_CTYPE} environment variable specifies character
24310 classification.  GCC uses it to determine the character boundaries in
24311 a string; this is needed for some multibyte encodings that contain quote
24312 and escape characters that are otherwise interpreted as a string
24313 end or escape.
24315 The @env{LC_MESSAGES} environment variable specifies the language to
24316 use in diagnostic messages.
24318 If the @env{LC_ALL} environment variable is set, it overrides the value
24319 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
24320 and @env{LC_MESSAGES} default to the value of the @env{LANG}
24321 environment variable.  If none of these variables are set, GCC
24322 defaults to traditional C English behavior.
24324 @item TMPDIR
24325 @findex TMPDIR
24326 If @env{TMPDIR} is set, it specifies the directory to use for temporary
24327 files.  GCC uses temporary files to hold the output of one stage of
24328 compilation which is to be used as input to the next stage: for example,
24329 the output of the preprocessor, which is the input to the compiler
24330 proper.
24332 @item GCC_COMPARE_DEBUG
24333 @findex GCC_COMPARE_DEBUG
24334 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
24335 @option{-fcompare-debug} to the compiler driver.  See the documentation
24336 of this option for more details.
24338 @item GCC_EXEC_PREFIX
24339 @findex GCC_EXEC_PREFIX
24340 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
24341 names of the subprograms executed by the compiler.  No slash is added
24342 when this prefix is combined with the name of a subprogram, but you can
24343 specify a prefix that ends with a slash if you wish.
24345 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
24346 an appropriate prefix to use based on the pathname it is invoked with.
24348 If GCC cannot find the subprogram using the specified prefix, it
24349 tries looking in the usual places for the subprogram.
24351 The default value of @env{GCC_EXEC_PREFIX} is
24352 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
24353 the installed compiler. In many cases @var{prefix} is the value
24354 of @code{prefix} when you ran the @file{configure} script.
24356 Other prefixes specified with @option{-B} take precedence over this prefix.
24358 This prefix is also used for finding files such as @file{crt0.o} that are
24359 used for linking.
24361 In addition, the prefix is used in an unusual way in finding the
24362 directories to search for header files.  For each of the standard
24363 directories whose name normally begins with @samp{/usr/local/lib/gcc}
24364 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
24365 replacing that beginning with the specified prefix to produce an
24366 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
24367 @file{foo/bar} just before it searches the standard directory 
24368 @file{/usr/local/lib/bar}.
24369 If a standard directory begins with the configured
24370 @var{prefix} then the value of @var{prefix} is replaced by
24371 @env{GCC_EXEC_PREFIX} when looking for header files.
24373 @item COMPILER_PATH
24374 @findex COMPILER_PATH
24375 The value of @env{COMPILER_PATH} is a colon-separated list of
24376 directories, much like @env{PATH}.  GCC tries the directories thus
24377 specified when searching for subprograms, if it can't find the
24378 subprograms using @env{GCC_EXEC_PREFIX}.
24380 @item LIBRARY_PATH
24381 @findex LIBRARY_PATH
24382 The value of @env{LIBRARY_PATH} is a colon-separated list of
24383 directories, much like @env{PATH}.  When configured as a native compiler,
24384 GCC tries the directories thus specified when searching for special
24385 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
24386 using GCC also uses these directories when searching for ordinary
24387 libraries for the @option{-l} option (but directories specified with
24388 @option{-L} come first).
24390 @item LANG
24391 @findex LANG
24392 @cindex locale definition
24393 This variable is used to pass locale information to the compiler.  One way in
24394 which this information is used is to determine the character set to be used
24395 when character literals, string literals and comments are parsed in C and C++.
24396 When the compiler is configured to allow multibyte characters,
24397 the following values for @env{LANG} are recognized:
24399 @table @samp
24400 @item C-JIS
24401 Recognize JIS characters.
24402 @item C-SJIS
24403 Recognize SJIS characters.
24404 @item C-EUCJP
24405 Recognize EUCJP characters.
24406 @end table
24408 If @env{LANG} is not defined, or if it has some other value, then the
24409 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
24410 recognize and translate multibyte characters.
24411 @end table
24413 @noindent
24414 Some additional environment variables affect the behavior of the
24415 preprocessor.
24417 @include cppenv.texi
24419 @c man end
24421 @node Precompiled Headers
24422 @section Using Precompiled Headers
24423 @cindex precompiled headers
24424 @cindex speed of compilation
24426 Often large projects have many header files that are included in every
24427 source file.  The time the compiler takes to process these header files
24428 over and over again can account for nearly all of the time required to
24429 build the project.  To make builds faster, GCC allows you to
24430 @dfn{precompile} a header file.
24432 To create a precompiled header file, simply compile it as you would any
24433 other file, if necessary using the @option{-x} option to make the driver
24434 treat it as a C or C++ header file.  You may want to use a
24435 tool like @command{make} to keep the precompiled header up-to-date when
24436 the headers it contains change.
24438 A precompiled header file is searched for when @code{#include} is
24439 seen in the compilation.  As it searches for the included file
24440 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
24441 compiler looks for a precompiled header in each directory just before it
24442 looks for the include file in that directory.  The name searched for is
24443 the name specified in the @code{#include} with @samp{.gch} appended.  If
24444 the precompiled header file can't be used, it is ignored.
24446 For instance, if you have @code{#include "all.h"}, and you have
24447 @file{all.h.gch} in the same directory as @file{all.h}, then the
24448 precompiled header file is used if possible, and the original
24449 header is used otherwise.
24451 Alternatively, you might decide to put the precompiled header file in a
24452 directory and use @option{-I} to ensure that directory is searched
24453 before (or instead of) the directory containing the original header.
24454 Then, if you want to check that the precompiled header file is always
24455 used, you can put a file of the same name as the original header in this
24456 directory containing an @code{#error} command.
24458 This also works with @option{-include}.  So yet another way to use
24459 precompiled headers, good for projects not designed with precompiled
24460 header files in mind, is to simply take most of the header files used by
24461 a project, include them from another header file, precompile that header
24462 file, and @option{-include} the precompiled header.  If the header files
24463 have guards against multiple inclusion, they are skipped because
24464 they've already been included (in the precompiled header).
24466 If you need to precompile the same header file for different
24467 languages, targets, or compiler options, you can instead make a
24468 @emph{directory} named like @file{all.h.gch}, and put each precompiled
24469 header in the directory, perhaps using @option{-o}.  It doesn't matter
24470 what you call the files in the directory; every precompiled header in
24471 the directory is considered.  The first precompiled header
24472 encountered in the directory that is valid for this compilation is
24473 used; they're searched in no particular order.
24475 There are many other possibilities, limited only by your imagination,
24476 good sense, and the constraints of your build system.
24478 A precompiled header file can be used only when these conditions apply:
24480 @itemize
24481 @item
24482 Only one precompiled header can be used in a particular compilation.
24484 @item
24485 A precompiled header can't be used once the first C token is seen.  You
24486 can have preprocessor directives before a precompiled header; you cannot
24487 include a precompiled header from inside another header.
24489 @item
24490 The precompiled header file must be produced for the same language as
24491 the current compilation.  You can't use a C precompiled header for a C++
24492 compilation.
24494 @item
24495 The precompiled header file must have been produced by the same compiler
24496 binary as the current compilation is using.
24498 @item
24499 Any macros defined before the precompiled header is included must
24500 either be defined in the same way as when the precompiled header was
24501 generated, or must not affect the precompiled header, which usually
24502 means that they don't appear in the precompiled header at all.
24504 The @option{-D} option is one way to define a macro before a
24505 precompiled header is included; using a @code{#define} can also do it.
24506 There are also some options that define macros implicitly, like
24507 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
24508 defined this way.
24510 @item If debugging information is output when using the precompiled
24511 header, using @option{-g} or similar, the same kind of debugging information
24512 must have been output when building the precompiled header.  However,
24513 a precompiled header built using @option{-g} can be used in a compilation
24514 when no debugging information is being output.
24516 @item The same @option{-m} options must generally be used when building
24517 and using the precompiled header.  @xref{Submodel Options},
24518 for any cases where this rule is relaxed.
24520 @item Each of the following options must be the same when building and using
24521 the precompiled header:
24523 @gccoptlist{-fexceptions}
24525 @item
24526 Some other command-line options starting with @option{-f},
24527 @option{-p}, or @option{-O} must be defined in the same way as when
24528 the precompiled header was generated.  At present, it's not clear
24529 which options are safe to change and which are not; the safest choice
24530 is to use exactly the same options when generating and using the
24531 precompiled header.  The following are known to be safe:
24533 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
24534 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
24535 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
24536 -pedantic-errors}
24538 @end itemize
24540 For all of these except the last, the compiler automatically
24541 ignores the precompiled header if the conditions aren't met.  If you
24542 find an option combination that doesn't work and doesn't cause the
24543 precompiled header to be ignored, please consider filing a bug report,
24544 see @ref{Bugs}.
24546 If you do use differing options when generating and using the
24547 precompiled header, the actual behavior is a mixture of the
24548 behavior for the options.  For instance, if you use @option{-g} to
24549 generate the precompiled header but not when using it, you may or may
24550 not get debugging information for routines in the precompiled header.