Merge of the scalar-storage-order branch.
[platform/upstream/gcc.git] / gcc / doc / invoke.texi
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.
4
5 @ignore
6 @c man begin INCLUDE
7 @include gcc-vers.texi
8 @c man end
9
10 @c man begin COPYRIGHT
11 Copyright @copyright{} 1988-2015 Free Software Foundation, Inc.
12
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.
20
21 (a) The FSF's Front-Cover Text is:
22
23      A GNU Manual
24
25 (b) The FSF's Back-Cover Text is:
26
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{}
42
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
62
63 @node Invoking GCC
64 @chapter GCC Command Options
65 @cindex GCC command options
66 @cindex command options
67 @cindex options, GCC command
68
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.
75
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.
80
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.
87
88 @cindex C++ compilation options
89 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
90 options for compiling C++ programs.
91
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}}.
98
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.
106
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.
113
114 @c man end
115
116 @xref{Option Index}, for an index to GCC's options.
117
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
148
149 @c man begin OPTIONS
150
151 @node Option Summary
152 @section Option Summary
153
154 Here is a summary of all the options, grouped by type.  Explanations are
155 in the following sections.
156
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}}
165
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 -fsso-struct=@var{endianness}
173 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
174 -fsigned-bitfields  -fsigned-char @gol
175 -funsigned-bitfields  -funsigned-char @gol
176 -trigraphs -traditional -traditional-cpp}
177
178 @item C++ Language Options
179 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
180 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
181 -fconstexpr-depth=@var{n}  -ffriend-injection @gol
182 -fno-elide-constructors @gol
183 -fno-enforce-eh-specs @gol
184 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
185 -fno-implicit-templates @gol
186 -fno-implicit-inline-templates @gol
187 -fno-implement-inlines  -fms-extensions @gol
188 -fno-nonansi-builtins  -fnothrow-opt  -fno-operator-names @gol
189 -fno-optional-diags  -fpermissive @gol
190 -fno-pretty-templates @gol
191 -frepo  -fno-rtti -fsized-deallocation @gol
192 -fstats  -ftemplate-backtrace-limit=@var{n} @gol
193 -ftemplate-depth=@var{n} @gol
194 -fno-threadsafe-statics  -fuse-cxa-atexit @gol
195 -fno-weak  -nostdinc++ @gol
196 -fvisibility-inlines-hidden @gol
197 -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]} @gol
198 -fvtv-counts -fvtv-debug @gol
199 -fvisibility-ms-compat @gol
200 -fext-numeric-literals @gol
201 -Wabi=@var{n}  -Wabi-tag  -Wconversion-null  -Wctor-dtor-privacy @gol
202 -Wdelete-non-virtual-dtor -Wliteral-suffix -Wmultiple-inheritance @gol
203 -Wnamespaces -Wnarrowing @gol
204 -Wnoexcept -Wnon-virtual-dtor  -Wreorder @gol
205 -Weffc++  -Wstrict-null-sentinel -Wtemplates @gol
206 -Wno-non-template-friend  -Wold-style-cast @gol
207 -Woverloaded-virtual  -Wno-pmf-conversions @gol
208 -Wsign-promo -Wvirtual-inheritance}
209
210 @item Objective-C and Objective-C++ Language Options
211 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
212 Objective-C and Objective-C++ Dialects}.
213 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
214 -fgnu-runtime  -fnext-runtime @gol
215 -fno-nil-receivers @gol
216 -fobjc-abi-version=@var{n} @gol
217 -fobjc-call-cxx-cdtors @gol
218 -fobjc-direct-dispatch @gol
219 -fobjc-exceptions @gol
220 -fobjc-gc @gol
221 -fobjc-nilcheck @gol
222 -fobjc-std=objc1 @gol
223 -fno-local-ivars @gol
224 -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]} @gol
225 -freplace-objc-classes @gol
226 -fzero-link @gol
227 -gen-decls @gol
228 -Wassign-intercept @gol
229 -Wno-protocol  -Wselector @gol
230 -Wstrict-selector-match @gol
231 -Wundeclared-selector}
232
233 @item Diagnostic Message Formatting Options
234 @xref{Diagnostic Message Formatting Options,,Options to Control Diagnostic Messages Formatting}.
235 @gccoptlist{-fmessage-length=@var{n}  @gol
236 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
237 -fdiagnostics-color=@r{[}auto@r{|}never@r{|}always@r{]}  @gol
238 -fno-diagnostics-show-option -fno-diagnostics-show-caret}
239
240 @item Warning Options
241 @xref{Warning Options,,Options to Request or Suppress Warnings}.
242 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -Wpedantic @gol
243 -pedantic-errors @gol
244 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  @gol
245 -Waggressive-loop-optimizations -Warray-bounds -Warray-bounds=@var{n} @gol
246 -Wbool-compare -Wduplicated-cond -Wframe-address @gol
247 -Wno-attributes -Wno-builtin-macro-redefined @gol
248 -Wc90-c99-compat -Wc99-c11-compat @gol
249 -Wc++-compat -Wc++11-compat -Wc++14-compat -Wcast-align  -Wcast-qual  @gol
250 -Wchar-subscripts -Wclobbered  -Wcomment -Wconditionally-supported  @gol
251 -Wconversion -Wcoverage-mismatch -Wdate-time -Wdelete-incomplete -Wno-cpp  @gol
252 -Wno-deprecated -Wno-deprecated-declarations -Wno-designated-init @gol
253 -Wdisabled-optimization @gol
254 -Wno-discarded-qualifiers -Wno-discarded-array-qualifiers @gol
255 -Wno-div-by-zero -Wdouble-promotion -Wempty-body  -Wenum-compare @gol
256 -Wno-endif-labels -Werror  -Werror=* @gol
257 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
258 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
259 -Wformat-security  -Wformat-signedness  -Wformat-y2k @gol
260 -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol
261 -Wignored-qualifiers  -Wincompatible-pointer-types @gol
262 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
263 -Winit-self  -Winline  -Wno-int-conversion @gol
264 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
265 -Wnull-dereference @gol
266 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
267 -Wlogical-op -Wlogical-not-parentheses -Wlong-long @gol
268 -Wmain -Wmaybe-uninitialized -Wmemset-transposed-args @gol
269 -Wmisleading-indentation -Wmissing-braces @gol
270 -Wmissing-field-initializers -Wmissing-include-dirs @gol
271 -Wno-multichar  -Wnonnull  -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]} @gol
272 -Wodr  -Wno-overflow  -Wopenmp-simd @gol
273 -Woverride-init-side-effects @gol
274 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
275 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
276 -Wplacement-new -Wpointer-arith  -Wno-pointer-to-int-cast @gol
277 -Wredundant-decls  -Wno-return-local-addr @gol
278 -Wreturn-type  -Wsequence-point  -Wshadow  -Wno-shadow-ivar @gol
279 -Wshift-overflow -Wshift-overflow=@var{n} @gol
280 -Wshift-count-negative -Wshift-count-overflow -Wshift-negative-value @gol
281 -Wsign-compare  -Wsign-conversion -Wfloat-conversion @gol
282 -Wno-scalar-storage-order @gol
283 -Wsizeof-pointer-memaccess  -Wsizeof-array-argument @gol
284 -Wstack-protector -Wstack-usage=@var{len} -Wstrict-aliasing @gol
285 -Wstrict-aliasing=n @gol -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
286 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]} @gol
287 -Wsuggest-final-types @gol -Wsuggest-final-methods -Wsuggest-override @gol
288 -Wmissing-format-attribute -Wsubobject-linkage @gol
289 -Wswitch  -Wswitch-default  -Wswitch-enum -Wswitch-bool -Wsync-nand @gol
290 -Wsystem-headers  -Wtautological-compare  -Wtrampolines  -Wtrigraphs @gol
291 -Wtype-limits  -Wundef @gol
292 -Wuninitialized  -Wunknown-pragmas  -Wno-pragmas @gol
293 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
294 -Wunused-label  -Wunused-local-typedefs -Wunused-parameter @gol
295 -Wno-unused-result -Wunused-value @gol -Wunused-variable @gol
296 -Wunused-const-variable @gol
297 -Wunused-but-set-parameter -Wunused-but-set-variable @gol
298 -Wuseless-cast -Wvariadic-macros -Wvector-operation-performance @gol
299 -Wvla -Wvolatile-register-var  -Wwrite-strings @gol
300 -Wzero-as-null-pointer-constant}
301
302 @item C and Objective-C-only Warning Options
303 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
304 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
305 -Wold-style-declaration  -Wold-style-definition @gol
306 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
307 -Wdeclaration-after-statement -Wpointer-sign}
308
309 @item Debugging Options
310 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
311 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
312 -fsanitize=@var{style} -fsanitize-recover -fsanitize-recover=@var{style} @gol
313 -fasan-shadow-offset=@var{number} -fsanitize-sections=@var{s1},@var{s2},... @gol
314 -fsanitize-undefined-trap-on-error @gol
315 -fcheck-pointer-bounds -fchecking -fchkp-check-incomplete-type @gol
316 -fchkp-first-field-has-own-bounds -fchkp-narrow-bounds @gol
317 -fchkp-narrow-to-innermost-array -fchkp-optimize @gol
318 -fchkp-use-fast-string-functions -fchkp-use-nochk-string-functions @gol
319 -fchkp-use-static-bounds -fchkp-use-static-const-bounds @gol
320 -fchkp-treat-zero-dynamic-size-as-infinite -fchkp-check-read @gol
321 -fchkp-check-read -fchkp-check-write -fchkp-store-bounds @gol
322 -fchkp-instrument-calls -fchkp-instrument-marked-only @gol
323 -fchkp-use-wrappers @gol
324 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
325 -fdisable-ipa-@var{pass_name} @gol
326 -fdisable-rtl-@var{pass_name} @gol
327 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
328 -fdisable-tree-@var{pass_name} @gol
329 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
330 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
331 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
332 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
333 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
334 -fdump-passes @gol
335 -fdump-statistics @gol
336 -fdump-tree-all @gol
337 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
338 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
339 -fdump-tree-cfg -fdump-tree-alias @gol
340 -fdump-tree-ch @gol
341 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
342 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
343 -fdump-tree-gimple@r{[}-raw@r{]} @gol
344 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
345 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
346 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
347 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
348 -fdump-tree-backprop@r{[}-@var{n}@r{]} @gol
349 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
350 -fdump-tree-nrv -fdump-tree-vect @gol
351 -fdump-tree-sink @gol
352 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
353 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
354 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
355 -fdump-tree-vtable-verify @gol
356 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
357 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
358 -fdump-final-insns=@var{file} @gol
359 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
360 -feliminate-dwarf2-dups -fno-eliminate-unused-debug-types @gol
361 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
362 -fenable-@var{kind}-@var{pass} @gol
363 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
364 -fdebug-types-section -fmem-report-wpa @gol
365 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
366 -fopt-info @gol
367 -fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
368 -frandom-seed=@var{number} -fsched-verbose=@var{n} @gol
369 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
370 -fstack-usage  -ftest-coverage  -ftime-report -fvar-tracking @gol
371 -fvar-tracking-assignments  -fvar-tracking-assignments-toggle @gol
372 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
373 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
374 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
375 -gvms  -gxcoff  -gxcoff+ -gz@r{[}=@var{type}@r{]} @gol
376 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
377 -fdebug-prefix-map=@var{old}=@var{new} @gol
378 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
379 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
380 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
381 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
382 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
383 -print-sysroot -print-sysroot-headers-suffix @gol
384 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
385
386 @item Optimization Options
387 @xref{Optimize Options,,Options that Control Optimization}.
388 @gccoptlist{-faggressive-loop-optimizations -falign-functions[=@var{n}] @gol
389 -falign-jumps[=@var{n}] @gol
390 -falign-labels[=@var{n}] -falign-loops[=@var{n}] @gol
391 -fassociative-math -fauto-profile -fauto-profile[=@var{path}] @gol
392 -fauto-inc-dec -fbranch-probabilities @gol
393 -fbranch-target-load-optimize -fbranch-target-load-optimize2 @gol
394 -fbtr-bb-exclusive -fcaller-saves @gol
395 -fcombine-stack-adjustments -fconserve-stack @gol
396 -fcompare-elim -fcprop-registers -fcrossjumping @gol
397 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
398 -fcx-limited-range @gol
399 -fdata-sections -fdce -fdelayed-branch @gol
400 -fdelete-null-pointer-checks -fdevirtualize -fdevirtualize-speculatively @gol
401 -fdevirtualize-at-ltrans -fdse @gol
402 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects @gol
403 -ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
404 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
405 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
406 -fgcse-sm -fhoist-adjacent-loads -fif-conversion @gol
407 -fif-conversion2 -findirect-inlining @gol
408 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
409 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-cp-alignment @gol
410 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference -fipa-icf @gol
411 -fira-algorithm=@var{algorithm} @gol
412 -fira-region=@var{region} -fira-hoist-pressure @gol
413 -fira-loop-pressure -fno-ira-share-save-slots @gol
414 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
415 -fisolate-erroneous-paths-dereference -fisolate-erroneous-paths-attribute @gol
416 -fivopts -fkeep-inline-functions -fkeep-static-functions @gol
417 -fkeep-static-consts -flive-range-shrinkage @gol
418 -floop-block -floop-interchange -floop-strip-mine @gol
419 -floop-unroll-and-jam -floop-nest-optimize @gol
420 -floop-parallelize-all -flra-remat -flto -flto-compression-level @gol
421 -flto-partition=@var{alg} -flto-report -flto-report-wpa -fmerge-all-constants @gol
422 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
423 -fmove-loop-invariants -fno-branch-count-reg @gol
424 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
425 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
426 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
427 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
428 -fomit-frame-pointer -foptimize-sibling-calls @gol
429 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
430 -fprefetch-loop-arrays -fprofile-report @gol
431 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
432 -fprofile-generate=@var{path} @gol
433 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
434 -fprofile-reorder-functions @gol
435 -freciprocal-math -free -frename-registers -freorder-blocks @gol
436 -freorder-blocks-algorithm=@var{algorithm} @gol
437 -freorder-blocks-and-partition -freorder-functions @gol
438 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
439 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
440 -fsched-spec-load -fsched-spec-load-dangerous @gol
441 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
442 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
443 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
444 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
445 -fschedule-fusion @gol
446 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
447 -fselective-scheduling -fselective-scheduling2 @gol
448 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
449 -fsemantic-interposition -fshrink-wrap -fsignaling-nans @gol
450 -fsingle-precision-constant -fsplit-ivs-in-unroller @gol
451 -fsplit-wide-types -fssa-backprop -fssa-phiopt @gol
452 -fstack-protector -fstack-protector-all -fstack-protector-strong @gol
453 -fstack-protector-explicit -fstdarg-opt -fstrict-aliasing @gol
454 -fstrict-overflow -fthread-jumps -ftracer -ftree-bit-ccp @gol
455 -ftree-builtin-call-dce -ftree-ccp -ftree-ch @gol
456 -ftree-coalesce-vars -ftree-copy-prop -ftree-dce -ftree-dominator-opts @gol
457 -ftree-dse -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
458 -ftree-loop-if-convert-stores -ftree-loop-im @gol
459 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
460 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
461 -ftree-loop-vectorize @gol
462 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-partial-pre -ftree-pta @gol
463 -ftree-reassoc -ftree-sink -ftree-slsr -ftree-sra @gol
464 -ftree-switch-conversion -ftree-tail-merge -ftree-ter @gol
465 -ftree-vectorize -ftree-vrp @gol
466 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
467 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
468 -fipa-ra -fvariable-expansion-in-unroller -fvect-cost-model -fvpt @gol
469 -fweb -fwhole-program -fwpa -fuse-linker-plugin @gol
470 --param @var{name}=@var{value}
471 -O  -O0  -O1  -O2  -O3  -Os -Ofast -Og}
472
473 @item Preprocessor Options
474 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
475 @gccoptlist{-A@var{question}=@var{answer} @gol
476 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
477 -C  -dD  -dI  -dM  -dN @gol
478 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
479 -idirafter @var{dir} @gol
480 -include @var{file}  -imacros @var{file} @gol
481 -iprefix @var{file}  -iwithprefix @var{dir} @gol
482 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
483 -imultilib @var{dir} -isysroot @var{dir} @gol
484 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
485 -P  -fdebug-cpp -ftrack-macro-expansion -fworking-directory @gol
486 -remap -trigraphs  -undef  -U@var{macro}  @gol
487 -Wp,@var{option} -Xpreprocessor @var{option} -no-integrated-cpp}
488
489 @item Assembler Option
490 @xref{Assembler Options,,Passing Options to the Assembler}.
491 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
492
493 @item Linker Options
494 @xref{Link Options,,Options for Linking}.
495 @gccoptlist{@var{object-file-name}  -fuse-ld=@var{linker} -l@var{library} @gol
496 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
497 -s  -static -static-libgcc -static-libstdc++ @gol
498 -static-libasan -static-libtsan -static-liblsan -static-libubsan @gol
499 -static-libmpx -static-libmpxwrappers @gol
500 -shared -shared-libgcc  -symbolic @gol
501 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
502 -u @var{symbol} -z @var{keyword}}
503
504 @item Directory Options
505 @xref{Directory Options,,Options for Directory Search}.
506 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
507 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol
508 --sysroot=@var{dir} --no-sysroot-suffix}
509
510 @item Machine Dependent Options
511 @xref{Submodel Options,,Hardware Models and Configurations}.
512 @c This list is ordered alphanumerically by subsection name.
513 @c Try and put the significant identifier (CPU or system) first,
514 @c so users have a clue at guessing where the ones they want will be.
515
516 @emph{AArch64 Options}
517 @gccoptlist{-mabi=@var{name}  -mbig-endian  -mlittle-endian @gol
518 -mgeneral-regs-only @gol
519 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
520 -mstrict-align @gol
521 -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
522 -mtls-dialect=desc  -mtls-dialect=traditional @gol
523 -mtls-size=@var{size} @gol
524 -mfix-cortex-a53-835769  -mno-fix-cortex-a53-835769 @gol
525 -mfix-cortex-a53-843419  -mno-fix-cortex-a53-843419 @gol
526 -mlow-precision-recip-sqrt -mno-low-precision-recip-sqrt@gol
527 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}}
528
529 @emph{Adapteva Epiphany Options}
530 @gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs @gol
531 -mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf @gol
532 -msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} @gol
533 -mround-nearest -mlong-calls -mshort-calls -msmall16 @gol
534 -mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} @gol
535 -msplit-vecmove-early -m1reg-@var{reg}}
536
537 @emph{ARC Options}
538 @gccoptlist{-mbarrel-shifter @gol
539 -mcpu=@var{cpu} -mA6 -mARC600 -mA7 -mARC700 @gol
540 -mdpfp -mdpfp-compact -mdpfp-fast -mno-dpfp-lrsr @gol
541 -mea -mno-mpy -mmul32x16 -mmul64 @gol
542 -mnorm -mspfp -mspfp-compact -mspfp-fast -msimd -msoft-float -mswap @gol
543 -mcrc -mdsp-packa -mdvbf -mlock -mmac-d16 -mmac-24 -mrtsc -mswape @gol
544 -mtelephony -mxy -misize -mannotate-align -marclinux -marclinux_prof @gol
545 -mepilogue-cfi -mlong-calls -mmedium-calls -msdata @gol
546 -mucb-mcount -mvolatile-cache @gol
547 -malign-call -mauto-modify-reg -mbbit-peephole -mno-brcc @gol
548 -mcase-vector-pcrel -mcompact-casesi -mno-cond-exec -mearly-cbranchsi @gol
549 -mexpand-adddi -mindexed-loads -mlra -mlra-priority-none @gol
550 -mlra-priority-compact mlra-priority-noncompact -mno-millicode @gol
551 -mmixed-code -mq-class -mRcq -mRcw -msize-level=@var{level} @gol
552 -mtune=@var{cpu} -mmultcost=@var{num} -munalign-prob-threshold=@var{probability}}
553
554 @emph{ARM Options}
555 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
556 -mabi=@var{name} @gol
557 -mapcs-stack-check  -mno-apcs-stack-check @gol
558 -mapcs-float  -mno-apcs-float @gol
559 -mapcs-reentrant  -mno-apcs-reentrant @gol
560 -msched-prolog  -mno-sched-prolog @gol
561 -mlittle-endian  -mbig-endian @gol
562 -mfloat-abi=@var{name} @gol
563 -mfp16-format=@var{name}
564 -mthumb-interwork  -mno-thumb-interwork @gol
565 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
566 -mtune=@var{name} -mprint-tune-info @gol
567 -mstructure-size-boundary=@var{n} @gol
568 -mabort-on-noreturn @gol
569 -mlong-calls  -mno-long-calls @gol
570 -msingle-pic-base  -mno-single-pic-base @gol
571 -mpic-register=@var{reg} @gol
572 -mnop-fun-dllimport @gol
573 -mpoke-function-name @gol
574 -mthumb  -marm @gol
575 -mtpcs-frame  -mtpcs-leaf-frame @gol
576 -mcaller-super-interworking  -mcallee-super-interworking @gol
577 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
578 -mword-relocations @gol
579 -mfix-cortex-m3-ldrd @gol
580 -munaligned-access @gol
581 -mneon-for-64bits @gol
582 -mslow-flash-data @gol
583 -masm-syntax-unified @gol
584 -mrestrict-it}
585
586 @emph{AVR Options}
587 @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
588 -mcall-prologues -mint8 -mn_flash=@var{size} -mno-interrupts @gol
589 -mrelax -mrmw -mstrict-X -mtiny-stack -nodevicelib -Waddr-space-convert}
590
591 @emph{Blackfin Options}
592 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
593 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
594 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
595 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
596 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
597 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
598 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
599 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
600 -micplb}
601
602 @emph{C6X Options}
603 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
604 -msim -msdata=@var{sdata-type}}
605
606 @emph{CRIS Options}
607 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
608 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
609 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
610 -mstack-align  -mdata-align  -mconst-align @gol
611 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
612 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
613 -mmul-bug-workaround  -mno-mul-bug-workaround}
614
615 @emph{CR16 Options}
616 @gccoptlist{-mmac @gol
617 -mcr16cplus -mcr16c @gol
618 -msim -mint32 -mbit-ops
619 -mdata-model=@var{model}}
620
621 @emph{Darwin Options}
622 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
623 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
624 -client_name  -compatibility_version  -current_version @gol
625 -dead_strip @gol
626 -dependency-file  -dylib_file  -dylinker_install_name @gol
627 -dynamic  -dynamiclib  -exported_symbols_list @gol
628 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
629 -force_flat_namespace  -headerpad_max_install_names @gol
630 -iframework @gol
631 -image_base  -init  -install_name  -keep_private_externs @gol
632 -multi_module  -multiply_defined  -multiply_defined_unused @gol
633 -noall_load   -no_dead_strip_inits_and_terms @gol
634 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
635 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
636 -private_bundle  -read_only_relocs  -sectalign @gol
637 -sectobjectsymbols  -whyload  -seg1addr @gol
638 -sectcreate  -sectobjectsymbols  -sectorder @gol
639 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
640 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
641 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
642 -single_module  -static  -sub_library  -sub_umbrella @gol
643 -twolevel_namespace  -umbrella  -undefined @gol
644 -unexported_symbols_list  -weak_reference_mismatches @gol
645 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
646 -mkernel -mone-byte-bool}
647
648 @emph{DEC Alpha Options}
649 @gccoptlist{-mno-fp-regs  -msoft-float @gol
650 -mieee  -mieee-with-inexact  -mieee-conformant @gol
651 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
652 -mtrap-precision=@var{mode}  -mbuild-constants @gol
653 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
654 -mbwx  -mmax  -mfix  -mcix @gol
655 -mfloat-vax  -mfloat-ieee @gol
656 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
657 -msmall-text  -mlarge-text @gol
658 -mmemory-latency=@var{time}}
659
660 @emph{FR30 Options}
661 @gccoptlist{-msmall-model -mno-lsim}
662
663 @emph{FT32 Options}
664 @gccoptlist{-msim -mlra}
665
666 @emph{FRV Options}
667 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
668 -mhard-float  -msoft-float @gol
669 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
670 -mdouble  -mno-double @gol
671 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
672 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
673 -mlinked-fp  -mlong-calls  -malign-labels @gol
674 -mlibrary-pic  -macc-4  -macc-8 @gol
675 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
676 -moptimize-membar -mno-optimize-membar @gol
677 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
678 -mvliw-branch  -mno-vliw-branch @gol
679 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
680 -mno-nested-cond-exec  -mtomcat-stats @gol
681 -mTLS -mtls @gol
682 -mcpu=@var{cpu}}
683
684 @emph{GNU/Linux Options}
685 @gccoptlist{-mglibc -muclibc -mmusl -mbionic -mandroid @gol
686 -tno-android-cc -tno-android-ld}
687
688 @emph{H8/300 Options}
689 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr -mno-exr  -mint32  -malign-300}
690
691 @emph{HPPA Options}
692 @gccoptlist{-march=@var{architecture-type} @gol
693 -mdisable-fpregs  -mdisable-indexing @gol
694 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
695 -mfixed-range=@var{register-range} @gol
696 -mjump-in-delay -mlinker-opt -mlong-calls @gol
697 -mlong-load-store  -mno-disable-fpregs @gol
698 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
699 -mno-jump-in-delay  -mno-long-load-store @gol
700 -mno-portable-runtime  -mno-soft-float @gol
701 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
702 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
703 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
704 -munix=@var{unix-std}  -nolibdld  -static  -threads}
705
706 @emph{IA-64 Options}
707 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
708 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
709 -mconstant-gp  -mauto-pic  -mfused-madd @gol
710 -minline-float-divide-min-latency @gol
711 -minline-float-divide-max-throughput @gol
712 -mno-inline-float-divide @gol
713 -minline-int-divide-min-latency @gol
714 -minline-int-divide-max-throughput  @gol
715 -mno-inline-int-divide @gol
716 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
717 -mno-inline-sqrt @gol
718 -mdwarf2-asm -mearly-stop-bits @gol
719 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
720 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
721 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
722 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
723 -msched-spec-ldc -msched-spec-control-ldc @gol
724 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
725 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
726 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
727 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
728
729 @emph{LM32 Options}
730 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
731 -msign-extend-enabled -muser-enabled}
732
733 @emph{M32R/D Options}
734 @gccoptlist{-m32r2 -m32rx -m32r @gol
735 -mdebug @gol
736 -malign-loops -mno-align-loops @gol
737 -missue-rate=@var{number} @gol
738 -mbranch-cost=@var{number} @gol
739 -mmodel=@var{code-size-model-type} @gol
740 -msdata=@var{sdata-type} @gol
741 -mno-flush-func -mflush-func=@var{name} @gol
742 -mno-flush-trap -mflush-trap=@var{number} @gol
743 -G @var{num}}
744
745 @emph{M32C Options}
746 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
747
748 @emph{M680x0 Options}
749 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune} @gol
750 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
751 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
752 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
753 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
754 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
755 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
756 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
757 -mxgot -mno-xgot}
758
759 @emph{MCore Options}
760 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
761 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
762 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
763 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
764 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
765
766 @emph{MeP Options}
767 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
768 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
769 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
770 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
771 -mtiny=@var{n}}
772
773 @emph{MicroBlaze Options}
774 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
775 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
776 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
777 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
778 -mbig-endian -mlittle-endian -mxl-reorder -mxl-mode-@var{app-model}}
779
780 @emph{MIPS Options}
781 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
782 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips32r3  -mips32r5 @gol
783 -mips32r6  -mips64  -mips64r2  -mips64r3  -mips64r5  -mips64r6 @gol
784 -mips16  -mno-mips16  -mflip-mips16 @gol
785 -minterlink-compressed -mno-interlink-compressed @gol
786 -minterlink-mips16  -mno-interlink-mips16 @gol
787 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
788 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
789 -mgp32  -mgp64  -mfp32  -mfpxx  -mfp64  -mhard-float  -msoft-float @gol
790 -mno-float  -msingle-float  -mdouble-float @gol
791 -modd-spreg -mno-odd-spreg @gol
792 -mcompact-branches=@var{policy} @gol
793 -mabs=@var{mode}  -mnan=@var{encoding} @gol
794 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
795 -mmcu -mmno-mcu @gol
796 -meva -mno-eva @gol
797 -mvirt -mno-virt @gol
798 -mxpa -mno-xpa @gol
799 -mmicromips -mno-micromips @gol
800 -mfpu=@var{fpu-type} @gol
801 -msmartmips  -mno-smartmips @gol
802 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
803 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
804 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
805 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
806 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
807 -membedded-data  -mno-embedded-data @gol
808 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
809 -mcode-readable=@var{setting} @gol
810 -msplit-addresses  -mno-split-addresses @gol
811 -mexplicit-relocs  -mno-explicit-relocs @gol
812 -mcheck-zero-division  -mno-check-zero-division @gol
813 -mdivide-traps  -mdivide-breaks @gol
814 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
815 -mmad -mno-mad -mimadd -mno-imadd -mfused-madd  -mno-fused-madd  -nocpp @gol
816 -mfix-24k -mno-fix-24k @gol
817 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
818 -mfix-r10000 -mno-fix-r10000  -mfix-rm7000 -mno-fix-rm7000 @gol
819 -mfix-vr4120  -mno-fix-vr4120 @gol
820 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
821 -mflush-func=@var{func}  -mno-flush-func @gol
822 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
823 -mfp-exceptions -mno-fp-exceptions @gol
824 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
825 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address @gol
826 -mframe-header-opt -mno-frame-header-opt}
827
828 @emph{MMIX Options}
829 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
830 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
831 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
832 -mno-base-addresses  -msingle-exit  -mno-single-exit}
833
834 @emph{MN10300 Options}
835 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
836 -mno-am33 -mam33 -mam33-2 -mam34 @gol
837 -mtune=@var{cpu-type} @gol
838 -mreturn-pointer-on-d0 @gol
839 -mno-crt0  -mrelax -mliw -msetlb}
840
841 @emph{Moxie Options}
842 @gccoptlist{-meb -mel -mmul.x -mno-crt0}
843
844 @emph{MSP430 Options}
845 @gccoptlist{-msim -masm-hex -mmcu= -mcpu= -mlarge -msmall -mrelax @gol
846 -mcode-region= -mdata-region= @gol
847 -msilicon-errata= -msilicon-errata-warn= @gol
848 -mhwmult= -minrt}
849
850 @emph{NDS32 Options}
851 @gccoptlist{-mbig-endian -mlittle-endian @gol
852 -mreduced-regs -mfull-regs @gol
853 -mcmov -mno-cmov @gol
854 -mperf-ext -mno-perf-ext @gol
855 -mv3push -mno-v3push @gol
856 -m16bit -mno-16bit @gol
857 -misr-vector-size=@var{num} @gol
858 -mcache-block-size=@var{num} @gol
859 -march=@var{arch} @gol
860 -mcmodel=@var{code-model} @gol
861 -mctor-dtor -mrelax}
862
863 @emph{Nios II Options}
864 @gccoptlist{-G @var{num} -mgpopt=@var{option} -mgpopt -mno-gpopt @gol
865 -mel -meb @gol
866 -mno-bypass-cache -mbypass-cache @gol
867 -mno-cache-volatile -mcache-volatile @gol
868 -mno-fast-sw-div -mfast-sw-div @gol
869 -mhw-mul -mno-hw-mul -mhw-mulx -mno-hw-mulx -mno-hw-div -mhw-div @gol
870 -mcustom-@var{insn}=@var{N} -mno-custom-@var{insn} @gol
871 -mcustom-fpu-cfg=@var{name} @gol
872 -mhal -msmallc -msys-crt0=@var{name} -msys-lib=@var{name} @gol
873 -march=@var{arch} -mbmx -mno-bmx -mcdx -mno-cdx}
874
875 @emph{Nvidia PTX Options}
876 @gccoptlist{-m32 -m64 -mmainkernel}
877
878 @emph{PDP-11 Options}
879 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
880 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
881 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
882 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
883 -mbranch-expensive  -mbranch-cheap @gol
884 -munix-asm  -mdec-asm}
885
886 @emph{picoChip Options}
887 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
888 -msymbol-as-address -mno-inefficient-warnings}
889
890 @emph{PowerPC Options}
891 See RS/6000 and PowerPC Options.
892
893 @emph{RL78 Options}
894 @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=g14 -mallregs @gol
895 -mcpu=g10 -mcpu=g13 -mcpu=g14 -mg10 -mg13 -mg14 @gol
896 -m64bit-doubles -m32bit-doubles}
897
898 @emph{RS/6000 and PowerPC Options}
899 @gccoptlist{-mcpu=@var{cpu-type} @gol
900 -mtune=@var{cpu-type} @gol
901 -mcmodel=@var{code-model} @gol
902 -mpowerpc64 @gol
903 -maltivec  -mno-altivec @gol
904 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
905 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
906 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
907 -mfprnd  -mno-fprnd @gol
908 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
909 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
910 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
911 -malign-power  -malign-natural @gol
912 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
913 -msingle-float -mdouble-float -msimple-fpu @gol
914 -mstring  -mno-string  -mupdate  -mno-update @gol
915 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
916 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
917 -mstrict-align  -mno-strict-align  -mrelocatable @gol
918 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
919 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
920 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
921 -mprioritize-restricted-insns=@var{priority} @gol
922 -msched-costly-dep=@var{dependence_type} @gol
923 -minsert-sched-nops=@var{scheme} @gol
924 -mcall-sysv  -mcall-netbsd @gol
925 -maix-struct-return  -msvr4-struct-return @gol
926 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
927 -mblock-move-inline-limit=@var{num} @gol
928 -misel -mno-isel @gol
929 -misel=yes  -misel=no @gol
930 -mspe -mno-spe @gol
931 -mspe=yes  -mspe=no @gol
932 -mpaired @gol
933 -mgen-cell-microcode -mwarn-cell-microcode @gol
934 -mvrsave -mno-vrsave @gol
935 -mmulhw -mno-mulhw @gol
936 -mdlmzb -mno-dlmzb @gol
937 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
938 -mprototype  -mno-prototype @gol
939 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
940 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
941 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
942 -mno-recip-precision @gol
943 -mveclibabi=@var{type} -mfriz -mno-friz @gol
944 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
945 -msave-toc-indirect -mno-save-toc-indirect @gol
946 -mpower8-fusion -mno-mpower8-fusion -mpower8-vector -mno-power8-vector @gol
947 -mcrypto -mno-crypto -mdirect-move -mno-direct-move @gol
948 -mquad-memory -mno-quad-memory @gol
949 -mquad-memory-atomic -mno-quad-memory-atomic @gol
950 -mcompat-align-parm -mno-compat-align-parm @gol
951 -mupper-regs-df -mno-upper-regs-df -mupper-regs-sf -mno-upper-regs-sf @gol
952 -mupper-regs -mno-upper-regs @gol
953 -mfloat128 -mno-float128}
954
955 @emph{RX Options}
956 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
957 -mcpu=@gol
958 -mbig-endian-data -mlittle-endian-data @gol
959 -msmall-data @gol
960 -msim  -mno-sim@gol
961 -mas100-syntax -mno-as100-syntax@gol
962 -mrelax@gol
963 -mmax-constant-size=@gol
964 -mint-register=@gol
965 -mpid@gol
966 -mallow-string-insns -mno-allow-string-insns@gol
967 -mno-warn-multiple-fast-interrupts@gol
968 -msave-acc-in-interrupts}
969
970 @emph{S/390 and zSeries Options}
971 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
972 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
973 -mlong-double-64 -mlong-double-128 @gol
974 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
975 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
976 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
977 -mhtm -mvx -mzvector @gol
978 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
979 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard @gol
980 -mhotpatch=@var{halfwords},@var{halfwords}}
981
982 @emph{Score Options}
983 @gccoptlist{-meb -mel @gol
984 -mnhwloop @gol
985 -muls @gol
986 -mmac @gol
987 -mscore5 -mscore5u -mscore7 -mscore7d}
988
989 @emph{SH Options}
990 @gccoptlist{-m1  -m2  -m2e @gol
991 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
992 -m3  -m3e @gol
993 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
994 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
995 -mb  -ml  -mdalign  -mrelax @gol
996 -mbigtable -mfmovd -mrenesas -mno-renesas -mnomacsave @gol
997 -mieee -mno-ieee -mbitops  -misize  -minline-ic_invalidate -mpadstruct @gol
998 -mspace -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
999 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
1000 -maccumulate-outgoing-args @gol
1001 -matomic-model=@var{atomic-model} @gol
1002 -mbranch-cost=@var{num} -mzdcbranch -mno-zdcbranch @gol
1003 -mcbranch-force-delay-slot @gol
1004 -mfused-madd -mno-fused-madd -mfsca -mno-fsca -mfsrra -mno-fsrra @gol
1005 -mpretend-cmove -mtas}
1006
1007 @emph{Solaris 2 Options}
1008 @gccoptlist{-mclear-hwcap -mno-clear-hwcap -mimpure-text  -mno-impure-text @gol
1009 -pthreads -pthread}
1010
1011 @emph{SPARC Options}
1012 @gccoptlist{-mcpu=@var{cpu-type} @gol
1013 -mtune=@var{cpu-type} @gol
1014 -mcmodel=@var{code-model} @gol
1015 -mmemory-model=@var{mem-model} @gol
1016 -m32  -m64  -mapp-regs  -mno-app-regs @gol
1017 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
1018 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
1019 -mhard-quad-float  -msoft-quad-float @gol
1020 -mstack-bias  -mno-stack-bias @gol
1021 -munaligned-doubles  -mno-unaligned-doubles @gol
1022 -muser-mode  -mno-user-mode @gol
1023 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
1024 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
1025 -mcbcond -mno-cbcond @gol
1026 -mfmaf  -mno-fmaf  -mpopc  -mno-popc @gol
1027 -mfix-at697f -mfix-ut699}
1028
1029 @emph{SPU Options}
1030 @gccoptlist{-mwarn-reloc -merror-reloc @gol
1031 -msafe-dma -munsafe-dma @gol
1032 -mbranch-hints @gol
1033 -msmall-mem -mlarge-mem -mstdmain @gol
1034 -mfixed-range=@var{register-range} @gol
1035 -mea32 -mea64 @gol
1036 -maddress-space-conversion -mno-address-space-conversion @gol
1037 -mcache-size=@var{cache-size} @gol
1038 -matomic-updates -mno-atomic-updates}
1039
1040 @emph{System V Options}
1041 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
1042
1043 @emph{TILE-Gx Options}
1044 @gccoptlist{-mcpu=CPU -m32 -m64 -mbig-endian -mlittle-endian @gol
1045 -mcmodel=@var{code-model}}
1046
1047 @emph{TILEPro Options}
1048 @gccoptlist{-mcpu=@var{cpu} -m32}
1049
1050 @emph{V850 Options}
1051 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
1052 -mprolog-function  -mno-prolog-function  -mspace @gol
1053 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
1054 -mapp-regs  -mno-app-regs @gol
1055 -mdisable-callt  -mno-disable-callt @gol
1056 -mv850e2v3 -mv850e2 -mv850e1 -mv850es @gol
1057 -mv850e -mv850 -mv850e3v5 @gol
1058 -mloop @gol
1059 -mrelax @gol
1060 -mlong-jumps @gol
1061 -msoft-float @gol
1062 -mhard-float @gol
1063 -mgcc-abi @gol
1064 -mrh850-abi @gol
1065 -mbig-switch}
1066
1067 @emph{VAX Options}
1068 @gccoptlist{-mg  -mgnu  -munix}
1069
1070 @emph{Visium Options}
1071 @gccoptlist{-mdebug -msim -mfpu -mno-fpu -mhard-float -msoft-float @gol
1072 -mcpu=@var{cpu-type} -mtune=@var{cpu-type} -msv-mode -muser-mode}
1073
1074 @emph{VMS Options}
1075 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64 @gol
1076 -mpointer-size=@var{size}}
1077
1078 @emph{VxWorks Options}
1079 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
1080 -Xbind-lazy  -Xbind-now}
1081
1082 @emph{x86 Options}
1083 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1084 -mtune-ctrl=@var{feature-list} -mdump-tune-features -mno-default @gol
1085 -mfpmath=@var{unit} @gol
1086 -masm=@var{dialect}  -mno-fancy-math-387 @gol
1087 -mno-fp-ret-in-387  -msoft-float @gol
1088 -mno-wide-multiply  -mrtd  -malign-double @gol
1089 -mpreferred-stack-boundary=@var{num} @gol
1090 -mincoming-stack-boundary=@var{num} @gol
1091 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
1092 -mrecip -mrecip=@var{opt} @gol
1093 -mvzeroupper -mprefer-avx128 @gol
1094 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
1095 -mavx2 -mavx512f -mavx512pf -mavx512er -mavx512cd -mavx512vl @gol
1096 -mavx512bw -mavx512dq -mavx512ifma -mavx512vbmi -msha -maes @gol
1097 -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma @gol
1098 -mprefetchwt1 -mclflushopt -mxsavec -mxsaves @gol
1099 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
1100 -mbmi2 -mfxsr -mxsave -mxsaveopt -mrtm -mlwp -mmpx -mmwaitx -mthreads @gol
1101 -mno-align-stringops  -minline-all-stringops @gol
1102 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
1103 -mmemcpy-strategy=@var{strategy} -mmemset-strategy=@var{strategy} @gol
1104 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
1105 -m96bit-long-double -mlong-double-64 -mlong-double-80 -mlong-double-128 @gol
1106 -mregparm=@var{num}  -msseregparm @gol
1107 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
1108 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
1109 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
1110 -mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
1111 -m32 -m64 -mx32 -m16 -miamcu -mlarge-data-threshold=@var{num} @gol
1112 -msse2avx -mfentry -mrecord-mcount -mnop-mcount -m8bit-idiv @gol
1113 -mavx256-split-unaligned-load -mavx256-split-unaligned-store @gol
1114 -malign-data=@var{type} -mstack-protector-guard=@var{guard}}
1115
1116 @emph{x86 Windows Options}
1117 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
1118 -mnop-fun-dllimport -mthread @gol
1119 -municode -mwin32 -mwindows -fno-set-stack-executable}
1120
1121 @emph{Xstormy16 Options}
1122 @gccoptlist{-msim}
1123
1124 @emph{Xtensa Options}
1125 @gccoptlist{-mconst16 -mno-const16 @gol
1126 -mfused-madd  -mno-fused-madd @gol
1127 -mforce-no-pic @gol
1128 -mserialize-volatile  -mno-serialize-volatile @gol
1129 -mtext-section-literals  -mno-text-section-literals @gol
1130 -mauto-litpools  -mno-auto-litpools @gol
1131 -mtarget-align  -mno-target-align @gol
1132 -mlongcalls  -mno-longcalls}
1133
1134 @emph{zSeries Options}
1135 See S/390 and zSeries Options.
1136
1137 @item Code Generation Options
1138 @xref{Code Gen Options,,Options for Code Generation Conventions}.
1139 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
1140 -ffixed-@var{reg}  -fexceptions @gol
1141 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
1142 -fasynchronous-unwind-tables @gol
1143 -fno-gnu-unique @gol
1144 -finhibit-size-directive  -finstrument-functions @gol
1145 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
1146 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
1147 -fno-common  -fno-ident @gol
1148 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE -fno-plt @gol
1149 -fno-jump-tables @gol
1150 -frecord-gcc-switches @gol
1151 -freg-struct-return  -fshort-enums @gol
1152 -fshort-double  -fshort-wchar @gol
1153 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
1154 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
1155 -fno-stack-limit -fsplit-stack @gol
1156 -fleading-underscore  -ftls-model=@var{model} @gol
1157 -fstack-reuse=@var{reuse_level} @gol
1158 -ftrapv  -fwrapv  -fbounds-check @gol
1159 -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]} @gol
1160 -fstrict-volatile-bitfields -fsync-libcalls}
1161 @end table
1162
1163
1164 @node Overall Options
1165 @section Options Controlling the Kind of Output
1166
1167 Compilation can involve up to four stages: preprocessing, compilation
1168 proper, assembly and linking, always in that order.  GCC is capable of
1169 preprocessing and compiling several files either into several
1170 assembler input files, or into one assembler input file; then each
1171 assembler input file produces an object file, and linking combines all
1172 the object files (those newly compiled, and those specified as input)
1173 into an executable file.
1174
1175 @cindex file name suffix
1176 For any given input file, the file name suffix determines what kind of
1177 compilation is done:
1178
1179 @table @gcctabopt
1180 @item @var{file}.c
1181 C source code that must be preprocessed.
1182
1183 @item @var{file}.i
1184 C source code that should not be preprocessed.
1185
1186 @item @var{file}.ii
1187 C++ source code that should not be preprocessed.
1188
1189 @item @var{file}.m
1190 Objective-C source code.  Note that you must link with the @file{libobjc}
1191 library to make an Objective-C program work.
1192
1193 @item @var{file}.mi
1194 Objective-C source code that should not be preprocessed.
1195
1196 @item @var{file}.mm
1197 @itemx @var{file}.M
1198 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1199 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1200 to a literal capital M@.
1201
1202 @item @var{file}.mii
1203 Objective-C++ source code that should not be preprocessed.
1204
1205 @item @var{file}.h
1206 C, C++, Objective-C or Objective-C++ header file to be turned into a
1207 precompiled header (default), or C, C++ header file to be turned into an
1208 Ada spec (via the @option{-fdump-ada-spec} switch).
1209
1210 @item @var{file}.cc
1211 @itemx @var{file}.cp
1212 @itemx @var{file}.cxx
1213 @itemx @var{file}.cpp
1214 @itemx @var{file}.CPP
1215 @itemx @var{file}.c++
1216 @itemx @var{file}.C
1217 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1218 the last two letters must both be literally @samp{x}.  Likewise,
1219 @samp{.C} refers to a literal capital C@.
1220
1221 @item @var{file}.mm
1222 @itemx @var{file}.M
1223 Objective-C++ source code that must be preprocessed.
1224
1225 @item @var{file}.mii
1226 Objective-C++ source code that should not be preprocessed.
1227
1228 @item @var{file}.hh
1229 @itemx @var{file}.H
1230 @itemx @var{file}.hp
1231 @itemx @var{file}.hxx
1232 @itemx @var{file}.hpp
1233 @itemx @var{file}.HPP
1234 @itemx @var{file}.h++
1235 @itemx @var{file}.tcc
1236 C++ header file to be turned into a precompiled header or Ada spec.
1237
1238 @item @var{file}.f
1239 @itemx @var{file}.for
1240 @itemx @var{file}.ftn
1241 Fixed form Fortran source code that should not be preprocessed.
1242
1243 @item @var{file}.F
1244 @itemx @var{file}.FOR
1245 @itemx @var{file}.fpp
1246 @itemx @var{file}.FPP
1247 @itemx @var{file}.FTN
1248 Fixed form Fortran source code that must be preprocessed (with the traditional
1249 preprocessor).
1250
1251 @item @var{file}.f90
1252 @itemx @var{file}.f95
1253 @itemx @var{file}.f03
1254 @itemx @var{file}.f08
1255 Free form Fortran source code that should not be preprocessed.
1256
1257 @item @var{file}.F90
1258 @itemx @var{file}.F95
1259 @itemx @var{file}.F03
1260 @itemx @var{file}.F08
1261 Free form Fortran source code that must be preprocessed (with the
1262 traditional preprocessor).
1263
1264 @item @var{file}.go
1265 Go source code.
1266
1267 @c FIXME: Descriptions of Java file types.
1268 @c @var{file}.java
1269 @c @var{file}.class
1270 @c @var{file}.zip
1271 @c @var{file}.jar
1272
1273 @item @var{file}.ads
1274 Ada source code file that contains a library unit declaration (a
1275 declaration of a package, subprogram, or generic, or a generic
1276 instantiation), or a library unit renaming declaration (a package,
1277 generic, or subprogram renaming declaration).  Such files are also
1278 called @dfn{specs}.
1279
1280 @item @var{file}.adb
1281 Ada source code file containing a library unit body (a subprogram or
1282 package body).  Such files are also called @dfn{bodies}.
1283
1284 @c GCC also knows about some suffixes for languages not yet included:
1285 @c Pascal:
1286 @c @var{file}.p
1287 @c @var{file}.pas
1288 @c Ratfor:
1289 @c @var{file}.r
1290
1291 @item @var{file}.s
1292 Assembler code.
1293
1294 @item @var{file}.S
1295 @itemx @var{file}.sx
1296 Assembler code that must be preprocessed.
1297
1298 @item @var{other}
1299 An object file to be fed straight into linking.
1300 Any file name with no recognized suffix is treated this way.
1301 @end table
1302
1303 @opindex x
1304 You can specify the input language explicitly with the @option{-x} option:
1305
1306 @table @gcctabopt
1307 @item -x @var{language}
1308 Specify explicitly the @var{language} for the following input files
1309 (rather than letting the compiler choose a default based on the file
1310 name suffix).  This option applies to all following input files until
1311 the next @option{-x} option.  Possible values for @var{language} are:
1312 @smallexample
1313 c  c-header  cpp-output
1314 c++  c++-header  c++-cpp-output
1315 objective-c  objective-c-header  objective-c-cpp-output
1316 objective-c++ objective-c++-header objective-c++-cpp-output
1317 assembler  assembler-with-cpp
1318 ada
1319 f77  f77-cpp-input f95  f95-cpp-input
1320 go
1321 java
1322 @end smallexample
1323
1324 @item -x none
1325 Turn off any specification of a language, so that subsequent files are
1326 handled according to their file name suffixes (as they are if @option{-x}
1327 has not been used at all).
1328
1329 @item -pass-exit-codes
1330 @opindex pass-exit-codes
1331 Normally the @command{gcc} program exits with the code of 1 if any
1332 phase of the compiler returns a non-success return code.  If you specify
1333 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1334 the numerically highest error produced by any phase returning an error
1335 indication.  The C, C++, and Fortran front ends return 4 if an internal
1336 compiler error is encountered.
1337 @end table
1338
1339 If you only want some of the stages of compilation, you can use
1340 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1341 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1342 @command{gcc} is to stop.  Note that some combinations (for example,
1343 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1344
1345 @table @gcctabopt
1346 @item -c
1347 @opindex c
1348 Compile or assemble the source files, but do not link.  The linking
1349 stage simply is not done.  The ultimate output is in the form of an
1350 object file for each source file.
1351
1352 By default, the object file name for a source file is made by replacing
1353 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1354
1355 Unrecognized input files, not requiring compilation or assembly, are
1356 ignored.
1357
1358 @item -S
1359 @opindex S
1360 Stop after the stage of compilation proper; do not assemble.  The output
1361 is in the form of an assembler code file for each non-assembler input
1362 file specified.
1363
1364 By default, the assembler file name for a source file is made by
1365 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1366
1367 Input files that don't require compilation are ignored.
1368
1369 @item -E
1370 @opindex E
1371 Stop after the preprocessing stage; do not run the compiler proper.  The
1372 output is in the form of preprocessed source code, which is sent to the
1373 standard output.
1374
1375 Input files that don't require preprocessing are ignored.
1376
1377 @cindex output file option
1378 @item -o @var{file}
1379 @opindex o
1380 Place output in file @var{file}.  This applies to whatever
1381 sort of output is being produced, whether it be an executable file,
1382 an object file, an assembler file or preprocessed C code.
1383
1384 If @option{-o} is not specified, the default is to put an executable
1385 file in @file{a.out}, the object file for
1386 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1387 assembler file in @file{@var{source}.s}, a precompiled header file in
1388 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1389 standard output.
1390
1391 @item -v
1392 @opindex v
1393 Print (on standard error output) the commands executed to run the stages
1394 of compilation.  Also print the version number of the compiler driver
1395 program and of the preprocessor and the compiler proper.
1396
1397 @item -###
1398 @opindex ###
1399 Like @option{-v} except the commands are not executed and arguments
1400 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1401 This is useful for shell scripts to capture the driver-generated command lines.
1402
1403 @item -pipe
1404 @opindex pipe
1405 Use pipes rather than temporary files for communication between the
1406 various stages of compilation.  This fails to work on some systems where
1407 the assembler is unable to read from a pipe; but the GNU assembler has
1408 no trouble.
1409
1410 @item --help
1411 @opindex help
1412 Print (on the standard output) a description of the command-line options
1413 understood by @command{gcc}.  If the @option{-v} option is also specified
1414 then @option{--help} is also passed on to the various processes
1415 invoked by @command{gcc}, so that they can display the command-line options
1416 they accept.  If the @option{-Wextra} option has also been specified
1417 (prior to the @option{--help} option), then command-line options that
1418 have no documentation associated with them are also displayed.
1419
1420 @item --target-help
1421 @opindex target-help
1422 Print (on the standard output) a description of target-specific command-line
1423 options for each tool.  For some targets extra target-specific
1424 information may also be printed.
1425
1426 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1427 Print (on the standard output) a description of the command-line
1428 options understood by the compiler that fit into all specified classes
1429 and qualifiers.  These are the supported classes:
1430
1431 @table @asis
1432 @item @samp{optimizers}
1433 Display all of the optimization options supported by the
1434 compiler.
1435
1436 @item @samp{warnings}
1437 Display all of the options controlling warning messages
1438 produced by the compiler.
1439
1440 @item @samp{target}
1441 Display target-specific options.  Unlike the
1442 @option{--target-help} option however, target-specific options of the
1443 linker and assembler are not displayed.  This is because those
1444 tools do not currently support the extended @option{--help=} syntax.
1445
1446 @item @samp{params}
1447 Display the values recognized by the @option{--param}
1448 option.
1449
1450 @item @var{language}
1451 Display the options supported for @var{language}, where
1452 @var{language} is the name of one of the languages supported in this
1453 version of GCC@.
1454
1455 @item @samp{common}
1456 Display the options that are common to all languages.
1457 @end table
1458
1459 These are the supported qualifiers:
1460
1461 @table @asis
1462 @item @samp{undocumented}
1463 Display only those options that are undocumented.
1464
1465 @item @samp{joined}
1466 Display options taking an argument that appears after an equal
1467 sign in the same continuous piece of text, such as:
1468 @samp{--help=target}.
1469
1470 @item @samp{separate}
1471 Display options taking an argument that appears as a separate word
1472 following the original option, such as: @samp{-o output-file}.
1473 @end table
1474
1475 Thus for example to display all the undocumented target-specific
1476 switches supported by the compiler, use:
1477
1478 @smallexample
1479 --help=target,undocumented
1480 @end smallexample
1481
1482 The sense of a qualifier can be inverted by prefixing it with the
1483 @samp{^} character, so for example to display all binary warning
1484 options (i.e., ones that are either on or off and that do not take an
1485 argument) that have a description, use:
1486
1487 @smallexample
1488 --help=warnings,^joined,^undocumented
1489 @end smallexample
1490
1491 The argument to @option{--help=} should not consist solely of inverted
1492 qualifiers.
1493
1494 Combining several classes is possible, although this usually
1495 restricts the output so much that there is nothing to display.  One
1496 case where it does work, however, is when one of the classes is
1497 @var{target}.  For example, to display all the target-specific
1498 optimization options, use:
1499
1500 @smallexample
1501 --help=target,optimizers
1502 @end smallexample
1503
1504 The @option{--help=} option can be repeated on the command line.  Each
1505 successive use displays its requested class of options, skipping
1506 those that have already been displayed.
1507
1508 If the @option{-Q} option appears on the command line before the
1509 @option{--help=} option, then the descriptive text displayed by
1510 @option{--help=} is changed.  Instead of describing the displayed
1511 options, an indication is given as to whether the option is enabled,
1512 disabled or set to a specific value (assuming that the compiler
1513 knows this at the point where the @option{--help=} option is used).
1514
1515 Here is a truncated example from the ARM port of @command{gcc}:
1516
1517 @smallexample
1518   % gcc -Q -mabi=2 --help=target -c
1519   The following options are target specific:
1520   -mabi=                                2
1521   -mabort-on-noreturn                   [disabled]
1522   -mapcs                                [disabled]
1523 @end smallexample
1524
1525 The output is sensitive to the effects of previous command-line
1526 options, so for example it is possible to find out which optimizations
1527 are enabled at @option{-O2} by using:
1528
1529 @smallexample
1530 -Q -O2 --help=optimizers
1531 @end smallexample
1532
1533 Alternatively you can discover which binary optimizations are enabled
1534 by @option{-O3} by using:
1535
1536 @smallexample
1537 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1538 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1539 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1540 @end smallexample
1541
1542 @item -no-canonical-prefixes
1543 @opindex no-canonical-prefixes
1544 Do not expand any symbolic links, resolve references to @samp{/../}
1545 or @samp{/./}, or make the path absolute when generating a relative
1546 prefix.
1547
1548 @item --version
1549 @opindex version
1550 Display the version number and copyrights of the invoked GCC@.
1551
1552 @item -wrapper
1553 @opindex wrapper
1554 Invoke all subcommands under a wrapper program.  The name of the
1555 wrapper program and its parameters are passed as a comma separated
1556 list.
1557
1558 @smallexample
1559 gcc -c t.c -wrapper gdb,--args
1560 @end smallexample
1561
1562 @noindent
1563 This invokes all subprograms of @command{gcc} under
1564 @samp{gdb --args}, thus the invocation of @command{cc1} is
1565 @samp{gdb --args cc1 @dots{}}.
1566
1567 @item -fplugin=@var{name}.so
1568 @opindex fplugin
1569 Load the plugin code in file @var{name}.so, assumed to be a
1570 shared object to be dlopen'd by the compiler.  The base name of
1571 the shared object file is used to identify the plugin for the
1572 purposes of argument parsing (See
1573 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1574 Each plugin should define the callback functions specified in the
1575 Plugins API.
1576
1577 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1578 @opindex fplugin-arg
1579 Define an argument called @var{key} with a value of @var{value}
1580 for the plugin called @var{name}.
1581
1582 @item -fdump-ada-spec@r{[}-slim@r{]}
1583 @opindex fdump-ada-spec
1584 For C and C++ source and include files, generate corresponding Ada specs.
1585 @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1586 GNAT User's Guide}, which provides detailed documentation on this feature.
1587
1588 @item -fada-spec-parent=@var{unit}
1589 @opindex fada-spec-parent
1590 In conjunction with @option{-fdump-ada-spec@r{[}-slim@r{]}} above, generate
1591 Ada specs as child units of parent @var{unit}.
1592
1593 @item -fdump-go-spec=@var{file}
1594 @opindex fdump-go-spec
1595 For input files in any language, generate corresponding Go
1596 declarations in @var{file}.  This generates Go @code{const},
1597 @code{type}, @code{var}, and @code{func} declarations which may be a
1598 useful way to start writing a Go interface to code written in some
1599 other language.
1600
1601 @include @value{srcdir}/../libiberty/at-file.texi
1602 @end table
1603
1604 @node Invoking G++
1605 @section Compiling C++ Programs
1606
1607 @cindex suffixes for C++ source
1608 @cindex C++ source file suffixes
1609 C++ source files conventionally use one of the suffixes @samp{.C},
1610 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1611 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1612 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1613 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1614 files with these names and compiles them as C++ programs even if you
1615 call the compiler the same way as for compiling C programs (usually
1616 with the name @command{gcc}).
1617
1618 @findex g++
1619 @findex c++
1620 However, the use of @command{gcc} does not add the C++ library.
1621 @command{g++} is a program that calls GCC and automatically specifies linking
1622 against the C++ library.  It treats @samp{.c},
1623 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1624 files unless @option{-x} is used.  This program is also useful when
1625 precompiling a C header file with a @samp{.h} extension for use in C++
1626 compilations.  On many systems, @command{g++} is also installed with
1627 the name @command{c++}.
1628
1629 @cindex invoking @command{g++}
1630 When you compile C++ programs, you may specify many of the same
1631 command-line options that you use for compiling programs in any
1632 language; or command-line options meaningful for C and related
1633 languages; or options that are meaningful only for C++ programs.
1634 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1635 explanations of options for languages related to C@.
1636 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1637 explanations of options that are meaningful only for C++ programs.
1638
1639 @node C Dialect Options
1640 @section Options Controlling C Dialect
1641 @cindex dialect options
1642 @cindex language dialect options
1643 @cindex options, dialect
1644
1645 The following options control the dialect of C (or languages derived
1646 from C, such as C++, Objective-C and Objective-C++) that the compiler
1647 accepts:
1648
1649 @table @gcctabopt
1650 @cindex ANSI support
1651 @cindex ISO support
1652 @item -ansi
1653 @opindex ansi
1654 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1655 equivalent to @option{-std=c++98}.
1656
1657 This turns off certain features of GCC that are incompatible with ISO
1658 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1659 such as the @code{asm} and @code{typeof} keywords, and
1660 predefined macros such as @code{unix} and @code{vax} that identify the
1661 type of system you are using.  It also enables the undesirable and
1662 rarely used ISO trigraph feature.  For the C compiler,
1663 it disables recognition of C++ style @samp{//} comments as well as
1664 the @code{inline} keyword.
1665
1666 The alternate keywords @code{__asm__}, @code{__extension__},
1667 @code{__inline__} and @code{__typeof__} continue to work despite
1668 @option{-ansi}.  You would not want to use them in an ISO C program, of
1669 course, but it is useful to put them in header files that might be included
1670 in compilations done with @option{-ansi}.  Alternate predefined macros
1671 such as @code{__unix__} and @code{__vax__} are also available, with or
1672 without @option{-ansi}.
1673
1674 The @option{-ansi} option does not cause non-ISO programs to be
1675 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1676 addition to @option{-ansi}.  @xref{Warning Options}.
1677
1678 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1679 option is used.  Some header files may notice this macro and refrain
1680 from declaring certain functions or defining certain macros that the
1681 ISO standard doesn't call for; this is to avoid interfering with any
1682 programs that might use these names for other things.
1683
1684 Functions that are normally built in but do not have semantics
1685 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1686 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1687 built-in functions provided by GCC}, for details of the functions
1688 affected.
1689
1690 @item -std=
1691 @opindex std
1692 Determine the language standard. @xref{Standards,,Language Standards
1693 Supported by GCC}, for details of these standard versions.  This option
1694 is currently only supported when compiling C or C++.
1695
1696 The compiler can accept several base standards, such as @samp{c90} or
1697 @samp{c++98}, and GNU dialects of those standards, such as
1698 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1699 compiler accepts all programs following that standard plus those
1700 using GNU extensions that do not contradict it.  For example,
1701 @option{-std=c90} turns off certain features of GCC that are
1702 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1703 keywords, but not other GNU extensions that do not have a meaning in
1704 ISO C90, such as omitting the middle term of a @code{?:}
1705 expression. On the other hand, when a GNU dialect of a standard is
1706 specified, all features supported by the compiler are enabled, even when
1707 those features change the meaning of the base standard.  As a result, some
1708 strict-conforming programs may be rejected.  The particular standard
1709 is used by @option{-Wpedantic} to identify which features are GNU
1710 extensions given that version of the standard. For example
1711 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1712 comments, while @option{-std=gnu99 -Wpedantic} does not.
1713
1714 A value for this option must be provided; possible values are
1715
1716 @table @samp
1717 @item c90
1718 @itemx c89
1719 @itemx iso9899:1990
1720 Support all ISO C90 programs (certain GNU extensions that conflict
1721 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1722
1723 @item iso9899:199409
1724 ISO C90 as modified in amendment 1.
1725
1726 @item c99
1727 @itemx c9x
1728 @itemx iso9899:1999
1729 @itemx iso9899:199x
1730 ISO C99.  This standard is substantially completely supported, modulo
1731 bugs and floating-point issues
1732 (mainly but not entirely relating to optional C99 features from
1733 Annexes F and G).  See
1734 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1735 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1736
1737 @item c11
1738 @itemx c1x
1739 @itemx iso9899:2011
1740 ISO C11, the 2011 revision of the ISO C standard.  This standard is
1741 substantially completely supported, modulo bugs, floating-point issues
1742 (mainly but not entirely relating to optional C11 features from
1743 Annexes F and G) and the optional Annexes K (Bounds-checking
1744 interfaces) and L (Analyzability).  The name @samp{c1x} is deprecated.
1745
1746 @item gnu90
1747 @itemx gnu89
1748 GNU dialect of ISO C90 (including some C99 features).
1749
1750 @item gnu99
1751 @itemx gnu9x
1752 GNU dialect of ISO C99.  The name @samp{gnu9x} is deprecated.
1753
1754 @item gnu11
1755 @itemx gnu1x
1756 GNU dialect of ISO C11.  This is the default for C code.
1757 The name @samp{gnu1x} is deprecated.
1758
1759 @item c++98
1760 @itemx c++03
1761 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1762 additional defect reports. Same as @option{-ansi} for C++ code.
1763
1764 @item gnu++98
1765 @itemx gnu++03
1766 GNU dialect of @option{-std=c++98}.  This is the default for
1767 C++ code.
1768
1769 @item c++11
1770 @itemx c++0x
1771 The 2011 ISO C++ standard plus amendments.
1772 The name @samp{c++0x} is deprecated.
1773
1774 @item gnu++11
1775 @itemx gnu++0x
1776 GNU dialect of @option{-std=c++11}.
1777 The name @samp{gnu++0x} is deprecated.
1778
1779 @item c++14
1780 @itemx c++1y
1781 The 2014 ISO C++ standard plus amendments.
1782 The name @samp{c++1y} is deprecated.
1783
1784 @item gnu++14
1785 @itemx gnu++1y
1786 GNU dialect of @option{-std=c++14}.
1787 The name @samp{gnu++1y} is deprecated.
1788
1789 @item c++1z
1790 The next revision of the ISO C++ standard, tentatively planned for
1791 2017.  Support is highly experimental, and will almost certainly
1792 change in incompatible ways in future releases.
1793
1794 @item gnu++1z
1795 GNU dialect of @option{-std=c++1z}.  Support is highly experimental,
1796 and will almost certainly change in incompatible ways in future
1797 releases.
1798 @end table
1799
1800 @item -fgnu89-inline
1801 @opindex fgnu89-inline
1802 The option @option{-fgnu89-inline} tells GCC to use the traditional
1803 GNU semantics for @code{inline} functions when in C99 mode.
1804 @xref{Inline,,An Inline Function is As Fast As a Macro}.
1805 Using this option is roughly equivalent to adding the
1806 @code{gnu_inline} function attribute to all inline functions
1807 (@pxref{Function Attributes}).
1808
1809 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1810 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1811 specifies the default behavior).
1812 This option is not supported in @option{-std=c90} or
1813 @option{-std=gnu90} mode.
1814
1815 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1816 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1817 in effect for @code{inline} functions.  @xref{Common Predefined
1818 Macros,,,cpp,The C Preprocessor}.
1819
1820 @item -aux-info @var{filename}
1821 @opindex aux-info
1822 Output to the given filename prototyped declarations for all functions
1823 declared and/or defined in a translation unit, including those in header
1824 files.  This option is silently ignored in any language other than C@.
1825
1826 Besides declarations, the file indicates, in comments, the origin of
1827 each declaration (source file and line), whether the declaration was
1828 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1829 @samp{O} for old, respectively, in the first character after the line
1830 number and the colon), and whether it came from a declaration or a
1831 definition (@samp{C} or @samp{F}, respectively, in the following
1832 character).  In the case of function definitions, a K&R-style list of
1833 arguments followed by their declarations is also provided, inside
1834 comments, after the declaration.
1835
1836 @item -fallow-parameterless-variadic-functions
1837 @opindex fallow-parameterless-variadic-functions
1838 Accept variadic functions without named parameters.
1839
1840 Although it is possible to define such a function, this is not very
1841 useful as it is not possible to read the arguments.  This is only
1842 supported for C as this construct is allowed by C++.
1843
1844 @item -fno-asm
1845 @opindex fno-asm
1846 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1847 keyword, so that code can use these words as identifiers.  You can use
1848 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1849 instead.  @option{-ansi} implies @option{-fno-asm}.
1850
1851 In C++, this switch only affects the @code{typeof} keyword, since
1852 @code{asm} and @code{inline} are standard keywords.  You may want to
1853 use the @option{-fno-gnu-keywords} flag instead, which has the same
1854 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1855 switch only affects the @code{asm} and @code{typeof} keywords, since
1856 @code{inline} is a standard keyword in ISO C99.
1857
1858 @item -fno-builtin
1859 @itemx -fno-builtin-@var{function}
1860 @opindex fno-builtin
1861 @cindex built-in functions
1862 Don't recognize built-in functions that do not begin with
1863 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1864 functions provided by GCC}, for details of the functions affected,
1865 including those which are not built-in functions when @option{-ansi} or
1866 @option{-std} options for strict ISO C conformance are used because they
1867 do not have an ISO standard meaning.
1868
1869 GCC normally generates special code to handle certain built-in functions
1870 more efficiently; for instance, calls to @code{alloca} may become single
1871 instructions which adjust the stack directly, and calls to @code{memcpy}
1872 may become inline copy loops.  The resulting code is often both smaller
1873 and faster, but since the function calls no longer appear as such, you
1874 cannot set a breakpoint on those calls, nor can you change the behavior
1875 of the functions by linking with a different library.  In addition,
1876 when a function is recognized as a built-in function, GCC may use
1877 information about that function to warn about problems with calls to
1878 that function, or to generate more efficient code, even if the
1879 resulting code still contains calls to that function.  For example,
1880 warnings are given with @option{-Wformat} for bad calls to
1881 @code{printf} when @code{printf} is built in and @code{strlen} is
1882 known not to modify global memory.
1883
1884 With the @option{-fno-builtin-@var{function}} option
1885 only the built-in function @var{function} is
1886 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1887 function is named that is not built-in in this version of GCC, this
1888 option is ignored.  There is no corresponding
1889 @option{-fbuiltin-@var{function}} option; if you wish to enable
1890 built-in functions selectively when using @option{-fno-builtin} or
1891 @option{-ffreestanding}, you may define macros such as:
1892
1893 @smallexample
1894 #define abs(n)          __builtin_abs ((n))
1895 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1896 @end smallexample
1897
1898 @item -fhosted
1899 @opindex fhosted
1900 @cindex hosted environment
1901
1902 Assert that compilation targets a hosted environment.  This implies
1903 @option{-fbuiltin}.  A hosted environment is one in which the
1904 entire standard library is available, and in which @code{main} has a return
1905 type of @code{int}.  Examples are nearly everything except a kernel.
1906 This is equivalent to @option{-fno-freestanding}.
1907
1908 @item -ffreestanding
1909 @opindex ffreestanding
1910 @cindex hosted environment
1911
1912 Assert that compilation targets a freestanding environment.  This
1913 implies @option{-fno-builtin}.  A freestanding environment
1914 is one in which the standard library may not exist, and program startup may
1915 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1916 This is equivalent to @option{-fno-hosted}.
1917
1918 @xref{Standards,,Language Standards Supported by GCC}, for details of
1919 freestanding and hosted environments.
1920
1921 @item -fopenacc
1922 @opindex fopenacc
1923 @cindex OpenACC accelerator programming
1924 Enable handling of OpenACC directives @code{#pragma acc} in C/C++ and
1925 @code{!$acc} in Fortran.  When @option{-fopenacc} is specified, the
1926 compiler generates accelerated code according to the OpenACC Application
1927 Programming Interface v2.0 @w{@uref{http://www.openacc.org/}}.  This option
1928 implies @option{-pthread}, and thus is only supported on targets that
1929 have support for @option{-pthread}.
1930
1931 Note that this is an experimental feature, incomplete, and subject to
1932 change in future versions of GCC.  See
1933 @w{@uref{https://gcc.gnu.org/wiki/OpenACC}} for more information.
1934
1935 @item -fopenmp
1936 @opindex fopenmp
1937 @cindex OpenMP parallel
1938 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1939 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1940 compiler generates parallel code according to the OpenMP Application
1941 Program Interface v4.0 @w{@uref{http://www.openmp.org/}}.  This option
1942 implies @option{-pthread}, and thus is only supported on targets that
1943 have support for @option{-pthread}. @option{-fopenmp} implies
1944 @option{-fopenmp-simd}.
1945
1946 @item -fopenmp-simd
1947 @opindex fopenmp-simd
1948 @cindex OpenMP SIMD
1949 @cindex SIMD
1950 Enable handling of OpenMP's SIMD directives with @code{#pragma omp}
1951 in C/C++ and @code{!$omp} in Fortran. Other OpenMP directives
1952 are ignored.
1953
1954 @item -fcilkplus
1955 @opindex fcilkplus
1956 @cindex Enable Cilk Plus
1957 Enable the usage of Cilk Plus language extension features for C/C++.
1958 When the option @option{-fcilkplus} is specified, enable the usage of
1959 the Cilk Plus Language extension features for C/C++.  The present
1960 implementation follows ABI version 1.2.  This is an experimental
1961 feature that is only partially complete, and whose interface may
1962 change in future versions of GCC as the official specification
1963 changes.  Currently, all features but @code{_Cilk_for} have been
1964 implemented.
1965
1966 @item -fgnu-tm
1967 @opindex fgnu-tm
1968 When the option @option{-fgnu-tm} is specified, the compiler
1969 generates code for the Linux variant of Intel's current Transactional
1970 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
1971 an experimental feature whose interface may change in future versions
1972 of GCC, as the official specification changes.  Please note that not
1973 all architectures are supported for this feature.
1974
1975 For more information on GCC's support for transactional memory,
1976 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
1977 Transactional Memory Library}.
1978
1979 Note that the transactional memory feature is not supported with
1980 non-call exceptions (@option{-fnon-call-exceptions}).
1981
1982 @item -fms-extensions
1983 @opindex fms-extensions
1984 Accept some non-standard constructs used in Microsoft header files.
1985
1986 In C++ code, this allows member names in structures to be similar
1987 to previous types declarations.
1988
1989 @smallexample
1990 typedef int UOW;
1991 struct ABC @{
1992   UOW UOW;
1993 @};
1994 @end smallexample
1995
1996 Some cases of unnamed fields in structures and unions are only
1997 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1998 fields within structs/unions}, for details.
1999
2000 Note that this option is off for all targets but x86 
2001 targets using ms-abi.
2002
2003 @item -fplan9-extensions
2004 @opindex fplan9-extensions
2005 Accept some non-standard constructs used in Plan 9 code.
2006
2007 This enables @option{-fms-extensions}, permits passing pointers to
2008 structures with anonymous fields to functions that expect pointers to
2009 elements of the type of the field, and permits referring to anonymous
2010 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
2011 struct/union fields within structs/unions}, for details.  This is only
2012 supported for C, not C++.
2013
2014 @item -trigraphs
2015 @opindex trigraphs
2016 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
2017 options for strict ISO C conformance) implies @option{-trigraphs}.
2018
2019 @cindex traditional C language
2020 @cindex C language, traditional
2021 @item -traditional
2022 @itemx -traditional-cpp
2023 @opindex traditional-cpp
2024 @opindex traditional
2025 Formerly, these options caused GCC to attempt to emulate a pre-standard
2026 C compiler.  They are now only supported with the @option{-E} switch.
2027 The preprocessor continues to support a pre-standard mode.  See the GNU
2028 CPP manual for details.
2029
2030 @item -fcond-mismatch
2031 @opindex fcond-mismatch
2032 Allow conditional expressions with mismatched types in the second and
2033 third arguments.  The value of such an expression is void.  This option
2034 is not supported for C++.
2035
2036 @item -flax-vector-conversions
2037 @opindex flax-vector-conversions
2038 Allow implicit conversions between vectors with differing numbers of
2039 elements and/or incompatible element types.  This option should not be
2040 used for new code.
2041
2042 @item -funsigned-char
2043 @opindex funsigned-char
2044 Let the type @code{char} be unsigned, like @code{unsigned char}.
2045
2046 Each kind of machine has a default for what @code{char} should
2047 be.  It is either like @code{unsigned char} by default or like
2048 @code{signed char} by default.
2049
2050 Ideally, a portable program should always use @code{signed char} or
2051 @code{unsigned char} when it depends on the signedness of an object.
2052 But many programs have been written to use plain @code{char} and
2053 expect it to be signed, or expect it to be unsigned, depending on the
2054 machines they were written for.  This option, and its inverse, let you
2055 make such a program work with the opposite default.
2056
2057 The type @code{char} is always a distinct type from each of
2058 @code{signed char} or @code{unsigned char}, even though its behavior
2059 is always just like one of those two.
2060
2061 @item -fsigned-char
2062 @opindex fsigned-char
2063 Let the type @code{char} be signed, like @code{signed char}.
2064
2065 Note that this is equivalent to @option{-fno-unsigned-char}, which is
2066 the negative form of @option{-funsigned-char}.  Likewise, the option
2067 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
2068
2069 @item -fsigned-bitfields
2070 @itemx -funsigned-bitfields
2071 @itemx -fno-signed-bitfields
2072 @itemx -fno-unsigned-bitfields
2073 @opindex fsigned-bitfields
2074 @opindex funsigned-bitfields
2075 @opindex fno-signed-bitfields
2076 @opindex fno-unsigned-bitfields
2077 These options control whether a bit-field is signed or unsigned, when the
2078 declaration does not use either @code{signed} or @code{unsigned}.  By
2079 default, such a bit-field is signed, because this is consistent: the
2080 basic integer types such as @code{int} are signed types.
2081
2082 @item -fsso-struct=@var{endianness}
2083 @opindex fsso-struct
2084 Set the default scalar storage order of structures and unions to the
2085 specified endianness.  The accepted values are @samp{big-endian} and
2086 @samp{little-endian}.  If the option is not passed, the compiler uses
2087 the native endianness of the target.  This option is not supported for C++.
2088
2089 @strong{Warning:} the @option{-fsso-struct} switch causes GCC to generate
2090 code that is not binary compatible with code generated without it if the
2091 specified endianness is not the native endianness of the target.
2092 @end table
2093
2094 @node C++ Dialect Options
2095 @section Options Controlling C++ Dialect
2096
2097 @cindex compiler options, C++
2098 @cindex C++ options, command-line
2099 @cindex options, C++
2100 This section describes the command-line options that are only meaningful
2101 for C++ programs.  You can also use most of the GNU compiler options
2102 regardless of what language your program is in.  For example, you
2103 might compile a file @file{firstClass.C} like this:
2104
2105 @smallexample
2106 g++ -g -fstrict-enums -O -c firstClass.C
2107 @end smallexample
2108
2109 @noindent
2110 In this example, only @option{-fstrict-enums} is an option meant
2111 only for C++ programs; you can use the other options with any
2112 language supported by GCC@.
2113
2114 Here is a list of options that are @emph{only} for compiling C++ programs:
2115
2116 @table @gcctabopt
2117
2118 @item -fabi-version=@var{n}
2119 @opindex fabi-version
2120 Use version @var{n} of the C++ ABI@.  The default is version 0.
2121
2122 Version 0 refers to the version conforming most closely to
2123 the C++ ABI specification.  Therefore, the ABI obtained using version 0
2124 will change in different versions of G++ as ABI bugs are fixed.
2125
2126 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.
2127
2128 Version 2 is the version of the C++ ABI that first appeared in G++
2129 3.4, and was the default through G++ 4.9.
2130
2131 Version 3 corrects an error in mangling a constant address as a
2132 template argument.
2133
2134 Version 4, which first appeared in G++ 4.5, implements a standard
2135 mangling for vector types.
2136
2137 Version 5, which first appeared in G++ 4.6, corrects the mangling of
2138 attribute const/volatile on function pointer types, decltype of a
2139 plain decl, and use of a function parameter in the declaration of
2140 another parameter.
2141
2142 Version 6, which first appeared in G++ 4.7, corrects the promotion
2143 behavior of C++11 scoped enums and the mangling of template argument
2144 packs, const/static_cast, prefix ++ and --, and a class scope function
2145 used as a template argument.
2146
2147 Version 7, which first appeared in G++ 4.8, that treats nullptr_t as a
2148 builtin type and corrects the mangling of lambdas in default argument
2149 scope.
2150
2151 Version 8, which first appeared in G++ 4.9, corrects the substitution
2152 behavior of function types with function-cv-qualifiers.
2153
2154 Version 9, which first appeared in G++ 5.2, corrects the alignment of
2155 @code{nullptr_t}.
2156
2157 Version 10, which first appeared in G++ 6.1, adds mangling of
2158 attributes that affect type identity, such as ia32 calling convention
2159 attributes (e.g. @samp{stdcall}).
2160
2161 See also @option{-Wabi}.
2162
2163 @item -fabi-compat-version=@var{n}
2164 @opindex fabi-compat-version
2165 On targets that support strong aliases, G++
2166 works around mangling changes by creating an alias with the correct
2167 mangled name when defining a symbol with an incorrect mangled name.
2168 This switch specifies which ABI version to use for the alias.
2169
2170 With @option{-fabi-version=0} (the default), this defaults to 8 (GCC 5
2171 compatibility).  If another ABI version is explicitly selected, this
2172 defaults to 0.  For compatibility with GCC versions 3.2 through 4.9,
2173 use @option{-fabi-compat-version=2}.
2174
2175 If this option is not provided but @option{-Wabi=@var{n}} is, that
2176 version is used for compatibility aliases.  If this option is provided
2177 along with @option{-Wabi} (without the version), the version from this
2178 option is used for the warning.
2179
2180 @item -fno-access-control
2181 @opindex fno-access-control
2182 Turn off all access checking.  This switch is mainly useful for working
2183 around bugs in the access control code.
2184
2185 @item -fcheck-new
2186 @opindex fcheck-new
2187 Check that the pointer returned by @code{operator new} is non-null
2188 before attempting to modify the storage allocated.  This check is
2189 normally unnecessary because the C++ standard specifies that
2190 @code{operator new} only returns @code{0} if it is declared
2191 @code{throw()}, in which case the compiler always checks the
2192 return value even without this option.  In all other cases, when
2193 @code{operator new} has a non-empty exception specification, memory
2194 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
2195 @samp{new (nothrow)}.
2196
2197 @item -fconstexpr-depth=@var{n}
2198 @opindex fconstexpr-depth
2199 Set the maximum nested evaluation depth for C++11 constexpr functions
2200 to @var{n}.  A limit is needed to detect endless recursion during
2201 constant expression evaluation.  The minimum specified by the standard
2202 is 512.
2203
2204 @item -fdeduce-init-list
2205 @opindex fdeduce-init-list
2206 Enable deduction of a template type parameter as
2207 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
2208
2209 @smallexample
2210 template <class T> auto forward(T t) -> decltype (realfn (t))
2211 @{
2212   return realfn (t);
2213 @}
2214
2215 void f()
2216 @{
2217   forward(@{1,2@}); // call forward<std::initializer_list<int>>
2218 @}
2219 @end smallexample
2220
2221 This deduction was implemented as a possible extension to the
2222 originally proposed semantics for the C++11 standard, but was not part
2223 of the final standard, so it is disabled by default.  This option is
2224 deprecated, and may be removed in a future version of G++.
2225
2226 @item -ffriend-injection
2227 @opindex ffriend-injection
2228 Inject friend functions into the enclosing namespace, so that they are
2229 visible outside the scope of the class in which they are declared.
2230 Friend functions were documented to work this way in the old Annotated
2231 C++ Reference Manual.  
2232 However, in ISO C++ a friend function that is not declared
2233 in an enclosing scope can only be found using argument dependent
2234 lookup.  GCC defaults to the standard behavior.
2235
2236 This option is for compatibility, and may be removed in a future
2237 release of G++.
2238
2239 @item -fno-elide-constructors
2240 @opindex fno-elide-constructors
2241 The C++ standard allows an implementation to omit creating a temporary
2242 that is only used to initialize another object of the same type.
2243 Specifying this option disables that optimization, and forces G++ to
2244 call the copy constructor in all cases.
2245
2246 @item -fno-enforce-eh-specs
2247 @opindex fno-enforce-eh-specs
2248 Don't generate code to check for violation of exception specifications
2249 at run time.  This option violates the C++ standard, but may be useful
2250 for reducing code size in production builds, much like defining
2251 @code{NDEBUG}.  This does not give user code permission to throw
2252 exceptions in violation of the exception specifications; the compiler
2253 still optimizes based on the specifications, so throwing an
2254 unexpected exception results in undefined behavior at run time.
2255
2256 @item -fextern-tls-init
2257 @itemx -fno-extern-tls-init
2258 @opindex fextern-tls-init
2259 @opindex fno-extern-tls-init
2260 The C++11 and OpenMP standards allow @code{thread_local} and
2261 @code{threadprivate} variables to have dynamic (runtime)
2262 initialization.  To support this, any use of such a variable goes
2263 through a wrapper function that performs any necessary initialization.
2264 When the use and definition of the variable are in the same
2265 translation unit, this overhead can be optimized away, but when the
2266 use is in a different translation unit there is significant overhead
2267 even if the variable doesn't actually need dynamic initialization.  If
2268 the programmer can be sure that no use of the variable in a
2269 non-defining TU needs to trigger dynamic initialization (either
2270 because the variable is statically initialized, or a use of the
2271 variable in the defining TU will be executed before any uses in
2272 another TU), they can avoid this overhead with the
2273 @option{-fno-extern-tls-init} option.
2274
2275 On targets that support symbol aliases, the default is
2276 @option{-fextern-tls-init}.  On targets that do not support symbol
2277 aliases, the default is @option{-fno-extern-tls-init}.
2278
2279 @item -ffor-scope
2280 @itemx -fno-for-scope
2281 @opindex ffor-scope
2282 @opindex fno-for-scope
2283 If @option{-ffor-scope} is specified, the scope of variables declared in
2284 a @i{for-init-statement} is limited to the @code{for} loop itself,
2285 as specified by the C++ standard.
2286 If @option{-fno-for-scope} is specified, the scope of variables declared in
2287 a @i{for-init-statement} extends to the end of the enclosing scope,
2288 as was the case in old versions of G++, and other (traditional)
2289 implementations of C++.
2290
2291 If neither flag is given, the default is to follow the standard,
2292 but to allow and give a warning for old-style code that would
2293 otherwise be invalid, or have different behavior.
2294
2295 @item -fno-gnu-keywords
2296 @opindex fno-gnu-keywords
2297 Do not recognize @code{typeof} as a keyword, so that code can use this
2298 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2299 @option{-ansi} implies @option{-fno-gnu-keywords}.
2300
2301 @item -fno-implicit-templates
2302 @opindex fno-implicit-templates
2303 Never emit code for non-inline templates that are instantiated
2304 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2305 @xref{Template Instantiation}, for more information.
2306
2307 @item -fno-implicit-inline-templates
2308 @opindex fno-implicit-inline-templates
2309 Don't emit code for implicit instantiations of inline templates, either.
2310 The default is to handle inlines differently so that compiles with and
2311 without optimization need the same set of explicit instantiations.
2312
2313 @item -fno-implement-inlines
2314 @opindex fno-implement-inlines
2315 To save space, do not emit out-of-line copies of inline functions
2316 controlled by @code{#pragma implementation}.  This causes linker
2317 errors if these functions are not inlined everywhere they are called.
2318
2319 @item -fms-extensions
2320 @opindex fms-extensions
2321 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2322 int and getting a pointer to member function via non-standard syntax.
2323
2324 @item -fno-nonansi-builtins
2325 @opindex fno-nonansi-builtins
2326 Disable built-in declarations of functions that are not mandated by
2327 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2328 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2329
2330 @item -fnothrow-opt
2331 @opindex fnothrow-opt
2332 Treat a @code{throw()} exception specification as if it were a
2333 @code{noexcept} specification to reduce or eliminate the text size
2334 overhead relative to a function with no exception specification.  If
2335 the function has local variables of types with non-trivial
2336 destructors, the exception specification actually makes the
2337 function smaller because the EH cleanups for those variables can be
2338 optimized away.  The semantic effect is that an exception thrown out of
2339 a function with such an exception specification results in a call
2340 to @code{terminate} rather than @code{unexpected}.
2341
2342 @item -fno-operator-names
2343 @opindex fno-operator-names
2344 Do not treat the operator name keywords @code{and}, @code{bitand},
2345 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2346 synonyms as keywords.
2347
2348 @item -fno-optional-diags
2349 @opindex fno-optional-diags
2350 Disable diagnostics that the standard says a compiler does not need to
2351 issue.  Currently, the only such diagnostic issued by G++ is the one for
2352 a name having multiple meanings within a class.
2353
2354 @item -fpermissive
2355 @opindex fpermissive
2356 Downgrade some diagnostics about nonconformant code from errors to
2357 warnings.  Thus, using @option{-fpermissive} allows some
2358 nonconforming code to compile.
2359
2360 @item -fno-pretty-templates
2361 @opindex fno-pretty-templates
2362 When an error message refers to a specialization of a function
2363 template, the compiler normally prints the signature of the
2364 template followed by the template arguments and any typedefs or
2365 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2366 rather than @code{void f(int)}) so that it's clear which template is
2367 involved.  When an error message refers to a specialization of a class
2368 template, the compiler omits any template arguments that match
2369 the default template arguments for that template.  If either of these
2370 behaviors make it harder to understand the error message rather than
2371 easier, you can use @option{-fno-pretty-templates} to disable them.
2372
2373 @item -frepo
2374 @opindex frepo
2375 Enable automatic template instantiation at link time.  This option also
2376 implies @option{-fno-implicit-templates}.  @xref{Template
2377 Instantiation}, for more information.
2378
2379 @item -fno-rtti
2380 @opindex fno-rtti
2381 Disable generation of information about every class with virtual
2382 functions for use by the C++ run-time type identification features
2383 (@code{dynamic_cast} and @code{typeid}).  If you don't use those parts
2384 of the language, you can save some space by using this flag.  Note that
2385 exception handling uses the same information, but G++ generates it as
2386 needed. The @code{dynamic_cast} operator can still be used for casts that
2387 do not require run-time type information, i.e.@: casts to @code{void *} or to
2388 unambiguous base classes.
2389
2390 @item -fsized-deallocation
2391 @opindex fsized-deallocation
2392 Enable the built-in global declarations
2393 @smallexample
2394 void operator delete (void *, std::size_t) noexcept;
2395 void operator delete[] (void *, std::size_t) noexcept;
2396 @end smallexample
2397 as introduced in C++14.  This is useful for user-defined replacement
2398 deallocation functions that, for example, use the size of the object
2399 to make deallocation faster.  Enabled by default under
2400 @option{-std=c++14} and above.  The flag @option{-Wsized-deallocation}
2401 warns about places that might want to add a definition.
2402
2403 @item -fstats
2404 @opindex fstats
2405 Emit statistics about front-end processing at the end of the compilation.
2406 This information is generally only useful to the G++ development team.
2407
2408 @item -fstrict-enums
2409 @opindex fstrict-enums
2410 Allow the compiler to optimize using the assumption that a value of
2411 enumerated type can only be one of the values of the enumeration (as
2412 defined in the C++ standard; basically, a value that can be
2413 represented in the minimum number of bits needed to represent all the
2414 enumerators).  This assumption may not be valid if the program uses a
2415 cast to convert an arbitrary integer value to the enumerated type.
2416
2417 @item -ftemplate-backtrace-limit=@var{n}
2418 @opindex ftemplate-backtrace-limit
2419 Set the maximum number of template instantiation notes for a single
2420 warning or error to @var{n}.  The default value is 10.
2421
2422 @item -ftemplate-depth=@var{n}
2423 @opindex ftemplate-depth
2424 Set the maximum instantiation depth for template classes to @var{n}.
2425 A limit on the template instantiation depth is needed to detect
2426 endless recursions during template class instantiation.  ANSI/ISO C++
2427 conforming programs must not rely on a maximum depth greater than 17
2428 (changed to 1024 in C++11).  The default value is 900, as the compiler
2429 can run out of stack space before hitting 1024 in some situations.
2430
2431 @item -fno-threadsafe-statics
2432 @opindex fno-threadsafe-statics
2433 Do not emit the extra code to use the routines specified in the C++
2434 ABI for thread-safe initialization of local statics.  You can use this
2435 option to reduce code size slightly in code that doesn't need to be
2436 thread-safe.
2437
2438 @item -fuse-cxa-atexit
2439 @opindex fuse-cxa-atexit
2440 Register destructors for objects with static storage duration with the
2441 @code{__cxa_atexit} function rather than the @code{atexit} function.
2442 This option is required for fully standards-compliant handling of static
2443 destructors, but only works if your C library supports
2444 @code{__cxa_atexit}.
2445
2446 @item -fno-use-cxa-get-exception-ptr
2447 @opindex fno-use-cxa-get-exception-ptr
2448 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2449 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2450 if the runtime routine is not available.
2451
2452 @item -fvisibility-inlines-hidden
2453 @opindex fvisibility-inlines-hidden
2454 This switch declares that the user does not attempt to compare
2455 pointers to inline functions or methods where the addresses of the two functions
2456 are taken in different shared objects.
2457
2458 The effect of this is that GCC may, effectively, mark inline methods with
2459 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2460 appear in the export table of a DSO and do not require a PLT indirection
2461 when used within the DSO@.  Enabling this option can have a dramatic effect
2462 on load and link times of a DSO as it massively reduces the size of the
2463 dynamic export table when the library makes heavy use of templates.
2464
2465 The behavior of this switch is not quite the same as marking the
2466 methods as hidden directly, because it does not affect static variables
2467 local to the function or cause the compiler to deduce that
2468 the function is defined in only one shared object.
2469
2470 You may mark a method as having a visibility explicitly to negate the
2471 effect of the switch for that method.  For example, if you do want to
2472 compare pointers to a particular inline method, you might mark it as
2473 having default visibility.  Marking the enclosing class with explicit
2474 visibility has no effect.
2475
2476 Explicitly instantiated inline methods are unaffected by this option
2477 as their linkage might otherwise cross a shared library boundary.
2478 @xref{Template Instantiation}.
2479
2480 @item -fvisibility-ms-compat
2481 @opindex fvisibility-ms-compat
2482 This flag attempts to use visibility settings to make GCC's C++
2483 linkage model compatible with that of Microsoft Visual Studio.
2484
2485 The flag makes these changes to GCC's linkage model:
2486
2487 @enumerate
2488 @item
2489 It sets the default visibility to @code{hidden}, like
2490 @option{-fvisibility=hidden}.
2491
2492 @item
2493 Types, but not their members, are not hidden by default.
2494
2495 @item
2496 The One Definition Rule is relaxed for types without explicit
2497 visibility specifications that are defined in more than one
2498 shared object: those declarations are permitted if they are
2499 permitted when this option is not used.
2500 @end enumerate
2501
2502 In new code it is better to use @option{-fvisibility=hidden} and
2503 export those classes that are intended to be externally visible.
2504 Unfortunately it is possible for code to rely, perhaps accidentally,
2505 on the Visual Studio behavior.
2506
2507 Among the consequences of these changes are that static data members
2508 of the same type with the same name but defined in different shared
2509 objects are different, so changing one does not change the other;
2510 and that pointers to function members defined in different shared
2511 objects may not compare equal.  When this flag is given, it is a
2512 violation of the ODR to define types with the same name differently.
2513
2514 @item -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]}
2515 @opindex fvtable-verify
2516 Turn on (or off, if using @option{-fvtable-verify=none}) the security
2517 feature that verifies at run time, for every virtual call, that
2518 the vtable pointer through which the call is made is valid for the type of
2519 the object, and has not been corrupted or overwritten.  If an invalid vtable
2520 pointer is detected at run time, an error is reported and execution of the
2521 program is immediately halted.
2522
2523 This option causes run-time data structures to be built at program startup,
2524 which are used for verifying the vtable pointers.  
2525 The options @samp{std} and @samp{preinit}
2526 control the timing of when these data structures are built.  In both cases the
2527 data structures are built before execution reaches @code{main}.  Using
2528 @option{-fvtable-verify=std} causes the data structures to be built after
2529 shared libraries have been loaded and initialized.
2530 @option{-fvtable-verify=preinit} causes them to be built before shared
2531 libraries have been loaded and initialized.
2532
2533 If this option appears multiple times in the command line with different
2534 values specified, @samp{none} takes highest priority over both @samp{std} and
2535 @samp{preinit}; @samp{preinit} takes priority over @samp{std}.
2536
2537 @item -fvtv-debug
2538 @opindex fvtv-debug
2539 When used in conjunction with @option{-fvtable-verify=std} or 
2540 @option{-fvtable-verify=preinit}, causes debug versions of the 
2541 runtime functions for the vtable verification feature to be called.  
2542 This flag also causes the compiler to log information about which 
2543 vtable pointers it finds for each class.
2544 This information is written to a file named @file{vtv_set_ptr_data.log} 
2545 in the directory named by the environment variable @env{VTV_LOGS_DIR} 
2546 if that is defined or the current working directory otherwise.
2547
2548 Note:  This feature @emph{appends} data to the log file. If you want a fresh log
2549 file, be sure to delete any existing one.
2550
2551 @item -fvtv-counts
2552 @opindex fvtv-counts
2553 This is a debugging flag.  When used in conjunction with
2554 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
2555 causes the compiler to keep track of the total number of virtual calls
2556 it encounters and the number of verifications it inserts.  It also
2557 counts the number of calls to certain run-time library functions
2558 that it inserts and logs this information for each compilation unit.
2559 The compiler writes this information to a file named
2560 @file{vtv_count_data.log} in the directory named by the environment
2561 variable @env{VTV_LOGS_DIR} if that is defined or the current working
2562 directory otherwise.  It also counts the size of the vtable pointer sets
2563 for each class, and writes this information to @file{vtv_class_set_sizes.log}
2564 in the same directory.
2565
2566 Note:  This feature @emph{appends} data to the log files.  To get fresh log
2567 files, be sure to delete any existing ones.
2568
2569 @item -fno-weak
2570 @opindex fno-weak
2571 Do not use weak symbol support, even if it is provided by the linker.
2572 By default, G++ uses weak symbols if they are available.  This
2573 option exists only for testing, and should not be used by end-users;
2574 it results in inferior code and has no benefits.  This option may
2575 be removed in a future release of G++.
2576
2577 @item -nostdinc++
2578 @opindex nostdinc++
2579 Do not search for header files in the standard directories specific to
2580 C++, but do still search the other standard directories.  (This option
2581 is used when building the C++ library.)
2582 @end table
2583
2584 In addition, these optimization, warning, and code generation options
2585 have meanings only for C++ programs:
2586
2587 @table @gcctabopt
2588 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2589 @opindex Wabi
2590 @opindex Wno-abi
2591 Warn when G++ it generates code that is probably not compatible with
2592 the vendor-neutral C++ ABI@.  Since G++ now defaults to updating the
2593 ABI with each major release, normally @option{-Wabi} will warn only if
2594 there is a check added later in a release series for an ABI issue
2595 discovered since the initial release.  @option{-Wabi} will warn about
2596 more things if an older ABI version is selected (with
2597 @option{-fabi-version=@var{n}}).
2598
2599 @option{-Wabi} can also be used with an explicit version number to
2600 warn about compatibility with a particular @option{-fabi-version}
2601 level, e.g. @option{-Wabi=2} to warn about changes relative to
2602 @option{-fabi-version=2}.
2603
2604 If an explicit version number is provided and
2605 @option{-fabi-compat-version} is not specified, the version number
2606 from this option is used for compatibility aliases.  If no explicit
2607 version number is provided with this option, but
2608 @option{-fabi-compat-version} is specified, that version number is
2609 used for ABI warnings.
2610
2611 Although an effort has been made to warn about
2612 all such cases, there are probably some cases that are not warned about,
2613 even though G++ is generating incompatible code.  There may also be
2614 cases where warnings are emitted even though the code that is generated
2615 is compatible.
2616
2617 You should rewrite your code to avoid these warnings if you are
2618 concerned about the fact that code generated by G++ may not be binary
2619 compatible with code generated by other compilers.
2620
2621 Known incompatibilities in @option{-fabi-version=2} (which was the
2622 default from GCC 3.4 to 4.9) include:
2623
2624 @itemize @bullet
2625
2626 @item
2627 A template with a non-type template parameter of reference type was
2628 mangled incorrectly:
2629 @smallexample
2630 extern int N;
2631 template <int &> struct S @{@};
2632 void n (S<N>) @{2@}
2633 @end smallexample
2634
2635 This was fixed in @option{-fabi-version=3}.
2636
2637 @item
2638 SIMD vector types declared using @code{__attribute ((vector_size))} were
2639 mangled in a non-standard way that does not allow for overloading of
2640 functions taking vectors of different sizes.
2641
2642 The mangling was changed in @option{-fabi-version=4}.
2643
2644 @item
2645 @code{__attribute ((const))} and @code{noreturn} were mangled as type
2646 qualifiers, and @code{decltype} of a plain declaration was folded away.
2647
2648 These mangling issues were fixed in @option{-fabi-version=5}.
2649
2650 @item
2651 Scoped enumerators passed as arguments to a variadic function are
2652 promoted like unscoped enumerators, causing @code{va_arg} to complain.
2653 On most targets this does not actually affect the parameter passing
2654 ABI, as there is no way to pass an argument smaller than @code{int}.
2655
2656 Also, the ABI changed the mangling of template argument packs,
2657 @code{const_cast}, @code{static_cast}, prefix increment/decrement, and
2658 a class scope function used as a template argument.
2659
2660 These issues were corrected in @option{-fabi-version=6}.
2661
2662 @item
2663 Lambdas in default argument scope were mangled incorrectly, and the
2664 ABI changed the mangling of @code{nullptr_t}.
2665
2666 These issues were corrected in @option{-fabi-version=7}.
2667
2668 @item
2669 When mangling a function type with function-cv-qualifiers, the
2670 un-qualified function type was incorrectly treated as a substitution
2671 candidate.
2672
2673 This was fixed in @option{-fabi-version=8}, the default for GCC 5.1.
2674
2675 @item
2676 @code{decltype(nullptr)} incorrectly had an alignment of 1, leading to
2677 unaligned accesses.  Note that this did not affect the ABI of a
2678 function with a @code{nullptr_t} parameter, as parameters have a
2679 minimum alignment.
2680
2681 This was fixed in @option{-fabi-version=9}, the default for GCC 5.2.
2682
2683 @item
2684 Target-specific attributes that affect the identity of a type, such as
2685 ia32 calling conventions on a function type (stdcall, regparm, etc.),
2686 did not affect the mangled name, leading to name collisions when
2687 function pointers were used as template arguments.
2688
2689 This was fixed in @option{-fabi-version=10}, the default for GCC 6.1.
2690
2691 @end itemize
2692
2693 It also warns about psABI-related changes.  The known psABI changes at this
2694 point include:
2695
2696 @itemize @bullet
2697
2698 @item
2699 For SysV/x86-64, unions with @code{long double} members are 
2700 passed in memory as specified in psABI.  For example:
2701
2702 @smallexample
2703 union U @{
2704   long double ld;
2705   int i;
2706 @};
2707 @end smallexample
2708
2709 @noindent
2710 @code{union U} is always passed in memory.
2711
2712 @end itemize
2713
2714 @item -Wabi-tag @r{(C++ and Objective-C++ only)}
2715 @opindex Wabi-tag
2716 @opindex -Wabi-tag
2717 Warn when a type with an ABI tag is used in a context that does not
2718 have that ABI tag.  See @ref{C++ Attributes} for more information
2719 about ABI tags.
2720
2721 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2722 @opindex Wctor-dtor-privacy
2723 @opindex Wno-ctor-dtor-privacy
2724 Warn when a class seems unusable because all the constructors or
2725 destructors in that class are private, and it has neither friends nor
2726 public static member functions.  Also warn if there are no non-private
2727 methods, and there's at least one private member function that isn't
2728 a constructor or destructor.
2729
2730 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2731 @opindex Wdelete-non-virtual-dtor
2732 @opindex Wno-delete-non-virtual-dtor
2733 Warn when @code{delete} is used to destroy an instance of a class that
2734 has virtual functions and non-virtual destructor. It is unsafe to delete
2735 an instance of a derived class through a pointer to a base class if the
2736 base class does not have a virtual destructor.  This warning is enabled
2737 by @option{-Wall}.
2738
2739 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
2740 @opindex Wliteral-suffix
2741 @opindex Wno-literal-suffix
2742 Warn when a string or character literal is followed by a ud-suffix which does
2743 not begin with an underscore.  As a conforming extension, GCC treats such
2744 suffixes as separate preprocessing tokens in order to maintain backwards
2745 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
2746 For example:
2747
2748 @smallexample
2749 #define __STDC_FORMAT_MACROS
2750 #include <inttypes.h>
2751 #include <stdio.h>
2752
2753 int main() @{
2754   int64_t i64 = 123;
2755   printf("My int64: %" PRId64"\n", i64);
2756 @}
2757 @end smallexample
2758
2759 In this case, @code{PRId64} is treated as a separate preprocessing token.
2760
2761 This warning is enabled by default.
2762
2763 @item -Wlto-type-mismatch
2764 @opindex Wlto-type-mismatch
2765 @opindex Wno-lto-type-mistmach
2766
2767 During the link-time optimization warn about type mismatches in between
2768 global declarations from different compilation units.
2769 Requires @option{-flto} to be enabled.  Enabled by default.
2770
2771 @item -Wnarrowing @r{(C++ and Objective-C++ only)}
2772 @opindex Wnarrowing
2773 @opindex Wno-narrowing
2774 Warn when a narrowing conversion prohibited by C++11 occurs within
2775 @samp{@{ @}}, e.g.
2776
2777 @smallexample
2778 int i = @{ 2.2 @}; // error: narrowing from double to int
2779 @end smallexample
2780
2781 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2782
2783 With @option{-std=c++11}, @option{-Wno-narrowing} suppresses the diagnostic
2784 required by the standard.  Note that this does not affect the meaning
2785 of well-formed code; narrowing conversions are still considered
2786 ill-formed in SFINAE context.
2787
2788 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2789 @opindex Wnoexcept
2790 @opindex Wno-noexcept
2791 Warn when a noexcept-expression evaluates to false because of a call
2792 to a function that does not have a non-throwing exception
2793 specification (i.e. @code{throw()} or @code{noexcept}) but is known by
2794 the compiler to never throw an exception.
2795
2796 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2797 @opindex Wnon-virtual-dtor
2798 @opindex Wno-non-virtual-dtor
2799 Warn when a class has virtual functions and an accessible non-virtual
2800 destructor itself or in an accessible polymorphic base class, in which
2801 case it is possible but unsafe to delete an instance of a derived
2802 class through a pointer to the class itself or base class.  This
2803 warning is automatically enabled if @option{-Weffc++} is specified.
2804
2805 @item -Wreorder @r{(C++ and Objective-C++ only)}
2806 @opindex Wreorder
2807 @opindex Wno-reorder
2808 @cindex reordering, warning
2809 @cindex warning for reordering of member initializers
2810 Warn when the order of member initializers given in the code does not
2811 match the order in which they must be executed.  For instance:
2812
2813 @smallexample
2814 struct A @{
2815   int i;
2816   int j;
2817   A(): j (0), i (1) @{ @}
2818 @};
2819 @end smallexample
2820
2821 @noindent
2822 The compiler rearranges the member initializers for @code{i}
2823 and @code{j} to match the declaration order of the members, emitting
2824 a warning to that effect.  This warning is enabled by @option{-Wall}.
2825
2826 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
2827 @opindex fext-numeric-literals
2828 @opindex fno-ext-numeric-literals
2829 Accept imaginary, fixed-point, or machine-defined
2830 literal number suffixes as GNU extensions.
2831 When this option is turned off these suffixes are treated
2832 as C++11 user-defined literal numeric suffixes.
2833 This is on by default for all pre-C++11 dialects and all GNU dialects:
2834 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
2835 @option{-std=gnu++14}.
2836 This option is off by default
2837 for ISO C++11 onwards (@option{-std=c++11}, ...).
2838 @end table
2839
2840 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2841
2842 @table @gcctabopt
2843 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2844 @opindex Weffc++
2845 @opindex Wno-effc++
2846 Warn about violations of the following style guidelines from Scott Meyers'
2847 @cite{Effective C++} series of books:
2848
2849 @itemize @bullet
2850 @item
2851 Define a copy constructor and an assignment operator for classes
2852 with dynamically-allocated memory.
2853
2854 @item
2855 Prefer initialization to assignment in constructors.
2856
2857 @item
2858 Have @code{operator=} return a reference to @code{*this}.
2859
2860 @item
2861 Don't try to return a reference when you must return an object.
2862
2863 @item
2864 Distinguish between prefix and postfix forms of increment and
2865 decrement operators.
2866
2867 @item
2868 Never overload @code{&&}, @code{||}, or @code{,}.
2869
2870 @end itemize
2871
2872 This option also enables @option{-Wnon-virtual-dtor}, which is also
2873 one of the effective C++ recommendations.  However, the check is
2874 extended to warn about the lack of virtual destructor in accessible
2875 non-polymorphic bases classes too.
2876
2877 When selecting this option, be aware that the standard library
2878 headers do not obey all of these guidelines; use @samp{grep -v}
2879 to filter out those warnings.
2880
2881 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2882 @opindex Wstrict-null-sentinel
2883 @opindex Wno-strict-null-sentinel
2884 Warn about the use of an uncasted @code{NULL} as sentinel.  When
2885 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2886 to @code{__null}.  Although it is a null pointer constant rather than a
2887 null pointer, it is guaranteed to be of the same size as a pointer.
2888 But this use is not portable across different compilers.
2889
2890 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2891 @opindex Wno-non-template-friend
2892 @opindex Wnon-template-friend
2893 Disable warnings when non-templatized friend functions are declared
2894 within a template.  Since the advent of explicit template specification
2895 support in G++, if the name of the friend is an unqualified-id (i.e.,
2896 @samp{friend foo(int)}), the C++ language specification demands that the
2897 friend declare or define an ordinary, nontemplate function.  (Section
2898 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2899 could be interpreted as a particular specialization of a templatized
2900 function.  Because this non-conforming behavior is no longer the default
2901 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2902 check existing code for potential trouble spots and is on by default.
2903 This new compiler behavior can be turned off with
2904 @option{-Wno-non-template-friend}, which keeps the conformant compiler code
2905 but disables the helpful warning.
2906
2907 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2908 @opindex Wold-style-cast
2909 @opindex Wno-old-style-cast
2910 Warn if an old-style (C-style) cast to a non-void type is used within
2911 a C++ program.  The new-style casts (@code{dynamic_cast},
2912 @code{static_cast}, @code{reinterpret_cast}, and @code{const_cast}) are
2913 less vulnerable to unintended effects and much easier to search for.
2914
2915 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2916 @opindex Woverloaded-virtual
2917 @opindex Wno-overloaded-virtual
2918 @cindex overloaded virtual function, warning
2919 @cindex warning for overloaded virtual function
2920 Warn when a function declaration hides virtual functions from a
2921 base class.  For example, in:
2922
2923 @smallexample
2924 struct A @{
2925   virtual void f();
2926 @};
2927
2928 struct B: public A @{
2929   void f(int);
2930 @};
2931 @end smallexample
2932
2933 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2934 like:
2935
2936 @smallexample
2937 B* b;
2938 b->f();
2939 @end smallexample
2940
2941 @noindent
2942 fails to compile.
2943
2944 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2945 @opindex Wno-pmf-conversions
2946 @opindex Wpmf-conversions
2947 Disable the diagnostic for converting a bound pointer to member function
2948 to a plain pointer.
2949
2950 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2951 @opindex Wsign-promo
2952 @opindex Wno-sign-promo
2953 Warn when overload resolution chooses a promotion from unsigned or
2954 enumerated type to a signed type, over a conversion to an unsigned type of
2955 the same size.  Previous versions of G++ tried to preserve
2956 unsignedness, but the standard mandates the current behavior.
2957
2958 @item -Wtemplates @r{(C++ and Objective-C++ only)}
2959 @opindex Wtemplates
2960 Warn when a primary template declaration is encountered.  Some coding
2961 rules disallow templates, and this may be used to enforce that rule.
2962 The warning is inactive inside a system header file, such as the STL, so
2963 one can still use the STL.  One may also instantiate or specialize
2964 templates.
2965
2966 @item -Wmultiple-inheritance @r{(C++ and Objective-C++ only)}
2967 @opindex Wmultiple-inheritance
2968 Warn when a class is defined with multiple direct base classes.  Some
2969 coding rules disallow multiple inheritance, and this may be used to
2970 enforce that rule.  The warning is inactive inside a system header file,
2971 such as the STL, so one can still use the STL.  One may also define
2972 classes that indirectly use multiple inheritance.
2973
2974 @item -Wvirtual-inheritance
2975 @opindex Wvirtual-inheritance
2976 Warn when a class is defined with a virtual direct base classe.  Some
2977 coding rules disallow multiple inheritance, and this may be used to
2978 enforce that rule.  The warning is inactive inside a system header file,
2979 such as the STL, so one can still use the STL.  One may also define
2980 classes that indirectly use virtual inheritance.
2981
2982 @item -Wnamespaces
2983 @opindex Wnamespaces
2984 Warn when a namespace definition is opened.  Some coding rules disallow
2985 namespaces, and this may be used to enforce that rule.  The warning is
2986 inactive inside a system header file, such as the STL, so one can still
2987 use the STL.  One may also use using directives and qualified names.
2988
2989 @item -Wno-terminate @r{(C++ and Objective-C++ only)}
2990 @opindex Wterminate
2991 @opindex Wno-terminate
2992 Disable the warning about a throw-expression that will immediately
2993 result in a call to @code{terminate}.
2994 @end table
2995
2996 @node Objective-C and Objective-C++ Dialect Options
2997 @section Options Controlling Objective-C and Objective-C++ Dialects
2998
2999 @cindex compiler options, Objective-C and Objective-C++
3000 @cindex Objective-C and Objective-C++ options, command-line
3001 @cindex options, Objective-C and Objective-C++
3002 (NOTE: This manual does not describe the Objective-C and Objective-C++
3003 languages themselves.  @xref{Standards,,Language Standards
3004 Supported by GCC}, for references.)
3005
3006 This section describes the command-line options that are only meaningful
3007 for Objective-C and Objective-C++ programs.  You can also use most of
3008 the language-independent GNU compiler options.
3009 For example, you might compile a file @file{some_class.m} like this:
3010
3011 @smallexample
3012 gcc -g -fgnu-runtime -O -c some_class.m
3013 @end smallexample
3014
3015 @noindent
3016 In this example, @option{-fgnu-runtime} is an option meant only for
3017 Objective-C and Objective-C++ programs; you can use the other options with
3018 any language supported by GCC@.
3019
3020 Note that since Objective-C is an extension of the C language, Objective-C
3021 compilations may also use options specific to the C front-end (e.g.,
3022 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
3023 C++-specific options (e.g., @option{-Wabi}).
3024
3025 Here is a list of options that are @emph{only} for compiling Objective-C
3026 and Objective-C++ programs:
3027
3028 @table @gcctabopt
3029 @item -fconstant-string-class=@var{class-name}
3030 @opindex fconstant-string-class
3031 Use @var{class-name} as the name of the class to instantiate for each
3032 literal string specified with the syntax @code{@@"@dots{}"}.  The default
3033 class name is @code{NXConstantString} if the GNU runtime is being used, and
3034 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
3035 @option{-fconstant-cfstrings} option, if also present, overrides the
3036 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
3037 to be laid out as constant CoreFoundation strings.
3038
3039 @item -fgnu-runtime
3040 @opindex fgnu-runtime
3041 Generate object code compatible with the standard GNU Objective-C
3042 runtime.  This is the default for most types of systems.
3043
3044 @item -fnext-runtime
3045 @opindex fnext-runtime
3046 Generate output compatible with the NeXT runtime.  This is the default
3047 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
3048 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
3049 used.
3050
3051 @item -fno-nil-receivers
3052 @opindex fno-nil-receivers
3053 Assume that all Objective-C message dispatches (@code{[receiver
3054 message:arg]}) in this translation unit ensure that the receiver is
3055 not @code{nil}.  This allows for more efficient entry points in the
3056 runtime to be used.  This option is only available in conjunction with
3057 the NeXT runtime and ABI version 0 or 1.
3058
3059 @item -fobjc-abi-version=@var{n}
3060 @opindex fobjc-abi-version
3061 Use version @var{n} of the Objective-C ABI for the selected runtime.
3062 This option is currently supported only for the NeXT runtime.  In that
3063 case, Version 0 is the traditional (32-bit) ABI without support for
3064 properties and other Objective-C 2.0 additions.  Version 1 is the
3065 traditional (32-bit) ABI with support for properties and other
3066 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
3067 nothing is specified, the default is Version 0 on 32-bit target
3068 machines, and Version 2 on 64-bit target machines.
3069
3070 @item -fobjc-call-cxx-cdtors
3071 @opindex fobjc-call-cxx-cdtors
3072 For each Objective-C class, check if any of its instance variables is a
3073 C++ object with a non-trivial default constructor.  If so, synthesize a
3074 special @code{- (id) .cxx_construct} instance method which runs
3075 non-trivial default constructors on any such instance variables, in order,
3076 and then return @code{self}.  Similarly, check if any instance variable
3077 is a C++ object with a non-trivial destructor, and if so, synthesize a
3078 special @code{- (void) .cxx_destruct} method which runs
3079 all such default destructors, in reverse order.
3080
3081 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
3082 methods thusly generated only operate on instance variables
3083 declared in the current Objective-C class, and not those inherited
3084 from superclasses.  It is the responsibility of the Objective-C
3085 runtime to invoke all such methods in an object's inheritance
3086 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
3087 by the runtime immediately after a new object instance is allocated;
3088 the @code{- (void) .cxx_destruct} methods are invoked immediately
3089 before the runtime deallocates an object instance.
3090
3091 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
3092 support for invoking the @code{- (id) .cxx_construct} and
3093 @code{- (void) .cxx_destruct} methods.
3094
3095 @item -fobjc-direct-dispatch
3096 @opindex fobjc-direct-dispatch
3097 Allow fast jumps to the message dispatcher.  On Darwin this is
3098 accomplished via the comm page.
3099
3100 @item -fobjc-exceptions
3101 @opindex fobjc-exceptions
3102 Enable syntactic support for structured exception handling in
3103 Objective-C, similar to what is offered by C++ and Java.  This option
3104 is required to use the Objective-C keywords @code{@@try},
3105 @code{@@throw}, @code{@@catch}, @code{@@finally} and
3106 @code{@@synchronized}.  This option is available with both the GNU
3107 runtime and the NeXT runtime (but not available in conjunction with
3108 the NeXT runtime on Mac OS X 10.2 and earlier).
3109
3110 @item -fobjc-gc
3111 @opindex fobjc-gc
3112 Enable garbage collection (GC) in Objective-C and Objective-C++
3113 programs.  This option is only available with the NeXT runtime; the
3114 GNU runtime has a different garbage collection implementation that
3115 does not require special compiler flags.
3116
3117 @item -fobjc-nilcheck
3118 @opindex fobjc-nilcheck
3119 For the NeXT runtime with version 2 of the ABI, check for a nil
3120 receiver in method invocations before doing the actual method call.
3121 This is the default and can be disabled using
3122 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
3123 checked for nil in this way no matter what this flag is set to.
3124 Currently this flag does nothing when the GNU runtime, or an older
3125 version of the NeXT runtime ABI, is used.
3126
3127 @item -fobjc-std=objc1
3128 @opindex fobjc-std
3129 Conform to the language syntax of Objective-C 1.0, the language
3130 recognized by GCC 4.0.  This only affects the Objective-C additions to
3131 the C/C++ language; it does not affect conformance to C/C++ standards,
3132 which is controlled by the separate C/C++ dialect option flags.  When
3133 this option is used with the Objective-C or Objective-C++ compiler,
3134 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
3135 This is useful if you need to make sure that your Objective-C code can
3136 be compiled with older versions of GCC@.
3137
3138 @item -freplace-objc-classes
3139 @opindex freplace-objc-classes
3140 Emit a special marker instructing @command{ld(1)} not to statically link in
3141 the resulting object file, and allow @command{dyld(1)} to load it in at
3142 run time instead.  This is used in conjunction with the Fix-and-Continue
3143 debugging mode, where the object file in question may be recompiled and
3144 dynamically reloaded in the course of program execution, without the need
3145 to restart the program itself.  Currently, Fix-and-Continue functionality
3146 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
3147 and later.
3148
3149 @item -fzero-link
3150 @opindex fzero-link
3151 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
3152 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
3153 compile time) with static class references that get initialized at load time,
3154 which improves run-time performance.  Specifying the @option{-fzero-link} flag
3155 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
3156 to be retained.  This is useful in Zero-Link debugging mode, since it allows
3157 for individual class implementations to be modified during program execution.
3158 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
3159 regardless of command-line options.
3160
3161 @item -fno-local-ivars
3162 @opindex fno-local-ivars
3163 @opindex flocal-ivars
3164 By default instance variables in Objective-C can be accessed as if
3165 they were local variables from within the methods of the class they're
3166 declared in.  This can lead to shadowing between instance variables
3167 and other variables declared either locally inside a class method or
3168 globally with the same name.  Specifying the @option{-fno-local-ivars}
3169 flag disables this behavior thus avoiding variable shadowing issues.
3170
3171 @item -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]}
3172 @opindex fivar-visibility
3173 Set the default instance variable visibility to the specified option
3174 so that instance variables declared outside the scope of any access
3175 modifier directives default to the specified visibility.
3176
3177 @item -gen-decls
3178 @opindex gen-decls
3179 Dump interface declarations for all classes seen in the source file to a
3180 file named @file{@var{sourcename}.decl}.
3181
3182 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
3183 @opindex Wassign-intercept
3184 @opindex Wno-assign-intercept
3185 Warn whenever an Objective-C assignment is being intercepted by the
3186 garbage collector.
3187
3188 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
3189 @opindex Wno-protocol
3190 @opindex Wprotocol
3191 If a class is declared to implement a protocol, a warning is issued for
3192 every method in the protocol that is not implemented by the class.  The
3193 default behavior is to issue a warning for every method not explicitly
3194 implemented in the class, even if a method implementation is inherited
3195 from the superclass.  If you use the @option{-Wno-protocol} option, then
3196 methods inherited from the superclass are considered to be implemented,
3197 and no warning is issued for them.
3198
3199 @item -Wselector @r{(Objective-C and Objective-C++ only)}
3200 @opindex Wselector
3201 @opindex Wno-selector
3202 Warn if multiple methods of different types for the same selector are
3203 found during compilation.  The check is performed on the list of methods
3204 in the final stage of compilation.  Additionally, a check is performed
3205 for each selector appearing in a @code{@@selector(@dots{})}
3206 expression, and a corresponding method for that selector has been found
3207 during compilation.  Because these checks scan the method table only at
3208 the end of compilation, these warnings are not produced if the final
3209 stage of compilation is not reached, for example because an error is
3210 found during compilation, or because the @option{-fsyntax-only} option is
3211 being used.
3212
3213 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
3214 @opindex Wstrict-selector-match
3215 @opindex Wno-strict-selector-match
3216 Warn if multiple methods with differing argument and/or return types are
3217 found for a given selector when attempting to send a message using this
3218 selector to a receiver of type @code{id} or @code{Class}.  When this flag
3219 is off (which is the default behavior), the compiler omits such warnings
3220 if any differences found are confined to types that share the same size
3221 and alignment.
3222
3223 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
3224 @opindex Wundeclared-selector
3225 @opindex Wno-undeclared-selector
3226 Warn if a @code{@@selector(@dots{})} expression referring to an
3227 undeclared selector is found.  A selector is considered undeclared if no
3228 method with that name has been declared before the
3229 @code{@@selector(@dots{})} expression, either explicitly in an
3230 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
3231 an @code{@@implementation} section.  This option always performs its
3232 checks as soon as a @code{@@selector(@dots{})} expression is found,
3233 while @option{-Wselector} only performs its checks in the final stage of
3234 compilation.  This also enforces the coding style convention
3235 that methods and selectors must be declared before being used.
3236
3237 @item -print-objc-runtime-info
3238 @opindex print-objc-runtime-info
3239 Generate C header describing the largest structure that is passed by
3240 value, if any.
3241
3242 @end table
3243
3244 @node Diagnostic Message Formatting Options
3245 @section Options to Control Diagnostic Messages Formatting
3246 @cindex options to control diagnostics formatting
3247 @cindex diagnostic messages
3248 @cindex message formatting
3249
3250 Traditionally, diagnostic messages have been formatted irrespective of
3251 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
3252 options described below
3253 to control the formatting algorithm for diagnostic messages, 
3254 e.g.@: how many characters per line, how often source location
3255 information should be reported.  Note that some language front ends may not
3256 honor these options.
3257
3258 @table @gcctabopt
3259 @item -fmessage-length=@var{n}
3260 @opindex fmessage-length
3261 Try to format error messages so that they fit on lines of about
3262 @var{n} characters.  If @var{n} is zero, then no line-wrapping is
3263 done; each error message appears on a single line.  This is the
3264 default for all front ends.
3265
3266 @item -fdiagnostics-show-location=once
3267 @opindex fdiagnostics-show-location
3268 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
3269 reporter to emit source location information @emph{once}; that is, in
3270 case the message is too long to fit on a single physical line and has to
3271 be wrapped, the source location won't be emitted (as prefix) again,
3272 over and over, in subsequent continuation lines.  This is the default
3273 behavior.
3274
3275 @item -fdiagnostics-show-location=every-line
3276 Only meaningful in line-wrapping mode.  Instructs the diagnostic
3277 messages reporter to emit the same source location information (as
3278 prefix) for physical lines that result from the process of breaking
3279 a message which is too long to fit on a single line.
3280
3281 @item -fdiagnostics-color[=@var{WHEN}]
3282 @itemx -fno-diagnostics-color
3283 @opindex fdiagnostics-color
3284 @cindex highlight, color, colour
3285 @vindex GCC_COLORS @r{environment variable}
3286 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
3287 or @samp{auto}.  The default depends on how the compiler has been configured,
3288 it can be any of the above @var{WHEN} options or also @samp{never}
3289 if @env{GCC_COLORS} environment variable isn't present in the environment,
3290 and @samp{auto} otherwise.
3291 @samp{auto} means to use color only when the standard error is a terminal.
3292 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
3293 aliases for @option{-fdiagnostics-color=always} and
3294 @option{-fdiagnostics-color=never}, respectively.
3295
3296 The colors are defined by the environment variable @env{GCC_COLORS}.
3297 Its value is a colon-separated list of capabilities and Select Graphic
3298 Rendition (SGR) substrings. SGR commands are interpreted by the
3299 terminal or terminal emulator.  (See the section in the documentation
3300 of your text terminal for permitted values and their meanings as
3301 character attributes.)  These substring values are integers in decimal
3302 representation and can be concatenated with semicolons.
3303 Common values to concatenate include
3304 @samp{1} for bold,
3305 @samp{4} for underline,
3306 @samp{5} for blink,
3307 @samp{7} for inverse,
3308 @samp{39} for default foreground color,
3309 @samp{30} to @samp{37} for foreground colors,
3310 @samp{90} to @samp{97} for 16-color mode foreground colors,
3311 @samp{38;5;0} to @samp{38;5;255}
3312 for 88-color and 256-color modes foreground colors,
3313 @samp{49} for default background color,
3314 @samp{40} to @samp{47} for background colors,
3315 @samp{100} to @samp{107} for 16-color mode background colors,
3316 and @samp{48;5;0} to @samp{48;5;255}
3317 for 88-color and 256-color modes background colors.
3318
3319 The default @env{GCC_COLORS} is
3320 @smallexample
3321 error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01
3322 @end smallexample
3323 @noindent
3324 where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
3325 @samp{01;36} is bold cyan, @samp{01;32} is bold green and
3326 @samp{01} is bold. Setting @env{GCC_COLORS} to the empty
3327 string disables colors.
3328 Supported capabilities are as follows.
3329
3330 @table @code
3331 @item error=
3332 @vindex error GCC_COLORS @r{capability}
3333 SGR substring for error: markers.
3334
3335 @item warning=
3336 @vindex warning GCC_COLORS @r{capability}
3337 SGR substring for warning: markers.
3338
3339 @item note=
3340 @vindex note GCC_COLORS @r{capability}
3341 SGR substring for note: markers.
3342
3343 @item caret=
3344 @vindex caret GCC_COLORS @r{capability}
3345 SGR substring for caret line.
3346
3347 @item locus=
3348 @vindex locus GCC_COLORS @r{capability}
3349 SGR substring for location information, @samp{file:line} or
3350 @samp{file:line:column} etc.
3351
3352 @item quote=
3353 @vindex quote GCC_COLORS @r{capability}
3354 SGR substring for information printed within quotes.
3355 @end table
3356
3357 @item -fno-diagnostics-show-option
3358 @opindex fno-diagnostics-show-option
3359 @opindex fdiagnostics-show-option
3360 By default, each diagnostic emitted includes text indicating the
3361 command-line option that directly controls the diagnostic (if such an
3362 option is known to the diagnostic machinery).  Specifying the
3363 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
3364
3365 @item -fno-diagnostics-show-caret
3366 @opindex fno-diagnostics-show-caret
3367 @opindex fdiagnostics-show-caret
3368 By default, each diagnostic emitted includes the original source line
3369 and a caret '^' indicating the column.  This option suppresses this
3370 information.  The source line is truncated to @var{n} characters, if
3371 the @option{-fmessage-length=n} option is given.  When the output is done
3372 to the terminal, the width is limited to the width given by the
3373 @env{COLUMNS} environment variable or, if not set, to the terminal width.
3374
3375 @end table
3376
3377 @node Warning Options
3378 @section Options to Request or Suppress Warnings
3379 @cindex options to control warnings
3380 @cindex warning messages
3381 @cindex messages, warning
3382 @cindex suppressing warnings
3383
3384 Warnings are diagnostic messages that report constructions that
3385 are not inherently erroneous but that are risky or suggest there
3386 may have been an error.
3387
3388 The following language-independent options do not enable specific
3389 warnings but control the kinds of diagnostics produced by GCC@.
3390
3391 @table @gcctabopt
3392 @cindex syntax checking
3393 @item -fsyntax-only
3394 @opindex fsyntax-only
3395 Check the code for syntax errors, but don't do anything beyond that.
3396
3397 @item -fmax-errors=@var{n}
3398 @opindex fmax-errors
3399 Limits the maximum number of error messages to @var{n}, at which point
3400 GCC bails out rather than attempting to continue processing the source
3401 code.  If @var{n} is 0 (the default), there is no limit on the number
3402 of error messages produced.  If @option{-Wfatal-errors} is also
3403 specified, then @option{-Wfatal-errors} takes precedence over this
3404 option.
3405
3406 @item -w
3407 @opindex w
3408 Inhibit all warning messages.
3409
3410 @item -Werror
3411 @opindex Werror
3412 @opindex Wno-error
3413 Make all warnings into errors.
3414
3415 @item -Werror=
3416 @opindex Werror=
3417 @opindex Wno-error=
3418 Make the specified warning into an error.  The specifier for a warning
3419 is appended; for example @option{-Werror=switch} turns the warnings
3420 controlled by @option{-Wswitch} into errors.  This switch takes a
3421 negative form, to be used to negate @option{-Werror} for specific
3422 warnings; for example @option{-Wno-error=switch} makes
3423 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3424 is in effect.
3425
3426 The warning message for each controllable warning includes the
3427 option that controls the warning.  That option can then be used with
3428 @option{-Werror=} and @option{-Wno-error=} as described above.
3429 (Printing of the option in the warning message can be disabled using the
3430 @option{-fno-diagnostics-show-option} flag.)
3431
3432 Note that specifying @option{-Werror=}@var{foo} automatically implies
3433 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3434 imply anything.
3435
3436 @item -Wfatal-errors
3437 @opindex Wfatal-errors
3438 @opindex Wno-fatal-errors
3439 This option causes the compiler to abort compilation on the first error
3440 occurred rather than trying to keep going and printing further error
3441 messages.
3442
3443 @end table
3444
3445 You can request many specific warnings with options beginning with
3446 @samp{-W}, for example @option{-Wimplicit} to request warnings on
3447 implicit declarations.  Each of these specific warning options also
3448 has a negative form beginning @samp{-Wno-} to turn off warnings; for
3449 example, @option{-Wno-implicit}.  This manual lists only one of the
3450 two forms, whichever is not the default.  For further
3451 language-specific options also refer to @ref{C++ Dialect Options} and
3452 @ref{Objective-C and Objective-C++ Dialect Options}.
3453
3454 Some options, such as @option{-Wall} and @option{-Wextra}, turn on other
3455 options, such as @option{-Wunused}, which may turn on further options,
3456 such as @option{-Wunused-value}. The combined effect of positive and
3457 negative forms is that more specific options have priority over less
3458 specific ones, independently of their position in the command-line. For
3459 options of the same specificity, the last one takes effect. Options
3460 enabled or disabled via pragmas (@pxref{Diagnostic Pragmas}) take effect
3461 as if they appeared at the end of the command-line.
3462
3463 When an unrecognized warning option is requested (e.g.,
3464 @option{-Wunknown-warning}), GCC emits a diagnostic stating
3465 that the option is not recognized.  However, if the @option{-Wno-} form
3466 is used, the behavior is slightly different: no diagnostic is
3467 produced for @option{-Wno-unknown-warning} unless other diagnostics
3468 are being produced.  This allows the use of new @option{-Wno-} options
3469 with old compilers, but if something goes wrong, the compiler
3470 warns that an unrecognized option is present.
3471
3472 @table @gcctabopt
3473 @item -Wpedantic
3474 @itemx -pedantic
3475 @opindex pedantic
3476 @opindex Wpedantic
3477 Issue all the warnings demanded by strict ISO C and ISO C++;
3478 reject all programs that use forbidden extensions, and some other
3479 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
3480 version of the ISO C standard specified by any @option{-std} option used.
3481
3482 Valid ISO C and ISO C++ programs should compile properly with or without
3483 this option (though a rare few require @option{-ansi} or a
3484 @option{-std} option specifying the required version of ISO C)@.  However,
3485 without this option, certain GNU extensions and traditional C and C++
3486 features are supported as well.  With this option, they are rejected.
3487
3488 @option{-Wpedantic} does not cause warning messages for use of the
3489 alternate keywords whose names begin and end with @samp{__}.  Pedantic
3490 warnings are also disabled in the expression that follows
3491 @code{__extension__}.  However, only system header files should use
3492 these escape routes; application programs should avoid them.
3493 @xref{Alternate Keywords}.
3494
3495 Some users try to use @option{-Wpedantic} to check programs for strict ISO
3496 C conformance.  They soon find that it does not do quite what they want:
3497 it finds some non-ISO practices, but not all---only those for which
3498 ISO C @emph{requires} a diagnostic, and some others for which
3499 diagnostics have been added.
3500
3501 A feature to report any failure to conform to ISO C might be useful in
3502 some instances, but would require considerable additional work and would
3503 be quite different from @option{-Wpedantic}.  We don't have plans to
3504 support such a feature in the near future.
3505
3506 Where the standard specified with @option{-std} represents a GNU
3507 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3508 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3509 extended dialect is based.  Warnings from @option{-Wpedantic} are given
3510 where they are required by the base standard.  (It does not make sense
3511 for such warnings to be given only for features not in the specified GNU
3512 C dialect, since by definition the GNU dialects of C include all
3513 features the compiler supports with the given option, and there would be
3514 nothing to warn about.)
3515
3516 @item -pedantic-errors
3517 @opindex pedantic-errors
3518 Give an error whenever the @dfn{base standard} (see @option{-Wpedantic})
3519 requires a diagnostic, in some cases where there is undefined behavior
3520 at compile-time and in some other cases that do not prevent compilation
3521 of programs that are valid according to the standard. This is not
3522 equivalent to @option{-Werror=pedantic}, since there are errors enabled
3523 by this option and not enabled by the latter and vice versa.
3524
3525 @item -Wall
3526 @opindex Wall
3527 @opindex Wno-all
3528 This enables all the warnings about constructions that some users
3529 consider questionable, and that are easy to avoid (or modify to
3530 prevent the warning), even in conjunction with macros.  This also
3531 enables some language-specific warnings described in @ref{C++ Dialect
3532 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3533
3534 @option{-Wall} turns on the following warning flags:
3535
3536 @gccoptlist{-Waddress   @gol
3537 -Warray-bounds=1 @r{(only with} @option{-O2}@r{)}  @gol
3538 -Wc++11-compat  -Wc++14-compat@gol
3539 -Wchar-subscripts  @gol
3540 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
3541 -Wimplicit-int @r{(C and Objective-C only)} @gol
3542 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3543 -Wbool-compare  @gol
3544 -Wduplicated-cond  @gol
3545 -Wcomment  @gol
3546 -Wformat   @gol
3547 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3548 -Wmaybe-uninitialized @gol
3549 -Wmissing-braces @r{(only for C/ObjC)} @gol
3550 -Wnonnull  @gol
3551 -Wopenmp-simd @gol
3552 -Wparentheses  @gol
3553 -Wpointer-sign  @gol
3554 -Wreorder   @gol
3555 -Wreturn-type  @gol
3556 -Wsequence-point  @gol
3557 -Wsign-compare @r{(only in C++)}  @gol
3558 -Wstrict-aliasing  @gol
3559 -Wstrict-overflow=1  @gol
3560 -Wswitch  @gol
3561 -Wtautological-compare  @gol
3562 -Wtrigraphs  @gol
3563 -Wuninitialized  @gol
3564 -Wunknown-pragmas  @gol
3565 -Wunused-function  @gol
3566 -Wunused-label     @gol
3567 -Wunused-value     @gol
3568 -Wunused-variable  @gol
3569 -Wvolatile-register-var @gol
3570 }
3571
3572 Note that some warning flags are not implied by @option{-Wall}.  Some of
3573 them warn about constructions that users generally do not consider
3574 questionable, but which occasionally you might wish to check for;
3575 others warn about constructions that are necessary or hard to avoid in
3576 some cases, and there is no simple way to modify the code to suppress
3577 the warning. Some of them are enabled by @option{-Wextra} but many of
3578 them must be enabled individually.
3579
3580 @item -Wextra
3581 @opindex W
3582 @opindex Wextra
3583 @opindex Wno-extra
3584 This enables some extra warning flags that are not enabled by
3585 @option{-Wall}. (This option used to be called @option{-W}.  The older
3586 name is still supported, but the newer name is more descriptive.)
3587
3588 @gccoptlist{-Wclobbered  @gol
3589 -Wempty-body  @gol
3590 -Wignored-qualifiers @gol
3591 -Wmissing-field-initializers  @gol
3592 -Wmissing-parameter-type @r{(C only)}  @gol
3593 -Wold-style-declaration @r{(C only)}  @gol
3594 -Woverride-init  @gol
3595 -Wsign-compare  @gol
3596 -Wtype-limits  @gol
3597 -Wuninitialized  @gol
3598 -Wshift-negative-value  @gol
3599 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3600 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3601 }
3602
3603 The option @option{-Wextra} also prints warning messages for the
3604 following cases:
3605
3606 @itemize @bullet
3607
3608 @item
3609 A pointer is compared against integer zero with @code{<}, @code{<=},
3610 @code{>}, or @code{>=}.
3611
3612 @item
3613 (C++ only) An enumerator and a non-enumerator both appear in a
3614 conditional expression.
3615
3616 @item
3617 (C++ only) Ambiguous virtual bases.
3618
3619 @item
3620 (C++ only) Subscripting an array that has been declared @code{register}.
3621
3622 @item
3623 (C++ only) Taking the address of a variable that has been declared
3624 @code{register}.
3625
3626 @item
3627 (C++ only) A base class is not initialized in a derived class's copy
3628 constructor.
3629
3630 @end itemize
3631
3632 @item -Wchar-subscripts
3633 @opindex Wchar-subscripts
3634 @opindex Wno-char-subscripts
3635 Warn if an array subscript has type @code{char}.  This is a common cause
3636 of error, as programmers often forget that this type is signed on some
3637 machines.
3638 This warning is enabled by @option{-Wall}.
3639
3640 @item -Wcomment
3641 @opindex Wcomment
3642 @opindex Wno-comment
3643 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3644 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3645 This warning is enabled by @option{-Wall}.
3646
3647 @item -Wno-coverage-mismatch
3648 @opindex Wno-coverage-mismatch
3649 Warn if feedback profiles do not match when using the
3650 @option{-fprofile-use} option.
3651 If a source file is changed between compiling with @option{-fprofile-gen} and
3652 with @option{-fprofile-use}, the files with the profile feedback can fail
3653 to match the source file and GCC cannot use the profile feedback
3654 information.  By default, this warning is enabled and is treated as an
3655 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3656 warning or @option{-Wno-error=coverage-mismatch} can be used to
3657 disable the error.  Disabling the error for this warning can result in
3658 poorly optimized code and is useful only in the
3659 case of very minor changes such as bug fixes to an existing code-base.
3660 Completely disabling the warning is not recommended.
3661
3662 @item -Wno-cpp
3663 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3664
3665 Suppress warning messages emitted by @code{#warning} directives.
3666
3667 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3668 @opindex Wdouble-promotion
3669 @opindex Wno-double-promotion
3670 Give a warning when a value of type @code{float} is implicitly
3671 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3672 floating-point unit implement @code{float} in hardware, but emulate
3673 @code{double} in software.  On such a machine, doing computations
3674 using @code{double} values is much more expensive because of the
3675 overhead required for software emulation.
3676
3677 It is easy to accidentally do computations with @code{double} because
3678 floating-point literals are implicitly of type @code{double}.  For
3679 example, in:
3680 @smallexample
3681 @group
3682 float area(float radius)
3683 @{
3684    return 3.14159 * radius * radius;
3685 @}
3686 @end group
3687 @end smallexample
3688 the compiler performs the entire computation with @code{double}
3689 because the floating-point literal is a @code{double}.
3690
3691 @item -Wformat
3692 @itemx -Wformat=@var{n}
3693 @opindex Wformat
3694 @opindex Wno-format
3695 @opindex ffreestanding
3696 @opindex fno-builtin
3697 @opindex Wformat=
3698 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3699 the arguments supplied have types appropriate to the format string
3700 specified, and that the conversions specified in the format string make
3701 sense.  This includes standard functions, and others specified by format
3702 attributes (@pxref{Function Attributes}), in the @code{printf},
3703 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3704 not in the C standard) families (or other target-specific families).
3705 Which functions are checked without format attributes having been
3706 specified depends on the standard version selected, and such checks of
3707 functions without the attribute specified are disabled by
3708 @option{-ffreestanding} or @option{-fno-builtin}.
3709
3710 The formats are checked against the format features supported by GNU
3711 libc version 2.2.  These include all ISO C90 and C99 features, as well
3712 as features from the Single Unix Specification and some BSD and GNU
3713 extensions.  Other library implementations may not support all these
3714 features; GCC does not support warning about features that go beyond a
3715 particular library's limitations.  However, if @option{-Wpedantic} is used
3716 with @option{-Wformat}, warnings are given about format features not
3717 in the selected standard version (but not for @code{strfmon} formats,
3718 since those are not in any version of the C standard).  @xref{C Dialect
3719 Options,,Options Controlling C Dialect}.
3720
3721 @table @gcctabopt
3722 @item -Wformat=1
3723 @itemx -Wformat
3724 @opindex Wformat
3725 @opindex Wformat=1
3726 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
3727 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
3728 @option{-Wformat} also checks for null format arguments for several
3729 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
3730 aspects of this level of format checking can be disabled by the
3731 options: @option{-Wno-format-contains-nul},
3732 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
3733 @option{-Wformat} is enabled by @option{-Wall}.
3734
3735 @item -Wno-format-contains-nul
3736 @opindex Wno-format-contains-nul
3737 @opindex Wformat-contains-nul
3738 If @option{-Wformat} is specified, do not warn about format strings that
3739 contain NUL bytes.
3740
3741 @item -Wno-format-extra-args
3742 @opindex Wno-format-extra-args
3743 @opindex Wformat-extra-args
3744 If @option{-Wformat} is specified, do not warn about excess arguments to a
3745 @code{printf} or @code{scanf} format function.  The C standard specifies
3746 that such arguments are ignored.
3747
3748 Where the unused arguments lie between used arguments that are
3749 specified with @samp{$} operand number specifications, normally
3750 warnings are still given, since the implementation could not know what
3751 type to pass to @code{va_arg} to skip the unused arguments.  However,
3752 in the case of @code{scanf} formats, this option suppresses the
3753 warning if the unused arguments are all pointers, since the Single
3754 Unix Specification says that such unused arguments are allowed.
3755
3756 @item -Wno-format-zero-length
3757 @opindex Wno-format-zero-length
3758 @opindex Wformat-zero-length
3759 If @option{-Wformat} is specified, do not warn about zero-length formats.
3760 The C standard specifies that zero-length formats are allowed.
3761
3762
3763 @item -Wformat=2
3764 @opindex Wformat=2
3765 Enable @option{-Wformat} plus additional format checks.  Currently
3766 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
3767 -Wformat-y2k}.
3768
3769 @item -Wformat-nonliteral
3770 @opindex Wformat-nonliteral
3771 @opindex Wno-format-nonliteral
3772 If @option{-Wformat} is specified, also warn if the format string is not a
3773 string literal and so cannot be checked, unless the format function
3774 takes its format arguments as a @code{va_list}.
3775
3776 @item -Wformat-security
3777 @opindex Wformat-security
3778 @opindex Wno-format-security
3779 If @option{-Wformat} is specified, also warn about uses of format
3780 functions that represent possible security problems.  At present, this
3781 warns about calls to @code{printf} and @code{scanf} functions where the
3782 format string is not a string literal and there are no format arguments,
3783 as in @code{printf (foo);}.  This may be a security hole if the format
3784 string came from untrusted input and contains @samp{%n}.  (This is
3785 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3786 in future warnings may be added to @option{-Wformat-security} that are not
3787 included in @option{-Wformat-nonliteral}.)
3788
3789 @item -Wformat-signedness
3790 @opindex Wformat-signedness
3791 @opindex Wno-format-signedness
3792 If @option{-Wformat} is specified, also warn if the format string
3793 requires an unsigned argument and the argument is signed and vice versa.
3794
3795 @item -Wformat-y2k
3796 @opindex Wformat-y2k
3797 @opindex Wno-format-y2k
3798 If @option{-Wformat} is specified, also warn about @code{strftime}
3799 formats that may yield only a two-digit year.
3800 @end table
3801
3802 @item -Wnonnull
3803 @opindex Wnonnull
3804 @opindex Wno-nonnull
3805 Warn about passing a null pointer for arguments marked as
3806 requiring a non-null value by the @code{nonnull} function attribute.
3807
3808 Also warns when comparing an argument marked with the @code{nonnull}
3809 function attribute against null inside the function.
3810
3811 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3812 can be disabled with the @option{-Wno-nonnull} option.
3813
3814 @item -Wnull-dereference
3815 @opindex Wnull-dereference
3816 @opindex Wno-null-dereference
3817 Warn if the compiler detects paths that trigger erroneous or
3818 undefined behavior due to dereferencing a null pointer.  This option
3819 is only active when @option{-fdelete-null-pointer-checks} is active,
3820 which is enabled by optimizations in most targets.  The precision of
3821 the warnings depends on the optimization options used.
3822
3823 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3824 @opindex Winit-self
3825 @opindex Wno-init-self
3826 Warn about uninitialized variables that are initialized with themselves.
3827 Note this option can only be used with the @option{-Wuninitialized} option.
3828
3829 For example, GCC warns about @code{i} being uninitialized in the
3830 following snippet only when @option{-Winit-self} has been specified:
3831 @smallexample
3832 @group
3833 int f()
3834 @{
3835   int i = i;
3836   return i;
3837 @}
3838 @end group
3839 @end smallexample
3840
3841 This warning is enabled by @option{-Wall} in C++.
3842
3843 @item -Wimplicit-int @r{(C and Objective-C only)}
3844 @opindex Wimplicit-int
3845 @opindex Wno-implicit-int
3846 Warn when a declaration does not specify a type.
3847 This warning is enabled by @option{-Wall}.
3848
3849 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3850 @opindex Wimplicit-function-declaration
3851 @opindex Wno-implicit-function-declaration
3852 Give a warning whenever a function is used before being declared. In
3853 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3854 enabled by default and it is made into an error by
3855 @option{-pedantic-errors}. This warning is also enabled by
3856 @option{-Wall}.
3857
3858 @item -Wimplicit @r{(C and Objective-C only)}
3859 @opindex Wimplicit
3860 @opindex Wno-implicit
3861 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3862 This warning is enabled by @option{-Wall}.
3863
3864 @item -Wignored-qualifiers @r{(C and C++ only)}
3865 @opindex Wignored-qualifiers
3866 @opindex Wno-ignored-qualifiers
3867 Warn if the return type of a function has a type qualifier
3868 such as @code{const}.  For ISO C such a type qualifier has no effect,
3869 since the value returned by a function is not an lvalue.
3870 For C++, the warning is only emitted for scalar types or @code{void}.
3871 ISO C prohibits qualified @code{void} return types on function
3872 definitions, so such return types always receive a warning
3873 even without this option.
3874
3875 This warning is also enabled by @option{-Wextra}.
3876
3877 @item -Wmain
3878 @opindex Wmain
3879 @opindex Wno-main
3880 Warn if the type of @code{main} is suspicious.  @code{main} should be
3881 a function with external linkage, returning int, taking either zero
3882 arguments, two, or three arguments of appropriate types.  This warning
3883 is enabled by default in C++ and is enabled by either @option{-Wall}
3884 or @option{-Wpedantic}.
3885
3886 @item -Wmisleading-indentation @r{(C and C++ only)}
3887 @opindex Wmisleading-indentation
3888 @opindex Wno-misleading-indentation
3889 Warn when the indentation of the code does not reflect the block structure.
3890 Specifically, a warning is issued for @code{if}, @code{else}, @code{while}, and
3891 @code{for} clauses with a guarded statement that does not use braces,
3892 followed by an unguarded statement with the same indentation.
3893
3894 This warning is disabled by default.
3895
3896 In the following example, the call to ``bar'' is misleadingly indented as
3897 if it were guarded by the ``if'' conditional.
3898
3899 @smallexample
3900   if (some_condition ())
3901     foo ();
3902     bar ();  /* Gotcha: this is not guarded by the "if".  */
3903 @end smallexample
3904
3905 In the case of mixed tabs and spaces, the warning uses the
3906 @option{-ftabstop=} option to determine if the statements line up
3907 (defaulting to 8).
3908
3909 The warning is not issued for code involving multiline preprocessor logic
3910 such as the following example.
3911
3912 @smallexample
3913   if (flagA)
3914     foo (0);
3915 #if SOME_CONDITION_THAT_DOES_NOT_HOLD
3916   if (flagB)
3917 #endif
3918     foo (1);
3919 @end smallexample
3920
3921 The warning is not issued after a @code{#line} directive, since this
3922 typically indicates autogenerated code, and no assumptions can be made
3923 about the layout of the file that the directive references.
3924
3925 @item -Wmissing-braces
3926 @opindex Wmissing-braces
3927 @opindex Wno-missing-braces
3928 Warn if an aggregate or union initializer is not fully bracketed.  In
3929 the following example, the initializer for @code{a} is not fully
3930 bracketed, but that for @code{b} is fully bracketed.  This warning is
3931 enabled by @option{-Wall} in C.
3932
3933 @smallexample
3934 int a[2][2] = @{ 0, 1, 2, 3 @};
3935 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3936 @end smallexample
3937
3938 This warning is enabled by @option{-Wall}.
3939
3940 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3941 @opindex Wmissing-include-dirs
3942 @opindex Wno-missing-include-dirs
3943 Warn if a user-supplied include directory does not exist.
3944
3945 @item -Wparentheses
3946 @opindex Wparentheses
3947 @opindex Wno-parentheses
3948 Warn if parentheses are omitted in certain contexts, such
3949 as when there is an assignment in a context where a truth value
3950 is expected, or when operators are nested whose precedence people
3951 often get confused about.
3952
3953 Also warn if a comparison like @code{x<=y<=z} appears; this is
3954 equivalent to @code{(x<=y ? 1 : 0) <= z}, which is a different
3955 interpretation from that of ordinary mathematical notation.
3956
3957 Also warn about constructions where there may be confusion to which
3958 @code{if} statement an @code{else} branch belongs.  Here is an example of
3959 such a case:
3960
3961 @smallexample
3962 @group
3963 @{
3964   if (a)
3965     if (b)
3966       foo ();
3967   else
3968     bar ();
3969 @}
3970 @end group
3971 @end smallexample
3972
3973 In C/C++, every @code{else} branch belongs to the innermost possible
3974 @code{if} statement, which in this example is @code{if (b)}.  This is
3975 often not what the programmer expected, as illustrated in the above
3976 example by indentation the programmer chose.  When there is the
3977 potential for this confusion, GCC issues a warning when this flag
3978 is specified.  To eliminate the warning, add explicit braces around
3979 the innermost @code{if} statement so there is no way the @code{else}
3980 can belong to the enclosing @code{if}.  The resulting code
3981 looks like this:
3982
3983 @smallexample
3984 @group
3985 @{
3986   if (a)
3987     @{
3988       if (b)
3989         foo ();
3990       else
3991         bar ();
3992     @}
3993 @}
3994 @end group
3995 @end smallexample
3996
3997 Also warn for dangerous uses of the GNU extension to
3998 @code{?:} with omitted middle operand. When the condition
3999 in the @code{?}: operator is a boolean expression, the omitted value is
4000 always 1.  Often programmers expect it to be a value computed
4001 inside the conditional expression instead.
4002
4003 This warning is enabled by @option{-Wall}.
4004
4005 @item -Wsequence-point
4006 @opindex Wsequence-point
4007 @opindex Wno-sequence-point
4008 Warn about code that may have undefined semantics because of violations
4009 of sequence point rules in the C and C++ standards.
4010
4011 The C and C++ standards define the order in which expressions in a C/C++
4012 program are evaluated in terms of @dfn{sequence points}, which represent
4013 a partial ordering between the execution of parts of the program: those
4014 executed before the sequence point, and those executed after it.  These
4015 occur after the evaluation of a full expression (one which is not part
4016 of a larger expression), after the evaluation of the first operand of a
4017 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
4018 function is called (but after the evaluation of its arguments and the
4019 expression denoting the called function), and in certain other places.
4020 Other than as expressed by the sequence point rules, the order of
4021 evaluation of subexpressions of an expression is not specified.  All
4022 these rules describe only a partial order rather than a total order,
4023 since, for example, if two functions are called within one expression
4024 with no sequence point between them, the order in which the functions
4025 are called is not specified.  However, the standards committee have
4026 ruled that function calls do not overlap.
4027
4028 It is not specified when between sequence points modifications to the
4029 values of objects take effect.  Programs whose behavior depends on this
4030 have undefined behavior; the C and C++ standards specify that ``Between
4031 the previous and next sequence point an object shall have its stored
4032 value modified at most once by the evaluation of an expression.
4033 Furthermore, the prior value shall be read only to determine the value
4034 to be stored.''.  If a program breaks these rules, the results on any
4035 particular implementation are entirely unpredictable.
4036
4037 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
4038 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
4039 diagnosed by this option, and it may give an occasional false positive
4040 result, but in general it has been found fairly effective at detecting
4041 this sort of problem in programs.
4042
4043 The standard is worded confusingly, therefore there is some debate
4044 over the precise meaning of the sequence point rules in subtle cases.
4045 Links to discussions of the problem, including proposed formal
4046 definitions, may be found on the GCC readings page, at
4047 @uref{http://gcc.gnu.org/@/readings.html}.
4048
4049 This warning is enabled by @option{-Wall} for C and C++.
4050
4051 @item -Wno-return-local-addr
4052 @opindex Wno-return-local-addr
4053 @opindex Wreturn-local-addr
4054 Do not warn about returning a pointer (or in C++, a reference) to a
4055 variable that goes out of scope after the function returns.
4056
4057 @item -Wreturn-type
4058 @opindex Wreturn-type
4059 @opindex Wno-return-type
4060 Warn whenever a function is defined with a return type that defaults
4061 to @code{int}.  Also warn about any @code{return} statement with no
4062 return value in a function whose return type is not @code{void}
4063 (falling off the end of the function body is considered returning
4064 without a value), and about a @code{return} statement with an
4065 expression in a function whose return type is @code{void}.
4066
4067 For C++, a function without return type always produces a diagnostic
4068 message, even when @option{-Wno-return-type} is specified.  The only
4069 exceptions are @code{main} and functions defined in system headers.
4070
4071 This warning is enabled by @option{-Wall}.
4072
4073 @item -Wshift-count-negative
4074 @opindex Wshift-count-negative
4075 @opindex Wno-shift-count-negative
4076 Warn if shift count is negative. This warning is enabled by default.
4077
4078 @item -Wshift-count-overflow
4079 @opindex Wshift-count-overflow
4080 @opindex Wno-shift-count-overflow
4081 Warn if shift count >= width of type. This warning is enabled by default.
4082
4083 @item -Wshift-negative-value
4084 @opindex Wshift-negative-value
4085 @opindex Wno-shift-negative-value
4086 Warn if left shifting a negative value.  This warning is enabled by
4087 @option{-Wextra} in C99 and C++11 modes (and newer).
4088
4089 @item -Wshift-overflow
4090 @itemx -Wshift-overflow=@var{n}
4091 @opindex Wshift-overflow
4092 @opindex Wno-shift-overflow
4093 Warn about left shift overflows.  This warning is enabled by
4094 default in C99 and C++11 modes (and newer).
4095
4096 @table @gcctabopt
4097 @item -Wshift-overflow=1
4098 This is the warning level of @option{-Wshift-overflow} and is enabled
4099 by default in C99 and C++11 modes (and newer).  This warning level does
4100 not warn about left-shifting 1 into the sign bit.  (However, in C, such
4101 an overflow is still rejected in contexts where an integer constant expression
4102 is required.)
4103
4104 @item -Wshift-overflow=2
4105 This warning level also warns about left-shifting 1 into the sign bit,
4106 unless C++14 mode is active.
4107 @end table
4108
4109 @item -Wswitch
4110 @opindex Wswitch
4111 @opindex Wno-switch
4112 Warn whenever a @code{switch} statement has an index of enumerated type
4113 and lacks a @code{case} for one or more of the named codes of that
4114 enumeration.  (The presence of a @code{default} label prevents this
4115 warning.)  @code{case} labels outside the enumeration range also
4116 provoke warnings when this option is used (even if there is a
4117 @code{default} label).
4118 This warning is enabled by @option{-Wall}.
4119
4120 @item -Wswitch-default
4121 @opindex Wswitch-default
4122 @opindex Wno-switch-default
4123 Warn whenever a @code{switch} statement does not have a @code{default}
4124 case.
4125
4126 @item -Wswitch-enum
4127 @opindex Wswitch-enum
4128 @opindex Wno-switch-enum
4129 Warn whenever a @code{switch} statement has an index of enumerated type
4130 and lacks a @code{case} for one or more of the named codes of that
4131 enumeration.  @code{case} labels outside the enumeration range also
4132 provoke warnings when this option is used.  The only difference
4133 between @option{-Wswitch} and this option is that this option gives a
4134 warning about an omitted enumeration code even if there is a
4135 @code{default} label.
4136
4137 @item -Wswitch-bool
4138 @opindex Wswitch-bool
4139 @opindex Wno-switch-bool
4140 Warn whenever a @code{switch} statement has an index of boolean type
4141 and the case values are outside the range of a boolean type.
4142 It is possible to suppress this warning by casting the controlling
4143 expression to a type other than @code{bool}.  For example:
4144 @smallexample
4145 @group
4146 switch ((int) (a == 4))
4147   @{
4148   @dots{}
4149   @}
4150 @end group
4151 @end smallexample
4152 This warning is enabled by default for C and C++ programs.
4153
4154 @item -Wsync-nand @r{(C and C++ only)}
4155 @opindex Wsync-nand
4156 @opindex Wno-sync-nand
4157 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
4158 built-in functions are used.  These functions changed semantics in GCC 4.4.
4159
4160 @item -Wtrigraphs
4161 @opindex Wtrigraphs
4162 @opindex Wno-trigraphs
4163 Warn if any trigraphs are encountered that might change the meaning of
4164 the program (trigraphs within comments are not warned about).
4165 This warning is enabled by @option{-Wall}.
4166
4167 @item -Wunused-but-set-parameter
4168 @opindex Wunused-but-set-parameter
4169 @opindex Wno-unused-but-set-parameter
4170 Warn whenever a function parameter is assigned to, but otherwise unused
4171 (aside from its declaration).
4172
4173 To suppress this warning use the @code{unused} attribute
4174 (@pxref{Variable Attributes}).
4175
4176 This warning is also enabled by @option{-Wunused} together with
4177 @option{-Wextra}.
4178
4179 @item -Wunused-but-set-variable
4180 @opindex Wunused-but-set-variable
4181 @opindex Wno-unused-but-set-variable
4182 Warn whenever a local variable is assigned to, but otherwise unused
4183 (aside from its declaration).
4184 This warning is enabled by @option{-Wall}.
4185
4186 To suppress this warning use the @code{unused} attribute
4187 (@pxref{Variable Attributes}).
4188
4189 This warning is also enabled by @option{-Wunused}, which is enabled
4190 by @option{-Wall}.
4191
4192 @item -Wunused-function
4193 @opindex Wunused-function
4194 @opindex Wno-unused-function
4195 Warn whenever a static function is declared but not defined or a
4196 non-inline static function is unused.
4197 This warning is enabled by @option{-Wall}.
4198
4199 @item -Wunused-label
4200 @opindex Wunused-label
4201 @opindex Wno-unused-label
4202 Warn whenever a label is declared but not used.
4203 This warning is enabled by @option{-Wall}.
4204
4205 To suppress this warning use the @code{unused} attribute
4206 (@pxref{Variable Attributes}).
4207
4208 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
4209 @opindex Wunused-local-typedefs
4210 Warn when a typedef locally defined in a function is not used.
4211 This warning is enabled by @option{-Wall}.
4212
4213 @item -Wunused-parameter
4214 @opindex Wunused-parameter
4215 @opindex Wno-unused-parameter
4216 Warn whenever a function parameter is unused aside from its declaration.
4217
4218 To suppress this warning use the @code{unused} attribute
4219 (@pxref{Variable Attributes}).
4220
4221 @item -Wno-unused-result
4222 @opindex Wunused-result
4223 @opindex Wno-unused-result
4224 Do not warn if a caller of a function marked with attribute
4225 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
4226 its return value. The default is @option{-Wunused-result}.
4227
4228 @item -Wunused-variable
4229 @opindex Wunused-variable
4230 @opindex Wno-unused-variable
4231 Warn whenever a local or static variable is unused aside from its
4232 declaration. This option implies @option{-Wunused-const-variable} for C,
4233 but not for C++. This warning is enabled by @option{-Wall}.
4234
4235 To suppress this warning use the @code{unused} attribute
4236 (@pxref{Variable Attributes}).
4237
4238 @item -Wunused-const-variable
4239 @opindex Wunused-const-variable
4240 @opindex Wno-unused-const-variable
4241 Warn whenever a constant static variable is unused aside from its declaration.
4242 This warning is enabled by @option{-Wunused-variable} for C, but not for C++.
4243 In C++ this is normally not an error since const variables take the place of
4244 @code{#define}s in C++.
4245
4246 To suppress this warning use the @code{unused} attribute
4247 (@pxref{Variable Attributes}).
4248
4249 @item -Wunused-value
4250 @opindex Wunused-value
4251 @opindex Wno-unused-value
4252 Warn whenever a statement computes a result that is explicitly not
4253 used. To suppress this warning cast the unused expression to
4254 @code{void}. This includes an expression-statement or the left-hand
4255 side of a comma expression that contains no side effects. For example,
4256 an expression such as @code{x[i,j]} causes a warning, while
4257 @code{x[(void)i,j]} does not.
4258
4259 This warning is enabled by @option{-Wall}.
4260
4261 @item -Wunused
4262 @opindex Wunused
4263 @opindex Wno-unused
4264 All the above @option{-Wunused} options combined.
4265
4266 In order to get a warning about an unused function parameter, you must
4267 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
4268 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
4269
4270 @item -Wuninitialized
4271 @opindex Wuninitialized
4272 @opindex Wno-uninitialized
4273 Warn if an automatic variable is used without first being initialized
4274 or if a variable may be clobbered by a @code{setjmp} call. In C++,
4275 warn if a non-static reference or non-static @code{const} member
4276 appears in a class without constructors.
4277
4278 If you want to warn about code that uses the uninitialized value of the
4279 variable in its own initializer, use the @option{-Winit-self} option.
4280
4281 These warnings occur for individual uninitialized or clobbered
4282 elements of structure, union or array variables as well as for
4283 variables that are uninitialized or clobbered as a whole.  They do
4284 not occur for variables or elements declared @code{volatile}.  Because
4285 these warnings depend on optimization, the exact variables or elements
4286 for which there are warnings depends on the precise optimization
4287 options and version of GCC used.
4288
4289 Note that there may be no warning about a variable that is used only
4290 to compute a value that itself is never used, because such
4291 computations may be deleted by data flow analysis before the warnings
4292 are printed.
4293
4294 @item -Wmaybe-uninitialized
4295 @opindex Wmaybe-uninitialized
4296 @opindex Wno-maybe-uninitialized
4297 For an automatic variable, if there exists a path from the function
4298 entry to a use of the variable that is initialized, but there exist
4299 some other paths for which the variable is not initialized, the compiler
4300 emits a warning if it cannot prove the uninitialized paths are not
4301 executed at run time. These warnings are made optional because GCC is
4302 not smart enough to see all the reasons why the code might be correct
4303 in spite of appearing to have an error.  Here is one example of how
4304 this can happen:
4305
4306 @smallexample
4307 @group
4308 @{
4309   int x;
4310   switch (y)
4311     @{
4312     case 1: x = 1;
4313       break;
4314     case 2: x = 4;
4315       break;
4316     case 3: x = 5;
4317     @}
4318   foo (x);
4319 @}
4320 @end group
4321 @end smallexample
4322
4323 @noindent
4324 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
4325 always initialized, but GCC doesn't know this. To suppress the
4326 warning, you need to provide a default case with assert(0) or
4327 similar code.
4328
4329 @cindex @code{longjmp} warnings
4330 This option also warns when a non-volatile automatic variable might be
4331 changed by a call to @code{longjmp}.  These warnings as well are possible
4332 only in optimizing compilation.
4333
4334 The compiler sees only the calls to @code{setjmp}.  It cannot know
4335 where @code{longjmp} will be called; in fact, a signal handler could
4336 call it at any point in the code.  As a result, you may get a warning
4337 even when there is in fact no problem because @code{longjmp} cannot
4338 in fact be called at the place that would cause a problem.
4339
4340 Some spurious warnings can be avoided if you declare all the functions
4341 you use that never return as @code{noreturn}.  @xref{Function
4342 Attributes}.
4343
4344 This warning is enabled by @option{-Wall} or @option{-Wextra}.
4345
4346 @item -Wunknown-pragmas
4347 @opindex Wunknown-pragmas
4348 @opindex Wno-unknown-pragmas
4349 @cindex warning for unknown pragmas
4350 @cindex unknown pragmas, warning
4351 @cindex pragmas, warning of unknown
4352 Warn when a @code{#pragma} directive is encountered that is not understood by 
4353 GCC@.  If this command-line option is used, warnings are even issued
4354 for unknown pragmas in system header files.  This is not the case if
4355 the warnings are only enabled by the @option{-Wall} command-line option.
4356
4357 @item -Wno-pragmas
4358 @opindex Wno-pragmas
4359 @opindex Wpragmas
4360 Do not warn about misuses of pragmas, such as incorrect parameters,
4361 invalid syntax, or conflicts between pragmas.  See also
4362 @option{-Wunknown-pragmas}.
4363
4364 @item -Wstrict-aliasing
4365 @opindex Wstrict-aliasing
4366 @opindex Wno-strict-aliasing
4367 This option is only active when @option{-fstrict-aliasing} is active.
4368 It warns about code that might break the strict aliasing rules that the
4369 compiler is using for optimization.  The warning does not catch all
4370 cases, but does attempt to catch the more common pitfalls.  It is
4371 included in @option{-Wall}.
4372 It is equivalent to @option{-Wstrict-aliasing=3}
4373
4374 @item -Wstrict-aliasing=n
4375 @opindex Wstrict-aliasing=n
4376 This option is only active when @option{-fstrict-aliasing} is active.
4377 It warns about code that might break the strict aliasing rules that the
4378 compiler is using for optimization.
4379 Higher levels correspond to higher accuracy (fewer false positives).
4380 Higher levels also correspond to more effort, similar to the way @option{-O} 
4381 works.
4382 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
4383
4384 Level 1: Most aggressive, quick, least accurate.
4385 Possibly useful when higher levels
4386 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
4387 false negatives.  However, it has many false positives.
4388 Warns for all pointer conversions between possibly incompatible types,
4389 even if never dereferenced.  Runs in the front end only.
4390
4391 Level 2: Aggressive, quick, not too precise.
4392 May still have many false positives (not as many as level 1 though),
4393 and few false negatives (but possibly more than level 1).
4394 Unlike level 1, it only warns when an address is taken.  Warns about
4395 incomplete types.  Runs in the front end only.
4396
4397 Level 3 (default for @option{-Wstrict-aliasing}):
4398 Should have very few false positives and few false
4399 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
4400 Takes care of the common pun+dereference pattern in the front end:
4401 @code{*(int*)&some_float}.
4402 If optimization is enabled, it also runs in the back end, where it deals
4403 with multiple statement cases using flow-sensitive points-to information.
4404 Only warns when the converted pointer is dereferenced.
4405 Does not warn about incomplete types.
4406
4407 @item -Wstrict-overflow
4408 @itemx -Wstrict-overflow=@var{n}
4409 @opindex Wstrict-overflow
4410 @opindex Wno-strict-overflow
4411 This option is only active when @option{-fstrict-overflow} is active.
4412 It warns about cases where the compiler optimizes based on the
4413 assumption that signed overflow does not occur.  Note that it does not
4414 warn about all cases where the code might overflow: it only warns
4415 about cases where the compiler implements some optimization.  Thus
4416 this warning depends on the optimization level.
4417
4418 An optimization that assumes that signed overflow does not occur is
4419 perfectly safe if the values of the variables involved are such that
4420 overflow never does, in fact, occur.  Therefore this warning can
4421 easily give a false positive: a warning about code that is not
4422 actually a problem.  To help focus on important issues, several
4423 warning levels are defined.  No warnings are issued for the use of
4424 undefined signed overflow when estimating how many iterations a loop
4425 requires, in particular when determining whether a loop will be
4426 executed at all.
4427
4428 @table @gcctabopt
4429 @item -Wstrict-overflow=1
4430 Warn about cases that are both questionable and easy to avoid.  For
4431 example,  with @option{-fstrict-overflow}, the compiler simplifies
4432 @code{x + 1 > x} to @code{1}.  This level of
4433 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
4434 are not, and must be explicitly requested.
4435
4436 @item -Wstrict-overflow=2
4437 Also warn about other cases where a comparison is simplified to a
4438 constant.  For example: @code{abs (x) >= 0}.  This can only be
4439 simplified when @option{-fstrict-overflow} is in effect, because
4440 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
4441 zero.  @option{-Wstrict-overflow} (with no level) is the same as
4442 @option{-Wstrict-overflow=2}.
4443
4444 @item -Wstrict-overflow=3
4445 Also warn about other cases where a comparison is simplified.  For
4446 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
4447
4448 @item -Wstrict-overflow=4
4449 Also warn about other simplifications not covered by the above cases.
4450 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
4451
4452 @item -Wstrict-overflow=5
4453 Also warn about cases where the compiler reduces the magnitude of a
4454 constant involved in a comparison.  For example: @code{x + 2 > y} is
4455 simplified to @code{x + 1 >= y}.  This is reported only at the
4456 highest warning level because this simplification applies to many
4457 comparisons, so this warning level gives a very large number of
4458 false positives.
4459 @end table
4460
4461 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]}
4462 @opindex Wsuggest-attribute=
4463 @opindex Wno-suggest-attribute=
4464 Warn for cases where adding an attribute may be beneficial. The
4465 attributes currently supported are listed below.
4466
4467 @table @gcctabopt
4468 @item -Wsuggest-attribute=pure
4469 @itemx -Wsuggest-attribute=const
4470 @itemx -Wsuggest-attribute=noreturn
4471 @opindex Wsuggest-attribute=pure
4472 @opindex Wno-suggest-attribute=pure
4473 @opindex Wsuggest-attribute=const
4474 @opindex Wno-suggest-attribute=const
4475 @opindex Wsuggest-attribute=noreturn
4476 @opindex Wno-suggest-attribute=noreturn
4477
4478 Warn about functions that might be candidates for attributes
4479 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
4480 functions visible in other compilation units or (in the case of @code{pure} and
4481 @code{const}) if it cannot prove that the function returns normally. A function
4482 returns normally if it doesn't contain an infinite loop or return abnormally
4483 by throwing, calling @code{abort} or trapping.  This analysis requires option
4484 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
4485 higher.  Higher optimization levels improve the accuracy of the analysis.
4486
4487 @item -Wsuggest-attribute=format
4488 @itemx -Wmissing-format-attribute
4489 @opindex Wsuggest-attribute=format
4490 @opindex Wmissing-format-attribute
4491 @opindex Wno-suggest-attribute=format
4492 @opindex Wno-missing-format-attribute
4493 @opindex Wformat
4494 @opindex Wno-format
4495
4496 Warn about function pointers that might be candidates for @code{format}
4497 attributes.  Note these are only possible candidates, not absolute ones.
4498 GCC guesses that function pointers with @code{format} attributes that
4499 are used in assignment, initialization, parameter passing or return
4500 statements should have a corresponding @code{format} attribute in the
4501 resulting type.  I.e.@: the left-hand side of the assignment or
4502 initialization, the type of the parameter variable, or the return type
4503 of the containing function respectively should also have a @code{format}
4504 attribute to avoid the warning.
4505
4506 GCC also warns about function definitions that might be
4507 candidates for @code{format} attributes.  Again, these are only
4508 possible candidates.  GCC guesses that @code{format} attributes
4509 might be appropriate for any function that calls a function like
4510 @code{vprintf} or @code{vscanf}, but this might not always be the
4511 case, and some functions for which @code{format} attributes are
4512 appropriate may not be detected.
4513 @end table
4514
4515 @item -Wsuggest-final-types
4516 @opindex Wno-suggest-final-types
4517 @opindex Wsuggest-final-types
4518 Warn about types with virtual methods where code quality would be improved
4519 if the type were declared with the C++11 @code{final} specifier, 
4520 or, if possible,
4521 declared in an anonymous namespace. This allows GCC to more aggressively
4522 devirtualize the polymorphic calls. This warning is more effective with link
4523 time optimization, where the information about the class hierarchy graph is
4524 more complete.
4525
4526 @item -Wsuggest-final-methods
4527 @opindex Wno-suggest-final-methods
4528 @opindex Wsuggest-final-methods
4529 Warn about virtual methods where code quality would be improved if the method
4530 were declared with the C++11 @code{final} specifier, 
4531 or, if possible, its type were
4532 declared in an anonymous namespace or with the @code{final} specifier.
4533 This warning is
4534 more effective with link time optimization, where the information about the
4535 class hierarchy graph is more complete. It is recommended to first consider
4536 suggestions of @option{-Wsuggest-final-types} and then rebuild with new
4537 annotations.
4538
4539 @item -Wsuggest-override
4540 Warn about overriding virtual functions that are not marked with the override
4541 keyword.
4542
4543 @item -Warray-bounds
4544 @itemx -Warray-bounds=@var{n}
4545 @opindex Wno-array-bounds
4546 @opindex Warray-bounds
4547 This option is only active when @option{-ftree-vrp} is active
4548 (default for @option{-O2} and above). It warns about subscripts to arrays
4549 that are always out of bounds. This warning is enabled by @option{-Wall}.
4550
4551 @table @gcctabopt
4552 @item -Warray-bounds=1
4553 This is the warning level of @option{-Warray-bounds} and is enabled
4554 by @option{-Wall}; higher levels are not, and must be explicitly requested.
4555
4556 @item -Warray-bounds=2
4557 This warning level also warns about out of bounds access for
4558 arrays at the end of a struct and for arrays accessed through
4559 pointers. This warning level may give a larger number of
4560 false positives and is deactivated by default.
4561 @end table
4562
4563 @item -Wbool-compare
4564 @opindex Wno-bool-compare
4565 @opindex Wbool-compare
4566 Warn about boolean expression compared with an integer value different from
4567 @code{true}/@code{false}.  For instance, the following comparison is
4568 always false:
4569 @smallexample
4570 int n = 5;
4571 @dots{}
4572 if ((n > 1) == 2) @{ @dots{} @}
4573 @end smallexample
4574 This warning is enabled by @option{-Wall}.
4575
4576 @item -Wduplicated-cond
4577 @opindex Wno-duplicated-cond
4578 @opindex Wduplicated-cond
4579 Warn about duplicated conditions in an if-else-if chain.  For instance,
4580 warn for the following code:
4581 @smallexample
4582 if (p->q != NULL) @{ @dots{} @}
4583 else if (p->q != NULL) @{ @dots{} @}
4584 @end smallexample
4585 This warning is enabled by @option{-Wall}.
4586
4587 @item -Wframe-address
4588 @opindex Wno-frame-address
4589 @opindex Wframe-address
4590 Warn when the @samp{__builtin_frame_address} or @samp{__builtin_return_address}
4591 is called with an argument greater than 0.  Such calls may return indeterminate
4592 values or crash the program.  The warning is included in @option{-Wall}.
4593
4594 @item -Wno-discarded-qualifiers @r{(C and Objective-C only)}
4595 @opindex Wno-discarded-qualifiers
4596 @opindex Wdiscarded-qualifiers
4597 Do not warn if type qualifiers on pointers are being discarded.
4598 Typically, the compiler warns if a @code{const char *} variable is
4599 passed to a function that takes a @code{char *} parameter.  This option
4600 can be used to suppress such a warning.
4601
4602 @item -Wno-discarded-array-qualifiers @r{(C and Objective-C only)}
4603 @opindex Wno-discarded-array-qualifiers
4604 @opindex Wdiscarded-array-qualifiers
4605 Do not warn if type qualifiers on arrays which are pointer targets
4606 are being discarded. Typically, the compiler warns if a
4607 @code{const int (*)[]} variable is passed to a function that
4608 takes a @code{int (*)[]} parameter.  This option can be used to
4609 suppress such a warning.
4610
4611 @item -Wno-incompatible-pointer-types @r{(C and Objective-C only)}
4612 @opindex Wno-incompatible-pointer-types
4613 @opindex Wincompatible-pointer-types
4614 Do not warn when there is a conversion between pointers that have incompatible
4615 types.  This warning is for cases not covered by @option{-Wno-pointer-sign},
4616 which warns for pointer argument passing or assignment with different
4617 signedness.
4618
4619 @item -Wno-int-conversion @r{(C and Objective-C only)}
4620 @opindex Wno-int-conversion
4621 @opindex Wint-conversion
4622 Do not warn about incompatible integer to pointer and pointer to integer
4623 conversions.  This warning is about implicit conversions; for explicit
4624 conversions the warnings @option{-Wno-int-to-pointer-cast} and
4625 @option{-Wno-pointer-to-int-cast} may be used.
4626
4627 @item -Wno-div-by-zero
4628 @opindex Wno-div-by-zero
4629 @opindex Wdiv-by-zero
4630 Do not warn about compile-time integer division by zero.  Floating-point
4631 division by zero is not warned about, as it can be a legitimate way of
4632 obtaining infinities and NaNs.
4633
4634 @item -Wsystem-headers
4635 @opindex Wsystem-headers
4636 @opindex Wno-system-headers
4637 @cindex warnings from system headers
4638 @cindex system headers, warnings from
4639 Print warning messages for constructs found in system header files.
4640 Warnings from system headers are normally suppressed, on the assumption
4641 that they usually do not indicate real problems and would only make the
4642 compiler output harder to read.  Using this command-line option tells
4643 GCC to emit warnings from system headers as if they occurred in user
4644 code.  However, note that using @option{-Wall} in conjunction with this
4645 option does @emph{not} warn about unknown pragmas in system
4646 headers---for that, @option{-Wunknown-pragmas} must also be used.
4647
4648 @item -Wtautological-compare
4649 @opindex Wtautological-compare
4650 @opindex Wno-tautological-compare
4651 Warn if a self-comparison always evaluates to true or false.  This
4652 warning detects various mistakes such as:
4653 @smallexample
4654 int i = 1;
4655 @dots{}
4656 if (i > i) @{ @dots{} @}
4657 @end smallexample
4658 This warning is enabled by @option{-Wall}.
4659
4660 @item -Wtrampolines
4661 @opindex Wtrampolines
4662 @opindex Wno-trampolines
4663 Warn about trampolines generated for pointers to nested functions.
4664 A trampoline is a small piece of data or code that is created at run
4665 time on the stack when the address of a nested function is taken, and is
4666 used to call the nested function indirectly.  For some targets, it is
4667 made up of data only and thus requires no special treatment.  But, for
4668 most targets, it is made up of code and thus requires the stack to be
4669 made executable in order for the program to work properly.
4670
4671 @item -Wfloat-equal
4672 @opindex Wfloat-equal
4673 @opindex Wno-float-equal
4674 Warn if floating-point values are used in equality comparisons.
4675
4676 The idea behind this is that sometimes it is convenient (for the
4677 programmer) to consider floating-point values as approximations to
4678 infinitely precise real numbers.  If you are doing this, then you need
4679 to compute (by analyzing the code, or in some other way) the maximum or
4680 likely maximum error that the computation introduces, and allow for it
4681 when performing comparisons (and when producing output, but that's a
4682 different problem).  In particular, instead of testing for equality, you
4683 should check to see whether the two values have ranges that overlap; and
4684 this is done with the relational operators, so equality comparisons are
4685 probably mistaken.
4686
4687 @item -Wtraditional @r{(C and Objective-C only)}
4688 @opindex Wtraditional
4689 @opindex Wno-traditional
4690 Warn about certain constructs that behave differently in traditional and
4691 ISO C@.  Also warn about ISO C constructs that have no traditional C
4692 equivalent, and/or problematic constructs that should be avoided.
4693
4694 @itemize @bullet
4695 @item
4696 Macro parameters that appear within string literals in the macro body.
4697 In traditional C macro replacement takes place within string literals,
4698 but in ISO C it does not.
4699
4700 @item
4701 In traditional C, some preprocessor directives did not exist.
4702 Traditional preprocessors only considered a line to be a directive
4703 if the @samp{#} appeared in column 1 on the line.  Therefore
4704 @option{-Wtraditional} warns about directives that traditional C
4705 understands but ignores because the @samp{#} does not appear as the
4706 first character on the line.  It also suggests you hide directives like
4707 @code{#pragma} not understood by traditional C by indenting them.  Some
4708 traditional implementations do not recognize @code{#elif}, so this option
4709 suggests avoiding it altogether.
4710
4711 @item
4712 A function-like macro that appears without arguments.
4713
4714 @item
4715 The unary plus operator.
4716
4717 @item
4718 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
4719 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
4720 constants.)  Note, these suffixes appear in macros defined in the system
4721 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
4722 Use of these macros in user code might normally lead to spurious
4723 warnings, however GCC's integrated preprocessor has enough context to
4724 avoid warning in these cases.
4725
4726 @item
4727 A function declared external in one block and then used after the end of
4728 the block.
4729
4730 @item
4731 A @code{switch} statement has an operand of type @code{long}.
4732
4733 @item
4734 A non-@code{static} function declaration follows a @code{static} one.
4735 This construct is not accepted by some traditional C compilers.
4736
4737 @item
4738 The ISO type of an integer constant has a different width or
4739 signedness from its traditional type.  This warning is only issued if
4740 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
4741 typically represent bit patterns, are not warned about.
4742
4743 @item
4744 Usage of ISO string concatenation is detected.
4745
4746 @item
4747 Initialization of automatic aggregates.
4748
4749 @item
4750 Identifier conflicts with labels.  Traditional C lacks a separate
4751 namespace for labels.
4752
4753 @item
4754 Initialization of unions.  If the initializer is zero, the warning is
4755 omitted.  This is done under the assumption that the zero initializer in
4756 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
4757 initializer warnings and relies on default initialization to zero in the
4758 traditional C case.
4759
4760 @item
4761 Conversions by prototypes between fixed/floating-point values and vice
4762 versa.  The absence of these prototypes when compiling with traditional
4763 C causes serious problems.  This is a subset of the possible
4764 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
4765
4766 @item
4767 Use of ISO C style function definitions.  This warning intentionally is
4768 @emph{not} issued for prototype declarations or variadic functions
4769 because these ISO C features appear in your code when using
4770 libiberty's traditional C compatibility macros, @code{PARAMS} and
4771 @code{VPARAMS}.  This warning is also bypassed for nested functions
4772 because that feature is already a GCC extension and thus not relevant to
4773 traditional C compatibility.
4774 @end itemize
4775
4776 @item -Wtraditional-conversion @r{(C and Objective-C only)}
4777 @opindex Wtraditional-conversion
4778 @opindex Wno-traditional-conversion
4779 Warn if a prototype causes a type conversion that is different from what
4780 would happen to the same argument in the absence of a prototype.  This
4781 includes conversions of fixed point to floating and vice versa, and
4782 conversions changing the width or signedness of a fixed-point argument
4783 except when the same as the default promotion.
4784
4785 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
4786 @opindex Wdeclaration-after-statement
4787 @opindex Wno-declaration-after-statement
4788 Warn when a declaration is found after a statement in a block.  This
4789 construct, known from C++, was introduced with ISO C99 and is by default
4790 allowed in GCC@.  It is not supported by ISO C90.  @xref{Mixed Declarations}.
4791
4792 @item -Wundef
4793 @opindex Wundef
4794 @opindex Wno-undef
4795 Warn if an undefined identifier is evaluated in an @code{#if} directive.
4796
4797 @item -Wno-endif-labels
4798 @opindex Wno-endif-labels
4799 @opindex Wendif-labels
4800 Do not warn whenever an @code{#else} or an @code{#endif} are followed by text.
4801
4802 @item -Wshadow
4803 @opindex Wshadow
4804 @opindex Wno-shadow
4805 Warn whenever a local variable or type declaration shadows another
4806 variable, parameter, type, class member (in C++), or instance variable
4807 (in Objective-C) or whenever a built-in function is shadowed. Note
4808 that in C++, the compiler warns if a local variable shadows an
4809 explicit typedef, but not if it shadows a struct/class/enum.
4810
4811 @item -Wno-shadow-ivar @r{(Objective-C only)}
4812 @opindex Wno-shadow-ivar
4813 @opindex Wshadow-ivar
4814 Do not warn whenever a local variable shadows an instance variable in an
4815 Objective-C method.
4816
4817 @item -Wlarger-than=@var{len}
4818 @opindex Wlarger-than=@var{len}
4819 @opindex Wlarger-than-@var{len}
4820 Warn whenever an object of larger than @var{len} bytes is defined.
4821
4822 @item -Wframe-larger-than=@var{len}
4823 @opindex Wframe-larger-than
4824 Warn if the size of a function frame is larger than @var{len} bytes.
4825 The computation done to determine the stack frame size is approximate
4826 and not conservative.
4827 The actual requirements may be somewhat greater than @var{len}
4828 even if you do not get a warning.  In addition, any space allocated
4829 via @code{alloca}, variable-length arrays, or related constructs
4830 is not included by the compiler when determining
4831 whether or not to issue a warning.
4832
4833 @item -Wno-free-nonheap-object
4834 @opindex Wno-free-nonheap-object
4835 @opindex Wfree-nonheap-object
4836 Do not warn when attempting to free an object that was not allocated
4837 on the heap.
4838
4839 @item -Wstack-usage=@var{len}
4840 @opindex Wstack-usage
4841 Warn if the stack usage of a function might be larger than @var{len} bytes.
4842 The computation done to determine the stack usage is conservative.
4843 Any space allocated via @code{alloca}, variable-length arrays, or related
4844 constructs is included by the compiler when determining whether or not to
4845 issue a warning.
4846
4847 The message is in keeping with the output of @option{-fstack-usage}.
4848
4849 @itemize
4850 @item
4851 If the stack usage is fully static but exceeds the specified amount, it's:
4852
4853 @smallexample
4854   warning: stack usage is 1120 bytes
4855 @end smallexample
4856 @item
4857 If the stack usage is (partly) dynamic but bounded, it's:
4858
4859 @smallexample
4860   warning: stack usage might be 1648 bytes
4861 @end smallexample
4862 @item
4863 If the stack usage is (partly) dynamic and not bounded, it's:
4864
4865 @smallexample
4866   warning: stack usage might be unbounded
4867 @end smallexample
4868 @end itemize
4869
4870 @item -Wunsafe-loop-optimizations
4871 @opindex Wunsafe-loop-optimizations
4872 @opindex Wno-unsafe-loop-optimizations
4873 Warn if the loop cannot be optimized because the compiler cannot
4874 assume anything on the bounds of the loop indices.  With
4875 @option{-funsafe-loop-optimizations} warn if the compiler makes
4876 such assumptions.
4877
4878 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
4879 @opindex Wno-pedantic-ms-format
4880 @opindex Wpedantic-ms-format
4881 When used in combination with @option{-Wformat}
4882 and @option{-pedantic} without GNU extensions, this option
4883 disables the warnings about non-ISO @code{printf} / @code{scanf} format
4884 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
4885 which depend on the MS runtime.
4886
4887 @item -Wplacement-new
4888 @opindex Wplacement-new
4889 @opindex Wno-placement-new
4890 Warn about placement new expressions with undefined behavior, such as
4891 constructing an object in a buffer that is smaller than the type of
4892 the object.
4893
4894 @item -Wpointer-arith
4895 @opindex Wpointer-arith
4896 @opindex Wno-pointer-arith
4897 Warn about anything that depends on the ``size of'' a function type or
4898 of @code{void}.  GNU C assigns these types a size of 1, for
4899 convenience in calculations with @code{void *} pointers and pointers
4900 to functions.  In C++, warn also when an arithmetic operation involves
4901 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
4902
4903 @item -Wtype-limits
4904 @opindex Wtype-limits
4905 @opindex Wno-type-limits
4906 Warn if a comparison is always true or always false due to the limited
4907 range of the data type, but do not warn for constant expressions.  For
4908 example, warn if an unsigned variable is compared against zero with
4909 @code{<} or @code{>=}.  This warning is also enabled by
4910 @option{-Wextra}.
4911
4912 @item -Wbad-function-cast @r{(C and Objective-C only)}
4913 @opindex Wbad-function-cast
4914 @opindex Wno-bad-function-cast
4915 Warn when a function call is cast to a non-matching type.
4916 For example, warn if a call to a function returning an integer type 
4917 is cast to a pointer type.
4918
4919 @item -Wc90-c99-compat @r{(C and Objective-C only)}
4920 @opindex Wc90-c99-compat
4921 @opindex Wno-c90-c99-compat
4922 Warn about features not present in ISO C90, but present in ISO C99.
4923 For instance, warn about use of variable length arrays, @code{long long}
4924 type, @code{bool} type, compound literals, designated initializers, and so
4925 on.  This option is independent of the standards mode.  Warnings are disabled
4926 in the expression that follows @code{__extension__}.
4927
4928 @item -Wc99-c11-compat @r{(C and Objective-C only)}
4929 @opindex Wc99-c11-compat
4930 @opindex Wno-c99-c11-compat
4931 Warn about features not present in ISO C99, but present in ISO C11.
4932 For instance, warn about use of anonymous structures and unions,
4933 @code{_Atomic} type qualifier, @code{_Thread_local} storage-class specifier,
4934 @code{_Alignas} specifier, @code{Alignof} operator, @code{_Generic} keyword,
4935 and so on.  This option is independent of the standards mode.  Warnings are
4936 disabled in the expression that follows @code{__extension__}.
4937
4938 @item -Wc++-compat @r{(C and Objective-C only)}
4939 @opindex Wc++-compat
4940 Warn about ISO C constructs that are outside of the common subset of
4941 ISO C and ISO C++, e.g.@: request for implicit conversion from
4942 @code{void *} to a pointer to non-@code{void} type.
4943
4944 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
4945 @opindex Wc++11-compat
4946 Warn about C++ constructs whose meaning differs between ISO C++ 1998
4947 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
4948 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
4949 enabled by @option{-Wall}.
4950
4951 @item -Wc++14-compat @r{(C++ and Objective-C++ only)}
4952 @opindex Wc++14-compat
4953 Warn about C++ constructs whose meaning differs between ISO C++ 2011
4954 and ISO C++ 2014.  This warning is enabled by @option{-Wall}.
4955
4956 @item -Wcast-qual
4957 @opindex Wcast-qual
4958 @opindex Wno-cast-qual
4959 Warn whenever a pointer is cast so as to remove a type qualifier from
4960 the target type.  For example, warn if a @code{const char *} is cast
4961 to an ordinary @code{char *}.
4962
4963 Also warn when making a cast that introduces a type qualifier in an
4964 unsafe way.  For example, casting @code{char **} to @code{const char **}
4965 is unsafe, as in this example:
4966
4967 @smallexample
4968   /* p is char ** value.  */
4969   const char **q = (const char **) p;
4970   /* Assignment of readonly string to const char * is OK.  */
4971   *q = "string";
4972   /* Now char** pointer points to read-only memory.  */
4973   **p = 'b';
4974 @end smallexample
4975
4976 @item -Wcast-align
4977 @opindex Wcast-align
4978 @opindex Wno-cast-align
4979 Warn whenever a pointer is cast such that the required alignment of the
4980 target is increased.  For example, warn if a @code{char *} is cast to
4981 an @code{int *} on machines where integers can only be accessed at
4982 two- or four-byte boundaries.
4983
4984 @item -Wwrite-strings
4985 @opindex Wwrite-strings
4986 @opindex Wno-write-strings
4987 When compiling C, give string constants the type @code{const
4988 char[@var{length}]} so that copying the address of one into a
4989 non-@code{const} @code{char *} pointer produces a warning.  These
4990 warnings help you find at compile time code that can try to write
4991 into a string constant, but only if you have been very careful about
4992 using @code{const} in declarations and prototypes.  Otherwise, it is
4993 just a nuisance. This is why we did not make @option{-Wall} request
4994 these warnings.
4995
4996 When compiling C++, warn about the deprecated conversion from string
4997 literals to @code{char *}.  This warning is enabled by default for C++
4998 programs.
4999
5000 @item -Wclobbered
5001 @opindex Wclobbered
5002 @opindex Wno-clobbered
5003 Warn for variables that might be changed by @code{longjmp} or
5004 @code{vfork}.  This warning is also enabled by @option{-Wextra}.
5005
5006 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
5007 @opindex Wconditionally-supported
5008 @opindex Wno-conditionally-supported
5009 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
5010
5011 @item -Wconversion
5012 @opindex Wconversion
5013 @opindex Wno-conversion
5014 Warn for implicit conversions that may alter a value. This includes
5015 conversions between real and integer, like @code{abs (x)} when
5016 @code{x} is @code{double}; conversions between signed and unsigned,
5017 like @code{unsigned ui = -1}; and conversions to smaller types, like
5018 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
5019 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
5020 changed by the conversion like in @code{abs (2.0)}.  Warnings about
5021 conversions between signed and unsigned integers can be disabled by
5022 using @option{-Wno-sign-conversion}.
5023
5024 For C++, also warn for confusing overload resolution for user-defined
5025 conversions; and conversions that never use a type conversion
5026 operator: conversions to @code{void}, the same type, a base class or a
5027 reference to them. Warnings about conversions between signed and
5028 unsigned integers are disabled by default in C++ unless
5029 @option{-Wsign-conversion} is explicitly enabled.
5030
5031 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
5032 @opindex Wconversion-null
5033 @opindex Wno-conversion-null
5034 Do not warn for conversions between @code{NULL} and non-pointer
5035 types. @option{-Wconversion-null} is enabled by default.
5036
5037 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
5038 @opindex Wzero-as-null-pointer-constant
5039 @opindex Wno-zero-as-null-pointer-constant
5040 Warn when a literal '0' is used as null pointer constant.  This can
5041 be useful to facilitate the conversion to @code{nullptr} in C++11.
5042
5043 @item -Wsubobject-linkage @r{(C++ and Objective-C++ only)}
5044 @opindex Wsubobject-linkage
5045 @opindex Wno-subobject-linkage
5046 Warn if a class type has a base or a field whose type uses the anonymous
5047 namespace or depends on a type with no linkage.  If a type A depends on
5048 a type B with no or internal linkage, defining it in multiple
5049 translation units would be an ODR violation because the meaning of B
5050 is different in each translation unit.  If A only appears in a single
5051 translation unit, the best way to silence the warning is to give it
5052 internal linkage by putting it in an anonymous namespace as well.  The
5053 compiler doesn't give this warning for types defined in the main .C
5054 file, as those are unlikely to have multiple definitions.
5055 @option{-Wsubobject-linkage} is enabled by default.
5056
5057 @item -Wdate-time
5058 @opindex Wdate-time
5059 @opindex Wno-date-time
5060 Warn when macros @code{__TIME__}, @code{__DATE__} or @code{__TIMESTAMP__}
5061 are encountered as they might prevent bit-wise-identical reproducible
5062 compilations.
5063
5064 @item -Wdelete-incomplete @r{(C++ and Objective-C++ only)}
5065 @opindex Wdelete-incomplete
5066 @opindex Wno-delete-incomplete
5067 Warn when deleting a pointer to incomplete type, which may cause
5068 undefined behavior at runtime.  This warning is enabled by default.
5069
5070 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
5071 @opindex Wuseless-cast
5072 @opindex Wno-useless-cast
5073 Warn when an expression is casted to its own type.
5074
5075 @item -Wempty-body
5076 @opindex Wempty-body
5077 @opindex Wno-empty-body
5078 Warn if an empty body occurs in an @code{if}, @code{else} or @code{do
5079 while} statement.  This warning is also enabled by @option{-Wextra}.
5080
5081 @item -Wenum-compare
5082 @opindex Wenum-compare
5083 @opindex Wno-enum-compare
5084 Warn about a comparison between values of different enumerated types.
5085 In C++ enumeral mismatches in conditional expressions are also
5086 diagnosed and the warning is enabled by default.  In C this warning is 
5087 enabled by @option{-Wall}.
5088
5089 @item -Wjump-misses-init @r{(C, Objective-C only)}
5090 @opindex Wjump-misses-init
5091 @opindex Wno-jump-misses-init
5092 Warn if a @code{goto} statement or a @code{switch} statement jumps
5093 forward across the initialization of a variable, or jumps backward to a
5094 label after the variable has been initialized.  This only warns about
5095 variables that are initialized when they are declared.  This warning is
5096 only supported for C and Objective-C; in C++ this sort of branch is an
5097 error in any case.
5098
5099 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
5100 can be disabled with the @option{-Wno-jump-misses-init} option.
5101
5102 @item -Wsign-compare
5103 @opindex Wsign-compare
5104 @opindex Wno-sign-compare
5105 @cindex warning for comparison of signed and unsigned values
5106 @cindex comparison of signed and unsigned values, warning
5107 @cindex signed and unsigned values, comparison warning
5108 Warn when a comparison between signed and unsigned values could produce
5109 an incorrect result when the signed value is converted to unsigned.
5110 This warning is also enabled by @option{-Wextra}; to get the other warnings
5111 of @option{-Wextra} without this warning, use @option{-Wextra -Wno-sign-compare}.
5112
5113 @item -Wsign-conversion
5114 @opindex Wsign-conversion
5115 @opindex Wno-sign-conversion
5116 Warn for implicit conversions that may change the sign of an integer
5117 value, like assigning a signed integer expression to an unsigned
5118 integer variable. An explicit cast silences the warning. In C, this
5119 option is enabled also by @option{-Wconversion}.
5120
5121 @item -Wfloat-conversion
5122 @opindex Wfloat-conversion
5123 @opindex Wno-float-conversion
5124 Warn for implicit conversions that reduce the precision of a real value.
5125 This includes conversions from real to integer, and from higher precision
5126 real to lower precision real values.  This option is also enabled by
5127 @option{-Wconversion}.
5128
5129 @item -Wno-scalar-storage-order
5130 @opindex -Wno-scalar-storage-order
5131 @opindex -Wscalar-storage-order
5132 Do not warn on suspicious constructs involving reverse scalar storage order.
5133
5134 @item -Wsized-deallocation @r{(C++ and Objective-C++ only)}
5135 @opindex Wsized-deallocation
5136 @opindex Wno-sized-deallocation
5137 Warn about a definition of an unsized deallocation function
5138 @smallexample
5139 void operator delete (void *) noexcept;
5140 void operator delete[] (void *) noexcept;
5141 @end smallexample
5142 without a definition of the corresponding sized deallocation function
5143 @smallexample
5144 void operator delete (void *, std::size_t) noexcept;
5145 void operator delete[] (void *, std::size_t) noexcept;
5146 @end smallexample
5147 or vice versa.  Enabled by @option{-Wextra} along with
5148 @option{-fsized-deallocation}.
5149
5150 @item -Wsizeof-pointer-memaccess
5151 @opindex Wsizeof-pointer-memaccess
5152 @opindex Wno-sizeof-pointer-memaccess
5153 Warn for suspicious length parameters to certain string and memory built-in
5154 functions if the argument uses @code{sizeof}.  This warning warns e.g.@:
5155 about @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not an array,
5156 but a pointer, and suggests a possible fix, or about
5157 @code{memcpy (&foo, ptr, sizeof (&foo));}.  This warning is enabled by
5158 @option{-Wall}.
5159
5160 @item -Wsizeof-array-argument
5161 @opindex Wsizeof-array-argument
5162 @opindex Wno-sizeof-array-argument
5163 Warn when the @code{sizeof} operator is applied to a parameter that is
5164 declared as an array in a function definition.  This warning is enabled by
5165 default for C and C++ programs.
5166
5167 @item -Wmemset-transposed-args
5168 @opindex Wmemset-transposed-args
5169 @opindex Wno-memset-transposed-args
5170 Warn for suspicious calls to the @code{memset} built-in function, if the
5171 second argument is not zero and the third argument is zero.  This warns e.g.@
5172 about @code{memset (buf, sizeof buf, 0)} where most probably
5173 @code{memset (buf, 0, sizeof buf)} was meant instead.  The diagnostics
5174 is only emitted if the third argument is literal zero.  If it is some
5175 expression that is folded to zero, a cast of zero to some type, etc., 
5176 it is far less likely that the user has mistakenly exchanged the arguments 
5177 and no warning is emitted.  This warning is enabled by @option{-Wall}.
5178
5179 @item -Waddress
5180 @opindex Waddress
5181 @opindex Wno-address
5182 Warn about suspicious uses of memory addresses. These include using
5183 the address of a function in a conditional expression, such as
5184 @code{void func(void); if (func)}, and comparisons against the memory
5185 address of a string literal, such as @code{if (x == "abc")}.  Such
5186 uses typically indicate a programmer error: the address of a function
5187 always evaluates to true, so their use in a conditional usually
5188 indicate that the programmer forgot the parentheses in a function
5189 call; and comparisons against string literals result in unspecified
5190 behavior and are not portable in C, so they usually indicate that the
5191 programmer intended to use @code{strcmp}.  This warning is enabled by
5192 @option{-Wall}.
5193
5194 @item -Wlogical-op
5195 @opindex Wlogical-op
5196 @opindex Wno-logical-op
5197 Warn about suspicious uses of logical operators in expressions.
5198 This includes using logical operators in contexts where a
5199 bit-wise operator is likely to be expected.  Also warns when
5200 the operands of a logical operator are the same:
5201 @smallexample
5202 extern int a;
5203 if (a < 0 && a < 0) @{ @dots{} @}
5204 @end smallexample
5205
5206 @item -Wlogical-not-parentheses
5207 @opindex Wlogical-not-parentheses
5208 @opindex Wno-logical-not-parentheses
5209 Warn about logical not used on the left hand side operand of a comparison.
5210 This option does not warn if the RHS operand is of a boolean type.  Its
5211 purpose is to detect suspicious code like the following:
5212 @smallexample
5213 int a;
5214 @dots{}
5215 if (!a > 1) @{ @dots{} @}
5216 @end smallexample
5217
5218 It is possible to suppress the warning by wrapping the LHS into
5219 parentheses:
5220 @smallexample
5221 if ((!a) > 1) @{ @dots{} @}
5222 @end smallexample
5223
5224 This warning is enabled by @option{-Wall}.
5225
5226 @item -Waggregate-return
5227 @opindex Waggregate-return
5228 @opindex Wno-aggregate-return
5229 Warn if any functions that return structures or unions are defined or
5230 called.  (In languages where you can return an array, this also elicits
5231 a warning.)
5232
5233 @item -Wno-aggressive-loop-optimizations
5234 @opindex Wno-aggressive-loop-optimizations
5235 @opindex Waggressive-loop-optimizations
5236 Warn if in a loop with constant number of iterations the compiler detects
5237 undefined behavior in some statement during one or more of the iterations.
5238
5239 @item -Wno-attributes
5240 @opindex Wno-attributes
5241 @opindex Wattributes
5242 Do not warn if an unexpected @code{__attribute__} is used, such as
5243 unrecognized attributes, function attributes applied to variables,
5244 etc.  This does not stop errors for incorrect use of supported
5245 attributes.
5246
5247 @item -Wno-builtin-macro-redefined
5248 @opindex Wno-builtin-macro-redefined
5249 @opindex Wbuiltin-macro-redefined
5250 Do not warn if certain built-in macros are redefined.  This suppresses
5251 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
5252 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
5253
5254 @item -Wstrict-prototypes @r{(C and Objective-C only)}
5255 @opindex Wstrict-prototypes
5256 @opindex Wno-strict-prototypes
5257 Warn if a function is declared or defined without specifying the
5258 argument types.  (An old-style function definition is permitted without
5259 a warning if preceded by a declaration that specifies the argument
5260 types.)
5261
5262 @item -Wold-style-declaration @r{(C and Objective-C only)}
5263 @opindex Wold-style-declaration
5264 @opindex Wno-old-style-declaration
5265 Warn for obsolescent usages, according to the C Standard, in a
5266 declaration. For example, warn if storage-class specifiers like
5267 @code{static} are not the first things in a declaration.  This warning
5268 is also enabled by @option{-Wextra}.
5269
5270 @item -Wold-style-definition @r{(C and Objective-C only)}
5271 @opindex Wold-style-definition
5272 @opindex Wno-old-style-definition
5273 Warn if an old-style function definition is used.  A warning is given
5274 even if there is a previous prototype.
5275
5276 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
5277 @opindex Wmissing-parameter-type
5278 @opindex Wno-missing-parameter-type
5279 A function parameter is declared without a type specifier in K&R-style
5280 functions:
5281
5282 @smallexample
5283 void foo(bar) @{ @}
5284 @end smallexample
5285
5286 This warning is also enabled by @option{-Wextra}.
5287
5288 @item -Wmissing-prototypes @r{(C and Objective-C only)}
5289 @opindex Wmissing-prototypes
5290 @opindex Wno-missing-prototypes
5291 Warn if a global function is defined without a previous prototype
5292 declaration.  This warning is issued even if the definition itself
5293 provides a prototype.  Use this option to detect global functions
5294 that do not have a matching prototype declaration in a header file.
5295 This option is not valid for C++ because all function declarations
5296 provide prototypes and a non-matching declaration declares an
5297 overload rather than conflict with an earlier declaration.
5298 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
5299
5300 @item -Wmissing-declarations
5301 @opindex Wmissing-declarations
5302 @opindex Wno-missing-declarations
5303 Warn if a global function is defined without a previous declaration.
5304 Do so even if the definition itself provides a prototype.
5305 Use this option to detect global functions that are not declared in
5306 header files.  In C, no warnings are issued for functions with previous
5307 non-prototype declarations; use @option{-Wmissing-prototypes} to detect
5308 missing prototypes.  In C++, no warnings are issued for function templates,
5309 or for inline functions, or for functions in anonymous namespaces.
5310
5311 @item -Wmissing-field-initializers
5312 @opindex Wmissing-field-initializers
5313 @opindex Wno-missing-field-initializers
5314 @opindex W
5315 @opindex Wextra
5316 @opindex Wno-extra
5317 Warn if a structure's initializer has some fields missing.  For
5318 example, the following code causes such a warning, because
5319 @code{x.h} is implicitly zero:
5320
5321 @smallexample
5322 struct s @{ int f, g, h; @};
5323 struct s x = @{ 3, 4 @};
5324 @end smallexample
5325
5326 This option does not warn about designated initializers, so the following
5327 modification does not trigger a warning:
5328
5329 @smallexample
5330 struct s @{ int f, g, h; @};
5331 struct s x = @{ .f = 3, .g = 4 @};
5332 @end smallexample
5333
5334 In C++ this option does not warn either about the empty @{ @}
5335 initializer, for example:
5336
5337 @smallexample
5338 struct s @{ int f, g, h; @};
5339 s x = @{ @};
5340 @end smallexample
5341
5342 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
5343 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
5344
5345 @item -Wno-multichar
5346 @opindex Wno-multichar
5347 @opindex Wmultichar
5348 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
5349 Usually they indicate a typo in the user's code, as they have
5350 implementation-defined values, and should not be used in portable code.
5351
5352 @item -Wnormalized@r{[}=@r{<}none@r{|}id@r{|}nfc@r{|}nfkc@r{>]}
5353 @opindex Wnormalized=
5354 @opindex Wnormalized
5355 @opindex Wno-normalized
5356 @cindex NFC
5357 @cindex NFKC
5358 @cindex character set, input normalization
5359 In ISO C and ISO C++, two identifiers are different if they are
5360 different sequences of characters.  However, sometimes when characters
5361 outside the basic ASCII character set are used, you can have two
5362 different character sequences that look the same.  To avoid confusion,
5363 the ISO 10646 standard sets out some @dfn{normalization rules} which
5364 when applied ensure that two sequences that look the same are turned into
5365 the same sequence.  GCC can warn you if you are using identifiers that
5366 have not been normalized; this option controls that warning.
5367
5368 There are four levels of warning supported by GCC@.  The default is
5369 @option{-Wnormalized=nfc}, which warns about any identifier that is
5370 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
5371 recommended form for most uses.  It is equivalent to
5372 @option{-Wnormalized}.
5373
5374 Unfortunately, there are some characters allowed in identifiers by
5375 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
5376 identifiers.  That is, there's no way to use these symbols in portable
5377 ISO C or C++ and have all your identifiers in NFC@.
5378 @option{-Wnormalized=id} suppresses the warning for these characters.
5379 It is hoped that future versions of the standards involved will correct
5380 this, which is why this option is not the default.
5381
5382 You can switch the warning off for all characters by writing
5383 @option{-Wnormalized=none} or @option{-Wno-normalized}.  You should
5384 only do this if you are using some other normalization scheme (like
5385 ``D''), because otherwise you can easily create bugs that are
5386 literally impossible to see.
5387
5388 Some characters in ISO 10646 have distinct meanings but look identical
5389 in some fonts or display methodologies, especially once formatting has
5390 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
5391 LETTER N'', displays just like a regular @code{n} that has been
5392 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
5393 normalization scheme to convert all these into a standard form as
5394 well, and GCC warns if your code is not in NFKC if you use
5395 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
5396 about every identifier that contains the letter O because it might be
5397 confused with the digit 0, and so is not the default, but may be
5398 useful as a local coding convention if the programming environment 
5399 cannot be fixed to display these characters distinctly.
5400
5401 @item -Wno-deprecated
5402 @opindex Wno-deprecated
5403 @opindex Wdeprecated
5404 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
5405
5406 @item -Wno-deprecated-declarations
5407 @opindex Wno-deprecated-declarations
5408 @opindex Wdeprecated-declarations
5409 Do not warn about uses of functions (@pxref{Function Attributes}),
5410 variables (@pxref{Variable Attributes}), and types (@pxref{Type
5411 Attributes}) marked as deprecated by using the @code{deprecated}
5412 attribute.
5413
5414 @item -Wno-overflow
5415 @opindex Wno-overflow
5416 @opindex Woverflow
5417 Do not warn about compile-time overflow in constant expressions.
5418
5419 @item -Wno-odr
5420 @opindex Wno-odr
5421 @opindex Wodr
5422 Warn about One Definition Rule violations during link-time optimization.
5423 Requires @option{-flto-odr-type-merging} to be enabled.  Enabled by default.
5424
5425 @item -Wopenmp-simd
5426 @opindex Wopenm-simd
5427 Warn if the vectorizer cost model overrides the OpenMP or the Cilk Plus
5428 simd directive set by user.  The @option{-fsimd-cost-model=unlimited}
5429 option can be used to relax the cost model.
5430
5431 @item -Woverride-init @r{(C and Objective-C only)}
5432 @opindex Woverride-init
5433 @opindex Wno-override-init
5434 @opindex W
5435 @opindex Wextra
5436 @opindex Wno-extra
5437 Warn if an initialized field without side effects is overridden when
5438 using designated initializers (@pxref{Designated Inits, , Designated
5439 Initializers}).
5440
5441 This warning is included in @option{-Wextra}.  To get other
5442 @option{-Wextra} warnings without this one, use @option{-Wextra
5443 -Wno-override-init}.
5444
5445 @item -Woverride-init-side-effects @r{(C and Objective-C only)}
5446 @opindex Woverride-init-side-effects
5447 @opindex Wno-override-init-side-effects
5448 Warn if an initialized field with side effects is overridden when
5449 using designated initializers (@pxref{Designated Inits, , Designated
5450 Initializers}).  This warning is enabled by default.
5451
5452 @item -Wpacked
5453 @opindex Wpacked
5454 @opindex Wno-packed
5455 Warn if a structure is given the packed attribute, but the packed
5456 attribute has no effect on the layout or size of the structure.
5457 Such structures may be mis-aligned for little benefit.  For
5458 instance, in this code, the variable @code{f.x} in @code{struct bar}
5459 is misaligned even though @code{struct bar} does not itself
5460 have the packed attribute:
5461
5462 @smallexample
5463 @group
5464 struct foo @{
5465   int x;
5466   char a, b, c, d;
5467 @} __attribute__((packed));
5468 struct bar @{
5469   char z;
5470   struct foo f;
5471 @};
5472 @end group
5473 @end smallexample
5474
5475 @item -Wpacked-bitfield-compat
5476 @opindex Wpacked-bitfield-compat
5477 @opindex Wno-packed-bitfield-compat
5478 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
5479 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
5480 the change can lead to differences in the structure layout.  GCC
5481 informs you when the offset of such a field has changed in GCC 4.4.
5482 For example there is no longer a 4-bit padding between field @code{a}
5483 and @code{b} in this structure:
5484
5485 @smallexample
5486 struct foo
5487 @{
5488   char a:4;
5489   char b:8;
5490 @} __attribute__ ((packed));
5491 @end smallexample
5492
5493 This warning is enabled by default.  Use
5494 @option{-Wno-packed-bitfield-compat} to disable this warning.
5495
5496 @item -Wpadded
5497 @opindex Wpadded
5498 @opindex Wno-padded
5499 Warn if padding is included in a structure, either to align an element
5500 of the structure or to align the whole structure.  Sometimes when this
5501 happens it is possible to rearrange the fields of the structure to
5502 reduce the padding and so make the structure smaller.
5503
5504 @item -Wredundant-decls
5505 @opindex Wredundant-decls
5506 @opindex Wno-redundant-decls
5507 Warn if anything is declared more than once in the same scope, even in
5508 cases where multiple declaration is valid and changes nothing.
5509
5510 @item -Wnested-externs @r{(C and Objective-C only)}
5511 @opindex Wnested-externs
5512 @opindex Wno-nested-externs
5513 Warn if an @code{extern} declaration is encountered within a function.
5514
5515 @item -Wno-inherited-variadic-ctor
5516 @opindex Winherited-variadic-ctor
5517 @opindex Wno-inherited-variadic-ctor
5518 Suppress warnings about use of C++11 inheriting constructors when the
5519 base class inherited from has a C variadic constructor; the warning is
5520 on by default because the ellipsis is not inherited.
5521
5522 @item -Winline
5523 @opindex Winline
5524 @opindex Wno-inline
5525 Warn if a function that is declared as inline cannot be inlined.
5526 Even with this option, the compiler does not warn about failures to
5527 inline functions declared in system headers.
5528
5529 The compiler uses a variety of heuristics to determine whether or not
5530 to inline a function.  For example, the compiler takes into account
5531 the size of the function being inlined and the amount of inlining
5532 that has already been done in the current function.  Therefore,
5533 seemingly insignificant changes in the source program can cause the
5534 warnings produced by @option{-Winline} to appear or disappear.
5535
5536 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
5537 @opindex Wno-invalid-offsetof
5538 @opindex Winvalid-offsetof
5539 Suppress warnings from applying the @code{offsetof} macro to a non-POD
5540 type.  According to the 2014 ISO C++ standard, applying @code{offsetof}
5541 to a non-standard-layout type is undefined.  In existing C++ implementations,
5542 however, @code{offsetof} typically gives meaningful results.
5543 This flag is for users who are aware that they are
5544 writing nonportable code and who have deliberately chosen to ignore the
5545 warning about it.
5546
5547 The restrictions on @code{offsetof} may be relaxed in a future version
5548 of the C++ standard.
5549
5550 @item -Wno-int-to-pointer-cast
5551 @opindex Wno-int-to-pointer-cast
5552 @opindex Wint-to-pointer-cast
5553 Suppress warnings from casts to pointer type of an integer of a
5554 different size. In C++, casting to a pointer type of smaller size is
5555 an error. @option{Wint-to-pointer-cast} is enabled by default.
5556
5557
5558 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
5559 @opindex Wno-pointer-to-int-cast
5560 @opindex Wpointer-to-int-cast
5561 Suppress warnings from casts from a pointer to an integer type of a
5562 different size.
5563
5564 @item -Winvalid-pch
5565 @opindex Winvalid-pch
5566 @opindex Wno-invalid-pch
5567 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
5568 the search path but can't be used.
5569
5570 @item -Wlong-long
5571 @opindex Wlong-long
5572 @opindex Wno-long-long
5573 Warn if @code{long long} type is used.  This is enabled by either
5574 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
5575 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
5576
5577 @item -Wvariadic-macros
5578 @opindex Wvariadic-macros
5579 @opindex Wno-variadic-macros
5580 Warn if variadic macros are used in ISO C90 mode, or if the GNU
5581 alternate syntax is used in ISO C99 mode.  This is enabled by either
5582 @option{-Wpedantic} or @option{-Wtraditional}.  To inhibit the warning
5583 messages, use @option{-Wno-variadic-macros}.
5584
5585 @item -Wvarargs
5586 @opindex Wvarargs
5587 @opindex Wno-varargs
5588 Warn upon questionable usage of the macros used to handle variable
5589 arguments like @code{va_start}.  This is default.  To inhibit the
5590 warning messages, use @option{-Wno-varargs}.
5591
5592 @item -Wvector-operation-performance
5593 @opindex Wvector-operation-performance
5594 @opindex Wno-vector-operation-performance
5595 Warn if vector operation is not implemented via SIMD capabilities of the
5596 architecture.  Mainly useful for the performance tuning.
5597 Vector operation can be implemented @code{piecewise}, which means that the
5598 scalar operation is performed on every vector element; 
5599 @code{in parallel}, which means that the vector operation is implemented
5600 using scalars of wider type, which normally is more performance efficient;
5601 and @code{as a single scalar}, which means that vector fits into a
5602 scalar type.
5603
5604 @item -Wno-virtual-move-assign
5605 @opindex Wvirtual-move-assign
5606 @opindex Wno-virtual-move-assign
5607 Suppress warnings about inheriting from a virtual base with a
5608 non-trivial C++11 move assignment operator.  This is dangerous because
5609 if the virtual base is reachable along more than one path, it is
5610 moved multiple times, which can mean both objects end up in the
5611 moved-from state.  If the move assignment operator is written to avoid
5612 moving from a moved-from object, this warning can be disabled.
5613
5614 @item -Wvla
5615 @opindex Wvla
5616 @opindex Wno-vla
5617 Warn if variable length array is used in the code.
5618 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
5619 the variable length array.
5620
5621 @item -Wvolatile-register-var
5622 @opindex Wvolatile-register-var
5623 @opindex Wno-volatile-register-var
5624 Warn if a register variable is declared volatile.  The volatile
5625 modifier does not inhibit all optimizations that may eliminate reads
5626 and/or writes to register variables.  This warning is enabled by
5627 @option{-Wall}.
5628
5629 @item -Wdisabled-optimization
5630 @opindex Wdisabled-optimization
5631 @opindex Wno-disabled-optimization
5632 Warn if a requested optimization pass is disabled.  This warning does
5633 not generally indicate that there is anything wrong with your code; it
5634 merely indicates that GCC's optimizers are unable to handle the code
5635 effectively.  Often, the problem is that your code is too big or too
5636 complex; GCC refuses to optimize programs when the optimization
5637 itself is likely to take inordinate amounts of time.
5638
5639 @item -Wpointer-sign @r{(C and Objective-C only)}
5640 @opindex Wpointer-sign
5641 @opindex Wno-pointer-sign
5642 Warn for pointer argument passing or assignment with different signedness.
5643 This option is only supported for C and Objective-C@.  It is implied by
5644 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
5645 @option{-Wno-pointer-sign}.
5646
5647 @item -Wstack-protector
5648 @opindex Wstack-protector
5649 @opindex Wno-stack-protector
5650 This option is only active when @option{-fstack-protector} is active.  It
5651 warns about functions that are not protected against stack smashing.
5652
5653 @item -Woverlength-strings
5654 @opindex Woverlength-strings
5655 @opindex Wno-overlength-strings
5656 Warn about string constants that are longer than the ``minimum
5657 maximum'' length specified in the C standard.  Modern compilers
5658 generally allow string constants that are much longer than the
5659 standard's minimum limit, but very portable programs should avoid
5660 using longer strings.
5661
5662 The limit applies @emph{after} string constant concatenation, and does
5663 not count the trailing NUL@.  In C90, the limit was 509 characters; in
5664 C99, it was raised to 4095.  C++98 does not specify a normative
5665 minimum maximum, so we do not diagnose overlength strings in C++@.
5666
5667 This option is implied by @option{-Wpedantic}, and can be disabled with
5668 @option{-Wno-overlength-strings}.
5669
5670 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
5671 @opindex Wunsuffixed-float-constants
5672
5673 Issue a warning for any floating constant that does not have
5674 a suffix.  When used together with @option{-Wsystem-headers} it
5675 warns about such constants in system header files.  This can be useful
5676 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
5677 from the decimal floating-point extension to C99.
5678
5679 @item -Wno-designated-init @r{(C and Objective-C only)}
5680 Suppress warnings when a positional initializer is used to initialize
5681 a structure that has been marked with the @code{designated_init}
5682 attribute.
5683
5684 @end table
5685
5686 @node Debugging Options
5687 @section Options for Debugging Your Program or GCC
5688 @cindex options, debugging
5689 @cindex debugging information options
5690
5691 GCC has various special options that are used for debugging
5692 either your program or GCC:
5693
5694 @table @gcctabopt
5695 @item -g
5696 @opindex g
5697 Produce debugging information in the operating system's native format
5698 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
5699 information.
5700
5701 On most systems that use stabs format, @option{-g} enables use of extra
5702 debugging information that only GDB can use; this extra information
5703 makes debugging work better in GDB but probably makes other debuggers
5704 crash or
5705 refuse to read the program.  If you want to control for certain whether
5706 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
5707 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
5708
5709 GCC allows you to use @option{-g} with
5710 @option{-O}.  The shortcuts taken by optimized code may occasionally
5711 produce surprising results: some variables you declared may not exist
5712 at all; flow of control may briefly move where you did not expect it;
5713 some statements may not be executed because they compute constant
5714 results or their values are already at hand; some statements may
5715 execute in different places because they have been moved out of loops.
5716
5717 Nevertheless it proves possible to debug optimized output.  This makes
5718 it reasonable to use the optimizer for programs that might have bugs.
5719
5720 The following options are useful when GCC is generated with the
5721 capability for more than one debugging format.
5722
5723 @item -gsplit-dwarf
5724 @opindex gsplit-dwarf
5725 Separate as much dwarf debugging information as possible into a
5726 separate output file with the extension .dwo.  This option allows
5727 the build system to avoid linking files with debug information.  To
5728 be useful, this option requires a debugger capable of reading .dwo
5729 files.
5730
5731 @item -ggdb
5732 @opindex ggdb
5733 Produce debugging information for use by GDB@.  This means to use the
5734 most expressive format available (DWARF 2, stabs, or the native format
5735 if neither of those are supported), including GDB extensions if at all
5736 possible.
5737
5738 @item -gpubnames
5739 @opindex gpubnames
5740 Generate dwarf .debug_pubnames and .debug_pubtypes sections.
5741
5742 @item -ggnu-pubnames
5743 @opindex ggnu-pubnames
5744 Generate .debug_pubnames and .debug_pubtypes sections in a format
5745 suitable for conversion into a GDB@ index.  This option is only useful
5746 with a linker that can produce GDB@ index version 7.
5747
5748 @item -gstabs
5749 @opindex gstabs
5750 Produce debugging information in stabs format (if that is supported),
5751 without GDB extensions.  This is the format used by DBX on most BSD
5752 systems.  On MIPS, Alpha and System V Release 4 systems this option
5753 produces stabs debugging output that is not understood by DBX or SDB@.
5754 On System V Release 4 systems this option requires the GNU assembler.
5755
5756 @item -feliminate-unused-debug-symbols
5757 @opindex feliminate-unused-debug-symbols
5758 Produce debugging information in stabs format (if that is supported),
5759 for only symbols that are actually used.
5760
5761 @item -femit-class-debug-always
5762 @opindex femit-class-debug-always
5763 Instead of emitting debugging information for a C++ class in only one
5764 object file, emit it in all object files using the class.  This option
5765 should be used only with debuggers that are unable to handle the way GCC
5766 normally emits debugging information for classes because using this
5767 option increases the size of debugging information by as much as a
5768 factor of two.
5769
5770 @item -fdebug-types-section
5771 @opindex fdebug-types-section
5772 @opindex fno-debug-types-section
5773 When using DWARF Version 4 or higher, type DIEs can be put into
5774 their own @code{.debug_types} section instead of making them part of the
5775 @code{.debug_info} section.  It is more efficient to put them in a separate
5776 comdat sections since the linker can then remove duplicates.
5777 But not all DWARF consumers support @code{.debug_types} sections yet
5778 and on some objects @code{.debug_types} produces larger instead of smaller
5779 debugging information.
5780
5781 @item -gstabs+
5782 @opindex gstabs+
5783 Produce debugging information in stabs format (if that is supported),
5784 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5785 use of these extensions is likely to make other debuggers crash or
5786 refuse to read the program.
5787
5788 @item -gcoff
5789 @opindex gcoff
5790 Produce debugging information in COFF format (if that is supported).
5791 This is the format used by SDB on most System V systems prior to
5792 System V Release 4.
5793
5794 @item -gxcoff
5795 @opindex gxcoff
5796 Produce debugging information in XCOFF format (if that is supported).
5797 This is the format used by the DBX debugger on IBM RS/6000 systems.
5798
5799 @item -gxcoff+
5800 @opindex gxcoff+
5801 Produce debugging information in XCOFF format (if that is supported),
5802 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5803 use of these extensions is likely to make other debuggers crash or
5804 refuse to read the program, and may cause assemblers other than the GNU
5805 assembler (GAS) to fail with an error.
5806
5807 @item -gdwarf-@var{version}
5808 @opindex gdwarf-@var{version}
5809 Produce debugging information in DWARF format (if that is supported).
5810 The value of @var{version} may be either 2, 3, 4 or 5; the default version
5811 for most targets is 4.  DWARF Version 5 is only experimental.
5812
5813 Note that with DWARF Version 2, some ports require and always
5814 use some non-conflicting DWARF 3 extensions in the unwind tables.
5815
5816 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
5817 for maximum benefit.
5818
5819 @item -grecord-gcc-switches
5820 @opindex grecord-gcc-switches
5821 This switch causes the command-line options used to invoke the
5822 compiler that may affect code generation to be appended to the
5823 DW_AT_producer attribute in DWARF debugging information.  The options
5824 are concatenated with spaces separating them from each other and from
5825 the compiler version.  See also @option{-frecord-gcc-switches} for another
5826 way of storing compiler options into the object file.  This is the default.
5827
5828 @item -gno-record-gcc-switches
5829 @opindex gno-record-gcc-switches
5830 Disallow appending command-line options to the DW_AT_producer attribute
5831 in DWARF debugging information.
5832
5833 @item -gstrict-dwarf
5834 @opindex gstrict-dwarf
5835 Disallow using extensions of later DWARF standard version than selected
5836 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
5837 DWARF extensions from later standard versions is allowed.
5838
5839 @item -gno-strict-dwarf
5840 @opindex gno-strict-dwarf
5841 Allow using extensions of later DWARF standard version than selected with
5842 @option{-gdwarf-@var{version}}.
5843
5844 @item -gz@r{[}=@var{type}@r{]}
5845 @opindex gz
5846 Produce compressed debug sections in DWARF format, if that is supported.
5847 If @var{type} is not given, the default type depends on the capabilities
5848 of the assembler and linker used.  @var{type} may be one of
5849 @samp{none} (don't compress debug sections), @samp{zlib} (use zlib
5850 compression in ELF gABI format), or @samp{zlib-gnu} (use zlib
5851 compression in traditional GNU format).  If the linker doesn't support
5852 writing compressed debug sections, the option is rejected.  Otherwise,
5853 if the assembler does not support them, @option{-gz} is silently ignored
5854 when producing object files.
5855
5856 @item -gvms
5857 @opindex gvms
5858 Produce debugging information in Alpha/VMS debug format (if that is
5859 supported).  This is the format used by DEBUG on Alpha/VMS systems.
5860
5861 @item -g@var{level}
5862 @itemx -ggdb@var{level}
5863 @itemx -gstabs@var{level}
5864 @itemx -gcoff@var{level}
5865 @itemx -gxcoff@var{level}
5866 @itemx -gvms@var{level}
5867 Request debugging information and also use @var{level} to specify how
5868 much information.  The default level is 2.
5869
5870 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
5871 @option{-g}.
5872
5873 Level 1 produces minimal information, enough for making backtraces in
5874 parts of the program that you don't plan to debug.  This includes
5875 descriptions of functions and external variables, and line number
5876 tables, but no information about local variables.
5877
5878 Level 3 includes extra information, such as all the macro definitions
5879 present in the program.  Some debuggers support macro expansion when
5880 you use @option{-g3}.
5881
5882 @option{-gdwarf-2} does not accept a concatenated debug level, because
5883 GCC used to support an option @option{-gdwarf} that meant to generate
5884 debug information in version 1 of the DWARF format (which is very
5885 different from version 2), and it would have been too confusing.  That
5886 debug format is long obsolete, but the option cannot be changed now.
5887 Instead use an additional @option{-g@var{level}} option to change the
5888 debug level for DWARF.
5889
5890 @item -gtoggle
5891 @opindex gtoggle
5892 Turn off generation of debug info, if leaving out this option
5893 generates it, or turn it on at level 2 otherwise.  The position of this
5894 argument in the command line does not matter; it takes effect after all
5895 other options are processed, and it does so only once, no matter how
5896 many times it is given.  This is mainly intended to be used with
5897 @option{-fcompare-debug}.
5898
5899 @item -fsanitize=address
5900 @opindex fsanitize=address
5901 Enable AddressSanitizer, a fast memory error detector.
5902 Memory access instructions are instrumented to detect
5903 out-of-bounds and use-after-free bugs.
5904 See @uref{https://github.com/google/sanitizers/wiki/AddressSanitizer} for
5905 more details.  The run-time behavior can be influenced using the
5906 @env{ASAN_OPTIONS} environment variable.  When set to @code{help=1},
5907 the available options are shown at startup of the instrumended program.  See
5908 @url{https://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flags}
5909 for a list of supported options.
5910
5911 @item -fsanitize=kernel-address
5912 @opindex fsanitize=kernel-address
5913 Enable AddressSanitizer for Linux kernel.
5914 See @uref{https://github.com/google/kasan/wiki} for more details.
5915
5916 @item -fsanitize=thread
5917 @opindex fsanitize=thread
5918 Enable ThreadSanitizer, a fast data race detector.
5919 Memory access instructions are instrumented to detect
5920 data race bugs.  See @uref{https://github.com/google/sanitizers/wiki#threadsanitizer} for more
5921 details. The run-time behavior can be influenced using the @env{TSAN_OPTIONS}
5922 environment variable; see
5923 @url{https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags} for a list of
5924 supported options.
5925
5926 @item -fsanitize=leak
5927 @opindex fsanitize=leak
5928 Enable LeakSanitizer, a memory leak detector.
5929 This option only matters for linking of executables and if neither
5930 @option{-fsanitize=address} nor @option{-fsanitize=thread} is used.  In that
5931 case the executable is linked against a library that overrides @code{malloc}
5932 and other allocator functions.  See
5933 @uref{https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer} for more
5934 details.  The run-time behavior can be influenced using the
5935 @env{LSAN_OPTIONS} environment variable.
5936
5937 @item -fsanitize=undefined
5938 @opindex fsanitize=undefined
5939 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector.
5940 Various computations are instrumented to detect undefined behavior
5941 at runtime.  Current suboptions are:
5942
5943 @table @gcctabopt
5944
5945 @item -fsanitize=shift
5946 @opindex fsanitize=shift
5947 This option enables checking that the result of a shift operation is
5948 not undefined.  Note that what exactly is considered undefined differs
5949 slightly between C and C++, as well as between ISO C90 and C99, etc.
5950
5951 @item -fsanitize=integer-divide-by-zero
5952 @opindex fsanitize=integer-divide-by-zero
5953 Detect integer division by zero as well as @code{INT_MIN / -1} division.
5954
5955 @item -fsanitize=unreachable
5956 @opindex fsanitize=unreachable
5957 With this option, the compiler turns the @code{__builtin_unreachable}
5958 call into a diagnostics message call instead.  When reaching the
5959 @code{__builtin_unreachable} call, the behavior is undefined.
5960
5961 @item -fsanitize=vla-bound
5962 @opindex fsanitize=vla-bound
5963 This option instructs the compiler to check that the size of a variable
5964 length array is positive.
5965
5966 @item -fsanitize=null
5967 @opindex fsanitize=null
5968 This option enables pointer checking.  Particularly, the application
5969 built with this option turned on will issue an error message when it
5970 tries to dereference a NULL pointer, or if a reference (possibly an
5971 rvalue reference) is bound to a NULL pointer, or if a method is invoked
5972 on an object pointed by a NULL pointer.
5973
5974 @item -fsanitize=return
5975 @opindex fsanitize=return
5976 This option enables return statement checking.  Programs
5977 built with this option turned on will issue an error message
5978 when the end of a non-void function is reached without actually
5979 returning a value.  This option works in C++ only.
5980
5981 @item -fsanitize=signed-integer-overflow
5982 @opindex fsanitize=signed-integer-overflow
5983 This option enables signed integer overflow checking.  We check that
5984 the result of @code{+}, @code{*}, and both unary and binary @code{-}
5985 does not overflow in the signed arithmetics.  Note, integer promotion
5986 rules must be taken into account.  That is, the following is not an
5987 overflow:
5988 @smallexample
5989 signed char a = SCHAR_MAX;
5990 a++;
5991 @end smallexample
5992
5993 @item -fsanitize=bounds
5994 @opindex fsanitize=bounds
5995 This option enables instrumentation of array bounds.  Various out of bounds
5996 accesses are detected.  Flexible array members, flexible array member-like
5997 arrays, and initializers of variables with static storage are not instrumented.
5998
5999 @item -fsanitize=bounds-strict
6000 @opindex fsanitize=bounds-strict
6001 This option enables strict instrumentation of array bounds.  Most out of bounds
6002 accesses are detected, including flexible array members and flexible array
6003 member-like arrays.  Initializers of variables with static storage are not
6004 instrumented.
6005
6006 @item -fsanitize=alignment
6007 @opindex fsanitize=alignment
6008
6009 This option enables checking of alignment of pointers when they are
6010 dereferenced, or when a reference is bound to insufficiently aligned target,
6011 or when a method or constructor is invoked on insufficiently aligned object.
6012
6013 @item -fsanitize=object-size
6014 @opindex fsanitize=object-size
6015 This option enables instrumentation of memory references using the
6016 @code{__builtin_object_size} function.  Various out of bounds pointer
6017 accesses are detected.
6018
6019 @item -fsanitize=float-divide-by-zero
6020 @opindex fsanitize=float-divide-by-zero
6021 Detect floating-point division by zero.  Unlike other similar options,
6022 @option{-fsanitize=float-divide-by-zero} is not enabled by
6023 @option{-fsanitize=undefined}, since floating-point division by zero can
6024 be a legitimate way of obtaining infinities and NaNs.
6025
6026 @item -fsanitize=float-cast-overflow
6027 @opindex fsanitize=float-cast-overflow
6028 This option enables floating-point type to integer conversion checking.
6029 We check that the result of the conversion does not overflow.
6030 Unlike other similar options, @option{-fsanitize=float-cast-overflow} is
6031 not enabled by @option{-fsanitize=undefined}.
6032 This option does not work well with @code{FE_INVALID} exceptions enabled.
6033
6034 @item -fsanitize=nonnull-attribute
6035 @opindex fsanitize=nonnull-attribute
6036
6037 This option enables instrumentation of calls, checking whether null values
6038 are not passed to arguments marked as requiring a non-null value by the
6039 @code{nonnull} function attribute.
6040
6041 @item -fsanitize=returns-nonnull-attribute
6042 @opindex fsanitize=returns-nonnull-attribute
6043
6044 This option enables instrumentation of return statements in functions
6045 marked with @code{returns_nonnull} function attribute, to detect returning
6046 of null values from such functions.
6047
6048 @item -fsanitize=bool
6049 @opindex fsanitize=bool
6050
6051 This option enables instrumentation of loads from bool.  If a value other
6052 than 0/1 is loaded, a run-time error is issued.
6053
6054 @item -fsanitize=enum
6055 @opindex fsanitize=enum
6056
6057 This option enables instrumentation of loads from an enum type.  If
6058 a value outside the range of values for the enum type is loaded,
6059 a run-time error is issued.
6060
6061 @item -fsanitize=vptr
6062 @opindex fsanitize=vptr
6063
6064 This option enables instrumentation of C++ member function calls, member
6065 accesses and some conversions between pointers to base and derived classes,
6066 to verify the referenced object has the correct dynamic type.
6067
6068 @end table
6069
6070 While @option{-ftrapv} causes traps for signed overflows to be emitted,
6071 @option{-fsanitize=undefined} gives a diagnostic message.
6072 This currently works only for the C family of languages.
6073
6074 @item -fno-sanitize=all
6075 @opindex fno-sanitize=all
6076
6077 This option disables all previously enabled sanitizers.
6078 @option{-fsanitize=all} is not allowed, as some sanitizers cannot be used
6079 together.
6080
6081 @item -fasan-shadow-offset=@var{number}
6082 @opindex fasan-shadow-offset
6083 This option forces GCC to use custom shadow offset in AddressSanitizer checks.
6084 It is useful for experimenting with different shadow memory layouts in
6085 Kernel AddressSanitizer.
6086
6087 @item -fsanitize-sections=@var{s1},@var{s2},...
6088 @opindex fsanitize-sections
6089 Sanitize global variables in selected user-defined sections.  @var{si} may
6090 contain wildcards.
6091
6092 @item -fsanitize-recover@r{[}=@var{opts}@r{]}
6093 @opindex fsanitize-recover
6094 @opindex fno-sanitize-recover
6095 @option{-fsanitize-recover=} controls error recovery mode for sanitizers
6096 mentioned in comma-separated list of @var{opts}.  Enabling this option
6097 for a sanitizer component causes it to attempt to continue
6098 running the program as if no error happened.  This means multiple
6099 runtime errors can be reported in a single program run, and the exit
6100 code of the program may indicate success even when errors
6101 have been reported.  The @option{-fno-sanitize-recover=} option
6102 can be used to alter
6103 this behavior: only the first detected error is reported
6104 and program then exits with a non-zero exit code.
6105
6106 Currently this feature only works for @option{-fsanitize=undefined} (and its suboptions
6107 except for @option{-fsanitize=unreachable} and @option{-fsanitize=return}),
6108 @option{-fsanitize=float-cast-overflow}, @option{-fsanitize=float-divide-by-zero} and
6109 @option{-fsanitize=kernel-address}.  For these sanitizers error recovery is turned on by default.
6110 @option{-fsanitize-recover=all} and @option{-fno-sanitize-recover=all} is also
6111 accepted, the former enables recovery for all sanitizers that support it,
6112 the latter disables recovery for all sanitizers that support it.
6113
6114 Syntax without explicit @var{opts} parameter is deprecated.  It is equivalent to
6115 @smallexample
6116 -fsanitize-recover=undefined,float-cast-overflow,float-divide-by-zero
6117 @end smallexample
6118 @noindent
6119 Similarly @option{-fno-sanitize-recover} is equivalent to
6120 @smallexample
6121 -fno-sanitize-recover=undefined,float-cast-overflow,float-divide-by-zero
6122 @end smallexample
6123
6124 @item -fsanitize-undefined-trap-on-error
6125 @opindex fsanitize-undefined-trap-on-error
6126 The @option{-fsanitize-undefined-trap-on-error} option instructs the compiler to
6127 report undefined behavior using @code{__builtin_trap} rather than
6128 a @code{libubsan} library routine.  The advantage of this is that the
6129 @code{libubsan} library is not needed and is not linked in, so this
6130 is usable even in freestanding environments.
6131
6132 @item -fcheck-pointer-bounds
6133 @opindex fcheck-pointer-bounds
6134 @opindex fno-check-pointer-bounds
6135 @cindex Pointer Bounds Checker options
6136 Enable Pointer Bounds Checker instrumentation.  Each memory reference
6137 is instrumented with checks of the pointer used for memory access against
6138 bounds associated with that pointer.  
6139
6140 Currently there
6141 is only an implementation for Intel MPX available, thus x86 target
6142 and @option{-mmpx} are required to enable this feature.  
6143 MPX-based instrumentation requires
6144 a runtime library to enable MPX in hardware and handle bounds
6145 violation signals.  By default when @option{-fcheck-pointer-bounds}
6146 and @option{-mmpx} options are used to link a program, the GCC driver
6147 links against the @file{libmpx} runtime library and @file{libmpxwrappers}
6148 library.  It also passes '-z bndplt' to a linker in case it supports this
6149 option (which is checked on libmpx configuration).  Note that old versions
6150 of linker may ignore option.  Gold linker doesn't support '-z bndplt'
6151 option.  With no '-z bndplt' support in linker all calls to dynamic libraries
6152 lose passed bounds reducing overall protection level.  It's highly
6153 recommended to use linker with '-z bndplt' support.  In case such linker
6154 is not available it is adviced to always use @option{-static-libmpxwrappers}
6155 for better protection level or use @option{-static} to completely avoid
6156 external calls to dynamic libraries.  MPX-based instrumentation
6157 may be used for debugging and also may be included in production code
6158 to increase program security.  Depending on usage, you may
6159 have different requirements for the runtime library.  The current version
6160 of the MPX runtime library is more oriented for use as a debugging
6161 tool.  MPX runtime library usage implies @option{-lpthread}.  See
6162 also @option{-static-libmpx}.  The runtime library  behavior can be
6163 influenced using various @env{CHKP_RT_*} environment variables.  See
6164 @uref{https://gcc.gnu.org/wiki/Intel%20MPX%20support%20in%20the%20GCC%20compiler}
6165 for more details.
6166
6167 Generated instrumentation may be controlled by various
6168 @option{-fchkp-*} options and by the @code{bnd_variable_size}
6169 structure field attribute (@pxref{Type Attributes}) and
6170 @code{bnd_legacy}, and @code{bnd_instrument} function attributes
6171 (@pxref{Function Attributes}).  GCC also provides a number of built-in
6172 functions for controlling the Pointer Bounds Checker.  @xref{Pointer
6173 Bounds Checker builtins}, for more information.
6174
6175 @item -fchecking
6176 @opindex fchecking
6177 @opindex fno-checking
6178 Enable internal consistency checking.  The default depends on
6179 the compiler configuration.
6180
6181 @item -fchkp-check-incomplete-type
6182 @opindex fchkp-check-incomplete-type
6183 @opindex fno-chkp-check-incomplete-type
6184 Generate pointer bounds checks for variables with incomplete type.
6185 Enabled by default.
6186
6187 @item -fchkp-narrow-bounds
6188 @opindex fchkp-narrow-bounds
6189 @opindex fno-chkp-narrow-bounds
6190 Controls bounds used by Pointer Bounds Checker for pointers to object
6191 fields.  If narrowing is enabled then field bounds are used.  Otherwise
6192 object bounds are used.  See also @option{-fchkp-narrow-to-innermost-array}
6193 and @option{-fchkp-first-field-has-own-bounds}.  Enabled by default.
6194
6195 @item -fchkp-first-field-has-own-bounds
6196 @opindex fchkp-first-field-has-own-bounds
6197 @opindex fno-chkp-first-field-has-own-bounds
6198 Forces Pointer Bounds Checker to use narrowed bounds for the address of the
6199 first field in the structure.  By default a pointer to the first field has
6200 the same bounds as a pointer to the whole structure.
6201
6202 @item -fchkp-narrow-to-innermost-array
6203 @opindex fchkp-narrow-to-innermost-array
6204 @opindex fno-chkp-narrow-to-innermost-array
6205 Forces Pointer Bounds Checker to use bounds of the innermost arrays in
6206 case of nested static array access.  By default this option is disabled and
6207 bounds of the outermost array are used.
6208
6209 @item -fchkp-optimize
6210 @opindex fchkp-optimize
6211 @opindex fno-chkp-optimize
6212 Enables Pointer Bounds Checker optimizations.  Enabled by default at
6213 optimization levels @option{-O}, @option{-O2}, @option{-O3}.
6214
6215 @item -fchkp-use-fast-string-functions
6216 @opindex fchkp-use-fast-string-functions
6217 @opindex fno-chkp-use-fast-string-functions
6218 Enables use of @code{*_nobnd} versions of string functions (not copying bounds)
6219 by Pointer Bounds Checker.  Disabled by default.
6220
6221 @item -fchkp-use-nochk-string-functions
6222 @opindex fchkp-use-nochk-string-functions
6223 @opindex fno-chkp-use-nochk-string-functions
6224 Enables use of @code{*_nochk} versions of string functions (not checking bounds)
6225 by Pointer Bounds Checker.  Disabled by default.
6226
6227 @item -fchkp-use-static-bounds
6228 @opindex fchkp-use-static-bounds
6229 @opindex fno-chkp-use-static-bounds
6230 Allow Pointer Bounds Checker to generate static bounds holding
6231 bounds of static variables.  Enabled by default.
6232
6233 @item -fchkp-use-static-const-bounds
6234 @opindex fchkp-use-static-const-bounds
6235 @opindex fno-chkp-use-static-const-bounds
6236 Use statically-initialized bounds for constant bounds instead of
6237 generating them each time they are required.  By default enabled when
6238 @option{-fchkp-use-static-bounds} is enabled.
6239
6240 @item -fchkp-treat-zero-dynamic-size-as-infinite
6241 @opindex fchkp-treat-zero-dynamic-size-as-infinite
6242 @opindex fno-chkp-treat-zero-dynamic-size-as-infinite
6243 With this option, objects with incomplete type whose
6244 dynamically-obtained size is zero are treated as having infinite size
6245 instead by Pointer Bounds
6246 Checker.  This option may be helpful if a program is linked with a library
6247 missing size information for some symbols.  Disabled by default.
6248
6249 @item -fchkp-check-read
6250 @opindex fchkp-check-read
6251 @opindex fno-chkp-check-read
6252 Instructs Pointer Bounds Checker to generate checks for all read
6253 accesses to memory.  Enabled by default.
6254
6255 @item -fchkp-check-write
6256 @opindex fchkp-check-write
6257 @opindex fno-chkp-check-write
6258 Instructs Pointer Bounds Checker to generate checks for all write
6259 accesses to memory.  Enabled by default.
6260
6261 @item -fchkp-store-bounds
6262 @opindex fchkp-store-bounds
6263 @opindex fno-chkp-store-bounds
6264 Instructs Pointer Bounds Checker to generate bounds stores for
6265 pointer writes.  Enabled by default.
6266
6267 @item -fchkp-instrument-calls
6268 @opindex fchkp-instrument-calls
6269 @opindex fno-chkp-instrument-calls
6270 Instructs Pointer Bounds Checker to pass pointer bounds to calls.
6271 Enabled by default.
6272
6273 @item -fchkp-instrument-marked-only
6274 @opindex fchkp-instrument-marked-only
6275 @opindex fno-chkp-instrument-marked-only
6276 Instructs Pointer Bounds Checker to instrument only functions
6277 marked with the @code{bnd_instrument} attribute
6278 (@pxref{Function Attributes}).  Disabled by default.
6279
6280 @item -fchkp-use-wrappers
6281 @opindex fchkp-use-wrappers
6282 @opindex fno-chkp-use-wrappers
6283 Allows Pointer Bounds Checker to replace calls to built-in functions
6284 with calls to wrapper functions.  When @option{-fchkp-use-wrappers}
6285 is used to link a program, the GCC driver automatically links
6286 against @file{libmpxwrappers}.  See also @option{-static-libmpxwrappers}.
6287 Enabled by default.
6288
6289 @item -fdump-final-insns@r{[}=@var{file}@r{]}
6290 @opindex fdump-final-insns
6291 Dump the final internal representation (RTL) to @var{file}.  If the
6292 optional argument is omitted (or if @var{file} is @code{.}), the name
6293 of the dump file is determined by appending @code{.gkd} to the
6294 compilation output file name.
6295
6296 @item -fcompare-debug@r{[}=@var{opts}@r{]}
6297 @opindex fcompare-debug
6298 @opindex fno-compare-debug
6299 If no error occurs during compilation, run the compiler a second time,
6300 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
6301 passed to the second compilation.  Dump the final internal
6302 representation in both compilations, and print an error if they differ.
6303
6304 If the equal sign is omitted, the default @option{-gtoggle} is used.
6305
6306 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
6307 and nonzero, implicitly enables @option{-fcompare-debug}.  If
6308 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
6309 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
6310 is used.
6311
6312 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
6313 is equivalent to @option{-fno-compare-debug}, which disables the dumping
6314 of the final representation and the second compilation, preventing even
6315 @env{GCC_COMPARE_DEBUG} from taking effect.
6316
6317 To verify full coverage during @option{-fcompare-debug} testing, set
6318 @env{GCC_COMPARE_DEBUG} to say @option{-fcompare-debug-not-overridden},
6319 which GCC rejects as an invalid option in any actual compilation
6320 (rather than preprocessing, assembly or linking).  To get just a
6321 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
6322 not overridden} will do.
6323
6324 @item -fcompare-debug-second
6325 @opindex fcompare-debug-second
6326 This option is implicitly passed to the compiler for the second
6327 compilation requested by @option{-fcompare-debug}, along with options to
6328 silence warnings, and omitting other options that would cause
6329 side-effect compiler outputs to files or to the standard output.  Dump
6330 files and preserved temporary files are renamed so as to contain the
6331 @code{.gk} additional extension during the second compilation, to avoid
6332 overwriting those generated by the first.
6333
6334 When this option is passed to the compiler driver, it causes the
6335 @emph{first} compilation to be skipped, which makes it useful for little
6336 other than debugging the compiler proper.
6337
6338 @item -feliminate-dwarf2-dups
6339 @opindex feliminate-dwarf2-dups
6340 Compress DWARF 2 debugging information by eliminating duplicated
6341 information about each symbol.  This option only makes sense when
6342 generating DWARF 2 debugging information with @option{-gdwarf-2}.
6343
6344 @item -femit-struct-debug-baseonly
6345 @opindex femit-struct-debug-baseonly
6346 Emit debug information for struct-like types
6347 only when the base name of the compilation source file
6348 matches the base name of file in which the struct is defined.
6349
6350 This option substantially reduces the size of debugging information,
6351 but at significant potential loss in type information to the debugger.
6352 See @option{-femit-struct-debug-reduced} for a less aggressive option.
6353 See @option{-femit-struct-debug-detailed} for more detailed control.
6354
6355 This option works only with DWARF 2.
6356
6357 @item -femit-struct-debug-reduced
6358 @opindex femit-struct-debug-reduced
6359 Emit debug information for struct-like types
6360 only when the base name of the compilation source file
6361 matches the base name of file in which the type is defined,
6362 unless the struct is a template or defined in a system header.
6363
6364 This option significantly reduces the size of debugging information,
6365 with some potential loss in type information to the debugger.
6366 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
6367 See @option{-femit-struct-debug-detailed} for more detailed control.
6368
6369 This option works only with DWARF 2.
6370
6371 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
6372 @opindex femit-struct-debug-detailed
6373 Specify the struct-like types
6374 for which the compiler generates debug information.
6375 The intent is to reduce duplicate struct debug information
6376 between different object files within the same program.
6377
6378 This option is a detailed version of
6379 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
6380 which serves for most needs.
6381
6382 A specification has the syntax@*
6383 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
6384
6385 The optional first word limits the specification to
6386 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
6387 A struct type is used directly when it is the type of a variable, member.
6388 Indirect uses arise through pointers to structs.
6389 That is, when use of an incomplete struct is valid, the use is indirect.
6390 An example is
6391 @samp{struct one direct; struct two * indirect;}.
6392
6393 The optional second word limits the specification to
6394 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
6395 Generic structs are a bit complicated to explain.
6396 For C++, these are non-explicit specializations of template classes,
6397 or non-template classes within the above.
6398 Other programming languages have generics,
6399 but @option{-femit-struct-debug-detailed} does not yet implement them.
6400
6401 The third word specifies the source files for those
6402 structs for which the compiler should emit debug information.
6403 The values @samp{none} and @samp{any} have the normal meaning.
6404 The value @samp{base} means that
6405 the base of name of the file in which the type declaration appears
6406 must match the base of the name of the main compilation file.
6407 In practice, this means that when compiling @file{foo.c}, debug information
6408 is generated for types declared in that file and @file{foo.h},
6409 but not other header files.
6410 The value @samp{sys} means those types satisfying @samp{base}
6411 or declared in system or compiler headers.
6412
6413 You may need to experiment to determine the best settings for your application.
6414
6415 The default is @option{-femit-struct-debug-detailed=all}.
6416
6417 This option works only with DWARF 2.
6418
6419 @item -fno-merge-debug-strings
6420 @opindex fmerge-debug-strings
6421 @opindex fno-merge-debug-strings
6422 Direct the linker to not merge together strings in the debugging
6423 information that are identical in different object files.  Merging is
6424 not supported by all assemblers or linkers.  Merging decreases the size
6425 of the debug information in the output file at the cost of increasing
6426 link processing time.  Merging is enabled by default.
6427
6428 @item -fdebug-prefix-map=@var{old}=@var{new}
6429 @opindex fdebug-prefix-map
6430 When compiling files in directory @file{@var{old}}, record debugging
6431 information describing them as in @file{@var{new}} instead.
6432
6433 @item -fno-dwarf2-cfi-asm
6434 @opindex fdwarf2-cfi-asm
6435 @opindex fno-dwarf2-cfi-asm
6436 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
6437 instead of using GAS @code{.cfi_*} directives.
6438
6439 @cindex @command{prof}
6440 @item -p
6441 @opindex p
6442 Generate extra code to write profile information suitable for the
6443 analysis program @command{prof}.  You must use this option when compiling
6444 the source files you want data about, and you must also use it when
6445 linking.
6446
6447 @cindex @command{gprof}
6448 @item -pg
6449 @opindex pg
6450 Generate extra code to write profile information suitable for the
6451 analysis program @command{gprof}.  You must use this option when compiling
6452 the source files you want data about, and you must also use it when
6453 linking.
6454
6455 @item -Q
6456 @opindex Q
6457 Makes the compiler print out each function name as it is compiled, and
6458 print some statistics about each pass when it finishes.
6459
6460 @item -ftime-report
6461 @opindex ftime-report
6462 Makes the compiler print some statistics about the time consumed by each
6463 pass when it finishes.
6464
6465 @item -fmem-report
6466 @opindex fmem-report
6467 Makes the compiler print some statistics about permanent memory
6468 allocation when it finishes.
6469
6470 @item -fmem-report-wpa
6471 @opindex fmem-report-wpa
6472 Makes the compiler print some statistics about permanent memory
6473 allocation for the WPA phase only.
6474
6475 @item -fpre-ipa-mem-report
6476 @opindex fpre-ipa-mem-report
6477 @item -fpost-ipa-mem-report
6478 @opindex fpost-ipa-mem-report
6479 Makes the compiler print some statistics about permanent memory
6480 allocation before or after interprocedural optimization.
6481
6482 @item -fprofile-report
6483 @opindex fprofile-report
6484 Makes the compiler print some statistics about consistency of the
6485 (estimated) profile and effect of individual passes.
6486
6487 @item -fstack-usage
6488 @opindex fstack-usage
6489 Makes the compiler output stack usage information for the program, on a
6490 per-function basis.  The filename for the dump is made by appending
6491 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
6492 the output file, if explicitly specified and it is not an executable,
6493 otherwise it is the basename of the source file.  An entry is made up
6494 of three fields:
6495
6496 @itemize
6497 @item
6498 The name of the function.
6499 @item
6500 A number of bytes.
6501 @item
6502 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
6503 @end itemize
6504
6505 The qualifier @code{static} means that the function manipulates the stack
6506 statically: a fixed number of bytes are allocated for the frame on function
6507 entry and released on function exit; no stack adjustments are otherwise made
6508 in the function.  The second field is this fixed number of bytes.
6509
6510 The qualifier @code{dynamic} means that the function manipulates the stack
6511 dynamically: in addition to the static allocation described above, stack
6512 adjustments are made in the body of the function, for example to push/pop
6513 arguments around function calls.  If the qualifier @code{bounded} is also
6514 present, the amount of these adjustments is bounded at compile time and
6515 the second field is an upper bound of the total amount of stack used by
6516 the function.  If it is not present, the amount of these adjustments is
6517 not bounded at compile time and the second field only represents the
6518 bounded part.
6519
6520 @item -fprofile-arcs
6521 @opindex fprofile-arcs
6522 Add code so that program flow @dfn{arcs} are instrumented.  During
6523 execution the program records how many times each branch and call is
6524 executed and how many times it is taken or returns.  When the compiled
6525 program exits it saves this data to a file called
6526 @file{@var{auxname}.gcda} for each source file.  The data may be used for
6527 profile-directed optimizations (@option{-fbranch-probabilities}), or for
6528 test coverage analysis (@option{-ftest-coverage}).  Each object file's
6529 @var{auxname} is generated from the name of the output file, if
6530 explicitly specified and it is not the final executable, otherwise it is
6531 the basename of the source file.  In both cases any suffix is removed
6532 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
6533 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
6534 @xref{Cross-profiling}.
6535
6536 @cindex @command{gcov}
6537 @item --coverage
6538 @opindex coverage
6539
6540 This option is used to compile and link code instrumented for coverage
6541 analysis.  The option is a synonym for @option{-fprofile-arcs}
6542 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
6543 linking).  See the documentation for those options for more details.
6544
6545 @itemize
6546
6547 @item
6548 Compile the source files with @option{-fprofile-arcs} plus optimization
6549 and code generation options.  For test coverage analysis, use the
6550 additional @option{-ftest-coverage} option.  You do not need to profile
6551 every source file in a program.
6552
6553 @item
6554 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
6555 (the latter implies the former).
6556
6557 @item
6558 Run the program on a representative workload to generate the arc profile
6559 information.  This may be repeated any number of times.  You can run
6560 concurrent instances of your program, and provided that the file system
6561 supports locking, the data files will be correctly updated.  Also
6562 @code{fork} calls are detected and correctly handled (double counting
6563 will not happen).
6564
6565 @item
6566 For profile-directed optimizations, compile the source files again with
6567 the same optimization and code generation options plus
6568 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
6569 Control Optimization}).
6570
6571 @item
6572 For test coverage analysis, use @command{gcov} to produce human readable
6573 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
6574 @command{gcov} documentation for further information.
6575
6576 @end itemize
6577
6578 With @option{-fprofile-arcs}, for each function of your program GCC
6579 creates a program flow graph, then finds a spanning tree for the graph.
6580 Only arcs that are not on the spanning tree have to be instrumented: the
6581 compiler adds code to count the number of times that these arcs are
6582 executed.  When an arc is the only exit or only entrance to a block, the
6583 instrumentation code can be added to the block; otherwise, a new basic
6584 block must be created to hold the instrumentation code.
6585
6586 @need 2000
6587 @item -ftest-coverage
6588 @opindex ftest-coverage
6589 Produce a notes file that the @command{gcov} code-coverage utility
6590 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
6591 show program coverage.  Each source file's note file is called
6592 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
6593 above for a description of @var{auxname} and instructions on how to
6594 generate test coverage data.  Coverage data matches the source files
6595 more closely if you do not optimize.
6596
6597 @item -fdbg-cnt-list
6598 @opindex fdbg-cnt-list
6599 Print the name and the counter upper bound for all debug counters.
6600
6601
6602 @item -fdbg-cnt=@var{counter-value-list}
6603 @opindex fdbg-cnt
6604 Set the internal debug counter upper bound.  @var{counter-value-list}
6605 is a comma-separated list of @var{name}:@var{value} pairs
6606 which sets the upper bound of each debug counter @var{name} to @var{value}.
6607 All debug counters have the initial upper bound of @code{UINT_MAX};
6608 thus @code{dbg_cnt} returns true always unless the upper bound
6609 is set by this option.
6610 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
6611 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
6612
6613 @item -fenable-@var{kind}-@var{pass}
6614 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
6615 @opindex fdisable-
6616 @opindex fenable-
6617
6618 This is a set of options that are used to explicitly disable/enable
6619 optimization passes.  These options are intended for use for debugging GCC.
6620 Compiler users should use regular options for enabling/disabling
6621 passes instead.
6622
6623 @table @gcctabopt
6624
6625 @item -fdisable-ipa-@var{pass}
6626 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
6627 statically invoked in the compiler multiple times, the pass name should be
6628 appended with a sequential number starting from 1.
6629
6630 @item -fdisable-rtl-@var{pass}
6631 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
6632 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
6633 statically invoked in the compiler multiple times, the pass name should be
6634 appended with a sequential number starting from 1.  @var{range-list} is a 
6635 comma-separated list of function ranges or assembler names.  Each range is a number
6636 pair separated by a colon.  The range is inclusive in both ends.  If the range
6637 is trivial, the number pair can be simplified as a single number.  If the
6638 function's call graph node's @var{uid} falls within one of the specified ranges,
6639 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
6640 function header of a dump file, and the pass names can be dumped by using
6641 option @option{-fdump-passes}.
6642
6643 @item -fdisable-tree-@var{pass}
6644 @itemx -fdisable-tree-@var{pass}=@var{range-list}
6645 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
6646 option arguments.
6647
6648 @item -fenable-ipa-@var{pass}
6649 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
6650 statically invoked in the compiler multiple times, the pass name should be
6651 appended with a sequential number starting from 1.
6652
6653 @item -fenable-rtl-@var{pass}
6654 @itemx -fenable-rtl-@var{pass}=@var{range-list}
6655 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
6656 description and examples.
6657
6658 @item -fenable-tree-@var{pass}
6659 @itemx -fenable-tree-@var{pass}=@var{range-list}
6660 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
6661 of option arguments.
6662
6663 @end table
6664
6665 Here are some examples showing uses of these options.
6666
6667 @smallexample
6668
6669 # disable ccp1 for all functions
6670    -fdisable-tree-ccp1
6671 # disable complete unroll for function whose cgraph node uid is 1
6672    -fenable-tree-cunroll=1
6673 # disable gcse2 for functions at the following ranges [1,1],
6674 # [300,400], and [400,1000]
6675 # disable gcse2 for functions foo and foo2
6676    -fdisable-rtl-gcse2=foo,foo2
6677 # disable early inlining
6678    -fdisable-tree-einline
6679 # disable ipa inlining
6680    -fdisable-ipa-inline
6681 # enable tree full unroll
6682    -fenable-tree-unroll
6683
6684 @end smallexample
6685
6686 @item -d@var{letters}
6687 @itemx -fdump-rtl-@var{pass}
6688 @itemx -fdump-rtl-@var{pass}=@var{filename}
6689 @opindex d
6690 @opindex fdump-rtl-@var{pass}
6691 Says to make debugging dumps during compilation at times specified by
6692 @var{letters}.  This is used for debugging the RTL-based passes of the
6693 compiler.  The file names for most of the dumps are made by appending
6694 a pass number and a word to the @var{dumpname}, and the files are
6695 created in the directory of the output file.  In case of
6696 @option{=@var{filename}} option, the dump is output on the given file
6697 instead of the pass numbered dump files.  Note that the pass number is
6698 assigned as passes are registered into the pass manager.  Most passes
6699 are registered in the order that they will execute and for these passes
6700 the number corresponds to the pass execution order.  However, passes
6701 registered by plugins, passes specific to compilation targets, or
6702 passes that are otherwise registered after all the other passes are
6703 numbered higher than a pass named "final", even if they are executed
6704 earlier.  @var{dumpname} is generated from the name of the output
6705 file if explicitly specified and not an executable, otherwise it is
6706 the basename of the source file.  These switches may have different
6707 effects when @option{-E} is used for preprocessing.
6708
6709 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
6710 @option{-d} option @var{letters}.  Here are the possible
6711 letters for use in @var{pass} and @var{letters}, and their meanings:
6712
6713 @table @gcctabopt
6714
6715 @item -fdump-rtl-alignments
6716 @opindex fdump-rtl-alignments
6717 Dump after branch alignments have been computed.
6718
6719 @item -fdump-rtl-asmcons
6720 @opindex fdump-rtl-asmcons
6721 Dump after fixing rtl statements that have unsatisfied in/out constraints.
6722
6723 @item -fdump-rtl-auto_inc_dec
6724 @opindex fdump-rtl-auto_inc_dec
6725 Dump after auto-inc-dec discovery.  This pass is only run on
6726 architectures that have auto inc or auto dec instructions.
6727
6728 @item -fdump-rtl-barriers
6729 @opindex fdump-rtl-barriers
6730 Dump after cleaning up the barrier instructions.
6731
6732 @item -fdump-rtl-bbpart
6733 @opindex fdump-rtl-bbpart
6734 Dump after partitioning hot and cold basic blocks.
6735
6736 @item -fdump-rtl-bbro
6737 @opindex fdump-rtl-bbro
6738 Dump after block reordering.
6739
6740 @item -fdump-rtl-btl1
6741 @itemx -fdump-rtl-btl2
6742 @opindex fdump-rtl-btl2
6743 @opindex fdump-rtl-btl2
6744 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
6745 after the two branch
6746 target load optimization passes.
6747
6748 @item -fdump-rtl-bypass
6749 @opindex fdump-rtl-bypass
6750 Dump after jump bypassing and control flow optimizations.
6751
6752 @item -fdump-rtl-combine
6753 @opindex fdump-rtl-combine
6754 Dump after the RTL instruction combination pass.
6755
6756 @item -fdump-rtl-compgotos
6757 @opindex fdump-rtl-compgotos
6758 Dump after duplicating the computed gotos.
6759
6760 @item -fdump-rtl-ce1
6761 @itemx -fdump-rtl-ce2
6762 @itemx -fdump-rtl-ce3
6763 @opindex fdump-rtl-ce1
6764 @opindex fdump-rtl-ce2
6765 @opindex fdump-rtl-ce3
6766 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
6767 @option{-fdump-rtl-ce3} enable dumping after the three
6768 if conversion passes.
6769
6770 @item -fdump-rtl-cprop_hardreg
6771 @opindex fdump-rtl-cprop_hardreg
6772 Dump after hard register copy propagation.
6773
6774 @item -fdump-rtl-csa
6775 @opindex fdump-rtl-csa
6776 Dump after combining stack adjustments.
6777
6778 @item -fdump-rtl-cse1
6779 @itemx -fdump-rtl-cse2
6780 @opindex fdump-rtl-cse1
6781 @opindex fdump-rtl-cse2
6782 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
6783 the two common subexpression elimination passes.
6784
6785 @item -fdump-rtl-dce
6786 @opindex fdump-rtl-dce
6787 Dump after the standalone dead code elimination passes.
6788
6789 @item -fdump-rtl-dbr
6790 @opindex fdump-rtl-dbr
6791 Dump after delayed branch scheduling.
6792
6793 @item -fdump-rtl-dce1
6794 @itemx -fdump-rtl-dce2
6795 @opindex fdump-rtl-dce1
6796 @opindex fdump-rtl-dce2
6797 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
6798 the two dead store elimination passes.
6799
6800 @item -fdump-rtl-eh
6801 @opindex fdump-rtl-eh
6802 Dump after finalization of EH handling code.
6803
6804 @item -fdump-rtl-eh_ranges
6805 @opindex fdump-rtl-eh_ranges
6806 Dump after conversion of EH handling range regions.
6807
6808 @item -fdump-rtl-expand
6809 @opindex fdump-rtl-expand
6810 Dump after RTL generation.
6811
6812 @item -fdump-rtl-fwprop1
6813 @itemx -fdump-rtl-fwprop2
6814 @opindex fdump-rtl-fwprop1
6815 @opindex fdump-rtl-fwprop2
6816 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
6817 dumping after the two forward propagation passes.
6818
6819 @item -fdump-rtl-gcse1
6820 @itemx -fdump-rtl-gcse2
6821 @opindex fdump-rtl-gcse1
6822 @opindex fdump-rtl-gcse2
6823 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
6824 after global common subexpression elimination.
6825
6826 @item -fdump-rtl-init-regs
6827 @opindex fdump-rtl-init-regs
6828 Dump after the initialization of the registers.
6829
6830 @item -fdump-rtl-initvals
6831 @opindex fdump-rtl-initvals
6832 Dump after the computation of the initial value sets.
6833
6834 @item -fdump-rtl-into_cfglayout
6835 @opindex fdump-rtl-into_cfglayout
6836 Dump after converting to cfglayout mode.
6837
6838 @item -fdump-rtl-ira
6839 @opindex fdump-rtl-ira
6840 Dump after iterated register allocation.
6841
6842 @item -fdump-rtl-jump
6843 @opindex fdump-rtl-jump
6844 Dump after the second jump optimization.
6845
6846 @item -fdump-rtl-loop2
6847 @opindex fdump-rtl-loop2
6848 @option{-fdump-rtl-loop2} enables dumping after the rtl
6849 loop optimization passes.
6850
6851 @item -fdump-rtl-mach
6852 @opindex fdump-rtl-mach
6853 Dump after performing the machine dependent reorganization pass, if that
6854 pass exists.
6855
6856 @item -fdump-rtl-mode_sw
6857 @opindex fdump-rtl-mode_sw
6858 Dump after removing redundant mode switches.
6859
6860 @item -fdump-rtl-rnreg
6861 @opindex fdump-rtl-rnreg
6862 Dump after register renumbering.
6863
6864 @item -fdump-rtl-outof_cfglayout
6865 @opindex fdump-rtl-outof_cfglayout
6866 Dump after converting from cfglayout mode.
6867
6868 @item -fdump-rtl-peephole2
6869 @opindex fdump-rtl-peephole2
6870 Dump after the peephole pass.
6871
6872 @item -fdump-rtl-postreload
6873 @opindex fdump-rtl-postreload
6874 Dump after post-reload optimizations.
6875
6876 @item -fdump-rtl-pro_and_epilogue
6877 @opindex fdump-rtl-pro_and_epilogue
6878 Dump after generating the function prologues and epilogues.
6879
6880 @item -fdump-rtl-sched1
6881 @itemx -fdump-rtl-sched2
6882 @opindex fdump-rtl-sched1
6883 @opindex fdump-rtl-sched2
6884 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
6885 after the basic block scheduling passes.
6886
6887 @item -fdump-rtl-ree
6888 @opindex fdump-rtl-ree
6889 Dump after sign/zero extension elimination.
6890
6891 @item -fdump-rtl-seqabstr
6892 @opindex fdump-rtl-seqabstr
6893 Dump after common sequence discovery.
6894
6895 @item -fdump-rtl-shorten
6896 @opindex fdump-rtl-shorten
6897 Dump after shortening branches.
6898
6899 @item -fdump-rtl-sibling
6900 @opindex fdump-rtl-sibling
6901 Dump after sibling call optimizations.
6902
6903 @item -fdump-rtl-split1
6904 @itemx -fdump-rtl-split2
6905 @itemx -fdump-rtl-split3
6906 @itemx -fdump-rtl-split4
6907 @itemx -fdump-rtl-split5
6908 @opindex fdump-rtl-split1
6909 @opindex fdump-rtl-split2
6910 @opindex fdump-rtl-split3
6911 @opindex fdump-rtl-split4
6912 @opindex fdump-rtl-split5
6913 These options enable dumping after five rounds of
6914 instruction splitting.
6915
6916 @item -fdump-rtl-sms
6917 @opindex fdump-rtl-sms
6918 Dump after modulo scheduling.  This pass is only run on some
6919 architectures.
6920
6921 @item -fdump-rtl-stack
6922 @opindex fdump-rtl-stack
6923 Dump after conversion from GCC's ``flat register file'' registers to the
6924 x87's stack-like registers.  This pass is only run on x86 variants.
6925
6926 @item -fdump-rtl-subreg1
6927 @itemx -fdump-rtl-subreg2
6928 @opindex fdump-rtl-subreg1
6929 @opindex fdump-rtl-subreg2
6930 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
6931 the two subreg expansion passes.
6932
6933 @item -fdump-rtl-unshare
6934 @opindex fdump-rtl-unshare
6935 Dump after all rtl has been unshared.
6936
6937 @item -fdump-rtl-vartrack
6938 @opindex fdump-rtl-vartrack
6939 Dump after variable tracking.
6940
6941 @item -fdump-rtl-vregs
6942 @opindex fdump-rtl-vregs
6943 Dump after converting virtual registers to hard registers.
6944
6945 @item -fdump-rtl-web
6946 @opindex fdump-rtl-web
6947 Dump after live range splitting.
6948
6949 @item -fdump-rtl-regclass
6950 @itemx -fdump-rtl-subregs_of_mode_init
6951 @itemx -fdump-rtl-subregs_of_mode_finish
6952 @itemx -fdump-rtl-dfinit
6953 @itemx -fdump-rtl-dfinish
6954 @opindex fdump-rtl-regclass
6955 @opindex fdump-rtl-subregs_of_mode_init
6956 @opindex fdump-rtl-subregs_of_mode_finish
6957 @opindex fdump-rtl-dfinit
6958 @opindex fdump-rtl-dfinish
6959 These dumps are defined but always produce empty files.
6960
6961 @item -da
6962 @itemx -fdump-rtl-all
6963 @opindex da
6964 @opindex fdump-rtl-all
6965 Produce all the dumps listed above.
6966
6967 @item -dA
6968 @opindex dA
6969 Annotate the assembler output with miscellaneous debugging information.
6970
6971 @item -dD
6972 @opindex dD
6973 Dump all macro definitions, at the end of preprocessing, in addition to
6974 normal output.
6975
6976 @item -dH
6977 @opindex dH
6978 Produce a core dump whenever an error occurs.
6979
6980 @item -dp
6981 @opindex dp
6982 Annotate the assembler output with a comment indicating which
6983 pattern and alternative is used.  The length of each instruction is
6984 also printed.
6985
6986 @item -dP
6987 @opindex dP
6988 Dump the RTL in the assembler output as a comment before each instruction.
6989 Also turns on @option{-dp} annotation.
6990
6991 @item -dx
6992 @opindex dx
6993 Just generate RTL for a function instead of compiling it.  Usually used
6994 with @option{-fdump-rtl-expand}.
6995 @end table
6996
6997 @item -fdump-noaddr
6998 @opindex fdump-noaddr
6999 When doing debugging dumps, suppress address output.  This makes it more
7000 feasible to use diff on debugging dumps for compiler invocations with
7001 different compiler binaries and/or different
7002 text / bss / data / heap / stack / dso start locations.
7003
7004 @item -freport-bug
7005 @opindex freport-bug
7006 Collect and dump debug information into temporary file if ICE in C/C++
7007 compiler occured.
7008
7009 @item -fdump-unnumbered
7010 @opindex fdump-unnumbered
7011 When doing debugging dumps, suppress instruction numbers and address output.
7012 This makes it more feasible to use diff on debugging dumps for compiler
7013 invocations with different options, in particular with and without
7014 @option{-g}.
7015
7016 @item -fdump-unnumbered-links
7017 @opindex fdump-unnumbered-links
7018 When doing debugging dumps (see @option{-d} option above), suppress
7019 instruction numbers for the links to the previous and next instructions
7020 in a sequence.
7021
7022 @item -fdump-translation-unit @r{(C++ only)}
7023 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
7024 @opindex fdump-translation-unit
7025 Dump a representation of the tree structure for the entire translation
7026 unit to a file.  The file name is made by appending @file{.tu} to the
7027 source file name, and the file is created in the same directory as the
7028 output file.  If the @samp{-@var{options}} form is used, @var{options}
7029 controls the details of the dump as described for the
7030 @option{-fdump-tree} options.
7031
7032 @item -fdump-class-hierarchy @r{(C++ only)}
7033 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
7034 @opindex fdump-class-hierarchy
7035 Dump a representation of each class's hierarchy and virtual function
7036 table layout to a file.  The file name is made by appending
7037 @file{.class} to the source file name, and the file is created in the
7038 same directory as the output file.  If the @samp{-@var{options}} form
7039 is used, @var{options} controls the details of the dump as described
7040 for the @option{-fdump-tree} options.
7041
7042 @item -fdump-ipa-@var{switch}
7043 @opindex fdump-ipa
7044 Control the dumping at various stages of inter-procedural analysis
7045 language tree to a file.  The file name is generated by appending a
7046 switch specific suffix to the source file name, and the file is created
7047 in the same directory as the output file.  The following dumps are
7048 possible:
7049
7050 @table @samp
7051 @item all
7052 Enables all inter-procedural analysis dumps.
7053
7054 @item cgraph
7055 Dumps information about call-graph optimization, unused function removal,
7056 and inlining decisions.
7057
7058 @item inline
7059 Dump after function inlining.
7060
7061 @end table
7062
7063 @item -fdump-passes
7064 @opindex fdump-passes
7065 Dump the list of optimization passes that are turned on and off by
7066 the current command-line options.
7067
7068 @item -fdump-statistics-@var{option}
7069 @opindex fdump-statistics
7070 Enable and control dumping of pass statistics in a separate file.  The
7071 file name is generated by appending a suffix ending in
7072 @samp{.statistics} to the source file name, and the file is created in
7073 the same directory as the output file.  If the @samp{-@var{option}}
7074 form is used, @samp{-stats} causes counters to be summed over the
7075 whole compilation unit while @samp{-details} dumps every event as
7076 the passes generate them.  The default with no option is to sum
7077 counters for each function compiled.
7078
7079 @item -fdump-tree-@var{switch}
7080 @itemx -fdump-tree-@var{switch}-@var{options}
7081 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
7082 @opindex fdump-tree
7083 Control the dumping at various stages of processing the intermediate
7084 language tree to a file.  The file name is generated by appending a
7085 switch-specific suffix to the source file name, and the file is
7086 created in the same directory as the output file. In case of
7087 @option{=@var{filename}} option, the dump is output on the given file
7088 instead of the auto named dump files.  If the @samp{-@var{options}}
7089 form is used, @var{options} is a list of @samp{-} separated options
7090 which control the details of the dump.  Not all options are applicable
7091 to all dumps; those that are not meaningful are ignored.  The
7092 following options are available
7093
7094 @table @samp
7095 @item address
7096 Print the address of each node.  Usually this is not meaningful as it
7097 changes according to the environment and source file.  Its primary use
7098 is for tying up a dump file with a debug environment.
7099 @item asmname
7100 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
7101 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
7102 use working backward from mangled names in the assembly file.
7103 @item slim
7104 When dumping front-end intermediate representations, inhibit dumping
7105 of members of a scope or body of a function merely because that scope
7106 has been reached.  Only dump such items when they are directly reachable
7107 by some other path.
7108
7109 When dumping pretty-printed trees, this option inhibits dumping the
7110 bodies of control structures.
7111
7112 When dumping RTL, print the RTL in slim (condensed) form instead of
7113 the default LISP-like representation.
7114 @item raw
7115 Print a raw representation of the tree.  By default, trees are
7116 pretty-printed into a C-like representation.
7117 @item details
7118 Enable more detailed dumps (not honored by every dump option). Also
7119 include information from the optimization passes.
7120 @item stats
7121 Enable dumping various statistics about the pass (not honored by every dump
7122 option).
7123 @item blocks
7124 Enable showing basic block boundaries (disabled in raw dumps).
7125 @item graph
7126 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
7127 dump a representation of the control flow graph suitable for viewing with
7128 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
7129 the file is pretty-printed as a subgraph, so that GraphViz can render them
7130 all in a single plot.
7131
7132 This option currently only works for RTL dumps, and the RTL is always
7133 dumped in slim form.
7134 @item vops
7135 Enable showing virtual operands for every statement.
7136 @item lineno
7137 Enable showing line numbers for statements.
7138 @item uid
7139 Enable showing the unique ID (@code{DECL_UID}) for each variable.
7140 @item verbose
7141 Enable showing the tree dump for each statement.
7142 @item eh
7143 Enable showing the EH region number holding each statement.
7144 @item scev
7145 Enable showing scalar evolution analysis details.
7146 @item optimized
7147 Enable showing optimization information (only available in certain
7148 passes).
7149 @item missed
7150 Enable showing missed optimization information (only available in certain
7151 passes).
7152 @item note
7153 Enable other detailed optimization information (only available in
7154 certain passes).
7155 @item =@var{filename}
7156 Instead of an auto named dump file, output into the given file
7157 name. The file names @file{stdout} and @file{stderr} are treated
7158 specially and are considered already open standard streams. For
7159 example,
7160
7161 @smallexample
7162 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
7163      -fdump-tree-pre=stderr file.c
7164 @end smallexample
7165
7166 outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
7167 output on to @file{stderr}. If two conflicting dump filenames are
7168 given for the same pass, then the latter option overrides the earlier
7169 one.
7170
7171 @item all
7172 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
7173 and @option{lineno}.
7174
7175 @item optall
7176 Turn on all optimization options, i.e., @option{optimized},
7177 @option{missed}, and @option{note}.
7178 @end table
7179
7180 The following tree dumps are possible:
7181 @table @samp
7182
7183 @item original
7184 @opindex fdump-tree-original
7185 Dump before any tree based optimization, to @file{@var{file}.original}.
7186
7187 @item optimized
7188 @opindex fdump-tree-optimized
7189 Dump after all tree based optimization, to @file{@var{file}.optimized}.
7190
7191 @item gimple
7192 @opindex fdump-tree-gimple
7193 Dump each function before and after the gimplification pass to a file.  The
7194 file name is made by appending @file{.gimple} to the source file name.
7195
7196 @item cfg
7197 @opindex fdump-tree-cfg
7198 Dump the control flow graph of each function to a file.  The file name is
7199 made by appending @file{.cfg} to the source file name.
7200
7201 @item ch
7202 @opindex fdump-tree-ch
7203 Dump each function after copying loop headers.  The file name is made by
7204 appending @file{.ch} to the source file name.
7205
7206 @item ssa
7207 @opindex fdump-tree-ssa
7208 Dump SSA related information to a file.  The file name is made by appending
7209 @file{.ssa} to the source file name.
7210
7211 @item alias
7212 @opindex fdump-tree-alias
7213 Dump aliasing information for each function.  The file name is made by
7214 appending @file{.alias} to the source file name.
7215
7216 @item ccp
7217 @opindex fdump-tree-ccp
7218 Dump each function after CCP@.  The file name is made by appending
7219 @file{.ccp} to the source file name.
7220
7221 @item storeccp
7222 @opindex fdump-tree-storeccp
7223 Dump each function after STORE-CCP@.  The file name is made by appending
7224 @file{.storeccp} to the source file name.
7225
7226 @item pre
7227 @opindex fdump-tree-pre
7228 Dump trees after partial redundancy elimination.  The file name is made
7229 by appending @file{.pre} to the source file name.
7230
7231 @item fre
7232 @opindex fdump-tree-fre
7233 Dump trees after full redundancy elimination.  The file name is made
7234 by appending @file{.fre} to the source file name.
7235
7236 @item copyprop
7237 @opindex fdump-tree-copyprop
7238 Dump trees after copy propagation.  The file name is made
7239 by appending @file{.copyprop} to the source file name.
7240
7241 @item store_copyprop
7242 @opindex fdump-tree-store_copyprop
7243 Dump trees after store copy-propagation.  The file name is made
7244 by appending @file{.store_copyprop} to the source file name.
7245
7246 @item dce
7247 @opindex fdump-tree-dce
7248 Dump each function after dead code elimination.  The file name is made by
7249 appending @file{.dce} to the source file name.
7250
7251 @item sra
7252 @opindex fdump-tree-sra
7253 Dump each function after performing scalar replacement of aggregates.  The
7254 file name is made by appending @file{.sra} to the source file name.
7255
7256 @item sink
7257 @opindex fdump-tree-sink
7258 Dump each function after performing code sinking.  The file name is made
7259 by appending @file{.sink} to the source file name.
7260
7261 @item dom
7262 @opindex fdump-tree-dom
7263 Dump each function after applying dominator tree optimizations.  The file
7264 name is made by appending @file{.dom} to the source file name.
7265
7266 @item dse
7267 @opindex fdump-tree-dse
7268 Dump each function after applying dead store elimination.  The file
7269 name is made by appending @file{.dse} to the source file name.
7270
7271 @item phiopt
7272 @opindex fdump-tree-phiopt
7273 Dump each function after optimizing PHI nodes into straightline code.  The file
7274 name is made by appending @file{.phiopt} to the source file name.
7275
7276 @item backprop
7277 @opindex fdump-tree-backprop
7278 Dump each function after back-propagating use information up the definition
7279 chain.  The file name is made by appending @file{.backprop} to the
7280 source file name.
7281
7282 @item forwprop
7283 @opindex fdump-tree-forwprop
7284 Dump each function after forward propagating single use variables.  The file
7285 name is made by appending @file{.forwprop} to the source file name.
7286
7287 @item nrv
7288 @opindex fdump-tree-nrv
7289 Dump each function after applying the named return value optimization on
7290 generic trees.  The file name is made by appending @file{.nrv} to the source
7291 file name.
7292
7293 @item vect
7294 @opindex fdump-tree-vect
7295 Dump each function after applying vectorization of loops.  The file name is
7296 made by appending @file{.vect} to the source file name.
7297
7298 @item slp
7299 @opindex fdump-tree-slp
7300 Dump each function after applying vectorization of basic blocks.  The file name
7301 is made by appending @file{.slp} to the source file name.
7302
7303 @item vrp
7304 @opindex fdump-tree-vrp
7305 Dump each function after Value Range Propagation (VRP).  The file name
7306 is made by appending @file{.vrp} to the source file name.
7307
7308 @item oaccdevlow
7309 @opindex fdump-tree-oaccdevlow
7310 Dump each function after applying device-specific OpenACC transformations.
7311 The file name is made by appending @file{.oaccdevlow} to the source file name.
7312
7313 @item all
7314 @opindex fdump-tree-all
7315 Enable all the available tree dumps with the flags provided in this option.
7316 @end table
7317
7318 @item -fopt-info
7319 @itemx -fopt-info-@var{options}
7320 @itemx -fopt-info-@var{options}=@var{filename}
7321 @opindex fopt-info
7322 Controls optimization dumps from various optimization passes. If the
7323 @samp{-@var{options}} form is used, @var{options} is a list of
7324 @samp{-} separated option keywords to select the dump details and
7325 optimizations.  
7326
7327 The @var{options} can be divided into two groups: options describing the
7328 verbosity of the dump, and options describing which optimizations
7329 should be included. The options from both the groups can be freely
7330 mixed as they are non-overlapping. However, in case of any conflicts,
7331 the later options override the earlier options on the command
7332 line. 
7333
7334 The following options control the dump verbosity:
7335
7336 @table @samp
7337 @item optimized
7338 Print information when an optimization is successfully applied. It is
7339 up to a pass to decide which information is relevant. For example, the
7340 vectorizer passes print the source location of loops which are
7341 successfully vectorized.
7342 @item missed
7343 Print information about missed optimizations. Individual passes
7344 control which information to include in the output. 
7345 @item note
7346 Print verbose information about optimizations, such as certain
7347 transformations, more detailed messages about decisions etc.
7348 @item all
7349 Print detailed optimization information. This includes
7350 @samp{optimized}, @samp{missed}, and @samp{note}.
7351 @end table
7352
7353 One or more of the following option keywords can be used to describe a
7354 group of optimizations:
7355
7356 @table @samp
7357 @item ipa
7358 Enable dumps from all interprocedural optimizations.
7359 @item loop
7360 Enable dumps from all loop optimizations.
7361 @item inline
7362 Enable dumps from all inlining optimizations.
7363 @item vec
7364 Enable dumps from all vectorization optimizations.
7365 @item optall
7366 Enable dumps from all optimizations. This is a superset of
7367 the optimization groups listed above.
7368 @end table
7369
7370 If @var{options} is
7371 omitted, it defaults to @samp{optimized-optall}, which means to dump all
7372 info about successful optimizations from all the passes.  
7373
7374 If the @var{filename} is provided, then the dumps from all the
7375 applicable optimizations are concatenated into the @var{filename}.
7376 Otherwise the dump is output onto @file{stderr}. Though multiple
7377 @option{-fopt-info} options are accepted, only one of them can include
7378 a @var{filename}. If other filenames are provided then all but the
7379 first such option are ignored.
7380
7381 Note that the output @var{filename} is overwritten
7382 in case of multiple translation units. If a combined output from
7383 multiple translation units is desired, @file{stderr} should be used
7384 instead.
7385
7386 In the following example, the optimization info is output to
7387 @file{stderr}:
7388
7389 @smallexample
7390 gcc -O3 -fopt-info
7391 @end smallexample
7392
7393 This example:
7394 @smallexample
7395 gcc -O3 -fopt-info-missed=missed.all
7396 @end smallexample
7397
7398 @noindent
7399 outputs missed optimization report from all the passes into
7400 @file{missed.all}, and this one:
7401
7402 @smallexample
7403 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
7404 @end smallexample
7405
7406 @noindent
7407 prints information about missed optimization opportunities from
7408 vectorization passes on @file{stderr}.  
7409 Note that @option{-fopt-info-vec-missed} is equivalent to 
7410 @option{-fopt-info-missed-vec}.
7411
7412 As another example,
7413 @smallexample
7414 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
7415 @end smallexample
7416
7417 @noindent
7418 outputs information about missed optimizations as well as
7419 optimized locations from all the inlining passes into
7420 @file{inline.txt}.
7421
7422 Finally, consider:
7423
7424 @smallexample
7425 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
7426 @end smallexample
7427
7428 @noindent
7429 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
7430 in conflict since only one output file is allowed. In this case, only
7431 the first option takes effect and the subsequent options are
7432 ignored. Thus only @file{vec.miss} is produced which contains
7433 dumps from the vectorizer about missed opportunities.
7434
7435 @item -frandom-seed=@var{number}
7436 @opindex frandom-seed
7437 This option provides a seed that GCC uses in place of
7438 random numbers in generating certain symbol names
7439 that have to be different in every compiled file.  It is also used to
7440 place unique stamps in coverage data files and the object files that
7441 produce them.  You can use the @option{-frandom-seed} option to produce
7442 reproducibly identical object files.
7443
7444 The @var{number} should be different for every file you compile.
7445
7446 @item -fsched-verbose=@var{n}
7447 @opindex fsched-verbose
7448 On targets that use instruction scheduling, this option controls the
7449 amount of debugging output the scheduler prints.  This information is
7450 written to standard error, unless @option{-fdump-rtl-sched1} or
7451 @option{-fdump-rtl-sched2} is specified, in which case it is output
7452 to the usual dump listing file, @file{.sched1} or @file{.sched2}
7453 respectively.  However for @var{n} greater than nine, the output is
7454 always printed to standard error.
7455
7456 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
7457 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
7458 For @var{n} greater than one, it also output basic block probabilities,
7459 detailed ready list information and unit/insn info.  For @var{n} greater
7460 than two, it includes RTL at abort point, control-flow and regions info.
7461 And for @var{n} over four, @option{-fsched-verbose} also includes
7462 dependence info.
7463
7464 @item -save-temps
7465 @itemx -save-temps=cwd
7466 @opindex save-temps
7467 Store the usual ``temporary'' intermediate files permanently; place them
7468 in the current directory and name them based on the source file.  Thus,
7469 compiling @file{foo.c} with @option{-c -save-temps} produces files
7470 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
7471 preprocessed @file{foo.i} output file even though the compiler now
7472 normally uses an integrated preprocessor.
7473
7474 When used in combination with the @option{-x} command-line option,
7475 @option{-save-temps} is sensible enough to avoid over writing an
7476 input source file with the same extension as an intermediate file.
7477 The corresponding intermediate file may be obtained by renaming the
7478 source file before using @option{-save-temps}.
7479
7480 If you invoke GCC in parallel, compiling several different source
7481 files that share a common base name in different subdirectories or the
7482 same source file compiled for multiple output destinations, it is
7483 likely that the different parallel compilers will interfere with each
7484 other, and overwrite the temporary files.  For instance:
7485
7486 @smallexample
7487 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
7488 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
7489 @end smallexample
7490
7491 may result in @file{foo.i} and @file{foo.o} being written to
7492 simultaneously by both compilers.
7493
7494 @item -save-temps=obj
7495 @opindex save-temps=obj
7496 Store the usual ``temporary'' intermediate files permanently.  If the
7497 @option{-o} option is used, the temporary files are based on the
7498 object file.  If the @option{-o} option is not used, the
7499 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
7500
7501 For example:
7502
7503 @smallexample
7504 gcc -save-temps=obj -c foo.c
7505 gcc -save-temps=obj -c bar.c -o dir/xbar.o
7506 gcc -save-temps=obj foobar.c -o dir2/yfoobar
7507 @end smallexample
7508
7509 @noindent
7510 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
7511 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
7512 @file{dir2/yfoobar.o}.
7513
7514 @item -time@r{[}=@var{file}@r{]}
7515 @opindex time
7516 Report the CPU time taken by each subprocess in the compilation
7517 sequence.  For C source files, this is the compiler proper and assembler
7518 (plus the linker if linking is done).
7519
7520 Without the specification of an output file, the output looks like this:
7521
7522 @smallexample
7523 # cc1 0.12 0.01
7524 # as 0.00 0.01
7525 @end smallexample
7526
7527 The first number on each line is the ``user time'', that is time spent
7528 executing the program itself.  The second number is ``system time'',
7529 time spent executing operating system routines on behalf of the program.
7530 Both numbers are in seconds.
7531
7532 With the specification of an output file, the output is appended to the
7533 named file, and it looks like this:
7534
7535 @smallexample
7536 0.12 0.01 cc1 @var{options}
7537 0.00 0.01 as @var{options}
7538 @end smallexample
7539
7540 The ``user time'' and the ``system time'' are moved before the program
7541 name, and the options passed to the program are displayed, so that one
7542 can later tell what file was being compiled, and with which options.
7543
7544 @item -fvar-tracking
7545 @opindex fvar-tracking
7546 Run variable tracking pass.  It computes where variables are stored at each
7547 position in code.  Better debugging information is then generated
7548 (if the debugging information format supports this information).
7549
7550 It is enabled by default when compiling with optimization (@option{-Os},
7551 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
7552 the debug info format supports it.
7553
7554 @item -fvar-tracking-assignments
7555 @opindex fvar-tracking-assignments
7556 @opindex fno-var-tracking-assignments
7557 Annotate assignments to user variables early in the compilation and
7558 attempt to carry the annotations over throughout the compilation all the
7559 way to the end, in an attempt to improve debug information while
7560 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
7561
7562 It can be enabled even if var-tracking is disabled, in which case
7563 annotations are created and maintained, but discarded at the end.
7564 By default, this flag is enabled together with @option{-fvar-tracking},
7565 except when selective scheduling is enabled.
7566
7567 @item -fvar-tracking-assignments-toggle
7568 @opindex fvar-tracking-assignments-toggle
7569 @opindex fno-var-tracking-assignments-toggle
7570 Toggle @option{-fvar-tracking-assignments}, in the same way that
7571 @option{-gtoggle} toggles @option{-g}.
7572
7573 @item -print-file-name=@var{library}
7574 @opindex print-file-name
7575 Print the full absolute name of the library file @var{library} that
7576 would be used when linking---and don't do anything else.  With this
7577 option, GCC does not compile or link anything; it just prints the
7578 file name.
7579
7580 @item -print-multi-directory
7581 @opindex print-multi-directory
7582 Print the directory name corresponding to the multilib selected by any
7583 other switches present in the command line.  This directory is supposed
7584 to exist in @env{GCC_EXEC_PREFIX}.
7585
7586 @item -print-multi-lib
7587 @opindex print-multi-lib
7588 Print the mapping from multilib directory names to compiler switches
7589 that enable them.  The directory name is separated from the switches by
7590 @samp{;}, and each switch starts with an @samp{@@} instead of the
7591 @samp{-}, without spaces between multiple switches.  This is supposed to
7592 ease shell processing.
7593
7594 @item -print-multi-os-directory
7595 @opindex print-multi-os-directory
7596 Print the path to OS libraries for the selected
7597 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
7598 present in the @file{lib} subdirectory and no multilibs are used, this is
7599 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
7600 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
7601 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
7602 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
7603
7604 @item -print-multiarch
7605 @opindex print-multiarch
7606 Print the path to OS libraries for the selected multiarch,
7607 relative to some @file{lib} subdirectory.
7608
7609 @item -print-prog-name=@var{program}
7610 @opindex print-prog-name
7611 Like @option{-print-file-name}, but searches for a program such as @command{cpp}.
7612
7613 @item -print-libgcc-file-name
7614 @opindex print-libgcc-file-name
7615 Same as @option{-print-file-name=libgcc.a}.
7616
7617 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
7618 but you do want to link with @file{libgcc.a}.  You can do:
7619
7620 @smallexample
7621 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
7622 @end smallexample
7623
7624 @item -print-search-dirs
7625 @opindex print-search-dirs
7626 Print the name of the configured installation directory and a list of
7627 program and library directories @command{gcc} searches---and don't do anything else.
7628
7629 This is useful when @command{gcc} prints the error message
7630 @samp{installation problem, cannot exec cpp0: No such file or directory}.
7631 To resolve this you either need to put @file{cpp0} and the other compiler
7632 components where @command{gcc} expects to find them, or you can set the environment
7633 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
7634 Don't forget the trailing @samp{/}.
7635 @xref{Environment Variables}.
7636
7637 @item -print-sysroot
7638 @opindex print-sysroot
7639 Print the target sysroot directory that is used during
7640 compilation.  This is the target sysroot specified either at configure
7641 time or using the @option{--sysroot} option, possibly with an extra
7642 suffix that depends on compilation options.  If no target sysroot is
7643 specified, the option prints nothing.
7644
7645 @item -print-sysroot-headers-suffix
7646 @opindex print-sysroot-headers-suffix
7647 Print the suffix added to the target sysroot when searching for
7648 headers, or give an error if the compiler is not configured with such
7649 a suffix---and don't do anything else.
7650
7651 @item -dumpmachine
7652 @opindex dumpmachine
7653 Print the compiler's target machine (for example,
7654 @samp{i686-pc-linux-gnu})---and don't do anything else.
7655
7656 @item -dumpversion
7657 @opindex dumpversion
7658 Print the compiler version (for example, @code{3.0})---and don't do
7659 anything else.
7660
7661 @item -dumpspecs
7662 @opindex dumpspecs
7663 Print the compiler's built-in specs---and don't do anything else.  (This
7664 is used when GCC itself is being built.)  @xref{Spec Files}.
7665
7666 @item -fno-eliminate-unused-debug-types
7667 @opindex feliminate-unused-debug-types
7668 @opindex fno-eliminate-unused-debug-types
7669 Normally, when producing DWARF 2 output, GCC avoids producing debug symbol 
7670 output for types that are nowhere used in the source file being compiled.
7671 Sometimes it is useful to have GCC emit debugging
7672 information for all types declared in a compilation
7673 unit, regardless of whether or not they are actually used
7674 in that compilation unit, for example 
7675 if, in the debugger, you want to cast a value to a type that is
7676 not actually used in your program (but is declared).  More often,
7677 however, this results in a significant amount of wasted space.
7678 @end table
7679
7680 @node Optimize Options
7681 @section Options That Control Optimization
7682 @cindex optimize options
7683 @cindex options, optimization
7684
7685 These options control various sorts of optimizations.
7686
7687 Without any optimization option, the compiler's goal is to reduce the
7688 cost of compilation and to make debugging produce the expected
7689 results.  Statements are independent: if you stop the program with a
7690 breakpoint between statements, you can then assign a new value to any
7691 variable or change the program counter to any other statement in the
7692 function and get exactly the results you expect from the source
7693 code.
7694
7695 Turning on optimization flags makes the compiler attempt to improve
7696 the performance and/or code size at the expense of compilation time
7697 and possibly the ability to debug the program.
7698
7699 The compiler performs optimization based on the knowledge it has of the
7700 program.  Compiling multiple files at once to a single output file mode allows
7701 the compiler to use information gained from all of the files when compiling
7702 each of them.
7703
7704 Not all optimizations are controlled directly by a flag.  Only
7705 optimizations that have a flag are listed in this section.
7706
7707 Most optimizations are only enabled if an @option{-O} level is set on
7708 the command line.  Otherwise they are disabled, even if individual
7709 optimization flags are specified.
7710
7711 Depending on the target and how GCC was configured, a slightly different
7712 set of optimizations may be enabled at each @option{-O} level than
7713 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
7714 to find out the exact set of optimizations that are enabled at each level.
7715 @xref{Overall Options}, for examples.
7716
7717 @table @gcctabopt
7718 @item -O
7719 @itemx -O1
7720 @opindex O
7721 @opindex O1
7722 Optimize.  Optimizing compilation takes somewhat more time, and a lot
7723 more memory for a large function.
7724
7725 With @option{-O}, the compiler tries to reduce code size and execution
7726 time, without performing any optimizations that take a great deal of
7727 compilation time.
7728
7729 @option{-O} turns on the following optimization flags:
7730 @gccoptlist{
7731 -fauto-inc-dec @gol
7732 -fbranch-count-reg @gol
7733 -fcombine-stack-adjustments @gol
7734 -fcompare-elim @gol
7735 -fcprop-registers @gol
7736 -fdce @gol
7737 -fdefer-pop @gol
7738 -fdelayed-branch @gol
7739 -fdse @gol
7740 -fforward-propagate @gol
7741 -fguess-branch-probability @gol
7742 -fif-conversion2 @gol
7743 -fif-conversion @gol
7744 -finline-functions-called-once @gol
7745 -fipa-pure-const @gol
7746 -fipa-profile @gol
7747 -fipa-reference @gol
7748 -fmerge-constants @gol
7749 -fmove-loop-invariants @gol
7750 -freorder-blocks @gol
7751 -fshrink-wrap @gol
7752 -fsplit-wide-types @gol
7753 -fssa-backprop @gol
7754 -fssa-phiopt @gol
7755 -ftree-bit-ccp @gol
7756 -ftree-ccp @gol
7757 -ftree-ch @gol
7758 -ftree-coalesce-vars @gol
7759 -ftree-copy-prop @gol
7760 -ftree-dce @gol
7761 -ftree-dominator-opts @gol
7762 -ftree-dse @gol
7763 -ftree-forwprop @gol
7764 -ftree-fre @gol
7765 -ftree-phiprop @gol
7766 -ftree-sink @gol
7767 -ftree-slsr @gol
7768 -ftree-sra @gol
7769 -ftree-pta @gol
7770 -ftree-ter @gol
7771 -funit-at-a-time}
7772
7773 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
7774 where doing so does not interfere with debugging.
7775
7776 @item -O2
7777 @opindex O2
7778 Optimize even more.  GCC performs nearly all supported optimizations
7779 that do not involve a space-speed tradeoff.
7780 As compared to @option{-O}, this option increases both compilation time
7781 and the performance of the generated code.
7782
7783 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
7784 also turns on the following optimization flags:
7785 @gccoptlist{-fthread-jumps @gol
7786 -falign-functions  -falign-jumps @gol
7787 -falign-loops  -falign-labels @gol
7788 -fcaller-saves @gol
7789 -fcrossjumping @gol
7790 -fcse-follow-jumps  -fcse-skip-blocks @gol
7791 -fdelete-null-pointer-checks @gol
7792 -fdevirtualize -fdevirtualize-speculatively @gol
7793 -fexpensive-optimizations @gol
7794 -fgcse  -fgcse-lm  @gol
7795 -fhoist-adjacent-loads @gol
7796 -finline-small-functions @gol
7797 -findirect-inlining @gol
7798 -fipa-cp @gol
7799 -fipa-cp-alignment @gol
7800 -fipa-sra @gol
7801 -fipa-icf @gol
7802 -fisolate-erroneous-paths-dereference @gol
7803 -flra-remat @gol
7804 -foptimize-sibling-calls @gol
7805 -foptimize-strlen @gol
7806 -fpartial-inlining @gol
7807 -fpeephole2 @gol
7808 -freorder-blocks-algorithm=stc @gol
7809 -freorder-blocks-and-partition -freorder-functions @gol
7810 -frerun-cse-after-loop  @gol
7811 -fsched-interblock  -fsched-spec @gol
7812 -fschedule-insns  -fschedule-insns2 @gol
7813 -fstrict-aliasing -fstrict-overflow @gol
7814 -ftree-builtin-call-dce @gol
7815 -ftree-switch-conversion -ftree-tail-merge @gol
7816 -ftree-pre @gol
7817 -ftree-vrp @gol
7818 -fipa-ra}
7819
7820 Please note the warning under @option{-fgcse} about
7821 invoking @option{-O2} on programs that use computed gotos.
7822
7823 @item -O3
7824 @opindex O3
7825 Optimize yet more.  @option{-O3} turns on all optimizations specified
7826 by @option{-O2} and also turns on the @option{-finline-functions},
7827 @option{-funswitch-loops}, @option{-fpredictive-commoning},
7828 @option{-fgcse-after-reload}, @option{-ftree-loop-vectorize},
7829 @option{-ftree-loop-distribute-patterns},
7830 @option{-ftree-slp-vectorize}, @option{-fvect-cost-model},
7831 @option{-ftree-partial-pre} and @option{-fipa-cp-clone} options.
7832
7833 @item -O0
7834 @opindex O0
7835 Reduce compilation time and make debugging produce the expected
7836 results.  This is the default.
7837
7838 @item -Os
7839 @opindex Os
7840 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
7841 do not typically increase code size.  It also performs further
7842 optimizations designed to reduce code size.
7843
7844 @option{-Os} disables the following optimization flags:
7845 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
7846 -falign-labels  -freorder-blocks  -freorder-blocks-algorithm=stc @gol
7847 -freorder-blocks-and-partition  -fprefetch-loop-arrays}
7848
7849 @item -Ofast
7850 @opindex Ofast
7851 Disregard strict standards compliance.  @option{-Ofast} enables all
7852 @option{-O3} optimizations.  It also enables optimizations that are not
7853 valid for all standard-compliant programs.
7854 It turns on @option{-ffast-math} and the Fortran-specific
7855 @option{-fno-protect-parens} and @option{-fstack-arrays}.
7856
7857 @item -Og
7858 @opindex Og
7859 Optimize debugging experience.  @option{-Og} enables optimizations
7860 that do not interfere with debugging. It should be the optimization
7861 level of choice for the standard edit-compile-debug cycle, offering
7862 a reasonable level of optimization while maintaining fast compilation
7863 and a good debugging experience.
7864
7865 If you use multiple @option{-O} options, with or without level numbers,
7866 the last such option is the one that is effective.
7867 @end table
7868
7869 Options of the form @option{-f@var{flag}} specify machine-independent
7870 flags.  Most flags have both positive and negative forms; the negative
7871 form of @option{-ffoo} is @option{-fno-foo}.  In the table
7872 below, only one of the forms is listed---the one you typically 
7873 use.  You can figure out the other form by either removing @samp{no-}
7874 or adding it.
7875
7876 The following options control specific optimizations.  They are either
7877 activated by @option{-O} options or are related to ones that are.  You
7878 can use the following flags in the rare cases when ``fine-tuning'' of
7879 optimizations to be performed is desired.
7880
7881 @table @gcctabopt
7882 @item -fno-defer-pop
7883 @opindex fno-defer-pop
7884 Always pop the arguments to each function call as soon as that function
7885 returns.  For machines that must pop arguments after a function call,
7886 the compiler normally lets arguments accumulate on the stack for several
7887 function calls and pops them all at once.
7888
7889 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7890
7891 @item -fforward-propagate
7892 @opindex fforward-propagate
7893 Perform a forward propagation pass on RTL@.  The pass tries to combine two
7894 instructions and checks if the result can be simplified.  If loop unrolling
7895 is active, two passes are performed and the second is scheduled after
7896 loop unrolling.
7897
7898 This option is enabled by default at optimization levels @option{-O},
7899 @option{-O2}, @option{-O3}, @option{-Os}.
7900
7901 @item -ffp-contract=@var{style}
7902 @opindex ffp-contract
7903 @option{-ffp-contract=off} disables floating-point expression contraction.
7904 @option{-ffp-contract=fast} enables floating-point expression contraction
7905 such as forming of fused multiply-add operations if the target has
7906 native support for them.
7907 @option{-ffp-contract=on} enables floating-point expression contraction
7908 if allowed by the language standard.  This is currently not implemented
7909 and treated equal to @option{-ffp-contract=off}.
7910
7911 The default is @option{-ffp-contract=fast}.
7912
7913 @item -fomit-frame-pointer
7914 @opindex fomit-frame-pointer
7915 Don't keep the frame pointer in a register for functions that
7916 don't need one.  This avoids the instructions to save, set up and
7917 restore frame pointers; it also makes an extra register available
7918 in many functions.  @strong{It also makes debugging impossible on
7919 some machines.}
7920
7921 On some machines, such as the VAX, this flag has no effect, because
7922 the standard calling sequence automatically handles the frame pointer
7923 and nothing is saved by pretending it doesn't exist.  The
7924 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
7925 whether a target machine supports this flag.  @xref{Registers,,Register
7926 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
7927
7928 The default setting (when not optimizing for
7929 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets is
7930 @option{-fomit-frame-pointer}.  You can configure GCC with the
7931 @option{--enable-frame-pointer} configure option to change the default.
7932
7933 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7934
7935 @item -foptimize-sibling-calls
7936 @opindex foptimize-sibling-calls
7937 Optimize sibling and tail recursive calls.
7938
7939 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7940
7941 @item -foptimize-strlen
7942 @opindex foptimize-strlen
7943 Optimize various standard C string functions (e.g. @code{strlen},
7944 @code{strchr} or @code{strcpy}) and
7945 their @code{_FORTIFY_SOURCE} counterparts into faster alternatives.
7946
7947 Enabled at levels @option{-O2}, @option{-O3}.
7948
7949 @item -fno-inline
7950 @opindex fno-inline
7951 Do not expand any functions inline apart from those marked with
7952 the @code{always_inline} attribute.  This is the default when not
7953 optimizing.
7954
7955 Single functions can be exempted from inlining by marking them
7956 with the @code{noinline} attribute.
7957
7958 @item -finline-small-functions
7959 @opindex finline-small-functions
7960 Integrate functions into their callers when their body is smaller than expected
7961 function call code (so overall size of program gets smaller).  The compiler
7962 heuristically decides which functions are simple enough to be worth integrating
7963 in this way.  This inlining applies to all functions, even those not declared
7964 inline.
7965
7966 Enabled at level @option{-O2}.
7967
7968 @item -findirect-inlining
7969 @opindex findirect-inlining
7970 Inline also indirect calls that are discovered to be known at compile
7971 time thanks to previous inlining.  This option has any effect only
7972 when inlining itself is turned on by the @option{-finline-functions}
7973 or @option{-finline-small-functions} options.
7974
7975 Enabled at level @option{-O2}.
7976
7977 @item -finline-functions
7978 @opindex finline-functions
7979 Consider all functions for inlining, even if they are not declared inline.
7980 The compiler heuristically decides which functions are worth integrating
7981 in this way.
7982
7983 If all calls to a given function are integrated, and the function is
7984 declared @code{static}, then the function is normally not output as
7985 assembler code in its own right.
7986
7987 Enabled at level @option{-O3}.
7988
7989 @item -finline-functions-called-once
7990 @opindex finline-functions-called-once
7991 Consider all @code{static} functions called once for inlining into their
7992 caller even if they are not marked @code{inline}.  If a call to a given
7993 function is integrated, then the function is not output as assembler code
7994 in its own right.
7995
7996 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
7997
7998 @item -fearly-inlining
7999 @opindex fearly-inlining
8000 Inline functions marked by @code{always_inline} and functions whose body seems
8001 smaller than the function call overhead early before doing
8002 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
8003 makes profiling significantly cheaper and usually inlining faster on programs
8004 having large chains of nested wrapper functions.
8005
8006 Enabled by default.
8007
8008 @item -fipa-sra
8009 @opindex fipa-sra
8010 Perform interprocedural scalar replacement of aggregates, removal of
8011 unused parameters and replacement of parameters passed by reference
8012 by parameters passed by value.
8013
8014 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
8015
8016 @item -finline-limit=@var{n}
8017 @opindex finline-limit
8018 By default, GCC limits the size of functions that can be inlined.  This flag
8019 allows coarse control of this limit.  @var{n} is the size of functions that
8020 can be inlined in number of pseudo instructions.
8021
8022 Inlining is actually controlled by a number of parameters, which may be
8023 specified individually by using @option{--param @var{name}=@var{value}}.
8024 The @option{-finline-limit=@var{n}} option sets some of these parameters
8025 as follows:
8026
8027 @table @gcctabopt
8028 @item max-inline-insns-single
8029 is set to @var{n}/2.
8030 @item max-inline-insns-auto
8031 is set to @var{n}/2.
8032 @end table
8033
8034 See below for a documentation of the individual
8035 parameters controlling inlining and for the defaults of these parameters.
8036
8037 @emph{Note:} there may be no value to @option{-finline-limit} that results
8038 in default behavior.
8039
8040 @emph{Note:} pseudo instruction represents, in this particular context, an
8041 abstract measurement of function's size.  In no way does it represent a count
8042 of assembly instructions and as such its exact meaning might change from one
8043 release to an another.
8044
8045 @item -fno-keep-inline-dllexport
8046 @opindex fno-keep-inline-dllexport
8047 This is a more fine-grained version of @option{-fkeep-inline-functions},
8048 which applies only to functions that are declared using the @code{dllexport}
8049 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
8050 Functions}.)
8051
8052 @item -fkeep-inline-functions
8053 @opindex fkeep-inline-functions
8054 In C, emit @code{static} functions that are declared @code{inline}
8055 into the object file, even if the function has been inlined into all
8056 of its callers.  This switch does not affect functions using the
8057 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
8058 inline functions into the object file.
8059
8060 @item -fkeep-static-functions
8061 @opindex fkeep-static-functions
8062 Emit @code{static} functions into the object file, even if the function
8063 is never used.
8064
8065 @item -fkeep-static-consts
8066 @opindex fkeep-static-consts
8067 Emit variables declared @code{static const} when optimization isn't turned
8068 on, even if the variables aren't referenced.
8069
8070 GCC enables this option by default.  If you want to force the compiler to
8071 check if a variable is referenced, regardless of whether or not
8072 optimization is turned on, use the @option{-fno-keep-static-consts} option.
8073
8074 @item -fmerge-constants
8075 @opindex fmerge-constants
8076 Attempt to merge identical constants (string constants and floating-point
8077 constants) across compilation units.
8078
8079 This option is the default for optimized compilation if the assembler and
8080 linker support it.  Use @option{-fno-merge-constants} to inhibit this
8081 behavior.
8082
8083 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8084
8085 @item -fmerge-all-constants
8086 @opindex fmerge-all-constants
8087 Attempt to merge identical constants and identical variables.
8088
8089 This option implies @option{-fmerge-constants}.  In addition to
8090 @option{-fmerge-constants} this considers e.g.@: even constant initialized
8091 arrays or initialized constant variables with integral or floating-point
8092 types.  Languages like C or C++ require each variable, including multiple
8093 instances of the same variable in recursive calls, to have distinct locations,
8094 so using this option results in non-conforming
8095 behavior.
8096
8097 @item -fmodulo-sched
8098 @opindex fmodulo-sched
8099 Perform swing modulo scheduling immediately before the first scheduling
8100 pass.  This pass looks at innermost loops and reorders their
8101 instructions by overlapping different iterations.
8102
8103 @item -fmodulo-sched-allow-regmoves
8104 @opindex fmodulo-sched-allow-regmoves
8105 Perform more aggressive SMS-based modulo scheduling with register moves
8106 allowed.  By setting this flag certain anti-dependences edges are
8107 deleted, which triggers the generation of reg-moves based on the
8108 life-range analysis.  This option is effective only with
8109 @option{-fmodulo-sched} enabled.
8110
8111 @item -fno-branch-count-reg
8112 @opindex fno-branch-count-reg
8113 Do not use ``decrement and branch'' instructions on a count register,
8114 but instead generate a sequence of instructions that decrement a
8115 register, compare it against zero, then branch based upon the result.
8116 This option is only meaningful on architectures that support such
8117 instructions, which include x86, PowerPC, IA-64 and S/390.
8118
8119 Enabled by default at @option{-O1} and higher.
8120
8121 The default is @option{-fbranch-count-reg}.
8122
8123 @item -fno-function-cse
8124 @opindex fno-function-cse
8125 Do not put function addresses in registers; make each instruction that
8126 calls a constant function contain the function's address explicitly.
8127
8128 This option results in less efficient code, but some strange hacks
8129 that alter the assembler output may be confused by the optimizations
8130 performed when this option is not used.
8131
8132 The default is @option{-ffunction-cse}
8133
8134 @item -fno-zero-initialized-in-bss
8135 @opindex fno-zero-initialized-in-bss
8136 If the target supports a BSS section, GCC by default puts variables that
8137 are initialized to zero into BSS@.  This can save space in the resulting
8138 code.
8139
8140 This option turns off this behavior because some programs explicitly
8141 rely on variables going to the data section---e.g., so that the
8142 resulting executable can find the beginning of that section and/or make
8143 assumptions based on that.
8144
8145 The default is @option{-fzero-initialized-in-bss}.
8146
8147 @item -fthread-jumps
8148 @opindex fthread-jumps
8149 Perform optimizations that check to see if a jump branches to a
8150 location where another comparison subsumed by the first is found.  If
8151 so, the first branch is redirected to either the destination of the
8152 second branch or a point immediately following it, depending on whether
8153 the condition is known to be true or false.
8154
8155 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8156
8157 @item -fsplit-wide-types
8158 @opindex fsplit-wide-types
8159 When using a type that occupies multiple registers, such as @code{long
8160 long} on a 32-bit system, split the registers apart and allocate them
8161 independently.  This normally generates better code for those types,
8162 but may make debugging more difficult.
8163
8164 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
8165 @option{-Os}.
8166
8167 @item -fcse-follow-jumps
8168 @opindex fcse-follow-jumps
8169 In common subexpression elimination (CSE), scan through jump instructions
8170 when the target of the jump is not reached by any other path.  For
8171 example, when CSE encounters an @code{if} statement with an
8172 @code{else} clause, CSE follows the jump when the condition
8173 tested is false.
8174
8175 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8176
8177 @item -fcse-skip-blocks
8178 @opindex fcse-skip-blocks
8179 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
8180 follow jumps that conditionally skip over blocks.  When CSE
8181 encounters a simple @code{if} statement with no else clause,
8182 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
8183 body of the @code{if}.
8184
8185 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8186
8187 @item -frerun-cse-after-loop
8188 @opindex frerun-cse-after-loop
8189 Re-run common subexpression elimination after loop optimizations are
8190 performed.
8191
8192 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8193
8194 @item -fgcse
8195 @opindex fgcse
8196 Perform a global common subexpression elimination pass.
8197 This pass also performs global constant and copy propagation.
8198
8199 @emph{Note:} When compiling a program using computed gotos, a GCC
8200 extension, you may get better run-time performance if you disable
8201 the global common subexpression elimination pass by adding
8202 @option{-fno-gcse} to the command line.
8203
8204 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8205
8206 @item -fgcse-lm
8207 @opindex fgcse-lm
8208 When @option{-fgcse-lm} is enabled, global common subexpression elimination
8209 attempts to move loads that are only killed by stores into themselves.  This
8210 allows a loop containing a load/store sequence to be changed to a load outside
8211 the loop, and a copy/store within the loop.
8212
8213 Enabled by default when @option{-fgcse} is enabled.
8214
8215 @item -fgcse-sm
8216 @opindex fgcse-sm
8217 When @option{-fgcse-sm} is enabled, a store motion pass is run after
8218 global common subexpression elimination.  This pass attempts to move
8219 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
8220 loops containing a load/store sequence can be changed to a load before
8221 the loop and a store after the loop.
8222
8223 Not enabled at any optimization level.
8224
8225 @item -fgcse-las
8226 @opindex fgcse-las
8227 When @option{-fgcse-las} is enabled, the global common subexpression
8228 elimination pass eliminates redundant loads that come after stores to the
8229 same memory location (both partial and full redundancies).
8230
8231 Not enabled at any optimization level.
8232
8233 @item -fgcse-after-reload
8234 @opindex fgcse-after-reload
8235 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
8236 pass is performed after reload.  The purpose of this pass is to clean up
8237 redundant spilling.
8238
8239 @item -faggressive-loop-optimizations
8240 @opindex faggressive-loop-optimizations
8241 This option tells the loop optimizer to use language constraints to
8242 derive bounds for the number of iterations of a loop.  This assumes that
8243 loop code does not invoke undefined behavior by for example causing signed
8244 integer overflows or out-of-bound array accesses.  The bounds for the
8245 number of iterations of a loop are used to guide loop unrolling and peeling
8246 and loop exit test optimizations.
8247 This option is enabled by default.
8248
8249 @item -funsafe-loop-optimizations
8250 @opindex funsafe-loop-optimizations
8251 This option tells the loop optimizer to assume that loop indices do not
8252 overflow, and that loops with nontrivial exit condition are not
8253 infinite.  This enables a wider range of loop optimizations even if
8254 the loop optimizer itself cannot prove that these assumptions are valid.
8255 If you use @option{-Wunsafe-loop-optimizations}, the compiler warns you
8256 if it finds this kind of loop.
8257
8258 @item -fcrossjumping
8259 @opindex fcrossjumping
8260 Perform cross-jumping transformation.
8261 This transformation unifies equivalent code and saves code size.  The
8262 resulting code may or may not perform better than without cross-jumping.
8263
8264 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8265
8266 @item -fauto-inc-dec
8267 @opindex fauto-inc-dec
8268 Combine increments or decrements of addresses with memory accesses.
8269 This pass is always skipped on architectures that do not have
8270 instructions to support this.  Enabled by default at @option{-O} and
8271 higher on architectures that support this.
8272
8273 @item -fdce
8274 @opindex fdce
8275 Perform dead code elimination (DCE) on RTL@.
8276 Enabled by default at @option{-O} and higher.
8277
8278 @item -fdse
8279 @opindex fdse
8280 Perform dead store elimination (DSE) on RTL@.
8281 Enabled by default at @option{-O} and higher.
8282
8283 @item -fif-conversion
8284 @opindex fif-conversion
8285 Attempt to transform conditional jumps into branch-less equivalents.  This
8286 includes use of conditional moves, min, max, set flags and abs instructions, and
8287 some tricks doable by standard arithmetics.  The use of conditional execution
8288 on chips where it is available is controlled by @option{-fif-conversion2}.
8289
8290 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8291
8292 @item -fif-conversion2
8293 @opindex fif-conversion2
8294 Use conditional execution (where available) to transform conditional jumps into
8295 branch-less equivalents.
8296
8297 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8298
8299 @item -fdeclone-ctor-dtor
8300 @opindex fdeclone-ctor-dtor
8301 The C++ ABI requires multiple entry points for constructors and
8302 destructors: one for a base subobject, one for a complete object, and
8303 one for a virtual destructor that calls operator delete afterwards.
8304 For a hierarchy with virtual bases, the base and complete variants are
8305 clones, which means two copies of the function.  With this option, the
8306 base and complete variants are changed to be thunks that call a common
8307 implementation.
8308
8309 Enabled by @option{-Os}.
8310
8311 @item -fdelete-null-pointer-checks
8312 @opindex fdelete-null-pointer-checks
8313 Assume that programs cannot safely dereference null pointers, and that
8314 no code or data element resides at address zero.
8315 This option enables simple constant
8316 folding optimizations at all optimization levels.  In addition, other
8317 optimization passes in GCC use this flag to control global dataflow
8318 analyses that eliminate useless checks for null pointers; these assume
8319 that a memory access to address zero always results in a trap, so
8320 that if a pointer is checked after it has already been dereferenced,
8321 it cannot be null.
8322
8323 Note however that in some environments this assumption is not true.
8324 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
8325 for programs that depend on that behavior.
8326
8327 This option is enabled by default on most targets.  On Nios II ELF, it
8328 defaults to off.  On AVR and CR16, this option is completely disabled.  
8329
8330 Passes that use the dataflow information
8331 are enabled independently at different optimization levels.
8332
8333 @item -fdevirtualize
8334 @opindex fdevirtualize
8335 Attempt to convert calls to virtual functions to direct calls.  This
8336 is done both within a procedure and interprocedurally as part of
8337 indirect inlining (@option{-findirect-inlining}) and interprocedural constant
8338 propagation (@option{-fipa-cp}).
8339 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8340
8341 @item -fdevirtualize-speculatively
8342 @opindex fdevirtualize-speculatively
8343 Attempt to convert calls to virtual functions to speculative direct calls.
8344 Based on the analysis of the type inheritance graph, determine for a given call
8345 the set of likely targets. If the set is small, preferably of size 1, change
8346 the call into a conditional deciding between direct and indirect calls.  The
8347 speculative calls enable more optimizations, such as inlining.  When they seem
8348 useless after further optimization, they are converted back into original form.
8349
8350 @item -fdevirtualize-at-ltrans
8351 @opindex fdevirtualize-at-ltrans
8352 Stream extra information needed for aggressive devirtualization when running
8353 the link-time optimizer in local transformation mode.  
8354 This option enables more devirtualization but
8355 significantly increases the size of streamed data. For this reason it is
8356 disabled by default.
8357
8358 @item -fexpensive-optimizations
8359 @opindex fexpensive-optimizations
8360 Perform a number of minor optimizations that are relatively expensive.
8361
8362 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8363
8364 @item -free
8365 @opindex free
8366 Attempt to remove redundant extension instructions.  This is especially
8367 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
8368 registers after writing to their lower 32-bit half.
8369
8370 Enabled for Alpha, AArch64 and x86 at levels @option{-O2},
8371 @option{-O3}, @option{-Os}.
8372
8373 @item -fno-lifetime-dse
8374 @opindex fno-lifetime-dse
8375 In C++ the value of an object is only affected by changes within its
8376 lifetime: when the constructor begins, the object has an indeterminate
8377 value, and any changes during the lifetime of the object are dead when
8378 the object is destroyed.  Normally dead store elimination will take
8379 advantage of this; if your code relies on the value of the object
8380 storage persisting beyond the lifetime of the object, you can use this
8381 flag to disable this optimization.
8382
8383 @item -flive-range-shrinkage
8384 @opindex flive-range-shrinkage
8385 Attempt to decrease register pressure through register live range
8386 shrinkage.  This is helpful for fast processors with small or moderate
8387 size register sets.
8388
8389 @item -fira-algorithm=@var{algorithm}
8390 @opindex fira-algorithm
8391 Use the specified coloring algorithm for the integrated register
8392 allocator.  The @var{algorithm} argument can be @samp{priority}, which
8393 specifies Chow's priority coloring, or @samp{CB}, which specifies
8394 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
8395 for all architectures, but for those targets that do support it, it is
8396 the default because it generates better code.
8397
8398 @item -fira-region=@var{region}
8399 @opindex fira-region
8400 Use specified regions for the integrated register allocator.  The
8401 @var{region} argument should be one of the following:
8402
8403 @table @samp
8404
8405 @item all
8406 Use all loops as register allocation regions.
8407 This can give the best results for machines with a small and/or
8408 irregular register set.
8409
8410 @item mixed
8411 Use all loops except for loops with small register pressure 
8412 as the regions.  This value usually gives
8413 the best results in most cases and for most architectures,
8414 and is enabled by default when compiling with optimization for speed
8415 (@option{-O}, @option{-O2}, @dots{}).
8416
8417 @item one
8418 Use all functions as a single region.  
8419 This typically results in the smallest code size, and is enabled by default for
8420 @option{-Os} or @option{-O0}.
8421
8422 @end table
8423
8424 @item -fira-hoist-pressure
8425 @opindex fira-hoist-pressure
8426 Use IRA to evaluate register pressure in the code hoisting pass for
8427 decisions to hoist expressions.  This option usually results in smaller
8428 code, but it can slow the compiler down.
8429
8430 This option is enabled at level @option{-Os} for all targets.
8431
8432 @item -fira-loop-pressure
8433 @opindex fira-loop-pressure
8434 Use IRA to evaluate register pressure in loops for decisions to move
8435 loop invariants.  This option usually results in generation
8436 of faster and smaller code on machines with large register files (>= 32
8437 registers), but it can slow the compiler down.
8438
8439 This option is enabled at level @option{-O3} for some targets.
8440
8441 @item -fno-ira-share-save-slots
8442 @opindex fno-ira-share-save-slots
8443 Disable sharing of stack slots used for saving call-used hard
8444 registers living through a call.  Each hard register gets a
8445 separate stack slot, and as a result function stack frames are
8446 larger.
8447
8448 @item -fno-ira-share-spill-slots
8449 @opindex fno-ira-share-spill-slots
8450 Disable sharing of stack slots allocated for pseudo-registers.  Each
8451 pseudo-register that does not get a hard register gets a separate
8452 stack slot, and as a result function stack frames are larger.
8453
8454 @item -fira-verbose=@var{n}
8455 @opindex fira-verbose
8456 Control the verbosity of the dump file for the integrated register allocator.
8457 The default value is 5.  If the value @var{n} is greater or equal to 10,
8458 the dump output is sent to stderr using the same format as @var{n} minus 10.
8459
8460 @item -flra-remat
8461 @opindex flra-remat
8462 Enable CFG-sensitive rematerialization in LRA.  Instead of loading
8463 values of spilled pseudos, LRA tries to rematerialize (recalculate)
8464 values if it is profitable.
8465
8466 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8467
8468 @item -fdelayed-branch
8469 @opindex fdelayed-branch
8470 If supported for the target machine, attempt to reorder instructions
8471 to exploit instruction slots available after delayed branch
8472 instructions.
8473
8474 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8475
8476 @item -fschedule-insns
8477 @opindex fschedule-insns
8478 If supported for the target machine, attempt to reorder instructions to
8479 eliminate execution stalls due to required data being unavailable.  This
8480 helps machines that have slow floating point or memory load instructions
8481 by allowing other instructions to be issued until the result of the load
8482 or floating-point instruction is required.
8483
8484 Enabled at levels @option{-O2}, @option{-O3}.
8485
8486 @item -fschedule-insns2
8487 @opindex fschedule-insns2
8488 Similar to @option{-fschedule-insns}, but requests an additional pass of
8489 instruction scheduling after register allocation has been done.  This is
8490 especially useful on machines with a relatively small number of
8491 registers and where memory load instructions take more than one cycle.
8492
8493 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8494
8495 @item -fno-sched-interblock
8496 @opindex fno-sched-interblock
8497 Don't schedule instructions across basic blocks.  This is normally
8498 enabled by default when scheduling before register allocation, i.e.@:
8499 with @option{-fschedule-insns} or at @option{-O2} or higher.
8500
8501 @item -fno-sched-spec
8502 @opindex fno-sched-spec
8503 Don't allow speculative motion of non-load instructions.  This is normally
8504 enabled by default when scheduling before register allocation, i.e.@:
8505 with @option{-fschedule-insns} or at @option{-O2} or higher.
8506
8507 @item -fsched-pressure
8508 @opindex fsched-pressure
8509 Enable register pressure sensitive insn scheduling before register
8510 allocation.  This only makes sense when scheduling before register
8511 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
8512 @option{-O2} or higher.  Usage of this option can improve the
8513 generated code and decrease its size by preventing register pressure
8514 increase above the number of available hard registers and subsequent
8515 spills in register allocation.
8516
8517 @item -fsched-spec-load
8518 @opindex fsched-spec-load
8519 Allow speculative motion of some load instructions.  This only makes
8520 sense when scheduling before register allocation, i.e.@: with
8521 @option{-fschedule-insns} or at @option{-O2} or higher.
8522
8523 @item -fsched-spec-load-dangerous
8524 @opindex fsched-spec-load-dangerous
8525 Allow speculative motion of more load instructions.  This only makes
8526 sense when scheduling before register allocation, i.e.@: with
8527 @option{-fschedule-insns} or at @option{-O2} or higher.
8528
8529 @item -fsched-stalled-insns
8530 @itemx -fsched-stalled-insns=@var{n}
8531 @opindex fsched-stalled-insns
8532 Define how many insns (if any) can be moved prematurely from the queue
8533 of stalled insns into the ready list during the second scheduling pass.
8534 @option{-fno-sched-stalled-insns} means that no insns are moved
8535 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
8536 on how many queued insns can be moved prematurely.
8537 @option{-fsched-stalled-insns} without a value is equivalent to
8538 @option{-fsched-stalled-insns=1}.
8539
8540 @item -fsched-stalled-insns-dep
8541 @itemx -fsched-stalled-insns-dep=@var{n}
8542 @opindex fsched-stalled-insns-dep
8543 Define how many insn groups (cycles) are examined for a dependency
8544 on a stalled insn that is a candidate for premature removal from the queue
8545 of stalled insns.  This has an effect only during the second scheduling pass,
8546 and only if @option{-fsched-stalled-insns} is used.
8547 @option{-fno-sched-stalled-insns-dep} is equivalent to
8548 @option{-fsched-stalled-insns-dep=0}.
8549 @option{-fsched-stalled-insns-dep} without a value is equivalent to
8550 @option{-fsched-stalled-insns-dep=1}.
8551
8552 @item -fsched2-use-superblocks
8553 @opindex fsched2-use-superblocks
8554 When scheduling after register allocation, use superblock scheduling.
8555 This allows motion across basic block boundaries,
8556 resulting in faster schedules.  This option is experimental, as not all machine
8557 descriptions used by GCC model the CPU closely enough to avoid unreliable
8558 results from the algorithm.
8559
8560 This only makes sense when scheduling after register allocation, i.e.@: with
8561 @option{-fschedule-insns2} or at @option{-O2} or higher.
8562
8563 @item -fsched-group-heuristic
8564 @opindex fsched-group-heuristic
8565 Enable the group heuristic in the scheduler.  This heuristic favors
8566 the instruction that belongs to a schedule group.  This is enabled
8567 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
8568 or @option{-fschedule-insns2} or at @option{-O2} or higher.
8569
8570 @item -fsched-critical-path-heuristic
8571 @opindex fsched-critical-path-heuristic
8572 Enable the critical-path heuristic in the scheduler.  This heuristic favors
8573 instructions on the critical path.  This is enabled by default when
8574 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
8575 or @option{-fschedule-insns2} or at @option{-O2} or higher.
8576
8577 @item -fsched-spec-insn-heuristic
8578 @opindex fsched-spec-insn-heuristic
8579 Enable the speculative instruction heuristic in the scheduler.  This
8580 heuristic favors speculative instructions with greater dependency weakness.
8581 This is enabled by default when scheduling is enabled, i.e.@:
8582 with @option{-fschedule-insns} or @option{-fschedule-insns2}
8583 or at @option{-O2} or higher.
8584
8585 @item -fsched-rank-heuristic
8586 @opindex fsched-rank-heuristic
8587 Enable the rank heuristic in the scheduler.  This heuristic favors
8588 the instruction belonging to a basic block with greater size or frequency.
8589 This is enabled by default when scheduling is enabled, i.e.@:
8590 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8591 at @option{-O2} or higher.
8592
8593 @item -fsched-last-insn-heuristic
8594 @opindex fsched-last-insn-heuristic
8595 Enable the last-instruction heuristic in the scheduler.  This heuristic
8596 favors the instruction that is less dependent on the last instruction
8597 scheduled.  This is enabled by default when scheduling is enabled,
8598 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8599 at @option{-O2} or higher.
8600
8601 @item -fsched-dep-count-heuristic
8602 @opindex fsched-dep-count-heuristic
8603 Enable the dependent-count heuristic in the scheduler.  This heuristic
8604 favors the instruction that has more instructions depending on it.
8605 This is enabled by default when scheduling is enabled, i.e.@:
8606 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8607 at @option{-O2} or higher.
8608
8609 @item -freschedule-modulo-scheduled-loops
8610 @opindex freschedule-modulo-scheduled-loops
8611 Modulo scheduling is performed before traditional scheduling.  If a loop
8612 is modulo scheduled, later scheduling passes may change its schedule.  
8613 Use this option to control that behavior.
8614
8615 @item -fselective-scheduling
8616 @opindex fselective-scheduling
8617 Schedule instructions using selective scheduling algorithm.  Selective
8618 scheduling runs instead of the first scheduler pass.
8619
8620 @item -fselective-scheduling2
8621 @opindex fselective-scheduling2
8622 Schedule instructions using selective scheduling algorithm.  Selective
8623 scheduling runs instead of the second scheduler pass.
8624
8625 @item -fsel-sched-pipelining
8626 @opindex fsel-sched-pipelining
8627 Enable software pipelining of innermost loops during selective scheduling.
8628 This option has no effect unless one of @option{-fselective-scheduling} or
8629 @option{-fselective-scheduling2} is turned on.
8630
8631 @item -fsel-sched-pipelining-outer-loops
8632 @opindex fsel-sched-pipelining-outer-loops
8633 When pipelining loops during selective scheduling, also pipeline outer loops.
8634 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
8635
8636 @item -fsemantic-interposition
8637 @opindex fsemantic-interposition
8638 Some object formats, like ELF, allow interposing of symbols by the 
8639 dynamic linker.
8640 This means that for symbols exported from the DSO, the compiler cannot perform
8641 interprocedural propagation, inlining and other optimizations in anticipation
8642 that the function or variable in question may change. While this feature is
8643 useful, for example, to rewrite memory allocation functions by a debugging
8644 implementation, it is expensive in the terms of code quality.
8645 With @option{-fno-semantic-interposition} the compiler assumes that 
8646 if interposition happens for functions the overwriting function will have 
8647 precisely the same semantics (and side effects). 
8648 Similarly if interposition happens
8649 for variables, the constructor of the variable will be the same. The flag
8650 has no effect for functions explicitly declared inline 
8651 (where it is never allowed for interposition to change semantics) 
8652 and for symbols explicitly declared weak.
8653
8654 @item -fshrink-wrap
8655 @opindex fshrink-wrap
8656 Emit function prologues only before parts of the function that need it,
8657 rather than at the top of the function.  This flag is enabled by default at
8658 @option{-O} and higher.
8659
8660 @item -fcaller-saves
8661 @opindex fcaller-saves
8662 Enable allocation of values to registers that are clobbered by
8663 function calls, by emitting extra instructions to save and restore the
8664 registers around such calls.  Such allocation is done only when it
8665 seems to result in better code.
8666
8667 This option is always enabled by default on certain machines, usually
8668 those which have no call-preserved registers to use instead.
8669
8670 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8671
8672 @item -fcombine-stack-adjustments
8673 @opindex fcombine-stack-adjustments
8674 Tracks stack adjustments (pushes and pops) and stack memory references
8675 and then tries to find ways to combine them.
8676
8677 Enabled by default at @option{-O1} and higher.
8678
8679 @item -fipa-ra
8680 @opindex fipa-ra
8681 Use caller save registers for allocation if those registers are not used by
8682 any called function.  In that case it is not necessary to save and restore
8683 them around calls.  This is only possible if called functions are part of
8684 same compilation unit as current function and they are compiled before it.
8685
8686 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8687
8688 @item -fconserve-stack
8689 @opindex fconserve-stack
8690 Attempt to minimize stack usage.  The compiler attempts to use less
8691 stack space, even if that makes the program slower.  This option
8692 implies setting the @option{large-stack-frame} parameter to 100
8693 and the @option{large-stack-frame-growth} parameter to 400.
8694
8695 @item -ftree-reassoc
8696 @opindex ftree-reassoc
8697 Perform reassociation on trees.  This flag is enabled by default
8698 at @option{-O} and higher.
8699
8700 @item -ftree-pre
8701 @opindex ftree-pre
8702 Perform partial redundancy elimination (PRE) on trees.  This flag is
8703 enabled by default at @option{-O2} and @option{-O3}.
8704
8705 @item -ftree-partial-pre
8706 @opindex ftree-partial-pre
8707 Make partial redundancy elimination (PRE) more aggressive.  This flag is
8708 enabled by default at @option{-O3}.
8709
8710 @item -ftree-forwprop
8711 @opindex ftree-forwprop
8712 Perform forward propagation on trees.  This flag is enabled by default
8713 at @option{-O} and higher.
8714
8715 @item -ftree-fre
8716 @opindex ftree-fre
8717 Perform full redundancy elimination (FRE) on trees.  The difference
8718 between FRE and PRE is that FRE only considers expressions
8719 that are computed on all paths leading to the redundant computation.
8720 This analysis is faster than PRE, though it exposes fewer redundancies.
8721 This flag is enabled by default at @option{-O} and higher.
8722
8723 @item -ftree-phiprop
8724 @opindex ftree-phiprop
8725 Perform hoisting of loads from conditional pointers on trees.  This
8726 pass is enabled by default at @option{-O} and higher.
8727
8728 @item -fhoist-adjacent-loads
8729 @opindex fhoist-adjacent-loads
8730 Speculatively hoist loads from both branches of an if-then-else if the
8731 loads are from adjacent locations in the same structure and the target
8732 architecture has a conditional move instruction.  This flag is enabled
8733 by default at @option{-O2} and higher.
8734
8735 @item -ftree-copy-prop
8736 @opindex ftree-copy-prop
8737 Perform copy propagation on trees.  This pass eliminates unnecessary
8738 copy operations.  This flag is enabled by default at @option{-O} and
8739 higher.
8740
8741 @item -fipa-pure-const
8742 @opindex fipa-pure-const
8743 Discover which functions are pure or constant.
8744 Enabled by default at @option{-O} and higher.
8745
8746 @item -fipa-reference
8747 @opindex fipa-reference
8748 Discover which static variables do not escape the
8749 compilation unit.
8750 Enabled by default at @option{-O} and higher.
8751
8752 @item -fipa-pta
8753 @opindex fipa-pta
8754 Perform interprocedural pointer analysis and interprocedural modification
8755 and reference analysis.  This option can cause excessive memory and
8756 compile-time usage on large compilation units.  It is not enabled by
8757 default at any optimization level.
8758
8759 @item -fipa-profile
8760 @opindex fipa-profile
8761 Perform interprocedural profile propagation.  The functions called only from
8762 cold functions are marked as cold. Also functions executed once (such as
8763 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
8764 functions and loop less parts of functions executed once are then optimized for
8765 size.
8766 Enabled by default at @option{-O} and higher.
8767
8768 @item -fipa-cp
8769 @opindex fipa-cp
8770 Perform interprocedural constant propagation.
8771 This optimization analyzes the program to determine when values passed
8772 to functions are constants and then optimizes accordingly.
8773 This optimization can substantially increase performance
8774 if the application has constants passed to functions.
8775 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
8776
8777 @item -fipa-cp-clone
8778 @opindex fipa-cp-clone
8779 Perform function cloning to make interprocedural constant propagation stronger.
8780 When enabled, interprocedural constant propagation performs function cloning
8781 when externally visible function can be called with constant arguments.
8782 Because this optimization can create multiple copies of functions,
8783 it may significantly increase code size
8784 (see @option{--param ipcp-unit-growth=@var{value}}).
8785 This flag is enabled by default at @option{-O3}.
8786
8787 @item -fipa-cp-alignment
8788 @opindex -fipa-cp-alignment
8789 When enabled, this optimization propagates alignment of function
8790 parameters to support better vectorization and string operations.
8791
8792 This flag is enabled by default at @option{-O2} and @option{-Os}.  It
8793 requires that @option{-fipa-cp} is enabled.
8794
8795 @item -fipa-icf
8796 @opindex fipa-icf
8797 Perform Identical Code Folding for functions and read-only variables.
8798 The optimization reduces code size and may disturb unwind stacks by replacing
8799 a function by equivalent one with a different name. The optimization works
8800 more effectively with link time optimization enabled.
8801
8802 Nevertheless the behavior is similar to Gold Linker ICF optimization, GCC ICF
8803 works on different levels and thus the optimizations are not same - there are
8804 equivalences that are found only by GCC and equivalences found only by Gold.
8805
8806 This flag is enabled by default at @option{-O2} and @option{-Os}.
8807
8808 @item -fisolate-erroneous-paths-dereference
8809 @opindex fisolate-erroneous-paths-dereference
8810 Detect paths that trigger erroneous or undefined behavior due to
8811 dereferencing a null pointer.  Isolate those paths from the main control
8812 flow and turn the statement with erroneous or undefined behavior into a trap.
8813 This flag is enabled by default at @option{-O2} and higher and depends on
8814 @option{-fdelete-null-pointer-checks} also being enabled.
8815
8816 @item -fisolate-erroneous-paths-attribute
8817 @opindex fisolate-erroneous-paths-attribute
8818 Detect paths that trigger erroneous or undefined behavior due a null value
8819 being used in a way forbidden by a @code{returns_nonnull} or @code{nonnull}
8820 attribute.  Isolate those paths from the main control flow and turn the
8821 statement with erroneous or undefined behavior into a trap.  This is not
8822 currently enabled, but may be enabled by @option{-O2} in the future.
8823
8824 @item -ftree-sink
8825 @opindex ftree-sink
8826 Perform forward store motion  on trees.  This flag is
8827 enabled by default at @option{-O} and higher.
8828
8829 @item -ftree-bit-ccp
8830 @opindex ftree-bit-ccp
8831 Perform sparse conditional bit constant propagation on trees and propagate
8832 pointer alignment information.
8833 This pass only operates on local scalar variables and is enabled by default
8834 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
8835
8836 @item -ftree-ccp
8837 @opindex ftree-ccp
8838 Perform sparse conditional constant propagation (CCP) on trees.  This
8839 pass only operates on local scalar variables and is enabled by default
8840 at @option{-O} and higher.
8841
8842 @item -fssa-backprop
8843 @opindex fssa-backprop
8844 Propagate information about uses of a value up the definition chain
8845 in order to simplify the definitions.  For example, this pass strips
8846 sign operations if the sign of a value never matters.  The flag is
8847 enabled by default at @option{-O} and higher.
8848
8849 @item -fssa-phiopt
8850 @opindex fssa-phiopt
8851 Perform pattern matching on SSA PHI nodes to optimize conditional
8852 code.  This pass is enabled by default at @option{-O} and higher.
8853
8854 @item -ftree-switch-conversion
8855 @opindex ftree-switch-conversion
8856 Perform conversion of simple initializations in a switch to
8857 initializations from a scalar array.  This flag is enabled by default
8858 at @option{-O2} and higher.
8859
8860 @item -ftree-tail-merge
8861 @opindex ftree-tail-merge
8862 Look for identical code sequences.  When found, replace one with a jump to the
8863 other.  This optimization is known as tail merging or cross jumping.  This flag
8864 is enabled by default at @option{-O2} and higher.  The compilation time
8865 in this pass can
8866 be limited using @option{max-tail-merge-comparisons} parameter and
8867 @option{max-tail-merge-iterations} parameter.
8868
8869 @item -ftree-dce
8870 @opindex ftree-dce
8871 Perform dead code elimination (DCE) on trees.  This flag is enabled by
8872 default at @option{-O} and higher.
8873
8874 @item -ftree-builtin-call-dce
8875 @opindex ftree-builtin-call-dce
8876 Perform conditional dead code elimination (DCE) for calls to built-in functions
8877 that may set @code{errno} but are otherwise side-effect free.  This flag is
8878 enabled by default at @option{-O2} and higher if @option{-Os} is not also
8879 specified.
8880
8881 @item -ftree-dominator-opts
8882 @opindex ftree-dominator-opts
8883 Perform a variety of simple scalar cleanups (constant/copy
8884 propagation, redundancy elimination, range propagation and expression
8885 simplification) based on a dominator tree traversal.  This also
8886 performs jump threading (to reduce jumps to jumps). This flag is
8887 enabled by default at @option{-O} and higher.
8888
8889 @item -ftree-dse
8890 @opindex ftree-dse
8891 Perform dead store elimination (DSE) on trees.  A dead store is a store into
8892 a memory location that is later overwritten by another store without
8893 any intervening loads.  In this case the earlier store can be deleted.  This
8894 flag is enabled by default at @option{-O} and higher.
8895
8896 @item -ftree-ch
8897 @opindex ftree-ch
8898 Perform loop header copying on trees.  This is beneficial since it increases
8899 effectiveness of code motion optimizations.  It also saves one jump.  This flag
8900 is enabled by default at @option{-O} and higher.  It is not enabled
8901 for @option{-Os}, since it usually increases code size.
8902
8903 @item -ftree-loop-optimize
8904 @opindex ftree-loop-optimize
8905 Perform loop optimizations on trees.  This flag is enabled by default
8906 at @option{-O} and higher.
8907
8908 @item -ftree-loop-linear
8909 @itemx -floop-interchange
8910 @itemx -floop-strip-mine
8911 @itemx -floop-block
8912 @itemx -floop-unroll-and-jam
8913 @opindex ftree-loop-linear
8914 @opindex floop-interchange
8915 @opindex floop-strip-mine
8916 @opindex floop-block
8917 @opindex floop-unroll-and-jam
8918 Perform loop nest optimizations.  Same as
8919 @option{-floop-nest-optimize}.  To use this code transformation, GCC has
8920 to be configured with @option{--with-isl} to enable the Graphite loop
8921 transformation infrastructure.
8922
8923 @item -fgraphite-identity
8924 @opindex fgraphite-identity
8925 Enable the identity transformation for graphite.  For every SCoP we generate
8926 the polyhedral representation and transform it back to gimple.  Using
8927 @option{-fgraphite-identity} we can check the costs or benefits of the
8928 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
8929 are also performed by the code generator ISL, like index splitting and
8930 dead code elimination in loops.
8931
8932 @item -floop-nest-optimize
8933 @opindex floop-nest-optimize
8934 Enable the ISL based loop nest optimizer.  This is a generic loop nest
8935 optimizer based on the Pluto optimization algorithms.  It calculates a loop
8936 structure optimized for data-locality and parallelism.  This option
8937 is experimental.
8938
8939 @item -floop-parallelize-all
8940 @opindex floop-parallelize-all
8941 Use the Graphite data dependence analysis to identify loops that can
8942 be parallelized.  Parallelize all the loops that can be analyzed to
8943 not contain loop carried dependences without checking that it is
8944 profitable to parallelize the loops.
8945
8946 @item -ftree-coalesce-vars
8947 @opindex ftree-coalesce-vars
8948 While transforming the program out of the SSA representation, attempt to
8949 reduce copying by coalescing versions of different user-defined
8950 variables, instead of just compiler temporaries.  This may severely
8951 limit the ability to debug an optimized program compiled with
8952 @option{-fno-var-tracking-assignments}.  In the negated form, this flag
8953 prevents SSA coalescing of user variables.  This option is enabled by
8954 default if optimization is enabled, and it does very little otherwise.
8955
8956 @item -ftree-loop-if-convert
8957 @opindex ftree-loop-if-convert
8958 Attempt to transform conditional jumps in the innermost loops to
8959 branch-less equivalents.  The intent is to remove control-flow from
8960 the innermost loops in order to improve the ability of the
8961 vectorization pass to handle these loops.  This is enabled by default
8962 if vectorization is enabled.
8963
8964 @item -ftree-loop-if-convert-stores
8965 @opindex ftree-loop-if-convert-stores
8966 Attempt to also if-convert conditional jumps containing memory writes.
8967 This transformation can be unsafe for multi-threaded programs as it
8968 transforms conditional memory writes into unconditional memory writes.
8969 For example,
8970 @smallexample
8971 for (i = 0; i < N; i++)
8972   if (cond)
8973     A[i] = expr;
8974 @end smallexample
8975 is transformed to
8976 @smallexample
8977 for (i = 0; i < N; i++)
8978   A[i] = cond ? expr : A[i];
8979 @end smallexample
8980 potentially producing data races.
8981
8982 @item -ftree-loop-distribution
8983 @opindex ftree-loop-distribution
8984 Perform loop distribution.  This flag can improve cache performance on
8985 big loop bodies and allow further loop optimizations, like
8986 parallelization or vectorization, to take place.  For example, the loop
8987 @smallexample
8988 DO I = 1, N
8989   A(I) = B(I) + C
8990   D(I) = E(I) * F
8991 ENDDO
8992 @end smallexample
8993 is transformed to
8994 @smallexample
8995 DO I = 1, N
8996    A(I) = B(I) + C
8997 ENDDO
8998 DO I = 1, N
8999    D(I) = E(I) * F
9000 ENDDO
9001 @end smallexample
9002
9003 @item -ftree-loop-distribute-patterns
9004 @opindex ftree-loop-distribute-patterns
9005 Perform loop distribution of patterns that can be code generated with
9006 calls to a library.  This flag is enabled by default at @option{-O3}.
9007
9008 This pass distributes the initialization loops and generates a call to
9009 memset zero.  For example, the loop
9010 @smallexample
9011 DO I = 1, N
9012   A(I) = 0
9013   B(I) = A(I) + I
9014 ENDDO
9015 @end smallexample
9016 is transformed to
9017 @smallexample
9018 DO I = 1, N
9019    A(I) = 0
9020 ENDDO
9021 DO I = 1, N
9022    B(I) = A(I) + I
9023 ENDDO
9024 @end smallexample
9025 and the initialization loop is transformed into a call to memset zero.
9026
9027 @item -ftree-loop-im
9028 @opindex ftree-loop-im
9029 Perform loop invariant motion on trees.  This pass moves only invariants that
9030 are hard to handle at RTL level (function calls, operations that expand to
9031 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
9032 operands of conditions that are invariant out of the loop, so that we can use
9033 just trivial invariantness analysis in loop unswitching.  The pass also includes
9034 store motion.
9035
9036 @item -ftree-loop-ivcanon
9037 @opindex ftree-loop-ivcanon
9038 Create a canonical counter for number of iterations in loops for which
9039 determining number of iterations requires complicated analysis.  Later
9040 optimizations then may determine the number easily.  Useful especially
9041 in connection with unrolling.
9042
9043 @item -fivopts
9044 @opindex fivopts
9045 Perform induction variable optimizations (strength reduction, induction
9046 variable merging and induction variable elimination) on trees.
9047
9048 @item -ftree-parallelize-loops=n
9049 @opindex ftree-parallelize-loops
9050 Parallelize loops, i.e., split their iteration space to run in n threads.
9051 This is only possible for loops whose iterations are independent
9052 and can be arbitrarily reordered.  The optimization is only
9053 profitable on multiprocessor machines, for loops that are CPU-intensive,
9054 rather than constrained e.g.@: by memory bandwidth.  This option
9055 implies @option{-pthread}, and thus is only supported on targets
9056 that have support for @option{-pthread}.
9057
9058 @item -ftree-pta
9059 @opindex ftree-pta
9060 Perform function-local points-to analysis on trees.  This flag is
9061 enabled by default at @option{-O} and higher.
9062
9063 @item -ftree-sra
9064 @opindex ftree-sra
9065 Perform scalar replacement of aggregates.  This pass replaces structure
9066 references with scalars to prevent committing structures to memory too
9067 early.  This flag is enabled by default at @option{-O} and higher.
9068
9069 @item -ftree-ter
9070 @opindex ftree-ter
9071 Perform temporary expression replacement during the SSA->normal phase.  Single
9072 use/single def temporaries are replaced at their use location with their
9073 defining expression.  This results in non-GIMPLE code, but gives the expanders
9074 much more complex trees to work on resulting in better RTL generation.  This is
9075 enabled by default at @option{-O} and higher.
9076
9077 @item -ftree-slsr
9078 @opindex ftree-slsr
9079 Perform straight-line strength reduction on trees.  This recognizes related
9080 expressions involving multiplications and replaces them by less expensive
9081 calculations when possible.  This is enabled by default at @option{-O} and
9082 higher.
9083
9084 @item -ftree-vectorize
9085 @opindex ftree-vectorize
9086 Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
9087 and @option{-ftree-slp-vectorize} if not explicitly specified.
9088
9089 @item -ftree-loop-vectorize
9090 @opindex ftree-loop-vectorize
9091 Perform loop vectorization on trees. This flag is enabled by default at
9092 @option{-O3} and when @option{-ftree-vectorize} is enabled.
9093
9094 @item -ftree-slp-vectorize
9095 @opindex ftree-slp-vectorize
9096 Perform basic block vectorization on trees. This flag is enabled by default at
9097 @option{-O3} and when @option{-ftree-vectorize} is enabled.
9098
9099 @item -fvect-cost-model=@var{model}
9100 @opindex fvect-cost-model
9101 Alter the cost model used for vectorization.  The @var{model} argument
9102 should be one of @samp{unlimited}, @samp{dynamic} or @samp{cheap}.
9103 With the @samp{unlimited} model the vectorized code-path is assumed
9104 to be profitable while with the @samp{dynamic} model a runtime check
9105 guards the vectorized code-path to enable it only for iteration
9106 counts that will likely execute faster than when executing the original
9107 scalar loop.  The @samp{cheap} model disables vectorization of
9108 loops where doing so would be cost prohibitive for example due to
9109 required runtime checks for data dependence or alignment but otherwise
9110 is equal to the @samp{dynamic} model.
9111 The default cost model depends on other optimization flags and is
9112 either @samp{dynamic} or @samp{cheap}.
9113
9114 @item -fsimd-cost-model=@var{model}
9115 @opindex fsimd-cost-model
9116 Alter the cost model used for vectorization of loops marked with the OpenMP
9117 or Cilk Plus simd directive.  The @var{model} argument should be one of
9118 @samp{unlimited}, @samp{dynamic}, @samp{cheap}.  All values of @var{model}
9119 have the same meaning as described in @option{-fvect-cost-model} and by
9120 default a cost model defined with @option{-fvect-cost-model} is used.
9121
9122 @item -ftree-vrp
9123 @opindex ftree-vrp
9124 Perform Value Range Propagation on trees.  This is similar to the
9125 constant propagation pass, but instead of values, ranges of values are
9126 propagated.  This allows the optimizers to remove unnecessary range
9127 checks like array bound checks and null pointer checks.  This is
9128 enabled by default at @option{-O2} and higher.  Null pointer check
9129 elimination is only done if @option{-fdelete-null-pointer-checks} is
9130 enabled.
9131
9132 @item -fsplit-ivs-in-unroller
9133 @opindex fsplit-ivs-in-unroller
9134 Enables expression of values of induction variables in later iterations
9135 of the unrolled loop using the value in the first iteration.  This breaks
9136 long dependency chains, thus improving efficiency of the scheduling passes.
9137
9138 A combination of @option{-fweb} and CSE is often sufficient to obtain the
9139 same effect.  However, that is not reliable in cases where the loop body
9140 is more complicated than a single basic block.  It also does not work at all
9141 on some architectures due to restrictions in the CSE pass.
9142
9143 This optimization is enabled by default.
9144
9145 @item -fvariable-expansion-in-unroller
9146 @opindex fvariable-expansion-in-unroller
9147 With this option, the compiler creates multiple copies of some
9148 local variables when unrolling a loop, which can result in superior code.
9149
9150 @item -fpartial-inlining
9151 @opindex fpartial-inlining
9152 Inline parts of functions.  This option has any effect only
9153 when inlining itself is turned on by the @option{-finline-functions}
9154 or @option{-finline-small-functions} options.
9155
9156 Enabled at level @option{-O2}.
9157
9158 @item -fpredictive-commoning
9159 @opindex fpredictive-commoning
9160 Perform predictive commoning optimization, i.e., reusing computations
9161 (especially memory loads and stores) performed in previous
9162 iterations of loops.
9163
9164 This option is enabled at level @option{-O3}.
9165
9166 @item -fprefetch-loop-arrays
9167 @opindex fprefetch-loop-arrays
9168 If supported by the target machine, generate instructions to prefetch
9169 memory to improve the performance of loops that access large arrays.
9170
9171 This option may generate better or worse code; results are highly
9172 dependent on the structure of loops within the source code.
9173
9174 Disabled at level @option{-Os}.
9175
9176 @item -fno-peephole
9177 @itemx -fno-peephole2
9178 @opindex fno-peephole
9179 @opindex fno-peephole2
9180 Disable any machine-specific peephole optimizations.  The difference
9181 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
9182 are implemented in the compiler; some targets use one, some use the
9183 other, a few use both.
9184
9185 @option{-fpeephole} is enabled by default.
9186 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9187
9188 @item -fno-guess-branch-probability
9189 @opindex fno-guess-branch-probability
9190 Do not guess branch probabilities using heuristics.
9191
9192 GCC uses heuristics to guess branch probabilities if they are
9193 not provided by profiling feedback (@option{-fprofile-arcs}).  These
9194 heuristics are based on the control flow graph.  If some branch probabilities
9195 are specified by @code{__builtin_expect}, then the heuristics are
9196 used to guess branch probabilities for the rest of the control flow graph,
9197 taking the @code{__builtin_expect} info into account.  The interactions
9198 between the heuristics and @code{__builtin_expect} can be complex, and in
9199 some cases, it may be useful to disable the heuristics so that the effects
9200 of @code{__builtin_expect} are easier to understand.
9201
9202 The default is @option{-fguess-branch-probability} at levels
9203 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9204
9205 @item -freorder-blocks
9206 @opindex freorder-blocks
9207 Reorder basic blocks in the compiled function in order to reduce number of
9208 taken branches and improve code locality.
9209
9210 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9211
9212 @item -freorder-blocks-algorithm=@var{algorithm}
9213 @opindex freorder-blocks-algorithm
9214 Use the specified algorithm for basic block reordering.  The
9215 @var{algorithm} argument can be @samp{simple}, which does not increase
9216 code size (except sometimes due to secondary effects like alignment),
9217 or @samp{stc}, the ``software trace cache'' algorithm, which tries to
9218 put all often executed code together, minimizing the number of branches
9219 executed by making extra copies of code.
9220
9221 The default is @samp{simple} at levels @option{-O}, @option{-Os}, and
9222 @samp{stc} at levels @option{-O2}, @option{-O3}.
9223
9224 @item -freorder-blocks-and-partition
9225 @opindex freorder-blocks-and-partition
9226 In addition to reordering basic blocks in the compiled function, in order
9227 to reduce number of taken branches, partitions hot and cold basic blocks
9228 into separate sections of the assembly and .o files, to improve
9229 paging and cache locality performance.
9230
9231 This optimization is automatically turned off in the presence of
9232 exception handling, for linkonce sections, for functions with a user-defined
9233 section attribute and on any architecture that does not support named
9234 sections.
9235
9236 Enabled for x86 at levels @option{-O2}, @option{-O3}.
9237
9238 @item -freorder-functions
9239 @opindex freorder-functions
9240 Reorder functions in the object file in order to
9241 improve code locality.  This is implemented by using special
9242 subsections @code{.text.hot} for most frequently executed functions and
9243 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
9244 the linker so object file format must support named sections and linker must
9245 place them in a reasonable way.
9246
9247 Also profile feedback must be available to make this option effective.  See
9248 @option{-fprofile-arcs} for details.
9249
9250 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9251
9252 @item -fstrict-aliasing
9253 @opindex fstrict-aliasing
9254 Allow the compiler to assume the strictest aliasing rules applicable to
9255 the language being compiled.  For C (and C++), this activates
9256 optimizations based on the type of expressions.  In particular, an
9257 object of one type is assumed never to reside at the same address as an
9258 object of a different type, unless the types are almost the same.  For
9259 example, an @code{unsigned int} can alias an @code{int}, but not a
9260 @code{void*} or a @code{double}.  A character type may alias any other
9261 type.
9262
9263 @anchor{Type-punning}Pay special attention to code like this:
9264 @smallexample
9265 union a_union @{
9266   int i;
9267   double d;
9268 @};
9269
9270 int f() @{
9271   union a_union t;
9272   t.d = 3.0;
9273   return t.i;
9274 @}
9275 @end smallexample
9276 The practice of reading from a different union member than the one most
9277 recently written to (called ``type-punning'') is common.  Even with
9278 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
9279 is accessed through the union type.  So, the code above works as
9280 expected.  @xref{Structures unions enumerations and bit-fields
9281 implementation}.  However, this code might not:
9282 @smallexample
9283 int f() @{
9284   union a_union t;
9285   int* ip;
9286   t.d = 3.0;
9287   ip = &t.i;
9288   return *ip;
9289 @}
9290 @end smallexample
9291
9292 Similarly, access by taking the address, casting the resulting pointer
9293 and dereferencing the result has undefined behavior, even if the cast
9294 uses a union type, e.g.:
9295 @smallexample
9296 int f() @{
9297   double d = 3.0;
9298   return ((union a_union *) &d)->i;
9299 @}
9300 @end smallexample
9301
9302 The @option{-fstrict-aliasing} option is enabled at levels
9303 @option{-O2}, @option{-O3}, @option{-Os}.
9304
9305 @item -fstrict-overflow
9306 @opindex fstrict-overflow
9307 Allow the compiler to assume strict signed overflow rules, depending
9308 on the language being compiled.  For C (and C++) this means that
9309 overflow when doing arithmetic with signed numbers is undefined, which
9310 means that the compiler may assume that it does not happen.  This
9311 permits various optimizations.  For example, the compiler assumes
9312 that an expression like @code{i + 10 > i} is always true for
9313 signed @code{i}.  This assumption is only valid if signed overflow is
9314 undefined, as the expression is false if @code{i + 10} overflows when
9315 using twos complement arithmetic.  When this option is in effect any
9316 attempt to determine whether an operation on signed numbers 
9317 overflows must be written carefully to not actually involve overflow.
9318
9319 This option also allows the compiler to assume strict pointer
9320 semantics: given a pointer to an object, if adding an offset to that
9321 pointer does not produce a pointer to the same object, the addition is
9322 undefined.  This permits the compiler to conclude that @code{p + u >
9323 p} is always true for a pointer @code{p} and unsigned integer
9324 @code{u}.  This assumption is only valid because pointer wraparound is
9325 undefined, as the expression is false if @code{p + u} overflows using
9326 twos complement arithmetic.
9327
9328 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
9329 that integer signed overflow is fully defined: it wraps.  When
9330 @option{-fwrapv} is used, there is no difference between
9331 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
9332 integers.  With @option{-fwrapv} certain types of overflow are
9333 permitted.  For example, if the compiler gets an overflow when doing
9334 arithmetic on constants, the overflowed value can still be used with
9335 @option{-fwrapv}, but not otherwise.
9336
9337 The @option{-fstrict-overflow} option is enabled at levels
9338 @option{-O2}, @option{-O3}, @option{-Os}.
9339
9340 @item -falign-functions
9341 @itemx -falign-functions=@var{n}
9342 @opindex falign-functions
9343 Align the start of functions to the next power-of-two greater than
9344 @var{n}, skipping up to @var{n} bytes.  For instance,
9345 @option{-falign-functions=32} aligns functions to the next 32-byte
9346 boundary, but @option{-falign-functions=24} aligns to the next
9347 32-byte boundary only if this can be done by skipping 23 bytes or less.
9348
9349 @option{-fno-align-functions} and @option{-falign-functions=1} are
9350 equivalent and mean that functions are not aligned.
9351
9352 Some assemblers only support this flag when @var{n} is a power of two;
9353 in that case, it is rounded up.
9354
9355 If @var{n} is not specified or is zero, use a machine-dependent default.
9356
9357 Enabled at levels @option{-O2}, @option{-O3}.
9358
9359 @item -falign-labels
9360 @itemx -falign-labels=@var{n}
9361 @opindex falign-labels
9362 Align all branch targets to a power-of-two boundary, skipping up to
9363 @var{n} bytes like @option{-falign-functions}.  This option can easily
9364 make code slower, because it must insert dummy operations for when the
9365 branch target is reached in the usual flow of the code.
9366
9367 @option{-fno-align-labels} and @option{-falign-labels=1} are
9368 equivalent and mean that labels are not aligned.
9369
9370 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
9371 are greater than this value, then their values are used instead.
9372
9373 If @var{n} is not specified or is zero, use a machine-dependent default
9374 which is very likely to be @samp{1}, meaning no alignment.
9375
9376 Enabled at levels @option{-O2}, @option{-O3}.
9377
9378 @item -falign-loops
9379 @itemx -falign-loops=@var{n}
9380 @opindex falign-loops
9381 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
9382 like @option{-falign-functions}.  If the loops are
9383 executed many times, this makes up for any execution of the dummy
9384 operations.
9385
9386 @option{-fno-align-loops} and @option{-falign-loops=1} are
9387 equivalent and mean that loops are not aligned.
9388
9389 If @var{n} is not specified or is zero, use a machine-dependent default.
9390
9391 Enabled at levels @option{-O2}, @option{-O3}.
9392
9393 @item -falign-jumps
9394 @itemx -falign-jumps=@var{n}
9395 @opindex falign-jumps
9396 Align branch targets to a power-of-two boundary, for branch targets
9397 where the targets can only be reached by jumping, skipping up to @var{n}
9398 bytes like @option{-falign-functions}.  In this case, no dummy operations
9399 need be executed.
9400
9401 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
9402 equivalent and mean that loops are not aligned.
9403
9404 If @var{n} is not specified or is zero, use a machine-dependent default.
9405
9406 Enabled at levels @option{-O2}, @option{-O3}.
9407
9408 @item -funit-at-a-time
9409 @opindex funit-at-a-time
9410 This option is left for compatibility reasons. @option{-funit-at-a-time}
9411 has no effect, while @option{-fno-unit-at-a-time} implies
9412 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
9413
9414 Enabled by default.
9415
9416 @item -fno-toplevel-reorder
9417 @opindex fno-toplevel-reorder
9418 Do not reorder top-level functions, variables, and @code{asm}
9419 statements.  Output them in the same order that they appear in the
9420 input file.  When this option is used, unreferenced static variables
9421 are not removed.  This option is intended to support existing code
9422 that relies on a particular ordering.  For new code, it is better to
9423 use attributes when possible.
9424
9425 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
9426 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
9427 targets.
9428
9429 @item -fweb
9430 @opindex fweb
9431 Constructs webs as commonly used for register allocation purposes and assign
9432 each web individual pseudo register.  This allows the register allocation pass
9433 to operate on pseudos directly, but also strengthens several other optimization
9434 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
9435 however, make debugging impossible, since variables no longer stay in a
9436 ``home register''.
9437
9438 Enabled by default with @option{-funroll-loops}.
9439
9440 @item -fwhole-program
9441 @opindex fwhole-program
9442 Assume that the current compilation unit represents the whole program being
9443 compiled.  All public functions and variables with the exception of @code{main}
9444 and those merged by attribute @code{externally_visible} become static functions
9445 and in effect are optimized more aggressively by interprocedural optimizers.
9446
9447 This option should not be used in combination with @option{-flto}.
9448 Instead relying on a linker plugin should provide safer and more precise
9449 information.
9450
9451 @item -flto[=@var{n}]
9452 @opindex flto
9453 This option runs the standard link-time optimizer.  When invoked
9454 with source code, it generates GIMPLE (one of GCC's internal
9455 representations) and writes it to special ELF sections in the object
9456 file.  When the object files are linked together, all the function
9457 bodies are read from these ELF sections and instantiated as if they
9458 had been part of the same translation unit.
9459
9460 To use the link-time optimizer, @option{-flto} and optimization
9461 options should be specified at compile time and during the final link.
9462 For example:
9463
9464 @smallexample
9465 gcc -c -O2 -flto foo.c
9466 gcc -c -O2 -flto bar.c
9467 gcc -o myprog -flto -O2 foo.o bar.o
9468 @end smallexample
9469
9470 The first two invocations to GCC save a bytecode representation
9471 of GIMPLE into special ELF sections inside @file{foo.o} and
9472 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
9473 @file{foo.o} and @file{bar.o}, merges the two files into a single
9474 internal image, and compiles the result as usual.  Since both
9475 @file{foo.o} and @file{bar.o} are merged into a single image, this
9476 causes all the interprocedural analyses and optimizations in GCC to
9477 work across the two files as if they were a single one.  This means,
9478 for example, that the inliner is able to inline functions in
9479 @file{bar.o} into functions in @file{foo.o} and vice-versa.
9480
9481 Another (simpler) way to enable link-time optimization is:
9482
9483 @smallexample
9484 gcc -o myprog -flto -O2 foo.c bar.c
9485 @end smallexample
9486
9487 The above generates bytecode for @file{foo.c} and @file{bar.c},
9488 merges them together into a single GIMPLE representation and optimizes
9489 them as usual to produce @file{myprog}.
9490
9491 The only important thing to keep in mind is that to enable link-time
9492 optimizations you need to use the GCC driver to perform the link-step.
9493 GCC then automatically performs link-time optimization if any of the
9494 objects involved were compiled with the @option{-flto} command-line option.  
9495 You generally
9496 should specify the optimization options to be used for link-time
9497 optimization though GCC tries to be clever at guessing an
9498 optimization level to use from the options used at compile-time
9499 if you fail to specify one at link-time.  You can always override
9500 the automatic decision to do link-time optimization at link-time
9501 by passing @option{-fno-lto} to the link command.
9502
9503 To make whole program optimization effective, it is necessary to make
9504 certain whole program assumptions.  The compiler needs to know
9505 what functions and variables can be accessed by libraries and runtime
9506 outside of the link-time optimized unit.  When supported by the linker,
9507 the linker plugin (see @option{-fuse-linker-plugin}) passes information
9508 to the compiler about used and externally visible symbols.  When
9509 the linker plugin is not available, @option{-fwhole-program} should be
9510 used to allow the compiler to make these assumptions, which leads
9511 to more aggressive optimization decisions.
9512
9513 When @option{-fuse-linker-plugin} is not enabled then, when a file is
9514 compiled with @option{-flto}, the generated object file is larger than
9515 a regular object file because it contains GIMPLE bytecodes and the usual
9516 final code (see @option{-ffat-lto-objects}.  This means that
9517 object files with LTO information can be linked as normal object
9518 files; if @option{-fno-lto} is passed to the linker, no
9519 interprocedural optimizations are applied.  Note that when
9520 @option{-fno-fat-lto-objects} is enabled the compile-stage is faster
9521 but you cannot perform a regular, non-LTO link on them.
9522
9523 Additionally, the optimization flags used to compile individual files
9524 are not necessarily related to those used at link time.  For instance,
9525
9526 @smallexample
9527 gcc -c -O0 -ffat-lto-objects -flto foo.c
9528 gcc -c -O0 -ffat-lto-objects -flto bar.c
9529 gcc -o myprog -O3 foo.o bar.o
9530 @end smallexample
9531
9532 This produces individual object files with unoptimized assembler
9533 code, but the resulting binary @file{myprog} is optimized at
9534 @option{-O3}.  If, instead, the final binary is generated with
9535 @option{-fno-lto}, then @file{myprog} is not optimized.
9536
9537 When producing the final binary, GCC only
9538 applies link-time optimizations to those files that contain bytecode.
9539 Therefore, you can mix and match object files and libraries with
9540 GIMPLE bytecodes and final object code.  GCC automatically selects
9541 which files to optimize in LTO mode and which files to link without
9542 further processing.
9543
9544 There are some code generation flags preserved by GCC when
9545 generating bytecodes, as they need to be used during the final link
9546 stage.  Generally options specified at link-time override those
9547 specified at compile-time.
9548
9549 If you do not specify an optimization level option @option{-O} at
9550 link-time then GCC computes one based on the optimization levels
9551 used when compiling the object files.  The highest optimization
9552 level wins here.
9553
9554 Currently, the following options and their setting are take from
9555 the first object file that explicitely specified it: 
9556 @option{-fPIC}, @option{-fpic}, @option{-fpie}, @option{-fcommon},
9557 @option{-fexceptions}, @option{-fnon-call-exceptions}, @option{-fgnu-tm}
9558 and all the @option{-m} target flags.
9559
9560 Certain ABI changing flags are required to match in all compilation-units
9561 and trying to override this at link-time with a conflicting value
9562 is ignored.  This includes options such as @option{-freg-struct-return}
9563 and @option{-fpcc-struct-return}. 
9564
9565 Other options such as @option{-ffp-contract}, @option{-fno-strict-overflow},
9566 @option{-fwrapv}, @option{-fno-trapv} or @option{-fno-strict-aliasing}
9567 are passed through to the link stage and merged conservatively for
9568 conflicting translation units.  Specifically
9569 @option{-fno-strict-overflow}, @option{-fwrapv} and @option{-fno-trapv} take
9570 precedence and for example @option{-ffp-contract=off} takes precedence
9571 over @option{-ffp-contract=fast}.  You can override them at linke-time.
9572
9573 It is recommended that you compile all the files participating in the
9574 same link with the same options and also specify those options at
9575 link time.
9576
9577 If LTO encounters objects with C linkage declared with incompatible
9578 types in separate translation units to be linked together (undefined
9579 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
9580 issued.  The behavior is still undefined at run time.  Similar
9581 diagnostics may be raised for other languages.
9582
9583 Another feature of LTO is that it is possible to apply interprocedural
9584 optimizations on files written in different languages:
9585
9586 @smallexample
9587 gcc -c -flto foo.c
9588 g++ -c -flto bar.cc
9589 gfortran -c -flto baz.f90
9590 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
9591 @end smallexample
9592
9593 Notice that the final link is done with @command{g++} to get the C++
9594 runtime libraries and @option{-lgfortran} is added to get the Fortran
9595 runtime libraries.  In general, when mixing languages in LTO mode, you
9596 should use the same link command options as when mixing languages in a
9597 regular (non-LTO) compilation.
9598
9599 If object files containing GIMPLE bytecode are stored in a library archive, say
9600 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
9601 are using a linker with plugin support.  To create static libraries suitable
9602 for LTO, use @command{gcc-ar} and @command{gcc-ranlib} instead of @command{ar}
9603 and @command{ranlib}; 
9604 to show the symbols of object files with GIMPLE bytecode, use
9605 @command{gcc-nm}.  Those commands require that @command{ar}, @command{ranlib}
9606 and @command{nm} have been compiled with plugin support.  At link time, use the the
9607 flag @option{-fuse-linker-plugin} to ensure that the library participates in
9608 the LTO optimization process:
9609
9610 @smallexample
9611 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
9612 @end smallexample
9613
9614 With the linker plugin enabled, the linker extracts the needed
9615 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
9616 to make them part of the aggregated GIMPLE image to be optimized.
9617
9618 If you are not using a linker with plugin support and/or do not
9619 enable the linker plugin, then the objects inside @file{libfoo.a}
9620 are extracted and linked as usual, but they do not participate
9621 in the LTO optimization process.  In order to make a static library suitable
9622 for both LTO optimization and usual linkage, compile its object files with
9623 @option{-flto} @option{-ffat-lto-objects}.
9624
9625 Link-time optimizations do not require the presence of the whole program to
9626 operate.  If the program does not require any symbols to be exported, it is
9627 possible to combine @option{-flto} and @option{-fwhole-program} to allow
9628 the interprocedural optimizers to use more aggressive assumptions which may
9629 lead to improved optimization opportunities.
9630 Use of @option{-fwhole-program} is not needed when linker plugin is
9631 active (see @option{-fuse-linker-plugin}).
9632
9633 The current implementation of LTO makes no
9634 attempt to generate bytecode that is portable between different
9635 types of hosts.  The bytecode files are versioned and there is a
9636 strict version check, so bytecode files generated in one version of
9637 GCC do not work with an older or newer version of GCC.
9638
9639 Link-time optimization does not work well with generation of debugging
9640 information.  Combining @option{-flto} with
9641 @option{-g} is currently experimental and expected to produce unexpected
9642 results.
9643
9644 If you specify the optional @var{n}, the optimization and code
9645 generation done at link time is executed in parallel using @var{n}
9646 parallel jobs by utilizing an installed @command{make} program.  The
9647 environment variable @env{MAKE} may be used to override the program
9648 used.  The default value for @var{n} is 1.
9649
9650 You can also specify @option{-flto=jobserver} to use GNU make's
9651 job server mode to determine the number of parallel jobs. This
9652 is useful when the Makefile calling GCC is already executing in parallel.
9653 You must prepend a @samp{+} to the command recipe in the parent Makefile
9654 for this to work.  This option likely only works if @env{MAKE} is
9655 GNU make.
9656
9657 @item -flto-partition=@var{alg}
9658 @opindex flto-partition
9659 Specify the partitioning algorithm used by the link-time optimizer.
9660 The value is either @samp{1to1} to specify a partitioning mirroring
9661 the original source files or @samp{balanced} to specify partitioning
9662 into equally sized chunks (whenever possible) or @samp{max} to create
9663 new partition for every symbol where possible.  Specifying @samp{none}
9664 as an algorithm disables partitioning and streaming completely. 
9665 The default value is @samp{balanced}. While @samp{1to1} can be used
9666 as an workaround for various code ordering issues, the @samp{max}
9667 partitioning is intended for internal testing only.
9668 The value @samp{one} specifies that exactly one partition should be
9669 used while the value @samp{none} bypasses partitioning and executes
9670 the link-time optimization step directly from the WPA phase.
9671
9672 @item -flto-odr-type-merging
9673 @opindex flto-odr-type-merging
9674 Enable streaming of mangled types names of C++ types and their unification
9675 at linktime.  This increases size of LTO object files, but enable
9676 diagnostics about One Definition Rule violations.
9677
9678 @item -flto-compression-level=@var{n}
9679 @opindex flto-compression-level
9680 This option specifies the level of compression used for intermediate
9681 language written to LTO object files, and is only meaningful in
9682 conjunction with LTO mode (@option{-flto}).  Valid
9683 values are 0 (no compression) to 9 (maximum compression).  Values
9684 outside this range are clamped to either 0 or 9.  If the option is not
9685 given, a default balanced compression setting is used.
9686
9687 @item -flto-report
9688 @opindex flto-report
9689 Prints a report with internal details on the workings of the link-time
9690 optimizer.  The contents of this report vary from version to version.
9691 It is meant to be useful to GCC developers when processing object
9692 files in LTO mode (via @option{-flto}).
9693
9694 Disabled by default.
9695
9696 @item -flto-report-wpa
9697 @opindex flto-report-wpa
9698 Like @option{-flto-report}, but only print for the WPA phase of Link
9699 Time Optimization.
9700
9701 @item -fuse-linker-plugin
9702 @opindex fuse-linker-plugin
9703 Enables the use of a linker plugin during link-time optimization.  This
9704 option relies on plugin support in the linker, which is available in gold
9705 or in GNU ld 2.21 or newer.
9706
9707 This option enables the extraction of object files with GIMPLE bytecode out
9708 of library archives. This improves the quality of optimization by exposing
9709 more code to the link-time optimizer.  This information specifies what
9710 symbols can be accessed externally (by non-LTO object or during dynamic
9711 linking).  Resulting code quality improvements on binaries (and shared
9712 libraries that use hidden visibility) are similar to @option{-fwhole-program}.
9713 See @option{-flto} for a description of the effect of this flag and how to
9714 use it.
9715
9716 This option is enabled by default when LTO support in GCC is enabled
9717 and GCC was configured for use with
9718 a linker supporting plugins (GNU ld 2.21 or newer or gold).
9719
9720 @item -ffat-lto-objects
9721 @opindex ffat-lto-objects
9722 Fat LTO objects are object files that contain both the intermediate language
9723 and the object code. This makes them usable for both LTO linking and normal
9724 linking. This option is effective only when compiling with @option{-flto}
9725 and is ignored at link time.
9726
9727 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
9728 requires the complete toolchain to be aware of LTO. It requires a linker with
9729 linker plugin support for basic functionality.  Additionally,
9730 @command{nm}, @command{ar} and @command{ranlib}
9731 need to support linker plugins to allow a full-featured build environment
9732 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
9733 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
9734 to these tools. With non fat LTO makefiles need to be modified to use them.
9735
9736 The default is @option{-fno-fat-lto-objects} on targets with linker plugin
9737 support.
9738
9739 @item -fcompare-elim
9740 @opindex fcompare-elim
9741 After register allocation and post-register allocation instruction splitting,
9742 identify arithmetic instructions that compute processor flags similar to a
9743 comparison operation based on that arithmetic.  If possible, eliminate the
9744 explicit comparison operation.
9745
9746 This pass only applies to certain targets that cannot explicitly represent
9747 the comparison operation before register allocation is complete.
9748
9749 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9750
9751 @item -fcprop-registers
9752 @opindex fcprop-registers
9753 After register allocation and post-register allocation instruction splitting,
9754 perform a copy-propagation pass to try to reduce scheduling dependencies
9755 and occasionally eliminate the copy.
9756
9757 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9758
9759 @item -fprofile-correction
9760 @opindex fprofile-correction
9761 Profiles collected using an instrumented binary for multi-threaded programs may
9762 be inconsistent due to missed counter updates. When this option is specified,
9763 GCC uses heuristics to correct or smooth out such inconsistencies. By
9764 default, GCC emits an error message when an inconsistent profile is detected.
9765
9766 @item -fprofile-dir=@var{path}
9767 @opindex fprofile-dir
9768
9769 Set the directory to search for the profile data files in to @var{path}.
9770 This option affects only the profile data generated by
9771 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
9772 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
9773 and its related options.  Both absolute and relative paths can be used.
9774 By default, GCC uses the current directory as @var{path}, thus the
9775 profile data file appears in the same directory as the object file.
9776
9777 @item -fprofile-generate
9778 @itemx -fprofile-generate=@var{path}
9779 @opindex fprofile-generate
9780
9781 Enable options usually used for instrumenting application to produce
9782 profile useful for later recompilation with profile feedback based
9783 optimization.  You must use @option{-fprofile-generate} both when
9784 compiling and when linking your program.
9785
9786 The following options are enabled: @option{-fprofile-arcs}, @option{-fprofile-values}, @option{-fvpt}.
9787
9788 If @var{path} is specified, GCC looks at the @var{path} to find
9789 the profile feedback data files. See @option{-fprofile-dir}.
9790
9791 @item -fprofile-use
9792 @itemx -fprofile-use=@var{path}
9793 @opindex fprofile-use
9794 Enable profile feedback-directed optimizations, 
9795 and the following optimizations
9796 which are generally profitable only with profile feedback available:
9797 @option{-fbranch-probabilities}, @option{-fvpt},
9798 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
9799 @option{-ftree-vectorize}, and @option{ftree-loop-distribute-patterns}.
9800
9801 By default, GCC emits an error message if the feedback profiles do not
9802 match the source code.  This error can be turned into a warning by using
9803 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
9804 code.
9805
9806 If @var{path} is specified, GCC looks at the @var{path} to find
9807 the profile feedback data files. See @option{-fprofile-dir}.
9808
9809 @item -fauto-profile
9810 @itemx -fauto-profile=@var{path}
9811 @opindex fauto-profile
9812 Enable sampling-based feedback-directed optimizations, 
9813 and the following optimizations
9814 which are generally profitable only with profile feedback available:
9815 @option{-fbranch-probabilities}, @option{-fvpt},
9816 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
9817 @option{-ftree-vectorize},
9818 @option{-finline-functions}, @option{-fipa-cp}, @option{-fipa-cp-clone},
9819 @option{-fpredictive-commoning}, @option{-funswitch-loops},
9820 @option{-fgcse-after-reload}, and @option{-ftree-loop-distribute-patterns}.
9821
9822 @var{path} is the name of a file containing AutoFDO profile information.
9823 If omitted, it defaults to @file{fbdata.afdo} in the current directory.
9824
9825 Producing an AutoFDO profile data file requires running your program
9826 with the @command{perf} utility on a supported GNU/Linux target system.
9827 For more information, see @uref{https://perf.wiki.kernel.org/}.
9828
9829 E.g.
9830 @smallexample
9831 perf record -e br_inst_retired:near_taken -b -o perf.data \
9832     -- your_program
9833 @end smallexample
9834
9835 Then use the @command{create_gcov} tool to convert the raw profile data
9836 to a format that can be used by GCC.@  You must also supply the 
9837 unstripped binary for your program to this tool.  
9838 See @uref{https://github.com/google/autofdo}.
9839
9840 E.g.
9841 @smallexample
9842 create_gcov --binary=your_program.unstripped --profile=perf.data \
9843     --gcov=profile.afdo
9844 @end smallexample
9845 @end table
9846
9847 The following options control compiler behavior regarding floating-point 
9848 arithmetic.  These options trade off between speed and
9849 correctness.  All must be specifically enabled.
9850
9851 @table @gcctabopt
9852 @item -ffloat-store
9853 @opindex ffloat-store
9854 Do not store floating-point variables in registers, and inhibit other
9855 options that might change whether a floating-point value is taken from a
9856 register or memory.
9857
9858 @cindex floating-point precision
9859 This option prevents undesirable excess precision on machines such as
9860 the 68000 where the floating registers (of the 68881) keep more
9861 precision than a @code{double} is supposed to have.  Similarly for the
9862 x86 architecture.  For most programs, the excess precision does only
9863 good, but a few programs rely on the precise definition of IEEE floating
9864 point.  Use @option{-ffloat-store} for such programs, after modifying
9865 them to store all pertinent intermediate computations into variables.
9866
9867 @item -fexcess-precision=@var{style}
9868 @opindex fexcess-precision
9869 This option allows further control over excess precision on machines
9870 where floating-point registers have more precision than the IEEE
9871 @code{float} and @code{double} types and the processor does not
9872 support operations rounding to those types.  By default,
9873 @option{-fexcess-precision=fast} is in effect; this means that
9874 operations are carried out in the precision of the registers and that
9875 it is unpredictable when rounding to the types specified in the source
9876 code takes place.  When compiling C, if
9877 @option{-fexcess-precision=standard} is specified then excess
9878 precision follows the rules specified in ISO C99; in particular,
9879 both casts and assignments cause values to be rounded to their
9880 semantic types (whereas @option{-ffloat-store} only affects
9881 assignments).  This option is enabled by default for C if a strict
9882 conformance option such as @option{-std=c99} is used.
9883
9884 @opindex mfpmath
9885 @option{-fexcess-precision=standard} is not implemented for languages
9886 other than C, and has no effect if
9887 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
9888 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
9889 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
9890 semantics apply without excess precision, and in the latter, rounding
9891 is unpredictable.
9892
9893 @item -ffast-math
9894 @opindex ffast-math
9895 Sets the options @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
9896 @option{-ffinite-math-only}, @option{-fno-rounding-math},
9897 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
9898
9899 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
9900
9901 This option is not turned on by any @option{-O} option besides
9902 @option{-Ofast} since it can result in incorrect output for programs
9903 that depend on an exact implementation of IEEE or ISO rules/specifications
9904 for math functions. It may, however, yield faster code for programs
9905 that do not require the guarantees of these specifications.
9906
9907 @item -fno-math-errno
9908 @opindex fno-math-errno
9909 Do not set @code{errno} after calling math functions that are executed
9910 with a single instruction, e.g., @code{sqrt}.  A program that relies on
9911 IEEE exceptions for math error handling may want to use this flag
9912 for speed while maintaining IEEE arithmetic compatibility.
9913
9914 This option is not turned on by any @option{-O} option since
9915 it can result in incorrect output for programs that depend on
9916 an exact implementation of IEEE or ISO rules/specifications for
9917 math functions. It may, however, yield faster code for programs
9918 that do not require the guarantees of these specifications.
9919
9920 The default is @option{-fmath-errno}.
9921
9922 On Darwin systems, the math library never sets @code{errno}.  There is
9923 therefore no reason for the compiler to consider the possibility that
9924 it might, and @option{-fno-math-errno} is the default.
9925
9926 @item -funsafe-math-optimizations
9927 @opindex funsafe-math-optimizations
9928
9929 Allow optimizations for floating-point arithmetic that (a) assume
9930 that arguments and results are valid and (b) may violate IEEE or
9931 ANSI standards.  When used at link-time, it may include libraries
9932 or startup files that change the default FPU control word or other
9933 similar optimizations.
9934
9935 This option is not turned on by any @option{-O} option since
9936 it can result in incorrect output for programs that depend on
9937 an exact implementation of IEEE or ISO rules/specifications for
9938 math functions. It may, however, yield faster code for programs
9939 that do not require the guarantees of these specifications.
9940 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
9941 @option{-fassociative-math} and @option{-freciprocal-math}.
9942
9943 The default is @option{-fno-unsafe-math-optimizations}.
9944
9945 @item -fassociative-math
9946 @opindex fassociative-math
9947
9948 Allow re-association of operands in series of floating-point operations.
9949 This violates the ISO C and C++ language standard by possibly changing
9950 computation result.  NOTE: re-ordering may change the sign of zero as
9951 well as ignore NaNs and inhibit or create underflow or overflow (and
9952 thus cannot be used on code that relies on rounding behavior like
9953 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
9954 and thus may not be used when ordered comparisons are required.
9955 This option requires that both @option{-fno-signed-zeros} and
9956 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
9957 much sense with @option{-frounding-math}. For Fortran the option
9958 is automatically enabled when both @option{-fno-signed-zeros} and
9959 @option{-fno-trapping-math} are in effect.
9960
9961 The default is @option{-fno-associative-math}.
9962
9963 @item -freciprocal-math
9964 @opindex freciprocal-math
9965
9966 Allow the reciprocal of a value to be used instead of dividing by
9967 the value if this enables optimizations.  For example @code{x / y}
9968 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
9969 is subject to common subexpression elimination.  Note that this loses
9970 precision and increases the number of flops operating on the value.
9971
9972 The default is @option{-fno-reciprocal-math}.
9973
9974 @item -ffinite-math-only
9975 @opindex ffinite-math-only
9976 Allow optimizations for floating-point arithmetic that assume
9977 that arguments and results are not NaNs or +-Infs.
9978
9979 This option is not turned on by any @option{-O} option since
9980 it can result in incorrect output for programs that depend on
9981 an exact implementation of IEEE or ISO rules/specifications for
9982 math functions. It may, however, yield faster code for programs
9983 that do not require the guarantees of these specifications.
9984
9985 The default is @option{-fno-finite-math-only}.
9986
9987 @item -fno-signed-zeros
9988 @opindex fno-signed-zeros
9989 Allow optimizations for floating-point arithmetic that ignore the
9990 signedness of zero.  IEEE arithmetic specifies the behavior of
9991 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
9992 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
9993 This option implies that the sign of a zero result isn't significant.
9994
9995 The default is @option{-fsigned-zeros}.
9996
9997 @item -fno-trapping-math
9998 @opindex fno-trapping-math
9999 Compile code assuming that floating-point operations cannot generate
10000 user-visible traps.  These traps include division by zero, overflow,
10001 underflow, inexact result and invalid operation.  This option requires
10002 that @option{-fno-signaling-nans} be in effect.  Setting this option may
10003 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
10004
10005 This option should never be turned on by any @option{-O} option since
10006 it can result in incorrect output for programs that depend on
10007 an exact implementation of IEEE or ISO rules/specifications for
10008 math functions.
10009
10010 The default is @option{-ftrapping-math}.
10011
10012 @item -frounding-math
10013 @opindex frounding-math
10014 Disable transformations and optimizations that assume default floating-point
10015 rounding behavior.  This is round-to-zero for all floating point
10016 to integer conversions, and round-to-nearest for all other arithmetic
10017 truncations.  This option should be specified for programs that change
10018 the FP rounding mode dynamically, or that may be executed with a
10019 non-default rounding mode.  This option disables constant folding of
10020 floating-point expressions at compile time (which may be affected by
10021 rounding mode) and arithmetic transformations that are unsafe in the
10022 presence of sign-dependent rounding modes.
10023
10024 The default is @option{-fno-rounding-math}.
10025
10026 This option is experimental and does not currently guarantee to
10027 disable all GCC optimizations that are affected by rounding mode.
10028 Future versions of GCC may provide finer control of this setting
10029 using C99's @code{FENV_ACCESS} pragma.  This command-line option
10030 will be used to specify the default state for @code{FENV_ACCESS}.
10031
10032 @item -fsignaling-nans
10033 @opindex fsignaling-nans
10034 Compile code assuming that IEEE signaling NaNs may generate user-visible
10035 traps during floating-point operations.  Setting this option disables
10036 optimizations that may change the number of exceptions visible with
10037 signaling NaNs.  This option implies @option{-ftrapping-math}.
10038
10039 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
10040 be defined.
10041
10042 The default is @option{-fno-signaling-nans}.
10043
10044 This option is experimental and does not currently guarantee to
10045 disable all GCC optimizations that affect signaling NaN behavior.
10046
10047 @item -fsingle-precision-constant
10048 @opindex fsingle-precision-constant
10049 Treat floating-point constants as single precision instead of
10050 implicitly converting them to double-precision constants.
10051
10052 @item -fcx-limited-range
10053 @opindex fcx-limited-range
10054 When enabled, this option states that a range reduction step is not
10055 needed when performing complex division.  Also, there is no checking
10056 whether the result of a complex multiplication or division is @code{NaN
10057 + I*NaN}, with an attempt to rescue the situation in that case.  The
10058 default is @option{-fno-cx-limited-range}, but is enabled by
10059 @option{-ffast-math}.
10060
10061 This option controls the default setting of the ISO C99
10062 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
10063 all languages.
10064
10065 @item -fcx-fortran-rules
10066 @opindex fcx-fortran-rules
10067 Complex multiplication and division follow Fortran rules.  Range
10068 reduction is done as part of complex division, but there is no checking
10069 whether the result of a complex multiplication or division is @code{NaN
10070 + I*NaN}, with an attempt to rescue the situation in that case.
10071
10072 The default is @option{-fno-cx-fortran-rules}.
10073
10074 @end table
10075
10076 The following options control optimizations that may improve
10077 performance, but are not enabled by any @option{-O} options.  This
10078 section includes experimental options that may produce broken code.
10079
10080 @table @gcctabopt
10081 @item -fbranch-probabilities
10082 @opindex fbranch-probabilities
10083 After running a program compiled with @option{-fprofile-arcs}
10084 (@pxref{Debugging Options,, Options for Debugging Your Program or
10085 @command{gcc}}), you can compile it a second time using
10086 @option{-fbranch-probabilities}, to improve optimizations based on
10087 the number of times each branch was taken.  When a program
10088 compiled with @option{-fprofile-arcs} exits, it saves arc execution
10089 counts to a file called @file{@var{sourcename}.gcda} for each source
10090 file.  The information in this data file is very dependent on the
10091 structure of the generated code, so you must use the same source code
10092 and the same optimization options for both compilations.
10093
10094 With @option{-fbranch-probabilities}, GCC puts a
10095 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
10096 These can be used to improve optimization.  Currently, they are only
10097 used in one place: in @file{reorg.c}, instead of guessing which path a
10098 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
10099 exactly determine which path is taken more often.
10100
10101 @item -fprofile-values
10102 @opindex fprofile-values
10103 If combined with @option{-fprofile-arcs}, it adds code so that some
10104 data about values of expressions in the program is gathered.
10105
10106 With @option{-fbranch-probabilities}, it reads back the data gathered
10107 from profiling values of expressions for usage in optimizations.
10108
10109 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
10110
10111 @item -fprofile-reorder-functions
10112 @opindex fprofile-reorder-functions
10113 Function reordering based on profile instrumentation collects
10114 first time of execution of a function and orders these functions
10115 in ascending order.
10116
10117 Enabled with @option{-fprofile-use}.
10118
10119 @item -fvpt
10120 @opindex fvpt
10121 If combined with @option{-fprofile-arcs}, this option instructs the compiler
10122 to add code to gather information about values of expressions.
10123
10124 With @option{-fbranch-probabilities}, it reads back the data gathered
10125 and actually performs the optimizations based on them.
10126 Currently the optimizations include specialization of division operations
10127 using the knowledge about the value of the denominator.
10128
10129 @item -frename-registers
10130 @opindex frename-registers
10131 Attempt to avoid false dependencies in scheduled code by making use
10132 of registers left over after register allocation.  This optimization
10133 most benefits processors with lots of registers.  Depending on the
10134 debug information format adopted by the target, however, it can
10135 make debugging impossible, since variables no longer stay in
10136 a ``home register''.
10137
10138 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
10139
10140 @item -fschedule-fusion
10141 @opindex fschedule-fusion
10142 Performs a target dependent pass over the instruction stream to schedule
10143 instructions of same type together because target machine can execute them
10144 more efficiently if they are adjacent to each other in the instruction flow.
10145
10146 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
10147
10148 @item -ftracer
10149 @opindex ftracer
10150 Perform tail duplication to enlarge superblock size.  This transformation
10151 simplifies the control flow of the function allowing other optimizations to do
10152 a better job.
10153
10154 Enabled with @option{-fprofile-use}.
10155
10156 @item -funroll-loops
10157 @opindex funroll-loops
10158 Unroll loops whose number of iterations can be determined at compile time or
10159 upon entry to the loop.  @option{-funroll-loops} implies
10160 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
10161 It also turns on complete loop peeling (i.e.@: complete removal of loops with
10162 a small constant number of iterations).  This option makes code larger, and may
10163 or may not make it run faster.
10164
10165 Enabled with @option{-fprofile-use}.
10166
10167 @item -funroll-all-loops
10168 @opindex funroll-all-loops
10169 Unroll all loops, even if their number of iterations is uncertain when
10170 the loop is entered.  This usually makes programs run more slowly.
10171 @option{-funroll-all-loops} implies the same options as
10172 @option{-funroll-loops}.
10173
10174 @item -fpeel-loops
10175 @opindex fpeel-loops
10176 Peels loops for which there is enough information that they do not
10177 roll much (from profile feedback).  It also turns on complete loop peeling
10178 (i.e.@: complete removal of loops with small constant number of iterations).
10179
10180 Enabled with @option{-fprofile-use}.
10181
10182 @item -fmove-loop-invariants
10183 @opindex fmove-loop-invariants
10184 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
10185 at level @option{-O1}
10186
10187 @item -funswitch-loops
10188 @opindex funswitch-loops
10189 Move branches with loop invariant conditions out of the loop, with duplicates
10190 of the loop on both branches (modified according to result of the condition).
10191
10192 @item -ffunction-sections
10193 @itemx -fdata-sections
10194 @opindex ffunction-sections
10195 @opindex fdata-sections
10196 Place each function or data item into its own section in the output
10197 file if the target supports arbitrary sections.  The name of the
10198 function or the name of the data item determines the section's name
10199 in the output file.
10200
10201 Use these options on systems where the linker can perform optimizations
10202 to improve locality of reference in the instruction space.  Most systems
10203 using the ELF object format and SPARC processors running Solaris 2 have
10204 linkers with such optimizations.  AIX may have these optimizations in
10205 the future.
10206
10207 Only use these options when there are significant benefits from doing
10208 so.  When you specify these options, the assembler and linker
10209 create larger object and executable files and are also slower.
10210 You cannot use @command{gprof} on all systems if you
10211 specify this option, and you may have problems with debugging if
10212 you specify both this option and @option{-g}.
10213
10214 @item -fbranch-target-load-optimize
10215 @opindex fbranch-target-load-optimize
10216 Perform branch target register load optimization before prologue / epilogue
10217 threading.
10218 The use of target registers can typically be exposed only during reload,
10219 thus hoisting loads out of loops and doing inter-block scheduling needs
10220 a separate optimization pass.
10221
10222 @item -fbranch-target-load-optimize2
10223 @opindex fbranch-target-load-optimize2
10224 Perform branch target register load optimization after prologue / epilogue
10225 threading.
10226
10227 @item -fbtr-bb-exclusive
10228 @opindex fbtr-bb-exclusive
10229 When performing branch target register load optimization, don't reuse
10230 branch target registers within any basic block.
10231
10232 @item -fstack-protector
10233 @opindex fstack-protector
10234 Emit extra code to check for buffer overflows, such as stack smashing
10235 attacks.  This is done by adding a guard variable to functions with
10236 vulnerable objects.  This includes functions that call @code{alloca}, and
10237 functions with buffers larger than 8 bytes.  The guards are initialized
10238 when a function is entered and then checked when the function exits.
10239 If a guard check fails, an error message is printed and the program exits.
10240
10241 @item -fstack-protector-all
10242 @opindex fstack-protector-all
10243 Like @option{-fstack-protector} except that all functions are protected.
10244
10245 @item -fstack-protector-strong
10246 @opindex fstack-protector-strong
10247 Like @option{-fstack-protector} but includes additional functions to
10248 be protected --- those that have local array definitions, or have
10249 references to local frame addresses.
10250
10251 @item -fstack-protector-explicit
10252 @opindex fstack-protector-explicit
10253 Like @option{-fstack-protector} but only protects those functions which
10254 have the @code{stack_protect} attribute
10255
10256 @item -fstdarg-opt
10257 @opindex fstdarg-opt
10258 Optimize the prologue of variadic argument functions with respect to usage of
10259 those arguments.
10260
10261 @item -fsection-anchors
10262 @opindex fsection-anchors
10263 Try to reduce the number of symbolic address calculations by using
10264 shared ``anchor'' symbols to address nearby objects.  This transformation
10265 can help to reduce the number of GOT entries and GOT accesses on some
10266 targets.
10267
10268 For example, the implementation of the following function @code{foo}:
10269
10270 @smallexample
10271 static int a, b, c;
10272 int foo (void) @{ return a + b + c; @}
10273 @end smallexample
10274
10275 @noindent
10276 usually calculates the addresses of all three variables, but if you
10277 compile it with @option{-fsection-anchors}, it accesses the variables
10278 from a common anchor point instead.  The effect is similar to the
10279 following pseudocode (which isn't valid C):
10280
10281 @smallexample
10282 int foo (void)
10283 @{
10284   register int *xr = &x;
10285   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
10286 @}
10287 @end smallexample
10288
10289 Not all targets support this option.
10290
10291 @item --param @var{name}=@var{value}
10292 @opindex param
10293 In some places, GCC uses various constants to control the amount of
10294 optimization that is done.  For example, GCC does not inline functions
10295 that contain more than a certain number of instructions.  You can
10296 control some of these constants on the command line using the
10297 @option{--param} option.
10298
10299 The names of specific parameters, and the meaning of the values, are
10300 tied to the internals of the compiler, and are subject to change
10301 without notice in future releases.
10302
10303 In each case, the @var{value} is an integer.  The allowable choices for
10304 @var{name} are:
10305
10306 @table @gcctabopt
10307 @item predictable-branch-outcome
10308 When branch is predicted to be taken with probability lower than this threshold
10309 (in percent), then it is considered well predictable. The default is 10.
10310
10311 @item max-crossjump-edges
10312 The maximum number of incoming edges to consider for cross-jumping.
10313 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
10314 the number of edges incoming to each block.  Increasing values mean
10315 more aggressive optimization, making the compilation time increase with
10316 probably small improvement in executable size.
10317
10318 @item min-crossjump-insns
10319 The minimum number of instructions that must be matched at the end
10320 of two blocks before cross-jumping is performed on them.  This
10321 value is ignored in the case where all instructions in the block being
10322 cross-jumped from are matched.  The default value is 5.
10323
10324 @item max-grow-copy-bb-insns
10325 The maximum code size expansion factor when copying basic blocks
10326 instead of jumping.  The expansion is relative to a jump instruction.
10327 The default value is 8.
10328
10329 @item max-goto-duplication-insns
10330 The maximum number of instructions to duplicate to a block that jumps
10331 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
10332 passes, GCC factors computed gotos early in the compilation process,
10333 and unfactors them as late as possible.  Only computed jumps at the
10334 end of a basic blocks with no more than max-goto-duplication-insns are
10335 unfactored.  The default value is 8.
10336
10337 @item max-delay-slot-insn-search
10338 The maximum number of instructions to consider when looking for an
10339 instruction to fill a delay slot.  If more than this arbitrary number of
10340 instructions are searched, the time savings from filling the delay slot
10341 are minimal, so stop searching.  Increasing values mean more
10342 aggressive optimization, making the compilation time increase with probably
10343 small improvement in execution time.
10344
10345 @item max-delay-slot-live-search
10346 When trying to fill delay slots, the maximum number of instructions to
10347 consider when searching for a block with valid live register
10348 information.  Increasing this arbitrarily chosen value means more
10349 aggressive optimization, increasing the compilation time.  This parameter
10350 should be removed when the delay slot code is rewritten to maintain the
10351 control-flow graph.
10352
10353 @item max-gcse-memory
10354 The approximate maximum amount of memory that can be allocated in
10355 order to perform the global common subexpression elimination
10356 optimization.  If more memory than specified is required, the
10357 optimization is not done.
10358
10359 @item max-gcse-insertion-ratio
10360 If the ratio of expression insertions to deletions is larger than this value
10361 for any expression, then RTL PRE inserts or removes the expression and thus
10362 leaves partially redundant computations in the instruction stream.  The default value is 20.
10363
10364 @item max-pending-list-length
10365 The maximum number of pending dependencies scheduling allows
10366 before flushing the current state and starting over.  Large functions
10367 with few branches or calls can create excessively large lists which
10368 needlessly consume memory and resources.
10369
10370 @item max-modulo-backtrack-attempts
10371 The maximum number of backtrack attempts the scheduler should make
10372 when modulo scheduling a loop.  Larger values can exponentially increase
10373 compilation time.
10374
10375 @item max-inline-insns-single
10376 Several parameters control the tree inliner used in GCC@.
10377 This number sets the maximum number of instructions (counted in GCC's
10378 internal representation) in a single function that the tree inliner
10379 considers for inlining.  This only affects functions declared
10380 inline and methods implemented in a class declaration (C++).
10381 The default value is 400.
10382
10383 @item max-inline-insns-auto
10384 When you use @option{-finline-functions} (included in @option{-O3}),
10385 a lot of functions that would otherwise not be considered for inlining
10386 by the compiler are investigated.  To those functions, a different
10387 (more restrictive) limit compared to functions declared inline can
10388 be applied.
10389 The default value is 40.
10390
10391 @item inline-min-speedup
10392 When estimated performance improvement of caller + callee runtime exceeds this
10393 threshold (in precent), the function can be inlined regardless the limit on
10394 @option{--param max-inline-insns-single} and @option{--param
10395 max-inline-insns-auto}.
10396
10397 @item large-function-insns
10398 The limit specifying really large functions.  For functions larger than this
10399 limit after inlining, inlining is constrained by
10400 @option{--param large-function-growth}.  This parameter is useful primarily
10401 to avoid extreme compilation time caused by non-linear algorithms used by the
10402 back end.
10403 The default value is 2700.
10404
10405 @item large-function-growth
10406 Specifies maximal growth of large function caused by inlining in percents.
10407 The default value is 100 which limits large function growth to 2.0 times
10408 the original size.
10409
10410 @item large-unit-insns
10411 The limit specifying large translation unit.  Growth caused by inlining of
10412 units larger than this limit is limited by @option{--param inline-unit-growth}.
10413 For small units this might be too tight.
10414 For example, consider a unit consisting of function A
10415 that is inline and B that just calls A three times.  If B is small relative to
10416 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
10417 large units consisting of small inlineable functions, however, the overall unit
10418 growth limit is needed to avoid exponential explosion of code size.  Thus for
10419 smaller units, the size is increased to @option{--param large-unit-insns}
10420 before applying @option{--param inline-unit-growth}.  The default is 10000.
10421
10422 @item inline-unit-growth
10423 Specifies maximal overall growth of the compilation unit caused by inlining.
10424 The default value is 20 which limits unit growth to 1.2 times the original
10425 size. Cold functions (either marked cold via an attribute or by profile
10426 feedback) are not accounted into the unit size.
10427
10428 @item ipcp-unit-growth
10429 Specifies maximal overall growth of the compilation unit caused by
10430 interprocedural constant propagation.  The default value is 10 which limits
10431 unit growth to 1.1 times the original size.
10432
10433 @item large-stack-frame
10434 The limit specifying large stack frames.  While inlining the algorithm is trying
10435 to not grow past this limit too much.  The default value is 256 bytes.
10436
10437 @item large-stack-frame-growth
10438 Specifies maximal growth of large stack frames caused by inlining in percents.
10439 The default value is 1000 which limits large stack frame growth to 11 times
10440 the original size.
10441
10442 @item max-inline-insns-recursive
10443 @itemx max-inline-insns-recursive-auto
10444 Specifies the maximum number of instructions an out-of-line copy of a
10445 self-recursive inline
10446 function can grow into by performing recursive inlining.
10447
10448 @option{--param max-inline-insns-recursive} applies to functions
10449 declared inline.
10450 For functions not declared inline, recursive inlining
10451 happens only when @option{-finline-functions} (included in @option{-O3}) is
10452 enabled; @option{--param max-inline-insns-recursive-auto} applies instead.  The
10453 default value is 450.
10454
10455 @item max-inline-recursive-depth
10456 @itemx max-inline-recursive-depth-auto
10457 Specifies the maximum recursion depth used for recursive inlining.
10458
10459 @option{--param max-inline-recursive-depth} applies to functions
10460 declared inline.  For functions not declared inline, recursive inlining
10461 happens only when @option{-finline-functions} (included in @option{-O3}) is
10462 enabled; @option{--param max-inline-recursive-depth-auto} applies instead.  The
10463 default value is 8.
10464
10465 @item min-inline-recursive-probability
10466 Recursive inlining is profitable only for function having deep recursion
10467 in average and can hurt for function having little recursion depth by
10468 increasing the prologue size or complexity of function body to other
10469 optimizers.
10470
10471 When profile feedback is available (see @option{-fprofile-generate}) the actual
10472 recursion depth can be guessed from probability that function recurses via a
10473 given call expression.  This parameter limits inlining only to call expressions
10474 whose probability exceeds the given threshold (in percents).
10475 The default value is 10.
10476
10477 @item early-inlining-insns
10478 Specify growth that the early inliner can make.  In effect it increases
10479 the amount of inlining for code having a large abstraction penalty.
10480 The default value is 14.
10481
10482 @item max-early-inliner-iterations
10483 Limit of iterations of the early inliner.  This basically bounds
10484 the number of nested indirect calls the early inliner can resolve.
10485 Deeper chains are still handled by late inlining.
10486
10487 @item comdat-sharing-probability
10488 Probability (in percent) that C++ inline function with comdat visibility
10489 are shared across multiple compilation units.  The default value is 20.
10490
10491 @item profile-func-internal-id
10492 A parameter to control whether to use function internal id in profile
10493 database lookup. If the value is 0, the compiler uses an id that
10494 is based on function assembler name and filename, which makes old profile
10495 data more tolerant to source changes such as function reordering etc.
10496 The default value is 0.
10497
10498 @item min-vect-loop-bound
10499 The minimum number of iterations under which loops are not vectorized
10500 when @option{-ftree-vectorize} is used.  The number of iterations after
10501 vectorization needs to be greater than the value specified by this option
10502 to allow vectorization.  The default value is 0.
10503
10504 @item gcse-cost-distance-ratio
10505 Scaling factor in calculation of maximum distance an expression
10506 can be moved by GCSE optimizations.  This is currently supported only in the
10507 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
10508 is with simple expressions, i.e., the expressions that have cost
10509 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
10510 hoisting of simple expressions.  The default value is 10.
10511
10512 @item gcse-unrestricted-cost
10513 Cost, roughly measured as the cost of a single typical machine
10514 instruction, at which GCSE optimizations do not constrain
10515 the distance an expression can travel.  This is currently
10516 supported only in the code hoisting pass.  The lesser the cost,
10517 the more aggressive code hoisting is.  Specifying 0 
10518 allows all expressions to travel unrestricted distances.
10519 The default value is 3.
10520
10521 @item max-hoist-depth
10522 The depth of search in the dominator tree for expressions to hoist.
10523 This is used to avoid quadratic behavior in hoisting algorithm.
10524 The value of 0 does not limit on the search, but may slow down compilation
10525 of huge functions.  The default value is 30.
10526
10527 @item max-tail-merge-comparisons
10528 The maximum amount of similar bbs to compare a bb with.  This is used to
10529 avoid quadratic behavior in tree tail merging.  The default value is 10.
10530
10531 @item max-tail-merge-iterations
10532 The maximum amount of iterations of the pass over the function.  This is used to
10533 limit compilation time in tree tail merging.  The default value is 2.
10534
10535 @item max-unrolled-insns
10536 The maximum number of instructions that a loop may have to be unrolled.
10537 If a loop is unrolled, this parameter also determines how many times
10538 the loop code is unrolled.
10539
10540 @item max-average-unrolled-insns
10541 The maximum number of instructions biased by probabilities of their execution
10542 that a loop may have to be unrolled.  If a loop is unrolled,
10543 this parameter also determines how many times the loop code is unrolled.
10544
10545 @item max-unroll-times
10546 The maximum number of unrollings of a single loop.
10547
10548 @item max-peeled-insns
10549 The maximum number of instructions that a loop may have to be peeled.
10550 If a loop is peeled, this parameter also determines how many times
10551 the loop code is peeled.
10552
10553 @item max-peel-times
10554 The maximum number of peelings of a single loop.
10555
10556 @item max-peel-branches
10557 The maximum number of branches on the hot path through the peeled sequence.
10558
10559 @item max-completely-peeled-insns
10560 The maximum number of insns of a completely peeled loop.
10561
10562 @item max-completely-peel-times
10563 The maximum number of iterations of a loop to be suitable for complete peeling.
10564
10565 @item max-completely-peel-loop-nest-depth
10566 The maximum depth of a loop nest suitable for complete peeling.
10567
10568 @item max-unswitch-insns
10569 The maximum number of insns of an unswitched loop.
10570
10571 @item max-unswitch-level
10572 The maximum number of branches unswitched in a single loop.
10573
10574 @item lim-expensive
10575 The minimum cost of an expensive expression in the loop invariant motion.
10576
10577 @item iv-consider-all-candidates-bound
10578 Bound on number of candidates for induction variables, below which
10579 all candidates are considered for each use in induction variable
10580 optimizations.  If there are more candidates than this,
10581 only the most relevant ones are considered to avoid quadratic time complexity.
10582
10583 @item iv-max-considered-uses
10584 The induction variable optimizations give up on loops that contain more
10585 induction variable uses.
10586
10587 @item iv-always-prune-cand-set-bound
10588 If the number of candidates in the set is smaller than this value,
10589 always try to remove unnecessary ivs from the set
10590 when adding a new one.
10591
10592 @item scev-max-expr-size
10593 Bound on size of expressions used in the scalar evolutions analyzer.
10594 Large expressions slow the analyzer.
10595
10596 @item scev-max-expr-complexity
10597 Bound on the complexity of the expressions in the scalar evolutions analyzer.
10598 Complex expressions slow the analyzer.
10599
10600 @item vect-max-version-for-alignment-checks
10601 The maximum number of run-time checks that can be performed when
10602 doing loop versioning for alignment in the vectorizer.
10603
10604 @item vect-max-version-for-alias-checks
10605 The maximum number of run-time checks that can be performed when
10606 doing loop versioning for alias in the vectorizer.
10607
10608 @item vect-max-peeling-for-alignment
10609 The maximum number of loop peels to enhance access alignment
10610 for vectorizer. Value -1 means 'no limit'.
10611
10612 @item max-iterations-to-track
10613 The maximum number of iterations of a loop the brute-force algorithm
10614 for analysis of the number of iterations of the loop tries to evaluate.
10615
10616 @item hot-bb-count-ws-permille
10617 A basic block profile count is considered hot if it contributes to 
10618 the given permillage (i.e. 0...1000) of the entire profiled execution.
10619
10620 @item hot-bb-frequency-fraction
10621 Select fraction of the entry block frequency of executions of basic block in
10622 function given basic block needs to have to be considered hot.
10623
10624 @item max-predicted-iterations
10625 The maximum number of loop iterations we predict statically.  This is useful
10626 in cases where a function contains a single loop with known bound and
10627 another loop with unknown bound.
10628 The known number of iterations is predicted correctly, while
10629 the unknown number of iterations average to roughly 10.  This means that the
10630 loop without bounds appears artificially cold relative to the other one.
10631
10632 @item builtin-expect-probability
10633 Control the probability of the expression having the specified value. This
10634 parameter takes a percentage (i.e. 0 ... 100) as input.
10635 The default probability of 90 is obtained empirically.
10636
10637 @item align-threshold
10638
10639 Select fraction of the maximal frequency of executions of a basic block in
10640 a function to align the basic block.
10641
10642 @item align-loop-iterations
10643
10644 A loop expected to iterate at least the selected number of iterations is
10645 aligned.
10646
10647 @item tracer-dynamic-coverage
10648 @itemx tracer-dynamic-coverage-feedback
10649
10650 This value is used to limit superblock formation once the given percentage of
10651 executed instructions is covered.  This limits unnecessary code size
10652 expansion.
10653
10654 The @option{tracer-dynamic-coverage-feedback} parameter
10655 is used only when profile
10656 feedback is available.  The real profiles (as opposed to statically estimated
10657 ones) are much less balanced allowing the threshold to be larger value.
10658
10659 @item tracer-max-code-growth
10660 Stop tail duplication once code growth has reached given percentage.  This is
10661 a rather artificial limit, as most of the duplicates are eliminated later in
10662 cross jumping, so it may be set to much higher values than is the desired code
10663 growth.
10664
10665 @item tracer-min-branch-ratio
10666
10667 Stop reverse growth when the reverse probability of best edge is less than this
10668 threshold (in percent).
10669
10670 @item tracer-min-branch-ratio
10671 @itemx tracer-min-branch-ratio-feedback
10672
10673 Stop forward growth if the best edge has probability lower than this
10674 threshold.
10675
10676 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
10677 compilation for profile feedback and one for compilation without.  The value
10678 for compilation with profile feedback needs to be more conservative (higher) in
10679 order to make tracer effective.
10680
10681 @item max-cse-path-length
10682
10683 The maximum number of basic blocks on path that CSE considers.
10684 The default is 10.
10685
10686 @item max-cse-insns
10687 The maximum number of instructions CSE processes before flushing.
10688 The default is 1000.
10689
10690 @item ggc-min-expand
10691
10692 GCC uses a garbage collector to manage its own memory allocation.  This
10693 parameter specifies the minimum percentage by which the garbage
10694 collector's heap should be allowed to expand between collections.
10695 Tuning this may improve compilation speed; it has no effect on code
10696 generation.
10697
10698 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
10699 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
10700 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
10701 GCC is not able to calculate RAM on a particular platform, the lower
10702 bound of 30% is used.  Setting this parameter and
10703 @option{ggc-min-heapsize} to zero causes a full collection to occur at
10704 every opportunity.  This is extremely slow, but can be useful for
10705 debugging.
10706
10707 @item ggc-min-heapsize
10708
10709 Minimum size of the garbage collector's heap before it begins bothering
10710 to collect garbage.  The first collection occurs after the heap expands
10711 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
10712 tuning this may improve compilation speed, and has no effect on code
10713 generation.
10714
10715 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
10716 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
10717 with a lower bound of 4096 (four megabytes) and an upper bound of
10718 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
10719 particular platform, the lower bound is used.  Setting this parameter
10720 very large effectively disables garbage collection.  Setting this
10721 parameter and @option{ggc-min-expand} to zero causes a full collection
10722 to occur at every opportunity.
10723
10724 @item max-reload-search-insns
10725 The maximum number of instruction reload should look backward for equivalent
10726 register.  Increasing values mean more aggressive optimization, making the
10727 compilation time increase with probably slightly better performance.
10728 The default value is 100.
10729
10730 @item max-cselib-memory-locations
10731 The maximum number of memory locations cselib should take into account.
10732 Increasing values mean more aggressive optimization, making the compilation time
10733 increase with probably slightly better performance.  The default value is 500.
10734
10735 @item reorder-blocks-duplicate
10736 @itemx reorder-blocks-duplicate-feedback
10737
10738 Used by the basic block reordering pass to decide whether to use unconditional
10739 branch or duplicate the code on its destination.  Code is duplicated when its
10740 estimated size is smaller than this value multiplied by the estimated size of
10741 unconditional jump in the hot spots of the program.
10742
10743 The @option{reorder-block-duplicate-feedback} parameter
10744 is used only when profile
10745 feedback is available.  It may be set to higher values than
10746 @option{reorder-block-duplicate} since information about the hot spots is more
10747 accurate.
10748
10749 @item max-sched-ready-insns
10750 The maximum number of instructions ready to be issued the scheduler should
10751 consider at any given time during the first scheduling pass.  Increasing
10752 values mean more thorough searches, making the compilation time increase
10753 with probably little benefit.  The default value is 100.
10754
10755 @item max-sched-region-blocks
10756 The maximum number of blocks in a region to be considered for
10757 interblock scheduling.  The default value is 10.
10758
10759 @item max-pipeline-region-blocks
10760 The maximum number of blocks in a region to be considered for
10761 pipelining in the selective scheduler.  The default value is 15.
10762
10763 @item max-sched-region-insns
10764 The maximum number of insns in a region to be considered for
10765 interblock scheduling.  The default value is 100.
10766
10767 @item max-pipeline-region-insns
10768 The maximum number of insns in a region to be considered for
10769 pipelining in the selective scheduler.  The default value is 200.
10770
10771 @item min-spec-prob
10772 The minimum probability (in percents) of reaching a source block
10773 for interblock speculative scheduling.  The default value is 40.
10774
10775 @item max-sched-extend-regions-iters
10776 The maximum number of iterations through CFG to extend regions.
10777 A value of 0 (the default) disables region extensions.
10778
10779 @item max-sched-insn-conflict-delay
10780 The maximum conflict delay for an insn to be considered for speculative motion.
10781 The default value is 3.
10782
10783 @item sched-spec-prob-cutoff
10784 The minimal probability of speculation success (in percents), so that
10785 speculative insns are scheduled.
10786 The default value is 40.
10787
10788 @item sched-spec-state-edge-prob-cutoff
10789 The minimum probability an edge must have for the scheduler to save its
10790 state across it.
10791 The default value is 10.
10792
10793 @item sched-mem-true-dep-cost
10794 Minimal distance (in CPU cycles) between store and load targeting same
10795 memory locations.  The default value is 1.
10796
10797 @item selsched-max-lookahead
10798 The maximum size of the lookahead window of selective scheduling.  It is a
10799 depth of search for available instructions.
10800 The default value is 50.
10801
10802 @item selsched-max-sched-times
10803 The maximum number of times that an instruction is scheduled during
10804 selective scheduling.  This is the limit on the number of iterations
10805 through which the instruction may be pipelined.  The default value is 2.
10806
10807 @item selsched-max-insns-to-rename
10808 The maximum number of best instructions in the ready list that are considered
10809 for renaming in the selective scheduler.  The default value is 2.
10810
10811 @item sms-min-sc
10812 The minimum value of stage count that swing modulo scheduler
10813 generates.  The default value is 2.
10814
10815 @item max-last-value-rtl
10816 The maximum size measured as number of RTLs that can be recorded in an expression
10817 in combiner for a pseudo register as last known value of that register.  The default
10818 is 10000.
10819
10820 @item max-combine-insns
10821 The maximum number of instructions the RTL combiner tries to combine.
10822 The default value is 2 at @option{-Og} and 4 otherwise.
10823
10824 @item integer-share-limit
10825 Small integer constants can use a shared data structure, reducing the
10826 compiler's memory usage and increasing its speed.  This sets the maximum
10827 value of a shared integer constant.  The default value is 256.
10828
10829 @item ssp-buffer-size
10830 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
10831 protection when @option{-fstack-protection} is used.
10832
10833 @item min-size-for-stack-sharing
10834 The minimum size of variables taking part in stack slot sharing when not
10835 optimizing. The default value is 32.
10836
10837 @item max-jump-thread-duplication-stmts
10838 Maximum number of statements allowed in a block that needs to be
10839 duplicated when threading jumps.
10840
10841 @item max-fields-for-field-sensitive
10842 Maximum number of fields in a structure treated in
10843 a field sensitive manner during pointer analysis.  The default is zero
10844 for @option{-O0} and @option{-O1},
10845 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
10846
10847 @item prefetch-latency
10848 Estimate on average number of instructions that are executed before
10849 prefetch finishes.  The distance prefetched ahead is proportional
10850 to this constant.  Increasing this number may also lead to less
10851 streams being prefetched (see @option{simultaneous-prefetches}).
10852
10853 @item simultaneous-prefetches
10854 Maximum number of prefetches that can run at the same time.
10855
10856 @item l1-cache-line-size
10857 The size of cache line in L1 cache, in bytes.
10858
10859 @item l1-cache-size
10860 The size of L1 cache, in kilobytes.
10861
10862 @item l2-cache-size
10863 The size of L2 cache, in kilobytes.
10864
10865 @item min-insn-to-prefetch-ratio
10866 The minimum ratio between the number of instructions and the
10867 number of prefetches to enable prefetching in a loop.
10868
10869 @item prefetch-min-insn-to-mem-ratio
10870 The minimum ratio between the number of instructions and the
10871 number of memory references to enable prefetching in a loop.
10872
10873 @item use-canonical-types
10874 Whether the compiler should use the ``canonical'' type system.  By
10875 default, this should always be 1, which uses a more efficient internal
10876 mechanism for comparing types in C++ and Objective-C++.  However, if
10877 bugs in the canonical type system are causing compilation failures,
10878 set this value to 0 to disable canonical types.
10879
10880 @item switch-conversion-max-branch-ratio
10881 Switch initialization conversion refuses to create arrays that are
10882 bigger than @option{switch-conversion-max-branch-ratio} times the number of
10883 branches in the switch.
10884
10885 @item max-partial-antic-length
10886 Maximum length of the partial antic set computed during the tree
10887 partial redundancy elimination optimization (@option{-ftree-pre}) when
10888 optimizing at @option{-O3} and above.  For some sorts of source code
10889 the enhanced partial redundancy elimination optimization can run away,
10890 consuming all of the memory available on the host machine.  This
10891 parameter sets a limit on the length of the sets that are computed,
10892 which prevents the runaway behavior.  Setting a value of 0 for
10893 this parameter allows an unlimited set length.
10894
10895 @item sccvn-max-scc-size
10896 Maximum size of a strongly connected component (SCC) during SCCVN
10897 processing.  If this limit is hit, SCCVN processing for the whole
10898 function is not done and optimizations depending on it are
10899 disabled.  The default maximum SCC size is 10000.
10900
10901 @item sccvn-max-alias-queries-per-access
10902 Maximum number of alias-oracle queries we perform when looking for
10903 redundancies for loads and stores.  If this limit is hit the search
10904 is aborted and the load or store is not considered redundant.  The
10905 number of queries is algorithmically limited to the number of
10906 stores on all paths from the load to the function entry.
10907 The default maxmimum number of queries is 1000.
10908
10909 @item ira-max-loops-num
10910 IRA uses regional register allocation by default.  If a function
10911 contains more loops than the number given by this parameter, only at most
10912 the given number of the most frequently-executed loops form regions
10913 for regional register allocation.  The default value of the
10914 parameter is 100.
10915
10916 @item ira-max-conflict-table-size 
10917 Although IRA uses a sophisticated algorithm to compress the conflict
10918 table, the table can still require excessive amounts of memory for
10919 huge functions.  If the conflict table for a function could be more
10920 than the size in MB given by this parameter, the register allocator
10921 instead uses a faster, simpler, and lower-quality
10922 algorithm that does not require building a pseudo-register conflict table.  
10923 The default value of the parameter is 2000.
10924
10925 @item ira-loop-reserved-regs
10926 IRA can be used to evaluate more accurate register pressure in loops
10927 for decisions to move loop invariants (see @option{-O3}).  The number
10928 of available registers reserved for some other purposes is given
10929 by this parameter.  The default value of the parameter is 2, which is
10930 the minimal number of registers needed by typical instructions.
10931 This value is the best found from numerous experiments.
10932
10933 @item lra-inheritance-ebb-probability-cutoff
10934 LRA tries to reuse values reloaded in registers in subsequent insns.
10935 This optimization is called inheritance.  EBB is used as a region to
10936 do this optimization.  The parameter defines a minimal fall-through
10937 edge probability in percentage used to add BB to inheritance EBB in
10938 LRA.  The default value of the parameter is 40.  The value was chosen
10939 from numerous runs of SPEC2000 on x86-64.
10940
10941 @item loop-invariant-max-bbs-in-loop
10942 Loop invariant motion can be very expensive, both in compilation time and
10943 in amount of needed compile-time memory, with very large loops.  Loops
10944 with more basic blocks than this parameter won't have loop invariant
10945 motion optimization performed on them.  The default value of the
10946 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
10947
10948 @item loop-max-datarefs-for-datadeps
10949 Building data dapendencies is expensive for very large loops.  This
10950 parameter limits the number of data references in loops that are
10951 considered for data dependence analysis.  These large loops are no
10952 handled by the optimizations using loop data dependencies.
10953 The default value is 1000.
10954
10955 @item max-vartrack-size
10956 Sets a maximum number of hash table slots to use during variable
10957 tracking dataflow analysis of any function.  If this limit is exceeded
10958 with variable tracking at assignments enabled, analysis for that
10959 function is retried without it, after removing all debug insns from
10960 the function.  If the limit is exceeded even without debug insns, var
10961 tracking analysis is completely disabled for the function.  Setting
10962 the parameter to zero makes it unlimited.
10963
10964 @item max-vartrack-expr-depth
10965 Sets a maximum number of recursion levels when attempting to map
10966 variable names or debug temporaries to value expressions.  This trades
10967 compilation time for more complete debug information.  If this is set too
10968 low, value expressions that are available and could be represented in
10969 debug information may end up not being used; setting this higher may
10970 enable the compiler to find more complex debug expressions, but compile
10971 time and memory use may grow.  The default is 12.
10972
10973 @item min-nondebug-insn-uid
10974 Use uids starting at this parameter for nondebug insns.  The range below
10975 the parameter is reserved exclusively for debug insns created by
10976 @option{-fvar-tracking-assignments}, but debug insns may get
10977 (non-overlapping) uids above it if the reserved range is exhausted.
10978
10979 @item ipa-sra-ptr-growth-factor
10980 IPA-SRA replaces a pointer to an aggregate with one or more new
10981 parameters only when their cumulative size is less or equal to
10982 @option{ipa-sra-ptr-growth-factor} times the size of the original
10983 pointer parameter.
10984
10985 @item sra-max-scalarization-size-Ospeed
10986 @item sra-max-scalarization-size-Osize
10987 The two Scalar Reduction of Aggregates passes (SRA and IPA-SRA) aim to
10988 replace scalar parts of aggregates with uses of independent scalar
10989 variables.  These parameters control the maximum size, in storage units,
10990 of aggregate which is considered for replacement when compiling for
10991 speed
10992 (@option{sra-max-scalarization-size-Ospeed}) or size
10993 (@option{sra-max-scalarization-size-Osize}) respectively.
10994
10995 @item tm-max-aggregate-size
10996 When making copies of thread-local variables in a transaction, this
10997 parameter specifies the size in bytes after which variables are
10998 saved with the logging functions as opposed to save/restore code
10999 sequence pairs.  This option only applies when using
11000 @option{-fgnu-tm}.
11001
11002 @item graphite-max-nb-scop-params
11003 To avoid exponential effects in the Graphite loop transforms, the
11004 number of parameters in a Static Control Part (SCoP) is bounded.  The
11005 default value is 10 parameters.  A variable whose value is unknown at
11006 compilation time and defined outside a SCoP is a parameter of the SCoP.
11007
11008 @item graphite-max-bbs-per-function
11009 To avoid exponential effects in the detection of SCoPs, the size of
11010 the functions analyzed by Graphite is bounded.  The default value is
11011 100 basic blocks.
11012
11013 @item loop-block-tile-size
11014 Loop blocking or strip mining transforms, enabled with
11015 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
11016 loop in the loop nest by a given number of iterations.  The strip
11017 length can be changed using the @option{loop-block-tile-size}
11018 parameter.  The default value is 51 iterations.
11019
11020 @item loop-unroll-jam-size
11021 Specify the unroll factor for the @option{-floop-unroll-and-jam} option.  The 
11022 default value is 4.
11023
11024 @item loop-unroll-jam-depth
11025 Specify the dimension to be unrolled (counting from the most inner loop)
11026 for the  @option{-floop-unroll-and-jam}.  The default value is 2.
11027
11028 @item ipa-cp-value-list-size
11029 IPA-CP attempts to track all possible values and types passed to a function's
11030 parameter in order to propagate them and perform devirtualization.
11031 @option{ipa-cp-value-list-size} is the maximum number of values and types it
11032 stores per one formal parameter of a function.
11033
11034 @item ipa-cp-eval-threshold
11035 IPA-CP calculates its own score of cloning profitability heuristics
11036 and performs those cloning opportunities with scores that exceed
11037 @option{ipa-cp-eval-threshold}.
11038
11039 @item ipa-cp-recursion-penalty
11040 Percentage penalty the recursive functions will receive when they
11041 are evaluated for cloning.
11042
11043 @item ipa-cp-single-call-penalty
11044 Percentage penalty functions containg a single call to another
11045 function will receive when they are evaluated for cloning.
11046
11047
11048 @item ipa-max-agg-items
11049 IPA-CP is also capable to propagate a number of scalar values passed
11050 in an aggregate. @option{ipa-max-agg-items} controls the maximum
11051 number of such values per one parameter.
11052
11053 @item ipa-cp-loop-hint-bonus
11054 When IPA-CP determines that a cloning candidate would make the number
11055 of iterations of a loop known, it adds a bonus of
11056 @option{ipa-cp-loop-hint-bonus} to the profitability score of
11057 the candidate.
11058
11059 @item ipa-cp-array-index-hint-bonus
11060 When IPA-CP determines that a cloning candidate would make the index of
11061 an array access known, it adds a bonus of
11062 @option{ipa-cp-array-index-hint-bonus} to the profitability
11063 score of the candidate.
11064
11065 @item ipa-max-aa-steps
11066 During its analysis of function bodies, IPA-CP employs alias analysis
11067 in order to track values pointed to by function parameters.  In order
11068 not spend too much time analyzing huge functions, it gives up and
11069 consider all memory clobbered after examining
11070 @option{ipa-max-aa-steps} statements modifying memory.
11071
11072 @item lto-partitions
11073 Specify desired number of partitions produced during WHOPR compilation.
11074 The number of partitions should exceed the number of CPUs used for compilation.
11075 The default value is 32.
11076
11077 @item lto-minpartition
11078 Size of minimal partition for WHOPR (in estimated instructions).
11079 This prevents expenses of splitting very small programs into too many
11080 partitions.
11081
11082 @item cxx-max-namespaces-for-diagnostic-help
11083 The maximum number of namespaces to consult for suggestions when C++
11084 name lookup fails for an identifier.  The default is 1000.
11085
11086 @item sink-frequency-threshold
11087 The maximum relative execution frequency (in percents) of the target block
11088 relative to a statement's original block to allow statement sinking of a
11089 statement.  Larger numbers result in more aggressive statement sinking.
11090 The default value is 75.  A small positive adjustment is applied for
11091 statements with memory operands as those are even more profitable so sink.
11092
11093 @item max-stores-to-sink
11094 The maximum number of conditional stores paires that can be sunk.  Set to 0
11095 if either vectorization (@option{-ftree-vectorize}) or if-conversion
11096 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
11097
11098 @item allow-store-data-races
11099 Allow optimizers to introduce new data races on stores.
11100 Set to 1 to allow, otherwise to 0.  This option is enabled by default
11101 at optimization level @option{-Ofast}.
11102
11103 @item case-values-threshold
11104 The smallest number of different values for which it is best to use a
11105 jump-table instead of a tree of conditional branches.  If the value is
11106 0, use the default for the machine.  The default is 0.
11107
11108 @item tree-reassoc-width
11109 Set the maximum number of instructions executed in parallel in
11110 reassociated tree. This parameter overrides target dependent
11111 heuristics used by default if has non zero value.
11112
11113 @item sched-pressure-algorithm
11114 Choose between the two available implementations of
11115 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
11116 and is the more likely to prevent instructions from being reordered.
11117 Algorithm 2 was designed to be a compromise between the relatively
11118 conservative approach taken by algorithm 1 and the rather aggressive
11119 approach taken by the default scheduler.  It relies more heavily on
11120 having a regular register file and accurate register pressure classes.
11121 See @file{haifa-sched.c} in the GCC sources for more details.
11122
11123 The default choice depends on the target.
11124
11125 @item max-slsr-cand-scan
11126 Set the maximum number of existing candidates that are considered when
11127 seeking a basis for a new straight-line strength reduction candidate.
11128
11129 @item asan-globals
11130 Enable buffer overflow detection for global objects.  This kind
11131 of protection is enabled by default if you are using
11132 @option{-fsanitize=address} option.
11133 To disable global objects protection use @option{--param asan-globals=0}.
11134
11135 @item asan-stack
11136 Enable buffer overflow detection for stack objects.  This kind of
11137 protection is enabled by default when using @option{-fsanitize=address}.
11138 To disable stack protection use @option{--param asan-stack=0} option.
11139
11140 @item asan-instrument-reads
11141 Enable buffer overflow detection for memory reads.  This kind of
11142 protection is enabled by default when using @option{-fsanitize=address}.
11143 To disable memory reads protection use
11144 @option{--param asan-instrument-reads=0}.
11145
11146 @item asan-instrument-writes
11147 Enable buffer overflow detection for memory writes.  This kind of
11148 protection is enabled by default when using @option{-fsanitize=address}.
11149 To disable memory writes protection use
11150 @option{--param asan-instrument-writes=0} option.
11151
11152 @item asan-memintrin
11153 Enable detection for built-in functions.  This kind of protection
11154 is enabled by default when using @option{-fsanitize=address}.
11155 To disable built-in functions protection use
11156 @option{--param asan-memintrin=0}.
11157
11158 @item asan-use-after-return
11159 Enable detection of use-after-return.  This kind of protection
11160 is enabled by default when using @option{-fsanitize=address} option.
11161 To disable use-after-return detection use 
11162 @option{--param asan-use-after-return=0}.
11163
11164 @item asan-instrumentation-with-call-threshold
11165 If number of memory accesses in function being instrumented
11166 is greater or equal to this number, use callbacks instead of inline checks.
11167 E.g. to disable inline code use
11168 @option{--param asan-instrumentation-with-call-threshold=0}.
11169
11170 @item chkp-max-ctor-size
11171 Static constructors generated by Pointer Bounds Checker may become very
11172 large and significantly increase compile time at optimization level
11173 @option{-O1} and higher.  This parameter is a maximum nubmer of statements
11174 in a single generated constructor.  Default value is 5000.
11175
11176 @item max-fsm-thread-path-insns
11177 Maximum number of instructions to copy when duplicating blocks on a
11178 finite state automaton jump thread path.  The default is 100.
11179
11180 @item max-fsm-thread-length
11181 Maximum number of basic blocks on a finite state automaton jump thread
11182 path.  The default is 10.
11183
11184 @item max-fsm-thread-paths
11185 Maximum number of new jump thread paths to create for a finite state
11186 automaton.  The default is 50.
11187
11188 @item parloops-chunk-size
11189 Chunk size of omp schedule for loops parallelized by parloops.  The default
11190 is 0.
11191
11192 @item parloops-schedule
11193 Schedule type of omp schedule for loops parallelized by parloops (static,
11194 dynamic, guided, auto, runtime).  The default is static.
11195
11196 @item max-ssa-name-query-depth
11197 Maximum depth of recursion when querying properties of SSA names in things
11198 like fold routines.  One level of recursion corresponds to following a
11199 use-def chain.
11200 @end table
11201 @end table
11202
11203 @node Preprocessor Options
11204 @section Options Controlling the Preprocessor
11205 @cindex preprocessor options
11206 @cindex options, preprocessor
11207
11208 These options control the C preprocessor, which is run on each C source
11209 file before actual compilation.
11210
11211 If you use the @option{-E} option, nothing is done except preprocessing.
11212 Some of these options make sense only together with @option{-E} because
11213 they cause the preprocessor output to be unsuitable for actual
11214 compilation.
11215
11216 @table @gcctabopt
11217 @item -Wp,@var{option}
11218 @opindex Wp
11219 You can use @option{-Wp,@var{option}} to bypass the compiler driver
11220 and pass @var{option} directly through to the preprocessor.  If
11221 @var{option} contains commas, it is split into multiple options at the
11222 commas.  However, many options are modified, translated or interpreted
11223 by the compiler driver before being passed to the preprocessor, and
11224 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
11225 interface is undocumented and subject to change, so whenever possible
11226 you should avoid using @option{-Wp} and let the driver handle the
11227 options instead.
11228
11229 @item -Xpreprocessor @var{option}
11230 @opindex Xpreprocessor
11231 Pass @var{option} as an option to the preprocessor.  You can use this to
11232 supply system-specific preprocessor options that GCC does not 
11233 recognize.
11234
11235 If you want to pass an option that takes an argument, you must use
11236 @option{-Xpreprocessor} twice, once for the option and once for the argument.
11237
11238 @item -no-integrated-cpp
11239 @opindex no-integrated-cpp
11240 Perform preprocessing as a separate pass before compilation.
11241 By default, GCC performs preprocessing as an integrated part of
11242 input tokenization and parsing.
11243 If this option is provided, the appropriate language front end
11244 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
11245 and Objective-C, respectively) is instead invoked twice,
11246 once for preprocessing only and once for actual compilation
11247 of the preprocessed input.
11248 This option may be useful in conjunction with the @option{-B} or
11249 @option{-wrapper} options to specify an alternate preprocessor or
11250 perform additional processing of the program source between
11251 normal preprocessing and compilation.
11252 @end table
11253
11254 @include cppopts.texi
11255
11256 @node Assembler Options
11257 @section Passing Options to the Assembler
11258
11259 @c prevent bad page break with this line
11260 You can pass options to the assembler.
11261
11262 @table @gcctabopt
11263 @item -Wa,@var{option}
11264 @opindex Wa
11265 Pass @var{option} as an option to the assembler.  If @var{option}
11266 contains commas, it is split into multiple options at the commas.
11267
11268 @item -Xassembler @var{option}
11269 @opindex Xassembler
11270 Pass @var{option} as an option to the assembler.  You can use this to
11271 supply system-specific assembler options that GCC does not
11272 recognize.
11273
11274 If you want to pass an option that takes an argument, you must use
11275 @option{-Xassembler} twice, once for the option and once for the argument.
11276
11277 @end table
11278
11279 @node Link Options
11280 @section Options for Linking
11281 @cindex link options
11282 @cindex options, linking
11283
11284 These options come into play when the compiler links object files into
11285 an executable output file.  They are meaningless if the compiler is
11286 not doing a link step.
11287
11288 @table @gcctabopt
11289 @cindex file names
11290 @item @var{object-file-name}
11291 A file name that does not end in a special recognized suffix is
11292 considered to name an object file or library.  (Object files are
11293 distinguished from libraries by the linker according to the file
11294 contents.)  If linking is done, these object files are used as input
11295 to the linker.
11296
11297 @item -c
11298 @itemx -S
11299 @itemx -E
11300 @opindex c
11301 @opindex S
11302 @opindex E
11303 If any of these options is used, then the linker is not run, and
11304 object file names should not be used as arguments.  @xref{Overall
11305 Options}.
11306
11307 @item -fuse-ld=bfd
11308 @opindex fuse-ld=bfd
11309 Use the @command{bfd} linker instead of the default linker.
11310
11311 @item -fuse-ld=gold
11312 @opindex fuse-ld=gold
11313 Use the @command{gold} linker instead of the default linker.
11314
11315 @cindex Libraries
11316 @item -l@var{library}
11317 @itemx -l @var{library}
11318 @opindex l
11319 Search the library named @var{library} when linking.  (The second
11320 alternative with the library as a separate argument is only for
11321 POSIX compliance and is not recommended.)
11322
11323 It makes a difference where in the command you write this option; the
11324 linker searches and processes libraries and object files in the order they
11325 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
11326 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
11327 to functions in @samp{z}, those functions may not be loaded.
11328
11329 The linker searches a standard list of directories for the library,
11330 which is actually a file named @file{lib@var{library}.a}.  The linker
11331 then uses this file as if it had been specified precisely by name.
11332
11333 The directories searched include several standard system directories
11334 plus any that you specify with @option{-L}.
11335
11336 Normally the files found this way are library files---archive files
11337 whose members are object files.  The linker handles an archive file by
11338 scanning through it for members which define symbols that have so far
11339 been referenced but not defined.  But if the file that is found is an
11340 ordinary object file, it is linked in the usual fashion.  The only
11341 difference between using an @option{-l} option and specifying a file name
11342 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
11343 and searches several directories.
11344
11345 @item -lobjc
11346 @opindex lobjc
11347 You need this special case of the @option{-l} option in order to
11348 link an Objective-C or Objective-C++ program.
11349
11350 @item -nostartfiles
11351 @opindex nostartfiles
11352 Do not use the standard system startup files when linking.
11353 The standard system libraries are used normally, unless @option{-nostdlib}
11354 or @option{-nodefaultlibs} is used.
11355
11356 @item -nodefaultlibs
11357 @opindex nodefaultlibs
11358 Do not use the standard system libraries when linking.
11359 Only the libraries you specify are passed to the linker, and options
11360 specifying linkage of the system libraries, such as @option{-static-libgcc}
11361 or @option{-shared-libgcc}, are ignored.  
11362 The standard startup files are used normally, unless @option{-nostartfiles}
11363 is used.  
11364
11365 The compiler may generate calls to @code{memcmp},
11366 @code{memset}, @code{memcpy} and @code{memmove}.
11367 These entries are usually resolved by entries in
11368 libc.  These entry points should be supplied through some other
11369 mechanism when this option is specified.
11370
11371 @item -nostdlib
11372 @opindex nostdlib
11373 Do not use the standard system startup files or libraries when linking.
11374 No startup files and only the libraries you specify are passed to
11375 the linker, and options specifying linkage of the system libraries, such as
11376 @option{-static-libgcc} or @option{-shared-libgcc}, are ignored.
11377
11378 The compiler may generate calls to @code{memcmp}, @code{memset},
11379 @code{memcpy} and @code{memmove}.
11380 These entries are usually resolved by entries in
11381 libc.  These entry points should be supplied through some other
11382 mechanism when this option is specified.
11383
11384 @cindex @option{-lgcc}, use with @option{-nostdlib}
11385 @cindex @option{-nostdlib} and unresolved references
11386 @cindex unresolved references and @option{-nostdlib}
11387 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
11388 @cindex @option{-nodefaultlibs} and unresolved references
11389 @cindex unresolved references and @option{-nodefaultlibs}
11390 One of the standard libraries bypassed by @option{-nostdlib} and
11391 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
11392 which GCC uses to overcome shortcomings of particular machines, or special
11393 needs for some languages.
11394 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
11395 Collection (GCC) Internals},
11396 for more discussion of @file{libgcc.a}.)
11397 In most cases, you need @file{libgcc.a} even when you want to avoid
11398 other standard libraries.  In other words, when you specify @option{-nostdlib}
11399 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
11400 This ensures that you have no unresolved references to internal GCC
11401 library subroutines.
11402 (An example of such an internal subroutine is @code{__main}, used to ensure C++
11403 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
11404 GNU Compiler Collection (GCC) Internals}.)
11405
11406 @item -pie
11407 @opindex pie
11408 Produce a position independent executable on targets that support it.
11409 For predictable results, you must also specify the same set of options
11410 used for compilation (@option{-fpie}, @option{-fPIE},
11411 or model suboptions) when you specify this linker option.
11412
11413 @item -no-pie
11414 @opindex no-pie
11415 Don't produce a position independent executable.
11416
11417 @item -rdynamic
11418 @opindex rdynamic
11419 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
11420 that support it. This instructs the linker to add all symbols, not
11421 only used ones, to the dynamic symbol table. This option is needed
11422 for some uses of @code{dlopen} or to allow obtaining backtraces
11423 from within a program.
11424
11425 @item -s
11426 @opindex s
11427 Remove all symbol table and relocation information from the executable.
11428
11429 @item -static
11430 @opindex static
11431 On systems that support dynamic linking, this prevents linking with the shared
11432 libraries.  On other systems, this option has no effect.
11433
11434 @item -shared
11435 @opindex shared
11436 Produce a shared object which can then be linked with other objects to
11437 form an executable.  Not all systems support this option.  For predictable
11438 results, you must also specify the same set of options used for compilation
11439 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
11440 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
11441 needs to build supplementary stub code for constructors to work.  On
11442 multi-libbed systems, @samp{gcc -shared} must select the correct support
11443 libraries to link against.  Failing to supply the correct flags may lead
11444 to subtle defects.  Supplying them in cases where they are not necessary
11445 is innocuous.}
11446
11447 @item -shared-libgcc
11448 @itemx -static-libgcc
11449 @opindex shared-libgcc
11450 @opindex static-libgcc
11451 On systems that provide @file{libgcc} as a shared library, these options
11452 force the use of either the shared or static version, respectively.
11453 If no shared version of @file{libgcc} was built when the compiler was
11454 configured, these options have no effect.
11455
11456 There are several situations in which an application should use the
11457 shared @file{libgcc} instead of the static version.  The most common
11458 of these is when the application wishes to throw and catch exceptions
11459 across different shared libraries.  In that case, each of the libraries
11460 as well as the application itself should use the shared @file{libgcc}.
11461
11462 Therefore, the G++ and GCJ drivers automatically add
11463 @option{-shared-libgcc} whenever you build a shared library or a main
11464 executable, because C++ and Java programs typically use exceptions, so
11465 this is the right thing to do.
11466
11467 If, instead, you use the GCC driver to create shared libraries, you may
11468 find that they are not always linked with the shared @file{libgcc}.
11469 If GCC finds, at its configuration time, that you have a non-GNU linker
11470 or a GNU linker that does not support option @option{--eh-frame-hdr},
11471 it links the shared version of @file{libgcc} into shared libraries
11472 by default.  Otherwise, it takes advantage of the linker and optimizes
11473 away the linking with the shared version of @file{libgcc}, linking with
11474 the static version of libgcc by default.  This allows exceptions to
11475 propagate through such shared libraries, without incurring relocation
11476 costs at library load time.
11477
11478 However, if a library or main executable is supposed to throw or catch
11479 exceptions, you must link it using the G++ or GCJ driver, as appropriate
11480 for the languages used in the program, or using the option
11481 @option{-shared-libgcc}, such that it is linked with the shared
11482 @file{libgcc}.
11483
11484 @item -static-libasan
11485 @opindex static-libasan
11486 When the @option{-fsanitize=address} option is used to link a program,
11487 the GCC driver automatically links against @option{libasan}.  If
11488 @file{libasan} is available as a shared library, and the @option{-static}
11489 option is not used, then this links against the shared version of
11490 @file{libasan}.  The @option{-static-libasan} option directs the GCC
11491 driver to link @file{libasan} statically, without necessarily linking
11492 other libraries statically.
11493
11494 @item -static-libtsan
11495 @opindex static-libtsan
11496 When the @option{-fsanitize=thread} option is used to link a program,
11497 the GCC driver automatically links against @option{libtsan}.  If
11498 @file{libtsan} is available as a shared library, and the @option{-static}
11499 option is not used, then this links against the shared version of
11500 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
11501 driver to link @file{libtsan} statically, without necessarily linking
11502 other libraries statically.
11503
11504 @item -static-liblsan
11505 @opindex static-liblsan
11506 When the @option{-fsanitize=leak} option is used to link a program,
11507 the GCC driver automatically links against @option{liblsan}.  If
11508 @file{liblsan} is available as a shared library, and the @option{-static}
11509 option is not used, then this links against the shared version of
11510 @file{liblsan}.  The @option{-static-liblsan} option directs the GCC
11511 driver to link @file{liblsan} statically, without necessarily linking
11512 other libraries statically.
11513
11514 @item -static-libubsan
11515 @opindex static-libubsan
11516 When the @option{-fsanitize=undefined} option is used to link a program,
11517 the GCC driver automatically links against @option{libubsan}.  If
11518 @file{libubsan} is available as a shared library, and the @option{-static}
11519 option is not used, then this links against the shared version of
11520 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
11521 driver to link @file{libubsan} statically, without necessarily linking
11522 other libraries statically.
11523
11524 @item -static-libmpx
11525 @opindex static-libmpx
11526 When the @option{-fcheck-pointer bounds} and @option{-mmpx} options are
11527 used to link a program, the GCC driver automatically links against
11528 @file{libmpx}.  If @file{libmpx} is available as a shared library,
11529 and the @option{-static} option is not used, then this links against
11530 the shared version of @file{libmpx}.  The @option{-static-libmpx}
11531 option directs the GCC driver to link @file{libmpx} statically,
11532 without necessarily linking other libraries statically.
11533
11534 @item -static-libmpxwrappers
11535 @opindex static-libmpxwrappers
11536 When the @option{-fcheck-pointer bounds} and @option{-mmpx} options are used
11537 to link a program without also using @option{-fno-chkp-use-wrappers}, the
11538 GCC driver automatically links against @file{libmpxwrappers}.  If
11539 @file{libmpxwrappers} is available as a shared library, and the
11540 @option{-static} option is not used, then this links against the shared
11541 version of @file{libmpxwrappers}.  The @option{-static-libmpxwrappers}
11542 option directs the GCC driver to link @file{libmpxwrappers} statically,
11543 without necessarily linking other libraries statically.
11544
11545 @item -static-libstdc++
11546 @opindex static-libstdc++
11547 When the @command{g++} program is used to link a C++ program, it
11548 normally automatically links against @option{libstdc++}.  If
11549 @file{libstdc++} is available as a shared library, and the
11550 @option{-static} option is not used, then this links against the
11551 shared version of @file{libstdc++}.  That is normally fine.  However, it
11552 is sometimes useful to freeze the version of @file{libstdc++} used by
11553 the program without going all the way to a fully static link.  The
11554 @option{-static-libstdc++} option directs the @command{g++} driver to
11555 link @file{libstdc++} statically, without necessarily linking other
11556 libraries statically.
11557
11558 @item -symbolic
11559 @opindex symbolic
11560 Bind references to global symbols when building a shared object.  Warn
11561 about any unresolved references (unless overridden by the link editor
11562 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
11563 this option.
11564
11565 @item -T @var{script}
11566 @opindex T
11567 @cindex linker script
11568 Use @var{script} as the linker script.  This option is supported by most
11569 systems using the GNU linker.  On some targets, such as bare-board
11570 targets without an operating system, the @option{-T} option may be required
11571 when linking to avoid references to undefined symbols.
11572
11573 @item -Xlinker @var{option}
11574 @opindex Xlinker
11575 Pass @var{option} as an option to the linker.  You can use this to
11576 supply system-specific linker options that GCC does not recognize.
11577
11578 If you want to pass an option that takes a separate argument, you must use
11579 @option{-Xlinker} twice, once for the option and once for the argument.
11580 For example, to pass @option{-assert definitions}, you must write
11581 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
11582 @option{-Xlinker "-assert definitions"}, because this passes the entire
11583 string as a single argument, which is not what the linker expects.
11584
11585 When using the GNU linker, it is usually more convenient to pass
11586 arguments to linker options using the @option{@var{option}=@var{value}}
11587 syntax than as separate arguments.  For example, you can specify
11588 @option{-Xlinker -Map=output.map} rather than
11589 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
11590 this syntax for command-line options.
11591
11592 @item -Wl,@var{option}
11593 @opindex Wl
11594 Pass @var{option} as an option to the linker.  If @var{option} contains
11595 commas, it is split into multiple options at the commas.  You can use this
11596 syntax to pass an argument to the option.
11597 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
11598 linker.  When using the GNU linker, you can also get the same effect with
11599 @option{-Wl,-Map=output.map}.
11600
11601 @item -u @var{symbol}
11602 @opindex u
11603 Pretend the symbol @var{symbol} is undefined, to force linking of
11604 library modules to define it.  You can use @option{-u} multiple times with
11605 different symbols to force loading of additional library modules.
11606
11607 @item -z @var{keyword}
11608 @opindex z
11609 @option{-z} is passed directly on to the linker along with the keyword
11610 @var{keyword}. See the section in the documentation of your linker for
11611 permitted values and their meanings.
11612 @end table
11613
11614 @node Directory Options
11615 @section Options for Directory Search
11616 @cindex directory options
11617 @cindex options, directory search
11618 @cindex search path
11619
11620 These options specify directories to search for header files, for
11621 libraries and for parts of the compiler:
11622
11623 @table @gcctabopt
11624 @item -I@var{dir}
11625 @opindex I
11626 Add the directory @var{dir} to the head of the list of directories to be
11627 searched for header files.  This can be used to override a system header
11628 file, substituting your own version, since these directories are
11629 searched before the system header file directories.  However, you should
11630 not use this option to add directories that contain vendor-supplied
11631 system header files (use @option{-isystem} for that).  If you use more than
11632 one @option{-I} option, the directories are scanned in left-to-right
11633 order; the standard system directories come after.
11634
11635 If a standard system include directory, or a directory specified with
11636 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
11637 option is ignored.  The directory is still searched but as a
11638 system directory at its normal position in the system include chain.
11639 This is to ensure that GCC's procedure to fix buggy system headers and
11640 the ordering for the @code{include_next} directive are not inadvertently changed.
11641 If you really need to change the search order for system directories,
11642 use the @option{-nostdinc} and/or @option{-isystem} options.
11643
11644 @item -iplugindir=@var{dir}
11645 @opindex iplugindir=
11646 Set the directory to search for plugins that are passed
11647 by @option{-fplugin=@var{name}} instead of
11648 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
11649 to be used by the user, but only passed by the driver.
11650
11651 @item -iquote@var{dir}
11652 @opindex iquote
11653 Add the directory @var{dir} to the head of the list of directories to
11654 be searched for header files only for the case of @code{#include
11655 "@var{file}"}; they are not searched for @code{#include <@var{file}>},
11656 otherwise just like @option{-I}.
11657
11658 @item -L@var{dir}
11659 @opindex L
11660 Add directory @var{dir} to the list of directories to be searched
11661 for @option{-l}.
11662
11663 @item -B@var{prefix}
11664 @opindex B
11665 This option specifies where to find the executables, libraries,
11666 include files, and data files of the compiler itself.
11667
11668 The compiler driver program runs one or more of the subprograms
11669 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
11670 @var{prefix} as a prefix for each program it tries to run, both with and
11671 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
11672
11673 For each subprogram to be run, the compiler driver first tries the
11674 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
11675 is not specified, the driver tries two standard prefixes, 
11676 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
11677 those results in a file name that is found, the unmodified program
11678 name is searched for using the directories specified in your
11679 @env{PATH} environment variable.
11680
11681 The compiler checks to see if the path provided by @option{-B}
11682 refers to a directory, and if necessary it adds a directory
11683 separator character at the end of the path.
11684
11685 @option{-B} prefixes that effectively specify directory names also apply
11686 to libraries in the linker, because the compiler translates these
11687 options into @option{-L} options for the linker.  They also apply to
11688 include files in the preprocessor, because the compiler translates these
11689 options into @option{-isystem} options for the preprocessor.  In this case,
11690 the compiler appends @samp{include} to the prefix.
11691
11692 The runtime support file @file{libgcc.a} can also be searched for using
11693 the @option{-B} prefix, if needed.  If it is not found there, the two
11694 standard prefixes above are tried, and that is all.  The file is left
11695 out of the link if it is not found by those means.
11696
11697 Another way to specify a prefix much like the @option{-B} prefix is to use
11698 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
11699 Variables}.
11700
11701 As a special kludge, if the path provided by @option{-B} is
11702 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
11703 9, then it is replaced by @file{[dir/]include}.  This is to help
11704 with boot-strapping the compiler.
11705
11706 @item -specs=@var{file}
11707 @opindex specs
11708 Process @var{file} after the compiler reads in the standard @file{specs}
11709 file, in order to override the defaults which the @command{gcc} driver
11710 program uses when determining what switches to pass to @command{cc1},
11711 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
11712 @option{-specs=@var{file}} can be specified on the command line, and they
11713 are processed in order, from left to right.
11714
11715 @item --sysroot=@var{dir}
11716 @opindex sysroot
11717 Use @var{dir} as the logical root directory for headers and libraries.
11718 For example, if the compiler normally searches for headers in
11719 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
11720 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
11721
11722 If you use both this option and the @option{-isysroot} option, then
11723 the @option{--sysroot} option applies to libraries, but the
11724 @option{-isysroot} option applies to header files.
11725
11726 The GNU linker (beginning with version 2.16) has the necessary support
11727 for this option.  If your linker does not support this option, the
11728 header file aspect of @option{--sysroot} still works, but the
11729 library aspect does not.
11730
11731 @item --no-sysroot-suffix
11732 @opindex no-sysroot-suffix
11733 For some targets, a suffix is added to the root directory specified
11734 with @option{--sysroot}, depending on the other options used, so that
11735 headers may for example be found in
11736 @file{@var{dir}/@var{suffix}/usr/include} instead of
11737 @file{@var{dir}/usr/include}.  This option disables the addition of
11738 such a suffix.
11739
11740 @item -I-
11741 @opindex I-
11742 This option has been deprecated.  Please use @option{-iquote} instead for
11743 @option{-I} directories before the @option{-I-} and remove the @option{-I-}
11744 option.
11745 Any directories you specify with @option{-I} options before the @option{-I-}
11746 option are searched only for the case of @code{#include "@var{file}"};
11747 they are not searched for @code{#include <@var{file}>}.
11748
11749 If additional directories are specified with @option{-I} options after
11750 the @option{-I-} option, these directories are searched for all @code{#include}
11751 directives.  (Ordinarily @emph{all} @option{-I} directories are used
11752 this way.)
11753
11754 In addition, the @option{-I-} option inhibits the use of the current
11755 directory (where the current input file came from) as the first search
11756 directory for @code{#include "@var{file}"}.  There is no way to
11757 override this effect of @option{-I-}.  With @option{-I.} you can specify
11758 searching the directory that is current when the compiler is
11759 invoked.  That is not exactly the same as what the preprocessor does
11760 by default, but it is often satisfactory.
11761
11762 @option{-I-} does not inhibit the use of the standard system directories
11763 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
11764 independent.
11765 @end table
11766
11767 @c man end
11768
11769 @node Spec Files
11770 @section Specifying Subprocesses and the Switches to Pass to Them
11771 @cindex Spec Files
11772
11773 @command{gcc} is a driver program.  It performs its job by invoking a
11774 sequence of other programs to do the work of compiling, assembling and
11775 linking.  GCC interprets its command-line parameters and uses these to
11776 deduce which programs it should invoke, and which command-line options
11777 it ought to place on their command lines.  This behavior is controlled
11778 by @dfn{spec strings}.  In most cases there is one spec string for each
11779 program that GCC can invoke, but a few programs have multiple spec
11780 strings to control their behavior.  The spec strings built into GCC can
11781 be overridden by using the @option{-specs=} command-line switch to specify
11782 a spec file.
11783
11784 @dfn{Spec files} are plaintext files that are used to construct spec
11785 strings.  They consist of a sequence of directives separated by blank
11786 lines.  The type of directive is determined by the first non-whitespace
11787 character on the line, which can be one of the following:
11788
11789 @table @code
11790 @item %@var{command}
11791 Issues a @var{command} to the spec file processor.  The commands that can
11792 appear here are:
11793
11794 @table @code
11795 @item %include <@var{file}>
11796 @cindex @code{%include}
11797 Search for @var{file} and insert its text at the current point in the
11798 specs file.
11799
11800 @item %include_noerr <@var{file}>
11801 @cindex @code{%include_noerr}
11802 Just like @samp{%include}, but do not generate an error message if the include
11803 file cannot be found.
11804
11805 @item %rename @var{old_name} @var{new_name}
11806 @cindex @code{%rename}
11807 Rename the spec string @var{old_name} to @var{new_name}.
11808
11809 @end table
11810
11811 @item *[@var{spec_name}]:
11812 This tells the compiler to create, override or delete the named spec
11813 string.  All lines after this directive up to the next directive or
11814 blank line are considered to be the text for the spec string.  If this
11815 results in an empty string then the spec is deleted.  (Or, if the
11816 spec did not exist, then nothing happens.)  Otherwise, if the spec
11817 does not currently exist a new spec is created.  If the spec does
11818 exist then its contents are overridden by the text of this
11819 directive, unless the first character of that text is the @samp{+}
11820 character, in which case the text is appended to the spec.
11821
11822 @item [@var{suffix}]:
11823 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
11824 and up to the next directive or blank line are considered to make up the
11825 spec string for the indicated suffix.  When the compiler encounters an
11826 input file with the named suffix, it processes the spec string in
11827 order to work out how to compile that file.  For example:
11828
11829 @smallexample
11830 .ZZ:
11831 z-compile -input %i
11832 @end smallexample
11833
11834 This says that any input file whose name ends in @samp{.ZZ} should be
11835 passed to the program @samp{z-compile}, which should be invoked with the
11836 command-line switch @option{-input} and with the result of performing the
11837 @samp{%i} substitution.  (See below.)
11838
11839 As an alternative to providing a spec string, the text following a
11840 suffix directive can be one of the following:
11841
11842 @table @code
11843 @item @@@var{language}
11844 This says that the suffix is an alias for a known @var{language}.  This is
11845 similar to using the @option{-x} command-line switch to GCC to specify a
11846 language explicitly.  For example:
11847
11848 @smallexample
11849 .ZZ:
11850 @@c++
11851 @end smallexample
11852
11853 Says that .ZZ files are, in fact, C++ source files.
11854
11855 @item #@var{name}
11856 This causes an error messages saying:
11857
11858 @smallexample
11859 @var{name} compiler not installed on this system.
11860 @end smallexample
11861 @end table
11862
11863 GCC already has an extensive list of suffixes built into it.
11864 This directive adds an entry to the end of the list of suffixes, but
11865 since the list is searched from the end backwards, it is effectively
11866 possible to override earlier entries using this technique.
11867
11868 @end table
11869
11870 GCC has the following spec strings built into it.  Spec files can
11871 override these strings or create their own.  Note that individual
11872 targets can also add their own spec strings to this list.
11873
11874 @smallexample
11875 asm          Options to pass to the assembler
11876 asm_final    Options to pass to the assembler post-processor
11877 cpp          Options to pass to the C preprocessor
11878 cc1          Options to pass to the C compiler
11879 cc1plus      Options to pass to the C++ compiler
11880 endfile      Object files to include at the end of the link
11881 link         Options to pass to the linker
11882 lib          Libraries to include on the command line to the linker
11883 libgcc       Decides which GCC support library to pass to the linker
11884 linker       Sets the name of the linker
11885 predefines   Defines to be passed to the C preprocessor
11886 signed_char  Defines to pass to CPP to say whether @code{char} is signed
11887              by default
11888 startfile    Object files to include at the start of the link
11889 @end smallexample
11890
11891 Here is a small example of a spec file:
11892
11893 @smallexample
11894 %rename lib                 old_lib
11895
11896 *lib:
11897 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
11898 @end smallexample
11899
11900 This example renames the spec called @samp{lib} to @samp{old_lib} and
11901 then overrides the previous definition of @samp{lib} with a new one.
11902 The new definition adds in some extra command-line options before
11903 including the text of the old definition.
11904
11905 @dfn{Spec strings} are a list of command-line options to be passed to their
11906 corresponding program.  In addition, the spec strings can contain
11907 @samp{%}-prefixed sequences to substitute variable text or to
11908 conditionally insert text into the command line.  Using these constructs
11909 it is possible to generate quite complex command lines.
11910
11911 Here is a table of all defined @samp{%}-sequences for spec
11912 strings.  Note that spaces are not generated automatically around the
11913 results of expanding these sequences.  Therefore you can concatenate them
11914 together or combine them with constant text in a single argument.
11915
11916 @table @code
11917 @item %%
11918 Substitute one @samp{%} into the program name or argument.
11919
11920 @item %i
11921 Substitute the name of the input file being processed.
11922
11923 @item %b
11924 Substitute the basename of the input file being processed.
11925 This is the substring up to (and not including) the last period
11926 and not including the directory.
11927
11928 @item %B
11929 This is the same as @samp{%b}, but include the file suffix (text after
11930 the last period).
11931
11932 @item %d
11933 Marks the argument containing or following the @samp{%d} as a
11934 temporary file name, so that that file is deleted if GCC exits
11935 successfully.  Unlike @samp{%g}, this contributes no text to the
11936 argument.
11937
11938 @item %g@var{suffix}
11939 Substitute a file name that has suffix @var{suffix} and is chosen
11940 once per compilation, and mark the argument in the same way as
11941 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
11942 name is now chosen in a way that is hard to predict even when previously
11943 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
11944 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
11945 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
11946 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
11947 was simply substituted with a file name chosen once per compilation,
11948 without regard to any appended suffix (which was therefore treated
11949 just like ordinary text), making such attacks more likely to succeed.
11950
11951 @item %u@var{suffix}
11952 Like @samp{%g}, but generates a new temporary file name
11953 each time it appears instead of once per compilation.
11954
11955 @item %U@var{suffix}
11956 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
11957 new one if there is no such last file name.  In the absence of any
11958 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
11959 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
11960 involves the generation of two distinct file names, one
11961 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
11962 simply substituted with a file name chosen for the previous @samp{%u},
11963 without regard to any appended suffix.
11964
11965 @item %j@var{suffix}
11966 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
11967 writable, and if @option{-save-temps} is not used; 
11968 otherwise, substitute the name
11969 of a temporary file, just like @samp{%u}.  This temporary file is not
11970 meant for communication between processes, but rather as a junk
11971 disposal mechanism.
11972
11973 @item %|@var{suffix}
11974 @itemx %m@var{suffix}
11975 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
11976 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
11977 all.  These are the two most common ways to instruct a program that it
11978 should read from standard input or write to standard output.  If you
11979 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
11980 construct: see for example @file{f/lang-specs.h}.
11981
11982 @item %.@var{SUFFIX}
11983 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
11984 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
11985 terminated by the next space or %.
11986
11987 @item %w
11988 Marks the argument containing or following the @samp{%w} as the
11989 designated output file of this compilation.  This puts the argument
11990 into the sequence of arguments that @samp{%o} substitutes.
11991
11992 @item %o
11993 Substitutes the names of all the output files, with spaces
11994 automatically placed around them.  You should write spaces
11995 around the @samp{%o} as well or the results are undefined.
11996 @samp{%o} is for use in the specs for running the linker.
11997 Input files whose names have no recognized suffix are not compiled
11998 at all, but they are included among the output files, so they are
11999 linked.
12000
12001 @item %O
12002 Substitutes the suffix for object files.  Note that this is
12003 handled specially when it immediately follows @samp{%g, %u, or %U},
12004 because of the need for those to form complete file names.  The
12005 handling is such that @samp{%O} is treated exactly as if it had already
12006 been substituted, except that @samp{%g, %u, and %U} do not currently
12007 support additional @var{suffix} characters following @samp{%O} as they do
12008 following, for example, @samp{.o}.
12009
12010 @item %p
12011 Substitutes the standard macro predefinitions for the
12012 current target machine.  Use this when running @command{cpp}.
12013
12014 @item %P
12015 Like @samp{%p}, but puts @samp{__} before and after the name of each
12016 predefined macro, except for macros that start with @samp{__} or with
12017 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
12018 C@.
12019
12020 @item %I
12021 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
12022 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
12023 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
12024 and @option{-imultilib} as necessary.
12025
12026 @item %s
12027 Current argument is the name of a library or startup file of some sort.
12028 Search for that file in a standard list of directories and substitute
12029 the full name found.  The current working directory is included in the
12030 list of directories scanned.
12031
12032 @item %T
12033 Current argument is the name of a linker script.  Search for that file
12034 in the current list of directories to scan for libraries. If the file
12035 is located insert a @option{--script} option into the command line
12036 followed by the full path name found.  If the file is not found then
12037 generate an error message.  Note: the current working directory is not
12038 searched.
12039
12040 @item %e@var{str}
12041 Print @var{str} as an error message.  @var{str} is terminated by a newline.
12042 Use this when inconsistent options are detected.
12043
12044 @item %(@var{name})
12045 Substitute the contents of spec string @var{name} at this point.
12046
12047 @item %x@{@var{option}@}
12048 Accumulate an option for @samp{%X}.
12049
12050 @item %X
12051 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
12052 spec string.
12053
12054 @item %Y
12055 Output the accumulated assembler options specified by @option{-Wa}.
12056
12057 @item %Z
12058 Output the accumulated preprocessor options specified by @option{-Wp}.
12059
12060 @item %a
12061 Process the @code{asm} spec.  This is used to compute the
12062 switches to be passed to the assembler.
12063
12064 @item %A
12065 Process the @code{asm_final} spec.  This is a spec string for
12066 passing switches to an assembler post-processor, if such a program is
12067 needed.
12068
12069 @item %l
12070 Process the @code{link} spec.  This is the spec for computing the
12071 command line passed to the linker.  Typically it makes use of the
12072 @samp{%L %G %S %D and %E} sequences.
12073
12074 @item %D
12075 Dump out a @option{-L} option for each directory that GCC believes might
12076 contain startup files.  If the target supports multilibs then the
12077 current multilib directory is prepended to each of these paths.
12078
12079 @item %L
12080 Process the @code{lib} spec.  This is a spec string for deciding which
12081 libraries are included on the command line to the linker.
12082
12083 @item %G
12084 Process the @code{libgcc} spec.  This is a spec string for deciding
12085 which GCC support library is included on the command line to the linker.
12086
12087 @item %S
12088 Process the @code{startfile} spec.  This is a spec for deciding which
12089 object files are the first ones passed to the linker.  Typically
12090 this might be a file named @file{crt0.o}.
12091
12092 @item %E
12093 Process the @code{endfile} spec.  This is a spec string that specifies
12094 the last object files that are passed to the linker.
12095
12096 @item %C
12097 Process the @code{cpp} spec.  This is used to construct the arguments
12098 to be passed to the C preprocessor.
12099
12100 @item %1
12101 Process the @code{cc1} spec.  This is used to construct the options to be
12102 passed to the actual C compiler (@command{cc1}).
12103
12104 @item %2
12105 Process the @code{cc1plus} spec.  This is used to construct the options to be
12106 passed to the actual C++ compiler (@command{cc1plus}).
12107
12108 @item %*
12109 Substitute the variable part of a matched option.  See below.
12110 Note that each comma in the substituted string is replaced by
12111 a single space.
12112
12113 @item %<@code{S}
12114 Remove all occurrences of @code{-S} from the command line.  Note---this
12115 command is position dependent.  @samp{%} commands in the spec string
12116 before this one see @code{-S}, @samp{%} commands in the spec string
12117 after this one do not.
12118
12119 @item %:@var{function}(@var{args})
12120 Call the named function @var{function}, passing it @var{args}.
12121 @var{args} is first processed as a nested spec string, then split
12122 into an argument vector in the usual fashion.  The function returns
12123 a string which is processed as if it had appeared literally as part
12124 of the current spec.
12125
12126 The following built-in spec functions are provided:
12127
12128 @table @code
12129 @item @code{getenv}
12130 The @code{getenv} spec function takes two arguments: an environment
12131 variable name and a string.  If the environment variable is not
12132 defined, a fatal error is issued.  Otherwise, the return value is the
12133 value of the environment variable concatenated with the string.  For
12134 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
12135
12136 @smallexample
12137 %:getenv(TOPDIR /include)
12138 @end smallexample
12139
12140 expands to @file{/path/to/top/include}.
12141
12142 @item @code{if-exists}
12143 The @code{if-exists} spec function takes one argument, an absolute
12144 pathname to a file.  If the file exists, @code{if-exists} returns the
12145 pathname.  Here is a small example of its usage:
12146
12147 @smallexample
12148 *startfile:
12149 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
12150 @end smallexample
12151
12152 @item @code{if-exists-else}
12153 The @code{if-exists-else} spec function is similar to the @code{if-exists}
12154 spec function, except that it takes two arguments.  The first argument is
12155 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
12156 returns the pathname.  If it does not exist, it returns the second argument.
12157 This way, @code{if-exists-else} can be used to select one file or another,
12158 based on the existence of the first.  Here is a small example of its usage:
12159
12160 @smallexample
12161 *startfile:
12162 crt0%O%s %:if-exists(crti%O%s) \
12163 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
12164 @end smallexample
12165
12166 @item @code{replace-outfile}
12167 The @code{replace-outfile} spec function takes two arguments.  It looks for the
12168 first argument in the outfiles array and replaces it with the second argument.  Here
12169 is a small example of its usage:
12170
12171 @smallexample
12172 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
12173 @end smallexample
12174
12175 @item @code{remove-outfile}
12176 The @code{remove-outfile} spec function takes one argument.  It looks for the
12177 first argument in the outfiles array and removes it.  Here is a small example
12178 its usage:
12179
12180 @smallexample
12181 %:remove-outfile(-lm)
12182 @end smallexample
12183
12184 @item @code{pass-through-libs}
12185 The @code{pass-through-libs} spec function takes any number of arguments.  It
12186 finds any @option{-l} options and any non-options ending in @file{.a} (which it
12187 assumes are the names of linker input library archive files) and returns a
12188 result containing all the found arguments each prepended by
12189 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
12190 intended to be passed to the LTO linker plugin.
12191
12192 @smallexample
12193 %:pass-through-libs(%G %L %G)
12194 @end smallexample
12195
12196 @item @code{print-asm-header}
12197 The @code{print-asm-header} function takes no arguments and simply
12198 prints a banner like:
12199
12200 @smallexample
12201 Assembler options
12202 =================
12203
12204 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
12205 @end smallexample
12206
12207 It is used to separate compiler options from assembler options
12208 in the @option{--target-help} output.
12209 @end table
12210
12211 @item %@{@code{S}@}
12212 Substitutes the @code{-S} switch, if that switch is given to GCC@.
12213 If that switch is not specified, this substitutes nothing.  Note that
12214 the leading dash is omitted when specifying this option, and it is
12215 automatically inserted if the substitution is performed.  Thus the spec
12216 string @samp{%@{foo@}} matches the command-line option @option{-foo}
12217 and outputs the command-line option @option{-foo}.
12218
12219 @item %W@{@code{S}@}
12220 Like %@{@code{S}@} but mark last argument supplied within as a file to be
12221 deleted on failure.
12222
12223 @item %@{@code{S}*@}
12224 Substitutes all the switches specified to GCC whose names start
12225 with @code{-S}, but which also take an argument.  This is used for
12226 switches like @option{-o}, @option{-D}, @option{-I}, etc.
12227 GCC considers @option{-o foo} as being
12228 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
12229 text, including the space.  Thus two arguments are generated.
12230
12231 @item %@{@code{S}*&@code{T}*@}
12232 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
12233 (the order of @code{S} and @code{T} in the spec is not significant).
12234 There can be any number of ampersand-separated variables; for each the
12235 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
12236
12237 @item %@{@code{S}:@code{X}@}
12238 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
12239
12240 @item %@{!@code{S}:@code{X}@}
12241 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
12242
12243 @item %@{@code{S}*:@code{X}@}
12244 Substitutes @code{X} if one or more switches whose names start with
12245 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
12246 once, no matter how many such switches appeared.  However, if @code{%*}
12247 appears somewhere in @code{X}, then @code{X} is substituted once
12248 for each matching switch, with the @code{%*} replaced by the part of
12249 that switch matching the @code{*}.
12250
12251 If @code{%*} appears as the last part of a spec sequence then a space
12252 is added after the end of the last substitution.  If there is more
12253 text in the sequence, however, then a space is not generated.  This
12254 allows the @code{%*} substitution to be used as part of a larger
12255 string.  For example, a spec string like this:
12256
12257 @smallexample
12258 %@{mcu=*:--script=%*/memory.ld@}
12259 @end smallexample
12260
12261 @noindent
12262 when matching an option like @option{-mcu=newchip} produces:
12263
12264 @smallexample
12265 --script=newchip/memory.ld
12266 @end smallexample
12267
12268 @item %@{.@code{S}:@code{X}@}
12269 Substitutes @code{X}, if processing a file with suffix @code{S}.
12270
12271 @item %@{!.@code{S}:@code{X}@}
12272 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
12273
12274 @item %@{,@code{S}:@code{X}@}
12275 Substitutes @code{X}, if processing a file for language @code{S}.
12276
12277 @item %@{!,@code{S}:@code{X}@}
12278 Substitutes @code{X}, if not processing a file for language @code{S}.
12279
12280 @item %@{@code{S}|@code{P}:@code{X}@}
12281 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
12282 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
12283 @code{*} sequences as well, although they have a stronger binding than
12284 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
12285 alternatives must be starred, and only the first matching alternative
12286 is substituted.
12287
12288 For example, a spec string like this:
12289
12290 @smallexample
12291 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
12292 @end smallexample
12293
12294 @noindent
12295 outputs the following command-line options from the following input
12296 command-line options:
12297
12298 @smallexample
12299 fred.c        -foo -baz
12300 jim.d         -bar -boggle
12301 -d fred.c     -foo -baz -boggle
12302 -d jim.d      -bar -baz -boggle
12303 @end smallexample
12304
12305 @item %@{S:X; T:Y; :D@}
12306
12307 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
12308 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
12309 be as many clauses as you need.  This may be combined with @code{.},
12310 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
12311
12312
12313 @end table
12314
12315 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
12316 construct may contain other nested @samp{%} constructs or spaces, or
12317 even newlines.  They are processed as usual, as described above.
12318 Trailing white space in @code{X} is ignored.  White space may also
12319 appear anywhere on the left side of the colon in these constructs,
12320 except between @code{.} or @code{*} and the corresponding word.
12321
12322 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
12323 handled specifically in these constructs.  If another value of
12324 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
12325 @option{-W} switch is found later in the command line, the earlier
12326 switch value is ignored, except with @{@code{S}*@} where @code{S} is
12327 just one letter, which passes all matching options.
12328
12329 The character @samp{|} at the beginning of the predicate text is used to
12330 indicate that a command should be piped to the following command, but
12331 only if @option{-pipe} is specified.
12332
12333 It is built into GCC which switches take arguments and which do not.
12334 (You might think it would be useful to generalize this to allow each
12335 compiler's spec to say which switches take arguments.  But this cannot
12336 be done in a consistent fashion.  GCC cannot even decide which input
12337 files have been specified without knowing which switches take arguments,
12338 and it must know which input files to compile in order to tell which
12339 compilers to run).
12340
12341 GCC also knows implicitly that arguments starting in @option{-l} are to be
12342 treated as compiler output files, and passed to the linker in their
12343 proper position among the other output files.
12344
12345 @c man begin OPTIONS
12346
12347 @node Target Options
12348 @section Specifying Target Machine and Compiler Version
12349 @cindex target options
12350 @cindex cross compiling
12351 @cindex specifying machine version
12352 @cindex specifying compiler version and target machine
12353 @cindex compiler version, specifying
12354 @cindex target machine, specifying
12355
12356 The usual way to run GCC is to run the executable called @command{gcc}, or
12357 @command{@var{machine}-gcc} when cross-compiling, or
12358 @command{@var{machine}-gcc-@var{version}} to run a version other than the
12359 one that was installed last.
12360
12361 @node Submodel Options
12362 @section Hardware Models and Configurations
12363 @cindex submodel options
12364 @cindex specifying hardware config
12365 @cindex hardware models and configurations, specifying
12366 @cindex machine dependent options
12367
12368 Each target machine types can have its own
12369 special options, starting with @samp{-m}, to choose among various
12370 hardware models or configurations---for example, 68010 vs 68020,
12371 floating coprocessor or none.  A single installed version of the
12372 compiler can compile for any model or configuration, according to the
12373 options specified.
12374
12375 Some configurations of the compiler also support additional special
12376 options, usually for compatibility with other compilers on the same
12377 platform.
12378
12379 @c This list is ordered alphanumerically by subsection name.
12380 @c It should be the same order and spelling as these options are listed
12381 @c in Machine Dependent Options
12382
12383 @menu
12384 * AArch64 Options::
12385 * Adapteva Epiphany Options::
12386 * ARC Options::
12387 * ARM Options::
12388 * AVR Options::
12389 * Blackfin Options::
12390 * C6X Options::
12391 * CRIS Options::
12392 * CR16 Options::
12393 * Darwin Options::
12394 * DEC Alpha Options::
12395 * FR30 Options::
12396 * FT32 Options::
12397 * FRV Options::
12398 * GNU/Linux Options::
12399 * H8/300 Options::
12400 * HPPA Options::
12401 * IA-64 Options::
12402 * LM32 Options::
12403 * M32C Options::
12404 * M32R/D Options::
12405 * M680x0 Options::
12406 * MCore Options::
12407 * MeP Options::
12408 * MicroBlaze Options::
12409 * MIPS Options::
12410 * MMIX Options::
12411 * MN10300 Options::
12412 * Moxie Options::
12413 * MSP430 Options::
12414 * NDS32 Options::
12415 * Nios II Options::
12416 * Nvidia PTX Options::
12417 * PDP-11 Options::
12418 * picoChip Options::
12419 * PowerPC Options::
12420 * RL78 Options::
12421 * RS/6000 and PowerPC Options::
12422 * RX Options::
12423 * S/390 and zSeries Options::
12424 * Score Options::
12425 * SH Options::
12426 * Solaris 2 Options::
12427 * SPARC Options::
12428 * SPU Options::
12429 * System V Options::
12430 * TILE-Gx Options::
12431 * TILEPro Options::
12432 * V850 Options::
12433 * VAX Options::
12434 * Visium Options::
12435 * VMS Options::
12436 * VxWorks Options::
12437 * x86 Options::
12438 * x86 Windows Options::
12439 * Xstormy16 Options::
12440 * Xtensa Options::
12441 * zSeries Options::
12442 @end menu
12443
12444 @node AArch64 Options
12445 @subsection AArch64 Options
12446 @cindex AArch64 Options
12447
12448 These options are defined for AArch64 implementations:
12449
12450 @table @gcctabopt
12451
12452 @item -mabi=@var{name}
12453 @opindex mabi
12454 Generate code for the specified data model.  Permissible values
12455 are @samp{ilp32} for SysV-like data model where int, long int and pointer
12456 are 32-bit, and @samp{lp64} for SysV-like data model where int is 32-bit,
12457 but long int and pointer are 64-bit.
12458
12459 The default depends on the specific target configuration.  Note that
12460 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
12461 entire program with the same ABI, and link with a compatible set of libraries.
12462
12463 @item -mbig-endian
12464 @opindex mbig-endian
12465 Generate big-endian code.  This is the default when GCC is configured for an
12466 @samp{aarch64_be-*-*} target.
12467
12468 @item -mgeneral-regs-only
12469 @opindex mgeneral-regs-only
12470 Generate code which uses only the general-purpose registers.  This is equivalent
12471 to feature modifier @option{nofp} of @option{-march} or @option{-mcpu}, except
12472 that @option{-mgeneral-regs-only} takes precedence over any conflicting feature
12473 modifier regardless of sequence.
12474
12475 @item -mlittle-endian
12476 @opindex mlittle-endian
12477 Generate little-endian code.  This is the default when GCC is configured for an
12478 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
12479
12480 @item -mcmodel=tiny
12481 @opindex mcmodel=tiny
12482 Generate code for the tiny code model.  The program and its statically defined
12483 symbols must be within 1GB of each other.  Pointers are 64 bits.  Programs can
12484 be statically or dynamically linked.  This model is not fully implemented and
12485 mostly treated as @samp{small}.
12486
12487 @item -mcmodel=small
12488 @opindex mcmodel=small
12489 Generate code for the small code model.  The program and its statically defined
12490 symbols must be within 4GB of each other.  Pointers are 64 bits.  Programs can
12491 be statically or dynamically linked.  This is the default code model.
12492
12493 @item -mcmodel=large
12494 @opindex mcmodel=large
12495 Generate code for the large code model.  This makes no assumptions about
12496 addresses and sizes of sections.  Pointers are 64 bits.  Programs can be
12497 statically linked only.
12498
12499 @item -mstrict-align
12500 @opindex mstrict-align
12501 Do not assume that unaligned memory references are handled by the system.
12502
12503 @item -momit-leaf-frame-pointer
12504 @itemx -mno-omit-leaf-frame-pointer
12505 @opindex momit-leaf-frame-pointer
12506 @opindex mno-omit-leaf-frame-pointer
12507 Omit or keep the frame pointer in leaf functions.  The former behaviour is the
12508 default.
12509
12510 @item -mtls-dialect=desc
12511 @opindex mtls-dialect=desc
12512 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
12513 of TLS variables.  This is the default.
12514
12515 @item -mtls-dialect=traditional
12516 @opindex mtls-dialect=traditional
12517 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
12518 of TLS variables.
12519
12520 @item -mtls-size=@var{size}
12521 @opindex mtls-size
12522 Specify bit size of immediate TLS offsets.  Valid values are 12, 24, 32, 48.
12523 This option depends on binutils higher than 2.25.
12524
12525 @item -mfix-cortex-a53-835769
12526 @itemx -mno-fix-cortex-a53-835769
12527 @opindex mfix-cortex-a53-835769
12528 @opindex mno-fix-cortex-a53-835769
12529 Enable or disable the workaround for the ARM Cortex-A53 erratum number 835769.
12530 This involves inserting a NOP instruction between memory instructions and
12531 64-bit integer multiply-accumulate instructions.
12532
12533 @item -mfix-cortex-a53-843419
12534 @itemx -mno-fix-cortex-a53-843419
12535 @opindex mfix-cortex-a53-843419
12536 @opindex mno-fix-cortex-a53-843419
12537 Enable or disable the workaround for the ARM Cortex-A53 erratum number 843419.
12538 This erratum workaround is made at link time and this will only pass the
12539 corresponding flag to the linker.
12540
12541 @item -mlow-precision-recip-sqrt
12542 @item -mno-low-precision-recip-sqrt
12543 @opindex -mlow-precision-recip-sqrt
12544 @opindex -mno-low-precision-recip-sqrt
12545 The square root estimate uses two steps instead of three for double-precision,
12546 and one step instead of two for single-precision.
12547 Thus reducing latency and precision.
12548 This is only relevant if @option{-ffast-math} activates
12549 reciprocal square root estimate instructions.
12550 Which in turn depends on the target processor.
12551
12552 @item -march=@var{name}
12553 @opindex march
12554 Specify the name of the target architecture, optionally suffixed by one or
12555 more feature modifiers.  This option has the form
12556 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}.
12557
12558 The permissible values for @var{arch} are @samp{armv8-a} or
12559 @samp{armv8.1-a}.
12560
12561 For the permissible values for @var{feature}, see the sub-section on
12562 @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
12563 Feature Modifiers}.  Where conflicting feature modifiers are
12564 specified, the right-most feature is used.
12565
12566 Additionally on native AArch64 GNU/Linux systems the value
12567 @samp{native} is available.  This option causes the compiler to pick the
12568 architecture of the host system.  If the compiler is unable to recognize the
12569 architecture of the host system this option has no effect.
12570
12571 GCC uses @var{name} to determine what kind of instructions it can emit
12572 when generating assembly code.  If @option{-march} is specified
12573 without either of @option{-mtune} or @option{-mcpu} also being
12574 specified, the code is tuned to perform well across a range of target
12575 processors implementing the target architecture.
12576
12577 @item -mtune=@var{name}
12578 @opindex mtune
12579 Specify the name of the target processor for which GCC should tune the
12580 performance of the code.  Permissible values for this option are:
12581 @samp{generic}, @samp{cortex-a53}, @samp{cortex-a57}, @samp{cortex-a72},
12582 @samp{exynos-m1}, @samp{thunderx}, @samp{xgene1}.
12583
12584 Additionally, this option can specify that GCC should tune the performance
12585 of the code for a big.LITTLE system.  Permissible values for this
12586 option are: @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53}.
12587
12588 Additionally on native AArch64 GNU/Linux systems the value
12589 @samp{native} is available.  This option causes the compiler to pick
12590 the architecture of and tune the performance of the code for the
12591 processor of the host system.  If the compiler is unable to recognize
12592 the processor of the host system this option has no effect.
12593
12594 Where none of @option{-mtune=}, @option{-mcpu=} or @option{-march=}
12595 are specified, the code is tuned to perform well across a range
12596 of target processors.
12597
12598 This option cannot be suffixed by feature modifiers.
12599
12600 @item -mcpu=@var{name}
12601 @opindex mcpu
12602 Specify the name of the target processor, optionally suffixed by one
12603 or more feature modifiers.  This option has the form
12604 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where
12605 the permissible values for @var{cpu} are the same as those available
12606 for @option{-mtune}.  The permissible values for @var{feature} are
12607 documented in the sub-section on
12608 @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
12609 Feature Modifiers}.  Where conflicting feature modifiers are
12610 specified, the right-most feature is used.
12611
12612 Additionally on native AArch64 GNU/Linux systems the value
12613 @samp{native} is available.  This option causes the compiler to tune
12614 the performance of the code for the processor of the host system.  If
12615 the compiler is unable to recognize the processor of the host system
12616 this option has no effect.
12617
12618 GCC uses @var{name} to determine what kind of instructions it can emit when
12619 generating assembly code (as if by @option{-march}) and to determine
12620 the target processor for which to tune for performance (as if
12621 by @option{-mtune}).  Where this option is used in conjunction
12622 with @option{-march} or @option{-mtune}, those options take precedence
12623 over the appropriate part of this option.
12624
12625 @item -moverride=@var{string}
12626 @opindex moverride
12627 Override tuning decisions made by the back-end in response to a
12628 @option{-mtune=} switch.  The syntax, semantics, and accepted values
12629 for @var{string} in this option are not guaranteed to be consistent
12630 across releases.
12631
12632 This option is only intended to be useful when developing GCC.
12633
12634 @item -mpc-relative-literal-loads
12635 @opindex mpcrelativeliteralloads
12636 Enable PC relative literal loads. If this option is used, literal
12637 pools are assumed to have a range of up to 1MiB and an appropriate
12638 instruction sequence is used. This option has no impact when used
12639 with @option{-mcmodel=tiny}.
12640
12641 @end table
12642
12643 @subsubsection @option{-march} and @option{-mcpu} Feature Modifiers
12644 @anchor{aarch64-feature-modifiers}
12645 @cindex @option{-march} feature modifiers
12646 @cindex @option{-mcpu} feature modifiers
12647 Feature modifiers used with @option{-march} and @option{-mcpu} can be any of
12648 the following and their inverses @option{no@var{feature}}:
12649
12650 @table @samp
12651 @item crc
12652 Enable CRC extension.
12653 @item crypto
12654 Enable Crypto extension.  This also enables Advanced SIMD and floating-point
12655 instructions.
12656 @item fp
12657 Enable floating-point instructions.  This is on by default for all possible
12658 values for options @option{-march} and @option{-mcpu}.
12659 @item simd
12660 Enable Advanced SIMD instructions.  This also enables floating-point
12661 instructions.  This is on by default for all possible values for options
12662 @option{-march} and @option{-mcpu}.
12663 @item lse
12664 Enable Large System Extension instructions.
12665 @item pan
12666 Enable Privileged Access Never support.
12667 @item lor
12668 Enable Limited Ordering Regions support.
12669 @item rdma
12670 Enable ARMv8.1 Advanced SIMD instructions.  This implies Advanced SIMD
12671 is enabled.
12672
12673 @end table
12674
12675 That is, @option{crypto} implies @option{simd} implies @option{fp}.
12676 Conversely, @option{nofp} (or equivalently, @option{-mgeneral-regs-only})
12677 implies @option{nosimd} implies @option{nocrypto}.
12678
12679 @node Adapteva Epiphany Options
12680 @subsection Adapteva Epiphany Options
12681
12682 These @samp{-m} options are defined for Adapteva Epiphany:
12683
12684 @table @gcctabopt
12685 @item -mhalf-reg-file
12686 @opindex mhalf-reg-file
12687 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
12688 That allows code to run on hardware variants that lack these registers.
12689
12690 @item -mprefer-short-insn-regs
12691 @opindex mprefer-short-insn-regs
12692 Preferrentially allocate registers that allow short instruction generation.
12693 This can result in increased instruction count, so this may either reduce or
12694 increase overall code size.
12695
12696 @item -mbranch-cost=@var{num}
12697 @opindex mbranch-cost
12698 Set the cost of branches to roughly @var{num} ``simple'' instructions.
12699 This cost is only a heuristic and is not guaranteed to produce
12700 consistent results across releases.
12701
12702 @item -mcmove
12703 @opindex mcmove
12704 Enable the generation of conditional moves.
12705
12706 @item -mnops=@var{num}
12707 @opindex mnops
12708 Emit @var{num} NOPs before every other generated instruction.
12709
12710 @item -mno-soft-cmpsf
12711 @opindex mno-soft-cmpsf
12712 For single-precision floating-point comparisons, emit an @code{fsub} instruction
12713 and test the flags.  This is faster than a software comparison, but can
12714 get incorrect results in the presence of NaNs, or when two different small
12715 numbers are compared such that their difference is calculated as zero.
12716 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
12717 software comparisons.
12718
12719 @item -mstack-offset=@var{num}
12720 @opindex mstack-offset
12721 Set the offset between the top of the stack and the stack pointer.
12722 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
12723 can be used by leaf functions without stack allocation.
12724 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
12725 Note also that this option changes the ABI; compiling a program with a
12726 different stack offset than the libraries have been compiled with
12727 generally does not work.
12728 This option can be useful if you want to evaluate if a different stack
12729 offset would give you better code, but to actually use a different stack
12730 offset to build working programs, it is recommended to configure the
12731 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
12732
12733 @item -mno-round-nearest
12734 @opindex mno-round-nearest
12735 Make the scheduler assume that the rounding mode has been set to
12736 truncating.  The default is @option{-mround-nearest}.
12737
12738 @item -mlong-calls
12739 @opindex mlong-calls
12740 If not otherwise specified by an attribute, assume all calls might be beyond
12741 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
12742 function address into a register before performing a (otherwise direct) call.
12743 This is the default.
12744
12745 @item -mshort-calls
12746 @opindex short-calls
12747 If not otherwise specified by an attribute, assume all direct calls are
12748 in the range of the @code{b} / @code{bl} instructions, so use these instructions
12749 for direct calls.  The default is @option{-mlong-calls}.
12750
12751 @item -msmall16
12752 @opindex msmall16
12753 Assume addresses can be loaded as 16-bit unsigned values.  This does not
12754 apply to function addresses for which @option{-mlong-calls} semantics
12755 are in effect.
12756
12757 @item -mfp-mode=@var{mode}
12758 @opindex mfp-mode
12759 Set the prevailing mode of the floating-point unit.
12760 This determines the floating-point mode that is provided and expected
12761 at function call and return time.  Making this mode match the mode you
12762 predominantly need at function start can make your programs smaller and
12763 faster by avoiding unnecessary mode switches.
12764
12765 @var{mode} can be set to one the following values:
12766
12767 @table @samp
12768 @item caller
12769 Any mode at function entry is valid, and retained or restored when
12770 the function returns, and when it calls other functions.
12771 This mode is useful for compiling libraries or other compilation units
12772 you might want to incorporate into different programs with different
12773 prevailing FPU modes, and the convenience of being able to use a single
12774 object file outweighs the size and speed overhead for any extra
12775 mode switching that might be needed, compared with what would be needed
12776 with a more specific choice of prevailing FPU mode.
12777
12778 @item truncate
12779 This is the mode used for floating-point calculations with
12780 truncating (i.e.@: round towards zero) rounding mode.  That includes
12781 conversion from floating point to integer.
12782
12783 @item round-nearest
12784 This is the mode used for floating-point calculations with
12785 round-to-nearest-or-even rounding mode.
12786
12787 @item int
12788 This is the mode used to perform integer calculations in the FPU, e.g.@:
12789 integer multiply, or integer multiply-and-accumulate.
12790 @end table
12791
12792 The default is @option{-mfp-mode=caller}
12793
12794 @item -mnosplit-lohi
12795 @itemx -mno-postinc
12796 @itemx -mno-postmodify
12797 @opindex mnosplit-lohi
12798 @opindex mno-postinc
12799 @opindex mno-postmodify
12800 Code generation tweaks that disable, respectively, splitting of 32-bit
12801 loads, generation of post-increment addresses, and generation of
12802 post-modify addresses.  The defaults are @option{msplit-lohi},
12803 @option{-mpost-inc}, and @option{-mpost-modify}.
12804
12805 @item -mnovect-double
12806 @opindex mno-vect-double
12807 Change the preferred SIMD mode to SImode.  The default is
12808 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
12809
12810 @item -max-vect-align=@var{num}
12811 @opindex max-vect-align
12812 The maximum alignment for SIMD vector mode types.
12813 @var{num} may be 4 or 8.  The default is 8.
12814 Note that this is an ABI change, even though many library function
12815 interfaces are unaffected if they don't use SIMD vector modes
12816 in places that affect size and/or alignment of relevant types.
12817
12818 @item -msplit-vecmove-early
12819 @opindex msplit-vecmove-early
12820 Split vector moves into single word moves before reload.  In theory this
12821 can give better register allocation, but so far the reverse seems to be
12822 generally the case.
12823
12824 @item -m1reg-@var{reg}
12825 @opindex m1reg-
12826 Specify a register to hold the constant @minus{}1, which makes loading small negative
12827 constants and certain bitmasks faster.
12828 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
12829 which specify use of that register as a fixed register,
12830 and @samp{none}, which means that no register is used for this
12831 purpose.  The default is @option{-m1reg-none}.
12832
12833 @end table
12834
12835 @node ARC Options
12836 @subsection ARC Options
12837 @cindex ARC options
12838
12839 The following options control the architecture variant for which code
12840 is being compiled:
12841
12842 @c architecture variants
12843 @table @gcctabopt
12844
12845 @item -mbarrel-shifter
12846 @opindex mbarrel-shifter
12847 Generate instructions supported by barrel shifter.  This is the default
12848 unless @option{-mcpu=ARC601} is in effect.
12849
12850 @item -mcpu=@var{cpu}
12851 @opindex mcpu
12852 Set architecture type, register usage, and instruction scheduling
12853 parameters for @var{cpu}.  There are also shortcut alias options
12854 available for backward compatibility and convenience.  Supported
12855 values for @var{cpu} are
12856
12857 @table @samp
12858 @opindex mA6
12859 @opindex mARC600
12860 @item ARC600
12861 Compile for ARC600.  Aliases: @option{-mA6}, @option{-mARC600}.
12862
12863 @item ARC601
12864 @opindex mARC601
12865 Compile for ARC601.  Alias: @option{-mARC601}.
12866
12867 @item ARC700
12868 @opindex mA7
12869 @opindex mARC700
12870 Compile for ARC700.  Aliases: @option{-mA7}, @option{-mARC700}.
12871 This is the default when configured with @option{--with-cpu=arc700}@.
12872 @end table
12873
12874 @item -mdpfp
12875 @opindex mdpfp
12876 @itemx -mdpfp-compact
12877 @opindex mdpfp-compact
12878 FPX: Generate Double Precision FPX instructions, tuned for the compact
12879 implementation.
12880
12881 @item -mdpfp-fast
12882 @opindex mdpfp-fast
12883 FPX: Generate Double Precision FPX instructions, tuned for the fast
12884 implementation.
12885
12886 @item -mno-dpfp-lrsr
12887 @opindex mno-dpfp-lrsr
12888 Disable LR and SR instructions from using FPX extension aux registers.
12889
12890 @item -mea
12891 @opindex mea
12892 Generate Extended arithmetic instructions.  Currently only
12893 @code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are
12894 supported.  This is always enabled for @option{-mcpu=ARC700}.
12895
12896 @item -mno-mpy
12897 @opindex mno-mpy
12898 Do not generate mpy instructions for ARC700.
12899
12900 @item -mmul32x16
12901 @opindex mmul32x16
12902 Generate 32x16 bit multiply and mac instructions.
12903
12904 @item -mmul64
12905 @opindex mmul64
12906 Generate mul64 and mulu64 instructions.  Only valid for @option{-mcpu=ARC600}.
12907
12908 @item -mnorm
12909 @opindex mnorm
12910 Generate norm instruction.  This is the default if @option{-mcpu=ARC700}
12911 is in effect.
12912
12913 @item -mspfp
12914 @opindex mspfp
12915 @itemx -mspfp-compact
12916 @opindex mspfp-compact
12917 FPX: Generate Single Precision FPX instructions, tuned for the compact
12918 implementation.
12919
12920 @item -mspfp-fast
12921 @opindex mspfp-fast
12922 FPX: Generate Single Precision FPX instructions, tuned for the fast
12923 implementation.
12924
12925 @item -msimd
12926 @opindex msimd
12927 Enable generation of ARC SIMD instructions via target-specific
12928 builtins.  Only valid for @option{-mcpu=ARC700}.
12929
12930 @item -msoft-float
12931 @opindex msoft-float
12932 This option ignored; it is provided for compatibility purposes only.
12933 Software floating point code is emitted by default, and this default
12934 can overridden by FPX options; @samp{mspfp}, @samp{mspfp-compact}, or
12935 @samp{mspfp-fast} for single precision, and @samp{mdpfp},
12936 @samp{mdpfp-compact}, or @samp{mdpfp-fast} for double precision.
12937
12938 @item -mswap
12939 @opindex mswap
12940 Generate swap instructions.
12941
12942 @end table
12943
12944 The following options are passed through to the assembler, and also
12945 define preprocessor macro symbols.
12946
12947 @c Flags used by the assembler, but for which we define preprocessor
12948 @c macro symbols as well.
12949 @table @gcctabopt
12950 @item -mdsp-packa
12951 @opindex mdsp-packa
12952 Passed down to the assembler to enable the DSP Pack A extensions.
12953 Also sets the preprocessor symbol @code{__Xdsp_packa}.
12954
12955 @item -mdvbf
12956 @opindex mdvbf
12957 Passed down to the assembler to enable the dual viterbi butterfly
12958 extension.  Also sets the preprocessor symbol @code{__Xdvbf}.
12959
12960 @c ARC700 4.10 extension instruction
12961 @item -mlock
12962 @opindex mlock
12963 Passed down to the assembler to enable the Locked Load/Store
12964 Conditional extension.  Also sets the preprocessor symbol
12965 @code{__Xlock}.
12966
12967 @item -mmac-d16
12968 @opindex mmac-d16
12969 Passed down to the assembler.  Also sets the preprocessor symbol
12970 @code{__Xxmac_d16}.
12971
12972 @item -mmac-24
12973 @opindex mmac-24
12974 Passed down to the assembler.  Also sets the preprocessor symbol
12975 @code{__Xxmac_24}.
12976
12977 @c ARC700 4.10 extension instruction
12978 @item -mrtsc
12979 @opindex mrtsc
12980 Passed down to the assembler to enable the 64-bit Time-Stamp Counter
12981 extension instruction.  Also sets the preprocessor symbol
12982 @code{__Xrtsc}.
12983
12984 @c ARC700 4.10 extension instruction
12985 @item -mswape
12986 @opindex mswape
12987 Passed down to the assembler to enable the swap byte ordering
12988 extension instruction.  Also sets the preprocessor symbol
12989 @code{__Xswape}.
12990
12991 @item -mtelephony
12992 @opindex mtelephony
12993 Passed down to the assembler to enable dual and single operand
12994 instructions for telephony.  Also sets the preprocessor symbol
12995 @code{__Xtelephony}.
12996
12997 @item -mxy
12998 @opindex mxy
12999 Passed down to the assembler to enable the XY Memory extension.  Also
13000 sets the preprocessor symbol @code{__Xxy}.
13001
13002 @end table
13003
13004 The following options control how the assembly code is annotated:
13005
13006 @c Assembly annotation options
13007 @table @gcctabopt
13008 @item -misize
13009 @opindex misize
13010 Annotate assembler instructions with estimated addresses.
13011
13012 @item -mannotate-align
13013 @opindex mannotate-align
13014 Explain what alignment considerations lead to the decision to make an
13015 instruction short or long.
13016
13017 @end table
13018
13019 The following options are passed through to the linker:
13020
13021 @c options passed through to the linker
13022 @table @gcctabopt
13023 @item -marclinux
13024 @opindex marclinux
13025 Passed through to the linker, to specify use of the @code{arclinux} emulation.
13026 This option is enabled by default in tool chains built for
13027 @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets
13028 when profiling is not requested.
13029
13030 @item -marclinux_prof
13031 @opindex marclinux_prof
13032 Passed through to the linker, to specify use of the
13033 @code{arclinux_prof} emulation.  This option is enabled by default in
13034 tool chains built for @w{@code{arc-linux-uclibc}} and
13035 @w{@code{arceb-linux-uclibc}} targets when profiling is requested.
13036
13037 @end table
13038
13039 The following options control the semantics of generated code:
13040
13041 @c semantically relevant code generation options
13042 @table @gcctabopt
13043 @item -mepilogue-cfi
13044 @opindex mepilogue-cfi
13045 Enable generation of call frame information for epilogues.
13046
13047 @item -mno-epilogue-cfi
13048 @opindex mno-epilogue-cfi
13049 Disable generation of call frame information for epilogues.
13050
13051 @item -mlong-calls
13052 @opindex mlong-calls
13053 Generate call insns as register indirect calls, thus providing access
13054 to the full 32-bit address range.
13055
13056 @item -mmedium-calls
13057 @opindex mmedium-calls
13058 Don't use less than 25 bit addressing range for calls, which is the
13059 offset available for an unconditional branch-and-link
13060 instruction.  Conditional execution of function calls is suppressed, to
13061 allow use of the 25-bit range, rather than the 21-bit range with
13062 conditional branch-and-link.  This is the default for tool chains built
13063 for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets.
13064
13065 @item -mno-sdata
13066 @opindex mno-sdata
13067 Do not generate sdata references.  This is the default for tool chains
13068 built for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}}
13069 targets.
13070
13071 @item -mucb-mcount
13072 @opindex mucb-mcount
13073 Instrument with mcount calls as used in UCB code.  I.e. do the
13074 counting in the callee, not the caller.  By default ARC instrumentation
13075 counts in the caller.
13076
13077 @item -mvolatile-cache
13078 @opindex mvolatile-cache
13079 Use ordinarily cached memory accesses for volatile references.  This is the
13080 default.
13081
13082 @item -mno-volatile-cache
13083 @opindex mno-volatile-cache
13084 Enable cache bypass for volatile references.
13085
13086 @end table
13087
13088 The following options fine tune code generation:
13089 @c code generation tuning options
13090 @table @gcctabopt
13091 @item -malign-call
13092 @opindex malign-call
13093 Do alignment optimizations for call instructions.
13094
13095 @item -mauto-modify-reg
13096 @opindex mauto-modify-reg
13097 Enable the use of pre/post modify with register displacement.
13098
13099 @item -mbbit-peephole
13100 @opindex mbbit-peephole
13101 Enable bbit peephole2.
13102
13103 @item -mno-brcc
13104 @opindex mno-brcc
13105 This option disables a target-specific pass in @file{arc_reorg} to
13106 generate @code{BRcc} instructions.  It has no effect on @code{BRcc}
13107 generation driven by the combiner pass.
13108
13109 @item -mcase-vector-pcrel
13110 @opindex mcase-vector-pcrel
13111 Use pc-relative switch case tables - this enables case table shortening.
13112 This is the default for @option{-Os}.
13113
13114 @item -mcompact-casesi
13115 @opindex mcompact-casesi
13116 Enable compact casesi pattern.
13117 This is the default for @option{-Os}.
13118
13119 @item -mno-cond-exec
13120 @opindex mno-cond-exec
13121 Disable ARCompact specific pass to generate conditional execution instructions.
13122 Due to delay slot scheduling and interactions between operand numbers,
13123 literal sizes, instruction lengths, and the support for conditional execution,
13124 the target-independent pass to generate conditional execution is often lacking,
13125 so the ARC port has kept a special pass around that tries to find more
13126 conditional execution generating opportunities after register allocation,
13127 branch shortening, and delay slot scheduling have been done.  This pass
13128 generally, but not always, improves performance and code size, at the cost of
13129 extra compilation time, which is why there is an option to switch it off.
13130 If you have a problem with call instructions exceeding their allowable
13131 offset range because they are conditionalized, you should consider using
13132 @option{-mmedium-calls} instead.
13133
13134 @item -mearly-cbranchsi
13135 @opindex mearly-cbranchsi
13136 Enable pre-reload use of the cbranchsi pattern.
13137
13138 @item -mexpand-adddi
13139 @opindex mexpand-adddi
13140 Expand @code{adddi3} and @code{subdi3} at rtl generation time into
13141 @code{add.f}, @code{adc} etc.
13142
13143 @item -mindexed-loads
13144 @opindex mindexed-loads
13145 Enable the use of indexed loads.  This can be problematic because some
13146 optimizers then assume that indexed stores exist, which is not
13147 the case.
13148
13149 @item -mlra
13150 @opindex mlra
13151 Enable Local Register Allocation.  This is still experimental for ARC,
13152 so by default the compiler uses standard reload
13153 (i.e. @option{-mno-lra}).
13154
13155 @item -mlra-priority-none
13156 @opindex mlra-priority-none
13157 Don't indicate any priority for target registers.
13158
13159 @item -mlra-priority-compact
13160 @opindex mlra-priority-compact
13161 Indicate target register priority for r0..r3 / r12..r15.
13162
13163 @item -mlra-priority-noncompact
13164 @opindex mlra-priority-noncompact
13165 Reduce target regsiter priority for r0..r3 / r12..r15.
13166
13167 @item -mno-millicode
13168 @opindex mno-millicode
13169 When optimizing for size (using @option{-Os}), prologues and epilogues
13170 that have to save or restore a large number of registers are often
13171 shortened by using call to a special function in libgcc; this is
13172 referred to as a @emph{millicode} call.  As these calls can pose
13173 performance issues, and/or cause linking issues when linking in a
13174 nonstandard way, this option is provided to turn off millicode call
13175 generation.
13176
13177 @item -mmixed-code
13178 @opindex mmixed-code
13179 Tweak register allocation to help 16-bit instruction generation.
13180 This generally has the effect of decreasing the average instruction size
13181 while increasing the instruction count.
13182
13183 @item -mq-class
13184 @opindex mq-class
13185 Enable 'q' instruction alternatives.
13186 This is the default for @option{-Os}.
13187
13188 @item -mRcq
13189 @opindex mRcq
13190 Enable Rcq constraint handling - most short code generation depends on this.
13191 This is the default.
13192
13193 @item -mRcw
13194 @opindex mRcw
13195 Enable Rcw constraint handling - ccfsm condexec mostly depends on this.
13196 This is the default.
13197
13198 @item -msize-level=@var{level}
13199 @opindex msize-level
13200 Fine-tune size optimization with regards to instruction lengths and alignment.
13201 The recognized values for @var{level} are:
13202 @table @samp
13203 @item 0
13204 No size optimization.  This level is deprecated and treated like @samp{1}.
13205
13206 @item 1
13207 Short instructions are used opportunistically.
13208
13209 @item 2
13210 In addition, alignment of loops and of code after barriers are dropped.
13211
13212 @item 3
13213 In addition, optional data alignment is dropped, and the option @option{Os} is enabled.
13214
13215 @end table
13216
13217 This defaults to @samp{3} when @option{-Os} is in effect.  Otherwise,
13218 the behavior when this is not set is equivalent to level @samp{1}.
13219
13220 @item -mtune=@var{cpu}
13221 @opindex mtune
13222 Set instruction scheduling parameters for @var{cpu}, overriding any implied
13223 by @option{-mcpu=}.
13224
13225 Supported values for @var{cpu} are
13226
13227 @table @samp
13228 @item ARC600
13229 Tune for ARC600 cpu.
13230
13231 @item ARC601
13232 Tune for ARC601 cpu.
13233
13234 @item ARC700
13235 Tune for ARC700 cpu with standard multiplier block.
13236
13237 @item ARC700-xmac
13238 Tune for ARC700 cpu with XMAC block.
13239
13240 @item ARC725D
13241 Tune for ARC725D cpu.
13242
13243 @item ARC750D
13244 Tune for ARC750D cpu.
13245
13246 @end table
13247
13248 @item -mmultcost=@var{num}
13249 @opindex mmultcost
13250 Cost to assume for a multiply instruction, with @samp{4} being equal to a
13251 normal instruction.
13252
13253 @item -munalign-prob-threshold=@var{probability}
13254 @opindex munalign-prob-threshold
13255 Set probability threshold for unaligning branches.
13256 When tuning for @samp{ARC700} and optimizing for speed, branches without
13257 filled delay slot are preferably emitted unaligned and long, unless
13258 profiling indicates that the probability for the branch to be taken
13259 is below @var{probability}.  @xref{Cross-profiling}.
13260 The default is (REG_BR_PROB_BASE/2), i.e.@: 5000.
13261
13262 @end table
13263
13264 The following options are maintained for backward compatibility, but
13265 are now deprecated and will be removed in a future release:
13266
13267 @c Deprecated options
13268 @table @gcctabopt
13269
13270 @item -margonaut
13271 @opindex margonaut
13272 Obsolete FPX.
13273
13274 @item -mbig-endian
13275 @opindex mbig-endian
13276 @itemx -EB
13277 @opindex EB
13278 Compile code for big endian targets.  Use of these options is now
13279 deprecated.  Users wanting big-endian code, should use the
13280 @w{@code{arceb-elf32}} and @w{@code{arceb-linux-uclibc}} targets when
13281 building the tool chain, for which big-endian is the default.
13282
13283 @item -mlittle-endian
13284 @opindex mlittle-endian
13285 @itemx -EL
13286 @opindex EL
13287 Compile code for little endian targets.  Use of these options is now
13288 deprecated.  Users wanting little-endian code should use the
13289 @w{@code{arc-elf32}} and @w{@code{arc-linux-uclibc}} targets when
13290 building the tool chain, for which little-endian is the default.
13291
13292 @item -mbarrel_shifter
13293 @opindex mbarrel_shifter
13294 Replaced by @option{-mbarrel-shifter}.
13295
13296 @item -mdpfp_compact
13297 @opindex mdpfp_compact
13298 Replaced by @option{-mdpfp-compact}.
13299
13300 @item -mdpfp_fast
13301 @opindex mdpfp_fast
13302 Replaced by @option{-mdpfp-fast}.
13303
13304 @item -mdsp_packa
13305 @opindex mdsp_packa
13306 Replaced by @option{-mdsp-packa}.
13307
13308 @item -mEA
13309 @opindex mEA
13310 Replaced by @option{-mea}.
13311
13312 @item -mmac_24
13313 @opindex mmac_24
13314 Replaced by @option{-mmac-24}.
13315
13316 @item -mmac_d16
13317 @opindex mmac_d16
13318 Replaced by @option{-mmac-d16}.
13319
13320 @item -mspfp_compact
13321 @opindex mspfp_compact
13322 Replaced by @option{-mspfp-compact}.
13323
13324 @item -mspfp_fast
13325 @opindex mspfp_fast
13326 Replaced by @option{-mspfp-fast}.
13327
13328 @item -mtune=@var{cpu}
13329 @opindex mtune
13330 Values @samp{arc600}, @samp{arc601}, @samp{arc700} and
13331 @samp{arc700-xmac} for @var{cpu} are replaced by @samp{ARC600},
13332 @samp{ARC601}, @samp{ARC700} and @samp{ARC700-xmac} respectively
13333
13334 @item -multcost=@var{num}
13335 @opindex multcost
13336 Replaced by @option{-mmultcost}.
13337
13338 @end table
13339
13340 @node ARM Options
13341 @subsection ARM Options
13342 @cindex ARM options
13343
13344 These @samp{-m} options are defined for the ARM port:
13345
13346 @table @gcctabopt
13347 @item -mabi=@var{name}
13348 @opindex mabi
13349 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
13350 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
13351
13352 @item -mapcs-frame
13353 @opindex mapcs-frame
13354 Generate a stack frame that is compliant with the ARM Procedure Call
13355 Standard for all functions, even if this is not strictly necessary for
13356 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
13357 with this option causes the stack frames not to be generated for
13358 leaf functions.  The default is @option{-mno-apcs-frame}.
13359 This option is deprecated.
13360
13361 @item -mapcs
13362 @opindex mapcs
13363 This is a synonym for @option{-mapcs-frame} and is deprecated.
13364
13365 @ignore
13366 @c not currently implemented
13367 @item -mapcs-stack-check
13368 @opindex mapcs-stack-check
13369 Generate code to check the amount of stack space available upon entry to
13370 every function (that actually uses some stack space).  If there is
13371 insufficient space available then either the function
13372 @code{__rt_stkovf_split_small} or @code{__rt_stkovf_split_big} is
13373 called, depending upon the amount of stack space required.  The runtime
13374 system is required to provide these functions.  The default is
13375 @option{-mno-apcs-stack-check}, since this produces smaller code.
13376
13377 @c not currently implemented
13378 @item -mapcs-float
13379 @opindex mapcs-float
13380 Pass floating-point arguments using the floating-point registers.  This is
13381 one of the variants of the APCS@.  This option is recommended if the
13382 target hardware has a floating-point unit or if a lot of floating-point
13383 arithmetic is going to be performed by the code.  The default is
13384 @option{-mno-apcs-float}, since the size of integer-only code is 
13385 slightly increased if @option{-mapcs-float} is used.
13386
13387 @c not currently implemented
13388 @item -mapcs-reentrant
13389 @opindex mapcs-reentrant
13390 Generate reentrant, position-independent code.  The default is
13391 @option{-mno-apcs-reentrant}.
13392 @end ignore
13393
13394 @item -mthumb-interwork
13395 @opindex mthumb-interwork
13396 Generate code that supports calling between the ARM and Thumb
13397 instruction sets.  Without this option, on pre-v5 architectures, the
13398 two instruction sets cannot be reliably used inside one program.  The
13399 default is @option{-mno-thumb-interwork}, since slightly larger code
13400 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
13401 configurations this option is meaningless.
13402
13403 @item -mno-sched-prolog
13404 @opindex mno-sched-prolog
13405 Prevent the reordering of instructions in the function prologue, or the
13406 merging of those instruction with the instructions in the function's
13407 body.  This means that all functions start with a recognizable set
13408 of instructions (or in fact one of a choice from a small set of
13409 different function prologues), and this information can be used to
13410 locate the start of functions inside an executable piece of code.  The
13411 default is @option{-msched-prolog}.
13412
13413 @item -mfloat-abi=@var{name}
13414 @opindex mfloat-abi
13415 Specifies which floating-point ABI to use.  Permissible values
13416 are: @samp{soft}, @samp{softfp} and @samp{hard}.
13417
13418 Specifying @samp{soft} causes GCC to generate output containing
13419 library calls for floating-point operations.
13420 @samp{softfp} allows the generation of code using hardware floating-point
13421 instructions, but still uses the soft-float calling conventions.
13422 @samp{hard} allows generation of floating-point instructions
13423 and uses FPU-specific calling conventions.
13424
13425 The default depends on the specific target configuration.  Note that
13426 the hard-float and soft-float ABIs are not link-compatible; you must
13427 compile your entire program with the same ABI, and link with a
13428 compatible set of libraries.
13429
13430 @item -mlittle-endian
13431 @opindex mlittle-endian
13432 Generate code for a processor running in little-endian mode.  This is
13433 the default for all standard configurations.
13434
13435 @item -mbig-endian
13436 @opindex mbig-endian
13437 Generate code for a processor running in big-endian mode; the default is
13438 to compile code for a little-endian processor.
13439
13440 @item -march=@var{name}
13441 @opindex march
13442 This specifies the name of the target ARM architecture.  GCC uses this
13443 name to determine what kind of instructions it can emit when generating
13444 assembly code.  This option can be used in conjunction with or instead
13445 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
13446 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
13447 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
13448 @samp{armv6}, @samp{armv6j},
13449 @samp{armv6t2}, @samp{armv6z}, @samp{armv6kz}, @samp{armv6-m},
13450 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m}, @samp{armv7e-m},
13451 @samp{armv7ve}, @samp{armv8-a}, @samp{armv8-a+crc},
13452 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
13453
13454 @option{-march=armv7ve} is the armv7-a architecture with virtualization
13455 extensions.
13456
13457 @option{-march=armv8-a+crc} enables code generation for the ARMv8-A
13458 architecture together with the optional CRC32 extensions.
13459
13460 @option{-march=native} causes the compiler to auto-detect the architecture
13461 of the build computer.  At present, this feature is only supported on
13462 GNU/Linux, and not all architectures are recognized.  If the auto-detect
13463 is unsuccessful the option has no effect.
13464
13465 @item -mtune=@var{name}
13466 @opindex mtune
13467 This option specifies the name of the target ARM processor for
13468 which GCC should tune the performance of the code.
13469 For some ARM implementations better performance can be obtained by using
13470 this option.
13471 Permissible names are: @samp{arm2}, @samp{arm250},
13472 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
13473 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
13474 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
13475 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
13476 @samp{arm720},
13477 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
13478 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
13479 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
13480 @samp{strongarm1110},
13481 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
13482 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
13483 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
13484 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
13485 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
13486 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
13487 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
13488 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8},
13489 @samp{cortex-a9}, @samp{cortex-a12}, @samp{cortex-a15}, @samp{cortex-a17},
13490 @samp{cortex-a53}, @samp{cortex-a57}, @samp{cortex-a72},
13491 @samp{cortex-r4},
13492 @samp{cortex-r4f}, @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-m7},
13493 @samp{cortex-m4},
13494 @samp{cortex-m3},
13495 @samp{cortex-m1},
13496 @samp{cortex-m0},
13497 @samp{cortex-m0plus},
13498 @samp{cortex-m1.small-multiply},
13499 @samp{cortex-m0.small-multiply},
13500 @samp{cortex-m0plus.small-multiply},
13501 @samp{exynos-m1},
13502 @samp{marvell-pj4},
13503 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
13504 @samp{fa526}, @samp{fa626},
13505 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te},
13506 @samp{xgene1}.
13507
13508 Additionally, this option can specify that GCC should tune the performance
13509 of the code for a big.LITTLE system.  Permissible names are:
13510 @samp{cortex-a15.cortex-a7}, @samp{cortex-a17.cortex-a7},
13511 @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53}.
13512
13513 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
13514 performance for a blend of processors within architecture @var{arch}.
13515 The aim is to generate code that run well on the current most popular
13516 processors, balancing between optimizations that benefit some CPUs in the
13517 range, and avoiding performance pitfalls of other CPUs.  The effects of
13518 this option may change in future GCC versions as CPU models come and go.
13519
13520 @option{-mtune=native} causes the compiler to auto-detect the CPU
13521 of the build computer.  At present, this feature is only supported on
13522 GNU/Linux, and not all architectures are recognized.  If the auto-detect is
13523 unsuccessful the option has no effect.
13524
13525 @item -mcpu=@var{name}
13526 @opindex mcpu
13527 This specifies the name of the target ARM processor.  GCC uses this name
13528 to derive the name of the target ARM architecture (as if specified
13529 by @option{-march}) and the ARM processor type for which to tune for
13530 performance (as if specified by @option{-mtune}).  Where this option
13531 is used in conjunction with @option{-march} or @option{-mtune},
13532 those options take precedence over the appropriate part of this option.
13533
13534 Permissible names for this option are the same as those for
13535 @option{-mtune}.
13536
13537 @option{-mcpu=generic-@var{arch}} is also permissible, and is
13538 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
13539 See @option{-mtune} for more information.
13540
13541 @option{-mcpu=native} causes the compiler to auto-detect the CPU
13542 of the build computer.  At present, this feature is only supported on
13543 GNU/Linux, and not all architectures are recognized.  If the auto-detect
13544 is unsuccessful the option has no effect.
13545
13546 @item -mfpu=@var{name}
13547 @opindex mfpu
13548 This specifies what floating-point hardware (or hardware emulation) is
13549 available on the target.  Permissible names are: @samp{vfp}, @samp{vfpv3},
13550 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
13551 @samp{vfpv3xd-fp16}, @samp{neon}, @samp{neon-fp16}, @samp{vfpv4},
13552 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
13553 @samp{fpv5-d16}, @samp{fpv5-sp-d16},
13554 @samp{fp-armv8}, @samp{neon-fp-armv8}, and @samp{crypto-neon-fp-armv8}.
13555
13556 If @option{-msoft-float} is specified this specifies the format of
13557 floating-point values.
13558
13559 If the selected floating-point hardware includes the NEON extension
13560 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
13561 operations are not generated by GCC's auto-vectorization pass unless
13562 @option{-funsafe-math-optimizations} is also specified.  This is
13563 because NEON hardware does not fully implement the IEEE 754 standard for
13564 floating-point arithmetic (in particular denormal values are treated as
13565 zero), so the use of NEON instructions may lead to a loss of precision.
13566
13567 @item -mfp16-format=@var{name}
13568 @opindex mfp16-format
13569 Specify the format of the @code{__fp16} half-precision floating-point type.
13570 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
13571 the default is @samp{none}, in which case the @code{__fp16} type is not
13572 defined.  @xref{Half-Precision}, for more information.
13573
13574 @item -mstructure-size-boundary=@var{n}
13575 @opindex mstructure-size-boundary
13576 The sizes of all structures and unions are rounded up to a multiple
13577 of the number of bits set by this option.  Permissible values are 8, 32
13578 and 64.  The default value varies for different toolchains.  For the COFF
13579 targeted toolchain the default value is 8.  A value of 64 is only allowed
13580 if the underlying ABI supports it.
13581
13582 Specifying a larger number can produce faster, more efficient code, but
13583 can also increase the size of the program.  Different values are potentially
13584 incompatible.  Code compiled with one value cannot necessarily expect to
13585 work with code or libraries compiled with another value, if they exchange
13586 information using structures or unions.
13587
13588 @item -mabort-on-noreturn
13589 @opindex mabort-on-noreturn
13590 Generate a call to the function @code{abort} at the end of a
13591 @code{noreturn} function.  It is executed if the function tries to
13592 return.
13593
13594 @item -mlong-calls
13595 @itemx -mno-long-calls
13596 @opindex mlong-calls
13597 @opindex mno-long-calls
13598 Tells the compiler to perform function calls by first loading the
13599 address of the function into a register and then performing a subroutine
13600 call on this register.  This switch is needed if the target function
13601 lies outside of the 64-megabyte addressing range of the offset-based
13602 version of subroutine call instruction.
13603
13604 Even if this switch is enabled, not all function calls are turned
13605 into long calls.  The heuristic is that static functions, functions
13606 that have the @code{short_call} attribute, functions that are inside
13607 the scope of a @code{#pragma no_long_calls} directive, and functions whose
13608 definitions have already been compiled within the current compilation
13609 unit are not turned into long calls.  The exceptions to this rule are
13610 that weak function definitions, functions with the @code{long_call}
13611 attribute or the @code{section} attribute, and functions that are within
13612 the scope of a @code{#pragma long_calls} directive are always
13613 turned into long calls.
13614
13615 This feature is not enabled by default.  Specifying
13616 @option{-mno-long-calls} restores the default behavior, as does
13617 placing the function calls within the scope of a @code{#pragma
13618 long_calls_off} directive.  Note these switches have no effect on how
13619 the compiler generates code to handle function calls via function
13620 pointers.
13621
13622 @item -msingle-pic-base
13623 @opindex msingle-pic-base
13624 Treat the register used for PIC addressing as read-only, rather than
13625 loading it in the prologue for each function.  The runtime system is
13626 responsible for initializing this register with an appropriate value
13627 before execution begins.
13628
13629 @item -mpic-register=@var{reg}
13630 @opindex mpic-register
13631 Specify the register to be used for PIC addressing.
13632 For standard PIC base case, the default is any suitable register
13633 determined by compiler.  For single PIC base case, the default is
13634 @samp{R9} if target is EABI based or stack-checking is enabled,
13635 otherwise the default is @samp{R10}.
13636
13637 @item -mpic-data-is-text-relative
13638 @opindex mpic-data-is-text-relative
13639 Assume that each data segments are relative to text segment at load time.
13640 Therefore, it permits addressing data using PC-relative operations.
13641 This option is on by default for targets other than VxWorks RTP.
13642
13643 @item -mpoke-function-name
13644 @opindex mpoke-function-name
13645 Write the name of each function into the text section, directly
13646 preceding the function prologue.  The generated code is similar to this:
13647
13648 @smallexample
13649      t0
13650          .ascii "arm_poke_function_name", 0
13651          .align
13652      t1
13653          .word 0xff000000 + (t1 - t0)
13654      arm_poke_function_name
13655          mov     ip, sp
13656          stmfd   sp!, @{fp, ip, lr, pc@}
13657          sub     fp, ip, #4
13658 @end smallexample
13659
13660 When performing a stack backtrace, code can inspect the value of
13661 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
13662 location @code{pc - 12} and the top 8 bits are set, then we know that
13663 there is a function name embedded immediately preceding this location
13664 and has length @code{((pc[-3]) & 0xff000000)}.
13665
13666 @item -mthumb
13667 @itemx -marm
13668 @opindex marm
13669 @opindex mthumb
13670
13671 Select between generating code that executes in ARM and Thumb
13672 states.  The default for most configurations is to generate code
13673 that executes in ARM state, but the default can be changed by
13674 configuring GCC with the @option{--with-mode=}@var{state}
13675 configure option.
13676
13677 You can also override the ARM and Thumb mode for each function
13678 by using the @code{target("thumb")} and @code{target("arm")} function attributes
13679 (@pxref{ARM Function Attributes}) or pragmas (@pxref{Function Specific Option Pragmas}).
13680
13681 @item -mtpcs-frame
13682 @opindex mtpcs-frame
13683 Generate a stack frame that is compliant with the Thumb Procedure Call
13684 Standard for all non-leaf functions.  (A leaf function is one that does
13685 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
13686
13687 @item -mtpcs-leaf-frame
13688 @opindex mtpcs-leaf-frame
13689 Generate a stack frame that is compliant with the Thumb Procedure Call
13690 Standard for all leaf functions.  (A leaf function is one that does
13691 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
13692
13693 @item -mcallee-super-interworking
13694 @opindex mcallee-super-interworking
13695 Gives all externally visible functions in the file being compiled an ARM
13696 instruction set header which switches to Thumb mode before executing the
13697 rest of the function.  This allows these functions to be called from
13698 non-interworking code.  This option is not valid in AAPCS configurations
13699 because interworking is enabled by default.
13700
13701 @item -mcaller-super-interworking
13702 @opindex mcaller-super-interworking
13703 Allows calls via function pointers (including virtual functions) to
13704 execute correctly regardless of whether the target code has been
13705 compiled for interworking or not.  There is a small overhead in the cost
13706 of executing a function pointer if this option is enabled.  This option
13707 is not valid in AAPCS configurations because interworking is enabled
13708 by default.
13709
13710 @item -mtp=@var{name}
13711 @opindex mtp
13712 Specify the access model for the thread local storage pointer.  The valid
13713 models are @samp{soft}, which generates calls to @code{__aeabi_read_tp},
13714 @samp{cp15}, which fetches the thread pointer from @code{cp15} directly
13715 (supported in the arm6k architecture), and @samp{auto}, which uses the
13716 best available method for the selected processor.  The default setting is
13717 @samp{auto}.
13718
13719 @item -mtls-dialect=@var{dialect}
13720 @opindex mtls-dialect
13721 Specify the dialect to use for accessing thread local storage.  Two
13722 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
13723 @samp{gnu} dialect selects the original GNU scheme for supporting
13724 local and global dynamic TLS models.  The @samp{gnu2} dialect
13725 selects the GNU descriptor scheme, which provides better performance
13726 for shared libraries.  The GNU descriptor scheme is compatible with
13727 the original scheme, but does require new assembler, linker and
13728 library support.  Initial and local exec TLS models are unaffected by
13729 this option and always use the original scheme.
13730
13731 @item -mword-relocations
13732 @opindex mword-relocations
13733 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
13734 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
13735 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
13736 is specified.
13737
13738 @item -mfix-cortex-m3-ldrd
13739 @opindex mfix-cortex-m3-ldrd
13740 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
13741 with overlapping destination and base registers are used.  This option avoids
13742 generating these instructions.  This option is enabled by default when
13743 @option{-mcpu=cortex-m3} is specified.
13744
13745 @item -munaligned-access
13746 @itemx -mno-unaligned-access
13747 @opindex munaligned-access
13748 @opindex mno-unaligned-access
13749 Enables (or disables) reading and writing of 16- and 32- bit values
13750 from addresses that are not 16- or 32- bit aligned.  By default
13751 unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
13752 architectures, and enabled for all other architectures.  If unaligned
13753 access is not enabled then words in packed data structures are
13754 accessed a byte at a time.
13755
13756 The ARM attribute @code{Tag_CPU_unaligned_access} is set in the
13757 generated object file to either true or false, depending upon the
13758 setting of this option.  If unaligned access is enabled then the
13759 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} is also
13760 defined.
13761
13762 @item -mneon-for-64bits
13763 @opindex mneon-for-64bits
13764 Enables using Neon to handle scalar 64-bits operations. This is
13765 disabled by default since the cost of moving data from core registers
13766 to Neon is high.
13767
13768 @item -mslow-flash-data
13769 @opindex mslow-flash-data
13770 Assume loading data from flash is slower than fetching instruction.
13771 Therefore literal load is minimized for better performance.
13772 This option is only supported when compiling for ARMv7 M-profile and
13773 off by default.
13774
13775 @item -masm-syntax-unified
13776 @opindex masm-syntax-unified
13777 Assume inline assembler is using unified asm syntax.  The default is
13778 currently off which implies divided syntax.  This option has no impact
13779 on Thumb2. However, this may change in future releases of GCC.
13780 Divided syntax should be considered deprecated.
13781
13782 @item -mrestrict-it
13783 @opindex mrestrict-it
13784 Restricts generation of IT blocks to conform to the rules of ARMv8.
13785 IT blocks can only contain a single 16-bit instruction from a select
13786 set of instructions. This option is on by default for ARMv8 Thumb mode.
13787
13788 @item -mprint-tune-info
13789 @opindex mprint-tune-info
13790 Print CPU tuning information as comment in assembler file.  This is
13791 an option used only for regression testing of the compiler and not
13792 intended for ordinary use in compiling code.  This option is disabled
13793 by default.
13794 @end table
13795
13796 @node AVR Options
13797 @subsection AVR Options
13798 @cindex AVR Options
13799
13800 These options are defined for AVR implementations:
13801
13802 @table @gcctabopt
13803 @item -mmcu=@var{mcu}
13804 @opindex mmcu
13805 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
13806
13807 The default for this option is@tie{}@samp{avr2}.
13808
13809 GCC supports the following AVR devices and ISAs:
13810
13811 @include avr-mmcu.texi
13812
13813 @item -maccumulate-args
13814 @opindex maccumulate-args
13815 Accumulate outgoing function arguments and acquire/release the needed
13816 stack space for outgoing function arguments once in function
13817 prologue/epilogue.  Without this option, outgoing arguments are pushed
13818 before calling a function and popped afterwards.
13819
13820 Popping the arguments after the function call can be expensive on
13821 AVR so that accumulating the stack space might lead to smaller
13822 executables because arguments need not to be removed from the
13823 stack after such a function call.
13824
13825 This option can lead to reduced code size for functions that perform
13826 several calls to functions that get their arguments on the stack like
13827 calls to printf-like functions.
13828
13829 @item -mbranch-cost=@var{cost}
13830 @opindex mbranch-cost
13831 Set the branch costs for conditional branch instructions to
13832 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
13833 integers. The default branch cost is 0.
13834
13835 @item -mcall-prologues
13836 @opindex mcall-prologues
13837 Functions prologues/epilogues are expanded as calls to appropriate
13838 subroutines.  Code size is smaller.
13839
13840 @item -mint8
13841 @opindex mint8
13842 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
13843 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
13844 and @code{long long} is 4 bytes.  Please note that this option does not
13845 conform to the C standards, but it results in smaller code
13846 size.
13847
13848 @item -mn-flash=@var{num}
13849 @opindex mn-flash
13850 Assume that the flash memory has a size of 
13851 @var{num} times 64@tie{}KiB.
13852
13853 @item -mno-interrupts
13854 @opindex mno-interrupts
13855 Generated code is not compatible with hardware interrupts.
13856 Code size is smaller.
13857
13858 @item -mrelax
13859 @opindex mrelax
13860 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
13861 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
13862 Setting @option{-mrelax} just adds the @option{--mlink-relax} option to
13863 the assembler's command line and the @option{--relax} option to the
13864 linker's command line.
13865
13866 Jump relaxing is performed by the linker because jump offsets are not
13867 known before code is located. Therefore, the assembler code generated by the
13868 compiler is the same, but the instructions in the executable may
13869 differ from instructions in the assembler code.
13870
13871 Relaxing must be turned on if linker stubs are needed, see the
13872 section on @code{EIND} and linker stubs below.
13873
13874 @item -mrmw
13875 @opindex mrmw
13876 Assume that the device supports the Read-Modify-Write
13877 instructions @code{XCH}, @code{LAC}, @code{LAS} and @code{LAT}.
13878
13879 @item -msp8
13880 @opindex msp8
13881 Treat the stack pointer register as an 8-bit register,
13882 i.e.@: assume the high byte of the stack pointer is zero.
13883 In general, you don't need to set this option by hand.
13884
13885 This option is used internally by the compiler to select and
13886 build multilibs for architectures @code{avr2} and @code{avr25}.
13887 These architectures mix devices with and without @code{SPH}.
13888 For any setting other than @option{-mmcu=avr2} or @option{-mmcu=avr25}
13889 the compiler driver adds or removes this option from the compiler
13890 proper's command line, because the compiler then knows if the device
13891 or architecture has an 8-bit stack pointer and thus no @code{SPH}
13892 register or not.
13893
13894 @item -mstrict-X
13895 @opindex mstrict-X
13896 Use address register @code{X} in a way proposed by the hardware.  This means
13897 that @code{X} is only used in indirect, post-increment or
13898 pre-decrement addressing.
13899
13900 Without this option, the @code{X} register may be used in the same way
13901 as @code{Y} or @code{Z} which then is emulated by additional
13902 instructions.  
13903 For example, loading a value with @code{X+const} addressing with a
13904 small non-negative @code{const < 64} to a register @var{Rn} is
13905 performed as
13906
13907 @example
13908 adiw r26, const   ; X += const
13909 ld   @var{Rn}, X        ; @var{Rn} = *X
13910 sbiw r26, const   ; X -= const
13911 @end example
13912
13913 @item -mtiny-stack
13914 @opindex mtiny-stack
13915 Only change the lower 8@tie{}bits of the stack pointer.
13916
13917 @item -nodevicelib
13918 @opindex nodevicelib
13919 Don't link against AVR-LibC's device specific library @code{libdev.a}.
13920
13921 @item -Waddr-space-convert
13922 @opindex Waddr-space-convert
13923 Warn about conversions between address spaces in the case where the
13924 resulting address space is not contained in the incoming address space.
13925 @end table
13926
13927 @subsubsection @code{EIND} and Devices with More Than 128 Ki Bytes of Flash
13928 @cindex @code{EIND}
13929 Pointers in the implementation are 16@tie{}bits wide.
13930 The address of a function or label is represented as word address so
13931 that indirect jumps and calls can target any code address in the
13932 range of 64@tie{}Ki words.
13933
13934 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
13935 bytes of program memory space, there is a special function register called
13936 @code{EIND} that serves as most significant part of the target address
13937 when @code{EICALL} or @code{EIJMP} instructions are used.
13938
13939 Indirect jumps and calls on these devices are handled as follows by
13940 the compiler and are subject to some limitations:
13941
13942 @itemize @bullet
13943
13944 @item
13945 The compiler never sets @code{EIND}.
13946
13947 @item
13948 The compiler uses @code{EIND} implicitely in @code{EICALL}/@code{EIJMP}
13949 instructions or might read @code{EIND} directly in order to emulate an
13950 indirect call/jump by means of a @code{RET} instruction.
13951
13952 @item
13953 The compiler assumes that @code{EIND} never changes during the startup
13954 code or during the application. In particular, @code{EIND} is not
13955 saved/restored in function or interrupt service routine
13956 prologue/epilogue.
13957
13958 @item
13959 For indirect calls to functions and computed goto, the linker
13960 generates @emph{stubs}. Stubs are jump pads sometimes also called
13961 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
13962 The stub contains a direct jump to the desired address.
13963
13964 @item
13965 Linker relaxation must be turned on so that the linker generates
13966 the stubs correctly in all situations. See the compiler option
13967 @option{-mrelax} and the linker option @option{--relax}.
13968 There are corner cases where the linker is supposed to generate stubs
13969 but aborts without relaxation and without a helpful error message.
13970
13971 @item
13972 The default linker script is arranged for code with @code{EIND = 0}.
13973 If code is supposed to work for a setup with @code{EIND != 0}, a custom
13974 linker script has to be used in order to place the sections whose
13975 name start with @code{.trampolines} into the segment where @code{EIND}
13976 points to.
13977
13978 @item
13979 The startup code from libgcc never sets @code{EIND}.
13980 Notice that startup code is a blend of code from libgcc and AVR-LibC.
13981 For the impact of AVR-LibC on @code{EIND}, see the
13982 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
13983
13984 @item
13985 It is legitimate for user-specific startup code to set up @code{EIND}
13986 early, for example by means of initialization code located in
13987 section @code{.init3}. Such code runs prior to general startup code
13988 that initializes RAM and calls constructors, but after the bit
13989 of startup code from AVR-LibC that sets @code{EIND} to the segment
13990 where the vector table is located.
13991 @example
13992 #include <avr/io.h>
13993
13994 static void
13995 __attribute__((section(".init3"),naked,used,no_instrument_function))
13996 init3_set_eind (void)
13997 @{
13998   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
13999                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
14000 @}
14001 @end example
14002
14003 @noindent
14004 The @code{__trampolines_start} symbol is defined in the linker script.
14005
14006 @item
14007 Stubs are generated automatically by the linker if
14008 the following two conditions are met:
14009 @itemize @minus
14010
14011 @item The address of a label is taken by means of the @code{gs} modifier
14012 (short for @emph{generate stubs}) like so:
14013 @example
14014 LDI r24, lo8(gs(@var{func}))
14015 LDI r25, hi8(gs(@var{func}))
14016 @end example
14017 @item The final location of that label is in a code segment
14018 @emph{outside} the segment where the stubs are located.
14019 @end itemize
14020
14021 @item
14022 The compiler emits such @code{gs} modifiers for code labels in the
14023 following situations:
14024 @itemize @minus
14025 @item Taking address of a function or code label.
14026 @item Computed goto.
14027 @item If prologue-save function is used, see @option{-mcall-prologues}
14028 command-line option.
14029 @item Switch/case dispatch tables. If you do not want such dispatch
14030 tables you can specify the @option{-fno-jump-tables} command-line option.
14031 @item C and C++ constructors/destructors called during startup/shutdown.
14032 @item If the tools hit a @code{gs()} modifier explained above.
14033 @end itemize
14034
14035 @item
14036 Jumping to non-symbolic addresses like so is @emph{not} supported:
14037
14038 @example
14039 int main (void)
14040 @{
14041     /* Call function at word address 0x2 */
14042     return ((int(*)(void)) 0x2)();
14043 @}
14044 @end example
14045
14046 Instead, a stub has to be set up, i.e.@: the function has to be called
14047 through a symbol (@code{func_4} in the example):
14048
14049 @example
14050 int main (void)
14051 @{
14052     extern int func_4 (void);
14053
14054     /* Call function at byte address 0x4 */
14055     return func_4();
14056 @}
14057 @end example
14058
14059 and the application be linked with @option{-Wl,--defsym,func_4=0x4}.
14060 Alternatively, @code{func_4} can be defined in the linker script.
14061 @end itemize
14062
14063 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
14064 @cindex @code{RAMPD}
14065 @cindex @code{RAMPX}
14066 @cindex @code{RAMPY}
14067 @cindex @code{RAMPZ}
14068 Some AVR devices support memories larger than the 64@tie{}KiB range
14069 that can be accessed with 16-bit pointers.  To access memory locations
14070 outside this 64@tie{}KiB range, the contentent of a @code{RAMP}
14071 register is used as high part of the address:
14072 The @code{X}, @code{Y}, @code{Z} address register is concatenated
14073 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
14074 register, respectively, to get a wide address. Similarly,
14075 @code{RAMPD} is used together with direct addressing.
14076
14077 @itemize
14078 @item
14079 The startup code initializes the @code{RAMP} special function
14080 registers with zero.
14081
14082 @item
14083 If a @ref{AVR Named Address Spaces,named address space} other than
14084 generic or @code{__flash} is used, then @code{RAMPZ} is set
14085 as needed before the operation.
14086
14087 @item
14088 If the device supports RAM larger than 64@tie{}KiB and the compiler
14089 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
14090 is reset to zero after the operation.
14091
14092 @item
14093 If the device comes with a specific @code{RAMP} register, the ISR
14094 prologue/epilogue saves/restores that SFR and initializes it with
14095 zero in case the ISR code might (implicitly) use it.
14096
14097 @item
14098 RAM larger than 64@tie{}KiB is not supported by GCC for AVR targets.
14099 If you use inline assembler to read from locations outside the
14100 16-bit address range and change one of the @code{RAMP} registers,
14101 you must reset it to zero after the access.
14102
14103 @end itemize
14104
14105 @subsubsection AVR Built-in Macros
14106
14107 GCC defines several built-in macros so that the user code can test
14108 for the presence or absence of features.  Almost any of the following
14109 built-in macros are deduced from device capabilities and thus
14110 triggered by the @option{-mmcu=} command-line option.
14111
14112 For even more AVR-specific built-in macros see
14113 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
14114
14115 @table @code
14116
14117 @item __AVR_ARCH__
14118 Build-in macro that resolves to a decimal number that identifies the
14119 architecture and depends on the @option{-mmcu=@var{mcu}} option.
14120 Possible values are:
14121
14122 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
14123 @code{4}, @code{5}, @code{51}, @code{6}
14124
14125 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3}, @code{avr31},
14126 @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51}, @code{avr6},
14127
14128 respectively and
14129
14130 @code{100}, @code{102}, @code{104},
14131 @code{105}, @code{106}, @code{107}
14132
14133 for @var{mcu}=@code{avrtiny}, @code{avrxmega2}, @code{avrxmega4},
14134 @code{avrxmega5}, @code{avrxmega6}, @code{avrxmega7}, respectively.
14135 If @var{mcu} specifies a device, this built-in macro is set
14136 accordingly. For example, with @option{-mmcu=atmega8} the macro is
14137 defined to @code{4}.
14138
14139 @item __AVR_@var{Device}__
14140 Setting @option{-mmcu=@var{device}} defines this built-in macro which reflects
14141 the device's name. For example, @option{-mmcu=atmega8} defines the
14142 built-in macro @code{__AVR_ATmega8__}, @option{-mmcu=attiny261a} defines
14143 @code{__AVR_ATtiny261A__}, etc.
14144
14145 The built-in macros' names follow
14146 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
14147 the device name as from the AVR user manual. The difference between
14148 @var{Device} in the built-in macro and @var{device} in
14149 @option{-mmcu=@var{device}} is that the latter is always lowercase.
14150
14151 If @var{device} is not a device but only a core architecture like
14152 @samp{avr51}, this macro is not defined.
14153
14154 @item __AVR_DEVICE_NAME__
14155 Setting @option{-mmcu=@var{device}} defines this built-in macro to
14156 the device's name. For example, with @option{-mmcu=atmega8} the macro
14157 is defined to @code{atmega8}.
14158
14159 If @var{device} is not a device but only a core architecture like
14160 @samp{avr51}, this macro is not defined.
14161
14162 @item __AVR_XMEGA__
14163 The device / architecture belongs to the XMEGA family of devices.
14164
14165 @item __AVR_HAVE_ELPM__
14166 The device has the @code{ELPM} instruction.
14167
14168 @item __AVR_HAVE_ELPMX__
14169 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
14170 R@var{n},Z+} instructions.
14171
14172 @item __AVR_HAVE_MOVW__
14173 The device has the @code{MOVW} instruction to perform 16-bit
14174 register-register moves.
14175
14176 @item __AVR_HAVE_LPMX__
14177 The device has the @code{LPM R@var{n},Z} and
14178 @code{LPM R@var{n},Z+} instructions.
14179
14180 @item __AVR_HAVE_MUL__
14181 The device has a hardware multiplier. 
14182
14183 @item __AVR_HAVE_JMP_CALL__
14184 The device has the @code{JMP} and @code{CALL} instructions.
14185 This is the case for devices with at least 16@tie{}KiB of program
14186 memory.
14187
14188 @item __AVR_HAVE_EIJMP_EICALL__
14189 @itemx __AVR_3_BYTE_PC__
14190 The device has the @code{EIJMP} and @code{EICALL} instructions.
14191 This is the case for devices with more than 128@tie{}KiB of program memory.
14192 This also means that the program counter
14193 (PC) is 3@tie{}bytes wide.
14194
14195 @item __AVR_2_BYTE_PC__
14196 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
14197 with up to 128@tie{}KiB of program memory.
14198
14199 @item __AVR_HAVE_8BIT_SP__
14200 @itemx __AVR_HAVE_16BIT_SP__
14201 The stack pointer (SP) register is treated as 8-bit respectively
14202 16-bit register by the compiler.
14203 The definition of these macros is affected by @option{-mtiny-stack}.
14204
14205 @item __AVR_HAVE_SPH__
14206 @itemx __AVR_SP8__
14207 The device has the SPH (high part of stack pointer) special function
14208 register or has an 8-bit stack pointer, respectively.
14209 The definition of these macros is affected by @option{-mmcu=} and
14210 in the cases of @option{-mmcu=avr2} and @option{-mmcu=avr25} also
14211 by @option{-msp8}.
14212
14213 @item __AVR_HAVE_RAMPD__
14214 @itemx __AVR_HAVE_RAMPX__
14215 @itemx __AVR_HAVE_RAMPY__
14216 @itemx __AVR_HAVE_RAMPZ__
14217 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
14218 @code{RAMPZ} special function register, respectively.
14219
14220 @item __NO_INTERRUPTS__
14221 This macro reflects the @option{-mno-interrupts} command-line option.
14222
14223 @item __AVR_ERRATA_SKIP__
14224 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
14225 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
14226 instructions because of a hardware erratum.  Skip instructions are
14227 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
14228 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
14229 set.
14230
14231 @item __AVR_ISA_RMW__
14232 The device has Read-Modify-Write instructions (XCH, LAC, LAS and LAT).
14233
14234 @item __AVR_SFR_OFFSET__=@var{offset}
14235 Instructions that can address I/O special function registers directly
14236 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
14237 address as if addressed by an instruction to access RAM like @code{LD}
14238 or @code{STS}. This offset depends on the device architecture and has
14239 to be subtracted from the RAM address in order to get the
14240 respective I/O@tie{}address.
14241
14242 @item __WITH_AVRLIBC__
14243 The compiler is configured to be used together with AVR-Libc.
14244 See the @option{--with-avrlibc} configure option.
14245
14246 @end table
14247
14248 @node Blackfin Options
14249 @subsection Blackfin Options
14250 @cindex Blackfin Options
14251
14252 @table @gcctabopt
14253 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
14254 @opindex mcpu=
14255 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
14256 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
14257 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
14258 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
14259 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
14260 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
14261 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
14262 @samp{bf561}, @samp{bf592}.
14263
14264 The optional @var{sirevision} specifies the silicon revision of the target
14265 Blackfin processor.  Any workarounds available for the targeted silicon revision
14266 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
14267 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
14268 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
14269 hexadecimal digits representing the major and minor numbers in the silicon
14270 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
14271 is not defined.  If @var{sirevision} is @samp{any}, the
14272 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
14273 If this optional @var{sirevision} is not used, GCC assumes the latest known
14274 silicon revision of the targeted Blackfin processor.
14275
14276 GCC defines a preprocessor macro for the specified @var{cpu}.
14277 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
14278 provided by libgloss to be linked in if @option{-msim} is not given.
14279
14280 Without this option, @samp{bf532} is used as the processor by default.
14281
14282 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
14283 only the preprocessor macro is defined.
14284
14285 @item -msim
14286 @opindex msim
14287 Specifies that the program will be run on the simulator.  This causes
14288 the simulator BSP provided by libgloss to be linked in.  This option
14289 has effect only for @samp{bfin-elf} toolchain.
14290 Certain other options, such as @option{-mid-shared-library} and
14291 @option{-mfdpic}, imply @option{-msim}.
14292
14293 @item -momit-leaf-frame-pointer
14294 @opindex momit-leaf-frame-pointer
14295 Don't keep the frame pointer in a register for leaf functions.  This
14296 avoids the instructions to save, set up and restore frame pointers and
14297 makes an extra register available in leaf functions.  The option
14298 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
14299 which might make debugging harder.
14300
14301 @item -mspecld-anomaly
14302 @opindex mspecld-anomaly
14303 When enabled, the compiler ensures that the generated code does not
14304 contain speculative loads after jump instructions. If this option is used,
14305 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
14306
14307 @item -mno-specld-anomaly
14308 @opindex mno-specld-anomaly
14309 Don't generate extra code to prevent speculative loads from occurring.
14310
14311 @item -mcsync-anomaly
14312 @opindex mcsync-anomaly
14313 When enabled, the compiler ensures that the generated code does not
14314 contain CSYNC or SSYNC instructions too soon after conditional branches.
14315 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
14316
14317 @item -mno-csync-anomaly
14318 @opindex mno-csync-anomaly
14319 Don't generate extra code to prevent CSYNC or SSYNC instructions from
14320 occurring too soon after a conditional branch.
14321
14322 @item -mlow-64k
14323 @opindex mlow-64k
14324 When enabled, the compiler is free to take advantage of the knowledge that
14325 the entire program fits into the low 64k of memory.
14326
14327 @item -mno-low-64k
14328 @opindex mno-low-64k
14329 Assume that the program is arbitrarily large.  This is the default.
14330
14331 @item -mstack-check-l1
14332 @opindex mstack-check-l1
14333 Do stack checking using information placed into L1 scratchpad memory by the
14334 uClinux kernel.
14335
14336 @item -mid-shared-library
14337 @opindex mid-shared-library
14338 Generate code that supports shared libraries via the library ID method.
14339 This allows for execute in place and shared libraries in an environment
14340 without virtual memory management.  This option implies @option{-fPIC}.
14341 With a @samp{bfin-elf} target, this option implies @option{-msim}.
14342
14343 @item -mno-id-shared-library
14344 @opindex mno-id-shared-library
14345 Generate code that doesn't assume ID-based shared libraries are being used.
14346 This is the default.
14347
14348 @item -mleaf-id-shared-library
14349 @opindex mleaf-id-shared-library
14350 Generate code that supports shared libraries via the library ID method,
14351 but assumes that this library or executable won't link against any other
14352 ID shared libraries.  That allows the compiler to use faster code for jumps
14353 and calls.
14354
14355 @item -mno-leaf-id-shared-library
14356 @opindex mno-leaf-id-shared-library
14357 Do not assume that the code being compiled won't link against any ID shared
14358 libraries.  Slower code is generated for jump and call insns.
14359
14360 @item -mshared-library-id=n
14361 @opindex mshared-library-id
14362 Specifies the identification number of the ID-based shared library being
14363 compiled.  Specifying a value of 0 generates more compact code; specifying
14364 other values forces the allocation of that number to the current
14365 library but is no more space- or time-efficient than omitting this option.
14366
14367 @item -msep-data
14368 @opindex msep-data
14369 Generate code that allows the data segment to be located in a different
14370 area of memory from the text segment.  This allows for execute in place in
14371 an environment without virtual memory management by eliminating relocations
14372 against the text section.
14373
14374 @item -mno-sep-data
14375 @opindex mno-sep-data
14376 Generate code that assumes that the data segment follows the text segment.
14377 This is the default.
14378
14379 @item -mlong-calls
14380 @itemx -mno-long-calls
14381 @opindex mlong-calls
14382 @opindex mno-long-calls
14383 Tells the compiler to perform function calls by first loading the
14384 address of the function into a register and then performing a subroutine
14385 call on this register.  This switch is needed if the target function
14386 lies outside of the 24-bit addressing range of the offset-based
14387 version of subroutine call instruction.
14388
14389 This feature is not enabled by default.  Specifying
14390 @option{-mno-long-calls} restores the default behavior.  Note these
14391 switches have no effect on how the compiler generates code to handle
14392 function calls via function pointers.
14393
14394 @item -mfast-fp
14395 @opindex mfast-fp
14396 Link with the fast floating-point library. This library relaxes some of
14397 the IEEE floating-point standard's rules for checking inputs against
14398 Not-a-Number (NAN), in the interest of performance.
14399
14400 @item -minline-plt
14401 @opindex minline-plt
14402 Enable inlining of PLT entries in function calls to functions that are
14403 not known to bind locally.  It has no effect without @option{-mfdpic}.
14404
14405 @item -mmulticore
14406 @opindex mmulticore
14407 Build a standalone application for multicore Blackfin processors. 
14408 This option causes proper start files and link scripts supporting 
14409 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
14410 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
14411
14412 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
14413 selects the one-application-per-core programming model.  Without
14414 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
14415 programming model is used. In this model, the main function of Core B
14416 should be named as @code{coreb_main}.
14417
14418 If this option is not used, the single-core application programming
14419 model is used.
14420
14421 @item -mcorea
14422 @opindex mcorea
14423 Build a standalone application for Core A of BF561 when using
14424 the one-application-per-core programming model. Proper start files
14425 and link scripts are used to support Core A, and the macro
14426 @code{__BFIN_COREA} is defined.
14427 This option can only be used in conjunction with @option{-mmulticore}.
14428
14429 @item -mcoreb
14430 @opindex mcoreb
14431 Build a standalone application for Core B of BF561 when using
14432 the one-application-per-core programming model. Proper start files
14433 and link scripts are used to support Core B, and the macro
14434 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
14435 should be used instead of @code{main}. 
14436 This option can only be used in conjunction with @option{-mmulticore}.
14437
14438 @item -msdram
14439 @opindex msdram
14440 Build a standalone application for SDRAM. Proper start files and
14441 link scripts are used to put the application into SDRAM, and the macro
14442 @code{__BFIN_SDRAM} is defined.
14443 The loader should initialize SDRAM before loading the application.
14444
14445 @item -micplb
14446 @opindex micplb
14447 Assume that ICPLBs are enabled at run time.  This has an effect on certain
14448 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
14449 are enabled; for standalone applications the default is off.
14450 @end table
14451
14452 @node C6X Options
14453 @subsection C6X Options
14454 @cindex C6X Options
14455
14456 @table @gcctabopt
14457 @item -march=@var{name}
14458 @opindex march
14459 This specifies the name of the target architecture.  GCC uses this
14460 name to determine what kind of instructions it can emit when generating
14461 assembly code.  Permissible names are: @samp{c62x},
14462 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
14463
14464 @item -mbig-endian
14465 @opindex mbig-endian
14466 Generate code for a big-endian target.
14467
14468 @item -mlittle-endian
14469 @opindex mlittle-endian
14470 Generate code for a little-endian target.  This is the default.
14471
14472 @item -msim
14473 @opindex msim
14474 Choose startup files and linker script suitable for the simulator.
14475
14476 @item -msdata=default
14477 @opindex msdata=default
14478 Put small global and static data in the @code{.neardata} section,
14479 which is pointed to by register @code{B14}.  Put small uninitialized
14480 global and static data in the @code{.bss} section, which is adjacent
14481 to the @code{.neardata} section.  Put small read-only data into the
14482 @code{.rodata} section.  The corresponding sections used for large
14483 pieces of data are @code{.fardata}, @code{.far} and @code{.const}.
14484
14485 @item -msdata=all
14486 @opindex msdata=all
14487 Put all data, not just small objects, into the sections reserved for
14488 small data, and use addressing relative to the @code{B14} register to
14489 access them.
14490
14491 @item -msdata=none
14492 @opindex msdata=none
14493 Make no use of the sections reserved for small data, and use absolute
14494 addresses to access all data.  Put all initialized global and static
14495 data in the @code{.fardata} section, and all uninitialized data in the
14496 @code{.far} section.  Put all constant data into the @code{.const}
14497 section.
14498 @end table
14499
14500 @node CRIS Options
14501 @subsection CRIS Options
14502 @cindex CRIS Options
14503
14504 These options are defined specifically for the CRIS ports.
14505
14506 @table @gcctabopt
14507 @item -march=@var{architecture-type}
14508 @itemx -mcpu=@var{architecture-type}
14509 @opindex march
14510 @opindex mcpu
14511 Generate code for the specified architecture.  The choices for
14512 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
14513 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
14514 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
14515 @samp{v10}.
14516
14517 @item -mtune=@var{architecture-type}
14518 @opindex mtune
14519 Tune to @var{architecture-type} everything applicable about the generated
14520 code, except for the ABI and the set of available instructions.  The
14521 choices for @var{architecture-type} are the same as for
14522 @option{-march=@var{architecture-type}}.
14523
14524 @item -mmax-stack-frame=@var{n}
14525 @opindex mmax-stack-frame
14526 Warn when the stack frame of a function exceeds @var{n} bytes.
14527
14528 @item -metrax4
14529 @itemx -metrax100
14530 @opindex metrax4
14531 @opindex metrax100
14532 The options @option{-metrax4} and @option{-metrax100} are synonyms for
14533 @option{-march=v3} and @option{-march=v8} respectively.
14534
14535 @item -mmul-bug-workaround
14536 @itemx -mno-mul-bug-workaround
14537 @opindex mmul-bug-workaround
14538 @opindex mno-mul-bug-workaround
14539 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
14540 models where it applies.  This option is active by default.
14541
14542 @item -mpdebug
14543 @opindex mpdebug
14544 Enable CRIS-specific verbose debug-related information in the assembly
14545 code.  This option also has the effect of turning off the @samp{#NO_APP}
14546 formatted-code indicator to the assembler at the beginning of the
14547 assembly file.
14548
14549 @item -mcc-init
14550 @opindex mcc-init
14551 Do not use condition-code results from previous instruction; always emit
14552 compare and test instructions before use of condition codes.
14553
14554 @item -mno-side-effects
14555 @opindex mno-side-effects
14556 Do not emit instructions with side effects in addressing modes other than
14557 post-increment.
14558
14559 @item -mstack-align
14560 @itemx -mno-stack-align
14561 @itemx -mdata-align
14562 @itemx -mno-data-align
14563 @itemx -mconst-align
14564 @itemx -mno-const-align
14565 @opindex mstack-align
14566 @opindex mno-stack-align
14567 @opindex mdata-align
14568 @opindex mno-data-align
14569 @opindex mconst-align
14570 @opindex mno-const-align
14571 These options (@samp{no-} options) arrange (eliminate arrangements) for the
14572 stack frame, individual data and constants to be aligned for the maximum
14573 single data access size for the chosen CPU model.  The default is to
14574 arrange for 32-bit alignment.  ABI details such as structure layout are
14575 not affected by these options.
14576
14577 @item -m32-bit
14578 @itemx -m16-bit
14579 @itemx -m8-bit
14580 @opindex m32-bit
14581 @opindex m16-bit
14582 @opindex m8-bit
14583 Similar to the stack- data- and const-align options above, these options
14584 arrange for stack frame, writable data and constants to all be 32-bit,
14585 16-bit or 8-bit aligned.  The default is 32-bit alignment.
14586
14587 @item -mno-prologue-epilogue
14588 @itemx -mprologue-epilogue
14589 @opindex mno-prologue-epilogue
14590 @opindex mprologue-epilogue
14591 With @option{-mno-prologue-epilogue}, the normal function prologue and
14592 epilogue which set up the stack frame are omitted and no return
14593 instructions or return sequences are generated in the code.  Use this
14594 option only together with visual inspection of the compiled code: no
14595 warnings or errors are generated when call-saved registers must be saved,
14596 or storage for local variables needs to be allocated.
14597
14598 @item -mno-gotplt
14599 @itemx -mgotplt
14600 @opindex mno-gotplt
14601 @opindex mgotplt
14602 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
14603 instruction sequences that load addresses for functions from the PLT part
14604 of the GOT rather than (traditional on other architectures) calls to the
14605 PLT@.  The default is @option{-mgotplt}.
14606
14607 @item -melf
14608 @opindex melf
14609 Legacy no-op option only recognized with the cris-axis-elf and
14610 cris-axis-linux-gnu targets.
14611
14612 @item -mlinux
14613 @opindex mlinux
14614 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
14615
14616 @item -sim
14617 @opindex sim
14618 This option, recognized for the cris-axis-elf, arranges
14619 to link with input-output functions from a simulator library.  Code,
14620 initialized data and zero-initialized data are allocated consecutively.
14621
14622 @item -sim2
14623 @opindex sim2
14624 Like @option{-sim}, but pass linker options to locate initialized data at
14625 0x40000000 and zero-initialized data at 0x80000000.
14626 @end table
14627
14628 @node CR16 Options
14629 @subsection CR16 Options
14630 @cindex CR16 Options
14631
14632 These options are defined specifically for the CR16 ports.
14633
14634 @table @gcctabopt
14635
14636 @item -mmac
14637 @opindex mmac
14638 Enable the use of multiply-accumulate instructions. Disabled by default.
14639
14640 @item -mcr16cplus
14641 @itemx -mcr16c
14642 @opindex mcr16cplus
14643 @opindex mcr16c
14644 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
14645 is default.
14646
14647 @item -msim
14648 @opindex msim
14649 Links the library libsim.a which is in compatible with simulator. Applicable
14650 to ELF compiler only.
14651
14652 @item -mint32
14653 @opindex mint32
14654 Choose integer type as 32-bit wide.
14655
14656 @item -mbit-ops
14657 @opindex mbit-ops
14658 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
14659
14660 @item -mdata-model=@var{model}
14661 @opindex mdata-model
14662 Choose a data model. The choices for @var{model} are @samp{near},
14663 @samp{far} or @samp{medium}. @samp{medium} is default.
14664 However, @samp{far} is not valid with @option{-mcr16c}, as the
14665 CR16C architecture does not support the far data model.
14666 @end table
14667
14668 @node Darwin Options
14669 @subsection Darwin Options
14670 @cindex Darwin options
14671
14672 These options are defined for all architectures running the Darwin operating
14673 system.
14674
14675 FSF GCC on Darwin does not create ``fat'' object files; it creates
14676 an object file for the single architecture that GCC was built to
14677 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
14678 @option{-arch} options are used; it does so by running the compiler or
14679 linker multiple times and joining the results together with
14680 @file{lipo}.
14681
14682 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
14683 @samp{i686}) is determined by the flags that specify the ISA
14684 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
14685 @option{-force_cpusubtype_ALL} option can be used to override this.
14686
14687 The Darwin tools vary in their behavior when presented with an ISA
14688 mismatch.  The assembler, @file{as}, only permits instructions to
14689 be used that are valid for the subtype of the file it is generating,
14690 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
14691 The linker for shared libraries, @file{/usr/bin/libtool}, fails
14692 and prints an error if asked to create a shared library with a less
14693 restrictive subtype than its input files (for instance, trying to put
14694 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
14695 for executables, @command{ld}, quietly gives the executable the most
14696 restrictive subtype of any of its input files.
14697
14698 @table @gcctabopt
14699 @item -F@var{dir}
14700 @opindex F
14701 Add the framework directory @var{dir} to the head of the list of
14702 directories to be searched for header files.  These directories are
14703 interleaved with those specified by @option{-I} options and are
14704 scanned in a left-to-right order.
14705
14706 A framework directory is a directory with frameworks in it.  A
14707 framework is a directory with a @file{Headers} and/or
14708 @file{PrivateHeaders} directory contained directly in it that ends
14709 in @file{.framework}.  The name of a framework is the name of this
14710 directory excluding the @file{.framework}.  Headers associated with
14711 the framework are found in one of those two directories, with
14712 @file{Headers} being searched first.  A subframework is a framework
14713 directory that is in a framework's @file{Frameworks} directory.
14714 Includes of subframework headers can only appear in a header of a
14715 framework that contains the subframework, or in a sibling subframework
14716 header.  Two subframeworks are siblings if they occur in the same
14717 framework.  A subframework should not have the same name as a
14718 framework; a warning is issued if this is violated.  Currently a
14719 subframework cannot have subframeworks; in the future, the mechanism
14720 may be extended to support this.  The standard frameworks can be found
14721 in @file{/System/Library/Frameworks} and
14722 @file{/Library/Frameworks}.  An example include looks like
14723 @code{#include <Framework/header.h>}, where @file{Framework} denotes
14724 the name of the framework and @file{header.h} is found in the
14725 @file{PrivateHeaders} or @file{Headers} directory.
14726
14727 @item -iframework@var{dir}
14728 @opindex iframework
14729 Like @option{-F} except the directory is a treated as a system
14730 directory.  The main difference between this @option{-iframework} and
14731 @option{-F} is that with @option{-iframework} the compiler does not
14732 warn about constructs contained within header files found via
14733 @var{dir}.  This option is valid only for the C family of languages.
14734
14735 @item -gused
14736 @opindex gused
14737 Emit debugging information for symbols that are used.  For stabs
14738 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
14739 This is by default ON@.
14740
14741 @item -gfull
14742 @opindex gfull
14743 Emit debugging information for all symbols and types.
14744
14745 @item -mmacosx-version-min=@var{version}
14746 The earliest version of MacOS X that this executable will run on
14747 is @var{version}.  Typical values of @var{version} include @code{10.1},
14748 @code{10.2}, and @code{10.3.9}.
14749
14750 If the compiler was built to use the system's headers by default,
14751 then the default for this option is the system version on which the
14752 compiler is running, otherwise the default is to make choices that
14753 are compatible with as many systems and code bases as possible.
14754
14755 @item -mkernel
14756 @opindex mkernel
14757 Enable kernel development mode.  The @option{-mkernel} option sets
14758 @option{-static}, @option{-fno-common}, @option{-fno-use-cxa-atexit},
14759 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
14760 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
14761 applicable.  This mode also sets @option{-mno-altivec},
14762 @option{-msoft-float}, @option{-fno-builtin} and
14763 @option{-mlong-branch} for PowerPC targets.
14764
14765 @item -mone-byte-bool
14766 @opindex mone-byte-bool
14767 Override the defaults for @code{bool} so that @code{sizeof(bool)==1}.
14768 By default @code{sizeof(bool)} is @code{4} when compiling for
14769 Darwin/PowerPC and @code{1} when compiling for Darwin/x86, so this
14770 option has no effect on x86.
14771
14772 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
14773 to generate code that is not binary compatible with code generated
14774 without that switch.  Using this switch may require recompiling all
14775 other modules in a program, including system libraries.  Use this
14776 switch to conform to a non-default data model.
14777
14778 @item -mfix-and-continue
14779 @itemx -ffix-and-continue
14780 @itemx -findirect-data
14781 @opindex mfix-and-continue
14782 @opindex ffix-and-continue
14783 @opindex findirect-data
14784 Generate code suitable for fast turnaround development, such as to
14785 allow GDB to dynamically load @file{.o} files into already-running
14786 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
14787 are provided for backwards compatibility.
14788
14789 @item -all_load
14790 @opindex all_load
14791 Loads all members of static archive libraries.
14792 See man ld(1) for more information.
14793
14794 @item -arch_errors_fatal
14795 @opindex arch_errors_fatal
14796 Cause the errors having to do with files that have the wrong architecture
14797 to be fatal.
14798
14799 @item -bind_at_load
14800 @opindex bind_at_load
14801 Causes the output file to be marked such that the dynamic linker will
14802 bind all undefined references when the file is loaded or launched.
14803
14804 @item -bundle
14805 @opindex bundle
14806 Produce a Mach-o bundle format file.
14807 See man ld(1) for more information.
14808
14809 @item -bundle_loader @var{executable}
14810 @opindex bundle_loader
14811 This option specifies the @var{executable} that will load the build
14812 output file being linked.  See man ld(1) for more information.
14813
14814 @item -dynamiclib
14815 @opindex dynamiclib
14816 When passed this option, GCC produces a dynamic library instead of
14817 an executable when linking, using the Darwin @file{libtool} command.
14818
14819 @item -force_cpusubtype_ALL
14820 @opindex force_cpusubtype_ALL
14821 This causes GCC's output file to have the @samp{ALL} subtype, instead of
14822 one controlled by the @option{-mcpu} or @option{-march} option.
14823
14824 @item -allowable_client  @var{client_name}
14825 @itemx -client_name
14826 @itemx -compatibility_version
14827 @itemx -current_version
14828 @itemx -dead_strip
14829 @itemx -dependency-file
14830 @itemx -dylib_file
14831 @itemx -dylinker_install_name
14832 @itemx -dynamic
14833 @itemx -exported_symbols_list
14834 @itemx -filelist
14835 @need 800
14836 @itemx -flat_namespace
14837 @itemx -force_flat_namespace
14838 @itemx -headerpad_max_install_names
14839 @itemx -image_base
14840 @itemx -init
14841 @itemx -install_name
14842 @itemx -keep_private_externs
14843 @itemx -multi_module
14844 @itemx -multiply_defined
14845 @itemx -multiply_defined_unused
14846 @need 800
14847 @itemx -noall_load
14848 @itemx -no_dead_strip_inits_and_terms
14849 @itemx -nofixprebinding
14850 @itemx -nomultidefs
14851 @itemx -noprebind
14852 @itemx -noseglinkedit
14853 @itemx -pagezero_size
14854 @itemx -prebind
14855 @itemx -prebind_all_twolevel_modules
14856 @itemx -private_bundle
14857 @need 800
14858 @itemx -read_only_relocs
14859 @itemx -sectalign
14860 @itemx -sectobjectsymbols
14861 @itemx -whyload
14862 @itemx -seg1addr
14863 @itemx -sectcreate
14864 @itemx -sectobjectsymbols
14865 @itemx -sectorder
14866 @itemx -segaddr
14867 @itemx -segs_read_only_addr
14868 @need 800
14869 @itemx -segs_read_write_addr
14870 @itemx -seg_addr_table
14871 @itemx -seg_addr_table_filename
14872 @itemx -seglinkedit
14873 @itemx -segprot
14874 @itemx -segs_read_only_addr
14875 @itemx -segs_read_write_addr
14876 @itemx -single_module
14877 @itemx -static
14878 @itemx -sub_library
14879 @need 800
14880 @itemx -sub_umbrella
14881 @itemx -twolevel_namespace
14882 @itemx -umbrella
14883 @itemx -undefined
14884 @itemx -unexported_symbols_list
14885 @itemx -weak_reference_mismatches
14886 @itemx -whatsloaded
14887 @opindex allowable_client
14888 @opindex client_name
14889 @opindex compatibility_version
14890 @opindex current_version
14891 @opindex dead_strip
14892 @opindex dependency-file
14893 @opindex dylib_file
14894 @opindex dylinker_install_name
14895 @opindex dynamic
14896 @opindex exported_symbols_list
14897 @opindex filelist
14898 @opindex flat_namespace
14899 @opindex force_flat_namespace
14900 @opindex headerpad_max_install_names
14901 @opindex image_base
14902 @opindex init
14903 @opindex install_name
14904 @opindex keep_private_externs
14905 @opindex multi_module
14906 @opindex multiply_defined
14907 @opindex multiply_defined_unused
14908 @opindex noall_load
14909 @opindex no_dead_strip_inits_and_terms
14910 @opindex nofixprebinding
14911 @opindex nomultidefs
14912 @opindex noprebind
14913 @opindex noseglinkedit
14914 @opindex pagezero_size
14915 @opindex prebind
14916 @opindex prebind_all_twolevel_modules
14917 @opindex private_bundle
14918 @opindex read_only_relocs
14919 @opindex sectalign
14920 @opindex sectobjectsymbols
14921 @opindex whyload
14922 @opindex seg1addr
14923 @opindex sectcreate
14924 @opindex sectobjectsymbols
14925 @opindex sectorder
14926 @opindex segaddr
14927 @opindex segs_read_only_addr
14928 @opindex segs_read_write_addr
14929 @opindex seg_addr_table
14930 @opindex seg_addr_table_filename
14931 @opindex seglinkedit
14932 @opindex segprot
14933 @opindex segs_read_only_addr
14934 @opindex segs_read_write_addr
14935 @opindex single_module
14936 @opindex static
14937 @opindex sub_library
14938 @opindex sub_umbrella
14939 @opindex twolevel_namespace
14940 @opindex umbrella
14941 @opindex undefined
14942 @opindex unexported_symbols_list
14943 @opindex weak_reference_mismatches
14944 @opindex whatsloaded
14945 These options are passed to the Darwin linker.  The Darwin linker man page
14946 describes them in detail.
14947 @end table
14948
14949 @node DEC Alpha Options
14950 @subsection DEC Alpha Options
14951
14952 These @samp{-m} options are defined for the DEC Alpha implementations:
14953
14954 @table @gcctabopt
14955 @item -mno-soft-float
14956 @itemx -msoft-float
14957 @opindex mno-soft-float
14958 @opindex msoft-float
14959 Use (do not use) the hardware floating-point instructions for
14960 floating-point operations.  When @option{-msoft-float} is specified,
14961 functions in @file{libgcc.a} are used to perform floating-point
14962 operations.  Unless they are replaced by routines that emulate the
14963 floating-point operations, or compiled in such a way as to call such
14964 emulations routines, these routines issue floating-point
14965 operations.   If you are compiling for an Alpha without floating-point
14966 operations, you must ensure that the library is built so as not to call
14967 them.
14968
14969 Note that Alpha implementations without floating-point operations are
14970 required to have floating-point registers.
14971
14972 @item -mfp-reg
14973 @itemx -mno-fp-regs
14974 @opindex mfp-reg
14975 @opindex mno-fp-regs
14976 Generate code that uses (does not use) the floating-point register set.
14977 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
14978 register set is not used, floating-point operands are passed in integer
14979 registers as if they were integers and floating-point results are passed
14980 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
14981 so any function with a floating-point argument or return value called by code
14982 compiled with @option{-mno-fp-regs} must also be compiled with that
14983 option.
14984
14985 A typical use of this option is building a kernel that does not use,
14986 and hence need not save and restore, any floating-point registers.
14987
14988 @item -mieee
14989 @opindex mieee
14990 The Alpha architecture implements floating-point hardware optimized for
14991 maximum performance.  It is mostly compliant with the IEEE floating-point
14992 standard.  However, for full compliance, software assistance is
14993 required.  This option generates code fully IEEE-compliant code
14994 @emph{except} that the @var{inexact-flag} is not maintained (see below).
14995 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
14996 defined during compilation.  The resulting code is less efficient but is
14997 able to correctly support denormalized numbers and exceptional IEEE
14998 values such as not-a-number and plus/minus infinity.  Other Alpha
14999 compilers call this option @option{-ieee_with_no_inexact}.
15000
15001 @item -mieee-with-inexact
15002 @opindex mieee-with-inexact
15003 This is like @option{-mieee} except the generated code also maintains
15004 the IEEE @var{inexact-flag}.  Turning on this option causes the
15005 generated code to implement fully-compliant IEEE math.  In addition to
15006 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
15007 macro.  On some Alpha implementations the resulting code may execute
15008 significantly slower than the code generated by default.  Since there is
15009 very little code that depends on the @var{inexact-flag}, you should
15010 normally not specify this option.  Other Alpha compilers call this
15011 option @option{-ieee_with_inexact}.
15012
15013 @item -mfp-trap-mode=@var{trap-mode}
15014 @opindex mfp-trap-mode
15015 This option controls what floating-point related traps are enabled.
15016 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
15017 The trap mode can be set to one of four values:
15018
15019 @table @samp
15020 @item n
15021 This is the default (normal) setting.  The only traps that are enabled
15022 are the ones that cannot be disabled in software (e.g., division by zero
15023 trap).
15024
15025 @item u
15026 In addition to the traps enabled by @samp{n}, underflow traps are enabled
15027 as well.
15028
15029 @item su
15030 Like @samp{u}, but the instructions are marked to be safe for software
15031 completion (see Alpha architecture manual for details).
15032
15033 @item sui
15034 Like @samp{su}, but inexact traps are enabled as well.
15035 @end table
15036
15037 @item -mfp-rounding-mode=@var{rounding-mode}
15038 @opindex mfp-rounding-mode
15039 Selects the IEEE rounding mode.  Other Alpha compilers call this option
15040 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
15041 of:
15042
15043 @table @samp
15044 @item n
15045 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
15046 the nearest machine number or towards the even machine number in case
15047 of a tie.
15048
15049 @item m
15050 Round towards minus infinity.
15051
15052 @item c
15053 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
15054
15055 @item d
15056 Dynamic rounding mode.  A field in the floating-point control register
15057 (@var{fpcr}, see Alpha architecture reference manual) controls the
15058 rounding mode in effect.  The C library initializes this register for
15059 rounding towards plus infinity.  Thus, unless your program modifies the
15060 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
15061 @end table
15062
15063 @item -mtrap-precision=@var{trap-precision}
15064 @opindex mtrap-precision
15065 In the Alpha architecture, floating-point traps are imprecise.  This
15066 means without software assistance it is impossible to recover from a
15067 floating trap and program execution normally needs to be terminated.
15068 GCC can generate code that can assist operating system trap handlers
15069 in determining the exact location that caused a floating-point trap.
15070 Depending on the requirements of an application, different levels of
15071 precisions can be selected:
15072
15073 @table @samp
15074 @item p
15075 Program precision.  This option is the default and means a trap handler
15076 can only identify which program caused a floating-point exception.
15077
15078 @item f
15079 Function precision.  The trap handler can determine the function that
15080 caused a floating-point exception.
15081
15082 @item i
15083 Instruction precision.  The trap handler can determine the exact
15084 instruction that caused a floating-point exception.
15085 @end table
15086
15087 Other Alpha compilers provide the equivalent options called
15088 @option{-scope_safe} and @option{-resumption_safe}.
15089
15090 @item -mieee-conformant
15091 @opindex mieee-conformant
15092 This option marks the generated code as IEEE conformant.  You must not
15093 use this option unless you also specify @option{-mtrap-precision=i} and either
15094 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
15095 is to emit the line @samp{.eflag 48} in the function prologue of the
15096 generated assembly file.
15097
15098 @item -mbuild-constants
15099 @opindex mbuild-constants
15100 Normally GCC examines a 32- or 64-bit integer constant to
15101 see if it can construct it from smaller constants in two or three
15102 instructions.  If it cannot, it outputs the constant as a literal and
15103 generates code to load it from the data segment at run time.
15104
15105 Use this option to require GCC to construct @emph{all} integer constants
15106 using code, even if it takes more instructions (the maximum is six).
15107
15108 You typically use this option to build a shared library dynamic
15109 loader.  Itself a shared library, it must relocate itself in memory
15110 before it can find the variables and constants in its own data segment.
15111
15112 @item -mbwx
15113 @itemx -mno-bwx
15114 @itemx -mcix
15115 @itemx -mno-cix
15116 @itemx -mfix
15117 @itemx -mno-fix
15118 @itemx -mmax
15119 @itemx -mno-max
15120 @opindex mbwx
15121 @opindex mno-bwx
15122 @opindex mcix
15123 @opindex mno-cix
15124 @opindex mfix
15125 @opindex mno-fix
15126 @opindex mmax
15127 @opindex mno-max
15128 Indicate whether GCC should generate code to use the optional BWX,
15129 CIX, FIX and MAX instruction sets.  The default is to use the instruction
15130 sets supported by the CPU type specified via @option{-mcpu=} option or that
15131 of the CPU on which GCC was built if none is specified.
15132
15133 @item -mfloat-vax
15134 @itemx -mfloat-ieee
15135 @opindex mfloat-vax
15136 @opindex mfloat-ieee
15137 Generate code that uses (does not use) VAX F and G floating-point
15138 arithmetic instead of IEEE single and double precision.
15139
15140 @item -mexplicit-relocs
15141 @itemx -mno-explicit-relocs
15142 @opindex mexplicit-relocs
15143 @opindex mno-explicit-relocs
15144 Older Alpha assemblers provided no way to generate symbol relocations
15145 except via assembler macros.  Use of these macros does not allow
15146 optimal instruction scheduling.  GNU binutils as of version 2.12
15147 supports a new syntax that allows the compiler to explicitly mark
15148 which relocations should apply to which instructions.  This option
15149 is mostly useful for debugging, as GCC detects the capabilities of
15150 the assembler when it is built and sets the default accordingly.
15151
15152 @item -msmall-data
15153 @itemx -mlarge-data
15154 @opindex msmall-data
15155 @opindex mlarge-data
15156 When @option{-mexplicit-relocs} is in effect, static data is
15157 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
15158 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
15159 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
15160 16-bit relocations off of the @code{$gp} register.  This limits the
15161 size of the small data area to 64KB, but allows the variables to be
15162 directly accessed via a single instruction.
15163
15164 The default is @option{-mlarge-data}.  With this option the data area
15165 is limited to just below 2GB@.  Programs that require more than 2GB of
15166 data must use @code{malloc} or @code{mmap} to allocate the data in the
15167 heap instead of in the program's data segment.
15168
15169 When generating code for shared libraries, @option{-fpic} implies
15170 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
15171
15172 @item -msmall-text
15173 @itemx -mlarge-text
15174 @opindex msmall-text
15175 @opindex mlarge-text
15176 When @option{-msmall-text} is used, the compiler assumes that the
15177 code of the entire program (or shared library) fits in 4MB, and is
15178 thus reachable with a branch instruction.  When @option{-msmall-data}
15179 is used, the compiler can assume that all local symbols share the
15180 same @code{$gp} value, and thus reduce the number of instructions
15181 required for a function call from 4 to 1.
15182
15183 The default is @option{-mlarge-text}.
15184
15185 @item -mcpu=@var{cpu_type}
15186 @opindex mcpu
15187 Set the instruction set and instruction scheduling parameters for
15188 machine type @var{cpu_type}.  You can specify either the @samp{EV}
15189 style name or the corresponding chip number.  GCC supports scheduling
15190 parameters for the EV4, EV5 and EV6 family of processors and
15191 chooses the default values for the instruction set from the processor
15192 you specify.  If you do not specify a processor type, GCC defaults
15193 to the processor on which the compiler was built.
15194
15195 Supported values for @var{cpu_type} are
15196
15197 @table @samp
15198 @item ev4
15199 @itemx ev45
15200 @itemx 21064
15201 Schedules as an EV4 and has no instruction set extensions.
15202
15203 @item ev5
15204 @itemx 21164
15205 Schedules as an EV5 and has no instruction set extensions.
15206
15207 @item ev56
15208 @itemx 21164a
15209 Schedules as an EV5 and supports the BWX extension.
15210
15211 @item pca56
15212 @itemx 21164pc
15213 @itemx 21164PC
15214 Schedules as an EV5 and supports the BWX and MAX extensions.
15215
15216 @item ev6
15217 @itemx 21264
15218 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
15219
15220 @item ev67
15221 @itemx 21264a
15222 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
15223 @end table
15224
15225 Native toolchains also support the value @samp{native},
15226 which selects the best architecture option for the host processor.
15227 @option{-mcpu=native} has no effect if GCC does not recognize
15228 the processor.
15229
15230 @item -mtune=@var{cpu_type}
15231 @opindex mtune
15232 Set only the instruction scheduling parameters for machine type
15233 @var{cpu_type}.  The instruction set is not changed.
15234
15235 Native toolchains also support the value @samp{native},
15236 which selects the best architecture option for the host processor.
15237 @option{-mtune=native} has no effect if GCC does not recognize
15238 the processor.
15239
15240 @item -mmemory-latency=@var{time}
15241 @opindex mmemory-latency
15242 Sets the latency the scheduler should assume for typical memory
15243 references as seen by the application.  This number is highly
15244 dependent on the memory access patterns used by the application
15245 and the size of the external cache on the machine.
15246
15247 Valid options for @var{time} are
15248
15249 @table @samp
15250 @item @var{number}
15251 A decimal number representing clock cycles.
15252
15253 @item L1
15254 @itemx L2
15255 @itemx L3
15256 @itemx main
15257 The compiler contains estimates of the number of clock cycles for
15258 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
15259 (also called Dcache, Scache, and Bcache), as well as to main memory.
15260 Note that L3 is only valid for EV5.
15261
15262 @end table
15263 @end table
15264
15265 @node FR30 Options
15266 @subsection FR30 Options
15267 @cindex FR30 Options
15268
15269 These options are defined specifically for the FR30 port.
15270
15271 @table @gcctabopt
15272
15273 @item -msmall-model
15274 @opindex msmall-model
15275 Use the small address space model.  This can produce smaller code, but
15276 it does assume that all symbolic values and addresses fit into a
15277 20-bit range.
15278
15279 @item -mno-lsim
15280 @opindex mno-lsim
15281 Assume that runtime support has been provided and so there is no need
15282 to include the simulator library (@file{libsim.a}) on the linker
15283 command line.
15284
15285 @end table
15286
15287 @node FT32 Options
15288 @subsection FT32 Options
15289 @cindex FT32 Options
15290
15291 These options are defined specifically for the FT32 port.
15292
15293 @table @gcctabopt
15294
15295 @item -msim
15296 @opindex msim
15297 Specifies that the program will be run on the simulator.  This causes
15298 an alternate runtime startup and library to be linked.
15299 You must not use this option when generating programs that will run on
15300 real hardware; you must provide your own runtime library for whatever
15301 I/O functions are needed.
15302
15303 @item -mlra
15304 @opindex mlra
15305 Enable Local Register Allocation.  This is still experimental for FT32,
15306 so by default the compiler uses standard reload.
15307
15308 @end table
15309
15310 @node FRV Options
15311 @subsection FRV Options
15312 @cindex FRV Options
15313
15314 @table @gcctabopt
15315 @item -mgpr-32
15316 @opindex mgpr-32
15317
15318 Only use the first 32 general-purpose registers.
15319
15320 @item -mgpr-64
15321 @opindex mgpr-64
15322
15323 Use all 64 general-purpose registers.
15324
15325 @item -mfpr-32
15326 @opindex mfpr-32
15327
15328 Use only the first 32 floating-point registers.
15329
15330 @item -mfpr-64
15331 @opindex mfpr-64
15332
15333 Use all 64 floating-point registers.
15334
15335 @item -mhard-float
15336 @opindex mhard-float
15337
15338 Use hardware instructions for floating-point operations.
15339
15340 @item -msoft-float
15341 @opindex msoft-float
15342
15343 Use library routines for floating-point operations.
15344
15345 @item -malloc-cc
15346 @opindex malloc-cc
15347
15348 Dynamically allocate condition code registers.
15349
15350 @item -mfixed-cc
15351 @opindex mfixed-cc
15352
15353 Do not try to dynamically allocate condition code registers, only
15354 use @code{icc0} and @code{fcc0}.
15355
15356 @item -mdword
15357 @opindex mdword
15358
15359 Change ABI to use double word insns.
15360
15361 @item -mno-dword
15362 @opindex mno-dword
15363
15364 Do not use double word instructions.
15365
15366 @item -mdouble
15367 @opindex mdouble
15368
15369 Use floating-point double instructions.
15370
15371 @item -mno-double
15372 @opindex mno-double
15373
15374 Do not use floating-point double instructions.
15375
15376 @item -mmedia
15377 @opindex mmedia
15378
15379 Use media instructions.
15380
15381 @item -mno-media
15382 @opindex mno-media
15383
15384 Do not use media instructions.
15385
15386 @item -mmuladd
15387 @opindex mmuladd
15388
15389 Use multiply and add/subtract instructions.
15390
15391 @item -mno-muladd
15392 @opindex mno-muladd
15393
15394 Do not use multiply and add/subtract instructions.
15395
15396 @item -mfdpic
15397 @opindex mfdpic
15398
15399 Select the FDPIC ABI, which uses function descriptors to represent
15400 pointers to functions.  Without any PIC/PIE-related options, it
15401 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
15402 assumes GOT entries and small data are within a 12-bit range from the
15403 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
15404 are computed with 32 bits.
15405 With a @samp{bfin-elf} target, this option implies @option{-msim}.
15406
15407 @item -minline-plt
15408 @opindex minline-plt
15409
15410 Enable inlining of PLT entries in function calls to functions that are
15411 not known to bind locally.  It has no effect without @option{-mfdpic}.
15412 It's enabled by default if optimizing for speed and compiling for
15413 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
15414 optimization option such as @option{-O3} or above is present in the
15415 command line.
15416
15417 @item -mTLS
15418 @opindex mTLS
15419
15420 Assume a large TLS segment when generating thread-local code.
15421
15422 @item -mtls
15423 @opindex mtls
15424
15425 Do not assume a large TLS segment when generating thread-local code.
15426
15427 @item -mgprel-ro
15428 @opindex mgprel-ro
15429
15430 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
15431 that is known to be in read-only sections.  It's enabled by default,
15432 except for @option{-fpic} or @option{-fpie}: even though it may help
15433 make the global offset table smaller, it trades 1 instruction for 4.
15434 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
15435 one of which may be shared by multiple symbols, and it avoids the need
15436 for a GOT entry for the referenced symbol, so it's more likely to be a
15437 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
15438
15439 @item -multilib-library-pic
15440 @opindex multilib-library-pic
15441
15442 Link with the (library, not FD) pic libraries.  It's implied by
15443 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
15444 @option{-fpic} without @option{-mfdpic}.  You should never have to use
15445 it explicitly.
15446
15447 @item -mlinked-fp
15448 @opindex mlinked-fp
15449
15450 Follow the EABI requirement of always creating a frame pointer whenever
15451 a stack frame is allocated.  This option is enabled by default and can
15452 be disabled with @option{-mno-linked-fp}.
15453
15454 @item -mlong-calls
15455 @opindex mlong-calls
15456
15457 Use indirect addressing to call functions outside the current
15458 compilation unit.  This allows the functions to be placed anywhere
15459 within the 32-bit address space.
15460
15461 @item -malign-labels
15462 @opindex malign-labels
15463
15464 Try to align labels to an 8-byte boundary by inserting NOPs into the
15465 previous packet.  This option only has an effect when VLIW packing
15466 is enabled.  It doesn't create new packets; it merely adds NOPs to
15467 existing ones.
15468
15469 @item -mlibrary-pic
15470 @opindex mlibrary-pic
15471
15472 Generate position-independent EABI code.
15473
15474 @item -macc-4
15475 @opindex macc-4
15476
15477 Use only the first four media accumulator registers.
15478
15479 @item -macc-8
15480 @opindex macc-8
15481
15482 Use all eight media accumulator registers.
15483
15484 @item -mpack
15485 @opindex mpack
15486
15487 Pack VLIW instructions.
15488
15489 @item -mno-pack
15490 @opindex mno-pack
15491
15492 Do not pack VLIW instructions.
15493
15494 @item -mno-eflags
15495 @opindex mno-eflags
15496
15497 Do not mark ABI switches in e_flags.
15498
15499 @item -mcond-move
15500 @opindex mcond-move
15501
15502 Enable the use of conditional-move instructions (default).
15503
15504 This switch is mainly for debugging the compiler and will likely be removed
15505 in a future version.
15506
15507 @item -mno-cond-move
15508 @opindex mno-cond-move
15509
15510 Disable the use of conditional-move instructions.
15511
15512 This switch is mainly for debugging the compiler and will likely be removed
15513 in a future version.
15514
15515 @item -mscc
15516 @opindex mscc
15517
15518 Enable the use of conditional set instructions (default).
15519
15520 This switch is mainly for debugging the compiler and will likely be removed
15521 in a future version.
15522
15523 @item -mno-scc
15524 @opindex mno-scc
15525
15526 Disable the use of conditional set instructions.
15527
15528 This switch is mainly for debugging the compiler and will likely be removed
15529 in a future version.
15530
15531 @item -mcond-exec
15532 @opindex mcond-exec
15533
15534 Enable the use of conditional execution (default).
15535
15536 This switch is mainly for debugging the compiler and will likely be removed
15537 in a future version.
15538
15539 @item -mno-cond-exec
15540 @opindex mno-cond-exec
15541
15542 Disable the use of conditional execution.
15543
15544 This switch is mainly for debugging the compiler and will likely be removed
15545 in a future version.
15546
15547 @item -mvliw-branch
15548 @opindex mvliw-branch
15549
15550 Run a pass to pack branches into VLIW instructions (default).
15551
15552 This switch is mainly for debugging the compiler and will likely be removed
15553 in a future version.
15554
15555 @item -mno-vliw-branch
15556 @opindex mno-vliw-branch
15557
15558 Do not run a pass to pack branches into VLIW instructions.
15559
15560 This switch is mainly for debugging the compiler and will likely be removed
15561 in a future version.
15562
15563 @item -mmulti-cond-exec
15564 @opindex mmulti-cond-exec
15565
15566 Enable optimization of @code{&&} and @code{||} in conditional execution
15567 (default).
15568
15569 This switch is mainly for debugging the compiler and will likely be removed
15570 in a future version.
15571
15572 @item -mno-multi-cond-exec
15573 @opindex mno-multi-cond-exec
15574
15575 Disable optimization of @code{&&} and @code{||} in conditional execution.
15576
15577 This switch is mainly for debugging the compiler and will likely be removed
15578 in a future version.
15579
15580 @item -mnested-cond-exec
15581 @opindex mnested-cond-exec
15582
15583 Enable nested conditional execution optimizations (default).
15584
15585 This switch is mainly for debugging the compiler and will likely be removed
15586 in a future version.
15587
15588 @item -mno-nested-cond-exec
15589 @opindex mno-nested-cond-exec
15590
15591 Disable nested conditional execution optimizations.
15592
15593 This switch is mainly for debugging the compiler and will likely be removed
15594 in a future version.
15595
15596 @item -moptimize-membar
15597 @opindex moptimize-membar
15598
15599 This switch removes redundant @code{membar} instructions from the
15600 compiler-generated code.  It is enabled by default.
15601
15602 @item -mno-optimize-membar
15603 @opindex mno-optimize-membar
15604
15605 This switch disables the automatic removal of redundant @code{membar}
15606 instructions from the generated code.
15607
15608 @item -mtomcat-stats
15609 @opindex mtomcat-stats
15610
15611 Cause gas to print out tomcat statistics.
15612
15613 @item -mcpu=@var{cpu}
15614 @opindex mcpu
15615
15616 Select the processor type for which to generate code.  Possible values are
15617 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
15618 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
15619
15620 @end table
15621
15622 @node GNU/Linux Options
15623 @subsection GNU/Linux Options
15624
15625 These @samp{-m} options are defined for GNU/Linux targets:
15626
15627 @table @gcctabopt
15628 @item -mglibc
15629 @opindex mglibc
15630 Use the GNU C library.  This is the default except
15631 on @samp{*-*-linux-*uclibc*}, @samp{*-*-linux-*musl*} and
15632 @samp{*-*-linux-*android*} targets.
15633
15634 @item -muclibc
15635 @opindex muclibc
15636 Use uClibc C library.  This is the default on
15637 @samp{*-*-linux-*uclibc*} targets.
15638
15639 @item -mmusl
15640 @opindex mmusl
15641 Use the musl C library.  This is the default on
15642 @samp{*-*-linux-*musl*} targets.
15643
15644 @item -mbionic
15645 @opindex mbionic
15646 Use Bionic C library.  This is the default on
15647 @samp{*-*-linux-*android*} targets.
15648
15649 @item -mandroid
15650 @opindex mandroid
15651 Compile code compatible with Android platform.  This is the default on
15652 @samp{*-*-linux-*android*} targets.
15653
15654 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
15655 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
15656 this option makes the GCC driver pass Android-specific options to the linker.
15657 Finally, this option causes the preprocessor macro @code{__ANDROID__}
15658 to be defined.
15659
15660 @item -tno-android-cc
15661 @opindex tno-android-cc
15662 Disable compilation effects of @option{-mandroid}, i.e., do not enable
15663 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
15664 @option{-fno-rtti} by default.
15665
15666 @item -tno-android-ld
15667 @opindex tno-android-ld
15668 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
15669 linking options to the linker.
15670
15671 @end table
15672
15673 @node H8/300 Options
15674 @subsection H8/300 Options
15675
15676 These @samp{-m} options are defined for the H8/300 implementations:
15677
15678 @table @gcctabopt
15679 @item -mrelax
15680 @opindex mrelax
15681 Shorten some address references at link time, when possible; uses the
15682 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
15683 ld, Using ld}, for a fuller description.
15684
15685 @item -mh
15686 @opindex mh
15687 Generate code for the H8/300H@.
15688
15689 @item -ms
15690 @opindex ms
15691 Generate code for the H8S@.
15692
15693 @item -mn
15694 @opindex mn
15695 Generate code for the H8S and H8/300H in the normal mode.  This switch
15696 must be used either with @option{-mh} or @option{-ms}.
15697
15698 @item -ms2600
15699 @opindex ms2600
15700 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
15701
15702 @item -mexr
15703 @opindex mexr
15704 Extended registers are stored on stack before execution of function
15705 with monitor attribute. Default option is @option{-mexr}.
15706 This option is valid only for H8S targets.
15707
15708 @item -mno-exr
15709 @opindex mno-exr
15710 Extended registers are not stored on stack before execution of function 
15711 with monitor attribute. Default option is @option{-mno-exr}. 
15712 This option is valid only for H8S targets.
15713
15714 @item -mint32
15715 @opindex mint32
15716 Make @code{int} data 32 bits by default.
15717
15718 @item -malign-300
15719 @opindex malign-300
15720 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
15721 The default for the H8/300H and H8S is to align longs and floats on
15722 4-byte boundaries.
15723 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
15724 This option has no effect on the H8/300.
15725 @end table
15726
15727 @node HPPA Options
15728 @subsection HPPA Options
15729 @cindex HPPA Options
15730
15731 These @samp{-m} options are defined for the HPPA family of computers:
15732
15733 @table @gcctabopt
15734 @item -march=@var{architecture-type}
15735 @opindex march
15736 Generate code for the specified architecture.  The choices for
15737 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
15738 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
15739 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
15740 architecture option for your machine.  Code compiled for lower numbered
15741 architectures runs on higher numbered architectures, but not the
15742 other way around.
15743
15744 @item -mpa-risc-1-0
15745 @itemx -mpa-risc-1-1
15746 @itemx -mpa-risc-2-0
15747 @opindex mpa-risc-1-0
15748 @opindex mpa-risc-1-1
15749 @opindex mpa-risc-2-0
15750 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
15751
15752 @item -mjump-in-delay
15753 @opindex mjump-in-delay
15754 This option is ignored and provided for compatibility purposes only.
15755
15756 @item -mdisable-fpregs
15757 @opindex mdisable-fpregs
15758 Prevent floating-point registers from being used in any manner.  This is
15759 necessary for compiling kernels that perform lazy context switching of
15760 floating-point registers.  If you use this option and attempt to perform
15761 floating-point operations, the compiler aborts.
15762
15763 @item -mdisable-indexing
15764 @opindex mdisable-indexing
15765 Prevent the compiler from using indexing address modes.  This avoids some
15766 rather obscure problems when compiling MIG generated code under MACH@.
15767
15768 @item -mno-space-regs
15769 @opindex mno-space-regs
15770 Generate code that assumes the target has no space registers.  This allows
15771 GCC to generate faster indirect calls and use unscaled index address modes.
15772
15773 Such code is suitable for level 0 PA systems and kernels.
15774
15775 @item -mfast-indirect-calls
15776 @opindex mfast-indirect-calls
15777 Generate code that assumes calls never cross space boundaries.  This
15778 allows GCC to emit code that performs faster indirect calls.
15779
15780 This option does not work in the presence of shared libraries or nested
15781 functions.
15782
15783 @item -mfixed-range=@var{register-range}
15784 @opindex mfixed-range
15785 Generate code treating the given register range as fixed registers.
15786 A fixed register is one that the register allocator cannot use.  This is
15787 useful when compiling kernel code.  A register range is specified as
15788 two registers separated by a dash.  Multiple register ranges can be
15789 specified separated by a comma.
15790
15791 @item -mlong-load-store
15792 @opindex mlong-load-store
15793 Generate 3-instruction load and store sequences as sometimes required by
15794 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
15795 the HP compilers.
15796
15797 @item -mportable-runtime
15798 @opindex mportable-runtime
15799 Use the portable calling conventions proposed by HP for ELF systems.
15800
15801 @item -mgas
15802 @opindex mgas
15803 Enable the use of assembler directives only GAS understands.
15804
15805 @item -mschedule=@var{cpu-type}
15806 @opindex mschedule
15807 Schedule code according to the constraints for the machine type
15808 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
15809 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
15810 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
15811 proper scheduling option for your machine.  The default scheduling is
15812 @samp{8000}.
15813
15814 @item -mlinker-opt
15815 @opindex mlinker-opt
15816 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
15817 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
15818 linkers in which they give bogus error messages when linking some programs.
15819
15820 @item -msoft-float
15821 @opindex msoft-float
15822 Generate output containing library calls for floating point.
15823 @strong{Warning:} the requisite libraries are not available for all HPPA
15824 targets.  Normally the facilities of the machine's usual C compiler are
15825 used, but this cannot be done directly in cross-compilation.  You must make
15826 your own arrangements to provide suitable library functions for
15827 cross-compilation.
15828
15829 @option{-msoft-float} changes the calling convention in the output file;
15830 therefore, it is only useful if you compile @emph{all} of a program with
15831 this option.  In particular, you need to compile @file{libgcc.a}, the
15832 library that comes with GCC, with @option{-msoft-float} in order for
15833 this to work.
15834
15835 @item -msio
15836 @opindex msio
15837 Generate the predefine, @code{_SIO}, for server IO@.  The default is
15838 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
15839 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
15840 options are available under HP-UX and HI-UX@.
15841
15842 @item -mgnu-ld
15843 @opindex mgnu-ld
15844 Use options specific to GNU @command{ld}.
15845 This passes @option{-shared} to @command{ld} when
15846 building a shared library.  It is the default when GCC is configured,
15847 explicitly or implicitly, with the GNU linker.  This option does not
15848 affect which @command{ld} is called; it only changes what parameters
15849 are passed to that @command{ld}.
15850 The @command{ld} that is called is determined by the
15851 @option{--with-ld} configure option, GCC's program search path, and
15852 finally by the user's @env{PATH}.  The linker used by GCC can be printed
15853 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
15854 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
15855
15856 @item -mhp-ld
15857 @opindex mhp-ld
15858 Use options specific to HP @command{ld}.
15859 This passes @option{-b} to @command{ld} when building
15860 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
15861 links.  It is the default when GCC is configured, explicitly or
15862 implicitly, with the HP linker.  This option does not affect
15863 which @command{ld} is called; it only changes what parameters are passed to that
15864 @command{ld}.
15865 The @command{ld} that is called is determined by the @option{--with-ld}
15866 configure option, GCC's program search path, and finally by the user's
15867 @env{PATH}.  The linker used by GCC can be printed using @samp{which
15868 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
15869 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
15870
15871 @item -mlong-calls
15872 @opindex mno-long-calls
15873 Generate code that uses long call sequences.  This ensures that a call
15874 is always able to reach linker generated stubs.  The default is to generate
15875 long calls only when the distance from the call site to the beginning
15876 of the function or translation unit, as the case may be, exceeds a
15877 predefined limit set by the branch type being used.  The limits for
15878 normal calls are 7,600,000 and 240,000 bytes, respectively for the
15879 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
15880 240,000 bytes.
15881
15882 Distances are measured from the beginning of functions when using the
15883 @option{-ffunction-sections} option, or when using the @option{-mgas}
15884 and @option{-mno-portable-runtime} options together under HP-UX with
15885 the SOM linker.
15886
15887 It is normally not desirable to use this option as it degrades
15888 performance.  However, it may be useful in large applications,
15889 particularly when partial linking is used to build the application.
15890
15891 The types of long calls used depends on the capabilities of the
15892 assembler and linker, and the type of code being generated.  The
15893 impact on systems that support long absolute calls, and long pic
15894 symbol-difference or pc-relative calls should be relatively small.
15895 However, an indirect call is used on 32-bit ELF systems in pic code
15896 and it is quite long.
15897
15898 @item -munix=@var{unix-std}
15899 @opindex march
15900 Generate compiler predefines and select a startfile for the specified
15901 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
15902 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
15903 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
15904 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
15905 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
15906 and later.
15907
15908 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
15909 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
15910 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
15911 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
15912 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
15913 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
15914
15915 It is @emph{important} to note that this option changes the interfaces
15916 for various library routines.  It also affects the operational behavior
15917 of the C library.  Thus, @emph{extreme} care is needed in using this
15918 option.
15919
15920 Library code that is intended to operate with more than one UNIX
15921 standard must test, set and restore the variable @code{__xpg4_extended_mask}
15922 as appropriate.  Most GNU software doesn't provide this capability.
15923
15924 @item -nolibdld
15925 @opindex nolibdld
15926 Suppress the generation of link options to search libdld.sl when the
15927 @option{-static} option is specified on HP-UX 10 and later.
15928
15929 @item -static
15930 @opindex static
15931 The HP-UX implementation of setlocale in libc has a dependency on
15932 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
15933 when the @option{-static} option is specified, special link options
15934 are needed to resolve this dependency.
15935
15936 On HP-UX 10 and later, the GCC driver adds the necessary options to
15937 link with libdld.sl when the @option{-static} option is specified.
15938 This causes the resulting binary to be dynamic.  On the 64-bit port,
15939 the linkers generate dynamic binaries by default in any case.  The
15940 @option{-nolibdld} option can be used to prevent the GCC driver from
15941 adding these link options.
15942
15943 @item -threads
15944 @opindex threads
15945 Add support for multithreading with the @dfn{dce thread} library
15946 under HP-UX@.  This option sets flags for both the preprocessor and
15947 linker.
15948 @end table
15949
15950 @node IA-64 Options
15951 @subsection IA-64 Options
15952 @cindex IA-64 Options
15953
15954 These are the @samp{-m} options defined for the Intel IA-64 architecture.
15955
15956 @table @gcctabopt
15957 @item -mbig-endian
15958 @opindex mbig-endian
15959 Generate code for a big-endian target.  This is the default for HP-UX@.
15960
15961 @item -mlittle-endian
15962 @opindex mlittle-endian
15963 Generate code for a little-endian target.  This is the default for AIX5
15964 and GNU/Linux.
15965
15966 @item -mgnu-as
15967 @itemx -mno-gnu-as
15968 @opindex mgnu-as
15969 @opindex mno-gnu-as
15970 Generate (or don't) code for the GNU assembler.  This is the default.
15971 @c Also, this is the default if the configure option @option{--with-gnu-as}
15972 @c is used.
15973
15974 @item -mgnu-ld
15975 @itemx -mno-gnu-ld
15976 @opindex mgnu-ld
15977 @opindex mno-gnu-ld
15978 Generate (or don't) code for the GNU linker.  This is the default.
15979 @c Also, this is the default if the configure option @option{--with-gnu-ld}
15980 @c is used.
15981
15982 @item -mno-pic
15983 @opindex mno-pic
15984 Generate code that does not use a global pointer register.  The result
15985 is not position independent code, and violates the IA-64 ABI@.
15986
15987 @item -mvolatile-asm-stop
15988 @itemx -mno-volatile-asm-stop
15989 @opindex mvolatile-asm-stop
15990 @opindex mno-volatile-asm-stop
15991 Generate (or don't) a stop bit immediately before and after volatile asm
15992 statements.
15993
15994 @item -mregister-names
15995 @itemx -mno-register-names
15996 @opindex mregister-names
15997 @opindex mno-register-names
15998 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
15999 the stacked registers.  This may make assembler output more readable.
16000
16001 @item -mno-sdata
16002 @itemx -msdata
16003 @opindex mno-sdata
16004 @opindex msdata
16005 Disable (or enable) optimizations that use the small data section.  This may
16006 be useful for working around optimizer bugs.
16007
16008 @item -mconstant-gp
16009 @opindex mconstant-gp
16010 Generate code that uses a single constant global pointer value.  This is
16011 useful when compiling kernel code.
16012
16013 @item -mauto-pic
16014 @opindex mauto-pic
16015 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
16016 This is useful when compiling firmware code.
16017
16018 @item -minline-float-divide-min-latency
16019 @opindex minline-float-divide-min-latency
16020 Generate code for inline divides of floating-point values
16021 using the minimum latency algorithm.
16022
16023 @item -minline-float-divide-max-throughput
16024 @opindex minline-float-divide-max-throughput
16025 Generate code for inline divides of floating-point values
16026 using the maximum throughput algorithm.
16027
16028 @item -mno-inline-float-divide
16029 @opindex mno-inline-float-divide
16030 Do not generate inline code for divides of floating-point values.
16031
16032 @item -minline-int-divide-min-latency
16033 @opindex minline-int-divide-min-latency
16034 Generate code for inline divides of integer values
16035 using the minimum latency algorithm.
16036
16037 @item -minline-int-divide-max-throughput
16038 @opindex minline-int-divide-max-throughput
16039 Generate code for inline divides of integer values
16040 using the maximum throughput algorithm.
16041
16042 @item -mno-inline-int-divide
16043 @opindex mno-inline-int-divide
16044 Do not generate inline code for divides of integer values.
16045
16046 @item -minline-sqrt-min-latency
16047 @opindex minline-sqrt-min-latency
16048 Generate code for inline square roots
16049 using the minimum latency algorithm.
16050
16051 @item -minline-sqrt-max-throughput
16052 @opindex minline-sqrt-max-throughput
16053 Generate code for inline square roots
16054 using the maximum throughput algorithm.
16055
16056 @item -mno-inline-sqrt
16057 @opindex mno-inline-sqrt
16058 Do not generate inline code for @code{sqrt}.
16059
16060 @item -mfused-madd
16061 @itemx -mno-fused-madd
16062 @opindex mfused-madd
16063 @opindex mno-fused-madd
16064 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
16065 instructions.  The default is to use these instructions.
16066
16067 @item -mno-dwarf2-asm
16068 @itemx -mdwarf2-asm
16069 @opindex mno-dwarf2-asm
16070 @opindex mdwarf2-asm
16071 Don't (or do) generate assembler code for the DWARF 2 line number debugging
16072 info.  This may be useful when not using the GNU assembler.
16073
16074 @item -mearly-stop-bits
16075 @itemx -mno-early-stop-bits
16076 @opindex mearly-stop-bits
16077 @opindex mno-early-stop-bits
16078 Allow stop bits to be placed earlier than immediately preceding the
16079 instruction that triggered the stop bit.  This can improve instruction
16080 scheduling, but does not always do so.
16081
16082 @item -mfixed-range=@var{register-range}
16083 @opindex mfixed-range
16084 Generate code treating the given register range as fixed registers.
16085 A fixed register is one that the register allocator cannot use.  This is
16086 useful when compiling kernel code.  A register range is specified as
16087 two registers separated by a dash.  Multiple register ranges can be
16088 specified separated by a comma.
16089
16090 @item -mtls-size=@var{tls-size}
16091 @opindex mtls-size
16092 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
16093 64.
16094
16095 @item -mtune=@var{cpu-type}
16096 @opindex mtune
16097 Tune the instruction scheduling for a particular CPU, Valid values are
16098 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
16099 and @samp{mckinley}.
16100
16101 @item -milp32
16102 @itemx -mlp64
16103 @opindex milp32
16104 @opindex mlp64
16105 Generate code for a 32-bit or 64-bit environment.
16106 The 32-bit environment sets int, long and pointer to 32 bits.
16107 The 64-bit environment sets int to 32 bits and long and pointer
16108 to 64 bits.  These are HP-UX specific flags.
16109
16110 @item -mno-sched-br-data-spec
16111 @itemx -msched-br-data-spec
16112 @opindex mno-sched-br-data-spec
16113 @opindex msched-br-data-spec
16114 (Dis/En)able data speculative scheduling before reload.
16115 This results in generation of @code{ld.a} instructions and
16116 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
16117 The default is 'disable'.
16118
16119 @item -msched-ar-data-spec
16120 @itemx -mno-sched-ar-data-spec
16121 @opindex msched-ar-data-spec
16122 @opindex mno-sched-ar-data-spec
16123 (En/Dis)able data speculative scheduling after reload.
16124 This results in generation of @code{ld.a} instructions and
16125 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
16126 The default is 'enable'.
16127
16128 @item -mno-sched-control-spec
16129 @itemx -msched-control-spec
16130 @opindex mno-sched-control-spec
16131 @opindex msched-control-spec
16132 (Dis/En)able control speculative scheduling.  This feature is
16133 available only during region scheduling (i.e.@: before reload).
16134 This results in generation of the @code{ld.s} instructions and
16135 the corresponding check instructions @code{chk.s}.
16136 The default is 'disable'.
16137
16138 @item -msched-br-in-data-spec
16139 @itemx -mno-sched-br-in-data-spec
16140 @opindex msched-br-in-data-spec
16141 @opindex mno-sched-br-in-data-spec
16142 (En/Dis)able speculative scheduling of the instructions that
16143 are dependent on the data speculative loads before reload.
16144 This is effective only with @option{-msched-br-data-spec} enabled.
16145 The default is 'enable'.
16146
16147 @item -msched-ar-in-data-spec
16148 @itemx -mno-sched-ar-in-data-spec
16149 @opindex msched-ar-in-data-spec
16150 @opindex mno-sched-ar-in-data-spec
16151 (En/Dis)able speculative scheduling of the instructions that
16152 are dependent on the data speculative loads after reload.
16153 This is effective only with @option{-msched-ar-data-spec} enabled.
16154 The default is 'enable'.
16155
16156 @item -msched-in-control-spec
16157 @itemx -mno-sched-in-control-spec
16158 @opindex msched-in-control-spec
16159 @opindex mno-sched-in-control-spec
16160 (En/Dis)able speculative scheduling of the instructions that
16161 are dependent on the control speculative loads.
16162 This is effective only with @option{-msched-control-spec} enabled.
16163 The default is 'enable'.
16164
16165 @item -mno-sched-prefer-non-data-spec-insns
16166 @itemx -msched-prefer-non-data-spec-insns
16167 @opindex mno-sched-prefer-non-data-spec-insns
16168 @opindex msched-prefer-non-data-spec-insns
16169 If enabled, data-speculative instructions are chosen for schedule
16170 only if there are no other choices at the moment.  This makes
16171 the use of the data speculation much more conservative.
16172 The default is 'disable'.
16173
16174 @item -mno-sched-prefer-non-control-spec-insns
16175 @itemx -msched-prefer-non-control-spec-insns
16176 @opindex mno-sched-prefer-non-control-spec-insns
16177 @opindex msched-prefer-non-control-spec-insns
16178 If enabled, control-speculative instructions are chosen for schedule
16179 only if there are no other choices at the moment.  This makes
16180 the use of the control speculation much more conservative.
16181 The default is 'disable'.
16182
16183 @item -mno-sched-count-spec-in-critical-path
16184 @itemx -msched-count-spec-in-critical-path
16185 @opindex mno-sched-count-spec-in-critical-path
16186 @opindex msched-count-spec-in-critical-path
16187 If enabled, speculative dependencies are considered during
16188 computation of the instructions priorities.  This makes the use of the
16189 speculation a bit more conservative.
16190 The default is 'disable'.
16191
16192 @item -msched-spec-ldc
16193 @opindex msched-spec-ldc
16194 Use a simple data speculation check.  This option is on by default.
16195
16196 @item -msched-control-spec-ldc
16197 @opindex msched-spec-ldc
16198 Use a simple check for control speculation.  This option is on by default.
16199
16200 @item -msched-stop-bits-after-every-cycle
16201 @opindex msched-stop-bits-after-every-cycle
16202 Place a stop bit after every cycle when scheduling.  This option is on
16203 by default.
16204
16205 @item -msched-fp-mem-deps-zero-cost
16206 @opindex msched-fp-mem-deps-zero-cost
16207 Assume that floating-point stores and loads are not likely to cause a conflict
16208 when placed into the same instruction group.  This option is disabled by
16209 default.
16210
16211 @item -msel-sched-dont-check-control-spec
16212 @opindex msel-sched-dont-check-control-spec
16213 Generate checks for control speculation in selective scheduling.
16214 This flag is disabled by default.
16215
16216 @item -msched-max-memory-insns=@var{max-insns}
16217 @opindex msched-max-memory-insns
16218 Limit on the number of memory insns per instruction group, giving lower
16219 priority to subsequent memory insns attempting to schedule in the same
16220 instruction group. Frequently useful to prevent cache bank conflicts.
16221 The default value is 1.
16222
16223 @item -msched-max-memory-insns-hard-limit
16224 @opindex msched-max-memory-insns-hard-limit
16225 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
16226 disallowing more than that number in an instruction group.
16227 Otherwise, the limit is ``soft'', meaning that non-memory operations
16228 are preferred when the limit is reached, but memory operations may still
16229 be scheduled.
16230
16231 @end table
16232
16233 @node LM32 Options
16234 @subsection LM32 Options
16235 @cindex LM32 options
16236
16237 These @option{-m} options are defined for the LatticeMico32 architecture:
16238
16239 @table @gcctabopt
16240 @item -mbarrel-shift-enabled
16241 @opindex mbarrel-shift-enabled
16242 Enable barrel-shift instructions.
16243
16244 @item -mdivide-enabled
16245 @opindex mdivide-enabled
16246 Enable divide and modulus instructions.
16247
16248 @item -mmultiply-enabled
16249 @opindex multiply-enabled
16250 Enable multiply instructions.
16251
16252 @item -msign-extend-enabled
16253 @opindex msign-extend-enabled
16254 Enable sign extend instructions.
16255
16256 @item -muser-enabled
16257 @opindex muser-enabled
16258 Enable user-defined instructions.
16259
16260 @end table
16261
16262 @node M32C Options
16263 @subsection M32C Options
16264 @cindex M32C options
16265
16266 @table @gcctabopt
16267 @item -mcpu=@var{name}
16268 @opindex mcpu=
16269 Select the CPU for which code is generated.  @var{name} may be one of
16270 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
16271 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
16272 the M32C/80 series.
16273
16274 @item -msim
16275 @opindex msim
16276 Specifies that the program will be run on the simulator.  This causes
16277 an alternate runtime library to be linked in which supports, for
16278 example, file I/O@.  You must not use this option when generating
16279 programs that will run on real hardware; you must provide your own
16280 runtime library for whatever I/O functions are needed.
16281
16282 @item -memregs=@var{number}
16283 @opindex memregs=
16284 Specifies the number of memory-based pseudo-registers GCC uses
16285 during code generation.  These pseudo-registers are used like real
16286 registers, so there is a tradeoff between GCC's ability to fit the
16287 code into available registers, and the performance penalty of using
16288 memory instead of registers.  Note that all modules in a program must
16289 be compiled with the same value for this option.  Because of that, you
16290 must not use this option with GCC's default runtime libraries.
16291
16292 @end table
16293
16294 @node M32R/D Options
16295 @subsection M32R/D Options
16296 @cindex M32R/D options
16297
16298 These @option{-m} options are defined for Renesas M32R/D architectures:
16299
16300 @table @gcctabopt
16301 @item -m32r2
16302 @opindex m32r2
16303 Generate code for the M32R/2@.
16304
16305 @item -m32rx
16306 @opindex m32rx
16307 Generate code for the M32R/X@.
16308
16309 @item -m32r
16310 @opindex m32r
16311 Generate code for the M32R@.  This is the default.
16312
16313 @item -mmodel=small
16314 @opindex mmodel=small
16315 Assume all objects live in the lower 16MB of memory (so that their addresses
16316 can be loaded with the @code{ld24} instruction), and assume all subroutines
16317 are reachable with the @code{bl} instruction.
16318 This is the default.
16319
16320 The addressability of a particular object can be set with the
16321 @code{model} attribute.
16322
16323 @item -mmodel=medium
16324 @opindex mmodel=medium
16325 Assume objects may be anywhere in the 32-bit address space (the compiler
16326 generates @code{seth/add3} instructions to load their addresses), and
16327 assume all subroutines are reachable with the @code{bl} instruction.
16328
16329 @item -mmodel=large
16330 @opindex mmodel=large
16331 Assume objects may be anywhere in the 32-bit address space (the compiler
16332 generates @code{seth/add3} instructions to load their addresses), and
16333 assume subroutines may not be reachable with the @code{bl} instruction
16334 (the compiler generates the much slower @code{seth/add3/jl}
16335 instruction sequence).
16336
16337 @item -msdata=none
16338 @opindex msdata=none
16339 Disable use of the small data area.  Variables are put into
16340 one of @code{.data}, @code{.bss}, or @code{.rodata} (unless the
16341 @code{section} attribute has been specified).
16342 This is the default.
16343
16344 The small data area consists of sections @code{.sdata} and @code{.sbss}.
16345 Objects may be explicitly put in the small data area with the
16346 @code{section} attribute using one of these sections.
16347
16348 @item -msdata=sdata
16349 @opindex msdata=sdata
16350 Put small global and static data in the small data area, but do not
16351 generate special code to reference them.
16352
16353 @item -msdata=use
16354 @opindex msdata=use
16355 Put small global and static data in the small data area, and generate
16356 special instructions to reference them.
16357
16358 @item -G @var{num}
16359 @opindex G
16360 @cindex smaller data references
16361 Put global and static objects less than or equal to @var{num} bytes
16362 into the small data or BSS sections instead of the normal data or BSS
16363 sections.  The default value of @var{num} is 8.
16364 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
16365 for this option to have any effect.
16366
16367 All modules should be compiled with the same @option{-G @var{num}} value.
16368 Compiling with different values of @var{num} may or may not work; if it
16369 doesn't the linker gives an error message---incorrect code is not
16370 generated.
16371
16372 @item -mdebug
16373 @opindex mdebug
16374 Makes the M32R-specific code in the compiler display some statistics
16375 that might help in debugging programs.
16376
16377 @item -malign-loops
16378 @opindex malign-loops
16379 Align all loops to a 32-byte boundary.
16380
16381 @item -mno-align-loops
16382 @opindex mno-align-loops
16383 Do not enforce a 32-byte alignment for loops.  This is the default.
16384
16385 @item -missue-rate=@var{number}
16386 @opindex missue-rate=@var{number}
16387 Issue @var{number} instructions per cycle.  @var{number} can only be 1
16388 or 2.
16389
16390 @item -mbranch-cost=@var{number}
16391 @opindex mbranch-cost=@var{number}
16392 @var{number} can only be 1 or 2.  If it is 1 then branches are
16393 preferred over conditional code, if it is 2, then the opposite applies.
16394
16395 @item -mflush-trap=@var{number}
16396 @opindex mflush-trap=@var{number}
16397 Specifies the trap number to use to flush the cache.  The default is
16398 12.  Valid numbers are between 0 and 15 inclusive.
16399
16400 @item -mno-flush-trap
16401 @opindex mno-flush-trap
16402 Specifies that the cache cannot be flushed by using a trap.
16403
16404 @item -mflush-func=@var{name}
16405 @opindex mflush-func=@var{name}
16406 Specifies the name of the operating system function to call to flush
16407 the cache.  The default is @samp{_flush_cache}, but a function call
16408 is only used if a trap is not available.
16409
16410 @item -mno-flush-func
16411 @opindex mno-flush-func
16412 Indicates that there is no OS function for flushing the cache.
16413
16414 @end table
16415
16416 @node M680x0 Options
16417 @subsection M680x0 Options
16418 @cindex M680x0 options
16419
16420 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
16421 The default settings depend on which architecture was selected when
16422 the compiler was configured; the defaults for the most common choices
16423 are given below.
16424
16425 @table @gcctabopt
16426 @item -march=@var{arch}
16427 @opindex march
16428 Generate code for a specific M680x0 or ColdFire instruction set
16429 architecture.  Permissible values of @var{arch} for M680x0
16430 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
16431 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
16432 architectures are selected according to Freescale's ISA classification
16433 and the permissible values are: @samp{isaa}, @samp{isaaplus},
16434 @samp{isab} and @samp{isac}.
16435
16436 GCC defines a macro @code{__mcf@var{arch}__} whenever it is generating
16437 code for a ColdFire target.  The @var{arch} in this macro is one of the
16438 @option{-march} arguments given above.
16439
16440 When used together, @option{-march} and @option{-mtune} select code
16441 that runs on a family of similar processors but that is optimized
16442 for a particular microarchitecture.
16443
16444 @item -mcpu=@var{cpu}
16445 @opindex mcpu
16446 Generate code for a specific M680x0 or ColdFire processor.
16447 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
16448 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
16449 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
16450 below, which also classifies the CPUs into families:
16451
16452 @multitable @columnfractions 0.20 0.80
16453 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
16454 @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}
16455 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
16456 @item @samp{5206e} @tab @samp{5206e}
16457 @item @samp{5208} @tab @samp{5207} @samp{5208}
16458 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
16459 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
16460 @item @samp{5216} @tab @samp{5214} @samp{5216}
16461 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
16462 @item @samp{5225} @tab @samp{5224} @samp{5225}
16463 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
16464 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
16465 @item @samp{5249} @tab @samp{5249}
16466 @item @samp{5250} @tab @samp{5250}
16467 @item @samp{5271} @tab @samp{5270} @samp{5271}
16468 @item @samp{5272} @tab @samp{5272}
16469 @item @samp{5275} @tab @samp{5274} @samp{5275}
16470 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
16471 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
16472 @item @samp{5307} @tab @samp{5307}
16473 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
16474 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
16475 @item @samp{5407} @tab @samp{5407}
16476 @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}
16477 @end multitable
16478
16479 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
16480 @var{arch} is compatible with @var{cpu}.  Other combinations of
16481 @option{-mcpu} and @option{-march} are rejected.
16482
16483 GCC defines the macro @code{__mcf_cpu_@var{cpu}} when ColdFire target
16484 @var{cpu} is selected.  It also defines @code{__mcf_family_@var{family}},
16485 where the value of @var{family} is given by the table above.
16486
16487 @item -mtune=@var{tune}
16488 @opindex mtune
16489 Tune the code for a particular microarchitecture within the
16490 constraints set by @option{-march} and @option{-mcpu}.
16491 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
16492 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
16493 and @samp{cpu32}.  The ColdFire microarchitectures
16494 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
16495
16496 You can also use @option{-mtune=68020-40} for code that needs
16497 to run relatively well on 68020, 68030 and 68040 targets.
16498 @option{-mtune=68020-60} is similar but includes 68060 targets
16499 as well.  These two options select the same tuning decisions as
16500 @option{-m68020-40} and @option{-m68020-60} respectively.
16501
16502 GCC defines the macros @code{__mc@var{arch}} and @code{__mc@var{arch}__}
16503 when tuning for 680x0 architecture @var{arch}.  It also defines
16504 @code{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
16505 option is used.  If GCC is tuning for a range of architectures,
16506 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
16507 it defines the macros for every architecture in the range.
16508
16509 GCC also defines the macro @code{__m@var{uarch}__} when tuning for
16510 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
16511 of the arguments given above.
16512
16513 @item -m68000
16514 @itemx -mc68000
16515 @opindex m68000
16516 @opindex mc68000
16517 Generate output for a 68000.  This is the default
16518 when the compiler is configured for 68000-based systems.
16519 It is equivalent to @option{-march=68000}.
16520
16521 Use this option for microcontrollers with a 68000 or EC000 core,
16522 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
16523
16524 @item -m68010
16525 @opindex m68010
16526 Generate output for a 68010.  This is the default
16527 when the compiler is configured for 68010-based systems.
16528 It is equivalent to @option{-march=68010}.
16529
16530 @item -m68020
16531 @itemx -mc68020
16532 @opindex m68020
16533 @opindex mc68020
16534 Generate output for a 68020.  This is the default
16535 when the compiler is configured for 68020-based systems.
16536 It is equivalent to @option{-march=68020}.
16537
16538 @item -m68030
16539 @opindex m68030
16540 Generate output for a 68030.  This is the default when the compiler is
16541 configured for 68030-based systems.  It is equivalent to
16542 @option{-march=68030}.
16543
16544 @item -m68040
16545 @opindex m68040
16546 Generate output for a 68040.  This is the default when the compiler is
16547 configured for 68040-based systems.  It is equivalent to
16548 @option{-march=68040}.
16549
16550 This option inhibits the use of 68881/68882 instructions that have to be
16551 emulated by software on the 68040.  Use this option if your 68040 does not
16552 have code to emulate those instructions.
16553
16554 @item -m68060
16555 @opindex m68060
16556 Generate output for a 68060.  This is the default when the compiler is
16557 configured for 68060-based systems.  It is equivalent to
16558 @option{-march=68060}.
16559
16560 This option inhibits the use of 68020 and 68881/68882 instructions that
16561 have to be emulated by software on the 68060.  Use this option if your 68060
16562 does not have code to emulate those instructions.
16563
16564 @item -mcpu32
16565 @opindex mcpu32
16566 Generate output for a CPU32.  This is the default
16567 when the compiler is configured for CPU32-based systems.
16568 It is equivalent to @option{-march=cpu32}.
16569
16570 Use this option for microcontrollers with a
16571 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
16572 68336, 68340, 68341, 68349 and 68360.
16573
16574 @item -m5200
16575 @opindex m5200
16576 Generate output for a 520X ColdFire CPU@.  This is the default
16577 when the compiler is configured for 520X-based systems.
16578 It is equivalent to @option{-mcpu=5206}, and is now deprecated
16579 in favor of that option.
16580
16581 Use this option for microcontroller with a 5200 core, including
16582 the MCF5202, MCF5203, MCF5204 and MCF5206.
16583
16584 @item -m5206e
16585 @opindex m5206e
16586 Generate output for a 5206e ColdFire CPU@.  The option is now
16587 deprecated in favor of the equivalent @option{-mcpu=5206e}.
16588
16589 @item -m528x
16590 @opindex m528x
16591 Generate output for a member of the ColdFire 528X family.
16592 The option is now deprecated in favor of the equivalent
16593 @option{-mcpu=528x}.
16594
16595 @item -m5307
16596 @opindex m5307
16597 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
16598 in favor of the equivalent @option{-mcpu=5307}.
16599
16600 @item -m5407
16601 @opindex m5407
16602 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
16603 in favor of the equivalent @option{-mcpu=5407}.
16604
16605 @item -mcfv4e
16606 @opindex mcfv4e
16607 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
16608 This includes use of hardware floating-point instructions.
16609 The option is equivalent to @option{-mcpu=547x}, and is now
16610 deprecated in favor of that option.
16611
16612 @item -m68020-40
16613 @opindex m68020-40
16614 Generate output for a 68040, without using any of the new instructions.
16615 This results in code that can run relatively efficiently on either a
16616 68020/68881 or a 68030 or a 68040.  The generated code does use the
16617 68881 instructions that are emulated on the 68040.
16618
16619 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
16620
16621 @item -m68020-60
16622 @opindex m68020-60
16623 Generate output for a 68060, without using any of the new instructions.
16624 This results in code that can run relatively efficiently on either a
16625 68020/68881 or a 68030 or a 68040.  The generated code does use the
16626 68881 instructions that are emulated on the 68060.
16627
16628 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
16629
16630 @item -mhard-float
16631 @itemx -m68881
16632 @opindex mhard-float
16633 @opindex m68881
16634 Generate floating-point instructions.  This is the default for 68020
16635 and above, and for ColdFire devices that have an FPU@.  It defines the
16636 macro @code{__HAVE_68881__} on M680x0 targets and @code{__mcffpu__}
16637 on ColdFire targets.
16638
16639 @item -msoft-float
16640 @opindex msoft-float
16641 Do not generate floating-point instructions; use library calls instead.
16642 This is the default for 68000, 68010, and 68832 targets.  It is also
16643 the default for ColdFire devices that have no FPU.
16644
16645 @item -mdiv
16646 @itemx -mno-div
16647 @opindex mdiv
16648 @opindex mno-div
16649 Generate (do not generate) ColdFire hardware divide and remainder
16650 instructions.  If @option{-march} is used without @option{-mcpu},
16651 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
16652 architectures.  Otherwise, the default is taken from the target CPU
16653 (either the default CPU, or the one specified by @option{-mcpu}).  For
16654 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
16655 @option{-mcpu=5206e}.
16656
16657 GCC defines the macro @code{__mcfhwdiv__} when this option is enabled.
16658
16659 @item -mshort
16660 @opindex mshort
16661 Consider type @code{int} to be 16 bits wide, like @code{short int}.
16662 Additionally, parameters passed on the stack are also aligned to a
16663 16-bit boundary even on targets whose API mandates promotion to 32-bit.
16664
16665 @item -mno-short
16666 @opindex mno-short
16667 Do not consider type @code{int} to be 16 bits wide.  This is the default.
16668
16669 @item -mnobitfield
16670 @itemx -mno-bitfield
16671 @opindex mnobitfield
16672 @opindex mno-bitfield
16673 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
16674 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
16675
16676 @item -mbitfield
16677 @opindex mbitfield
16678 Do use the bit-field instructions.  The @option{-m68020} option implies
16679 @option{-mbitfield}.  This is the default if you use a configuration
16680 designed for a 68020.
16681
16682 @item -mrtd
16683 @opindex mrtd
16684 Use a different function-calling convention, in which functions
16685 that take a fixed number of arguments return with the @code{rtd}
16686 instruction, which pops their arguments while returning.  This
16687 saves one instruction in the caller since there is no need to pop
16688 the arguments there.
16689
16690 This calling convention is incompatible with the one normally
16691 used on Unix, so you cannot use it if you need to call libraries
16692 compiled with the Unix compiler.
16693
16694 Also, you must provide function prototypes for all functions that
16695 take variable numbers of arguments (including @code{printf});
16696 otherwise incorrect code is generated for calls to those
16697 functions.
16698
16699 In addition, seriously incorrect code results if you call a
16700 function with too many arguments.  (Normally, extra arguments are
16701 harmlessly ignored.)
16702
16703 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
16704 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
16705
16706 @item -mno-rtd
16707 @opindex mno-rtd
16708 Do not use the calling conventions selected by @option{-mrtd}.
16709 This is the default.
16710
16711 @item -malign-int
16712 @itemx -mno-align-int
16713 @opindex malign-int
16714 @opindex mno-align-int
16715 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
16716 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
16717 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
16718 Aligning variables on 32-bit boundaries produces code that runs somewhat
16719 faster on processors with 32-bit busses at the expense of more memory.
16720
16721 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
16722 aligns structures containing the above types differently than
16723 most published application binary interface specifications for the m68k.
16724
16725 @item -mpcrel
16726 @opindex mpcrel
16727 Use the pc-relative addressing mode of the 68000 directly, instead of
16728 using a global offset table.  At present, this option implies @option{-fpic},
16729 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
16730 not presently supported with @option{-mpcrel}, though this could be supported for
16731 68020 and higher processors.
16732
16733 @item -mno-strict-align
16734 @itemx -mstrict-align
16735 @opindex mno-strict-align
16736 @opindex mstrict-align
16737 Do not (do) assume that unaligned memory references are handled by
16738 the system.
16739
16740 @item -msep-data
16741 Generate code that allows the data segment to be located in a different
16742 area of memory from the text segment.  This allows for execute-in-place in
16743 an environment without virtual memory management.  This option implies
16744 @option{-fPIC}.
16745
16746 @item -mno-sep-data
16747 Generate code that assumes that the data segment follows the text segment.
16748 This is the default.
16749
16750 @item -mid-shared-library
16751 Generate code that supports shared libraries via the library ID method.
16752 This allows for execute-in-place and shared libraries in an environment
16753 without virtual memory management.  This option implies @option{-fPIC}.
16754
16755 @item -mno-id-shared-library
16756 Generate code that doesn't assume ID-based shared libraries are being used.
16757 This is the default.
16758
16759 @item -mshared-library-id=n
16760 Specifies the identification number of the ID-based shared library being
16761 compiled.  Specifying a value of 0 generates more compact code; specifying
16762 other values forces the allocation of that number to the current
16763 library, but is no more space- or time-efficient than omitting this option.
16764
16765 @item -mxgot
16766 @itemx -mno-xgot
16767 @opindex mxgot
16768 @opindex mno-xgot
16769 When generating position-independent code for ColdFire, generate code
16770 that works if the GOT has more than 8192 entries.  This code is
16771 larger and slower than code generated without this option.  On M680x0
16772 processors, this option is not needed; @option{-fPIC} suffices.
16773
16774 GCC normally uses a single instruction to load values from the GOT@.
16775 While this is relatively efficient, it only works if the GOT
16776 is smaller than about 64k.  Anything larger causes the linker
16777 to report an error such as:
16778
16779 @cindex relocation truncated to fit (ColdFire)
16780 @smallexample
16781 relocation truncated to fit: R_68K_GOT16O foobar
16782 @end smallexample
16783
16784 If this happens, you should recompile your code with @option{-mxgot}.
16785 It should then work with very large GOTs.  However, code generated with
16786 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
16787 the value of a global symbol.
16788
16789 Note that some linkers, including newer versions of the GNU linker,
16790 can create multiple GOTs and sort GOT entries.  If you have such a linker,
16791 you should only need to use @option{-mxgot} when compiling a single
16792 object file that accesses more than 8192 GOT entries.  Very few do.
16793
16794 These options have no effect unless GCC is generating
16795 position-independent code.
16796
16797 @end table
16798
16799 @node MCore Options
16800 @subsection MCore Options
16801 @cindex MCore options
16802
16803 These are the @samp{-m} options defined for the Motorola M*Core
16804 processors.
16805
16806 @table @gcctabopt
16807
16808 @item -mhardlit
16809 @itemx -mno-hardlit
16810 @opindex mhardlit
16811 @opindex mno-hardlit
16812 Inline constants into the code stream if it can be done in two
16813 instructions or less.
16814
16815 @item -mdiv
16816 @itemx -mno-div
16817 @opindex mdiv
16818 @opindex mno-div
16819 Use the divide instruction.  (Enabled by default).
16820
16821 @item -mrelax-immediate
16822 @itemx -mno-relax-immediate
16823 @opindex mrelax-immediate
16824 @opindex mno-relax-immediate
16825 Allow arbitrary-sized immediates in bit operations.
16826
16827 @item -mwide-bitfields
16828 @itemx -mno-wide-bitfields
16829 @opindex mwide-bitfields
16830 @opindex mno-wide-bitfields
16831 Always treat bit-fields as @code{int}-sized.
16832
16833 @item -m4byte-functions
16834 @itemx -mno-4byte-functions
16835 @opindex m4byte-functions
16836 @opindex mno-4byte-functions
16837 Force all functions to be aligned to a 4-byte boundary.
16838
16839 @item -mcallgraph-data
16840 @itemx -mno-callgraph-data
16841 @opindex mcallgraph-data
16842 @opindex mno-callgraph-data
16843 Emit callgraph information.
16844
16845 @item -mslow-bytes
16846 @itemx -mno-slow-bytes
16847 @opindex mslow-bytes
16848 @opindex mno-slow-bytes
16849 Prefer word access when reading byte quantities.
16850
16851 @item -mlittle-endian
16852 @itemx -mbig-endian
16853 @opindex mlittle-endian
16854 @opindex mbig-endian
16855 Generate code for a little-endian target.
16856
16857 @item -m210
16858 @itemx -m340
16859 @opindex m210
16860 @opindex m340
16861 Generate code for the 210 processor.
16862
16863 @item -mno-lsim
16864 @opindex mno-lsim
16865 Assume that runtime support has been provided and so omit the
16866 simulator library (@file{libsim.a)} from the linker command line.
16867
16868 @item -mstack-increment=@var{size}
16869 @opindex mstack-increment
16870 Set the maximum amount for a single stack increment operation.  Large
16871 values can increase the speed of programs that contain functions
16872 that need a large amount of stack space, but they can also trigger a
16873 segmentation fault if the stack is extended too much.  The default
16874 value is 0x1000.
16875
16876 @end table
16877
16878 @node MeP Options
16879 @subsection MeP Options
16880 @cindex MeP options
16881
16882 @table @gcctabopt
16883
16884 @item -mabsdiff
16885 @opindex mabsdiff
16886 Enables the @code{abs} instruction, which is the absolute difference
16887 between two registers.
16888
16889 @item -mall-opts
16890 @opindex mall-opts
16891 Enables all the optional instructions---average, multiply, divide, bit
16892 operations, leading zero, absolute difference, min/max, clip, and
16893 saturation.
16894
16895
16896 @item -maverage
16897 @opindex maverage
16898 Enables the @code{ave} instruction, which computes the average of two
16899 registers.
16900
16901 @item -mbased=@var{n}
16902 @opindex mbased=
16903 Variables of size @var{n} bytes or smaller are placed in the
16904 @code{.based} section by default.  Based variables use the @code{$tp}
16905 register as a base register, and there is a 128-byte limit to the
16906 @code{.based} section.
16907
16908 @item -mbitops
16909 @opindex mbitops
16910 Enables the bit operation instructions---bit test (@code{btstm}), set
16911 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
16912 test-and-set (@code{tas}).
16913
16914 @item -mc=@var{name}
16915 @opindex mc=
16916 Selects which section constant data is placed in.  @var{name} may
16917 be @samp{tiny}, @samp{near}, or @samp{far}.
16918
16919 @item -mclip
16920 @opindex mclip
16921 Enables the @code{clip} instruction.  Note that @option{-mclip} is not
16922 useful unless you also provide @option{-mminmax}.
16923
16924 @item -mconfig=@var{name}
16925 @opindex mconfig=
16926 Selects one of the built-in core configurations.  Each MeP chip has
16927 one or more modules in it; each module has a core CPU and a variety of
16928 coprocessors, optional instructions, and peripherals.  The
16929 @code{MeP-Integrator} tool, not part of GCC, provides these
16930 configurations through this option; using this option is the same as
16931 using all the corresponding command-line options.  The default
16932 configuration is @samp{default}.
16933
16934 @item -mcop
16935 @opindex mcop
16936 Enables the coprocessor instructions.  By default, this is a 32-bit
16937 coprocessor.  Note that the coprocessor is normally enabled via the
16938 @option{-mconfig=} option.
16939
16940 @item -mcop32
16941 @opindex mcop32
16942 Enables the 32-bit coprocessor's instructions.
16943
16944 @item -mcop64
16945 @opindex mcop64
16946 Enables the 64-bit coprocessor's instructions.
16947
16948 @item -mivc2
16949 @opindex mivc2
16950 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
16951
16952 @item -mdc
16953 @opindex mdc
16954 Causes constant variables to be placed in the @code{.near} section.
16955
16956 @item -mdiv
16957 @opindex mdiv
16958 Enables the @code{div} and @code{divu} instructions.
16959
16960 @item -meb
16961 @opindex meb
16962 Generate big-endian code.
16963
16964 @item -mel
16965 @opindex mel
16966 Generate little-endian code.
16967
16968 @item -mio-volatile
16969 @opindex mio-volatile
16970 Tells the compiler that any variable marked with the @code{io}
16971 attribute is to be considered volatile.
16972
16973 @item -ml
16974 @opindex ml
16975 Causes variables to be assigned to the @code{.far} section by default.
16976
16977 @item -mleadz
16978 @opindex mleadz
16979 Enables the @code{leadz} (leading zero) instruction.
16980
16981 @item -mm
16982 @opindex mm
16983 Causes variables to be assigned to the @code{.near} section by default.
16984
16985 @item -mminmax
16986 @opindex mminmax
16987 Enables the @code{min} and @code{max} instructions.
16988
16989 @item -mmult
16990 @opindex mmult
16991 Enables the multiplication and multiply-accumulate instructions.
16992
16993 @item -mno-opts
16994 @opindex mno-opts
16995 Disables all the optional instructions enabled by @option{-mall-opts}.
16996
16997 @item -mrepeat
16998 @opindex mrepeat
16999 Enables the @code{repeat} and @code{erepeat} instructions, used for
17000 low-overhead looping.
17001
17002 @item -ms
17003 @opindex ms
17004 Causes all variables to default to the @code{.tiny} section.  Note
17005 that there is a 65536-byte limit to this section.  Accesses to these
17006 variables use the @code{%gp} base register.
17007
17008 @item -msatur
17009 @opindex msatur
17010 Enables the saturation instructions.  Note that the compiler does not
17011 currently generate these itself, but this option is included for
17012 compatibility with other tools, like @code{as}.
17013
17014 @item -msdram
17015 @opindex msdram
17016 Link the SDRAM-based runtime instead of the default ROM-based runtime.
17017
17018 @item -msim
17019 @opindex msim
17020 Link the simulator run-time libraries.
17021
17022 @item -msimnovec
17023 @opindex msimnovec
17024 Link the simulator runtime libraries, excluding built-in support
17025 for reset and exception vectors and tables.
17026
17027 @item -mtf
17028 @opindex mtf
17029 Causes all functions to default to the @code{.far} section.  Without
17030 this option, functions default to the @code{.near} section.
17031
17032 @item -mtiny=@var{n}
17033 @opindex mtiny=
17034 Variables that are @var{n} bytes or smaller are allocated to the
17035 @code{.tiny} section.  These variables use the @code{$gp} base
17036 register.  The default for this option is 4, but note that there's a
17037 65536-byte limit to the @code{.tiny} section.
17038
17039 @end table
17040
17041 @node MicroBlaze Options
17042 @subsection MicroBlaze Options
17043 @cindex MicroBlaze Options
17044
17045 @table @gcctabopt
17046
17047 @item -msoft-float
17048 @opindex msoft-float
17049 Use software emulation for floating point (default).
17050
17051 @item -mhard-float
17052 @opindex mhard-float
17053 Use hardware floating-point instructions.
17054
17055 @item -mmemcpy
17056 @opindex mmemcpy
17057 Do not optimize block moves, use @code{memcpy}.
17058
17059 @item -mno-clearbss
17060 @opindex mno-clearbss
17061 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
17062
17063 @item -mcpu=@var{cpu-type}
17064 @opindex mcpu=
17065 Use features of, and schedule code for, the given CPU.
17066 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
17067 where @var{X} is a major version, @var{YY} is the minor version, and
17068 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
17069 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
17070
17071 @item -mxl-soft-mul
17072 @opindex mxl-soft-mul
17073 Use software multiply emulation (default).
17074
17075 @item -mxl-soft-div
17076 @opindex mxl-soft-div
17077 Use software emulation for divides (default).
17078
17079 @item -mxl-barrel-shift
17080 @opindex mxl-barrel-shift
17081 Use the hardware barrel shifter.
17082
17083 @item -mxl-pattern-compare
17084 @opindex mxl-pattern-compare
17085 Use pattern compare instructions.
17086
17087 @item -msmall-divides
17088 @opindex msmall-divides
17089 Use table lookup optimization for small signed integer divisions.
17090
17091 @item -mxl-stack-check
17092 @opindex mxl-stack-check
17093 This option is deprecated.  Use @option{-fstack-check} instead.
17094
17095 @item -mxl-gp-opt
17096 @opindex mxl-gp-opt
17097 Use GP-relative @code{.sdata}/@code{.sbss} sections.
17098
17099 @item -mxl-multiply-high
17100 @opindex mxl-multiply-high
17101 Use multiply high instructions for high part of 32x32 multiply.
17102
17103 @item -mxl-float-convert
17104 @opindex mxl-float-convert
17105 Use hardware floating-point conversion instructions.
17106
17107 @item -mxl-float-sqrt
17108 @opindex mxl-float-sqrt
17109 Use hardware floating-point square root instruction.
17110
17111 @item -mbig-endian
17112 @opindex mbig-endian
17113 Generate code for a big-endian target.
17114
17115 @item -mlittle-endian
17116 @opindex mlittle-endian
17117 Generate code for a little-endian target.
17118
17119 @item -mxl-reorder
17120 @opindex mxl-reorder
17121 Use reorder instructions (swap and byte reversed load/store).
17122
17123 @item -mxl-mode-@var{app-model}
17124 Select application model @var{app-model}.  Valid models are
17125 @table @samp
17126 @item executable
17127 normal executable (default), uses startup code @file{crt0.o}.
17128
17129 @item xmdstub
17130 for use with Xilinx Microprocessor Debugger (XMD) based
17131 software intrusive debug agent called xmdstub. This uses startup file
17132 @file{crt1.o} and sets the start address of the program to 0x800.
17133
17134 @item bootstrap
17135 for applications that are loaded using a bootloader.
17136 This model uses startup file @file{crt2.o} which does not contain a processor
17137 reset vector handler. This is suitable for transferring control on a
17138 processor reset to the bootloader rather than the application.
17139
17140 @item novectors
17141 for applications that do not require any of the
17142 MicroBlaze vectors. This option may be useful for applications running
17143 within a monitoring application. This model uses @file{crt3.o} as a startup file.
17144 @end table
17145
17146 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
17147 @option{-mxl-mode-@var{app-model}}.
17148
17149 @end table
17150
17151 @node MIPS Options
17152 @subsection MIPS Options
17153 @cindex MIPS options
17154
17155 @table @gcctabopt
17156
17157 @item -EB
17158 @opindex EB
17159 Generate big-endian code.
17160
17161 @item -EL
17162 @opindex EL
17163 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
17164 configurations.
17165
17166 @item -march=@var{arch}
17167 @opindex march
17168 Generate code that runs on @var{arch}, which can be the name of a
17169 generic MIPS ISA, or the name of a particular processor.
17170 The ISA names are:
17171 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
17172 @samp{mips32}, @samp{mips32r2}, @samp{mips32r3}, @samp{mips32r5},
17173 @samp{mips32r6}, @samp{mips64}, @samp{mips64r2}, @samp{mips64r3},
17174 @samp{mips64r5} and @samp{mips64r6}.
17175 The processor names are:
17176 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
17177 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
17178 @samp{5kc}, @samp{5kf},
17179 @samp{20kc},
17180 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
17181 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
17182 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
17183 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
17184 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
17185 @samp{i6400},
17186 @samp{interaptiv},
17187 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
17188 @samp{m4k},
17189 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
17190 @samp{m5100}, @samp{m5101},
17191 @samp{octeon}, @samp{octeon+}, @samp{octeon2}, @samp{octeon3},
17192 @samp{orion},
17193 @samp{p5600},
17194 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
17195 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
17196 @samp{rm7000}, @samp{rm9000},
17197 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
17198 @samp{sb1},
17199 @samp{sr71000},
17200 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
17201 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
17202 @samp{xlr} and @samp{xlp}.
17203 The special value @samp{from-abi} selects the
17204 most compatible architecture for the selected ABI (that is,
17205 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
17206
17207 The native Linux/GNU toolchain also supports the value @samp{native},
17208 which selects the best architecture option for the host processor.
17209 @option{-march=native} has no effect if GCC does not recognize
17210 the processor.
17211
17212 In processor names, a final @samp{000} can be abbreviated as @samp{k}
17213 (for example, @option{-march=r2k}).  Prefixes are optional, and
17214 @samp{vr} may be written @samp{r}.
17215
17216 Names of the form @samp{@var{n}f2_1} refer to processors with
17217 FPUs clocked at half the rate of the core, names of the form
17218 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
17219 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
17220 processors with FPUs clocked a ratio of 3:2 with respect to the core.
17221 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
17222 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
17223 accepted as synonyms for @samp{@var{n}f1_1}.
17224
17225 GCC defines two macros based on the value of this option.  The first
17226 is @code{_MIPS_ARCH}, which gives the name of target architecture, as
17227 a string.  The second has the form @code{_MIPS_ARCH_@var{foo}},
17228 where @var{foo} is the capitalized value of @code{_MIPS_ARCH}@.
17229 For example, @option{-march=r2000} sets @code{_MIPS_ARCH}
17230 to @code{"r2000"} and defines the macro @code{_MIPS_ARCH_R2000}.
17231
17232 Note that the @code{_MIPS_ARCH} macro uses the processor names given
17233 above.  In other words, it has the full prefix and does not
17234 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
17235 the macro names the resolved architecture (either @code{"mips1"} or
17236 @code{"mips3"}).  It names the default architecture when no
17237 @option{-march} option is given.
17238
17239 @item -mtune=@var{arch}
17240 @opindex mtune
17241 Optimize for @var{arch}.  Among other things, this option controls
17242 the way instructions are scheduled, and the perceived cost of arithmetic
17243 operations.  The list of @var{arch} values is the same as for
17244 @option{-march}.
17245
17246 When this option is not used, GCC optimizes for the processor
17247 specified by @option{-march}.  By using @option{-march} and
17248 @option{-mtune} together, it is possible to generate code that
17249 runs on a family of processors, but optimize the code for one
17250 particular member of that family.
17251
17252 @option{-mtune} defines the macros @code{_MIPS_TUNE} and
17253 @code{_MIPS_TUNE_@var{foo}}, which work in the same way as the
17254 @option{-march} ones described above.
17255
17256 @item -mips1
17257 @opindex mips1
17258 Equivalent to @option{-march=mips1}.
17259
17260 @item -mips2
17261 @opindex mips2
17262 Equivalent to @option{-march=mips2}.
17263
17264 @item -mips3
17265 @opindex mips3
17266 Equivalent to @option{-march=mips3}.
17267
17268 @item -mips4
17269 @opindex mips4
17270 Equivalent to @option{-march=mips4}.
17271
17272 @item -mips32
17273 @opindex mips32
17274 Equivalent to @option{-march=mips32}.
17275
17276 @item -mips32r3
17277 @opindex mips32r3
17278 Equivalent to @option{-march=mips32r3}.
17279
17280 @item -mips32r5
17281 @opindex mips32r5
17282 Equivalent to @option{-march=mips32r5}.
17283
17284 @item -mips32r6
17285 @opindex mips32r6
17286 Equivalent to @option{-march=mips32r6}.
17287
17288 @item -mips64
17289 @opindex mips64
17290 Equivalent to @option{-march=mips64}.
17291
17292 @item -mips64r2
17293 @opindex mips64r2
17294 Equivalent to @option{-march=mips64r2}.
17295
17296 @item -mips64r3
17297 @opindex mips64r3
17298 Equivalent to @option{-march=mips64r3}.
17299
17300 @item -mips64r5
17301 @opindex mips64r5
17302 Equivalent to @option{-march=mips64r5}.
17303
17304 @item -mips64r6
17305 @opindex mips64r6
17306 Equivalent to @option{-march=mips64r6}.
17307
17308 @item -mips16
17309 @itemx -mno-mips16
17310 @opindex mips16
17311 @opindex mno-mips16
17312 Generate (do not generate) MIPS16 code.  If GCC is targeting a
17313 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
17314
17315 MIPS16 code generation can also be controlled on a per-function basis
17316 by means of @code{mips16} and @code{nomips16} attributes.
17317 @xref{Function Attributes}, for more information.
17318
17319 @item -mflip-mips16
17320 @opindex mflip-mips16
17321 Generate MIPS16 code on alternating functions.  This option is provided
17322 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
17323 not intended for ordinary use in compiling user code.
17324
17325 @item -minterlink-compressed
17326 @item -mno-interlink-compressed
17327 @opindex minterlink-compressed
17328 @opindex mno-interlink-compressed
17329 Require (do not require) that code using the standard (uncompressed) MIPS ISA
17330 be link-compatible with MIPS16 and microMIPS code, and vice versa.
17331
17332 For example, code using the standard ISA encoding cannot jump directly
17333 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
17334 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
17335 knows that the target of the jump is not compressed.
17336
17337 @item -minterlink-mips16
17338 @itemx -mno-interlink-mips16
17339 @opindex minterlink-mips16
17340 @opindex mno-interlink-mips16
17341 Aliases of @option{-minterlink-compressed} and
17342 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
17343 and are retained for backwards compatibility.
17344
17345 @item -mabi=32
17346 @itemx -mabi=o64
17347 @itemx -mabi=n32
17348 @itemx -mabi=64
17349 @itemx -mabi=eabi
17350 @opindex mabi=32
17351 @opindex mabi=o64
17352 @opindex mabi=n32
17353 @opindex mabi=64
17354 @opindex mabi=eabi
17355 Generate code for the given ABI@.
17356
17357 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
17358 generates 64-bit code when you select a 64-bit architecture, but you
17359 can use @option{-mgp32} to get 32-bit code instead.
17360
17361 For information about the O64 ABI, see
17362 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
17363
17364 GCC supports a variant of the o32 ABI in which floating-point registers
17365 are 64 rather than 32 bits wide.  You can select this combination with
17366 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
17367 and @code{mfhc1} instructions and is therefore only supported for
17368 MIPS32R2, MIPS32R3 and MIPS32R5 processors.
17369
17370 The register assignments for arguments and return values remain the
17371 same, but each scalar value is passed in a single 64-bit register
17372 rather than a pair of 32-bit registers.  For example, scalar
17373 floating-point values are returned in @samp{$f0} only, not a
17374 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
17375 remains the same in that the even-numbered double-precision registers
17376 are saved.
17377
17378 Two additional variants of the o32 ABI are supported to enable
17379 a transition from 32-bit to 64-bit registers.  These are FPXX
17380 (@option{-mfpxx}) and FP64A (@option{-mfp64} @option{-mno-odd-spreg}).
17381 The FPXX extension mandates that all code must execute correctly
17382 when run using 32-bit or 64-bit registers.  The code can be interlinked
17383 with either FP32 or FP64, but not both.
17384 The FP64A extension is similar to the FP64 extension but forbids the
17385 use of odd-numbered single-precision registers.  This can be used
17386 in conjunction with the @code{FRE} mode of FPUs in MIPS32R5
17387 processors and allows both FP32 and FP64A code to interlink and
17388 run in the same process without changing FPU modes.
17389
17390 @item -mabicalls
17391 @itemx -mno-abicalls
17392 @opindex mabicalls
17393 @opindex mno-abicalls
17394 Generate (do not generate) code that is suitable for SVR4-style
17395 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
17396 systems.
17397
17398 @item -mshared
17399 @itemx -mno-shared
17400 Generate (do not generate) code that is fully position-independent,
17401 and that can therefore be linked into shared libraries.  This option
17402 only affects @option{-mabicalls}.
17403
17404 All @option{-mabicalls} code has traditionally been position-independent,
17405 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
17406 as an extension, the GNU toolchain allows executables to use absolute
17407 accesses for locally-binding symbols.  It can also use shorter GP
17408 initialization sequences and generate direct calls to locally-defined
17409 functions.  This mode is selected by @option{-mno-shared}.
17410
17411 @option{-mno-shared} depends on binutils 2.16 or higher and generates
17412 objects that can only be linked by the GNU linker.  However, the option
17413 does not affect the ABI of the final executable; it only affects the ABI
17414 of relocatable objects.  Using @option{-mno-shared} generally makes
17415 executables both smaller and quicker.
17416
17417 @option{-mshared} is the default.
17418
17419 @item -mplt
17420 @itemx -mno-plt
17421 @opindex mplt
17422 @opindex mno-plt
17423 Assume (do not assume) that the static and dynamic linkers
17424 support PLTs and copy relocations.  This option only affects
17425 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
17426 has no effect without @option{-msym32}.
17427
17428 You can make @option{-mplt} the default by configuring
17429 GCC with @option{--with-mips-plt}.  The default is
17430 @option{-mno-plt} otherwise.
17431
17432 @item -mxgot
17433 @itemx -mno-xgot
17434 @opindex mxgot
17435 @opindex mno-xgot
17436 Lift (do not lift) the usual restrictions on the size of the global
17437 offset table.
17438
17439 GCC normally uses a single instruction to load values from the GOT@.
17440 While this is relatively efficient, it only works if the GOT
17441 is smaller than about 64k.  Anything larger causes the linker
17442 to report an error such as:
17443
17444 @cindex relocation truncated to fit (MIPS)
17445 @smallexample
17446 relocation truncated to fit: R_MIPS_GOT16 foobar
17447 @end smallexample
17448
17449 If this happens, you should recompile your code with @option{-mxgot}.
17450 This works with very large GOTs, although the code is also
17451 less efficient, since it takes three instructions to fetch the
17452 value of a global symbol.
17453
17454 Note that some linkers can create multiple GOTs.  If you have such a
17455 linker, you should only need to use @option{-mxgot} when a single object
17456 file accesses more than 64k's worth of GOT entries.  Very few do.
17457
17458 These options have no effect unless GCC is generating position
17459 independent code.
17460
17461 @item -mgp32
17462 @opindex mgp32
17463 Assume that general-purpose registers are 32 bits wide.
17464
17465 @item -mgp64
17466 @opindex mgp64
17467 Assume that general-purpose registers are 64 bits wide.
17468
17469 @item -mfp32
17470 @opindex mfp32
17471 Assume that floating-point registers are 32 bits wide.
17472
17473 @item -mfp64
17474 @opindex mfp64
17475 Assume that floating-point registers are 64 bits wide.
17476
17477 @item -mfpxx
17478 @opindex mfpxx
17479 Do not assume the width of floating-point registers.
17480
17481 @item -mhard-float
17482 @opindex mhard-float
17483 Use floating-point coprocessor instructions.
17484
17485 @item -msoft-float
17486 @opindex msoft-float
17487 Do not use floating-point coprocessor instructions.  Implement
17488 floating-point calculations using library calls instead.
17489
17490 @item -mno-float
17491 @opindex mno-float
17492 Equivalent to @option{-msoft-float}, but additionally asserts that the
17493 program being compiled does not perform any floating-point operations.
17494 This option is presently supported only by some bare-metal MIPS
17495 configurations, where it may select a special set of libraries
17496 that lack all floating-point support (including, for example, the
17497 floating-point @code{printf} formats).  
17498 If code compiled with @option{-mno-float} accidentally contains
17499 floating-point operations, it is likely to suffer a link-time
17500 or run-time failure.
17501
17502 @item -msingle-float
17503 @opindex msingle-float
17504 Assume that the floating-point coprocessor only supports single-precision
17505 operations.
17506
17507 @item -mdouble-float
17508 @opindex mdouble-float
17509 Assume that the floating-point coprocessor supports double-precision
17510 operations.  This is the default.
17511
17512 @item -modd-spreg
17513 @itemx -mno-odd-spreg
17514 @opindex modd-spreg
17515 @opindex mno-odd-spreg
17516 Enable the use of odd-numbered single-precision floating-point registers
17517 for the o32 ABI.  This is the default for processors that are known to
17518 support these registers.  When using the o32 FPXX ABI, @option{-mno-odd-spreg}
17519 is set by default.
17520
17521 @item -mcompact-branches=never
17522 @itemx -mcompact-branches=optimal
17523 @itemx -mcompact-branches=always
17524 @opindex mcompact-branches=never
17525 @opindex mcompact-branches=optimal
17526 @opindex mcompact-branches=always
17527 These options control which form of branches will be generated.  The
17528 default is @option{-mcompact-branches=optimal}.
17529
17530 The @option{-mcompact-branches=never} option ensures that compact branch
17531 instructions will never be generated.
17532
17533 The @option{-mcompact-branches=always} option ensures that a compact
17534 branch instruction will be generated if available.  If a compact branch
17535 instruction is not available, a delay slot form of the branch will be
17536 used instead.
17537
17538 This option is supported from MIPS Release 6 onwards.
17539
17540 The @option{-mcompact-branches=optimal} option will cause a delay slot
17541 branch to be used if one is available in the current ISA and the delay
17542 slot is successfully filled.  If the delay slot is not filled, a compact
17543 branch will be chosen if one is available.
17544
17545 @item -mabs=2008
17546 @itemx -mabs=legacy
17547 @opindex mabs=2008
17548 @opindex mabs=legacy
17549 These options control the treatment of the special not-a-number (NaN)
17550 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
17551 @code{neg.@i{fmt}} machine instructions.
17552
17553 By default or when @option{-mabs=legacy} is used the legacy
17554 treatment is selected.  In this case these instructions are considered
17555 arithmetic and avoided where correct operation is required and the
17556 input operand might be a NaN.  A longer sequence of instructions that
17557 manipulate the sign bit of floating-point datum manually is used
17558 instead unless the @option{-ffinite-math-only} option has also been
17559 specified.
17560
17561 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
17562 this case these instructions are considered non-arithmetic and therefore
17563 operating correctly in all cases, including in particular where the
17564 input operand is a NaN.  These instructions are therefore always used
17565 for the respective operations.
17566
17567 @item -mnan=2008
17568 @itemx -mnan=legacy
17569 @opindex mnan=2008
17570 @opindex mnan=legacy
17571 These options control the encoding of the special not-a-number (NaN)
17572 IEEE 754 floating-point data.
17573
17574 The @option{-mnan=legacy} option selects the legacy encoding.  In this
17575 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
17576 significand field being 0, whereas signalling NaNs (sNaNs) are denoted
17577 by the first bit of their trailing significand field being 1.
17578
17579 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
17580 this case qNaNs are denoted by the first bit of their trailing
17581 significand field being 1, whereas sNaNs are denoted by the first bit of
17582 their trailing significand field being 0.
17583
17584 The default is @option{-mnan=legacy} unless GCC has been configured with
17585 @option{--with-nan=2008}.
17586
17587 @item -mllsc
17588 @itemx -mno-llsc
17589 @opindex mllsc
17590 @opindex mno-llsc
17591 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
17592 implement atomic memory built-in functions.  When neither option is
17593 specified, GCC uses the instructions if the target architecture
17594 supports them.
17595
17596 @option{-mllsc} is useful if the runtime environment can emulate the
17597 instructions and @option{-mno-llsc} can be useful when compiling for
17598 nonstandard ISAs.  You can make either option the default by
17599 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
17600 respectively.  @option{--with-llsc} is the default for some
17601 configurations; see the installation documentation for details.
17602
17603 @item -mdsp
17604 @itemx -mno-dsp
17605 @opindex mdsp
17606 @opindex mno-dsp
17607 Use (do not use) revision 1 of the MIPS DSP ASE@.
17608 @xref{MIPS DSP Built-in Functions}.  This option defines the
17609 preprocessor macro @code{__mips_dsp}.  It also defines
17610 @code{__mips_dsp_rev} to 1.
17611
17612 @item -mdspr2
17613 @itemx -mno-dspr2
17614 @opindex mdspr2
17615 @opindex mno-dspr2
17616 Use (do not use) revision 2 of the MIPS DSP ASE@.
17617 @xref{MIPS DSP Built-in Functions}.  This option defines the
17618 preprocessor macros @code{__mips_dsp} and @code{__mips_dspr2}.
17619 It also defines @code{__mips_dsp_rev} to 2.
17620
17621 @item -msmartmips
17622 @itemx -mno-smartmips
17623 @opindex msmartmips
17624 @opindex mno-smartmips
17625 Use (do not use) the MIPS SmartMIPS ASE.
17626
17627 @item -mpaired-single
17628 @itemx -mno-paired-single
17629 @opindex mpaired-single
17630 @opindex mno-paired-single
17631 Use (do not use) paired-single floating-point instructions.
17632 @xref{MIPS Paired-Single Support}.  This option requires
17633 hardware floating-point support to be enabled.
17634
17635 @item -mdmx
17636 @itemx -mno-mdmx
17637 @opindex mdmx
17638 @opindex mno-mdmx
17639 Use (do not use) MIPS Digital Media Extension instructions.
17640 This option can only be used when generating 64-bit code and requires
17641 hardware floating-point support to be enabled.
17642
17643 @item -mips3d
17644 @itemx -mno-mips3d
17645 @opindex mips3d
17646 @opindex mno-mips3d
17647 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
17648 The option @option{-mips3d} implies @option{-mpaired-single}.
17649
17650 @item -mmicromips
17651 @itemx -mno-micromips
17652 @opindex mmicromips
17653 @opindex mno-mmicromips
17654 Generate (do not generate) microMIPS code.
17655
17656 MicroMIPS code generation can also be controlled on a per-function basis
17657 by means of @code{micromips} and @code{nomicromips} attributes.
17658 @xref{Function Attributes}, for more information.
17659
17660 @item -mmt
17661 @itemx -mno-mt
17662 @opindex mmt
17663 @opindex mno-mt
17664 Use (do not use) MT Multithreading instructions.
17665
17666 @item -mmcu
17667 @itemx -mno-mcu
17668 @opindex mmcu
17669 @opindex mno-mcu
17670 Use (do not use) the MIPS MCU ASE instructions.
17671
17672 @item -meva
17673 @itemx -mno-eva
17674 @opindex meva
17675 @opindex mno-eva
17676 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
17677
17678 @item -mvirt
17679 @itemx -mno-virt
17680 @opindex mvirt
17681 @opindex mno-virt
17682 Use (do not use) the MIPS Virtualization Application Specific instructions.
17683
17684 @item -mxpa
17685 @itemx -mno-xpa
17686 @opindex mxpa
17687 @opindex mno-xpa
17688 Use (do not use) the MIPS eXtended Physical Address (XPA) instructions.
17689
17690 @item -mlong64
17691 @opindex mlong64
17692 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
17693 an explanation of the default and the way that the pointer size is
17694 determined.
17695
17696 @item -mlong32
17697 @opindex mlong32
17698 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
17699
17700 The default size of @code{int}s, @code{long}s and pointers depends on
17701 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
17702 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
17703 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
17704 or the same size as integer registers, whichever is smaller.
17705
17706 @item -msym32
17707 @itemx -mno-sym32
17708 @opindex msym32
17709 @opindex mno-sym32
17710 Assume (do not assume) that all symbols have 32-bit values, regardless
17711 of the selected ABI@.  This option is useful in combination with
17712 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
17713 to generate shorter and faster references to symbolic addresses.
17714
17715 @item -G @var{num}
17716 @opindex G
17717 Put definitions of externally-visible data in a small data section
17718 if that data is no bigger than @var{num} bytes.  GCC can then generate
17719 more efficient accesses to the data; see @option{-mgpopt} for details.
17720
17721 The default @option{-G} option depends on the configuration.
17722
17723 @item -mlocal-sdata
17724 @itemx -mno-local-sdata
17725 @opindex mlocal-sdata
17726 @opindex mno-local-sdata
17727 Extend (do not extend) the @option{-G} behavior to local data too,
17728 such as to static variables in C@.  @option{-mlocal-sdata} is the
17729 default for all configurations.
17730
17731 If the linker complains that an application is using too much small data,
17732 you might want to try rebuilding the less performance-critical parts with
17733 @option{-mno-local-sdata}.  You might also want to build large
17734 libraries with @option{-mno-local-sdata}, so that the libraries leave
17735 more room for the main program.
17736
17737 @item -mextern-sdata
17738 @itemx -mno-extern-sdata
17739 @opindex mextern-sdata
17740 @opindex mno-extern-sdata
17741 Assume (do not assume) that externally-defined data is in
17742 a small data section if the size of that data is within the @option{-G} limit.
17743 @option{-mextern-sdata} is the default for all configurations.
17744
17745 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
17746 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
17747 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
17748 is placed in a small data section.  If @var{Var} is defined by another
17749 module, you must either compile that module with a high-enough
17750 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
17751 definition.  If @var{Var} is common, you must link the application
17752 with a high-enough @option{-G} setting.
17753
17754 The easiest way of satisfying these restrictions is to compile
17755 and link every module with the same @option{-G} option.  However,
17756 you may wish to build a library that supports several different
17757 small data limits.  You can do this by compiling the library with
17758 the highest supported @option{-G} setting and additionally using
17759 @option{-mno-extern-sdata} to stop the library from making assumptions
17760 about externally-defined data.
17761
17762 @item -mgpopt
17763 @itemx -mno-gpopt
17764 @opindex mgpopt
17765 @opindex mno-gpopt
17766 Use (do not use) GP-relative accesses for symbols that are known to be
17767 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
17768 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
17769 configurations.
17770
17771 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
17772 might not hold the value of @code{_gp}.  For example, if the code is
17773 part of a library that might be used in a boot monitor, programs that
17774 call boot monitor routines pass an unknown value in @code{$gp}.
17775 (In such situations, the boot monitor itself is usually compiled
17776 with @option{-G0}.)
17777
17778 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
17779 @option{-mno-extern-sdata}.
17780
17781 @item -membedded-data
17782 @itemx -mno-embedded-data
17783 @opindex membedded-data
17784 @opindex mno-embedded-data
17785 Allocate variables to the read-only data section first if possible, then
17786 next in the small data section if possible, otherwise in data.  This gives
17787 slightly slower code than the default, but reduces the amount of RAM required
17788 when executing, and thus may be preferred for some embedded systems.
17789
17790 @item -muninit-const-in-rodata
17791 @itemx -mno-uninit-const-in-rodata
17792 @opindex muninit-const-in-rodata
17793 @opindex mno-uninit-const-in-rodata
17794 Put uninitialized @code{const} variables in the read-only data section.
17795 This option is only meaningful in conjunction with @option{-membedded-data}.
17796
17797 @item -mcode-readable=@var{setting}
17798 @opindex mcode-readable
17799 Specify whether GCC may generate code that reads from executable sections.
17800 There are three possible settings:
17801
17802 @table @gcctabopt
17803 @item -mcode-readable=yes
17804 Instructions may freely access executable sections.  This is the
17805 default setting.
17806
17807 @item -mcode-readable=pcrel
17808 MIPS16 PC-relative load instructions can access executable sections,
17809 but other instructions must not do so.  This option is useful on 4KSc
17810 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
17811 It is also useful on processors that can be configured to have a dual
17812 instruction/data SRAM interface and that, like the M4K, automatically
17813 redirect PC-relative loads to the instruction RAM.
17814
17815 @item -mcode-readable=no
17816 Instructions must not access executable sections.  This option can be
17817 useful on targets that are configured to have a dual instruction/data
17818 SRAM interface but that (unlike the M4K) do not automatically redirect
17819 PC-relative loads to the instruction RAM.
17820 @end table
17821
17822 @item -msplit-addresses
17823 @itemx -mno-split-addresses
17824 @opindex msplit-addresses
17825 @opindex mno-split-addresses
17826 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
17827 relocation operators.  This option has been superseded by
17828 @option{-mexplicit-relocs} but is retained for backwards compatibility.
17829
17830 @item -mexplicit-relocs
17831 @itemx -mno-explicit-relocs
17832 @opindex mexplicit-relocs
17833 @opindex mno-explicit-relocs
17834 Use (do not use) assembler relocation operators when dealing with symbolic
17835 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
17836 is to use assembler macros instead.
17837
17838 @option{-mexplicit-relocs} is the default if GCC was configured
17839 to use an assembler that supports relocation operators.
17840
17841 @item -mcheck-zero-division
17842 @itemx -mno-check-zero-division
17843 @opindex mcheck-zero-division
17844 @opindex mno-check-zero-division
17845 Trap (do not trap) on integer division by zero.
17846
17847 The default is @option{-mcheck-zero-division}.
17848
17849 @item -mdivide-traps
17850 @itemx -mdivide-breaks
17851 @opindex mdivide-traps
17852 @opindex mdivide-breaks
17853 MIPS systems check for division by zero by generating either a
17854 conditional trap or a break instruction.  Using traps results in
17855 smaller code, but is only supported on MIPS II and later.  Also, some
17856 versions of the Linux kernel have a bug that prevents trap from
17857 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
17858 allow conditional traps on architectures that support them and
17859 @option{-mdivide-breaks} to force the use of breaks.
17860
17861 The default is usually @option{-mdivide-traps}, but this can be
17862 overridden at configure time using @option{--with-divide=breaks}.
17863 Divide-by-zero checks can be completely disabled using
17864 @option{-mno-check-zero-division}.
17865
17866 @item -mmemcpy
17867 @itemx -mno-memcpy
17868 @opindex mmemcpy
17869 @opindex mno-memcpy
17870 Force (do not force) the use of @code{memcpy} for non-trivial block
17871 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
17872 most constant-sized copies.
17873
17874 @item -mlong-calls
17875 @itemx -mno-long-calls
17876 @opindex mlong-calls
17877 @opindex mno-long-calls
17878 Disable (do not disable) use of the @code{jal} instruction.  Calling
17879 functions using @code{jal} is more efficient but requires the caller
17880 and callee to be in the same 256 megabyte segment.
17881
17882 This option has no effect on abicalls code.  The default is
17883 @option{-mno-long-calls}.
17884
17885 @item -mmad
17886 @itemx -mno-mad
17887 @opindex mmad
17888 @opindex mno-mad
17889 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
17890 instructions, as provided by the R4650 ISA@.
17891
17892 @item -mimadd
17893 @itemx -mno-imadd
17894 @opindex mimadd
17895 @opindex mno-imadd
17896 Enable (disable) use of the @code{madd} and @code{msub} integer
17897 instructions.  The default is @option{-mimadd} on architectures
17898 that support @code{madd} and @code{msub} except for the 74k 
17899 architecture where it was found to generate slower code.
17900
17901 @item -mfused-madd
17902 @itemx -mno-fused-madd
17903 @opindex mfused-madd
17904 @opindex mno-fused-madd
17905 Enable (disable) use of the floating-point multiply-accumulate
17906 instructions, when they are available.  The default is
17907 @option{-mfused-madd}.
17908
17909 On the R8000 CPU when multiply-accumulate instructions are used,
17910 the intermediate product is calculated to infinite precision
17911 and is not subject to the FCSR Flush to Zero bit.  This may be
17912 undesirable in some circumstances.  On other processors the result
17913 is numerically identical to the equivalent computation using
17914 separate multiply, add, subtract and negate instructions.
17915
17916 @item -nocpp
17917 @opindex nocpp
17918 Tell the MIPS assembler to not run its preprocessor over user
17919 assembler files (with a @samp{.s} suffix) when assembling them.
17920
17921 @item -mfix-24k
17922 @item -mno-fix-24k
17923 @opindex mfix-24k
17924 @opindex mno-fix-24k
17925 Work around the 24K E48 (lost data on stores during refill) errata.
17926 The workarounds are implemented by the assembler rather than by GCC@.
17927
17928 @item -mfix-r4000
17929 @itemx -mno-fix-r4000
17930 @opindex mfix-r4000
17931 @opindex mno-fix-r4000
17932 Work around certain R4000 CPU errata:
17933 @itemize @minus
17934 @item
17935 A double-word or a variable shift may give an incorrect result if executed
17936 immediately after starting an integer division.
17937 @item
17938 A double-word or a variable shift may give an incorrect result if executed
17939 while an integer multiplication is in progress.
17940 @item
17941 An integer division may give an incorrect result if started in a delay slot
17942 of a taken branch or a jump.
17943 @end itemize
17944
17945 @item -mfix-r4400
17946 @itemx -mno-fix-r4400
17947 @opindex mfix-r4400
17948 @opindex mno-fix-r4400
17949 Work around certain R4400 CPU errata:
17950 @itemize @minus
17951 @item
17952 A double-word or a variable shift may give an incorrect result if executed
17953 immediately after starting an integer division.
17954 @end itemize
17955
17956 @item -mfix-r10000
17957 @itemx -mno-fix-r10000
17958 @opindex mfix-r10000
17959 @opindex mno-fix-r10000
17960 Work around certain R10000 errata:
17961 @itemize @minus
17962 @item
17963 @code{ll}/@code{sc} sequences may not behave atomically on revisions
17964 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
17965 @end itemize
17966
17967 This option can only be used if the target architecture supports
17968 branch-likely instructions.  @option{-mfix-r10000} is the default when
17969 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
17970 otherwise.
17971
17972 @item -mfix-rm7000
17973 @itemx -mno-fix-rm7000
17974 @opindex mfix-rm7000
17975 Work around the RM7000 @code{dmult}/@code{dmultu} errata.  The
17976 workarounds are implemented by the assembler rather than by GCC@.
17977
17978 @item -mfix-vr4120
17979 @itemx -mno-fix-vr4120
17980 @opindex mfix-vr4120
17981 Work around certain VR4120 errata:
17982 @itemize @minus
17983 @item
17984 @code{dmultu} does not always produce the correct result.
17985 @item
17986 @code{div} and @code{ddiv} do not always produce the correct result if one
17987 of the operands is negative.
17988 @end itemize
17989 The workarounds for the division errata rely on special functions in
17990 @file{libgcc.a}.  At present, these functions are only provided by
17991 the @code{mips64vr*-elf} configurations.
17992
17993 Other VR4120 errata require a NOP to be inserted between certain pairs of
17994 instructions.  These errata are handled by the assembler, not by GCC itself.
17995
17996 @item -mfix-vr4130
17997 @opindex mfix-vr4130
17998 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
17999 workarounds are implemented by the assembler rather than by GCC,
18000 although GCC avoids using @code{mflo} and @code{mfhi} if the
18001 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
18002 instructions are available instead.
18003
18004 @item -mfix-sb1
18005 @itemx -mno-fix-sb1
18006 @opindex mfix-sb1
18007 Work around certain SB-1 CPU core errata.
18008 (This flag currently works around the SB-1 revision 2
18009 ``F1'' and ``F2'' floating-point errata.)
18010
18011 @item -mr10k-cache-barrier=@var{setting}
18012 @opindex mr10k-cache-barrier
18013 Specify whether GCC should insert cache barriers to avoid the
18014 side-effects of speculation on R10K processors.
18015
18016 In common with many processors, the R10K tries to predict the outcome
18017 of a conditional branch and speculatively executes instructions from
18018 the ``taken'' branch.  It later aborts these instructions if the
18019 predicted outcome is wrong.  However, on the R10K, even aborted
18020 instructions can have side effects.
18021
18022 This problem only affects kernel stores and, depending on the system,
18023 kernel loads.  As an example, a speculatively-executed store may load
18024 the target memory into cache and mark the cache line as dirty, even if
18025 the store itself is later aborted.  If a DMA operation writes to the
18026 same area of memory before the ``dirty'' line is flushed, the cached
18027 data overwrites the DMA-ed data.  See the R10K processor manual
18028 for a full description, including other potential problems.
18029
18030 One workaround is to insert cache barrier instructions before every memory
18031 access that might be speculatively executed and that might have side
18032 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
18033 controls GCC's implementation of this workaround.  It assumes that
18034 aborted accesses to any byte in the following regions does not have
18035 side effects:
18036
18037 @enumerate
18038 @item
18039 the memory occupied by the current function's stack frame;
18040
18041 @item
18042 the memory occupied by an incoming stack argument;
18043
18044 @item
18045 the memory occupied by an object with a link-time-constant address.
18046 @end enumerate
18047
18048 It is the kernel's responsibility to ensure that speculative
18049 accesses to these regions are indeed safe.
18050
18051 If the input program contains a function declaration such as:
18052
18053 @smallexample
18054 void foo (void);
18055 @end smallexample
18056
18057 then the implementation of @code{foo} must allow @code{j foo} and
18058 @code{jal foo} to be executed speculatively.  GCC honors this
18059 restriction for functions it compiles itself.  It expects non-GCC
18060 functions (such as hand-written assembly code) to do the same.
18061
18062 The option has three forms:
18063
18064 @table @gcctabopt
18065 @item -mr10k-cache-barrier=load-store
18066 Insert a cache barrier before a load or store that might be
18067 speculatively executed and that might have side effects even
18068 if aborted.
18069
18070 @item -mr10k-cache-barrier=store
18071 Insert a cache barrier before a store that might be speculatively
18072 executed and that might have side effects even if aborted.
18073
18074 @item -mr10k-cache-barrier=none
18075 Disable the insertion of cache barriers.  This is the default setting.
18076 @end table
18077
18078 @item -mflush-func=@var{func}
18079 @itemx -mno-flush-func
18080 @opindex mflush-func
18081 Specifies the function to call to flush the I and D caches, or to not
18082 call any such function.  If called, the function must take the same
18083 arguments as the common @code{_flush_func}, that is, the address of the
18084 memory range for which the cache is being flushed, the size of the
18085 memory range, and the number 3 (to flush both caches).  The default
18086 depends on the target GCC was configured for, but commonly is either
18087 @code{_flush_func} or @code{__cpu_flush}.
18088
18089 @item mbranch-cost=@var{num}
18090 @opindex mbranch-cost
18091 Set the cost of branches to roughly @var{num} ``simple'' instructions.
18092 This cost is only a heuristic and is not guaranteed to produce
18093 consistent results across releases.  A zero cost redundantly selects
18094 the default, which is based on the @option{-mtune} setting.
18095
18096 @item -mbranch-likely
18097 @itemx -mno-branch-likely
18098 @opindex mbranch-likely
18099 @opindex mno-branch-likely
18100 Enable or disable use of Branch Likely instructions, regardless of the
18101 default for the selected architecture.  By default, Branch Likely
18102 instructions may be generated if they are supported by the selected
18103 architecture.  An exception is for the MIPS32 and MIPS64 architectures
18104 and processors that implement those architectures; for those, Branch
18105 Likely instructions are not be generated by default because the MIPS32
18106 and MIPS64 architectures specifically deprecate their use.
18107
18108 @item -mfp-exceptions
18109 @itemx -mno-fp-exceptions
18110 @opindex mfp-exceptions
18111 Specifies whether FP exceptions are enabled.  This affects how
18112 FP instructions are scheduled for some processors.
18113 The default is that FP exceptions are
18114 enabled.
18115
18116 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
18117 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
18118 FP pipe.
18119
18120 @item -mvr4130-align
18121 @itemx -mno-vr4130-align
18122 @opindex mvr4130-align
18123 The VR4130 pipeline is two-way superscalar, but can only issue two
18124 instructions together if the first one is 8-byte aligned.  When this
18125 option is enabled, GCC aligns pairs of instructions that it
18126 thinks should execute in parallel.
18127
18128 This option only has an effect when optimizing for the VR4130.
18129 It normally makes code faster, but at the expense of making it bigger.
18130 It is enabled by default at optimization level @option{-O3}.
18131
18132 @item -msynci
18133 @itemx -mno-synci
18134 @opindex msynci
18135 Enable (disable) generation of @code{synci} instructions on
18136 architectures that support it.  The @code{synci} instructions (if
18137 enabled) are generated when @code{__builtin___clear_cache} is
18138 compiled.
18139
18140 This option defaults to @option{-mno-synci}, but the default can be
18141 overridden by configuring GCC with @option{--with-synci}.
18142
18143 When compiling code for single processor systems, it is generally safe
18144 to use @code{synci}.  However, on many multi-core (SMP) systems, it
18145 does not invalidate the instruction caches on all cores and may lead
18146 to undefined behavior.
18147
18148 @item -mrelax-pic-calls
18149 @itemx -mno-relax-pic-calls
18150 @opindex mrelax-pic-calls
18151 Try to turn PIC calls that are normally dispatched via register
18152 @code{$25} into direct calls.  This is only possible if the linker can
18153 resolve the destination at link-time and if the destination is within
18154 range for a direct call.
18155
18156 @option{-mrelax-pic-calls} is the default if GCC was configured to use
18157 an assembler and a linker that support the @code{.reloc} assembly
18158 directive and @option{-mexplicit-relocs} is in effect.  With
18159 @option{-mno-explicit-relocs}, this optimization can be performed by the
18160 assembler and the linker alone without help from the compiler.
18161
18162 @item -mmcount-ra-address
18163 @itemx -mno-mcount-ra-address
18164 @opindex mmcount-ra-address
18165 @opindex mno-mcount-ra-address
18166 Emit (do not emit) code that allows @code{_mcount} to modify the
18167 calling function's return address.  When enabled, this option extends
18168 the usual @code{_mcount} interface with a new @var{ra-address}
18169 parameter, which has type @code{intptr_t *} and is passed in register
18170 @code{$12}.  @code{_mcount} can then modify the return address by
18171 doing both of the following:
18172 @itemize
18173 @item
18174 Returning the new address in register @code{$31}.
18175 @item
18176 Storing the new address in @code{*@var{ra-address}},
18177 if @var{ra-address} is nonnull.
18178 @end itemize
18179
18180 The default is @option{-mno-mcount-ra-address}.
18181
18182 @item -mframe-header-opt
18183 @itemx -mno-frame-header-opt
18184 @opindex mframe-header-opt
18185 Enable (disable) frame header optimization in the o32 ABI.  When using the
18186 o32 ABI, calling functions will allocate 16 bytes on the stack for the called
18187 function to write out register arguments.  When enabled, this optimization
18188 will suppress the allocation of the frame header if it can be determined that
18189 it is unused.
18190
18191 This optimization is off by default at all optimization levels.
18192
18193 @end table
18194
18195 @node MMIX Options
18196 @subsection MMIX Options
18197 @cindex MMIX Options
18198
18199 These options are defined for the MMIX:
18200
18201 @table @gcctabopt
18202 @item -mlibfuncs
18203 @itemx -mno-libfuncs
18204 @opindex mlibfuncs
18205 @opindex mno-libfuncs
18206 Specify that intrinsic library functions are being compiled, passing all
18207 values in registers, no matter the size.
18208
18209 @item -mepsilon
18210 @itemx -mno-epsilon
18211 @opindex mepsilon
18212 @opindex mno-epsilon
18213 Generate floating-point comparison instructions that compare with respect
18214 to the @code{rE} epsilon register.
18215
18216 @item -mabi=mmixware
18217 @itemx -mabi=gnu
18218 @opindex mabi=mmixware
18219 @opindex mabi=gnu
18220 Generate code that passes function parameters and return values that (in
18221 the called function) are seen as registers @code{$0} and up, as opposed to
18222 the GNU ABI which uses global registers @code{$231} and up.
18223
18224 @item -mzero-extend
18225 @itemx -mno-zero-extend
18226 @opindex mzero-extend
18227 @opindex mno-zero-extend
18228 When reading data from memory in sizes shorter than 64 bits, use (do not
18229 use) zero-extending load instructions by default, rather than
18230 sign-extending ones.
18231
18232 @item -mknuthdiv
18233 @itemx -mno-knuthdiv
18234 @opindex mknuthdiv
18235 @opindex mno-knuthdiv
18236 Make the result of a division yielding a remainder have the same sign as
18237 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
18238 remainder follows the sign of the dividend.  Both methods are
18239 arithmetically valid, the latter being almost exclusively used.
18240
18241 @item -mtoplevel-symbols
18242 @itemx -mno-toplevel-symbols
18243 @opindex mtoplevel-symbols
18244 @opindex mno-toplevel-symbols
18245 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
18246 code can be used with the @code{PREFIX} assembly directive.
18247
18248 @item -melf
18249 @opindex melf
18250 Generate an executable in the ELF format, rather than the default
18251 @samp{mmo} format used by the @command{mmix} simulator.
18252
18253 @item -mbranch-predict
18254 @itemx -mno-branch-predict
18255 @opindex mbranch-predict
18256 @opindex mno-branch-predict
18257 Use (do not use) the probable-branch instructions, when static branch
18258 prediction indicates a probable branch.
18259
18260 @item -mbase-addresses
18261 @itemx -mno-base-addresses
18262 @opindex mbase-addresses
18263 @opindex mno-base-addresses
18264 Generate (do not generate) code that uses @emph{base addresses}.  Using a
18265 base address automatically generates a request (handled by the assembler
18266 and the linker) for a constant to be set up in a global register.  The
18267 register is used for one or more base address requests within the range 0
18268 to 255 from the value held in the register.  The generally leads to short
18269 and fast code, but the number of different data items that can be
18270 addressed is limited.  This means that a program that uses lots of static
18271 data may require @option{-mno-base-addresses}.
18272
18273 @item -msingle-exit
18274 @itemx -mno-single-exit
18275 @opindex msingle-exit
18276 @opindex mno-single-exit
18277 Force (do not force) generated code to have a single exit point in each
18278 function.
18279 @end table
18280
18281 @node MN10300 Options
18282 @subsection MN10300 Options
18283 @cindex MN10300 options
18284
18285 These @option{-m} options are defined for Matsushita MN10300 architectures:
18286
18287 @table @gcctabopt
18288 @item -mmult-bug
18289 @opindex mmult-bug
18290 Generate code to avoid bugs in the multiply instructions for the MN10300
18291 processors.  This is the default.
18292
18293 @item -mno-mult-bug
18294 @opindex mno-mult-bug
18295 Do not generate code to avoid bugs in the multiply instructions for the
18296 MN10300 processors.
18297
18298 @item -mam33
18299 @opindex mam33
18300 Generate code using features specific to the AM33 processor.
18301
18302 @item -mno-am33
18303 @opindex mno-am33
18304 Do not generate code using features specific to the AM33 processor.  This
18305 is the default.
18306
18307 @item -mam33-2
18308 @opindex mam33-2
18309 Generate code using features specific to the AM33/2.0 processor.
18310
18311 @item -mam34
18312 @opindex mam34
18313 Generate code using features specific to the AM34 processor.
18314
18315 @item -mtune=@var{cpu-type}
18316 @opindex mtune
18317 Use the timing characteristics of the indicated CPU type when
18318 scheduling instructions.  This does not change the targeted processor
18319 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
18320 @samp{am33-2} or @samp{am34}.
18321
18322 @item -mreturn-pointer-on-d0
18323 @opindex mreturn-pointer-on-d0
18324 When generating a function that returns a pointer, return the pointer
18325 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
18326 only in @code{a0}, and attempts to call such functions without a prototype
18327 result in errors.  Note that this option is on by default; use
18328 @option{-mno-return-pointer-on-d0} to disable it.
18329
18330 @item -mno-crt0
18331 @opindex mno-crt0
18332 Do not link in the C run-time initialization object file.
18333
18334 @item -mrelax
18335 @opindex mrelax
18336 Indicate to the linker that it should perform a relaxation optimization pass
18337 to shorten branches, calls and absolute memory addresses.  This option only
18338 has an effect when used on the command line for the final link step.
18339
18340 This option makes symbolic debugging impossible.
18341
18342 @item -mliw
18343 @opindex mliw
18344 Allow the compiler to generate @emph{Long Instruction Word}
18345 instructions if the target is the @samp{AM33} or later.  This is the
18346 default.  This option defines the preprocessor macro @code{__LIW__}.
18347
18348 @item -mnoliw
18349 @opindex mnoliw
18350 Do not allow the compiler to generate @emph{Long Instruction Word}
18351 instructions.  This option defines the preprocessor macro
18352 @code{__NO_LIW__}.
18353
18354 @item -msetlb
18355 @opindex msetlb
18356 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
18357 instructions if the target is the @samp{AM33} or later.  This is the
18358 default.  This option defines the preprocessor macro @code{__SETLB__}.
18359
18360 @item -mnosetlb
18361 @opindex mnosetlb
18362 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
18363 instructions.  This option defines the preprocessor macro
18364 @code{__NO_SETLB__}.
18365
18366 @end table
18367
18368 @node Moxie Options
18369 @subsection Moxie Options
18370 @cindex Moxie Options
18371
18372 @table @gcctabopt
18373
18374 @item -meb
18375 @opindex meb
18376 Generate big-endian code.  This is the default for @samp{moxie-*-*}
18377 configurations.
18378
18379 @item -mel
18380 @opindex mel
18381 Generate little-endian code.
18382
18383 @item -mmul.x
18384 @opindex mmul.x
18385 Generate mul.x and umul.x instructions.  This is the default for
18386 @samp{moxiebox-*-*} configurations.
18387
18388 @item -mno-crt0
18389 @opindex mno-crt0
18390 Do not link in the C run-time initialization object file.
18391
18392 @end table
18393
18394 @node MSP430 Options
18395 @subsection MSP430 Options
18396 @cindex MSP430 Options
18397
18398 These options are defined for the MSP430:
18399
18400 @table @gcctabopt
18401
18402 @item -masm-hex
18403 @opindex masm-hex
18404 Force assembly output to always use hex constants.  Normally such
18405 constants are signed decimals, but this option is available for
18406 testsuite and/or aesthetic purposes.
18407
18408 @item -mmcu=
18409 @opindex mmcu=
18410 Select the MCU to target.  This is used to create a C preprocessor
18411 symbol based upon the MCU name, converted to upper case and pre- and
18412 post-fixed with @samp{__}.  This in turn is used by the
18413 @file{msp430.h} header file to select an MCU-specific supplementary
18414 header file.
18415
18416 The option also sets the ISA to use.  If the MCU name is one that is
18417 known to only support the 430 ISA then that is selected, otherwise the
18418 430X ISA is selected.  A generic MCU name of @samp{msp430} can also be
18419 used to select the 430 ISA.  Similarly the generic @samp{msp430x} MCU
18420 name selects the 430X ISA.
18421
18422 In addition an MCU-specific linker script is added to the linker
18423 command line.  The script's name is the name of the MCU with
18424 @file{.ld} appended.  Thus specifying @option{-mmcu=xxx} on the @command{gcc}
18425 command line defines the C preprocessor symbol @code{__XXX__} and
18426 cause the linker to search for a script called @file{xxx.ld}.
18427
18428 This option is also passed on to the assembler.
18429
18430 @item -mcpu=
18431 @opindex mcpu=
18432 Specifies the ISA to use.  Accepted values are @samp{msp430},
18433 @samp{msp430x} and @samp{msp430xv2}.  This option is deprecated.  The
18434 @option{-mmcu=} option should be used to select the ISA.
18435
18436 @item -msim
18437 @opindex msim
18438 Link to the simulator runtime libraries and linker script.  Overrides
18439 any scripts that would be selected by the @option{-mmcu=} option.
18440
18441 @item -mlarge
18442 @opindex mlarge
18443 Use large-model addressing (20-bit pointers, 32-bit @code{size_t}).
18444
18445 @item -msmall
18446 @opindex msmall
18447 Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
18448
18449 @item -mrelax
18450 @opindex mrelax
18451 This option is passed to the assembler and linker, and allows the
18452 linker to perform certain optimizations that cannot be done until
18453 the final link.
18454
18455 @item mhwmult=
18456 @opindex mhwmult=
18457 Describes the type of hardware multiply supported by the target.
18458 Accepted values are @samp{none} for no hardware multiply, @samp{16bit}
18459 for the original 16-bit-only multiply supported by early MCUs.
18460 @samp{32bit} for the 16/32-bit multiply supported by later MCUs and
18461 @samp{f5series} for the 16/32-bit multiply supported by F5-series MCUs.
18462 A value of @samp{auto} can also be given.  This tells GCC to deduce
18463 the hardware multiply support based upon the MCU name provided by the
18464 @option{-mmcu} option.  If no @option{-mmcu} option is specified then
18465 @samp{32bit} hardware multiply support is assumed.  If the MCU name is
18466 not recognised then no hardware multiply support is assumed.
18467 @code{auto} is the default setting.
18468
18469 Hardware multiplies are normally performed by calling a library
18470 routine.  This saves space in the generated code.  When compiling at
18471 @option{-O3} or higher however the hardware multiplier is invoked
18472 inline.  This makes for bigger, but faster code.
18473
18474 The hardware multiply routines disable interrupts whilst running and
18475 restore the previous interrupt state when they finish.  This makes
18476 them safe to use inside interrupt handlers as well as in normal code.
18477
18478 @item -minrt
18479 @opindex minrt
18480 Enable the use of a minimum runtime environment - no static
18481 initializers or constructors.  This is intended for memory-constrained
18482 devices.  The compiler includes special symbols in some objects
18483 that tell the linker and runtime which code fragments are required.
18484
18485 @item -mcode-region=
18486 @itemx -mdata-region=
18487 @opindex mcode-region
18488 @opindex mdata-region
18489 These options tell the compiler where to place functions and data that
18490 do not have one of the @code{lower}, @code{upper}, @code{either} or
18491 @code{section} attributes.  Possible values are @code{lower},
18492 @code{upper}, @code{either} or @code{any}.  The first three behave
18493 like the corresponding attribute.  The fourth possible value -
18494 @code{any} - is the default.  It leaves placement entirely up to the
18495 linker script and how it assigns the standard sections (.text, .data
18496 etc) to the memory regions.
18497
18498 @item -msilicon-errata=
18499 @opindex msilicon-errata
18500 This option passes on a request to assembler to enable the fixes for
18501 the named silicon errata.
18502
18503 @item -msilicon-errata-warn=
18504 @opindex msilicon-errata-warn
18505 This option passes on a request to the assembler to enable warning
18506 messages when a silicon errata might need to be applied.
18507
18508 @end table
18509
18510 @node NDS32 Options
18511 @subsection NDS32 Options
18512 @cindex NDS32 Options
18513
18514 These options are defined for NDS32 implementations:
18515
18516 @table @gcctabopt
18517
18518 @item -mbig-endian
18519 @opindex mbig-endian
18520 Generate code in big-endian mode.
18521
18522 @item -mlittle-endian
18523 @opindex mlittle-endian
18524 Generate code in little-endian mode.
18525
18526 @item -mreduced-regs
18527 @opindex mreduced-regs
18528 Use reduced-set registers for register allocation.
18529
18530 @item -mfull-regs
18531 @opindex mfull-regs
18532 Use full-set registers for register allocation.
18533
18534 @item -mcmov
18535 @opindex mcmov
18536 Generate conditional move instructions.
18537
18538 @item -mno-cmov
18539 @opindex mno-cmov
18540 Do not generate conditional move instructions.
18541
18542 @item -mperf-ext
18543 @opindex mperf-ext
18544 Generate performance extension instructions.
18545
18546 @item -mno-perf-ext
18547 @opindex mno-perf-ext
18548 Do not generate performance extension instructions.
18549
18550 @item -mv3push
18551 @opindex mv3push
18552 Generate v3 push25/pop25 instructions.
18553
18554 @item -mno-v3push
18555 @opindex mno-v3push
18556 Do not generate v3 push25/pop25 instructions.
18557
18558 @item -m16-bit
18559 @opindex m16-bit
18560 Generate 16-bit instructions.
18561
18562 @item -mno-16-bit
18563 @opindex mno-16-bit
18564 Do not generate 16-bit instructions.
18565
18566 @item -misr-vector-size=@var{num}
18567 @opindex misr-vector-size
18568 Specify the size of each interrupt vector, which must be 4 or 16.
18569
18570 @item -mcache-block-size=@var{num}
18571 @opindex mcache-block-size
18572 Specify the size of each cache block,
18573 which must be a power of 2 between 4 and 512.
18574
18575 @item -march=@var{arch}
18576 @opindex march
18577 Specify the name of the target architecture.
18578
18579 @item -mcmodel=@var{code-model}
18580 @opindex mcmodel
18581 Set the code model to one of
18582 @table @asis
18583 @item @samp{small}
18584 All the data and read-only data segments must be within 512KB addressing space.
18585 The text segment must be within 16MB addressing space.
18586 @item @samp{medium}
18587 The data segment must be within 512KB while the read-only data segment can be
18588 within 4GB addressing space.  The text segment should be still within 16MB
18589 addressing space.
18590 @item @samp{large}
18591 All the text and data segments can be within 4GB addressing space.
18592 @end table
18593
18594 @item -mctor-dtor
18595 @opindex mctor-dtor
18596 Enable constructor/destructor feature.
18597
18598 @item -mrelax
18599 @opindex mrelax
18600 Guide linker to relax instructions.
18601
18602 @end table
18603
18604 @node Nios II Options
18605 @subsection Nios II Options
18606 @cindex Nios II options
18607 @cindex Altera Nios II options
18608
18609 These are the options defined for the Altera Nios II processor.
18610
18611 @table @gcctabopt
18612
18613 @item -G @var{num}
18614 @opindex G
18615 @cindex smaller data references
18616 Put global and static objects less than or equal to @var{num} bytes
18617 into the small data or BSS sections instead of the normal data or BSS
18618 sections.  The default value of @var{num} is 8.
18619
18620 @item -mgpopt=@var{option}
18621 @item -mgpopt
18622 @itemx -mno-gpopt
18623 @opindex mgpopt
18624 @opindex mno-gpopt
18625 Generate (do not generate) GP-relative accesses.  The following 
18626 @var{option} names are recognized:
18627
18628 @table @samp
18629
18630 @item none
18631 Do not generate GP-relative accesses.
18632
18633 @item local
18634 Generate GP-relative accesses for small data objects that are not 
18635 external, weak, or uninitialized common symbols.  
18636 Also use GP-relative addressing for objects that
18637 have been explicitly placed in a small data section via a @code{section}
18638 attribute.
18639
18640 @item global
18641 As for @samp{local}, but also generate GP-relative accesses for
18642 small data objects that are external, weak, or common.  If you use this option,
18643 you must ensure that all parts of your program (including libraries) are
18644 compiled with the same @option{-G} setting.
18645
18646 @item data
18647 Generate GP-relative accesses for all data objects in the program.  If you
18648 use this option, the entire data and BSS segments
18649 of your program must fit in 64K of memory and you must use an appropriate
18650 linker script to allocate them within the addressible range of the
18651 global pointer.
18652
18653 @item all
18654 Generate GP-relative addresses for function pointers as well as data
18655 pointers.  If you use this option, the entire text, data, and BSS segments
18656 of your program must fit in 64K of memory and you must use an appropriate
18657 linker script to allocate them within the addressible range of the
18658 global pointer.
18659
18660 @end table
18661
18662 @option{-mgpopt} is equivalent to @option{-mgpopt=local}, and
18663 @option{-mno-gpopt} is equivalent to @option{-mgpopt=none}.
18664
18665 The default is @option{-mgpopt} except when @option{-fpic} or
18666 @option{-fPIC} is specified to generate position-independent code.
18667 Note that the Nios II ABI does not permit GP-relative accesses from
18668 shared libraries.
18669
18670 You may need to specify @option{-mno-gpopt} explicitly when building
18671 programs that include large amounts of small data, including large
18672 GOT data sections.  In this case, the 16-bit offset for GP-relative
18673 addressing may not be large enough to allow access to the entire 
18674 small data section.
18675
18676 @item -mel
18677 @itemx -meb
18678 @opindex mel
18679 @opindex meb
18680 Generate little-endian (default) or big-endian (experimental) code,
18681 respectively.
18682
18683 @item -march=@var{arch}
18684 @opindex march
18685 This specifies the name of the target Nios II architecture.  GCC uses this
18686 name to determine what kind of instructions it can emit when generating
18687 assembly code.  Permissible names are: @samp{r1}, @samp{r2}.
18688
18689 The preprocessor macro @code{__nios2_arch__} is available to programs,
18690 with value 1 or 2, indicating the targeted ISA level.
18691
18692 @item -mbypass-cache
18693 @itemx -mno-bypass-cache
18694 @opindex mno-bypass-cache
18695 @opindex mbypass-cache
18696 Force all load and store instructions to always bypass cache by 
18697 using I/O variants of the instructions. The default is not to
18698 bypass the cache.
18699
18700 @item -mno-cache-volatile 
18701 @itemx -mcache-volatile       
18702 @opindex mcache-volatile 
18703 @opindex mno-cache-volatile
18704 Volatile memory access bypass the cache using the I/O variants of 
18705 the load and store instructions. The default is not to bypass the cache.
18706
18707 @item -mno-fast-sw-div
18708 @itemx -mfast-sw-div
18709 @opindex mno-fast-sw-div
18710 @opindex mfast-sw-div
18711 Do not use table-based fast divide for small numbers. The default 
18712 is to use the fast divide at @option{-O3} and above.
18713
18714 @item -mno-hw-mul
18715 @itemx -mhw-mul
18716 @itemx -mno-hw-mulx
18717 @itemx -mhw-mulx
18718 @itemx -mno-hw-div
18719 @itemx -mhw-div
18720 @opindex mno-hw-mul
18721 @opindex mhw-mul
18722 @opindex mno-hw-mulx
18723 @opindex mhw-mulx
18724 @opindex mno-hw-div
18725 @opindex mhw-div
18726 Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of 
18727 instructions by the compiler. The default is to emit @code{mul}
18728 and not emit @code{div} and @code{mulx}.
18729
18730 @item -mbmx
18731 @itemx -mno-bmx
18732 @itemx -mcdx
18733 @itemx -mno-cdx
18734 Enable or disable generation of Nios II R2 BMX (bit manipulation) and
18735 CDX (code density) instructions.  Enabling these instructions also
18736 requires @option{-march=r2}.  Since these instructions are optional
18737 extensions to the R2 architecture, the default is not to emit them.
18738
18739 @item -mcustom-@var{insn}=@var{N}
18740 @itemx -mno-custom-@var{insn}
18741 @opindex mcustom-@var{insn}
18742 @opindex mno-custom-@var{insn}
18743 Each @option{-mcustom-@var{insn}=@var{N}} option enables use of a
18744 custom instruction with encoding @var{N} when generating code that uses 
18745 @var{insn}.  For example, @option{-mcustom-fadds=253} generates custom
18746 instruction 253 for single-precision floating-point add operations instead
18747 of the default behavior of using a library call.
18748
18749 The following values of @var{insn} are supported.  Except as otherwise
18750 noted, floating-point operations are expected to be implemented with
18751 normal IEEE 754 semantics and correspond directly to the C operators or the
18752 equivalent GCC built-in functions (@pxref{Other Builtins}).
18753
18754 Single-precision floating point:
18755 @table @asis
18756
18757 @item @samp{fadds}, @samp{fsubs}, @samp{fdivs}, @samp{fmuls}
18758 Binary arithmetic operations.
18759
18760 @item @samp{fnegs}
18761 Unary negation.
18762
18763 @item @samp{fabss}
18764 Unary absolute value.
18765
18766 @item @samp{fcmpeqs}, @samp{fcmpges}, @samp{fcmpgts}, @samp{fcmples}, @samp{fcmplts}, @samp{fcmpnes}
18767 Comparison operations.
18768
18769 @item @samp{fmins}, @samp{fmaxs}
18770 Floating-point minimum and maximum.  These instructions are only
18771 generated if @option{-ffinite-math-only} is specified.
18772
18773 @item @samp{fsqrts}
18774 Unary square root operation.
18775
18776 @item @samp{fcoss}, @samp{fsins}, @samp{ftans}, @samp{fatans}, @samp{fexps}, @samp{flogs}
18777 Floating-point trigonometric and exponential functions.  These instructions
18778 are only generated if @option{-funsafe-math-optimizations} is also specified.
18779
18780 @end table
18781
18782 Double-precision floating point:
18783 @table @asis
18784
18785 @item @samp{faddd}, @samp{fsubd}, @samp{fdivd}, @samp{fmuld}
18786 Binary arithmetic operations.
18787
18788 @item @samp{fnegd}
18789 Unary negation.
18790
18791 @item @samp{fabsd}
18792 Unary absolute value.
18793
18794 @item @samp{fcmpeqd}, @samp{fcmpged}, @samp{fcmpgtd}, @samp{fcmpled}, @samp{fcmpltd}, @samp{fcmpned}
18795 Comparison operations.
18796
18797 @item @samp{fmind}, @samp{fmaxd}
18798 Double-precision minimum and maximum.  These instructions are only
18799 generated if @option{-ffinite-math-only} is specified.
18800
18801 @item @samp{fsqrtd}
18802 Unary square root operation.
18803
18804 @item @samp{fcosd}, @samp{fsind}, @samp{ftand}, @samp{fatand}, @samp{fexpd}, @samp{flogd}
18805 Double-precision trigonometric and exponential functions.  These instructions
18806 are only generated if @option{-funsafe-math-optimizations} is also specified.
18807
18808 @end table
18809
18810 Conversions:
18811 @table @asis
18812 @item @samp{fextsd}
18813 Conversion from single precision to double precision.
18814
18815 @item @samp{ftruncds}
18816 Conversion from double precision to single precision.
18817
18818 @item @samp{fixsi}, @samp{fixsu}, @samp{fixdi}, @samp{fixdu}
18819 Conversion from floating point to signed or unsigned integer types, with
18820 truncation towards zero.
18821
18822 @item @samp{round}
18823 Conversion from single-precision floating point to signed integer,
18824 rounding to the nearest integer and ties away from zero.
18825 This corresponds to the @code{__builtin_lroundf} function when
18826 @option{-fno-math-errno} is used.
18827
18828 @item @samp{floatis}, @samp{floatus}, @samp{floatid}, @samp{floatud}
18829 Conversion from signed or unsigned integer types to floating-point types.
18830
18831 @end table
18832
18833 In addition, all of the following transfer instructions for internal
18834 registers X and Y must be provided to use any of the double-precision
18835 floating-point instructions.  Custom instructions taking two
18836 double-precision source operands expect the first operand in the
18837 64-bit register X.  The other operand (or only operand of a unary
18838 operation) is given to the custom arithmetic instruction with the
18839 least significant half in source register @var{src1} and the most
18840 significant half in @var{src2}.  A custom instruction that returns a
18841 double-precision result returns the most significant 32 bits in the
18842 destination register and the other half in 32-bit register Y.  
18843 GCC automatically generates the necessary code sequences to write
18844 register X and/or read register Y when double-precision floating-point
18845 instructions are used.
18846
18847 @table @asis
18848
18849 @item @samp{fwrx}
18850 Write @var{src1} into the least significant half of X and @var{src2} into
18851 the most significant half of X.
18852
18853 @item @samp{fwry}
18854 Write @var{src1} into Y.
18855
18856 @item @samp{frdxhi}, @samp{frdxlo}
18857 Read the most or least (respectively) significant half of X and store it in
18858 @var{dest}.
18859
18860 @item @samp{frdy}
18861 Read the value of Y and store it into @var{dest}.
18862 @end table
18863
18864 Note that you can gain more local control over generation of Nios II custom
18865 instructions by using the @code{target("custom-@var{insn}=@var{N}")}
18866 and @code{target("no-custom-@var{insn}")} function attributes
18867 (@pxref{Function Attributes})
18868 or pragmas (@pxref{Function Specific Option Pragmas}).
18869
18870 @item -mcustom-fpu-cfg=@var{name}
18871 @opindex mcustom-fpu-cfg
18872
18873 This option enables a predefined, named set of custom instruction encodings
18874 (see @option{-mcustom-@var{insn}} above).  
18875 Currently, the following sets are defined:
18876
18877 @option{-mcustom-fpu-cfg=60-1} is equivalent to:
18878 @gccoptlist{-mcustom-fmuls=252 @gol
18879 -mcustom-fadds=253 @gol
18880 -mcustom-fsubs=254 @gol
18881 -fsingle-precision-constant}
18882
18883 @option{-mcustom-fpu-cfg=60-2} is equivalent to:
18884 @gccoptlist{-mcustom-fmuls=252 @gol
18885 -mcustom-fadds=253 @gol
18886 -mcustom-fsubs=254 @gol
18887 -mcustom-fdivs=255 @gol
18888 -fsingle-precision-constant}
18889
18890 @option{-mcustom-fpu-cfg=72-3} is equivalent to:
18891 @gccoptlist{-mcustom-floatus=243 @gol
18892 -mcustom-fixsi=244 @gol
18893 -mcustom-floatis=245 @gol
18894 -mcustom-fcmpgts=246 @gol
18895 -mcustom-fcmples=249 @gol
18896 -mcustom-fcmpeqs=250 @gol
18897 -mcustom-fcmpnes=251 @gol
18898 -mcustom-fmuls=252 @gol
18899 -mcustom-fadds=253 @gol
18900 -mcustom-fsubs=254 @gol
18901 -mcustom-fdivs=255 @gol
18902 -fsingle-precision-constant}
18903
18904 Custom instruction assignments given by individual
18905 @option{-mcustom-@var{insn}=} options override those given by
18906 @option{-mcustom-fpu-cfg=}, regardless of the
18907 order of the options on the command line.
18908
18909 Note that you can gain more local control over selection of a FPU
18910 configuration by using the @code{target("custom-fpu-cfg=@var{name}")}
18911 function attribute (@pxref{Function Attributes})
18912 or pragma (@pxref{Function Specific Option Pragmas}).
18913
18914 @end table
18915
18916 These additional @samp{-m} options are available for the Altera Nios II
18917 ELF (bare-metal) target:
18918
18919 @table @gcctabopt
18920
18921 @item -mhal
18922 @opindex mhal
18923 Link with HAL BSP.  This suppresses linking with the GCC-provided C runtime
18924 startup and termination code, and is typically used in conjunction with
18925 @option{-msys-crt0=} to specify the location of the alternate startup code
18926 provided by the HAL BSP.
18927
18928 @item -msmallc
18929 @opindex msmallc
18930 Link with a limited version of the C library, @option{-lsmallc}, rather than
18931 Newlib.
18932
18933 @item -msys-crt0=@var{startfile}
18934 @opindex msys-crt0
18935 @var{startfile} is the file name of the startfile (crt0) to use 
18936 when linking.  This option is only useful in conjunction with @option{-mhal}.
18937
18938 @item -msys-lib=@var{systemlib}
18939 @opindex msys-lib
18940 @var{systemlib} is the library name of the library that provides
18941 low-level system calls required by the C library,
18942 e.g. @code{read} and @code{write}.
18943 This option is typically used to link with a library provided by a HAL BSP.
18944
18945 @end table
18946
18947 @node Nvidia PTX Options
18948 @subsection Nvidia PTX Options
18949 @cindex Nvidia PTX options
18950 @cindex nvptx options
18951
18952 These options are defined for Nvidia PTX:
18953
18954 @table @gcctabopt
18955
18956 @item -m32
18957 @itemx -m64
18958 @opindex m32
18959 @opindex m64
18960 Generate code for 32-bit or 64-bit ABI.
18961
18962 @item -mmainkernel
18963 @opindex mmainkernel
18964 Link in code for a __main kernel.  This is for stand-alone instead of
18965 offloading execution.
18966
18967 @end table
18968
18969 @node PDP-11 Options
18970 @subsection PDP-11 Options
18971 @cindex PDP-11 Options
18972
18973 These options are defined for the PDP-11:
18974
18975 @table @gcctabopt
18976 @item -mfpu
18977 @opindex mfpu
18978 Use hardware FPP floating point.  This is the default.  (FIS floating
18979 point on the PDP-11/40 is not supported.)
18980
18981 @item -msoft-float
18982 @opindex msoft-float
18983 Do not use hardware floating point.
18984
18985 @item -mac0
18986 @opindex mac0
18987 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
18988
18989 @item -mno-ac0
18990 @opindex mno-ac0
18991 Return floating-point results in memory.  This is the default.
18992
18993 @item -m40
18994 @opindex m40
18995 Generate code for a PDP-11/40.
18996
18997 @item -m45
18998 @opindex m45
18999 Generate code for a PDP-11/45.  This is the default.
19000
19001 @item -m10
19002 @opindex m10
19003 Generate code for a PDP-11/10.
19004
19005 @item -mbcopy-builtin
19006 @opindex mbcopy-builtin
19007 Use inline @code{movmemhi} patterns for copying memory.  This is the
19008 default.
19009
19010 @item -mbcopy
19011 @opindex mbcopy
19012 Do not use inline @code{movmemhi} patterns for copying memory.
19013
19014 @item -mint16
19015 @itemx -mno-int32
19016 @opindex mint16
19017 @opindex mno-int32
19018 Use 16-bit @code{int}.  This is the default.
19019
19020 @item -mint32
19021 @itemx -mno-int16
19022 @opindex mint32
19023 @opindex mno-int16
19024 Use 32-bit @code{int}.
19025
19026 @item -mfloat64
19027 @itemx -mno-float32
19028 @opindex mfloat64
19029 @opindex mno-float32
19030 Use 64-bit @code{float}.  This is the default.
19031
19032 @item -mfloat32
19033 @itemx -mno-float64
19034 @opindex mfloat32
19035 @opindex mno-float64
19036 Use 32-bit @code{float}.
19037
19038 @item -mabshi
19039 @opindex mabshi
19040 Use @code{abshi2} pattern.  This is the default.
19041
19042 @item -mno-abshi
19043 @opindex mno-abshi
19044 Do not use @code{abshi2} pattern.
19045
19046 @item -mbranch-expensive
19047 @opindex mbranch-expensive
19048 Pretend that branches are expensive.  This is for experimenting with
19049 code generation only.
19050
19051 @item -mbranch-cheap
19052 @opindex mbranch-cheap
19053 Do not pretend that branches are expensive.  This is the default.
19054
19055 @item -munix-asm
19056 @opindex munix-asm
19057 Use Unix assembler syntax.  This is the default when configured for
19058 @samp{pdp11-*-bsd}.
19059
19060 @item -mdec-asm
19061 @opindex mdec-asm
19062 Use DEC assembler syntax.  This is the default when configured for any
19063 PDP-11 target other than @samp{pdp11-*-bsd}.
19064 @end table
19065
19066 @node picoChip Options
19067 @subsection picoChip Options
19068 @cindex picoChip options
19069
19070 These @samp{-m} options are defined for picoChip implementations:
19071
19072 @table @gcctabopt
19073
19074 @item -mae=@var{ae_type}
19075 @opindex mcpu
19076 Set the instruction set, register set, and instruction scheduling
19077 parameters for array element type @var{ae_type}.  Supported values
19078 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
19079
19080 @option{-mae=ANY} selects a completely generic AE type.  Code
19081 generated with this option runs on any of the other AE types.  The
19082 code is not as efficient as it would be if compiled for a specific
19083 AE type, and some types of operation (e.g., multiplication) do not
19084 work properly on all types of AE.
19085
19086 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
19087 for compiled code, and is the default.
19088
19089 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
19090 option may suffer from poor performance of byte (char) manipulation,
19091 since the DSP AE does not provide hardware support for byte load/stores.
19092
19093 @item -msymbol-as-address
19094 Enable the compiler to directly use a symbol name as an address in a
19095 load/store instruction, without first loading it into a
19096 register.  Typically, the use of this option generates larger
19097 programs, which run faster than when the option isn't used.  However, the
19098 results vary from program to program, so it is left as a user option,
19099 rather than being permanently enabled.
19100
19101 @item -mno-inefficient-warnings
19102 Disables warnings about the generation of inefficient code.  These
19103 warnings can be generated, for example, when compiling code that
19104 performs byte-level memory operations on the MAC AE type.  The MAC AE has
19105 no hardware support for byte-level memory operations, so all byte
19106 load/stores must be synthesized from word load/store operations.  This is
19107 inefficient and a warning is generated to indicate
19108 that you should rewrite the code to avoid byte operations, or to target
19109 an AE type that has the necessary hardware support.  This option disables
19110 these warnings.
19111
19112 @end table
19113
19114 @node PowerPC Options
19115 @subsection PowerPC Options
19116 @cindex PowerPC options
19117
19118 These are listed under @xref{RS/6000 and PowerPC Options}.
19119
19120 @node RL78 Options
19121 @subsection RL78 Options
19122 @cindex RL78 Options
19123
19124 @table @gcctabopt
19125
19126 @item -msim
19127 @opindex msim
19128 Links in additional target libraries to support operation within a
19129 simulator.
19130
19131 @item -mmul=none
19132 @itemx -mmul=g10
19133 @itemx -mmul=g13
19134 @itemx -mmul=g14
19135 @itemx -mmul=rl78
19136 @opindex mmul
19137 Specifies the type of hardware multiplication and division support to
19138 be used.  The simplest is @code{none}, which uses software for both
19139 multiplication and division.  This is the default.  The @code{g13}
19140 value is for the hardware multiply/divide peripheral found on the
19141 RL78/G13 (S2 core) targets.  The @code{g14} value selects the use of
19142 the multiplication and division instructions supported by the RL78/G14
19143 (S3 core) parts.  The value @code{rl78} is an alias for @code{g14} and
19144 the value @code{mg10} is an alias for @code{none}.
19145
19146 In addition a C preprocessor macro is defined, based upon the setting
19147 of this option.  Possible values are: @code{__RL78_MUL_NONE__},
19148 @code{__RL78_MUL_G13__} or @code{__RL78_MUL_G14__}.
19149
19150 @item -mcpu=g10
19151 @itemx -mcpu=g13
19152 @itemx -mcpu=g14
19153 @itemx -mcpu=rl78
19154 @opindex mcpu
19155 Specifies the RL78 core to target.  The default is the G14 core, also
19156 known as an S3 core or just RL78.  The G13 or S2 core does not have
19157 multiply or divide instructions, instead it uses a hardware peripheral
19158 for these operations.  The G10 or S1 core does not have register
19159 banks, so it uses a different calling convention.
19160
19161 If this option is set it also selects the type of hardware multiply
19162 support to use, unless this is overridden by an explicit
19163 @option{-mmul=none} option on the command line.  Thus specifying
19164 @option{-mcpu=g13} enables the use of the G13 hardware multiply
19165 peripheral and specifying @option{-mcpu=g10} disables the use of
19166 hardware multipications altogether.
19167
19168 Note, although the RL78/G14 core is the default target, specifying
19169 @option{-mcpu=g14} or @option{-mcpu=rl78} on the command line does
19170 change the behaviour of the toolchain since it also enables G14
19171 hardware multiply support.  If these options are not specified on the
19172 command line then software multiplication routines will be used even
19173 though the code targets the RL78 core.  This is for backwards
19174 compatibility with older toolchains which did not have hardware
19175 multiply and divide support.
19176
19177 In addition a C preprocessor macro is defined, based upon the setting
19178 of this option.  Possible values are: @code{__RL78_G10__},
19179 @code{__RL78_G13__} or @code{__RL78_G14__}.
19180
19181 @item -mg10
19182 @itemx -mg13
19183 @itemx -mg14
19184 @itemx -mrl78
19185 @opindex mg10
19186 @opindex mg13
19187 @opindex mg14
19188 @opindex mrl78
19189 These are aliases for the corresponding @option{-mcpu=} option.  They
19190 are provided for backwards compatibility.
19191
19192 @item -mallregs
19193 @opindex mallregs
19194 Allow the compiler to use all of the available registers.  By default
19195 registers @code{r24..r31} are reserved for use in interrupt handlers.
19196 With this option enabled these registers can be used in ordinary
19197 functions as well.
19198
19199 @item -m64bit-doubles
19200 @itemx -m32bit-doubles
19201 @opindex m64bit-doubles
19202 @opindex m32bit-doubles
19203 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
19204 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
19205 @option{-m32bit-doubles}.
19206
19207 @end table
19208
19209 @node RS/6000 and PowerPC Options
19210 @subsection IBM RS/6000 and PowerPC Options
19211 @cindex RS/6000 and PowerPC Options
19212 @cindex IBM RS/6000 and PowerPC Options
19213
19214 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
19215 @table @gcctabopt
19216 @item -mpowerpc-gpopt
19217 @itemx -mno-powerpc-gpopt
19218 @itemx -mpowerpc-gfxopt
19219 @itemx -mno-powerpc-gfxopt
19220 @need 800
19221 @itemx -mpowerpc64
19222 @itemx -mno-powerpc64
19223 @itemx -mmfcrf
19224 @itemx -mno-mfcrf
19225 @itemx -mpopcntb
19226 @itemx -mno-popcntb
19227 @itemx -mpopcntd
19228 @itemx -mno-popcntd
19229 @itemx -mfprnd
19230 @itemx -mno-fprnd
19231 @need 800
19232 @itemx -mcmpb
19233 @itemx -mno-cmpb
19234 @itemx -mmfpgpr
19235 @itemx -mno-mfpgpr
19236 @itemx -mhard-dfp
19237 @itemx -mno-hard-dfp
19238 @opindex mpowerpc-gpopt
19239 @opindex mno-powerpc-gpopt
19240 @opindex mpowerpc-gfxopt
19241 @opindex mno-powerpc-gfxopt
19242 @opindex mpowerpc64
19243 @opindex mno-powerpc64
19244 @opindex mmfcrf
19245 @opindex mno-mfcrf
19246 @opindex mpopcntb
19247 @opindex mno-popcntb
19248 @opindex mpopcntd
19249 @opindex mno-popcntd
19250 @opindex mfprnd
19251 @opindex mno-fprnd
19252 @opindex mcmpb
19253 @opindex mno-cmpb
19254 @opindex mmfpgpr
19255 @opindex mno-mfpgpr
19256 @opindex mhard-dfp
19257 @opindex mno-hard-dfp
19258 You use these options to specify which instructions are available on the
19259 processor you are using.  The default value of these options is
19260 determined when configuring GCC@.  Specifying the
19261 @option{-mcpu=@var{cpu_type}} overrides the specification of these
19262 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
19263 rather than the options listed above.
19264
19265 Specifying @option{-mpowerpc-gpopt} allows
19266 GCC to use the optional PowerPC architecture instructions in the
19267 General Purpose group, including floating-point square root.  Specifying
19268 @option{-mpowerpc-gfxopt} allows GCC to
19269 use the optional PowerPC architecture instructions in the Graphics
19270 group, including floating-point select.
19271
19272 The @option{-mmfcrf} option allows GCC to generate the move from
19273 condition register field instruction implemented on the POWER4
19274 processor and other processors that support the PowerPC V2.01
19275 architecture.
19276 The @option{-mpopcntb} option allows GCC to generate the popcount and
19277 double-precision FP reciprocal estimate instruction implemented on the
19278 POWER5 processor and other processors that support the PowerPC V2.02
19279 architecture.
19280 The @option{-mpopcntd} option allows GCC to generate the popcount
19281 instruction implemented on the POWER7 processor and other processors
19282 that support the PowerPC V2.06 architecture.
19283 The @option{-mfprnd} option allows GCC to generate the FP round to
19284 integer instructions implemented on the POWER5+ processor and other
19285 processors that support the PowerPC V2.03 architecture.
19286 The @option{-mcmpb} option allows GCC to generate the compare bytes
19287 instruction implemented on the POWER6 processor and other processors
19288 that support the PowerPC V2.05 architecture.
19289 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
19290 general-purpose register instructions implemented on the POWER6X
19291 processor and other processors that support the extended PowerPC V2.05
19292 architecture.
19293 The @option{-mhard-dfp} option allows GCC to generate the decimal
19294 floating-point instructions implemented on some POWER processors.
19295
19296 The @option{-mpowerpc64} option allows GCC to generate the additional
19297 64-bit instructions that are found in the full PowerPC64 architecture
19298 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
19299 @option{-mno-powerpc64}.
19300
19301 @item -mcpu=@var{cpu_type}
19302 @opindex mcpu
19303 Set architecture type, register usage, and
19304 instruction scheduling parameters for machine type @var{cpu_type}.
19305 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
19306 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
19307 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
19308 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
19309 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
19310 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
19311 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
19312 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
19313 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
19314 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8}, @samp{powerpc},
19315 @samp{powerpc64}, @samp{powerpc64le}, and @samp{rs64}.
19316
19317 @option{-mcpu=powerpc}, @option{-mcpu=powerpc64}, and
19318 @option{-mcpu=powerpc64le} specify pure 32-bit PowerPC (either
19319 endian), 64-bit big endian PowerPC and 64-bit little endian PowerPC
19320 architecture machine types, with an appropriate, generic processor
19321 model assumed for scheduling purposes.
19322
19323 The other options specify a specific processor.  Code generated under
19324 those options runs best on that processor, and may not run at all on
19325 others.
19326
19327 The @option{-mcpu} options automatically enable or disable the
19328 following options:
19329
19330 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
19331 -mpopcntb -mpopcntd  -mpowerpc64 @gol
19332 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
19333 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
19334 -mcrypto -mdirect-move -mpower8-fusion -mpower8-vector @gol
19335 -mquad-memory -mquad-memory-atomic}
19336
19337 The particular options set for any particular CPU varies between
19338 compiler versions, depending on what setting seems to produce optimal
19339 code for that CPU; it doesn't necessarily reflect the actual hardware's
19340 capabilities.  If you wish to set an individual option to a particular
19341 value, you may specify it after the @option{-mcpu} option, like
19342 @option{-mcpu=970 -mno-altivec}.
19343
19344 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
19345 not enabled or disabled by the @option{-mcpu} option at present because
19346 AIX does not have full support for these options.  You may still
19347 enable or disable them individually if you're sure it'll work in your
19348 environment.
19349
19350 @item -mtune=@var{cpu_type}
19351 @opindex mtune
19352 Set the instruction scheduling parameters for machine type
19353 @var{cpu_type}, but do not set the architecture type or register usage,
19354 as @option{-mcpu=@var{cpu_type}} does.  The same
19355 values for @var{cpu_type} are used for @option{-mtune} as for
19356 @option{-mcpu}.  If both are specified, the code generated uses the
19357 architecture and registers set by @option{-mcpu}, but the
19358 scheduling parameters set by @option{-mtune}.
19359
19360 @item -mcmodel=small
19361 @opindex mcmodel=small
19362 Generate PowerPC64 code for the small model: The TOC is limited to
19363 64k.
19364
19365 @item -mcmodel=medium
19366 @opindex mcmodel=medium
19367 Generate PowerPC64 code for the medium model: The TOC and other static
19368 data may be up to a total of 4G in size.
19369
19370 @item -mcmodel=large
19371 @opindex mcmodel=large
19372 Generate PowerPC64 code for the large model: The TOC may be up to 4G
19373 in size.  Other data and code is only limited by the 64-bit address
19374 space.
19375
19376 @item -maltivec
19377 @itemx -mno-altivec
19378 @opindex maltivec
19379 @opindex mno-altivec
19380 Generate code that uses (does not use) AltiVec instructions, and also
19381 enable the use of built-in functions that allow more direct access to
19382 the AltiVec instruction set.  You may also need to set
19383 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
19384 enhancements.
19385
19386 When @option{-maltivec} is used, rather than @option{-maltivec=le} or
19387 @option{-maltivec=be}, the element order for Altivec intrinsics such
19388 as @code{vec_splat}, @code{vec_extract}, and @code{vec_insert} 
19389 match array element order corresponding to the endianness of the
19390 target.  That is, element zero identifies the leftmost element in a
19391 vector register when targeting a big-endian platform, and identifies
19392 the rightmost element in a vector register when targeting a
19393 little-endian platform.
19394
19395 @item -maltivec=be
19396 @opindex maltivec=be
19397 Generate Altivec instructions using big-endian element order,
19398 regardless of whether the target is big- or little-endian.  This is
19399 the default when targeting a big-endian platform.
19400
19401 The element order is used to interpret element numbers in Altivec
19402 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
19403 @code{vec_insert}.  By default, these match array element order
19404 corresponding to the endianness for the target.
19405
19406 @item -maltivec=le
19407 @opindex maltivec=le
19408 Generate Altivec instructions using little-endian element order,
19409 regardless of whether the target is big- or little-endian.  This is
19410 the default when targeting a little-endian platform.  This option is
19411 currently ignored when targeting a big-endian platform.
19412
19413 The element order is used to interpret element numbers in Altivec
19414 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
19415 @code{vec_insert}.  By default, these match array element order
19416 corresponding to the endianness for the target.
19417
19418 @item -mvrsave
19419 @itemx -mno-vrsave
19420 @opindex mvrsave
19421 @opindex mno-vrsave
19422 Generate VRSAVE instructions when generating AltiVec code.
19423
19424 @item -mgen-cell-microcode
19425 @opindex mgen-cell-microcode
19426 Generate Cell microcode instructions.
19427
19428 @item -mwarn-cell-microcode
19429 @opindex mwarn-cell-microcode
19430 Warn when a Cell microcode instruction is emitted.  An example
19431 of a Cell microcode instruction is a variable shift.
19432
19433 @item -msecure-plt
19434 @opindex msecure-plt
19435 Generate code that allows @command{ld} and @command{ld.so}
19436 to build executables and shared
19437 libraries with non-executable @code{.plt} and @code{.got} sections.
19438 This is a PowerPC
19439 32-bit SYSV ABI option.
19440
19441 @item -mbss-plt
19442 @opindex mbss-plt
19443 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
19444 fills in, and
19445 requires @code{.plt} and @code{.got}
19446 sections that are both writable and executable.
19447 This is a PowerPC 32-bit SYSV ABI option.
19448
19449 @item -misel
19450 @itemx -mno-isel
19451 @opindex misel
19452 @opindex mno-isel
19453 This switch enables or disables the generation of ISEL instructions.
19454
19455 @item -misel=@var{yes/no}
19456 This switch has been deprecated.  Use @option{-misel} and
19457 @option{-mno-isel} instead.
19458
19459 @item -mspe
19460 @itemx -mno-spe
19461 @opindex mspe
19462 @opindex mno-spe
19463 This switch enables or disables the generation of SPE simd
19464 instructions.
19465
19466 @item -mpaired
19467 @itemx -mno-paired
19468 @opindex mpaired
19469 @opindex mno-paired
19470 This switch enables or disables the generation of PAIRED simd
19471 instructions.
19472
19473 @item -mspe=@var{yes/no}
19474 This option has been deprecated.  Use @option{-mspe} and
19475 @option{-mno-spe} instead.
19476
19477 @item -mvsx
19478 @itemx -mno-vsx
19479 @opindex mvsx
19480 @opindex mno-vsx
19481 Generate code that uses (does not use) vector/scalar (VSX)
19482 instructions, and also enable the use of built-in functions that allow
19483 more direct access to the VSX instruction set.
19484
19485 @item -mcrypto
19486 @itemx -mno-crypto
19487 @opindex mcrypto
19488 @opindex mno-crypto
19489 Enable the use (disable) of the built-in functions that allow direct
19490 access to the cryptographic instructions that were added in version
19491 2.07 of the PowerPC ISA.
19492
19493 @item -mdirect-move
19494 @itemx -mno-direct-move
19495 @opindex mdirect-move
19496 @opindex mno-direct-move
19497 Generate code that uses (does not use) the instructions to move data
19498 between the general purpose registers and the vector/scalar (VSX)
19499 registers that were added in version 2.07 of the PowerPC ISA.
19500
19501 @item -mpower8-fusion
19502 @itemx -mno-power8-fusion
19503 @opindex mpower8-fusion
19504 @opindex mno-power8-fusion
19505 Generate code that keeps (does not keeps) some integer operations
19506 adjacent so that the instructions can be fused together on power8 and
19507 later processors.
19508
19509 @item -mpower8-vector
19510 @itemx -mno-power8-vector
19511 @opindex mpower8-vector
19512 @opindex mno-power8-vector
19513 Generate code that uses (does not use) the vector and scalar
19514 instructions that were added in version 2.07 of the PowerPC ISA.  Also
19515 enable the use of built-in functions that allow more direct access to
19516 the vector instructions.
19517
19518 @item -mquad-memory
19519 @itemx -mno-quad-memory
19520 @opindex mquad-memory
19521 @opindex mno-quad-memory
19522 Generate code that uses (does not use) the non-atomic quad word memory
19523 instructions.  The @option{-mquad-memory} option requires use of
19524 64-bit mode.
19525
19526 @item -mquad-memory-atomic
19527 @itemx -mno-quad-memory-atomic
19528 @opindex mquad-memory-atomic
19529 @opindex mno-quad-memory-atomic
19530 Generate code that uses (does not use) the atomic quad word memory
19531 instructions.  The @option{-mquad-memory-atomic} option requires use of
19532 64-bit mode.
19533
19534 @item -mupper-regs-df
19535 @itemx -mno-upper-regs-df
19536 @opindex mupper-regs-df
19537 @opindex mno-upper-regs-df
19538 Generate code that uses (does not use) the scalar double precision
19539 instructions that target all 64 registers in the vector/scalar
19540 floating point register set that were added in version 2.06 of the
19541 PowerPC ISA.  @option{-mupper-regs-df} is turned on by default if you
19542 use any of the @option{-mcpu=power7}, @option{-mcpu=power8}, or
19543 @option{-mvsx} options.
19544
19545 @item -mupper-regs-sf
19546 @itemx -mno-upper-regs-sf
19547 @opindex mupper-regs-sf
19548 @opindex mno-upper-regs-sf
19549 Generate code that uses (does not use) the scalar single precision
19550 instructions that target all 64 registers in the vector/scalar
19551 floating point register set that were added in version 2.07 of the
19552 PowerPC ISA.  @option{-mupper-regs-sf} is turned on by default if you
19553 use either of the @option{-mcpu=power8} or @option{-mpower8-vector}
19554 options.
19555
19556 @item -mupper-regs
19557 @itemx -mno-upper-regs
19558 @opindex mupper-regs
19559 @opindex mno-upper-regs
19560 Generate code that uses (does not use) the scalar
19561 instructions that target all 64 registers in the vector/scalar
19562 floating point register set, depending on the model of the machine.
19563
19564 If the @option{-mno-upper-regs} option is used, it turns off both
19565 @option{-mupper-regs-sf} and @option{-mupper-regs-df} options.
19566
19567 @item -mfloat128
19568 @itemx -mno-float128
19569 @opindex mfloat128
19570 @opindex mno-float128
19571 Enable/disable the @var{__float128} keyword for IEEE 128-bit floating point
19572 and use software emulation for IEEE 128-bit floating point.
19573
19574 The VSX instruction set (@option{-mvsx}, @option{-mcpu=power7}, or
19575 @option{-mcpu=power8}) must be enabled to use the @option{-mfloat128}
19576 option.
19577
19578 @item -mfloat-gprs=@var{yes/single/double/no}
19579 @itemx -mfloat-gprs
19580 @opindex mfloat-gprs
19581 This switch enables or disables the generation of floating-point
19582 operations on the general-purpose registers for architectures that
19583 support it.
19584
19585 The argument @samp{yes} or @samp{single} enables the use of
19586 single-precision floating-point operations.
19587
19588 The argument @samp{double} enables the use of single and
19589 double-precision floating-point operations.
19590
19591 The argument @samp{no} disables floating-point operations on the
19592 general-purpose registers.
19593
19594 This option is currently only available on the MPC854x.
19595
19596 @item -m32
19597 @itemx -m64
19598 @opindex m32
19599 @opindex m64
19600 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
19601 targets (including GNU/Linux).  The 32-bit environment sets int, long
19602 and pointer to 32 bits and generates code that runs on any PowerPC
19603 variant.  The 64-bit environment sets int to 32 bits and long and
19604 pointer to 64 bits, and generates code for PowerPC64, as for
19605 @option{-mpowerpc64}.
19606
19607 @item -mfull-toc
19608 @itemx -mno-fp-in-toc
19609 @itemx -mno-sum-in-toc
19610 @itemx -mminimal-toc
19611 @opindex mfull-toc
19612 @opindex mno-fp-in-toc
19613 @opindex mno-sum-in-toc
19614 @opindex mminimal-toc
19615 Modify generation of the TOC (Table Of Contents), which is created for
19616 every executable file.  The @option{-mfull-toc} option is selected by
19617 default.  In that case, GCC allocates at least one TOC entry for
19618 each unique non-automatic variable reference in your program.  GCC
19619 also places floating-point constants in the TOC@.  However, only
19620 16,384 entries are available in the TOC@.
19621
19622 If you receive a linker error message that saying you have overflowed
19623 the available TOC space, you can reduce the amount of TOC space used
19624 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
19625 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
19626 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
19627 generate code to calculate the sum of an address and a constant at
19628 run time instead of putting that sum into the TOC@.  You may specify one
19629 or both of these options.  Each causes GCC to produce very slightly
19630 slower and larger code at the expense of conserving TOC space.
19631
19632 If you still run out of space in the TOC even when you specify both of
19633 these options, specify @option{-mminimal-toc} instead.  This option causes
19634 GCC to make only one TOC entry for every file.  When you specify this
19635 option, GCC produces code that is slower and larger but which
19636 uses extremely little TOC space.  You may wish to use this option
19637 only on files that contain less frequently-executed code.
19638
19639 @item -maix64
19640 @itemx -maix32
19641 @opindex maix64
19642 @opindex maix32
19643 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
19644 @code{long} type, and the infrastructure needed to support them.
19645 Specifying @option{-maix64} implies @option{-mpowerpc64},
19646 while @option{-maix32} disables the 64-bit ABI and
19647 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
19648
19649 @item -mxl-compat
19650 @itemx -mno-xl-compat
19651 @opindex mxl-compat
19652 @opindex mno-xl-compat
19653 Produce code that conforms more closely to IBM XL compiler semantics
19654 when using AIX-compatible ABI@.  Pass floating-point arguments to
19655 prototyped functions beyond the register save area (RSA) on the stack
19656 in addition to argument FPRs.  Do not assume that most significant
19657 double in 128-bit long double value is properly rounded when comparing
19658 values and converting to double.  Use XL symbol names for long double
19659 support routines.
19660
19661 The AIX calling convention was extended but not initially documented to
19662 handle an obscure K&R C case of calling a function that takes the
19663 address of its arguments with fewer arguments than declared.  IBM XL
19664 compilers access floating-point arguments that do not fit in the
19665 RSA from the stack when a subroutine is compiled without
19666 optimization.  Because always storing floating-point arguments on the
19667 stack is inefficient and rarely needed, this option is not enabled by
19668 default and only is necessary when calling subroutines compiled by IBM
19669 XL compilers without optimization.
19670
19671 @item -mpe
19672 @opindex mpe
19673 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
19674 application written to use message passing with special startup code to
19675 enable the application to run.  The system must have PE installed in the
19676 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
19677 must be overridden with the @option{-specs=} option to specify the
19678 appropriate directory location.  The Parallel Environment does not
19679 support threads, so the @option{-mpe} option and the @option{-pthread}
19680 option are incompatible.
19681
19682 @item -malign-natural
19683 @itemx -malign-power
19684 @opindex malign-natural
19685 @opindex malign-power
19686 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
19687 @option{-malign-natural} overrides the ABI-defined alignment of larger
19688 types, such as floating-point doubles, on their natural size-based boundary.
19689 The option @option{-malign-power} instructs GCC to follow the ABI-specified
19690 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
19691
19692 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
19693 is not supported.
19694
19695 @item -msoft-float
19696 @itemx -mhard-float
19697 @opindex msoft-float
19698 @opindex mhard-float
19699 Generate code that does not use (uses) the floating-point register set.
19700 Software floating-point emulation is provided if you use the
19701 @option{-msoft-float} option, and pass the option to GCC when linking.
19702
19703 @item -msingle-float
19704 @itemx -mdouble-float
19705 @opindex msingle-float
19706 @opindex mdouble-float
19707 Generate code for single- or double-precision floating-point operations.
19708 @option{-mdouble-float} implies @option{-msingle-float}.
19709
19710 @item -msimple-fpu
19711 @opindex msimple-fpu
19712 Do not generate @code{sqrt} and @code{div} instructions for hardware
19713 floating-point unit.
19714
19715 @item -mfpu=@var{name}
19716 @opindex mfpu
19717 Specify type of floating-point unit.  Valid values for @var{name} are
19718 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
19719 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
19720 @samp{sp_full} (equivalent to @option{-msingle-float}),
19721 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
19722
19723 @item -mxilinx-fpu
19724 @opindex mxilinx-fpu
19725 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
19726
19727 @item -mmultiple
19728 @itemx -mno-multiple
19729 @opindex mmultiple
19730 @opindex mno-multiple
19731 Generate code that uses (does not use) the load multiple word
19732 instructions and the store multiple word instructions.  These
19733 instructions are generated by default on POWER systems, and not
19734 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
19735 PowerPC systems, since those instructions do not work when the
19736 processor is in little-endian mode.  The exceptions are PPC740 and
19737 PPC750 which permit these instructions in little-endian mode.
19738
19739 @item -mstring
19740 @itemx -mno-string
19741 @opindex mstring
19742 @opindex mno-string
19743 Generate code that uses (does not use) the load string instructions
19744 and the store string word instructions to save multiple registers and
19745 do small block moves.  These instructions are generated by default on
19746 POWER systems, and not generated on PowerPC systems.  Do not use
19747 @option{-mstring} on little-endian PowerPC systems, since those
19748 instructions do not work when the processor is in little-endian mode.
19749 The exceptions are PPC740 and PPC750 which permit these instructions
19750 in little-endian mode.
19751
19752 @item -mupdate
19753 @itemx -mno-update
19754 @opindex mupdate
19755 @opindex mno-update
19756 Generate code that uses (does not use) the load or store instructions
19757 that update the base register to the address of the calculated memory
19758 location.  These instructions are generated by default.  If you use
19759 @option{-mno-update}, there is a small window between the time that the
19760 stack pointer is updated and the address of the previous frame is
19761 stored, which means code that walks the stack frame across interrupts or
19762 signals may get corrupted data.
19763
19764 @item -mavoid-indexed-addresses
19765 @itemx -mno-avoid-indexed-addresses
19766 @opindex mavoid-indexed-addresses
19767 @opindex mno-avoid-indexed-addresses
19768 Generate code that tries to avoid (not avoid) the use of indexed load
19769 or store instructions. These instructions can incur a performance
19770 penalty on Power6 processors in certain situations, such as when
19771 stepping through large arrays that cross a 16M boundary.  This option
19772 is enabled by default when targeting Power6 and disabled otherwise.
19773
19774 @item -mfused-madd
19775 @itemx -mno-fused-madd
19776 @opindex mfused-madd
19777 @opindex mno-fused-madd
19778 Generate code that uses (does not use) the floating-point multiply and
19779 accumulate instructions.  These instructions are generated by default
19780 if hardware floating point is used.  The machine-dependent
19781 @option{-mfused-madd} option is now mapped to the machine-independent
19782 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
19783 mapped to @option{-ffp-contract=off}.
19784
19785 @item -mmulhw
19786 @itemx -mno-mulhw
19787 @opindex mmulhw
19788 @opindex mno-mulhw
19789 Generate code that uses (does not use) the half-word multiply and
19790 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
19791 These instructions are generated by default when targeting those
19792 processors.
19793
19794 @item -mdlmzb
19795 @itemx -mno-dlmzb
19796 @opindex mdlmzb
19797 @opindex mno-dlmzb
19798 Generate code that uses (does not use) the string-search @samp{dlmzb}
19799 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
19800 generated by default when targeting those processors.
19801
19802 @item -mno-bit-align
19803 @itemx -mbit-align
19804 @opindex mno-bit-align
19805 @opindex mbit-align
19806 On System V.4 and embedded PowerPC systems do not (do) force structures
19807 and unions that contain bit-fields to be aligned to the base type of the
19808 bit-field.
19809
19810 For example, by default a structure containing nothing but 8
19811 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
19812 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
19813 the structure is aligned to a 1-byte boundary and is 1 byte in
19814 size.
19815
19816 @item -mno-strict-align
19817 @itemx -mstrict-align
19818 @opindex mno-strict-align
19819 @opindex mstrict-align
19820 On System V.4 and embedded PowerPC systems do not (do) assume that
19821 unaligned memory references are handled by the system.
19822
19823 @item -mrelocatable
19824 @itemx -mno-relocatable
19825 @opindex mrelocatable
19826 @opindex mno-relocatable
19827 Generate code that allows (does not allow) a static executable to be
19828 relocated to a different address at run time.  A simple embedded
19829 PowerPC system loader should relocate the entire contents of
19830 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
19831 a table of 32-bit addresses generated by this option.  For this to
19832 work, all objects linked together must be compiled with
19833 @option{-mrelocatable} or @option{-mrelocatable-lib}.
19834 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
19835
19836 @item -mrelocatable-lib
19837 @itemx -mno-relocatable-lib
19838 @opindex mrelocatable-lib
19839 @opindex mno-relocatable-lib
19840 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
19841 @code{.fixup} section to allow static executables to be relocated at
19842 run time, but @option{-mrelocatable-lib} does not use the smaller stack
19843 alignment of @option{-mrelocatable}.  Objects compiled with
19844 @option{-mrelocatable-lib} may be linked with objects compiled with
19845 any combination of the @option{-mrelocatable} options.
19846
19847 @item -mno-toc
19848 @itemx -mtoc
19849 @opindex mno-toc
19850 @opindex mtoc
19851 On System V.4 and embedded PowerPC systems do not (do) assume that
19852 register 2 contains a pointer to a global area pointing to the addresses
19853 used in the program.
19854
19855 @item -mlittle
19856 @itemx -mlittle-endian
19857 @opindex mlittle
19858 @opindex mlittle-endian
19859 On System V.4 and embedded PowerPC systems compile code for the
19860 processor in little-endian mode.  The @option{-mlittle-endian} option is
19861 the same as @option{-mlittle}.
19862
19863 @item -mbig
19864 @itemx -mbig-endian
19865 @opindex mbig
19866 @opindex mbig-endian
19867 On System V.4 and embedded PowerPC systems compile code for the
19868 processor in big-endian mode.  The @option{-mbig-endian} option is
19869 the same as @option{-mbig}.
19870
19871 @item -mdynamic-no-pic
19872 @opindex mdynamic-no-pic
19873 On Darwin and Mac OS X systems, compile code so that it is not
19874 relocatable, but that its external references are relocatable.  The
19875 resulting code is suitable for applications, but not shared
19876 libraries.
19877
19878 @item -msingle-pic-base
19879 @opindex msingle-pic-base
19880 Treat the register used for PIC addressing as read-only, rather than
19881 loading it in the prologue for each function.  The runtime system is
19882 responsible for initializing this register with an appropriate value
19883 before execution begins.
19884
19885 @item -mprioritize-restricted-insns=@var{priority}
19886 @opindex mprioritize-restricted-insns
19887 This option controls the priority that is assigned to
19888 dispatch-slot restricted instructions during the second scheduling
19889 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
19890 or @samp{2} to assign no, highest, or second-highest (respectively) 
19891 priority to dispatch-slot restricted
19892 instructions.
19893
19894 @item -msched-costly-dep=@var{dependence_type}
19895 @opindex msched-costly-dep
19896 This option controls which dependences are considered costly
19897 by the target during instruction scheduling.  The argument
19898 @var{dependence_type} takes one of the following values:
19899
19900 @table @asis
19901 @item @samp{no}
19902 No dependence is costly.
19903
19904 @item @samp{all}
19905 All dependences are costly.
19906
19907 @item @samp{true_store_to_load}
19908 A true dependence from store to load is costly.
19909
19910 @item @samp{store_to_load}
19911 Any dependence from store to load is costly.
19912
19913 @item @var{number}
19914 Any dependence for which the latency is greater than or equal to 
19915 @var{number} is costly.
19916 @end table
19917
19918 @item -minsert-sched-nops=@var{scheme}
19919 @opindex minsert-sched-nops
19920 This option controls which NOP insertion scheme is used during
19921 the second scheduling pass.  The argument @var{scheme} takes one of the
19922 following values:
19923
19924 @table @asis
19925 @item @samp{no}
19926 Don't insert NOPs.
19927
19928 @item @samp{pad}
19929 Pad with NOPs any dispatch group that has vacant issue slots,
19930 according to the scheduler's grouping.
19931
19932 @item @samp{regroup_exact}
19933 Insert NOPs to force costly dependent insns into
19934 separate groups.  Insert exactly as many NOPs as needed to force an insn
19935 to a new group, according to the estimated processor grouping.
19936
19937 @item @var{number}
19938 Insert NOPs to force costly dependent insns into
19939 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
19940 @end table
19941
19942 @item -mcall-sysv
19943 @opindex mcall-sysv
19944 On System V.4 and embedded PowerPC systems compile code using calling
19945 conventions that adhere to the March 1995 draft of the System V
19946 Application Binary Interface, PowerPC processor supplement.  This is the
19947 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
19948
19949 @item -mcall-sysv-eabi
19950 @itemx -mcall-eabi
19951 @opindex mcall-sysv-eabi
19952 @opindex mcall-eabi
19953 Specify both @option{-mcall-sysv} and @option{-meabi} options.
19954
19955 @item -mcall-sysv-noeabi
19956 @opindex mcall-sysv-noeabi
19957 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
19958
19959 @item -mcall-aixdesc
19960 @opindex m
19961 On System V.4 and embedded PowerPC systems compile code for the AIX
19962 operating system.
19963
19964 @item -mcall-linux
19965 @opindex mcall-linux
19966 On System V.4 and embedded PowerPC systems compile code for the
19967 Linux-based GNU system.
19968
19969 @item -mcall-freebsd
19970 @opindex mcall-freebsd
19971 On System V.4 and embedded PowerPC systems compile code for the
19972 FreeBSD operating system.
19973
19974 @item -mcall-netbsd
19975 @opindex mcall-netbsd
19976 On System V.4 and embedded PowerPC systems compile code for the
19977 NetBSD operating system.
19978
19979 @item -mcall-openbsd
19980 @opindex mcall-netbsd
19981 On System V.4 and embedded PowerPC systems compile code for the
19982 OpenBSD operating system.
19983
19984 @item -maix-struct-return
19985 @opindex maix-struct-return
19986 Return all structures in memory (as specified by the AIX ABI)@.
19987
19988 @item -msvr4-struct-return
19989 @opindex msvr4-struct-return
19990 Return structures smaller than 8 bytes in registers (as specified by the
19991 SVR4 ABI)@.
19992
19993 @item -mabi=@var{abi-type}
19994 @opindex mabi
19995 Extend the current ABI with a particular extension, or remove such extension.
19996 Valid values are @samp{altivec}, @samp{no-altivec}, @samp{spe},
19997 @samp{no-spe}, @samp{ibmlongdouble}, @samp{ieeelongdouble},
19998 @samp{elfv1}, @samp{elfv2}@.
19999
20000 @item -mabi=spe
20001 @opindex mabi=spe
20002 Extend the current ABI with SPE ABI extensions.  This does not change
20003 the default ABI, instead it adds the SPE ABI extensions to the current
20004 ABI@.
20005
20006 @item -mabi=no-spe
20007 @opindex mabi=no-spe
20008 Disable Book-E SPE ABI extensions for the current ABI@.
20009
20010 @item -mabi=ibmlongdouble
20011 @opindex mabi=ibmlongdouble
20012 Change the current ABI to use IBM extended-precision long double.
20013 This is a PowerPC 32-bit SYSV ABI option.
20014
20015 @item -mabi=ieeelongdouble
20016 @opindex mabi=ieeelongdouble
20017 Change the current ABI to use IEEE extended-precision long double.
20018 This is a PowerPC 32-bit Linux ABI option.
20019
20020 @item -mabi=elfv1
20021 @opindex mabi=elfv1
20022 Change the current ABI to use the ELFv1 ABI.
20023 This is the default ABI for big-endian PowerPC 64-bit Linux.
20024 Overriding the default ABI requires special system support and is
20025 likely to fail in spectacular ways.
20026
20027 @item -mabi=elfv2
20028 @opindex mabi=elfv2
20029 Change the current ABI to use the ELFv2 ABI.
20030 This is the default ABI for little-endian PowerPC 64-bit Linux.
20031 Overriding the default ABI requires special system support and is
20032 likely to fail in spectacular ways.
20033
20034 @item -mprototype
20035 @itemx -mno-prototype
20036 @opindex mprototype
20037 @opindex mno-prototype
20038 On System V.4 and embedded PowerPC systems assume that all calls to
20039 variable argument functions are properly prototyped.  Otherwise, the
20040 compiler must insert an instruction before every non-prototyped call to
20041 set or clear bit 6 of the condition code register (@code{CR}) to
20042 indicate whether floating-point values are passed in the floating-point
20043 registers in case the function takes variable arguments.  With
20044 @option{-mprototype}, only calls to prototyped variable argument functions
20045 set or clear the bit.
20046
20047 @item -msim
20048 @opindex msim
20049 On embedded PowerPC systems, assume that the startup module is called
20050 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
20051 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
20052 configurations.
20053
20054 @item -mmvme
20055 @opindex mmvme
20056 On embedded PowerPC systems, assume that the startup module is called
20057 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
20058 @file{libc.a}.
20059
20060 @item -mads
20061 @opindex mads
20062 On embedded PowerPC systems, assume that the startup module is called
20063 @file{crt0.o} and the standard C libraries are @file{libads.a} and
20064 @file{libc.a}.
20065
20066 @item -myellowknife
20067 @opindex myellowknife
20068 On embedded PowerPC systems, assume that the startup module is called
20069 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
20070 @file{libc.a}.
20071
20072 @item -mvxworks
20073 @opindex mvxworks
20074 On System V.4 and embedded PowerPC systems, specify that you are
20075 compiling for a VxWorks system.
20076
20077 @item -memb
20078 @opindex memb
20079 On embedded PowerPC systems, set the @code{PPC_EMB} bit in the ELF flags
20080 header to indicate that @samp{eabi} extended relocations are used.
20081
20082 @item -meabi
20083 @itemx -mno-eabi
20084 @opindex meabi
20085 @opindex mno-eabi
20086 On System V.4 and embedded PowerPC systems do (do not) adhere to the
20087 Embedded Applications Binary Interface (EABI), which is a set of
20088 modifications to the System V.4 specifications.  Selecting @option{-meabi}
20089 means that the stack is aligned to an 8-byte boundary, a function
20090 @code{__eabi} is called from @code{main} to set up the EABI
20091 environment, and the @option{-msdata} option can use both @code{r2} and
20092 @code{r13} to point to two separate small data areas.  Selecting
20093 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
20094 no EABI initialization function is called from @code{main}, and the
20095 @option{-msdata} option only uses @code{r13} to point to a single
20096 small data area.  The @option{-meabi} option is on by default if you
20097 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
20098
20099 @item -msdata=eabi
20100 @opindex msdata=eabi
20101 On System V.4 and embedded PowerPC systems, put small initialized
20102 @code{const} global and static data in the @code{.sdata2} section, which
20103 is pointed to by register @code{r2}.  Put small initialized
20104 non-@code{const} global and static data in the @code{.sdata} section,
20105 which is pointed to by register @code{r13}.  Put small uninitialized
20106 global and static data in the @code{.sbss} section, which is adjacent to
20107 the @code{.sdata} section.  The @option{-msdata=eabi} option is
20108 incompatible with the @option{-mrelocatable} option.  The
20109 @option{-msdata=eabi} option also sets the @option{-memb} option.
20110
20111 @item -msdata=sysv
20112 @opindex msdata=sysv
20113 On System V.4 and embedded PowerPC systems, put small global and static
20114 data in the @code{.sdata} section, which is pointed to by register
20115 @code{r13}.  Put small uninitialized global and static data in the
20116 @code{.sbss} section, which is adjacent to the @code{.sdata} section.
20117 The @option{-msdata=sysv} option is incompatible with the
20118 @option{-mrelocatable} option.
20119
20120 @item -msdata=default
20121 @itemx -msdata
20122 @opindex msdata=default
20123 @opindex msdata
20124 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
20125 compile code the same as @option{-msdata=eabi}, otherwise compile code the
20126 same as @option{-msdata=sysv}.
20127
20128 @item -msdata=data
20129 @opindex msdata=data
20130 On System V.4 and embedded PowerPC systems, put small global
20131 data in the @code{.sdata} section.  Put small uninitialized global
20132 data in the @code{.sbss} section.  Do not use register @code{r13}
20133 to address small data however.  This is the default behavior unless
20134 other @option{-msdata} options are used.
20135
20136 @item -msdata=none
20137 @itemx -mno-sdata
20138 @opindex msdata=none
20139 @opindex mno-sdata
20140 On embedded PowerPC systems, put all initialized global and static data
20141 in the @code{.data} section, and all uninitialized data in the
20142 @code{.bss} section.
20143
20144 @item -mblock-move-inline-limit=@var{num}
20145 @opindex mblock-move-inline-limit
20146 Inline all block moves (such as calls to @code{memcpy} or structure
20147 copies) less than or equal to @var{num} bytes.  The minimum value for
20148 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
20149 targets.  The default value is target-specific.
20150
20151 @item -G @var{num}
20152 @opindex G
20153 @cindex smaller data references (PowerPC)
20154 @cindex .sdata/.sdata2 references (PowerPC)
20155 On embedded PowerPC systems, put global and static items less than or
20156 equal to @var{num} bytes into the small data or BSS sections instead of
20157 the normal data or BSS section.  By default, @var{num} is 8.  The
20158 @option{-G @var{num}} switch is also passed to the linker.
20159 All modules should be compiled with the same @option{-G @var{num}} value.
20160
20161 @item -mregnames
20162 @itemx -mno-regnames
20163 @opindex mregnames
20164 @opindex mno-regnames
20165 On System V.4 and embedded PowerPC systems do (do not) emit register
20166 names in the assembly language output using symbolic forms.
20167
20168 @item -mlongcall
20169 @itemx -mno-longcall
20170 @opindex mlongcall
20171 @opindex mno-longcall
20172 By default assume that all calls are far away so that a longer and more
20173 expensive calling sequence is required.  This is required for calls
20174 farther than 32 megabytes (33,554,432 bytes) from the current location.
20175 A short call is generated if the compiler knows
20176 the call cannot be that far away.  This setting can be overridden by
20177 the @code{shortcall} function attribute, or by @code{#pragma
20178 longcall(0)}.
20179
20180 Some linkers are capable of detecting out-of-range calls and generating
20181 glue code on the fly.  On these systems, long calls are unnecessary and
20182 generate slower code.  As of this writing, the AIX linker can do this,
20183 as can the GNU linker for PowerPC/64.  It is planned to add this feature
20184 to the GNU linker for 32-bit PowerPC systems as well.
20185
20186 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
20187 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
20188 addresses represent the callee and the branch island.  The
20189 Darwin/PPC linker prefers the first address and generates a @code{bl
20190 callee} if the PPC @code{bl} instruction reaches the callee directly;
20191 otherwise, the linker generates @code{bl L42} to call the branch
20192 island.  The branch island is appended to the body of the
20193 calling function; it computes the full 32-bit address of the callee
20194 and jumps to it.
20195
20196 On Mach-O (Darwin) systems, this option directs the compiler emit to
20197 the glue for every direct call, and the Darwin linker decides whether
20198 to use or discard it.
20199
20200 In the future, GCC may ignore all longcall specifications
20201 when the linker is known to generate glue.
20202
20203 @item -mtls-markers
20204 @itemx -mno-tls-markers
20205 @opindex mtls-markers
20206 @opindex mno-tls-markers
20207 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
20208 specifying the function argument.  The relocation allows the linker to
20209 reliably associate function call with argument setup instructions for
20210 TLS optimization, which in turn allows GCC to better schedule the
20211 sequence.
20212
20213 @item -pthread
20214 @opindex pthread
20215 Adds support for multithreading with the @dfn{pthreads} library.
20216 This option sets flags for both the preprocessor and linker.
20217
20218 @item -mrecip
20219 @itemx -mno-recip
20220 @opindex mrecip
20221 This option enables use of the reciprocal estimate and
20222 reciprocal square root estimate instructions with additional
20223 Newton-Raphson steps to increase precision instead of doing a divide or
20224 square root and divide for floating-point arguments.  You should use
20225 the @option{-ffast-math} option when using @option{-mrecip} (or at
20226 least @option{-funsafe-math-optimizations},
20227 @option{-finite-math-only}, @option{-freciprocal-math} and
20228 @option{-fno-trapping-math}).  Note that while the throughput of the
20229 sequence is generally higher than the throughput of the non-reciprocal
20230 instruction, the precision of the sequence can be decreased by up to 2
20231 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
20232 roots.
20233
20234 @item -mrecip=@var{opt}
20235 @opindex mrecip=opt
20236 This option controls which reciprocal estimate instructions
20237 may be used.  @var{opt} is a comma-separated list of options, which may
20238 be preceded by a @code{!} to invert the option:
20239
20240 @table @samp
20241
20242 @item all
20243 Enable all estimate instructions.
20244
20245 @item default 
20246 Enable the default instructions, equivalent to @option{-mrecip}.
20247
20248 @item none 
20249 Disable all estimate instructions, equivalent to @option{-mno-recip}.
20250
20251 @item div 
20252 Enable the reciprocal approximation instructions for both 
20253 single and double precision.
20254
20255 @item divf 
20256 Enable the single-precision reciprocal approximation instructions.
20257
20258 @item divd 
20259 Enable the double-precision reciprocal approximation instructions.
20260
20261 @item rsqrt 
20262 Enable the reciprocal square root approximation instructions for both
20263 single and double precision.
20264
20265 @item rsqrtf 
20266 Enable the single-precision reciprocal square root approximation instructions.
20267
20268 @item rsqrtd 
20269 Enable the double-precision reciprocal square root approximation instructions.
20270
20271 @end table
20272
20273 So, for example, @option{-mrecip=all,!rsqrtd} enables
20274 all of the reciprocal estimate instructions, except for the
20275 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
20276 which handle the double-precision reciprocal square root calculations.
20277
20278 @item -mrecip-precision
20279 @itemx -mno-recip-precision
20280 @opindex mrecip-precision
20281 Assume (do not assume) that the reciprocal estimate instructions
20282 provide higher-precision estimates than is mandated by the PowerPC
20283 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
20284 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
20285 The double-precision square root estimate instructions are not generated by
20286 default on low-precision machines, since they do not provide an
20287 estimate that converges after three steps.
20288
20289 @item -mveclibabi=@var{type}
20290 @opindex mveclibabi
20291 Specifies the ABI type to use for vectorizing intrinsics using an
20292 external library.  The only type supported at present is @samp{mass},
20293 which specifies to use IBM's Mathematical Acceleration Subsystem
20294 (MASS) libraries for vectorizing intrinsics using external libraries.
20295 GCC currently emits calls to @code{acosd2}, @code{acosf4},
20296 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
20297 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
20298 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
20299 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
20300 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
20301 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
20302 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
20303 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
20304 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
20305 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
20306 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
20307 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
20308 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
20309 for power7.  Both @option{-ftree-vectorize} and
20310 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
20311 libraries must be specified at link time.
20312
20313 @item -mfriz
20314 @itemx -mno-friz
20315 @opindex mfriz
20316 Generate (do not generate) the @code{friz} instruction when the
20317 @option{-funsafe-math-optimizations} option is used to optimize
20318 rounding of floating-point values to 64-bit integer and back to floating
20319 point.  The @code{friz} instruction does not return the same value if
20320 the floating-point number is too large to fit in an integer.
20321
20322 @item -mpointers-to-nested-functions
20323 @itemx -mno-pointers-to-nested-functions
20324 @opindex mpointers-to-nested-functions
20325 Generate (do not generate) code to load up the static chain register
20326 (@code{r11}) when calling through a pointer on AIX and 64-bit Linux
20327 systems where a function pointer points to a 3-word descriptor giving
20328 the function address, TOC value to be loaded in register @code{r2}, and
20329 static chain value to be loaded in register @code{r11}.  The
20330 @option{-mpointers-to-nested-functions} is on by default.  You cannot
20331 call through pointers to nested functions or pointers
20332 to functions compiled in other languages that use the static chain if
20333 you use @option{-mno-pointers-to-nested-functions}.
20334
20335 @item -msave-toc-indirect
20336 @itemx -mno-save-toc-indirect
20337 @opindex msave-toc-indirect
20338 Generate (do not generate) code to save the TOC value in the reserved
20339 stack location in the function prologue if the function calls through
20340 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
20341 saved in the prologue, it is saved just before the call through the
20342 pointer.  The @option{-mno-save-toc-indirect} option is the default.
20343
20344 @item -mcompat-align-parm
20345 @itemx -mno-compat-align-parm
20346 @opindex mcompat-align-parm
20347 Generate (do not generate) code to pass structure parameters with a
20348 maximum alignment of 64 bits, for compatibility with older versions
20349 of GCC.
20350
20351 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
20352 structure parameter on a 128-bit boundary when that structure contained
20353 a member requiring 128-bit alignment.  This is corrected in more
20354 recent versions of GCC.  This option may be used to generate code
20355 that is compatible with functions compiled with older versions of
20356 GCC.
20357
20358 The @option{-mno-compat-align-parm} option is the default.
20359 @end table
20360
20361 @node RX Options
20362 @subsection RX Options
20363 @cindex RX Options
20364
20365 These command-line options are defined for RX targets:
20366
20367 @table @gcctabopt
20368 @item -m64bit-doubles
20369 @itemx -m32bit-doubles
20370 @opindex m64bit-doubles
20371 @opindex m32bit-doubles
20372 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
20373 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
20374 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
20375 works on 32-bit values, which is why the default is
20376 @option{-m32bit-doubles}.
20377
20378 @item -fpu
20379 @itemx -nofpu
20380 @opindex fpu
20381 @opindex nofpu
20382 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
20383 floating-point hardware.  The default is enabled for the RX600
20384 series and disabled for the RX200 series.
20385
20386 Floating-point instructions are only generated for 32-bit floating-point 
20387 values, however, so the FPU hardware is not used for doubles if the
20388 @option{-m64bit-doubles} option is used.
20389
20390 @emph{Note} If the @option{-fpu} option is enabled then
20391 @option{-funsafe-math-optimizations} is also enabled automatically.
20392 This is because the RX FPU instructions are themselves unsafe.
20393
20394 @item -mcpu=@var{name}
20395 @opindex mcpu
20396 Selects the type of RX CPU to be targeted.  Currently three types are
20397 supported, the generic @samp{RX600} and @samp{RX200} series hardware and
20398 the specific @samp{RX610} CPU.  The default is @samp{RX600}.
20399
20400 The only difference between @samp{RX600} and @samp{RX610} is that the
20401 @samp{RX610} does not support the @code{MVTIPL} instruction.
20402
20403 The @samp{RX200} series does not have a hardware floating-point unit
20404 and so @option{-nofpu} is enabled by default when this type is
20405 selected.
20406
20407 @item -mbig-endian-data
20408 @itemx -mlittle-endian-data
20409 @opindex mbig-endian-data
20410 @opindex mlittle-endian-data
20411 Store data (but not code) in the big-endian format.  The default is
20412 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
20413 format.
20414
20415 @item -msmall-data-limit=@var{N}
20416 @opindex msmall-data-limit
20417 Specifies the maximum size in bytes of global and static variables
20418 which can be placed into the small data area.  Using the small data
20419 area can lead to smaller and faster code, but the size of area is
20420 limited and it is up to the programmer to ensure that the area does
20421 not overflow.  Also when the small data area is used one of the RX's
20422 registers (usually @code{r13}) is reserved for use pointing to this
20423 area, so it is no longer available for use by the compiler.  This
20424 could result in slower and/or larger code if variables are pushed onto
20425 the stack instead of being held in this register.
20426
20427 Note, common variables (variables that have not been initialized) and
20428 constants are not placed into the small data area as they are assigned
20429 to other sections in the output executable.
20430
20431 The default value is zero, which disables this feature.  Note, this
20432 feature is not enabled by default with higher optimization levels
20433 (@option{-O2} etc) because of the potentially detrimental effects of
20434 reserving a register.  It is up to the programmer to experiment and
20435 discover whether this feature is of benefit to their program.  See the
20436 description of the @option{-mpid} option for a description of how the
20437 actual register to hold the small data area pointer is chosen.
20438
20439 @item -msim
20440 @itemx -mno-sim
20441 @opindex msim
20442 @opindex mno-sim
20443 Use the simulator runtime.  The default is to use the libgloss
20444 board-specific runtime.
20445
20446 @item -mas100-syntax
20447 @itemx -mno-as100-syntax
20448 @opindex mas100-syntax
20449 @opindex mno-as100-syntax
20450 When generating assembler output use a syntax that is compatible with
20451 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
20452 assembler, but it has some restrictions so it is not generated by default.
20453
20454 @item -mmax-constant-size=@var{N}
20455 @opindex mmax-constant-size
20456 Specifies the maximum size, in bytes, of a constant that can be used as
20457 an operand in a RX instruction.  Although the RX instruction set does
20458 allow constants of up to 4 bytes in length to be used in instructions,
20459 a longer value equates to a longer instruction.  Thus in some
20460 circumstances it can be beneficial to restrict the size of constants
20461 that are used in instructions.  Constants that are too big are instead
20462 placed into a constant pool and referenced via register indirection.
20463
20464 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
20465 or 4 means that constants of any size are allowed.
20466
20467 @item -mrelax
20468 @opindex mrelax
20469 Enable linker relaxation.  Linker relaxation is a process whereby the
20470 linker attempts to reduce the size of a program by finding shorter
20471 versions of various instructions.  Disabled by default.
20472
20473 @item -mint-register=@var{N}
20474 @opindex mint-register
20475 Specify the number of registers to reserve for fast interrupt handler
20476 functions.  The value @var{N} can be between 0 and 4.  A value of 1
20477 means that register @code{r13} is reserved for the exclusive use
20478 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
20479 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
20480 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
20481 A value of 0, the default, does not reserve any registers.
20482
20483 @item -msave-acc-in-interrupts
20484 @opindex msave-acc-in-interrupts
20485 Specifies that interrupt handler functions should preserve the
20486 accumulator register.  This is only necessary if normal code might use
20487 the accumulator register, for example because it performs 64-bit
20488 multiplications.  The default is to ignore the accumulator as this
20489 makes the interrupt handlers faster.
20490
20491 @item -mpid
20492 @itemx -mno-pid
20493 @opindex mpid
20494 @opindex mno-pid
20495 Enables the generation of position independent data.  When enabled any
20496 access to constant data is done via an offset from a base address
20497 held in a register.  This allows the location of constant data to be
20498 determined at run time without requiring the executable to be
20499 relocated, which is a benefit to embedded applications with tight
20500 memory constraints.  Data that can be modified is not affected by this
20501 option.
20502
20503 Note, using this feature reserves a register, usually @code{r13}, for
20504 the constant data base address.  This can result in slower and/or
20505 larger code, especially in complicated functions.
20506
20507 The actual register chosen to hold the constant data base address
20508 depends upon whether the @option{-msmall-data-limit} and/or the
20509 @option{-mint-register} command-line options are enabled.  Starting
20510 with register @code{r13} and proceeding downwards, registers are
20511 allocated first to satisfy the requirements of @option{-mint-register},
20512 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
20513 is possible for the small data area register to be @code{r8} if both
20514 @option{-mint-register=4} and @option{-mpid} are specified on the
20515 command line.
20516
20517 By default this feature is not enabled.  The default can be restored
20518 via the @option{-mno-pid} command-line option.
20519
20520 @item -mno-warn-multiple-fast-interrupts
20521 @itemx -mwarn-multiple-fast-interrupts
20522 @opindex mno-warn-multiple-fast-interrupts
20523 @opindex mwarn-multiple-fast-interrupts
20524 Prevents GCC from issuing a warning message if it finds more than one
20525 fast interrupt handler when it is compiling a file.  The default is to
20526 issue a warning for each extra fast interrupt handler found, as the RX
20527 only supports one such interrupt.
20528
20529 @item -mallow-string-insns
20530 @itemx -mno-allow-string-insns
20531 @opindex mallow-string-insns
20532 @opindex mno-allow-string-insns
20533 Enables or disables the use of the string manipulation instructions
20534 @code{SMOVF}, @code{SCMPU}, @code{SMOVB}, @code{SMOVU}, @code{SUNTIL}
20535 @code{SWHILE} and also the @code{RMPA} instruction.  These
20536 instructions may prefetch data, which is not safe to do if accessing
20537 an I/O register.  (See section 12.2.7 of the RX62N Group User's Manual
20538 for more information).
20539
20540 The default is to allow these instructions, but it is not possible for
20541 GCC to reliably detect all circumstances where a string instruction
20542 might be used to access an I/O register, so their use cannot be
20543 disabled automatically.  Instead it is reliant upon the programmer to
20544 use the @option{-mno-allow-string-insns} option if their program
20545 accesses I/O space.
20546
20547 When the instructions are enabled GCC defines the C preprocessor
20548 symbol @code{__RX_ALLOW_STRING_INSNS__}, otherwise it defines the
20549 symbol @code{__RX_DISALLOW_STRING_INSNS__}.
20550 @end table
20551
20552 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
20553 has special significance to the RX port when used with the
20554 @code{interrupt} function attribute.  This attribute indicates a
20555 function intended to process fast interrupts.  GCC ensures
20556 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
20557 and/or @code{r13} and only provided that the normal use of the
20558 corresponding registers have been restricted via the
20559 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
20560 options.
20561
20562 @node S/390 and zSeries Options
20563 @subsection S/390 and zSeries Options
20564 @cindex S/390 and zSeries Options
20565
20566 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
20567
20568 @table @gcctabopt
20569 @item -mhard-float
20570 @itemx -msoft-float
20571 @opindex mhard-float
20572 @opindex msoft-float
20573 Use (do not use) the hardware floating-point instructions and registers
20574 for floating-point operations.  When @option{-msoft-float} is specified,
20575 functions in @file{libgcc.a} are used to perform floating-point
20576 operations.  When @option{-mhard-float} is specified, the compiler
20577 generates IEEE floating-point instructions.  This is the default.
20578
20579 @item -mhard-dfp
20580 @itemx -mno-hard-dfp
20581 @opindex mhard-dfp
20582 @opindex mno-hard-dfp
20583 Use (do not use) the hardware decimal-floating-point instructions for
20584 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
20585 specified, functions in @file{libgcc.a} are used to perform
20586 decimal-floating-point operations.  When @option{-mhard-dfp} is
20587 specified, the compiler generates decimal-floating-point hardware
20588 instructions.  This is the default for @option{-march=z9-ec} or higher.
20589
20590 @item -mlong-double-64
20591 @itemx -mlong-double-128
20592 @opindex mlong-double-64
20593 @opindex mlong-double-128
20594 These switches control the size of @code{long double} type. A size
20595 of 64 bits makes the @code{long double} type equivalent to the @code{double}
20596 type. This is the default.
20597
20598 @item -mbackchain
20599 @itemx -mno-backchain
20600 @opindex mbackchain
20601 @opindex mno-backchain
20602 Store (do not store) the address of the caller's frame as backchain pointer
20603 into the callee's stack frame.
20604 A backchain may be needed to allow debugging using tools that do not understand
20605 DWARF 2 call frame information.
20606 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
20607 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
20608 the backchain is placed into the topmost word of the 96/160 byte register
20609 save area.
20610
20611 In general, code compiled with @option{-mbackchain} is call-compatible with
20612 code compiled with @option{-mmo-backchain}; however, use of the backchain
20613 for debugging purposes usually requires that the whole binary is built with
20614 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
20615 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
20616 to build a linux kernel use @option{-msoft-float}.
20617
20618 The default is to not maintain the backchain.
20619
20620 @item -mpacked-stack
20621 @itemx -mno-packed-stack
20622 @opindex mpacked-stack
20623 @opindex mno-packed-stack
20624 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
20625 specified, the compiler uses the all fields of the 96/160 byte register save
20626 area only for their default purpose; unused fields still take up stack space.
20627 When @option{-mpacked-stack} is specified, register save slots are densely
20628 packed at the top of the register save area; unused space is reused for other
20629 purposes, allowing for more efficient use of the available stack space.
20630 However, when @option{-mbackchain} is also in effect, the topmost word of
20631 the save area is always used to store the backchain, and the return address
20632 register is always saved two words below the backchain.
20633
20634 As long as the stack frame backchain is not used, code generated with
20635 @option{-mpacked-stack} is call-compatible with code generated with
20636 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
20637 S/390 or zSeries generated code that uses the stack frame backchain at run
20638 time, not just for debugging purposes.  Such code is not call-compatible
20639 with code compiled with @option{-mpacked-stack}.  Also, note that the
20640 combination of @option{-mbackchain},
20641 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
20642 to build a linux kernel use @option{-msoft-float}.
20643
20644 The default is to not use the packed stack layout.
20645
20646 @item -msmall-exec
20647 @itemx -mno-small-exec
20648 @opindex msmall-exec
20649 @opindex mno-small-exec
20650 Generate (or do not generate) code using the @code{bras} instruction
20651 to do subroutine calls.
20652 This only works reliably if the total executable size does not
20653 exceed 64k.  The default is to use the @code{basr} instruction instead,
20654 which does not have this limitation.
20655
20656 @item -m64
20657 @itemx -m31
20658 @opindex m64
20659 @opindex m31
20660 When @option{-m31} is specified, generate code compliant to the
20661 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
20662 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
20663 particular to generate 64-bit instructions.  For the @samp{s390}
20664 targets, the default is @option{-m31}, while the @samp{s390x}
20665 targets default to @option{-m64}.
20666
20667 @item -mzarch
20668 @itemx -mesa
20669 @opindex mzarch
20670 @opindex mesa
20671 When @option{-mzarch} is specified, generate code using the
20672 instructions available on z/Architecture.
20673 When @option{-mesa} is specified, generate code using the
20674 instructions available on ESA/390.  Note that @option{-mesa} is
20675 not possible with @option{-m64}.
20676 When generating code compliant to the GNU/Linux for S/390 ABI,
20677 the default is @option{-mesa}.  When generating code compliant
20678 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
20679
20680 @item -mhtm
20681 @itemx -mno-htm
20682 @opindex mhtm
20683 @opindex mno-htm
20684 The @option{-mhtm} option enables a set of builtins making use of
20685 instructions available with the transactional execution facility
20686 introduced with the IBM zEnterprise EC12 machine generation
20687 @ref{S/390 System z Built-in Functions}.
20688 @option{-mhtm} is enabled by default when using @option{-march=zEC12}.
20689
20690 @item -mvx
20691 @itemx -mno-vx
20692 @opindex mvx
20693 @opindex mno-vx
20694 When @option{-mvx} is specified, generate code using the instructions
20695 available with the vector extension facility introduced with the IBM
20696 z13 machine generation.
20697 This option changes the ABI for some vector type values with regard to
20698 alignment and calling conventions.  In case vector type values are
20699 being used in an ABI-relevant context a GAS @samp{.gnu_attribute}
20700 command will be added to mark the resulting binary with the ABI used.
20701 @option{-mvx} is enabled by default when using @option{-march=z13}.
20702
20703 @item -mzvector
20704 @itemx -mno-zvector
20705 @opindex mzvector
20706 @opindex mno-zvector
20707 The @option{-mzvector} option enables vector language extensions and
20708 builtins using instructions available with the vector extension
20709 facility introduced with the IBM z13 machine generation.
20710 This option adds support for @samp{vector} to be used as a keyword to
20711 define vector type variables and arguments.  @samp{vector} is only
20712 available when GNU extensions are enabled.  It will not be expanded
20713 when requesting strict standard compliance e.g. with @option{-std=c99}.
20714 In addition to the GCC low-level builtins @option{-mzvector} enables
20715 a set of builtins added for compatibility with Altivec-style
20716 implementations like Power and Cell.  In order to make use of these
20717 builtins the header file @file{vecintrin.h} needs to be included.
20718 @option{-mzvector} is disabled by default.
20719
20720 @item -mmvcle
20721 @itemx -mno-mvcle
20722 @opindex mmvcle
20723 @opindex mno-mvcle
20724 Generate (or do not generate) code using the @code{mvcle} instruction
20725 to perform block moves.  When @option{-mno-mvcle} is specified,
20726 use a @code{mvc} loop instead.  This is the default unless optimizing for
20727 size.
20728
20729 @item -mdebug
20730 @itemx -mno-debug
20731 @opindex mdebug
20732 @opindex mno-debug
20733 Print (or do not print) additional debug information when compiling.
20734 The default is to not print debug information.
20735
20736 @item -march=@var{cpu-type}
20737 @opindex march
20738 Generate code that runs on @var{cpu-type}, which is the name of a system
20739 representing a certain processor type.  Possible values for
20740 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
20741 @samp{z9-109}, @samp{z9-ec}, @samp{z10},  @samp{z196}, @samp{zEC12},
20742 and @samp{z13}.
20743 When generating code using the instructions available on z/Architecture,
20744 the default is @option{-march=z900}.  Otherwise, the default is
20745 @option{-march=g5}.
20746
20747 @item -mtune=@var{cpu-type}
20748 @opindex mtune
20749 Tune to @var{cpu-type} everything applicable about the generated code,
20750 except for the ABI and the set of available instructions.
20751 The list of @var{cpu-type} values is the same as for @option{-march}.
20752 The default is the value used for @option{-march}.
20753
20754 @item -mtpf-trace
20755 @itemx -mno-tpf-trace
20756 @opindex mtpf-trace
20757 @opindex mno-tpf-trace
20758 Generate code that adds (does not add) in TPF OS specific branches to trace
20759 routines in the operating system.  This option is off by default, even
20760 when compiling for the TPF OS@.
20761
20762 @item -mfused-madd
20763 @itemx -mno-fused-madd
20764 @opindex mfused-madd
20765 @opindex mno-fused-madd
20766 Generate code that uses (does not use) the floating-point multiply and
20767 accumulate instructions.  These instructions are generated by default if
20768 hardware floating point is used.
20769
20770 @item -mwarn-framesize=@var{framesize}
20771 @opindex mwarn-framesize
20772 Emit a warning if the current function exceeds the given frame size.  Because
20773 this is a compile-time check it doesn't need to be a real problem when the program
20774 runs.  It is intended to identify functions that most probably cause
20775 a stack overflow.  It is useful to be used in an environment with limited stack
20776 size e.g.@: the linux kernel.
20777
20778 @item -mwarn-dynamicstack
20779 @opindex mwarn-dynamicstack
20780 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
20781 arrays.  This is generally a bad idea with a limited stack size.
20782
20783 @item -mstack-guard=@var{stack-guard}
20784 @itemx -mstack-size=@var{stack-size}
20785 @opindex mstack-guard
20786 @opindex mstack-size
20787 If these options are provided the S/390 back end emits additional instructions in
20788 the function prologue that trigger a trap if the stack size is @var{stack-guard}
20789 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
20790 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
20791 the frame size of the compiled function is chosen.
20792 These options are intended to be used to help debugging stack overflow problems.
20793 The additionally emitted code causes only little overhead and hence can also be
20794 used in production-like systems without greater performance degradation.  The given
20795 values have to be exact powers of 2 and @var{stack-size} has to be greater than
20796 @var{stack-guard} without exceeding 64k.
20797 In order to be efficient the extra code makes the assumption that the stack starts
20798 at an address aligned to the value given by @var{stack-size}.
20799 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
20800
20801 @item -mhotpatch=@var{pre-halfwords},@var{post-halfwords}
20802 @opindex mhotpatch
20803 If the hotpatch option is enabled, a ``hot-patching'' function
20804 prologue is generated for all functions in the compilation unit.
20805 The funtion label is prepended with the given number of two-byte
20806 NOP instructions (@var{pre-halfwords}, maximum 1000000).  After
20807 the label, 2 * @var{post-halfwords} bytes are appended, using the
20808 largest NOP like instructions the architecture allows (maximum
20809 1000000).
20810
20811 If both arguments are zero, hotpatching is disabled.
20812
20813 This option can be overridden for individual functions with the
20814 @code{hotpatch} attribute.
20815 @end table
20816
20817 @node Score Options
20818 @subsection Score Options
20819 @cindex Score Options
20820
20821 These options are defined for Score implementations:
20822
20823 @table @gcctabopt
20824 @item -meb
20825 @opindex meb
20826 Compile code for big-endian mode.  This is the default.
20827
20828 @item -mel
20829 @opindex mel
20830 Compile code for little-endian mode.
20831
20832 @item -mnhwloop
20833 @opindex mnhwloop
20834 Disable generation of @code{bcnz} instructions.
20835
20836 @item -muls
20837 @opindex muls
20838 Enable generation of unaligned load and store instructions.
20839
20840 @item -mmac
20841 @opindex mmac
20842 Enable the use of multiply-accumulate instructions. Disabled by default.
20843
20844 @item -mscore5
20845 @opindex mscore5
20846 Specify the SCORE5 as the target architecture.
20847
20848 @item -mscore5u
20849 @opindex mscore5u
20850 Specify the SCORE5U of the target architecture.
20851
20852 @item -mscore7
20853 @opindex mscore7
20854 Specify the SCORE7 as the target architecture. This is the default.
20855
20856 @item -mscore7d
20857 @opindex mscore7d
20858 Specify the SCORE7D as the target architecture.
20859 @end table
20860
20861 @node SH Options
20862 @subsection SH Options
20863
20864 These @samp{-m} options are defined for the SH implementations:
20865
20866 @table @gcctabopt
20867 @item -m1
20868 @opindex m1
20869 Generate code for the SH1.
20870
20871 @item -m2
20872 @opindex m2
20873 Generate code for the SH2.
20874
20875 @item -m2e
20876 Generate code for the SH2e.
20877
20878 @item -m2a-nofpu
20879 @opindex m2a-nofpu
20880 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
20881 that the floating-point unit is not used.
20882
20883 @item -m2a-single-only
20884 @opindex m2a-single-only
20885 Generate code for the SH2a-FPU, in such a way that no double-precision
20886 floating-point operations are used.
20887
20888 @item -m2a-single
20889 @opindex m2a-single
20890 Generate code for the SH2a-FPU assuming the floating-point unit is in
20891 single-precision mode by default.
20892
20893 @item -m2a
20894 @opindex m2a
20895 Generate code for the SH2a-FPU assuming the floating-point unit is in
20896 double-precision mode by default.
20897
20898 @item -m3
20899 @opindex m3
20900 Generate code for the SH3.
20901
20902 @item -m3e
20903 @opindex m3e
20904 Generate code for the SH3e.
20905
20906 @item -m4-nofpu
20907 @opindex m4-nofpu
20908 Generate code for the SH4 without a floating-point unit.
20909
20910 @item -m4-single-only
20911 @opindex m4-single-only
20912 Generate code for the SH4 with a floating-point unit that only
20913 supports single-precision arithmetic.
20914
20915 @item -m4-single
20916 @opindex m4-single
20917 Generate code for the SH4 assuming the floating-point unit is in
20918 single-precision mode by default.
20919
20920 @item -m4
20921 @opindex m4
20922 Generate code for the SH4.
20923
20924 @item -m4-100
20925 @opindex m4-100
20926 Generate code for SH4-100.
20927
20928 @item -m4-100-nofpu
20929 @opindex m4-100-nofpu
20930 Generate code for SH4-100 in such a way that the
20931 floating-point unit is not used.
20932
20933 @item -m4-100-single
20934 @opindex m4-100-single
20935 Generate code for SH4-100 assuming the floating-point unit is in
20936 single-precision mode by default.
20937
20938 @item -m4-100-single-only
20939 @opindex m4-100-single-only
20940 Generate code for SH4-100 in such a way that no double-precision
20941 floating-point operations are used.
20942
20943 @item -m4-200
20944 @opindex m4-200
20945 Generate code for SH4-200.
20946
20947 @item -m4-200-nofpu
20948 @opindex m4-200-nofpu
20949 Generate code for SH4-200 without in such a way that the
20950 floating-point unit is not used.
20951
20952 @item -m4-200-single
20953 @opindex m4-200-single
20954 Generate code for SH4-200 assuming the floating-point unit is in
20955 single-precision mode by default.
20956
20957 @item -m4-200-single-only
20958 @opindex m4-200-single-only
20959 Generate code for SH4-200 in such a way that no double-precision
20960 floating-point operations are used.
20961
20962 @item -m4-300
20963 @opindex m4-300
20964 Generate code for SH4-300.
20965
20966 @item -m4-300-nofpu
20967 @opindex m4-300-nofpu
20968 Generate code for SH4-300 without in such a way that the
20969 floating-point unit is not used.
20970
20971 @item -m4-300-single
20972 @opindex m4-300-single
20973 Generate code for SH4-300 in such a way that no double-precision
20974 floating-point operations are used.
20975
20976 @item -m4-300-single-only
20977 @opindex m4-300-single-only
20978 Generate code for SH4-300 in such a way that no double-precision
20979 floating-point operations are used.
20980
20981 @item -m4-340
20982 @opindex m4-340
20983 Generate code for SH4-340 (no MMU, no FPU).
20984
20985 @item -m4-500
20986 @opindex m4-500
20987 Generate code for SH4-500 (no FPU).  Passes @option{-isa=sh4-nofpu} to the
20988 assembler.
20989
20990 @item -m4a-nofpu
20991 @opindex m4a-nofpu
20992 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
20993 floating-point unit is not used.
20994
20995 @item -m4a-single-only
20996 @opindex m4a-single-only
20997 Generate code for the SH4a, in such a way that no double-precision
20998 floating-point operations are used.
20999
21000 @item -m4a-single
21001 @opindex m4a-single
21002 Generate code for the SH4a assuming the floating-point unit is in
21003 single-precision mode by default.
21004
21005 @item -m4a
21006 @opindex m4a
21007 Generate code for the SH4a.
21008
21009 @item -m4al
21010 @opindex m4al
21011 Same as @option{-m4a-nofpu}, except that it implicitly passes
21012 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
21013 instructions at the moment.
21014
21015 @item -mb
21016 @opindex mb
21017 Compile code for the processor in big-endian mode.
21018
21019 @item -ml
21020 @opindex ml
21021 Compile code for the processor in little-endian mode.
21022
21023 @item -mdalign
21024 @opindex mdalign
21025 Align doubles at 64-bit boundaries.  Note that this changes the calling
21026 conventions, and thus some functions from the standard C library do
21027 not work unless you recompile it first with @option{-mdalign}.
21028
21029 @item -mrelax
21030 @opindex mrelax
21031 Shorten some address references at link time, when possible; uses the
21032 linker option @option{-relax}.
21033
21034 @item -mbigtable
21035 @opindex mbigtable
21036 Use 32-bit offsets in @code{switch} tables.  The default is to use
21037 16-bit offsets.
21038
21039 @item -mbitops
21040 @opindex mbitops
21041 Enable the use of bit manipulation instructions on SH2A.
21042
21043 @item -mfmovd
21044 @opindex mfmovd
21045 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
21046 alignment constraints.
21047
21048 @item -mrenesas
21049 @opindex mrenesas
21050 Comply with the calling conventions defined by Renesas.
21051
21052 @item -mno-renesas
21053 @opindex mno-renesas
21054 Comply with the calling conventions defined for GCC before the Renesas
21055 conventions were available.  This option is the default for all
21056 targets of the SH toolchain.
21057
21058 @item -mnomacsave
21059 @opindex mnomacsave
21060 Mark the @code{MAC} register as call-clobbered, even if
21061 @option{-mrenesas} is given.
21062
21063 @item -mieee
21064 @itemx -mno-ieee
21065 @opindex mieee
21066 @opindex mno-ieee
21067 Control the IEEE compliance of floating-point comparisons, which affects the
21068 handling of cases where the result of a comparison is unordered.  By default
21069 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
21070 enabled @option{-mno-ieee} is implicitly set, which results in faster
21071 floating-point greater-equal and less-equal comparisons.  The implcit settings
21072 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
21073
21074 @item -minline-ic_invalidate
21075 @opindex minline-ic_invalidate
21076 Inline code to invalidate instruction cache entries after setting up
21077 nested function trampolines.
21078 This option has no effect if @option{-musermode} is in effect and the selected
21079 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
21080 instruction.
21081 If the selected code generation option does not allow the use of the @code{icbi}
21082 instruction, and @option{-musermode} is not in effect, the inlined code
21083 manipulates the instruction cache address array directly with an associative
21084 write.  This not only requires privileged mode at run time, but it also
21085 fails if the cache line had been mapped via the TLB and has become unmapped.
21086
21087 @item -misize
21088 @opindex misize
21089 Dump instruction size and location in the assembly code.
21090
21091 @item -mpadstruct
21092 @opindex mpadstruct
21093 This option is deprecated.  It pads structures to multiple of 4 bytes,
21094 which is incompatible with the SH ABI@.
21095
21096 @item -matomic-model=@var{model}
21097 @opindex matomic-model=@var{model}
21098 Sets the model of atomic operations and additional parameters as a comma
21099 separated list.  For details on the atomic built-in functions see
21100 @ref{__atomic Builtins}.  The following models and parameters are supported:
21101
21102 @table @samp
21103
21104 @item none
21105 Disable compiler generated atomic sequences and emit library calls for atomic
21106 operations.  This is the default if the target is not @code{sh*-*-linux*}.
21107
21108 @item soft-gusa
21109 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
21110 built-in functions.  The generated atomic sequences require additional support
21111 from the interrupt/exception handling code of the system and are only suitable
21112 for SH3* and SH4* single-core systems.  This option is enabled by default when
21113 the target is @code{sh*-*-linux*} and SH3* or SH4*.  When the target is SH4A,
21114 this option also partially utilizes the hardware atomic instructions
21115 @code{movli.l} and @code{movco.l} to create more efficient code, unless
21116 @samp{strict} is specified.  
21117
21118 @item soft-tcb
21119 Generate software atomic sequences that use a variable in the thread control
21120 block.  This is a variation of the gUSA sequences which can also be used on
21121 SH1* and SH2* targets.  The generated atomic sequences require additional
21122 support from the interrupt/exception handling code of the system and are only
21123 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
21124 parameter has to be specified as well.
21125
21126 @item soft-imask
21127 Generate software atomic sequences that temporarily disable interrupts by
21128 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
21129 in privileged mode and is only suitable for single-core systems.  Additional
21130 support from the interrupt/exception handling code of the system is not
21131 required.  This model is enabled by default when the target is
21132 @code{sh*-*-linux*} and SH1* or SH2*.
21133
21134 @item hard-llcs
21135 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
21136 instructions only.  This is only available on SH4A and is suitable for
21137 multi-core systems.  Since the hardware instructions support only 32 bit atomic
21138 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
21139 Code compiled with this option is also compatible with other software
21140 atomic model interrupt/exception handling systems if executed on an SH4A
21141 system.  Additional support from the interrupt/exception handling code of the
21142 system is not required for this model.
21143
21144 @item gbr-offset=
21145 This parameter specifies the offset in bytes of the variable in the thread
21146 control block structure that should be used by the generated atomic sequences
21147 when the @samp{soft-tcb} model has been selected.  For other models this
21148 parameter is ignored.  The specified value must be an integer multiple of four
21149 and in the range 0-1020.
21150
21151 @item strict
21152 This parameter prevents mixed usage of multiple atomic models, even if they
21153 are compatible, and makes the compiler generate atomic sequences of the
21154 specified model only.
21155
21156 @end table
21157
21158 @item -mtas
21159 @opindex mtas
21160 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
21161 Notice that depending on the particular hardware and software configuration
21162 this can degrade overall performance due to the operand cache line flushes
21163 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
21164 processors the @code{tas.b} instruction must be used with caution since it
21165 can result in data corruption for certain cache configurations.
21166
21167 @item -mprefergot
21168 @opindex mprefergot
21169 When generating position-independent code, emit function calls using
21170 the Global Offset Table instead of the Procedure Linkage Table.
21171
21172 @item -musermode
21173 @itemx -mno-usermode
21174 @opindex musermode
21175 @opindex mno-usermode
21176 Don't allow (allow) the compiler generating privileged mode code.  Specifying
21177 @option{-musermode} also implies @option{-mno-inline-ic_invalidate} if the
21178 inlined code would not work in user mode.  @option{-musermode} is the default
21179 when the target is @code{sh*-*-linux*}.  If the target is SH1* or SH2*
21180 @option{-musermode} has no effect, since there is no user mode.
21181
21182 @item -multcost=@var{number}
21183 @opindex multcost=@var{number}
21184 Set the cost to assume for a multiply insn.
21185
21186 @item -mdiv=@var{strategy}
21187 @opindex mdiv=@var{strategy}
21188 Set the division strategy to be used for integer division operations.
21189 @var{strategy} can be one of: 
21190
21191 @table @samp
21192
21193 @item call-div1
21194 Calls a library function that uses the single-step division instruction
21195 @code{div1} to perform the operation.  Division by zero calculates an
21196 unspecified result and does not trap.  This is the default except for SH4,
21197 SH2A and SHcompact.
21198
21199 @item call-fp
21200 Calls a library function that performs the operation in double precision
21201 floating point.  Division by zero causes a floating-point exception.  This is
21202 the default for SHcompact with FPU.  Specifying this for targets that do not
21203 have a double precision FPU defaults to @code{call-div1}.
21204
21205 @item call-table
21206 Calls a library function that uses a lookup table for small divisors and
21207 the @code{div1} instruction with case distinction for larger divisors.  Division
21208 by zero calculates an unspecified result and does not trap.  This is the default
21209 for SH4.  Specifying this for targets that do not have dynamic shift
21210 instructions defaults to @code{call-div1}.
21211
21212 @end table
21213
21214 When a division strategy has not been specified the default strategy is
21215 selected based on the current target.  For SH2A the default strategy is to
21216 use the @code{divs} and @code{divu} instructions instead of library function
21217 calls.
21218
21219 @item -maccumulate-outgoing-args
21220 @opindex maccumulate-outgoing-args
21221 Reserve space once for outgoing arguments in the function prologue rather
21222 than around each call.  Generally beneficial for performance and size.  Also
21223 needed for unwinding to avoid changing the stack frame around conditional code.
21224
21225 @item -mdivsi3_libfunc=@var{name}
21226 @opindex mdivsi3_libfunc=@var{name}
21227 Set the name of the library function used for 32-bit signed division to
21228 @var{name}.
21229 This only affects the name used in the @samp{call} division strategies, and
21230 the compiler still expects the same sets of input/output/clobbered registers as
21231 if this option were not present.
21232
21233 @item -mfixed-range=@var{register-range}
21234 @opindex mfixed-range
21235 Generate code treating the given register range as fixed registers.
21236 A fixed register is one that the register allocator can not use.  This is
21237 useful when compiling kernel code.  A register range is specified as
21238 two registers separated by a dash.  Multiple register ranges can be
21239 specified separated by a comma.
21240
21241 @item -mbranch-cost=@var{num}
21242 @opindex mbranch-cost=@var{num}
21243 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
21244 make the compiler try to generate more branch-free code if possible.  
21245 If not specified the value is selected depending on the processor type that
21246 is being compiled for.
21247
21248 @item -mzdcbranch
21249 @itemx -mno-zdcbranch
21250 @opindex mzdcbranch
21251 @opindex mno-zdcbranch
21252 Assume (do not assume) that zero displacement conditional branch instructions
21253 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
21254 compiler prefers zero displacement branch code sequences.  This is
21255 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
21256 disabled by specifying @option{-mno-zdcbranch}.
21257
21258 @item -mcbranch-force-delay-slot
21259 @opindex mcbranch-force-delay-slot
21260 Force the usage of delay slots for conditional branches, which stuffs the delay
21261 slot with a @code{nop} if a suitable instruction can't be found.  By default
21262 this option is disabled.  It can be enabled to work around hardware bugs as
21263 found in the original SH7055.
21264
21265 @item -mfused-madd
21266 @itemx -mno-fused-madd
21267 @opindex mfused-madd
21268 @opindex mno-fused-madd
21269 Generate code that uses (does not use) the floating-point multiply and
21270 accumulate instructions.  These instructions are generated by default
21271 if hardware floating point is used.  The machine-dependent
21272 @option{-mfused-madd} option is now mapped to the machine-independent
21273 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
21274 mapped to @option{-ffp-contract=off}.
21275
21276 @item -mfsca
21277 @itemx -mno-fsca
21278 @opindex mfsca
21279 @opindex mno-fsca
21280 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
21281 and cosine approximations.  The option @option{-mfsca} must be used in
21282 combination with @option{-funsafe-math-optimizations}.  It is enabled by default
21283 when generating code for SH4A.  Using @option{-mno-fsca} disables sine and cosine
21284 approximations even if @option{-funsafe-math-optimizations} is in effect.
21285
21286 @item -mfsrra
21287 @itemx -mno-fsrra
21288 @opindex mfsrra
21289 @opindex mno-fsrra
21290 Allow or disallow the compiler to emit the @code{fsrra} instruction for
21291 reciprocal square root approximations.  The option @option{-mfsrra} must be used
21292 in combination with @option{-funsafe-math-optimizations} and
21293 @option{-ffinite-math-only}.  It is enabled by default when generating code for
21294 SH4A.  Using @option{-mno-fsrra} disables reciprocal square root approximations
21295 even if @option{-funsafe-math-optimizations} and @option{-ffinite-math-only} are
21296 in effect.
21297
21298 @item -mpretend-cmove
21299 @opindex mpretend-cmove
21300 Prefer zero-displacement conditional branches for conditional move instruction
21301 patterns.  This can result in faster code on the SH4 processor.
21302
21303 @item -mfdpic
21304 @opindex fdpic
21305 Generate code using the FDPIC ABI.
21306
21307 @end table
21308
21309 @node Solaris 2 Options
21310 @subsection Solaris 2 Options
21311 @cindex Solaris 2 options
21312
21313 These @samp{-m} options are supported on Solaris 2:
21314
21315 @table @gcctabopt
21316 @item -mclear-hwcap
21317 @opindex mclear-hwcap
21318 @option{-mclear-hwcap} tells the compiler to remove the hardware
21319 capabilities generated by the Solaris assembler.  This is only necessary
21320 when object files use ISA extensions not supported by the current
21321 machine, but check at runtime whether or not to use them.
21322
21323 @item -mimpure-text
21324 @opindex mimpure-text
21325 @option{-mimpure-text}, used in addition to @option{-shared}, tells
21326 the compiler to not pass @option{-z text} to the linker when linking a
21327 shared object.  Using this option, you can link position-dependent
21328 code into a shared object.
21329
21330 @option{-mimpure-text} suppresses the ``relocations remain against
21331 allocatable but non-writable sections'' linker error message.
21332 However, the necessary relocations trigger copy-on-write, and the
21333 shared object is not actually shared across processes.  Instead of
21334 using @option{-mimpure-text}, you should compile all source code with
21335 @option{-fpic} or @option{-fPIC}.
21336
21337 @end table
21338
21339 These switches are supported in addition to the above on Solaris 2:
21340
21341 @table @gcctabopt
21342 @item -pthreads
21343 @opindex pthreads
21344 Add support for multithreading using the POSIX threads library.  This
21345 option sets flags for both the preprocessor and linker.  This option does
21346 not affect the thread safety of object code produced  by the compiler or
21347 that of libraries supplied with it.
21348
21349 @item -pthread
21350 @opindex pthread
21351 This is a synonym for @option{-pthreads}.
21352 @end table
21353
21354 @node SPARC Options
21355 @subsection SPARC Options
21356 @cindex SPARC options
21357
21358 These @samp{-m} options are supported on the SPARC:
21359
21360 @table @gcctabopt
21361 @item -mno-app-regs
21362 @itemx -mapp-regs
21363 @opindex mno-app-regs
21364 @opindex mapp-regs
21365 Specify @option{-mapp-regs} to generate output using the global registers
21366 2 through 4, which the SPARC SVR4 ABI reserves for applications.  Like the
21367 global register 1, each global register 2 through 4 is then treated as an
21368 allocable register that is clobbered by function calls.  This is the default.
21369
21370 To be fully SVR4 ABI-compliant at the cost of some performance loss,
21371 specify @option{-mno-app-regs}.  You should compile libraries and system
21372 software with this option.
21373
21374 @item -mflat
21375 @itemx -mno-flat
21376 @opindex mflat
21377 @opindex mno-flat
21378 With @option{-mflat}, the compiler does not generate save/restore instructions
21379 and uses a ``flat'' or single register window model.  This model is compatible
21380 with the regular register window model.  The local registers and the input
21381 registers (0--5) are still treated as ``call-saved'' registers and are
21382 saved on the stack as needed.
21383
21384 With @option{-mno-flat} (the default), the compiler generates save/restore
21385 instructions (except for leaf functions).  This is the normal operating mode.
21386
21387 @item -mfpu
21388 @itemx -mhard-float
21389 @opindex mfpu
21390 @opindex mhard-float
21391 Generate output containing floating-point instructions.  This is the
21392 default.
21393
21394 @item -mno-fpu
21395 @itemx -msoft-float
21396 @opindex mno-fpu
21397 @opindex msoft-float
21398 Generate output containing library calls for floating point.
21399 @strong{Warning:} the requisite libraries are not available for all SPARC
21400 targets.  Normally the facilities of the machine's usual C compiler are
21401 used, but this cannot be done directly in cross-compilation.  You must make
21402 your own arrangements to provide suitable library functions for
21403 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
21404 @samp{sparclite-*-*} do provide software floating-point support.
21405
21406 @option{-msoft-float} changes the calling convention in the output file;
21407 therefore, it is only useful if you compile @emph{all} of a program with
21408 this option.  In particular, you need to compile @file{libgcc.a}, the
21409 library that comes with GCC, with @option{-msoft-float} in order for
21410 this to work.
21411
21412 @item -mhard-quad-float
21413 @opindex mhard-quad-float
21414 Generate output containing quad-word (long double) floating-point
21415 instructions.
21416
21417 @item -msoft-quad-float
21418 @opindex msoft-quad-float
21419 Generate output containing library calls for quad-word (long double)
21420 floating-point instructions.  The functions called are those specified
21421 in the SPARC ABI@.  This is the default.
21422
21423 As of this writing, there are no SPARC implementations that have hardware
21424 support for the quad-word floating-point instructions.  They all invoke
21425 a trap handler for one of these instructions, and then the trap handler
21426 emulates the effect of the instruction.  Because of the trap handler overhead,
21427 this is much slower than calling the ABI library routines.  Thus the
21428 @option{-msoft-quad-float} option is the default.
21429
21430 @item -mno-unaligned-doubles
21431 @itemx -munaligned-doubles
21432 @opindex mno-unaligned-doubles
21433 @opindex munaligned-doubles
21434 Assume that doubles have 8-byte alignment.  This is the default.
21435
21436 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
21437 alignment only if they are contained in another type, or if they have an
21438 absolute address.  Otherwise, it assumes they have 4-byte alignment.
21439 Specifying this option avoids some rare compatibility problems with code
21440 generated by other compilers.  It is not the default because it results
21441 in a performance loss, especially for floating-point code.
21442
21443 @item -muser-mode
21444 @itemx -mno-user-mode
21445 @opindex muser-mode
21446 @opindex mno-user-mode
21447 Do not generate code that can only run in supervisor mode.  This is relevant
21448 only for the @code{casa} instruction emitted for the LEON3 processor.  This
21449 is the default.
21450
21451 @item -mno-faster-structs
21452 @itemx -mfaster-structs
21453 @opindex mno-faster-structs
21454 @opindex mfaster-structs
21455 With @option{-mfaster-structs}, the compiler assumes that structures
21456 should have 8-byte alignment.  This enables the use of pairs of
21457 @code{ldd} and @code{std} instructions for copies in structure
21458 assignment, in place of twice as many @code{ld} and @code{st} pairs.
21459 However, the use of this changed alignment directly violates the SPARC
21460 ABI@.  Thus, it's intended only for use on targets where the developer
21461 acknowledges that their resulting code is not directly in line with
21462 the rules of the ABI@.
21463
21464 @item -mcpu=@var{cpu_type}
21465 @opindex mcpu
21466 Set the instruction set, register set, and instruction scheduling parameters
21467 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
21468 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
21469 @samp{leon}, @samp{leon3}, @samp{leon3v7}, @samp{sparclite}, @samp{f930},
21470 @samp{f934}, @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
21471 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
21472 @samp{niagara3} and @samp{niagara4}.
21473
21474 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
21475 which selects the best architecture option for the host processor.
21476 @option{-mcpu=native} has no effect if GCC does not recognize
21477 the processor.
21478
21479 Default instruction scheduling parameters are used for values that select
21480 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
21481 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
21482
21483 Here is a list of each supported architecture and their supported
21484 implementations.
21485
21486 @table @asis
21487 @item v7
21488 cypress, leon3v7
21489
21490 @item v8
21491 supersparc, hypersparc, leon, leon3
21492
21493 @item sparclite
21494 f930, f934, sparclite86x
21495
21496 @item sparclet
21497 tsc701
21498
21499 @item v9
21500 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4
21501 @end table
21502
21503 By default (unless configured otherwise), GCC generates code for the V7
21504 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
21505 additionally optimizes it for the Cypress CY7C602 chip, as used in the
21506 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
21507 SPARCStation 1, 2, IPX etc.
21508
21509 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
21510 architecture.  The only difference from V7 code is that the compiler emits
21511 the integer multiply and integer divide instructions which exist in SPARC-V8
21512 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
21513 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
21514 2000 series.
21515
21516 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
21517 the SPARC architecture.  This adds the integer multiply, integer divide step
21518 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
21519 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
21520 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
21521 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
21522 MB86934 chip, which is the more recent SPARClite with FPU@.
21523
21524 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
21525 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
21526 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
21527 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
21528 optimizes it for the TEMIC SPARClet chip.
21529
21530 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
21531 architecture.  This adds 64-bit integer and floating-point move instructions,
21532 3 additional floating-point condition code registers and conditional move
21533 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
21534 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
21535 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
21536 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
21537 @option{-mcpu=niagara}, the compiler additionally optimizes it for
21538 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
21539 additionally optimizes it for Sun UltraSPARC T2 chips. With
21540 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
21541 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
21542 additionally optimizes it for Sun UltraSPARC T4 chips.
21543
21544 @item -mtune=@var{cpu_type}
21545 @opindex mtune
21546 Set the instruction scheduling parameters for machine type
21547 @var{cpu_type}, but do not set the instruction set or register set that the
21548 option @option{-mcpu=@var{cpu_type}} does.
21549
21550 The same values for @option{-mcpu=@var{cpu_type}} can be used for
21551 @option{-mtune=@var{cpu_type}}, but the only useful values are those
21552 that select a particular CPU implementation.  Those are @samp{cypress},
21553 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{leon3},
21554 @samp{leon3v7}, @samp{f930}, @samp{f934}, @samp{sparclite86x}, @samp{tsc701},
21555 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
21556 @samp{niagara3} and @samp{niagara4}.  With native Solaris and GNU/Linux
21557 toolchains, @samp{native} can also be used.
21558
21559 @item -mv8plus
21560 @itemx -mno-v8plus
21561 @opindex mv8plus
21562 @opindex mno-v8plus
21563 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
21564 difference from the V8 ABI is that the global and out registers are
21565 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
21566 mode for all SPARC-V9 processors.
21567
21568 @item -mvis
21569 @itemx -mno-vis
21570 @opindex mvis
21571 @opindex mno-vis
21572 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
21573 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
21574
21575 @item -mvis2
21576 @itemx -mno-vis2
21577 @opindex mvis2
21578 @opindex mno-vis2
21579 With @option{-mvis2}, GCC generates code that takes advantage of
21580 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
21581 default is @option{-mvis2} when targeting a cpu that supports such
21582 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
21583 also sets @option{-mvis}.
21584
21585 @item -mvis3
21586 @itemx -mno-vis3
21587 @opindex mvis3
21588 @opindex mno-vis3
21589 With @option{-mvis3}, GCC generates code that takes advantage of
21590 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
21591 default is @option{-mvis3} when targeting a cpu that supports such
21592 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
21593 also sets @option{-mvis2} and @option{-mvis}.
21594
21595 @item -mcbcond
21596 @itemx -mno-cbcond
21597 @opindex mcbcond
21598 @opindex mno-cbcond
21599 With @option{-mcbcond}, GCC generates code that takes advantage of
21600 compare-and-branch instructions, as defined in the Sparc Architecture 2011.
21601 The default is @option{-mcbcond} when targeting a cpu that supports such
21602 instructions, such as niagara-4 and later.
21603
21604 @item -mpopc
21605 @itemx -mno-popc
21606 @opindex mpopc
21607 @opindex mno-popc
21608 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
21609 population count instruction.  The default is @option{-mpopc}
21610 when targeting a cpu that supports such instructions, such as Niagara-2 and
21611 later.
21612
21613 @item -mfmaf
21614 @itemx -mno-fmaf
21615 @opindex mfmaf
21616 @opindex mno-fmaf
21617 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
21618 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
21619 when targeting a cpu that supports such instructions, such as Niagara-3 and
21620 later.
21621
21622 @item -mfix-at697f
21623 @opindex mfix-at697f
21624 Enable the documented workaround for the single erratum of the Atmel AT697F
21625 processor (which corresponds to erratum #13 of the AT697E processor).
21626
21627 @item -mfix-ut699
21628 @opindex mfix-ut699
21629 Enable the documented workarounds for the floating-point errata and the data
21630 cache nullify errata of the UT699 processor.
21631 @end table
21632
21633 These @samp{-m} options are supported in addition to the above
21634 on SPARC-V9 processors in 64-bit environments:
21635
21636 @table @gcctabopt
21637 @item -m32
21638 @itemx -m64
21639 @opindex m32
21640 @opindex m64
21641 Generate code for a 32-bit or 64-bit environment.
21642 The 32-bit environment sets int, long and pointer to 32 bits.
21643 The 64-bit environment sets int to 32 bits and long and pointer
21644 to 64 bits.
21645
21646 @item -mcmodel=@var{which}
21647 @opindex mcmodel
21648 Set the code model to one of
21649
21650 @table @samp
21651 @item medlow
21652 The Medium/Low code model: 64-bit addresses, programs
21653 must be linked in the low 32 bits of memory.  Programs can be statically
21654 or dynamically linked.
21655
21656 @item medmid
21657 The Medium/Middle code model: 64-bit addresses, programs
21658 must be linked in the low 44 bits of memory, the text and data segments must
21659 be less than 2GB in size and the data segment must be located within 2GB of
21660 the text segment.
21661
21662 @item medany
21663 The Medium/Anywhere code model: 64-bit addresses, programs
21664 may be linked anywhere in memory, the text and data segments must be less
21665 than 2GB in size and the data segment must be located within 2GB of the
21666 text segment.
21667
21668 @item embmedany
21669 The Medium/Anywhere code model for embedded systems:
21670 64-bit addresses, the text and data segments must be less than 2GB in
21671 size, both starting anywhere in memory (determined at link time).  The
21672 global register %g4 points to the base of the data segment.  Programs
21673 are statically linked and PIC is not supported.
21674 @end table
21675
21676 @item -mmemory-model=@var{mem-model}
21677 @opindex mmemory-model
21678 Set the memory model in force on the processor to one of
21679
21680 @table @samp
21681 @item default
21682 The default memory model for the processor and operating system.
21683
21684 @item rmo
21685 Relaxed Memory Order
21686
21687 @item pso
21688 Partial Store Order
21689
21690 @item tso
21691 Total Store Order
21692
21693 @item sc
21694 Sequential Consistency
21695 @end table
21696
21697 These memory models are formally defined in Appendix D of the Sparc V9
21698 architecture manual, as set in the processor's @code{PSTATE.MM} field.
21699
21700 @item -mstack-bias
21701 @itemx -mno-stack-bias
21702 @opindex mstack-bias
21703 @opindex mno-stack-bias
21704 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
21705 frame pointer if present, are offset by @minus{}2047 which must be added back
21706 when making stack frame references.  This is the default in 64-bit mode.
21707 Otherwise, assume no such offset is present.
21708 @end table
21709
21710 @node SPU Options
21711 @subsection SPU Options
21712 @cindex SPU options
21713
21714 These @samp{-m} options are supported on the SPU:
21715
21716 @table @gcctabopt
21717 @item -mwarn-reloc
21718 @itemx -merror-reloc
21719 @opindex mwarn-reloc
21720 @opindex merror-reloc
21721
21722 The loader for SPU does not handle dynamic relocations.  By default, GCC
21723 gives an error when it generates code that requires a dynamic
21724 relocation.  @option{-mno-error-reloc} disables the error,
21725 @option{-mwarn-reloc} generates a warning instead.
21726
21727 @item -msafe-dma
21728 @itemx -munsafe-dma
21729 @opindex msafe-dma
21730 @opindex munsafe-dma
21731
21732 Instructions that initiate or test completion of DMA must not be
21733 reordered with respect to loads and stores of the memory that is being
21734 accessed.
21735 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
21736 memory accesses, but that can lead to inefficient code in places where the
21737 memory is known to not change.  Rather than mark the memory as volatile,
21738 you can use @option{-msafe-dma} to tell the compiler to treat
21739 the DMA instructions as potentially affecting all memory.  
21740
21741 @item -mbranch-hints
21742 @opindex mbranch-hints
21743
21744 By default, GCC generates a branch hint instruction to avoid
21745 pipeline stalls for always-taken or probably-taken branches.  A hint
21746 is not generated closer than 8 instructions away from its branch.
21747 There is little reason to disable them, except for debugging purposes,
21748 or to make an object a little bit smaller.
21749
21750 @item -msmall-mem
21751 @itemx -mlarge-mem
21752 @opindex msmall-mem
21753 @opindex mlarge-mem
21754
21755 By default, GCC generates code assuming that addresses are never larger
21756 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
21757 a full 32-bit address.
21758
21759 @item -mstdmain
21760 @opindex mstdmain
21761
21762 By default, GCC links against startup code that assumes the SPU-style
21763 main function interface (which has an unconventional parameter list).
21764 With @option{-mstdmain}, GCC links your program against startup
21765 code that assumes a C99-style interface to @code{main}, including a
21766 local copy of @code{argv} strings.
21767
21768 @item -mfixed-range=@var{register-range}
21769 @opindex mfixed-range
21770 Generate code treating the given register range as fixed registers.
21771 A fixed register is one that the register allocator cannot use.  This is
21772 useful when compiling kernel code.  A register range is specified as
21773 two registers separated by a dash.  Multiple register ranges can be
21774 specified separated by a comma.
21775
21776 @item -mea32
21777 @itemx -mea64
21778 @opindex mea32
21779 @opindex mea64
21780 Compile code assuming that pointers to the PPU address space accessed
21781 via the @code{__ea} named address space qualifier are either 32 or 64
21782 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
21783 all object code in an executable must be compiled with the same setting.
21784
21785 @item -maddress-space-conversion
21786 @itemx -mno-address-space-conversion
21787 @opindex maddress-space-conversion
21788 @opindex mno-address-space-conversion
21789 Allow/disallow treating the @code{__ea} address space as superset
21790 of the generic address space.  This enables explicit type casts
21791 between @code{__ea} and generic pointer as well as implicit
21792 conversions of generic pointers to @code{__ea} pointers.  The
21793 default is to allow address space pointer conversions.
21794
21795 @item -mcache-size=@var{cache-size}
21796 @opindex mcache-size
21797 This option controls the version of libgcc that the compiler links to an
21798 executable and selects a software-managed cache for accessing variables
21799 in the @code{__ea} address space with a particular cache size.  Possible
21800 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
21801 and @samp{128}.  The default cache size is 64KB.
21802
21803 @item -matomic-updates
21804 @itemx -mno-atomic-updates
21805 @opindex matomic-updates
21806 @opindex mno-atomic-updates
21807 This option controls the version of libgcc that the compiler links to an
21808 executable and selects whether atomic updates to the software-managed
21809 cache of PPU-side variables are used.  If you use atomic updates, changes
21810 to a PPU variable from SPU code using the @code{__ea} named address space
21811 qualifier do not interfere with changes to other PPU variables residing
21812 in the same cache line from PPU code.  If you do not use atomic updates,
21813 such interference may occur; however, writing back cache lines is
21814 more efficient.  The default behavior is to use atomic updates.
21815
21816 @item -mdual-nops
21817 @itemx -mdual-nops=@var{n}
21818 @opindex mdual-nops
21819 By default, GCC inserts nops to increase dual issue when it expects
21820 it to increase performance.  @var{n} can be a value from 0 to 10.  A
21821 smaller @var{n} inserts fewer nops.  10 is the default, 0 is the
21822 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
21823
21824 @item -mhint-max-nops=@var{n}
21825 @opindex mhint-max-nops
21826 Maximum number of nops to insert for a branch hint.  A branch hint must
21827 be at least 8 instructions away from the branch it is affecting.  GCC
21828 inserts up to @var{n} nops to enforce this, otherwise it does not
21829 generate the branch hint.
21830
21831 @item -mhint-max-distance=@var{n}
21832 @opindex mhint-max-distance
21833 The encoding of the branch hint instruction limits the hint to be within
21834 256 instructions of the branch it is affecting.  By default, GCC makes
21835 sure it is within 125.
21836
21837 @item -msafe-hints
21838 @opindex msafe-hints
21839 Work around a hardware bug that causes the SPU to stall indefinitely.
21840 By default, GCC inserts the @code{hbrp} instruction to make sure
21841 this stall won't happen.
21842
21843 @end table
21844
21845 @node System V Options
21846 @subsection Options for System V
21847
21848 These additional options are available on System V Release 4 for
21849 compatibility with other compilers on those systems:
21850
21851 @table @gcctabopt
21852 @item -G
21853 @opindex G
21854 Create a shared object.
21855 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
21856
21857 @item -Qy
21858 @opindex Qy
21859 Identify the versions of each tool used by the compiler, in a
21860 @code{.ident} assembler directive in the output.
21861
21862 @item -Qn
21863 @opindex Qn
21864 Refrain from adding @code{.ident} directives to the output file (this is
21865 the default).
21866
21867 @item -YP,@var{dirs}
21868 @opindex YP
21869 Search the directories @var{dirs}, and no others, for libraries
21870 specified with @option{-l}.
21871
21872 @item -Ym,@var{dir}
21873 @opindex Ym
21874 Look in the directory @var{dir} to find the M4 preprocessor.
21875 The assembler uses this option.
21876 @c This is supposed to go with a -Yd for predefined M4 macro files, but
21877 @c the generic assembler that comes with Solaris takes just -Ym.
21878 @end table
21879
21880 @node TILE-Gx Options
21881 @subsection TILE-Gx Options
21882 @cindex TILE-Gx options
21883
21884 These @samp{-m} options are supported on the TILE-Gx:
21885
21886 @table @gcctabopt
21887 @item -mcmodel=small
21888 @opindex mcmodel=small
21889 Generate code for the small model.  The distance for direct calls is
21890 limited to 500M in either direction.  PC-relative addresses are 32
21891 bits.  Absolute addresses support the full address range.
21892
21893 @item -mcmodel=large
21894 @opindex mcmodel=large
21895 Generate code for the large model.  There is no limitation on call
21896 distance, pc-relative addresses, or absolute addresses.
21897
21898 @item -mcpu=@var{name}
21899 @opindex mcpu
21900 Selects the type of CPU to be targeted.  Currently the only supported
21901 type is @samp{tilegx}.
21902
21903 @item -m32
21904 @itemx -m64
21905 @opindex m32
21906 @opindex m64
21907 Generate code for a 32-bit or 64-bit environment.  The 32-bit
21908 environment sets int, long, and pointer to 32 bits.  The 64-bit
21909 environment sets int to 32 bits and long and pointer to 64 bits.
21910
21911 @item -mbig-endian
21912 @itemx -mlittle-endian
21913 @opindex mbig-endian
21914 @opindex mlittle-endian
21915 Generate code in big/little endian mode, respectively.
21916 @end table
21917
21918 @node TILEPro Options
21919 @subsection TILEPro Options
21920 @cindex TILEPro options
21921
21922 These @samp{-m} options are supported on the TILEPro:
21923
21924 @table @gcctabopt
21925 @item -mcpu=@var{name}
21926 @opindex mcpu
21927 Selects the type of CPU to be targeted.  Currently the only supported
21928 type is @samp{tilepro}.
21929
21930 @item -m32
21931 @opindex m32
21932 Generate code for a 32-bit environment, which sets int, long, and
21933 pointer to 32 bits.  This is the only supported behavior so the flag
21934 is essentially ignored.
21935 @end table
21936
21937 @node V850 Options
21938 @subsection V850 Options
21939 @cindex V850 Options
21940
21941 These @samp{-m} options are defined for V850 implementations:
21942
21943 @table @gcctabopt
21944 @item -mlong-calls
21945 @itemx -mno-long-calls
21946 @opindex mlong-calls
21947 @opindex mno-long-calls
21948 Treat all calls as being far away (near).  If calls are assumed to be
21949 far away, the compiler always loads the function's address into a
21950 register, and calls indirect through the pointer.
21951
21952 @item -mno-ep
21953 @itemx -mep
21954 @opindex mno-ep
21955 @opindex mep
21956 Do not optimize (do optimize) basic blocks that use the same index
21957 pointer 4 or more times to copy pointer into the @code{ep} register, and
21958 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
21959 option is on by default if you optimize.
21960
21961 @item -mno-prolog-function
21962 @itemx -mprolog-function
21963 @opindex mno-prolog-function
21964 @opindex mprolog-function
21965 Do not use (do use) external functions to save and restore registers
21966 at the prologue and epilogue of a function.  The external functions
21967 are slower, but use less code space if more than one function saves
21968 the same number of registers.  The @option{-mprolog-function} option
21969 is on by default if you optimize.
21970
21971 @item -mspace
21972 @opindex mspace
21973 Try to make the code as small as possible.  At present, this just turns
21974 on the @option{-mep} and @option{-mprolog-function} options.
21975
21976 @item -mtda=@var{n}
21977 @opindex mtda
21978 Put static or global variables whose size is @var{n} bytes or less into
21979 the tiny data area that register @code{ep} points to.  The tiny data
21980 area can hold up to 256 bytes in total (128 bytes for byte references).
21981
21982 @item -msda=@var{n}
21983 @opindex msda
21984 Put static or global variables whose size is @var{n} bytes or less into
21985 the small data area that register @code{gp} points to.  The small data
21986 area can hold up to 64 kilobytes.
21987
21988 @item -mzda=@var{n}
21989 @opindex mzda
21990 Put static or global variables whose size is @var{n} bytes or less into
21991 the first 32 kilobytes of memory.
21992
21993 @item -mv850
21994 @opindex mv850
21995 Specify that the target processor is the V850.
21996
21997 @item -mv850e3v5
21998 @opindex mv850e3v5
21999 Specify that the target processor is the V850E3V5.  The preprocessor
22000 constant @code{__v850e3v5__} is defined if this option is used.
22001
22002 @item -mv850e2v4
22003 @opindex mv850e2v4
22004 Specify that the target processor is the V850E3V5.  This is an alias for
22005 the @option{-mv850e3v5} option.
22006
22007 @item -mv850e2v3
22008 @opindex mv850e2v3
22009 Specify that the target processor is the V850E2V3.  The preprocessor
22010 constant @code{__v850e2v3__} is defined if this option is used.
22011
22012 @item -mv850e2
22013 @opindex mv850e2
22014 Specify that the target processor is the V850E2.  The preprocessor
22015 constant @code{__v850e2__} is defined if this option is used.
22016
22017 @item -mv850e1
22018 @opindex mv850e1
22019 Specify that the target processor is the V850E1.  The preprocessor
22020 constants @code{__v850e1__} and @code{__v850e__} are defined if
22021 this option is used.
22022
22023 @item -mv850es
22024 @opindex mv850es
22025 Specify that the target processor is the V850ES.  This is an alias for
22026 the @option{-mv850e1} option.
22027
22028 @item -mv850e
22029 @opindex mv850e
22030 Specify that the target processor is the V850E@.  The preprocessor
22031 constant @code{__v850e__} is defined if this option is used.
22032
22033 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
22034 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
22035 are defined then a default target processor is chosen and the
22036 relevant @samp{__v850*__} preprocessor constant is defined.
22037
22038 The preprocessor constants @code{__v850} and @code{__v851__} are always
22039 defined, regardless of which processor variant is the target.
22040
22041 @item -mdisable-callt
22042 @itemx -mno-disable-callt
22043 @opindex mdisable-callt
22044 @opindex mno-disable-callt
22045 This option suppresses generation of the @code{CALLT} instruction for the
22046 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
22047 architecture.
22048
22049 This option is enabled by default when the RH850 ABI is
22050 in use (see @option{-mrh850-abi}), and disabled by default when the
22051 GCC ABI is in use.  If @code{CALLT} instructions are being generated
22052 then the C preprocessor symbol @code{__V850_CALLT__} is defined.
22053
22054 @item -mrelax
22055 @itemx -mno-relax
22056 @opindex mrelax
22057 @opindex mno-relax
22058 Pass on (or do not pass on) the @option{-mrelax} command-line option
22059 to the assembler.
22060
22061 @item -mlong-jumps
22062 @itemx -mno-long-jumps
22063 @opindex mlong-jumps
22064 @opindex mno-long-jumps
22065 Disable (or re-enable) the generation of PC-relative jump instructions.
22066
22067 @item -msoft-float
22068 @itemx -mhard-float
22069 @opindex msoft-float
22070 @opindex mhard-float
22071 Disable (or re-enable) the generation of hardware floating point
22072 instructions.  This option is only significant when the target
22073 architecture is @samp{V850E2V3} or higher.  If hardware floating point
22074 instructions are being generated then the C preprocessor symbol
22075 @code{__FPU_OK__} is defined, otherwise the symbol
22076 @code{__NO_FPU__} is defined.
22077
22078 @item -mloop
22079 @opindex mloop
22080 Enables the use of the e3v5 LOOP instruction.  The use of this
22081 instruction is not enabled by default when the e3v5 architecture is
22082 selected because its use is still experimental.
22083
22084 @item -mrh850-abi
22085 @itemx -mghs
22086 @opindex mrh850-abi
22087 @opindex mghs
22088 Enables support for the RH850 version of the V850 ABI.  This is the
22089 default.  With this version of the ABI the following rules apply:
22090
22091 @itemize
22092 @item
22093 Integer sized structures and unions are returned via a memory pointer
22094 rather than a register.
22095
22096 @item
22097 Large structures and unions (more than 8 bytes in size) are passed by
22098 value.
22099
22100 @item
22101 Functions are aligned to 16-bit boundaries.
22102
22103 @item
22104 The @option{-m8byte-align} command-line option is supported.
22105
22106 @item
22107 The @option{-mdisable-callt} command-line option is enabled by
22108 default.  The @option{-mno-disable-callt} command-line option is not
22109 supported.
22110 @end itemize
22111
22112 When this version of the ABI is enabled the C preprocessor symbol
22113 @code{__V850_RH850_ABI__} is defined.
22114
22115 @item -mgcc-abi
22116 @opindex mgcc-abi
22117 Enables support for the old GCC version of the V850 ABI.  With this
22118 version of the ABI the following rules apply:
22119
22120 @itemize
22121 @item
22122 Integer sized structures and unions are returned in register @code{r10}.
22123
22124 @item
22125 Large structures and unions (more than 8 bytes in size) are passed by
22126 reference.
22127
22128 @item
22129 Functions are aligned to 32-bit boundaries, unless optimizing for
22130 size.
22131
22132 @item
22133 The @option{-m8byte-align} command-line option is not supported.
22134
22135 @item
22136 The @option{-mdisable-callt} command-line option is supported but not
22137 enabled by default.
22138 @end itemize
22139
22140 When this version of the ABI is enabled the C preprocessor symbol
22141 @code{__V850_GCC_ABI__} is defined.
22142
22143 @item -m8byte-align
22144 @itemx -mno-8byte-align
22145 @opindex m8byte-align
22146 @opindex mno-8byte-align
22147 Enables support for @code{double} and @code{long long} types to be
22148 aligned on 8-byte boundaries.  The default is to restrict the
22149 alignment of all objects to at most 4-bytes.  When
22150 @option{-m8byte-align} is in effect the C preprocessor symbol
22151 @code{__V850_8BYTE_ALIGN__} is defined.
22152
22153 @item -mbig-switch
22154 @opindex mbig-switch
22155 Generate code suitable for big switch tables.  Use this option only if
22156 the assembler/linker complain about out of range branches within a switch
22157 table.
22158
22159 @item -mapp-regs
22160 @opindex mapp-regs
22161 This option causes r2 and r5 to be used in the code generated by
22162 the compiler.  This setting is the default.
22163
22164 @item -mno-app-regs
22165 @opindex mno-app-regs
22166 This option causes r2 and r5 to be treated as fixed registers.
22167
22168 @end table
22169
22170 @node VAX Options
22171 @subsection VAX Options
22172 @cindex VAX options
22173
22174 These @samp{-m} options are defined for the VAX:
22175
22176 @table @gcctabopt
22177 @item -munix
22178 @opindex munix
22179 Do not output certain jump instructions (@code{aobleq} and so on)
22180 that the Unix assembler for the VAX cannot handle across long
22181 ranges.
22182
22183 @item -mgnu
22184 @opindex mgnu
22185 Do output those jump instructions, on the assumption that the
22186 GNU assembler is being used.
22187
22188 @item -mg
22189 @opindex mg
22190 Output code for G-format floating-point numbers instead of D-format.
22191 @end table
22192
22193 @node Visium Options
22194 @subsection Visium Options
22195 @cindex Visium options
22196
22197 @table @gcctabopt
22198
22199 @item -mdebug
22200 @opindex mdebug
22201 A program which performs file I/O and is destined to run on an MCM target
22202 should be linked with this option.  It causes the libraries libc.a and
22203 libdebug.a to be linked.  The program should be run on the target under
22204 the control of the GDB remote debugging stub.
22205
22206 @item -msim
22207 @opindex msim
22208 A program which performs file I/O and is destined to run on the simulator
22209 should be linked with option.  This causes libraries libc.a and libsim.a to
22210 be linked.
22211
22212 @item -mfpu
22213 @itemx -mhard-float
22214 @opindex mfpu
22215 @opindex mhard-float
22216 Generate code containing floating-point instructions.  This is the
22217 default.
22218
22219 @item -mno-fpu
22220 @itemx -msoft-float
22221 @opindex mno-fpu
22222 @opindex msoft-float
22223 Generate code containing library calls for floating-point.
22224
22225 @option{-msoft-float} changes the calling convention in the output file;
22226 therefore, it is only useful if you compile @emph{all} of a program with
22227 this option.  In particular, you need to compile @file{libgcc.a}, the
22228 library that comes with GCC, with @option{-msoft-float} in order for
22229 this to work.
22230
22231 @item -mcpu=@var{cpu_type}
22232 @opindex mcpu
22233 Set the instruction set, register set, and instruction scheduling parameters
22234 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
22235 @samp{mcm}, @samp{gr5} and @samp{gr6}.
22236
22237 @samp{mcm} is a synonym of @samp{gr5} present for backward compatibility.
22238
22239 By default (unless configured otherwise), GCC generates code for the GR5
22240 variant of the Visium architecture.  
22241
22242 With @option{-mcpu=gr6}, GCC generates code for the GR6 variant of the Visium
22243 architecture.  The only difference from GR5 code is that the compiler will
22244 generate block move instructions.
22245
22246 @item -mtune=@var{cpu_type}
22247 @opindex mtune
22248 Set the instruction scheduling parameters for machine type @var{cpu_type},
22249 but do not set the instruction set or register set that the option
22250 @option{-mcpu=@var{cpu_type}} would.
22251
22252 @item -msv-mode
22253 @opindex msv-mode
22254 Generate code for the supervisor mode, where there are no restrictions on
22255 the access to general registers.  This is the default.
22256
22257 @item -muser-mode
22258 @opindex muser-mode
22259 Generate code for the user mode, where the access to some general registers
22260 is forbidden: on the GR5, registers r24 to r31 cannot be accessed in this
22261 mode; on the GR6, only registers r29 to r31 are affected.
22262 @end table
22263
22264 @node VMS Options
22265 @subsection VMS Options
22266
22267 These @samp{-m} options are defined for the VMS implementations:
22268
22269 @table @gcctabopt
22270 @item -mvms-return-codes
22271 @opindex mvms-return-codes
22272 Return VMS condition codes from @code{main}. The default is to return POSIX-style
22273 condition (e.g.@ error) codes.
22274
22275 @item -mdebug-main=@var{prefix}
22276 @opindex mdebug-main=@var{prefix}
22277 Flag the first routine whose name starts with @var{prefix} as the main
22278 routine for the debugger.
22279
22280 @item -mmalloc64
22281 @opindex mmalloc64
22282 Default to 64-bit memory allocation routines.
22283
22284 @item -mpointer-size=@var{size}
22285 @opindex mpointer-size=@var{size}
22286 Set the default size of pointers. Possible options for @var{size} are
22287 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
22288 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
22289 The later option disables @code{pragma pointer_size}.
22290 @end table
22291
22292 @node VxWorks Options
22293 @subsection VxWorks Options
22294 @cindex VxWorks Options
22295
22296 The options in this section are defined for all VxWorks targets.
22297 Options specific to the target hardware are listed with the other
22298 options for that target.
22299
22300 @table @gcctabopt
22301 @item -mrtp
22302 @opindex mrtp
22303 GCC can generate code for both VxWorks kernels and real time processes
22304 (RTPs).  This option switches from the former to the latter.  It also
22305 defines the preprocessor macro @code{__RTP__}.
22306
22307 @item -non-static
22308 @opindex non-static
22309 Link an RTP executable against shared libraries rather than static
22310 libraries.  The options @option{-static} and @option{-shared} can
22311 also be used for RTPs (@pxref{Link Options}); @option{-static}
22312 is the default.
22313
22314 @item -Bstatic
22315 @itemx -Bdynamic
22316 @opindex Bstatic
22317 @opindex Bdynamic
22318 These options are passed down to the linker.  They are defined for
22319 compatibility with Diab.
22320
22321 @item -Xbind-lazy
22322 @opindex Xbind-lazy
22323 Enable lazy binding of function calls.  This option is equivalent to
22324 @option{-Wl,-z,now} and is defined for compatibility with Diab.
22325
22326 @item -Xbind-now
22327 @opindex Xbind-now
22328 Disable lazy binding of function calls.  This option is the default and
22329 is defined for compatibility with Diab.
22330 @end table
22331
22332 @node x86 Options
22333 @subsection x86 Options
22334 @cindex x86 Options
22335
22336 These @samp{-m} options are defined for the x86 family of computers.
22337
22338 @table @gcctabopt
22339
22340 @item -march=@var{cpu-type}
22341 @opindex march
22342 Generate instructions for the machine type @var{cpu-type}.  In contrast to
22343 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
22344 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
22345 to generate code that may not run at all on processors other than the one
22346 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
22347 @option{-mtune=@var{cpu-type}}.
22348
22349 The choices for @var{cpu-type} are:
22350
22351 @table @samp
22352 @item native
22353 This selects the CPU to generate code for at compilation time by determining
22354 the processor type of the compiling machine.  Using @option{-march=native}
22355 enables all instruction subsets supported by the local machine (hence
22356 the result might not run on different machines).  Using @option{-mtune=native}
22357 produces code optimized for the local machine under the constraints
22358 of the selected instruction set.  
22359
22360 @item i386
22361 Original Intel i386 CPU@.
22362
22363 @item i486
22364 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
22365
22366 @item i586
22367 @itemx pentium
22368 Intel Pentium CPU with no MMX support.
22369
22370 @item lakemont
22371 Intel Lakemont MCU, based on Intel Pentium CPU.
22372
22373 @item pentium-mmx
22374 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
22375
22376 @item pentiumpro
22377 Intel Pentium Pro CPU@.
22378
22379 @item i686
22380 When used with @option{-march}, the Pentium Pro
22381 instruction set is used, so the code runs on all i686 family chips.
22382 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
22383
22384 @item pentium2
22385 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
22386 support.
22387
22388 @item pentium3
22389 @itemx pentium3m
22390 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
22391 set support.
22392
22393 @item pentium-m
22394 Intel Pentium M; low-power version of Intel Pentium III CPU
22395 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
22396
22397 @item pentium4
22398 @itemx pentium4m
22399 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
22400
22401 @item prescott
22402 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
22403 set support.
22404
22405 @item nocona
22406 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
22407 SSE2 and SSE3 instruction set support.
22408
22409 @item core2
22410 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
22411 instruction set support.
22412
22413 @item nehalem
22414 Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
22415 SSE4.1, SSE4.2 and POPCNT instruction set support.
22416
22417 @item westmere
22418 Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
22419 SSE4.1, SSE4.2, POPCNT, AES and PCLMUL instruction set support.
22420
22421 @item sandybridge
22422 Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
22423 SSE4.1, SSE4.2, POPCNT, AVX, AES and PCLMUL instruction set support.
22424
22425 @item ivybridge
22426 Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
22427 SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C
22428 instruction set support.
22429
22430 @item haswell
22431 Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
22432 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
22433 BMI, BMI2 and F16C instruction set support.
22434
22435 @item broadwell
22436 Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
22437 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
22438 BMI, BMI2, F16C, RDSEED, ADCX and PREFETCHW instruction set support.
22439
22440 @item skylake
22441 Intel Skylake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
22442 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
22443 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC and
22444 XSAVES instruction set support.
22445
22446 @item bonnell
22447 Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
22448 instruction set support.
22449
22450 @item silvermont
22451 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
22452 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL and RDRND instruction set support.
22453
22454 @item knl
22455 Intel Knight's Landing CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
22456 SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
22457 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER and
22458 AVX512CD instruction set support.
22459
22460 @item skylake-avx512
22461 Intel Skylake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
22462 SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
22463 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F,
22464 AVX512VL, AVX512BW, AVX512DQ and AVX512CD instruction set support.
22465
22466 @item k6
22467 AMD K6 CPU with MMX instruction set support.
22468
22469 @item k6-2
22470 @itemx k6-3
22471 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
22472
22473 @item athlon
22474 @itemx athlon-tbird
22475 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
22476 support.
22477
22478 @item athlon-4
22479 @itemx athlon-xp
22480 @itemx athlon-mp
22481 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
22482 instruction set support.
22483
22484 @item k8
22485 @itemx opteron
22486 @itemx athlon64
22487 @itemx athlon-fx
22488 Processors based on the AMD K8 core with x86-64 instruction set support,
22489 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
22490 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
22491 instruction set extensions.)
22492
22493 @item k8-sse3
22494 @itemx opteron-sse3
22495 @itemx athlon64-sse3
22496 Improved versions of AMD K8 cores with SSE3 instruction set support.
22497
22498 @item amdfam10
22499 @itemx barcelona
22500 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
22501 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
22502 instruction set extensions.)
22503
22504 @item bdver1
22505 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
22506 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
22507 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
22508 @item bdver2
22509 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
22510 supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX,
22511 SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
22512 extensions.)
22513 @item bdver3
22514 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
22515 supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, XOP, LWP, AES, 
22516 PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 
22517 64-bit instruction set extensions.
22518 @item bdver4
22519 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
22520 supersets BMI, BMI2, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, AVX2, XOP, LWP, 
22521 AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, 
22522 SSE4.2, ABM and 64-bit instruction set extensions.
22523
22524 @item znver1
22525 AMD Family 17h core based CPUs with x86-64 instruction set support.  (This
22526 supersets BMI, BMI2, F16C, FMA, FSGSBASE, AVX, AVX2, ADCX, RDSEED, MWAITX,
22527 SHA, CLZERO, AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3,
22528 SSE4.1, SSE4.2, ABM, XSAVEC, XSAVES, CLFLUSHOPT, POPCNT, and 64-bit
22529 instruction set extensions.
22530
22531 @item btver1
22532 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
22533 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
22534 instruction set extensions.)
22535
22536 @item btver2
22537 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
22538 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
22539 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
22540
22541 @item winchip-c6
22542 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
22543 set support.
22544
22545 @item winchip2
22546 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
22547 instruction set support.
22548
22549 @item c3
22550 VIA C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
22551 implemented for this chip.)
22552
22553 @item c3-2
22554 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
22555 (No scheduling is
22556 implemented for this chip.)
22557
22558 @item geode
22559 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
22560 @end table
22561
22562 @item -mtune=@var{cpu-type}
22563 @opindex mtune
22564 Tune to @var{cpu-type} everything applicable about the generated code, except
22565 for the ABI and the set of available instructions.  
22566 While picking a specific @var{cpu-type} schedules things appropriately
22567 for that particular chip, the compiler does not generate any code that
22568 cannot run on the default machine type unless you use a
22569 @option{-march=@var{cpu-type}} option.
22570 For example, if GCC is configured for i686-pc-linux-gnu
22571 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
22572 but still runs on i686 machines.
22573
22574 The choices for @var{cpu-type} are the same as for @option{-march}.
22575 In addition, @option{-mtune} supports 2 extra choices for @var{cpu-type}:
22576
22577 @table @samp
22578 @item generic
22579 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
22580 If you know the CPU on which your code will run, then you should use
22581 the corresponding @option{-mtune} or @option{-march} option instead of
22582 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
22583 of your application will have, then you should use this option.
22584
22585 As new processors are deployed in the marketplace, the behavior of this
22586 option will change.  Therefore, if you upgrade to a newer version of
22587 GCC, code generation controlled by this option will change to reflect
22588 the processors
22589 that are most common at the time that version of GCC is released.
22590
22591 There is no @option{-march=generic} option because @option{-march}
22592 indicates the instruction set the compiler can use, and there is no
22593 generic instruction set applicable to all processors.  In contrast,
22594 @option{-mtune} indicates the processor (or, in this case, collection of
22595 processors) for which the code is optimized.
22596
22597 @item intel
22598 Produce code optimized for the most current Intel processors, which are
22599 Haswell and Silvermont for this version of GCC.  If you know the CPU
22600 on which your code will run, then you should use the corresponding
22601 @option{-mtune} or @option{-march} option instead of @option{-mtune=intel}.
22602 But, if you want your application performs better on both Haswell and
22603 Silvermont, then you should use this option.
22604
22605 As new Intel processors are deployed in the marketplace, the behavior of
22606 this option will change.  Therefore, if you upgrade to a newer version of
22607 GCC, code generation controlled by this option will change to reflect
22608 the most current Intel processors at the time that version of GCC is
22609 released.
22610
22611 There is no @option{-march=intel} option because @option{-march} indicates
22612 the instruction set the compiler can use, and there is no common
22613 instruction set applicable to all processors.  In contrast,
22614 @option{-mtune} indicates the processor (or, in this case, collection of
22615 processors) for which the code is optimized.
22616 @end table
22617
22618 @item -mcpu=@var{cpu-type}
22619 @opindex mcpu
22620 A deprecated synonym for @option{-mtune}.
22621
22622 @item -mfpmath=@var{unit}
22623 @opindex mfpmath
22624 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
22625 for @var{unit} are:
22626
22627 @table @samp
22628 @item 387
22629 Use the standard 387 floating-point coprocessor present on the majority of chips and
22630 emulated otherwise.  Code compiled with this option runs almost everywhere.
22631 The temporary results are computed in 80-bit precision instead of the precision
22632 specified by the type, resulting in slightly different results compared to most
22633 of other chips.  See @option{-ffloat-store} for more detailed description.
22634
22635 This is the default choice for x86-32 targets.
22636
22637 @item sse
22638 Use scalar floating-point instructions present in the SSE instruction set.
22639 This instruction set is supported by Pentium III and newer chips,
22640 and in the AMD line
22641 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
22642 instruction set supports only single-precision arithmetic, thus the double and
22643 extended-precision arithmetic are still done using 387.  A later version, present
22644 only in Pentium 4 and AMD x86-64 chips, supports double-precision
22645 arithmetic too.
22646
22647 For the x86-32 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
22648 or @option{-msse2} switches to enable SSE extensions and make this option
22649 effective.  For the x86-64 compiler, these extensions are enabled by default.
22650
22651 The resulting code should be considerably faster in the majority of cases and avoid
22652 the numerical instability problems of 387 code, but may break some existing
22653 code that expects temporaries to be 80 bits.
22654
22655 This is the default choice for the x86-64 compiler.
22656
22657 @item sse,387
22658 @itemx sse+387
22659 @itemx both
22660 Attempt to utilize both instruction sets at once.  This effectively doubles the
22661 amount of available registers, and on chips with separate execution units for
22662 387 and SSE the execution resources too.  Use this option with care, as it is
22663 still experimental, because the GCC register allocator does not model separate
22664 functional units well, resulting in unstable performance.
22665 @end table
22666
22667 @item -masm=@var{dialect}
22668 @opindex masm=@var{dialect}
22669 Output assembly instructions using selected @var{dialect}.  Also affects
22670 which dialect is used for basic @code{asm} (@pxref{Basic Asm}) and
22671 extended @code{asm} (@pxref{Extended Asm}). Supported choices (in dialect
22672 order) are @samp{att} or @samp{intel}. The default is @samp{att}. Darwin does
22673 not support @samp{intel}.
22674
22675 @item -mieee-fp
22676 @itemx -mno-ieee-fp
22677 @opindex mieee-fp
22678 @opindex mno-ieee-fp
22679 Control whether or not the compiler uses IEEE floating-point
22680 comparisons.  These correctly handle the case where the result of a
22681 comparison is unordered.
22682
22683 @item -msoft-float
22684 @opindex msoft-float
22685 Generate output containing library calls for floating point.
22686
22687 @strong{Warning:} the requisite libraries are not part of GCC@.
22688 Normally the facilities of the machine's usual C compiler are used, but
22689 this can't be done directly in cross-compilation.  You must make your
22690 own arrangements to provide suitable library functions for
22691 cross-compilation.
22692
22693 On machines where a function returns floating-point results in the 80387
22694 register stack, some floating-point opcodes may be emitted even if
22695 @option{-msoft-float} is used.
22696
22697 @item -mno-fp-ret-in-387
22698 @opindex mno-fp-ret-in-387
22699 Do not use the FPU registers for return values of functions.
22700
22701 The usual calling convention has functions return values of types
22702 @code{float} and @code{double} in an FPU register, even if there
22703 is no FPU@.  The idea is that the operating system should emulate
22704 an FPU@.
22705
22706 The option @option{-mno-fp-ret-in-387} causes such values to be returned
22707 in ordinary CPU registers instead.
22708
22709 @item -mno-fancy-math-387
22710 @opindex mno-fancy-math-387
22711 Some 387 emulators do not support the @code{sin}, @code{cos} and
22712 @code{sqrt} instructions for the 387.  Specify this option to avoid
22713 generating those instructions.  This option is the default on
22714 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
22715 indicates that the target CPU always has an FPU and so the
22716 instruction does not need emulation.  These
22717 instructions are not generated unless you also use the
22718 @option{-funsafe-math-optimizations} switch.
22719
22720 @item -malign-double
22721 @itemx -mno-align-double
22722 @opindex malign-double
22723 @opindex mno-align-double
22724 Control whether GCC aligns @code{double}, @code{long double}, and
22725 @code{long long} variables on a two-word boundary or a one-word
22726 boundary.  Aligning @code{double} variables on a two-word boundary
22727 produces code that runs somewhat faster on a Pentium at the
22728 expense of more memory.
22729
22730 On x86-64, @option{-malign-double} is enabled by default.
22731
22732 @strong{Warning:} if you use the @option{-malign-double} switch,
22733 structures containing the above types are aligned differently than
22734 the published application binary interface specifications for the x86-32
22735 and are not binary compatible with structures in code compiled
22736 without that switch.
22737
22738 @item -m96bit-long-double
22739 @itemx -m128bit-long-double
22740 @opindex m96bit-long-double
22741 @opindex m128bit-long-double
22742 These switches control the size of @code{long double} type.  The x86-32
22743 application binary interface specifies the size to be 96 bits,
22744 so @option{-m96bit-long-double} is the default in 32-bit mode.
22745
22746 Modern architectures (Pentium and newer) prefer @code{long double}
22747 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
22748 conforming to the ABI, this is not possible.  So specifying
22749 @option{-m128bit-long-double} aligns @code{long double}
22750 to a 16-byte boundary by padding the @code{long double} with an additional
22751 32-bit zero.
22752
22753 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
22754 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
22755
22756 Notice that neither of these options enable any extra precision over the x87
22757 standard of 80 bits for a @code{long double}.
22758
22759 @strong{Warning:} if you override the default value for your target ABI, this
22760 changes the size of 
22761 structures and arrays containing @code{long double} variables,
22762 as well as modifying the function calling convention for functions taking
22763 @code{long double}.  Hence they are not binary-compatible
22764 with code compiled without that switch.
22765
22766 @item -mlong-double-64
22767 @itemx -mlong-double-80
22768 @itemx -mlong-double-128
22769 @opindex mlong-double-64
22770 @opindex mlong-double-80
22771 @opindex mlong-double-128
22772 These switches control the size of @code{long double} type. A size
22773 of 64 bits makes the @code{long double} type equivalent to the @code{double}
22774 type. This is the default for 32-bit Bionic C library.  A size
22775 of 128 bits makes the @code{long double} type equivalent to the
22776 @code{__float128} type. This is the default for 64-bit Bionic C library.
22777
22778 @strong{Warning:} if you override the default value for your target ABI, this
22779 changes the size of
22780 structures and arrays containing @code{long double} variables,
22781 as well as modifying the function calling convention for functions taking
22782 @code{long double}.  Hence they are not binary-compatible
22783 with code compiled without that switch.
22784
22785 @item -malign-data=@var{type}
22786 @opindex malign-data
22787 Control how GCC aligns variables.  Supported values for @var{type} are
22788 @samp{compat} uses increased alignment value compatible uses GCC 4.8
22789 and earlier, @samp{abi} uses alignment value as specified by the
22790 psABI, and @samp{cacheline} uses increased alignment value to match
22791 the cache line size.  @samp{compat} is the default.
22792
22793 @item -mlarge-data-threshold=@var{threshold}
22794 @opindex mlarge-data-threshold
22795 When @option{-mcmodel=medium} is specified, data objects larger than
22796 @var{threshold} are placed in the large data section.  This value must be the
22797 same across all objects linked into the binary, and defaults to 65535.
22798
22799 @item -mrtd
22800 @opindex mrtd
22801 Use a different function-calling convention, in which functions that
22802 take a fixed number of arguments return with the @code{ret @var{num}}
22803 instruction, which pops their arguments while returning.  This saves one
22804 instruction in the caller since there is no need to pop the arguments
22805 there.
22806
22807 You can specify that an individual function is called with this calling
22808 sequence with the function attribute @code{stdcall}.  You can also
22809 override the @option{-mrtd} option by using the function attribute
22810 @code{cdecl}.  @xref{Function Attributes}.
22811
22812 @strong{Warning:} this calling convention is incompatible with the one
22813 normally used on Unix, so you cannot use it if you need to call
22814 libraries compiled with the Unix compiler.
22815
22816 Also, you must provide function prototypes for all functions that
22817 take variable numbers of arguments (including @code{printf});
22818 otherwise incorrect code is generated for calls to those
22819 functions.
22820
22821 In addition, seriously incorrect code results if you call a
22822 function with too many arguments.  (Normally, extra arguments are
22823 harmlessly ignored.)
22824
22825 @item -mregparm=@var{num}
22826 @opindex mregparm
22827 Control how many registers are used to pass integer arguments.  By
22828 default, no registers are used to pass arguments, and at most 3
22829 registers can be used.  You can control this behavior for a specific
22830 function by using the function attribute @code{regparm}.
22831 @xref{Function Attributes}.
22832
22833 @strong{Warning:} if you use this switch, and
22834 @var{num} is nonzero, then you must build all modules with the same
22835 value, including any libraries.  This includes the system libraries and
22836 startup modules.
22837
22838 @item -msseregparm
22839 @opindex msseregparm
22840 Use SSE register passing conventions for float and double arguments
22841 and return values.  You can control this behavior for a specific
22842 function by using the function attribute @code{sseregparm}.
22843 @xref{Function Attributes}.
22844
22845 @strong{Warning:} if you use this switch then you must build all
22846 modules with the same value, including any libraries.  This includes
22847 the system libraries and startup modules.
22848
22849 @item -mvect8-ret-in-mem
22850 @opindex mvect8-ret-in-mem
22851 Return 8-byte vectors in memory instead of MMX registers.  This is the
22852 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
22853 Studio compilers until version 12.  Later compiler versions (starting
22854 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
22855 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
22856 you need to remain compatible with existing code produced by those
22857 previous compiler versions or older versions of GCC@.
22858
22859 @item -mpc32
22860 @itemx -mpc64
22861 @itemx -mpc80
22862 @opindex mpc32
22863 @opindex mpc64
22864 @opindex mpc80
22865
22866 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
22867 is specified, the significands of results of floating-point operations are
22868 rounded to 24 bits (single precision); @option{-mpc64} rounds the
22869 significands of results of floating-point operations to 53 bits (double
22870 precision) and @option{-mpc80} rounds the significands of results of
22871 floating-point operations to 64 bits (extended double precision), which is
22872 the default.  When this option is used, floating-point operations in higher
22873 precisions are not available to the programmer without setting the FPU
22874 control word explicitly.
22875
22876 Setting the rounding of floating-point operations to less than the default
22877 80 bits can speed some programs by 2% or more.  Note that some mathematical
22878 libraries assume that extended-precision (80-bit) floating-point operations
22879 are enabled by default; routines in such libraries could suffer significant
22880 loss of accuracy, typically through so-called ``catastrophic cancellation'',
22881 when this option is used to set the precision to less than extended precision.
22882
22883 @item -mstackrealign
22884 @opindex mstackrealign
22885 Realign the stack at entry.  On the x86, the @option{-mstackrealign}
22886 option generates an alternate prologue and epilogue that realigns the
22887 run-time stack if necessary.  This supports mixing legacy codes that keep
22888 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
22889 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
22890 applicable to individual functions.
22891
22892 @item -mpreferred-stack-boundary=@var{num}
22893 @opindex mpreferred-stack-boundary
22894 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
22895 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
22896 the default is 4 (16 bytes or 128 bits).
22897
22898 @strong{Warning:} When generating code for the x86-64 architecture with
22899 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
22900 used to keep the stack boundary aligned to 8 byte boundary.  Since
22901 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
22902 intended to be used in controlled environment where stack space is
22903 important limitation.  This option leads to wrong code when functions
22904 compiled with 16 byte stack alignment (such as functions from a standard
22905 library) are called with misaligned stack.  In this case, SSE
22906 instructions may lead to misaligned memory access traps.  In addition,
22907 variable arguments are handled incorrectly for 16 byte aligned
22908 objects (including x87 long double and __int128), leading to wrong
22909 results.  You must build all modules with
22910 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
22911 includes the system libraries and startup modules.
22912
22913 @item -mincoming-stack-boundary=@var{num}
22914 @opindex mincoming-stack-boundary
22915 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
22916 boundary.  If @option{-mincoming-stack-boundary} is not specified,
22917 the one specified by @option{-mpreferred-stack-boundary} is used.
22918
22919 On Pentium and Pentium Pro, @code{double} and @code{long double} values
22920 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
22921 suffer significant run time performance penalties.  On Pentium III, the
22922 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
22923 properly if it is not 16-byte aligned.
22924
22925 To ensure proper alignment of this values on the stack, the stack boundary
22926 must be as aligned as that required by any value stored on the stack.
22927 Further, every function must be generated such that it keeps the stack
22928 aligned.  Thus calling a function compiled with a higher preferred
22929 stack boundary from a function compiled with a lower preferred stack
22930 boundary most likely misaligns the stack.  It is recommended that
22931 libraries that use callbacks always use the default setting.
22932
22933 This extra alignment does consume extra stack space, and generally
22934 increases code size.  Code that is sensitive to stack space usage, such
22935 as embedded systems and operating system kernels, may want to reduce the
22936 preferred alignment to @option{-mpreferred-stack-boundary=2}.
22937
22938 @need 200
22939 @item -mmmx
22940 @opindex mmmx
22941 @need 200
22942 @itemx -msse
22943 @opindex msse
22944 @need 200
22945 @itemx -msse2
22946 @opindex msse2
22947 @need 200
22948 @itemx -msse3
22949 @opindex msse3
22950 @need 200
22951 @itemx -mssse3
22952 @opindex mssse3
22953 @need 200
22954 @itemx -msse4
22955 @opindex msse4
22956 @need 200
22957 @itemx -msse4a
22958 @opindex msse4a
22959 @need 200
22960 @itemx -msse4.1
22961 @opindex msse4.1
22962 @need 200
22963 @itemx -msse4.2
22964 @opindex msse4.2
22965 @need 200
22966 @itemx -mavx
22967 @opindex mavx
22968 @need 200
22969 @itemx -mavx2
22970 @opindex mavx2
22971 @need 200
22972 @itemx -mavx512f
22973 @opindex mavx512f
22974 @need 200
22975 @itemx -mavx512pf
22976 @opindex mavx512pf
22977 @need 200
22978 @itemx -mavx512er
22979 @opindex mavx512er
22980 @need 200
22981 @itemx -mavx512cd
22982 @opindex mavx512cd
22983 @need 200
22984 @itemx -mavx512vl
22985 @opindex mavx512vl
22986 @need 200
22987 @itemx -mavx512bw
22988 @opindex mavx512bw
22989 @need 200
22990 @itemx -mavx512dq
22991 @opindex mavx512dq
22992 @need 200
22993 @itemx -mavx512ifma
22994 @opindex mavx512ifma
22995 @need 200
22996 @itemx -mavx512vbmi
22997 @opindex mavx512vbmi
22998 @need 200
22999 @itemx -msha
23000 @opindex msha
23001 @need 200
23002 @itemx -maes
23003 @opindex maes
23004 @need 200
23005 @itemx -mpclmul
23006 @opindex mpclmul
23007 @need 200
23008 @itemx -mclfushopt
23009 @opindex mclfushopt
23010 @need 200
23011 @itemx -mfsgsbase
23012 @opindex mfsgsbase
23013 @need 200
23014 @itemx -mrdrnd
23015 @opindex mrdrnd
23016 @need 200
23017 @itemx -mf16c
23018 @opindex mf16c
23019 @need 200
23020 @itemx -mfma
23021 @opindex mfma
23022 @need 200
23023 @itemx -mfma4
23024 @opindex mfma4
23025 @need 200
23026 @itemx -mno-fma4
23027 @opindex mno-fma4
23028 @need 200
23029 @itemx -mprefetchwt1
23030 @opindex mprefetchwt1
23031 @need 200
23032 @itemx -mxop
23033 @opindex mxop
23034 @need 200
23035 @itemx -mlwp
23036 @opindex mlwp
23037 @need 200
23038 @itemx -m3dnow
23039 @opindex m3dnow
23040 @need 200
23041 @itemx -mpopcnt
23042 @opindex mpopcnt
23043 @need 200
23044 @itemx -mabm
23045 @opindex mabm
23046 @need 200
23047 @itemx -mbmi
23048 @opindex mbmi
23049 @need 200
23050 @itemx -mbmi2
23051 @need 200
23052 @itemx -mlzcnt
23053 @opindex mlzcnt
23054 @need 200
23055 @itemx -mfxsr
23056 @opindex mfxsr
23057 @need 200
23058 @itemx -mxsave
23059 @opindex mxsave
23060 @need 200
23061 @itemx -mxsaveopt
23062 @opindex mxsaveopt
23063 @need 200
23064 @itemx -mxsavec
23065 @opindex mxsavec
23066 @need 200
23067 @itemx -mxsaves
23068 @opindex mxsaves
23069 @need 200
23070 @itemx -mrtm
23071 @opindex mrtm
23072 @need 200
23073 @itemx -mtbm
23074 @opindex mtbm
23075 @need 200
23076 @itemx -mmpx
23077 @opindex mmpx
23078 @need 200
23079 @itemx -mmwaitx
23080 @opindex mmwaitx
23081 These switches enable the use of instructions in the MMX, SSE,
23082 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER, AVX512CD,
23083 SHA, AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A, FMA4, XOP, LWP, ABM,
23084 AVX512VL, AVX512BW, AVX512DQ, AVX512IFMA AVX512VBMI, BMI, BMI2, FXSR,
23085 XSAVE, XSAVEOPT, LZCNT, RTM, MPX, MWAITX or 3DNow!@:
23086 extended instruction sets.  Each has a corresponding @option{-mno-} option
23087 to disable use of these instructions.
23088
23089 These extensions are also available as built-in functions: see
23090 @ref{x86 Built-in Functions}, for details of the functions enabled and
23091 disabled by these switches.
23092
23093 To generate SSE/SSE2 instructions automatically from floating-point
23094 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
23095
23096 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
23097 generates new AVX instructions or AVX equivalence for all SSEx instructions
23098 when needed.
23099
23100 These options enable GCC to use these extended instructions in
23101 generated code, even without @option{-mfpmath=sse}.  Applications that
23102 perform run-time CPU detection must compile separate files for each
23103 supported architecture, using the appropriate flags.  In particular,
23104 the file containing the CPU detection code should be compiled without
23105 these options.
23106
23107 @item -mdump-tune-features
23108 @opindex mdump-tune-features
23109 This option instructs GCC to dump the names of the x86 performance 
23110 tuning features and default settings. The names can be used in 
23111 @option{-mtune-ctrl=@var{feature-list}}.
23112
23113 @item -mtune-ctrl=@var{feature-list}
23114 @opindex mtune-ctrl=@var{feature-list}
23115 This option is used to do fine grain control of x86 code generation features.
23116 @var{feature-list} is a comma separated list of @var{feature} names. See also
23117 @option{-mdump-tune-features}. When specified, the @var{feature} is turned
23118 on if it is not preceded with @samp{^}, otherwise, it is turned off. 
23119 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
23120 developers. Using it may lead to code paths not covered by testing and can
23121 potentially result in compiler ICEs or runtime errors.
23122
23123 @item -mno-default
23124 @opindex mno-default
23125 This option instructs GCC to turn off all tunable features. See also 
23126 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
23127
23128 @item -mcld
23129 @opindex mcld
23130 This option instructs GCC to emit a @code{cld} instruction in the prologue
23131 of functions that use string instructions.  String instructions depend on
23132 the DF flag to select between autoincrement or autodecrement mode.  While the
23133 ABI specifies the DF flag to be cleared on function entry, some operating
23134 systems violate this specification by not clearing the DF flag in their
23135 exception dispatchers.  The exception handler can be invoked with the DF flag
23136 set, which leads to wrong direction mode when string instructions are used.
23137 This option can be enabled by default on 32-bit x86 targets by configuring
23138 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
23139 instructions can be suppressed with the @option{-mno-cld} compiler option
23140 in this case.
23141
23142 @item -mvzeroupper
23143 @opindex mvzeroupper
23144 This option instructs GCC to emit a @code{vzeroupper} instruction
23145 before a transfer of control flow out of the function to minimize
23146 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
23147 intrinsics.
23148
23149 @item -mprefer-avx128
23150 @opindex mprefer-avx128
23151 This option instructs GCC to use 128-bit AVX instructions instead of
23152 256-bit AVX instructions in the auto-vectorizer.
23153
23154 @item -mcx16
23155 @opindex mcx16
23156 This option enables GCC to generate @code{CMPXCHG16B} instructions.
23157 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
23158 (or oword) data types.  
23159 This is useful for high-resolution counters that can be updated
23160 by multiple processors (or cores).  This instruction is generated as part of
23161 atomic built-in functions: see @ref{__sync Builtins} or
23162 @ref{__atomic Builtins} for details.
23163
23164 @item -msahf
23165 @opindex msahf
23166 This option enables generation of @code{SAHF} instructions in 64-bit code.
23167 Early Intel Pentium 4 CPUs with Intel 64 support,
23168 prior to the introduction of Pentium 4 G1 step in December 2005,
23169 lacked the @code{LAHF} and @code{SAHF} instructions
23170 which are supported by AMD64.
23171 These are load and store instructions, respectively, for certain status flags.
23172 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
23173 @code{drem}, and @code{remainder} built-in functions;
23174 see @ref{Other Builtins} for details.
23175
23176 @item -mmovbe
23177 @opindex mmovbe
23178 This option enables use of the @code{movbe} instruction to implement
23179 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
23180
23181 @item -mcrc32
23182 @opindex mcrc32
23183 This option enables built-in functions @code{__builtin_ia32_crc32qi},
23184 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
23185 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
23186
23187 @item -mrecip
23188 @opindex mrecip
23189 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
23190 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
23191 with an additional Newton-Raphson step
23192 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
23193 (and their vectorized
23194 variants) for single-precision floating-point arguments.  These instructions
23195 are generated only when @option{-funsafe-math-optimizations} is enabled
23196 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
23197 Note that while the throughput of the sequence is higher than the throughput
23198 of the non-reciprocal instruction, the precision of the sequence can be
23199 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
23200
23201 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
23202 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
23203 combination), and doesn't need @option{-mrecip}.
23204
23205 Also note that GCC emits the above sequence with additional Newton-Raphson step
23206 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
23207 already with @option{-ffast-math} (or the above option combination), and
23208 doesn't need @option{-mrecip}.
23209
23210 @item -mrecip=@var{opt}
23211 @opindex mrecip=opt
23212 This option controls which reciprocal estimate instructions
23213 may be used.  @var{opt} is a comma-separated list of options, which may
23214 be preceded by a @samp{!} to invert the option:
23215
23216 @table @samp
23217 @item all
23218 Enable all estimate instructions.
23219
23220 @item default
23221 Enable the default instructions, equivalent to @option{-mrecip}.
23222
23223 @item none
23224 Disable all estimate instructions, equivalent to @option{-mno-recip}.
23225
23226 @item div
23227 Enable the approximation for scalar division.
23228
23229 @item vec-div
23230 Enable the approximation for vectorized division.
23231
23232 @item sqrt
23233 Enable the approximation for scalar square root.
23234
23235 @item vec-sqrt
23236 Enable the approximation for vectorized square root.
23237 @end table
23238
23239 So, for example, @option{-mrecip=all,!sqrt} enables
23240 all of the reciprocal approximations, except for square root.
23241
23242 @item -mveclibabi=@var{type}
23243 @opindex mveclibabi
23244 Specifies the ABI type to use for vectorizing intrinsics using an
23245 external library.  Supported values for @var{type} are @samp{svml} 
23246 for the Intel short
23247 vector math library and @samp{acml} for the AMD math core library.
23248 To use this option, both @option{-ftree-vectorize} and
23249 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
23250 ABI-compatible library must be specified at link time.
23251
23252 GCC currently emits calls to @code{vmldExp2},
23253 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
23254 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
23255 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
23256 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
23257 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
23258 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
23259 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
23260 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
23261 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
23262 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
23263 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
23264 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
23265 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
23266 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
23267 when @option{-mveclibabi=acml} is used.  
23268
23269 @item -mabi=@var{name}
23270 @opindex mabi
23271 Generate code for the specified calling convention.  Permissible values
23272 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
23273 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
23274 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
23275 You can control this behavior for specific functions by
23276 using the function attributes @code{ms_abi} and @code{sysv_abi}.
23277 @xref{Function Attributes}.
23278
23279 @item -mtls-dialect=@var{type}
23280 @opindex mtls-dialect
23281 Generate code to access thread-local storage using the @samp{gnu} or
23282 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
23283 @samp{gnu2} is more efficient, but it may add compile- and run-time
23284 requirements that cannot be satisfied on all systems.
23285
23286 @item -mpush-args
23287 @itemx -mno-push-args
23288 @opindex mpush-args
23289 @opindex mno-push-args
23290 Use PUSH operations to store outgoing parameters.  This method is shorter
23291 and usually equally fast as method using SUB/MOV operations and is enabled
23292 by default.  In some cases disabling it may improve performance because of
23293 improved scheduling and reduced dependencies.
23294
23295 @item -maccumulate-outgoing-args
23296 @opindex maccumulate-outgoing-args
23297 If enabled, the maximum amount of space required for outgoing arguments is
23298 computed in the function prologue.  This is faster on most modern CPUs
23299 because of reduced dependencies, improved scheduling and reduced stack usage
23300 when the preferred stack boundary is not equal to 2.  The drawback is a notable
23301 increase in code size.  This switch implies @option{-mno-push-args}.
23302
23303 @item -mthreads
23304 @opindex mthreads
23305 Support thread-safe exception handling on MinGW.  Programs that rely
23306 on thread-safe exception handling must compile and link all code with the
23307 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
23308 @option{-D_MT}; when linking, it links in a special thread helper library
23309 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
23310
23311 @item -mno-align-stringops
23312 @opindex mno-align-stringops
23313 Do not align the destination of inlined string operations.  This switch reduces
23314 code size and improves performance in case the destination is already aligned,
23315 but GCC doesn't know about it.
23316
23317 @item -minline-all-stringops
23318 @opindex minline-all-stringops
23319 By default GCC inlines string operations only when the destination is 
23320 known to be aligned to least a 4-byte boundary.  
23321 This enables more inlining and increases code
23322 size, but may improve performance of code that depends on fast
23323 @code{memcpy}, @code{strlen},
23324 and @code{memset} for short lengths.
23325
23326 @item -minline-stringops-dynamically
23327 @opindex minline-stringops-dynamically
23328 For string operations of unknown size, use run-time checks with
23329 inline code for small blocks and a library call for large blocks.
23330
23331 @item -mstringop-strategy=@var{alg}
23332 @opindex mstringop-strategy=@var{alg}
23333 Override the internal decision heuristic for the particular algorithm to use
23334 for inlining string operations.  The allowed values for @var{alg} are:
23335
23336 @table @samp
23337 @item rep_byte
23338 @itemx rep_4byte
23339 @itemx rep_8byte
23340 Expand using i386 @code{rep} prefix of the specified size.
23341
23342 @item byte_loop
23343 @itemx loop
23344 @itemx unrolled_loop
23345 Expand into an inline loop.
23346
23347 @item libcall
23348 Always use a library call.
23349 @end table
23350
23351 @item -mmemcpy-strategy=@var{strategy}
23352 @opindex mmemcpy-strategy=@var{strategy}
23353 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
23354 should be inlined and what inline algorithm to use when the expected size
23355 of the copy operation is known. @var{strategy} 
23356 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
23357 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
23358 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
23359 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
23360 in the list must be specified in increasing order.  The minimal byte size for 
23361 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
23362 preceding range.
23363
23364 @item -mmemset-strategy=@var{strategy}
23365 @opindex mmemset-strategy=@var{strategy}
23366 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
23367 @code{__builtin_memset} expansion.
23368
23369 @item -momit-leaf-frame-pointer
23370 @opindex momit-leaf-frame-pointer
23371 Don't keep the frame pointer in a register for leaf functions.  This
23372 avoids the instructions to save, set up, and restore frame pointers and
23373 makes an extra register available in leaf functions.  The option
23374 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
23375 which might make debugging harder.
23376
23377 @item -mtls-direct-seg-refs
23378 @itemx -mno-tls-direct-seg-refs
23379 @opindex mtls-direct-seg-refs
23380 Controls whether TLS variables may be accessed with offsets from the
23381 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
23382 or whether the thread base pointer must be added.  Whether or not this
23383 is valid depends on the operating system, and whether it maps the
23384 segment to cover the entire TLS area.
23385
23386 For systems that use the GNU C Library, the default is on.
23387
23388 @item -msse2avx
23389 @itemx -mno-sse2avx
23390 @opindex msse2avx
23391 Specify that the assembler should encode SSE instructions with VEX
23392 prefix.  The option @option{-mavx} turns this on by default.
23393
23394 @item -mfentry
23395 @itemx -mno-fentry
23396 @opindex mfentry
23397 If profiling is active (@option{-pg}), put the profiling
23398 counter call before the prologue.
23399 Note: On x86 architectures the attribute @code{ms_hook_prologue}
23400 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
23401
23402 @item -mrecord-mcount
23403 @itemx -mno-record-mcount
23404 @opindex mrecord-mcount
23405 If profiling is active (@option{-pg}), generate a __mcount_loc section
23406 that contains pointers to each profiling call. This is useful for
23407 automatically patching and out calls.
23408
23409 @item -mnop-mcount
23410 @itemx -mno-nop-mcount
23411 @opindex mnop-mcount
23412 If profiling is active (@option{-pg}), generate the calls to
23413 the profiling functions as nops. This is useful when they
23414 should be patched in later dynamically. This is likely only
23415 useful together with @option{-mrecord-mcount}.
23416
23417 @item -mskip-rax-setup
23418 @itemx -mno-skip-rax-setup
23419 @opindex mskip-rax-setup
23420 When generating code for the x86-64 architecture with SSE extensions
23421 disabled, @option{-skip-rax-setup} can be used to skip setting up RAX
23422 register when there are no variable arguments passed in vector registers.
23423
23424 @strong{Warning:} Since RAX register is used to avoid unnecessarily
23425 saving vector registers on stack when passing variable arguments, the
23426 impacts of this option are callees may waste some stack space,
23427 misbehave or jump to a random location.  GCC 4.4 or newer don't have
23428 those issues, regardless the RAX register value.
23429
23430 @item -m8bit-idiv
23431 @itemx -mno-8bit-idiv
23432 @opindex m8bit-idiv
23433 On some processors, like Intel Atom, 8-bit unsigned integer divide is
23434 much faster than 32-bit/64-bit integer divide.  This option generates a
23435 run-time check.  If both dividend and divisor are within range of 0
23436 to 255, 8-bit unsigned integer divide is used instead of
23437 32-bit/64-bit integer divide.
23438
23439 @item -mavx256-split-unaligned-load
23440 @itemx -mavx256-split-unaligned-store
23441 @opindex mavx256-split-unaligned-load
23442 @opindex mavx256-split-unaligned-store
23443 Split 32-byte AVX unaligned load and store.
23444
23445 @item -mstack-protector-guard=@var{guard}
23446 @opindex mstack-protector-guard=@var{guard}
23447 Generate stack protection code using canary at @var{guard}.  Supported
23448 locations are @samp{global} for global canary or @samp{tls} for per-thread
23449 canary in the TLS block (the default).  This option has effect only when
23450 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
23451
23452 @end table
23453
23454 These @samp{-m} switches are supported in addition to the above
23455 on x86-64 processors in 64-bit environments.
23456
23457 @table @gcctabopt
23458 @item -m32
23459 @itemx -m64
23460 @itemx -mx32
23461 @itemx -m16
23462 @itemx -miamcu
23463 @opindex m32
23464 @opindex m64
23465 @opindex mx32
23466 @opindex m16
23467 @opindex miamcu
23468 Generate code for a 16-bit, 32-bit or 64-bit environment.
23469 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
23470 to 32 bits, and
23471 generates code that runs on any i386 system.
23472
23473 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
23474 types to 64 bits, and generates code for the x86-64 architecture.
23475 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
23476 and @option{-mdynamic-no-pic} options.
23477
23478 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
23479 to 32 bits, and
23480 generates code for the x86-64 architecture.
23481
23482 The @option{-m16} option is the same as @option{-m32}, except for that
23483 it outputs the @code{.code16gcc} assembly directive at the beginning of
23484 the assembly output so that the binary can run in 16-bit mode.
23485
23486 The @option{-miamcu} option generates code which conforms to Intel MCU
23487 psABI.  It requires the @option{-m32} option to be turned on.
23488
23489 @item -mno-red-zone
23490 @opindex mno-red-zone
23491 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
23492 by the x86-64 ABI; it is a 128-byte area beyond the location of the
23493 stack pointer that is not modified by signal or interrupt handlers
23494 and therefore can be used for temporary data without adjusting the stack
23495 pointer.  The flag @option{-mno-red-zone} disables this red zone.
23496
23497 @item -mcmodel=small
23498 @opindex mcmodel=small
23499 Generate code for the small code model: the program and its symbols must
23500 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
23501 Programs can be statically or dynamically linked.  This is the default
23502 code model.
23503
23504 @item -mcmodel=kernel
23505 @opindex mcmodel=kernel
23506 Generate code for the kernel code model.  The kernel runs in the
23507 negative 2 GB of the address space.
23508 This model has to be used for Linux kernel code.
23509
23510 @item -mcmodel=medium
23511 @opindex mcmodel=medium
23512 Generate code for the medium model: the program is linked in the lower 2
23513 GB of the address space.  Small symbols are also placed there.  Symbols
23514 with sizes larger than @option{-mlarge-data-threshold} are put into
23515 large data or BSS sections and can be located above 2GB.  Programs can
23516 be statically or dynamically linked.
23517
23518 @item -mcmodel=large
23519 @opindex mcmodel=large
23520 Generate code for the large model.  This model makes no assumptions
23521 about addresses and sizes of sections.
23522
23523 @item -maddress-mode=long
23524 @opindex maddress-mode=long
23525 Generate code for long address mode.  This is only supported for 64-bit
23526 and x32 environments.  It is the default address mode for 64-bit
23527 environments.
23528
23529 @item -maddress-mode=short
23530 @opindex maddress-mode=short
23531 Generate code for short address mode.  This is only supported for 32-bit
23532 and x32 environments.  It is the default address mode for 32-bit and
23533 x32 environments.
23534 @end table
23535
23536 @node x86 Windows Options
23537 @subsection x86 Windows Options
23538 @cindex x86 Windows Options
23539 @cindex Windows Options for x86
23540
23541 These additional options are available for Microsoft Windows targets:
23542
23543 @table @gcctabopt
23544 @item -mconsole
23545 @opindex mconsole
23546 This option
23547 specifies that a console application is to be generated, by
23548 instructing the linker to set the PE header subsystem type
23549 required for console applications.
23550 This option is available for Cygwin and MinGW targets and is
23551 enabled by default on those targets.
23552
23553 @item -mdll
23554 @opindex mdll
23555 This option is available for Cygwin and MinGW targets.  It
23556 specifies that a DLL---a dynamic link library---is to be
23557 generated, enabling the selection of the required runtime
23558 startup object and entry point.
23559
23560 @item -mnop-fun-dllimport
23561 @opindex mnop-fun-dllimport
23562 This option is available for Cygwin and MinGW targets.  It
23563 specifies that the @code{dllimport} attribute should be ignored.
23564
23565 @item -mthread
23566 @opindex mthread
23567 This option is available for MinGW targets. It specifies
23568 that MinGW-specific thread support is to be used.
23569
23570 @item -municode
23571 @opindex municode
23572 This option is available for MinGW-w64 targets.  It causes
23573 the @code{UNICODE} preprocessor macro to be predefined, and
23574 chooses Unicode-capable runtime startup code.
23575
23576 @item -mwin32
23577 @opindex mwin32
23578 This option is available for Cygwin and MinGW targets.  It
23579 specifies that the typical Microsoft Windows predefined macros are to
23580 be set in the pre-processor, but does not influence the choice
23581 of runtime library/startup code.
23582
23583 @item -mwindows
23584 @opindex mwindows
23585 This option is available for Cygwin and MinGW targets.  It
23586 specifies that a GUI application is to be generated by
23587 instructing the linker to set the PE header subsystem type
23588 appropriately.
23589
23590 @item -fno-set-stack-executable
23591 @opindex fno-set-stack-executable
23592 This option is available for MinGW targets. It specifies that
23593 the executable flag for the stack used by nested functions isn't
23594 set. This is necessary for binaries running in kernel mode of
23595 Microsoft Windows, as there the User32 API, which is used to set executable
23596 privileges, isn't available.
23597
23598 @item -fwritable-relocated-rdata
23599 @opindex fno-writable-relocated-rdata
23600 This option is available for MinGW and Cygwin targets.  It specifies
23601 that relocated-data in read-only section is put into .data
23602 section.  This is a necessary for older runtimes not supporting
23603 modification of .rdata sections for pseudo-relocation.
23604
23605 @item -mpe-aligned-commons
23606 @opindex mpe-aligned-commons
23607 This option is available for Cygwin and MinGW targets.  It
23608 specifies that the GNU extension to the PE file format that
23609 permits the correct alignment of COMMON variables should be
23610 used when generating code.  It is enabled by default if
23611 GCC detects that the target assembler found during configuration
23612 supports the feature.
23613 @end table
23614
23615 See also under @ref{x86 Options} for standard options.
23616
23617 @node Xstormy16 Options
23618 @subsection Xstormy16 Options
23619 @cindex Xstormy16 Options
23620
23621 These options are defined for Xstormy16:
23622
23623 @table @gcctabopt
23624 @item -msim
23625 @opindex msim
23626 Choose startup files and linker script suitable for the simulator.
23627 @end table
23628
23629 @node Xtensa Options
23630 @subsection Xtensa Options
23631 @cindex Xtensa Options
23632
23633 These options are supported for Xtensa targets:
23634
23635 @table @gcctabopt
23636 @item -mconst16
23637 @itemx -mno-const16
23638 @opindex mconst16
23639 @opindex mno-const16
23640 Enable or disable use of @code{CONST16} instructions for loading
23641 constant values.  The @code{CONST16} instruction is currently not a
23642 standard option from Tensilica.  When enabled, @code{CONST16}
23643 instructions are always used in place of the standard @code{L32R}
23644 instructions.  The use of @code{CONST16} is enabled by default only if
23645 the @code{L32R} instruction is not available.
23646
23647 @item -mfused-madd
23648 @itemx -mno-fused-madd
23649 @opindex mfused-madd
23650 @opindex mno-fused-madd
23651 Enable or disable use of fused multiply/add and multiply/subtract
23652 instructions in the floating-point option.  This has no effect if the
23653 floating-point option is not also enabled.  Disabling fused multiply/add
23654 and multiply/subtract instructions forces the compiler to use separate
23655 instructions for the multiply and add/subtract operations.  This may be
23656 desirable in some cases where strict IEEE 754-compliant results are
23657 required: the fused multiply add/subtract instructions do not round the
23658 intermediate result, thereby producing results with @emph{more} bits of
23659 precision than specified by the IEEE standard.  Disabling fused multiply
23660 add/subtract instructions also ensures that the program output is not
23661 sensitive to the compiler's ability to combine multiply and add/subtract
23662 operations.
23663
23664 @item -mserialize-volatile
23665 @itemx -mno-serialize-volatile
23666 @opindex mserialize-volatile
23667 @opindex mno-serialize-volatile
23668 When this option is enabled, GCC inserts @code{MEMW} instructions before
23669 @code{volatile} memory references to guarantee sequential consistency.
23670 The default is @option{-mserialize-volatile}.  Use
23671 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
23672
23673 @item -mforce-no-pic
23674 @opindex mforce-no-pic
23675 For targets, like GNU/Linux, where all user-mode Xtensa code must be
23676 position-independent code (PIC), this option disables PIC for compiling
23677 kernel code.
23678
23679 @item -mtext-section-literals
23680 @itemx -mno-text-section-literals
23681 @opindex mtext-section-literals
23682 @opindex mno-text-section-literals
23683 These options control the treatment of literal pools.  The default is
23684 @option{-mno-text-section-literals}, which places literals in a separate
23685 section in the output file.  This allows the literal pool to be placed
23686 in a data RAM/ROM, and it also allows the linker to combine literal
23687 pools from separate object files to remove redundant literals and
23688 improve code size.  With @option{-mtext-section-literals}, the literals
23689 are interspersed in the text section in order to keep them as close as
23690 possible to their references.  This may be necessary for large assembly
23691 files.  Literals for each function are placed right before that function.
23692
23693 @item -mauto-litpools
23694 @itemx -mno-auto-litpools
23695 @opindex mauto-litpools
23696 @opindex mno-auto-litpools
23697 These options control the treatment of literal pools.  The default is
23698 @option{-mno-auto-litpools}, which places literals in a separate
23699 section in the output file unless @option{-mtext-section-literals} is
23700 used.  With @option{-mauto-litpools} the literals are interspersed in
23701 the text section by the assembler.  Compiler does not produce explicit
23702 @code{.literal} directives and loads literals into registers with
23703 @code{MOVI} instructions instead of @code{L32R} to let the assembler
23704 do relaxation and place literals as necessary.  This option allows
23705 assembler to create several literal pools per function and assemble
23706 very big functions, which may not be possible with
23707 @option{-mtext-section-literals}.
23708
23709 @item -mtarget-align
23710 @itemx -mno-target-align
23711 @opindex mtarget-align
23712 @opindex mno-target-align
23713 When this option is enabled, GCC instructs the assembler to
23714 automatically align instructions to reduce branch penalties at the
23715 expense of some code density.  The assembler attempts to widen density
23716 instructions to align branch targets and the instructions following call
23717 instructions.  If there are not enough preceding safe density
23718 instructions to align a target, no widening is performed.  The
23719 default is @option{-mtarget-align}.  These options do not affect the
23720 treatment of auto-aligned instructions like @code{LOOP}, which the
23721 assembler always aligns, either by widening density instructions or
23722 by inserting NOP instructions.
23723
23724 @item -mlongcalls
23725 @itemx -mno-longcalls
23726 @opindex mlongcalls
23727 @opindex mno-longcalls
23728 When this option is enabled, GCC instructs the assembler to translate
23729 direct calls to indirect calls unless it can determine that the target
23730 of a direct call is in the range allowed by the call instruction.  This
23731 translation typically occurs for calls to functions in other source
23732 files.  Specifically, the assembler translates a direct @code{CALL}
23733 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
23734 The default is @option{-mno-longcalls}.  This option should be used in
23735 programs where the call target can potentially be out of range.  This
23736 option is implemented in the assembler, not the compiler, so the
23737 assembly code generated by GCC still shows direct call
23738 instructions---look at the disassembled object code to see the actual
23739 instructions.  Note that the assembler uses an indirect call for
23740 every cross-file call, not just those that really are out of range.
23741 @end table
23742
23743 @node zSeries Options
23744 @subsection zSeries Options
23745 @cindex zSeries options
23746
23747 These are listed under @xref{S/390 and zSeries Options}.
23748
23749 @node Code Gen Options
23750 @section Options for Code Generation Conventions
23751 @cindex code generation conventions
23752 @cindex options, code generation
23753 @cindex run-time options
23754
23755 These machine-independent options control the interface conventions
23756 used in code generation.
23757
23758 Most of them have both positive and negative forms; the negative form
23759 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
23760 one of the forms is listed---the one that is not the default.  You
23761 can figure out the other form by either removing @samp{no-} or adding
23762 it.
23763
23764 @table @gcctabopt
23765 @item -fbounds-check
23766 @opindex fbounds-check
23767 For front ends that support it, generate additional code to check that
23768 indices used to access arrays are within the declared range.  This is
23769 currently only supported by the Java and Fortran front ends, where
23770 this option defaults to true and false respectively.
23771
23772 @item -fstack-reuse=@var{reuse-level}
23773 @opindex fstack_reuse
23774 This option controls stack space reuse for user declared local/auto variables
23775 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
23776 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
23777 local variables and temporaries, @samp{named_vars} enables the reuse only for
23778 user defined local variables with names, and @samp{none} disables stack reuse
23779 completely. The default value is @samp{all}. The option is needed when the
23780 program extends the lifetime of a scoped local variable or a compiler generated
23781 temporary beyond the end point defined by the language.  When a lifetime of
23782 a variable ends, and if the variable lives in memory, the optimizing compiler
23783 has the freedom to reuse its stack space with other temporaries or scoped
23784 local variables whose live range does not overlap with it. Legacy code extending
23785 local lifetime is likely to break with the stack reuse optimization.
23786
23787 For example,
23788
23789 @smallexample
23790    int *p;
23791    @{
23792      int local1;
23793
23794      p = &local1;
23795      local1 = 10;
23796      ....
23797    @}
23798    @{
23799       int local2;
23800       local2 = 20;
23801       ...
23802    @}
23803
23804    if (*p == 10)  // out of scope use of local1
23805      @{
23806
23807      @}
23808 @end smallexample
23809
23810 Another example:
23811 @smallexample
23812
23813    struct A
23814    @{
23815        A(int k) : i(k), j(k) @{ @}
23816        int i;
23817        int j;
23818    @};
23819
23820    A *ap;
23821
23822    void foo(const A& ar)
23823    @{
23824       ap = &ar;
23825    @}
23826
23827    void bar()
23828    @{
23829       foo(A(10)); // temp object's lifetime ends when foo returns
23830
23831       @{
23832         A a(20);
23833         ....
23834       @}
23835       ap->i+= 10;  // ap references out of scope temp whose space
23836                    // is reused with a. What is the value of ap->i?
23837    @}
23838
23839 @end smallexample
23840
23841 The lifetime of a compiler generated temporary is well defined by the C++
23842 standard. When a lifetime of a temporary ends, and if the temporary lives
23843 in memory, the optimizing compiler has the freedom to reuse its stack
23844 space with other temporaries or scoped local variables whose live range
23845 does not overlap with it. However some of the legacy code relies on
23846 the behavior of older compilers in which temporaries' stack space is
23847 not reused, the aggressive stack reuse can lead to runtime errors. This
23848 option is used to control the temporary stack reuse optimization.
23849
23850 @item -ftrapv
23851 @opindex ftrapv
23852 This option generates traps for signed overflow on addition, subtraction,
23853 multiplication operations.
23854 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
23855 @option{-ftrapv} @option{-fwrapv} on the command-line results in
23856 @option{-fwrapv} being effective.  Note that only active options override, so
23857 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
23858 results in @option{-ftrapv} being effective.
23859
23860 @item -fwrapv
23861 @opindex fwrapv
23862 This option instructs the compiler to assume that signed arithmetic
23863 overflow of addition, subtraction and multiplication wraps around
23864 using twos-complement representation.  This flag enables some optimizations
23865 and disables others.  This option is enabled by default for the Java
23866 front end, as required by the Java language specification.
23867 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
23868 @option{-ftrapv} @option{-fwrapv} on the command-line results in
23869 @option{-fwrapv} being effective.  Note that only active options override, so
23870 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
23871 results in @option{-ftrapv} being effective.
23872
23873 @item -fexceptions
23874 @opindex fexceptions
23875 Enable exception handling.  Generates extra code needed to propagate
23876 exceptions.  For some targets, this implies GCC generates frame
23877 unwind information for all functions, which can produce significant data
23878 size overhead, although it does not affect execution.  If you do not
23879 specify this option, GCC enables it by default for languages like
23880 C++ that normally require exception handling, and disables it for
23881 languages like C that do not normally require it.  However, you may need
23882 to enable this option when compiling C code that needs to interoperate
23883 properly with exception handlers written in C++.  You may also wish to
23884 disable this option if you are compiling older C++ programs that don't
23885 use exception handling.
23886
23887 @item -fnon-call-exceptions
23888 @opindex fnon-call-exceptions
23889 Generate code that allows trapping instructions to throw exceptions.
23890 Note that this requires platform-specific runtime support that does
23891 not exist everywhere.  Moreover, it only allows @emph{trapping}
23892 instructions to throw exceptions, i.e.@: memory references or floating-point
23893 instructions.  It does not allow exceptions to be thrown from
23894 arbitrary signal handlers such as @code{SIGALRM}.
23895
23896 @item -fdelete-dead-exceptions
23897 @opindex fdelete-dead-exceptions
23898 Consider that instructions that may throw exceptions but don't otherwise
23899 contribute to the execution of the program can be optimized away.
23900 This option is enabled by default for the Ada front end, as permitted by
23901 the Ada language specification.
23902 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
23903
23904 @item -funwind-tables
23905 @opindex funwind-tables
23906 Similar to @option{-fexceptions}, except that it just generates any needed
23907 static data, but does not affect the generated code in any other way.
23908 You normally do not need to enable this option; instead, a language processor
23909 that needs this handling enables it on your behalf.
23910
23911 @item -fasynchronous-unwind-tables
23912 @opindex fasynchronous-unwind-tables
23913 Generate unwind table in DWARF 2 format, if supported by target machine.  The
23914 table is exact at each instruction boundary, so it can be used for stack
23915 unwinding from asynchronous events (such as debugger or garbage collector).
23916
23917 @item -fno-gnu-unique
23918 @opindex fno-gnu-unique
23919 On systems with recent GNU assembler and C library, the C++ compiler
23920 uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
23921 of template static data members and static local variables in inline
23922 functions are unique even in the presence of @code{RTLD_LOCAL}; this
23923 is necessary to avoid problems with a library used by two different
23924 @code{RTLD_LOCAL} plugins depending on a definition in one of them and
23925 therefore disagreeing with the other one about the binding of the
23926 symbol.  But this causes @code{dlclose} to be ignored for affected
23927 DSOs; if your program relies on reinitialization of a DSO via
23928 @code{dlclose} and @code{dlopen}, you can use
23929 @option{-fno-gnu-unique}.
23930
23931 @item -fpcc-struct-return
23932 @opindex fpcc-struct-return
23933 Return ``short'' @code{struct} and @code{union} values in memory like
23934 longer ones, rather than in registers.  This convention is less
23935 efficient, but it has the advantage of allowing intercallability between
23936 GCC-compiled files and files compiled with other compilers, particularly
23937 the Portable C Compiler (pcc).
23938
23939 The precise convention for returning structures in memory depends
23940 on the target configuration macros.
23941
23942 Short structures and unions are those whose size and alignment match
23943 that of some integer type.
23944
23945 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
23946 switch is not binary compatible with code compiled with the
23947 @option{-freg-struct-return} switch.
23948 Use it to conform to a non-default application binary interface.
23949
23950 @item -freg-struct-return
23951 @opindex freg-struct-return
23952 Return @code{struct} and @code{union} values in registers when possible.
23953 This is more efficient for small structures than
23954 @option{-fpcc-struct-return}.
23955
23956 If you specify neither @option{-fpcc-struct-return} nor
23957 @option{-freg-struct-return}, GCC defaults to whichever convention is
23958 standard for the target.  If there is no standard convention, GCC
23959 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
23960 the principal compiler.  In those cases, we can choose the standard, and
23961 we chose the more efficient register return alternative.
23962
23963 @strong{Warning:} code compiled with the @option{-freg-struct-return}
23964 switch is not binary compatible with code compiled with the
23965 @option{-fpcc-struct-return} switch.
23966 Use it to conform to a non-default application binary interface.
23967
23968 @item -fshort-enums
23969 @opindex fshort-enums
23970 Allocate to an @code{enum} type only as many bytes as it needs for the
23971 declared range of possible values.  Specifically, the @code{enum} type
23972 is equivalent to the smallest integer type that has enough room.
23973
23974 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
23975 code that is not binary compatible with code generated without that switch.
23976 Use it to conform to a non-default application binary interface.
23977
23978 @item -fshort-double
23979 @opindex fshort-double
23980 Use the same size for @code{double} as for @code{float}.
23981
23982 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
23983 code that is not binary compatible with code generated without that switch.
23984 Use it to conform to a non-default application binary interface.
23985
23986 @item -fshort-wchar
23987 @opindex fshort-wchar
23988 Override the underlying type for @code{wchar_t} to be @code{short
23989 unsigned int} instead of the default for the target.  This option is
23990 useful for building programs to run under WINE@.
23991
23992 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
23993 code that is not binary compatible with code generated without that switch.
23994 Use it to conform to a non-default application binary interface.
23995
23996 @item -fno-common
23997 @opindex fno-common
23998 In C code, controls the placement of uninitialized global variables.
23999 Unix C compilers have traditionally permitted multiple definitions of
24000 such variables in different compilation units by placing the variables
24001 in a common block.
24002 This is the behavior specified by @option{-fcommon}, and is the default
24003 for GCC on most targets.
24004 On the other hand, this behavior is not required by ISO C, and on some
24005 targets may carry a speed or code size penalty on variable references.
24006 The @option{-fno-common} option specifies that the compiler should place
24007 uninitialized global variables in the data section of the object file,
24008 rather than generating them as common blocks.
24009 This has the effect that if the same variable is declared
24010 (without @code{extern}) in two different compilations,
24011 you get a multiple-definition error when you link them.
24012 In this case, you must compile with @option{-fcommon} instead.
24013 Compiling with @option{-fno-common} is useful on targets for which
24014 it provides better performance, or if you wish to verify that the
24015 program will work on other systems that always treat uninitialized
24016 variable declarations this way.
24017
24018 @item -fno-ident
24019 @opindex fno-ident
24020 Ignore the @code{#ident} directive.
24021
24022 @item -finhibit-size-directive
24023 @opindex finhibit-size-directive
24024 Don't output a @code{.size} assembler directive, or anything else that
24025 would cause trouble if the function is split in the middle, and the
24026 two halves are placed at locations far apart in memory.  This option is
24027 used when compiling @file{crtstuff.c}; you should not need to use it
24028 for anything else.
24029
24030 @item -fverbose-asm
24031 @opindex fverbose-asm
24032 Put extra commentary information in the generated assembly code to
24033 make it more readable.  This option is generally only of use to those
24034 who actually need to read the generated assembly code (perhaps while
24035 debugging the compiler itself).
24036
24037 @option{-fno-verbose-asm}, the default, causes the
24038 extra information to be omitted and is useful when comparing two assembler
24039 files.
24040
24041 @item -frecord-gcc-switches
24042 @opindex frecord-gcc-switches
24043 This switch causes the command line used to invoke the
24044 compiler to be recorded into the object file that is being created.
24045 This switch is only implemented on some targets and the exact format
24046 of the recording is target and binary file format dependent, but it
24047 usually takes the form of a section containing ASCII text.  This
24048 switch is related to the @option{-fverbose-asm} switch, but that
24049 switch only records information in the assembler output file as
24050 comments, so it never reaches the object file.
24051 See also @option{-grecord-gcc-switches} for another
24052 way of storing compiler options into the object file.
24053
24054 @item -fpic
24055 @opindex fpic
24056 @cindex global offset table
24057 @cindex PIC
24058 Generate position-independent code (PIC) suitable for use in a shared
24059 library, if supported for the target machine.  Such code accesses all
24060 constant addresses through a global offset table (GOT)@.  The dynamic
24061 loader resolves the GOT entries when the program starts (the dynamic
24062 loader is not part of GCC; it is part of the operating system).  If
24063 the GOT size for the linked executable exceeds a machine-specific
24064 maximum size, you get an error message from the linker indicating that
24065 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
24066 instead.  (These maximums are 8k on the SPARC and 32k
24067 on the m68k and RS/6000.  The x86 has no such limit.)
24068
24069 Position-independent code requires special support, and therefore works
24070 only on certain machines.  For the x86, GCC supports PIC for System V
24071 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
24072 position-independent.
24073
24074 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
24075 are defined to 1.
24076
24077 @item -fPIC
24078 @opindex fPIC
24079 If supported for the target machine, emit position-independent code,
24080 suitable for dynamic linking and avoiding any limit on the size of the
24081 global offset table.  This option makes a difference on the m68k,
24082 PowerPC and SPARC@.
24083
24084 Position-independent code requires special support, and therefore works
24085 only on certain machines.
24086
24087 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
24088 are defined to 2.
24089
24090 @item -fpie
24091 @itemx -fPIE
24092 @opindex fpie
24093 @opindex fPIE
24094 These options are similar to @option{-fpic} and @option{-fPIC}, but
24095 generated position independent code can be only linked into executables.
24096 Usually these options are used when @option{-pie} GCC option is
24097 used during linking.
24098
24099 @option{-fpie} and @option{-fPIE} both define the macros
24100 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
24101 for @option{-fpie} and 2 for @option{-fPIE}.
24102
24103 @item -fno-plt
24104 @opindex fno-plt
24105 Do not use PLT for external function calls in position-independent code.
24106 Instead, load callee address at call site from GOT and branch to it.
24107 This leads to more efficient code by eliminating PLT stubs and exposing
24108 GOT load to optimizations.  On architectures such as 32-bit x86 where
24109 PLT stubs expect GOT pointer in a specific register, this gives more
24110 register allocation freedom to the compiler.  Lazy binding requires PLT:
24111 with @option{-fno-plt} all external symbols are resolved at load time.
24112
24113 Alternatively, function attribute @code{noplt} can be used to avoid PLT
24114 for calls to specific external functions by marking those functions with
24115 this attribute.
24116
24117 Additionally, a few targets also convert calls to those functions that are
24118 marked to not use the PLT to use the GOT instead for non-position independent
24119 code.
24120
24121 @item -fno-jump-tables
24122 @opindex fno-jump-tables
24123 Do not use jump tables for switch statements even where it would be
24124 more efficient than other code generation strategies.  This option is
24125 of use in conjunction with @option{-fpic} or @option{-fPIC} for
24126 building code that forms part of a dynamic linker and cannot
24127 reference the address of a jump table.  On some targets, jump tables
24128 do not require a GOT and this option is not needed.
24129
24130 @item -ffixed-@var{reg}
24131 @opindex ffixed
24132 Treat the register named @var{reg} as a fixed register; generated code
24133 should never refer to it (except perhaps as a stack pointer, frame
24134 pointer or in some other fixed role).
24135
24136 @var{reg} must be the name of a register.  The register names accepted
24137 are machine-specific and are defined in the @code{REGISTER_NAMES}
24138 macro in the machine description macro file.
24139
24140 This flag does not have a negative form, because it specifies a
24141 three-way choice.
24142
24143 @item -fcall-used-@var{reg}
24144 @opindex fcall-used
24145 Treat the register named @var{reg} as an allocable register that is
24146 clobbered by function calls.  It may be allocated for temporaries or
24147 variables that do not live across a call.  Functions compiled this way
24148 do not save and restore the register @var{reg}.
24149
24150 It is an error to use this flag with the frame pointer or stack pointer.
24151 Use of this flag for other registers that have fixed pervasive roles in
24152 the machine's execution model produces disastrous results.
24153
24154 This flag does not have a negative form, because it specifies a
24155 three-way choice.
24156
24157 @item -fcall-saved-@var{reg}
24158 @opindex fcall-saved
24159 Treat the register named @var{reg} as an allocable register saved by
24160 functions.  It may be allocated even for temporaries or variables that
24161 live across a call.  Functions compiled this way save and restore
24162 the register @var{reg} if they use it.
24163
24164 It is an error to use this flag with the frame pointer or stack pointer.
24165 Use of this flag for other registers that have fixed pervasive roles in
24166 the machine's execution model produces disastrous results.
24167
24168 A different sort of disaster results from the use of this flag for
24169 a register in which function values may be returned.
24170
24171 This flag does not have a negative form, because it specifies a
24172 three-way choice.
24173
24174 @item -fpack-struct[=@var{n}]
24175 @opindex fpack-struct
24176 Without a value specified, pack all structure members together without
24177 holes.  When a value is specified (which must be a small power of two), pack
24178 structure members according to this value, representing the maximum
24179 alignment (that is, objects with default alignment requirements larger than
24180 this are output potentially unaligned at the next fitting location.
24181
24182 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
24183 code that is not binary compatible with code generated without that switch.
24184 Additionally, it makes the code suboptimal.
24185 Use it to conform to a non-default application binary interface.
24186
24187 @item -finstrument-functions
24188 @opindex finstrument-functions
24189 Generate instrumentation calls for entry and exit to functions.  Just
24190 after function entry and just before function exit, the following
24191 profiling functions are called with the address of the current
24192 function and its call site.  (On some platforms,
24193 @code{__builtin_return_address} does not work beyond the current
24194 function, so the call site information may not be available to the
24195 profiling functions otherwise.)
24196
24197 @smallexample
24198 void __cyg_profile_func_enter (void *this_fn,
24199                                void *call_site);
24200 void __cyg_profile_func_exit  (void *this_fn,
24201                                void *call_site);
24202 @end smallexample
24203
24204 The first argument is the address of the start of the current function,
24205 which may be looked up exactly in the symbol table.
24206
24207 This instrumentation is also done for functions expanded inline in other
24208 functions.  The profiling calls indicate where, conceptually, the
24209 inline function is entered and exited.  This means that addressable
24210 versions of such functions must be available.  If all your uses of a
24211 function are expanded inline, this may mean an additional expansion of
24212 code size.  If you use @code{extern inline} in your C code, an
24213 addressable version of such functions must be provided.  (This is
24214 normally the case anyway, but if you get lucky and the optimizer always
24215 expands the functions inline, you might have gotten away without
24216 providing static copies.)
24217
24218 A function may be given the attribute @code{no_instrument_function}, in
24219 which case this instrumentation is not done.  This can be used, for
24220 example, for the profiling functions listed above, high-priority
24221 interrupt routines, and any functions from which the profiling functions
24222 cannot safely be called (perhaps signal handlers, if the profiling
24223 routines generate output or allocate memory).
24224
24225 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
24226 @opindex finstrument-functions-exclude-file-list
24227
24228 Set the list of functions that are excluded from instrumentation (see
24229 the description of @option{-finstrument-functions}).  If the file that
24230 contains a function definition matches with one of @var{file}, then
24231 that function is not instrumented.  The match is done on substrings:
24232 if the @var{file} parameter is a substring of the file name, it is
24233 considered to be a match.
24234
24235 For example:
24236
24237 @smallexample
24238 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
24239 @end smallexample
24240
24241 @noindent
24242 excludes any inline function defined in files whose pathnames
24243 contain @file{/bits/stl} or @file{include/sys}.
24244
24245 If, for some reason, you want to include letter @samp{,} in one of
24246 @var{sym}, write @samp{\,}. For example,
24247 @option{-finstrument-functions-exclude-file-list='\,\,tmp'}
24248 (note the single quote surrounding the option).
24249
24250 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
24251 @opindex finstrument-functions-exclude-function-list
24252
24253 This is similar to @option{-finstrument-functions-exclude-file-list},
24254 but this option sets the list of function names to be excluded from
24255 instrumentation.  The function name to be matched is its user-visible
24256 name, such as @code{vector<int> blah(const vector<int> &)}, not the
24257 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
24258 match is done on substrings: if the @var{sym} parameter is a substring
24259 of the function name, it is considered to be a match.  For C99 and C++
24260 extended identifiers, the function name must be given in UTF-8, not
24261 using universal character names.
24262
24263 @item -fstack-check
24264 @opindex fstack-check
24265 Generate code to verify that you do not go beyond the boundary of the
24266 stack.  You should specify this flag if you are running in an
24267 environment with multiple threads, but you only rarely need to specify it in
24268 a single-threaded environment since stack overflow is automatically
24269 detected on nearly all systems if there is only one stack.
24270
24271 Note that this switch does not actually cause checking to be done; the
24272 operating system or the language runtime must do that.  The switch causes
24273 generation of code to ensure that they see the stack being extended.
24274
24275 You can additionally specify a string parameter: @samp{no} means no
24276 checking, @samp{generic} means force the use of old-style checking,
24277 @samp{specific} means use the best checking method and is equivalent
24278 to bare @option{-fstack-check}.
24279
24280 Old-style checking is a generic mechanism that requires no specific
24281 target support in the compiler but comes with the following drawbacks:
24282
24283 @enumerate
24284 @item
24285 Modified allocation strategy for large objects: they are always
24286 allocated dynamically if their size exceeds a fixed threshold.
24287
24288 @item
24289 Fixed limit on the size of the static frame of functions: when it is
24290 topped by a particular function, stack checking is not reliable and
24291 a warning is issued by the compiler.
24292
24293 @item
24294 Inefficiency: because of both the modified allocation strategy and the
24295 generic implementation, code performance is hampered.
24296 @end enumerate
24297
24298 Note that old-style stack checking is also the fallback method for
24299 @samp{specific} if no target support has been added in the compiler.
24300
24301 @item -fstack-limit-register=@var{reg}
24302 @itemx -fstack-limit-symbol=@var{sym}
24303 @itemx -fno-stack-limit
24304 @opindex fstack-limit-register
24305 @opindex fstack-limit-symbol
24306 @opindex fno-stack-limit
24307 Generate code to ensure that the stack does not grow beyond a certain value,
24308 either the value of a register or the address of a symbol.  If a larger
24309 stack is required, a signal is raised at run time.  For most targets,
24310 the signal is raised before the stack overruns the boundary, so
24311 it is possible to catch the signal without taking special precautions.
24312
24313 For instance, if the stack starts at absolute address @samp{0x80000000}
24314 and grows downwards, you can use the flags
24315 @option{-fstack-limit-symbol=__stack_limit} and
24316 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
24317 of 128KB@.  Note that this may only work with the GNU linker.
24318
24319 @item -fsplit-stack
24320 @opindex fsplit-stack
24321 Generate code to automatically split the stack before it overflows.
24322 The resulting program has a discontiguous stack which can only
24323 overflow if the program is unable to allocate any more memory.  This
24324 is most useful when running threaded programs, as it is no longer
24325 necessary to calculate a good stack size to use for each thread.  This
24326 is currently only implemented for the x86 targets running
24327 GNU/Linux.
24328
24329 When code compiled with @option{-fsplit-stack} calls code compiled
24330 without @option{-fsplit-stack}, there may not be much stack space
24331 available for the latter code to run.  If compiling all code,
24332 including library code, with @option{-fsplit-stack} is not an option,
24333 then the linker can fix up these calls so that the code compiled
24334 without @option{-fsplit-stack} always has a large stack.  Support for
24335 this is implemented in the gold linker in GNU binutils release 2.21
24336 and later.
24337
24338 @item -fleading-underscore
24339 @opindex fleading-underscore
24340 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
24341 change the way C symbols are represented in the object file.  One use
24342 is to help link with legacy assembly code.
24343
24344 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
24345 generate code that is not binary compatible with code generated without that
24346 switch.  Use it to conform to a non-default application binary interface.
24347 Not all targets provide complete support for this switch.
24348
24349 @item -ftls-model=@var{model}
24350 @opindex ftls-model
24351 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
24352 The @var{model} argument should be one of @samp{global-dynamic},
24353 @samp{local-dynamic}, @samp{initial-exec} or @samp{local-exec}.
24354 Note that the choice is subject to optimization: the compiler may use
24355 a more efficient model for symbols not visible outside of the translation
24356 unit, or if @option{-fpic} is not given on the command line.
24357
24358 The default without @option{-fpic} is @samp{initial-exec}; with
24359 @option{-fpic} the default is @samp{global-dynamic}.
24360
24361 @item -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]}
24362 @opindex fvisibility
24363 Set the default ELF image symbol visibility to the specified option---all
24364 symbols are marked with this unless overridden within the code.
24365 Using this feature can very substantially improve linking and
24366 load times of shared object libraries, produce more optimized
24367 code, provide near-perfect API export and prevent symbol clashes.
24368 It is @strong{strongly} recommended that you use this in any shared objects
24369 you distribute.
24370
24371 Despite the nomenclature, @samp{default} always means public; i.e.,
24372 available to be linked against from outside the shared object.
24373 @samp{protected} and @samp{internal} are pretty useless in real-world
24374 usage so the only other commonly used option is @samp{hidden}.
24375 The default if @option{-fvisibility} isn't specified is
24376 @samp{default}, i.e., make every symbol public.
24377
24378 A good explanation of the benefits offered by ensuring ELF
24379 symbols have the correct visibility is given by ``How To Write
24380 Shared Libraries'' by Ulrich Drepper (which can be found at
24381 @w{@uref{http://www.akkadia.org/drepper/}})---however a superior
24382 solution made possible by this option to marking things hidden when
24383 the default is public is to make the default hidden and mark things
24384 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
24385 and @code{__attribute__ ((visibility("default")))} instead of
24386 @code{__declspec(dllexport)} you get almost identical semantics with
24387 identical syntax.  This is a great boon to those working with
24388 cross-platform projects.
24389
24390 For those adding visibility support to existing code, you may find
24391 @code{#pragma GCC visibility} of use.  This works by you enclosing
24392 the declarations you wish to set visibility for with (for example)
24393 @code{#pragma GCC visibility push(hidden)} and
24394 @code{#pragma GCC visibility pop}.
24395 Bear in mind that symbol visibility should be viewed @strong{as
24396 part of the API interface contract} and thus all new code should
24397 always specify visibility when it is not the default; i.e., declarations
24398 only for use within the local DSO should @strong{always} be marked explicitly
24399 as hidden as so to avoid PLT indirection overheads---making this
24400 abundantly clear also aids readability and self-documentation of the code.
24401 Note that due to ISO C++ specification requirements, @code{operator new} and
24402 @code{operator delete} must always be of default visibility.
24403
24404 Be aware that headers from outside your project, in particular system
24405 headers and headers from any other library you use, may not be
24406 expecting to be compiled with visibility other than the default.  You
24407 may need to explicitly say @code{#pragma GCC visibility push(default)}
24408 before including any such headers.
24409
24410 @code{extern} declarations are not affected by @option{-fvisibility}, so
24411 a lot of code can be recompiled with @option{-fvisibility=hidden} with
24412 no modifications.  However, this means that calls to @code{extern}
24413 functions with no explicit visibility use the PLT, so it is more
24414 effective to use @code{__attribute ((visibility))} and/or
24415 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
24416 declarations should be treated as hidden.
24417
24418 Note that @option{-fvisibility} does affect C++ vague linkage
24419 entities. This means that, for instance, an exception class that is
24420 be thrown between DSOs must be explicitly marked with default
24421 visibility so that the @samp{type_info} nodes are unified between
24422 the DSOs.
24423
24424 An overview of these techniques, their benefits and how to use them
24425 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
24426
24427 @item -fstrict-volatile-bitfields
24428 @opindex fstrict-volatile-bitfields
24429 This option should be used if accesses to volatile bit-fields (or other
24430 structure fields, although the compiler usually honors those types
24431 anyway) should use a single access of the width of the
24432 field's type, aligned to a natural alignment if possible.  For
24433 example, targets with memory-mapped peripheral registers might require
24434 all such accesses to be 16 bits wide; with this flag you can
24435 declare all peripheral bit-fields as @code{unsigned short} (assuming short
24436 is 16 bits on these targets) to force GCC to use 16-bit accesses
24437 instead of, perhaps, a more efficient 32-bit access.
24438
24439 If this option is disabled, the compiler uses the most efficient
24440 instruction.  In the previous example, that might be a 32-bit load
24441 instruction, even though that accesses bytes that do not contain
24442 any portion of the bit-field, or memory-mapped registers unrelated to
24443 the one being updated.
24444
24445 In some cases, such as when the @code{packed} attribute is applied to a 
24446 structure field, it may not be possible to access the field with a single
24447 read or write that is correctly aligned for the target machine.  In this
24448 case GCC falls back to generating multiple accesses rather than code that 
24449 will fault or truncate the result at run time.
24450
24451 Note:  Due to restrictions of the C/C++11 memory model, write accesses are
24452 not allowed to touch non bit-field members.  It is therefore recommended
24453 to define all bits of the field's type as bit-field members.
24454
24455 The default value of this option is determined by the application binary
24456 interface for the target processor.
24457
24458 @item -fsync-libcalls
24459 @opindex fsync-libcalls
24460 This option controls whether any out-of-line instance of the @code{__sync}
24461 family of functions may be used to implement the C++11 @code{__atomic}
24462 family of functions.
24463
24464 The default value of this option is enabled, thus the only useful form
24465 of the option is @option{-fno-sync-libcalls}.  This option is used in
24466 the implementation of the @file{libatomic} runtime library.
24467
24468 @end table
24469
24470 @c man end
24471
24472 @node Environment Variables
24473 @section Environment Variables Affecting GCC
24474 @cindex environment variables
24475
24476 @c man begin ENVIRONMENT
24477 This section describes several environment variables that affect how GCC
24478 operates.  Some of them work by specifying directories or prefixes to use
24479 when searching for various kinds of files.  Some are used to specify other
24480 aspects of the compilation environment.
24481
24482 Note that you can also specify places to search using options such as
24483 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
24484 take precedence over places specified using environment variables, which
24485 in turn take precedence over those specified by the configuration of GCC@.
24486 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
24487 GNU Compiler Collection (GCC) Internals}.
24488
24489 @table @env
24490 @item LANG
24491 @itemx LC_CTYPE
24492 @c @itemx LC_COLLATE
24493 @itemx LC_MESSAGES
24494 @c @itemx LC_MONETARY
24495 @c @itemx LC_NUMERIC
24496 @c @itemx LC_TIME
24497 @itemx LC_ALL
24498 @findex LANG
24499 @findex LC_CTYPE
24500 @c @findex LC_COLLATE
24501 @findex LC_MESSAGES
24502 @c @findex LC_MONETARY
24503 @c @findex LC_NUMERIC
24504 @c @findex LC_TIME
24505 @findex LC_ALL
24506 @cindex locale
24507 These environment variables control the way that GCC uses
24508 localization information which allows GCC to work with different
24509 national conventions.  GCC inspects the locale categories
24510 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
24511 so.  These locale categories can be set to any value supported by your
24512 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
24513 Kingdom encoded in UTF-8.
24514
24515 The @env{LC_CTYPE} environment variable specifies character
24516 classification.  GCC uses it to determine the character boundaries in
24517 a string; this is needed for some multibyte encodings that contain quote
24518 and escape characters that are otherwise interpreted as a string
24519 end or escape.
24520
24521 The @env{LC_MESSAGES} environment variable specifies the language to
24522 use in diagnostic messages.
24523
24524 If the @env{LC_ALL} environment variable is set, it overrides the value
24525 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
24526 and @env{LC_MESSAGES} default to the value of the @env{LANG}
24527 environment variable.  If none of these variables are set, GCC
24528 defaults to traditional C English behavior.
24529
24530 @item TMPDIR
24531 @findex TMPDIR
24532 If @env{TMPDIR} is set, it specifies the directory to use for temporary
24533 files.  GCC uses temporary files to hold the output of one stage of
24534 compilation which is to be used as input to the next stage: for example,
24535 the output of the preprocessor, which is the input to the compiler
24536 proper.
24537
24538 @item GCC_COMPARE_DEBUG
24539 @findex GCC_COMPARE_DEBUG
24540 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
24541 @option{-fcompare-debug} to the compiler driver.  See the documentation
24542 of this option for more details.
24543
24544 @item GCC_EXEC_PREFIX
24545 @findex GCC_EXEC_PREFIX
24546 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
24547 names of the subprograms executed by the compiler.  No slash is added
24548 when this prefix is combined with the name of a subprogram, but you can
24549 specify a prefix that ends with a slash if you wish.
24550
24551 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
24552 an appropriate prefix to use based on the pathname it is invoked with.
24553
24554 If GCC cannot find the subprogram using the specified prefix, it
24555 tries looking in the usual places for the subprogram.
24556
24557 The default value of @env{GCC_EXEC_PREFIX} is
24558 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
24559 the installed compiler. In many cases @var{prefix} is the value
24560 of @code{prefix} when you ran the @file{configure} script.
24561
24562 Other prefixes specified with @option{-B} take precedence over this prefix.
24563
24564 This prefix is also used for finding files such as @file{crt0.o} that are
24565 used for linking.
24566
24567 In addition, the prefix is used in an unusual way in finding the
24568 directories to search for header files.  For each of the standard
24569 directories whose name normally begins with @samp{/usr/local/lib/gcc}
24570 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
24571 replacing that beginning with the specified prefix to produce an
24572 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
24573 @file{foo/bar} just before it searches the standard directory 
24574 @file{/usr/local/lib/bar}.
24575 If a standard directory begins with the configured
24576 @var{prefix} then the value of @var{prefix} is replaced by
24577 @env{GCC_EXEC_PREFIX} when looking for header files.
24578
24579 @item COMPILER_PATH
24580 @findex COMPILER_PATH
24581 The value of @env{COMPILER_PATH} is a colon-separated list of
24582 directories, much like @env{PATH}.  GCC tries the directories thus
24583 specified when searching for subprograms, if it can't find the
24584 subprograms using @env{GCC_EXEC_PREFIX}.
24585
24586 @item LIBRARY_PATH
24587 @findex LIBRARY_PATH
24588 The value of @env{LIBRARY_PATH} is a colon-separated list of
24589 directories, much like @env{PATH}.  When configured as a native compiler,
24590 GCC tries the directories thus specified when searching for special
24591 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
24592 using GCC also uses these directories when searching for ordinary
24593 libraries for the @option{-l} option (but directories specified with
24594 @option{-L} come first).
24595
24596 @item LANG
24597 @findex LANG
24598 @cindex locale definition
24599 This variable is used to pass locale information to the compiler.  One way in
24600 which this information is used is to determine the character set to be used
24601 when character literals, string literals and comments are parsed in C and C++.
24602 When the compiler is configured to allow multibyte characters,
24603 the following values for @env{LANG} are recognized:
24604
24605 @table @samp
24606 @item C-JIS
24607 Recognize JIS characters.
24608 @item C-SJIS
24609 Recognize SJIS characters.
24610 @item C-EUCJP
24611 Recognize EUCJP characters.
24612 @end table
24613
24614 If @env{LANG} is not defined, or if it has some other value, then the
24615 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
24616 recognize and translate multibyte characters.
24617 @end table
24618
24619 @noindent
24620 Some additional environment variables affect the behavior of the
24621 preprocessor.
24622
24623 @include cppenv.texi
24624
24625 @c man end
24626
24627 @node Precompiled Headers
24628 @section Using Precompiled Headers
24629 @cindex precompiled headers
24630 @cindex speed of compilation
24631
24632 Often large projects have many header files that are included in every
24633 source file.  The time the compiler takes to process these header files
24634 over and over again can account for nearly all of the time required to
24635 build the project.  To make builds faster, GCC allows you to
24636 @dfn{precompile} a header file.
24637
24638 To create a precompiled header file, simply compile it as you would any
24639 other file, if necessary using the @option{-x} option to make the driver
24640 treat it as a C or C++ header file.  You may want to use a
24641 tool like @command{make} to keep the precompiled header up-to-date when
24642 the headers it contains change.
24643
24644 A precompiled header file is searched for when @code{#include} is
24645 seen in the compilation.  As it searches for the included file
24646 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
24647 compiler looks for a precompiled header in each directory just before it
24648 looks for the include file in that directory.  The name searched for is
24649 the name specified in the @code{#include} with @samp{.gch} appended.  If
24650 the precompiled header file can't be used, it is ignored.
24651
24652 For instance, if you have @code{#include "all.h"}, and you have
24653 @file{all.h.gch} in the same directory as @file{all.h}, then the
24654 precompiled header file is used if possible, and the original
24655 header is used otherwise.
24656
24657 Alternatively, you might decide to put the precompiled header file in a
24658 directory and use @option{-I} to ensure that directory is searched
24659 before (or instead of) the directory containing the original header.
24660 Then, if you want to check that the precompiled header file is always
24661 used, you can put a file of the same name as the original header in this
24662 directory containing an @code{#error} command.
24663
24664 This also works with @option{-include}.  So yet another way to use
24665 precompiled headers, good for projects not designed with precompiled
24666 header files in mind, is to simply take most of the header files used by
24667 a project, include them from another header file, precompile that header
24668 file, and @option{-include} the precompiled header.  If the header files
24669 have guards against multiple inclusion, they are skipped because
24670 they've already been included (in the precompiled header).
24671
24672 If you need to precompile the same header file for different
24673 languages, targets, or compiler options, you can instead make a
24674 @emph{directory} named like @file{all.h.gch}, and put each precompiled
24675 header in the directory, perhaps using @option{-o}.  It doesn't matter
24676 what you call the files in the directory; every precompiled header in
24677 the directory is considered.  The first precompiled header
24678 encountered in the directory that is valid for this compilation is
24679 used; they're searched in no particular order.
24680
24681 There are many other possibilities, limited only by your imagination,
24682 good sense, and the constraints of your build system.
24683
24684 A precompiled header file can be used only when these conditions apply:
24685
24686 @itemize
24687 @item
24688 Only one precompiled header can be used in a particular compilation.
24689
24690 @item
24691 A precompiled header can't be used once the first C token is seen.  You
24692 can have preprocessor directives before a precompiled header; you cannot
24693 include a precompiled header from inside another header.
24694
24695 @item
24696 The precompiled header file must be produced for the same language as
24697 the current compilation.  You can't use a C precompiled header for a C++
24698 compilation.
24699
24700 @item
24701 The precompiled header file must have been produced by the same compiler
24702 binary as the current compilation is using.
24703
24704 @item
24705 Any macros defined before the precompiled header is included must
24706 either be defined in the same way as when the precompiled header was
24707 generated, or must not affect the precompiled header, which usually
24708 means that they don't appear in the precompiled header at all.
24709
24710 The @option{-D} option is one way to define a macro before a
24711 precompiled header is included; using a @code{#define} can also do it.
24712 There are also some options that define macros implicitly, like
24713 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
24714 defined this way.
24715
24716 @item If debugging information is output when using the precompiled
24717 header, using @option{-g} or similar, the same kind of debugging information
24718 must have been output when building the precompiled header.  However,
24719 a precompiled header built using @option{-g} can be used in a compilation
24720 when no debugging information is being output.
24721
24722 @item The same @option{-m} options must generally be used when building
24723 and using the precompiled header.  @xref{Submodel Options},
24724 for any cases where this rule is relaxed.
24725
24726 @item Each of the following options must be the same when building and using
24727 the precompiled header:
24728
24729 @gccoptlist{-fexceptions}
24730
24731 @item
24732 Some other command-line options starting with @option{-f},
24733 @option{-p}, or @option{-O} must be defined in the same way as when
24734 the precompiled header was generated.  At present, it's not clear
24735 which options are safe to change and which are not; the safest choice
24736 is to use exactly the same options when generating and using the
24737 precompiled header.  The following are known to be safe:
24738
24739 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
24740 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
24741 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
24742 -pedantic-errors}
24743
24744 @end itemize
24745
24746 For all of these except the last, the compiler automatically
24747 ignores the precompiled header if the conditions aren't met.  If you
24748 find an option combination that doesn't work and doesn't cause the
24749 precompiled header to be ignored, please consider filing a bug report,
24750 see @ref{Bugs}.
24751
24752 If you do use differing options when generating and using the
24753 precompiled header, the actual behavior is a mixture of the
24754 behavior for the options.  For instance, if you use @option{-g} to
24755 generate the precompiled header but not when using it, you may or may
24756 not get debugging information for routines in the precompiled header.