-fsave-optimization-record: compress the output using zlib
[official-gcc.git] / gcc / doc / invoke.texi
blob283d20fa29620c703991e344d80eefb5af5a9acd
1 @c Copyright (C) 1988-2018 Free Software Foundation, Inc.
2 @c This is part of the GCC manual.
3 @c For copying conditions, see the file gcc.texi.
5 @ignore
6 @c man begin INCLUDE
7 @include gcc-vers.texi
8 @c man end
10 @c man begin COPYRIGHT
11 Copyright @copyright{} 1988-2018 Free Software Foundation, Inc.
13 Permission is granted to copy, distribute and/or modify this document
14 under the terms of the GNU Free Documentation License, Version 1.3 or
15 any later version published by the Free Software Foundation; with the
16 Invariant Sections being ``GNU General Public License'' and ``Funding
17 Free Software'', the Front-Cover texts being (a) (see below), and with
18 the Back-Cover Texts being (b) (see below).  A copy of the license is
19 included in the gfdl(7) man page.
21 (a) The FSF's Front-Cover Text is:
23      A GNU Manual
25 (b) The FSF's Back-Cover Text is:
27      You have freedom to copy and modify this GNU Manual, like GNU
28      software.  Copies published by the Free Software Foundation raise
29      funds for GNU development.
30 @c man end
31 @c Set file name and title for the man page.
32 @setfilename gcc
33 @settitle GNU project C and C++ compiler
34 @c man begin SYNOPSIS
35 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
36     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
37     [@option{-W}@var{warn}@dots{}] [@option{-Wpedantic}]
38     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
39     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
40     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
41     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
43 Only the most useful options are listed here; see below for the
44 remainder.  @command{g++} accepts mostly the same options as @command{gcc}.
45 @c man end
46 @c man begin SEEALSO
47 gpl(7), gfdl(7), fsf-funding(7),
48 cpp(1), gcov(1), as(1), ld(1), gdb(1), dbx(1)
49 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
50 @file{ld}, @file{binutils} and @file{gdb}.
51 @c man end
52 @c man begin BUGS
53 For instructions on reporting bugs, see
54 @w{@value{BUGURL}}.
55 @c man end
56 @c man begin AUTHOR
57 See the Info entry for @command{gcc}, or
58 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
59 for contributors to GCC@.
60 @c man end
61 @end ignore
63 @node Invoking GCC
64 @chapter GCC Command Options
65 @cindex GCC command options
66 @cindex command options
67 @cindex options, GCC command
69 @c man begin DESCRIPTION
70 When you invoke GCC, it normally does preprocessing, compilation,
71 assembly and linking.  The ``overall options'' allow you to stop this
72 process at an intermediate stage.  For example, the @option{-c} option
73 says not to run the linker.  Then the output consists of object files
74 output by the assembler.
75 @xref{Overall Options,,Options Controlling the Kind of Output}.
77 Other options are passed on to one or more stages of processing.  Some options
78 control the preprocessor and others the compiler itself.  Yet other
79 options control the assembler and linker; most of these are not
80 documented here, since you rarely need to use any of them.
82 @cindex C compilation options
83 Most of the command-line options that you can use with GCC are useful
84 for C programs; when an option is only useful with another language
85 (usually C++), the explanation says so explicitly.  If the description
86 for a particular option does not mention a source language, you can use
87 that option with all supported languages.
89 @cindex cross compiling
90 @cindex specifying machine version
91 @cindex specifying compiler version and target machine
92 @cindex compiler version, specifying
93 @cindex target machine, specifying
94 The usual way to run GCC is to run the executable called @command{gcc}, or
95 @command{@var{machine}-gcc} when cross-compiling, or
96 @command{@var{machine}-gcc-@var{version}} to run a specific version of GCC.
97 When you compile C++ programs, you should invoke GCC as @command{g++} 
98 instead.  @xref{Invoking G++,,Compiling C++ Programs}, 
99 for information about the differences in behavior between @command{gcc} 
100 and @code{g++} when compiling C++ programs.
102 @cindex grouping options
103 @cindex options, grouping
104 The @command{gcc} program accepts options and file names as operands.  Many
105 options have multi-letter names; therefore multiple single-letter options
106 may @emph{not} be grouped: @option{-dv} is very different from @w{@samp{-d
107 -v}}.
109 @cindex order of options
110 @cindex options, order
111 You can mix options and other arguments.  For the most part, the order
112 you use doesn't matter.  Order does matter when you use several
113 options of the same kind; for example, if you specify @option{-L} more
114 than once, the directories are searched in the order specified.  Also,
115 the placement of the @option{-l} option is significant.
117 Many options have long names starting with @samp{-f} or with
118 @samp{-W}---for example,
119 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
120 these have both positive and negative forms; the negative form of
121 @option{-ffoo} is @option{-fno-foo}.  This manual documents
122 only one of these two forms, whichever one is not the default.
124 Some options take one or more arguments typically separated either
125 by a space or by the equals sign (@samp{=}) from the option name.
126 Unless documented otherwise, an argument can be either numeric or
127 a string.  Numeric arguments must typically be small unsigned decimal
128 or hexadecimal integers.  Hexadecimal arguments must begin with
129 the @samp{0x} prefix.  Arguments to options that specify a size
130 threshold of some sort may be arbitrarily large decimal or hexadecimal
131 integers followed by a byte size suffix designating a multiple of bytes
132 such as @code{kB} and @code{KiB} for kilobyte and kibibyte, respectively,
133 @code{MB} and @code{MiB} for megabyte and mebibyte, @code{GB} and
134 @code{GiB} for gigabyte and gigibyte, and so on.  Such arguments are
135 designated by @var{byte-size} in the following text.  Refer to the NIST,
136 IEC, and other relevant national and international standards for the full
137 listing and explanation of the binary and decimal byte size prefixes.
139 @c man end
141 @xref{Option Index}, for an index to GCC's options.
143 @menu
144 * Option Summary::      Brief list of all options, without explanations.
145 * Overall Options::     Controlling the kind of output:
146                         an executable, object files, assembler files,
147                         or preprocessed source.
148 * Invoking G++::        Compiling C++ programs.
149 * C Dialect Options::   Controlling the variant of C language compiled.
150 * C++ Dialect Options:: Variations on C++.
151 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
152                         and Objective-C++.
153 * Diagnostic Message Formatting Options:: Controlling how diagnostics should
154                         be formatted.
155 * Warning Options::     How picky should the compiler be?
156 * Debugging Options::   Producing debuggable code.
157 * Optimize Options::    How much optimization?
158 * Instrumentation Options:: Enabling profiling and extra run-time error checking.
159 * Preprocessor Options:: Controlling header files and macro definitions.
160                          Also, getting dependency information for Make.
161 * Assembler Options::   Passing options to the assembler.
162 * Link Options::        Specifying libraries and so on.
163 * Directory Options::   Where to find header files and libraries.
164                         Where to find the compiler executable files.
165 * Code Gen Options::    Specifying conventions for function calls, data layout
166                         and register usage.
167 * Developer Options::   Printing GCC configuration info, statistics, and
168                         debugging dumps.
169 * Submodel Options::    Target-specific options, such as compiling for a
170                         specific processor variant.
171 * Spec Files::          How to pass switches to sub-processes.
172 * Environment Variables:: Env vars that affect GCC.
173 * Precompiled Headers:: Compiling a header once, and using it many times.
174 @end menu
176 @c man begin OPTIONS
178 @node Option Summary
179 @section Option Summary
181 Here is a summary of all the options, grouped by type.  Explanations are
182 in the following sections.
184 @table @emph
185 @item Overall Options
186 @xref{Overall Options,,Options Controlling the Kind of Output}.
187 @gccoptlist{-c  -S  -E  -o @var{file}  -x @var{language}  @gol
188 -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  --target-help  --version @gol
189 -pass-exit-codes  -pipe  -specs=@var{file}  -wrapper  @gol
190 @@@var{file}  -ffile-prefix-map=@var{old}=@var{new}  @gol
191 -fplugin=@var{file}  -fplugin-arg-@var{name}=@var{arg}  @gol
192 -fdump-ada-spec@r{[}-slim@r{]}  -fada-spec-parent=@var{unit}  -fdump-go-spec=@var{file}}
194 @item C Language Options
195 @xref{C Dialect Options,,Options Controlling C Dialect}.
196 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
197 -fpermitted-flt-eval-methods=@var{standard} @gol
198 -aux-info @var{filename}  -fallow-parameterless-variadic-functions @gol
199 -fno-asm  -fno-builtin  -fno-builtin-@var{function}  -fgimple@gol
200 -fhosted  -ffreestanding  -fopenacc  -fopenmp  -fopenmp-simd @gol
201 -fms-extensions  -fplan9-extensions  -fsso-struct=@var{endianness} @gol
202 -fallow-single-precision  -fcond-mismatch  -flax-vector-conversions @gol
203 -fsigned-bitfields  -fsigned-char @gol
204 -funsigned-bitfields  -funsigned-char}
206 @item C++ Language Options
207 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
208 @gccoptlist{-fabi-version=@var{n}  -fno-access-control @gol
209 -faligned-new=@var{n}  -fargs-in-order=@var{n}  -fcheck-new @gol
210 -fconstexpr-depth=@var{n}  -fconstexpr-loop-limit=@var{n} @gol
211 -fno-elide-constructors @gol
212 -fno-enforce-eh-specs @gol
213 -fno-gnu-keywords @gol
214 -fno-implicit-templates @gol
215 -fno-implicit-inline-templates @gol
216 -fno-implement-inlines  -fms-extensions @gol
217 -fnew-inheriting-ctors @gol
218 -fnew-ttp-matching @gol
219 -fno-nonansi-builtins  -fnothrow-opt  -fno-operator-names @gol
220 -fno-optional-diags  -fpermissive @gol
221 -fno-pretty-templates @gol
222 -frepo  -fno-rtti  -fsized-deallocation @gol
223 -ftemplate-backtrace-limit=@var{n} @gol
224 -ftemplate-depth=@var{n} @gol
225 -fno-threadsafe-statics  -fuse-cxa-atexit @gol
226 -fno-weak  -nostdinc++ @gol
227 -fvisibility-inlines-hidden @gol
228 -fvisibility-ms-compat @gol
229 -fext-numeric-literals @gol
230 -Wabi=@var{n}  -Wabi-tag  -Wconversion-null  -Wctor-dtor-privacy @gol
231 -Wdelete-non-virtual-dtor -Wdeprecated-copy  -Wliteral-suffix @gol
232 -Wmultiple-inheritance -Wno-init-list-lifetime @gol
233 -Wnamespaces  -Wnarrowing @gol
234 -Wpessimizing-move  -Wredundant-move @gol
235 -Wnoexcept  -Wnoexcept-type  -Wclass-memaccess @gol
236 -Wnon-virtual-dtor  -Wreorder  -Wregister @gol
237 -Weffc++  -Wstrict-null-sentinel  -Wtemplates @gol
238 -Wno-non-template-friend  -Wold-style-cast @gol
239 -Woverloaded-virtual  -Wno-pmf-conversions @gol
240 -Wno-class-conversion  -Wno-terminate @gol
241 -Wsign-promo  -Wvirtual-inheritance}
243 @item Objective-C and Objective-C++ Language Options
244 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
245 Objective-C and Objective-C++ Dialects}.
246 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
247 -fgnu-runtime  -fnext-runtime @gol
248 -fno-nil-receivers @gol
249 -fobjc-abi-version=@var{n} @gol
250 -fobjc-call-cxx-cdtors @gol
251 -fobjc-direct-dispatch @gol
252 -fobjc-exceptions @gol
253 -fobjc-gc @gol
254 -fobjc-nilcheck @gol
255 -fobjc-std=objc1 @gol
256 -fno-local-ivars @gol
257 -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]} @gol
258 -freplace-objc-classes @gol
259 -fzero-link @gol
260 -gen-decls @gol
261 -Wassign-intercept @gol
262 -Wno-protocol  -Wselector @gol
263 -Wstrict-selector-match @gol
264 -Wundeclared-selector}
266 @item Diagnostic Message Formatting Options
267 @xref{Diagnostic Message Formatting Options,,Options to Control Diagnostic Messages Formatting}.
268 @gccoptlist{-fmessage-length=@var{n}  @gol
269 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
270 -fdiagnostics-color=@r{[}auto@r{|}never@r{|}always@r{]}  @gol
271 -fno-diagnostics-show-option  -fno-diagnostics-show-caret @gol
272 -fno-diagnostics-show-labels -fno-diagnostics-show-line-numbers @gol
273 -fdiagnostics-minimum-margin-width=@var{width} @gol
274 -fdiagnostics-parseable-fixits  -fdiagnostics-generate-patch @gol
275 -fdiagnostics-show-template-tree -fno-elide-type @gol
276 -fno-show-column}
278 @item Warning Options
279 @xref{Warning Options,,Options to Request or Suppress Warnings}.
280 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -Wpedantic @gol
281 -pedantic-errors @gol
282 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  -Waligned-new @gol
283 -Walloc-zero  -Walloc-size-larger-than=@var{byte-size}
284 -Walloca  -Walloca-larger-than=@var{byte-size} @gol
285 -Wno-aggressive-loop-optimizations  -Warray-bounds  -Warray-bounds=@var{n} @gol
286 -Wno-attributes -Wno-attribute-alias @gol
287 -Wbool-compare  -Wbool-operation @gol
288 -Wno-builtin-declaration-mismatch @gol
289 -Wno-builtin-macro-redefined  -Wc90-c99-compat  -Wc99-c11-compat @gol
290 -Wc++-compat  -Wc++11-compat  -Wc++14-compat  -Wc++17-compat  @gol
291 -Wcast-align  -Wcast-align=strict  -Wcast-function-type  -Wcast-qual  @gol
292 -Wchar-subscripts  -Wcatch-value  -Wcatch-value=@var{n} @gol
293 -Wclobbered  -Wcomment  -Wconditionally-supported @gol
294 -Wconversion  -Wcoverage-mismatch  -Wno-cpp  -Wdangling-else  -Wdate-time @gol
295 -Wdelete-incomplete @gol
296 -Wno-attribute-warning @gol
297 -Wno-deprecated  -Wno-deprecated-declarations  -Wno-designated-init @gol
298 -Wdisabled-optimization @gol
299 -Wno-discarded-qualifiers  -Wno-discarded-array-qualifiers @gol
300 -Wno-div-by-zero  -Wdouble-promotion @gol
301 -Wduplicated-branches  -Wduplicated-cond @gol
302 -Wempty-body  -Wenum-compare  -Wno-endif-labels  -Wexpansion-to-defined @gol
303 -Werror  -Werror=*  -Wextra-semi  -Wfatal-errors @gol
304 -Wfloat-equal  -Wformat  -Wformat=2 @gol
305 -Wno-format-contains-nul  -Wno-format-extra-args  @gol
306 -Wformat-nonliteral -Wformat-overflow=@var{n} @gol
307 -Wformat-security  -Wformat-signedness  -Wformat-truncation=@var{n} @gol
308 -Wformat-y2k  -Wframe-address @gol
309 -Wframe-larger-than=@var{byte-size}  -Wno-free-nonheap-object @gol
310 -Wjump-misses-init @gol
311 -Wif-not-aligned @gol
312 -Wignored-qualifiers  -Wignored-attributes  -Wincompatible-pointer-types @gol
313 -Wimplicit  -Wimplicit-fallthrough  -Wimplicit-fallthrough=@var{n} @gol
314 -Wimplicit-function-declaration  -Wimplicit-int @gol
315 -Winit-self  -Winline  -Wno-int-conversion  -Wint-in-bool-context @gol
316 -Wno-int-to-pointer-cast  -Winvalid-memory-model  -Wno-invalid-offsetof @gol
317 -Winvalid-pch  -Wlarger-than=@var{byte-size} @gol
318 -Wlogical-op  -Wlogical-not-parentheses  -Wlong-long @gol
319 -Wmain  -Wmaybe-uninitialized  -Wmemset-elt-size  -Wmemset-transposed-args @gol
320 -Wmisleading-indentation  -Wno-missing-attributes -Wmissing-braces @gol
321 -Wmissing-field-initializers  -Wmissing-include-dirs  -Wmissing-profile @gol
322 -Wno-multichar  -Wmultistatement-macros  -Wnonnull  -Wnonnull-compare @gol
323 -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]} @gol
324 -Wnull-dereference  -Wodr  -Wno-overflow  -Wopenmp-simd  @gol
325 -Woverride-init-side-effects  -Woverlength-strings @gol
326 -Wpacked  -Wpacked-bitfield-compat -Wpacked-not-aligned -Wpadded @gol
327 -Wparentheses  -Wno-pedantic-ms-format @gol
328 -Wplacement-new  -Wplacement-new=@var{n} @gol
329 -Wpointer-arith  -Wpointer-compare  -Wno-pointer-to-int-cast @gol
330 -Wno-pragmas  -Wno-prio-ctor-dtor -Wredundant-decls @gol
331 -Wrestrict  -Wno-return-local-addr @gol
332 -Wreturn-type  -Wsequence-point  -Wshadow  -Wno-shadow-ivar @gol
333 -Wshadow=global,  -Wshadow=local,  -Wshadow=compatible-local @gol
334 -Wshift-overflow  -Wshift-overflow=@var{n} @gol
335 -Wshift-count-negative  -Wshift-count-overflow  -Wshift-negative-value @gol
336 -Wsign-compare  -Wsign-conversion  -Wfloat-conversion @gol
337 -Wno-scalar-storage-order  -Wsizeof-pointer-div @gol
338 -Wsizeof-pointer-memaccess  -Wsizeof-array-argument @gol
339 -Wstack-protector  -Wstack-usage=@var{byte-size}  -Wstrict-aliasing @gol
340 -Wstrict-aliasing=n  -Wstrict-overflow  -Wstrict-overflow=@var{n} @gol
341 -Wstringop-overflow=@var{n} -Wstringop-truncation @gol
342 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{|}malloc@r{]} @gol
343 -Wsuggest-final-types @gol  -Wsuggest-final-methods  -Wsuggest-override @gol
344 -Wmissing-format-attribute  -Wsubobject-linkage @gol
345 -Wswitch  -Wswitch-bool  -Wswitch-default  -Wswitch-enum @gol
346 -Wswitch-unreachable  -Wsync-nand @gol
347 -Wsystem-headers  -Wtautological-compare  -Wtrampolines  -Wtrigraphs @gol
348 -Wtype-limits  -Wundef @gol
349 -Wuninitialized  -Wunknown-pragmas @gol
350 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
351 -Wunused-label  -Wunused-local-typedefs  -Wunused-macros @gol
352 -Wunused-parameter  -Wno-unused-result @gol
353 -Wunused-value  -Wunused-variable @gol
354 -Wunused-const-variable  -Wunused-const-variable=@var{n} @gol
355 -Wunused-but-set-parameter  -Wunused-but-set-variable @gol
356 -Wuseless-cast  -Wvariadic-macros  -Wvector-operation-performance @gol
357 -Wvla  -Wvla-larger-than=@var{byte-size}  -Wvolatile-register-var @gol
358 -Wwrite-strings @gol
359 -Wzero-as-null-pointer-constant  -Whsa}
361 @item C and Objective-C-only Warning Options
362 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
363 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
364 -Wold-style-declaration  -Wold-style-definition @gol
365 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
366 -Wdeclaration-after-statement  -Wpointer-sign}
368 @item Debugging Options
369 @xref{Debugging Options,,Options for Debugging Your Program}.
370 @gccoptlist{-g  -g@var{level}  -gdwarf  -gdwarf-@var{version} @gol
371 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
372 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
373 -gas-loc-support  -gno-as-loc-support @gol
374 -gas-locview-support  -gno-as-locview-support @gol
375 -gcolumn-info  -gno-column-info @gol
376 -gstatement-frontiers  -gno-statement-frontiers @gol
377 -gvariable-location-views  -gno-variable-location-views @gol
378 -ginternal-reset-location-views  -gno-internal-reset-location-views @gol
379 -ginline-points  -gno-inline-points @gol
380 -gvms  -gxcoff  -gxcoff+  -gz@r{[}=@var{type}@r{]} @gol
381 -gsplit-dwarf -gdescribe-dies -gno-describe-dies @gol
382 -fdebug-prefix-map=@var{old}=@var{new}  -fdebug-types-section @gol
383 -fno-eliminate-unused-debug-types @gol
384 -femit-struct-debug-baseonly  -femit-struct-debug-reduced @gol
385 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
386 -feliminate-unused-debug-symbols  -femit-class-debug-always @gol
387 -fno-merge-debug-strings  -fno-dwarf2-cfi-asm @gol
388 -fvar-tracking  -fvar-tracking-assignments}
390 @item Optimization Options
391 @xref{Optimize Options,,Options that Control Optimization}.
392 @gccoptlist{-faggressive-loop-optimizations @gol
393 -falign-functions[=@var{n}[:@var{m}:[@var{n2}[:@var{m2}]]]] @gol
394 -falign-jumps[=@var{n}[:@var{m}:[@var{n2}[:@var{m2}]]]] @gol
395 -falign-labels[=@var{n}[:@var{m}:[@var{n2}[:@var{m2}]]]] @gol
396 -falign-loops[=@var{n}[:@var{m}:[@var{n2}[:@var{m2}]]]] @gol
397 -fassociative-math  -fauto-profile  -fauto-profile[=@var{path}] @gol
398 -fauto-inc-dec  -fbranch-probabilities @gol
399 -fbranch-target-load-optimize  -fbranch-target-load-optimize2 @gol
400 -fbtr-bb-exclusive  -fcaller-saves @gol
401 -fcombine-stack-adjustments  -fconserve-stack @gol
402 -fcompare-elim  -fcprop-registers  -fcrossjumping @gol
403 -fcse-follow-jumps  -fcse-skip-blocks  -fcx-fortran-rules @gol
404 -fcx-limited-range @gol
405 -fdata-sections  -fdce  -fdelayed-branch @gol
406 -fdelete-null-pointer-checks  -fdevirtualize  -fdevirtualize-speculatively @gol
407 -fdevirtualize-at-ltrans  -fdse @gol
408 -fearly-inlining  -fipa-sra  -fexpensive-optimizations  -ffat-lto-objects @gol
409 -ffast-math  -ffinite-math-only  -ffloat-store  -fexcess-precision=@var{style} @gol
410 -fforward-propagate  -ffp-contract=@var{style}  -ffunction-sections @gol
411 -fgcse  -fgcse-after-reload  -fgcse-las  -fgcse-lm  -fgraphite-identity @gol
412 -fgcse-sm  -fhoist-adjacent-loads  -fif-conversion @gol
413 -fif-conversion2  -findirect-inlining @gol
414 -finline-functions  -finline-functions-called-once  -finline-limit=@var{n} @gol
415 -finline-small-functions  -fipa-cp  -fipa-cp-clone @gol
416 -fipa-bit-cp -fipa-vrp @gol
417 -fipa-pta  -fipa-profile  -fipa-pure-const  -fipa-reference  -fipa-reference-addressable @gol
418 -fipa-stack-alignment  -fipa-icf  -fira-algorithm=@var{algorithm} @gol
419 -fira-region=@var{region}  -fira-hoist-pressure @gol
420 -fira-loop-pressure  -fno-ira-share-save-slots @gol
421 -fno-ira-share-spill-slots @gol
422 -fisolate-erroneous-paths-dereference  -fisolate-erroneous-paths-attribute @gol
423 -fivopts  -fkeep-inline-functions  -fkeep-static-functions @gol
424 -fkeep-static-consts  -flimit-function-alignment  -flive-range-shrinkage @gol
425 -floop-block  -floop-interchange  -floop-strip-mine @gol
426 -floop-unroll-and-jam  -floop-nest-optimize @gol
427 -floop-parallelize-all  -flra-remat  -flto  -flto-compression-level @gol
428 -flto-partition=@var{alg}  -fmerge-all-constants @gol
429 -fmerge-constants  -fmodulo-sched  -fmodulo-sched-allow-regmoves @gol
430 -fmove-loop-invariants  -fno-branch-count-reg @gol
431 -fno-defer-pop  -fno-fp-int-builtin-inexact  -fno-function-cse @gol
432 -fno-guess-branch-probability  -fno-inline  -fno-math-errno  -fno-peephole @gol
433 -fno-peephole2  -fno-printf-return-value  -fno-sched-interblock @gol
434 -fno-sched-spec  -fno-signed-zeros @gol
435 -fno-toplevel-reorder  -fno-trapping-math  -fno-zero-initialized-in-bss @gol
436 -fomit-frame-pointer  -foptimize-sibling-calls @gol
437 -fpartial-inlining  -fpeel-loops  -fpredictive-commoning @gol
438 -fprefetch-loop-arrays @gol
439 -fprofile-correction @gol
440 -fprofile-use  -fprofile-use=@var{path}  -fprofile-values @gol
441 -fprofile-reorder-functions @gol
442 -freciprocal-math  -free  -frename-registers  -freorder-blocks @gol
443 -freorder-blocks-algorithm=@var{algorithm} @gol
444 -freorder-blocks-and-partition  -freorder-functions @gol
445 -frerun-cse-after-loop  -freschedule-modulo-scheduled-loops @gol
446 -frounding-math  -fsave-optimization-record @gol
447 -fsched2-use-superblocks  -fsched-pressure @gol
448 -fsched-spec-load  -fsched-spec-load-dangerous @gol
449 -fsched-stalled-insns-dep[=@var{n}]  -fsched-stalled-insns[=@var{n}] @gol
450 -fsched-group-heuristic  -fsched-critical-path-heuristic @gol
451 -fsched-spec-insn-heuristic  -fsched-rank-heuristic @gol
452 -fsched-last-insn-heuristic  -fsched-dep-count-heuristic @gol
453 -fschedule-fusion @gol
454 -fschedule-insns  -fschedule-insns2  -fsection-anchors @gol
455 -fselective-scheduling  -fselective-scheduling2 @gol
456 -fsel-sched-pipelining  -fsel-sched-pipelining-outer-loops @gol
457 -fsemantic-interposition  -fshrink-wrap  -fshrink-wrap-separate @gol
458 -fsignaling-nans @gol
459 -fsingle-precision-constant  -fsplit-ivs-in-unroller  -fsplit-loops@gol
460 -fsplit-paths @gol
461 -fsplit-wide-types  -fssa-backprop  -fssa-phiopt @gol
462 -fstdarg-opt  -fstore-merging  -fstrict-aliasing @gol
463 -fthread-jumps  -ftracer  -ftree-bit-ccp @gol
464 -ftree-builtin-call-dce  -ftree-ccp  -ftree-ch @gol
465 -ftree-coalesce-vars  -ftree-copy-prop  -ftree-dce  -ftree-dominator-opts @gol
466 -ftree-dse  -ftree-forwprop  -ftree-fre  -fcode-hoisting @gol
467 -ftree-loop-if-convert  -ftree-loop-im @gol
468 -ftree-phiprop  -ftree-loop-distribution  -ftree-loop-distribute-patterns @gol
469 -ftree-loop-ivcanon  -ftree-loop-linear  -ftree-loop-optimize @gol
470 -ftree-loop-vectorize @gol
471 -ftree-parallelize-loops=@var{n}  -ftree-pre  -ftree-partial-pre  -ftree-pta @gol
472 -ftree-reassoc  -ftree-scev-cprop  -ftree-sink  -ftree-slsr  -ftree-sra @gol
473 -ftree-switch-conversion  -ftree-tail-merge @gol
474 -ftree-ter  -ftree-vectorize  -ftree-vrp  -funconstrained-commons @gol
475 -funit-at-a-time  -funroll-all-loops  -funroll-loops @gol
476 -funsafe-math-optimizations  -funswitch-loops @gol
477 -fipa-ra  -fvariable-expansion-in-unroller  -fvect-cost-model  -fvpt @gol
478 -fweb  -fwhole-program  -fwpa  -fuse-linker-plugin @gol
479 --param @var{name}=@var{value}
480 -O  -O0  -O1  -O2  -O3  -Os  -Ofast  -Og}
482 @item Program Instrumentation Options
483 @xref{Instrumentation Options,,Program Instrumentation Options}.
484 @gccoptlist{-p  -pg  -fprofile-arcs  --coverage  -ftest-coverage @gol
485 -fprofile-abs-path @gol
486 -fprofile-dir=@var{path}  -fprofile-generate  -fprofile-generate=@var{path} @gol
487 -fprofile-update=@var{method}  -fprofile-filter-files=@var{regex}  -fprofile-exclude-files=@var{regex} @gol
488 -fsanitize=@var{style}  -fsanitize-recover  -fsanitize-recover=@var{style} @gol
489 -fasan-shadow-offset=@var{number}  -fsanitize-sections=@var{s1},@var{s2},... @gol
490 -fsanitize-undefined-trap-on-error  -fbounds-check @gol
491 -fcf-protection=@r{[}full@r{|}branch@r{|}return@r{|}none@r{]} @gol
492 -fstack-protector  -fstack-protector-all  -fstack-protector-strong @gol
493 -fstack-protector-explicit  -fstack-check @gol
494 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
495 -fno-stack-limit  -fsplit-stack @gol
496 -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]} @gol
497 -fvtv-counts  -fvtv-debug @gol
498 -finstrument-functions @gol
499 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
500 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}}
502 @item Preprocessor Options
503 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
504 @gccoptlist{-A@var{question}=@var{answer} @gol
505 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
506 -C  -CC  -D@var{macro}@r{[}=@var{defn}@r{]} @gol
507 -dD  -dI  -dM  -dN  -dU @gol
508 -fdebug-cpp  -fdirectives-only  -fdollars-in-identifiers  @gol
509 -fexec-charset=@var{charset}  -fextended-identifiers  @gol
510 -finput-charset=@var{charset} -fmacro-prefix-map=@var{old}=@var{new}  @gol
511 -fno-canonical-system-headers @gol -fpch-deps  -fpch-preprocess  @gol
512 -fpreprocessed -ftabstop=@var{width}  -ftrack-macro-expansion  @gol
513 -fwide-exec-charset=@var{charset}  -fworking-directory @gol
514 -H  -imacros @var{file}  -include @var{file} @gol
515 -M  -MD  -MF  -MG  -MM  -MMD  -MP  -MQ  -MT @gol
516 -no-integrated-cpp  -P  -pthread  -remap @gol
517 -traditional  -traditional-cpp  -trigraphs @gol
518 -U@var{macro}  -undef  @gol
519 -Wp,@var{option}  -Xpreprocessor @var{option}}
521 @item Assembler Options
522 @xref{Assembler Options,,Passing Options to the Assembler}.
523 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
525 @item Linker Options
526 @xref{Link Options,,Options for Linking}.
527 @gccoptlist{@var{object-file-name}  -fuse-ld=@var{linker}  -l@var{library} @gol
528 -nostartfiles  -nodefaultlibs  -nolibc  -nostdlib @gol
529 -e @var{entry}  --entry=@var{entry} @gol
530 -pie  -pthread  -r  -rdynamic @gol
531 -s  -static -static-pie -static-libgcc  -static-libstdc++ @gol
532 -static-libasan  -static-libtsan  -static-liblsan  -static-libubsan @gol
533 -shared  -shared-libgcc  -symbolic @gol
534 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
535 -u @var{symbol}  -z @var{keyword}}
537 @item Directory Options
538 @xref{Directory Options,,Options for Directory Search}.
539 @gccoptlist{-B@var{prefix}  -I@var{dir}  -I- @gol
540 -idirafter @var{dir} @gol
541 -imacros @var{file}  -imultilib @var{dir} @gol
542 -iplugindir=@var{dir}  -iprefix @var{file} @gol
543 -iquote @var{dir}  -isysroot @var{dir}  -isystem @var{dir} @gol
544 -iwithprefix @var{dir}  -iwithprefixbefore @var{dir}  @gol
545 -L@var{dir}  -no-canonical-prefixes  --no-sysroot-suffix @gol
546 -nostdinc  -nostdinc++  --sysroot=@var{dir}}
548 @item Code Generation Options
549 @xref{Code Gen Options,,Options for Code Generation Conventions}.
550 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
551 -ffixed-@var{reg}  -fexceptions @gol
552 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
553 -fasynchronous-unwind-tables @gol
554 -fno-gnu-unique @gol
555 -finhibit-size-directive  -fno-common  -fno-ident @gol
556 -fpcc-struct-return  -fpic  -fPIC  -fpie  -fPIE  -fno-plt @gol
557 -fno-jump-tables @gol
558 -frecord-gcc-switches @gol
559 -freg-struct-return  -fshort-enums  -fshort-wchar @gol
560 -fverbose-asm  -fpack-struct[=@var{n}]  @gol
561 -fleading-underscore  -ftls-model=@var{model} @gol
562 -fstack-reuse=@var{reuse_level} @gol
563 -ftrampolines  -ftrapv  -fwrapv @gol
564 -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]} @gol
565 -fstrict-volatile-bitfields  -fsync-libcalls}
567 @item Developer Options
568 @xref{Developer Options,,GCC Developer Options}.
569 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
570 -dumpfullversion  -fchecking  -fchecking=@var{n}  -fdbg-cnt-list @gol
571 -fdbg-cnt=@var{counter-value-list} @gol
572 -fdisable-ipa-@var{pass_name} @gol
573 -fdisable-rtl-@var{pass_name} @gol
574 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
575 -fdisable-tree-@var{pass_name} @gol
576 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
577 -fdump-debug -fdump-earlydebug @gol
578 -fdump-noaddr  -fdump-unnumbered  -fdump-unnumbered-links @gol
579 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
580 -fdump-final-insns@r{[}=@var{file}@r{]} @gol
581 -fdump-ipa-all  -fdump-ipa-cgraph  -fdump-ipa-inline @gol
582 -fdump-lang-all @gol
583 -fdump-lang-@var{switch} @gol
584 -fdump-lang-@var{switch}-@var{options} @gol
585 -fdump-lang-@var{switch}-@var{options}=@var{filename} @gol
586 -fdump-passes @gol
587 -fdump-rtl-@var{pass}  -fdump-rtl-@var{pass}=@var{filename} @gol
588 -fdump-statistics @gol
589 -fdump-tree-all @gol
590 -fdump-tree-@var{switch} @gol
591 -fdump-tree-@var{switch}-@var{options} @gol
592 -fdump-tree-@var{switch}-@var{options}=@var{filename} @gol
593 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
594 -fenable-@var{kind}-@var{pass} @gol
595 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
596 -fira-verbose=@var{n} @gol
597 -flto-report  -flto-report-wpa  -fmem-report-wpa @gol
598 -fmem-report  -fpre-ipa-mem-report  -fpost-ipa-mem-report @gol
599 -fopt-info  -fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
600 -fprofile-report @gol
601 -frandom-seed=@var{string}  -fsched-verbose=@var{n} @gol
602 -fsel-sched-verbose  -fsel-sched-dump-cfg  -fsel-sched-pipelining-verbose @gol
603 -fstats  -fstack-usage  -ftime-report  -ftime-report-details @gol
604 -fvar-tracking-assignments-toggle  -gtoggle @gol
605 -print-file-name=@var{library}  -print-libgcc-file-name @gol
606 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
607 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
608 -print-sysroot  -print-sysroot-headers-suffix @gol
609 -save-temps  -save-temps=cwd  -save-temps=obj  -time@r{[}=@var{file}@r{]}}
611 @item Machine-Dependent Options
612 @xref{Submodel Options,,Machine-Dependent Options}.
613 @c This list is ordered alphanumerically by subsection name.
614 @c Try and put the significant identifier (CPU or system) first,
615 @c so users have a clue at guessing where the ones they want will be.
617 @emph{AArch64 Options}
618 @gccoptlist{-mabi=@var{name}  -mbig-endian  -mlittle-endian @gol
619 -mgeneral-regs-only @gol
620 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
621 -mstrict-align -mno-strict-align @gol
622 -momit-leaf-frame-pointer @gol
623 -mtls-dialect=desc  -mtls-dialect=traditional @gol
624 -mtls-size=@var{size} @gol
625 -mfix-cortex-a53-835769  -mfix-cortex-a53-843419 @gol
626 -mlow-precision-recip-sqrt  -mlow-precision-sqrt  -mlow-precision-div @gol
627 -mpc-relative-literal-loads @gol
628 -msign-return-address=@var{scope} @gol
629 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}  @gol
630 -moverride=@var{string}  -mverbose-cost-dump -mtrack-speculation} 
632 @emph{Adapteva Epiphany Options}
633 @gccoptlist{-mhalf-reg-file  -mprefer-short-insn-regs @gol
634 -mbranch-cost=@var{num}  -mcmove  -mnops=@var{num}  -msoft-cmpsf @gol
635 -msplit-lohi  -mpost-inc  -mpost-modify  -mstack-offset=@var{num} @gol
636 -mround-nearest  -mlong-calls  -mshort-calls  -msmall16 @gol
637 -mfp-mode=@var{mode}  -mvect-double  -max-vect-align=@var{num} @gol
638 -msplit-vecmove-early  -m1reg-@var{reg}}
640 @emph{ARC Options}
641 @gccoptlist{-mbarrel-shifter -mjli-always @gol
642 -mcpu=@var{cpu}  -mA6  -mARC600  -mA7  -mARC700 @gol
643 -mdpfp  -mdpfp-compact  -mdpfp-fast  -mno-dpfp-lrsr @gol
644 -mea  -mno-mpy  -mmul32x16  -mmul64  -matomic @gol
645 -mnorm  -mspfp  -mspfp-compact  -mspfp-fast  -msimd  -msoft-float  -mswap @gol
646 -mcrc  -mdsp-packa  -mdvbf  -mlock  -mmac-d16  -mmac-24  -mrtsc  -mswape @gol
647 -mtelephony  -mxy  -misize  -mannotate-align  -marclinux  -marclinux_prof @gol
648 -mlong-calls  -mmedium-calls  -msdata -mirq-ctrl-saved @gol
649 -mrgf-banked-regs -mlpc-width=@var{width} -G @var{num} @gol
650 -mvolatile-cache  -mtp-regno=@var{regno} @gol
651 -malign-call  -mauto-modify-reg  -mbbit-peephole  -mno-brcc @gol
652 -mcase-vector-pcrel  -mcompact-casesi  -mno-cond-exec  -mearly-cbranchsi @gol
653 -mexpand-adddi  -mindexed-loads  -mlra  -mlra-priority-none @gol
654 -mlra-priority-compact mlra-priority-noncompact  -mmillicode @gol
655 -mmixed-code  -mq-class  -mRcq  -mRcw  -msize-level=@var{level} @gol
656 -mtune=@var{cpu}  -mmultcost=@var{num} -mcode-density-frame @gol
657 -munalign-prob-threshold=@var{probability}  -mmpy-option=@var{multo} @gol
658 -mdiv-rem  -mcode-density  -mll64  -mfpu=@var{fpu} -mrf16  -mbranch-index}
660 @emph{ARM Options}
661 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
662 -mabi=@var{name} @gol
663 -mapcs-stack-check  -mno-apcs-stack-check @gol
664 -mapcs-reentrant  -mno-apcs-reentrant @gol
665 -msched-prolog  -mno-sched-prolog @gol
666 -mlittle-endian  -mbig-endian @gol
667 -mbe8 -mbe32 @gol
668 -mfloat-abi=@var{name} @gol
669 -mfp16-format=@var{name}
670 -mthumb-interwork  -mno-thumb-interwork @gol
671 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
672 -mtune=@var{name}  -mprint-tune-info @gol
673 -mstructure-size-boundary=@var{n} @gol
674 -mabort-on-noreturn @gol
675 -mlong-calls  -mno-long-calls @gol
676 -msingle-pic-base  -mno-single-pic-base @gol
677 -mpic-register=@var{reg} @gol
678 -mnop-fun-dllimport @gol
679 -mpoke-function-name @gol
680 -mthumb  -marm  -mflip-thumb @gol
681 -mtpcs-frame  -mtpcs-leaf-frame @gol
682 -mcaller-super-interworking  -mcallee-super-interworking @gol
683 -mtp=@var{name}  -mtls-dialect=@var{dialect} @gol
684 -mword-relocations @gol
685 -mfix-cortex-m3-ldrd @gol
686 -munaligned-access @gol
687 -mneon-for-64bits @gol
688 -mslow-flash-data @gol
689 -masm-syntax-unified @gol
690 -mrestrict-it @gol
691 -mverbose-cost-dump @gol
692 -mpure-code @gol
693 -mcmse}
695 @emph{AVR Options}
696 @gccoptlist{-mmcu=@var{mcu}  -mabsdata  -maccumulate-args @gol
697 -mbranch-cost=@var{cost} @gol
698 -mcall-prologues  -mgas-isr-prologues  -mint8 @gol
699 -mn_flash=@var{size}  -mno-interrupts @gol
700 -mmain-is-OS_task -mrelax  -mrmw  -mstrict-X  -mtiny-stack @gol
701 -mfract-convert-truncate @gol
702 -mshort-calls  -nodevicelib @gol
703 -Waddr-space-convert  -Wmisspelled-isr}
705 @emph{Blackfin Options}
706 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
707 -msim  -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
708 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
709 -mlow-64k  -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
710 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
711 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
712 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
713 -mfast-fp  -minline-plt  -mmulticore  -mcorea  -mcoreb  -msdram @gol
714 -micplb}
716 @emph{C6X Options}
717 @gccoptlist{-mbig-endian  -mlittle-endian  -march=@var{cpu} @gol
718 -msim  -msdata=@var{sdata-type}}
720 @emph{CRIS Options}
721 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
722 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
723 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
724 -mstack-align  -mdata-align  -mconst-align @gol
725 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
726 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
727 -mmul-bug-workaround  -mno-mul-bug-workaround}
729 @emph{CR16 Options}
730 @gccoptlist{-mmac @gol
731 -mcr16cplus  -mcr16c @gol
732 -msim  -mint32  -mbit-ops
733 -mdata-model=@var{model}}
735 @emph{C-SKY Options}
736 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu} @gol
737 -mbig-endian  -EB  -mlittle-endian  -EL @gol
738 -mhard-float  -msoft-float  -mfpu=@var{fpu}  -mdouble-float  -mfdivdu @gol
739 -melrw  -mistack  -mmp  -mcp  -mcache  -msecurity  -mtrust @gol
740 -mdsp  -medsp  -mvdsp @gol
741 -mdiv  -msmart  -mhigh-registers  -manchor @gol
742 -mpushpop  -mmultiple-stld  -mconstpool  -mstack-size  -mccrt @gol
743 -mbranch-cost=@var{n}  -mcse-cc  -msched-prolog}
745 @emph{Darwin Options}
746 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
747 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
748 -client_name  -compatibility_version  -current_version @gol
749 -dead_strip @gol
750 -dependency-file  -dylib_file  -dylinker_install_name @gol
751 -dynamic  -dynamiclib  -exported_symbols_list @gol
752 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
753 -force_flat_namespace  -headerpad_max_install_names @gol
754 -iframework @gol
755 -image_base  -init  -install_name  -keep_private_externs @gol
756 -multi_module  -multiply_defined  -multiply_defined_unused @gol
757 -noall_load   -no_dead_strip_inits_and_terms @gol
758 -nofixprebinding  -nomultidefs  -noprebind  -noseglinkedit @gol
759 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
760 -private_bundle  -read_only_relocs  -sectalign @gol
761 -sectobjectsymbols  -whyload  -seg1addr @gol
762 -sectcreate  -sectobjectsymbols  -sectorder @gol
763 -segaddr  -segs_read_only_addr  -segs_read_write_addr @gol
764 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
765 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
766 -single_module  -static  -sub_library  -sub_umbrella @gol
767 -twolevel_namespace  -umbrella  -undefined @gol
768 -unexported_symbols_list  -weak_reference_mismatches @gol
769 -whatsloaded  -F  -gused  -gfull  -mmacosx-version-min=@var{version} @gol
770 -mkernel  -mone-byte-bool}
772 @emph{DEC Alpha Options}
773 @gccoptlist{-mno-fp-regs  -msoft-float @gol
774 -mieee  -mieee-with-inexact  -mieee-conformant @gol
775 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
776 -mtrap-precision=@var{mode}  -mbuild-constants @gol
777 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
778 -mbwx  -mmax  -mfix  -mcix @gol
779 -mfloat-vax  -mfloat-ieee @gol
780 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
781 -msmall-text  -mlarge-text @gol
782 -mmemory-latency=@var{time}}
784 @emph{FR30 Options}
785 @gccoptlist{-msmall-model  -mno-lsim}
787 @emph{FT32 Options}
788 @gccoptlist{-msim  -mlra  -mnodiv  -mft32b  -mcompress  -mnopm}
790 @emph{FRV Options}
791 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
792 -mhard-float  -msoft-float @gol
793 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
794 -mdouble  -mno-double @gol
795 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
796 -mfdpic  -minline-plt  -mgprel-ro  -multilib-library-pic @gol
797 -mlinked-fp  -mlong-calls  -malign-labels @gol
798 -mlibrary-pic  -macc-4  -macc-8 @gol
799 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
800 -moptimize-membar  -mno-optimize-membar @gol
801 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
802 -mvliw-branch  -mno-vliw-branch @gol
803 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
804 -mno-nested-cond-exec  -mtomcat-stats @gol
805 -mTLS  -mtls @gol
806 -mcpu=@var{cpu}}
808 @emph{GNU/Linux Options}
809 @gccoptlist{-mglibc  -muclibc  -mmusl  -mbionic  -mandroid @gol
810 -tno-android-cc  -tno-android-ld}
812 @emph{H8/300 Options}
813 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr  -mno-exr  -mint32  -malign-300}
815 @emph{HPPA Options}
816 @gccoptlist{-march=@var{architecture-type} @gol
817 -mcaller-copies  -mdisable-fpregs  -mdisable-indexing @gol
818 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
819 -mfixed-range=@var{register-range} @gol
820 -mjump-in-delay  -mlinker-opt  -mlong-calls @gol
821 -mlong-load-store  -mno-disable-fpregs @gol
822 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
823 -mno-jump-in-delay  -mno-long-load-store @gol
824 -mno-portable-runtime  -mno-soft-float @gol
825 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
826 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
827 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
828 -munix=@var{unix-std}  -nolibdld  -static  -threads}
830 @emph{IA-64 Options}
831 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
832 -mvolatile-asm-stop  -mregister-names  -msdata  -mno-sdata @gol
833 -mconstant-gp  -mauto-pic  -mfused-madd @gol
834 -minline-float-divide-min-latency @gol
835 -minline-float-divide-max-throughput @gol
836 -mno-inline-float-divide @gol
837 -minline-int-divide-min-latency @gol
838 -minline-int-divide-max-throughput  @gol
839 -mno-inline-int-divide @gol
840 -minline-sqrt-min-latency  -minline-sqrt-max-throughput @gol
841 -mno-inline-sqrt @gol
842 -mdwarf2-asm  -mearly-stop-bits @gol
843 -mfixed-range=@var{register-range}  -mtls-size=@var{tls-size} @gol
844 -mtune=@var{cpu-type}  -milp32  -mlp64 @gol
845 -msched-br-data-spec  -msched-ar-data-spec  -msched-control-spec @gol
846 -msched-br-in-data-spec  -msched-ar-in-data-spec  -msched-in-control-spec @gol
847 -msched-spec-ldc  -msched-spec-control-ldc @gol
848 -msched-prefer-non-data-spec-insns  -msched-prefer-non-control-spec-insns @gol
849 -msched-stop-bits-after-every-cycle  -msched-count-spec-in-critical-path @gol
850 -msel-sched-dont-check-control-spec  -msched-fp-mem-deps-zero-cost @gol
851 -msched-max-memory-insns-hard-limit  -msched-max-memory-insns=@var{max-insns}}
853 @emph{LM32 Options}
854 @gccoptlist{-mbarrel-shift-enabled  -mdivide-enabled  -mmultiply-enabled @gol
855 -msign-extend-enabled  -muser-enabled}
857 @emph{M32R/D Options}
858 @gccoptlist{-m32r2  -m32rx  -m32r @gol
859 -mdebug @gol
860 -malign-loops  -mno-align-loops @gol
861 -missue-rate=@var{number} @gol
862 -mbranch-cost=@var{number} @gol
863 -mmodel=@var{code-size-model-type} @gol
864 -msdata=@var{sdata-type} @gol
865 -mno-flush-func  -mflush-func=@var{name} @gol
866 -mno-flush-trap  -mflush-trap=@var{number} @gol
867 -G @var{num}}
869 @emph{M32C Options}
870 @gccoptlist{-mcpu=@var{cpu}  -msim  -memregs=@var{number}}
872 @emph{M680x0 Options}
873 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune} @gol
874 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
875 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
876 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
877 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
878 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
879 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
880 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
881 -mxgot  -mno-xgot  -mlong-jump-table-offsets}
883 @emph{MCore Options}
884 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
885 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
886 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
887 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
888 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
890 @emph{MeP Options}
891 @gccoptlist{-mabsdiff  -mall-opts  -maverage  -mbased=@var{n}  -mbitops @gol
892 -mc=@var{n}  -mclip  -mconfig=@var{name}  -mcop  -mcop32  -mcop64  -mivc2 @gol
893 -mdc  -mdiv  -meb  -mel  -mio-volatile  -ml  -mleadz  -mm  -mminmax @gol
894 -mmult  -mno-opts  -mrepeat  -ms  -msatur  -msdram  -msim  -msimnovec  -mtf @gol
895 -mtiny=@var{n}}
897 @emph{MicroBlaze Options}
898 @gccoptlist{-msoft-float  -mhard-float  -msmall-divides  -mcpu=@var{cpu} @gol
899 -mmemcpy  -mxl-soft-mul  -mxl-soft-div  -mxl-barrel-shift @gol
900 -mxl-pattern-compare  -mxl-stack-check  -mxl-gp-opt  -mno-clearbss @gol
901 -mxl-multiply-high  -mxl-float-convert  -mxl-float-sqrt @gol
902 -mbig-endian  -mlittle-endian  -mxl-reorder  -mxl-mode-@var{app-model}
903 -mpic-data-is-text-relative}
905 @emph{MIPS Options}
906 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
907 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips32r3  -mips32r5 @gol
908 -mips32r6  -mips64  -mips64r2  -mips64r3  -mips64r5  -mips64r6 @gol
909 -mips16  -mno-mips16  -mflip-mips16 @gol
910 -minterlink-compressed  -mno-interlink-compressed @gol
911 -minterlink-mips16  -mno-interlink-mips16 @gol
912 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
913 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
914 -mgp32  -mgp64  -mfp32  -mfpxx  -mfp64  -mhard-float  -msoft-float @gol
915 -mno-float  -msingle-float  -mdouble-float @gol
916 -modd-spreg  -mno-odd-spreg @gol
917 -mabs=@var{mode}  -mnan=@var{encoding} @gol
918 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
919 -mmcu  -mmno-mcu @gol
920 -meva  -mno-eva @gol
921 -mvirt  -mno-virt @gol
922 -mxpa  -mno-xpa @gol
923 -mcrc -mno-crc @gol
924 -mginv -mno-ginv @gol
925 -mmicromips  -mno-micromips @gol
926 -mmsa  -mno-msa @gol
927 -mloongson-mmi  -mno-loongson-mmi @gol
928 -mloongson-ext  -mno-loongson-ext @gol
929 -mloongson-ext2  -mno-loongson-ext2 @gol
930 -mfpu=@var{fpu-type} @gol
931 -msmartmips  -mno-smartmips @gol
932 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
933 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
934 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
935 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
936 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
937 -membedded-data  -mno-embedded-data @gol
938 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
939 -mcode-readable=@var{setting} @gol
940 -msplit-addresses  -mno-split-addresses @gol
941 -mexplicit-relocs  -mno-explicit-relocs @gol
942 -mcheck-zero-division  -mno-check-zero-division @gol
943 -mdivide-traps  -mdivide-breaks @gol
944 -mload-store-pairs  -mno-load-store-pairs @gol
945 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
946 -mmad  -mno-mad  -mimadd  -mno-imadd  -mfused-madd  -mno-fused-madd  -nocpp @gol
947 -mfix-24k  -mno-fix-24k @gol
948 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
949 -mfix-r10000  -mno-fix-r10000  -mfix-rm7000  -mno-fix-rm7000 @gol
950 -mfix-vr4120  -mno-fix-vr4120 @gol
951 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
952 -mflush-func=@var{func}  -mno-flush-func @gol
953 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
954 -mcompact-branches=@var{policy} @gol
955 -mfp-exceptions  -mno-fp-exceptions @gol
956 -mvr4130-align  -mno-vr4130-align  -msynci  -mno-synci @gol
957 -mlxc1-sxc1 -mno-lxc1-sxc1 -mmadd4 -mno-madd4 @gol
958 -mrelax-pic-calls  -mno-relax-pic-calls  -mmcount-ra-address @gol
959 -mframe-header-opt  -mno-frame-header-opt}
961 @emph{MMIX Options}
962 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
963 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
964 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
965 -mno-base-addresses  -msingle-exit  -mno-single-exit}
967 @emph{MN10300 Options}
968 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
969 -mno-am33  -mam33  -mam33-2  -mam34 @gol
970 -mtune=@var{cpu-type} @gol
971 -mreturn-pointer-on-d0 @gol
972 -mno-crt0  -mrelax  -mliw  -msetlb}
974 @emph{Moxie Options}
975 @gccoptlist{-meb  -mel  -mmul.x  -mno-crt0}
977 @emph{MSP430 Options}
978 @gccoptlist{-msim  -masm-hex  -mmcu=  -mcpu=  -mlarge  -msmall  -mrelax @gol
979 -mwarn-mcu @gol
980 -mcode-region=  -mdata-region= @gol
981 -msilicon-errata=  -msilicon-errata-warn= @gol
982 -mhwmult=  -minrt}
984 @emph{NDS32 Options}
985 @gccoptlist{-mbig-endian  -mlittle-endian @gol
986 -mreduced-regs  -mfull-regs @gol
987 -mcmov  -mno-cmov @gol
988 -mext-perf  -mno-ext-perf @gol
989 -mext-perf2  -mno-ext-perf2 @gol
990 -mext-string  -mno-ext-string @gol
991 -mv3push  -mno-v3push @gol
992 -m16bit  -mno-16bit @gol
993 -misr-vector-size=@var{num} @gol
994 -mcache-block-size=@var{num} @gol
995 -march=@var{arch} @gol
996 -mcmodel=@var{code-model} @gol
997 -mctor-dtor  -mrelax}
999 @emph{Nios II Options}
1000 @gccoptlist{-G @var{num}  -mgpopt=@var{option}  -mgpopt  -mno-gpopt @gol
1001 -mgprel-sec=@var{regexp} -mr0rel-sec=@var{regexp} @gol
1002 -mel  -meb @gol
1003 -mno-bypass-cache  -mbypass-cache @gol
1004 -mno-cache-volatile  -mcache-volatile @gol
1005 -mno-fast-sw-div  -mfast-sw-div @gol
1006 -mhw-mul  -mno-hw-mul  -mhw-mulx  -mno-hw-mulx  -mno-hw-div  -mhw-div @gol
1007 -mcustom-@var{insn}=@var{N}  -mno-custom-@var{insn} @gol
1008 -mcustom-fpu-cfg=@var{name} @gol
1009 -mhal  -msmallc  -msys-crt0=@var{name}  -msys-lib=@var{name} @gol
1010 -march=@var{arch}  -mbmx  -mno-bmx  -mcdx  -mno-cdx}
1012 @emph{Nvidia PTX Options}
1013 @gccoptlist{-m32  -m64  -mmainkernel  -moptimize}
1015 @emph{OpenRISC Options}
1016 @gccoptlist{-mboard=@var{name} -mnewlib -mhard-mul -mhard-div @gol
1017 -msoft-mul -msoft-div @gol
1018 -mcmov -mror -msext -msfimm -mshftimm}
1020 @emph{PDP-11 Options}
1021 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
1022 -mint32  -mno-int16 -mint16  -mno-int32 @gol
1023 -msplit -munix-asm  -mdec-asm -mgnu-asm -mlra}
1025 @emph{picoChip Options}
1026 @gccoptlist{-mae=@var{ae_type}  -mvliw-lookahead=@var{N} @gol
1027 -msymbol-as-address  -mno-inefficient-warnings}
1029 @emph{PowerPC Options}
1030 See RS/6000 and PowerPC Options.
1032 @emph{PowerPC SPE Options}
1033 @gccoptlist{-mcpu=@var{cpu-type} @gol
1034 -mtune=@var{cpu-type} @gol
1035 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb @gol
1036 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
1037 -m32  -mxl-compat  -mno-xl-compat @gol
1038 -malign-power  -malign-natural @gol
1039 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
1040 -msingle-float  -mdouble-float @gol
1041 -mupdate  -mno-update @gol
1042 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
1043 -mstrict-align  -mno-strict-align  -mrelocatable @gol
1044 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
1045 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
1046 -msingle-pic-base @gol
1047 -mprioritize-restricted-insns=@var{priority} @gol
1048 -msched-costly-dep=@var{dependence_type} @gol
1049 -minsert-sched-nops=@var{scheme} @gol
1050 -mcall-sysv  -mcall-netbsd @gol
1051 -maix-struct-return  -msvr4-struct-return @gol
1052 -mabi=@var{abi-type}  -msecure-plt  -mbss-plt @gol
1053 -mblock-move-inline-limit=@var{num} @gol
1054 -misel  -mno-isel @gol
1055 -misel=yes  -misel=no @gol
1056 -mspe  -mno-spe @gol
1057 -mspe=yes  -mspe=no @gol
1058 -mfloat-gprs=yes  -mfloat-gprs=no  -mfloat-gprs=single  -mfloat-gprs=double @gol
1059 -mprototype  -mno-prototype @gol
1060 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
1061 -msdata=@var{opt}  -mvxworks  -G @var{num} @gol
1062 -mrecip  -mrecip=@var{opt}  -mno-recip  -mrecip-precision @gol
1063 -mno-recip-precision @gol
1064 -mpointers-to-nested-functions  -mno-pointers-to-nested-functions @gol
1065 -msave-toc-indirect  -mno-save-toc-indirect @gol
1066 -mcompat-align-parm  -mno-compat-align-parm @gol
1067 -mfloat128  -mno-float128 @gol
1068 -mgnu-attribute  -mno-gnu-attribute @gol
1069 -mstack-protector-guard=@var{guard} -mstack-protector-guard-reg=@var{reg} @gol
1070 -mstack-protector-guard-offset=@var{offset}}
1072 @emph{RISC-V Options}
1073 @gccoptlist{-mbranch-cost=@var{N-instruction} @gol
1074 -mplt  -mno-plt @gol
1075 -mabi=@var{ABI-string} @gol
1076 -mfdiv  -mno-fdiv @gol
1077 -mdiv  -mno-div @gol
1078 -march=@var{ISA-string} @gol
1079 -mtune=@var{processor-string} @gol
1080 -mpreferred-stack-boundary=@var{num} @gol
1081 -msmall-data-limit=@var{N-bytes} @gol
1082 -msave-restore  -mno-save-restore @gol
1083 -mstrict-align -mno-strict-align @gol
1084 -mcmodel=medlow -mcmodel=medany @gol
1085 -mexplicit-relocs  -mno-explicit-relocs @gol
1086 -mrelax -mno-relax @gol}
1088 @emph{RL78 Options}
1089 @gccoptlist{-msim  -mmul=none  -mmul=g13  -mmul=g14  -mallregs @gol
1090 -mcpu=g10  -mcpu=g13  -mcpu=g14  -mg10  -mg13  -mg14 @gol
1091 -m64bit-doubles  -m32bit-doubles  -msave-mduc-in-interrupts}
1093 @emph{RS/6000 and PowerPC Options}
1094 @gccoptlist{-mcpu=@var{cpu-type} @gol
1095 -mtune=@var{cpu-type} @gol
1096 -mcmodel=@var{code-model} @gol
1097 -mpowerpc64 @gol
1098 -maltivec  -mno-altivec @gol
1099 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
1100 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
1101 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mpopcntd  -mno-popcntd @gol
1102 -mfprnd  -mno-fprnd @gol
1103 -mcmpb  -mno-cmpb  -mmfpgpr  -mno-mfpgpr  -mhard-dfp  -mno-hard-dfp @gol
1104 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
1105 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
1106 -malign-power  -malign-natural @gol
1107 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
1108 -mupdate  -mno-update @gol
1109 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
1110 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
1111 -mstrict-align  -mno-strict-align  -mrelocatable @gol
1112 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
1113 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
1114 -mdynamic-no-pic  -maltivec  -mswdiv  -msingle-pic-base @gol
1115 -mprioritize-restricted-insns=@var{priority} @gol
1116 -msched-costly-dep=@var{dependence_type} @gol
1117 -minsert-sched-nops=@var{scheme} @gol
1118 -mcall-aixdesc  -mcall-eabi  -mcall-freebsd  @gol
1119 -mcall-linux  -mcall-netbsd  -mcall-openbsd  @gol
1120 -mcall-sysv  -mcall-sysv-eabi  -mcall-sysv-noeabi @gol
1121 -mtraceback=@var{traceback_type} @gol
1122 -maix-struct-return  -msvr4-struct-return @gol
1123 -mabi=@var{abi-type}  -msecure-plt  -mbss-plt @gol
1124 -mblock-move-inline-limit=@var{num} @gol
1125 -mblock-compare-inline-limit=@var{num} @gol
1126 -mblock-compare-inline-loop-limit=@var{num} @gol
1127 -mstring-compare-inline-limit=@var{num} @gol
1128 -misel  -mno-isel @gol
1129 -mvrsave  -mno-vrsave @gol
1130 -mmulhw  -mno-mulhw @gol
1131 -mdlmzb  -mno-dlmzb @gol
1132 -mprototype  -mno-prototype @gol
1133 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
1134 -msdata=@var{opt}  -mreadonly-in-sdata  -mvxworks  -G @var{num} @gol
1135 -mrecip  -mrecip=@var{opt}  -mno-recip  -mrecip-precision @gol
1136 -mno-recip-precision @gol
1137 -mveclibabi=@var{type}  -mfriz  -mno-friz @gol
1138 -mpointers-to-nested-functions  -mno-pointers-to-nested-functions @gol
1139 -msave-toc-indirect  -mno-save-toc-indirect @gol
1140 -mpower8-fusion  -mno-mpower8-fusion  -mpower8-vector  -mno-power8-vector @gol
1141 -mcrypto  -mno-crypto  -mhtm  -mno-htm @gol
1142 -mquad-memory  -mno-quad-memory @gol
1143 -mquad-memory-atomic  -mno-quad-memory-atomic @gol
1144 -mcompat-align-parm  -mno-compat-align-parm @gol
1145 -mfloat128  -mno-float128  -mfloat128-hardware  -mno-float128-hardware @gol
1146 -mgnu-attribute  -mno-gnu-attribute @gol
1147 -mstack-protector-guard=@var{guard} -mstack-protector-guard-reg=@var{reg} @gol
1148 -mstack-protector-guard-offset=@var{offset}}
1150 @emph{RX Options}
1151 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
1152 -mcpu=@gol
1153 -mbig-endian-data  -mlittle-endian-data @gol
1154 -msmall-data @gol
1155 -msim  -mno-sim@gol
1156 -mas100-syntax  -mno-as100-syntax@gol
1157 -mrelax@gol
1158 -mmax-constant-size=@gol
1159 -mint-register=@gol
1160 -mpid@gol
1161 -mallow-string-insns  -mno-allow-string-insns@gol
1162 -mjsr@gol
1163 -mno-warn-multiple-fast-interrupts@gol
1164 -msave-acc-in-interrupts}
1166 @emph{S/390 and zSeries Options}
1167 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1168 -mhard-float  -msoft-float  -mhard-dfp  -mno-hard-dfp @gol
1169 -mlong-double-64  -mlong-double-128 @gol
1170 -mbackchain  -mno-backchain  -mpacked-stack  -mno-packed-stack @gol
1171 -msmall-exec  -mno-small-exec  -mmvcle  -mno-mvcle @gol
1172 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
1173 -mhtm  -mvx  -mzvector @gol
1174 -mtpf-trace  -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
1175 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size  -mstack-guard @gol
1176 -mhotpatch=@var{halfwords},@var{halfwords}}
1178 @emph{Score Options}
1179 @gccoptlist{-meb  -mel @gol
1180 -mnhwloop @gol
1181 -muls @gol
1182 -mmac @gol
1183 -mscore5  -mscore5u  -mscore7  -mscore7d}
1185 @emph{SH Options}
1186 @gccoptlist{-m1  -m2  -m2e @gol
1187 -m2a-nofpu  -m2a-single-only  -m2a-single  -m2a @gol
1188 -m3  -m3e @gol
1189 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
1190 -m4a-nofpu  -m4a-single-only  -m4a-single  -m4a  -m4al @gol
1191 -mb  -ml  -mdalign  -mrelax @gol
1192 -mbigtable  -mfmovd  -mrenesas  -mno-renesas  -mnomacsave @gol
1193 -mieee  -mno-ieee  -mbitops  -misize  -minline-ic_invalidate  -mpadstruct @gol
1194 -mprefergot  -musermode  -multcost=@var{number}  -mdiv=@var{strategy} @gol
1195 -mdivsi3_libfunc=@var{name}  -mfixed-range=@var{register-range} @gol
1196 -maccumulate-outgoing-args @gol
1197 -matomic-model=@var{atomic-model} @gol
1198 -mbranch-cost=@var{num}  -mzdcbranch  -mno-zdcbranch @gol
1199 -mcbranch-force-delay-slot @gol
1200 -mfused-madd  -mno-fused-madd  -mfsca  -mno-fsca  -mfsrra  -mno-fsrra @gol
1201 -mpretend-cmove  -mtas}
1203 @emph{Solaris 2 Options}
1204 @gccoptlist{-mclear-hwcap  -mno-clear-hwcap  -mimpure-text  -mno-impure-text @gol
1205 -pthreads}
1207 @emph{SPARC Options}
1208 @gccoptlist{-mcpu=@var{cpu-type} @gol
1209 -mtune=@var{cpu-type} @gol
1210 -mcmodel=@var{code-model} @gol
1211 -mmemory-model=@var{mem-model} @gol
1212 -m32  -m64  -mapp-regs  -mno-app-regs @gol
1213 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
1214 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
1215 -mhard-quad-float  -msoft-quad-float @gol
1216 -mstack-bias  -mno-stack-bias @gol
1217 -mstd-struct-return  -mno-std-struct-return @gol
1218 -munaligned-doubles  -mno-unaligned-doubles @gol
1219 -muser-mode  -mno-user-mode @gol
1220 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
1221 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
1222 -mvis4 -mno-vis4 -mvis4b -mno-vis4b @gol
1223 -mcbcond  -mno-cbcond  -mfmaf  -mno-fmaf  -mfsmuld  -mno-fsmuld  @gol
1224 -mpopc  -mno-popc  -msubxc  -mno-subxc @gol
1225 -mfix-at697f  -mfix-ut699  -mfix-ut700  -mfix-gr712rc @gol
1226 -mlra  -mno-lra}
1228 @emph{SPU Options}
1229 @gccoptlist{-mwarn-reloc  -merror-reloc @gol
1230 -msafe-dma  -munsafe-dma @gol
1231 -mbranch-hints @gol
1232 -msmall-mem  -mlarge-mem  -mstdmain @gol
1233 -mfixed-range=@var{register-range} @gol
1234 -mea32  -mea64 @gol
1235 -maddress-space-conversion  -mno-address-space-conversion @gol
1236 -mcache-size=@var{cache-size} @gol
1237 -matomic-updates  -mno-atomic-updates}
1239 @emph{System V Options}
1240 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
1242 @emph{TILE-Gx Options}
1243 @gccoptlist{-mcpu=CPU  -m32  -m64  -mbig-endian  -mlittle-endian @gol
1244 -mcmodel=@var{code-model}}
1246 @emph{TILEPro Options}
1247 @gccoptlist{-mcpu=@var{cpu}  -m32}
1249 @emph{V850 Options}
1250 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
1251 -mprolog-function  -mno-prolog-function  -mspace @gol
1252 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
1253 -mapp-regs  -mno-app-regs @gol
1254 -mdisable-callt  -mno-disable-callt @gol
1255 -mv850e2v3  -mv850e2  -mv850e1  -mv850es @gol
1256 -mv850e  -mv850  -mv850e3v5 @gol
1257 -mloop @gol
1258 -mrelax @gol
1259 -mlong-jumps @gol
1260 -msoft-float @gol
1261 -mhard-float @gol
1262 -mgcc-abi @gol
1263 -mrh850-abi @gol
1264 -mbig-switch}
1266 @emph{VAX Options}
1267 @gccoptlist{-mg  -mgnu  -munix}
1269 @emph{Visium Options}
1270 @gccoptlist{-mdebug  -msim  -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
1271 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type}  -msv-mode  -muser-mode}
1273 @emph{VMS Options}
1274 @gccoptlist{-mvms-return-codes  -mdebug-main=@var{prefix}  -mmalloc64 @gol
1275 -mpointer-size=@var{size}}
1277 @emph{VxWorks Options}
1278 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
1279 -Xbind-lazy  -Xbind-now}
1281 @emph{x86 Options}
1282 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1283 -mtune-ctrl=@var{feature-list}  -mdump-tune-features  -mno-default @gol
1284 -mfpmath=@var{unit} @gol
1285 -masm=@var{dialect}  -mno-fancy-math-387 @gol
1286 -mno-fp-ret-in-387  -m80387  -mhard-float  -msoft-float @gol
1287 -mno-wide-multiply  -mrtd  -malign-double @gol
1288 -mpreferred-stack-boundary=@var{num} @gol
1289 -mincoming-stack-boundary=@var{num} @gol
1290 -mcld  -mcx16  -msahf  -mmovbe  -mcrc32 @gol
1291 -mrecip  -mrecip=@var{opt} @gol
1292 -mvzeroupper  -mprefer-avx128 -mprefer-vector-width=@var{opt} @gol
1293 -mmmx  -msse  -msse2  -msse3  -mssse3  -msse4.1  -msse4.2  -msse4  -mavx @gol
1294 -mavx2  -mavx512f  -mavx512pf  -mavx512er  -mavx512cd  -mavx512vl @gol
1295 -mavx512bw  -mavx512dq  -mavx512ifma  -mavx512vbmi  -msha  -maes @gol
1296 -mpclmul  -mfsgsbase  -mrdrnd  -mf16c  -mfma -mpconfig -mwbnoinvd -mptwrite @gol
1297 -mprefetchwt1  -mclflushopt  -mxsavec  -mxsaves @gol
1298 -msse4a  -m3dnow  -m3dnowa  -mpopcnt  -mabm  -mbmi  -mtbm  -mfma4  -mxop @gol
1299 -mlzcnt  -mbmi2  -mfxsr  -mxsave  -mxsaveopt  -mrtm  -mlwp @gol
1300 -mmwaitx  -mclzero  -mpku  -mthreads -mgfni  -mvaes  -mwaitpkg @gol
1301 -mshstk -mforce-indirect-call -mavx512vbmi2 @gol
1302 -mvpclmulqdq -mavx512bitalg -mmovdiri -mmovdir64b -mavx512vpopcntdq
1303 -mcldemote @gol
1304 -mms-bitfields  -mno-align-stringops  -minline-all-stringops @gol
1305 -minline-stringops-dynamically  -mstringop-strategy=@var{alg} @gol
1306 -mmemcpy-strategy=@var{strategy}  -mmemset-strategy=@var{strategy} @gol
1307 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
1308 -m96bit-long-double  -mlong-double-64  -mlong-double-80  -mlong-double-128 @gol
1309 -mregparm=@var{num}  -msseregparm @gol
1310 -mveclibabi=@var{type}  -mvect8-ret-in-mem @gol
1311 -mpc32  -mpc64  -mpc80  -mstackrealign @gol
1312 -momit-leaf-frame-pointer  -mno-red-zone  -mno-tls-direct-seg-refs @gol
1313 -mcmodel=@var{code-model}  -mabi=@var{name}  -maddress-mode=@var{mode} @gol
1314 -m32  -m64  -mx32  -m16  -miamcu  -mlarge-data-threshold=@var{num} @gol
1315 -msse2avx  -mfentry  -mrecord-mcount  -mnop-mcount  -m8bit-idiv @gol
1316 -mavx256-split-unaligned-load  -mavx256-split-unaligned-store @gol
1317 -malign-data=@var{type}  -mstack-protector-guard=@var{guard} @gol
1318 -mstack-protector-guard-reg=@var{reg} @gol
1319 -mstack-protector-guard-offset=@var{offset} @gol
1320 -mstack-protector-guard-symbol=@var{symbol} @gol
1321 -mgeneral-regs-only -mcall-ms2sysv-xlogues @gol
1322 -mindirect-branch=@var{choice} -mfunction-return=@var{choice} @gol
1323 -mindirect-branch-register}
1325 @emph{x86 Windows Options}
1326 @gccoptlist{-mconsole  -mcygwin  -mno-cygwin  -mdll @gol
1327 -mnop-fun-dllimport  -mthread @gol
1328 -municode  -mwin32  -mwindows  -fno-set-stack-executable}
1330 @emph{Xstormy16 Options}
1331 @gccoptlist{-msim}
1333 @emph{Xtensa Options}
1334 @gccoptlist{-mconst16  -mno-const16 @gol
1335 -mfused-madd  -mno-fused-madd @gol
1336 -mforce-no-pic @gol
1337 -mserialize-volatile  -mno-serialize-volatile @gol
1338 -mtext-section-literals  -mno-text-section-literals @gol
1339 -mauto-litpools  -mno-auto-litpools @gol
1340 -mtarget-align  -mno-target-align @gol
1341 -mlongcalls  -mno-longcalls}
1343 @emph{zSeries Options}
1344 See S/390 and zSeries Options.
1345 @end table
1348 @node Overall Options
1349 @section Options Controlling the Kind of Output
1351 Compilation can involve up to four stages: preprocessing, compilation
1352 proper, assembly and linking, always in that order.  GCC is capable of
1353 preprocessing and compiling several files either into several
1354 assembler input files, or into one assembler input file; then each
1355 assembler input file produces an object file, and linking combines all
1356 the object files (those newly compiled, and those specified as input)
1357 into an executable file.
1359 @cindex file name suffix
1360 For any given input file, the file name suffix determines what kind of
1361 compilation is done:
1363 @table @gcctabopt
1364 @item @var{file}.c
1365 C source code that must be preprocessed.
1367 @item @var{file}.i
1368 C source code that should not be preprocessed.
1370 @item @var{file}.ii
1371 C++ source code that should not be preprocessed.
1373 @item @var{file}.m
1374 Objective-C source code.  Note that you must link with the @file{libobjc}
1375 library to make an Objective-C program work.
1377 @item @var{file}.mi
1378 Objective-C source code that should not be preprocessed.
1380 @item @var{file}.mm
1381 @itemx @var{file}.M
1382 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1383 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1384 to a literal capital M@.
1386 @item @var{file}.mii
1387 Objective-C++ source code that should not be preprocessed.
1389 @item @var{file}.h
1390 C, C++, Objective-C or Objective-C++ header file to be turned into a
1391 precompiled header (default), or C, C++ header file to be turned into an
1392 Ada spec (via the @option{-fdump-ada-spec} switch).
1394 @item @var{file}.cc
1395 @itemx @var{file}.cp
1396 @itemx @var{file}.cxx
1397 @itemx @var{file}.cpp
1398 @itemx @var{file}.CPP
1399 @itemx @var{file}.c++
1400 @itemx @var{file}.C
1401 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1402 the last two letters must both be literally @samp{x}.  Likewise,
1403 @samp{.C} refers to a literal capital C@.
1405 @item @var{file}.mm
1406 @itemx @var{file}.M
1407 Objective-C++ source code that must be preprocessed.
1409 @item @var{file}.mii
1410 Objective-C++ source code that should not be preprocessed.
1412 @item @var{file}.hh
1413 @itemx @var{file}.H
1414 @itemx @var{file}.hp
1415 @itemx @var{file}.hxx
1416 @itemx @var{file}.hpp
1417 @itemx @var{file}.HPP
1418 @itemx @var{file}.h++
1419 @itemx @var{file}.tcc
1420 C++ header file to be turned into a precompiled header or Ada spec.
1422 @item @var{file}.f
1423 @itemx @var{file}.for
1424 @itemx @var{file}.ftn
1425 Fixed form Fortran source code that should not be preprocessed.
1427 @item @var{file}.F
1428 @itemx @var{file}.FOR
1429 @itemx @var{file}.fpp
1430 @itemx @var{file}.FPP
1431 @itemx @var{file}.FTN
1432 Fixed form Fortran source code that must be preprocessed (with the traditional
1433 preprocessor).
1435 @item @var{file}.f90
1436 @itemx @var{file}.f95
1437 @itemx @var{file}.f03
1438 @itemx @var{file}.f08
1439 Free form Fortran source code that should not be preprocessed.
1441 @item @var{file}.F90
1442 @itemx @var{file}.F95
1443 @itemx @var{file}.F03
1444 @itemx @var{file}.F08
1445 Free form Fortran source code that must be preprocessed (with the
1446 traditional preprocessor).
1448 @item @var{file}.go
1449 Go source code.
1451 @item @var{file}.brig
1452 BRIG files (binary representation of HSAIL).
1454 @item @var{file}.d
1455 D source code.
1457 @item @var{file}.di
1458 D interface file.
1460 @item @var{file}.dd
1461 D documentation code (Ddoc).
1463 @item @var{file}.ads
1464 Ada source code file that contains a library unit declaration (a
1465 declaration of a package, subprogram, or generic, or a generic
1466 instantiation), or a library unit renaming declaration (a package,
1467 generic, or subprogram renaming declaration).  Such files are also
1468 called @dfn{specs}.
1470 @item @var{file}.adb
1471 Ada source code file containing a library unit body (a subprogram or
1472 package body).  Such files are also called @dfn{bodies}.
1474 @c GCC also knows about some suffixes for languages not yet included:
1475 @c Ratfor:
1476 @c @var{file}.r
1478 @item @var{file}.s
1479 Assembler code.
1481 @item @var{file}.S
1482 @itemx @var{file}.sx
1483 Assembler code that must be preprocessed.
1485 @item @var{other}
1486 An object file to be fed straight into linking.
1487 Any file name with no recognized suffix is treated this way.
1488 @end table
1490 @opindex x
1491 You can specify the input language explicitly with the @option{-x} option:
1493 @table @gcctabopt
1494 @item -x @var{language}
1495 Specify explicitly the @var{language} for the following input files
1496 (rather than letting the compiler choose a default based on the file
1497 name suffix).  This option applies to all following input files until
1498 the next @option{-x} option.  Possible values for @var{language} are:
1499 @smallexample
1500 c  c-header  cpp-output
1501 c++  c++-header  c++-cpp-output
1502 objective-c  objective-c-header  objective-c-cpp-output
1503 objective-c++ objective-c++-header objective-c++-cpp-output
1504 assembler  assembler-with-cpp
1507 f77  f77-cpp-input f95  f95-cpp-input
1509 brig
1510 @end smallexample
1512 @item -x none
1513 Turn off any specification of a language, so that subsequent files are
1514 handled according to their file name suffixes (as they are if @option{-x}
1515 has not been used at all).
1516 @end table
1518 If you only want some of the stages of compilation, you can use
1519 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1520 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1521 @command{gcc} is to stop.  Note that some combinations (for example,
1522 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1524 @table @gcctabopt
1525 @item -c
1526 @opindex c
1527 Compile or assemble the source files, but do not link.  The linking
1528 stage simply is not done.  The ultimate output is in the form of an
1529 object file for each source file.
1531 By default, the object file name for a source file is made by replacing
1532 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1534 Unrecognized input files, not requiring compilation or assembly, are
1535 ignored.
1537 @item -S
1538 @opindex S
1539 Stop after the stage of compilation proper; do not assemble.  The output
1540 is in the form of an assembler code file for each non-assembler input
1541 file specified.
1543 By default, the assembler file name for a source file is made by
1544 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1546 Input files that don't require compilation are ignored.
1548 @item -E
1549 @opindex E
1550 Stop after the preprocessing stage; do not run the compiler proper.  The
1551 output is in the form of preprocessed source code, which is sent to the
1552 standard output.
1554 Input files that don't require preprocessing are ignored.
1556 @cindex output file option
1557 @item -o @var{file}
1558 @opindex o
1559 Place output in file @var{file}.  This applies to whatever
1560 sort of output is being produced, whether it be an executable file,
1561 an object file, an assembler file or preprocessed C code.
1563 If @option{-o} is not specified, the default is to put an executable
1564 file in @file{a.out}, the object file for
1565 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1566 assembler file in @file{@var{source}.s}, a precompiled header file in
1567 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1568 standard output.
1570 @item -v
1571 @opindex v
1572 Print (on standard error output) the commands executed to run the stages
1573 of compilation.  Also print the version number of the compiler driver
1574 program and of the preprocessor and the compiler proper.
1576 @item -###
1577 @opindex ###
1578 Like @option{-v} except the commands are not executed and arguments
1579 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1580 This is useful for shell scripts to capture the driver-generated command lines.
1582 @item --help
1583 @opindex help
1584 Print (on the standard output) a description of the command-line options
1585 understood by @command{gcc}.  If the @option{-v} option is also specified
1586 then @option{--help} is also passed on to the various processes
1587 invoked by @command{gcc}, so that they can display the command-line options
1588 they accept.  If the @option{-Wextra} option has also been specified
1589 (prior to the @option{--help} option), then command-line options that
1590 have no documentation associated with them are also displayed.
1592 @item --target-help
1593 @opindex target-help
1594 Print (on the standard output) a description of target-specific command-line
1595 options for each tool.  For some targets extra target-specific
1596 information may also be printed.
1598 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1599 Print (on the standard output) a description of the command-line
1600 options understood by the compiler that fit into all specified classes
1601 and qualifiers.  These are the supported classes:
1603 @table @asis
1604 @item @samp{optimizers}
1605 Display all of the optimization options supported by the
1606 compiler.
1608 @item @samp{warnings}
1609 Display all of the options controlling warning messages
1610 produced by the compiler.
1612 @item @samp{target}
1613 Display target-specific options.  Unlike the
1614 @option{--target-help} option however, target-specific options of the
1615 linker and assembler are not displayed.  This is because those
1616 tools do not currently support the extended @option{--help=} syntax.
1618 @item @samp{params}
1619 Display the values recognized by the @option{--param}
1620 option.
1622 @item @var{language}
1623 Display the options supported for @var{language}, where
1624 @var{language} is the name of one of the languages supported in this
1625 version of GCC@.
1627 @item @samp{common}
1628 Display the options that are common to all languages.
1629 @end table
1631 These are the supported qualifiers:
1633 @table @asis
1634 @item @samp{undocumented}
1635 Display only those options that are undocumented.
1637 @item @samp{joined}
1638 Display options taking an argument that appears after an equal
1639 sign in the same continuous piece of text, such as:
1640 @samp{--help=target}.
1642 @item @samp{separate}
1643 Display options taking an argument that appears as a separate word
1644 following the original option, such as: @samp{-o output-file}.
1645 @end table
1647 Thus for example to display all the undocumented target-specific
1648 switches supported by the compiler, use:
1650 @smallexample
1651 --help=target,undocumented
1652 @end smallexample
1654 The sense of a qualifier can be inverted by prefixing it with the
1655 @samp{^} character, so for example to display all binary warning
1656 options (i.e., ones that are either on or off and that do not take an
1657 argument) that have a description, use:
1659 @smallexample
1660 --help=warnings,^joined,^undocumented
1661 @end smallexample
1663 The argument to @option{--help=} should not consist solely of inverted
1664 qualifiers.
1666 Combining several classes is possible, although this usually
1667 restricts the output so much that there is nothing to display.  One
1668 case where it does work, however, is when one of the classes is
1669 @var{target}.  For example, to display all the target-specific
1670 optimization options, use:
1672 @smallexample
1673 --help=target,optimizers
1674 @end smallexample
1676 The @option{--help=} option can be repeated on the command line.  Each
1677 successive use displays its requested class of options, skipping
1678 those that have already been displayed.
1680 If the @option{-Q} option appears on the command line before the
1681 @option{--help=} option, then the descriptive text displayed by
1682 @option{--help=} is changed.  Instead of describing the displayed
1683 options, an indication is given as to whether the option is enabled,
1684 disabled or set to a specific value (assuming that the compiler
1685 knows this at the point where the @option{--help=} option is used).
1687 Here is a truncated example from the ARM port of @command{gcc}:
1689 @smallexample
1690   % gcc -Q -mabi=2 --help=target -c
1691   The following options are target specific:
1692   -mabi=                                2
1693   -mabort-on-noreturn                   [disabled]
1694   -mapcs                                [disabled]
1695 @end smallexample
1697 The output is sensitive to the effects of previous command-line
1698 options, so for example it is possible to find out which optimizations
1699 are enabled at @option{-O2} by using:
1701 @smallexample
1702 -Q -O2 --help=optimizers
1703 @end smallexample
1705 Alternatively you can discover which binary optimizations are enabled
1706 by @option{-O3} by using:
1708 @smallexample
1709 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1710 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1711 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1712 @end smallexample
1714 @item --version
1715 @opindex version
1716 Display the version number and copyrights of the invoked GCC@.
1718 @item -pass-exit-codes
1719 @opindex pass-exit-codes
1720 Normally the @command{gcc} program exits with the code of 1 if any
1721 phase of the compiler returns a non-success return code.  If you specify
1722 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1723 the numerically highest error produced by any phase returning an error
1724 indication.  The C, C++, and Fortran front ends return 4 if an internal
1725 compiler error is encountered.
1727 @item -pipe
1728 @opindex pipe
1729 Use pipes rather than temporary files for communication between the
1730 various stages of compilation.  This fails to work on some systems where
1731 the assembler is unable to read from a pipe; but the GNU assembler has
1732 no trouble.
1734 @item -specs=@var{file}
1735 @opindex specs
1736 Process @var{file} after the compiler reads in the standard @file{specs}
1737 file, in order to override the defaults which the @command{gcc} driver
1738 program uses when determining what switches to pass to @command{cc1},
1739 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
1740 @option{-specs=@var{file}} can be specified on the command line, and they
1741 are processed in order, from left to right.  @xref{Spec Files}, for
1742 information about the format of the @var{file}.
1744 @item -wrapper
1745 @opindex wrapper
1746 Invoke all subcommands under a wrapper program.  The name of the
1747 wrapper program and its parameters are passed as a comma separated
1748 list.
1750 @smallexample
1751 gcc -c t.c -wrapper gdb,--args
1752 @end smallexample
1754 @noindent
1755 This invokes all subprograms of @command{gcc} under
1756 @samp{gdb --args}, thus the invocation of @command{cc1} is
1757 @samp{gdb --args cc1 @dots{}}.
1759 @item -ffile-prefix-map=@var{old}=@var{new}
1760 @opindex ffile-prefix-map
1761 When compiling files residing in directory @file{@var{old}}, record
1762 any references to them in the result of the compilation as if the
1763 files resided in directory @file{@var{new}} instead.  Specifying this
1764 option is equivalent to specifying all the individual
1765 @option{-f*-prefix-map} options.  This can be used to make reproducible
1766 builds that are location independent.  See also
1767 @option{-fmacro-prefix-map} and @option{-fdebug-prefix-map}.
1769 @item -fplugin=@var{name}.so
1770 @opindex fplugin
1771 Load the plugin code in file @var{name}.so, assumed to be a
1772 shared object to be dlopen'd by the compiler.  The base name of
1773 the shared object file is used to identify the plugin for the
1774 purposes of argument parsing (See
1775 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1776 Each plugin should define the callback functions specified in the
1777 Plugins API.
1779 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1780 @opindex fplugin-arg
1781 Define an argument called @var{key} with a value of @var{value}
1782 for the plugin called @var{name}.
1784 @item -fdump-ada-spec@r{[}-slim@r{]}
1785 @opindex fdump-ada-spec
1786 For C and C++ source and include files, generate corresponding Ada specs.
1787 @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1788 GNAT User's Guide}, which provides detailed documentation on this feature.
1790 @item -fada-spec-parent=@var{unit}
1791 @opindex fada-spec-parent
1792 In conjunction with @option{-fdump-ada-spec@r{[}-slim@r{]}} above, generate
1793 Ada specs as child units of parent @var{unit}.
1795 @item -fdump-go-spec=@var{file}
1796 @opindex fdump-go-spec
1797 For input files in any language, generate corresponding Go
1798 declarations in @var{file}.  This generates Go @code{const},
1799 @code{type}, @code{var}, and @code{func} declarations which may be a
1800 useful way to start writing a Go interface to code written in some
1801 other language.
1803 @include @value{srcdir}/../libiberty/at-file.texi
1804 @end table
1806 @node Invoking G++
1807 @section Compiling C++ Programs
1809 @cindex suffixes for C++ source
1810 @cindex C++ source file suffixes
1811 C++ source files conventionally use one of the suffixes @samp{.C},
1812 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1813 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1814 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1815 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1816 files with these names and compiles them as C++ programs even if you
1817 call the compiler the same way as for compiling C programs (usually
1818 with the name @command{gcc}).
1820 @findex g++
1821 @findex c++
1822 However, the use of @command{gcc} does not add the C++ library.
1823 @command{g++} is a program that calls GCC and automatically specifies linking
1824 against the C++ library.  It treats @samp{.c},
1825 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1826 files unless @option{-x} is used.  This program is also useful when
1827 precompiling a C header file with a @samp{.h} extension for use in C++
1828 compilations.  On many systems, @command{g++} is also installed with
1829 the name @command{c++}.
1831 @cindex invoking @command{g++}
1832 When you compile C++ programs, you may specify many of the same
1833 command-line options that you use for compiling programs in any
1834 language; or command-line options meaningful for C and related
1835 languages; or options that are meaningful only for C++ programs.
1836 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1837 explanations of options for languages related to C@.
1838 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1839 explanations of options that are meaningful only for C++ programs.
1841 @node C Dialect Options
1842 @section Options Controlling C Dialect
1843 @cindex dialect options
1844 @cindex language dialect options
1845 @cindex options, dialect
1847 The following options control the dialect of C (or languages derived
1848 from C, such as C++, Objective-C and Objective-C++) that the compiler
1849 accepts:
1851 @table @gcctabopt
1852 @cindex ANSI support
1853 @cindex ISO support
1854 @item -ansi
1855 @opindex ansi
1856 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1857 equivalent to @option{-std=c++98}.
1859 This turns off certain features of GCC that are incompatible with ISO
1860 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1861 such as the @code{asm} and @code{typeof} keywords, and
1862 predefined macros such as @code{unix} and @code{vax} that identify the
1863 type of system you are using.  It also enables the undesirable and
1864 rarely used ISO trigraph feature.  For the C compiler,
1865 it disables recognition of C++ style @samp{//} comments as well as
1866 the @code{inline} keyword.
1868 The alternate keywords @code{__asm__}, @code{__extension__},
1869 @code{__inline__} and @code{__typeof__} continue to work despite
1870 @option{-ansi}.  You would not want to use them in an ISO C program, of
1871 course, but it is useful to put them in header files that might be included
1872 in compilations done with @option{-ansi}.  Alternate predefined macros
1873 such as @code{__unix__} and @code{__vax__} are also available, with or
1874 without @option{-ansi}.
1876 The @option{-ansi} option does not cause non-ISO programs to be
1877 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1878 addition to @option{-ansi}.  @xref{Warning Options}.
1880 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1881 option is used.  Some header files may notice this macro and refrain
1882 from declaring certain functions or defining certain macros that the
1883 ISO standard doesn't call for; this is to avoid interfering with any
1884 programs that might use these names for other things.
1886 Functions that are normally built in but do not have semantics
1887 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1888 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1889 built-in functions provided by GCC}, for details of the functions
1890 affected.
1892 @item -std=
1893 @opindex std
1894 Determine the language standard. @xref{Standards,,Language Standards
1895 Supported by GCC}, for details of these standard versions.  This option
1896 is currently only supported when compiling C or C++.
1898 The compiler can accept several base standards, such as @samp{c90} or
1899 @samp{c++98}, and GNU dialects of those standards, such as
1900 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1901 compiler accepts all programs following that standard plus those
1902 using GNU extensions that do not contradict it.  For example,
1903 @option{-std=c90} turns off certain features of GCC that are
1904 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1905 keywords, but not other GNU extensions that do not have a meaning in
1906 ISO C90, such as omitting the middle term of a @code{?:}
1907 expression. On the other hand, when a GNU dialect of a standard is
1908 specified, all features supported by the compiler are enabled, even when
1909 those features change the meaning of the base standard.  As a result, some
1910 strict-conforming programs may be rejected.  The particular standard
1911 is used by @option{-Wpedantic} to identify which features are GNU
1912 extensions given that version of the standard. For example
1913 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1914 comments, while @option{-std=gnu99 -Wpedantic} does not.
1916 A value for this option must be provided; possible values are
1918 @table @samp
1919 @item c90
1920 @itemx c89
1921 @itemx iso9899:1990
1922 Support all ISO C90 programs (certain GNU extensions that conflict
1923 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1925 @item iso9899:199409
1926 ISO C90 as modified in amendment 1.
1928 @item c99
1929 @itemx c9x
1930 @itemx iso9899:1999
1931 @itemx iso9899:199x
1932 ISO C99.  This standard is substantially completely supported, modulo
1933 bugs and floating-point issues
1934 (mainly but not entirely relating to optional C99 features from
1935 Annexes F and G).  See
1936 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1937 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1939 @item c11
1940 @itemx c1x
1941 @itemx iso9899:2011
1942 ISO C11, the 2011 revision of the ISO C standard.  This standard is
1943 substantially completely supported, modulo bugs, floating-point issues
1944 (mainly but not entirely relating to optional C11 features from
1945 Annexes F and G) and the optional Annexes K (Bounds-checking
1946 interfaces) and L (Analyzability).  The name @samp{c1x} is deprecated.
1948 @item c17
1949 @itemx c18
1950 @itemx iso9899:2017
1951 @itemx iso9899:2018
1952 ISO C17, the 2017 revision of the ISO C standard
1953 (published in 2018).  This standard is
1954 same as C11 except for corrections of defects (all of which are also
1955 applied with @option{-std=c11}) and a new value of
1956 @code{__STDC_VERSION__}, and so is supported to the same extent as C11.
1958 @item c2x
1959 The next version of the ISO C standard, still under development.  The
1960 support for this version is experimental and incomplete.
1962 @item gnu90
1963 @itemx gnu89
1964 GNU dialect of ISO C90 (including some C99 features).
1966 @item gnu99
1967 @itemx gnu9x
1968 GNU dialect of ISO C99.  The name @samp{gnu9x} is deprecated.
1970 @item gnu11
1971 @itemx gnu1x
1972 GNU dialect of ISO C11.
1973 The name @samp{gnu1x} is deprecated.
1975 @item gnu17
1976 @itemx gnu18
1977 GNU dialect of ISO C17.  This is the default for C code.
1979 @item gnu2x
1980 The next version of the ISO C standard, still under development, plus
1981 GNU extensions.  The support for this version is experimental and
1982 incomplete.
1984 @item c++98
1985 @itemx c++03
1986 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1987 additional defect reports. Same as @option{-ansi} for C++ code.
1989 @item gnu++98
1990 @itemx gnu++03
1991 GNU dialect of @option{-std=c++98}.
1993 @item c++11
1994 @itemx c++0x
1995 The 2011 ISO C++ standard plus amendments.
1996 The name @samp{c++0x} is deprecated.
1998 @item gnu++11
1999 @itemx gnu++0x
2000 GNU dialect of @option{-std=c++11}.
2001 The name @samp{gnu++0x} is deprecated.
2003 @item c++14
2004 @itemx c++1y
2005 The 2014 ISO C++ standard plus amendments.
2006 The name @samp{c++1y} is deprecated.
2008 @item gnu++14
2009 @itemx gnu++1y
2010 GNU dialect of @option{-std=c++14}.
2011 This is the default for C++ code.
2012 The name @samp{gnu++1y} is deprecated.
2014 @item c++17
2015 @itemx c++1z
2016 The 2017 ISO C++ standard plus amendments.
2017 The name @samp{c++1z} is deprecated.
2019 @item gnu++17
2020 @itemx gnu++1z
2021 GNU dialect of @option{-std=c++17}.
2022 The name @samp{gnu++1z} is deprecated.
2024 @item c++2a
2025 The next revision of the ISO C++ standard, tentatively planned for
2026 2020.  Support is highly experimental, and will almost certainly
2027 change in incompatible ways in future releases.
2029 @item gnu++2a
2030 GNU dialect of @option{-std=c++2a}.  Support is highly experimental,
2031 and will almost certainly change in incompatible ways in future
2032 releases.
2033 @end table
2035 @item -fgnu89-inline
2036 @opindex fgnu89-inline
2037 The option @option{-fgnu89-inline} tells GCC to use the traditional
2038 GNU semantics for @code{inline} functions when in C99 mode.
2039 @xref{Inline,,An Inline Function is As Fast As a Macro}.
2040 Using this option is roughly equivalent to adding the
2041 @code{gnu_inline} function attribute to all inline functions
2042 (@pxref{Function Attributes}).
2044 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
2045 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
2046 specifies the default behavior).
2047 This option is not supported in @option{-std=c90} or
2048 @option{-std=gnu90} mode.
2050 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
2051 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
2052 in effect for @code{inline} functions.  @xref{Common Predefined
2053 Macros,,,cpp,The C Preprocessor}.
2055 @item -fpermitted-flt-eval-methods=@var{style}
2056 @opindex fpermitted-flt-eval-methods
2057 @opindex fpermitted-flt-eval-methods=c11
2058 @opindex fpermitted-flt-eval-methods=ts-18661-3
2059 ISO/IEC TS 18661-3 defines new permissible values for
2060 @code{FLT_EVAL_METHOD} that indicate that operations and constants with
2061 a semantic type that is an interchange or extended format should be
2062 evaluated to the precision and range of that type.  These new values are
2063 a superset of those permitted under C99/C11, which does not specify the
2064 meaning of other positive values of @code{FLT_EVAL_METHOD}.  As such, code
2065 conforming to C11 may not have been written expecting the possibility of
2066 the new values.
2068 @option{-fpermitted-flt-eval-methods} specifies whether the compiler
2069 should allow only the values of @code{FLT_EVAL_METHOD} specified in C99/C11,
2070 or the extended set of values specified in ISO/IEC TS 18661-3.
2072 @var{style} is either @code{c11} or @code{ts-18661-3} as appropriate.
2074 The default when in a standards compliant mode (@option{-std=c11} or similar)
2075 is @option{-fpermitted-flt-eval-methods=c11}.  The default when in a GNU
2076 dialect (@option{-std=gnu11} or similar) is
2077 @option{-fpermitted-flt-eval-methods=ts-18661-3}.
2079 @item -aux-info @var{filename}
2080 @opindex aux-info
2081 Output to the given filename prototyped declarations for all functions
2082 declared and/or defined in a translation unit, including those in header
2083 files.  This option is silently ignored in any language other than C@.
2085 Besides declarations, the file indicates, in comments, the origin of
2086 each declaration (source file and line), whether the declaration was
2087 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
2088 @samp{O} for old, respectively, in the first character after the line
2089 number and the colon), and whether it came from a declaration or a
2090 definition (@samp{C} or @samp{F}, respectively, in the following
2091 character).  In the case of function definitions, a K&R-style list of
2092 arguments followed by their declarations is also provided, inside
2093 comments, after the declaration.
2095 @item -fallow-parameterless-variadic-functions
2096 @opindex fallow-parameterless-variadic-functions
2097 Accept variadic functions without named parameters.
2099 Although it is possible to define such a function, this is not very
2100 useful as it is not possible to read the arguments.  This is only
2101 supported for C as this construct is allowed by C++.
2103 @item -fno-asm
2104 @opindex fno-asm
2105 @opindex fasm
2106 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
2107 keyword, so that code can use these words as identifiers.  You can use
2108 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
2109 instead.  @option{-ansi} implies @option{-fno-asm}.
2111 In C++, this switch only affects the @code{typeof} keyword, since
2112 @code{asm} and @code{inline} are standard keywords.  You may want to
2113 use the @option{-fno-gnu-keywords} flag instead, which has the same
2114 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
2115 switch only affects the @code{asm} and @code{typeof} keywords, since
2116 @code{inline} is a standard keyword in ISO C99.
2118 @item -fno-builtin
2119 @itemx -fno-builtin-@var{function}
2120 @opindex fno-builtin
2121 @opindex fbuiltin
2122 @cindex built-in functions
2123 Don't recognize built-in functions that do not begin with
2124 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
2125 functions provided by GCC}, for details of the functions affected,
2126 including those which are not built-in functions when @option{-ansi} or
2127 @option{-std} options for strict ISO C conformance are used because they
2128 do not have an ISO standard meaning.
2130 GCC normally generates special code to handle certain built-in functions
2131 more efficiently; for instance, calls to @code{alloca} may become single
2132 instructions which adjust the stack directly, and calls to @code{memcpy}
2133 may become inline copy loops.  The resulting code is often both smaller
2134 and faster, but since the function calls no longer appear as such, you
2135 cannot set a breakpoint on those calls, nor can you change the behavior
2136 of the functions by linking with a different library.  In addition,
2137 when a function is recognized as a built-in function, GCC may use
2138 information about that function to warn about problems with calls to
2139 that function, or to generate more efficient code, even if the
2140 resulting code still contains calls to that function.  For example,
2141 warnings are given with @option{-Wformat} for bad calls to
2142 @code{printf} when @code{printf} is built in and @code{strlen} is
2143 known not to modify global memory.
2145 With the @option{-fno-builtin-@var{function}} option
2146 only the built-in function @var{function} is
2147 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
2148 function is named that is not built-in in this version of GCC, this
2149 option is ignored.  There is no corresponding
2150 @option{-fbuiltin-@var{function}} option; if you wish to enable
2151 built-in functions selectively when using @option{-fno-builtin} or
2152 @option{-ffreestanding}, you may define macros such as:
2154 @smallexample
2155 #define abs(n)          __builtin_abs ((n))
2156 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
2157 @end smallexample
2159 @item -fgimple
2160 @opindex fgimple
2162 Enable parsing of function definitions marked with @code{__GIMPLE}.
2163 This is an experimental feature that allows unit testing of GIMPLE
2164 passes.
2166 @item -fhosted
2167 @opindex fhosted
2168 @cindex hosted environment
2170 Assert that compilation targets a hosted environment.  This implies
2171 @option{-fbuiltin}.  A hosted environment is one in which the
2172 entire standard library is available, and in which @code{main} has a return
2173 type of @code{int}.  Examples are nearly everything except a kernel.
2174 This is equivalent to @option{-fno-freestanding}.
2176 @item -ffreestanding
2177 @opindex ffreestanding
2178 @cindex hosted environment
2180 Assert that compilation targets a freestanding environment.  This
2181 implies @option{-fno-builtin}.  A freestanding environment
2182 is one in which the standard library may not exist, and program startup may
2183 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
2184 This is equivalent to @option{-fno-hosted}.
2186 @xref{Standards,,Language Standards Supported by GCC}, for details of
2187 freestanding and hosted environments.
2189 @item -fopenacc
2190 @opindex fopenacc
2191 @cindex OpenACC accelerator programming
2192 Enable handling of OpenACC directives @code{#pragma acc} in C/C++ and
2193 @code{!$acc} in Fortran.  When @option{-fopenacc} is specified, the
2194 compiler generates accelerated code according to the OpenACC Application
2195 Programming Interface v2.0 @w{@uref{https://www.openacc.org}}.  This option
2196 implies @option{-pthread}, and thus is only supported on targets that
2197 have support for @option{-pthread}.
2199 @item -fopenacc-dim=@var{geom}
2200 @opindex fopenacc-dim
2201 @cindex OpenACC accelerator programming
2202 Specify default compute dimensions for parallel offload regions that do
2203 not explicitly specify.  The @var{geom} value is a triple of
2204 ':'-separated sizes, in order 'gang', 'worker' and, 'vector'.  A size
2205 can be omitted, to use a target-specific default value.
2207 @item -fopenmp
2208 @opindex fopenmp
2209 @cindex OpenMP parallel
2210 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
2211 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
2212 compiler generates parallel code according to the OpenMP Application
2213 Program Interface v4.5 @w{@uref{https://www.openmp.org}}.  This option
2214 implies @option{-pthread}, and thus is only supported on targets that
2215 have support for @option{-pthread}. @option{-fopenmp} implies
2216 @option{-fopenmp-simd}.
2218 @item -fopenmp-simd
2219 @opindex fopenmp-simd
2220 @cindex OpenMP SIMD
2221 @cindex SIMD
2222 Enable handling of OpenMP's SIMD directives with @code{#pragma omp}
2223 in C/C++ and @code{!$omp} in Fortran. Other OpenMP directives
2224 are ignored.
2226 @item -fgnu-tm
2227 @opindex fgnu-tm
2228 When the option @option{-fgnu-tm} is specified, the compiler
2229 generates code for the Linux variant of Intel's current Transactional
2230 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
2231 an experimental feature whose interface may change in future versions
2232 of GCC, as the official specification changes.  Please note that not
2233 all architectures are supported for this feature.
2235 For more information on GCC's support for transactional memory,
2236 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
2237 Transactional Memory Library}.
2239 Note that the transactional memory feature is not supported with
2240 non-call exceptions (@option{-fnon-call-exceptions}).
2242 @item -fms-extensions
2243 @opindex fms-extensions
2244 Accept some non-standard constructs used in Microsoft header files.
2246 In C++ code, this allows member names in structures to be similar
2247 to previous types declarations.
2249 @smallexample
2250 typedef int UOW;
2251 struct ABC @{
2252   UOW UOW;
2254 @end smallexample
2256 Some cases of unnamed fields in structures and unions are only
2257 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
2258 fields within structs/unions}, for details.
2260 Note that this option is off for all targets but x86 
2261 targets using ms-abi.
2263 @item -fplan9-extensions
2264 @opindex fplan9-extensions
2265 Accept some non-standard constructs used in Plan 9 code.
2267 This enables @option{-fms-extensions}, permits passing pointers to
2268 structures with anonymous fields to functions that expect pointers to
2269 elements of the type of the field, and permits referring to anonymous
2270 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
2271 struct/union fields within structs/unions}, for details.  This is only
2272 supported for C, not C++.
2274 @item -fcond-mismatch
2275 @opindex fcond-mismatch
2276 Allow conditional expressions with mismatched types in the second and
2277 third arguments.  The value of such an expression is void.  This option
2278 is not supported for C++.
2280 @item -flax-vector-conversions
2281 @opindex flax-vector-conversions
2282 Allow implicit conversions between vectors with differing numbers of
2283 elements and/or incompatible element types.  This option should not be
2284 used for new code.
2286 @item -funsigned-char
2287 @opindex funsigned-char
2288 Let the type @code{char} be unsigned, like @code{unsigned char}.
2290 Each kind of machine has a default for what @code{char} should
2291 be.  It is either like @code{unsigned char} by default or like
2292 @code{signed char} by default.
2294 Ideally, a portable program should always use @code{signed char} or
2295 @code{unsigned char} when it depends on the signedness of an object.
2296 But many programs have been written to use plain @code{char} and
2297 expect it to be signed, or expect it to be unsigned, depending on the
2298 machines they were written for.  This option, and its inverse, let you
2299 make such a program work with the opposite default.
2301 The type @code{char} is always a distinct type from each of
2302 @code{signed char} or @code{unsigned char}, even though its behavior
2303 is always just like one of those two.
2305 @item -fsigned-char
2306 @opindex fsigned-char
2307 Let the type @code{char} be signed, like @code{signed char}.
2309 Note that this is equivalent to @option{-fno-unsigned-char}, which is
2310 the negative form of @option{-funsigned-char}.  Likewise, the option
2311 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
2313 @item -fsigned-bitfields
2314 @itemx -funsigned-bitfields
2315 @itemx -fno-signed-bitfields
2316 @itemx -fno-unsigned-bitfields
2317 @opindex fsigned-bitfields
2318 @opindex funsigned-bitfields
2319 @opindex fno-signed-bitfields
2320 @opindex fno-unsigned-bitfields
2321 These options control whether a bit-field is signed or unsigned, when the
2322 declaration does not use either @code{signed} or @code{unsigned}.  By
2323 default, such a bit-field is signed, because this is consistent: the
2324 basic integer types such as @code{int} are signed types.
2326 @item -fsso-struct=@var{endianness}
2327 @opindex fsso-struct
2328 Set the default scalar storage order of structures and unions to the
2329 specified endianness.  The accepted values are @samp{big-endian},
2330 @samp{little-endian} and @samp{native} for the native endianness of
2331 the target (the default).  This option is not supported for C++.
2333 @strong{Warning:} the @option{-fsso-struct} switch causes GCC to generate
2334 code that is not binary compatible with code generated without it if the
2335 specified endianness is not the native endianness of the target.
2336 @end table
2338 @node C++ Dialect Options
2339 @section Options Controlling C++ Dialect
2341 @cindex compiler options, C++
2342 @cindex C++ options, command-line
2343 @cindex options, C++
2344 This section describes the command-line options that are only meaningful
2345 for C++ programs.  You can also use most of the GNU compiler options
2346 regardless of what language your program is in.  For example, you
2347 might compile a file @file{firstClass.C} like this:
2349 @smallexample
2350 g++ -g -fstrict-enums -O -c firstClass.C
2351 @end smallexample
2353 @noindent
2354 In this example, only @option{-fstrict-enums} is an option meant
2355 only for C++ programs; you can use the other options with any
2356 language supported by GCC@.
2358 Some options for compiling C programs, such as @option{-std}, are also
2359 relevant for C++ programs.
2360 @xref{C Dialect Options,,Options Controlling C Dialect}.
2362 Here is a list of options that are @emph{only} for compiling C++ programs:
2364 @table @gcctabopt
2366 @item -fabi-version=@var{n}
2367 @opindex fabi-version
2368 Use version @var{n} of the C++ ABI@.  The default is version 0.
2370 Version 0 refers to the version conforming most closely to
2371 the C++ ABI specification.  Therefore, the ABI obtained using version 0
2372 will change in different versions of G++ as ABI bugs are fixed.
2374 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.
2376 Version 2 is the version of the C++ ABI that first appeared in G++
2377 3.4, and was the default through G++ 4.9.
2379 Version 3 corrects an error in mangling a constant address as a
2380 template argument.
2382 Version 4, which first appeared in G++ 4.5, implements a standard
2383 mangling for vector types.
2385 Version 5, which first appeared in G++ 4.6, corrects the mangling of
2386 attribute const/volatile on function pointer types, decltype of a
2387 plain decl, and use of a function parameter in the declaration of
2388 another parameter.
2390 Version 6, which first appeared in G++ 4.7, corrects the promotion
2391 behavior of C++11 scoped enums and the mangling of template argument
2392 packs, const/static_cast, prefix ++ and --, and a class scope function
2393 used as a template argument.
2395 Version 7, which first appeared in G++ 4.8, that treats nullptr_t as a
2396 builtin type and corrects the mangling of lambdas in default argument
2397 scope.
2399 Version 8, which first appeared in G++ 4.9, corrects the substitution
2400 behavior of function types with function-cv-qualifiers.
2402 Version 9, which first appeared in G++ 5.2, corrects the alignment of
2403 @code{nullptr_t}.
2405 Version 10, which first appeared in G++ 6.1, adds mangling of
2406 attributes that affect type identity, such as ia32 calling convention
2407 attributes (e.g.@: @samp{stdcall}).
2409 Version 11, which first appeared in G++ 7, corrects the mangling of
2410 sizeof... expressions and operator names.  For multiple entities with
2411 the same name within a function, that are declared in different scopes,
2412 the mangling now changes starting with the twelfth occurrence.  It also
2413 implies @option{-fnew-inheriting-ctors}.
2415 Version 12, which first appeared in G++ 8, corrects the calling
2416 conventions for empty classes on the x86_64 target and for classes
2417 with only deleted copy/move constructors.  It accidentally changes the
2418 calling convention for classes with a deleted copy constructor and a
2419 trivial move constructor.
2421 Version 13, which first appeared in G++ 8.2, fixes the accidental
2422 change in version 12.
2424 See also @option{-Wabi}.
2426 @item -fabi-compat-version=@var{n}
2427 @opindex fabi-compat-version
2428 On targets that support strong aliases, G++
2429 works around mangling changes by creating an alias with the correct
2430 mangled name when defining a symbol with an incorrect mangled name.
2431 This switch specifies which ABI version to use for the alias.
2433 With @option{-fabi-version=0} (the default), this defaults to 11 (GCC 7
2434 compatibility).  If another ABI version is explicitly selected, this
2435 defaults to 0.  For compatibility with GCC versions 3.2 through 4.9,
2436 use @option{-fabi-compat-version=2}.
2438 If this option is not provided but @option{-Wabi=@var{n}} is, that
2439 version is used for compatibility aliases.  If this option is provided
2440 along with @option{-Wabi} (without the version), the version from this
2441 option is used for the warning.
2443 @item -fno-access-control
2444 @opindex fno-access-control
2445 @opindex faccess-control
2446 Turn off all access checking.  This switch is mainly useful for working
2447 around bugs in the access control code.
2449 @item -faligned-new
2450 @opindex faligned-new
2451 Enable support for C++17 @code{new} of types that require more
2452 alignment than @code{void* ::operator new(std::size_t)} provides.  A
2453 numeric argument such as @code{-faligned-new=32} can be used to
2454 specify how much alignment (in bytes) is provided by that function,
2455 but few users will need to override the default of
2456 @code{alignof(std::max_align_t)}.
2458 This flag is enabled by default for @option{-std=c++17}.
2460 @item -fcheck-new
2461 @opindex fcheck-new
2462 Check that the pointer returned by @code{operator new} is non-null
2463 before attempting to modify the storage allocated.  This check is
2464 normally unnecessary because the C++ standard specifies that
2465 @code{operator new} only returns @code{0} if it is declared
2466 @code{throw()}, in which case the compiler always checks the
2467 return value even without this option.  In all other cases, when
2468 @code{operator new} has a non-empty exception specification, memory
2469 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
2470 @samp{new (nothrow)}.
2472 @item -fconcepts
2473 @opindex fconcepts
2474 Enable support for the C++ Extensions for Concepts Technical
2475 Specification, ISO 19217 (2015), which allows code like
2477 @smallexample
2478 template <class T> concept bool Addable = requires (T t) @{ t + t; @};
2479 template <Addable T> T add (T a, T b) @{ return a + b; @}
2480 @end smallexample
2482 @item -fconstexpr-depth=@var{n}
2483 @opindex fconstexpr-depth
2484 Set the maximum nested evaluation depth for C++11 constexpr functions
2485 to @var{n}.  A limit is needed to detect endless recursion during
2486 constant expression evaluation.  The minimum specified by the standard
2487 is 512.
2489 @item -fconstexpr-loop-limit=@var{n}
2490 @opindex fconstexpr-loop-limit
2491 Set the maximum number of iterations for a loop in C++14 constexpr functions
2492 to @var{n}.  A limit is needed to detect infinite loops during
2493 constant expression evaluation.  The default is 262144 (1<<18).
2495 @item -fdeduce-init-list
2496 @opindex fdeduce-init-list
2497 Enable deduction of a template type parameter as
2498 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
2500 @smallexample
2501 template <class T> auto forward(T t) -> decltype (realfn (t))
2503   return realfn (t);
2506 void f()
2508   forward(@{1,2@}); // call forward<std::initializer_list<int>>
2510 @end smallexample
2512 This deduction was implemented as a possible extension to the
2513 originally proposed semantics for the C++11 standard, but was not part
2514 of the final standard, so it is disabled by default.  This option is
2515 deprecated, and may be removed in a future version of G++.
2517 @item -fno-elide-constructors
2518 @opindex fno-elide-constructors
2519 @opindex felide-constructors
2520 The C++ standard allows an implementation to omit creating a temporary
2521 that is only used to initialize another object of the same type.
2522 Specifying this option disables that optimization, and forces G++ to
2523 call the copy constructor in all cases.  This option also causes G++
2524 to call trivial member functions which otherwise would be expanded inline.
2526 In C++17, the compiler is required to omit these temporaries, but this
2527 option still affects trivial member functions.
2529 @item -fno-enforce-eh-specs
2530 @opindex fno-enforce-eh-specs
2531 @opindex fenforce-eh-specs
2532 Don't generate code to check for violation of exception specifications
2533 at run time.  This option violates the C++ standard, but may be useful
2534 for reducing code size in production builds, much like defining
2535 @code{NDEBUG}.  This does not give user code permission to throw
2536 exceptions in violation of the exception specifications; the compiler
2537 still optimizes based on the specifications, so throwing an
2538 unexpected exception results in undefined behavior at run time.
2540 @item -fextern-tls-init
2541 @itemx -fno-extern-tls-init
2542 @opindex fextern-tls-init
2543 @opindex fno-extern-tls-init
2544 The C++11 and OpenMP standards allow @code{thread_local} and
2545 @code{threadprivate} variables to have dynamic (runtime)
2546 initialization.  To support this, any use of such a variable goes
2547 through a wrapper function that performs any necessary initialization.
2548 When the use and definition of the variable are in the same
2549 translation unit, this overhead can be optimized away, but when the
2550 use is in a different translation unit there is significant overhead
2551 even if the variable doesn't actually need dynamic initialization.  If
2552 the programmer can be sure that no use of the variable in a
2553 non-defining TU needs to trigger dynamic initialization (either
2554 because the variable is statically initialized, or a use of the
2555 variable in the defining TU will be executed before any uses in
2556 another TU), they can avoid this overhead with the
2557 @option{-fno-extern-tls-init} option.
2559 On targets that support symbol aliases, the default is
2560 @option{-fextern-tls-init}.  On targets that do not support symbol
2561 aliases, the default is @option{-fno-extern-tls-init}.
2563 @item -fno-gnu-keywords
2564 @opindex fno-gnu-keywords
2565 @opindex fgnu-keywords
2566 Do not recognize @code{typeof} as a keyword, so that code can use this
2567 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2568 This option is implied by the strict ISO C++ dialects: @option{-ansi},
2569 @option{-std=c++98}, @option{-std=c++11}, etc.
2571 @item -fno-implicit-templates
2572 @opindex fno-implicit-templates
2573 @opindex fimplicit-templates
2574 Never emit code for non-inline templates that are instantiated
2575 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2576 @xref{Template Instantiation}, for more information.
2578 @item -fno-implicit-inline-templates
2579 @opindex fno-implicit-inline-templates
2580 @opindex fimplicit-inline-templates
2581 Don't emit code for implicit instantiations of inline templates, either.
2582 The default is to handle inlines differently so that compiles with and
2583 without optimization need the same set of explicit instantiations.
2585 @item -fno-implement-inlines
2586 @opindex fno-implement-inlines
2587 @opindex fimplement-inlines
2588 To save space, do not emit out-of-line copies of inline functions
2589 controlled by @code{#pragma implementation}.  This causes linker
2590 errors if these functions are not inlined everywhere they are called.
2592 @item -fms-extensions
2593 @opindex fms-extensions
2594 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2595 int and getting a pointer to member function via non-standard syntax.
2597 @item -fnew-inheriting-ctors
2598 @opindex fnew-inheriting-ctors
2599 Enable the P0136 adjustment to the semantics of C++11 constructor
2600 inheritance.  This is part of C++17 but also considered to be a Defect
2601 Report against C++11 and C++14.  This flag is enabled by default
2602 unless @option{-fabi-version=10} or lower is specified.
2604 @item -fnew-ttp-matching
2605 @opindex fnew-ttp-matching
2606 Enable the P0522 resolution to Core issue 150, template template
2607 parameters and default arguments: this allows a template with default
2608 template arguments as an argument for a template template parameter
2609 with fewer template parameters.  This flag is enabled by default for
2610 @option{-std=c++17}.
2612 @item -fno-nonansi-builtins
2613 @opindex fno-nonansi-builtins
2614 @opindex fnonansi-builtins
2615 Disable built-in declarations of functions that are not mandated by
2616 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2617 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2619 @item -fnothrow-opt
2620 @opindex fnothrow-opt
2621 Treat a @code{throw()} exception specification as if it were a
2622 @code{noexcept} specification to reduce or eliminate the text size
2623 overhead relative to a function with no exception specification.  If
2624 the function has local variables of types with non-trivial
2625 destructors, the exception specification actually makes the
2626 function smaller because the EH cleanups for those variables can be
2627 optimized away.  The semantic effect is that an exception thrown out of
2628 a function with such an exception specification results in a call
2629 to @code{terminate} rather than @code{unexpected}.
2631 @item -fno-operator-names
2632 @opindex fno-operator-names
2633 @opindex foperator-names
2634 Do not treat the operator name keywords @code{and}, @code{bitand},
2635 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2636 synonyms as keywords.
2638 @item -fno-optional-diags
2639 @opindex fno-optional-diags
2640 @opindex foptional-diags
2641 Disable diagnostics that the standard says a compiler does not need to
2642 issue.  Currently, the only such diagnostic issued by G++ is the one for
2643 a name having multiple meanings within a class.
2645 @item -fpermissive
2646 @opindex fpermissive
2647 Downgrade some diagnostics about nonconformant code from errors to
2648 warnings.  Thus, using @option{-fpermissive} allows some
2649 nonconforming code to compile.
2651 @item -fno-pretty-templates
2652 @opindex fno-pretty-templates
2653 @opindex fpretty-templates
2654 When an error message refers to a specialization of a function
2655 template, the compiler normally prints the signature of the
2656 template followed by the template arguments and any typedefs or
2657 typenames in the signature (e.g.@: @code{void f(T) [with T = int]}
2658 rather than @code{void f(int)}) so that it's clear which template is
2659 involved.  When an error message refers to a specialization of a class
2660 template, the compiler omits any template arguments that match
2661 the default template arguments for that template.  If either of these
2662 behaviors make it harder to understand the error message rather than
2663 easier, you can use @option{-fno-pretty-templates} to disable them.
2665 @item -frepo
2666 @opindex frepo
2667 Enable automatic template instantiation at link time.  This option also
2668 implies @option{-fno-implicit-templates}.  @xref{Template
2669 Instantiation}, for more information.
2671 @item -fno-rtti
2672 @opindex fno-rtti
2673 @opindex frtti
2674 Disable generation of information about every class with virtual
2675 functions for use by the C++ run-time type identification features
2676 (@code{dynamic_cast} and @code{typeid}).  If you don't use those parts
2677 of the language, you can save some space by using this flag.  Note that
2678 exception handling uses the same information, but G++ generates it as
2679 needed. The @code{dynamic_cast} operator can still be used for casts that
2680 do not require run-time type information, i.e.@: casts to @code{void *} or to
2681 unambiguous base classes.
2683 Mixing code compiled with @option{-frtti} with that compiled with
2684 @option{-fno-rtti} may not work.  For example, programs may
2685 fail to link if a class compiled with @option{-fno-rtti} is used as a base 
2686 for a class compiled with @option{-frtti}.  
2688 @item -fsized-deallocation
2689 @opindex fsized-deallocation
2690 Enable the built-in global declarations
2691 @smallexample
2692 void operator delete (void *, std::size_t) noexcept;
2693 void operator delete[] (void *, std::size_t) noexcept;
2694 @end smallexample
2695 as introduced in C++14.  This is useful for user-defined replacement
2696 deallocation functions that, for example, use the size of the object
2697 to make deallocation faster.  Enabled by default under
2698 @option{-std=c++14} and above.  The flag @option{-Wsized-deallocation}
2699 warns about places that might want to add a definition.
2701 @item -fstrict-enums
2702 @opindex fstrict-enums
2703 Allow the compiler to optimize using the assumption that a value of
2704 enumerated type can only be one of the values of the enumeration (as
2705 defined in the C++ standard; basically, a value that can be
2706 represented in the minimum number of bits needed to represent all the
2707 enumerators).  This assumption may not be valid if the program uses a
2708 cast to convert an arbitrary integer value to the enumerated type.
2710 @item -fstrong-eval-order
2711 @opindex fstrong-eval-order
2712 Evaluate member access, array subscripting, and shift expressions in
2713 left-to-right order, and evaluate assignment in right-to-left order,
2714 as adopted for C++17.  Enabled by default with @option{-std=c++17}.
2715 @option{-fstrong-eval-order=some} enables just the ordering of member
2716 access and shift expressions, and is the default without
2717 @option{-std=c++17}.
2719 @item -ftemplate-backtrace-limit=@var{n}
2720 @opindex ftemplate-backtrace-limit
2721 Set the maximum number of template instantiation notes for a single
2722 warning or error to @var{n}.  The default value is 10.
2724 @item -ftemplate-depth=@var{n}
2725 @opindex ftemplate-depth
2726 Set the maximum instantiation depth for template classes to @var{n}.
2727 A limit on the template instantiation depth is needed to detect
2728 endless recursions during template class instantiation.  ANSI/ISO C++
2729 conforming programs must not rely on a maximum depth greater than 17
2730 (changed to 1024 in C++11).  The default value is 900, as the compiler
2731 can run out of stack space before hitting 1024 in some situations.
2733 @item -fno-threadsafe-statics
2734 @opindex fno-threadsafe-statics
2735 @opindex fthreadsafe-statics
2736 Do not emit the extra code to use the routines specified in the C++
2737 ABI for thread-safe initialization of local statics.  You can use this
2738 option to reduce code size slightly in code that doesn't need to be
2739 thread-safe.
2741 @item -fuse-cxa-atexit
2742 @opindex fuse-cxa-atexit
2743 Register destructors for objects with static storage duration with the
2744 @code{__cxa_atexit} function rather than the @code{atexit} function.
2745 This option is required for fully standards-compliant handling of static
2746 destructors, but only works if your C library supports
2747 @code{__cxa_atexit}.
2749 @item -fno-use-cxa-get-exception-ptr
2750 @opindex fno-use-cxa-get-exception-ptr
2751 @opindex fuse-cxa-get-exception-ptr
2752 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2753 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2754 if the runtime routine is not available.
2756 @item -fvisibility-inlines-hidden
2757 @opindex fvisibility-inlines-hidden
2758 This switch declares that the user does not attempt to compare
2759 pointers to inline functions or methods where the addresses of the two functions
2760 are taken in different shared objects.
2762 The effect of this is that GCC may, effectively, mark inline methods with
2763 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2764 appear in the export table of a DSO and do not require a PLT indirection
2765 when used within the DSO@.  Enabling this option can have a dramatic effect
2766 on load and link times of a DSO as it massively reduces the size of the
2767 dynamic export table when the library makes heavy use of templates.
2769 The behavior of this switch is not quite the same as marking the
2770 methods as hidden directly, because it does not affect static variables
2771 local to the function or cause the compiler to deduce that
2772 the function is defined in only one shared object.
2774 You may mark a method as having a visibility explicitly to negate the
2775 effect of the switch for that method.  For example, if you do want to
2776 compare pointers to a particular inline method, you might mark it as
2777 having default visibility.  Marking the enclosing class with explicit
2778 visibility has no effect.
2780 Explicitly instantiated inline methods are unaffected by this option
2781 as their linkage might otherwise cross a shared library boundary.
2782 @xref{Template Instantiation}.
2784 @item -fvisibility-ms-compat
2785 @opindex fvisibility-ms-compat
2786 This flag attempts to use visibility settings to make GCC's C++
2787 linkage model compatible with that of Microsoft Visual Studio.
2789 The flag makes these changes to GCC's linkage model:
2791 @enumerate
2792 @item
2793 It sets the default visibility to @code{hidden}, like
2794 @option{-fvisibility=hidden}.
2796 @item
2797 Types, but not their members, are not hidden by default.
2799 @item
2800 The One Definition Rule is relaxed for types without explicit
2801 visibility specifications that are defined in more than one
2802 shared object: those declarations are permitted if they are
2803 permitted when this option is not used.
2804 @end enumerate
2806 In new code it is better to use @option{-fvisibility=hidden} and
2807 export those classes that are intended to be externally visible.
2808 Unfortunately it is possible for code to rely, perhaps accidentally,
2809 on the Visual Studio behavior.
2811 Among the consequences of these changes are that static data members
2812 of the same type with the same name but defined in different shared
2813 objects are different, so changing one does not change the other;
2814 and that pointers to function members defined in different shared
2815 objects may not compare equal.  When this flag is given, it is a
2816 violation of the ODR to define types with the same name differently.
2818 @item -fno-weak
2819 @opindex fno-weak
2820 @opindex fweak
2821 Do not use weak symbol support, even if it is provided by the linker.
2822 By default, G++ uses weak symbols if they are available.  This
2823 option exists only for testing, and should not be used by end-users;
2824 it results in inferior code and has no benefits.  This option may
2825 be removed in a future release of G++.
2827 @item -nostdinc++
2828 @opindex nostdinc++
2829 Do not search for header files in the standard directories specific to
2830 C++, but do still search the other standard directories.  (This option
2831 is used when building the C++ library.)
2832 @end table
2834 In addition, these optimization, warning, and code generation options
2835 have meanings only for C++ programs:
2837 @table @gcctabopt
2838 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2839 @opindex Wabi
2840 @opindex Wno-abi
2841 Warn when G++ it generates code that is probably not compatible with
2842 the vendor-neutral C++ ABI@.  Since G++ now defaults to updating the
2843 ABI with each major release, normally @option{-Wabi} will warn only if
2844 there is a check added later in a release series for an ABI issue
2845 discovered since the initial release.  @option{-Wabi} will warn about
2846 more things if an older ABI version is selected (with
2847 @option{-fabi-version=@var{n}}).
2849 @option{-Wabi} can also be used with an explicit version number to
2850 warn about compatibility with a particular @option{-fabi-version}
2851 level, e.g.@: @option{-Wabi=2} to warn about changes relative to
2852 @option{-fabi-version=2}.
2854 If an explicit version number is provided and
2855 @option{-fabi-compat-version} is not specified, the version number
2856 from this option is used for compatibility aliases.  If no explicit
2857 version number is provided with this option, but
2858 @option{-fabi-compat-version} is specified, that version number is
2859 used for ABI warnings.
2861 Although an effort has been made to warn about
2862 all such cases, there are probably some cases that are not warned about,
2863 even though G++ is generating incompatible code.  There may also be
2864 cases where warnings are emitted even though the code that is generated
2865 is compatible.
2867 You should rewrite your code to avoid these warnings if you are
2868 concerned about the fact that code generated by G++ may not be binary
2869 compatible with code generated by other compilers.
2871 Known incompatibilities in @option{-fabi-version=2} (which was the
2872 default from GCC 3.4 to 4.9) include:
2874 @itemize @bullet
2876 @item
2877 A template with a non-type template parameter of reference type was
2878 mangled incorrectly:
2879 @smallexample
2880 extern int N;
2881 template <int &> struct S @{@};
2882 void n (S<N>) @{2@}
2883 @end smallexample
2885 This was fixed in @option{-fabi-version=3}.
2887 @item
2888 SIMD vector types declared using @code{__attribute ((vector_size))} were
2889 mangled in a non-standard way that does not allow for overloading of
2890 functions taking vectors of different sizes.
2892 The mangling was changed in @option{-fabi-version=4}.
2894 @item
2895 @code{__attribute ((const))} and @code{noreturn} were mangled as type
2896 qualifiers, and @code{decltype} of a plain declaration was folded away.
2898 These mangling issues were fixed in @option{-fabi-version=5}.
2900 @item
2901 Scoped enumerators passed as arguments to a variadic function are
2902 promoted like unscoped enumerators, causing @code{va_arg} to complain.
2903 On most targets this does not actually affect the parameter passing
2904 ABI, as there is no way to pass an argument smaller than @code{int}.
2906 Also, the ABI changed the mangling of template argument packs,
2907 @code{const_cast}, @code{static_cast}, prefix increment/decrement, and
2908 a class scope function used as a template argument.
2910 These issues were corrected in @option{-fabi-version=6}.
2912 @item
2913 Lambdas in default argument scope were mangled incorrectly, and the
2914 ABI changed the mangling of @code{nullptr_t}.
2916 These issues were corrected in @option{-fabi-version=7}.
2918 @item
2919 When mangling a function type with function-cv-qualifiers, the
2920 un-qualified function type was incorrectly treated as a substitution
2921 candidate.
2923 This was fixed in @option{-fabi-version=8}, the default for GCC 5.1.
2925 @item
2926 @code{decltype(nullptr)} incorrectly had an alignment of 1, leading to
2927 unaligned accesses.  Note that this did not affect the ABI of a
2928 function with a @code{nullptr_t} parameter, as parameters have a
2929 minimum alignment.
2931 This was fixed in @option{-fabi-version=9}, the default for GCC 5.2.
2933 @item
2934 Target-specific attributes that affect the identity of a type, such as
2935 ia32 calling conventions on a function type (stdcall, regparm, etc.),
2936 did not affect the mangled name, leading to name collisions when
2937 function pointers were used as template arguments.
2939 This was fixed in @option{-fabi-version=10}, the default for GCC 6.1.
2941 @end itemize
2943 It also warns about psABI-related changes.  The known psABI changes at this
2944 point include:
2946 @itemize @bullet
2948 @item
2949 For SysV/x86-64, unions with @code{long double} members are 
2950 passed in memory as specified in psABI.  For example:
2952 @smallexample
2953 union U @{
2954   long double ld;
2955   int i;
2957 @end smallexample
2959 @noindent
2960 @code{union U} is always passed in memory.
2962 @end itemize
2964 @item -Wabi-tag @r{(C++ and Objective-C++ only)}
2965 @opindex Wabi-tag
2966 @opindex Wabi-tag
2967 Warn when a type with an ABI tag is used in a context that does not
2968 have that ABI tag.  See @ref{C++ Attributes} for more information
2969 about ABI tags.
2971 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2972 @opindex Wctor-dtor-privacy
2973 @opindex Wno-ctor-dtor-privacy
2974 Warn when a class seems unusable because all the constructors or
2975 destructors in that class are private, and it has neither friends nor
2976 public static member functions.  Also warn if there are no non-private
2977 methods, and there's at least one private member function that isn't
2978 a constructor or destructor.
2980 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2981 @opindex Wdelete-non-virtual-dtor
2982 @opindex Wno-delete-non-virtual-dtor
2983 Warn when @code{delete} is used to destroy an instance of a class that
2984 has virtual functions and non-virtual destructor. It is unsafe to delete
2985 an instance of a derived class through a pointer to a base class if the
2986 base class does not have a virtual destructor.  This warning is enabled
2987 by @option{-Wall}.
2989 @item -Wdeprecated-copy @r{(C++ and Objective-C++ only)}
2990 @opindex Wdeprecated-copy
2991 @opindex Wno-deprecated-copy
2992 Warn that the implicit declaration of a copy constructor or copy
2993 assignment operator is deprecated if the class has a user-provided
2994 copy constructor, copy assignment operator, or destructor, in C++11
2995 and up.  This warning is enabled by @option{-Wall}.
2997 @item -Wno-init-list-lifetime @r{(C++ and Objective-C++ only)}
2998 @opindex Winit-list-lifetime
2999 @opindex Wno-init-list-lifetime
3000 Do not warn about uses of @code{std::initializer_list} that are likely
3001 to result in dangling pointers.  Since the underlying array for an
3002 @code{initializer_list} is handled like a normal C++ temporary object,
3003 it is easy to inadvertently keep a pointer to the array past the end
3004 of the array's lifetime.  For example:
3006 @itemize @bullet
3007 @item
3008 If a function returns a temporary @code{initializer_list}, or a local
3009 @code{initializer_list} variable, the array's lifetime ends at the end
3010 of the return statement, so the value returned has a dangling pointer.
3012 @item
3013 If a new-expression creates an @code{initializer_list}, the array only
3014 lives until the end of the enclosing full-expression, so the
3015 @code{initializer_list} in the heap has a dangling pointer.
3017 @item
3018 When an @code{initializer_list} variable is assigned from a
3019 brace-enclosed initializer list, the temporary array created for the
3020 right side of the assignment only lives until the end of the
3021 full-expression, so at the next statement the @code{initializer_list}
3022 variable has a dangling pointer.
3024 @smallexample
3025 // li's initial underlying array lives as long as li
3026 std::initializer_list<int> li = @{ 1,2,3 @};
3027 // assignment changes li to point to a temporary array
3028 li = @{ 4, 5 @};
3029 // now the temporary is gone and li has a dangling pointer
3030 int i = li.begin()[0] // undefined behavior
3031 @end smallexample
3033 @item
3034 When a list constructor stores the @code{begin} pointer from the
3035 @code{initializer_list} argument, this doesn't extend the lifetime of
3036 the array, so if a class variable is constructed from a temporary
3037 @code{initializer_list}, the pointer is left dangling by the end of
3038 the variable declaration statement.
3040 @end itemize
3042 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
3043 @opindex Wliteral-suffix
3044 @opindex Wno-literal-suffix
3045 Warn when a string or character literal is followed by a ud-suffix which does
3046 not begin with an underscore.  As a conforming extension, GCC treats such
3047 suffixes as separate preprocessing tokens in order to maintain backwards
3048 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
3049 For example:
3051 @smallexample
3052 #define __STDC_FORMAT_MACROS
3053 #include <inttypes.h>
3054 #include <stdio.h>
3056 int main() @{
3057   int64_t i64 = 123;
3058   printf("My int64: %" PRId64"\n", i64);
3060 @end smallexample
3062 In this case, @code{PRId64} is treated as a separate preprocessing token.
3064 Additionally, warn when a user-defined literal operator is declared with
3065 a literal suffix identifier that doesn't begin with an underscore. Literal
3066 suffix identifiers that don't begin with an underscore are reserved for
3067 future standardization.
3069 This warning is enabled by default.
3071 @item -Wlto-type-mismatch
3072 @opindex Wlto-type-mismatch
3073 @opindex Wno-lto-type-mismatch
3075 During the link-time optimization warn about type mismatches in
3076 global declarations from different compilation units.
3077 Requires @option{-flto} to be enabled.  Enabled by default.
3079 @item -Wno-narrowing @r{(C++ and Objective-C++ only)}
3080 @opindex Wnarrowing
3081 @opindex Wno-narrowing
3082 For C++11 and later standards, narrowing conversions are diagnosed by default,
3083 as required by the standard.  A narrowing conversion from a constant produces
3084 an error, and a narrowing conversion from a non-constant produces a warning,
3085 but @option{-Wno-narrowing} suppresses the diagnostic.
3086 Note that this does not affect the meaning of well-formed code;
3087 narrowing conversions are still considered ill-formed in SFINAE contexts.
3089 With @option{-Wnarrowing} in C++98, warn when a narrowing
3090 conversion prohibited by C++11 occurs within
3091 @samp{@{ @}}, e.g.
3093 @smallexample
3094 int i = @{ 2.2 @}; // error: narrowing from double to int
3095 @end smallexample
3097 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
3099 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
3100 @opindex Wnoexcept
3101 @opindex Wno-noexcept
3102 Warn when a noexcept-expression evaluates to false because of a call
3103 to a function that does not have a non-throwing exception
3104 specification (i.e. @code{throw()} or @code{noexcept}) but is known by
3105 the compiler to never throw an exception.
3107 @item -Wnoexcept-type @r{(C++ and Objective-C++ only)}
3108 @opindex Wnoexcept-type
3109 @opindex Wno-noexcept-type
3110 Warn if the C++17 feature making @code{noexcept} part of a function
3111 type changes the mangled name of a symbol relative to C++14.  Enabled
3112 by @option{-Wabi} and @option{-Wc++17-compat}.
3114 As an example:
3116 @smallexample
3117 template <class T> void f(T t) @{ t(); @};
3118 void g() noexcept;
3119 void h() @{ f(g); @} 
3120 @end smallexample
3122 @noindent
3123 In C++14, @code{f} calls @code{f<void(*)()>}, but in
3124 C++17 it calls @code{f<void(*)()noexcept>}.
3126 @item -Wclass-memaccess @r{(C++ and Objective-C++ only)}
3127 @opindex Wclass-memaccess
3128 @opindex Wno-class-memaccess
3129 Warn when the destination of a call to a raw memory function such as
3130 @code{memset} or @code{memcpy} is an object of class type, and when writing
3131 into such an object might bypass the class non-trivial or deleted constructor
3132 or copy assignment, violate const-correctness or encapsulation, or corrupt
3133 virtual table pointers.  Modifying the representation of such objects may
3134 violate invariants maintained by member functions of the class.  For example,
3135 the call to @code{memset} below is undefined because it modifies a non-trivial
3136 class object and is, therefore, diagnosed.  The safe way to either initialize
3137 or clear the storage of objects of such types is by using the appropriate
3138 constructor or assignment operator, if one is available.
3139 @smallexample
3140 std::string str = "abc";
3141 memset (&str, 0, sizeof str);
3142 @end smallexample
3143 The @option{-Wclass-memaccess} option is enabled by @option{-Wall}.
3144 Explicitly casting the pointer to the class object to @code{void *} or
3145 to a type that can be safely accessed by the raw memory function suppresses
3146 the warning.
3148 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
3149 @opindex Wnon-virtual-dtor
3150 @opindex Wno-non-virtual-dtor
3151 Warn when a class has virtual functions and an accessible non-virtual
3152 destructor itself or in an accessible polymorphic base class, in which
3153 case it is possible but unsafe to delete an instance of a derived
3154 class through a pointer to the class itself or base class.  This
3155 warning is automatically enabled if @option{-Weffc++} is specified.
3157 @item -Wregister @r{(C++ and Objective-C++ only)}
3158 @opindex Wregister
3159 @opindex Wno-register
3160 Warn on uses of the @code{register} storage class specifier, except
3161 when it is part of the GNU @ref{Explicit Register Variables} extension.
3162 The use of the @code{register} keyword as storage class specifier has
3163 been deprecated in C++11 and removed in C++17.
3164 Enabled by default with @option{-std=c++17}.
3166 @item -Wreorder @r{(C++ and Objective-C++ only)}
3167 @opindex Wreorder
3168 @opindex Wno-reorder
3169 @cindex reordering, warning
3170 @cindex warning for reordering of member initializers
3171 Warn when the order of member initializers given in the code does not
3172 match the order in which they must be executed.  For instance:
3174 @smallexample
3175 struct A @{
3176   int i;
3177   int j;
3178   A(): j (0), i (1) @{ @}
3180 @end smallexample
3182 @noindent
3183 The compiler rearranges the member initializers for @code{i}
3184 and @code{j} to match the declaration order of the members, emitting
3185 a warning to that effect.  This warning is enabled by @option{-Wall}.
3187 @item -Wno-pessimizing-move @r{(C++ and Objective-C++ only)}
3188 @opindex Wpessimizing-move
3189 @opindex Wno-pessimizing-move
3190 This warning warns when a call to @code{std::move} prevents copy
3191 elision.  A typical scenario when copy elision can occur is when returning in
3192 a function with a class return type, when the expression being returned is the
3193 name of a non-volatile automatic object, and is not a function parameter, and
3194 has the same type as the function return type.
3196 @smallexample
3197 struct T @{
3198 @dots{}
3200 T fn()
3202   T t;
3203   @dots{}
3204   return std::move (t);
3206 @end smallexample
3208 But in this example, the @code{std::move} call prevents copy elision.
3210 This warning is enabled by @option{-Wall}.
3212 @item -Wno-redundant-move @r{(C++ and Objective-C++ only)}
3213 @opindex Wredundant-move
3214 @opindex Wno-redundant-move
3215 This warning warns about redundant calls to @code{std::move}; that is, when
3216 a move operation would have been performed even without the @code{std::move}
3217 call.  This happens because the compiler is forced to treat the object as if
3218 it were an rvalue in certain situations such as returning a local variable,
3219 where copy elision isn't applicable.  Consider:
3221 @smallexample
3222 struct T @{
3223 @dots{}
3225 T fn(T t)
3227   @dots{}
3228   return std::move (t);
3230 @end smallexample
3232 Here, the @code{std::move} call is redundant.  Because G++ implements Core
3233 Issue 1579, another example is:
3235 @smallexample
3236 struct T @{ // convertible to U
3237 @dots{}
3239 struct U @{
3240 @dots{}
3242 U fn()
3244   T t;
3245   @dots{}
3246   return std::move (t);
3248 @end smallexample
3249 In this example, copy elision isn't applicable because the type of the
3250 expression being returned and the function return type differ, yet G++
3251 treats the return value as if it were designated by an rvalue.
3253 This warning is enabled by @option{-Wextra}.
3255 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
3256 @opindex fext-numeric-literals
3257 @opindex fno-ext-numeric-literals
3258 Accept imaginary, fixed-point, or machine-defined
3259 literal number suffixes as GNU extensions.
3260 When this option is turned off these suffixes are treated
3261 as C++11 user-defined literal numeric suffixes.
3262 This is on by default for all pre-C++11 dialects and all GNU dialects:
3263 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
3264 @option{-std=gnu++14}.
3265 This option is off by default
3266 for ISO C++11 onwards (@option{-std=c++11}, ...).
3267 @end table
3269 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
3271 @table @gcctabopt
3272 @item -Weffc++ @r{(C++ and Objective-C++ only)}
3273 @opindex Weffc++
3274 @opindex Wno-effc++
3275 Warn about violations of the following style guidelines from Scott Meyers'
3276 @cite{Effective C++} series of books:
3278 @itemize @bullet
3279 @item
3280 Define a copy constructor and an assignment operator for classes
3281 with dynamically-allocated memory.
3283 @item
3284 Prefer initialization to assignment in constructors.
3286 @item
3287 Have @code{operator=} return a reference to @code{*this}.
3289 @item
3290 Don't try to return a reference when you must return an object.
3292 @item
3293 Distinguish between prefix and postfix forms of increment and
3294 decrement operators.
3296 @item
3297 Never overload @code{&&}, @code{||}, or @code{,}.
3299 @end itemize
3301 This option also enables @option{-Wnon-virtual-dtor}, which is also
3302 one of the effective C++ recommendations.  However, the check is
3303 extended to warn about the lack of virtual destructor in accessible
3304 non-polymorphic bases classes too.
3306 When selecting this option, be aware that the standard library
3307 headers do not obey all of these guidelines; use @samp{grep -v}
3308 to filter out those warnings.
3310 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
3311 @opindex Wstrict-null-sentinel
3312 @opindex Wno-strict-null-sentinel
3313 Warn about the use of an uncasted @code{NULL} as sentinel.  When
3314 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
3315 to @code{__null}.  Although it is a null pointer constant rather than a
3316 null pointer, it is guaranteed to be of the same size as a pointer.
3317 But this use is not portable across different compilers.
3319 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
3320 @opindex Wno-non-template-friend
3321 @opindex Wnon-template-friend
3322 Disable warnings when non-template friend functions are declared
3323 within a template.  In very old versions of GCC that predate implementation
3324 of the ISO standard, declarations such as 
3325 @samp{friend int foo(int)}, where the name of the friend is an unqualified-id,
3326 could be interpreted as a particular specialization of a template
3327 function; the warning exists to diagnose compatibility problems, 
3328 and is enabled by default.
3330 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
3331 @opindex Wold-style-cast
3332 @opindex Wno-old-style-cast
3333 Warn if an old-style (C-style) cast to a non-void type is used within
3334 a C++ program.  The new-style casts (@code{dynamic_cast},
3335 @code{static_cast}, @code{reinterpret_cast}, and @code{const_cast}) are
3336 less vulnerable to unintended effects and much easier to search for.
3338 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
3339 @opindex Woverloaded-virtual
3340 @opindex Wno-overloaded-virtual
3341 @cindex overloaded virtual function, warning
3342 @cindex warning for overloaded virtual function
3343 Warn when a function declaration hides virtual functions from a
3344 base class.  For example, in:
3346 @smallexample
3347 struct A @{
3348   virtual void f();
3351 struct B: public A @{
3352   void f(int);
3354 @end smallexample
3356 the @code{A} class version of @code{f} is hidden in @code{B}, and code
3357 like:
3359 @smallexample
3360 B* b;
3361 b->f();
3362 @end smallexample
3364 @noindent
3365 fails to compile.
3367 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
3368 @opindex Wno-pmf-conversions
3369 @opindex Wpmf-conversions
3370 Disable the diagnostic for converting a bound pointer to member function
3371 to a plain pointer.
3373 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
3374 @opindex Wsign-promo
3375 @opindex Wno-sign-promo
3376 Warn when overload resolution chooses a promotion from unsigned or
3377 enumerated type to a signed type, over a conversion to an unsigned type of
3378 the same size.  Previous versions of G++ tried to preserve
3379 unsignedness, but the standard mandates the current behavior.
3381 @item -Wtemplates @r{(C++ and Objective-C++ only)}
3382 @opindex Wtemplates
3383 @opindex Wno-templates
3384 Warn when a primary template declaration is encountered.  Some coding
3385 rules disallow templates, and this may be used to enforce that rule.
3386 The warning is inactive inside a system header file, such as the STL, so
3387 one can still use the STL.  One may also instantiate or specialize
3388 templates.
3390 @item -Wmultiple-inheritance @r{(C++ and Objective-C++ only)}
3391 @opindex Wmultiple-inheritance
3392 @opindex Wno-multiple-inheritance
3393 Warn when a class is defined with multiple direct base classes.  Some
3394 coding rules disallow multiple inheritance, and this may be used to
3395 enforce that rule.  The warning is inactive inside a system header file,
3396 such as the STL, so one can still use the STL.  One may also define
3397 classes that indirectly use multiple inheritance.
3399 @item -Wvirtual-inheritance
3400 @opindex Wvirtual-inheritance
3401 @opindex Wno-virtual-inheritance
3402 Warn when a class is defined with a virtual direct base class.  Some
3403 coding rules disallow multiple inheritance, and this may be used to
3404 enforce that rule.  The warning is inactive inside a system header file,
3405 such as the STL, so one can still use the STL.  One may also define
3406 classes that indirectly use virtual inheritance.
3408 @item -Wnamespaces
3409 @opindex Wnamespaces
3410 @opindex Wno-namespaces
3411 Warn when a namespace definition is opened.  Some coding rules disallow
3412 namespaces, and this may be used to enforce that rule.  The warning is
3413 inactive inside a system header file, such as the STL, so one can still
3414 use the STL.  One may also use using directives and qualified names.
3416 @item -Wno-terminate @r{(C++ and Objective-C++ only)}
3417 @opindex Wterminate
3418 @opindex Wno-terminate
3419 Disable the warning about a throw-expression that will immediately
3420 result in a call to @code{terminate}.
3422 @item -Wno-class-conversion @r{(C++ and Objective-C++ only)}
3423 @opindex Wno-class-conversion
3424 @opindex Wclass-conversion
3425 Disable the warning about the case when a conversion function converts an
3426 object to the same type, to a base class of that type, or to void; such
3427 a conversion function will never be called.
3428 @end table
3430 @node Objective-C and Objective-C++ Dialect Options
3431 @section Options Controlling Objective-C and Objective-C++ Dialects
3433 @cindex compiler options, Objective-C and Objective-C++
3434 @cindex Objective-C and Objective-C++ options, command-line
3435 @cindex options, Objective-C and Objective-C++
3436 (NOTE: This manual does not describe the Objective-C and Objective-C++
3437 languages themselves.  @xref{Standards,,Language Standards
3438 Supported by GCC}, for references.)
3440 This section describes the command-line options that are only meaningful
3441 for Objective-C and Objective-C++ programs.  You can also use most of
3442 the language-independent GNU compiler options.
3443 For example, you might compile a file @file{some_class.m} like this:
3445 @smallexample
3446 gcc -g -fgnu-runtime -O -c some_class.m
3447 @end smallexample
3449 @noindent
3450 In this example, @option{-fgnu-runtime} is an option meant only for
3451 Objective-C and Objective-C++ programs; you can use the other options with
3452 any language supported by GCC@.
3454 Note that since Objective-C is an extension of the C language, Objective-C
3455 compilations may also use options specific to the C front-end (e.g.,
3456 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
3457 C++-specific options (e.g., @option{-Wabi}).
3459 Here is a list of options that are @emph{only} for compiling Objective-C
3460 and Objective-C++ programs:
3462 @table @gcctabopt
3463 @item -fconstant-string-class=@var{class-name}
3464 @opindex fconstant-string-class
3465 Use @var{class-name} as the name of the class to instantiate for each
3466 literal string specified with the syntax @code{@@"@dots{}"}.  The default
3467 class name is @code{NXConstantString} if the GNU runtime is being used, and
3468 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
3469 @option{-fconstant-cfstrings} option, if also present, overrides the
3470 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
3471 to be laid out as constant CoreFoundation strings.
3473 @item -fgnu-runtime
3474 @opindex fgnu-runtime
3475 Generate object code compatible with the standard GNU Objective-C
3476 runtime.  This is the default for most types of systems.
3478 @item -fnext-runtime
3479 @opindex fnext-runtime
3480 Generate output compatible with the NeXT runtime.  This is the default
3481 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
3482 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
3483 used.
3485 @item -fno-nil-receivers
3486 @opindex fno-nil-receivers
3487 @opindex fnil-receivers
3488 Assume that all Objective-C message dispatches (@code{[receiver
3489 message:arg]}) in this translation unit ensure that the receiver is
3490 not @code{nil}.  This allows for more efficient entry points in the
3491 runtime to be used.  This option is only available in conjunction with
3492 the NeXT runtime and ABI version 0 or 1.
3494 @item -fobjc-abi-version=@var{n}
3495 @opindex fobjc-abi-version
3496 Use version @var{n} of the Objective-C ABI for the selected runtime.
3497 This option is currently supported only for the NeXT runtime.  In that
3498 case, Version 0 is the traditional (32-bit) ABI without support for
3499 properties and other Objective-C 2.0 additions.  Version 1 is the
3500 traditional (32-bit) ABI with support for properties and other
3501 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
3502 nothing is specified, the default is Version 0 on 32-bit target
3503 machines, and Version 2 on 64-bit target machines.
3505 @item -fobjc-call-cxx-cdtors
3506 @opindex fobjc-call-cxx-cdtors
3507 For each Objective-C class, check if any of its instance variables is a
3508 C++ object with a non-trivial default constructor.  If so, synthesize a
3509 special @code{- (id) .cxx_construct} instance method which runs
3510 non-trivial default constructors on any such instance variables, in order,
3511 and then return @code{self}.  Similarly, check if any instance variable
3512 is a C++ object with a non-trivial destructor, and if so, synthesize a
3513 special @code{- (void) .cxx_destruct} method which runs
3514 all such default destructors, in reverse order.
3516 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
3517 methods thusly generated only operate on instance variables
3518 declared in the current Objective-C class, and not those inherited
3519 from superclasses.  It is the responsibility of the Objective-C
3520 runtime to invoke all such methods in an object's inheritance
3521 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
3522 by the runtime immediately after a new object instance is allocated;
3523 the @code{- (void) .cxx_destruct} methods are invoked immediately
3524 before the runtime deallocates an object instance.
3526 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
3527 support for invoking the @code{- (id) .cxx_construct} and
3528 @code{- (void) .cxx_destruct} methods.
3530 @item -fobjc-direct-dispatch
3531 @opindex fobjc-direct-dispatch
3532 Allow fast jumps to the message dispatcher.  On Darwin this is
3533 accomplished via the comm page.
3535 @item -fobjc-exceptions
3536 @opindex fobjc-exceptions
3537 Enable syntactic support for structured exception handling in
3538 Objective-C, similar to what is offered by C++.  This option
3539 is required to use the Objective-C keywords @code{@@try},
3540 @code{@@throw}, @code{@@catch}, @code{@@finally} and
3541 @code{@@synchronized}.  This option is available with both the GNU
3542 runtime and the NeXT runtime (but not available in conjunction with
3543 the NeXT runtime on Mac OS X 10.2 and earlier).
3545 @item -fobjc-gc
3546 @opindex fobjc-gc
3547 Enable garbage collection (GC) in Objective-C and Objective-C++
3548 programs.  This option is only available with the NeXT runtime; the
3549 GNU runtime has a different garbage collection implementation that
3550 does not require special compiler flags.
3552 @item -fobjc-nilcheck
3553 @opindex fobjc-nilcheck
3554 For the NeXT runtime with version 2 of the ABI, check for a nil
3555 receiver in method invocations before doing the actual method call.
3556 This is the default and can be disabled using
3557 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
3558 checked for nil in this way no matter what this flag is set to.
3559 Currently this flag does nothing when the GNU runtime, or an older
3560 version of the NeXT runtime ABI, is used.
3562 @item -fobjc-std=objc1
3563 @opindex fobjc-std
3564 Conform to the language syntax of Objective-C 1.0, the language
3565 recognized by GCC 4.0.  This only affects the Objective-C additions to
3566 the C/C++ language; it does not affect conformance to C/C++ standards,
3567 which is controlled by the separate C/C++ dialect option flags.  When
3568 this option is used with the Objective-C or Objective-C++ compiler,
3569 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
3570 This is useful if you need to make sure that your Objective-C code can
3571 be compiled with older versions of GCC@.
3573 @item -freplace-objc-classes
3574 @opindex freplace-objc-classes
3575 Emit a special marker instructing @command{ld(1)} not to statically link in
3576 the resulting object file, and allow @command{dyld(1)} to load it in at
3577 run time instead.  This is used in conjunction with the Fix-and-Continue
3578 debugging mode, where the object file in question may be recompiled and
3579 dynamically reloaded in the course of program execution, without the need
3580 to restart the program itself.  Currently, Fix-and-Continue functionality
3581 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
3582 and later.
3584 @item -fzero-link
3585 @opindex fzero-link
3586 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
3587 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
3588 compile time) with static class references that get initialized at load time,
3589 which improves run-time performance.  Specifying the @option{-fzero-link} flag
3590 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
3591 to be retained.  This is useful in Zero-Link debugging mode, since it allows
3592 for individual class implementations to be modified during program execution.
3593 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
3594 regardless of command-line options.
3596 @item -fno-local-ivars
3597 @opindex fno-local-ivars
3598 @opindex flocal-ivars
3599 By default instance variables in Objective-C can be accessed as if
3600 they were local variables from within the methods of the class they're
3601 declared in.  This can lead to shadowing between instance variables
3602 and other variables declared either locally inside a class method or
3603 globally with the same name.  Specifying the @option{-fno-local-ivars}
3604 flag disables this behavior thus avoiding variable shadowing issues.
3606 @item -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]}
3607 @opindex fivar-visibility
3608 Set the default instance variable visibility to the specified option
3609 so that instance variables declared outside the scope of any access
3610 modifier directives default to the specified visibility.
3612 @item -gen-decls
3613 @opindex gen-decls
3614 Dump interface declarations for all classes seen in the source file to a
3615 file named @file{@var{sourcename}.decl}.
3617 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
3618 @opindex Wassign-intercept
3619 @opindex Wno-assign-intercept
3620 Warn whenever an Objective-C assignment is being intercepted by the
3621 garbage collector.
3623 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
3624 @opindex Wno-protocol
3625 @opindex Wprotocol
3626 If a class is declared to implement a protocol, a warning is issued for
3627 every method in the protocol that is not implemented by the class.  The
3628 default behavior is to issue a warning for every method not explicitly
3629 implemented in the class, even if a method implementation is inherited
3630 from the superclass.  If you use the @option{-Wno-protocol} option, then
3631 methods inherited from the superclass are considered to be implemented,
3632 and no warning is issued for them.
3634 @item -Wselector @r{(Objective-C and Objective-C++ only)}
3635 @opindex Wselector
3636 @opindex Wno-selector
3637 Warn if multiple methods of different types for the same selector are
3638 found during compilation.  The check is performed on the list of methods
3639 in the final stage of compilation.  Additionally, a check is performed
3640 for each selector appearing in a @code{@@selector(@dots{})}
3641 expression, and a corresponding method for that selector has been found
3642 during compilation.  Because these checks scan the method table only at
3643 the end of compilation, these warnings are not produced if the final
3644 stage of compilation is not reached, for example because an error is
3645 found during compilation, or because the @option{-fsyntax-only} option is
3646 being used.
3648 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
3649 @opindex Wstrict-selector-match
3650 @opindex Wno-strict-selector-match
3651 Warn if multiple methods with differing argument and/or return types are
3652 found for a given selector when attempting to send a message using this
3653 selector to a receiver of type @code{id} or @code{Class}.  When this flag
3654 is off (which is the default behavior), the compiler omits such warnings
3655 if any differences found are confined to types that share the same size
3656 and alignment.
3658 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
3659 @opindex Wundeclared-selector
3660 @opindex Wno-undeclared-selector
3661 Warn if a @code{@@selector(@dots{})} expression referring to an
3662 undeclared selector is found.  A selector is considered undeclared if no
3663 method with that name has been declared before the
3664 @code{@@selector(@dots{})} expression, either explicitly in an
3665 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
3666 an @code{@@implementation} section.  This option always performs its
3667 checks as soon as a @code{@@selector(@dots{})} expression is found,
3668 while @option{-Wselector} only performs its checks in the final stage of
3669 compilation.  This also enforces the coding style convention
3670 that methods and selectors must be declared before being used.
3672 @item -print-objc-runtime-info
3673 @opindex print-objc-runtime-info
3674 Generate C header describing the largest structure that is passed by
3675 value, if any.
3677 @end table
3679 @node Diagnostic Message Formatting Options
3680 @section Options to Control Diagnostic Messages Formatting
3681 @cindex options to control diagnostics formatting
3682 @cindex diagnostic messages
3683 @cindex message formatting
3685 Traditionally, diagnostic messages have been formatted irrespective of
3686 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
3687 options described below
3688 to control the formatting algorithm for diagnostic messages, 
3689 e.g.@: how many characters per line, how often source location
3690 information should be reported.  Note that some language front ends may not
3691 honor these options.
3693 @table @gcctabopt
3694 @item -fmessage-length=@var{n}
3695 @opindex fmessage-length
3696 Try to format error messages so that they fit on lines of about
3697 @var{n} characters.  If @var{n} is zero, then no line-wrapping is
3698 done; each error message appears on a single line.  This is the
3699 default for all front ends.
3701 Note - this option also affects the display of the @samp{#error} and
3702 @samp{#warning} pre-processor directives, and the @samp{deprecated}
3703 function/type/variable attribute.  It does not however affect the
3704 @samp{pragma GCC warning} and @samp{pragma GCC error} pragmas.
3706 @item -fdiagnostics-show-location=once
3707 @opindex fdiagnostics-show-location
3708 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
3709 reporter to emit source location information @emph{once}; that is, in
3710 case the message is too long to fit on a single physical line and has to
3711 be wrapped, the source location won't be emitted (as prefix) again,
3712 over and over, in subsequent continuation lines.  This is the default
3713 behavior.
3715 @item -fdiagnostics-show-location=every-line
3716 Only meaningful in line-wrapping mode.  Instructs the diagnostic
3717 messages reporter to emit the same source location information (as
3718 prefix) for physical lines that result from the process of breaking
3719 a message which is too long to fit on a single line.
3721 @item -fdiagnostics-color[=@var{WHEN}]
3722 @itemx -fno-diagnostics-color
3723 @opindex fdiagnostics-color
3724 @cindex highlight, color
3725 @vindex GCC_COLORS @r{environment variable}
3726 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
3727 or @samp{auto}.  The default depends on how the compiler has been configured,
3728 it can be any of the above @var{WHEN} options or also @samp{never}
3729 if @env{GCC_COLORS} environment variable isn't present in the environment,
3730 and @samp{auto} otherwise.
3731 @samp{auto} means to use color only when the standard error is a terminal.
3732 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
3733 aliases for @option{-fdiagnostics-color=always} and
3734 @option{-fdiagnostics-color=never}, respectively.
3736 The colors are defined by the environment variable @env{GCC_COLORS}.
3737 Its value is a colon-separated list of capabilities and Select Graphic
3738 Rendition (SGR) substrings. SGR commands are interpreted by the
3739 terminal or terminal emulator.  (See the section in the documentation
3740 of your text terminal for permitted values and their meanings as
3741 character attributes.)  These substring values are integers in decimal
3742 representation and can be concatenated with semicolons.
3743 Common values to concatenate include
3744 @samp{1} for bold,
3745 @samp{4} for underline,
3746 @samp{5} for blink,
3747 @samp{7} for inverse,
3748 @samp{39} for default foreground color,
3749 @samp{30} to @samp{37} for foreground colors,
3750 @samp{90} to @samp{97} for 16-color mode foreground colors,
3751 @samp{38;5;0} to @samp{38;5;255}
3752 for 88-color and 256-color modes foreground colors,
3753 @samp{49} for default background color,
3754 @samp{40} to @samp{47} for background colors,
3755 @samp{100} to @samp{107} for 16-color mode background colors,
3756 and @samp{48;5;0} to @samp{48;5;255}
3757 for 88-color and 256-color modes background colors.
3759 The default @env{GCC_COLORS} is
3760 @smallexample
3761 error=01;31:warning=01;35:note=01;36:range1=32:range2=34:locus=01:\
3762 quote=01:fixit-insert=32:fixit-delete=31:\
3763 diff-filename=01:diff-hunk=32:diff-delete=31:diff-insert=32:\
3764 type-diff=01;32
3765 @end smallexample
3766 @noindent
3767 where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
3768 @samp{01;36} is bold cyan, @samp{32} is green, @samp{34} is blue,
3769 @samp{01} is bold, and @samp{31} is red.
3770 Setting @env{GCC_COLORS} to the empty string disables colors.
3771 Supported capabilities are as follows.
3773 @table @code
3774 @item error=
3775 @vindex error GCC_COLORS @r{capability}
3776 SGR substring for error: markers.
3778 @item warning=
3779 @vindex warning GCC_COLORS @r{capability}
3780 SGR substring for warning: markers.
3782 @item note=
3783 @vindex note GCC_COLORS @r{capability}
3784 SGR substring for note: markers.
3786 @item range1=
3787 @vindex range1 GCC_COLORS @r{capability}
3788 SGR substring for first additional range.
3790 @item range2=
3791 @vindex range2 GCC_COLORS @r{capability}
3792 SGR substring for second additional range.
3794 @item locus=
3795 @vindex locus GCC_COLORS @r{capability}
3796 SGR substring for location information, @samp{file:line} or
3797 @samp{file:line:column} etc.
3799 @item quote=
3800 @vindex quote GCC_COLORS @r{capability}
3801 SGR substring for information printed within quotes.
3803 @item fixit-insert=
3804 @vindex fixit-insert GCC_COLORS @r{capability}
3805 SGR substring for fix-it hints suggesting text to
3806 be inserted or replaced.
3808 @item fixit-delete=
3809 @vindex fixit-delete GCC_COLORS @r{capability}
3810 SGR substring for fix-it hints suggesting text to
3811 be deleted.
3813 @item diff-filename=
3814 @vindex diff-filename GCC_COLORS @r{capability}
3815 SGR substring for filename headers within generated patches.
3817 @item diff-hunk=
3818 @vindex diff-hunk GCC_COLORS @r{capability}
3819 SGR substring for the starts of hunks within generated patches.
3821 @item diff-delete=
3822 @vindex diff-delete GCC_COLORS @r{capability}
3823 SGR substring for deleted lines within generated patches.
3825 @item diff-insert=
3826 @vindex diff-insert GCC_COLORS @r{capability}
3827 SGR substring for inserted lines within generated patches.
3829 @item type-diff=
3830 @vindex type-diff GCC_COLORS @r{capability}
3831 SGR substring for highlighting mismatching types within template
3832 arguments in the C++ frontend.
3833 @end table
3835 @item -fno-diagnostics-show-option
3836 @opindex fno-diagnostics-show-option
3837 @opindex fdiagnostics-show-option
3838 By default, each diagnostic emitted includes text indicating the
3839 command-line option that directly controls the diagnostic (if such an
3840 option is known to the diagnostic machinery).  Specifying the
3841 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
3843 @item -fno-diagnostics-show-caret
3844 @opindex fno-diagnostics-show-caret
3845 @opindex fdiagnostics-show-caret
3846 By default, each diagnostic emitted includes the original source line
3847 and a caret @samp{^} indicating the column.  This option suppresses this
3848 information.  The source line is truncated to @var{n} characters, if
3849 the @option{-fmessage-length=n} option is given.  When the output is done
3850 to the terminal, the width is limited to the width given by the
3851 @env{COLUMNS} environment variable or, if not set, to the terminal width.
3853 @item -fno-diagnostics-show-labels
3854 @opindex fno-diagnostics-show-labels
3855 @opindex fdiagnostics-show-labels
3856 By default, when printing source code (via @option{-fdiagnostics-show-caret}),
3857 diagnostics can label ranges of source code with pertinent information, such
3858 as the types of expressions:
3860 @smallexample
3861     printf ("foo %s bar", long_i + long_j);
3862                  ~^       ~~~~~~~~~~~~~~~
3863                   |              |
3864                   char *         long int
3865 @end smallexample
3867 This option suppresses the printing of these labels (in the example above,
3868 the vertical bars and the ``char *'' and ``long int'' text).
3870 @item -fno-diagnostics-show-line-numbers
3871 @opindex fno-diagnostics-show-line-numbers
3872 @opindex fdiagnostics-show-line-numbers
3873 By default, when printing source code (via @option{-fdiagnostics-show-caret}),
3874 a left margin is printed, showing line numbers.  This option suppresses this
3875 left margin.
3877 @item -fdiagnostics-minimum-margin-width=@var{width}
3878 @opindex fdiagnostics-minimum-margin-width
3879 This option controls the minimum width of the left margin printed by
3880 @option{-fdiagnostics-show-line-numbers}.  It defaults to 6.
3882 @item -fdiagnostics-parseable-fixits
3883 @opindex fdiagnostics-parseable-fixits
3884 Emit fix-it hints in a machine-parseable format, suitable for consumption
3885 by IDEs.  For each fix-it, a line will be printed after the relevant
3886 diagnostic, starting with the string ``fix-it:''.  For example:
3888 @smallexample
3889 fix-it:"test.c":@{45:3-45:21@}:"gtk_widget_show_all"
3890 @end smallexample
3892 The location is expressed as a half-open range, expressed as a count of
3893 bytes, starting at byte 1 for the initial column.  In the above example,
3894 bytes 3 through 20 of line 45 of ``test.c'' are to be replaced with the
3895 given string:
3897 @smallexample
3898 00000000011111111112222222222
3899 12345678901234567890123456789
3900   gtk_widget_showall (dlg);
3901   ^^^^^^^^^^^^^^^^^^
3902   gtk_widget_show_all
3903 @end smallexample
3905 The filename and replacement string escape backslash as ``\\", tab as ``\t'',
3906 newline as ``\n'', double quotes as ``\"'', non-printable characters as octal
3907 (e.g. vertical tab as ``\013'').
3909 An empty replacement string indicates that the given range is to be removed.
3910 An empty range (e.g. ``45:3-45:3'') indicates that the string is to
3911 be inserted at the given position.
3913 @item -fdiagnostics-generate-patch
3914 @opindex fdiagnostics-generate-patch
3915 Print fix-it hints to stderr in unified diff format, after any diagnostics
3916 are printed.  For example:
3918 @smallexample
3919 --- test.c
3920 +++ test.c
3921 @@ -42,5 +42,5 @@
3923  void show_cb(GtkDialog *dlg)
3924  @{
3925 -  gtk_widget_showall(dlg);
3926 +  gtk_widget_show_all(dlg);
3927  @}
3929 @end smallexample
3931 The diff may or may not be colorized, following the same rules
3932 as for diagnostics (see @option{-fdiagnostics-color}).
3934 @item -fdiagnostics-show-template-tree
3935 @opindex fdiagnostics-show-template-tree
3937 In the C++ frontend, when printing diagnostics showing mismatching
3938 template types, such as:
3940 @smallexample
3941   could not convert 'std::map<int, std::vector<double> >()'
3942     from 'map<[...],vector<double>>' to 'map<[...],vector<float>>
3943 @end smallexample
3945 the @option{-fdiagnostics-show-template-tree} flag enables printing a
3946 tree-like structure showing the common and differing parts of the types,
3947 such as:
3949 @smallexample
3950   map<
3951     [...],
3952     vector<
3953       [double != float]>>
3954 @end smallexample
3956 The parts that differ are highlighted with color (``double'' and
3957 ``float'' in this case).
3959 @item -fno-elide-type
3960 @opindex fno-elide-type
3961 @opindex felide-type
3962 By default when the C++ frontend prints diagnostics showing mismatching
3963 template types, common parts of the types are printed as ``[...]'' to
3964 simplify the error message.  For example:
3966 @smallexample
3967   could not convert 'std::map<int, std::vector<double> >()'
3968     from 'map<[...],vector<double>>' to 'map<[...],vector<float>>
3969 @end smallexample
3971 Specifying the @option{-fno-elide-type} flag suppresses that behavior.
3972 This flag also affects the output of the
3973 @option{-fdiagnostics-show-template-tree} flag.
3975 @item -fno-show-column
3976 @opindex fno-show-column
3977 @opindex fshow-column
3978 Do not print column numbers in diagnostics.  This may be necessary if
3979 diagnostics are being scanned by a program that does not understand the
3980 column numbers, such as @command{dejagnu}.
3982 @end table
3984 @node Warning Options
3985 @section Options to Request or Suppress Warnings
3986 @cindex options to control warnings
3987 @cindex warning messages
3988 @cindex messages, warning
3989 @cindex suppressing warnings
3991 Warnings are diagnostic messages that report constructions that
3992 are not inherently erroneous but that are risky or suggest there
3993 may have been an error.
3995 The following language-independent options do not enable specific
3996 warnings but control the kinds of diagnostics produced by GCC@.
3998 @table @gcctabopt
3999 @cindex syntax checking
4000 @item -fsyntax-only
4001 @opindex fsyntax-only
4002 Check the code for syntax errors, but don't do anything beyond that.
4004 @item -fmax-errors=@var{n}
4005 @opindex fmax-errors
4006 Limits the maximum number of error messages to @var{n}, at which point
4007 GCC bails out rather than attempting to continue processing the source
4008 code.  If @var{n} is 0 (the default), there is no limit on the number
4009 of error messages produced.  If @option{-Wfatal-errors} is also
4010 specified, then @option{-Wfatal-errors} takes precedence over this
4011 option.
4013 @item -w
4014 @opindex w
4015 Inhibit all warning messages.
4017 @item -Werror
4018 @opindex Werror
4019 @opindex Wno-error
4020 Make all warnings into errors.
4022 @item -Werror=
4023 @opindex Werror=
4024 @opindex Wno-error=
4025 Make the specified warning into an error.  The specifier for a warning
4026 is appended; for example @option{-Werror=switch} turns the warnings
4027 controlled by @option{-Wswitch} into errors.  This switch takes a
4028 negative form, to be used to negate @option{-Werror} for specific
4029 warnings; for example @option{-Wno-error=switch} makes
4030 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
4031 is in effect.
4033 The warning message for each controllable warning includes the
4034 option that controls the warning.  That option can then be used with
4035 @option{-Werror=} and @option{-Wno-error=} as described above.
4036 (Printing of the option in the warning message can be disabled using the
4037 @option{-fno-diagnostics-show-option} flag.)
4039 Note that specifying @option{-Werror=}@var{foo} automatically implies
4040 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
4041 imply anything.
4043 @item -Wfatal-errors
4044 @opindex Wfatal-errors
4045 @opindex Wno-fatal-errors
4046 This option causes the compiler to abort compilation on the first error
4047 occurred rather than trying to keep going and printing further error
4048 messages.
4050 @end table
4052 You can request many specific warnings with options beginning with
4053 @samp{-W}, for example @option{-Wimplicit} to request warnings on
4054 implicit declarations.  Each of these specific warning options also
4055 has a negative form beginning @samp{-Wno-} to turn off warnings; for
4056 example, @option{-Wno-implicit}.  This manual lists only one of the
4057 two forms, whichever is not the default.  For further
4058 language-specific options also refer to @ref{C++ Dialect Options} and
4059 @ref{Objective-C and Objective-C++ Dialect Options}.
4061 Some options, such as @option{-Wall} and @option{-Wextra}, turn on other
4062 options, such as @option{-Wunused}, which may turn on further options,
4063 such as @option{-Wunused-value}. The combined effect of positive and
4064 negative forms is that more specific options have priority over less
4065 specific ones, independently of their position in the command-line. For
4066 options of the same specificity, the last one takes effect. Options
4067 enabled or disabled via pragmas (@pxref{Diagnostic Pragmas}) take effect
4068 as if they appeared at the end of the command-line.
4070 When an unrecognized warning option is requested (e.g.,
4071 @option{-Wunknown-warning}), GCC emits a diagnostic stating
4072 that the option is not recognized.  However, if the @option{-Wno-} form
4073 is used, the behavior is slightly different: no diagnostic is
4074 produced for @option{-Wno-unknown-warning} unless other diagnostics
4075 are being produced.  This allows the use of new @option{-Wno-} options
4076 with old compilers, but if something goes wrong, the compiler
4077 warns that an unrecognized option is present.
4079 @table @gcctabopt
4080 @item -Wpedantic
4081 @itemx -pedantic
4082 @opindex pedantic
4083 @opindex Wpedantic
4084 @opindex Wno-pedantic
4085 Issue all the warnings demanded by strict ISO C and ISO C++;
4086 reject all programs that use forbidden extensions, and some other
4087 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
4088 version of the ISO C standard specified by any @option{-std} option used.
4090 Valid ISO C and ISO C++ programs should compile properly with or without
4091 this option (though a rare few require @option{-ansi} or a
4092 @option{-std} option specifying the required version of ISO C)@.  However,
4093 without this option, certain GNU extensions and traditional C and C++
4094 features are supported as well.  With this option, they are rejected.
4096 @option{-Wpedantic} does not cause warning messages for use of the
4097 alternate keywords whose names begin and end with @samp{__}.  Pedantic
4098 warnings are also disabled in the expression that follows
4099 @code{__extension__}.  However, only system header files should use
4100 these escape routes; application programs should avoid them.
4101 @xref{Alternate Keywords}.
4103 Some users try to use @option{-Wpedantic} to check programs for strict ISO
4104 C conformance.  They soon find that it does not do quite what they want:
4105 it finds some non-ISO practices, but not all---only those for which
4106 ISO C @emph{requires} a diagnostic, and some others for which
4107 diagnostics have been added.
4109 A feature to report any failure to conform to ISO C might be useful in
4110 some instances, but would require considerable additional work and would
4111 be quite different from @option{-Wpedantic}.  We don't have plans to
4112 support such a feature in the near future.
4114 Where the standard specified with @option{-std} represents a GNU
4115 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
4116 corresponding @dfn{base standard}, the version of ISO C on which the GNU
4117 extended dialect is based.  Warnings from @option{-Wpedantic} are given
4118 where they are required by the base standard.  (It does not make sense
4119 for such warnings to be given only for features not in the specified GNU
4120 C dialect, since by definition the GNU dialects of C include all
4121 features the compiler supports with the given option, and there would be
4122 nothing to warn about.)
4124 @item -pedantic-errors
4125 @opindex pedantic-errors
4126 Give an error whenever the @dfn{base standard} (see @option{-Wpedantic})
4127 requires a diagnostic, in some cases where there is undefined behavior
4128 at compile-time and in some other cases that do not prevent compilation
4129 of programs that are valid according to the standard. This is not
4130 equivalent to @option{-Werror=pedantic}, since there are errors enabled
4131 by this option and not enabled by the latter and vice versa.
4133 @item -Wall
4134 @opindex Wall
4135 @opindex Wno-all
4136 This enables all the warnings about constructions that some users
4137 consider questionable, and that are easy to avoid (or modify to
4138 prevent the warning), even in conjunction with macros.  This also
4139 enables some language-specific warnings described in @ref{C++ Dialect
4140 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
4142 @option{-Wall} turns on the following warning flags:
4144 @gccoptlist{-Waddress   @gol
4145 -Warray-bounds=1 @r{(only with} @option{-O2}@r{)}  @gol
4146 -Wbool-compare  @gol
4147 -Wbool-operation  @gol
4148 -Wc++11-compat  -Wc++14-compat  @gol
4149 -Wcatch-value @r{(C++ and Objective-C++ only)}  @gol
4150 -Wchar-subscripts  @gol
4151 -Wcomment  @gol
4152 -Wduplicate-decl-specifier @r{(C and Objective-C only)} @gol
4153 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
4154 -Wformat   @gol
4155 -Wint-in-bool-context  @gol
4156 -Wimplicit @r{(C and Objective-C only)} @gol
4157 -Wimplicit-int @r{(C and Objective-C only)} @gol
4158 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
4159 -Winit-self @r{(only for C++)} @gol
4160 -Wlogical-not-parentheses @gol
4161 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
4162 -Wmaybe-uninitialized @gol
4163 -Wmemset-elt-size @gol
4164 -Wmemset-transposed-args @gol
4165 -Wmisleading-indentation @r{(only for C/C++)} @gol
4166 -Wmissing-attributes @gol
4167 -Wmissing-braces @r{(only for C/ObjC)} @gol
4168 -Wmultistatement-macros  @gol
4169 -Wnarrowing @r{(only for C++)}  @gol
4170 -Wnonnull  @gol
4171 -Wnonnull-compare  @gol
4172 -Wopenmp-simd @gol
4173 -Wparentheses  @gol
4174 -Wpessimizing-move @r{(only for C++)}  @gol
4175 -Wpointer-sign  @gol
4176 -Wreorder   @gol
4177 -Wrestrict   @gol
4178 -Wreturn-type  @gol
4179 -Wsequence-point  @gol
4180 -Wsign-compare @r{(only in C++)}  @gol
4181 -Wsizeof-pointer-div @gol
4182 -Wsizeof-pointer-memaccess @gol
4183 -Wstrict-aliasing  @gol
4184 -Wstrict-overflow=1  @gol
4185 -Wswitch  @gol
4186 -Wtautological-compare  @gol
4187 -Wtrigraphs  @gol
4188 -Wuninitialized  @gol
4189 -Wunknown-pragmas  @gol
4190 -Wunused-function  @gol
4191 -Wunused-label     @gol
4192 -Wunused-value     @gol
4193 -Wunused-variable  @gol
4194 -Wvolatile-register-var @gol
4197 Note that some warning flags are not implied by @option{-Wall}.  Some of
4198 them warn about constructions that users generally do not consider
4199 questionable, but which occasionally you might wish to check for;
4200 others warn about constructions that are necessary or hard to avoid in
4201 some cases, and there is no simple way to modify the code to suppress
4202 the warning. Some of them are enabled by @option{-Wextra} but many of
4203 them must be enabled individually.
4205 @item -Wextra
4206 @opindex W
4207 @opindex Wextra
4208 @opindex Wno-extra
4209 This enables some extra warning flags that are not enabled by
4210 @option{-Wall}. (This option used to be called @option{-W}.  The older
4211 name is still supported, but the newer name is more descriptive.)
4213 @gccoptlist{-Wclobbered  @gol
4214 -Wcast-function-type  @gol
4215 -Wempty-body  @gol
4216 -Wignored-qualifiers @gol
4217 -Wimplicit-fallthrough=3 @gol
4218 -Wmissing-field-initializers  @gol
4219 -Wmissing-parameter-type @r{(C only)}  @gol
4220 -Wold-style-declaration @r{(C only)}  @gol
4221 -Woverride-init  @gol
4222 -Wsign-compare @r{(C only)} @gol
4223 -Wredundant-move @r{(only for C++)}  @gol
4224 -Wtype-limits  @gol
4225 -Wuninitialized  @gol
4226 -Wshift-negative-value @r{(in C++03 and in C99 and newer)}  @gol
4227 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
4228 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
4231 The option @option{-Wextra} also prints warning messages for the
4232 following cases:
4234 @itemize @bullet
4236 @item
4237 A pointer is compared against integer zero with @code{<}, @code{<=},
4238 @code{>}, or @code{>=}.
4240 @item
4241 (C++ only) An enumerator and a non-enumerator both appear in a
4242 conditional expression.
4244 @item
4245 (C++ only) Ambiguous virtual bases.
4247 @item
4248 (C++ only) Subscripting an array that has been declared @code{register}.
4250 @item
4251 (C++ only) Taking the address of a variable that has been declared
4252 @code{register}.
4254 @item
4255 (C++ only) A base class is not initialized in the copy constructor
4256 of a derived class.
4258 @end itemize
4260 @item -Wchar-subscripts
4261 @opindex Wchar-subscripts
4262 @opindex Wno-char-subscripts
4263 Warn if an array subscript has type @code{char}.  This is a common cause
4264 of error, as programmers often forget that this type is signed on some
4265 machines.
4266 This warning is enabled by @option{-Wall}.
4268 @item -Wchkp
4269 @opindex Wchkp
4270 @opindex Wno-chkp
4271 Warn about an invalid memory access that is found by Pointer Bounds Checker
4272 (@option{-fcheck-pointer-bounds}).
4274 @item -Wno-coverage-mismatch
4275 @opindex Wno-coverage-mismatch
4276 @opindex Wcoverage-mismatch
4277 Warn if feedback profiles do not match when using the
4278 @option{-fprofile-use} option.
4279 If a source file is changed between compiling with @option{-fprofile-generate}
4280 and with @option{-fprofile-use}, the files with the profile feedback can fail
4281 to match the source file and GCC cannot use the profile feedback
4282 information.  By default, this warning is enabled and is treated as an
4283 error.  @option{-Wno-coverage-mismatch} can be used to disable the
4284 warning or @option{-Wno-error=coverage-mismatch} can be used to
4285 disable the error.  Disabling the error for this warning can result in
4286 poorly optimized code and is useful only in the
4287 case of very minor changes such as bug fixes to an existing code-base.
4288 Completely disabling the warning is not recommended.
4290 @item -Wno-cpp
4291 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
4293 Suppress warning messages emitted by @code{#warning} directives.
4295 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
4296 @opindex Wdouble-promotion
4297 @opindex Wno-double-promotion
4298 Give a warning when a value of type @code{float} is implicitly
4299 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
4300 floating-point unit implement @code{float} in hardware, but emulate
4301 @code{double} in software.  On such a machine, doing computations
4302 using @code{double} values is much more expensive because of the
4303 overhead required for software emulation.
4305 It is easy to accidentally do computations with @code{double} because
4306 floating-point literals are implicitly of type @code{double}.  For
4307 example, in:
4308 @smallexample
4309 @group
4310 float area(float radius)
4312    return 3.14159 * radius * radius;
4314 @end group
4315 @end smallexample
4316 the compiler performs the entire computation with @code{double}
4317 because the floating-point literal is a @code{double}.
4319 @item -Wduplicate-decl-specifier @r{(C and Objective-C only)}
4320 @opindex Wduplicate-decl-specifier
4321 @opindex Wno-duplicate-decl-specifier
4322 Warn if a declaration has duplicate @code{const}, @code{volatile},
4323 @code{restrict} or @code{_Atomic} specifier.  This warning is enabled by
4324 @option{-Wall}.
4326 @item -Wformat
4327 @itemx -Wformat=@var{n}
4328 @opindex Wformat
4329 @opindex Wno-format
4330 @opindex ffreestanding
4331 @opindex fno-builtin
4332 @opindex Wformat=
4333 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
4334 the arguments supplied have types appropriate to the format string
4335 specified, and that the conversions specified in the format string make
4336 sense.  This includes standard functions, and others specified by format
4337 attributes (@pxref{Function Attributes}), in the @code{printf},
4338 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
4339 not in the C standard) families (or other target-specific families).
4340 Which functions are checked without format attributes having been
4341 specified depends on the standard version selected, and such checks of
4342 functions without the attribute specified are disabled by
4343 @option{-ffreestanding} or @option{-fno-builtin}.
4345 The formats are checked against the format features supported by GNU
4346 libc version 2.2.  These include all ISO C90 and C99 features, as well
4347 as features from the Single Unix Specification and some BSD and GNU
4348 extensions.  Other library implementations may not support all these
4349 features; GCC does not support warning about features that go beyond a
4350 particular library's limitations.  However, if @option{-Wpedantic} is used
4351 with @option{-Wformat}, warnings are given about format features not
4352 in the selected standard version (but not for @code{strfmon} formats,
4353 since those are not in any version of the C standard).  @xref{C Dialect
4354 Options,,Options Controlling C Dialect}.
4356 @table @gcctabopt
4357 @item -Wformat=1
4358 @itemx -Wformat
4359 @opindex Wformat
4360 @opindex Wformat=1
4361 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
4362 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
4363 @option{-Wformat} also checks for null format arguments for several
4364 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
4365 aspects of this level of format checking can be disabled by the
4366 options: @option{-Wno-format-contains-nul},
4367 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
4368 @option{-Wformat} is enabled by @option{-Wall}.
4370 @item -Wno-format-contains-nul
4371 @opindex Wno-format-contains-nul
4372 @opindex Wformat-contains-nul
4373 If @option{-Wformat} is specified, do not warn about format strings that
4374 contain NUL bytes.
4376 @item -Wno-format-extra-args
4377 @opindex Wno-format-extra-args
4378 @opindex Wformat-extra-args
4379 If @option{-Wformat} is specified, do not warn about excess arguments to a
4380 @code{printf} or @code{scanf} format function.  The C standard specifies
4381 that such arguments are ignored.
4383 Where the unused arguments lie between used arguments that are
4384 specified with @samp{$} operand number specifications, normally
4385 warnings are still given, since the implementation could not know what
4386 type to pass to @code{va_arg} to skip the unused arguments.  However,
4387 in the case of @code{scanf} formats, this option suppresses the
4388 warning if the unused arguments are all pointers, since the Single
4389 Unix Specification says that such unused arguments are allowed.
4391 @item -Wformat-overflow
4392 @itemx -Wformat-overflow=@var{level}
4393 @opindex Wformat-overflow
4394 @opindex Wno-format-overflow
4395 Warn about calls to formatted input/output functions such as @code{sprintf}
4396 and @code{vsprintf} that might overflow the destination buffer.  When the
4397 exact number of bytes written by a format directive cannot be determined
4398 at compile-time it is estimated based on heuristics that depend on the
4399 @var{level} argument and on optimization.  While enabling optimization
4400 will in most cases improve the accuracy of the warning, it may also
4401 result in false positives.
4403 @table @gcctabopt
4404 @item -Wformat-overflow
4405 @itemx -Wformat-overflow=1
4406 @opindex Wformat-overflow
4407 @opindex Wno-format-overflow
4408 Level @var{1} of @option{-Wformat-overflow} enabled by @option{-Wformat}
4409 employs a conservative approach that warns only about calls that most
4410 likely overflow the buffer.  At this level, numeric arguments to format
4411 directives with unknown values are assumed to have the value of one, and
4412 strings of unknown length to be empty.  Numeric arguments that are known
4413 to be bounded to a subrange of their type, or string arguments whose output
4414 is bounded either by their directive's precision or by a finite set of
4415 string literals, are assumed to take on the value within the range that
4416 results in the most bytes on output.  For example, the call to @code{sprintf}
4417 below is diagnosed because even with both @var{a} and @var{b} equal to zero,
4418 the terminating NUL character (@code{'\0'}) appended by the function
4419 to the destination buffer will be written past its end.  Increasing
4420 the size of the buffer by a single byte is sufficient to avoid the
4421 warning, though it may not be sufficient to avoid the overflow.
4423 @smallexample
4424 void f (int a, int b)
4426   char buf [13];
4427   sprintf (buf, "a = %i, b = %i\n", a, b);
4429 @end smallexample
4431 @item -Wformat-overflow=2
4432 Level @var{2} warns also about calls that might overflow the destination
4433 buffer given an argument of sufficient length or magnitude.  At level
4434 @var{2}, unknown numeric arguments are assumed to have the minimum
4435 representable value for signed types with a precision greater than 1, and
4436 the maximum representable value otherwise.  Unknown string arguments whose
4437 length cannot be assumed to be bounded either by the directive's precision,
4438 or by a finite set of string literals they may evaluate to, or the character
4439 array they may point to, are assumed to be 1 character long.
4441 At level @var{2}, the call in the example above is again diagnosed, but
4442 this time because with @var{a} equal to a 32-bit @code{INT_MIN} the first
4443 @code{%i} directive will write some of its digits beyond the end of
4444 the destination buffer.  To make the call safe regardless of the values
4445 of the two variables, the size of the destination buffer must be increased
4446 to at least 34 bytes.  GCC includes the minimum size of the buffer in
4447 an informational note following the warning.
4449 An alternative to increasing the size of the destination buffer is to
4450 constrain the range of formatted values.  The maximum length of string
4451 arguments can be bounded by specifying the precision in the format
4452 directive.  When numeric arguments of format directives can be assumed
4453 to be bounded by less than the precision of their type, choosing
4454 an appropriate length modifier to the format specifier will reduce
4455 the required buffer size.  For example, if @var{a} and @var{b} in the
4456 example above can be assumed to be within the precision of
4457 the @code{short int} type then using either the @code{%hi} format
4458 directive or casting the argument to @code{short} reduces the maximum
4459 required size of the buffer to 24 bytes.
4461 @smallexample
4462 void f (int a, int b)
4464   char buf [23];
4465   sprintf (buf, "a = %hi, b = %i\n", a, (short)b);
4467 @end smallexample
4468 @end table
4470 @item -Wno-format-zero-length
4471 @opindex Wno-format-zero-length
4472 @opindex Wformat-zero-length
4473 If @option{-Wformat} is specified, do not warn about zero-length formats.
4474 The C standard specifies that zero-length formats are allowed.
4477 @item -Wformat=2
4478 @opindex Wformat=2
4479 Enable @option{-Wformat} plus additional format checks.  Currently
4480 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
4481 -Wformat-y2k}.
4483 @item -Wformat-nonliteral
4484 @opindex Wformat-nonliteral
4485 @opindex Wno-format-nonliteral
4486 If @option{-Wformat} is specified, also warn if the format string is not a
4487 string literal and so cannot be checked, unless the format function
4488 takes its format arguments as a @code{va_list}.
4490 @item -Wformat-security
4491 @opindex Wformat-security
4492 @opindex Wno-format-security
4493 If @option{-Wformat} is specified, also warn about uses of format
4494 functions that represent possible security problems.  At present, this
4495 warns about calls to @code{printf} and @code{scanf} functions where the
4496 format string is not a string literal and there are no format arguments,
4497 as in @code{printf (foo);}.  This may be a security hole if the format
4498 string came from untrusted input and contains @samp{%n}.  (This is
4499 currently a subset of what @option{-Wformat-nonliteral} warns about, but
4500 in future warnings may be added to @option{-Wformat-security} that are not
4501 included in @option{-Wformat-nonliteral}.)
4503 @item -Wformat-signedness
4504 @opindex Wformat-signedness
4505 @opindex Wno-format-signedness
4506 If @option{-Wformat} is specified, also warn if the format string
4507 requires an unsigned argument and the argument is signed and vice versa.
4509 @item -Wformat-truncation
4510 @itemx -Wformat-truncation=@var{level}
4511 @opindex Wformat-truncation
4512 @opindex Wno-format-truncation
4513 Warn about calls to formatted input/output functions such as @code{snprintf}
4514 and @code{vsnprintf} that might result in output truncation.  When the exact
4515 number of bytes written by a format directive cannot be determined at
4516 compile-time it is estimated based on heuristics that depend on
4517 the @var{level} argument and on optimization.  While enabling optimization
4518 will in most cases improve the accuracy of the warning, it may also result
4519 in false positives.  Except as noted otherwise, the option uses the same
4520 logic @option{-Wformat-overflow}.
4522 @table @gcctabopt
4523 @item -Wformat-truncation
4524 @itemx -Wformat-truncation=1
4525 @opindex Wformat-truncation
4526 @opindex Wno-format-truncation
4527 Level @var{1} of @option{-Wformat-truncation} enabled by @option{-Wformat}
4528 employs a conservative approach that warns only about calls to bounded
4529 functions whose return value is unused and that will most likely result
4530 in output truncation.
4532 @item -Wformat-truncation=2
4533 Level @var{2} warns also about calls to bounded functions whose return
4534 value is used and that might result in truncation given an argument of
4535 sufficient length or magnitude.
4536 @end table
4538 @item -Wformat-y2k
4539 @opindex Wformat-y2k
4540 @opindex Wno-format-y2k
4541 If @option{-Wformat} is specified, also warn about @code{strftime}
4542 formats that may yield only a two-digit year.
4543 @end table
4545 @item -Wnonnull
4546 @opindex Wnonnull
4547 @opindex Wno-nonnull
4548 Warn about passing a null pointer for arguments marked as
4549 requiring a non-null value by the @code{nonnull} function attribute.
4551 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
4552 can be disabled with the @option{-Wno-nonnull} option.
4554 @item -Wnonnull-compare
4555 @opindex Wnonnull-compare
4556 @opindex Wno-nonnull-compare
4557 Warn when comparing an argument marked with the @code{nonnull}
4558 function attribute against null inside the function.
4560 @option{-Wnonnull-compare} is included in @option{-Wall}.  It
4561 can be disabled with the @option{-Wno-nonnull-compare} option.
4563 @item -Wnull-dereference
4564 @opindex Wnull-dereference
4565 @opindex Wno-null-dereference
4566 Warn if the compiler detects paths that trigger erroneous or
4567 undefined behavior due to dereferencing a null pointer.  This option
4568 is only active when @option{-fdelete-null-pointer-checks} is active,
4569 which is enabled by optimizations in most targets.  The precision of
4570 the warnings depends on the optimization options used.
4572 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
4573 @opindex Winit-self
4574 @opindex Wno-init-self
4575 Warn about uninitialized variables that are initialized with themselves.
4576 Note this option can only be used with the @option{-Wuninitialized} option.
4578 For example, GCC warns about @code{i} being uninitialized in the
4579 following snippet only when @option{-Winit-self} has been specified:
4580 @smallexample
4581 @group
4582 int f()
4584   int i = i;
4585   return i;
4587 @end group
4588 @end smallexample
4590 This warning is enabled by @option{-Wall} in C++.
4592 @item -Wimplicit-int @r{(C and Objective-C only)}
4593 @opindex Wimplicit-int
4594 @opindex Wno-implicit-int
4595 Warn when a declaration does not specify a type.
4596 This warning is enabled by @option{-Wall}.
4598 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
4599 @opindex Wimplicit-function-declaration
4600 @opindex Wno-implicit-function-declaration
4601 Give a warning whenever a function is used before being declared. In
4602 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
4603 enabled by default and it is made into an error by
4604 @option{-pedantic-errors}. This warning is also enabled by
4605 @option{-Wall}.
4607 @item -Wimplicit @r{(C and Objective-C only)}
4608 @opindex Wimplicit
4609 @opindex Wno-implicit
4610 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
4611 This warning is enabled by @option{-Wall}.
4613 @item -Wimplicit-fallthrough
4614 @opindex Wimplicit-fallthrough
4615 @opindex Wno-implicit-fallthrough
4616 @option{-Wimplicit-fallthrough} is the same as @option{-Wimplicit-fallthrough=3}
4617 and @option{-Wno-implicit-fallthrough} is the same as
4618 @option{-Wimplicit-fallthrough=0}.
4620 @item -Wimplicit-fallthrough=@var{n}
4621 @opindex Wimplicit-fallthrough=
4622 Warn when a switch case falls through.  For example:
4624 @smallexample
4625 @group
4626 switch (cond)
4627   @{
4628   case 1:
4629     a = 1;
4630     break;
4631   case 2:
4632     a = 2;
4633   case 3:
4634     a = 3;
4635     break;
4636   @}
4637 @end group
4638 @end smallexample
4640 This warning does not warn when the last statement of a case cannot
4641 fall through, e.g. when there is a return statement or a call to function
4642 declared with the noreturn attribute.  @option{-Wimplicit-fallthrough=}
4643 also takes into account control flow statements, such as ifs, and only
4644 warns when appropriate.  E.g.@:
4646 @smallexample
4647 @group
4648 switch (cond)
4649   @{
4650   case 1:
4651     if (i > 3) @{
4652       bar (5);
4653       break;
4654     @} else if (i < 1) @{
4655       bar (0);
4656     @} else
4657       return;
4658   default:
4659     @dots{}
4660   @}
4661 @end group
4662 @end smallexample
4664 Since there are occasions where a switch case fall through is desirable,
4665 GCC provides an attribute, @code{__attribute__ ((fallthrough))}, that is
4666 to be used along with a null statement to suppress this warning that
4667 would normally occur:
4669 @smallexample
4670 @group
4671 switch (cond)
4672   @{
4673   case 1:
4674     bar (0);
4675     __attribute__ ((fallthrough));
4676   default:
4677     @dots{}
4678   @}
4679 @end group
4680 @end smallexample
4682 C++17 provides a standard way to suppress the @option{-Wimplicit-fallthrough}
4683 warning using @code{[[fallthrough]];} instead of the GNU attribute.  In C++11
4684 or C++14 users can use @code{[[gnu::fallthrough]];}, which is a GNU extension.
4685 Instead of these attributes, it is also possible to add a fallthrough comment
4686 to silence the warning.  The whole body of the C or C++ style comment should
4687 match the given regular expressions listed below.  The option argument @var{n}
4688 specifies what kind of comments are accepted:
4690 @itemize @bullet
4692 @item @option{-Wimplicit-fallthrough=0} disables the warning altogether.
4694 @item @option{-Wimplicit-fallthrough=1} matches @code{.*} regular
4695 expression, any comment is used as fallthrough comment.
4697 @item @option{-Wimplicit-fallthrough=2} case insensitively matches
4698 @code{.*falls?[ \t-]*thr(ough|u).*} regular expression.
4700 @item @option{-Wimplicit-fallthrough=3} case sensitively matches one of the
4701 following regular expressions:
4703 @itemize @bullet
4705 @item @code{-fallthrough}
4707 @item @code{@@fallthrough@@}
4709 @item @code{lint -fallthrough[ \t]*}
4711 @item @code{[ \t.!]*(ELSE,? |INTENTIONAL(LY)? )?@*FALL(S | |-)?THR(OUGH|U)[ \t.!]*(-[^\n\r]*)?}
4713 @item @code{[ \t.!]*(Else,? |Intentional(ly)? )?@*Fall((s | |-)[Tt]|t)hr(ough|u)[ \t.!]*(-[^\n\r]*)?}
4715 @item @code{[ \t.!]*([Ee]lse,? |[Ii]ntentional(ly)? )?@*fall(s | |-)?thr(ough|u)[ \t.!]*(-[^\n\r]*)?}
4717 @end itemize
4719 @item @option{-Wimplicit-fallthrough=4} case sensitively matches one of the
4720 following regular expressions:
4722 @itemize @bullet
4724 @item @code{-fallthrough}
4726 @item @code{@@fallthrough@@}
4728 @item @code{lint -fallthrough[ \t]*}
4730 @item @code{[ \t]*FALLTHR(OUGH|U)[ \t]*}
4732 @end itemize
4734 @item @option{-Wimplicit-fallthrough=5} doesn't recognize any comments as
4735 fallthrough comments, only attributes disable the warning.
4737 @end itemize
4739 The comment needs to be followed after optional whitespace and other comments
4740 by @code{case} or @code{default} keywords or by a user label that precedes some
4741 @code{case} or @code{default} label.
4743 @smallexample
4744 @group
4745 switch (cond)
4746   @{
4747   case 1:
4748     bar (0);
4749     /* FALLTHRU */
4750   default:
4751     @dots{}
4752   @}
4753 @end group
4754 @end smallexample
4756 The @option{-Wimplicit-fallthrough=3} warning is enabled by @option{-Wextra}.
4758 @item -Wif-not-aligned @r{(C, C++, Objective-C and Objective-C++ only)}
4759 @opindex Wif-not-aligned
4760 @opindex Wno-if-not-aligned
4761 Control if warning triggered by the @code{warn_if_not_aligned} attribute
4762 should be issued.  This is enabled by default.
4763 Use @option{-Wno-if-not-aligned} to disable it.
4765 @item -Wignored-qualifiers @r{(C and C++ only)}
4766 @opindex Wignored-qualifiers
4767 @opindex Wno-ignored-qualifiers
4768 Warn if the return type of a function has a type qualifier
4769 such as @code{const}.  For ISO C such a type qualifier has no effect,
4770 since the value returned by a function is not an lvalue.
4771 For C++, the warning is only emitted for scalar types or @code{void}.
4772 ISO C prohibits qualified @code{void} return types on function
4773 definitions, so such return types always receive a warning
4774 even without this option.
4776 This warning is also enabled by @option{-Wextra}.
4778 @item -Wignored-attributes @r{(C and C++ only)}
4779 @opindex Wignored-attributes
4780 @opindex Wno-ignored-attributes
4781 Warn when an attribute is ignored.  This is different from the
4782 @option{-Wattributes} option in that it warns whenever the compiler decides
4783 to drop an attribute, not that the attribute is either unknown, used in a
4784 wrong place, etc.  This warning is enabled by default.
4786 @item -Wmain
4787 @opindex Wmain
4788 @opindex Wno-main
4789 Warn if the type of @code{main} is suspicious.  @code{main} should be
4790 a function with external linkage, returning int, taking either zero
4791 arguments, two, or three arguments of appropriate types.  This warning
4792 is enabled by default in C++ and is enabled by either @option{-Wall}
4793 or @option{-Wpedantic}.
4795 @item -Wmisleading-indentation @r{(C and C++ only)}
4796 @opindex Wmisleading-indentation
4797 @opindex Wno-misleading-indentation
4798 Warn when the indentation of the code does not reflect the block structure.
4799 Specifically, a warning is issued for @code{if}, @code{else}, @code{while}, and
4800 @code{for} clauses with a guarded statement that does not use braces,
4801 followed by an unguarded statement with the same indentation.
4803 In the following example, the call to ``bar'' is misleadingly indented as
4804 if it were guarded by the ``if'' conditional.
4806 @smallexample
4807   if (some_condition ())
4808     foo ();
4809     bar ();  /* Gotcha: this is not guarded by the "if".  */
4810 @end smallexample
4812 In the case of mixed tabs and spaces, the warning uses the
4813 @option{-ftabstop=} option to determine if the statements line up
4814 (defaulting to 8).
4816 The warning is not issued for code involving multiline preprocessor logic
4817 such as the following example.
4819 @smallexample
4820   if (flagA)
4821     foo (0);
4822 #if SOME_CONDITION_THAT_DOES_NOT_HOLD
4823   if (flagB)
4824 #endif
4825     foo (1);
4826 @end smallexample
4828 The warning is not issued after a @code{#line} directive, since this
4829 typically indicates autogenerated code, and no assumptions can be made
4830 about the layout of the file that the directive references.
4832 This warning is enabled by @option{-Wall} in C and C++.
4834 @item -Wno-missing-attributes
4835 @opindex Wmissing-attributes
4836 @opindex Wno-missing-attributes
4837 Warn when a declaration of a function is missing one or more attributes
4838 that a related function is declared with and whose absence may adversely
4839 affect the correctness or efficiency of generated code.  For example,
4840 the warning is issued for declarations of aliases that use attributes
4841 to specify less restrictive requirements than those of their targets.
4842 This typically represents a potential optimization oportunity rather
4843 than a hidden bug.  The @option{-Wattribute-alias} option controls warnings
4844 issued for mismatches between declarations of aliases and their targets
4845 that might be indicative of code generation bugs.
4846 Attributes considered include @code{alloc_align}, @code{alloc_size},
4847 @code{cold}, @code{const}, @code{hot}, @code{leaf}, @code{malloc},
4848 @code{nonnull}, @code{noreturn}, @code{nothrow}, @code{pure},
4849 @code{returns_nonnull}, and @code{returns_twice}.
4851 In C++, the warning is issued when an explicit specialization of a primary
4852 template declared with attribute @code{alloc_align}, @code{alloc_size},
4853 @code{assume_aligned}, @code{format}, @code{format_arg}, @code{malloc},
4854 or @code{nonnull} is declared without it.  Attributes @code{deprecated},
4855 @code{error}, and @code{warning} suppress the warning.
4856 (@pxref{Function Attributes}).
4858 @option{-Wmissing-attributes} is enabled by @option{-Wall}.
4860 For example, since the declaration of the primary function template
4861 below makes use of both attribute @code{malloc} and @code{alloc_size}
4862 the declaration of the explicit specialization of the template is
4863 diagnosed because it is missing one of the attributes.
4865 @smallexample
4866 template <class T>
4867 T* __attribute__ ((malloc, alloc_size (1)))
4868 allocate (size_t);
4870 template <>
4871 void* __attribute__ ((malloc))   // missing alloc_size
4872 allocate<void> (size_t);
4873 @end smallexample
4875 @item -Wmissing-braces
4876 @opindex Wmissing-braces
4877 @opindex Wno-missing-braces
4878 Warn if an aggregate or union initializer is not fully bracketed.  In
4879 the following example, the initializer for @code{a} is not fully
4880 bracketed, but that for @code{b} is fully bracketed.  This warning is
4881 enabled by @option{-Wall} in C.
4883 @smallexample
4884 int a[2][2] = @{ 0, 1, 2, 3 @};
4885 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
4886 @end smallexample
4888 This warning is enabled by @option{-Wall}.
4890 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
4891 @opindex Wmissing-include-dirs
4892 @opindex Wno-missing-include-dirs
4893 Warn if a user-supplied include directory does not exist.
4895 @item -Wmissing-profile
4896 @opindex Wmissing-profile
4897 @opindex Wno-missing-profile
4898 Warn if feedback profiles are missing when using the
4899 @option{-fprofile-use} option.
4900 This option diagnoses those cases where a new function or a new file is added
4901 to the user code between compiling with @option{-fprofile-generate} and with
4902 @option{-fprofile-use}, without regenerating the profiles.  In these cases, the
4903 profile feedback data files do not contain any profile feedback information for
4904 the newly added function or file respectively.  Also, in the case when profile
4905 count data (.gcda) files are removed, GCC cannot use any profile feedback
4906 information.  In all these cases, warnings are issued to inform the user that a
4907 profile generation step is due.  @option{-Wno-missing-profile} can be used to
4908 disable the warning.  Ignoring the warning can result in poorly optimized code.
4909 Completely disabling the warning is not recommended and should be done only
4910 when non-existent profile data is justified.
4912 @item -Wmultistatement-macros
4913 @opindex Wmultistatement-macros
4914 @opindex Wno-multistatement-macros
4915 Warn about unsafe multiple statement macros that appear to be guarded
4916 by a clause such as @code{if}, @code{else}, @code{for}, @code{switch}, or
4917 @code{while}, in which only the first statement is actually guarded after
4918 the macro is expanded.
4920 For example:
4922 @smallexample
4923 #define DOIT x++; y++
4924 if (c)
4925   DOIT;
4926 @end smallexample
4928 will increment @code{y} unconditionally, not just when @code{c} holds.
4929 The can usually be fixed by wrapping the macro in a do-while loop:
4930 @smallexample
4931 #define DOIT do @{ x++; y++; @} while (0)
4932 if (c)
4933   DOIT;
4934 @end smallexample
4936 This warning is enabled by @option{-Wall} in C and C++.
4938 @item -Wparentheses
4939 @opindex Wparentheses
4940 @opindex Wno-parentheses
4941 Warn if parentheses are omitted in certain contexts, such
4942 as when there is an assignment in a context where a truth value
4943 is expected, or when operators are nested whose precedence people
4944 often get confused about.
4946 Also warn if a comparison like @code{x<=y<=z} appears; this is
4947 equivalent to @code{(x<=y ? 1 : 0) <= z}, which is a different
4948 interpretation from that of ordinary mathematical notation.
4950 Also warn for dangerous uses of the GNU extension to
4951 @code{?:} with omitted middle operand. When the condition
4952 in the @code{?}: operator is a boolean expression, the omitted value is
4953 always 1.  Often programmers expect it to be a value computed
4954 inside the conditional expression instead.
4956 For C++ this also warns for some cases of unnecessary parentheses in
4957 declarations, which can indicate an attempt at a function call instead
4958 of a declaration:
4959 @smallexample
4961   // Declares a local variable called mymutex.
4962   std::unique_lock<std::mutex> (mymutex);
4963   // User meant std::unique_lock<std::mutex> lock (mymutex);
4965 @end smallexample
4967 This warning is enabled by @option{-Wall}.
4969 @item -Wsequence-point
4970 @opindex Wsequence-point
4971 @opindex Wno-sequence-point
4972 Warn about code that may have undefined semantics because of violations
4973 of sequence point rules in the C and C++ standards.
4975 The C and C++ standards define the order in which expressions in a C/C++
4976 program are evaluated in terms of @dfn{sequence points}, which represent
4977 a partial ordering between the execution of parts of the program: those
4978 executed before the sequence point, and those executed after it.  These
4979 occur after the evaluation of a full expression (one which is not part
4980 of a larger expression), after the evaluation of the first operand of a
4981 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
4982 function is called (but after the evaluation of its arguments and the
4983 expression denoting the called function), and in certain other places.
4984 Other than as expressed by the sequence point rules, the order of
4985 evaluation of subexpressions of an expression is not specified.  All
4986 these rules describe only a partial order rather than a total order,
4987 since, for example, if two functions are called within one expression
4988 with no sequence point between them, the order in which the functions
4989 are called is not specified.  However, the standards committee have
4990 ruled that function calls do not overlap.
4992 It is not specified when between sequence points modifications to the
4993 values of objects take effect.  Programs whose behavior depends on this
4994 have undefined behavior; the C and C++ standards specify that ``Between
4995 the previous and next sequence point an object shall have its stored
4996 value modified at most once by the evaluation of an expression.
4997 Furthermore, the prior value shall be read only to determine the value
4998 to be stored.''.  If a program breaks these rules, the results on any
4999 particular implementation are entirely unpredictable.
5001 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
5002 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
5003 diagnosed by this option, and it may give an occasional false positive
5004 result, but in general it has been found fairly effective at detecting
5005 this sort of problem in programs.
5007 The C++17 standard will define the order of evaluation of operands in
5008 more cases: in particular it requires that the right-hand side of an
5009 assignment be evaluated before the left-hand side, so the above
5010 examples are no longer undefined.  But this warning will still warn
5011 about them, to help people avoid writing code that is undefined in C
5012 and earlier revisions of C++.
5014 The standard is worded confusingly, therefore there is some debate
5015 over the precise meaning of the sequence point rules in subtle cases.
5016 Links to discussions of the problem, including proposed formal
5017 definitions, may be found on the GCC readings page, at
5018 @uref{http://gcc.gnu.org/@/readings.html}.
5020 This warning is enabled by @option{-Wall} for C and C++.
5022 @item -Wno-return-local-addr
5023 @opindex Wno-return-local-addr
5024 @opindex Wreturn-local-addr
5025 Do not warn about returning a pointer (or in C++, a reference) to a
5026 variable that goes out of scope after the function returns.
5028 @item -Wreturn-type
5029 @opindex Wreturn-type
5030 @opindex Wno-return-type
5031 Warn whenever a function is defined with a return type that defaults
5032 to @code{int}.  Also warn about any @code{return} statement with no
5033 return value in a function whose return type is not @code{void}
5034 (falling off the end of the function body is considered returning
5035 without a value).
5037 For C only, warn about a @code{return} statement with an expression in a
5038 function whose return type is @code{void}, unless the expression type is
5039 also @code{void}.  As a GNU extension, the latter case is accepted
5040 without a warning unless @option{-Wpedantic} is used.
5042 For C++, a function without return type always produces a diagnostic
5043 message, even when @option{-Wno-return-type} is specified.  The only
5044 exceptions are @code{main} and functions defined in system headers.
5046 This warning is enabled by default for C++ and is enabled by @option{-Wall}.
5048 @item -Wshift-count-negative
5049 @opindex Wshift-count-negative
5050 @opindex Wno-shift-count-negative
5051 Warn if shift count is negative. This warning is enabled by default.
5053 @item -Wshift-count-overflow
5054 @opindex Wshift-count-overflow
5055 @opindex Wno-shift-count-overflow
5056 Warn if shift count >= width of type. This warning is enabled by default.
5058 @item -Wshift-negative-value
5059 @opindex Wshift-negative-value
5060 @opindex Wno-shift-negative-value
5061 Warn if left shifting a negative value.  This warning is enabled by
5062 @option{-Wextra} in C99 and C++11 modes (and newer).
5064 @item -Wshift-overflow
5065 @itemx -Wshift-overflow=@var{n}
5066 @opindex Wshift-overflow
5067 @opindex Wno-shift-overflow
5068 Warn about left shift overflows.  This warning is enabled by
5069 default in C99 and C++11 modes (and newer).
5071 @table @gcctabopt
5072 @item -Wshift-overflow=1
5073 This is the warning level of @option{-Wshift-overflow} and is enabled
5074 by default in C99 and C++11 modes (and newer).  This warning level does
5075 not warn about left-shifting 1 into the sign bit.  (However, in C, such
5076 an overflow is still rejected in contexts where an integer constant expression
5077 is required.)
5079 @item -Wshift-overflow=2
5080 This warning level also warns about left-shifting 1 into the sign bit,
5081 unless C++14 mode is active.
5082 @end table
5084 @item -Wswitch
5085 @opindex Wswitch
5086 @opindex Wno-switch
5087 Warn whenever a @code{switch} statement has an index of enumerated type
5088 and lacks a @code{case} for one or more of the named codes of that
5089 enumeration.  (The presence of a @code{default} label prevents this
5090 warning.)  @code{case} labels outside the enumeration range also
5091 provoke warnings when this option is used (even if there is a
5092 @code{default} label).
5093 This warning is enabled by @option{-Wall}.
5095 @item -Wswitch-default
5096 @opindex Wswitch-default
5097 @opindex Wno-switch-default
5098 Warn whenever a @code{switch} statement does not have a @code{default}
5099 case.
5101 @item -Wswitch-enum
5102 @opindex Wswitch-enum
5103 @opindex Wno-switch-enum
5104 Warn whenever a @code{switch} statement has an index of enumerated type
5105 and lacks a @code{case} for one or more of the named codes of that
5106 enumeration.  @code{case} labels outside the enumeration range also
5107 provoke warnings when this option is used.  The only difference
5108 between @option{-Wswitch} and this option is that this option gives a
5109 warning about an omitted enumeration code even if there is a
5110 @code{default} label.
5112 @item -Wswitch-bool
5113 @opindex Wswitch-bool
5114 @opindex Wno-switch-bool
5115 Warn whenever a @code{switch} statement has an index of boolean type
5116 and the case values are outside the range of a boolean type.
5117 It is possible to suppress this warning by casting the controlling
5118 expression to a type other than @code{bool}.  For example:
5119 @smallexample
5120 @group
5121 switch ((int) (a == 4))
5122   @{
5123   @dots{}
5124   @}
5125 @end group
5126 @end smallexample
5127 This warning is enabled by default for C and C++ programs.
5129 @item -Wswitch-unreachable
5130 @opindex Wswitch-unreachable
5131 @opindex Wno-switch-unreachable
5132 Warn whenever a @code{switch} statement contains statements between the
5133 controlling expression and the first case label, which will never be
5134 executed.  For example:
5135 @smallexample
5136 @group
5137 switch (cond)
5138   @{
5139    i = 15;
5140   @dots{}
5141    case 5:
5142   @dots{}
5143   @}
5144 @end group
5145 @end smallexample
5146 @option{-Wswitch-unreachable} does not warn if the statement between the
5147 controlling expression and the first case label is just a declaration:
5148 @smallexample
5149 @group
5150 switch (cond)
5151   @{
5152    int i;
5153   @dots{}
5154    case 5:
5155    i = 5;
5156   @dots{}
5157   @}
5158 @end group
5159 @end smallexample
5160 This warning is enabled by default for C and C++ programs.
5162 @item -Wsync-nand @r{(C and C++ only)}
5163 @opindex Wsync-nand
5164 @opindex Wno-sync-nand
5165 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
5166 built-in functions are used.  These functions changed semantics in GCC 4.4.
5168 @item -Wunused-but-set-parameter
5169 @opindex Wunused-but-set-parameter
5170 @opindex Wno-unused-but-set-parameter
5171 Warn whenever a function parameter is assigned to, but otherwise unused
5172 (aside from its declaration).
5174 To suppress this warning use the @code{unused} attribute
5175 (@pxref{Variable Attributes}).
5177 This warning is also enabled by @option{-Wunused} together with
5178 @option{-Wextra}.
5180 @item -Wunused-but-set-variable
5181 @opindex Wunused-but-set-variable
5182 @opindex Wno-unused-but-set-variable
5183 Warn whenever a local variable is assigned to, but otherwise unused
5184 (aside from its declaration).
5185 This warning is enabled by @option{-Wall}.
5187 To suppress this warning use the @code{unused} attribute
5188 (@pxref{Variable Attributes}).
5190 This warning is also enabled by @option{-Wunused}, which is enabled
5191 by @option{-Wall}.
5193 @item -Wunused-function
5194 @opindex Wunused-function
5195 @opindex Wno-unused-function
5196 Warn whenever a static function is declared but not defined or a
5197 non-inline static function is unused.
5198 This warning is enabled by @option{-Wall}.
5200 @item -Wunused-label
5201 @opindex Wunused-label
5202 @opindex Wno-unused-label
5203 Warn whenever a label is declared but not used.
5204 This warning is enabled by @option{-Wall}.
5206 To suppress this warning use the @code{unused} attribute
5207 (@pxref{Variable Attributes}).
5209 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
5210 @opindex Wunused-local-typedefs
5211 @opindex Wno-unused-local-typedefs
5212 Warn when a typedef locally defined in a function is not used.
5213 This warning is enabled by @option{-Wall}.
5215 @item -Wunused-parameter
5216 @opindex Wunused-parameter
5217 @opindex Wno-unused-parameter
5218 Warn whenever a function parameter is unused aside from its declaration.
5220 To suppress this warning use the @code{unused} attribute
5221 (@pxref{Variable Attributes}).
5223 @item -Wno-unused-result
5224 @opindex Wunused-result
5225 @opindex Wno-unused-result
5226 Do not warn if a caller of a function marked with attribute
5227 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
5228 its return value. The default is @option{-Wunused-result}.
5230 @item -Wunused-variable
5231 @opindex Wunused-variable
5232 @opindex Wno-unused-variable
5233 Warn whenever a local or static variable is unused aside from its
5234 declaration. This option implies @option{-Wunused-const-variable=1} for C,
5235 but not for C++. This warning is enabled by @option{-Wall}.
5237 To suppress this warning use the @code{unused} attribute
5238 (@pxref{Variable Attributes}).
5240 @item -Wunused-const-variable
5241 @itemx -Wunused-const-variable=@var{n}
5242 @opindex Wunused-const-variable
5243 @opindex Wno-unused-const-variable
5244 Warn whenever a constant static variable is unused aside from its declaration.
5245 @option{-Wunused-const-variable=1} is enabled by @option{-Wunused-variable}
5246 for C, but not for C++. In C this declares variable storage, but in C++ this
5247 is not an error since const variables take the place of @code{#define}s.
5249 To suppress this warning use the @code{unused} attribute
5250 (@pxref{Variable Attributes}).
5252 @table @gcctabopt
5253 @item -Wunused-const-variable=1
5254 This is the warning level that is enabled by @option{-Wunused-variable} for
5255 C.  It warns only about unused static const variables defined in the main
5256 compilation unit, but not about static const variables declared in any
5257 header included.
5259 @item -Wunused-const-variable=2
5260 This warning level also warns for unused constant static variables in
5261 headers (excluding system headers).  This is the warning level of
5262 @option{-Wunused-const-variable} and must be explicitly requested since
5263 in C++ this isn't an error and in C it might be harder to clean up all
5264 headers included.
5265 @end table
5267 @item -Wunused-value
5268 @opindex Wunused-value
5269 @opindex Wno-unused-value
5270 Warn whenever a statement computes a result that is explicitly not
5271 used. To suppress this warning cast the unused expression to
5272 @code{void}. This includes an expression-statement or the left-hand
5273 side of a comma expression that contains no side effects. For example,
5274 an expression such as @code{x[i,j]} causes a warning, while
5275 @code{x[(void)i,j]} does not.
5277 This warning is enabled by @option{-Wall}.
5279 @item -Wunused
5280 @opindex Wunused
5281 @opindex Wno-unused
5282 All the above @option{-Wunused} options combined.
5284 In order to get a warning about an unused function parameter, you must
5285 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
5286 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
5288 @item -Wuninitialized
5289 @opindex Wuninitialized
5290 @opindex Wno-uninitialized
5291 Warn if an automatic variable is used without first being initialized
5292 or if a variable may be clobbered by a @code{setjmp} call. In C++,
5293 warn if a non-static reference or non-static @code{const} member
5294 appears in a class without constructors.
5296 If you want to warn about code that uses the uninitialized value of the
5297 variable in its own initializer, use the @option{-Winit-self} option.
5299 These warnings occur for individual uninitialized or clobbered
5300 elements of structure, union or array variables as well as for
5301 variables that are uninitialized or clobbered as a whole.  They do
5302 not occur for variables or elements declared @code{volatile}.  Because
5303 these warnings depend on optimization, the exact variables or elements
5304 for which there are warnings depends on the precise optimization
5305 options and version of GCC used.
5307 Note that there may be no warning about a variable that is used only
5308 to compute a value that itself is never used, because such
5309 computations may be deleted by data flow analysis before the warnings
5310 are printed.
5312 @item -Winvalid-memory-model
5313 @opindex Winvalid-memory-model
5314 @opindex Wno-invalid-memory-model
5315 Warn for invocations of @ref{__atomic Builtins}, @ref{__sync Builtins},
5316 and the C11 atomic generic functions with a memory consistency argument
5317 that is either invalid for the operation or outside the range of values
5318 of the @code{memory_order} enumeration.  For example, since the
5319 @code{__atomic_store} and @code{__atomic_store_n} built-ins are only
5320 defined for the relaxed, release, and sequentially consistent memory
5321 orders the following code is diagnosed:
5323 @smallexample
5324 void store (int *i)
5326   __atomic_store_n (i, 0, memory_order_consume);
5328 @end smallexample
5330 @option{-Winvalid-memory-model} is enabled by default.
5332 @item -Wmaybe-uninitialized
5333 @opindex Wmaybe-uninitialized
5334 @opindex Wno-maybe-uninitialized
5335 For an automatic (i.e.@: local) variable, if there exists a path from the
5336 function entry to a use of the variable that is initialized, but there exist
5337 some other paths for which the variable is not initialized, the compiler
5338 emits a warning if it cannot prove the uninitialized paths are not
5339 executed at run time.
5341 These warnings are only possible in optimizing compilation, because otherwise
5342 GCC does not keep track of the state of variables.
5344 These warnings are made optional because GCC may not be able to determine when
5345 the code is correct in spite of appearing to have an error.  Here is one
5346 example of how this can happen:
5348 @smallexample
5349 @group
5351   int x;
5352   switch (y)
5353     @{
5354     case 1: x = 1;
5355       break;
5356     case 2: x = 4;
5357       break;
5358     case 3: x = 5;
5359     @}
5360   foo (x);
5362 @end group
5363 @end smallexample
5365 @noindent
5366 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
5367 always initialized, but GCC doesn't know this. To suppress the
5368 warning, you need to provide a default case with assert(0) or
5369 similar code.
5371 @cindex @code{longjmp} warnings
5372 This option also warns when a non-volatile automatic variable might be
5373 changed by a call to @code{longjmp}.
5374 The compiler sees only the calls to @code{setjmp}.  It cannot know
5375 where @code{longjmp} will be called; in fact, a signal handler could
5376 call it at any point in the code.  As a result, you may get a warning
5377 even when there is in fact no problem because @code{longjmp} cannot
5378 in fact be called at the place that would cause a problem.
5380 Some spurious warnings can be avoided if you declare all the functions
5381 you use that never return as @code{noreturn}.  @xref{Function
5382 Attributes}.
5384 This warning is enabled by @option{-Wall} or @option{-Wextra}.
5386 @item -Wunknown-pragmas
5387 @opindex Wunknown-pragmas
5388 @opindex Wno-unknown-pragmas
5389 @cindex warning for unknown pragmas
5390 @cindex unknown pragmas, warning
5391 @cindex pragmas, warning of unknown
5392 Warn when a @code{#pragma} directive is encountered that is not understood by 
5393 GCC@.  If this command-line option is used, warnings are even issued
5394 for unknown pragmas in system header files.  This is not the case if
5395 the warnings are only enabled by the @option{-Wall} command-line option.
5397 @item -Wno-pragmas
5398 @opindex Wno-pragmas
5399 @opindex Wpragmas
5400 Do not warn about misuses of pragmas, such as incorrect parameters,
5401 invalid syntax, or conflicts between pragmas.  See also
5402 @option{-Wunknown-pragmas}.
5404 @item -Wno-prio-ctor-dtor
5405 @opindex Wno-prio-ctor-dtor
5406 @opindex Wprio-ctor-dtor
5407 Do not warn if a priority from 0 to 100 is used for constructor or destructor.
5408 The use of constructor and destructor attributes allow you to assign a
5409 priority to the constructor/destructor to control its order of execution
5410 before @code{main} is called or after it returns.  The priority values must be
5411 greater than 100 as the compiler reserves priority values between 0--100 for
5412 the implementation.
5414 @item -Wstrict-aliasing
5415 @opindex Wstrict-aliasing
5416 @opindex Wno-strict-aliasing
5417 This option is only active when @option{-fstrict-aliasing} is active.
5418 It warns about code that might break the strict aliasing rules that the
5419 compiler is using for optimization.  The warning does not catch all
5420 cases, but does attempt to catch the more common pitfalls.  It is
5421 included in @option{-Wall}.
5422 It is equivalent to @option{-Wstrict-aliasing=3}
5424 @item -Wstrict-aliasing=n
5425 @opindex Wstrict-aliasing=n
5426 This option is only active when @option{-fstrict-aliasing} is active.
5427 It warns about code that might break the strict aliasing rules that the
5428 compiler is using for optimization.
5429 Higher levels correspond to higher accuracy (fewer false positives).
5430 Higher levels also correspond to more effort, similar to the way @option{-O} 
5431 works.
5432 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
5434 Level 1: Most aggressive, quick, least accurate.
5435 Possibly useful when higher levels
5436 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
5437 false negatives.  However, it has many false positives.
5438 Warns for all pointer conversions between possibly incompatible types,
5439 even if never dereferenced.  Runs in the front end only.
5441 Level 2: Aggressive, quick, not too precise.
5442 May still have many false positives (not as many as level 1 though),
5443 and few false negatives (but possibly more than level 1).
5444 Unlike level 1, it only warns when an address is taken.  Warns about
5445 incomplete types.  Runs in the front end only.
5447 Level 3 (default for @option{-Wstrict-aliasing}):
5448 Should have very few false positives and few false
5449 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
5450 Takes care of the common pun+dereference pattern in the front end:
5451 @code{*(int*)&some_float}.
5452 If optimization is enabled, it also runs in the back end, where it deals
5453 with multiple statement cases using flow-sensitive points-to information.
5454 Only warns when the converted pointer is dereferenced.
5455 Does not warn about incomplete types.
5457 @item -Wstrict-overflow
5458 @itemx -Wstrict-overflow=@var{n}
5459 @opindex Wstrict-overflow
5460 @opindex Wno-strict-overflow
5461 This option is only active when signed overflow is undefined.
5462 It warns about cases where the compiler optimizes based on the
5463 assumption that signed overflow does not occur.  Note that it does not
5464 warn about all cases where the code might overflow: it only warns
5465 about cases where the compiler implements some optimization.  Thus
5466 this warning depends on the optimization level.
5468 An optimization that assumes that signed overflow does not occur is
5469 perfectly safe if the values of the variables involved are such that
5470 overflow never does, in fact, occur.  Therefore this warning can
5471 easily give a false positive: a warning about code that is not
5472 actually a problem.  To help focus on important issues, several
5473 warning levels are defined.  No warnings are issued for the use of
5474 undefined signed overflow when estimating how many iterations a loop
5475 requires, in particular when determining whether a loop will be
5476 executed at all.
5478 @table @gcctabopt
5479 @item -Wstrict-overflow=1
5480 Warn about cases that are both questionable and easy to avoid.  For
5481 example the compiler simplifies
5482 @code{x + 1 > x} to @code{1}.  This level of
5483 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
5484 are not, and must be explicitly requested.
5486 @item -Wstrict-overflow=2
5487 Also warn about other cases where a comparison is simplified to a
5488 constant.  For example: @code{abs (x) >= 0}.  This can only be
5489 simplified when signed integer overflow is undefined, because
5490 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
5491 zero.  @option{-Wstrict-overflow} (with no level) is the same as
5492 @option{-Wstrict-overflow=2}.
5494 @item -Wstrict-overflow=3
5495 Also warn about other cases where a comparison is simplified.  For
5496 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
5498 @item -Wstrict-overflow=4
5499 Also warn about other simplifications not covered by the above cases.
5500 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
5502 @item -Wstrict-overflow=5
5503 Also warn about cases where the compiler reduces the magnitude of a
5504 constant involved in a comparison.  For example: @code{x + 2 > y} is
5505 simplified to @code{x + 1 >= y}.  This is reported only at the
5506 highest warning level because this simplification applies to many
5507 comparisons, so this warning level gives a very large number of
5508 false positives.
5509 @end table
5511 @item -Wstringop-overflow
5512 @itemx -Wstringop-overflow=@var{type}
5513 @opindex Wstringop-overflow
5514 @opindex Wno-stringop-overflow
5515 Warn for calls to string manipulation functions such as @code{memcpy} and
5516 @code{strcpy} that are determined to overflow the destination buffer.  The
5517 optional argument is one greater than the type of Object Size Checking to
5518 perform to determine the size of the destination.  @xref{Object Size Checking}.
5519 The argument is meaningful only for functions that operate on character arrays
5520 but not for raw memory functions like @code{memcpy} which always make use
5521 of Object Size type-0.  The option also warns for calls that specify a size
5522 in excess of the largest possible object or at most @code{SIZE_MAX / 2} bytes.
5523 The option produces the best results with optimization enabled but can detect
5524 a small subset of simple buffer overflows even without optimization in
5525 calls to the GCC built-in functions like @code{__builtin_memcpy} that
5526 correspond to the standard functions.  In any case, the option warns about
5527 just a subset of buffer overflows detected by the corresponding overflow
5528 checking built-ins.  For example, the option will issue a warning for
5529 the @code{strcpy} call below because it copies at least 5 characters
5530 (the string @code{"blue"} including the terminating NUL) into the buffer
5531 of size 4.
5533 @smallexample
5534 enum Color @{ blue, purple, yellow @};
5535 const char* f (enum Color clr)
5537   static char buf [4];
5538   const char *str;
5539   switch (clr)
5540     @{
5541       case blue: str = "blue"; break;
5542       case purple: str = "purple"; break;
5543       case yellow: str = "yellow"; break;
5544     @}
5546   return strcpy (buf, str);   // warning here
5548 @end smallexample
5550 Option @option{-Wstringop-overflow=2} is enabled by default.
5552 @table @gcctabopt
5553 @item -Wstringop-overflow
5554 @itemx -Wstringop-overflow=1
5555 @opindex Wstringop-overflow
5556 @opindex Wno-stringop-overflow
5557 The @option{-Wstringop-overflow=1} option uses type-zero Object Size Checking
5558 to determine the sizes of destination objects.  This is the default setting
5559 of the option.  At this setting the option will not warn for writes past
5560 the end of subobjects of larger objects accessed by pointers unless the
5561 size of the largest surrounding object is known.  When the destination may
5562 be one of several objects it is assumed to be the largest one of them.  On
5563 Linux systems, when optimization is enabled at this setting the option warns
5564 for the same code as when the @code{_FORTIFY_SOURCE} macro is defined to
5565 a non-zero value.
5567 @item -Wstringop-overflow=2
5568 The @option{-Wstringop-overflow=2} option uses type-one Object Size Checking
5569 to determine the sizes of destination objects.  At this setting the option
5570 will warn about overflows when writing to members of the largest complete
5571 objects whose exact size is known.  It will, however, not warn for excessive
5572 writes to the same members of unknown objects referenced by pointers since
5573 they may point to arrays containing unknown numbers of elements.
5575 @item -Wstringop-overflow=3
5576 The @option{-Wstringop-overflow=3} option uses type-two Object Size Checking
5577 to determine the sizes of destination objects.  At this setting the option
5578 warns about overflowing the smallest object or data member.  This is the
5579 most restrictive setting of the option that may result in warnings for safe
5580 code.
5582 @item -Wstringop-overflow=4
5583 The @option{-Wstringop-overflow=4} option uses type-three Object Size Checking
5584 to determine the sizes of destination objects.  At this setting the option
5585 will warn about overflowing any data members, and when the destination is
5586 one of several objects it uses the size of the largest of them to decide
5587 whether to issue a warning.  Similarly to @option{-Wstringop-overflow=3} this
5588 setting of the option may result in warnings for benign code.
5589 @end table
5591 @item -Wstringop-truncation
5592 @opindex Wstringop-truncation
5593 @opindex Wno-stringop-truncation
5594 Warn for calls to bounded string manipulation functions such as @code{strncat},
5595 @code{strncpy}, and @code{stpncpy} that may either truncate the copied string
5596 or leave the destination unchanged.
5598 In the following example, the call to @code{strncat} specifies a bound that
5599 is less than the length of the source string.  As a result, the copy of
5600 the source will be truncated and so the call is diagnosed.  To avoid the
5601 warning use @code{bufsize - strlen (buf) - 1)} as the bound.
5603 @smallexample
5604 void append (char *buf, size_t bufsize)
5606   strncat (buf, ".txt", 3);
5608 @end smallexample
5610 As another example, the following call to @code{strncpy} results in copying
5611 to @code{d} just the characters preceding the terminating NUL, without
5612 appending the NUL to the end.  Assuming the result of @code{strncpy} is
5613 necessarily a NUL-terminated string is a common mistake, and so the call
5614 is diagnosed.  To avoid the warning when the result is not expected to be
5615 NUL-terminated, call @code{memcpy} instead.
5617 @smallexample
5618 void copy (char *d, const char *s)
5620   strncpy (d, s, strlen (s));
5622 @end smallexample
5624 In the following example, the call to @code{strncpy} specifies the size
5625 of the destination buffer as the bound.  If the length of the source
5626 string is equal to or greater than this size the result of the copy will
5627 not be NUL-terminated.  Therefore, the call is also diagnosed.  To avoid
5628 the warning, specify @code{sizeof buf - 1} as the bound and set the last
5629 element of the buffer to @code{NUL}.
5631 @smallexample
5632 void copy (const char *s)
5634   char buf[80];
5635   strncpy (buf, s, sizeof buf);
5636   @dots{}
5638 @end smallexample
5640 In situations where a character array is intended to store a sequence
5641 of bytes with no terminating @code{NUL} such an array may be annotated
5642 with attribute @code{nonstring} to avoid this warning.  Such arrays,
5643 however, are not suitable arguments to functions that expect
5644 @code{NUL}-terminated strings.  To help detect accidental misuses of
5645 such arrays GCC issues warnings unless it can prove that the use is
5646 safe.  @xref{Common Variable Attributes}.
5648 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{|}cold@r{|}malloc@r{]}
5649 @opindex Wsuggest-attribute=
5650 @opindex Wno-suggest-attribute=
5651 Warn for cases where adding an attribute may be beneficial. The
5652 attributes currently supported are listed below.
5654 @table @gcctabopt
5655 @item -Wsuggest-attribute=pure
5656 @itemx -Wsuggest-attribute=const
5657 @itemx -Wsuggest-attribute=noreturn
5658 @itemx -Wsuggest-attribute=malloc
5659 @opindex Wsuggest-attribute=pure
5660 @opindex Wno-suggest-attribute=pure
5661 @opindex Wsuggest-attribute=const
5662 @opindex Wno-suggest-attribute=const
5663 @opindex Wsuggest-attribute=noreturn
5664 @opindex Wno-suggest-attribute=noreturn
5665 @opindex Wsuggest-attribute=malloc
5666 @opindex Wno-suggest-attribute=malloc
5668 Warn about functions that might be candidates for attributes
5669 @code{pure}, @code{const} or @code{noreturn} or @code{malloc}. The compiler
5670 only warns for functions visible in other compilation units or (in the case of
5671 @code{pure} and @code{const}) if it cannot prove that the function returns
5672 normally. A function returns normally if it doesn't contain an infinite loop or
5673 return abnormally by throwing, calling @code{abort} or trapping.  This analysis
5674 requires option @option{-fipa-pure-const}, which is enabled by default at
5675 @option{-O} and higher.  Higher optimization levels improve the accuracy
5676 of the analysis.
5678 @item -Wsuggest-attribute=format
5679 @itemx -Wmissing-format-attribute
5680 @opindex Wsuggest-attribute=format
5681 @opindex Wmissing-format-attribute
5682 @opindex Wno-suggest-attribute=format
5683 @opindex Wno-missing-format-attribute
5684 @opindex Wformat
5685 @opindex Wno-format
5687 Warn about function pointers that might be candidates for @code{format}
5688 attributes.  Note these are only possible candidates, not absolute ones.
5689 GCC guesses that function pointers with @code{format} attributes that
5690 are used in assignment, initialization, parameter passing or return
5691 statements should have a corresponding @code{format} attribute in the
5692 resulting type.  I.e.@: the left-hand side of the assignment or
5693 initialization, the type of the parameter variable, or the return type
5694 of the containing function respectively should also have a @code{format}
5695 attribute to avoid the warning.
5697 GCC also warns about function definitions that might be
5698 candidates for @code{format} attributes.  Again, these are only
5699 possible candidates.  GCC guesses that @code{format} attributes
5700 might be appropriate for any function that calls a function like
5701 @code{vprintf} or @code{vscanf}, but this might not always be the
5702 case, and some functions for which @code{format} attributes are
5703 appropriate may not be detected.
5705 @item -Wsuggest-attribute=cold
5706 @opindex Wsuggest-attribute=cold
5707 @opindex Wno-suggest-attribute=cold
5709 Warn about functions that might be candidates for @code{cold} attribute.  This
5710 is based on static detection and generally will only warn about functions which
5711 always leads to a call to another @code{cold} function such as wrappers of
5712 C++ @code{throw} or fatal error reporting functions leading to @code{abort}.
5713 @end table
5715 @item -Wsuggest-final-types
5716 @opindex Wno-suggest-final-types
5717 @opindex Wsuggest-final-types
5718 Warn about types with virtual methods where code quality would be improved
5719 if the type were declared with the C++11 @code{final} specifier, 
5720 or, if possible,
5721 declared in an anonymous namespace. This allows GCC to more aggressively
5722 devirtualize the polymorphic calls. This warning is more effective with link
5723 time optimization, where the information about the class hierarchy graph is
5724 more complete.
5726 @item -Wsuggest-final-methods
5727 @opindex Wno-suggest-final-methods
5728 @opindex Wsuggest-final-methods
5729 Warn about virtual methods where code quality would be improved if the method
5730 were declared with the C++11 @code{final} specifier, 
5731 or, if possible, its type were
5732 declared in an anonymous namespace or with the @code{final} specifier.
5733 This warning is
5734 more effective with link-time optimization, where the information about the
5735 class hierarchy graph is more complete. It is recommended to first consider
5736 suggestions of @option{-Wsuggest-final-types} and then rebuild with new
5737 annotations.
5739 @item -Wsuggest-override
5740 Warn about overriding virtual functions that are not marked with the override
5741 keyword.
5743 @item -Walloc-zero
5744 @opindex Wno-alloc-zero
5745 @opindex Walloc-zero
5746 Warn about calls to allocation functions decorated with attribute
5747 @code{alloc_size} that specify zero bytes, including those to the built-in
5748 forms of the functions @code{aligned_alloc}, @code{alloca}, @code{calloc},
5749 @code{malloc}, and @code{realloc}.  Because the behavior of these functions
5750 when called with a zero size differs among implementations (and in the case
5751 of @code{realloc} has been deprecated) relying on it may result in subtle
5752 portability bugs and should be avoided.
5754 @item -Walloc-size-larger-than=@var{byte-size}
5755 @opindex Walloc-size-larger-than=
5756 @opindex Wno-alloc-size-larger-than
5757 Warn about calls to functions decorated with attribute @code{alloc_size}
5758 that attempt to allocate objects larger than the specified number of bytes,
5759 or where the result of the size computation in an integer type with infinite
5760 precision would exceed the value of @samp{PTRDIFF_MAX} on the target.
5761 @option{-Walloc-size-larger-than=}@samp{PTRDIFF_MAX} is enabled by default.
5762 Warnings controlled by the option can be disabled either by specifying
5763 @var{byte-size} of @samp{SIZE_MAX} or more or by
5764 @option{-Wno-alloc-size-larger-than}.
5765 @xref{Function Attributes}.
5767 @item -Wno-alloc-size-larger-than
5768 @opindex Wno-alloc-size-larger-than
5769 Disable @option{-Walloc-size-larger-than=} warnings.  The option is
5770 equivalent to @option{-Walloc-size-larger-than=}@samp{SIZE_MAX} or
5771 larger.
5773 @item -Walloca
5774 @opindex Wno-alloca
5775 @opindex Walloca
5776 This option warns on all uses of @code{alloca} in the source.
5778 @item -Walloca-larger-than=@var{byte-size}
5779 @opindex Walloca-larger-than=
5780 @opindex Wno-alloca-larger-than
5781 This option warns on calls to @code{alloca} with an integer argument whose
5782 value is either zero, or that is not bounded by a controlling predicate
5783 that limits its value to at most @var{byte-size}.  It also warns for calls
5784 to @code{alloca} where the bound value is unknown.  Arguments of non-integer
5785 types are considered unbounded even if they appear to be constrained to
5786 the expected range.
5788 For example, a bounded case of @code{alloca} could be:
5790 @smallexample
5791 void func (size_t n)
5793   void *p;
5794   if (n <= 1000)
5795     p = alloca (n);
5796   else
5797     p = malloc (n);
5798   f (p);
5800 @end smallexample
5802 In the above example, passing @code{-Walloca-larger-than=1000} would not
5803 issue a warning because the call to @code{alloca} is known to be at most
5804 1000 bytes.  However, if @code{-Walloca-larger-than=500} were passed,
5805 the compiler would emit a warning.
5807 Unbounded uses, on the other hand, are uses of @code{alloca} with no
5808 controlling predicate constraining its integer argument.  For example:
5810 @smallexample
5811 void func ()
5813   void *p = alloca (n);
5814   f (p);
5816 @end smallexample
5818 If @code{-Walloca-larger-than=500} were passed, the above would trigger
5819 a warning, but this time because of the lack of bounds checking.
5821 Note, that even seemingly correct code involving signed integers could
5822 cause a warning:
5824 @smallexample
5825 void func (signed int n)
5827   if (n < 500)
5828     @{
5829       p = alloca (n);
5830       f (p);
5831     @}
5833 @end smallexample
5835 In the above example, @var{n} could be negative, causing a larger than
5836 expected argument to be implicitly cast into the @code{alloca} call.
5838 This option also warns when @code{alloca} is used in a loop.
5840 @option{-Walloca-larger-than=}@samp{PTRDIFF_MAX} is enabled by default
5841 but is usually only effective  when @option{-ftree-vrp} is active (default
5842 for @option{-O2} and above).
5844 See also @option{-Wvla-larger-than=}@samp{byte-size}.
5846 @item -Wno-alloca-larger-than
5847 @opindex Wno-alloca-larger-than
5848 Disable @option{-Walloca-larger-than=} warnings.  The option is
5849 equivalent to @option{-Walloca-larger-than=}@samp{SIZE_MAX} or larger.
5851 @item -Warray-bounds
5852 @itemx -Warray-bounds=@var{n}
5853 @opindex Wno-array-bounds
5854 @opindex Warray-bounds
5855 This option is only active when @option{-ftree-vrp} is active
5856 (default for @option{-O2} and above). It warns about subscripts to arrays
5857 that are always out of bounds. This warning is enabled by @option{-Wall}.
5859 @table @gcctabopt
5860 @item -Warray-bounds=1
5861 This is the warning level of @option{-Warray-bounds} and is enabled
5862 by @option{-Wall}; higher levels are not, and must be explicitly requested.
5864 @item -Warray-bounds=2
5865 This warning level also warns about out of bounds access for
5866 arrays at the end of a struct and for arrays accessed through
5867 pointers. This warning level may give a larger number of
5868 false positives and is deactivated by default.
5869 @end table
5871 @item -Wattribute-alias=@var{n}
5872 @itemx -Wno-attribute-alias
5873 @opindex -Wattribute-alias
5874 @opindex -Wno-attribute-alias
5875 Warn about declarations using the @code{alias} and similar attributes whose
5876 target is incompatible with the type of the alias.
5877 @xref{Function Attributes,,Declaring Attributes of Functions}.
5878 The @option{-Wattribute-alias=1} is  enabled by @option{-Wall}.
5880 @table @gcctabopt
5881 @item -Wattribute-alias=1
5882 The default warning level of the @option{-Wattribute-alias} option diagnoses
5883 incompatibilities between the type of the alias declaration and that of its
5884 target.  Such incompatibilities are typically indicative of bugs.
5886 @item -Wattribute-alias=2
5887 At this level @option{-Wattribute-alias} also diagnoses mismatches between
5888 the set of attributes of the alias declaration and the attributes applied
5889 to its target.  Although in some cases such mismatches may indicate bugs,
5890 in other cases they may be benign and could be resolved simply by adding
5891 the missing attribute to the target.
5892 @end table
5894 @item -Wbool-compare
5895 @opindex Wno-bool-compare
5896 @opindex Wbool-compare
5897 Warn about boolean expression compared with an integer value different from
5898 @code{true}/@code{false}.  For instance, the following comparison is
5899 always false:
5900 @smallexample
5901 int n = 5;
5902 @dots{}
5903 if ((n > 1) == 2) @{ @dots{} @}
5904 @end smallexample
5905 This warning is enabled by @option{-Wall}.
5907 @item -Wbool-operation
5908 @opindex Wno-bool-operation
5909 @opindex Wbool-operation
5910 Warn about suspicious operations on expressions of a boolean type.  For
5911 instance, bitwise negation of a boolean is very likely a bug in the program.
5912 For C, this warning also warns about incrementing or decrementing a boolean,
5913 which rarely makes sense.  (In C++, decrementing a boolean is always invalid.
5914 Incrementing a boolean is invalid in C++17, and deprecated otherwise.)
5916 This warning is enabled by @option{-Wall}.
5918 @item -Wduplicated-branches
5919 @opindex Wno-duplicated-branches
5920 @opindex Wduplicated-branches
5921 Warn when an if-else has identical branches.  This warning detects cases like
5922 @smallexample
5923 if (p != NULL)
5924   return 0;
5925 else
5926   return 0;
5927 @end smallexample
5928 It doesn't warn when both branches contain just a null statement.  This warning
5929 also warn for conditional operators:
5930 @smallexample
5931   int i = x ? *p : *p;
5932 @end smallexample
5934 @item -Wduplicated-cond
5935 @opindex Wno-duplicated-cond
5936 @opindex Wduplicated-cond
5937 Warn about duplicated conditions in an if-else-if chain.  For instance,
5938 warn for the following code:
5939 @smallexample
5940 if (p->q != NULL) @{ @dots{} @}
5941 else if (p->q != NULL) @{ @dots{} @}
5942 @end smallexample
5944 @item -Wframe-address
5945 @opindex Wno-frame-address
5946 @opindex Wframe-address
5947 Warn when the @samp{__builtin_frame_address} or @samp{__builtin_return_address}
5948 is called with an argument greater than 0.  Such calls may return indeterminate
5949 values or crash the program.  The warning is included in @option{-Wall}.
5951 @item -Wno-discarded-qualifiers @r{(C and Objective-C only)}
5952 @opindex Wno-discarded-qualifiers
5953 @opindex Wdiscarded-qualifiers
5954 Do not warn if type qualifiers on pointers are being discarded.
5955 Typically, the compiler warns if a @code{const char *} variable is
5956 passed to a function that takes a @code{char *} parameter.  This option
5957 can be used to suppress such a warning.
5959 @item -Wno-discarded-array-qualifiers @r{(C and Objective-C only)}
5960 @opindex Wno-discarded-array-qualifiers
5961 @opindex Wdiscarded-array-qualifiers
5962 Do not warn if type qualifiers on arrays which are pointer targets
5963 are being discarded. Typically, the compiler warns if a
5964 @code{const int (*)[]} variable is passed to a function that
5965 takes a @code{int (*)[]} parameter.  This option can be used to
5966 suppress such a warning.
5968 @item -Wno-incompatible-pointer-types @r{(C and Objective-C only)}
5969 @opindex Wno-incompatible-pointer-types
5970 @opindex Wincompatible-pointer-types
5971 Do not warn when there is a conversion between pointers that have incompatible
5972 types.  This warning is for cases not covered by @option{-Wno-pointer-sign},
5973 which warns for pointer argument passing or assignment with different
5974 signedness.
5976 @item -Wno-int-conversion @r{(C and Objective-C only)}
5977 @opindex Wno-int-conversion
5978 @opindex Wint-conversion
5979 Do not warn about incompatible integer to pointer and pointer to integer
5980 conversions.  This warning is about implicit conversions; for explicit
5981 conversions the warnings @option{-Wno-int-to-pointer-cast} and
5982 @option{-Wno-pointer-to-int-cast} may be used.
5984 @item -Wno-div-by-zero
5985 @opindex Wno-div-by-zero
5986 @opindex Wdiv-by-zero
5987 Do not warn about compile-time integer division by zero.  Floating-point
5988 division by zero is not warned about, as it can be a legitimate way of
5989 obtaining infinities and NaNs.
5991 @item -Wsystem-headers
5992 @opindex Wsystem-headers
5993 @opindex Wno-system-headers
5994 @cindex warnings from system headers
5995 @cindex system headers, warnings from
5996 Print warning messages for constructs found in system header files.
5997 Warnings from system headers are normally suppressed, on the assumption
5998 that they usually do not indicate real problems and would only make the
5999 compiler output harder to read.  Using this command-line option tells
6000 GCC to emit warnings from system headers as if they occurred in user
6001 code.  However, note that using @option{-Wall} in conjunction with this
6002 option does @emph{not} warn about unknown pragmas in system
6003 headers---for that, @option{-Wunknown-pragmas} must also be used.
6005 @item -Wtautological-compare
6006 @opindex Wtautological-compare
6007 @opindex Wno-tautological-compare
6008 Warn if a self-comparison always evaluates to true or false.  This
6009 warning detects various mistakes such as:
6010 @smallexample
6011 int i = 1;
6012 @dots{}
6013 if (i > i) @{ @dots{} @}
6014 @end smallexample
6016 This warning also warns about bitwise comparisons that always evaluate
6017 to true or false, for instance:
6018 @smallexample
6019 if ((a & 16) == 10) @{ @dots{} @}
6020 @end smallexample
6021 will always be false.
6023 This warning is enabled by @option{-Wall}.
6025 @item -Wtrampolines
6026 @opindex Wtrampolines
6027 @opindex Wno-trampolines
6028 Warn about trampolines generated for pointers to nested functions.
6029 A trampoline is a small piece of data or code that is created at run
6030 time on the stack when the address of a nested function is taken, and is
6031 used to call the nested function indirectly.  For some targets, it is
6032 made up of data only and thus requires no special treatment.  But, for
6033 most targets, it is made up of code and thus requires the stack to be
6034 made executable in order for the program to work properly.
6036 @item -Wfloat-equal
6037 @opindex Wfloat-equal
6038 @opindex Wno-float-equal
6039 Warn if floating-point values are used in equality comparisons.
6041 The idea behind this is that sometimes it is convenient (for the
6042 programmer) to consider floating-point values as approximations to
6043 infinitely precise real numbers.  If you are doing this, then you need
6044 to compute (by analyzing the code, or in some other way) the maximum or
6045 likely maximum error that the computation introduces, and allow for it
6046 when performing comparisons (and when producing output, but that's a
6047 different problem).  In particular, instead of testing for equality, you
6048 should check to see whether the two values have ranges that overlap; and
6049 this is done with the relational operators, so equality comparisons are
6050 probably mistaken.
6052 @item -Wtraditional @r{(C and Objective-C only)}
6053 @opindex Wtraditional
6054 @opindex Wno-traditional
6055 Warn about certain constructs that behave differently in traditional and
6056 ISO C@.  Also warn about ISO C constructs that have no traditional C
6057 equivalent, and/or problematic constructs that should be avoided.
6059 @itemize @bullet
6060 @item
6061 Macro parameters that appear within string literals in the macro body.
6062 In traditional C macro replacement takes place within string literals,
6063 but in ISO C it does not.
6065 @item
6066 In traditional C, some preprocessor directives did not exist.
6067 Traditional preprocessors only considered a line to be a directive
6068 if the @samp{#} appeared in column 1 on the line.  Therefore
6069 @option{-Wtraditional} warns about directives that traditional C
6070 understands but ignores because the @samp{#} does not appear as the
6071 first character on the line.  It also suggests you hide directives like
6072 @code{#pragma} not understood by traditional C by indenting them.  Some
6073 traditional implementations do not recognize @code{#elif}, so this option
6074 suggests avoiding it altogether.
6076 @item
6077 A function-like macro that appears without arguments.
6079 @item
6080 The unary plus operator.
6082 @item
6083 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
6084 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
6085 constants.)  Note, these suffixes appear in macros defined in the system
6086 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
6087 Use of these macros in user code might normally lead to spurious
6088 warnings, however GCC's integrated preprocessor has enough context to
6089 avoid warning in these cases.
6091 @item
6092 A function declared external in one block and then used after the end of
6093 the block.
6095 @item
6096 A @code{switch} statement has an operand of type @code{long}.
6098 @item
6099 A non-@code{static} function declaration follows a @code{static} one.
6100 This construct is not accepted by some traditional C compilers.
6102 @item
6103 The ISO type of an integer constant has a different width or
6104 signedness from its traditional type.  This warning is only issued if
6105 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
6106 typically represent bit patterns, are not warned about.
6108 @item
6109 Usage of ISO string concatenation is detected.
6111 @item
6112 Initialization of automatic aggregates.
6114 @item
6115 Identifier conflicts with labels.  Traditional C lacks a separate
6116 namespace for labels.
6118 @item
6119 Initialization of unions.  If the initializer is zero, the warning is
6120 omitted.  This is done under the assumption that the zero initializer in
6121 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
6122 initializer warnings and relies on default initialization to zero in the
6123 traditional C case.
6125 @item
6126 Conversions by prototypes between fixed/floating-point values and vice
6127 versa.  The absence of these prototypes when compiling with traditional
6128 C causes serious problems.  This is a subset of the possible
6129 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
6131 @item
6132 Use of ISO C style function definitions.  This warning intentionally is
6133 @emph{not} issued for prototype declarations or variadic functions
6134 because these ISO C features appear in your code when using
6135 libiberty's traditional C compatibility macros, @code{PARAMS} and
6136 @code{VPARAMS}.  This warning is also bypassed for nested functions
6137 because that feature is already a GCC extension and thus not relevant to
6138 traditional C compatibility.
6139 @end itemize
6141 @item -Wtraditional-conversion @r{(C and Objective-C only)}
6142 @opindex Wtraditional-conversion
6143 @opindex Wno-traditional-conversion
6144 Warn if a prototype causes a type conversion that is different from what
6145 would happen to the same argument in the absence of a prototype.  This
6146 includes conversions of fixed point to floating and vice versa, and
6147 conversions changing the width or signedness of a fixed-point argument
6148 except when the same as the default promotion.
6150 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
6151 @opindex Wdeclaration-after-statement
6152 @opindex Wno-declaration-after-statement
6153 Warn when a declaration is found after a statement in a block.  This
6154 construct, known from C++, was introduced with ISO C99 and is by default
6155 allowed in GCC@.  It is not supported by ISO C90.  @xref{Mixed Declarations}.
6157 @item -Wshadow
6158 @opindex Wshadow
6159 @opindex Wno-shadow
6160 Warn whenever a local variable or type declaration shadows another
6161 variable, parameter, type, class member (in C++), or instance variable
6162 (in Objective-C) or whenever a built-in function is shadowed. Note
6163 that in C++, the compiler warns if a local variable shadows an
6164 explicit typedef, but not if it shadows a struct/class/enum.
6165 Same as @option{-Wshadow=global}.
6167 @item -Wno-shadow-ivar @r{(Objective-C only)}
6168 @opindex Wno-shadow-ivar
6169 @opindex Wshadow-ivar
6170 Do not warn whenever a local variable shadows an instance variable in an
6171 Objective-C method.
6173 @item -Wshadow=global
6174 @opindex Wshadow=local
6175 The default for @option{-Wshadow}. Warns for any (global) shadowing.
6177 @item -Wshadow=local
6178 @opindex Wshadow=local
6179 Warn when a local variable shadows another local variable or parameter.
6180 This warning is enabled by @option{-Wshadow=global}.
6182 @item -Wshadow=compatible-local
6183 @opindex Wshadow=compatible-local
6184 Warn when a local variable shadows another local variable or parameter
6185 whose type is compatible with that of the shadowing variable. In C++,
6186 type compatibility here means the type of the shadowing variable can be
6187 converted to that of the shadowed variable. The creation of this flag
6188 (in addition to @option{-Wshadow=local}) is based on the idea that when
6189 a local variable shadows another one of incompatible type, it is most
6190 likely intentional, not a bug or typo, as shown in the following example:
6192 @smallexample
6193 @group
6194 for (SomeIterator i = SomeObj.begin(); i != SomeObj.end(); ++i)
6196   for (int i = 0; i < N; ++i)
6197   @{
6198     ...
6199   @}
6200   ...
6202 @end group
6203 @end smallexample
6205 Since the two variable @code{i} in the example above have incompatible types,
6206 enabling only @option{-Wshadow=compatible-local} will not emit a warning.
6207 Because their types are incompatible, if a programmer accidentally uses one
6208 in place of the other, type checking will catch that and emit an error or
6209 warning. So not warning (about shadowing) in this case will not lead to
6210 undetected bugs. Use of this flag instead of @option{-Wshadow=local} can
6211 possibly reduce the number of warnings triggered by intentional shadowing.
6213 This warning is enabled by @option{-Wshadow=local}.
6215 @item -Wlarger-than=@var{byte-size}
6216 @opindex Wlarger-than=
6217 @opindex Wlarger-than-@var{byte-size}
6218 Warn whenever an object is defined whose size exceeds @var{byte-size}.
6219 @option{-Wlarger-than=}@samp{PTRDIFF_MAX} is enabled by default.
6220 Warnings controlled by the option can be disabled either by specifying
6221 @var{byte-size} of @samp{SIZE_MAX} or more or by
6222 @option{-Wno-larger-than}.
6224 @item -Wno-larger-than
6225 @opindex Wno-larger-than
6226 Disable @option{-Wlarger-than=} warnings.  The option is equivalent
6227 to @option{-Wlarger-than=}@samp{SIZE_MAX} or larger.
6229 @item -Wframe-larger-than=@var{byte-size}
6230 @opindex Wframe-larger-than=
6231 @opindex Wno-frame-larger-than
6232 Warn if the size of a function frame exceeds @var{byte-size}.
6233 The computation done to determine the stack frame size is approximate
6234 and not conservative.
6235 The actual requirements may be somewhat greater than @var{byte-size}
6236 even if you do not get a warning.  In addition, any space allocated
6237 via @code{alloca}, variable-length arrays, or related constructs
6238 is not included by the compiler when determining
6239 whether or not to issue a warning.
6240 @option{-Wframe-larger-than=}@samp{PTRDIFF_MAX} is enabled by default.
6241 Warnings controlled by the option can be disabled either by specifying
6242 @var{byte-size} of @samp{SIZE_MAX} or more or by
6243 @option{-Wno-frame-larger-than}.
6245 @item -Wno-frame-larger-than
6246 @opindex Wno-frame-larger-than
6247 Disable @option{-Wframe-larger-than=} warnings.  The option is equivalent
6248 to @option{-Wframe-larger-than=}@samp{SIZE_MAX} or larger.
6250 @item -Wno-free-nonheap-object
6251 @opindex Wno-free-nonheap-object
6252 @opindex Wfree-nonheap-object
6253 Do not warn when attempting to free an object that was not allocated
6254 on the heap.
6256 @item -Wstack-usage=@var{byte-size}
6257 @opindex Wstack-usage
6258 @opindex Wno-stack-usage
6259 Warn if the stack usage of a function might exceed @var{byte-size}.
6260 The computation done to determine the stack usage is conservative.
6261 Any space allocated via @code{alloca}, variable-length arrays, or related
6262 constructs is included by the compiler when determining whether or not to
6263 issue a warning.
6265 The message is in keeping with the output of @option{-fstack-usage}.
6267 @itemize
6268 @item
6269 If the stack usage is fully static but exceeds the specified amount, it's:
6271 @smallexample
6272   warning: stack usage is 1120 bytes
6273 @end smallexample
6274 @item
6275 If the stack usage is (partly) dynamic but bounded, it's:
6277 @smallexample
6278   warning: stack usage might be 1648 bytes
6279 @end smallexample
6280 @item
6281 If the stack usage is (partly) dynamic and not bounded, it's:
6283 @smallexample
6284   warning: stack usage might be unbounded
6285 @end smallexample
6286 @end itemize
6288 @option{-Wstack-usage=}@samp{PTRDIFF_MAX} is enabled by default.
6289 Warnings controlled by the option can be disabled either by specifying
6290 @var{byte-size} of @samp{SIZE_MAX} or more or by
6291 @option{-Wno-stack-usage}.
6293 @item -Wno-stack-usage
6294 @opindex Wno-stack-usage
6295 Disable @option{-Wstack-usage=} warnings.  The option is equivalent
6296 to @option{-Wstack-usage=}@samp{SIZE_MAX} or larger.
6298 @item -Wunsafe-loop-optimizations
6299 @opindex Wunsafe-loop-optimizations
6300 @opindex Wno-unsafe-loop-optimizations
6301 Warn if the loop cannot be optimized because the compiler cannot
6302 assume anything on the bounds of the loop indices.  With
6303 @option{-funsafe-loop-optimizations} warn if the compiler makes
6304 such assumptions.
6306 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
6307 @opindex Wno-pedantic-ms-format
6308 @opindex Wpedantic-ms-format
6309 When used in combination with @option{-Wformat}
6310 and @option{-pedantic} without GNU extensions, this option
6311 disables the warnings about non-ISO @code{printf} / @code{scanf} format
6312 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
6313 which depend on the MS runtime.
6315 @item -Waligned-new
6316 @opindex Waligned-new
6317 @opindex Wno-aligned-new
6318 Warn about a new-expression of a type that requires greater alignment
6319 than the @code{alignof(std::max_align_t)} but uses an allocation
6320 function without an explicit alignment parameter. This option is
6321 enabled by @option{-Wall}.
6323 Normally this only warns about global allocation functions, but
6324 @option{-Waligned-new=all} also warns about class member allocation
6325 functions.
6327 @item -Wplacement-new
6328 @itemx -Wplacement-new=@var{n}
6329 @opindex Wplacement-new
6330 @opindex Wno-placement-new
6331 Warn about placement new expressions with undefined behavior, such as
6332 constructing an object in a buffer that is smaller than the type of
6333 the object.  For example, the placement new expression below is diagnosed
6334 because it attempts to construct an array of 64 integers in a buffer only
6335 64 bytes large.
6336 @smallexample
6337 char buf [64];
6338 new (buf) int[64];
6339 @end smallexample
6340 This warning is enabled by default.
6342 @table @gcctabopt
6343 @item -Wplacement-new=1
6344 This is the default warning level of @option{-Wplacement-new}.  At this
6345 level the warning is not issued for some strictly undefined constructs that
6346 GCC allows as extensions for compatibility with legacy code.  For example,
6347 the following @code{new} expression is not diagnosed at this level even
6348 though it has undefined behavior according to the C++ standard because
6349 it writes past the end of the one-element array.
6350 @smallexample
6351 struct S @{ int n, a[1]; @};
6352 S *s = (S *)malloc (sizeof *s + 31 * sizeof s->a[0]);
6353 new (s->a)int [32]();
6354 @end smallexample
6356 @item -Wplacement-new=2
6357 At this level, in addition to diagnosing all the same constructs as at level
6358 1, a diagnostic is also issued for placement new expressions that construct
6359 an object in the last member of structure whose type is an array of a single
6360 element and whose size is less than the size of the object being constructed.
6361 While the previous example would be diagnosed, the following construct makes
6362 use of the flexible member array extension to avoid the warning at level 2.
6363 @smallexample
6364 struct S @{ int n, a[]; @};
6365 S *s = (S *)malloc (sizeof *s + 32 * sizeof s->a[0]);
6366 new (s->a)int [32]();
6367 @end smallexample
6369 @end table
6371 @item -Wpointer-arith
6372 @opindex Wpointer-arith
6373 @opindex Wno-pointer-arith
6374 Warn about anything that depends on the ``size of'' a function type or
6375 of @code{void}.  GNU C assigns these types a size of 1, for
6376 convenience in calculations with @code{void *} pointers and pointers
6377 to functions.  In C++, warn also when an arithmetic operation involves
6378 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
6380 @item -Wpointer-compare
6381 @opindex Wpointer-compare
6382 @opindex Wno-pointer-compare
6383 Warn if a pointer is compared with a zero character constant.  This usually
6384 means that the pointer was meant to be dereferenced.  For example:
6386 @smallexample
6387 const char *p = foo ();
6388 if (p == '\0')
6389   return 42;
6390 @end smallexample
6392 Note that the code above is invalid in C++11.
6394 This warning is enabled by default.
6396 @item -Wtype-limits
6397 @opindex Wtype-limits
6398 @opindex Wno-type-limits
6399 Warn if a comparison is always true or always false due to the limited
6400 range of the data type, but do not warn for constant expressions.  For
6401 example, warn if an unsigned variable is compared against zero with
6402 @code{<} or @code{>=}.  This warning is also enabled by
6403 @option{-Wextra}.
6405 @item -Wabsolute-value @r{(C and Objective-C only)}
6406 @opindex Wabsolute-value
6407 @opindex Wno-absolute-value
6408 Warn when a wrong absolute value function seems to be used or when it
6409 does not have any effect because its argument is an unsigned type.
6410 This warning be suppressed with an explicit type cast and it is also
6411 enabled by @option{-Wextra}.
6413 @include cppwarnopts.texi
6415 @item -Wbad-function-cast @r{(C and Objective-C only)}
6416 @opindex Wbad-function-cast
6417 @opindex Wno-bad-function-cast
6418 Warn when a function call is cast to a non-matching type.
6419 For example, warn if a call to a function returning an integer type 
6420 is cast to a pointer type.
6422 @item -Wc90-c99-compat @r{(C and Objective-C only)}
6423 @opindex Wc90-c99-compat
6424 @opindex Wno-c90-c99-compat
6425 Warn about features not present in ISO C90, but present in ISO C99.
6426 For instance, warn about use of variable length arrays, @code{long long}
6427 type, @code{bool} type, compound literals, designated initializers, and so
6428 on.  This option is independent of the standards mode.  Warnings are disabled
6429 in the expression that follows @code{__extension__}.
6431 @item -Wc99-c11-compat @r{(C and Objective-C only)}
6432 @opindex Wc99-c11-compat
6433 @opindex Wno-c99-c11-compat
6434 Warn about features not present in ISO C99, but present in ISO C11.
6435 For instance, warn about use of anonymous structures and unions,
6436 @code{_Atomic} type qualifier, @code{_Thread_local} storage-class specifier,
6437 @code{_Alignas} specifier, @code{Alignof} operator, @code{_Generic} keyword,
6438 and so on.  This option is independent of the standards mode.  Warnings are
6439 disabled in the expression that follows @code{__extension__}.
6441 @item -Wc++-compat @r{(C and Objective-C only)}
6442 @opindex Wc++-compat
6443 @opindex Wno-c++-compat
6444 Warn about ISO C constructs that are outside of the common subset of
6445 ISO C and ISO C++, e.g.@: request for implicit conversion from
6446 @code{void *} to a pointer to non-@code{void} type.
6448 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
6449 @opindex Wc++11-compat
6450 @opindex Wno-c++11-compat
6451 Warn about C++ constructs whose meaning differs between ISO C++ 1998
6452 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
6453 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
6454 enabled by @option{-Wall}.
6456 @item -Wc++14-compat @r{(C++ and Objective-C++ only)}
6457 @opindex Wc++14-compat
6458 @opindex Wno-c++14-compat
6459 Warn about C++ constructs whose meaning differs between ISO C++ 2011
6460 and ISO C++ 2014.  This warning is enabled by @option{-Wall}.
6462 @item -Wc++17-compat @r{(C++ and Objective-C++ only)}
6463 @opindex Wc++17-compat
6464 @opindex Wno-c++17-compat
6465 Warn about C++ constructs whose meaning differs between ISO C++ 2014
6466 and ISO C++ 2017.  This warning is enabled by @option{-Wall}.
6468 @item -Wcast-qual
6469 @opindex Wcast-qual
6470 @opindex Wno-cast-qual
6471 Warn whenever a pointer is cast so as to remove a type qualifier from
6472 the target type.  For example, warn if a @code{const char *} is cast
6473 to an ordinary @code{char *}.
6475 Also warn when making a cast that introduces a type qualifier in an
6476 unsafe way.  For example, casting @code{char **} to @code{const char **}
6477 is unsafe, as in this example:
6479 @smallexample
6480   /* p is char ** value.  */
6481   const char **q = (const char **) p;
6482   /* Assignment of readonly string to const char * is OK.  */
6483   *q = "string";
6484   /* Now char** pointer points to read-only memory.  */
6485   **p = 'b';
6486 @end smallexample
6488 @item -Wcast-align
6489 @opindex Wcast-align
6490 @opindex Wno-cast-align
6491 Warn whenever a pointer is cast such that the required alignment of the
6492 target is increased.  For example, warn if a @code{char *} is cast to
6493 an @code{int *} on machines where integers can only be accessed at
6494 two- or four-byte boundaries.
6496 @item -Wcast-align=strict
6497 @opindex Wcast-align=strict
6498 Warn whenever a pointer is cast such that the required alignment of the
6499 target is increased.  For example, warn if a @code{char *} is cast to
6500 an @code{int *} regardless of the target machine.
6502 @item -Wcast-function-type
6503 @opindex Wcast-function-type
6504 @opindex Wno-cast-function-type
6505 Warn when a function pointer is cast to an incompatible function pointer.
6506 In a cast involving function types with a variable argument list only
6507 the types of initial arguments that are provided are considered.
6508 Any parameter of pointer-type matches any other pointer-type.  Any benign
6509 differences in integral types are ignored, like @code{int} vs.@: @code{long}
6510 on ILP32 targets.  Likewise type qualifiers are ignored.  The function
6511 type @code{void (*) (void)} is special and matches everything, which can
6512 be used to suppress this warning.
6513 In a cast involving pointer to member types this warning warns whenever
6514 the type cast is changing the pointer to member type.
6515 This warning is enabled by @option{-Wextra}.
6517 @item -Wwrite-strings
6518 @opindex Wwrite-strings
6519 @opindex Wno-write-strings
6520 When compiling C, give string constants the type @code{const
6521 char[@var{length}]} so that copying the address of one into a
6522 non-@code{const} @code{char *} pointer produces a warning.  These
6523 warnings help you find at compile time code that can try to write
6524 into a string constant, but only if you have been very careful about
6525 using @code{const} in declarations and prototypes.  Otherwise, it is
6526 just a nuisance. This is why we did not make @option{-Wall} request
6527 these warnings.
6529 When compiling C++, warn about the deprecated conversion from string
6530 literals to @code{char *}.  This warning is enabled by default for C++
6531 programs.
6533 @item -Wcatch-value
6534 @itemx -Wcatch-value=@var{n} @r{(C++ and Objective-C++ only)}
6535 @opindex Wcatch-value
6536 @opindex Wno-catch-value
6537 Warn about catch handlers that do not catch via reference.
6538 With @option{-Wcatch-value=1} (or @option{-Wcatch-value} for short)
6539 warn about polymorphic class types that are caught by value.
6540 With @option{-Wcatch-value=2} warn about all class types that are caught
6541 by value. With @option{-Wcatch-value=3} warn about all types that are
6542 not caught by reference. @option{-Wcatch-value} is enabled by @option{-Wall}.
6544 @item -Wclobbered
6545 @opindex Wclobbered
6546 @opindex Wno-clobbered
6547 Warn for variables that might be changed by @code{longjmp} or
6548 @code{vfork}.  This warning is also enabled by @option{-Wextra}.
6550 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
6551 @opindex Wconditionally-supported
6552 @opindex Wno-conditionally-supported
6553 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
6555 @item -Wconversion
6556 @opindex Wconversion
6557 @opindex Wno-conversion
6558 Warn for implicit conversions that may alter a value. This includes
6559 conversions between real and integer, like @code{abs (x)} when
6560 @code{x} is @code{double}; conversions between signed and unsigned,
6561 like @code{unsigned ui = -1}; and conversions to smaller types, like
6562 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
6563 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
6564 changed by the conversion like in @code{abs (2.0)}.  Warnings about
6565 conversions between signed and unsigned integers can be disabled by
6566 using @option{-Wno-sign-conversion}.
6568 For C++, also warn for confusing overload resolution for user-defined
6569 conversions; and conversions that never use a type conversion
6570 operator: conversions to @code{void}, the same type, a base class or a
6571 reference to them. Warnings about conversions between signed and
6572 unsigned integers are disabled by default in C++ unless
6573 @option{-Wsign-conversion} is explicitly enabled.
6575 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
6576 @opindex Wconversion-null
6577 @opindex Wno-conversion-null
6578 Do not warn for conversions between @code{NULL} and non-pointer
6579 types. @option{-Wconversion-null} is enabled by default.
6581 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
6582 @opindex Wzero-as-null-pointer-constant
6583 @opindex Wno-zero-as-null-pointer-constant
6584 Warn when a literal @samp{0} is used as null pointer constant.  This can
6585 be useful to facilitate the conversion to @code{nullptr} in C++11.
6587 @item -Wsubobject-linkage @r{(C++ and Objective-C++ only)}
6588 @opindex Wsubobject-linkage
6589 @opindex Wno-subobject-linkage
6590 Warn if a class type has a base or a field whose type uses the anonymous
6591 namespace or depends on a type with no linkage.  If a type A depends on
6592 a type B with no or internal linkage, defining it in multiple
6593 translation units would be an ODR violation because the meaning of B
6594 is different in each translation unit.  If A only appears in a single
6595 translation unit, the best way to silence the warning is to give it
6596 internal linkage by putting it in an anonymous namespace as well.  The
6597 compiler doesn't give this warning for types defined in the main .C
6598 file, as those are unlikely to have multiple definitions.
6599 @option{-Wsubobject-linkage} is enabled by default.
6601 @item -Wdangling-else
6602 @opindex Wdangling-else
6603 @opindex Wno-dangling-else
6604 Warn about constructions where there may be confusion to which
6605 @code{if} statement an @code{else} branch belongs.  Here is an example of
6606 such a case:
6608 @smallexample
6609 @group
6611   if (a)
6612     if (b)
6613       foo ();
6614   else
6615     bar ();
6617 @end group
6618 @end smallexample
6620 In C/C++, every @code{else} branch belongs to the innermost possible
6621 @code{if} statement, which in this example is @code{if (b)}.  This is
6622 often not what the programmer expected, as illustrated in the above
6623 example by indentation the programmer chose.  When there is the
6624 potential for this confusion, GCC issues a warning when this flag
6625 is specified.  To eliminate the warning, add explicit braces around
6626 the innermost @code{if} statement so there is no way the @code{else}
6627 can belong to the enclosing @code{if}.  The resulting code
6628 looks like this:
6630 @smallexample
6631 @group
6633   if (a)
6634     @{
6635       if (b)
6636         foo ();
6637       else
6638         bar ();
6639     @}
6641 @end group
6642 @end smallexample
6644 This warning is enabled by @option{-Wparentheses}.
6646 @item -Wdate-time
6647 @opindex Wdate-time
6648 @opindex Wno-date-time
6649 Warn when macros @code{__TIME__}, @code{__DATE__} or @code{__TIMESTAMP__}
6650 are encountered as they might prevent bit-wise-identical reproducible
6651 compilations.
6653 @item -Wdelete-incomplete @r{(C++ and Objective-C++ only)}
6654 @opindex Wdelete-incomplete
6655 @opindex Wno-delete-incomplete
6656 Warn when deleting a pointer to incomplete type, which may cause
6657 undefined behavior at runtime.  This warning is enabled by default.
6659 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
6660 @opindex Wuseless-cast
6661 @opindex Wno-useless-cast
6662 Warn when an expression is casted to its own type.
6664 @item -Wempty-body
6665 @opindex Wempty-body
6666 @opindex Wno-empty-body
6667 Warn if an empty body occurs in an @code{if}, @code{else} or @code{do
6668 while} statement.  This warning is also enabled by @option{-Wextra}.
6670 @item -Wenum-compare
6671 @opindex Wenum-compare
6672 @opindex Wno-enum-compare
6673 Warn about a comparison between values of different enumerated types.
6674 In C++ enumerated type mismatches in conditional expressions are also
6675 diagnosed and the warning is enabled by default.  In C this warning is 
6676 enabled by @option{-Wall}.
6678 @item -Wextra-semi @r{(C++, Objective-C++ only)}
6679 @opindex Wextra-semi
6680 @opindex Wno-extra-semi
6681 Warn about redundant semicolon after in-class function definition.
6683 @item -Wjump-misses-init @r{(C, Objective-C only)}
6684 @opindex Wjump-misses-init
6685 @opindex Wno-jump-misses-init
6686 Warn if a @code{goto} statement or a @code{switch} statement jumps
6687 forward across the initialization of a variable, or jumps backward to a
6688 label after the variable has been initialized.  This only warns about
6689 variables that are initialized when they are declared.  This warning is
6690 only supported for C and Objective-C; in C++ this sort of branch is an
6691 error in any case.
6693 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
6694 can be disabled with the @option{-Wno-jump-misses-init} option.
6696 @item -Wsign-compare
6697 @opindex Wsign-compare
6698 @opindex Wno-sign-compare
6699 @cindex warning for comparison of signed and unsigned values
6700 @cindex comparison of signed and unsigned values, warning
6701 @cindex signed and unsigned values, comparison warning
6702 Warn when a comparison between signed and unsigned values could produce
6703 an incorrect result when the signed value is converted to unsigned.
6704 In C++, this warning is also enabled by @option{-Wall}.  In C, it is
6705 also enabled by @option{-Wextra}.
6707 @item -Wsign-conversion
6708 @opindex Wsign-conversion
6709 @opindex Wno-sign-conversion
6710 Warn for implicit conversions that may change the sign of an integer
6711 value, like assigning a signed integer expression to an unsigned
6712 integer variable. An explicit cast silences the warning. In C, this
6713 option is enabled also by @option{-Wconversion}.
6715 @item -Wfloat-conversion
6716 @opindex Wfloat-conversion
6717 @opindex Wno-float-conversion
6718 Warn for implicit conversions that reduce the precision of a real value.
6719 This includes conversions from real to integer, and from higher precision
6720 real to lower precision real values.  This option is also enabled by
6721 @option{-Wconversion}.
6723 @item -Wno-scalar-storage-order
6724 @opindex Wno-scalar-storage-order
6725 @opindex Wscalar-storage-order
6726 Do not warn on suspicious constructs involving reverse scalar storage order.
6728 @item -Wsized-deallocation @r{(C++ and Objective-C++ only)}
6729 @opindex Wsized-deallocation
6730 @opindex Wno-sized-deallocation
6731 Warn about a definition of an unsized deallocation function
6732 @smallexample
6733 void operator delete (void *) noexcept;
6734 void operator delete[] (void *) noexcept;
6735 @end smallexample
6736 without a definition of the corresponding sized deallocation function
6737 @smallexample
6738 void operator delete (void *, std::size_t) noexcept;
6739 void operator delete[] (void *, std::size_t) noexcept;
6740 @end smallexample
6741 or vice versa.  Enabled by @option{-Wextra} along with
6742 @option{-fsized-deallocation}.
6744 @item -Wsizeof-pointer-div
6745 @opindex Wsizeof-pointer-div
6746 @opindex Wno-sizeof-pointer-div
6747 Warn for suspicious divisions of two sizeof expressions that divide
6748 the pointer size by the element size, which is the usual way to compute
6749 the array size but won't work out correctly with pointers.  This warning
6750 warns e.g.@: about @code{sizeof (ptr) / sizeof (ptr[0])} if @code{ptr} is
6751 not an array, but a pointer.  This warning is enabled by @option{-Wall}.
6753 @item -Wsizeof-pointer-memaccess
6754 @opindex Wsizeof-pointer-memaccess
6755 @opindex Wno-sizeof-pointer-memaccess
6756 Warn for suspicious length parameters to certain string and memory built-in
6757 functions if the argument uses @code{sizeof}.  This warning triggers for
6758 example for @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not
6759 an array, but a pointer, and suggests a possible fix, or about
6760 @code{memcpy (&foo, ptr, sizeof (&foo));}.  @option{-Wsizeof-pointer-memaccess}
6761 also warns about calls to bounded string copy functions like @code{strncat}
6762 or @code{strncpy} that specify as the bound a @code{sizeof} expression of
6763 the source array.  For example, in the following function the call to
6764 @code{strncat} specifies the size of the source string as the bound.  That
6765 is almost certainly a mistake and so the call is diagnosed.
6766 @smallexample
6767 void make_file (const char *name)
6769   char path[PATH_MAX];
6770   strncpy (path, name, sizeof path - 1);
6771   strncat (path, ".text", sizeof ".text");
6772   @dots{}
6774 @end smallexample
6776 The @option{-Wsizeof-pointer-memaccess} option is enabled by @option{-Wall}.
6778 @item -Wsizeof-array-argument
6779 @opindex Wsizeof-array-argument
6780 @opindex Wno-sizeof-array-argument
6781 Warn when the @code{sizeof} operator is applied to a parameter that is
6782 declared as an array in a function definition.  This warning is enabled by
6783 default for C and C++ programs.
6785 @item -Wmemset-elt-size
6786 @opindex Wmemset-elt-size
6787 @opindex Wno-memset-elt-size
6788 Warn for suspicious calls to the @code{memset} built-in function, if the
6789 first argument references an array, and the third argument is a number
6790 equal to the number of elements, but not equal to the size of the array
6791 in memory.  This indicates that the user has omitted a multiplication by
6792 the element size.  This warning is enabled by @option{-Wall}.
6794 @item -Wmemset-transposed-args
6795 @opindex Wmemset-transposed-args
6796 @opindex Wno-memset-transposed-args
6797 Warn for suspicious calls to the @code{memset} built-in function, if the
6798 second argument is not zero and the third argument is zero.  This warns e.g.@:
6799 about @code{memset (buf, sizeof buf, 0)} where most probably
6800 @code{memset (buf, 0, sizeof buf)} was meant instead.  The diagnostics
6801 is only emitted if the third argument is literal zero.  If it is some
6802 expression that is folded to zero, a cast of zero to some type, etc., 
6803 it is far less likely that the user has mistakenly exchanged the arguments 
6804 and no warning is emitted.  This warning is enabled by @option{-Wall}.
6806 @item -Waddress
6807 @opindex Waddress
6808 @opindex Wno-address
6809 Warn about suspicious uses of memory addresses. These include using
6810 the address of a function in a conditional expression, such as
6811 @code{void func(void); if (func)}, and comparisons against the memory
6812 address of a string literal, such as @code{if (x == "abc")}.  Such
6813 uses typically indicate a programmer error: the address of a function
6814 always evaluates to true, so their use in a conditional usually
6815 indicate that the programmer forgot the parentheses in a function
6816 call; and comparisons against string literals result in unspecified
6817 behavior and are not portable in C, so they usually indicate that the
6818 programmer intended to use @code{strcmp}.  This warning is enabled by
6819 @option{-Wall}.
6821 @item -Wlogical-op
6822 @opindex Wlogical-op
6823 @opindex Wno-logical-op
6824 Warn about suspicious uses of logical operators in expressions.
6825 This includes using logical operators in contexts where a
6826 bit-wise operator is likely to be expected.  Also warns when
6827 the operands of a logical operator are the same:
6828 @smallexample
6829 extern int a;
6830 if (a < 0 && a < 0) @{ @dots{} @}
6831 @end smallexample
6833 @item -Wlogical-not-parentheses
6834 @opindex Wlogical-not-parentheses
6835 @opindex Wno-logical-not-parentheses
6836 Warn about logical not used on the left hand side operand of a comparison.
6837 This option does not warn if the right operand is considered to be a boolean
6838 expression.  Its purpose is to detect suspicious code like the following:
6839 @smallexample
6840 int a;
6841 @dots{}
6842 if (!a > 1) @{ @dots{} @}
6843 @end smallexample
6845 It is possible to suppress the warning by wrapping the LHS into
6846 parentheses:
6847 @smallexample
6848 if ((!a) > 1) @{ @dots{} @}
6849 @end smallexample
6851 This warning is enabled by @option{-Wall}.
6853 @item -Waggregate-return
6854 @opindex Waggregate-return
6855 @opindex Wno-aggregate-return
6856 Warn if any functions that return structures or unions are defined or
6857 called.  (In languages where you can return an array, this also elicits
6858 a warning.)
6860 @item -Wno-aggressive-loop-optimizations
6861 @opindex Wno-aggressive-loop-optimizations
6862 @opindex Waggressive-loop-optimizations
6863 Warn if in a loop with constant number of iterations the compiler detects
6864 undefined behavior in some statement during one or more of the iterations.
6866 @item -Wno-attributes
6867 @opindex Wno-attributes
6868 @opindex Wattributes
6869 Do not warn if an unexpected @code{__attribute__} is used, such as
6870 unrecognized attributes, function attributes applied to variables,
6871 etc.  This does not stop errors for incorrect use of supported
6872 attributes.
6874 @item -Wno-builtin-declaration-mismatch
6875 @opindex Wno-builtin-declaration-mismatch
6876 @opindex Wbuiltin-declaration-mismatch
6877 Warn if a built-in function is declared with the wrong signature or 
6878 as non-function.
6879 This warning is enabled by default.
6881 @item -Wno-builtin-macro-redefined
6882 @opindex Wno-builtin-macro-redefined
6883 @opindex Wbuiltin-macro-redefined
6884 Do not warn if certain built-in macros are redefined.  This suppresses
6885 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
6886 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
6888 @item -Wstrict-prototypes @r{(C and Objective-C only)}
6889 @opindex Wstrict-prototypes
6890 @opindex Wno-strict-prototypes
6891 Warn if a function is declared or defined without specifying the
6892 argument types.  (An old-style function definition is permitted without
6893 a warning if preceded by a declaration that specifies the argument
6894 types.)
6896 @item -Wold-style-declaration @r{(C and Objective-C only)}
6897 @opindex Wold-style-declaration
6898 @opindex Wno-old-style-declaration
6899 Warn for obsolescent usages, according to the C Standard, in a
6900 declaration. For example, warn if storage-class specifiers like
6901 @code{static} are not the first things in a declaration.  This warning
6902 is also enabled by @option{-Wextra}.
6904 @item -Wold-style-definition @r{(C and Objective-C only)}
6905 @opindex Wold-style-definition
6906 @opindex Wno-old-style-definition
6907 Warn if an old-style function definition is used.  A warning is given
6908 even if there is a previous prototype.
6910 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
6911 @opindex Wmissing-parameter-type
6912 @opindex Wno-missing-parameter-type
6913 A function parameter is declared without a type specifier in K&R-style
6914 functions:
6916 @smallexample
6917 void foo(bar) @{ @}
6918 @end smallexample
6920 This warning is also enabled by @option{-Wextra}.
6922 @item -Wmissing-prototypes @r{(C and Objective-C only)}
6923 @opindex Wmissing-prototypes
6924 @opindex Wno-missing-prototypes
6925 Warn if a global function is defined without a previous prototype
6926 declaration.  This warning is issued even if the definition itself
6927 provides a prototype.  Use this option to detect global functions
6928 that do not have a matching prototype declaration in a header file.
6929 This option is not valid for C++ because all function declarations
6930 provide prototypes and a non-matching declaration declares an
6931 overload rather than conflict with an earlier declaration.
6932 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
6934 @item -Wmissing-declarations
6935 @opindex Wmissing-declarations
6936 @opindex Wno-missing-declarations
6937 Warn if a global function is defined without a previous declaration.
6938 Do so even if the definition itself provides a prototype.
6939 Use this option to detect global functions that are not declared in
6940 header files.  In C, no warnings are issued for functions with previous
6941 non-prototype declarations; use @option{-Wmissing-prototypes} to detect
6942 missing prototypes.  In C++, no warnings are issued for function templates,
6943 or for inline functions, or for functions in anonymous namespaces.
6945 @item -Wmissing-field-initializers
6946 @opindex Wmissing-field-initializers
6947 @opindex Wno-missing-field-initializers
6948 @opindex W
6949 @opindex Wextra
6950 @opindex Wno-extra
6951 Warn if a structure's initializer has some fields missing.  For
6952 example, the following code causes such a warning, because
6953 @code{x.h} is implicitly zero:
6955 @smallexample
6956 struct s @{ int f, g, h; @};
6957 struct s x = @{ 3, 4 @};
6958 @end smallexample
6960 This option does not warn about designated initializers, so the following
6961 modification does not trigger a warning:
6963 @smallexample
6964 struct s @{ int f, g, h; @};
6965 struct s x = @{ .f = 3, .g = 4 @};
6966 @end smallexample
6968 In C this option does not warn about the universal zero initializer
6969 @samp{@{ 0 @}}:
6971 @smallexample
6972 struct s @{ int f, g, h; @};
6973 struct s x = @{ 0 @};
6974 @end smallexample
6976 Likewise, in C++ this option does not warn about the empty @{ @}
6977 initializer, for example:
6979 @smallexample
6980 struct s @{ int f, g, h; @};
6981 s x = @{ @};
6982 @end smallexample
6984 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
6985 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
6987 @item -Wno-multichar
6988 @opindex Wno-multichar
6989 @opindex Wmultichar
6990 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
6991 Usually they indicate a typo in the user's code, as they have
6992 implementation-defined values, and should not be used in portable code.
6994 @item -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]}
6995 @opindex Wnormalized=
6996 @opindex Wnormalized
6997 @opindex Wno-normalized
6998 @cindex NFC
6999 @cindex NFKC
7000 @cindex character set, input normalization
7001 In ISO C and ISO C++, two identifiers are different if they are
7002 different sequences of characters.  However, sometimes when characters
7003 outside the basic ASCII character set are used, you can have two
7004 different character sequences that look the same.  To avoid confusion,
7005 the ISO 10646 standard sets out some @dfn{normalization rules} which
7006 when applied ensure that two sequences that look the same are turned into
7007 the same sequence.  GCC can warn you if you are using identifiers that
7008 have not been normalized; this option controls that warning.
7010 There are four levels of warning supported by GCC@.  The default is
7011 @option{-Wnormalized=nfc}, which warns about any identifier that is
7012 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
7013 recommended form for most uses.  It is equivalent to
7014 @option{-Wnormalized}.
7016 Unfortunately, there are some characters allowed in identifiers by
7017 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
7018 identifiers.  That is, there's no way to use these symbols in portable
7019 ISO C or C++ and have all your identifiers in NFC@.
7020 @option{-Wnormalized=id} suppresses the warning for these characters.
7021 It is hoped that future versions of the standards involved will correct
7022 this, which is why this option is not the default.
7024 You can switch the warning off for all characters by writing
7025 @option{-Wnormalized=none} or @option{-Wno-normalized}.  You should
7026 only do this if you are using some other normalization scheme (like
7027 ``D''), because otherwise you can easily create bugs that are
7028 literally impossible to see.
7030 Some characters in ISO 10646 have distinct meanings but look identical
7031 in some fonts or display methodologies, especially once formatting has
7032 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
7033 LETTER N'', displays just like a regular @code{n} that has been
7034 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
7035 normalization scheme to convert all these into a standard form as
7036 well, and GCC warns if your code is not in NFKC if you use
7037 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
7038 about every identifier that contains the letter O because it might be
7039 confused with the digit 0, and so is not the default, but may be
7040 useful as a local coding convention if the programming environment 
7041 cannot be fixed to display these characters distinctly.
7043 @item -Wno-attribute-warning
7044 @opindex Wno-attribute-warning
7045 @opindex Wattribute-warning
7046 Do not warn about usage of functions (@pxref{Function Attributes})
7047 declared with @code{warning} attribute.  By default, this warning is
7048 enabled.  @option{-Wno-attribute-warning} can be used to disable the
7049 warning or @option{-Wno-error=attribute-warning} can be used to
7050 disable the error when compiled with @option{-Werror} flag.
7052 @item -Wno-deprecated
7053 @opindex Wno-deprecated
7054 @opindex Wdeprecated
7055 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
7057 @item -Wno-deprecated-declarations
7058 @opindex Wno-deprecated-declarations
7059 @opindex Wdeprecated-declarations
7060 Do not warn about uses of functions (@pxref{Function Attributes}),
7061 variables (@pxref{Variable Attributes}), and types (@pxref{Type
7062 Attributes}) marked as deprecated by using the @code{deprecated}
7063 attribute.
7065 @item -Wno-overflow
7066 @opindex Wno-overflow
7067 @opindex Woverflow
7068 Do not warn about compile-time overflow in constant expressions.
7070 @item -Wno-odr
7071 @opindex Wno-odr
7072 @opindex Wodr
7073 Warn about One Definition Rule violations during link-time optimization.
7074 Requires @option{-flto-odr-type-merging} to be enabled.  Enabled by default.
7076 @item -Wopenmp-simd
7077 @opindex Wopenmp-simd
7078 @opindex Wno-openmp-simd
7079 Warn if the vectorizer cost model overrides the OpenMP
7080 simd directive set by user.  The @option{-fsimd-cost-model=unlimited}
7081 option can be used to relax the cost model.
7083 @item -Woverride-init @r{(C and Objective-C only)}
7084 @opindex Woverride-init
7085 @opindex Wno-override-init
7086 @opindex W
7087 @opindex Wextra
7088 @opindex Wno-extra
7089 Warn if an initialized field without side effects is overridden when
7090 using designated initializers (@pxref{Designated Inits, , Designated
7091 Initializers}).
7093 This warning is included in @option{-Wextra}.  To get other
7094 @option{-Wextra} warnings without this one, use @option{-Wextra
7095 -Wno-override-init}.
7097 @item -Woverride-init-side-effects @r{(C and Objective-C only)}
7098 @opindex Woverride-init-side-effects
7099 @opindex Wno-override-init-side-effects
7100 Warn if an initialized field with side effects is overridden when
7101 using designated initializers (@pxref{Designated Inits, , Designated
7102 Initializers}).  This warning is enabled by default.
7104 @item -Wpacked
7105 @opindex Wpacked
7106 @opindex Wno-packed
7107 Warn if a structure is given the packed attribute, but the packed
7108 attribute has no effect on the layout or size of the structure.
7109 Such structures may be mis-aligned for little benefit.  For
7110 instance, in this code, the variable @code{f.x} in @code{struct bar}
7111 is misaligned even though @code{struct bar} does not itself
7112 have the packed attribute:
7114 @smallexample
7115 @group
7116 struct foo @{
7117   int x;
7118   char a, b, c, d;
7119 @} __attribute__((packed));
7120 struct bar @{
7121   char z;
7122   struct foo f;
7124 @end group
7125 @end smallexample
7127 @item -Wpacked-bitfield-compat
7128 @opindex Wpacked-bitfield-compat
7129 @opindex Wno-packed-bitfield-compat
7130 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
7131 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
7132 the change can lead to differences in the structure layout.  GCC
7133 informs you when the offset of such a field has changed in GCC 4.4.
7134 For example there is no longer a 4-bit padding between field @code{a}
7135 and @code{b} in this structure:
7137 @smallexample
7138 struct foo
7140   char a:4;
7141   char b:8;
7142 @} __attribute__ ((packed));
7143 @end smallexample
7145 This warning is enabled by default.  Use
7146 @option{-Wno-packed-bitfield-compat} to disable this warning.
7148 @item -Wpacked-not-aligned @r{(C, C++, Objective-C and Objective-C++ only)}
7149 @opindex Wpacked-not-aligned
7150 @opindex Wno-packed-not-aligned
7151 Warn if a structure field with explicitly specified alignment in a
7152 packed struct or union is misaligned.  For example, a warning will
7153 be issued on @code{struct S}, like, @code{warning: alignment 1 of
7154 'struct S' is less than 8}, in this code:
7156 @smallexample
7157 @group
7158 struct __attribute__ ((aligned (8))) S8 @{ char a[8]; @};
7159 struct __attribute__ ((packed)) S @{
7160   struct S8 s8;
7162 @end group
7163 @end smallexample
7165 This warning is enabled by @option{-Wall}.
7167 @item -Wpadded
7168 @opindex Wpadded
7169 @opindex Wno-padded
7170 Warn if padding is included in a structure, either to align an element
7171 of the structure or to align the whole structure.  Sometimes when this
7172 happens it is possible to rearrange the fields of the structure to
7173 reduce the padding and so make the structure smaller.
7175 @item -Wredundant-decls
7176 @opindex Wredundant-decls
7177 @opindex Wno-redundant-decls
7178 Warn if anything is declared more than once in the same scope, even in
7179 cases where multiple declaration is valid and changes nothing.
7181 @item -Wno-restrict
7182 @opindex Wrestrict
7183 @opindex Wno-restrict
7184 Warn when an object referenced by a @code{restrict}-qualified parameter
7185 (or, in C++, a @code{__restrict}-qualified parameter) is aliased by another
7186 argument, or when copies between such objects overlap.  For example,
7187 the call to the @code{strcpy} function below attempts to truncate the string
7188 by replacing its initial characters with the last four.  However, because
7189 the call writes the terminating NUL into @code{a[4]}, the copies overlap and
7190 the call is diagnosed.
7192 @smallexample
7193 void foo (void)
7195   char a[] = "abcd1234";
7196   strcpy (a, a + 4);
7197   @dots{}
7199 @end smallexample
7200 The @option{-Wrestrict} option detects some instances of simple overlap
7201 even without optimization but works best at @option{-O2} and above.  It
7202 is included in @option{-Wall}.
7204 @item -Wnested-externs @r{(C and Objective-C only)}
7205 @opindex Wnested-externs
7206 @opindex Wno-nested-externs
7207 Warn if an @code{extern} declaration is encountered within a function.
7209 @item -Wno-inherited-variadic-ctor
7210 @opindex Winherited-variadic-ctor
7211 @opindex Wno-inherited-variadic-ctor
7212 Suppress warnings about use of C++11 inheriting constructors when the
7213 base class inherited from has a C variadic constructor; the warning is
7214 on by default because the ellipsis is not inherited.
7216 @item -Winline
7217 @opindex Winline
7218 @opindex Wno-inline
7219 Warn if a function that is declared as inline cannot be inlined.
7220 Even with this option, the compiler does not warn about failures to
7221 inline functions declared in system headers.
7223 The compiler uses a variety of heuristics to determine whether or not
7224 to inline a function.  For example, the compiler takes into account
7225 the size of the function being inlined and the amount of inlining
7226 that has already been done in the current function.  Therefore,
7227 seemingly insignificant changes in the source program can cause the
7228 warnings produced by @option{-Winline} to appear or disappear.
7230 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
7231 @opindex Wno-invalid-offsetof
7232 @opindex Winvalid-offsetof
7233 Suppress warnings from applying the @code{offsetof} macro to a non-POD
7234 type.  According to the 2014 ISO C++ standard, applying @code{offsetof}
7235 to a non-standard-layout type is undefined.  In existing C++ implementations,
7236 however, @code{offsetof} typically gives meaningful results.
7237 This flag is for users who are aware that they are
7238 writing nonportable code and who have deliberately chosen to ignore the
7239 warning about it.
7241 The restrictions on @code{offsetof} may be relaxed in a future version
7242 of the C++ standard.
7244 @item -Wint-in-bool-context
7245 @opindex Wint-in-bool-context
7246 @opindex Wno-int-in-bool-context
7247 Warn for suspicious use of integer values where boolean values are expected,
7248 such as conditional expressions (?:) using non-boolean integer constants in
7249 boolean context, like @code{if (a <= b ? 2 : 3)}.  Or left shifting of signed
7250 integers in boolean context, like @code{for (a = 0; 1 << a; a++);}.  Likewise
7251 for all kinds of multiplications regardless of the data type.
7252 This warning is enabled by @option{-Wall}.
7254 @item -Wno-int-to-pointer-cast
7255 @opindex Wno-int-to-pointer-cast
7256 @opindex Wint-to-pointer-cast
7257 Suppress warnings from casts to pointer type of an integer of a
7258 different size. In C++, casting to a pointer type of smaller size is
7259 an error. @option{Wint-to-pointer-cast} is enabled by default.
7262 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
7263 @opindex Wno-pointer-to-int-cast
7264 @opindex Wpointer-to-int-cast
7265 Suppress warnings from casts from a pointer to an integer type of a
7266 different size.
7268 @item -Winvalid-pch
7269 @opindex Winvalid-pch
7270 @opindex Wno-invalid-pch
7271 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
7272 the search path but cannot be used.
7274 @item -Wlong-long
7275 @opindex Wlong-long
7276 @opindex Wno-long-long
7277 Warn if @code{long long} type is used.  This is enabled by either
7278 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
7279 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
7281 @item -Wvariadic-macros
7282 @opindex Wvariadic-macros
7283 @opindex Wno-variadic-macros
7284 Warn if variadic macros are used in ISO C90 mode, or if the GNU
7285 alternate syntax is used in ISO C99 mode.  This is enabled by either
7286 @option{-Wpedantic} or @option{-Wtraditional}.  To inhibit the warning
7287 messages, use @option{-Wno-variadic-macros}.
7289 @item -Wvarargs
7290 @opindex Wvarargs
7291 @opindex Wno-varargs
7292 Warn upon questionable usage of the macros used to handle variable
7293 arguments like @code{va_start}.  This is default.  To inhibit the
7294 warning messages, use @option{-Wno-varargs}.
7296 @item -Wvector-operation-performance
7297 @opindex Wvector-operation-performance
7298 @opindex Wno-vector-operation-performance
7299 Warn if vector operation is not implemented via SIMD capabilities of the
7300 architecture.  Mainly useful for the performance tuning.
7301 Vector operation can be implemented @code{piecewise}, which means that the
7302 scalar operation is performed on every vector element; 
7303 @code{in parallel}, which means that the vector operation is implemented
7304 using scalars of wider type, which normally is more performance efficient;
7305 and @code{as a single scalar}, which means that vector fits into a
7306 scalar type.
7308 @item -Wno-virtual-move-assign
7309 @opindex Wvirtual-move-assign
7310 @opindex Wno-virtual-move-assign
7311 Suppress warnings about inheriting from a virtual base with a
7312 non-trivial C++11 move assignment operator.  This is dangerous because
7313 if the virtual base is reachable along more than one path, it is
7314 moved multiple times, which can mean both objects end up in the
7315 moved-from state.  If the move assignment operator is written to avoid
7316 moving from a moved-from object, this warning can be disabled.
7318 @item -Wvla
7319 @opindex Wvla
7320 @opindex Wno-vla
7321 Warn if a variable-length array is used in the code.
7322 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
7323 the variable-length array.
7325 @item -Wvla-larger-than=@var{byte-size}
7326 @opindex Wvla-larger-than=
7327 @opindex Wno-vla-larger-than
7328 If this option is used, the compiler will warn for declarations of
7329 variable-length arrays whose size is either unbounded, or bounded
7330 by an argument that allows the array size to exceed @var{byte-size}
7331 bytes.  This is similar to how @option{-Walloca-larger-than=}@var{byte-size}
7332 works, but with variable-length arrays.
7334 Note that GCC may optimize small variable-length arrays of a known
7335 value into plain arrays, so this warning may not get triggered for
7336 such arrays.
7338 @option{-Wvla-larger-than=}@samp{PTRDIFF_MAX} is enabled by default but
7339 is typically only effective when @option{-ftree-vrp} is active (default
7340 for @option{-O2} and above).
7342 See also @option{-Walloca-larger-than=@var{byte-size}}.
7344 @item -Wno-vla-larger-than
7345 @opindex Wno-vla-larger-than
7346 Disable @option{-Wvla-larger-than=} warnings.  The option is equivalent
7347 to @option{-Wvla-larger-than=}@samp{SIZE_MAX} or larger.
7349 @item -Wvolatile-register-var
7350 @opindex Wvolatile-register-var
7351 @opindex Wno-volatile-register-var
7352 Warn if a register variable is declared volatile.  The volatile
7353 modifier does not inhibit all optimizations that may eliminate reads
7354 and/or writes to register variables.  This warning is enabled by
7355 @option{-Wall}.
7357 @item -Wdisabled-optimization
7358 @opindex Wdisabled-optimization
7359 @opindex Wno-disabled-optimization
7360 Warn if a requested optimization pass is disabled.  This warning does
7361 not generally indicate that there is anything wrong with your code; it
7362 merely indicates that GCC's optimizers are unable to handle the code
7363 effectively.  Often, the problem is that your code is too big or too
7364 complex; GCC refuses to optimize programs when the optimization
7365 itself is likely to take inordinate amounts of time.
7367 @item -Wpointer-sign @r{(C and Objective-C only)}
7368 @opindex Wpointer-sign
7369 @opindex Wno-pointer-sign
7370 Warn for pointer argument passing or assignment with different signedness.
7371 This option is only supported for C and Objective-C@.  It is implied by
7372 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
7373 @option{-Wno-pointer-sign}.
7375 @item -Wstack-protector
7376 @opindex Wstack-protector
7377 @opindex Wno-stack-protector
7378 This option is only active when @option{-fstack-protector} is active.  It
7379 warns about functions that are not protected against stack smashing.
7381 @item -Woverlength-strings
7382 @opindex Woverlength-strings
7383 @opindex Wno-overlength-strings
7384 Warn about string constants that are longer than the ``minimum
7385 maximum'' length specified in the C standard.  Modern compilers
7386 generally allow string constants that are much longer than the
7387 standard's minimum limit, but very portable programs should avoid
7388 using longer strings.
7390 The limit applies @emph{after} string constant concatenation, and does
7391 not count the trailing NUL@.  In C90, the limit was 509 characters; in
7392 C99, it was raised to 4095.  C++98 does not specify a normative
7393 minimum maximum, so we do not diagnose overlength strings in C++@.
7395 This option is implied by @option{-Wpedantic}, and can be disabled with
7396 @option{-Wno-overlength-strings}.
7398 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
7399 @opindex Wunsuffixed-float-constants
7400 @opindex Wno-unsuffixed-float-constants
7402 Issue a warning for any floating constant that does not have
7403 a suffix.  When used together with @option{-Wsystem-headers} it
7404 warns about such constants in system header files.  This can be useful
7405 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
7406 from the decimal floating-point extension to C99.
7408 @item -Wno-designated-init @r{(C and Objective-C only)}
7409 Suppress warnings when a positional initializer is used to initialize
7410 a structure that has been marked with the @code{designated_init}
7411 attribute.
7413 @item -Whsa
7414 Issue a warning when HSAIL cannot be emitted for the compiled function or
7415 OpenMP construct.
7417 @end table
7419 @node Debugging Options
7420 @section Options for Debugging Your Program
7421 @cindex options, debugging
7422 @cindex debugging information options
7424 To tell GCC to emit extra information for use by a debugger, in almost 
7425 all cases you need only to add @option{-g} to your other options.
7427 GCC allows you to use @option{-g} with
7428 @option{-O}.  The shortcuts taken by optimized code may occasionally
7429 be surprising: some variables you declared may not exist
7430 at all; flow of control may briefly move where you did not expect it;
7431 some statements may not be executed because they compute constant
7432 results or their values are already at hand; some statements may
7433 execute in different places because they have been moved out of loops.
7434 Nevertheless it is possible to debug optimized output.  This makes
7435 it reasonable to use the optimizer for programs that might have bugs.
7437 If you are not using some other optimization option, consider
7438 using @option{-Og} (@pxref{Optimize Options}) with @option{-g}.  
7439 With no @option{-O} option at all, some compiler passes that collect
7440 information useful for debugging do not run at all, so that
7441 @option{-Og} may result in a better debugging experience.
7443 @table @gcctabopt
7444 @item -g
7445 @opindex g
7446 Produce debugging information in the operating system's native format
7447 (stabs, COFF, XCOFF, or DWARF)@.  GDB can work with this debugging
7448 information.
7450 On most systems that use stabs format, @option{-g} enables use of extra
7451 debugging information that only GDB can use; this extra information
7452 makes debugging work better in GDB but probably makes other debuggers
7453 crash or
7454 refuse to read the program.  If you want to control for certain whether
7455 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
7456 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
7458 @item -ggdb
7459 @opindex ggdb
7460 Produce debugging information for use by GDB@.  This means to use the
7461 most expressive format available (DWARF, stabs, or the native format
7462 if neither of those are supported), including GDB extensions if at all
7463 possible.
7465 @item -gdwarf
7466 @itemx -gdwarf-@var{version}
7467 @opindex gdwarf
7468 Produce debugging information in DWARF format (if that is supported).
7469 The value of @var{version} may be either 2, 3, 4 or 5; the default version
7470 for most targets is 4.  DWARF Version 5 is only experimental.
7472 Note that with DWARF Version 2, some ports require and always
7473 use some non-conflicting DWARF 3 extensions in the unwind tables.
7475 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
7476 for maximum benefit.
7478 GCC no longer supports DWARF Version 1, which is substantially
7479 different than Version 2 and later.  For historical reasons, some
7480 other DWARF-related options such as
7481 @option{-fno-dwarf2-cfi-asm}) retain a reference to DWARF Version 2
7482 in their names, but apply to all currently-supported versions of DWARF.
7484 @item -gstabs
7485 @opindex gstabs
7486 Produce debugging information in stabs format (if that is supported),
7487 without GDB extensions.  This is the format used by DBX on most BSD
7488 systems.  On MIPS, Alpha and System V Release 4 systems this option
7489 produces stabs debugging output that is not understood by DBX@.
7490 On System V Release 4 systems this option requires the GNU assembler.
7492 @item -gstabs+
7493 @opindex gstabs+
7494 Produce debugging information in stabs format (if that is supported),
7495 using GNU extensions understood only by the GNU debugger (GDB)@.  The
7496 use of these extensions is likely to make other debuggers crash or
7497 refuse to read the program.
7499 @item -gxcoff
7500 @opindex gxcoff
7501 Produce debugging information in XCOFF format (if that is supported).
7502 This is the format used by the DBX debugger on IBM RS/6000 systems.
7504 @item -gxcoff+
7505 @opindex gxcoff+
7506 Produce debugging information in XCOFF format (if that is supported),
7507 using GNU extensions understood only by the GNU debugger (GDB)@.  The
7508 use of these extensions is likely to make other debuggers crash or
7509 refuse to read the program, and may cause assemblers other than the GNU
7510 assembler (GAS) to fail with an error.
7512 @item -gvms
7513 @opindex gvms
7514 Produce debugging information in Alpha/VMS debug format (if that is
7515 supported).  This is the format used by DEBUG on Alpha/VMS systems.
7517 @item -g@var{level}
7518 @itemx -ggdb@var{level}
7519 @itemx -gstabs@var{level}
7520 @itemx -gxcoff@var{level}
7521 @itemx -gvms@var{level}
7522 Request debugging information and also use @var{level} to specify how
7523 much information.  The default level is 2.
7525 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
7526 @option{-g}.
7528 Level 1 produces minimal information, enough for making backtraces in
7529 parts of the program that you don't plan to debug.  This includes
7530 descriptions of functions and external variables, and line number
7531 tables, but no information about local variables.
7533 Level 3 includes extra information, such as all the macro definitions
7534 present in the program.  Some debuggers support macro expansion when
7535 you use @option{-g3}.
7537 @option{-gdwarf} does not accept a concatenated debug level, to avoid
7538 confusion with @option{-gdwarf-@var{level}}.
7539 Instead use an additional @option{-g@var{level}} option to change the
7540 debug level for DWARF.
7542 @item -feliminate-unused-debug-symbols
7543 @opindex feliminate-unused-debug-symbols
7544 Produce debugging information in stabs format (if that is supported),
7545 for only symbols that are actually used.
7547 @item -femit-class-debug-always
7548 @opindex femit-class-debug-always
7549 Instead of emitting debugging information for a C++ class in only one
7550 object file, emit it in all object files using the class.  This option
7551 should be used only with debuggers that are unable to handle the way GCC
7552 normally emits debugging information for classes because using this
7553 option increases the size of debugging information by as much as a
7554 factor of two.
7556 @item -fno-merge-debug-strings
7557 @opindex fmerge-debug-strings
7558 @opindex fno-merge-debug-strings
7559 Direct the linker to not merge together strings in the debugging
7560 information that are identical in different object files.  Merging is
7561 not supported by all assemblers or linkers.  Merging decreases the size
7562 of the debug information in the output file at the cost of increasing
7563 link processing time.  Merging is enabled by default.
7565 @item -fdebug-prefix-map=@var{old}=@var{new}
7566 @opindex fdebug-prefix-map
7567 When compiling files residing in directory @file{@var{old}}, record
7568 debugging information describing them as if the files resided in
7569 directory @file{@var{new}} instead.  This can be used to replace a
7570 build-time path with an install-time path in the debug info.  It can
7571 also be used to change an absolute path to a relative path by using
7572 @file{.} for @var{new}.  This can give more reproducible builds, which
7573 are location independent, but may require an extra command to tell GDB
7574 where to find the source files. See also @option{-ffile-prefix-map}.
7576 @item -fvar-tracking
7577 @opindex fvar-tracking
7578 Run variable tracking pass.  It computes where variables are stored at each
7579 position in code.  Better debugging information is then generated
7580 (if the debugging information format supports this information).
7582 It is enabled by default when compiling with optimization (@option{-Os},
7583 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
7584 the debug info format supports it.
7586 @item -fvar-tracking-assignments
7587 @opindex fvar-tracking-assignments
7588 @opindex fno-var-tracking-assignments
7589 Annotate assignments to user variables early in the compilation and
7590 attempt to carry the annotations over throughout the compilation all the
7591 way to the end, in an attempt to improve debug information while
7592 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
7594 It can be enabled even if var-tracking is disabled, in which case
7595 annotations are created and maintained, but discarded at the end.
7596 By default, this flag is enabled together with @option{-fvar-tracking},
7597 except when selective scheduling is enabled.
7599 @item -gsplit-dwarf
7600 @opindex gsplit-dwarf
7601 Separate as much DWARF debugging information as possible into a
7602 separate output file with the extension @file{.dwo}.  This option allows
7603 the build system to avoid linking files with debug information.  To
7604 be useful, this option requires a debugger capable of reading @file{.dwo}
7605 files.
7607 @item -gdescribe-dies
7608 @opindex gdescribe-dies
7609 Add description attributes to some DWARF DIEs that have no name attribute,
7610 such as artificial variables, external references and call site
7611 parameter DIEs.
7613 @item -gpubnames
7614 @opindex gpubnames
7615 Generate DWARF @code{.debug_pubnames} and @code{.debug_pubtypes} sections.
7617 @item -ggnu-pubnames
7618 @opindex ggnu-pubnames
7619 Generate @code{.debug_pubnames} and @code{.debug_pubtypes} sections in a format
7620 suitable for conversion into a GDB@ index.  This option is only useful
7621 with a linker that can produce GDB@ index version 7.
7623 @item -fdebug-types-section
7624 @opindex fdebug-types-section
7625 @opindex fno-debug-types-section
7626 When using DWARF Version 4 or higher, type DIEs can be put into
7627 their own @code{.debug_types} section instead of making them part of the
7628 @code{.debug_info} section.  It is more efficient to put them in a separate
7629 comdat section since the linker can then remove duplicates.
7630 But not all DWARF consumers support @code{.debug_types} sections yet
7631 and on some objects @code{.debug_types} produces larger instead of smaller
7632 debugging information.
7634 @item -grecord-gcc-switches
7635 @itemx -gno-record-gcc-switches
7636 @opindex grecord-gcc-switches
7637 @opindex gno-record-gcc-switches
7638 This switch causes the command-line options used to invoke the
7639 compiler that may affect code generation to be appended to the
7640 DW_AT_producer attribute in DWARF debugging information.  The options
7641 are concatenated with spaces separating them from each other and from
7642 the compiler version.  
7643 It is enabled by default.
7644 See also @option{-frecord-gcc-switches} for another
7645 way of storing compiler options into the object file.  
7647 @item -gstrict-dwarf
7648 @opindex gstrict-dwarf
7649 Disallow using extensions of later DWARF standard version than selected
7650 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
7651 DWARF extensions from later standard versions is allowed.
7653 @item -gno-strict-dwarf
7654 @opindex gno-strict-dwarf
7655 Allow using extensions of later DWARF standard version than selected with
7656 @option{-gdwarf-@var{version}}.
7658 @item -gas-loc-support
7659 @opindex gas-loc-support
7660 Inform the compiler that the assembler supports @code{.loc} directives.
7661 It may then use them for the assembler to generate DWARF2+ line number
7662 tables.
7664 This is generally desirable, because assembler-generated line-number
7665 tables are a lot more compact than those the compiler can generate
7666 itself.
7668 This option will be enabled by default if, at GCC configure time, the
7669 assembler was found to support such directives.
7671 @item -gno-as-loc-support
7672 @opindex gno-as-loc-support
7673 Force GCC to generate DWARF2+ line number tables internally, if DWARF2+
7674 line number tables are to be generated.
7676 @item gas-locview-support
7677 @opindex gas-locview-support
7678 Inform the compiler that the assembler supports @code{view} assignment
7679 and reset assertion checking in @code{.loc} directives.
7681 This option will be enabled by default if, at GCC configure time, the
7682 assembler was found to support them.
7684 @item gno-as-locview-support
7685 Force GCC to assign view numbers internally, if
7686 @option{-gvariable-location-views} are explicitly requested.
7688 @item -gcolumn-info
7689 @itemx -gno-column-info
7690 @opindex gcolumn-info
7691 @opindex gno-column-info
7692 Emit location column information into DWARF debugging information, rather
7693 than just file and line.
7694 This option is enabled by default.
7696 @item -gstatement-frontiers
7697 @itemx -gno-statement-frontiers
7698 @opindex gstatement-frontiers
7699 @opindex gno-statement-frontiers
7700 This option causes GCC to create markers in the internal representation
7701 at the beginning of statements, and to keep them roughly in place
7702 throughout compilation, using them to guide the output of @code{is_stmt}
7703 markers in the line number table.  This is enabled by default when
7704 compiling with optimization (@option{-Os}, @option{-O}, @option{-O2},
7705 @dots{}), and outputting DWARF 2 debug information at the normal level.
7707 @item -gvariable-location-views
7708 @itemx -gvariable-location-views=incompat5
7709 @itemx -gno-variable-location-views
7710 @opindex gvariable-location-views
7711 @opindex gvariable-location-views=incompat5
7712 @opindex gno-variable-location-views
7713 Augment variable location lists with progressive view numbers implied
7714 from the line number table.  This enables debug information consumers to
7715 inspect state at certain points of the program, even if no instructions
7716 associated with the corresponding source locations are present at that
7717 point.  If the assembler lacks support for view numbers in line number
7718 tables, this will cause the compiler to emit the line number table,
7719 which generally makes them somewhat less compact.  The augmented line
7720 number tables and location lists are fully backward-compatible, so they
7721 can be consumed by debug information consumers that are not aware of
7722 these augmentations, but they won't derive any benefit from them either.
7724 This is enabled by default when outputting DWARF 2 debug information at
7725 the normal level, as long as there is assembler support,
7726 @option{-fvar-tracking-assignments} is enabled and
7727 @option{-gstrict-dwarf} is not.  When assembler support is not
7728 available, this may still be enabled, but it will force GCC to output
7729 internal line number tables, and if
7730 @option{-ginternal-reset-location-views} is not enabled, that will most
7731 certainly lead to silently mismatching location views.
7733 There is a proposed representation for view numbers that is not backward
7734 compatible with the location list format introduced in DWARF 5, that can
7735 be enabled with @option{-gvariable-location-views=incompat5}.  This
7736 option may be removed in the future, is only provided as a reference
7737 implementation of the proposed representation.  Debug information
7738 consumers are not expected to support this extended format, and they
7739 would be rendered unable to decode location lists using it.
7741 @item -ginternal-reset-location-views
7742 @itemx -gnointernal-reset-location-views
7743 @opindex ginternal-reset-location-views
7744 @opindex gno-internal-reset-location-views
7745 Attempt to determine location views that can be omitted from location
7746 view lists.  This requires the compiler to have very accurate insn
7747 length estimates, which isn't always the case, and it may cause
7748 incorrect view lists to be generated silently when using an assembler
7749 that does not support location view lists.  The GNU assembler will flag
7750 any such error as a @code{view number mismatch}.  This is only enabled
7751 on ports that define a reliable estimation function.
7753 @item -ginline-points
7754 @itemx -gno-inline-points
7755 @opindex ginline-points
7756 @opindex gno-inline-points
7757 Generate extended debug information for inlined functions.  Location
7758 view tracking markers are inserted at inlined entry points, so that
7759 address and view numbers can be computed and output in debug
7760 information.  This can be enabled independently of location views, in
7761 which case the view numbers won't be output, but it can only be enabled
7762 along with statement frontiers, and it is only enabled by default if
7763 location views are enabled.
7765 @item -gz@r{[}=@var{type}@r{]}
7766 @opindex gz
7767 Produce compressed debug sections in DWARF format, if that is supported.
7768 If @var{type} is not given, the default type depends on the capabilities
7769 of the assembler and linker used.  @var{type} may be one of
7770 @samp{none} (don't compress debug sections), @samp{zlib} (use zlib
7771 compression in ELF gABI format), or @samp{zlib-gnu} (use zlib
7772 compression in traditional GNU format).  If the linker doesn't support
7773 writing compressed debug sections, the option is rejected.  Otherwise,
7774 if the assembler does not support them, @option{-gz} is silently ignored
7775 when producing object files.
7777 @item -femit-struct-debug-baseonly
7778 @opindex femit-struct-debug-baseonly
7779 Emit debug information for struct-like types
7780 only when the base name of the compilation source file
7781 matches the base name of file in which the struct is defined.
7783 This option substantially reduces the size of debugging information,
7784 but at significant potential loss in type information to the debugger.
7785 See @option{-femit-struct-debug-reduced} for a less aggressive option.
7786 See @option{-femit-struct-debug-detailed} for more detailed control.
7788 This option works only with DWARF debug output.
7790 @item -femit-struct-debug-reduced
7791 @opindex femit-struct-debug-reduced
7792 Emit debug information for struct-like types
7793 only when the base name of the compilation source file
7794 matches the base name of file in which the type is defined,
7795 unless the struct is a template or defined in a system header.
7797 This option significantly reduces the size of debugging information,
7798 with some potential loss in type information to the debugger.
7799 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
7800 See @option{-femit-struct-debug-detailed} for more detailed control.
7802 This option works only with DWARF debug output.
7804 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
7805 @opindex femit-struct-debug-detailed
7806 Specify the struct-like types
7807 for which the compiler generates debug information.
7808 The intent is to reduce duplicate struct debug information
7809 between different object files within the same program.
7811 This option is a detailed version of
7812 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
7813 which serves for most needs.
7815 A specification has the syntax@*
7816 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
7818 The optional first word limits the specification to
7819 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
7820 A struct type is used directly when it is the type of a variable, member.
7821 Indirect uses arise through pointers to structs.
7822 That is, when use of an incomplete struct is valid, the use is indirect.
7823 An example is
7824 @samp{struct one direct; struct two * indirect;}.
7826 The optional second word limits the specification to
7827 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
7828 Generic structs are a bit complicated to explain.
7829 For C++, these are non-explicit specializations of template classes,
7830 or non-template classes within the above.
7831 Other programming languages have generics,
7832 but @option{-femit-struct-debug-detailed} does not yet implement them.
7834 The third word specifies the source files for those
7835 structs for which the compiler should emit debug information.
7836 The values @samp{none} and @samp{any} have the normal meaning.
7837 The value @samp{base} means that
7838 the base of name of the file in which the type declaration appears
7839 must match the base of the name of the main compilation file.
7840 In practice, this means that when compiling @file{foo.c}, debug information
7841 is generated for types declared in that file and @file{foo.h},
7842 but not other header files.
7843 The value @samp{sys} means those types satisfying @samp{base}
7844 or declared in system or compiler headers.
7846 You may need to experiment to determine the best settings for your application.
7848 The default is @option{-femit-struct-debug-detailed=all}.
7850 This option works only with DWARF debug output.
7852 @item -fno-dwarf2-cfi-asm
7853 @opindex fdwarf2-cfi-asm
7854 @opindex fno-dwarf2-cfi-asm
7855 Emit DWARF unwind info as compiler generated @code{.eh_frame} section
7856 instead of using GAS @code{.cfi_*} directives.
7858 @item -fno-eliminate-unused-debug-types
7859 @opindex feliminate-unused-debug-types
7860 @opindex fno-eliminate-unused-debug-types
7861 Normally, when producing DWARF output, GCC avoids producing debug symbol 
7862 output for types that are nowhere used in the source file being compiled.
7863 Sometimes it is useful to have GCC emit debugging
7864 information for all types declared in a compilation
7865 unit, regardless of whether or not they are actually used
7866 in that compilation unit, for example 
7867 if, in the debugger, you want to cast a value to a type that is
7868 not actually used in your program (but is declared).  More often,
7869 however, this results in a significant amount of wasted space.
7870 @end table
7872 @node Optimize Options
7873 @section Options That Control Optimization
7874 @cindex optimize options
7875 @cindex options, optimization
7877 These options control various sorts of optimizations.
7879 Without any optimization option, the compiler's goal is to reduce the
7880 cost of compilation and to make debugging produce the expected
7881 results.  Statements are independent: if you stop the program with a
7882 breakpoint between statements, you can then assign a new value to any
7883 variable or change the program counter to any other statement in the
7884 function and get exactly the results you expect from the source
7885 code.
7887 Turning on optimization flags makes the compiler attempt to improve
7888 the performance and/or code size at the expense of compilation time
7889 and possibly the ability to debug the program.
7891 The compiler performs optimization based on the knowledge it has of the
7892 program.  Compiling multiple files at once to a single output file mode allows
7893 the compiler to use information gained from all of the files when compiling
7894 each of them.
7896 Not all optimizations are controlled directly by a flag.  Only
7897 optimizations that have a flag are listed in this section.
7899 Most optimizations are only enabled if an @option{-O} level is set on
7900 the command line.  Otherwise they are disabled, even if individual
7901 optimization flags are specified.
7903 Depending on the target and how GCC was configured, a slightly different
7904 set of optimizations may be enabled at each @option{-O} level than
7905 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
7906 to find out the exact set of optimizations that are enabled at each level.
7907 @xref{Overall Options}, for examples.
7909 @table @gcctabopt
7910 @item -O
7911 @itemx -O1
7912 @opindex O
7913 @opindex O1
7914 Optimize.  Optimizing compilation takes somewhat more time, and a lot
7915 more memory for a large function.
7917 With @option{-O}, the compiler tries to reduce code size and execution
7918 time, without performing any optimizations that take a great deal of
7919 compilation time.
7921 @option{-O} turns on the following optimization flags:
7922 @gccoptlist{
7923 -fauto-inc-dec @gol
7924 -fbranch-count-reg @gol
7925 -fcombine-stack-adjustments @gol
7926 -fcompare-elim @gol
7927 -fcprop-registers @gol
7928 -fdce @gol
7929 -fdefer-pop @gol
7930 -fdelayed-branch @gol
7931 -fdse @gol
7932 -fforward-propagate @gol
7933 -fguess-branch-probability @gol
7934 -fif-conversion2 @gol
7935 -fif-conversion @gol
7936 -finline-functions-called-once @gol
7937 -fipa-pure-const @gol
7938 -fipa-profile @gol
7939 -fipa-reference @gol
7940 -fipa-reference-addressable @gol
7941 -fmerge-constants @gol
7942 -fmove-loop-invariants @gol
7943 -fomit-frame-pointer @gol
7944 -freorder-blocks @gol
7945 -fshrink-wrap @gol
7946 -fshrink-wrap-separate @gol
7947 -fsplit-wide-types @gol
7948 -fssa-backprop @gol
7949 -fssa-phiopt @gol
7950 -ftree-bit-ccp @gol
7951 -ftree-ccp @gol
7952 -ftree-ch @gol
7953 -ftree-coalesce-vars @gol
7954 -ftree-copy-prop @gol
7955 -ftree-dce @gol
7956 -ftree-dominator-opts @gol
7957 -ftree-dse @gol
7958 -ftree-forwprop @gol
7959 -ftree-fre @gol
7960 -ftree-phiprop @gol
7961 -ftree-scev-cprop @gol
7962 -ftree-sink @gol
7963 -ftree-slsr @gol
7964 -ftree-sra @gol
7965 -ftree-pta @gol
7966 -ftree-ter @gol
7967 -funit-at-a-time}
7969 @item -O2
7970 @opindex O2
7971 Optimize even more.  GCC performs nearly all supported optimizations
7972 that do not involve a space-speed tradeoff.
7973 As compared to @option{-O}, this option increases both compilation time
7974 and the performance of the generated code.
7976 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
7977 also turns on the following optimization flags:
7978 @gccoptlist{-fthread-jumps @gol
7979 -falign-functions  -falign-jumps @gol
7980 -falign-loops  -falign-labels @gol
7981 -fcaller-saves @gol
7982 -fcrossjumping @gol
7983 -fcse-follow-jumps  -fcse-skip-blocks @gol
7984 -fdelete-null-pointer-checks @gol
7985 -fdevirtualize -fdevirtualize-speculatively @gol
7986 -fexpensive-optimizations @gol
7987 -fgcse  -fgcse-lm  @gol
7988 -fhoist-adjacent-loads @gol
7989 -finline-small-functions @gol
7990 -findirect-inlining @gol
7991 -fipa-cp @gol
7992 -fipa-bit-cp @gol
7993 -fipa-vrp @gol
7994 -fipa-sra @gol
7995 -fipa-icf @gol
7996 -fisolate-erroneous-paths-dereference @gol
7997 -flra-remat @gol
7998 -foptimize-sibling-calls @gol
7999 -foptimize-strlen @gol
8000 -fpartial-inlining @gol
8001 -fpeephole2 @gol
8002 -freorder-blocks-algorithm=stc @gol
8003 -freorder-blocks-and-partition -freorder-functions @gol
8004 -frerun-cse-after-loop  @gol
8005 -fsched-interblock  -fsched-spec @gol
8006 -fschedule-insns  -fschedule-insns2 @gol
8007 -fstore-merging @gol
8008 -fstrict-aliasing @gol
8009 -ftree-builtin-call-dce @gol
8010 -ftree-switch-conversion -ftree-tail-merge @gol
8011 -fcode-hoisting @gol
8012 -ftree-pre @gol
8013 -ftree-vrp @gol
8014 -fipa-ra}
8016 Please note the warning under @option{-fgcse} about
8017 invoking @option{-O2} on programs that use computed gotos.
8019 @item -O3
8020 @opindex O3
8021 Optimize yet more.  @option{-O3} turns on all optimizations specified
8022 by @option{-O2} and also turns on the following optimization flags:
8023 @gccoptlist{-finline-functions @gol
8024 -funswitch-loops @gol
8025 -fpredictive-commoning @gol
8026 -fgcse-after-reload @gol
8027 -ftree-loop-vectorize @gol
8028 -ftree-loop-distribution @gol
8029 -ftree-loop-distribute-patterns @gol
8030 -floop-interchange @gol
8031 -floop-unroll-and-jam @gol
8032 -fsplit-paths @gol
8033 -ftree-slp-vectorize @gol
8034 -fvect-cost-model @gol
8035 -ftree-partial-pre @gol
8036 -fpeel-loops @gol
8037 -fipa-cp-clone}
8039 @item -O0
8040 @opindex O0
8041 Reduce compilation time and make debugging produce the expected
8042 results.  This is the default.
8044 @item -Os
8045 @opindex Os
8046 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
8047 do not typically increase code size.  It also performs further
8048 optimizations designed to reduce code size.
8050 @option{-Os} disables the following optimization flags:
8051 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
8052 -falign-labels  -fprefetch-loop-arrays}
8054 @item -Ofast
8055 @opindex Ofast
8056 Disregard strict standards compliance.  @option{-Ofast} enables all
8057 @option{-O3} optimizations.  It also enables optimizations that are not
8058 valid for all standard-compliant programs.
8059 It turns on @option{-ffast-math} and the Fortran-specific
8060 @option{-fstack-arrays}, unless @option{-fmax-stack-var-size} is
8061 specified, and @option{-fno-protect-parens}.
8063 @item -Og
8064 @opindex Og
8065 Optimize debugging experience.  @option{-Og} enables optimizations
8066 that do not interfere with debugging. It should be the optimization
8067 level of choice for the standard edit-compile-debug cycle, offering
8068 a reasonable level of optimization while maintaining fast compilation
8069 and a good debugging experience.
8070 @end table
8072 If you use multiple @option{-O} options, with or without level numbers,
8073 the last such option is the one that is effective.
8075 Options of the form @option{-f@var{flag}} specify machine-independent
8076 flags.  Most flags have both positive and negative forms; the negative
8077 form of @option{-ffoo} is @option{-fno-foo}.  In the table
8078 below, only one of the forms is listed---the one you typically 
8079 use.  You can figure out the other form by either removing @samp{no-}
8080 or adding it.
8082 The following options control specific optimizations.  They are either
8083 activated by @option{-O} options or are related to ones that are.  You
8084 can use the following flags in the rare cases when ``fine-tuning'' of
8085 optimizations to be performed is desired.
8087 @table @gcctabopt
8088 @item -fno-defer-pop
8089 @opindex fno-defer-pop
8090 @opindex fdefer-pop
8091 For machines that must pop arguments after a function call, always pop 
8092 the arguments as soon as each function returns.  
8093 At levels @option{-O1} and higher, @option{-fdefer-pop} is the default;
8094 this allows the compiler to let arguments accumulate on the stack for several
8095 function calls and pop them all at once.
8097 @item -fforward-propagate
8098 @opindex fforward-propagate
8099 Perform a forward propagation pass on RTL@.  The pass tries to combine two
8100 instructions and checks if the result can be simplified.  If loop unrolling
8101 is active, two passes are performed and the second is scheduled after
8102 loop unrolling.
8104 This option is enabled by default at optimization levels @option{-O},
8105 @option{-O2}, @option{-O3}, @option{-Os}.
8107 @item -ffp-contract=@var{style}
8108 @opindex ffp-contract
8109 @option{-ffp-contract=off} disables floating-point expression contraction.
8110 @option{-ffp-contract=fast} enables floating-point expression contraction
8111 such as forming of fused multiply-add operations if the target has
8112 native support for them.
8113 @option{-ffp-contract=on} enables floating-point expression contraction
8114 if allowed by the language standard.  This is currently not implemented
8115 and treated equal to @option{-ffp-contract=off}.
8117 The default is @option{-ffp-contract=fast}.
8119 @item -fomit-frame-pointer
8120 @opindex fomit-frame-pointer
8121 Omit the frame pointer in functions that don't need one.  This avoids the
8122 instructions to save, set up and restore the frame pointer; on many targets
8123 it also makes an extra register available.
8125 On some targets this flag has no effect because the standard calling sequence
8126 always uses a frame pointer, so it cannot be omitted.
8128 Note that @option{-fno-omit-frame-pointer} doesn't guarantee the frame pointer
8129 is used in all functions.  Several targets always omit the frame pointer in
8130 leaf functions.
8132 Enabled by default at @option{-O} and higher.
8134 @item -foptimize-sibling-calls
8135 @opindex foptimize-sibling-calls
8136 Optimize sibling and tail recursive calls.
8138 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8140 @item -foptimize-strlen
8141 @opindex foptimize-strlen
8142 Optimize various standard C string functions (e.g.@: @code{strlen},
8143 @code{strchr} or @code{strcpy}) and
8144 their @code{_FORTIFY_SOURCE} counterparts into faster alternatives.
8146 Enabled at levels @option{-O2}, @option{-O3}.
8148 @item -fno-inline
8149 @opindex fno-inline
8150 @opindex finline
8151 Do not expand any functions inline apart from those marked with
8152 the @code{always_inline} attribute.  This is the default when not
8153 optimizing.
8155 Single functions can be exempted from inlining by marking them
8156 with the @code{noinline} attribute.
8158 @item -finline-small-functions
8159 @opindex finline-small-functions
8160 Integrate functions into their callers when their body is smaller than expected
8161 function call code (so overall size of program gets smaller).  The compiler
8162 heuristically decides which functions are simple enough to be worth integrating
8163 in this way.  This inlining applies to all functions, even those not declared
8164 inline.
8166 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8168 @item -findirect-inlining
8169 @opindex findirect-inlining
8170 Inline also indirect calls that are discovered to be known at compile
8171 time thanks to previous inlining.  This option has any effect only
8172 when inlining itself is turned on by the @option{-finline-functions}
8173 or @option{-finline-small-functions} options.
8175 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8177 @item -finline-functions
8178 @opindex finline-functions
8179 Consider all functions for inlining, even if they are not declared inline.
8180 The compiler heuristically decides which functions are worth integrating
8181 in this way.
8183 If all calls to a given function are integrated, and the function is
8184 declared @code{static}, then the function is normally not output as
8185 assembler code in its own right.
8187 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8189 @item -finline-functions-called-once
8190 @opindex finline-functions-called-once
8191 Consider all @code{static} functions called once for inlining into their
8192 caller even if they are not marked @code{inline}.  If a call to a given
8193 function is integrated, then the function is not output as assembler code
8194 in its own right.
8196 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
8198 @item -fearly-inlining
8199 @opindex fearly-inlining
8200 Inline functions marked by @code{always_inline} and functions whose body seems
8201 smaller than the function call overhead early before doing
8202 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
8203 makes profiling significantly cheaper and usually inlining faster on programs
8204 having large chains of nested wrapper functions.
8206 Enabled by default.
8208 @item -fipa-sra
8209 @opindex fipa-sra
8210 Perform interprocedural scalar replacement of aggregates, removal of
8211 unused parameters and replacement of parameters passed by reference
8212 by parameters passed by value.
8214 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
8216 @item -finline-limit=@var{n}
8217 @opindex finline-limit
8218 By default, GCC limits the size of functions that can be inlined.  This flag
8219 allows coarse control of this limit.  @var{n} is the size of functions that
8220 can be inlined in number of pseudo instructions.
8222 Inlining is actually controlled by a number of parameters, which may be
8223 specified individually by using @option{--param @var{name}=@var{value}}.
8224 The @option{-finline-limit=@var{n}} option sets some of these parameters
8225 as follows:
8227 @table @gcctabopt
8228 @item max-inline-insns-single
8229 is set to @var{n}/2.
8230 @item max-inline-insns-auto
8231 is set to @var{n}/2.
8232 @end table
8234 See below for a documentation of the individual
8235 parameters controlling inlining and for the defaults of these parameters.
8237 @emph{Note:} there may be no value to @option{-finline-limit} that results
8238 in default behavior.
8240 @emph{Note:} pseudo instruction represents, in this particular context, an
8241 abstract measurement of function's size.  In no way does it represent a count
8242 of assembly instructions and as such its exact meaning might change from one
8243 release to an another.
8245 @item -fno-keep-inline-dllexport
8246 @opindex fno-keep-inline-dllexport
8247 @opindex fkeep-inline-dllexport
8248 This is a more fine-grained version of @option{-fkeep-inline-functions},
8249 which applies only to functions that are declared using the @code{dllexport}
8250 attribute or declspec.  @xref{Function Attributes,,Declaring Attributes of
8251 Functions}.
8253 @item -fkeep-inline-functions
8254 @opindex fkeep-inline-functions
8255 In C, emit @code{static} functions that are declared @code{inline}
8256 into the object file, even if the function has been inlined into all
8257 of its callers.  This switch does not affect functions using the
8258 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
8259 inline functions into the object file.
8261 @item -fkeep-static-functions
8262 @opindex fkeep-static-functions
8263 Emit @code{static} functions into the object file, even if the function
8264 is never used.
8266 @item -fkeep-static-consts
8267 @opindex fkeep-static-consts
8268 Emit variables declared @code{static const} when optimization isn't turned
8269 on, even if the variables aren't referenced.
8271 GCC enables this option by default.  If you want to force the compiler to
8272 check if a variable is referenced, regardless of whether or not
8273 optimization is turned on, use the @option{-fno-keep-static-consts} option.
8275 @item -fmerge-constants
8276 @opindex fmerge-constants
8277 Attempt to merge identical constants (string constants and floating-point
8278 constants) across compilation units.
8280 This option is the default for optimized compilation if the assembler and
8281 linker support it.  Use @option{-fno-merge-constants} to inhibit this
8282 behavior.
8284 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8286 @item -fmerge-all-constants
8287 @opindex fmerge-all-constants
8288 Attempt to merge identical constants and identical variables.
8290 This option implies @option{-fmerge-constants}.  In addition to
8291 @option{-fmerge-constants} this considers e.g.@: even constant initialized
8292 arrays or initialized constant variables with integral or floating-point
8293 types.  Languages like C or C++ require each variable, including multiple
8294 instances of the same variable in recursive calls, to have distinct locations,
8295 so using this option results in non-conforming
8296 behavior.
8298 @item -fmodulo-sched
8299 @opindex fmodulo-sched
8300 Perform swing modulo scheduling immediately before the first scheduling
8301 pass.  This pass looks at innermost loops and reorders their
8302 instructions by overlapping different iterations.
8304 @item -fmodulo-sched-allow-regmoves
8305 @opindex fmodulo-sched-allow-regmoves
8306 Perform more aggressive SMS-based modulo scheduling with register moves
8307 allowed.  By setting this flag certain anti-dependences edges are
8308 deleted, which triggers the generation of reg-moves based on the
8309 life-range analysis.  This option is effective only with
8310 @option{-fmodulo-sched} enabled.
8312 @item -fno-branch-count-reg
8313 @opindex fno-branch-count-reg
8314 @opindex fbranch-count-reg
8315 Disable the optimization pass that scans for opportunities to use 
8316 ``decrement and branch'' instructions on a count register instead of
8317 instruction sequences that decrement a register, compare it against zero, and
8318 then branch based upon the result.  This option is only meaningful on
8319 architectures that support such instructions, which include x86, PowerPC,
8320 IA-64 and S/390.  Note that the @option{-fno-branch-count-reg} option
8321 doesn't remove the decrement and branch instructions from the generated
8322 instruction stream introduced by other optimization passes.
8324 The default is @option{-fbranch-count-reg} at @option{-O1} and higher.
8326 @item -fno-function-cse
8327 @opindex fno-function-cse
8328 @opindex ffunction-cse
8329 Do not put function addresses in registers; make each instruction that
8330 calls a constant function contain the function's address explicitly.
8332 This option results in less efficient code, but some strange hacks
8333 that alter the assembler output may be confused by the optimizations
8334 performed when this option is not used.
8336 The default is @option{-ffunction-cse}
8338 @item -fno-zero-initialized-in-bss
8339 @opindex fno-zero-initialized-in-bss
8340 @opindex fzero-initialized-in-bss
8341 If the target supports a BSS section, GCC by default puts variables that
8342 are initialized to zero into BSS@.  This can save space in the resulting
8343 code.
8345 This option turns off this behavior because some programs explicitly
8346 rely on variables going to the data section---e.g., so that the
8347 resulting executable can find the beginning of that section and/or make
8348 assumptions based on that.
8350 The default is @option{-fzero-initialized-in-bss}.
8352 @item -fthread-jumps
8353 @opindex fthread-jumps
8354 Perform optimizations that check to see if a jump branches to a
8355 location where another comparison subsumed by the first is found.  If
8356 so, the first branch is redirected to either the destination of the
8357 second branch or a point immediately following it, depending on whether
8358 the condition is known to be true or false.
8360 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8362 @item -fsplit-wide-types
8363 @opindex fsplit-wide-types
8364 When using a type that occupies multiple registers, such as @code{long
8365 long} on a 32-bit system, split the registers apart and allocate them
8366 independently.  This normally generates better code for those types,
8367 but may make debugging more difficult.
8369 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
8370 @option{-Os}.
8372 @item -fcse-follow-jumps
8373 @opindex fcse-follow-jumps
8374 In common subexpression elimination (CSE), scan through jump instructions
8375 when the target of the jump is not reached by any other path.  For
8376 example, when CSE encounters an @code{if} statement with an
8377 @code{else} clause, CSE follows the jump when the condition
8378 tested is false.
8380 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8382 @item -fcse-skip-blocks
8383 @opindex fcse-skip-blocks
8384 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
8385 follow jumps that conditionally skip over blocks.  When CSE
8386 encounters a simple @code{if} statement with no else clause,
8387 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
8388 body of the @code{if}.
8390 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8392 @item -frerun-cse-after-loop
8393 @opindex frerun-cse-after-loop
8394 Re-run common subexpression elimination after loop optimizations are
8395 performed.
8397 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8399 @item -fgcse
8400 @opindex fgcse
8401 Perform a global common subexpression elimination pass.
8402 This pass also performs global constant and copy propagation.
8404 @emph{Note:} When compiling a program using computed gotos, a GCC
8405 extension, you may get better run-time performance if you disable
8406 the global common subexpression elimination pass by adding
8407 @option{-fno-gcse} to the command line.
8409 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8411 @item -fgcse-lm
8412 @opindex fgcse-lm
8413 When @option{-fgcse-lm} is enabled, global common subexpression elimination
8414 attempts to move loads that are only killed by stores into themselves.  This
8415 allows a loop containing a load/store sequence to be changed to a load outside
8416 the loop, and a copy/store within the loop.
8418 Enabled by default when @option{-fgcse} is enabled.
8420 @item -fgcse-sm
8421 @opindex fgcse-sm
8422 When @option{-fgcse-sm} is enabled, a store motion pass is run after
8423 global common subexpression elimination.  This pass attempts to move
8424 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
8425 loops containing a load/store sequence can be changed to a load before
8426 the loop and a store after the loop.
8428 Not enabled at any optimization level.
8430 @item -fgcse-las
8431 @opindex fgcse-las
8432 When @option{-fgcse-las} is enabled, the global common subexpression
8433 elimination pass eliminates redundant loads that come after stores to the
8434 same memory location (both partial and full redundancies).
8436 Not enabled at any optimization level.
8438 @item -fgcse-after-reload
8439 @opindex fgcse-after-reload
8440 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
8441 pass is performed after reload.  The purpose of this pass is to clean up
8442 redundant spilling.
8444 @item -faggressive-loop-optimizations
8445 @opindex faggressive-loop-optimizations
8446 This option tells the loop optimizer to use language constraints to
8447 derive bounds for the number of iterations of a loop.  This assumes that
8448 loop code does not invoke undefined behavior by for example causing signed
8449 integer overflows or out-of-bound array accesses.  The bounds for the
8450 number of iterations of a loop are used to guide loop unrolling and peeling
8451 and loop exit test optimizations.
8452 This option is enabled by default.
8454 @item -funconstrained-commons
8455 @opindex funconstrained-commons
8456 This option tells the compiler that variables declared in common blocks
8457 (e.g.@: Fortran) may later be overridden with longer trailing arrays. This
8458 prevents certain optimizations that depend on knowing the array bounds.
8460 @item -fcrossjumping
8461 @opindex fcrossjumping
8462 Perform cross-jumping transformation.
8463 This transformation unifies equivalent code and saves code size.  The
8464 resulting code may or may not perform better than without cross-jumping.
8466 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8468 @item -fauto-inc-dec
8469 @opindex fauto-inc-dec
8470 Combine increments or decrements of addresses with memory accesses.
8471 This pass is always skipped on architectures that do not have
8472 instructions to support this.  Enabled by default at @option{-O} and
8473 higher on architectures that support this.
8475 @item -fdce
8476 @opindex fdce
8477 Perform dead code elimination (DCE) on RTL@.
8478 Enabled by default at @option{-O} and higher.
8480 @item -fdse
8481 @opindex fdse
8482 Perform dead store elimination (DSE) on RTL@.
8483 Enabled by default at @option{-O} and higher.
8485 @item -fif-conversion
8486 @opindex fif-conversion
8487 Attempt to transform conditional jumps into branch-less equivalents.  This
8488 includes use of conditional moves, min, max, set flags and abs instructions, and
8489 some tricks doable by standard arithmetics.  The use of conditional execution
8490 on chips where it is available is controlled by @option{-fif-conversion2}.
8492 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8494 @item -fif-conversion2
8495 @opindex fif-conversion2
8496 Use conditional execution (where available) to transform conditional jumps into
8497 branch-less equivalents.
8499 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8501 @item -fdeclone-ctor-dtor
8502 @opindex fdeclone-ctor-dtor
8503 The C++ ABI requires multiple entry points for constructors and
8504 destructors: one for a base subobject, one for a complete object, and
8505 one for a virtual destructor that calls operator delete afterwards.
8506 For a hierarchy with virtual bases, the base and complete variants are
8507 clones, which means two copies of the function.  With this option, the
8508 base and complete variants are changed to be thunks that call a common
8509 implementation.
8511 Enabled by @option{-Os}.
8513 @item -fdelete-null-pointer-checks
8514 @opindex fdelete-null-pointer-checks
8515 Assume that programs cannot safely dereference null pointers, and that
8516 no code or data element resides at address zero.
8517 This option enables simple constant
8518 folding optimizations at all optimization levels.  In addition, other
8519 optimization passes in GCC use this flag to control global dataflow
8520 analyses that eliminate useless checks for null pointers; these assume
8521 that a memory access to address zero always results in a trap, so
8522 that if a pointer is checked after it has already been dereferenced,
8523 it cannot be null.
8525 Note however that in some environments this assumption is not true.
8526 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
8527 for programs that depend on that behavior.
8529 This option is enabled by default on most targets.  On Nios II ELF, it
8530 defaults to off.  On AVR, CR16, and MSP430, this option is completely disabled.
8532 Passes that use the dataflow information
8533 are enabled independently at different optimization levels.
8535 @item -fdevirtualize
8536 @opindex fdevirtualize
8537 Attempt to convert calls to virtual functions to direct calls.  This
8538 is done both within a procedure and interprocedurally as part of
8539 indirect inlining (@option{-findirect-inlining}) and interprocedural constant
8540 propagation (@option{-fipa-cp}).
8541 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8543 @item -fdevirtualize-speculatively
8544 @opindex fdevirtualize-speculatively
8545 Attempt to convert calls to virtual functions to speculative direct calls.
8546 Based on the analysis of the type inheritance graph, determine for a given call
8547 the set of likely targets. If the set is small, preferably of size 1, change
8548 the call into a conditional deciding between direct and indirect calls.  The
8549 speculative calls enable more optimizations, such as inlining.  When they seem
8550 useless after further optimization, they are converted back into original form.
8552 @item -fdevirtualize-at-ltrans
8553 @opindex fdevirtualize-at-ltrans
8554 Stream extra information needed for aggressive devirtualization when running
8555 the link-time optimizer in local transformation mode.  
8556 This option enables more devirtualization but
8557 significantly increases the size of streamed data. For this reason it is
8558 disabled by default.
8560 @item -fexpensive-optimizations
8561 @opindex fexpensive-optimizations
8562 Perform a number of minor optimizations that are relatively expensive.
8564 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8566 @item -free
8567 @opindex free
8568 Attempt to remove redundant extension instructions.  This is especially
8569 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
8570 registers after writing to their lower 32-bit half.
8572 Enabled for Alpha, AArch64 and x86 at levels @option{-O2},
8573 @option{-O3}, @option{-Os}.
8575 @item -fno-lifetime-dse
8576 @opindex fno-lifetime-dse
8577 @opindex flifetime-dse
8578 In C++ the value of an object is only affected by changes within its
8579 lifetime: when the constructor begins, the object has an indeterminate
8580 value, and any changes during the lifetime of the object are dead when
8581 the object is destroyed.  Normally dead store elimination will take
8582 advantage of this; if your code relies on the value of the object
8583 storage persisting beyond the lifetime of the object, you can use this
8584 flag to disable this optimization.  To preserve stores before the
8585 constructor starts (e.g.@: because your operator new clears the object
8586 storage) but still treat the object as dead after the destructor you,
8587 can use @option{-flifetime-dse=1}.  The default behavior can be
8588 explicitly selected with @option{-flifetime-dse=2}.
8589 @option{-flifetime-dse=0} is equivalent to @option{-fno-lifetime-dse}.
8591 @item -flive-range-shrinkage
8592 @opindex flive-range-shrinkage
8593 Attempt to decrease register pressure through register live range
8594 shrinkage.  This is helpful for fast processors with small or moderate
8595 size register sets.
8597 @item -fira-algorithm=@var{algorithm}
8598 @opindex fira-algorithm
8599 Use the specified coloring algorithm for the integrated register
8600 allocator.  The @var{algorithm} argument can be @samp{priority}, which
8601 specifies Chow's priority coloring, or @samp{CB}, which specifies
8602 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
8603 for all architectures, but for those targets that do support it, it is
8604 the default because it generates better code.
8606 @item -fira-region=@var{region}
8607 @opindex fira-region
8608 Use specified regions for the integrated register allocator.  The
8609 @var{region} argument should be one of the following:
8611 @table @samp
8613 @item all
8614 Use all loops as register allocation regions.
8615 This can give the best results for machines with a small and/or
8616 irregular register set.
8618 @item mixed
8619 Use all loops except for loops with small register pressure 
8620 as the regions.  This value usually gives
8621 the best results in most cases and for most architectures,
8622 and is enabled by default when compiling with optimization for speed
8623 (@option{-O}, @option{-O2}, @dots{}).
8625 @item one
8626 Use all functions as a single region.  
8627 This typically results in the smallest code size, and is enabled by default for
8628 @option{-Os} or @option{-O0}.
8630 @end table
8632 @item -fira-hoist-pressure
8633 @opindex fira-hoist-pressure
8634 Use IRA to evaluate register pressure in the code hoisting pass for
8635 decisions to hoist expressions.  This option usually results in smaller
8636 code, but it can slow the compiler down.
8638 This option is enabled at level @option{-Os} for all targets.
8640 @item -fira-loop-pressure
8641 @opindex fira-loop-pressure
8642 Use IRA to evaluate register pressure in loops for decisions to move
8643 loop invariants.  This option usually results in generation
8644 of faster and smaller code on machines with large register files (>= 32
8645 registers), but it can slow the compiler down.
8647 This option is enabled at level @option{-O3} for some targets.
8649 @item -fno-ira-share-save-slots
8650 @opindex fno-ira-share-save-slots
8651 @opindex fira-share-save-slots
8652 Disable sharing of stack slots used for saving call-used hard
8653 registers living through a call.  Each hard register gets a
8654 separate stack slot, and as a result function stack frames are
8655 larger.
8657 @item -fno-ira-share-spill-slots
8658 @opindex fno-ira-share-spill-slots
8659 @opindex fira-share-spill-slots
8660 Disable sharing of stack slots allocated for pseudo-registers.  Each
8661 pseudo-register that does not get a hard register gets a separate
8662 stack slot, and as a result function stack frames are larger.
8664 @item -flra-remat
8665 @opindex flra-remat
8666 Enable CFG-sensitive rematerialization in LRA.  Instead of loading
8667 values of spilled pseudos, LRA tries to rematerialize (recalculate)
8668 values if it is profitable.
8670 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8672 @item -fdelayed-branch
8673 @opindex fdelayed-branch
8674 If supported for the target machine, attempt to reorder instructions
8675 to exploit instruction slots available after delayed branch
8676 instructions.
8678 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os},
8679 but not at @option{-Og}.
8681 @item -fschedule-insns
8682 @opindex fschedule-insns
8683 If supported for the target machine, attempt to reorder instructions to
8684 eliminate execution stalls due to required data being unavailable.  This
8685 helps machines that have slow floating point or memory load instructions
8686 by allowing other instructions to be issued until the result of the load
8687 or floating-point instruction is required.
8689 Enabled at levels @option{-O2}, @option{-O3}.
8691 @item -fschedule-insns2
8692 @opindex fschedule-insns2
8693 Similar to @option{-fschedule-insns}, but requests an additional pass of
8694 instruction scheduling after register allocation has been done.  This is
8695 especially useful on machines with a relatively small number of
8696 registers and where memory load instructions take more than one cycle.
8698 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8700 @item -fno-sched-interblock
8701 @opindex fno-sched-interblock
8702 @opindex fsched-interblock
8703 Disable instruction scheduling across basic blocks, which
8704 is normally enabled when scheduling before register allocation, i.e.@:
8705 with @option{-fschedule-insns} or at @option{-O2} or higher.
8707 @item -fno-sched-spec
8708 @opindex fno-sched-spec
8709 @opindex fsched-spec
8710 Disable speculative motion of non-load instructions, which
8711 is normally enabled when scheduling before register allocation, i.e.@:
8712 with @option{-fschedule-insns} or at @option{-O2} or higher.
8714 @item -fsched-pressure
8715 @opindex fsched-pressure
8716 Enable register pressure sensitive insn scheduling before register
8717 allocation.  This only makes sense when scheduling before register
8718 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
8719 @option{-O2} or higher.  Usage of this option can improve the
8720 generated code and decrease its size by preventing register pressure
8721 increase above the number of available hard registers and subsequent
8722 spills in register allocation.
8724 @item -fsched-spec-load
8725 @opindex fsched-spec-load
8726 Allow speculative motion of some load instructions.  This only makes
8727 sense when scheduling before register allocation, i.e.@: with
8728 @option{-fschedule-insns} or at @option{-O2} or higher.
8730 @item -fsched-spec-load-dangerous
8731 @opindex fsched-spec-load-dangerous
8732 Allow speculative motion of more load instructions.  This only makes
8733 sense when scheduling before register allocation, i.e.@: with
8734 @option{-fschedule-insns} or at @option{-O2} or higher.
8736 @item -fsched-stalled-insns
8737 @itemx -fsched-stalled-insns=@var{n}
8738 @opindex fsched-stalled-insns
8739 Define how many insns (if any) can be moved prematurely from the queue
8740 of stalled insns into the ready list during the second scheduling pass.
8741 @option{-fno-sched-stalled-insns} means that no insns are moved
8742 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
8743 on how many queued insns can be moved prematurely.
8744 @option{-fsched-stalled-insns} without a value is equivalent to
8745 @option{-fsched-stalled-insns=1}.
8747 @item -fsched-stalled-insns-dep
8748 @itemx -fsched-stalled-insns-dep=@var{n}
8749 @opindex fsched-stalled-insns-dep
8750 Define how many insn groups (cycles) are examined for a dependency
8751 on a stalled insn that is a candidate for premature removal from the queue
8752 of stalled insns.  This has an effect only during the second scheduling pass,
8753 and only if @option{-fsched-stalled-insns} is used.
8754 @option{-fno-sched-stalled-insns-dep} is equivalent to
8755 @option{-fsched-stalled-insns-dep=0}.
8756 @option{-fsched-stalled-insns-dep} without a value is equivalent to
8757 @option{-fsched-stalled-insns-dep=1}.
8759 @item -fsched2-use-superblocks
8760 @opindex fsched2-use-superblocks
8761 When scheduling after register allocation, use superblock scheduling.
8762 This allows motion across basic block boundaries,
8763 resulting in faster schedules.  This option is experimental, as not all machine
8764 descriptions used by GCC model the CPU closely enough to avoid unreliable
8765 results from the algorithm.
8767 This only makes sense when scheduling after register allocation, i.e.@: with
8768 @option{-fschedule-insns2} or at @option{-O2} or higher.
8770 @item -fsched-group-heuristic
8771 @opindex fsched-group-heuristic
8772 Enable the group heuristic in the scheduler.  This heuristic favors
8773 the instruction that belongs to a schedule group.  This is enabled
8774 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
8775 or @option{-fschedule-insns2} or at @option{-O2} or higher.
8777 @item -fsched-critical-path-heuristic
8778 @opindex fsched-critical-path-heuristic
8779 Enable the critical-path heuristic in the scheduler.  This heuristic favors
8780 instructions on the critical path.  This is enabled by default when
8781 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
8782 or @option{-fschedule-insns2} or at @option{-O2} or higher.
8784 @item -fsched-spec-insn-heuristic
8785 @opindex fsched-spec-insn-heuristic
8786 Enable the speculative instruction heuristic in the scheduler.  This
8787 heuristic favors speculative instructions with greater dependency weakness.
8788 This is enabled by default when scheduling is enabled, i.e.@:
8789 with @option{-fschedule-insns} or @option{-fschedule-insns2}
8790 or at @option{-O2} or higher.
8792 @item -fsched-rank-heuristic
8793 @opindex fsched-rank-heuristic
8794 Enable the rank heuristic in the scheduler.  This heuristic favors
8795 the instruction belonging to a basic block with greater size or frequency.
8796 This is enabled by default when scheduling is enabled, i.e.@:
8797 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8798 at @option{-O2} or higher.
8800 @item -fsched-last-insn-heuristic
8801 @opindex fsched-last-insn-heuristic
8802 Enable the last-instruction heuristic in the scheduler.  This heuristic
8803 favors the instruction that is less dependent on the last instruction
8804 scheduled.  This is enabled by default when scheduling is enabled,
8805 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8806 at @option{-O2} or higher.
8808 @item -fsched-dep-count-heuristic
8809 @opindex fsched-dep-count-heuristic
8810 Enable the dependent-count heuristic in the scheduler.  This heuristic
8811 favors the instruction that has more instructions depending on it.
8812 This is enabled by default when scheduling is enabled, i.e.@:
8813 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8814 at @option{-O2} or higher.
8816 @item -freschedule-modulo-scheduled-loops
8817 @opindex freschedule-modulo-scheduled-loops
8818 Modulo scheduling is performed before traditional scheduling.  If a loop
8819 is modulo scheduled, later scheduling passes may change its schedule.  
8820 Use this option to control that behavior.
8822 @item -fselective-scheduling
8823 @opindex fselective-scheduling
8824 Schedule instructions using selective scheduling algorithm.  Selective
8825 scheduling runs instead of the first scheduler pass.
8827 @item -fselective-scheduling2
8828 @opindex fselective-scheduling2
8829 Schedule instructions using selective scheduling algorithm.  Selective
8830 scheduling runs instead of the second scheduler pass.
8832 @item -fsel-sched-pipelining
8833 @opindex fsel-sched-pipelining
8834 Enable software pipelining of innermost loops during selective scheduling.
8835 This option has no effect unless one of @option{-fselective-scheduling} or
8836 @option{-fselective-scheduling2} is turned on.
8838 @item -fsel-sched-pipelining-outer-loops
8839 @opindex fsel-sched-pipelining-outer-loops
8840 When pipelining loops during selective scheduling, also pipeline outer loops.
8841 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
8843 @item -fsemantic-interposition
8844 @opindex fsemantic-interposition
8845 Some object formats, like ELF, allow interposing of symbols by the 
8846 dynamic linker.
8847 This means that for symbols exported from the DSO, the compiler cannot perform
8848 interprocedural propagation, inlining and other optimizations in anticipation
8849 that the function or variable in question may change. While this feature is
8850 useful, for example, to rewrite memory allocation functions by a debugging
8851 implementation, it is expensive in the terms of code quality.
8852 With @option{-fno-semantic-interposition} the compiler assumes that 
8853 if interposition happens for functions the overwriting function will have 
8854 precisely the same semantics (and side effects). 
8855 Similarly if interposition happens
8856 for variables, the constructor of the variable will be the same. The flag
8857 has no effect for functions explicitly declared inline 
8858 (where it is never allowed for interposition to change semantics) 
8859 and for symbols explicitly declared weak.
8861 @item -fshrink-wrap
8862 @opindex fshrink-wrap
8863 Emit function prologues only before parts of the function that need it,
8864 rather than at the top of the function.  This flag is enabled by default at
8865 @option{-O} and higher.
8867 @item -fshrink-wrap-separate
8868 @opindex fshrink-wrap-separate
8869 Shrink-wrap separate parts of the prologue and epilogue separately, so that
8870 those parts are only executed when needed.
8871 This option is on by default, but has no effect unless @option{-fshrink-wrap}
8872 is also turned on and the target supports this.
8874 @item -fcaller-saves
8875 @opindex fcaller-saves
8876 Enable allocation of values to registers that are clobbered by
8877 function calls, by emitting extra instructions to save and restore the
8878 registers around such calls.  Such allocation is done only when it
8879 seems to result in better code.
8881 This option is always enabled by default on certain machines, usually
8882 those which have no call-preserved registers to use instead.
8884 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8886 @item -fcombine-stack-adjustments
8887 @opindex fcombine-stack-adjustments
8888 Tracks stack adjustments (pushes and pops) and stack memory references
8889 and then tries to find ways to combine them.
8891 Enabled by default at @option{-O1} and higher.
8893 @item -fipa-ra
8894 @opindex fipa-ra
8895 Use caller save registers for allocation if those registers are not used by
8896 any called function.  In that case it is not necessary to save and restore
8897 them around calls.  This is only possible if called functions are part of
8898 same compilation unit as current function and they are compiled before it.
8900 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}, however the option
8901 is disabled if generated code will be instrumented for profiling
8902 (@option{-p}, or @option{-pg}) or if callee's register usage cannot be known
8903 exactly (this happens on targets that do not expose prologues
8904 and epilogues in RTL).
8906 @item -fconserve-stack
8907 @opindex fconserve-stack
8908 Attempt to minimize stack usage.  The compiler attempts to use less
8909 stack space, even if that makes the program slower.  This option
8910 implies setting the @option{large-stack-frame} parameter to 100
8911 and the @option{large-stack-frame-growth} parameter to 400.
8913 @item -ftree-reassoc
8914 @opindex ftree-reassoc
8915 Perform reassociation on trees.  This flag is enabled by default
8916 at @option{-O} and higher.
8918 @item -fcode-hoisting
8919 @opindex fcode-hoisting
8920 Perform code hoisting.  Code hoisting tries to move the
8921 evaluation of expressions executed on all paths to the function exit
8922 as early as possible.  This is especially useful as a code size
8923 optimization, but it often helps for code speed as well.
8924 This flag is enabled by default at @option{-O2} and higher.
8926 @item -ftree-pre
8927 @opindex ftree-pre
8928 Perform partial redundancy elimination (PRE) on trees.  This flag is
8929 enabled by default at @option{-O2} and @option{-O3}.
8931 @item -ftree-partial-pre
8932 @opindex ftree-partial-pre
8933 Make partial redundancy elimination (PRE) more aggressive.  This flag is
8934 enabled by default at @option{-O3}.
8936 @item -ftree-forwprop
8937 @opindex ftree-forwprop
8938 Perform forward propagation on trees.  This flag is enabled by default
8939 at @option{-O} and higher.
8941 @item -ftree-fre
8942 @opindex ftree-fre
8943 Perform full redundancy elimination (FRE) on trees.  The difference
8944 between FRE and PRE is that FRE only considers expressions
8945 that are computed on all paths leading to the redundant computation.
8946 This analysis is faster than PRE, though it exposes fewer redundancies.
8947 This flag is enabled by default at @option{-O} and higher.
8949 @item -ftree-phiprop
8950 @opindex ftree-phiprop
8951 Perform hoisting of loads from conditional pointers on trees.  This
8952 pass is enabled by default at @option{-O} and higher.
8954 @item -fhoist-adjacent-loads
8955 @opindex fhoist-adjacent-loads
8956 Speculatively hoist loads from both branches of an if-then-else if the
8957 loads are from adjacent locations in the same structure and the target
8958 architecture has a conditional move instruction.  This flag is enabled
8959 by default at @option{-O2} and higher.
8961 @item -ftree-copy-prop
8962 @opindex ftree-copy-prop
8963 Perform copy propagation on trees.  This pass eliminates unnecessary
8964 copy operations.  This flag is enabled by default at @option{-O} and
8965 higher.
8967 @item -fipa-pure-const
8968 @opindex fipa-pure-const
8969 Discover which functions are pure or constant.
8970 Enabled by default at @option{-O} and higher.
8972 @item -fipa-reference
8973 @opindex fipa-reference
8974 Discover which static variables do not escape the
8975 compilation unit.
8976 Enabled by default at @option{-O} and higher.
8978 @item -fipa-reference-addressable
8979 @opindex fipa-reference-addressable
8980 Discover read-only, write-only and non-addressable static variables.
8981 Enabled by default at @option{-O} and higher.
8983 @item -fipa-stack-alignment
8984 @opindex fipa-stack-alignment
8985 Reduce stack alignment on call sites if possible.
8986 Enabled by default.
8988 @item -fipa-pta
8989 @opindex fipa-pta
8990 Perform interprocedural pointer analysis and interprocedural modification
8991 and reference analysis.  This option can cause excessive memory and
8992 compile-time usage on large compilation units.  It is not enabled by
8993 default at any optimization level.
8995 @item -fipa-profile
8996 @opindex fipa-profile
8997 Perform interprocedural profile propagation.  The functions called only from
8998 cold functions are marked as cold. Also functions executed once (such as
8999 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
9000 functions and loop less parts of functions executed once are then optimized for
9001 size.
9002 Enabled by default at @option{-O} and higher.
9004 @item -fipa-cp
9005 @opindex fipa-cp
9006 Perform interprocedural constant propagation.
9007 This optimization analyzes the program to determine when values passed
9008 to functions are constants and then optimizes accordingly.
9009 This optimization can substantially increase performance
9010 if the application has constants passed to functions.
9011 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
9013 @item -fipa-cp-clone
9014 @opindex fipa-cp-clone
9015 Perform function cloning to make interprocedural constant propagation stronger.
9016 When enabled, interprocedural constant propagation performs function cloning
9017 when externally visible function can be called with constant arguments.
9018 Because this optimization can create multiple copies of functions,
9019 it may significantly increase code size
9020 (see @option{--param ipcp-unit-growth=@var{value}}).
9021 This flag is enabled by default at @option{-O3}.
9023 @item -fipa-bit-cp
9024 @opindex fipa-bit-cp
9025 When enabled, perform interprocedural bitwise constant
9026 propagation. This flag is enabled by default at @option{-O2}. It
9027 requires that @option{-fipa-cp} is enabled.
9029 @item -fipa-vrp
9030 @opindex fipa-vrp
9031 When enabled, perform interprocedural propagation of value
9032 ranges. This flag is enabled by default at @option{-O2}. It requires
9033 that @option{-fipa-cp} is enabled.
9035 @item -fipa-icf
9036 @opindex fipa-icf
9037 Perform Identical Code Folding for functions and read-only variables.
9038 The optimization reduces code size and may disturb unwind stacks by replacing
9039 a function by equivalent one with a different name. The optimization works
9040 more effectively with link-time optimization enabled.
9042 Nevertheless the behavior is similar to Gold Linker ICF optimization, GCC ICF
9043 works on different levels and thus the optimizations are not same - there are
9044 equivalences that are found only by GCC and equivalences found only by Gold.
9046 This flag is enabled by default at @option{-O2} and @option{-Os}.
9048 @item -fisolate-erroneous-paths-dereference
9049 @opindex fisolate-erroneous-paths-dereference
9050 Detect paths that trigger erroneous or undefined behavior due to
9051 dereferencing a null pointer.  Isolate those paths from the main control
9052 flow and turn the statement with erroneous or undefined behavior into a trap.
9053 This flag is enabled by default at @option{-O2} and higher and depends on
9054 @option{-fdelete-null-pointer-checks} also being enabled.
9056 @item -fisolate-erroneous-paths-attribute
9057 @opindex fisolate-erroneous-paths-attribute
9058 Detect paths that trigger erroneous or undefined behavior due to a null value
9059 being used in a way forbidden by a @code{returns_nonnull} or @code{nonnull}
9060 attribute.  Isolate those paths from the main control flow and turn the
9061 statement with erroneous or undefined behavior into a trap.  This is not
9062 currently enabled, but may be enabled by @option{-O2} in the future.
9064 @item -ftree-sink
9065 @opindex ftree-sink
9066 Perform forward store motion on trees.  This flag is
9067 enabled by default at @option{-O} and higher.
9069 @item -ftree-bit-ccp
9070 @opindex ftree-bit-ccp
9071 Perform sparse conditional bit constant propagation on trees and propagate
9072 pointer alignment information.
9073 This pass only operates on local scalar variables and is enabled by default
9074 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
9076 @item -ftree-ccp
9077 @opindex ftree-ccp
9078 Perform sparse conditional constant propagation (CCP) on trees.  This
9079 pass only operates on local scalar variables and is enabled by default
9080 at @option{-O} and higher.
9082 @item -fssa-backprop
9083 @opindex fssa-backprop
9084 Propagate information about uses of a value up the definition chain
9085 in order to simplify the definitions.  For example, this pass strips
9086 sign operations if the sign of a value never matters.  The flag is
9087 enabled by default at @option{-O} and higher.
9089 @item -fssa-phiopt
9090 @opindex fssa-phiopt
9091 Perform pattern matching on SSA PHI nodes to optimize conditional
9092 code.  This pass is enabled by default at @option{-O} and higher.
9094 @item -ftree-switch-conversion
9095 @opindex ftree-switch-conversion
9096 Perform conversion of simple initializations in a switch to
9097 initializations from a scalar array.  This flag is enabled by default
9098 at @option{-O2} and higher.
9100 @item -ftree-tail-merge
9101 @opindex ftree-tail-merge
9102 Look for identical code sequences.  When found, replace one with a jump to the
9103 other.  This optimization is known as tail merging or cross jumping.  This flag
9104 is enabled by default at @option{-O2} and higher.  The compilation time
9105 in this pass can
9106 be limited using @option{max-tail-merge-comparisons} parameter and
9107 @option{max-tail-merge-iterations} parameter.
9109 @item -ftree-dce
9110 @opindex ftree-dce
9111 Perform dead code elimination (DCE) on trees.  This flag is enabled by
9112 default at @option{-O} and higher.
9114 @item -ftree-builtin-call-dce
9115 @opindex ftree-builtin-call-dce
9116 Perform conditional dead code elimination (DCE) for calls to built-in functions
9117 that may set @code{errno} but are otherwise free of side effects.  This flag is
9118 enabled by default at @option{-O2} and higher if @option{-Os} is not also
9119 specified.
9121 @item -ftree-dominator-opts
9122 @opindex ftree-dominator-opts
9123 Perform a variety of simple scalar cleanups (constant/copy
9124 propagation, redundancy elimination, range propagation and expression
9125 simplification) based on a dominator tree traversal.  This also
9126 performs jump threading (to reduce jumps to jumps). This flag is
9127 enabled by default at @option{-O} and higher.
9129 @item -ftree-dse
9130 @opindex ftree-dse
9131 Perform dead store elimination (DSE) on trees.  A dead store is a store into
9132 a memory location that is later overwritten by another store without
9133 any intervening loads.  In this case the earlier store can be deleted.  This
9134 flag is enabled by default at @option{-O} and higher.
9136 @item -ftree-ch
9137 @opindex ftree-ch
9138 Perform loop header copying on trees.  This is beneficial since it increases
9139 effectiveness of code motion optimizations.  It also saves one jump.  This flag
9140 is enabled by default at @option{-O} and higher.  It is not enabled
9141 for @option{-Os}, since it usually increases code size.
9143 @item -ftree-loop-optimize
9144 @opindex ftree-loop-optimize
9145 Perform loop optimizations on trees.  This flag is enabled by default
9146 at @option{-O} and higher.
9148 @item -ftree-loop-linear
9149 @itemx -floop-strip-mine
9150 @itemx -floop-block
9151 @opindex ftree-loop-linear
9152 @opindex floop-strip-mine
9153 @opindex floop-block
9154 Perform loop nest optimizations.  Same as
9155 @option{-floop-nest-optimize}.  To use this code transformation, GCC has
9156 to be configured with @option{--with-isl} to enable the Graphite loop
9157 transformation infrastructure.
9159 @item -fgraphite-identity
9160 @opindex fgraphite-identity
9161 Enable the identity transformation for graphite.  For every SCoP we generate
9162 the polyhedral representation and transform it back to gimple.  Using
9163 @option{-fgraphite-identity} we can check the costs or benefits of the
9164 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
9165 are also performed by the code generator isl, like index splitting and
9166 dead code elimination in loops.
9168 @item -floop-nest-optimize
9169 @opindex floop-nest-optimize
9170 Enable the isl based loop nest optimizer.  This is a generic loop nest
9171 optimizer based on the Pluto optimization algorithms.  It calculates a loop
9172 structure optimized for data-locality and parallelism.  This option
9173 is experimental.
9175 @item -floop-parallelize-all
9176 @opindex floop-parallelize-all
9177 Use the Graphite data dependence analysis to identify loops that can
9178 be parallelized.  Parallelize all the loops that can be analyzed to
9179 not contain loop carried dependences without checking that it is
9180 profitable to parallelize the loops.
9182 @item -ftree-coalesce-vars
9183 @opindex ftree-coalesce-vars
9184 While transforming the program out of the SSA representation, attempt to
9185 reduce copying by coalescing versions of different user-defined
9186 variables, instead of just compiler temporaries.  This may severely
9187 limit the ability to debug an optimized program compiled with
9188 @option{-fno-var-tracking-assignments}.  In the negated form, this flag
9189 prevents SSA coalescing of user variables.  This option is enabled by
9190 default if optimization is enabled, and it does very little otherwise.
9192 @item -ftree-loop-if-convert
9193 @opindex ftree-loop-if-convert
9194 Attempt to transform conditional jumps in the innermost loops to
9195 branch-less equivalents.  The intent is to remove control-flow from
9196 the innermost loops in order to improve the ability of the
9197 vectorization pass to handle these loops.  This is enabled by default
9198 if vectorization is enabled.
9200 @item -ftree-loop-distribution
9201 @opindex ftree-loop-distribution
9202 Perform loop distribution.  This flag can improve cache performance on
9203 big loop bodies and allow further loop optimizations, like
9204 parallelization or vectorization, to take place.  For example, the loop
9205 @smallexample
9206 DO I = 1, N
9207   A(I) = B(I) + C
9208   D(I) = E(I) * F
9209 ENDDO
9210 @end smallexample
9211 is transformed to
9212 @smallexample
9213 DO I = 1, N
9214    A(I) = B(I) + C
9215 ENDDO
9216 DO I = 1, N
9217    D(I) = E(I) * F
9218 ENDDO
9219 @end smallexample
9221 @item -ftree-loop-distribute-patterns
9222 @opindex ftree-loop-distribute-patterns
9223 Perform loop distribution of patterns that can be code generated with
9224 calls to a library.  This flag is enabled by default at @option{-O3}.
9226 This pass distributes the initialization loops and generates a call to
9227 memset zero.  For example, the loop
9228 @smallexample
9229 DO I = 1, N
9230   A(I) = 0
9231   B(I) = A(I) + I
9232 ENDDO
9233 @end smallexample
9234 is transformed to
9235 @smallexample
9236 DO I = 1, N
9237    A(I) = 0
9238 ENDDO
9239 DO I = 1, N
9240    B(I) = A(I) + I
9241 ENDDO
9242 @end smallexample
9243 and the initialization loop is transformed into a call to memset zero.
9245 @item -floop-interchange
9246 @opindex floop-interchange
9247 Perform loop interchange outside of graphite.  This flag can improve cache
9248 performance on loop nest and allow further loop optimizations, like
9249 vectorization, to take place.  For example, the loop
9250 @smallexample
9251 for (int i = 0; i < N; i++)
9252   for (int j = 0; j < N; j++)
9253     for (int k = 0; k < N; k++)
9254       c[i][j] = c[i][j] + a[i][k]*b[k][j];
9255 @end smallexample
9256 is transformed to
9257 @smallexample
9258 for (int i = 0; i < N; i++)
9259   for (int k = 0; k < N; k++)
9260     for (int j = 0; j < N; j++)
9261       c[i][j] = c[i][j] + a[i][k]*b[k][j];
9262 @end smallexample
9263 This flag is enabled by default at @option{-O3}.
9265 @item -floop-unroll-and-jam
9266 @opindex floop-unroll-and-jam
9267 Apply unroll and jam transformations on feasible loops.  In a loop
9268 nest this unrolls the outer loop by some factor and fuses the resulting
9269 multiple inner loops.  This flag is enabled by default at @option{-O3}.
9271 @item -ftree-loop-im
9272 @opindex ftree-loop-im
9273 Perform loop invariant motion on trees.  This pass moves only invariants that
9274 are hard to handle at RTL level (function calls, operations that expand to
9275 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
9276 operands of conditions that are invariant out of the loop, so that we can use
9277 just trivial invariantness analysis in loop unswitching.  The pass also includes
9278 store motion.
9280 @item -ftree-loop-ivcanon
9281 @opindex ftree-loop-ivcanon
9282 Create a canonical counter for number of iterations in loops for which
9283 determining number of iterations requires complicated analysis.  Later
9284 optimizations then may determine the number easily.  Useful especially
9285 in connection with unrolling.
9287 @item -ftree-scev-cprop
9288 @opindex ftree-scev-cprop
9289 Perform final value replacement.  If a variable is modified in a loop
9290 in such a way that its value when exiting the loop can be determined using
9291 only its initial value and the number of loop iterations, replace uses of
9292 the final value by such a computation, provided it is sufficiently cheap.
9293 This reduces data dependencies and may allow further simplifications.
9294 Enabled by default at @option{-O} and higher.
9296 @item -fivopts
9297 @opindex fivopts
9298 Perform induction variable optimizations (strength reduction, induction
9299 variable merging and induction variable elimination) on trees.
9301 @item -ftree-parallelize-loops=n
9302 @opindex ftree-parallelize-loops
9303 Parallelize loops, i.e., split their iteration space to run in n threads.
9304 This is only possible for loops whose iterations are independent
9305 and can be arbitrarily reordered.  The optimization is only
9306 profitable on multiprocessor machines, for loops that are CPU-intensive,
9307 rather than constrained e.g.@: by memory bandwidth.  This option
9308 implies @option{-pthread}, and thus is only supported on targets
9309 that have support for @option{-pthread}.
9311 @item -ftree-pta
9312 @opindex ftree-pta
9313 Perform function-local points-to analysis on trees.  This flag is
9314 enabled by default at @option{-O} and higher.
9316 @item -ftree-sra
9317 @opindex ftree-sra
9318 Perform scalar replacement of aggregates.  This pass replaces structure
9319 references with scalars to prevent committing structures to memory too
9320 early.  This flag is enabled by default at @option{-O} and higher.
9322 @item -fstore-merging
9323 @opindex fstore-merging
9324 Perform merging of narrow stores to consecutive memory addresses.  This pass
9325 merges contiguous stores of immediate values narrower than a word into fewer
9326 wider stores to reduce the number of instructions.  This is enabled by default
9327 at @option{-O2} and higher as well as @option{-Os}.
9329 @item -ftree-ter
9330 @opindex ftree-ter
9331 Perform temporary expression replacement during the SSA->normal phase.  Single
9332 use/single def temporaries are replaced at their use location with their
9333 defining expression.  This results in non-GIMPLE code, but gives the expanders
9334 much more complex trees to work on resulting in better RTL generation.  This is
9335 enabled by default at @option{-O} and higher.
9337 @item -ftree-slsr
9338 @opindex ftree-slsr
9339 Perform straight-line strength reduction on trees.  This recognizes related
9340 expressions involving multiplications and replaces them by less expensive
9341 calculations when possible.  This is enabled by default at @option{-O} and
9342 higher.
9344 @item -ftree-vectorize
9345 @opindex ftree-vectorize
9346 Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
9347 and @option{-ftree-slp-vectorize} if not explicitly specified.
9349 @item -ftree-loop-vectorize
9350 @opindex ftree-loop-vectorize
9351 Perform loop vectorization on trees. This flag is enabled by default at
9352 @option{-O3} and when @option{-ftree-vectorize} is enabled.
9354 @item -ftree-slp-vectorize
9355 @opindex ftree-slp-vectorize
9356 Perform basic block vectorization on trees. This flag is enabled by default at
9357 @option{-O3} and when @option{-ftree-vectorize} is enabled.
9359 @item -fvect-cost-model=@var{model}
9360 @opindex fvect-cost-model
9361 Alter the cost model used for vectorization.  The @var{model} argument
9362 should be one of @samp{unlimited}, @samp{dynamic} or @samp{cheap}.
9363 With the @samp{unlimited} model the vectorized code-path is assumed
9364 to be profitable while with the @samp{dynamic} model a runtime check
9365 guards the vectorized code-path to enable it only for iteration
9366 counts that will likely execute faster than when executing the original
9367 scalar loop.  The @samp{cheap} model disables vectorization of
9368 loops where doing so would be cost prohibitive for example due to
9369 required runtime checks for data dependence or alignment but otherwise
9370 is equal to the @samp{dynamic} model.
9371 The default cost model depends on other optimization flags and is
9372 either @samp{dynamic} or @samp{cheap}.
9374 @item -fsimd-cost-model=@var{model}
9375 @opindex fsimd-cost-model
9376 Alter the cost model used for vectorization of loops marked with the OpenMP
9377 simd directive.  The @var{model} argument should be one of
9378 @samp{unlimited}, @samp{dynamic}, @samp{cheap}.  All values of @var{model}
9379 have the same meaning as described in @option{-fvect-cost-model} and by
9380 default a cost model defined with @option{-fvect-cost-model} is used.
9382 @item -ftree-vrp
9383 @opindex ftree-vrp
9384 Perform Value Range Propagation on trees.  This is similar to the
9385 constant propagation pass, but instead of values, ranges of values are
9386 propagated.  This allows the optimizers to remove unnecessary range
9387 checks like array bound checks and null pointer checks.  This is
9388 enabled by default at @option{-O2} and higher.  Null pointer check
9389 elimination is only done if @option{-fdelete-null-pointer-checks} is
9390 enabled.
9392 @item -fsplit-paths
9393 @opindex fsplit-paths
9394 Split paths leading to loop backedges.  This can improve dead code
9395 elimination and common subexpression elimination.  This is enabled by
9396 default at @option{-O2} and above.
9398 @item -fsplit-ivs-in-unroller
9399 @opindex fsplit-ivs-in-unroller
9400 Enables expression of values of induction variables in later iterations
9401 of the unrolled loop using the value in the first iteration.  This breaks
9402 long dependency chains, thus improving efficiency of the scheduling passes.
9404 A combination of @option{-fweb} and CSE is often sufficient to obtain the
9405 same effect.  However, that is not reliable in cases where the loop body
9406 is more complicated than a single basic block.  It also does not work at all
9407 on some architectures due to restrictions in the CSE pass.
9409 This optimization is enabled by default.
9411 @item -fvariable-expansion-in-unroller
9412 @opindex fvariable-expansion-in-unroller
9413 With this option, the compiler creates multiple copies of some
9414 local variables when unrolling a loop, which can result in superior code.
9416 @item -fpartial-inlining
9417 @opindex fpartial-inlining
9418 Inline parts of functions.  This option has any effect only
9419 when inlining itself is turned on by the @option{-finline-functions}
9420 or @option{-finline-small-functions} options.
9422 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9424 @item -fpredictive-commoning
9425 @opindex fpredictive-commoning
9426 Perform predictive commoning optimization, i.e., reusing computations
9427 (especially memory loads and stores) performed in previous
9428 iterations of loops.
9430 This option is enabled at level @option{-O3}.
9432 @item -fprefetch-loop-arrays
9433 @opindex fprefetch-loop-arrays
9434 If supported by the target machine, generate instructions to prefetch
9435 memory to improve the performance of loops that access large arrays.
9437 This option may generate better or worse code; results are highly
9438 dependent on the structure of loops within the source code.
9440 Disabled at level @option{-Os}.
9442 @item -fno-printf-return-value
9443 @opindex fno-printf-return-value
9444 @opindex fprintf-return-value
9445 Do not substitute constants for known return value of formatted output
9446 functions such as @code{sprintf}, @code{snprintf}, @code{vsprintf}, and
9447 @code{vsnprintf} (but not @code{printf} of @code{fprintf}).  This
9448 transformation allows GCC to optimize or even eliminate branches based
9449 on the known return value of these functions called with arguments that
9450 are either constant, or whose values are known to be in a range that
9451 makes determining the exact return value possible.  For example, when
9452 @option{-fprintf-return-value} is in effect, both the branch and the
9453 body of the @code{if} statement (but not the call to @code{snprint})
9454 can be optimized away when @code{i} is a 32-bit or smaller integer
9455 because the return value is guaranteed to be at most 8.
9457 @smallexample
9458 char buf[9];
9459 if (snprintf (buf, "%08x", i) >= sizeof buf)
9460   @dots{}
9461 @end smallexample
9463 The @option{-fprintf-return-value} option relies on other optimizations
9464 and yields best results with @option{-O2} and above.  It works in tandem
9465 with the @option{-Wformat-overflow} and @option{-Wformat-truncation}
9466 options.  The @option{-fprintf-return-value} option is enabled by default.
9468 @item -fno-peephole
9469 @itemx -fno-peephole2
9470 @opindex fno-peephole
9471 @opindex fpeephole
9472 @opindex fno-peephole2
9473 @opindex fpeephole2
9474 Disable any machine-specific peephole optimizations.  The difference
9475 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
9476 are implemented in the compiler; some targets use one, some use the
9477 other, a few use both.
9479 @option{-fpeephole} is enabled by default.
9480 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9482 @item -fno-guess-branch-probability
9483 @opindex fno-guess-branch-probability
9484 @opindex fguess-branch-probability
9485 Do not guess branch probabilities using heuristics.
9487 GCC uses heuristics to guess branch probabilities if they are
9488 not provided by profiling feedback (@option{-fprofile-arcs}).  These
9489 heuristics are based on the control flow graph.  If some branch probabilities
9490 are specified by @code{__builtin_expect}, then the heuristics are
9491 used to guess branch probabilities for the rest of the control flow graph,
9492 taking the @code{__builtin_expect} info into account.  The interactions
9493 between the heuristics and @code{__builtin_expect} can be complex, and in
9494 some cases, it may be useful to disable the heuristics so that the effects
9495 of @code{__builtin_expect} are easier to understand.
9497 It is also possible to specify expected probability of the expression
9498 with @code{__builtin_expect_with_probability} built-in function.
9500 The default is @option{-fguess-branch-probability} at levels
9501 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9503 @item -freorder-blocks
9504 @opindex freorder-blocks
9505 Reorder basic blocks in the compiled function in order to reduce number of
9506 taken branches and improve code locality.
9508 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9510 @item -freorder-blocks-algorithm=@var{algorithm}
9511 @opindex freorder-blocks-algorithm
9512 Use the specified algorithm for basic block reordering.  The
9513 @var{algorithm} argument can be @samp{simple}, which does not increase
9514 code size (except sometimes due to secondary effects like alignment),
9515 or @samp{stc}, the ``software trace cache'' algorithm, which tries to
9516 put all often executed code together, minimizing the number of branches
9517 executed by making extra copies of code.
9519 The default is @samp{simple} at levels @option{-O}, @option{-Os}, and
9520 @samp{stc} at levels @option{-O2}, @option{-O3}.
9522 @item -freorder-blocks-and-partition
9523 @opindex freorder-blocks-and-partition
9524 In addition to reordering basic blocks in the compiled function, in order
9525 to reduce number of taken branches, partitions hot and cold basic blocks
9526 into separate sections of the assembly and @file{.o} files, to improve
9527 paging and cache locality performance.
9529 This optimization is automatically turned off in the presence of
9530 exception handling or unwind tables (on targets using setjump/longjump or target specific scheme), for linkonce sections, for functions with a user-defined
9531 section attribute and on any architecture that does not support named
9532 sections.  When @option{-fsplit-stack} is used this option is not
9533 enabled by default (to avoid linker errors), but may be enabled
9534 explicitly (if using a working linker).
9536 Enabled for x86 at levels @option{-O2}, @option{-O3}, @option{-Os}.
9538 @item -freorder-functions
9539 @opindex freorder-functions
9540 Reorder functions in the object file in order to
9541 improve code locality.  This is implemented by using special
9542 subsections @code{.text.hot} for most frequently executed functions and
9543 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
9544 the linker so object file format must support named sections and linker must
9545 place them in a reasonable way.
9547 Also profile feedback must be available to make this option effective.  See
9548 @option{-fprofile-arcs} for details.
9550 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9552 @item -fstrict-aliasing
9553 @opindex fstrict-aliasing
9554 Allow the compiler to assume the strictest aliasing rules applicable to
9555 the language being compiled.  For C (and C++), this activates
9556 optimizations based on the type of expressions.  In particular, an
9557 object of one type is assumed never to reside at the same address as an
9558 object of a different type, unless the types are almost the same.  For
9559 example, an @code{unsigned int} can alias an @code{int}, but not a
9560 @code{void*} or a @code{double}.  A character type may alias any other
9561 type.
9563 @anchor{Type-punning}Pay special attention to code like this:
9564 @smallexample
9565 union a_union @{
9566   int i;
9567   double d;
9570 int f() @{
9571   union a_union t;
9572   t.d = 3.0;
9573   return t.i;
9575 @end smallexample
9576 The practice of reading from a different union member than the one most
9577 recently written to (called ``type-punning'') is common.  Even with
9578 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
9579 is accessed through the union type.  So, the code above works as
9580 expected.  @xref{Structures unions enumerations and bit-fields
9581 implementation}.  However, this code might not:
9582 @smallexample
9583 int f() @{
9584   union a_union t;
9585   int* ip;
9586   t.d = 3.0;
9587   ip = &t.i;
9588   return *ip;
9590 @end smallexample
9592 Similarly, access by taking the address, casting the resulting pointer
9593 and dereferencing the result has undefined behavior, even if the cast
9594 uses a union type, e.g.:
9595 @smallexample
9596 int f() @{
9597   double d = 3.0;
9598   return ((union a_union *) &d)->i;
9600 @end smallexample
9602 The @option{-fstrict-aliasing} option is enabled at levels
9603 @option{-O2}, @option{-O3}, @option{-Os}.
9605 @item -falign-functions
9606 @itemx -falign-functions=@var{n}
9607 @itemx -falign-functions=@var{n}:@var{m}
9608 @itemx -falign-functions=@var{n}:@var{m}:@var{n2}
9609 @itemx -falign-functions=@var{n}:@var{m}:@var{n2}:@var{m2}
9610 @opindex falign-functions
9611 Align the start of functions to the next power-of-two greater than
9612 @var{n}, skipping up to @var{m}-1 bytes.  This ensures that at least
9613 the first @var{m} bytes of the function can be fetched by the CPU
9614 without crossing an @var{n}-byte alignment boundary.
9616 If @var{m} is not specified, it defaults to @var{n}.
9618 Examples: @option{-falign-functions=32} aligns functions to the next
9619 32-byte boundary, @option{-falign-functions=24} aligns to the next
9620 32-byte boundary only if this can be done by skipping 23 bytes or less,
9621 @option{-falign-functions=32:7} aligns to the next
9622 32-byte boundary only if this can be done by skipping 6 bytes or less.
9624 The second pair of @var{n2}:@var{m2} values allows you to specify
9625 a secondary alignment: @option{-falign-functions=64:7:32:3} aligns to
9626 the next 64-byte boundary if this can be done by skipping 6 bytes or less,
9627 otherwise aligns to the next 32-byte boundary if this can be done
9628 by skipping 2 bytes or less.
9629 If @var{m2} is not specified, it defaults to @var{n2}.
9631 Some assemblers only support this flag when @var{n} is a power of two;
9632 in that case, it is rounded up.
9634 @option{-fno-align-functions} and @option{-falign-functions=1} are
9635 equivalent and mean that functions are not aligned.
9637 If @var{n} is not specified or is zero, use a machine-dependent default.
9638 The maximum allowed @var{n} option value is 65536.
9640 Enabled at levels @option{-O2}, @option{-O3}.
9642 @item -flimit-function-alignment
9643 If this option is enabled, the compiler tries to avoid unnecessarily
9644 overaligning functions. It attempts to instruct the assembler to align
9645 by the amount specified by @option{-falign-functions}, but not to
9646 skip more bytes than the size of the function.
9648 @item -falign-labels
9649 @itemx -falign-labels=@var{n}
9650 @itemx -falign-labels=@var{n}:@var{m}
9651 @itemx -falign-labels=@var{n}:@var{m}:@var{n2}
9652 @itemx -falign-labels=@var{n}:@var{m}:@var{n2}:@var{m2}
9653 @opindex falign-labels
9654 Align all branch targets to a power-of-two boundary.
9656 Parameters of this option are analogous to the @option{-falign-functions} option.
9657 @option{-fno-align-labels} and @option{-falign-labels=1} are
9658 equivalent and mean that labels are not aligned.
9660 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
9661 are greater than this value, then their values are used instead.
9663 If @var{n} is not specified or is zero, use a machine-dependent default
9664 which is very likely to be @samp{1}, meaning no alignment.
9665 The maximum allowed @var{n} option value is 65536.
9667 Enabled at levels @option{-O2}, @option{-O3}.
9669 @item -falign-loops
9670 @itemx -falign-loops=@var{n}
9671 @itemx -falign-loops=@var{n}:@var{m}
9672 @itemx -falign-loops=@var{n}:@var{m}:@var{n2}
9673 @itemx -falign-loops=@var{n}:@var{m}:@var{n2}:@var{m2}
9674 @opindex falign-loops
9675 Align loops to a power-of-two boundary.  If the loops are executed
9676 many times, this makes up for any execution of the dummy padding
9677 instructions.
9679 Parameters of this option are analogous to the @option{-falign-functions} option.
9680 @option{-fno-align-loops} and @option{-falign-loops=1} are
9681 equivalent and mean that loops are not aligned.
9682 The maximum allowed @var{n} option value is 65536.
9684 If @var{n} is not specified or is zero, use a machine-dependent default.
9686 Enabled at levels @option{-O2}, @option{-O3}.
9688 @item -falign-jumps
9689 @itemx -falign-jumps=@var{n}
9690 @itemx -falign-jumps=@var{n}:@var{m}
9691 @itemx -falign-jumps=@var{n}:@var{m}:@var{n2}
9692 @itemx -falign-jumps=@var{n}:@var{m}:@var{n2}:@var{m2}
9693 @opindex falign-jumps
9694 Align branch targets to a power-of-two boundary, for branch targets
9695 where the targets can only be reached by jumping.  In this case,
9696 no dummy operations need be executed.
9698 Parameters of this option are analogous to the @option{-falign-functions} option.
9699 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
9700 equivalent and mean that loops are not aligned.
9702 If @var{n} is not specified or is zero, use a machine-dependent default.
9703 The maximum allowed @var{n} option value is 65536.
9705 Enabled at levels @option{-O2}, @option{-O3}.
9707 @item -funit-at-a-time
9708 @opindex funit-at-a-time
9709 This option is left for compatibility reasons. @option{-funit-at-a-time}
9710 has no effect, while @option{-fno-unit-at-a-time} implies
9711 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
9713 Enabled by default.
9715 @item -fno-toplevel-reorder
9716 @opindex fno-toplevel-reorder
9717 @opindex ftoplevel-reorder
9718 Do not reorder top-level functions, variables, and @code{asm}
9719 statements.  Output them in the same order that they appear in the
9720 input file.  When this option is used, unreferenced static variables
9721 are not removed.  This option is intended to support existing code
9722 that relies on a particular ordering.  For new code, it is better to
9723 use attributes when possible.
9725 @option{-ftoplevel-reorder} is the default at @option{-O1} and higher, and
9726 also at @option{-O0} if @option{-fsection-anchors} is explicitly requested.
9727 Additionally @option{-fno-toplevel-reorder} implies
9728 @option{-fno-section-anchors}.
9730 @item -fweb
9731 @opindex fweb
9732 Constructs webs as commonly used for register allocation purposes and assign
9733 each web individual pseudo register.  This allows the register allocation pass
9734 to operate on pseudos directly, but also strengthens several other optimization
9735 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
9736 however, make debugging impossible, since variables no longer stay in a
9737 ``home register''.
9739 Enabled by default with @option{-funroll-loops}.
9741 @item -fwhole-program
9742 @opindex fwhole-program
9743 Assume that the current compilation unit represents the whole program being
9744 compiled.  All public functions and variables with the exception of @code{main}
9745 and those merged by attribute @code{externally_visible} become static functions
9746 and in effect are optimized more aggressively by interprocedural optimizers.
9748 This option should not be used in combination with @option{-flto}.
9749 Instead relying on a linker plugin should provide safer and more precise
9750 information.
9752 @item -flto[=@var{n}]
9753 @opindex flto
9754 This option runs the standard link-time optimizer.  When invoked
9755 with source code, it generates GIMPLE (one of GCC's internal
9756 representations) and writes it to special ELF sections in the object
9757 file.  When the object files are linked together, all the function
9758 bodies are read from these ELF sections and instantiated as if they
9759 had been part of the same translation unit.
9761 To use the link-time optimizer, @option{-flto} and optimization
9762 options should be specified at compile time and during the final link.
9763 It is recommended that you compile all the files participating in the
9764 same link with the same options and also specify those options at
9765 link time.  
9766 For example:
9768 @smallexample
9769 gcc -c -O2 -flto foo.c
9770 gcc -c -O2 -flto bar.c
9771 gcc -o myprog -flto -O2 foo.o bar.o
9772 @end smallexample
9774 The first two invocations to GCC save a bytecode representation
9775 of GIMPLE into special ELF sections inside @file{foo.o} and
9776 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
9777 @file{foo.o} and @file{bar.o}, merges the two files into a single
9778 internal image, and compiles the result as usual.  Since both
9779 @file{foo.o} and @file{bar.o} are merged into a single image, this
9780 causes all the interprocedural analyses and optimizations in GCC to
9781 work across the two files as if they were a single one.  This means,
9782 for example, that the inliner is able to inline functions in
9783 @file{bar.o} into functions in @file{foo.o} and vice-versa.
9785 Another (simpler) way to enable link-time optimization is:
9787 @smallexample
9788 gcc -o myprog -flto -O2 foo.c bar.c
9789 @end smallexample
9791 The above generates bytecode for @file{foo.c} and @file{bar.c},
9792 merges them together into a single GIMPLE representation and optimizes
9793 them as usual to produce @file{myprog}.
9795 The only important thing to keep in mind is that to enable link-time
9796 optimizations you need to use the GCC driver to perform the link step.
9797 GCC then automatically performs link-time optimization if any of the
9798 objects involved were compiled with the @option{-flto} command-line option.  
9799 You generally
9800 should specify the optimization options to be used for link-time
9801 optimization though GCC tries to be clever at guessing an
9802 optimization level to use from the options used at compile time
9803 if you fail to specify one at link time.  You can always override
9804 the automatic decision to do link-time optimization
9805 by passing @option{-fno-lto} to the link command.
9807 To make whole program optimization effective, it is necessary to make
9808 certain whole program assumptions.  The compiler needs to know
9809 what functions and variables can be accessed by libraries and runtime
9810 outside of the link-time optimized unit.  When supported by the linker,
9811 the linker plugin (see @option{-fuse-linker-plugin}) passes information
9812 to the compiler about used and externally visible symbols.  When
9813 the linker plugin is not available, @option{-fwhole-program} should be
9814 used to allow the compiler to make these assumptions, which leads
9815 to more aggressive optimization decisions.
9817 When @option{-fuse-linker-plugin} is not enabled, when a file is
9818 compiled with @option{-flto}, the generated object file is larger than
9819 a regular object file because it contains GIMPLE bytecodes and the usual
9820 final code (see @option{-ffat-lto-objects}.  This means that
9821 object files with LTO information can be linked as normal object
9822 files; if @option{-fno-lto} is passed to the linker, no
9823 interprocedural optimizations are applied.  Note that when
9824 @option{-fno-fat-lto-objects} is enabled the compile stage is faster
9825 but you cannot perform a regular, non-LTO link on them.
9827 Additionally, the optimization flags used to compile individual files
9828 are not necessarily related to those used at link time.  For instance,
9830 @smallexample
9831 gcc -c -O0 -ffat-lto-objects -flto foo.c
9832 gcc -c -O0 -ffat-lto-objects -flto bar.c
9833 gcc -o myprog -O3 foo.o bar.o
9834 @end smallexample
9836 This produces individual object files with unoptimized assembler
9837 code, but the resulting binary @file{myprog} is optimized at
9838 @option{-O3}.  If, instead, the final binary is generated with
9839 @option{-fno-lto}, then @file{myprog} is not optimized.
9841 When producing the final binary, GCC only
9842 applies link-time optimizations to those files that contain bytecode.
9843 Therefore, you can mix and match object files and libraries with
9844 GIMPLE bytecodes and final object code.  GCC automatically selects
9845 which files to optimize in LTO mode and which files to link without
9846 further processing.
9848 There are some code generation flags preserved by GCC when
9849 generating bytecodes, as they need to be used during the final link
9850 stage.  Generally options specified at link time override those
9851 specified at compile time.
9853 If you do not specify an optimization level option @option{-O} at
9854 link time, then GCC uses the highest optimization level 
9855 used when compiling the object files.
9857 Currently, the following options and their settings are taken from
9858 the first object file that explicitly specifies them: 
9859 @option{-fPIC}, @option{-fpic}, @option{-fpie}, @option{-fcommon},
9860 @option{-fexceptions}, @option{-fnon-call-exceptions}, @option{-fgnu-tm}
9861 and all the @option{-m} target flags.
9863 Certain ABI-changing flags are required to match in all compilation units,
9864 and trying to override this at link time with a conflicting value
9865 is ignored.  This includes options such as @option{-freg-struct-return}
9866 and @option{-fpcc-struct-return}. 
9868 Other options such as @option{-ffp-contract}, @option{-fno-strict-overflow},
9869 @option{-fwrapv}, @option{-fno-trapv} or @option{-fno-strict-aliasing}
9870 are passed through to the link stage and merged conservatively for
9871 conflicting translation units.  Specifically
9872 @option{-fno-strict-overflow}, @option{-fwrapv} and @option{-fno-trapv} take
9873 precedence; and for example @option{-ffp-contract=off} takes precedence
9874 over @option{-ffp-contract=fast}.  You can override them at link time.
9876 If LTO encounters objects with C linkage declared with incompatible
9877 types in separate translation units to be linked together (undefined
9878 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
9879 issued.  The behavior is still undefined at run time.  Similar
9880 diagnostics may be raised for other languages.
9882 Another feature of LTO is that it is possible to apply interprocedural
9883 optimizations on files written in different languages:
9885 @smallexample
9886 gcc -c -flto foo.c
9887 g++ -c -flto bar.cc
9888 gfortran -c -flto baz.f90
9889 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
9890 @end smallexample
9892 Notice that the final link is done with @command{g++} to get the C++
9893 runtime libraries and @option{-lgfortran} is added to get the Fortran
9894 runtime libraries.  In general, when mixing languages in LTO mode, you
9895 should use the same link command options as when mixing languages in a
9896 regular (non-LTO) compilation.
9898 If object files containing GIMPLE bytecode are stored in a library archive, say
9899 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
9900 are using a linker with plugin support.  To create static libraries suitable
9901 for LTO, use @command{gcc-ar} and @command{gcc-ranlib} instead of @command{ar}
9902 and @command{ranlib}; 
9903 to show the symbols of object files with GIMPLE bytecode, use
9904 @command{gcc-nm}.  Those commands require that @command{ar}, @command{ranlib}
9905 and @command{nm} have been compiled with plugin support.  At link time, use the
9906 flag @option{-fuse-linker-plugin} to ensure that the library participates in
9907 the LTO optimization process:
9909 @smallexample
9910 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
9911 @end smallexample
9913 With the linker plugin enabled, the linker extracts the needed
9914 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
9915 to make them part of the aggregated GIMPLE image to be optimized.
9917 If you are not using a linker with plugin support and/or do not
9918 enable the linker plugin, then the objects inside @file{libfoo.a}
9919 are extracted and linked as usual, but they do not participate
9920 in the LTO optimization process.  In order to make a static library suitable
9921 for both LTO optimization and usual linkage, compile its object files with
9922 @option{-flto} @option{-ffat-lto-objects}.
9924 Link-time optimizations do not require the presence of the whole program to
9925 operate.  If the program does not require any symbols to be exported, it is
9926 possible to combine @option{-flto} and @option{-fwhole-program} to allow
9927 the interprocedural optimizers to use more aggressive assumptions which may
9928 lead to improved optimization opportunities.
9929 Use of @option{-fwhole-program} is not needed when linker plugin is
9930 active (see @option{-fuse-linker-plugin}).
9932 The current implementation of LTO makes no
9933 attempt to generate bytecode that is portable between different
9934 types of hosts.  The bytecode files are versioned and there is a
9935 strict version check, so bytecode files generated in one version of
9936 GCC do not work with an older or newer version of GCC.
9938 Link-time optimization does not work well with generation of debugging
9939 information on systems other than those using a combination of ELF and
9940 DWARF.
9942 If you specify the optional @var{n}, the optimization and code
9943 generation done at link time is executed in parallel using @var{n}
9944 parallel jobs by utilizing an installed @command{make} program.  The
9945 environment variable @env{MAKE} may be used to override the program
9946 used.  The default value for @var{n} is 1.
9948 You can also specify @option{-flto=jobserver} to use GNU make's
9949 job server mode to determine the number of parallel jobs. This
9950 is useful when the Makefile calling GCC is already executing in parallel.
9951 You must prepend a @samp{+} to the command recipe in the parent Makefile
9952 for this to work.  This option likely only works if @env{MAKE} is
9953 GNU make.
9955 @item -flto-partition=@var{alg}
9956 @opindex flto-partition
9957 Specify the partitioning algorithm used by the link-time optimizer.
9958 The value is either @samp{1to1} to specify a partitioning mirroring
9959 the original source files or @samp{balanced} to specify partitioning
9960 into equally sized chunks (whenever possible) or @samp{max} to create
9961 new partition for every symbol where possible.  Specifying @samp{none}
9962 as an algorithm disables partitioning and streaming completely. 
9963 The default value is @samp{balanced}. While @samp{1to1} can be used
9964 as an workaround for various code ordering issues, the @samp{max}
9965 partitioning is intended for internal testing only.
9966 The value @samp{one} specifies that exactly one partition should be
9967 used while the value @samp{none} bypasses partitioning and executes
9968 the link-time optimization step directly from the WPA phase.
9970 @item -flto-odr-type-merging
9971 @opindex flto-odr-type-merging
9972 Enable streaming of mangled types names of C++ types and their unification
9973 at link time.  This increases size of LTO object files, but enables
9974 diagnostics about One Definition Rule violations.
9976 @item -flto-compression-level=@var{n}
9977 @opindex flto-compression-level
9978 This option specifies the level of compression used for intermediate
9979 language written to LTO object files, and is only meaningful in
9980 conjunction with LTO mode (@option{-flto}).  Valid
9981 values are 0 (no compression) to 9 (maximum compression).  Values
9982 outside this range are clamped to either 0 or 9.  If the option is not
9983 given, a default balanced compression setting is used.
9985 @item -fuse-linker-plugin
9986 @opindex fuse-linker-plugin
9987 Enables the use of a linker plugin during link-time optimization.  This
9988 option relies on plugin support in the linker, which is available in gold
9989 or in GNU ld 2.21 or newer.
9991 This option enables the extraction of object files with GIMPLE bytecode out
9992 of library archives. This improves the quality of optimization by exposing
9993 more code to the link-time optimizer.  This information specifies what
9994 symbols can be accessed externally (by non-LTO object or during dynamic
9995 linking).  Resulting code quality improvements on binaries (and shared
9996 libraries that use hidden visibility) are similar to @option{-fwhole-program}.
9997 See @option{-flto} for a description of the effect of this flag and how to
9998 use it.
10000 This option is enabled by default when LTO support in GCC is enabled
10001 and GCC was configured for use with
10002 a linker supporting plugins (GNU ld 2.21 or newer or gold).
10004 @item -ffat-lto-objects
10005 @opindex ffat-lto-objects
10006 Fat LTO objects are object files that contain both the intermediate language
10007 and the object code. This makes them usable for both LTO linking and normal
10008 linking. This option is effective only when compiling with @option{-flto}
10009 and is ignored at link time.
10011 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
10012 requires the complete toolchain to be aware of LTO. It requires a linker with
10013 linker plugin support for basic functionality.  Additionally,
10014 @command{nm}, @command{ar} and @command{ranlib}
10015 need to support linker plugins to allow a full-featured build environment
10016 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
10017 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
10018 to these tools. With non fat LTO makefiles need to be modified to use them.
10020 Note that modern binutils provide plugin auto-load mechanism.
10021 Installing the linker plugin into @file{$libdir/bfd-plugins} has the same
10022 effect as usage of the command wrappers (@command{gcc-ar}, @command{gcc-nm} and
10023 @command{gcc-ranlib}).
10025 The default is @option{-fno-fat-lto-objects} on targets with linker plugin
10026 support.
10028 @item -fcompare-elim
10029 @opindex fcompare-elim
10030 After register allocation and post-register allocation instruction splitting,
10031 identify arithmetic instructions that compute processor flags similar to a
10032 comparison operation based on that arithmetic.  If possible, eliminate the
10033 explicit comparison operation.
10035 This pass only applies to certain targets that cannot explicitly represent
10036 the comparison operation before register allocation is complete.
10038 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
10040 @item -fcprop-registers
10041 @opindex fcprop-registers
10042 After register allocation and post-register allocation instruction splitting,
10043 perform a copy-propagation pass to try to reduce scheduling dependencies
10044 and occasionally eliminate the copy.
10046 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
10048 @item -fprofile-correction
10049 @opindex fprofile-correction
10050 Profiles collected using an instrumented binary for multi-threaded programs may
10051 be inconsistent due to missed counter updates. When this option is specified,
10052 GCC uses heuristics to correct or smooth out such inconsistencies. By
10053 default, GCC emits an error message when an inconsistent profile is detected.
10055 @item -fprofile-use
10056 @itemx -fprofile-use=@var{path}
10057 @opindex fprofile-use
10058 Enable profile feedback-directed optimizations, 
10059 and the following optimizations
10060 which are generally profitable only with profile feedback available:
10061 @option{-fbranch-probabilities}, @option{-fvpt},
10062 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
10063 @option{-ftree-vectorize}, and @option{ftree-loop-distribute-patterns}.
10065 Before you can use this option, you must first generate profiling information.
10066 @xref{Instrumentation Options}, for information about the
10067 @option{-fprofile-generate} option.
10069 By default, GCC emits an error message if the feedback profiles do not
10070 match the source code.  This error can be turned into a warning by using
10071 @option{-Wno-error=coverage-mismatch}.  Note this may result in poorly
10072 optimized code.  Additionally, by default, GCC also emits a warning message if
10073 the feedback profiles do not exist (See @option{-Wmissing-profile}).
10075 If @var{path} is specified, GCC looks at the @var{path} to find
10076 the profile feedback data files. See @option{-fprofile-dir}.
10078 @item -fauto-profile
10079 @itemx -fauto-profile=@var{path}
10080 @opindex fauto-profile
10081 Enable sampling-based feedback-directed optimizations, 
10082 and the following optimizations
10083 which are generally profitable only with profile feedback available:
10084 @option{-fbranch-probabilities}, @option{-fvpt},
10085 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
10086 @option{-ftree-vectorize},
10087 @option{-finline-functions}, @option{-fipa-cp}, @option{-fipa-cp-clone},
10088 @option{-fpredictive-commoning}, @option{-funswitch-loops},
10089 @option{-fgcse-after-reload}, and @option{-ftree-loop-distribute-patterns}.
10091 @var{path} is the name of a file containing AutoFDO profile information.
10092 If omitted, it defaults to @file{fbdata.afdo} in the current directory.
10094 Producing an AutoFDO profile data file requires running your program
10095 with the @command{perf} utility on a supported GNU/Linux target system.
10096 For more information, see @uref{https://perf.wiki.kernel.org/}.
10098 E.g.
10099 @smallexample
10100 perf record -e br_inst_retired:near_taken -b -o perf.data \
10101     -- your_program
10102 @end smallexample
10104 Then use the @command{create_gcov} tool to convert the raw profile data
10105 to a format that can be used by GCC.@  You must also supply the 
10106 unstripped binary for your program to this tool.  
10107 See @uref{https://github.com/google/autofdo}.
10109 E.g.
10110 @smallexample
10111 create_gcov --binary=your_program.unstripped --profile=perf.data \
10112     --gcov=profile.afdo
10113 @end smallexample
10114 @end table
10116 The following options control compiler behavior regarding floating-point 
10117 arithmetic.  These options trade off between speed and
10118 correctness.  All must be specifically enabled.
10120 @table @gcctabopt
10121 @item -ffloat-store
10122 @opindex ffloat-store
10123 Do not store floating-point variables in registers, and inhibit other
10124 options that might change whether a floating-point value is taken from a
10125 register or memory.
10127 @cindex floating-point precision
10128 This option prevents undesirable excess precision on machines such as
10129 the 68000 where the floating registers (of the 68881) keep more
10130 precision than a @code{double} is supposed to have.  Similarly for the
10131 x86 architecture.  For most programs, the excess precision does only
10132 good, but a few programs rely on the precise definition of IEEE floating
10133 point.  Use @option{-ffloat-store} for such programs, after modifying
10134 them to store all pertinent intermediate computations into variables.
10136 @item -fexcess-precision=@var{style}
10137 @opindex fexcess-precision
10138 This option allows further control over excess precision on machines
10139 where floating-point operations occur in a format with more precision or
10140 range than the IEEE standard and interchange floating-point types.  By
10141 default, @option{-fexcess-precision=fast} is in effect; this means that
10142 operations may be carried out in a wider precision than the types specified
10143 in the source if that would result in faster code, and it is unpredictable
10144 when rounding to the types specified in the source code takes place.
10145 When compiling C, if @option{-fexcess-precision=standard} is specified then
10146 excess precision follows the rules specified in ISO C99; in particular,
10147 both casts and assignments cause values to be rounded to their
10148 semantic types (whereas @option{-ffloat-store} only affects
10149 assignments).  This option is enabled by default for C if a strict
10150 conformance option such as @option{-std=c99} is used.
10151 @option{-ffast-math} enables @option{-fexcess-precision=fast} by default
10152 regardless of whether a strict conformance option is used.
10154 @opindex mfpmath
10155 @option{-fexcess-precision=standard} is not implemented for languages
10156 other than C.  On the x86, it has no effect if @option{-mfpmath=sse}
10157 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
10158 semantics apply without excess precision, and in the latter, rounding
10159 is unpredictable.
10161 @item -ffast-math
10162 @opindex ffast-math
10163 Sets the options @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
10164 @option{-ffinite-math-only}, @option{-fno-rounding-math},
10165 @option{-fno-signaling-nans}, @option{-fcx-limited-range} and
10166 @option{-fexcess-precision=fast}.
10168 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
10170 This option is not turned on by any @option{-O} option besides
10171 @option{-Ofast} since it can result in incorrect output for programs
10172 that depend on an exact implementation of IEEE or ISO rules/specifications
10173 for math functions. It may, however, yield faster code for programs
10174 that do not require the guarantees of these specifications.
10176 @item -fno-math-errno
10177 @opindex fno-math-errno
10178 @opindex fmath-errno
10179 Do not set @code{errno} after calling math functions that are executed
10180 with a single instruction, e.g., @code{sqrt}.  A program that relies on
10181 IEEE exceptions for math error handling may want to use this flag
10182 for speed while maintaining IEEE arithmetic compatibility.
10184 This option is not turned on by any @option{-O} option since
10185 it can result in incorrect output for programs that depend on
10186 an exact implementation of IEEE or ISO rules/specifications for
10187 math functions. It may, however, yield faster code for programs
10188 that do not require the guarantees of these specifications.
10190 The default is @option{-fmath-errno}.
10192 On Darwin systems, the math library never sets @code{errno}.  There is
10193 therefore no reason for the compiler to consider the possibility that
10194 it might, and @option{-fno-math-errno} is the default.
10196 @item -funsafe-math-optimizations
10197 @opindex funsafe-math-optimizations
10199 Allow optimizations for floating-point arithmetic that (a) assume
10200 that arguments and results are valid and (b) may violate IEEE or
10201 ANSI standards.  When used at link time, it may include libraries
10202 or startup files that change the default FPU control word or other
10203 similar optimizations.
10205 This option is not turned on by any @option{-O} option since
10206 it can result in incorrect output for programs that depend on
10207 an exact implementation of IEEE or ISO rules/specifications for
10208 math functions. It may, however, yield faster code for programs
10209 that do not require the guarantees of these specifications.
10210 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
10211 @option{-fassociative-math} and @option{-freciprocal-math}.
10213 The default is @option{-fno-unsafe-math-optimizations}.
10215 @item -fassociative-math
10216 @opindex fassociative-math
10218 Allow re-association of operands in series of floating-point operations.
10219 This violates the ISO C and C++ language standard by possibly changing
10220 computation result.  NOTE: re-ordering may change the sign of zero as
10221 well as ignore NaNs and inhibit or create underflow or overflow (and
10222 thus cannot be used on code that relies on rounding behavior like
10223 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
10224 and thus may not be used when ordered comparisons are required.
10225 This option requires that both @option{-fno-signed-zeros} and
10226 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
10227 much sense with @option{-frounding-math}. For Fortran the option
10228 is automatically enabled when both @option{-fno-signed-zeros} and
10229 @option{-fno-trapping-math} are in effect.
10231 The default is @option{-fno-associative-math}.
10233 @item -freciprocal-math
10234 @opindex freciprocal-math
10236 Allow the reciprocal of a value to be used instead of dividing by
10237 the value if this enables optimizations.  For example @code{x / y}
10238 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
10239 is subject to common subexpression elimination.  Note that this loses
10240 precision and increases the number of flops operating on the value.
10242 The default is @option{-fno-reciprocal-math}.
10244 @item -ffinite-math-only
10245 @opindex ffinite-math-only
10246 Allow optimizations for floating-point arithmetic that assume
10247 that arguments and results are not NaNs or +-Infs.
10249 This option is not turned on by any @option{-O} option since
10250 it can result in incorrect output for programs that depend on
10251 an exact implementation of IEEE or ISO rules/specifications for
10252 math functions. It may, however, yield faster code for programs
10253 that do not require the guarantees of these specifications.
10255 The default is @option{-fno-finite-math-only}.
10257 @item -fno-signed-zeros
10258 @opindex fno-signed-zeros
10259 @opindex fsigned-zeros
10260 Allow optimizations for floating-point arithmetic that ignore the
10261 signedness of zero.  IEEE arithmetic specifies the behavior of
10262 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
10263 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
10264 This option implies that the sign of a zero result isn't significant.
10266 The default is @option{-fsigned-zeros}.
10268 @item -fno-trapping-math
10269 @opindex fno-trapping-math
10270 @opindex ftrapping-math
10271 Compile code assuming that floating-point operations cannot generate
10272 user-visible traps.  These traps include division by zero, overflow,
10273 underflow, inexact result and invalid operation.  This option requires
10274 that @option{-fno-signaling-nans} be in effect.  Setting this option may
10275 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
10277 This option should never be turned on by any @option{-O} option since
10278 it can result in incorrect output for programs that depend on
10279 an exact implementation of IEEE or ISO rules/specifications for
10280 math functions.
10282 The default is @option{-ftrapping-math}.
10284 @item -frounding-math
10285 @opindex frounding-math
10286 Disable transformations and optimizations that assume default floating-point
10287 rounding behavior.  This is round-to-zero for all floating point
10288 to integer conversions, and round-to-nearest for all other arithmetic
10289 truncations.  This option should be specified for programs that change
10290 the FP rounding mode dynamically, or that may be executed with a
10291 non-default rounding mode.  This option disables constant folding of
10292 floating-point expressions at compile time (which may be affected by
10293 rounding mode) and arithmetic transformations that are unsafe in the
10294 presence of sign-dependent rounding modes.
10296 The default is @option{-fno-rounding-math}.
10298 This option is experimental and does not currently guarantee to
10299 disable all GCC optimizations that are affected by rounding mode.
10300 Future versions of GCC may provide finer control of this setting
10301 using C99's @code{FENV_ACCESS} pragma.  This command-line option
10302 will be used to specify the default state for @code{FENV_ACCESS}.
10304 @item -fsignaling-nans
10305 @opindex fsignaling-nans
10306 Compile code assuming that IEEE signaling NaNs may generate user-visible
10307 traps during floating-point operations.  Setting this option disables
10308 optimizations that may change the number of exceptions visible with
10309 signaling NaNs.  This option implies @option{-ftrapping-math}.
10311 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
10312 be defined.
10314 The default is @option{-fno-signaling-nans}.
10316 This option is experimental and does not currently guarantee to
10317 disable all GCC optimizations that affect signaling NaN behavior.
10319 @item -fno-fp-int-builtin-inexact
10320 @opindex fno-fp-int-builtin-inexact
10321 @opindex ffp-int-builtin-inexact
10322 Do not allow the built-in functions @code{ceil}, @code{floor},
10323 @code{round} and @code{trunc}, and their @code{float} and @code{long
10324 double} variants, to generate code that raises the ``inexact''
10325 floating-point exception for noninteger arguments.  ISO C99 and C11
10326 allow these functions to raise the ``inexact'' exception, but ISO/IEC
10327 TS 18661-1:2014, the C bindings to IEEE 754-2008, does not allow these
10328 functions to do so.
10330 The default is @option{-ffp-int-builtin-inexact}, allowing the
10331 exception to be raised.  This option does nothing unless
10332 @option{-ftrapping-math} is in effect.
10334 Even if @option{-fno-fp-int-builtin-inexact} is used, if the functions
10335 generate a call to a library function then the ``inexact'' exception
10336 may be raised if the library implementation does not follow TS 18661.
10338 @item -fsingle-precision-constant
10339 @opindex fsingle-precision-constant
10340 Treat floating-point constants as single precision instead of
10341 implicitly converting them to double-precision constants.
10343 @item -fcx-limited-range
10344 @opindex fcx-limited-range
10345 When enabled, this option states that a range reduction step is not
10346 needed when performing complex division.  Also, there is no checking
10347 whether the result of a complex multiplication or division is @code{NaN
10348 + I*NaN}, with an attempt to rescue the situation in that case.  The
10349 default is @option{-fno-cx-limited-range}, but is enabled by
10350 @option{-ffast-math}.
10352 This option controls the default setting of the ISO C99
10353 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
10354 all languages.
10356 @item -fcx-fortran-rules
10357 @opindex fcx-fortran-rules
10358 Complex multiplication and division follow Fortran rules.  Range
10359 reduction is done as part of complex division, but there is no checking
10360 whether the result of a complex multiplication or division is @code{NaN
10361 + I*NaN}, with an attempt to rescue the situation in that case.
10363 The default is @option{-fno-cx-fortran-rules}.
10365 @end table
10367 The following options control optimizations that may improve
10368 performance, but are not enabled by any @option{-O} options.  This
10369 section includes experimental options that may produce broken code.
10371 @table @gcctabopt
10372 @item -fbranch-probabilities
10373 @opindex fbranch-probabilities
10374 After running a program compiled with @option{-fprofile-arcs}
10375 (@pxref{Instrumentation Options}),
10376 you can compile it a second time using
10377 @option{-fbranch-probabilities}, to improve optimizations based on
10378 the number of times each branch was taken.  When a program
10379 compiled with @option{-fprofile-arcs} exits, it saves arc execution
10380 counts to a file called @file{@var{sourcename}.gcda} for each source
10381 file.  The information in this data file is very dependent on the
10382 structure of the generated code, so you must use the same source code
10383 and the same optimization options for both compilations.
10385 With @option{-fbranch-probabilities}, GCC puts a
10386 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
10387 These can be used to improve optimization.  Currently, they are only
10388 used in one place: in @file{reorg.c}, instead of guessing which path a
10389 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
10390 exactly determine which path is taken more often.
10392 @item -fprofile-values
10393 @opindex fprofile-values
10394 If combined with @option{-fprofile-arcs}, it adds code so that some
10395 data about values of expressions in the program is gathered.
10397 With @option{-fbranch-probabilities}, it reads back the data gathered
10398 from profiling values of expressions for usage in optimizations.
10400 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
10402 @item -fprofile-reorder-functions
10403 @opindex fprofile-reorder-functions
10404 Function reordering based on profile instrumentation collects
10405 first time of execution of a function and orders these functions
10406 in ascending order.
10408 Enabled with @option{-fprofile-use}.
10410 @item -fvpt
10411 @opindex fvpt
10412 If combined with @option{-fprofile-arcs}, this option instructs the compiler
10413 to add code to gather information about values of expressions.
10415 With @option{-fbranch-probabilities}, it reads back the data gathered
10416 and actually performs the optimizations based on them.
10417 Currently the optimizations include specialization of division operations
10418 using the knowledge about the value of the denominator.
10420 @item -frename-registers
10421 @opindex frename-registers
10422 Attempt to avoid false dependencies in scheduled code by making use
10423 of registers left over after register allocation.  This optimization
10424 most benefits processors with lots of registers.  Depending on the
10425 debug information format adopted by the target, however, it can
10426 make debugging impossible, since variables no longer stay in
10427 a ``home register''.
10429 Enabled by default with @option{-funroll-loops}.
10431 @item -fschedule-fusion
10432 @opindex fschedule-fusion
10433 Performs a target dependent pass over the instruction stream to schedule
10434 instructions of same type together because target machine can execute them
10435 more efficiently if they are adjacent to each other in the instruction flow.
10437 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
10439 @item -ftracer
10440 @opindex ftracer
10441 Perform tail duplication to enlarge superblock size.  This transformation
10442 simplifies the control flow of the function allowing other optimizations to do
10443 a better job.
10445 Enabled with @option{-fprofile-use}.
10447 @item -funroll-loops
10448 @opindex funroll-loops
10449 Unroll loops whose number of iterations can be determined at compile time or
10450 upon entry to the loop.  @option{-funroll-loops} implies
10451 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
10452 It also turns on complete loop peeling (i.e.@: complete removal of loops with
10453 a small constant number of iterations).  This option makes code larger, and may
10454 or may not make it run faster.
10456 Enabled with @option{-fprofile-use}.
10458 @item -funroll-all-loops
10459 @opindex funroll-all-loops
10460 Unroll all loops, even if their number of iterations is uncertain when
10461 the loop is entered.  This usually makes programs run more slowly.
10462 @option{-funroll-all-loops} implies the same options as
10463 @option{-funroll-loops}.
10465 @item -fpeel-loops
10466 @opindex fpeel-loops
10467 Peels loops for which there is enough information that they do not
10468 roll much (from profile feedback or static analysis).  It also turns on
10469 complete loop peeling (i.e.@: complete removal of loops with small constant
10470 number of iterations).
10472 Enabled with @option{-O3} and/or @option{-fprofile-use}.
10474 @item -fmove-loop-invariants
10475 @opindex fmove-loop-invariants
10476 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
10477 at level @option{-O1}
10479 @item -fsplit-loops
10480 @opindex fsplit-loops
10481 Split a loop into two if it contains a condition that's always true
10482 for one side of the iteration space and false for the other.
10484 @item -funswitch-loops
10485 @opindex funswitch-loops
10486 Move branches with loop invariant conditions out of the loop, with duplicates
10487 of the loop on both branches (modified according to result of the condition).
10489 @item -ffunction-sections
10490 @itemx -fdata-sections
10491 @opindex ffunction-sections
10492 @opindex fdata-sections
10493 Place each function or data item into its own section in the output
10494 file if the target supports arbitrary sections.  The name of the
10495 function or the name of the data item determines the section's name
10496 in the output file.
10498 Use these options on systems where the linker can perform optimizations to
10499 improve locality of reference in the instruction space.  Most systems using the
10500 ELF object format have linkers with such optimizations.  On AIX, the linker
10501 rearranges sections (CSECTs) based on the call graph.  The performance impact
10502 varies.
10504 Together with a linker garbage collection (linker @option{--gc-sections}
10505 option) these options may lead to smaller statically-linked executables (after
10506 stripping).
10508 On ELF/DWARF systems these options do not degenerate the quality of the debug
10509 information.  There could be issues with other object files/debug info formats.
10511 Only use these options when there are significant benefits from doing so.  When
10512 you specify these options, the assembler and linker create larger object and
10513 executable files and are also slower.  These options affect code generation.
10514 They prevent optimizations by the compiler and assembler using relative
10515 locations inside a translation unit since the locations are unknown until
10516 link time.  An example of such an optimization is relaxing calls to short call
10517 instructions.
10519 @item -fbranch-target-load-optimize
10520 @opindex fbranch-target-load-optimize
10521 Perform branch target register load optimization before prologue / epilogue
10522 threading.
10523 The use of target registers can typically be exposed only during reload,
10524 thus hoisting loads out of loops and doing inter-block scheduling needs
10525 a separate optimization pass.
10527 @item -fbranch-target-load-optimize2
10528 @opindex fbranch-target-load-optimize2
10529 Perform branch target register load optimization after prologue / epilogue
10530 threading.
10532 @item -fbtr-bb-exclusive
10533 @opindex fbtr-bb-exclusive
10534 When performing branch target register load optimization, don't reuse
10535 branch target registers within any basic block.
10537 @item -fstdarg-opt
10538 @opindex fstdarg-opt
10539 Optimize the prologue of variadic argument functions with respect to usage of
10540 those arguments.
10542 @item -fsection-anchors
10543 @opindex fsection-anchors
10544 Try to reduce the number of symbolic address calculations by using
10545 shared ``anchor'' symbols to address nearby objects.  This transformation
10546 can help to reduce the number of GOT entries and GOT accesses on some
10547 targets.
10549 For example, the implementation of the following function @code{foo}:
10551 @smallexample
10552 static int a, b, c;
10553 int foo (void) @{ return a + b + c; @}
10554 @end smallexample
10556 @noindent
10557 usually calculates the addresses of all three variables, but if you
10558 compile it with @option{-fsection-anchors}, it accesses the variables
10559 from a common anchor point instead.  The effect is similar to the
10560 following pseudocode (which isn't valid C):
10562 @smallexample
10563 int foo (void)
10565   register int *xr = &x;
10566   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
10568 @end smallexample
10570 Not all targets support this option.
10572 @item --param @var{name}=@var{value}
10573 @opindex param
10574 In some places, GCC uses various constants to control the amount of
10575 optimization that is done.  For example, GCC does not inline functions
10576 that contain more than a certain number of instructions.  You can
10577 control some of these constants on the command line using the
10578 @option{--param} option.
10580 The names of specific parameters, and the meaning of the values, are
10581 tied to the internals of the compiler, and are subject to change
10582 without notice in future releases.
10584 In order to get minimal, maximal and default value of a parameter,
10585 one can use @option{--help=param -Q} options.
10587 In each case, the @var{value} is an integer.  The allowable choices for
10588 @var{name} are:
10590 @table @gcctabopt
10591 @item predictable-branch-outcome
10592 When branch is predicted to be taken with probability lower than this threshold
10593 (in percent), then it is considered well predictable.
10595 @item max-rtl-if-conversion-insns
10596 RTL if-conversion tries to remove conditional branches around a block and
10597 replace them with conditionally executed instructions.  This parameter
10598 gives the maximum number of instructions in a block which should be
10599 considered for if-conversion.  The compiler will
10600 also use other heuristics to decide whether if-conversion is likely to be
10601 profitable.
10603 @item max-rtl-if-conversion-predictable-cost
10604 @itemx max-rtl-if-conversion-unpredictable-cost
10605 RTL if-conversion will try to remove conditional branches around a block
10606 and replace them with conditionally executed instructions.  These parameters
10607 give the maximum permissible cost for the sequence that would be generated
10608 by if-conversion depending on whether the branch is statically determined
10609 to be predictable or not.  The units for this parameter are the same as
10610 those for the GCC internal seq_cost metric.  The compiler will try to
10611 provide a reasonable default for this parameter using the BRANCH_COST
10612 target macro.
10614 @item max-crossjump-edges
10615 The maximum number of incoming edges to consider for cross-jumping.
10616 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
10617 the number of edges incoming to each block.  Increasing values mean
10618 more aggressive optimization, making the compilation time increase with
10619 probably small improvement in executable size.
10621 @item min-crossjump-insns
10622 The minimum number of instructions that must be matched at the end
10623 of two blocks before cross-jumping is performed on them.  This
10624 value is ignored in the case where all instructions in the block being
10625 cross-jumped from are matched.
10627 @item max-grow-copy-bb-insns
10628 The maximum code size expansion factor when copying basic blocks
10629 instead of jumping.  The expansion is relative to a jump instruction.
10631 @item max-goto-duplication-insns
10632 The maximum number of instructions to duplicate to a block that jumps
10633 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
10634 passes, GCC factors computed gotos early in the compilation process,
10635 and unfactors them as late as possible.  Only computed jumps at the
10636 end of a basic blocks with no more than max-goto-duplication-insns are
10637 unfactored.
10639 @item max-delay-slot-insn-search
10640 The maximum number of instructions to consider when looking for an
10641 instruction to fill a delay slot.  If more than this arbitrary number of
10642 instructions are searched, the time savings from filling the delay slot
10643 are minimal, so stop searching.  Increasing values mean more
10644 aggressive optimization, making the compilation time increase with probably
10645 small improvement in execution time.
10647 @item max-delay-slot-live-search
10648 When trying to fill delay slots, the maximum number of instructions to
10649 consider when searching for a block with valid live register
10650 information.  Increasing this arbitrarily chosen value means more
10651 aggressive optimization, increasing the compilation time.  This parameter
10652 should be removed when the delay slot code is rewritten to maintain the
10653 control-flow graph.
10655 @item max-gcse-memory
10656 The approximate maximum amount of memory that can be allocated in
10657 order to perform the global common subexpression elimination
10658 optimization.  If more memory than specified is required, the
10659 optimization is not done.
10661 @item max-gcse-insertion-ratio
10662 If the ratio of expression insertions to deletions is larger than this value
10663 for any expression, then RTL PRE inserts or removes the expression and thus
10664 leaves partially redundant computations in the instruction stream.
10666 @item max-pending-list-length
10667 The maximum number of pending dependencies scheduling allows
10668 before flushing the current state and starting over.  Large functions
10669 with few branches or calls can create excessively large lists which
10670 needlessly consume memory and resources.
10672 @item max-modulo-backtrack-attempts
10673 The maximum number of backtrack attempts the scheduler should make
10674 when modulo scheduling a loop.  Larger values can exponentially increase
10675 compilation time.
10677 @item max-inline-insns-single
10678 Several parameters control the tree inliner used in GCC@.
10679 This number sets the maximum number of instructions (counted in GCC's
10680 internal representation) in a single function that the tree inliner
10681 considers for inlining.  This only affects functions declared
10682 inline and methods implemented in a class declaration (C++).
10684 @item max-inline-insns-auto
10685 When you use @option{-finline-functions} (included in @option{-O3}),
10686 a lot of functions that would otherwise not be considered for inlining
10687 by the compiler are investigated.  To those functions, a different
10688 (more restrictive) limit compared to functions declared inline can
10689 be applied.
10691 @item inline-min-speedup
10692 When estimated performance improvement of caller + callee runtime exceeds this
10693 threshold (in percent), the function can be inlined regardless of the limit on
10694 @option{--param max-inline-insns-single} and @option{--param
10695 max-inline-insns-auto}.
10697 @item large-function-insns
10698 The limit specifying really large functions.  For functions larger than this
10699 limit after inlining, inlining is constrained by
10700 @option{--param large-function-growth}.  This parameter is useful primarily
10701 to avoid extreme compilation time caused by non-linear algorithms used by the
10702 back end.
10704 @item large-function-growth
10705 Specifies maximal growth of large function caused by inlining in percents.
10706 For example, parameter value 100 limits large function growth to 2.0 times
10707 the original size.
10709 @item large-unit-insns
10710 The limit specifying large translation unit.  Growth caused by inlining of
10711 units larger than this limit is limited by @option{--param inline-unit-growth}.
10712 For small units this might be too tight.
10713 For example, consider a unit consisting of function A
10714 that is inline and B that just calls A three times.  If B is small relative to
10715 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
10716 large units consisting of small inlineable functions, however, the overall unit
10717 growth limit is needed to avoid exponential explosion of code size.  Thus for
10718 smaller units, the size is increased to @option{--param large-unit-insns}
10719 before applying @option{--param inline-unit-growth}.
10721 @item inline-unit-growth
10722 Specifies maximal overall growth of the compilation unit caused by inlining.
10723 For example, parameter value 20 limits unit growth to 1.2 times the original
10724 size. Cold functions (either marked cold via an attribute or by profile
10725 feedback) are not accounted into the unit size.
10727 @item ipcp-unit-growth
10728 Specifies maximal overall growth of the compilation unit caused by
10729 interprocedural constant propagation.  For example, parameter value 10 limits
10730 unit growth to 1.1 times the original size.
10732 @item large-stack-frame
10733 The limit specifying large stack frames.  While inlining the algorithm is trying
10734 to not grow past this limit too much.
10736 @item large-stack-frame-growth
10737 Specifies maximal growth of large stack frames caused by inlining in percents.
10738 For example, parameter value 1000 limits large stack frame growth to 11 times
10739 the original size.
10741 @item max-inline-insns-recursive
10742 @itemx max-inline-insns-recursive-auto
10743 Specifies the maximum number of instructions an out-of-line copy of a
10744 self-recursive inline
10745 function can grow into by performing recursive inlining.
10747 @option{--param max-inline-insns-recursive} applies to functions
10748 declared inline.
10749 For functions not declared inline, recursive inlining
10750 happens only when @option{-finline-functions} (included in @option{-O3}) is
10751 enabled; @option{--param max-inline-insns-recursive-auto} applies instead.
10753 @item max-inline-recursive-depth
10754 @itemx max-inline-recursive-depth-auto
10755 Specifies the maximum recursion depth used for recursive inlining.
10757 @option{--param max-inline-recursive-depth} applies to functions
10758 declared inline.  For functions not declared inline, recursive inlining
10759 happens only when @option{-finline-functions} (included in @option{-O3}) is
10760 enabled; @option{--param max-inline-recursive-depth-auto} applies instead.
10762 @item min-inline-recursive-probability
10763 Recursive inlining is profitable only for function having deep recursion
10764 in average and can hurt for function having little recursion depth by
10765 increasing the prologue size or complexity of function body to other
10766 optimizers.
10768 When profile feedback is available (see @option{-fprofile-generate}) the actual
10769 recursion depth can be guessed from the probability that function recurses
10770 via a given call expression.  This parameter limits inlining only to call
10771 expressions whose probability exceeds the given threshold (in percents).
10773 @item early-inlining-insns
10774 Specify growth that the early inliner can make.  In effect it increases
10775 the amount of inlining for code having a large abstraction penalty.
10777 @item max-early-inliner-iterations
10778 Limit of iterations of the early inliner.  This basically bounds
10779 the number of nested indirect calls the early inliner can resolve.
10780 Deeper chains are still handled by late inlining.
10782 @item comdat-sharing-probability
10783 Probability (in percent) that C++ inline function with comdat visibility
10784 are shared across multiple compilation units.
10786 @item profile-func-internal-id
10787 A parameter to control whether to use function internal id in profile
10788 database lookup. If the value is 0, the compiler uses an id that
10789 is based on function assembler name and filename, which makes old profile
10790 data more tolerant to source changes such as function reordering etc.
10792 @item min-vect-loop-bound
10793 The minimum number of iterations under which loops are not vectorized
10794 when @option{-ftree-vectorize} is used.  The number of iterations after
10795 vectorization needs to be greater than the value specified by this option
10796 to allow vectorization.
10798 @item gcse-cost-distance-ratio
10799 Scaling factor in calculation of maximum distance an expression
10800 can be moved by GCSE optimizations.  This is currently supported only in the
10801 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
10802 is with simple expressions, i.e., the expressions that have cost
10803 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
10804 hoisting of simple expressions.
10806 @item gcse-unrestricted-cost
10807 Cost, roughly measured as the cost of a single typical machine
10808 instruction, at which GCSE optimizations do not constrain
10809 the distance an expression can travel.  This is currently
10810 supported only in the code hoisting pass.  The lesser the cost,
10811 the more aggressive code hoisting is.  Specifying 0 
10812 allows all expressions to travel unrestricted distances.
10814 @item max-hoist-depth
10815 The depth of search in the dominator tree for expressions to hoist.
10816 This is used to avoid quadratic behavior in hoisting algorithm.
10817 The value of 0 does not limit on the search, but may slow down compilation
10818 of huge functions.
10820 @item max-tail-merge-comparisons
10821 The maximum amount of similar bbs to compare a bb with.  This is used to
10822 avoid quadratic behavior in tree tail merging.
10824 @item max-tail-merge-iterations
10825 The maximum amount of iterations of the pass over the function.  This is used to
10826 limit compilation time in tree tail merging.
10828 @item store-merging-allow-unaligned
10829 Allow the store merging pass to introduce unaligned stores if it is legal to
10830 do so.
10832 @item max-stores-to-merge
10833 The maximum number of stores to attempt to merge into wider stores in the store
10834 merging pass.
10836 @item max-unrolled-insns
10837 The maximum number of instructions that a loop may have to be unrolled.
10838 If a loop is unrolled, this parameter also determines how many times
10839 the loop code is unrolled.
10841 @item max-average-unrolled-insns
10842 The maximum number of instructions biased by probabilities of their execution
10843 that a loop may have to be unrolled.  If a loop is unrolled,
10844 this parameter also determines how many times the loop code is unrolled.
10846 @item max-unroll-times
10847 The maximum number of unrollings of a single loop.
10849 @item max-peeled-insns
10850 The maximum number of instructions that a loop may have to be peeled.
10851 If a loop is peeled, this parameter also determines how many times
10852 the loop code is peeled.
10854 @item max-peel-times
10855 The maximum number of peelings of a single loop.
10857 @item max-peel-branches
10858 The maximum number of branches on the hot path through the peeled sequence.
10860 @item max-completely-peeled-insns
10861 The maximum number of insns of a completely peeled loop.
10863 @item max-completely-peel-times
10864 The maximum number of iterations of a loop to be suitable for complete peeling.
10866 @item max-completely-peel-loop-nest-depth
10867 The maximum depth of a loop nest suitable for complete peeling.
10869 @item max-unswitch-insns
10870 The maximum number of insns of an unswitched loop.
10872 @item max-unswitch-level
10873 The maximum number of branches unswitched in a single loop.
10875 @item lim-expensive
10876 The minimum cost of an expensive expression in the loop invariant motion.
10878 @item iv-consider-all-candidates-bound
10879 Bound on number of candidates for induction variables, below which
10880 all candidates are considered for each use in induction variable
10881 optimizations.  If there are more candidates than this,
10882 only the most relevant ones are considered to avoid quadratic time complexity.
10884 @item iv-max-considered-uses
10885 The induction variable optimizations give up on loops that contain more
10886 induction variable uses.
10888 @item iv-always-prune-cand-set-bound
10889 If the number of candidates in the set is smaller than this value,
10890 always try to remove unnecessary ivs from the set
10891 when adding a new one.
10893 @item avg-loop-niter
10894 Average number of iterations of a loop.
10896 @item dse-max-object-size
10897 Maximum size (in bytes) of objects tracked bytewise by dead store elimination.
10898 Larger values may result in larger compilation times.
10900 @item dse-max-alias-queries-per-store
10901 Maximum number of queries into the alias oracle per store.
10902 Larger values result in larger compilation times and may result in more
10903 removed dead stores.
10905 @item scev-max-expr-size
10906 Bound on size of expressions used in the scalar evolutions analyzer.
10907 Large expressions slow the analyzer.
10909 @item scev-max-expr-complexity
10910 Bound on the complexity of the expressions in the scalar evolutions analyzer.
10911 Complex expressions slow the analyzer.
10913 @item max-tree-if-conversion-phi-args
10914 Maximum number of arguments in a PHI supported by TREE if conversion
10915 unless the loop is marked with simd pragma.
10917 @item vect-max-version-for-alignment-checks
10918 The maximum number of run-time checks that can be performed when
10919 doing loop versioning for alignment in the vectorizer.
10921 @item vect-max-version-for-alias-checks
10922 The maximum number of run-time checks that can be performed when
10923 doing loop versioning for alias in the vectorizer.
10925 @item vect-max-peeling-for-alignment
10926 The maximum number of loop peels to enhance access alignment
10927 for vectorizer. Value -1 means no limit.
10929 @item max-iterations-to-track
10930 The maximum number of iterations of a loop the brute-force algorithm
10931 for analysis of the number of iterations of the loop tries to evaluate.
10933 @item hot-bb-count-ws-permille
10934 A basic block profile count is considered hot if it contributes to 
10935 the given permillage (i.e.@: 0...1000) of the entire profiled execution.
10937 @item hot-bb-frequency-fraction
10938 Select fraction of the entry block frequency of executions of basic block in
10939 function given basic block needs to have to be considered hot.
10941 @item max-predicted-iterations
10942 The maximum number of loop iterations we predict statically.  This is useful
10943 in cases where a function contains a single loop with known bound and
10944 another loop with unknown bound.
10945 The known number of iterations is predicted correctly, while
10946 the unknown number of iterations average to roughly 10.  This means that the
10947 loop without bounds appears artificially cold relative to the other one.
10949 @item builtin-expect-probability
10950 Control the probability of the expression having the specified value. This
10951 parameter takes a percentage (i.e.@: 0 ... 100) as input.
10953 @item builtin-string-cmp-inline-length
10954 The maximum length of a constant string for a builtin string cmp call 
10955 eligible for inlining.
10957 @item align-threshold
10959 Select fraction of the maximal frequency of executions of a basic block in
10960 a function to align the basic block.
10962 @item align-loop-iterations
10964 A loop expected to iterate at least the selected number of iterations is
10965 aligned.
10967 @item tracer-dynamic-coverage
10968 @itemx tracer-dynamic-coverage-feedback
10970 This value is used to limit superblock formation once the given percentage of
10971 executed instructions is covered.  This limits unnecessary code size
10972 expansion.
10974 The @option{tracer-dynamic-coverage-feedback} parameter
10975 is used only when profile
10976 feedback is available.  The real profiles (as opposed to statically estimated
10977 ones) are much less balanced allowing the threshold to be larger value.
10979 @item tracer-max-code-growth
10980 Stop tail duplication once code growth has reached given percentage.  This is
10981 a rather artificial limit, as most of the duplicates are eliminated later in
10982 cross jumping, so it may be set to much higher values than is the desired code
10983 growth.
10985 @item tracer-min-branch-ratio
10987 Stop reverse growth when the reverse probability of best edge is less than this
10988 threshold (in percent).
10990 @item tracer-min-branch-probability
10991 @itemx tracer-min-branch-probability-feedback
10993 Stop forward growth if the best edge has probability lower than this
10994 threshold.
10996 Similarly to @option{tracer-dynamic-coverage} two parameters are
10997 provided.  @option{tracer-min-branch-probability-feedback} is used for
10998 compilation with profile feedback and @option{tracer-min-branch-probability}
10999 compilation without.  The value for compilation with profile feedback
11000 needs to be more conservative (higher) in order to make tracer
11001 effective.
11003 @item stack-clash-protection-guard-size
11004 Specify the size of the operating system provided stack guard as
11005 2 raised to @var{num} bytes.  Higher values may reduce the
11006 number of explicit probes, but a value larger than the operating system
11007 provided guard will leave code vulnerable to stack clash style attacks.
11009 @item stack-clash-protection-probe-interval
11010 Stack clash protection involves probing stack space as it is allocated.  This
11011 param controls the maximum distance between probes into the stack as 2 raised
11012 to @var{num} bytes.  Higher values may reduce the number of explicit probes, but a value
11013 larger than the operating system provided guard will leave code vulnerable to
11014 stack clash style attacks.
11016 @item max-cse-path-length
11018 The maximum number of basic blocks on path that CSE considers.
11020 @item max-cse-insns
11021 The maximum number of instructions CSE processes before flushing.
11023 @item ggc-min-expand
11025 GCC uses a garbage collector to manage its own memory allocation.  This
11026 parameter specifies the minimum percentage by which the garbage
11027 collector's heap should be allowed to expand between collections.
11028 Tuning this may improve compilation speed; it has no effect on code
11029 generation.
11031 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
11032 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
11033 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
11034 GCC is not able to calculate RAM on a particular platform, the lower
11035 bound of 30% is used.  Setting this parameter and
11036 @option{ggc-min-heapsize} to zero causes a full collection to occur at
11037 every opportunity.  This is extremely slow, but can be useful for
11038 debugging.
11040 @item ggc-min-heapsize
11042 Minimum size of the garbage collector's heap before it begins bothering
11043 to collect garbage.  The first collection occurs after the heap expands
11044 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
11045 tuning this may improve compilation speed, and has no effect on code
11046 generation.
11048 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
11049 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
11050 with a lower bound of 4096 (four megabytes) and an upper bound of
11051 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
11052 particular platform, the lower bound is used.  Setting this parameter
11053 very large effectively disables garbage collection.  Setting this
11054 parameter and @option{ggc-min-expand} to zero causes a full collection
11055 to occur at every opportunity.
11057 @item max-reload-search-insns
11058 The maximum number of instruction reload should look backward for equivalent
11059 register.  Increasing values mean more aggressive optimization, making the
11060 compilation time increase with probably slightly better performance.
11062 @item max-cselib-memory-locations
11063 The maximum number of memory locations cselib should take into account.
11064 Increasing values mean more aggressive optimization, making the compilation time
11065 increase with probably slightly better performance.
11067 @item max-sched-ready-insns
11068 The maximum number of instructions ready to be issued the scheduler should
11069 consider at any given time during the first scheduling pass.  Increasing
11070 values mean more thorough searches, making the compilation time increase
11071 with probably little benefit.
11073 @item max-sched-region-blocks
11074 The maximum number of blocks in a region to be considered for
11075 interblock scheduling.
11077 @item max-pipeline-region-blocks
11078 The maximum number of blocks in a region to be considered for
11079 pipelining in the selective scheduler.
11081 @item max-sched-region-insns
11082 The maximum number of insns in a region to be considered for
11083 interblock scheduling.
11085 @item max-pipeline-region-insns
11086 The maximum number of insns in a region to be considered for
11087 pipelining in the selective scheduler.
11089 @item min-spec-prob
11090 The minimum probability (in percents) of reaching a source block
11091 for interblock speculative scheduling.
11093 @item max-sched-extend-regions-iters
11094 The maximum number of iterations through CFG to extend regions.
11095 A value of 0 disables region extensions.
11097 @item max-sched-insn-conflict-delay
11098 The maximum conflict delay for an insn to be considered for speculative motion.
11100 @item sched-spec-prob-cutoff
11101 The minimal probability of speculation success (in percents), so that
11102 speculative insns are scheduled.
11104 @item sched-state-edge-prob-cutoff
11105 The minimum probability an edge must have for the scheduler to save its
11106 state across it.
11108 @item sched-mem-true-dep-cost
11109 Minimal distance (in CPU cycles) between store and load targeting same
11110 memory locations.
11112 @item selsched-max-lookahead
11113 The maximum size of the lookahead window of selective scheduling.  It is a
11114 depth of search for available instructions.
11116 @item selsched-max-sched-times
11117 The maximum number of times that an instruction is scheduled during
11118 selective scheduling.  This is the limit on the number of iterations
11119 through which the instruction may be pipelined.
11121 @item selsched-insns-to-rename
11122 The maximum number of best instructions in the ready list that are considered
11123 for renaming in the selective scheduler.
11125 @item sms-min-sc
11126 The minimum value of stage count that swing modulo scheduler
11127 generates.
11129 @item max-last-value-rtl
11130 The maximum size measured as number of RTLs that can be recorded in an expression
11131 in combiner for a pseudo register as last known value of that register.
11133 @item max-combine-insns
11134 The maximum number of instructions the RTL combiner tries to combine.
11136 @item integer-share-limit
11137 Small integer constants can use a shared data structure, reducing the
11138 compiler's memory usage and increasing its speed.  This sets the maximum
11139 value of a shared integer constant.
11141 @item ssp-buffer-size
11142 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
11143 protection when @option{-fstack-protection} is used.
11145 @item min-size-for-stack-sharing
11146 The minimum size of variables taking part in stack slot sharing when not
11147 optimizing.
11149 @item max-jump-thread-duplication-stmts
11150 Maximum number of statements allowed in a block that needs to be
11151 duplicated when threading jumps.
11153 @item max-fields-for-field-sensitive
11154 Maximum number of fields in a structure treated in
11155 a field sensitive manner during pointer analysis.
11157 @item prefetch-latency
11158 Estimate on average number of instructions that are executed before
11159 prefetch finishes.  The distance prefetched ahead is proportional
11160 to this constant.  Increasing this number may also lead to less
11161 streams being prefetched (see @option{simultaneous-prefetches}).
11163 @item simultaneous-prefetches
11164 Maximum number of prefetches that can run at the same time.
11166 @item l1-cache-line-size
11167 The size of cache line in L1 data cache, in bytes.
11169 @item l1-cache-size
11170 The size of L1 data cache, in kilobytes.
11172 @item l2-cache-size
11173 The size of L2 data cache, in kilobytes.
11175 @item prefetch-dynamic-strides
11176 Whether the loop array prefetch pass should issue software prefetch hints
11177 for strides that are non-constant.  In some cases this may be
11178 beneficial, though the fact the stride is non-constant may make it
11179 hard to predict when there is clear benefit to issuing these hints.
11181 Set to 1 if the prefetch hints should be issued for non-constant
11182 strides.  Set to 0 if prefetch hints should be issued only for strides that
11183 are known to be constant and below @option{prefetch-minimum-stride}.
11185 @item prefetch-minimum-stride
11186 Minimum constant stride, in bytes, to start using prefetch hints for.  If
11187 the stride is less than this threshold, prefetch hints will not be issued.
11189 This setting is useful for processors that have hardware prefetchers, in
11190 which case there may be conflicts between the hardware prefetchers and
11191 the software prefetchers.  If the hardware prefetchers have a maximum
11192 stride they can handle, it should be used here to improve the use of
11193 software prefetchers.
11195 A value of -1 means we don't have a threshold and therefore
11196 prefetch hints can be issued for any constant stride.
11198 This setting is only useful for strides that are known and constant.
11200 @item loop-interchange-max-num-stmts
11201 The maximum number of stmts in a loop to be interchanged.
11203 @item loop-interchange-stride-ratio
11204 The minimum ratio between stride of two loops for interchange to be profitable.
11206 @item min-insn-to-prefetch-ratio
11207 The minimum ratio between the number of instructions and the
11208 number of prefetches to enable prefetching in a loop.
11210 @item prefetch-min-insn-to-mem-ratio
11211 The minimum ratio between the number of instructions and the
11212 number of memory references to enable prefetching in a loop.
11214 @item use-canonical-types
11215 Whether the compiler should use the ``canonical'' type system.
11216 Should always be 1, which uses a more efficient internal
11217 mechanism for comparing types in C++ and Objective-C++.  However, if
11218 bugs in the canonical type system are causing compilation failures,
11219 set this value to 0 to disable canonical types.
11221 @item switch-conversion-max-branch-ratio
11222 Switch initialization conversion refuses to create arrays that are
11223 bigger than @option{switch-conversion-max-branch-ratio} times the number of
11224 branches in the switch.
11226 @item max-partial-antic-length
11227 Maximum length of the partial antic set computed during the tree
11228 partial redundancy elimination optimization (@option{-ftree-pre}) when
11229 optimizing at @option{-O3} and above.  For some sorts of source code
11230 the enhanced partial redundancy elimination optimization can run away,
11231 consuming all of the memory available on the host machine.  This
11232 parameter sets a limit on the length of the sets that are computed,
11233 which prevents the runaway behavior.  Setting a value of 0 for
11234 this parameter allows an unlimited set length.
11236 @item rpo-vn-max-loop-depth
11237 Maximum loop depth that is value-numbered optimistically.
11238 When the limit hits the innermost
11239 @var{rpo-vn-max-loop-depth} loops and the outermost loop in the
11240 loop nest are value-numbered optimistically and the remaining ones not.
11242 @item sccvn-max-alias-queries-per-access
11243 Maximum number of alias-oracle queries we perform when looking for
11244 redundancies for loads and stores.  If this limit is hit the search
11245 is aborted and the load or store is not considered redundant.  The
11246 number of queries is algorithmically limited to the number of
11247 stores on all paths from the load to the function entry.
11249 @item ira-max-loops-num
11250 IRA uses regional register allocation by default.  If a function
11251 contains more loops than the number given by this parameter, only at most
11252 the given number of the most frequently-executed loops form regions
11253 for regional register allocation.
11255 @item ira-max-conflict-table-size 
11256 Although IRA uses a sophisticated algorithm to compress the conflict
11257 table, the table can still require excessive amounts of memory for
11258 huge functions.  If the conflict table for a function could be more
11259 than the size in MB given by this parameter, the register allocator
11260 instead uses a faster, simpler, and lower-quality
11261 algorithm that does not require building a pseudo-register conflict table.  
11263 @item ira-loop-reserved-regs
11264 IRA can be used to evaluate more accurate register pressure in loops
11265 for decisions to move loop invariants (see @option{-O3}).  The number
11266 of available registers reserved for some other purposes is given
11267 by this parameter.  Default of the parameter
11268 is the best found from numerous experiments.
11270 @item lra-inheritance-ebb-probability-cutoff
11271 LRA tries to reuse values reloaded in registers in subsequent insns.
11272 This optimization is called inheritance.  EBB is used as a region to
11273 do this optimization.  The parameter defines a minimal fall-through
11274 edge probability in percentage used to add BB to inheritance EBB in
11275 LRA.  The default value was chosen
11276 from numerous runs of SPEC2000 on x86-64.
11278 @item loop-invariant-max-bbs-in-loop
11279 Loop invariant motion can be very expensive, both in compilation time and
11280 in amount of needed compile-time memory, with very large loops.  Loops
11281 with more basic blocks than this parameter won't have loop invariant
11282 motion optimization performed on them.
11284 @item loop-max-datarefs-for-datadeps
11285 Building data dependencies is expensive for very large loops.  This
11286 parameter limits the number of data references in loops that are
11287 considered for data dependence analysis.  These large loops are no
11288 handled by the optimizations using loop data dependencies.
11290 @item max-vartrack-size
11291 Sets a maximum number of hash table slots to use during variable
11292 tracking dataflow analysis of any function.  If this limit is exceeded
11293 with variable tracking at assignments enabled, analysis for that
11294 function is retried without it, after removing all debug insns from
11295 the function.  If the limit is exceeded even without debug insns, var
11296 tracking analysis is completely disabled for the function.  Setting
11297 the parameter to zero makes it unlimited.
11299 @item max-vartrack-expr-depth
11300 Sets a maximum number of recursion levels when attempting to map
11301 variable names or debug temporaries to value expressions.  This trades
11302 compilation time for more complete debug information.  If this is set too
11303 low, value expressions that are available and could be represented in
11304 debug information may end up not being used; setting this higher may
11305 enable the compiler to find more complex debug expressions, but compile
11306 time and memory use may grow.
11308 @item max-debug-marker-count
11309 Sets a threshold on the number of debug markers (e.g.@: begin stmt
11310 markers) to avoid complexity explosion at inlining or expanding to RTL.
11311 If a function has more such gimple stmts than the set limit, such stmts
11312 will be dropped from the inlined copy of a function, and from its RTL
11313 expansion.
11315 @item min-nondebug-insn-uid
11316 Use uids starting at this parameter for nondebug insns.  The range below
11317 the parameter is reserved exclusively for debug insns created by
11318 @option{-fvar-tracking-assignments}, but debug insns may get
11319 (non-overlapping) uids above it if the reserved range is exhausted.
11321 @item ipa-sra-ptr-growth-factor
11322 IPA-SRA replaces a pointer to an aggregate with one or more new
11323 parameters only when their cumulative size is less or equal to
11324 @option{ipa-sra-ptr-growth-factor} times the size of the original
11325 pointer parameter.
11327 @item sra-max-scalarization-size-Ospeed
11328 @itemx sra-max-scalarization-size-Osize
11329 The two Scalar Reduction of Aggregates passes (SRA and IPA-SRA) aim to
11330 replace scalar parts of aggregates with uses of independent scalar
11331 variables.  These parameters control the maximum size, in storage units,
11332 of aggregate which is considered for replacement when compiling for
11333 speed
11334 (@option{sra-max-scalarization-size-Ospeed}) or size
11335 (@option{sra-max-scalarization-size-Osize}) respectively.
11337 @item tm-max-aggregate-size
11338 When making copies of thread-local variables in a transaction, this
11339 parameter specifies the size in bytes after which variables are
11340 saved with the logging functions as opposed to save/restore code
11341 sequence pairs.  This option only applies when using
11342 @option{-fgnu-tm}.
11344 @item graphite-max-nb-scop-params
11345 To avoid exponential effects in the Graphite loop transforms, the
11346 number of parameters in a Static Control Part (SCoP) is bounded.
11347 A value of zero can be used to lift
11348 the bound.  A variable whose value is unknown at compilation time and
11349 defined outside a SCoP is a parameter of the SCoP.
11351 @item loop-block-tile-size
11352 Loop blocking or strip mining transforms, enabled with
11353 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
11354 loop in the loop nest by a given number of iterations.  The strip
11355 length can be changed using the @option{loop-block-tile-size}
11356 parameter.
11358 @item ipa-cp-value-list-size
11359 IPA-CP attempts to track all possible values and types passed to a function's
11360 parameter in order to propagate them and perform devirtualization.
11361 @option{ipa-cp-value-list-size} is the maximum number of values and types it
11362 stores per one formal parameter of a function.
11364 @item ipa-cp-eval-threshold
11365 IPA-CP calculates its own score of cloning profitability heuristics
11366 and performs those cloning opportunities with scores that exceed
11367 @option{ipa-cp-eval-threshold}.
11369 @item ipa-cp-recursion-penalty
11370 Percentage penalty the recursive functions will receive when they
11371 are evaluated for cloning.
11373 @item ipa-cp-single-call-penalty
11374 Percentage penalty functions containing a single call to another
11375 function will receive when they are evaluated for cloning.
11377 @item ipa-max-agg-items
11378 IPA-CP is also capable to propagate a number of scalar values passed
11379 in an aggregate. @option{ipa-max-agg-items} controls the maximum
11380 number of such values per one parameter.
11382 @item ipa-cp-loop-hint-bonus
11383 When IPA-CP determines that a cloning candidate would make the number
11384 of iterations of a loop known, it adds a bonus of
11385 @option{ipa-cp-loop-hint-bonus} to the profitability score of
11386 the candidate.
11388 @item ipa-cp-array-index-hint-bonus
11389 When IPA-CP determines that a cloning candidate would make the index of
11390 an array access known, it adds a bonus of
11391 @option{ipa-cp-array-index-hint-bonus} to the profitability
11392 score of the candidate.
11394 @item ipa-max-aa-steps
11395 During its analysis of function bodies, IPA-CP employs alias analysis
11396 in order to track values pointed to by function parameters.  In order
11397 not spend too much time analyzing huge functions, it gives up and
11398 consider all memory clobbered after examining
11399 @option{ipa-max-aa-steps} statements modifying memory.
11401 @item lto-partitions
11402 Specify desired number of partitions produced during WHOPR compilation.
11403 The number of partitions should exceed the number of CPUs used for compilation.
11405 @item lto-min-partition
11406 Size of minimal partition for WHOPR (in estimated instructions).
11407 This prevents expenses of splitting very small programs into too many
11408 partitions.
11410 @item lto-max-partition
11411 Size of max partition for WHOPR (in estimated instructions).
11412 to provide an upper bound for individual size of partition.
11413 Meant to be used only with balanced partitioning.
11415 @item cxx-max-namespaces-for-diagnostic-help
11416 The maximum number of namespaces to consult for suggestions when C++
11417 name lookup fails for an identifier.
11419 @item sink-frequency-threshold
11420 The maximum relative execution frequency (in percents) of the target block
11421 relative to a statement's original block to allow statement sinking of a
11422 statement.  Larger numbers result in more aggressive statement sinking.
11423 A small positive adjustment is applied for
11424 statements with memory operands as those are even more profitable so sink.
11426 @item max-stores-to-sink
11427 The maximum number of conditional store pairs that can be sunk.  Set to 0
11428 if either vectorization (@option{-ftree-vectorize}) or if-conversion
11429 (@option{-ftree-loop-if-convert}) is disabled.
11431 @item allow-store-data-races
11432 Allow optimizers to introduce new data races on stores.
11433 Set to 1 to allow, otherwise to 0.
11435 @item case-values-threshold
11436 The smallest number of different values for which it is best to use a
11437 jump-table instead of a tree of conditional branches.  If the value is
11438 0, use the default for the machine.
11440 @item tree-reassoc-width
11441 Set the maximum number of instructions executed in parallel in
11442 reassociated tree. This parameter overrides target dependent
11443 heuristics used by default if has non zero value.
11445 @item sched-pressure-algorithm
11446 Choose between the two available implementations of
11447 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
11448 and is the more likely to prevent instructions from being reordered.
11449 Algorithm 2 was designed to be a compromise between the relatively
11450 conservative approach taken by algorithm 1 and the rather aggressive
11451 approach taken by the default scheduler.  It relies more heavily on
11452 having a regular register file and accurate register pressure classes.
11453 See @file{haifa-sched.c} in the GCC sources for more details.
11455 The default choice depends on the target.
11457 @item max-slsr-cand-scan
11458 Set the maximum number of existing candidates that are considered when
11459 seeking a basis for a new straight-line strength reduction candidate.
11461 @item asan-globals
11462 Enable buffer overflow detection for global objects.  This kind
11463 of protection is enabled by default if you are using
11464 @option{-fsanitize=address} option.
11465 To disable global objects protection use @option{--param asan-globals=0}.
11467 @item asan-stack
11468 Enable buffer overflow detection for stack objects.  This kind of
11469 protection is enabled by default when using @option{-fsanitize=address}.
11470 To disable stack protection use @option{--param asan-stack=0} option.
11472 @item asan-instrument-reads
11473 Enable buffer overflow detection for memory reads.  This kind of
11474 protection is enabled by default when using @option{-fsanitize=address}.
11475 To disable memory reads protection use
11476 @option{--param asan-instrument-reads=0}.
11478 @item asan-instrument-writes
11479 Enable buffer overflow detection for memory writes.  This kind of
11480 protection is enabled by default when using @option{-fsanitize=address}.
11481 To disable memory writes protection use
11482 @option{--param asan-instrument-writes=0} option.
11484 @item asan-memintrin
11485 Enable detection for built-in functions.  This kind of protection
11486 is enabled by default when using @option{-fsanitize=address}.
11487 To disable built-in functions protection use
11488 @option{--param asan-memintrin=0}.
11490 @item asan-use-after-return
11491 Enable detection of use-after-return.  This kind of protection
11492 is enabled by default when using the @option{-fsanitize=address} option.
11493 To disable it use @option{--param asan-use-after-return=0}.
11495 Note: By default the check is disabled at run time.  To enable it,
11496 add @code{detect_stack_use_after_return=1} to the environment variable
11497 @env{ASAN_OPTIONS}.
11499 @item asan-instrumentation-with-call-threshold
11500 If number of memory accesses in function being instrumented
11501 is greater or equal to this number, use callbacks instead of inline checks.
11502 E.g. to disable inline code use
11503 @option{--param asan-instrumentation-with-call-threshold=0}.
11505 @item use-after-scope-direct-emission-threshold
11506 If the size of a local variable in bytes is smaller or equal to this
11507 number, directly poison (or unpoison) shadow memory instead of using
11508 run-time callbacks.
11510 @item max-fsm-thread-path-insns
11511 Maximum number of instructions to copy when duplicating blocks on a
11512 finite state automaton jump thread path.
11514 @item max-fsm-thread-length
11515 Maximum number of basic blocks on a finite state automaton jump thread
11516 path.
11518 @item max-fsm-thread-paths
11519 Maximum number of new jump thread paths to create for a finite state
11520 automaton.
11522 @item parloops-chunk-size
11523 Chunk size of omp schedule for loops parallelized by parloops.
11525 @item parloops-schedule
11526 Schedule type of omp schedule for loops parallelized by parloops (static,
11527 dynamic, guided, auto, runtime).
11529 @item parloops-min-per-thread
11530 The minimum number of iterations per thread of an innermost parallelized
11531 loop for which the parallelized variant is preferred over the single threaded
11532 one.  Note that for a parallelized loop nest the
11533 minimum number of iterations of the outermost loop per thread is two.
11535 @item max-ssa-name-query-depth
11536 Maximum depth of recursion when querying properties of SSA names in things
11537 like fold routines.  One level of recursion corresponds to following a
11538 use-def chain.
11540 @item hsa-gen-debug-stores
11541 Enable emission of special debug stores within HSA kernels which are
11542 then read and reported by libgomp plugin.  Generation of these stores
11543 is disabled by default, use @option{--param hsa-gen-debug-stores=1} to
11544 enable it.
11546 @item max-speculative-devirt-maydefs
11547 The maximum number of may-defs we analyze when looking for a must-def
11548 specifying the dynamic type of an object that invokes a virtual call
11549 we may be able to devirtualize speculatively.
11551 @item max-vrp-switch-assertions
11552 The maximum number of assertions to add along the default edge of a switch
11553 statement during VRP.
11555 @item unroll-jam-min-percent
11556 The minimum percentage of memory references that must be optimized
11557 away for the unroll-and-jam transformation to be considered profitable.
11559 @item unroll-jam-max-unroll
11560 The maximum number of times the outer loop should be unrolled by
11561 the unroll-and-jam transformation.
11563 @item max-rtl-if-conversion-unpredictable-cost
11564 Maximum permissible cost for the sequence that would be generated
11565 by the RTL if-conversion pass for a branch that is considered unpredictable.
11567 @item max-variable-expansions-in-unroller
11568 If @option{-fvariable-expansion-in-unroller} is used, the maximum number
11569 of times that an individual variable will be expanded during loop unrolling.
11571 @item tracer-min-branch-probability-feedback
11572 Stop forward growth if the probability of best edge is less than
11573 this threshold (in percent). Used when profile feedback is available.
11575 @item partial-inlining-entry-probability
11576 Maximum probability of the entry BB of split region
11577 (in percent relative to entry BB of the function)
11578 to make partial inlining happen.
11580 @item max-tracked-strlens
11581 Maximum number of strings for which strlen optimization pass will
11582 track string lengths.
11584 @item gcse-after-reload-partial-fraction
11585 The threshold ratio for performing partial redundancy
11586 elimination after reload.
11588 @item gcse-after-reload-critical-fraction
11589 The threshold ratio of critical edges execution count that
11590 permit performing redundancy elimination after reload.
11592 @item max-loop-header-insns
11593 The maximum number of insns in loop header duplicated
11594 by the copy loop headers pass.
11596 @item vect-epilogues-nomask
11597 Enable loop epilogue vectorization using smaller vector size.
11599 @item slp-max-insns-in-bb
11600 Maximum number of instructions in basic block to be
11601 considered for SLP vectorization.
11603 @item avoid-fma-max-bits
11604 Maximum number of bits for which we avoid creating FMAs.
11606 @item sms-loop-average-count-threshold
11607 A threshold on the average loop count considered by the swing modulo scheduler.
11609 @item sms-dfa-history
11610 The number of cycles the swing modulo scheduler considers when checking
11611 conflicts using DFA.
11613 @item hot-bb-count-fraction
11614 Select fraction of the maximal count of repetitions of basic block
11615 in program given basic block needs
11616 to have to be considered hot (used in non-LTO mode)
11618 @item max-inline-insns-recursive-auto
11619 The maximum number of instructions non-inline function
11620 can grow to via recursive inlining.
11622 @item graphite-allow-codegen-errors
11623 Whether codegen errors should be ICEs when @option{-fchecking}.
11625 @item sms-max-ii-factor
11626 A factor for tuning the upper bound that swing modulo scheduler
11627 uses for scheduling a loop.
11629 @item lra-max-considered-reload-pseudos
11630 The max number of reload pseudos which are considered during
11631 spilling a non-reload pseudo.
11633 @item max-pow-sqrt-depth
11634 Maximum depth of sqrt chains to use when synthesizing exponentiation
11635 by a real constant.
11637 @item max-dse-active-local-stores
11638 Maximum number of active local stores in RTL dead store elimination.
11640 @item asan-instrument-allocas
11641 Enable asan allocas/VLAs protection.
11643 @item max-iterations-computation-cost
11644 Bound on the cost of an expression to compute the number of iterations.
11646 @item max-isl-operations
11647 Maximum number of isl operations, 0 means unlimited.
11649 @item graphite-max-arrays-per-scop
11650 Maximum number of arrays per scop.
11652 @item max-vartrack-reverse-op-size
11653 Max. size of loc list for which reverse ops should be added.
11655 @item unlikely-bb-count-fraction
11656 The minimum fraction of profile runs a given basic block execution count
11657 must be not to be considered unlikely.
11659 @item tracer-dynamic-coverage-feedback
11660 The percentage of function, weighted by execution frequency,
11661 that must be covered by trace formation.
11662 Used when profile feedback is available.
11664 @item max-inline-recursive-depth-auto
11665 The maximum depth of recursive inlining for non-inline functions.
11667 @item fsm-scale-path-stmts
11668 Scale factor to apply to the number of statements in a threading path
11669 when comparing to the number of (scaled) blocks.
11671 @item fsm-maximum-phi-arguments
11672 Maximum number of arguments a PHI may have before the FSM threader
11673 will not try to thread through its block.
11675 @item uninit-control-dep-attempts
11676 Maximum number of nested calls to search for control dependencies
11677 during uninitialized variable analysis.
11679 @item indir-call-topn-profile
11680 Track top N target addresses in indirect-call profile.
11682 @item max-once-peeled-insns
11683 The maximum number of insns of a peeled loop that rolls only once.
11685 @item sra-max-scalarization-size-Osize
11686 Maximum size, in storage units, of an aggregate
11687 which should be considered for scalarization when compiling for size.
11689 @item fsm-scale-path-blocks
11690 Scale factor to apply to the number of blocks in a threading path
11691 when comparing to the number of (scaled) statements.
11693 @item sched-autopref-queue-depth
11694 Hardware autoprefetcher scheduler model control flag.
11695 Number of lookahead cycles the model looks into; at '
11696 ' only enable instruction sorting heuristic.
11699 @end table
11700 @end table
11702 @node Instrumentation Options
11703 @section Program Instrumentation Options
11704 @cindex instrumentation options
11705 @cindex program instrumentation options
11706 @cindex run-time error checking options
11707 @cindex profiling options
11708 @cindex options, program instrumentation
11709 @cindex options, run-time error checking
11710 @cindex options, profiling
11712 GCC supports a number of command-line options that control adding
11713 run-time instrumentation to the code it normally generates.  
11714 For example, one purpose of instrumentation is collect profiling
11715 statistics for use in finding program hot spots, code coverage
11716 analysis, or profile-guided optimizations.
11717 Another class of program instrumentation is adding run-time checking 
11718 to detect programming errors like invalid pointer
11719 dereferences or out-of-bounds array accesses, as well as deliberately
11720 hostile attacks such as stack smashing or C++ vtable hijacking.
11721 There is also a general hook which can be used to implement other
11722 forms of tracing or function-level instrumentation for debug or
11723 program analysis purposes.
11725 @table @gcctabopt
11726 @cindex @command{prof}
11727 @item -p
11728 @opindex p
11729 Generate extra code to write profile information suitable for the
11730 analysis program @command{prof}.  You must use this option when compiling
11731 the source files you want data about, and you must also use it when
11732 linking.
11734 @cindex @command{gprof}
11735 @item -pg
11736 @opindex pg
11737 Generate extra code to write profile information suitable for the
11738 analysis program @command{gprof}.  You must use this option when compiling
11739 the source files you want data about, and you must also use it when
11740 linking.
11742 @item -fprofile-arcs
11743 @opindex fprofile-arcs
11744 Add code so that program flow @dfn{arcs} are instrumented.  During
11745 execution the program records how many times each branch and call is
11746 executed and how many times it is taken or returns.  On targets that support
11747 constructors with priority support, profiling properly handles constructors,
11748 destructors and C++ constructors (and destructors) of classes which are used
11749 as a type of a global variable.
11751 When the compiled
11752 program exits it saves this data to a file called
11753 @file{@var{auxname}.gcda} for each source file.  The data may be used for
11754 profile-directed optimizations (@option{-fbranch-probabilities}), or for
11755 test coverage analysis (@option{-ftest-coverage}).  Each object file's
11756 @var{auxname} is generated from the name of the output file, if
11757 explicitly specified and it is not the final executable, otherwise it is
11758 the basename of the source file.  In both cases any suffix is removed
11759 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
11760 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
11761 @xref{Cross-profiling}.
11763 @cindex @command{gcov}
11764 @item --coverage
11765 @opindex coverage
11767 This option is used to compile and link code instrumented for coverage
11768 analysis.  The option is a synonym for @option{-fprofile-arcs}
11769 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
11770 linking).  See the documentation for those options for more details.
11772 @itemize
11774 @item
11775 Compile the source files with @option{-fprofile-arcs} plus optimization
11776 and code generation options.  For test coverage analysis, use the
11777 additional @option{-ftest-coverage} option.  You do not need to profile
11778 every source file in a program.
11780 @item
11781 Compile the source files additionally with @option{-fprofile-abs-path}
11782 to create absolute path names in the @file{.gcno} files.  This allows
11783 @command{gcov} to find the correct sources in projects where compilations
11784 occur with different working directories.
11786 @item
11787 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
11788 (the latter implies the former).
11790 @item
11791 Run the program on a representative workload to generate the arc profile
11792 information.  This may be repeated any number of times.  You can run
11793 concurrent instances of your program, and provided that the file system
11794 supports locking, the data files will be correctly updated.  Unless
11795 a strict ISO C dialect option is in effect, @code{fork} calls are
11796 detected and correctly handled without double counting.
11798 @item
11799 For profile-directed optimizations, compile the source files again with
11800 the same optimization and code generation options plus
11801 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
11802 Control Optimization}).
11804 @item
11805 For test coverage analysis, use @command{gcov} to produce human readable
11806 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
11807 @command{gcov} documentation for further information.
11809 @end itemize
11811 With @option{-fprofile-arcs}, for each function of your program GCC
11812 creates a program flow graph, then finds a spanning tree for the graph.
11813 Only arcs that are not on the spanning tree have to be instrumented: the
11814 compiler adds code to count the number of times that these arcs are
11815 executed.  When an arc is the only exit or only entrance to a block, the
11816 instrumentation code can be added to the block; otherwise, a new basic
11817 block must be created to hold the instrumentation code.
11819 @need 2000
11820 @item -ftest-coverage
11821 @opindex ftest-coverage
11822 Produce a notes file that the @command{gcov} code-coverage utility
11823 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
11824 show program coverage.  Each source file's note file is called
11825 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
11826 above for a description of @var{auxname} and instructions on how to
11827 generate test coverage data.  Coverage data matches the source files
11828 more closely if you do not optimize.
11830 @item -fprofile-abs-path
11831 @opindex fprofile-abs-path
11832 Automatically convert relative source file names to absolute path names
11833 in the @file{.gcno} files.  This allows @command{gcov} to find the correct
11834 sources in projects where compilations occur with different working
11835 directories.
11837 @item -fprofile-dir=@var{path}
11838 @opindex fprofile-dir
11840 Set the directory to search for the profile data files in to @var{path}.
11841 This option affects only the profile data generated by
11842 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
11843 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
11844 and its related options.  Both absolute and relative paths can be used.
11845 By default, GCC uses the current directory as @var{path}, thus the
11846 profile data file appears in the same directory as the object file.
11847 In order to prevent the file name clashing, if the object file name is
11848 not an absolute path, we mangle the absolute path of the
11849 @file{@var{sourcename}.gcda} file and use it as the file name of a
11850 @file{.gcda} file.
11852 When an executable is run in a massive parallel environment, it is recommended
11853 to save profile to different folders.  That can be done with variables
11854 in @var{path} that are exported during run-time:
11856 @table @gcctabopt
11858 @item %p
11859 process ID.
11861 @item %q@{VAR@}
11862 value of environment variable @var{VAR}
11864 @end table
11866 @item -fprofile-generate
11867 @itemx -fprofile-generate=@var{path}
11868 @opindex fprofile-generate
11870 Enable options usually used for instrumenting application to produce
11871 profile useful for later recompilation with profile feedback based
11872 optimization.  You must use @option{-fprofile-generate} both when
11873 compiling and when linking your program.
11875 The following options are enabled: @option{-fprofile-arcs}, @option{-fprofile-values}, @option{-fvpt}.
11877 If @var{path} is specified, GCC looks at the @var{path} to find
11878 the profile feedback data files. See @option{-fprofile-dir}.
11880 To optimize the program based on the collected profile information, use
11881 @option{-fprofile-use}.  @xref{Optimize Options}, for more information.
11883 @item -fprofile-update=@var{method}
11884 @opindex fprofile-update
11886 Alter the update method for an application instrumented for profile
11887 feedback based optimization.  The @var{method} argument should be one of
11888 @samp{single}, @samp{atomic} or @samp{prefer-atomic}.
11889 The first one is useful for single-threaded applications,
11890 while the second one prevents profile corruption by emitting thread-safe code.
11892 @strong{Warning:} When an application does not properly join all threads
11893 (or creates an detached thread), a profile file can be still corrupted.
11895 Using @samp{prefer-atomic} would be transformed either to @samp{atomic},
11896 when supported by a target, or to @samp{single} otherwise.  The GCC driver
11897 automatically selects @samp{prefer-atomic} when @option{-pthread}
11898 is present in the command line.
11900 @item -fprofile-filter-files=@var{regex}
11901 @opindex fprofile-filter-files
11903 Instrument only functions from files where names match
11904 any regular expression (separated by a semi-colon).
11906 For example, @option{-fprofile-filter-files=main.c;module.*.c} will instrument
11907 only @file{main.c} and all C files starting with 'module'.
11909 @item -fprofile-exclude-files=@var{regex}
11910 @opindex fprofile-exclude-files
11912 Instrument only functions from files where names do not match
11913 all the regular expressions (separated by a semi-colon).
11915 For example, @option{-fprofile-exclude-files=/usr/*} will prevent instrumentation
11916 of all files that are located in @file{/usr/} folder.
11918 @item -fsanitize=address
11919 @opindex fsanitize=address
11920 Enable AddressSanitizer, a fast memory error detector.
11921 Memory access instructions are instrumented to detect
11922 out-of-bounds and use-after-free bugs.
11923 The option enables @option{-fsanitize-address-use-after-scope}.
11924 See @uref{https://github.com/google/sanitizers/wiki/AddressSanitizer} for
11925 more details.  The run-time behavior can be influenced using the
11926 @env{ASAN_OPTIONS} environment variable.  When set to @code{help=1},
11927 the available options are shown at startup of the instrumented program.  See
11928 @url{https://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flags}
11929 for a list of supported options.
11930 The option cannot be combined with @option{-fsanitize=thread}.
11932 @item -fsanitize=kernel-address
11933 @opindex fsanitize=kernel-address
11934 Enable AddressSanitizer for Linux kernel.
11935 See @uref{https://github.com/google/kasan/wiki} for more details.
11937 @item -fsanitize=pointer-compare
11938 @opindex fsanitize=pointer-compare
11939 Instrument comparison operation (<, <=, >, >=) with pointer operands.
11940 The option must be combined with either @option{-fsanitize=kernel-address} or
11941 @option{-fsanitize=address}
11942 The option cannot be combined with @option{-fsanitize=thread}.
11943 Note: By default the check is disabled at run time.  To enable it,
11944 add @code{detect_invalid_pointer_pairs=2} to the environment variable
11945 @env{ASAN_OPTIONS}. Using @code{detect_invalid_pointer_pairs=1} detects
11946 invalid operation only when both pointers are non-null.
11948 @item -fsanitize=pointer-subtract
11949 @opindex fsanitize=pointer-subtract
11950 Instrument subtraction with pointer operands.
11951 The option must be combined with either @option{-fsanitize=kernel-address} or
11952 @option{-fsanitize=address}
11953 The option cannot be combined with @option{-fsanitize=thread}.
11954 Note: By default the check is disabled at run time.  To enable it,
11955 add @code{detect_invalid_pointer_pairs=2} to the environment variable
11956 @env{ASAN_OPTIONS}. Using @code{detect_invalid_pointer_pairs=1} detects
11957 invalid operation only when both pointers are non-null.
11959 @item -fsanitize=thread
11960 @opindex fsanitize=thread
11961 Enable ThreadSanitizer, a fast data race detector.
11962 Memory access instructions are instrumented to detect
11963 data race bugs.  See @uref{https://github.com/google/sanitizers/wiki#threadsanitizer} for more
11964 details. The run-time behavior can be influenced using the @env{TSAN_OPTIONS}
11965 environment variable; see
11966 @url{https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags} for a list of
11967 supported options.
11968 The option cannot be combined with @option{-fsanitize=address},
11969 @option{-fsanitize=leak}.
11971 Note that sanitized atomic builtins cannot throw exceptions when
11972 operating on invalid memory addresses with non-call exceptions
11973 (@option{-fnon-call-exceptions}).
11975 @item -fsanitize=leak
11976 @opindex fsanitize=leak
11977 Enable LeakSanitizer, a memory leak detector.
11978 This option only matters for linking of executables and
11979 the executable is linked against a library that overrides @code{malloc}
11980 and other allocator functions.  See
11981 @uref{https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer} for more
11982 details.  The run-time behavior can be influenced using the
11983 @env{LSAN_OPTIONS} environment variable.
11984 The option cannot be combined with @option{-fsanitize=thread}.
11986 @item -fsanitize=undefined
11987 @opindex fsanitize=undefined
11988 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector.
11989 Various computations are instrumented to detect undefined behavior
11990 at runtime.  Current suboptions are:
11992 @table @gcctabopt
11994 @item -fsanitize=shift
11995 @opindex fsanitize=shift
11996 This option enables checking that the result of a shift operation is
11997 not undefined.  Note that what exactly is considered undefined differs
11998 slightly between C and C++, as well as between ISO C90 and C99, etc.
11999 This option has two suboptions, @option{-fsanitize=shift-base} and
12000 @option{-fsanitize=shift-exponent}.
12002 @item -fsanitize=shift-exponent
12003 @opindex fsanitize=shift-exponent
12004 This option enables checking that the second argument of a shift operation
12005 is not negative and is smaller than the precision of the promoted first
12006 argument.
12008 @item -fsanitize=shift-base
12009 @opindex fsanitize=shift-base
12010 If the second argument of a shift operation is within range, check that the
12011 result of a shift operation is not undefined.  Note that what exactly is
12012 considered undefined differs slightly between C and C++, as well as between
12013 ISO C90 and C99, etc.
12015 @item -fsanitize=integer-divide-by-zero
12016 @opindex fsanitize=integer-divide-by-zero
12017 Detect integer division by zero as well as @code{INT_MIN / -1} division.
12019 @item -fsanitize=unreachable
12020 @opindex fsanitize=unreachable
12021 With this option, the compiler turns the @code{__builtin_unreachable}
12022 call into a diagnostics message call instead.  When reaching the
12023 @code{__builtin_unreachable} call, the behavior is undefined.
12025 @item -fsanitize=vla-bound
12026 @opindex fsanitize=vla-bound
12027 This option instructs the compiler to check that the size of a variable
12028 length array is positive.
12030 @item -fsanitize=null
12031 @opindex fsanitize=null
12032 This option enables pointer checking.  Particularly, the application
12033 built with this option turned on will issue an error message when it
12034 tries to dereference a NULL pointer, or if a reference (possibly an
12035 rvalue reference) is bound to a NULL pointer, or if a method is invoked
12036 on an object pointed by a NULL pointer.
12038 @item -fsanitize=return
12039 @opindex fsanitize=return
12040 This option enables return statement checking.  Programs
12041 built with this option turned on will issue an error message
12042 when the end of a non-void function is reached without actually
12043 returning a value.  This option works in C++ only.
12045 @item -fsanitize=signed-integer-overflow
12046 @opindex fsanitize=signed-integer-overflow
12047 This option enables signed integer overflow checking.  We check that
12048 the result of @code{+}, @code{*}, and both unary and binary @code{-}
12049 does not overflow in the signed arithmetics.  Note, integer promotion
12050 rules must be taken into account.  That is, the following is not an
12051 overflow:
12052 @smallexample
12053 signed char a = SCHAR_MAX;
12054 a++;
12055 @end smallexample
12057 @item -fsanitize=bounds
12058 @opindex fsanitize=bounds
12059 This option enables instrumentation of array bounds.  Various out of bounds
12060 accesses are detected.  Flexible array members, flexible array member-like
12061 arrays, and initializers of variables with static storage are not instrumented.
12063 @item -fsanitize=bounds-strict
12064 @opindex fsanitize=bounds-strict
12065 This option enables strict instrumentation of array bounds.  Most out of bounds
12066 accesses are detected, including flexible array members and flexible array
12067 member-like arrays.  Initializers of variables with static storage are not
12068 instrumented.
12070 @item -fsanitize=alignment
12071 @opindex fsanitize=alignment
12073 This option enables checking of alignment of pointers when they are
12074 dereferenced, or when a reference is bound to insufficiently aligned target,
12075 or when a method or constructor is invoked on insufficiently aligned object.
12077 @item -fsanitize=object-size
12078 @opindex fsanitize=object-size
12079 This option enables instrumentation of memory references using the
12080 @code{__builtin_object_size} function.  Various out of bounds pointer
12081 accesses are detected.
12083 @item -fsanitize=float-divide-by-zero
12084 @opindex fsanitize=float-divide-by-zero
12085 Detect floating-point division by zero.  Unlike other similar options,
12086 @option{-fsanitize=float-divide-by-zero} is not enabled by
12087 @option{-fsanitize=undefined}, since floating-point division by zero can
12088 be a legitimate way of obtaining infinities and NaNs.
12090 @item -fsanitize=float-cast-overflow
12091 @opindex fsanitize=float-cast-overflow
12092 This option enables floating-point type to integer conversion checking.
12093 We check that the result of the conversion does not overflow.
12094 Unlike other similar options, @option{-fsanitize=float-cast-overflow} is
12095 not enabled by @option{-fsanitize=undefined}.
12096 This option does not work well with @code{FE_INVALID} exceptions enabled.
12098 @item -fsanitize=nonnull-attribute
12099 @opindex fsanitize=nonnull-attribute
12101 This option enables instrumentation of calls, checking whether null values
12102 are not passed to arguments marked as requiring a non-null value by the
12103 @code{nonnull} function attribute.
12105 @item -fsanitize=returns-nonnull-attribute
12106 @opindex fsanitize=returns-nonnull-attribute
12108 This option enables instrumentation of return statements in functions
12109 marked with @code{returns_nonnull} function attribute, to detect returning
12110 of null values from such functions.
12112 @item -fsanitize=bool
12113 @opindex fsanitize=bool
12115 This option enables instrumentation of loads from bool.  If a value other
12116 than 0/1 is loaded, a run-time error is issued.
12118 @item -fsanitize=enum
12119 @opindex fsanitize=enum
12121 This option enables instrumentation of loads from an enum type.  If
12122 a value outside the range of values for the enum type is loaded,
12123 a run-time error is issued.
12125 @item -fsanitize=vptr
12126 @opindex fsanitize=vptr
12128 This option enables instrumentation of C++ member function calls, member
12129 accesses and some conversions between pointers to base and derived classes,
12130 to verify the referenced object has the correct dynamic type.
12132 @item -fsanitize=pointer-overflow
12133 @opindex fsanitize=pointer-overflow
12135 This option enables instrumentation of pointer arithmetics.  If the pointer
12136 arithmetics overflows, a run-time error is issued.
12138 @item -fsanitize=builtin
12139 @opindex fsanitize=builtin
12141 This option enables instrumentation of arguments to selected builtin
12142 functions.  If an invalid value is passed to such arguments, a run-time
12143 error is issued.  E.g.@ passing 0 as the argument to @code{__builtin_ctz}
12144 or @code{__builtin_clz} invokes undefined behavior and is diagnosed
12145 by this option.
12147 @end table
12149 While @option{-ftrapv} causes traps for signed overflows to be emitted,
12150 @option{-fsanitize=undefined} gives a diagnostic message.
12151 This currently works only for the C family of languages.
12153 @item -fno-sanitize=all
12154 @opindex fno-sanitize=all
12156 This option disables all previously enabled sanitizers.
12157 @option{-fsanitize=all} is not allowed, as some sanitizers cannot be used
12158 together.
12160 @item -fasan-shadow-offset=@var{number}
12161 @opindex fasan-shadow-offset
12162 This option forces GCC to use custom shadow offset in AddressSanitizer checks.
12163 It is useful for experimenting with different shadow memory layouts in
12164 Kernel AddressSanitizer.
12166 @item -fsanitize-sections=@var{s1},@var{s2},...
12167 @opindex fsanitize-sections
12168 Sanitize global variables in selected user-defined sections.  @var{si} may
12169 contain wildcards.
12171 @item -fsanitize-recover@r{[}=@var{opts}@r{]}
12172 @opindex fsanitize-recover
12173 @opindex fno-sanitize-recover
12174 @option{-fsanitize-recover=} controls error recovery mode for sanitizers
12175 mentioned in comma-separated list of @var{opts}.  Enabling this option
12176 for a sanitizer component causes it to attempt to continue
12177 running the program as if no error happened.  This means multiple
12178 runtime errors can be reported in a single program run, and the exit
12179 code of the program may indicate success even when errors
12180 have been reported.  The @option{-fno-sanitize-recover=} option
12181 can be used to alter
12182 this behavior: only the first detected error is reported
12183 and program then exits with a non-zero exit code.
12185 Currently this feature only works for @option{-fsanitize=undefined} (and its suboptions
12186 except for @option{-fsanitize=unreachable} and @option{-fsanitize=return}),
12187 @option{-fsanitize=float-cast-overflow}, @option{-fsanitize=float-divide-by-zero},
12188 @option{-fsanitize=bounds-strict},
12189 @option{-fsanitize=kernel-address} and @option{-fsanitize=address}.
12190 For these sanitizers error recovery is turned on by default,
12191 except @option{-fsanitize=address}, for which this feature is experimental.
12192 @option{-fsanitize-recover=all} and @option{-fno-sanitize-recover=all} is also
12193 accepted, the former enables recovery for all sanitizers that support it,
12194 the latter disables recovery for all sanitizers that support it.
12196 Even if a recovery mode is turned on the compiler side, it needs to be also
12197 enabled on the runtime library side, otherwise the failures are still fatal.
12198 The runtime library defaults to @code{halt_on_error=0} for
12199 ThreadSanitizer and UndefinedBehaviorSanitizer, while default value for
12200 AddressSanitizer is @code{halt_on_error=1}. This can be overridden through
12201 setting the @code{halt_on_error} flag in the corresponding environment variable.
12203 Syntax without an explicit @var{opts} parameter is deprecated.  It is
12204 equivalent to specifying an @var{opts} list of:
12206 @smallexample
12207 undefined,float-cast-overflow,float-divide-by-zero,bounds-strict
12208 @end smallexample
12210 @item -fsanitize-address-use-after-scope
12211 @opindex fsanitize-address-use-after-scope
12212 Enable sanitization of local variables to detect use-after-scope bugs.
12213 The option sets @option{-fstack-reuse} to @samp{none}.
12215 @item -fsanitize-undefined-trap-on-error
12216 @opindex fsanitize-undefined-trap-on-error
12217 The @option{-fsanitize-undefined-trap-on-error} option instructs the compiler to
12218 report undefined behavior using @code{__builtin_trap} rather than
12219 a @code{libubsan} library routine.  The advantage of this is that the
12220 @code{libubsan} library is not needed and is not linked in, so this
12221 is usable even in freestanding environments.
12223 @item -fsanitize-coverage=trace-pc
12224 @opindex fsanitize-coverage=trace-pc
12225 Enable coverage-guided fuzzing code instrumentation.
12226 Inserts a call to @code{__sanitizer_cov_trace_pc} into every basic block.
12228 @item -fsanitize-coverage=trace-cmp
12229 @opindex fsanitize-coverage=trace-cmp
12230 Enable dataflow guided fuzzing code instrumentation.
12231 Inserts a call to @code{__sanitizer_cov_trace_cmp1},
12232 @code{__sanitizer_cov_trace_cmp2}, @code{__sanitizer_cov_trace_cmp4} or
12233 @code{__sanitizer_cov_trace_cmp8} for integral comparison with both operands
12234 variable or @code{__sanitizer_cov_trace_const_cmp1},
12235 @code{__sanitizer_cov_trace_const_cmp2},
12236 @code{__sanitizer_cov_trace_const_cmp4} or
12237 @code{__sanitizer_cov_trace_const_cmp8} for integral comparison with one
12238 operand constant, @code{__sanitizer_cov_trace_cmpf} or
12239 @code{__sanitizer_cov_trace_cmpd} for float or double comparisons and
12240 @code{__sanitizer_cov_trace_switch} for switch statements.
12242 @item -fcf-protection=@r{[}full@r{|}branch@r{|}return@r{|}none@r{]}
12243 @opindex fcf-protection
12244 Enable code instrumentation of control-flow transfers to increase
12245 program security by checking that target addresses of control-flow
12246 transfer instructions (such as indirect function call, function return,
12247 indirect jump) are valid.  This prevents diverting the flow of control
12248 to an unexpected target.  This is intended to protect against such
12249 threats as Return-oriented Programming (ROP), and similarly
12250 call/jmp-oriented programming (COP/JOP).
12252 The value @code{branch} tells the compiler to implement checking of
12253 validity of control-flow transfer at the point of indirect branch
12254 instructions, i.e.@: call/jmp instructions.  The value @code{return}
12255 implements checking of validity at the point of returning from a
12256 function.  The value @code{full} is an alias for specifying both
12257 @code{branch} and @code{return}. The value @code{none} turns off
12258 instrumentation.
12260 The macro @code{__CET__} is defined when @option{-fcf-protection} is
12261 used.  The first bit of @code{__CET__} is set to 1 for the value
12262 @code{branch} and the second bit of @code{__CET__} is set to 1 for
12263 the @code{return}.
12265 You can also use the @code{nocf_check} attribute to identify
12266 which functions and calls should be skipped from instrumentation
12267 (@pxref{Function Attributes}).
12269 Currently the x86 GNU/Linux target provides an implementation based
12270 on Intel Control-flow Enforcement Technology (CET).
12272 @item -fstack-protector
12273 @opindex fstack-protector
12274 Emit extra code to check for buffer overflows, such as stack smashing
12275 attacks.  This is done by adding a guard variable to functions with
12276 vulnerable objects.  This includes functions that call @code{alloca}, and
12277 functions with buffers larger than 8 bytes.  The guards are initialized
12278 when a function is entered and then checked when the function exits.
12279 If a guard check fails, an error message is printed and the program exits.
12281 @item -fstack-protector-all
12282 @opindex fstack-protector-all
12283 Like @option{-fstack-protector} except that all functions are protected.
12285 @item -fstack-protector-strong
12286 @opindex fstack-protector-strong
12287 Like @option{-fstack-protector} but includes additional functions to
12288 be protected --- those that have local array definitions, or have
12289 references to local frame addresses.
12291 @item -fstack-protector-explicit
12292 @opindex fstack-protector-explicit
12293 Like @option{-fstack-protector} but only protects those functions which
12294 have the @code{stack_protect} attribute.
12296 @item -fstack-check
12297 @opindex fstack-check
12298 Generate code to verify that you do not go beyond the boundary of the
12299 stack.  You should specify this flag if you are running in an
12300 environment with multiple threads, but you only rarely need to specify it in
12301 a single-threaded environment since stack overflow is automatically
12302 detected on nearly all systems if there is only one stack.
12304 Note that this switch does not actually cause checking to be done; the
12305 operating system or the language runtime must do that.  The switch causes
12306 generation of code to ensure that they see the stack being extended.
12308 You can additionally specify a string parameter: @samp{no} means no
12309 checking, @samp{generic} means force the use of old-style checking,
12310 @samp{specific} means use the best checking method and is equivalent
12311 to bare @option{-fstack-check}.
12313 Old-style checking is a generic mechanism that requires no specific
12314 target support in the compiler but comes with the following drawbacks:
12316 @enumerate
12317 @item
12318 Modified allocation strategy for large objects: they are always
12319 allocated dynamically if their size exceeds a fixed threshold.  Note this
12320 may change the semantics of some code.
12322 @item
12323 Fixed limit on the size of the static frame of functions: when it is
12324 topped by a particular function, stack checking is not reliable and
12325 a warning is issued by the compiler.
12327 @item
12328 Inefficiency: because of both the modified allocation strategy and the
12329 generic implementation, code performance is hampered.
12330 @end enumerate
12332 Note that old-style stack checking is also the fallback method for
12333 @samp{specific} if no target support has been added in the compiler.
12335 @samp{-fstack-check=} is designed for Ada's needs to detect infinite recursion
12336 and stack overflows.  @samp{specific} is an excellent choice when compiling
12337 Ada code.  It is not generally sufficient to protect against stack-clash
12338 attacks.  To protect against those you want @samp{-fstack-clash-protection}.
12340 @item -fstack-clash-protection
12341 @opindex fstack-clash-protection
12342 Generate code to prevent stack clash style attacks.  When this option is
12343 enabled, the compiler will only allocate one page of stack space at a time
12344 and each page is accessed immediately after allocation.  Thus, it prevents
12345 allocations from jumping over any stack guard page provided by the
12346 operating system.
12348 Most targets do not fully support stack clash protection.  However, on
12349 those targets @option{-fstack-clash-protection} will protect dynamic stack
12350 allocations.  @option{-fstack-clash-protection} may also provide limited
12351 protection for static stack allocations if the target supports
12352 @option{-fstack-check=specific}.
12354 @item -fstack-limit-register=@var{reg}
12355 @itemx -fstack-limit-symbol=@var{sym}
12356 @itemx -fno-stack-limit
12357 @opindex fstack-limit-register
12358 @opindex fstack-limit-symbol
12359 @opindex fno-stack-limit
12360 Generate code to ensure that the stack does not grow beyond a certain value,
12361 either the value of a register or the address of a symbol.  If a larger
12362 stack is required, a signal is raised at run time.  For most targets,
12363 the signal is raised before the stack overruns the boundary, so
12364 it is possible to catch the signal without taking special precautions.
12366 For instance, if the stack starts at absolute address @samp{0x80000000}
12367 and grows downwards, you can use the flags
12368 @option{-fstack-limit-symbol=__stack_limit} and
12369 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
12370 of 128KB@.  Note that this may only work with the GNU linker.
12372 You can locally override stack limit checking by using the
12373 @code{no_stack_limit} function attribute (@pxref{Function Attributes}).
12375 @item -fsplit-stack
12376 @opindex fsplit-stack
12377 Generate code to automatically split the stack before it overflows.
12378 The resulting program has a discontiguous stack which can only
12379 overflow if the program is unable to allocate any more memory.  This
12380 is most useful when running threaded programs, as it is no longer
12381 necessary to calculate a good stack size to use for each thread.  This
12382 is currently only implemented for the x86 targets running
12383 GNU/Linux.
12385 When code compiled with @option{-fsplit-stack} calls code compiled
12386 without @option{-fsplit-stack}, there may not be much stack space
12387 available for the latter code to run.  If compiling all code,
12388 including library code, with @option{-fsplit-stack} is not an option,
12389 then the linker can fix up these calls so that the code compiled
12390 without @option{-fsplit-stack} always has a large stack.  Support for
12391 this is implemented in the gold linker in GNU binutils release 2.21
12392 and later.
12394 @item -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]}
12395 @opindex fvtable-verify
12396 This option is only available when compiling C++ code.
12397 It turns on (or off, if using @option{-fvtable-verify=none}) the security
12398 feature that verifies at run time, for every virtual call, that
12399 the vtable pointer through which the call is made is valid for the type of
12400 the object, and has not been corrupted or overwritten.  If an invalid vtable
12401 pointer is detected at run time, an error is reported and execution of the
12402 program is immediately halted.
12404 This option causes run-time data structures to be built at program startup,
12405 which are used for verifying the vtable pointers.  
12406 The options @samp{std} and @samp{preinit}
12407 control the timing of when these data structures are built.  In both cases the
12408 data structures are built before execution reaches @code{main}.  Using
12409 @option{-fvtable-verify=std} causes the data structures to be built after
12410 shared libraries have been loaded and initialized.
12411 @option{-fvtable-verify=preinit} causes them to be built before shared
12412 libraries have been loaded and initialized.
12414 If this option appears multiple times in the command line with different
12415 values specified, @samp{none} takes highest priority over both @samp{std} and
12416 @samp{preinit}; @samp{preinit} takes priority over @samp{std}.
12418 @item -fvtv-debug
12419 @opindex fvtv-debug
12420 When used in conjunction with @option{-fvtable-verify=std} or 
12421 @option{-fvtable-verify=preinit}, causes debug versions of the 
12422 runtime functions for the vtable verification feature to be called.  
12423 This flag also causes the compiler to log information about which 
12424 vtable pointers it finds for each class.
12425 This information is written to a file named @file{vtv_set_ptr_data.log} 
12426 in the directory named by the environment variable @env{VTV_LOGS_DIR} 
12427 if that is defined or the current working directory otherwise.
12429 Note:  This feature @emph{appends} data to the log file. If you want a fresh log
12430 file, be sure to delete any existing one.
12432 @item -fvtv-counts
12433 @opindex fvtv-counts
12434 This is a debugging flag.  When used in conjunction with
12435 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
12436 causes the compiler to keep track of the total number of virtual calls
12437 it encounters and the number of verifications it inserts.  It also
12438 counts the number of calls to certain run-time library functions
12439 that it inserts and logs this information for each compilation unit.
12440 The compiler writes this information to a file named
12441 @file{vtv_count_data.log} in the directory named by the environment
12442 variable @env{VTV_LOGS_DIR} if that is defined or the current working
12443 directory otherwise.  It also counts the size of the vtable pointer sets
12444 for each class, and writes this information to @file{vtv_class_set_sizes.log}
12445 in the same directory.
12447 Note:  This feature @emph{appends} data to the log files.  To get fresh log
12448 files, be sure to delete any existing ones.
12450 @item -finstrument-functions
12451 @opindex finstrument-functions
12452 Generate instrumentation calls for entry and exit to functions.  Just
12453 after function entry and just before function exit, the following
12454 profiling functions are called with the address of the current
12455 function and its call site.  (On some platforms,
12456 @code{__builtin_return_address} does not work beyond the current
12457 function, so the call site information may not be available to the
12458 profiling functions otherwise.)
12460 @smallexample
12461 void __cyg_profile_func_enter (void *this_fn,
12462                                void *call_site);
12463 void __cyg_profile_func_exit  (void *this_fn,
12464                                void *call_site);
12465 @end smallexample
12467 The first argument is the address of the start of the current function,
12468 which may be looked up exactly in the symbol table.
12470 This instrumentation is also done for functions expanded inline in other
12471 functions.  The profiling calls indicate where, conceptually, the
12472 inline function is entered and exited.  This means that addressable
12473 versions of such functions must be available.  If all your uses of a
12474 function are expanded inline, this may mean an additional expansion of
12475 code size.  If you use @code{extern inline} in your C code, an
12476 addressable version of such functions must be provided.  (This is
12477 normally the case anyway, but if you get lucky and the optimizer always
12478 expands the functions inline, you might have gotten away without
12479 providing static copies.)
12481 A function may be given the attribute @code{no_instrument_function}, in
12482 which case this instrumentation is not done.  This can be used, for
12483 example, for the profiling functions listed above, high-priority
12484 interrupt routines, and any functions from which the profiling functions
12485 cannot safely be called (perhaps signal handlers, if the profiling
12486 routines generate output or allocate memory).
12488 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
12489 @opindex finstrument-functions-exclude-file-list
12491 Set the list of functions that are excluded from instrumentation (see
12492 the description of @option{-finstrument-functions}).  If the file that
12493 contains a function definition matches with one of @var{file}, then
12494 that function is not instrumented.  The match is done on substrings:
12495 if the @var{file} parameter is a substring of the file name, it is
12496 considered to be a match.
12498 For example:
12500 @smallexample
12501 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
12502 @end smallexample
12504 @noindent
12505 excludes any inline function defined in files whose pathnames
12506 contain @file{/bits/stl} or @file{include/sys}.
12508 If, for some reason, you want to include letter @samp{,} in one of
12509 @var{sym}, write @samp{\,}. For example,
12510 @option{-finstrument-functions-exclude-file-list='\,\,tmp'}
12511 (note the single quote surrounding the option).
12513 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
12514 @opindex finstrument-functions-exclude-function-list
12516 This is similar to @option{-finstrument-functions-exclude-file-list},
12517 but this option sets the list of function names to be excluded from
12518 instrumentation.  The function name to be matched is its user-visible
12519 name, such as @code{vector<int> blah(const vector<int> &)}, not the
12520 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
12521 match is done on substrings: if the @var{sym} parameter is a substring
12522 of the function name, it is considered to be a match.  For C99 and C++
12523 extended identifiers, the function name must be given in UTF-8, not
12524 using universal character names.
12526 @item -fpatchable-function-entry=@var{N}[,@var{M}]
12527 @opindex fpatchable-function-entry
12528 Generate @var{N} NOPs right at the beginning
12529 of each function, with the function entry point before the @var{M}th NOP.
12530 If @var{M} is omitted, it defaults to @code{0} so the
12531 function entry points to the address just at the first NOP.
12532 The NOP instructions reserve extra space which can be used to patch in
12533 any desired instrumentation at run time, provided that the code segment
12534 is writable.  The amount of space is controllable indirectly via
12535 the number of NOPs; the NOP instruction used corresponds to the instruction
12536 emitted by the internal GCC back-end interface @code{gen_nop}.  This behavior
12537 is target-specific and may also depend on the architecture variant and/or
12538 other compilation options.
12540 For run-time identification, the starting addresses of these areas,
12541 which correspond to their respective function entries minus @var{M},
12542 are additionally collected in the @code{__patchable_function_entries}
12543 section of the resulting binary.
12545 Note that the value of @code{__attribute__ ((patchable_function_entry
12546 (N,M)))} takes precedence over command-line option
12547 @option{-fpatchable-function-entry=N,M}.  This can be used to increase
12548 the area size or to remove it completely on a single function.
12549 If @code{N=0}, no pad location is recorded.
12551 The NOP instructions are inserted at---and maybe before, depending on
12552 @var{M}---the function entry address, even before the prologue.
12554 @end table
12557 @node Preprocessor Options
12558 @section Options Controlling the Preprocessor
12559 @cindex preprocessor options
12560 @cindex options, preprocessor
12562 These options control the C preprocessor, which is run on each C source
12563 file before actual compilation.
12565 If you use the @option{-E} option, nothing is done except preprocessing.
12566 Some of these options make sense only together with @option{-E} because
12567 they cause the preprocessor output to be unsuitable for actual
12568 compilation.
12570 In addition to the options listed here, there are a number of options 
12571 to control search paths for include files documented in 
12572 @ref{Directory Options}.  
12573 Options to control preprocessor diagnostics are listed in 
12574 @ref{Warning Options}.
12576 @table @gcctabopt
12577 @include cppopts.texi
12579 @item -Wp,@var{option}
12580 @opindex Wp
12581 You can use @option{-Wp,@var{option}} to bypass the compiler driver
12582 and pass @var{option} directly through to the preprocessor.  If
12583 @var{option} contains commas, it is split into multiple options at the
12584 commas.  However, many options are modified, translated or interpreted
12585 by the compiler driver before being passed to the preprocessor, and
12586 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
12587 interface is undocumented and subject to change, so whenever possible
12588 you should avoid using @option{-Wp} and let the driver handle the
12589 options instead.
12591 @item -Xpreprocessor @var{option}
12592 @opindex Xpreprocessor
12593 Pass @var{option} as an option to the preprocessor.  You can use this to
12594 supply system-specific preprocessor options that GCC does not 
12595 recognize.
12597 If you want to pass an option that takes an argument, you must use
12598 @option{-Xpreprocessor} twice, once for the option and once for the argument.
12600 @item -no-integrated-cpp
12601 @opindex no-integrated-cpp
12602 Perform preprocessing as a separate pass before compilation.
12603 By default, GCC performs preprocessing as an integrated part of
12604 input tokenization and parsing.
12605 If this option is provided, the appropriate language front end
12606 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
12607 and Objective-C, respectively) is instead invoked twice,
12608 once for preprocessing only and once for actual compilation
12609 of the preprocessed input.
12610 This option may be useful in conjunction with the @option{-B} or
12611 @option{-wrapper} options to specify an alternate preprocessor or
12612 perform additional processing of the program source between
12613 normal preprocessing and compilation.
12615 @end table
12617 @node Assembler Options
12618 @section Passing Options to the Assembler
12620 @c prevent bad page break with this line
12621 You can pass options to the assembler.
12623 @table @gcctabopt
12624 @item -Wa,@var{option}
12625 @opindex Wa
12626 Pass @var{option} as an option to the assembler.  If @var{option}
12627 contains commas, it is split into multiple options at the commas.
12629 @item -Xassembler @var{option}
12630 @opindex Xassembler
12631 Pass @var{option} as an option to the assembler.  You can use this to
12632 supply system-specific assembler options that GCC does not
12633 recognize.
12635 If you want to pass an option that takes an argument, you must use
12636 @option{-Xassembler} twice, once for the option and once for the argument.
12638 @end table
12640 @node Link Options
12641 @section Options for Linking
12642 @cindex link options
12643 @cindex options, linking
12645 These options come into play when the compiler links object files into
12646 an executable output file.  They are meaningless if the compiler is
12647 not doing a link step.
12649 @table @gcctabopt
12650 @cindex file names
12651 @item @var{object-file-name}
12652 A file name that does not end in a special recognized suffix is
12653 considered to name an object file or library.  (Object files are
12654 distinguished from libraries by the linker according to the file
12655 contents.)  If linking is done, these object files are used as input
12656 to the linker.
12658 @item -c
12659 @itemx -S
12660 @itemx -E
12661 @opindex c
12662 @opindex S
12663 @opindex E
12664 If any of these options is used, then the linker is not run, and
12665 object file names should not be used as arguments.  @xref{Overall
12666 Options}.
12668 @item -flinker-output=@var{type}
12669 @opindex flinker-output
12670 This option controls the code generation of the link time optimizer.  By
12671 default the linker output is determined by the linker plugin automatically. For
12672 debugging the compiler and in the case of incremental linking to non-lto object
12673 file is desired, it may be useful to control the type manually.
12675 If @var{type} is @samp{exec} the code generation is configured to produce static
12676 binary. In this case @option{-fpic} and @option{-fpie} are both disabled.
12678 If @var{type} is @samp{dyn} the code generation is configured to produce shared
12679 library. In this case @option{-fpic} or @option{-fPIC} is preserved, but not
12680 enabled automatically.  This makes it possible to build shared libraries without
12681 position independent code on architectures this is possible, i.e.@: on x86.
12683 If @var{type} is @samp{pie} the code generation is configured to produce
12684 @option{-fpie} executable. This result in similar optimizations as @samp{exec}
12685 except that @option{-fpie} is not disabled if specified at compilation time.
12687 If @var{type} is @samp{rel} the compiler assumes that incremental linking is
12688 done.  The sections containing intermediate code for link-time optimization are
12689 merged, pre-optimized, and output to the resulting object file. In addition, if
12690 @option{-ffat-lto-objects} is specified the binary code is produced for future
12691 non-lto linking. The object file produced by incremental linking will be smaller
12692 than a static library produced from the same object files.  At link-time the
12693 result of incremental linking will also load faster to compiler than a static
12694 library assuming that majority of objects in the library are used.
12696 Finally @samp{nolto-rel} configure compiler to for incremental linking where
12697 code generation is forced, final binary is produced and the intermediate code
12698 for later link-time optimization is stripped. When multiple object files are
12699 linked together the resulting code will be optimized better than with link time
12700 optimizations disabled (for example, the cross-module inlining will happen),
12701 most of benefits of whole program optimizations are however lost. 
12703 During the incremental link (by @option{-r}) the linker plugin will default to
12704 @option{rel}. With current interfaces to GNU Binutils it is however not
12705 possible to link incrementally LTO objects and non-LTO objects into a single
12706 mixed object file.  In the case any of object files in incremental link can not
12707 be used for link-time optimization the linker plugin will output warning and
12708 use @samp{nolto-rel}. To maintain the whole program optimization it is
12709 recommended to link such objects into static library instead. Alternatively it
12710 is possible to use H.J. Lu's binutils with support for mixed objects.
12712 @item -fuse-ld=bfd
12713 @opindex fuse-ld=bfd
12714 Use the @command{bfd} linker instead of the default linker.
12716 @item -fuse-ld=gold
12717 @opindex fuse-ld=gold
12718 Use the @command{gold} linker instead of the default linker.
12720 @item -fuse-ld=lld
12721 @opindex fuse-ld=lld
12722 Use the LLVM @command{lld} linker instead of the default linker.
12724 @cindex Libraries
12725 @item -l@var{library}
12726 @itemx -l @var{library}
12727 @opindex l
12728 Search the library named @var{library} when linking.  (The second
12729 alternative with the library as a separate argument is only for
12730 POSIX compliance and is not recommended.)
12732 It makes a difference where in the command you write this option; the
12733 linker searches and processes libraries and object files in the order they
12734 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
12735 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
12736 to functions in @samp{z}, those functions may not be loaded.
12738 The linker searches a standard list of directories for the library,
12739 which is actually a file named @file{lib@var{library}.a}.  The linker
12740 then uses this file as if it had been specified precisely by name.
12742 The directories searched include several standard system directories
12743 plus any that you specify with @option{-L}.
12745 Normally the files found this way are library files---archive files
12746 whose members are object files.  The linker handles an archive file by
12747 scanning through it for members which define symbols that have so far
12748 been referenced but not defined.  But if the file that is found is an
12749 ordinary object file, it is linked in the usual fashion.  The only
12750 difference between using an @option{-l} option and specifying a file name
12751 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
12752 and searches several directories.
12754 @item -lobjc
12755 @opindex lobjc
12756 You need this special case of the @option{-l} option in order to
12757 link an Objective-C or Objective-C++ program.
12759 @item -nostartfiles
12760 @opindex nostartfiles
12761 Do not use the standard system startup files when linking.
12762 The standard system libraries are used normally, unless @option{-nostdlib},
12763 @option{-nolibc}, or @option{-nodefaultlibs} is used.
12765 @item -nodefaultlibs
12766 @opindex nodefaultlibs
12767 Do not use the standard system libraries when linking.
12768 Only the libraries you specify are passed to the linker, and options
12769 specifying linkage of the system libraries, such as @option{-static-libgcc}
12770 or @option{-shared-libgcc}, are ignored.  
12771 The standard startup files are used normally, unless @option{-nostartfiles}
12772 is used.  
12774 The compiler may generate calls to @code{memcmp},
12775 @code{memset}, @code{memcpy} and @code{memmove}.
12776 These entries are usually resolved by entries in
12777 libc.  These entry points should be supplied through some other
12778 mechanism when this option is specified.
12780 @item -nolibc
12781 @opindex nolibc
12782 Do not use the C library or system libraries tightly coupled with it when
12783 linking.  Still link with the startup files, @file{libgcc} or toolchain
12784 provided language support libraries such as @file{libgnat}, @file{libgfortran}
12785 or @file{libstdc++} unless options preventing their inclusion are used as
12786 well.  This typically removes @option{-lc} from the link command line, as well
12787 as system libraries that normally go with it and become meaningless when
12788 absence of a C library is assumed, for example @option{-lpthread} or
12789 @option{-lm} in some configurations.  This is intended for bare-board
12790 targets when there is indeed no C library available.
12792 @item -nostdlib
12793 @opindex nostdlib
12794 Do not use the standard system startup files or libraries when linking.
12795 No startup files and only the libraries you specify are passed to
12796 the linker, and options specifying linkage of the system libraries, such as
12797 @option{-static-libgcc} or @option{-shared-libgcc}, are ignored.
12799 The compiler may generate calls to @code{memcmp}, @code{memset},
12800 @code{memcpy} and @code{memmove}.
12801 These entries are usually resolved by entries in
12802 libc.  These entry points should be supplied through some other
12803 mechanism when this option is specified.
12805 @cindex @option{-lgcc}, use with @option{-nostdlib}
12806 @cindex @option{-nostdlib} and unresolved references
12807 @cindex unresolved references and @option{-nostdlib}
12808 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
12809 @cindex @option{-nodefaultlibs} and unresolved references
12810 @cindex unresolved references and @option{-nodefaultlibs}
12811 One of the standard libraries bypassed by @option{-nostdlib} and
12812 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
12813 which GCC uses to overcome shortcomings of particular machines, or special
12814 needs for some languages.
12815 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
12816 Collection (GCC) Internals},
12817 for more discussion of @file{libgcc.a}.)
12818 In most cases, you need @file{libgcc.a} even when you want to avoid
12819 other standard libraries.  In other words, when you specify @option{-nostdlib}
12820 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
12821 This ensures that you have no unresolved references to internal GCC
12822 library subroutines.
12823 (An example of such an internal subroutine is @code{__main}, used to ensure C++
12824 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
12825 GNU Compiler Collection (GCC) Internals}.)
12827 @item -e @var{entry}
12828 @itemx --entry=@var{entry}
12829 @opindex e
12830 @opindex entry
12832 Specify that the program entry point is @var{entry}.  The argument is
12833 interpreted by the linker; the GNU linker accepts either a symbol name
12834 or an address.
12836 @item -pie
12837 @opindex pie
12838 Produce a dynamically linked position independent executable on targets
12839 that support it.  For predictable results, you must also specify the same
12840 set of options used for compilation (@option{-fpie}, @option{-fPIE},
12841 or model suboptions) when you specify this linker option.
12843 @item -no-pie
12844 @opindex no-pie
12845 Don't produce a dynamically linked position independent executable.
12847 @item -static-pie
12848 @opindex static-pie
12849 Produce a static position independent executable on targets that support
12850 it.  A static position independent executable is similar to a static
12851 executable, but can be loaded at any address without a dynamic linker.
12852 For predictable results, you must also specify the same set of options
12853 used for compilation (@option{-fpie}, @option{-fPIE}, or model
12854 suboptions) when you specify this linker option.
12856 @item -pthread
12857 @opindex pthread
12858 Link with the POSIX threads library.  This option is supported on 
12859 GNU/Linux targets, most other Unix derivatives, and also on 
12860 x86 Cygwin and MinGW targets.  On some targets this option also sets 
12861 flags for the preprocessor, so it should be used consistently for both
12862 compilation and linking.
12864 @item -r
12865 @opindex r
12866 Produce a relocatable object as output.  This is also known as partial
12867 linking.
12869 @item -rdynamic
12870 @opindex rdynamic
12871 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
12872 that support it. This instructs the linker to add all symbols, not
12873 only used ones, to the dynamic symbol table. This option is needed
12874 for some uses of @code{dlopen} or to allow obtaining backtraces
12875 from within a program.
12877 @item -s
12878 @opindex s
12879 Remove all symbol table and relocation information from the executable.
12881 @item -static
12882 @opindex static
12883 On systems that support dynamic linking, this overrides @option{-pie}
12884 and prevents linking with the shared libraries.  On other systems, this
12885 option has no effect.
12887 @item -shared
12888 @opindex shared
12889 Produce a shared object which can then be linked with other objects to
12890 form an executable.  Not all systems support this option.  For predictable
12891 results, you must also specify the same set of options used for compilation
12892 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
12893 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
12894 needs to build supplementary stub code for constructors to work.  On
12895 multi-libbed systems, @samp{gcc -shared} must select the correct support
12896 libraries to link against.  Failing to supply the correct flags may lead
12897 to subtle defects.  Supplying them in cases where they are not necessary
12898 is innocuous.}
12900 @item -shared-libgcc
12901 @itemx -static-libgcc
12902 @opindex shared-libgcc
12903 @opindex static-libgcc
12904 On systems that provide @file{libgcc} as a shared library, these options
12905 force the use of either the shared or static version, respectively.
12906 If no shared version of @file{libgcc} was built when the compiler was
12907 configured, these options have no effect.
12909 There are several situations in which an application should use the
12910 shared @file{libgcc} instead of the static version.  The most common
12911 of these is when the application wishes to throw and catch exceptions
12912 across different shared libraries.  In that case, each of the libraries
12913 as well as the application itself should use the shared @file{libgcc}.
12915 Therefore, the G++ driver automatically adds @option{-shared-libgcc}
12916 whenever you build a shared library or a main executable, because C++
12917 programs typically use exceptions, so this is the right thing to do.
12919 If, instead, you use the GCC driver to create shared libraries, you may
12920 find that they are not always linked with the shared @file{libgcc}.
12921 If GCC finds, at its configuration time, that you have a non-GNU linker
12922 or a GNU linker that does not support option @option{--eh-frame-hdr},
12923 it links the shared version of @file{libgcc} into shared libraries
12924 by default.  Otherwise, it takes advantage of the linker and optimizes
12925 away the linking with the shared version of @file{libgcc}, linking with
12926 the static version of libgcc by default.  This allows exceptions to
12927 propagate through such shared libraries, without incurring relocation
12928 costs at library load time.
12930 However, if a library or main executable is supposed to throw or catch
12931 exceptions, you must link it using the G++ driver, or using the option
12932 @option{-shared-libgcc}, such that it is linked with the shared
12933 @file{libgcc}.
12935 @item -static-libasan
12936 @opindex static-libasan
12937 When the @option{-fsanitize=address} option is used to link a program,
12938 the GCC driver automatically links against @option{libasan}.  If
12939 @file{libasan} is available as a shared library, and the @option{-static}
12940 option is not used, then this links against the shared version of
12941 @file{libasan}.  The @option{-static-libasan} option directs the GCC
12942 driver to link @file{libasan} statically, without necessarily linking
12943 other libraries statically.
12945 @item -static-libtsan
12946 @opindex static-libtsan
12947 When the @option{-fsanitize=thread} option is used to link a program,
12948 the GCC driver automatically links against @option{libtsan}.  If
12949 @file{libtsan} is available as a shared library, and the @option{-static}
12950 option is not used, then this links against the shared version of
12951 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
12952 driver to link @file{libtsan} statically, without necessarily linking
12953 other libraries statically.
12955 @item -static-liblsan
12956 @opindex static-liblsan
12957 When the @option{-fsanitize=leak} option is used to link a program,
12958 the GCC driver automatically links against @option{liblsan}.  If
12959 @file{liblsan} is available as a shared library, and the @option{-static}
12960 option is not used, then this links against the shared version of
12961 @file{liblsan}.  The @option{-static-liblsan} option directs the GCC
12962 driver to link @file{liblsan} statically, without necessarily linking
12963 other libraries statically.
12965 @item -static-libubsan
12966 @opindex static-libubsan
12967 When the @option{-fsanitize=undefined} option is used to link a program,
12968 the GCC driver automatically links against @option{libubsan}.  If
12969 @file{libubsan} is available as a shared library, and the @option{-static}
12970 option is not used, then this links against the shared version of
12971 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
12972 driver to link @file{libubsan} statically, without necessarily linking
12973 other libraries statically.
12975 @item -static-libstdc++
12976 @opindex static-libstdc++
12977 When the @command{g++} program is used to link a C++ program, it
12978 normally automatically links against @option{libstdc++}.  If
12979 @file{libstdc++} is available as a shared library, and the
12980 @option{-static} option is not used, then this links against the
12981 shared version of @file{libstdc++}.  That is normally fine.  However, it
12982 is sometimes useful to freeze the version of @file{libstdc++} used by
12983 the program without going all the way to a fully static link.  The
12984 @option{-static-libstdc++} option directs the @command{g++} driver to
12985 link @file{libstdc++} statically, without necessarily linking other
12986 libraries statically.
12988 @item -symbolic
12989 @opindex symbolic
12990 Bind references to global symbols when building a shared object.  Warn
12991 about any unresolved references (unless overridden by the link editor
12992 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
12993 this option.
12995 @item -T @var{script}
12996 @opindex T
12997 @cindex linker script
12998 Use @var{script} as the linker script.  This option is supported by most
12999 systems using the GNU linker.  On some targets, such as bare-board
13000 targets without an operating system, the @option{-T} option may be required
13001 when linking to avoid references to undefined symbols.
13003 @item -Xlinker @var{option}
13004 @opindex Xlinker
13005 Pass @var{option} as an option to the linker.  You can use this to
13006 supply system-specific linker options that GCC does not recognize.
13008 If you want to pass an option that takes a separate argument, you must use
13009 @option{-Xlinker} twice, once for the option and once for the argument.
13010 For example, to pass @option{-assert definitions}, you must write
13011 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
13012 @option{-Xlinker "-assert definitions"}, because this passes the entire
13013 string as a single argument, which is not what the linker expects.
13015 When using the GNU linker, it is usually more convenient to pass
13016 arguments to linker options using the @option{@var{option}=@var{value}}
13017 syntax than as separate arguments.  For example, you can specify
13018 @option{-Xlinker -Map=output.map} rather than
13019 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
13020 this syntax for command-line options.
13022 @item -Wl,@var{option}
13023 @opindex Wl
13024 Pass @var{option} as an option to the linker.  If @var{option} contains
13025 commas, it is split into multiple options at the commas.  You can use this
13026 syntax to pass an argument to the option.
13027 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
13028 linker.  When using the GNU linker, you can also get the same effect with
13029 @option{-Wl,-Map=output.map}.
13031 @item -u @var{symbol}
13032 @opindex u
13033 Pretend the symbol @var{symbol} is undefined, to force linking of
13034 library modules to define it.  You can use @option{-u} multiple times with
13035 different symbols to force loading of additional library modules.
13037 @item -z @var{keyword}
13038 @opindex z
13039 @option{-z} is passed directly on to the linker along with the keyword
13040 @var{keyword}. See the section in the documentation of your linker for
13041 permitted values and their meanings.
13042 @end table
13044 @node Directory Options
13045 @section Options for Directory Search
13046 @cindex directory options
13047 @cindex options, directory search
13048 @cindex search path
13050 These options specify directories to search for header files, for
13051 libraries and for parts of the compiler:
13053 @table @gcctabopt
13054 @include cppdiropts.texi
13056 @item -iplugindir=@var{dir}
13057 @opindex iplugindir=
13058 Set the directory to search for plugins that are passed
13059 by @option{-fplugin=@var{name}} instead of
13060 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
13061 to be used by the user, but only passed by the driver.
13063 @item -L@var{dir}
13064 @opindex L
13065 Add directory @var{dir} to the list of directories to be searched
13066 for @option{-l}.
13068 @item -B@var{prefix}
13069 @opindex B
13070 This option specifies where to find the executables, libraries,
13071 include files, and data files of the compiler itself.
13073 The compiler driver program runs one or more of the subprograms
13074 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
13075 @var{prefix} as a prefix for each program it tries to run, both with and
13076 without @samp{@var{machine}/@var{version}/} for the corresponding target
13077 machine and compiler version.
13079 For each subprogram to be run, the compiler driver first tries the
13080 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
13081 is not specified, the driver tries two standard prefixes, 
13082 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
13083 those results in a file name that is found, the unmodified program
13084 name is searched for using the directories specified in your
13085 @env{PATH} environment variable.
13087 The compiler checks to see if the path provided by @option{-B}
13088 refers to a directory, and if necessary it adds a directory
13089 separator character at the end of the path.
13091 @option{-B} prefixes that effectively specify directory names also apply
13092 to libraries in the linker, because the compiler translates these
13093 options into @option{-L} options for the linker.  They also apply to
13094 include files in the preprocessor, because the compiler translates these
13095 options into @option{-isystem} options for the preprocessor.  In this case,
13096 the compiler appends @samp{include} to the prefix.
13098 The runtime support file @file{libgcc.a} can also be searched for using
13099 the @option{-B} prefix, if needed.  If it is not found there, the two
13100 standard prefixes above are tried, and that is all.  The file is left
13101 out of the link if it is not found by those means.
13103 Another way to specify a prefix much like the @option{-B} prefix is to use
13104 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
13105 Variables}.
13107 As a special kludge, if the path provided by @option{-B} is
13108 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
13109 9, then it is replaced by @file{[dir/]include}.  This is to help
13110 with boot-strapping the compiler.
13112 @item -no-canonical-prefixes
13113 @opindex no-canonical-prefixes
13114 Do not expand any symbolic links, resolve references to @samp{/../}
13115 or @samp{/./}, or make the path absolute when generating a relative
13116 prefix.
13118 @item --sysroot=@var{dir}
13119 @opindex sysroot
13120 Use @var{dir} as the logical root directory for headers and libraries.
13121 For example, if the compiler normally searches for headers in
13122 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
13123 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
13125 If you use both this option and the @option{-isysroot} option, then
13126 the @option{--sysroot} option applies to libraries, but the
13127 @option{-isysroot} option applies to header files.
13129 The GNU linker (beginning with version 2.16) has the necessary support
13130 for this option.  If your linker does not support this option, the
13131 header file aspect of @option{--sysroot} still works, but the
13132 library aspect does not.
13134 @item --no-sysroot-suffix
13135 @opindex no-sysroot-suffix
13136 For some targets, a suffix is added to the root directory specified
13137 with @option{--sysroot}, depending on the other options used, so that
13138 headers may for example be found in
13139 @file{@var{dir}/@var{suffix}/usr/include} instead of
13140 @file{@var{dir}/usr/include}.  This option disables the addition of
13141 such a suffix.
13143 @end table
13145 @node Code Gen Options
13146 @section Options for Code Generation Conventions
13147 @cindex code generation conventions
13148 @cindex options, code generation
13149 @cindex run-time options
13151 These machine-independent options control the interface conventions
13152 used in code generation.
13154 Most of them have both positive and negative forms; the negative form
13155 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
13156 one of the forms is listed---the one that is not the default.  You
13157 can figure out the other form by either removing @samp{no-} or adding
13160 @table @gcctabopt
13161 @item -fstack-reuse=@var{reuse-level}
13162 @opindex fstack_reuse
13163 This option controls stack space reuse for user declared local/auto variables
13164 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
13165 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
13166 local variables and temporaries, @samp{named_vars} enables the reuse only for
13167 user defined local variables with names, and @samp{none} disables stack reuse
13168 completely. The default value is @samp{all}. The option is needed when the
13169 program extends the lifetime of a scoped local variable or a compiler generated
13170 temporary beyond the end point defined by the language.  When a lifetime of
13171 a variable ends, and if the variable lives in memory, the optimizing compiler
13172 has the freedom to reuse its stack space with other temporaries or scoped
13173 local variables whose live range does not overlap with it. Legacy code extending
13174 local lifetime is likely to break with the stack reuse optimization.
13176 For example,
13178 @smallexample
13179    int *p;
13180    @{
13181      int local1;
13183      p = &local1;
13184      local1 = 10;
13185      ....
13186    @}
13187    @{
13188       int local2;
13189       local2 = 20;
13190       ...
13191    @}
13193    if (*p == 10)  // out of scope use of local1
13194      @{
13196      @}
13197 @end smallexample
13199 Another example:
13200 @smallexample
13202    struct A
13203    @{
13204        A(int k) : i(k), j(k) @{ @}
13205        int i;
13206        int j;
13207    @};
13209    A *ap;
13211    void foo(const A& ar)
13212    @{
13213       ap = &ar;
13214    @}
13216    void bar()
13217    @{
13218       foo(A(10)); // temp object's lifetime ends when foo returns
13220       @{
13221         A a(20);
13222         ....
13223       @}
13224       ap->i+= 10;  // ap references out of scope temp whose space
13225                    // is reused with a. What is the value of ap->i?
13226    @}
13228 @end smallexample
13230 The lifetime of a compiler generated temporary is well defined by the C++
13231 standard. When a lifetime of a temporary ends, and if the temporary lives
13232 in memory, the optimizing compiler has the freedom to reuse its stack
13233 space with other temporaries or scoped local variables whose live range
13234 does not overlap with it. However some of the legacy code relies on
13235 the behavior of older compilers in which temporaries' stack space is
13236 not reused, the aggressive stack reuse can lead to runtime errors. This
13237 option is used to control the temporary stack reuse optimization.
13239 @item -ftrapv
13240 @opindex ftrapv
13241 This option generates traps for signed overflow on addition, subtraction,
13242 multiplication operations.
13243 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
13244 @option{-ftrapv} @option{-fwrapv} on the command-line results in
13245 @option{-fwrapv} being effective.  Note that only active options override, so
13246 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
13247 results in @option{-ftrapv} being effective.
13249 @item -fwrapv
13250 @opindex fwrapv
13251 This option instructs the compiler to assume that signed arithmetic
13252 overflow of addition, subtraction and multiplication wraps around
13253 using twos-complement representation.  This flag enables some optimizations
13254 and disables others.
13255 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
13256 @option{-ftrapv} @option{-fwrapv} on the command-line results in
13257 @option{-fwrapv} being effective.  Note that only active options override, so
13258 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
13259 results in @option{-ftrapv} being effective.
13261 @item -fwrapv-pointer
13262 @opindex fwrapv-pointer
13263 This option instructs the compiler to assume that pointer arithmetic
13264 overflow on addition and subtraction wraps around using twos-complement
13265 representation.  This flag disables some optimizations which assume
13266 pointer overflow is invalid.
13268 @item -fstrict-overflow
13269 @opindex fstrict-overflow
13270 This option implies @option{-fno-wrapv} @option{-fno-wrapv-pointer} and when
13271 negated implies @option{-fwrapv} @option{-fwrapv-pointer}.
13273 @item -fexceptions
13274 @opindex fexceptions
13275 Enable exception handling.  Generates extra code needed to propagate
13276 exceptions.  For some targets, this implies GCC generates frame
13277 unwind information for all functions, which can produce significant data
13278 size overhead, although it does not affect execution.  If you do not
13279 specify this option, GCC enables it by default for languages like
13280 C++ that normally require exception handling, and disables it for
13281 languages like C that do not normally require it.  However, you may need
13282 to enable this option when compiling C code that needs to interoperate
13283 properly with exception handlers written in C++.  You may also wish to
13284 disable this option if you are compiling older C++ programs that don't
13285 use exception handling.
13287 @item -fnon-call-exceptions
13288 @opindex fnon-call-exceptions
13289 Generate code that allows trapping instructions to throw exceptions.
13290 Note that this requires platform-specific runtime support that does
13291 not exist everywhere.  Moreover, it only allows @emph{trapping}
13292 instructions to throw exceptions, i.e.@: memory references or floating-point
13293 instructions.  It does not allow exceptions to be thrown from
13294 arbitrary signal handlers such as @code{SIGALRM}.
13296 @item -fdelete-dead-exceptions
13297 @opindex fdelete-dead-exceptions
13298 Consider that instructions that may throw exceptions but don't otherwise
13299 contribute to the execution of the program can be optimized away.
13300 This option is enabled by default for the Ada front end, as permitted by
13301 the Ada language specification.
13302 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
13304 @item -funwind-tables
13305 @opindex funwind-tables
13306 Similar to @option{-fexceptions}, except that it just generates any needed
13307 static data, but does not affect the generated code in any other way.
13308 You normally do not need to enable this option; instead, a language processor
13309 that needs this handling enables it on your behalf.
13311 @item -fasynchronous-unwind-tables
13312 @opindex fasynchronous-unwind-tables
13313 Generate unwind table in DWARF format, if supported by target machine.  The
13314 table is exact at each instruction boundary, so it can be used for stack
13315 unwinding from asynchronous events (such as debugger or garbage collector).
13317 @item -fno-gnu-unique
13318 @opindex fno-gnu-unique
13319 @opindex fgnu-unique
13320 On systems with recent GNU assembler and C library, the C++ compiler
13321 uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
13322 of template static data members and static local variables in inline
13323 functions are unique even in the presence of @code{RTLD_LOCAL}; this
13324 is necessary to avoid problems with a library used by two different
13325 @code{RTLD_LOCAL} plugins depending on a definition in one of them and
13326 therefore disagreeing with the other one about the binding of the
13327 symbol.  But this causes @code{dlclose} to be ignored for affected
13328 DSOs; if your program relies on reinitialization of a DSO via
13329 @code{dlclose} and @code{dlopen}, you can use
13330 @option{-fno-gnu-unique}.
13332 @item -fpcc-struct-return
13333 @opindex fpcc-struct-return
13334 Return ``short'' @code{struct} and @code{union} values in memory like
13335 longer ones, rather than in registers.  This convention is less
13336 efficient, but it has the advantage of allowing intercallability between
13337 GCC-compiled files and files compiled with other compilers, particularly
13338 the Portable C Compiler (pcc).
13340 The precise convention for returning structures in memory depends
13341 on the target configuration macros.
13343 Short structures and unions are those whose size and alignment match
13344 that of some integer type.
13346 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
13347 switch is not binary compatible with code compiled with the
13348 @option{-freg-struct-return} switch.
13349 Use it to conform to a non-default application binary interface.
13351 @item -freg-struct-return
13352 @opindex freg-struct-return
13353 Return @code{struct} and @code{union} values in registers when possible.
13354 This is more efficient for small structures than
13355 @option{-fpcc-struct-return}.
13357 If you specify neither @option{-fpcc-struct-return} nor
13358 @option{-freg-struct-return}, GCC defaults to whichever convention is
13359 standard for the target.  If there is no standard convention, GCC
13360 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
13361 the principal compiler.  In those cases, we can choose the standard, and
13362 we chose the more efficient register return alternative.
13364 @strong{Warning:} code compiled with the @option{-freg-struct-return}
13365 switch is not binary compatible with code compiled with the
13366 @option{-fpcc-struct-return} switch.
13367 Use it to conform to a non-default application binary interface.
13369 @item -fshort-enums
13370 @opindex fshort-enums
13371 Allocate to an @code{enum} type only as many bytes as it needs for the
13372 declared range of possible values.  Specifically, the @code{enum} type
13373 is equivalent to the smallest integer type that has enough room.
13375 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
13376 code that is not binary compatible with code generated without that switch.
13377 Use it to conform to a non-default application binary interface.
13379 @item -fshort-wchar
13380 @opindex fshort-wchar
13381 Override the underlying type for @code{wchar_t} to be @code{short
13382 unsigned int} instead of the default for the target.  This option is
13383 useful for building programs to run under WINE@.
13385 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
13386 code that is not binary compatible with code generated without that switch.
13387 Use it to conform to a non-default application binary interface.
13389 @item -fno-common
13390 @opindex fno-common
13391 @opindex fcommon
13392 @cindex tentative definitions
13393 In C code, this option controls the placement of global variables 
13394 defined without an initializer, known as @dfn{tentative definitions} 
13395 in the C standard.  Tentative definitions are distinct from declarations 
13396 of a variable with the @code{extern} keyword, which do not allocate storage.
13398 Unix C compilers have traditionally allocated storage for
13399 uninitialized global variables in a common block.  This allows the
13400 linker to resolve all tentative definitions of the same variable
13401 in different compilation units to the same object, or to a non-tentative
13402 definition.  
13403 This is the behavior specified by @option{-fcommon}, and is the default for 
13404 GCC on most targets.  
13405 On the other hand, this behavior is not required by ISO
13406 C, and on some targets may carry a speed or code size penalty on
13407 variable references.
13409 The @option{-fno-common} option specifies that the compiler should instead
13410 place uninitialized global variables in the BSS section of the object file.
13411 This inhibits the merging of tentative definitions by the linker so
13412 you get a multiple-definition error if the same 
13413 variable is defined in more than one compilation unit.
13414 Compiling with @option{-fno-common} is useful on targets for which
13415 it provides better performance, or if you wish to verify that the
13416 program will work on other systems that always treat uninitialized
13417 variable definitions this way.
13419 @item -fno-ident
13420 @opindex fno-ident
13421 @opindex fident
13422 Ignore the @code{#ident} directive.
13424 @item -finhibit-size-directive
13425 @opindex finhibit-size-directive
13426 Don't output a @code{.size} assembler directive, or anything else that
13427 would cause trouble if the function is split in the middle, and the
13428 two halves are placed at locations far apart in memory.  This option is
13429 used when compiling @file{crtstuff.c}; you should not need to use it
13430 for anything else.
13432 @item -fverbose-asm
13433 @opindex fverbose-asm
13434 Put extra commentary information in the generated assembly code to
13435 make it more readable.  This option is generally only of use to those
13436 who actually need to read the generated assembly code (perhaps while
13437 debugging the compiler itself).
13439 @option{-fno-verbose-asm}, the default, causes the
13440 extra information to be omitted and is useful when comparing two assembler
13441 files.
13443 The added comments include:
13445 @itemize @bullet
13447 @item
13448 information on the compiler version and command-line options,
13450 @item
13451 the source code lines associated with the assembly instructions,
13452 in the form FILENAME:LINENUMBER:CONTENT OF LINE,
13454 @item
13455 hints on which high-level expressions correspond to
13456 the various assembly instruction operands.
13458 @end itemize
13460 For example, given this C source file:
13462 @smallexample
13463 int test (int n)
13465   int i;
13466   int total = 0;
13468   for (i = 0; i < n; i++)
13469     total += i * i;
13471   return total;
13473 @end smallexample
13475 compiling to (x86_64) assembly via @option{-S} and emitting the result
13476 direct to stdout via @option{-o} @option{-}
13478 @smallexample
13479 gcc -S test.c -fverbose-asm -Os -o -
13480 @end smallexample
13482 gives output similar to this:
13484 @smallexample
13485         .file   "test.c"
13486 # GNU C11 (GCC) version 7.0.0 20160809 (experimental) (x86_64-pc-linux-gnu)
13487   [...snip...]
13488 # options passed:
13489   [...snip...]
13491         .text
13492         .globl  test
13493         .type   test, @@function
13494 test:
13495 .LFB0:
13496         .cfi_startproc
13497 # test.c:4:   int total = 0;
13498         xorl    %eax, %eax      # <retval>
13499 # test.c:6:   for (i = 0; i < n; i++)
13500         xorl    %edx, %edx      # i
13501 .L2:
13502 # test.c:6:   for (i = 0; i < n; i++)
13503         cmpl    %edi, %edx      # n, i
13504         jge     .L5     #,
13505 # test.c:7:     total += i * i;
13506         movl    %edx, %ecx      # i, tmp92
13507         imull   %edx, %ecx      # i, tmp92
13508 # test.c:6:   for (i = 0; i < n; i++)
13509         incl    %edx    # i
13510 # test.c:7:     total += i * i;
13511         addl    %ecx, %eax      # tmp92, <retval>
13512         jmp     .L2     #
13513 .L5:
13514 # test.c:10: @}
13515         ret
13516         .cfi_endproc
13517 .LFE0:
13518         .size   test, .-test
13519         .ident  "GCC: (GNU) 7.0.0 20160809 (experimental)"
13520         .section        .note.GNU-stack,"",@@progbits
13521 @end smallexample
13523 The comments are intended for humans rather than machines and hence the
13524 precise format of the comments is subject to change.
13526 @item -frecord-gcc-switches
13527 @opindex frecord-gcc-switches
13528 This switch causes the command line used to invoke the
13529 compiler to be recorded into the object file that is being created.
13530 This switch is only implemented on some targets and the exact format
13531 of the recording is target and binary file format dependent, but it
13532 usually takes the form of a section containing ASCII text.  This
13533 switch is related to the @option{-fverbose-asm} switch, but that
13534 switch only records information in the assembler output file as
13535 comments, so it never reaches the object file.
13536 See also @option{-grecord-gcc-switches} for another
13537 way of storing compiler options into the object file.
13539 @item -fpic
13540 @opindex fpic
13541 @cindex global offset table
13542 @cindex PIC
13543 Generate position-independent code (PIC) suitable for use in a shared
13544 library, if supported for the target machine.  Such code accesses all
13545 constant addresses through a global offset table (GOT)@.  The dynamic
13546 loader resolves the GOT entries when the program starts (the dynamic
13547 loader is not part of GCC; it is part of the operating system).  If
13548 the GOT size for the linked executable exceeds a machine-specific
13549 maximum size, you get an error message from the linker indicating that
13550 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
13551 instead.  (These maximums are 8k on the SPARC, 28k on AArch64 and 32k
13552 on the m68k and RS/6000.  The x86 has no such limit.)
13554 Position-independent code requires special support, and therefore works
13555 only on certain machines.  For the x86, GCC supports PIC for System V
13556 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
13557 position-independent.
13559 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
13560 are defined to 1.
13562 @item -fPIC
13563 @opindex fPIC
13564 If supported for the target machine, emit position-independent code,
13565 suitable for dynamic linking and avoiding any limit on the size of the
13566 global offset table.  This option makes a difference on AArch64, m68k,
13567 PowerPC and SPARC@.
13569 Position-independent code requires special support, and therefore works
13570 only on certain machines.
13572 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
13573 are defined to 2.
13575 @item -fpie
13576 @itemx -fPIE
13577 @opindex fpie
13578 @opindex fPIE
13579 These options are similar to @option{-fpic} and @option{-fPIC}, but the
13580 generated position-independent code can be only linked into executables.
13581 Usually these options are used to compile code that will be linked using
13582 the @option{-pie} GCC option.
13584 @option{-fpie} and @option{-fPIE} both define the macros
13585 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
13586 for @option{-fpie} and 2 for @option{-fPIE}.
13588 @item -fno-plt
13589 @opindex fno-plt
13590 @opindex fplt
13591 Do not use the PLT for external function calls in position-independent code.
13592 Instead, load the callee address at call sites from the GOT and branch to it.
13593 This leads to more efficient code by eliminating PLT stubs and exposing
13594 GOT loads to optimizations.  On architectures such as 32-bit x86 where
13595 PLT stubs expect the GOT pointer in a specific register, this gives more
13596 register allocation freedom to the compiler.
13597 Lazy binding requires use of the PLT; 
13598 with @option{-fno-plt} all external symbols are resolved at load time.
13600 Alternatively, the function attribute @code{noplt} can be used to avoid calls
13601 through the PLT for specific external functions.
13603 In position-dependent code, a few targets also convert calls to
13604 functions that are marked to not use the PLT to use the GOT instead.
13606 @item -fno-jump-tables
13607 @opindex fno-jump-tables
13608 @opindex fjump-tables
13609 Do not use jump tables for switch statements even where it would be
13610 more efficient than other code generation strategies.  This option is
13611 of use in conjunction with @option{-fpic} or @option{-fPIC} for
13612 building code that forms part of a dynamic linker and cannot
13613 reference the address of a jump table.  On some targets, jump tables
13614 do not require a GOT and this option is not needed.
13616 @item -ffixed-@var{reg}
13617 @opindex ffixed
13618 Treat the register named @var{reg} as a fixed register; generated code
13619 should never refer to it (except perhaps as a stack pointer, frame
13620 pointer or in some other fixed role).
13622 @var{reg} must be the name of a register.  The register names accepted
13623 are machine-specific and are defined in the @code{REGISTER_NAMES}
13624 macro in the machine description macro file.
13626 This flag does not have a negative form, because it specifies a
13627 three-way choice.
13629 @item -fcall-used-@var{reg}
13630 @opindex fcall-used
13631 Treat the register named @var{reg} as an allocable register that is
13632 clobbered by function calls.  It may be allocated for temporaries or
13633 variables that do not live across a call.  Functions compiled this way
13634 do not save and restore the register @var{reg}.
13636 It is an error to use this flag with the frame pointer or stack pointer.
13637 Use of this flag for other registers that have fixed pervasive roles in
13638 the machine's execution model produces disastrous results.
13640 This flag does not have a negative form, because it specifies a
13641 three-way choice.
13643 @item -fcall-saved-@var{reg}
13644 @opindex fcall-saved
13645 Treat the register named @var{reg} as an allocable register saved by
13646 functions.  It may be allocated even for temporaries or variables that
13647 live across a call.  Functions compiled this way save and restore
13648 the register @var{reg} if they use it.
13650 It is an error to use this flag with the frame pointer or stack pointer.
13651 Use of this flag for other registers that have fixed pervasive roles in
13652 the machine's execution model produces disastrous results.
13654 A different sort of disaster results from the use of this flag for
13655 a register in which function values may be returned.
13657 This flag does not have a negative form, because it specifies a
13658 three-way choice.
13660 @item -fpack-struct[=@var{n}]
13661 @opindex fpack-struct
13662 Without a value specified, pack all structure members together without
13663 holes.  When a value is specified (which must be a small power of two), pack
13664 structure members according to this value, representing the maximum
13665 alignment (that is, objects with default alignment requirements larger than
13666 this are output potentially unaligned at the next fitting location.
13668 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
13669 code that is not binary compatible with code generated without that switch.
13670 Additionally, it makes the code suboptimal.
13671 Use it to conform to a non-default application binary interface.
13673 @item -fleading-underscore
13674 @opindex fleading-underscore
13675 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
13676 change the way C symbols are represented in the object file.  One use
13677 is to help link with legacy assembly code.
13679 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
13680 generate code that is not binary compatible with code generated without that
13681 switch.  Use it to conform to a non-default application binary interface.
13682 Not all targets provide complete support for this switch.
13684 @item -ftls-model=@var{model}
13685 @opindex ftls-model
13686 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
13687 The @var{model} argument should be one of @samp{global-dynamic},
13688 @samp{local-dynamic}, @samp{initial-exec} or @samp{local-exec}.
13689 Note that the choice is subject to optimization: the compiler may use
13690 a more efficient model for symbols not visible outside of the translation
13691 unit, or if @option{-fpic} is not given on the command line.
13693 The default without @option{-fpic} is @samp{initial-exec}; with
13694 @option{-fpic} the default is @samp{global-dynamic}.
13696 @item -ftrampolines
13697 @opindex ftrampolines
13698 For targets that normally need trampolines for nested functions, always
13699 generate them instead of using descriptors.  Otherwise, for targets that
13700 do not need them, like for example HP-PA or IA-64, do nothing.
13702 A trampoline is a small piece of code that is created at run time on the
13703 stack when the address of a nested function is taken, and is used to call
13704 the nested function indirectly.  Therefore, it requires the stack to be
13705 made executable in order for the program to work properly.
13707 @option{-fno-trampolines} is enabled by default on a language by language
13708 basis to let the compiler avoid generating them, if it computes that this
13709 is safe, and replace them with descriptors.  Descriptors are made up of data
13710 only, but the generated code must be prepared to deal with them.  As of this
13711 writing, @option{-fno-trampolines} is enabled by default only for Ada.
13713 Moreover, code compiled with @option{-ftrampolines} and code compiled with
13714 @option{-fno-trampolines} are not binary compatible if nested functions are
13715 present.  This option must therefore be used on a program-wide basis and be
13716 manipulated with extreme care.
13718 @item -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]}
13719 @opindex fvisibility
13720 Set the default ELF image symbol visibility to the specified option---all
13721 symbols are marked with this unless overridden within the code.
13722 Using this feature can very substantially improve linking and
13723 load times of shared object libraries, produce more optimized
13724 code, provide near-perfect API export and prevent symbol clashes.
13725 It is @strong{strongly} recommended that you use this in any shared objects
13726 you distribute.
13728 Despite the nomenclature, @samp{default} always means public; i.e.,
13729 available to be linked against from outside the shared object.
13730 @samp{protected} and @samp{internal} are pretty useless in real-world
13731 usage so the only other commonly used option is @samp{hidden}.
13732 The default if @option{-fvisibility} isn't specified is
13733 @samp{default}, i.e., make every symbol public.
13735 A good explanation of the benefits offered by ensuring ELF
13736 symbols have the correct visibility is given by ``How To Write
13737 Shared Libraries'' by Ulrich Drepper (which can be found at
13738 @w{@uref{https://www.akkadia.org/drepper/}})---however a superior
13739 solution made possible by this option to marking things hidden when
13740 the default is public is to make the default hidden and mark things
13741 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
13742 and @code{__attribute__ ((visibility("default")))} instead of
13743 @code{__declspec(dllexport)} you get almost identical semantics with
13744 identical syntax.  This is a great boon to those working with
13745 cross-platform projects.
13747 For those adding visibility support to existing code, you may find
13748 @code{#pragma GCC visibility} of use.  This works by you enclosing
13749 the declarations you wish to set visibility for with (for example)
13750 @code{#pragma GCC visibility push(hidden)} and
13751 @code{#pragma GCC visibility pop}.
13752 Bear in mind that symbol visibility should be viewed @strong{as
13753 part of the API interface contract} and thus all new code should
13754 always specify visibility when it is not the default; i.e., declarations
13755 only for use within the local DSO should @strong{always} be marked explicitly
13756 as hidden as so to avoid PLT indirection overheads---making this
13757 abundantly clear also aids readability and self-documentation of the code.
13758 Note that due to ISO C++ specification requirements, @code{operator new} and
13759 @code{operator delete} must always be of default visibility.
13761 Be aware that headers from outside your project, in particular system
13762 headers and headers from any other library you use, may not be
13763 expecting to be compiled with visibility other than the default.  You
13764 may need to explicitly say @code{#pragma GCC visibility push(default)}
13765 before including any such headers.
13767 @code{extern} declarations are not affected by @option{-fvisibility}, so
13768 a lot of code can be recompiled with @option{-fvisibility=hidden} with
13769 no modifications.  However, this means that calls to @code{extern}
13770 functions with no explicit visibility use the PLT, so it is more
13771 effective to use @code{__attribute ((visibility))} and/or
13772 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
13773 declarations should be treated as hidden.
13775 Note that @option{-fvisibility} does affect C++ vague linkage
13776 entities. This means that, for instance, an exception class that is
13777 be thrown between DSOs must be explicitly marked with default
13778 visibility so that the @samp{type_info} nodes are unified between
13779 the DSOs.
13781 An overview of these techniques, their benefits and how to use them
13782 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
13784 @item -fstrict-volatile-bitfields
13785 @opindex fstrict-volatile-bitfields
13786 This option should be used if accesses to volatile bit-fields (or other
13787 structure fields, although the compiler usually honors those types
13788 anyway) should use a single access of the width of the
13789 field's type, aligned to a natural alignment if possible.  For
13790 example, targets with memory-mapped peripheral registers might require
13791 all such accesses to be 16 bits wide; with this flag you can
13792 declare all peripheral bit-fields as @code{unsigned short} (assuming short
13793 is 16 bits on these targets) to force GCC to use 16-bit accesses
13794 instead of, perhaps, a more efficient 32-bit access.
13796 If this option is disabled, the compiler uses the most efficient
13797 instruction.  In the previous example, that might be a 32-bit load
13798 instruction, even though that accesses bytes that do not contain
13799 any portion of the bit-field, or memory-mapped registers unrelated to
13800 the one being updated.
13802 In some cases, such as when the @code{packed} attribute is applied to a 
13803 structure field, it may not be possible to access the field with a single
13804 read or write that is correctly aligned for the target machine.  In this
13805 case GCC falls back to generating multiple accesses rather than code that 
13806 will fault or truncate the result at run time.
13808 Note:  Due to restrictions of the C/C++11 memory model, write accesses are
13809 not allowed to touch non bit-field members.  It is therefore recommended
13810 to define all bits of the field's type as bit-field members.
13812 The default value of this option is determined by the application binary
13813 interface for the target processor.
13815 @item -fsync-libcalls
13816 @opindex fsync-libcalls
13817 This option controls whether any out-of-line instance of the @code{__sync}
13818 family of functions may be used to implement the C++11 @code{__atomic}
13819 family of functions.
13821 The default value of this option is enabled, thus the only useful form
13822 of the option is @option{-fno-sync-libcalls}.  This option is used in
13823 the implementation of the @file{libatomic} runtime library.
13825 @end table
13827 @node Developer Options
13828 @section GCC Developer Options
13829 @cindex developer options
13830 @cindex debugging GCC
13831 @cindex debug dump options
13832 @cindex dump options
13833 @cindex compilation statistics
13835 This section describes command-line options that are primarily of
13836 interest to GCC developers, including options to support compiler
13837 testing and investigation of compiler bugs and compile-time
13838 performance problems.  This includes options that produce debug dumps
13839 at various points in the compilation; that print statistics such as
13840 memory use and execution time; and that print information about GCC's
13841 configuration, such as where it searches for libraries.  You should
13842 rarely need to use any of these options for ordinary compilation and
13843 linking tasks.
13845 Many developer options that cause GCC to dump output to a file take an
13846 optional @samp{=@var{filename}} suffix. You can specify @samp{stdout}
13847 or @samp{-} to dump to standard output, and @samp{stderr} for standard
13848 error.
13850 If @samp{=@var{filename}} is omitted, a default dump file name is
13851 constructed by concatenating the base dump file name, a pass number,
13852 phase letter, and pass name.  The base dump file name is the name of
13853 output file produced by the compiler if explicitly specified and not
13854 an executable; otherwise it is the source file name.
13855 The pass number is determined by the order passes are registered with
13856 the compiler's pass manager. 
13857 This is generally the same as the order of execution, but passes
13858 registered by plugins, target-specific passes, or passes that are
13859 otherwise registered late are numbered higher than the pass named
13860 @samp{final}, even if they are executed earlier.  The phase letter is
13861 one of @samp{i} (inter-procedural analysis), @samp{l}
13862 (language-specific), @samp{r} (RTL), or @samp{t} (tree). 
13863 The files are created in the directory of the output file. 
13865 @table @gcctabopt
13867 @item -d@var{letters}
13868 @itemx -fdump-rtl-@var{pass}
13869 @itemx -fdump-rtl-@var{pass}=@var{filename}
13870 @opindex d
13871 @opindex fdump-rtl-@var{pass}
13872 Says to make debugging dumps during compilation at times specified by
13873 @var{letters}.  This is used for debugging the RTL-based passes of the
13874 compiler.
13876 Some @option{-d@var{letters}} switches have different meaning when
13877 @option{-E} is used for preprocessing.  @xref{Preprocessor Options},
13878 for information about preprocessor-specific dump options.
13880 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
13881 @option{-d} option @var{letters}.  Here are the possible
13882 letters for use in @var{pass} and @var{letters}, and their meanings:
13884 @table @gcctabopt
13886 @item -fdump-rtl-alignments
13887 @opindex fdump-rtl-alignments
13888 Dump after branch alignments have been computed.
13890 @item -fdump-rtl-asmcons
13891 @opindex fdump-rtl-asmcons
13892 Dump after fixing rtl statements that have unsatisfied in/out constraints.
13894 @item -fdump-rtl-auto_inc_dec
13895 @opindex fdump-rtl-auto_inc_dec
13896 Dump after auto-inc-dec discovery.  This pass is only run on
13897 architectures that have auto inc or auto dec instructions.
13899 @item -fdump-rtl-barriers
13900 @opindex fdump-rtl-barriers
13901 Dump after cleaning up the barrier instructions.
13903 @item -fdump-rtl-bbpart
13904 @opindex fdump-rtl-bbpart
13905 Dump after partitioning hot and cold basic blocks.
13907 @item -fdump-rtl-bbro
13908 @opindex fdump-rtl-bbro
13909 Dump after block reordering.
13911 @item -fdump-rtl-btl1
13912 @itemx -fdump-rtl-btl2
13913 @opindex fdump-rtl-btl2
13914 @opindex fdump-rtl-btl2
13915 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
13916 after the two branch
13917 target load optimization passes.
13919 @item -fdump-rtl-bypass
13920 @opindex fdump-rtl-bypass
13921 Dump after jump bypassing and control flow optimizations.
13923 @item -fdump-rtl-combine
13924 @opindex fdump-rtl-combine
13925 Dump after the RTL instruction combination pass.
13927 @item -fdump-rtl-compgotos
13928 @opindex fdump-rtl-compgotos
13929 Dump after duplicating the computed gotos.
13931 @item -fdump-rtl-ce1
13932 @itemx -fdump-rtl-ce2
13933 @itemx -fdump-rtl-ce3
13934 @opindex fdump-rtl-ce1
13935 @opindex fdump-rtl-ce2
13936 @opindex fdump-rtl-ce3
13937 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
13938 @option{-fdump-rtl-ce3} enable dumping after the three
13939 if conversion passes.
13941 @item -fdump-rtl-cprop_hardreg
13942 @opindex fdump-rtl-cprop_hardreg
13943 Dump after hard register copy propagation.
13945 @item -fdump-rtl-csa
13946 @opindex fdump-rtl-csa
13947 Dump after combining stack adjustments.
13949 @item -fdump-rtl-cse1
13950 @itemx -fdump-rtl-cse2
13951 @opindex fdump-rtl-cse1
13952 @opindex fdump-rtl-cse2
13953 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
13954 the two common subexpression elimination passes.
13956 @item -fdump-rtl-dce
13957 @opindex fdump-rtl-dce
13958 Dump after the standalone dead code elimination passes.
13960 @item -fdump-rtl-dbr
13961 @opindex fdump-rtl-dbr
13962 Dump after delayed branch scheduling.
13964 @item -fdump-rtl-dce1
13965 @itemx -fdump-rtl-dce2
13966 @opindex fdump-rtl-dce1
13967 @opindex fdump-rtl-dce2
13968 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
13969 the two dead store elimination passes.
13971 @item -fdump-rtl-eh
13972 @opindex fdump-rtl-eh
13973 Dump after finalization of EH handling code.
13975 @item -fdump-rtl-eh_ranges
13976 @opindex fdump-rtl-eh_ranges
13977 Dump after conversion of EH handling range regions.
13979 @item -fdump-rtl-expand
13980 @opindex fdump-rtl-expand
13981 Dump after RTL generation.
13983 @item -fdump-rtl-fwprop1
13984 @itemx -fdump-rtl-fwprop2
13985 @opindex fdump-rtl-fwprop1
13986 @opindex fdump-rtl-fwprop2
13987 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
13988 dumping after the two forward propagation passes.
13990 @item -fdump-rtl-gcse1
13991 @itemx -fdump-rtl-gcse2
13992 @opindex fdump-rtl-gcse1
13993 @opindex fdump-rtl-gcse2
13994 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
13995 after global common subexpression elimination.
13997 @item -fdump-rtl-init-regs
13998 @opindex fdump-rtl-init-regs
13999 Dump after the initialization of the registers.
14001 @item -fdump-rtl-initvals
14002 @opindex fdump-rtl-initvals
14003 Dump after the computation of the initial value sets.
14005 @item -fdump-rtl-into_cfglayout
14006 @opindex fdump-rtl-into_cfglayout
14007 Dump after converting to cfglayout mode.
14009 @item -fdump-rtl-ira
14010 @opindex fdump-rtl-ira
14011 Dump after iterated register allocation.
14013 @item -fdump-rtl-jump
14014 @opindex fdump-rtl-jump
14015 Dump after the second jump optimization.
14017 @item -fdump-rtl-loop2
14018 @opindex fdump-rtl-loop2
14019 @option{-fdump-rtl-loop2} enables dumping after the rtl
14020 loop optimization passes.
14022 @item -fdump-rtl-mach
14023 @opindex fdump-rtl-mach
14024 Dump after performing the machine dependent reorganization pass, if that
14025 pass exists.
14027 @item -fdump-rtl-mode_sw
14028 @opindex fdump-rtl-mode_sw
14029 Dump after removing redundant mode switches.
14031 @item -fdump-rtl-rnreg
14032 @opindex fdump-rtl-rnreg
14033 Dump after register renumbering.
14035 @item -fdump-rtl-outof_cfglayout
14036 @opindex fdump-rtl-outof_cfglayout
14037 Dump after converting from cfglayout mode.
14039 @item -fdump-rtl-peephole2
14040 @opindex fdump-rtl-peephole2
14041 Dump after the peephole pass.
14043 @item -fdump-rtl-postreload
14044 @opindex fdump-rtl-postreload
14045 Dump after post-reload optimizations.
14047 @item -fdump-rtl-pro_and_epilogue
14048 @opindex fdump-rtl-pro_and_epilogue
14049 Dump after generating the function prologues and epilogues.
14051 @item -fdump-rtl-sched1
14052 @itemx -fdump-rtl-sched2
14053 @opindex fdump-rtl-sched1
14054 @opindex fdump-rtl-sched2
14055 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
14056 after the basic block scheduling passes.
14058 @item -fdump-rtl-ree
14059 @opindex fdump-rtl-ree
14060 Dump after sign/zero extension elimination.
14062 @item -fdump-rtl-seqabstr
14063 @opindex fdump-rtl-seqabstr
14064 Dump after common sequence discovery.
14066 @item -fdump-rtl-shorten
14067 @opindex fdump-rtl-shorten
14068 Dump after shortening branches.
14070 @item -fdump-rtl-sibling
14071 @opindex fdump-rtl-sibling
14072 Dump after sibling call optimizations.
14074 @item -fdump-rtl-split1
14075 @itemx -fdump-rtl-split2
14076 @itemx -fdump-rtl-split3
14077 @itemx -fdump-rtl-split4
14078 @itemx -fdump-rtl-split5
14079 @opindex fdump-rtl-split1
14080 @opindex fdump-rtl-split2
14081 @opindex fdump-rtl-split3
14082 @opindex fdump-rtl-split4
14083 @opindex fdump-rtl-split5
14084 These options enable dumping after five rounds of
14085 instruction splitting.
14087 @item -fdump-rtl-sms
14088 @opindex fdump-rtl-sms
14089 Dump after modulo scheduling.  This pass is only run on some
14090 architectures.
14092 @item -fdump-rtl-stack
14093 @opindex fdump-rtl-stack
14094 Dump after conversion from GCC's ``flat register file'' registers to the
14095 x87's stack-like registers.  This pass is only run on x86 variants.
14097 @item -fdump-rtl-subreg1
14098 @itemx -fdump-rtl-subreg2
14099 @opindex fdump-rtl-subreg1
14100 @opindex fdump-rtl-subreg2
14101 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
14102 the two subreg expansion passes.
14104 @item -fdump-rtl-unshare
14105 @opindex fdump-rtl-unshare
14106 Dump after all rtl has been unshared.
14108 @item -fdump-rtl-vartrack
14109 @opindex fdump-rtl-vartrack
14110 Dump after variable tracking.
14112 @item -fdump-rtl-vregs
14113 @opindex fdump-rtl-vregs
14114 Dump after converting virtual registers to hard registers.
14116 @item -fdump-rtl-web
14117 @opindex fdump-rtl-web
14118 Dump after live range splitting.
14120 @item -fdump-rtl-regclass
14121 @itemx -fdump-rtl-subregs_of_mode_init
14122 @itemx -fdump-rtl-subregs_of_mode_finish
14123 @itemx -fdump-rtl-dfinit
14124 @itemx -fdump-rtl-dfinish
14125 @opindex fdump-rtl-regclass
14126 @opindex fdump-rtl-subregs_of_mode_init
14127 @opindex fdump-rtl-subregs_of_mode_finish
14128 @opindex fdump-rtl-dfinit
14129 @opindex fdump-rtl-dfinish
14130 These dumps are defined but always produce empty files.
14132 @item -da
14133 @itemx -fdump-rtl-all
14134 @opindex da
14135 @opindex fdump-rtl-all
14136 Produce all the dumps listed above.
14138 @item -dA
14139 @opindex dA
14140 Annotate the assembler output with miscellaneous debugging information.
14142 @item -dD
14143 @opindex dD
14144 Dump all macro definitions, at the end of preprocessing, in addition to
14145 normal output.
14147 @item -dH
14148 @opindex dH
14149 Produce a core dump whenever an error occurs.
14151 @item -dp
14152 @opindex dp
14153 Annotate the assembler output with a comment indicating which
14154 pattern and alternative is used.  The length and cost of each instruction are
14155 also printed.
14157 @item -dP
14158 @opindex dP
14159 Dump the RTL in the assembler output as a comment before each instruction.
14160 Also turns on @option{-dp} annotation.
14162 @item -dx
14163 @opindex dx
14164 Just generate RTL for a function instead of compiling it.  Usually used
14165 with @option{-fdump-rtl-expand}.
14166 @end table
14168 @item -fdump-debug
14169 @opindex fdump-debug
14170 Dump debugging information generated during the debug
14171 generation phase.
14173 @item -fdump-earlydebug
14174 @opindex fdump-earlydebug
14175 Dump debugging information generated during the early debug
14176 generation phase.
14178 @item -fdump-noaddr
14179 @opindex fdump-noaddr
14180 When doing debugging dumps, suppress address output.  This makes it more
14181 feasible to use diff on debugging dumps for compiler invocations with
14182 different compiler binaries and/or different
14183 text / bss / data / heap / stack / dso start locations.
14185 @item -freport-bug
14186 @opindex freport-bug
14187 Collect and dump debug information into a temporary file if an
14188 internal compiler error (ICE) occurs.
14190 @item -fdump-unnumbered
14191 @opindex fdump-unnumbered
14192 When doing debugging dumps, suppress instruction numbers and address output.
14193 This makes it more feasible to use diff on debugging dumps for compiler
14194 invocations with different options, in particular with and without
14195 @option{-g}.
14197 @item -fdump-unnumbered-links
14198 @opindex fdump-unnumbered-links
14199 When doing debugging dumps (see @option{-d} option above), suppress
14200 instruction numbers for the links to the previous and next instructions
14201 in a sequence.
14203 @item -fdump-ipa-@var{switch}
14204 @itemx -fdump-ipa-@var{switch}-@var{options}
14205 @opindex fdump-ipa
14206 Control the dumping at various stages of inter-procedural analysis
14207 language tree to a file.  The file name is generated by appending a
14208 switch specific suffix to the source file name, and the file is created
14209 in the same directory as the output file.  The following dumps are
14210 possible:
14212 @table @samp
14213 @item all
14214 Enables all inter-procedural analysis dumps.
14216 @item cgraph
14217 Dumps information about call-graph optimization, unused function removal,
14218 and inlining decisions.
14220 @item inline
14221 Dump after function inlining.
14223 @end table
14225 Additionally, the options @option{-optimized}, @option{-missed},
14226 @option{-note}, and @option{-all} can be provided, with the same meaning
14227 as for @option{-fopt-info}, defaulting to @option{-optimized}.
14229 For example, @option{-fdump-ipa-inline-optimized-missed} will emit
14230 information on callsites that were inlined, along with callsites
14231 that were not inlined.
14233 By default, the dump will contain messages about successful
14234 optimizations (equivalent to @option{-optimized}) together with
14235 low-level details about the analysis.
14237 @item -fdump-lang-all
14238 @itemx -fdump-lang-@var{switch}
14239 @itemx -fdump-lang-@var{switch}-@var{options}
14240 @itemx -fdump-lang-@var{switch}-@var{options}=@var{filename}
14241 @opindex fdump-lang-all
14242 @opindex fdump-lang
14243 Control the dumping of language-specific information.  The @var{options}
14244 and @var{filename} portions behave as described in the
14245 @option{-fdump-tree} option.  The following @var{switch} values are
14246 accepted:
14248 @table @samp
14249 @item all
14251 Enable all language-specific dumps.
14253 @item class
14254 Dump class hierarchy information.  Virtual table information is emitted
14255 unless '@option{slim}' is specified.  This option is applicable to C++ only.
14257 @item raw
14258 Dump the raw internal tree data.  This option is applicable to C++ only.
14260 @end table
14262 @item -fdump-passes
14263 @opindex fdump-passes
14264 Print on @file{stderr} the list of optimization passes that are turned
14265 on and off by the current command-line options.
14267 @item -fdump-statistics-@var{option}
14268 @opindex fdump-statistics
14269 Enable and control dumping of pass statistics in a separate file.  The
14270 file name is generated by appending a suffix ending in
14271 @samp{.statistics} to the source file name, and the file is created in
14272 the same directory as the output file.  If the @samp{-@var{option}}
14273 form is used, @samp{-stats} causes counters to be summed over the
14274 whole compilation unit while @samp{-details} dumps every event as
14275 the passes generate them.  The default with no option is to sum
14276 counters for each function compiled.
14278 @item -fdump-tree-all
14279 @itemx -fdump-tree-@var{switch}
14280 @itemx -fdump-tree-@var{switch}-@var{options}
14281 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
14282 @opindex fdump-tree-all
14283 @opindex fdump-tree
14284 Control the dumping at various stages of processing the intermediate
14285 language tree to a file.  If the @samp{-@var{options}}
14286 form is used, @var{options} is a list of @samp{-} separated options
14287 which control the details of the dump.  Not all options are applicable
14288 to all dumps; those that are not meaningful are ignored.  The
14289 following options are available
14291 @table @samp
14292 @item address
14293 Print the address of each node.  Usually this is not meaningful as it
14294 changes according to the environment and source file.  Its primary use
14295 is for tying up a dump file with a debug environment.
14296 @item asmname
14297 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
14298 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
14299 use working backward from mangled names in the assembly file.
14300 @item slim
14301 When dumping front-end intermediate representations, inhibit dumping
14302 of members of a scope or body of a function merely because that scope
14303 has been reached.  Only dump such items when they are directly reachable
14304 by some other path.
14306 When dumping pretty-printed trees, this option inhibits dumping the
14307 bodies of control structures.
14309 When dumping RTL, print the RTL in slim (condensed) form instead of
14310 the default LISP-like representation.
14311 @item raw
14312 Print a raw representation of the tree.  By default, trees are
14313 pretty-printed into a C-like representation.
14314 @item details
14315 Enable more detailed dumps (not honored by every dump option). Also
14316 include information from the optimization passes.
14317 @item stats
14318 Enable dumping various statistics about the pass (not honored by every dump
14319 option).
14320 @item blocks
14321 Enable showing basic block boundaries (disabled in raw dumps).
14322 @item graph
14323 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
14324 dump a representation of the control flow graph suitable for viewing with
14325 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
14326 the file is pretty-printed as a subgraph, so that GraphViz can render them
14327 all in a single plot.
14329 This option currently only works for RTL dumps, and the RTL is always
14330 dumped in slim form.
14331 @item vops
14332 Enable showing virtual operands for every statement.
14333 @item lineno
14334 Enable showing line numbers for statements.
14335 @item uid
14336 Enable showing the unique ID (@code{DECL_UID}) for each variable.
14337 @item verbose
14338 Enable showing the tree dump for each statement.
14339 @item eh
14340 Enable showing the EH region number holding each statement.
14341 @item scev
14342 Enable showing scalar evolution analysis details.
14343 @item optimized
14344 Enable showing optimization information (only available in certain
14345 passes).
14346 @item missed
14347 Enable showing missed optimization information (only available in certain
14348 passes).
14349 @item note
14350 Enable other detailed optimization information (only available in
14351 certain passes).
14352 @item all
14353 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
14354 and @option{lineno}.
14355 @item optall
14356 Turn on all optimization options, i.e., @option{optimized},
14357 @option{missed}, and @option{note}.
14358 @end table
14360 To determine what tree dumps are available or find the dump for a pass
14361 of interest follow the steps below.
14363 @enumerate
14364 @item
14365 Invoke GCC with @option{-fdump-passes} and in the @file{stderr} output
14366 look for a code that corresponds to the pass you are interested in.
14367 For example, the codes @code{tree-evrp}, @code{tree-vrp1}, and
14368 @code{tree-vrp2} correspond to the three Value Range Propagation passes.
14369 The number at the end distinguishes distinct invocations of the same pass.
14370 @item
14371 To enable the creation of the dump file, append the pass code to
14372 the @option{-fdump-} option prefix and invoke GCC with it.  For example,
14373 to enable the dump from the Early Value Range Propagation pass, invoke
14374 GCC with the @option{-fdump-tree-evrp} option.  Optionally, you may
14375 specify the name of the dump file.  If you don't specify one, GCC
14376 creates as described below.
14377 @item
14378 Find the pass dump in a file whose name is composed of three components
14379 separated by a period: the name of the source file GCC was invoked to
14380 compile, a numeric suffix indicating the pass number followed by the
14381 letter @samp{t} for tree passes (and the letter @samp{r} for RTL passes),
14382 and finally the pass code.  For example, the Early VRP pass dump might
14383 be in a file named @file{myfile.c.038t.evrp} in the current working
14384 directory.  Note that the numeric codes are not stable and may change
14385 from one version of GCC to another.
14386 @end enumerate
14388 @item -fopt-info
14389 @itemx -fopt-info-@var{options}
14390 @itemx -fopt-info-@var{options}=@var{filename}
14391 @opindex fopt-info
14392 Controls optimization dumps from various optimization passes. If the
14393 @samp{-@var{options}} form is used, @var{options} is a list of
14394 @samp{-} separated option keywords to select the dump details and
14395 optimizations.  
14397 The @var{options} can be divided into three groups:
14398 @enumerate
14399 @item
14400 options describing what kinds of messages should be emitted,
14401 @item
14402 options describing the verbosity of the dump, and
14403 @item
14404 options describing which optimizations should be included.
14405 @end enumerate
14406 The options from each group can be freely mixed as they are
14407 non-overlapping. However, in case of any conflicts,
14408 the later options override the earlier options on the command
14409 line. 
14411 The following options control which kinds of messages should be emitted:
14413 @table @samp
14414 @item optimized
14415 Print information when an optimization is successfully applied. It is
14416 up to a pass to decide which information is relevant. For example, the
14417 vectorizer passes print the source location of loops which are
14418 successfully vectorized.
14419 @item missed
14420 Print information about missed optimizations. Individual passes
14421 control which information to include in the output. 
14422 @item note
14423 Print verbose information about optimizations, such as certain
14424 transformations, more detailed messages about decisions etc.
14425 @item all
14426 Print detailed optimization information. This includes
14427 @samp{optimized}, @samp{missed}, and @samp{note}.
14428 @end table
14430 The following option controls the dump verbosity:
14432 @table @samp
14433 @item internals
14434 By default, only ``high-level'' messages are emitted. This option enables
14435 additional, more detailed, messages, which are likely to only be of interest
14436 to GCC developers.
14437 @end table
14439 One or more of the following option keywords can be used to describe a
14440 group of optimizations:
14442 @table @samp
14443 @item ipa
14444 Enable dumps from all interprocedural optimizations.
14445 @item loop
14446 Enable dumps from all loop optimizations.
14447 @item inline
14448 Enable dumps from all inlining optimizations.
14449 @item omp
14450 Enable dumps from all OMP (Offloading and Multi Processing) optimizations.
14451 @item vec
14452 Enable dumps from all vectorization optimizations.
14453 @item optall
14454 Enable dumps from all optimizations. This is a superset of
14455 the optimization groups listed above.
14456 @end table
14458 If @var{options} is
14459 omitted, it defaults to @samp{optimized-optall}, which means to dump messages
14460 about successful optimizations from all the passes, omitting messages
14461 that are treated as ``internals''.
14463 If the @var{filename} is provided, then the dumps from all the
14464 applicable optimizations are concatenated into the @var{filename}.
14465 Otherwise the dump is output onto @file{stderr}. Though multiple
14466 @option{-fopt-info} options are accepted, only one of them can include
14467 a @var{filename}. If other filenames are provided then all but the
14468 first such option are ignored.
14470 Note that the output @var{filename} is overwritten
14471 in case of multiple translation units. If a combined output from
14472 multiple translation units is desired, @file{stderr} should be used
14473 instead.
14475 In the following example, the optimization info is output to
14476 @file{stderr}:
14478 @smallexample
14479 gcc -O3 -fopt-info
14480 @end smallexample
14482 This example:
14483 @smallexample
14484 gcc -O3 -fopt-info-missed=missed.all
14485 @end smallexample
14487 @noindent
14488 outputs missed optimization report from all the passes into
14489 @file{missed.all}, and this one:
14491 @smallexample
14492 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
14493 @end smallexample
14495 @noindent
14496 prints information about missed optimization opportunities from
14497 vectorization passes on @file{stderr}.  
14498 Note that @option{-fopt-info-vec-missed} is equivalent to 
14499 @option{-fopt-info-missed-vec}.  The order of the optimization group
14500 names and message types listed after @option{-fopt-info} does not matter.
14502 As another example,
14503 @smallexample
14504 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
14505 @end smallexample
14507 @noindent
14508 outputs information about missed optimizations as well as
14509 optimized locations from all the inlining passes into
14510 @file{inline.txt}.
14512 Finally, consider:
14514 @smallexample
14515 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
14516 @end smallexample
14518 @noindent
14519 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
14520 in conflict since only one output file is allowed. In this case, only
14521 the first option takes effect and the subsequent options are
14522 ignored. Thus only @file{vec.miss} is produced which contains
14523 dumps from the vectorizer about missed opportunities.
14525 @item -fsave-optimization-record
14526 @opindex fsave-optimization-record
14527 Write a SRCFILE.opt-record.json.gz file detailing what optimizations
14528 were performed, for those optimizations that support @option{-fopt-info}.
14530 This option is experimental and the format of the data within the
14531 compressed JSON file is subject to change.
14533 It is roughly equivalent to a machine-readable version of
14534 @option{-fopt-info-all}, as a collection of messages with source file,
14535 line number and column number, with the following additional data for
14536 each message:
14538 @itemize @bullet
14540 @item
14541 the execution count of the code being optimized, along with metadata about
14542 whether this was from actual profile data, or just an estimate, allowing
14543 consumers to prioritize messages by code hotness,
14545 @item
14546 the function name of the code being optimized, where applicable,
14548 @item
14549 the ``inlining chain'' for the code being optimized, so that when
14550 a function is inlined into several different places (which might
14551 themselves be inlined), the reader can distinguish between the copies,
14553 @item
14554 objects identifying those parts of the message that refer to expressions,
14555 statements or symbol-table nodes, which of these categories they are, and,
14556 when available, their source code location,
14558 @item
14559 the GCC pass that emitted the message, and
14561 @item
14562 the location in GCC's own code from which the message was emitted
14564 @end itemize
14566 Additionally, some messages are logically nested within other
14567 messages, reflecting implementation details of the optimization
14568 passes.
14570 @item -fsched-verbose=@var{n}
14571 @opindex fsched-verbose
14572 On targets that use instruction scheduling, this option controls the
14573 amount of debugging output the scheduler prints to the dump files.
14575 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
14576 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
14577 For @var{n} greater than one, it also output basic block probabilities,
14578 detailed ready list information and unit/insn info.  For @var{n} greater
14579 than two, it includes RTL at abort point, control-flow and regions info.
14580 And for @var{n} over four, @option{-fsched-verbose} also includes
14581 dependence info.
14585 @item -fenable-@var{kind}-@var{pass}
14586 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
14587 @opindex fdisable-
14588 @opindex fenable-
14590 This is a set of options that are used to explicitly disable/enable
14591 optimization passes.  These options are intended for use for debugging GCC.
14592 Compiler users should use regular options for enabling/disabling
14593 passes instead.
14595 @table @gcctabopt
14597 @item -fdisable-ipa-@var{pass}
14598 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
14599 statically invoked in the compiler multiple times, the pass name should be
14600 appended with a sequential number starting from 1.
14602 @item -fdisable-rtl-@var{pass}
14603 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
14604 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
14605 statically invoked in the compiler multiple times, the pass name should be
14606 appended with a sequential number starting from 1.  @var{range-list} is a 
14607 comma-separated list of function ranges or assembler names.  Each range is a number
14608 pair separated by a colon.  The range is inclusive in both ends.  If the range
14609 is trivial, the number pair can be simplified as a single number.  If the
14610 function's call graph node's @var{uid} falls within one of the specified ranges,
14611 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
14612 function header of a dump file, and the pass names can be dumped by using
14613 option @option{-fdump-passes}.
14615 @item -fdisable-tree-@var{pass}
14616 @itemx -fdisable-tree-@var{pass}=@var{range-list}
14617 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
14618 option arguments.
14620 @item -fenable-ipa-@var{pass}
14621 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
14622 statically invoked in the compiler multiple times, the pass name should be
14623 appended with a sequential number starting from 1.
14625 @item -fenable-rtl-@var{pass}
14626 @itemx -fenable-rtl-@var{pass}=@var{range-list}
14627 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
14628 description and examples.
14630 @item -fenable-tree-@var{pass}
14631 @itemx -fenable-tree-@var{pass}=@var{range-list}
14632 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
14633 of option arguments.
14635 @end table
14637 Here are some examples showing uses of these options.
14639 @smallexample
14641 # disable ccp1 for all functions
14642    -fdisable-tree-ccp1
14643 # disable complete unroll for function whose cgraph node uid is 1
14644    -fenable-tree-cunroll=1
14645 # disable gcse2 for functions at the following ranges [1,1],
14646 # [300,400], and [400,1000]
14647 # disable gcse2 for functions foo and foo2
14648    -fdisable-rtl-gcse2=foo,foo2
14649 # disable early inlining
14650    -fdisable-tree-einline
14651 # disable ipa inlining
14652    -fdisable-ipa-inline
14653 # enable tree full unroll
14654    -fenable-tree-unroll
14656 @end smallexample
14658 @item -fchecking
14659 @itemx -fchecking=@var{n}
14660 @opindex fchecking
14661 @opindex fno-checking
14662 Enable internal consistency checking.  The default depends on
14663 the compiler configuration.  @option{-fchecking=2} enables further
14664 internal consistency checking that might affect code generation.
14666 @item -frandom-seed=@var{string}
14667 @opindex frandom-seed
14668 This option provides a seed that GCC uses in place of
14669 random numbers in generating certain symbol names
14670 that have to be different in every compiled file.  It is also used to
14671 place unique stamps in coverage data files and the object files that
14672 produce them.  You can use the @option{-frandom-seed} option to produce
14673 reproducibly identical object files.
14675 The @var{string} can either be a number (decimal, octal or hex) or an
14676 arbitrary string (in which case it's converted to a number by
14677 computing CRC32).
14679 The @var{string} should be different for every file you compile.
14681 @item -save-temps
14682 @itemx -save-temps=cwd
14683 @opindex save-temps
14684 Store the usual ``temporary'' intermediate files permanently; place them
14685 in the current directory and name them based on the source file.  Thus,
14686 compiling @file{foo.c} with @option{-c -save-temps} produces files
14687 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
14688 preprocessed @file{foo.i} output file even though the compiler now
14689 normally uses an integrated preprocessor.
14691 When used in combination with the @option{-x} command-line option,
14692 @option{-save-temps} is sensible enough to avoid over writing an
14693 input source file with the same extension as an intermediate file.
14694 The corresponding intermediate file may be obtained by renaming the
14695 source file before using @option{-save-temps}.
14697 If you invoke GCC in parallel, compiling several different source
14698 files that share a common base name in different subdirectories or the
14699 same source file compiled for multiple output destinations, it is
14700 likely that the different parallel compilers will interfere with each
14701 other, and overwrite the temporary files.  For instance:
14703 @smallexample
14704 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
14705 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
14706 @end smallexample
14708 may result in @file{foo.i} and @file{foo.o} being written to
14709 simultaneously by both compilers.
14711 @item -save-temps=obj
14712 @opindex save-temps=obj
14713 Store the usual ``temporary'' intermediate files permanently.  If the
14714 @option{-o} option is used, the temporary files are based on the
14715 object file.  If the @option{-o} option is not used, the
14716 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
14718 For example:
14720 @smallexample
14721 gcc -save-temps=obj -c foo.c
14722 gcc -save-temps=obj -c bar.c -o dir/xbar.o
14723 gcc -save-temps=obj foobar.c -o dir2/yfoobar
14724 @end smallexample
14726 @noindent
14727 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
14728 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
14729 @file{dir2/yfoobar.o}.
14731 @item -time@r{[}=@var{file}@r{]}
14732 @opindex time
14733 Report the CPU time taken by each subprocess in the compilation
14734 sequence.  For C source files, this is the compiler proper and assembler
14735 (plus the linker if linking is done).
14737 Without the specification of an output file, the output looks like this:
14739 @smallexample
14740 # cc1 0.12 0.01
14741 # as 0.00 0.01
14742 @end smallexample
14744 The first number on each line is the ``user time'', that is time spent
14745 executing the program itself.  The second number is ``system time'',
14746 time spent executing operating system routines on behalf of the program.
14747 Both numbers are in seconds.
14749 With the specification of an output file, the output is appended to the
14750 named file, and it looks like this:
14752 @smallexample
14753 0.12 0.01 cc1 @var{options}
14754 0.00 0.01 as @var{options}
14755 @end smallexample
14757 The ``user time'' and the ``system time'' are moved before the program
14758 name, and the options passed to the program are displayed, so that one
14759 can later tell what file was being compiled, and with which options.
14761 @item -fdump-final-insns@r{[}=@var{file}@r{]}
14762 @opindex fdump-final-insns
14763 Dump the final internal representation (RTL) to @var{file}.  If the
14764 optional argument is omitted (or if @var{file} is @code{.}), the name
14765 of the dump file is determined by appending @code{.gkd} to the
14766 compilation output file name.
14768 @item -fcompare-debug@r{[}=@var{opts}@r{]}
14769 @opindex fcompare-debug
14770 @opindex fno-compare-debug
14771 If no error occurs during compilation, run the compiler a second time,
14772 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
14773 passed to the second compilation.  Dump the final internal
14774 representation in both compilations, and print an error if they differ.
14776 If the equal sign is omitted, the default @option{-gtoggle} is used.
14778 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
14779 and nonzero, implicitly enables @option{-fcompare-debug}.  If
14780 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
14781 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
14782 is used.
14784 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
14785 is equivalent to @option{-fno-compare-debug}, which disables the dumping
14786 of the final representation and the second compilation, preventing even
14787 @env{GCC_COMPARE_DEBUG} from taking effect.
14789 To verify full coverage during @option{-fcompare-debug} testing, set
14790 @env{GCC_COMPARE_DEBUG} to say @option{-fcompare-debug-not-overridden},
14791 which GCC rejects as an invalid option in any actual compilation
14792 (rather than preprocessing, assembly or linking).  To get just a
14793 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
14794 not overridden} will do.
14796 @item -fcompare-debug-second
14797 @opindex fcompare-debug-second
14798 This option is implicitly passed to the compiler for the second
14799 compilation requested by @option{-fcompare-debug}, along with options to
14800 silence warnings, and omitting other options that would cause the compiler
14801 to produce output to files or to standard output as a side effect.  Dump
14802 files and preserved temporary files are renamed so as to contain the
14803 @code{.gk} additional extension during the second compilation, to avoid
14804 overwriting those generated by the first.
14806 When this option is passed to the compiler driver, it causes the
14807 @emph{first} compilation to be skipped, which makes it useful for little
14808 other than debugging the compiler proper.
14810 @item -gtoggle
14811 @opindex gtoggle
14812 Turn off generation of debug info, if leaving out this option
14813 generates it, or turn it on at level 2 otherwise.  The position of this
14814 argument in the command line does not matter; it takes effect after all
14815 other options are processed, and it does so only once, no matter how
14816 many times it is given.  This is mainly intended to be used with
14817 @option{-fcompare-debug}.
14819 @item -fvar-tracking-assignments-toggle
14820 @opindex fvar-tracking-assignments-toggle
14821 @opindex fno-var-tracking-assignments-toggle
14822 Toggle @option{-fvar-tracking-assignments}, in the same way that
14823 @option{-gtoggle} toggles @option{-g}.
14825 @item -Q
14826 @opindex Q
14827 Makes the compiler print out each function name as it is compiled, and
14828 print some statistics about each pass when it finishes.
14830 @item -ftime-report
14831 @opindex ftime-report
14832 Makes the compiler print some statistics about the time consumed by each
14833 pass when it finishes.
14835 @item -ftime-report-details
14836 @opindex ftime-report-details
14837 Record the time consumed by infrastructure parts separately for each pass.
14839 @item -fira-verbose=@var{n}
14840 @opindex fira-verbose
14841 Control the verbosity of the dump file for the integrated register allocator.
14842 The default value is 5.  If the value @var{n} is greater or equal to 10,
14843 the dump output is sent to stderr using the same format as @var{n} minus 10.
14845 @item -flto-report
14846 @opindex flto-report
14847 Prints a report with internal details on the workings of the link-time
14848 optimizer.  The contents of this report vary from version to version.
14849 It is meant to be useful to GCC developers when processing object
14850 files in LTO mode (via @option{-flto}).
14852 Disabled by default.
14854 @item -flto-report-wpa
14855 @opindex flto-report-wpa
14856 Like @option{-flto-report}, but only print for the WPA phase of Link
14857 Time Optimization.
14859 @item -fmem-report
14860 @opindex fmem-report
14861 Makes the compiler print some statistics about permanent memory
14862 allocation when it finishes.
14864 @item -fmem-report-wpa
14865 @opindex fmem-report-wpa
14866 Makes the compiler print some statistics about permanent memory
14867 allocation for the WPA phase only.
14869 @item -fpre-ipa-mem-report
14870 @opindex fpre-ipa-mem-report
14871 @item -fpost-ipa-mem-report
14872 @opindex fpost-ipa-mem-report
14873 Makes the compiler print some statistics about permanent memory
14874 allocation before or after interprocedural optimization.
14876 @item -fprofile-report
14877 @opindex fprofile-report
14878 Makes the compiler print some statistics about consistency of the
14879 (estimated) profile and effect of individual passes.
14881 @item -fstack-usage
14882 @opindex fstack-usage
14883 Makes the compiler output stack usage information for the program, on a
14884 per-function basis.  The filename for the dump is made by appending
14885 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
14886 the output file, if explicitly specified and it is not an executable,
14887 otherwise it is the basename of the source file.  An entry is made up
14888 of three fields:
14890 @itemize
14891 @item
14892 The name of the function.
14893 @item
14894 A number of bytes.
14895 @item
14896 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
14897 @end itemize
14899 The qualifier @code{static} means that the function manipulates the stack
14900 statically: a fixed number of bytes are allocated for the frame on function
14901 entry and released on function exit; no stack adjustments are otherwise made
14902 in the function.  The second field is this fixed number of bytes.
14904 The qualifier @code{dynamic} means that the function manipulates the stack
14905 dynamically: in addition to the static allocation described above, stack
14906 adjustments are made in the body of the function, for example to push/pop
14907 arguments around function calls.  If the qualifier @code{bounded} is also
14908 present, the amount of these adjustments is bounded at compile time and
14909 the second field is an upper bound of the total amount of stack used by
14910 the function.  If it is not present, the amount of these adjustments is
14911 not bounded at compile time and the second field only represents the
14912 bounded part.
14914 @item -fstats
14915 @opindex fstats
14916 Emit statistics about front-end processing at the end of the compilation.
14917 This option is supported only by the C++ front end, and
14918 the information is generally only useful to the G++ development team.
14920 @item -fdbg-cnt-list
14921 @opindex fdbg-cnt-list
14922 Print the name and the counter upper bound for all debug counters.
14925 @item -fdbg-cnt=@var{counter-value-list}
14926 @opindex fdbg-cnt
14927 Set the internal debug counter lower and upper bound.  @var{counter-value-list}
14928 is a comma-separated list of @var{name}:@var{lower_bound}:@var{upper_bound}
14929 tuples which sets the lower and the upper bound of each debug
14930 counter @var{name}.  The @var{lower_bound} is optional and is zero
14931 initialized if not set.
14932 All debug counters have the initial upper bound of @code{UINT_MAX};
14933 thus @code{dbg_cnt} returns true always unless the upper bound
14934 is set by this option.
14935 For example, with @option{-fdbg-cnt=dce:2:4,tail_call:10},
14936 @code{dbg_cnt(dce)} returns true only for third and fourth invocation.
14937 For @code{dbg_cnt(tail_call)} true is returned for first 10 invocations.
14939 @item -print-file-name=@var{library}
14940 @opindex print-file-name
14941 Print the full absolute name of the library file @var{library} that
14942 would be used when linking---and don't do anything else.  With this
14943 option, GCC does not compile or link anything; it just prints the
14944 file name.
14946 @item -print-multi-directory
14947 @opindex print-multi-directory
14948 Print the directory name corresponding to the multilib selected by any
14949 other switches present in the command line.  This directory is supposed
14950 to exist in @env{GCC_EXEC_PREFIX}.
14952 @item -print-multi-lib
14953 @opindex print-multi-lib
14954 Print the mapping from multilib directory names to compiler switches
14955 that enable them.  The directory name is separated from the switches by
14956 @samp{;}, and each switch starts with an @samp{@@} instead of the
14957 @samp{-}, without spaces between multiple switches.  This is supposed to
14958 ease shell processing.
14960 @item -print-multi-os-directory
14961 @opindex print-multi-os-directory
14962 Print the path to OS libraries for the selected
14963 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
14964 present in the @file{lib} subdirectory and no multilibs are used, this is
14965 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
14966 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
14967 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
14968 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
14970 @item -print-multiarch
14971 @opindex print-multiarch
14972 Print the path to OS libraries for the selected multiarch,
14973 relative to some @file{lib} subdirectory.
14975 @item -print-prog-name=@var{program}
14976 @opindex print-prog-name
14977 Like @option{-print-file-name}, but searches for a program such as @command{cpp}.
14979 @item -print-libgcc-file-name
14980 @opindex print-libgcc-file-name
14981 Same as @option{-print-file-name=libgcc.a}.
14983 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
14984 but you do want to link with @file{libgcc.a}.  You can do:
14986 @smallexample
14987 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
14988 @end smallexample
14990 @item -print-search-dirs
14991 @opindex print-search-dirs
14992 Print the name of the configured installation directory and a list of
14993 program and library directories @command{gcc} searches---and don't do anything else.
14995 This is useful when @command{gcc} prints the error message
14996 @samp{installation problem, cannot exec cpp0: No such file or directory}.
14997 To resolve this you either need to put @file{cpp0} and the other compiler
14998 components where @command{gcc} expects to find them, or you can set the environment
14999 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
15000 Don't forget the trailing @samp{/}.
15001 @xref{Environment Variables}.
15003 @item -print-sysroot
15004 @opindex print-sysroot
15005 Print the target sysroot directory that is used during
15006 compilation.  This is the target sysroot specified either at configure
15007 time or using the @option{--sysroot} option, possibly with an extra
15008 suffix that depends on compilation options.  If no target sysroot is
15009 specified, the option prints nothing.
15011 @item -print-sysroot-headers-suffix
15012 @opindex print-sysroot-headers-suffix
15013 Print the suffix added to the target sysroot when searching for
15014 headers, or give an error if the compiler is not configured with such
15015 a suffix---and don't do anything else.
15017 @item -dumpmachine
15018 @opindex dumpmachine
15019 Print the compiler's target machine (for example,
15020 @samp{i686-pc-linux-gnu})---and don't do anything else.
15022 @item -dumpversion
15023 @opindex dumpversion
15024 Print the compiler version (for example, @code{3.0}, @code{6.3.0} or @code{7})---and don't do
15025 anything else.  This is the compiler version used in filesystem paths and
15026 specs. Depending on how the compiler has been configured it can be just
15027 a single number (major version), two numbers separated by a dot (major and
15028 minor version) or three numbers separated by dots (major, minor and patchlevel
15029 version).
15031 @item -dumpfullversion
15032 @opindex dumpfullversion
15033 Print the full compiler version---and don't do anything else. The output is
15034 always three numbers separated by dots, major, minor and patchlevel version.
15036 @item -dumpspecs
15037 @opindex dumpspecs
15038 Print the compiler's built-in specs---and don't do anything else.  (This
15039 is used when GCC itself is being built.)  @xref{Spec Files}.
15040 @end table
15042 @node Submodel Options
15043 @section Machine-Dependent Options
15044 @cindex submodel options
15045 @cindex specifying hardware config
15046 @cindex hardware models and configurations, specifying
15047 @cindex target-dependent options
15048 @cindex machine-dependent options
15050 Each target machine supported by GCC can have its own options---for
15051 example, to allow you to compile for a particular processor variant or
15052 ABI, or to control optimizations specific to that machine.  By
15053 convention, the names of machine-specific options start with
15054 @samp{-m}.
15056 Some configurations of the compiler also support additional target-specific
15057 options, usually for compatibility with other compilers on the same
15058 platform.
15060 @c This list is ordered alphanumerically by subsection name.
15061 @c It should be the same order and spelling as these options are listed
15062 @c in Machine Dependent Options
15064 @menu
15065 * AArch64 Options::
15066 * Adapteva Epiphany Options::
15067 * ARC Options::
15068 * ARM Options::
15069 * AVR Options::
15070 * Blackfin Options::
15071 * C6X Options::
15072 * CRIS Options::
15073 * CR16 Options::
15074 * C-SKY Options::
15075 * Darwin Options::
15076 * DEC Alpha Options::
15077 * FR30 Options::
15078 * FT32 Options::
15079 * FRV Options::
15080 * GNU/Linux Options::
15081 * H8/300 Options::
15082 * HPPA Options::
15083 * IA-64 Options::
15084 * LM32 Options::
15085 * M32C Options::
15086 * M32R/D Options::
15087 * M680x0 Options::
15088 * MCore Options::
15089 * MeP Options::
15090 * MicroBlaze Options::
15091 * MIPS Options::
15092 * MMIX Options::
15093 * MN10300 Options::
15094 * Moxie Options::
15095 * MSP430 Options::
15096 * NDS32 Options::
15097 * Nios II Options::
15098 * Nvidia PTX Options::
15099 * OpenRISC Options::
15100 * PDP-11 Options::
15101 * picoChip Options::
15102 * PowerPC Options::
15103 * PowerPC SPE Options::
15104 * RISC-V Options::
15105 * RL78 Options::
15106 * RS/6000 and PowerPC Options::
15107 * RX Options::
15108 * S/390 and zSeries Options::
15109 * Score Options::
15110 * SH Options::
15111 * Solaris 2 Options::
15112 * SPARC Options::
15113 * SPU Options::
15114 * System V Options::
15115 * TILE-Gx Options::
15116 * TILEPro Options::
15117 * V850 Options::
15118 * VAX Options::
15119 * Visium Options::
15120 * VMS Options::
15121 * VxWorks Options::
15122 * x86 Options::
15123 * x86 Windows Options::
15124 * Xstormy16 Options::
15125 * Xtensa Options::
15126 * zSeries Options::
15127 @end menu
15129 @node AArch64 Options
15130 @subsection AArch64 Options
15131 @cindex AArch64 Options
15133 These options are defined for AArch64 implementations:
15135 @table @gcctabopt
15137 @item -mabi=@var{name}
15138 @opindex mabi
15139 Generate code for the specified data model.  Permissible values
15140 are @samp{ilp32} for SysV-like data model where int, long int and pointers
15141 are 32 bits, and @samp{lp64} for SysV-like data model where int is 32 bits,
15142 but long int and pointers are 64 bits.
15144 The default depends on the specific target configuration.  Note that
15145 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
15146 entire program with the same ABI, and link with a compatible set of libraries.
15148 @item -mbig-endian
15149 @opindex mbig-endian
15150 Generate big-endian code.  This is the default when GCC is configured for an
15151 @samp{aarch64_be-*-*} target.
15153 @item -mgeneral-regs-only
15154 @opindex mgeneral-regs-only
15155 Generate code which uses only the general-purpose registers.  This will prevent
15156 the compiler from using floating-point and Advanced SIMD registers but will not
15157 impose any restrictions on the assembler.
15159 @item -mlittle-endian
15160 @opindex mlittle-endian
15161 Generate little-endian code.  This is the default when GCC is configured for an
15162 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
15164 @item -mcmodel=tiny
15165 @opindex mcmodel=tiny
15166 Generate code for the tiny code model.  The program and its statically defined
15167 symbols must be within 1MB of each other.  Programs can be statically or
15168 dynamically linked.
15170 @item -mcmodel=small
15171 @opindex mcmodel=small
15172 Generate code for the small code model.  The program and its statically defined
15173 symbols must be within 4GB of each other.  Programs can be statically or
15174 dynamically linked.  This is the default code model.
15176 @item -mcmodel=large
15177 @opindex mcmodel=large
15178 Generate code for the large code model.  This makes no assumptions about
15179 addresses and sizes of sections.  Programs can be statically linked only.
15181 @item -mstrict-align
15182 @itemx -mno-strict-align
15183 @opindex mstrict-align
15184 @opindex mno-strict-align
15185 Avoid or allow generating memory accesses that may not be aligned on a natural
15186 object boundary as described in the architecture specification.
15188 @item -momit-leaf-frame-pointer
15189 @itemx -mno-omit-leaf-frame-pointer
15190 @opindex momit-leaf-frame-pointer
15191 @opindex mno-omit-leaf-frame-pointer
15192 Omit or keep the frame pointer in leaf functions.  The former behavior is the
15193 default.
15195 @item -mtls-dialect=desc
15196 @opindex mtls-dialect=desc
15197 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
15198 of TLS variables.  This is the default.
15200 @item -mtls-dialect=traditional
15201 @opindex mtls-dialect=traditional
15202 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
15203 of TLS variables.
15205 @item -mtls-size=@var{size}
15206 @opindex mtls-size
15207 Specify bit size of immediate TLS offsets.  Valid values are 12, 24, 32, 48.
15208 This option requires binutils 2.26 or newer.
15210 @item -mfix-cortex-a53-835769
15211 @itemx -mno-fix-cortex-a53-835769
15212 @opindex mfix-cortex-a53-835769
15213 @opindex mno-fix-cortex-a53-835769
15214 Enable or disable the workaround for the ARM Cortex-A53 erratum number 835769.
15215 This involves inserting a NOP instruction between memory instructions and
15216 64-bit integer multiply-accumulate instructions.
15218 @item -mfix-cortex-a53-843419
15219 @itemx -mno-fix-cortex-a53-843419
15220 @opindex mfix-cortex-a53-843419
15221 @opindex mno-fix-cortex-a53-843419
15222 Enable or disable the workaround for the ARM Cortex-A53 erratum number 843419.
15223 This erratum workaround is made at link time and this will only pass the
15224 corresponding flag to the linker.
15226 @item -mlow-precision-recip-sqrt
15227 @itemx -mno-low-precision-recip-sqrt
15228 @opindex mlow-precision-recip-sqrt
15229 @opindex mno-low-precision-recip-sqrt
15230 Enable or disable the reciprocal square root approximation.
15231 This option only has an effect if @option{-ffast-math} or
15232 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
15233 precision of reciprocal square root results to about 16 bits for
15234 single precision and to 32 bits for double precision.
15236 @item -mlow-precision-sqrt
15237 @itemx -mno-low-precision-sqrt
15238 @opindex mlow-precision-sqrt
15239 @opindex mno-low-precision-sqrt
15240 Enable or disable the square root approximation.
15241 This option only has an effect if @option{-ffast-math} or
15242 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
15243 precision of square root results to about 16 bits for
15244 single precision and to 32 bits for double precision.
15245 If enabled, it implies @option{-mlow-precision-recip-sqrt}.
15247 @item -mlow-precision-div
15248 @itemx -mno-low-precision-div
15249 @opindex mlow-precision-div
15250 @opindex mno-low-precision-div
15251 Enable or disable the division approximation.
15252 This option only has an effect if @option{-ffast-math} or
15253 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
15254 precision of division results to about 16 bits for
15255 single precision and to 32 bits for double precision.
15257 @item -mtrack-speculation
15258 @itemx -mno-track-speculation
15259 Enable or disable generation of additional code to track speculative
15260 execution through conditional branches.  The tracking state can then
15261 be used by the compiler when expanding calls to
15262 @code{__builtin_speculation_safe_copy} to permit a more efficient code
15263 sequence to be generated.
15265 @item -march=@var{name}
15266 @opindex march
15267 Specify the name of the target architecture and, optionally, one or
15268 more feature modifiers.  This option has the form
15269 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}.
15271 The permissible values for @var{arch} are @samp{armv8-a},
15272 @samp{armv8.1-a}, @samp{armv8.2-a}, @samp{armv8.3-a} or @samp{armv8.4-a}
15273 or @var{native}.
15275 The value @samp{armv8.4-a} implies @samp{armv8.3-a} and enables compiler
15276 support for the ARMv8.4-A architecture extensions.
15278 The value @samp{armv8.3-a} implies @samp{armv8.2-a} and enables compiler
15279 support for the ARMv8.3-A architecture extensions.
15281 The value @samp{armv8.2-a} implies @samp{armv8.1-a} and enables compiler
15282 support for the ARMv8.2-A architecture extensions.
15284 The value @samp{armv8.1-a} implies @samp{armv8-a} and enables compiler
15285 support for the ARMv8.1-A architecture extension.  In particular, it
15286 enables the @samp{+crc}, @samp{+lse}, and @samp{+rdma} features.
15288 The value @samp{native} is available on native AArch64 GNU/Linux and
15289 causes the compiler to pick the architecture of the host system.  This
15290 option has no effect if the compiler is unable to recognize the
15291 architecture of the host system,
15293 The permissible values for @var{feature} are listed in the sub-section
15294 on @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
15295 Feature Modifiers}.  Where conflicting feature modifiers are
15296 specified, the right-most feature is used.
15298 GCC uses @var{name} to determine what kind of instructions it can emit
15299 when generating assembly code.  If @option{-march} is specified
15300 without either of @option{-mtune} or @option{-mcpu} also being
15301 specified, the code is tuned to perform well across a range of target
15302 processors implementing the target architecture.
15304 @item -mtune=@var{name}
15305 @opindex mtune
15306 Specify the name of the target processor for which GCC should tune the
15307 performance of the code.  Permissible values for this option are:
15308 @samp{generic}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55},
15309 @samp{cortex-a57}, @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-a75},
15310 @samp{cortex-a76}, @samp{ares}, @samp{exynos-m1}, @samp{falkor},
15311 @samp{qdf24xx}, @samp{saphira}, @samp{phecda}, @samp{xgene1}, @samp{vulcan},
15312 @samp{thunderx}, @samp{thunderxt88}, @samp{thunderxt88p1}, @samp{thunderxt81},
15313 @samp{tsv110}, @samp{thunderxt83}, @samp{thunderx2t99},
15314 @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
15315 @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53},
15316 @samp{cortex-a75.cortex-a55}, @samp{cortex-a76.cortex-a55}
15317 @samp{native}.
15319 The values @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
15320 @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53},
15321 @samp{cortex-a75.cortex-a55}, @samp{cortex-a76.cortex-a55} specify that GCC
15322 should tune for a big.LITTLE system.
15324 Additionally on native AArch64 GNU/Linux systems the value
15325 @samp{native} tunes performance to the host system.  This option has no effect
15326 if the compiler is unable to recognize the processor of the host system.
15328 Where none of @option{-mtune=}, @option{-mcpu=} or @option{-march=}
15329 are specified, the code is tuned to perform well across a range
15330 of target processors.
15332 This option cannot be suffixed by feature modifiers.
15334 @item -mcpu=@var{name}
15335 @opindex mcpu
15336 Specify the name of the target processor, optionally suffixed by one
15337 or more feature modifiers.  This option has the form
15338 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where
15339 the permissible values for @var{cpu} are the same as those available
15340 for @option{-mtune}.  The permissible values for @var{feature} are
15341 documented in the sub-section on
15342 @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
15343 Feature Modifiers}.  Where conflicting feature modifiers are
15344 specified, the right-most feature is used.
15346 GCC uses @var{name} to determine what kind of instructions it can emit when
15347 generating assembly code (as if by @option{-march}) and to determine
15348 the target processor for which to tune for performance (as if
15349 by @option{-mtune}).  Where this option is used in conjunction
15350 with @option{-march} or @option{-mtune}, those options take precedence
15351 over the appropriate part of this option.
15353 @item -moverride=@var{string}
15354 @opindex moverride
15355 Override tuning decisions made by the back-end in response to a
15356 @option{-mtune=} switch.  The syntax, semantics, and accepted values
15357 for @var{string} in this option are not guaranteed to be consistent
15358 across releases.
15360 This option is only intended to be useful when developing GCC.
15362 @item -mverbose-cost-dump
15363 @opindex mverbose-cost-dump
15364 Enable verbose cost model dumping in the debug dump files.  This option is
15365 provided for use in debugging the compiler.
15367 @item -mpc-relative-literal-loads
15368 @itemx -mno-pc-relative-literal-loads
15369 @opindex mpc-relative-literal-loads
15370 @opindex mno-pc-relative-literal-loads
15371 Enable or disable PC-relative literal loads.  With this option literal pools are
15372 accessed using a single instruction and emitted after each function.  This
15373 limits the maximum size of functions to 1MB.  This is enabled by default for
15374 @option{-mcmodel=tiny}.
15376 @item -msign-return-address=@var{scope}
15377 @opindex msign-return-address
15378 Select the function scope on which return address signing will be applied.
15379 Permissible values are @samp{none}, which disables return address signing,
15380 @samp{non-leaf}, which enables pointer signing for functions which are not leaf
15381 functions, and @samp{all}, which enables pointer signing for all functions.  The
15382 default value is @samp{none}.
15384 @item -msve-vector-bits=@var{bits}
15385 @opindex msve-vector-bits
15386 Specify the number of bits in an SVE vector register.  This option only has
15387 an effect when SVE is enabled.
15389 GCC supports two forms of SVE code generation: ``vector-length
15390 agnostic'' output that works with any size of vector register and
15391 ``vector-length specific'' output that only works when the vector
15392 registers are a particular size.  Replacing @var{bits} with
15393 @samp{scalable} selects vector-length agnostic output while
15394 replacing it with a number selects vector-length specific output.
15395 The possible lengths in the latter case are: 128, 256, 512, 1024
15396 and 2048.  @samp{scalable} is the default.
15398 At present, @samp{-msve-vector-bits=128} produces the same output
15399 as @samp{-msve-vector-bits=scalable}.
15401 @end table
15403 @subsubsection @option{-march} and @option{-mcpu} Feature Modifiers
15404 @anchor{aarch64-feature-modifiers}
15405 @cindex @option{-march} feature modifiers
15406 @cindex @option{-mcpu} feature modifiers
15407 Feature modifiers used with @option{-march} and @option{-mcpu} can be any of
15408 the following and their inverses @option{no@var{feature}}:
15410 @table @samp
15411 @item crc
15412 Enable CRC extension.  This is on by default for
15413 @option{-march=armv8.1-a}.
15414 @item crypto
15415 Enable Crypto extension.  This also enables Advanced SIMD and floating-point
15416 instructions.
15417 @item fp
15418 Enable floating-point instructions.  This is on by default for all possible
15419 values for options @option{-march} and @option{-mcpu}.
15420 @item simd
15421 Enable Advanced SIMD instructions.  This also enables floating-point
15422 instructions.  This is on by default for all possible values for options
15423 @option{-march} and @option{-mcpu}.
15424 @item sve
15425 Enable Scalable Vector Extension instructions.  This also enables Advanced
15426 SIMD and floating-point instructions.
15427 @item lse
15428 Enable Large System Extension instructions.  This is on by default for
15429 @option{-march=armv8.1-a}.
15430 @item rdma
15431 Enable Round Double Multiply Accumulate instructions.  This is on by default
15432 for @option{-march=armv8.1-a}.
15433 @item fp16
15434 Enable FP16 extension.  This also enables floating-point instructions.
15435 @item fp16fml
15436 Enable FP16 fmla extension.  This also enables FP16 extensions and
15437 floating-point instructions. This option is enabled by default for @option{-march=armv8.4-a}. Use of this option with architectures prior to Armv8.2-A is not supported.
15439 @item rcpc
15440 Enable the RcPc extension.  This does not change code generation from GCC,
15441 but is passed on to the assembler, enabling inline asm statements to use
15442 instructions from the RcPc extension.
15443 @item dotprod
15444 Enable the Dot Product extension.  This also enables Advanced SIMD instructions.
15445 @item aes
15446 Enable the Armv8-a aes and pmull crypto extension.  This also enables Advanced
15447 SIMD instructions.
15448 @item sha2
15449 Enable the Armv8-a sha2 crypto extension.  This also enables Advanced SIMD instructions.
15450 @item sha3
15451 Enable the sha512 and sha3 crypto extension.  This also enables Advanced SIMD
15452 instructions. Use of this option with architectures prior to Armv8.2-A is not supported.
15453 @item sm4
15454 Enable the sm3 and sm4 crypto extension.  This also enables Advanced SIMD instructions.
15455 Use of this option with architectures prior to Armv8.2-A is not supported.
15456 @item profile
15457 Enable the Statistical Profiling extension.  This option is only to enable the
15458 extension at the assembler level and does not affect code generation.
15460 @end table
15462 Feature @option{crypto} implies @option{aes}, @option{sha2}, and @option{simd},
15463 which implies @option{fp}.
15464 Conversely, @option{nofp} implies @option{nosimd}, which implies
15465 @option{nocrypto}, @option{noaes} and @option{nosha2}.
15467 @node Adapteva Epiphany Options
15468 @subsection Adapteva Epiphany Options
15470 These @samp{-m} options are defined for Adapteva Epiphany:
15472 @table @gcctabopt
15473 @item -mhalf-reg-file
15474 @opindex mhalf-reg-file
15475 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
15476 That allows code to run on hardware variants that lack these registers.
15478 @item -mprefer-short-insn-regs
15479 @opindex mprefer-short-insn-regs
15480 Preferentially allocate registers that allow short instruction generation.
15481 This can result in increased instruction count, so this may either reduce or
15482 increase overall code size.
15484 @item -mbranch-cost=@var{num}
15485 @opindex mbranch-cost
15486 Set the cost of branches to roughly @var{num} ``simple'' instructions.
15487 This cost is only a heuristic and is not guaranteed to produce
15488 consistent results across releases.
15490 @item -mcmove
15491 @opindex mcmove
15492 Enable the generation of conditional moves.
15494 @item -mnops=@var{num}
15495 @opindex mnops
15496 Emit @var{num} NOPs before every other generated instruction.
15498 @item -mno-soft-cmpsf
15499 @opindex mno-soft-cmpsf
15500 @opindex msoft-cmpsf
15501 For single-precision floating-point comparisons, emit an @code{fsub} instruction
15502 and test the flags.  This is faster than a software comparison, but can
15503 get incorrect results in the presence of NaNs, or when two different small
15504 numbers are compared such that their difference is calculated as zero.
15505 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
15506 software comparisons.
15508 @item -mstack-offset=@var{num}
15509 @opindex mstack-offset
15510 Set the offset between the top of the stack and the stack pointer.
15511 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
15512 can be used by leaf functions without stack allocation.
15513 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
15514 Note also that this option changes the ABI; compiling a program with a
15515 different stack offset than the libraries have been compiled with
15516 generally does not work.
15517 This option can be useful if you want to evaluate if a different stack
15518 offset would give you better code, but to actually use a different stack
15519 offset to build working programs, it is recommended to configure the
15520 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
15522 @item -mno-round-nearest
15523 @opindex mno-round-nearest
15524 @opindex mround-nearest
15525 Make the scheduler assume that the rounding mode has been set to
15526 truncating.  The default is @option{-mround-nearest}.
15528 @item -mlong-calls
15529 @opindex mlong-calls
15530 If not otherwise specified by an attribute, assume all calls might be beyond
15531 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
15532 function address into a register before performing a (otherwise direct) call.
15533 This is the default.
15535 @item -mshort-calls
15536 @opindex short-calls
15537 If not otherwise specified by an attribute, assume all direct calls are
15538 in the range of the @code{b} / @code{bl} instructions, so use these instructions
15539 for direct calls.  The default is @option{-mlong-calls}.
15541 @item -msmall16
15542 @opindex msmall16
15543 Assume addresses can be loaded as 16-bit unsigned values.  This does not
15544 apply to function addresses for which @option{-mlong-calls} semantics
15545 are in effect.
15547 @item -mfp-mode=@var{mode}
15548 @opindex mfp-mode
15549 Set the prevailing mode of the floating-point unit.
15550 This determines the floating-point mode that is provided and expected
15551 at function call and return time.  Making this mode match the mode you
15552 predominantly need at function start can make your programs smaller and
15553 faster by avoiding unnecessary mode switches.
15555 @var{mode} can be set to one the following values:
15557 @table @samp
15558 @item caller
15559 Any mode at function entry is valid, and retained or restored when
15560 the function returns, and when it calls other functions.
15561 This mode is useful for compiling libraries or other compilation units
15562 you might want to incorporate into different programs with different
15563 prevailing FPU modes, and the convenience of being able to use a single
15564 object file outweighs the size and speed overhead for any extra
15565 mode switching that might be needed, compared with what would be needed
15566 with a more specific choice of prevailing FPU mode.
15568 @item truncate
15569 This is the mode used for floating-point calculations with
15570 truncating (i.e.@: round towards zero) rounding mode.  That includes
15571 conversion from floating point to integer.
15573 @item round-nearest
15574 This is the mode used for floating-point calculations with
15575 round-to-nearest-or-even rounding mode.
15577 @item int
15578 This is the mode used to perform integer calculations in the FPU, e.g.@:
15579 integer multiply, or integer multiply-and-accumulate.
15580 @end table
15582 The default is @option{-mfp-mode=caller}
15584 @item -mno-split-lohi
15585 @itemx -mno-postinc
15586 @itemx -mno-postmodify
15587 @opindex mno-split-lohi
15588 @opindex msplit-lohi
15589 @opindex mno-postinc
15590 @opindex mpostinc
15591 @opindex mno-postmodify
15592 @opindex mpostmodify
15593 Code generation tweaks that disable, respectively, splitting of 32-bit
15594 loads, generation of post-increment addresses, and generation of
15595 post-modify addresses.  The defaults are @option{msplit-lohi},
15596 @option{-mpost-inc}, and @option{-mpost-modify}.
15598 @item -mnovect-double
15599 @opindex mno-vect-double
15600 @opindex mvect-double
15601 Change the preferred SIMD mode to SImode.  The default is
15602 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
15604 @item -max-vect-align=@var{num}
15605 @opindex max-vect-align
15606 The maximum alignment for SIMD vector mode types.
15607 @var{num} may be 4 or 8.  The default is 8.
15608 Note that this is an ABI change, even though many library function
15609 interfaces are unaffected if they don't use SIMD vector modes
15610 in places that affect size and/or alignment of relevant types.
15612 @item -msplit-vecmove-early
15613 @opindex msplit-vecmove-early
15614 Split vector moves into single word moves before reload.  In theory this
15615 can give better register allocation, but so far the reverse seems to be
15616 generally the case.
15618 @item -m1reg-@var{reg}
15619 @opindex m1reg-
15620 Specify a register to hold the constant @minus{}1, which makes loading small negative
15621 constants and certain bitmasks faster.
15622 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
15623 which specify use of that register as a fixed register,
15624 and @samp{none}, which means that no register is used for this
15625 purpose.  The default is @option{-m1reg-none}.
15627 @end table
15629 @node ARC Options
15630 @subsection ARC Options
15631 @cindex ARC options
15633 The following options control the architecture variant for which code
15634 is being compiled:
15636 @c architecture variants
15637 @table @gcctabopt
15639 @item -mbarrel-shifter
15640 @opindex mbarrel-shifter
15641 Generate instructions supported by barrel shifter.  This is the default
15642 unless @option{-mcpu=ARC601} or @samp{-mcpu=ARCEM} is in effect.
15644 @item -mjli-always
15645 @opindex mjli-alawys
15646 Force to call a function using jli_s instruction.  This option is
15647 valid only for ARCv2 architecture.
15649 @item -mcpu=@var{cpu}
15650 @opindex mcpu
15651 Set architecture type, register usage, and instruction scheduling
15652 parameters for @var{cpu}.  There are also shortcut alias options
15653 available for backward compatibility and convenience.  Supported
15654 values for @var{cpu} are
15656 @table @samp
15657 @opindex mA6
15658 @opindex mARC600
15659 @item arc600
15660 Compile for ARC600.  Aliases: @option{-mA6}, @option{-mARC600}.
15662 @item arc601
15663 @opindex mARC601
15664 Compile for ARC601.  Alias: @option{-mARC601}.
15666 @item arc700
15667 @opindex mA7
15668 @opindex mARC700
15669 Compile for ARC700.  Aliases: @option{-mA7}, @option{-mARC700}.
15670 This is the default when configured with @option{--with-cpu=arc700}@.
15672 @item arcem
15673 Compile for ARC EM.
15675 @item archs
15676 Compile for ARC HS.
15678 @item em
15679 Compile for ARC EM CPU with no hardware extensions.
15681 @item em4
15682 Compile for ARC EM4 CPU.
15684 @item em4_dmips
15685 Compile for ARC EM4 DMIPS CPU.
15687 @item em4_fpus
15688 Compile for ARC EM4 DMIPS CPU with the single-precision floating-point
15689 extension.
15691 @item em4_fpuda
15692 Compile for ARC EM4 DMIPS CPU with single-precision floating-point and
15693 double assist instructions.
15695 @item hs
15696 Compile for ARC HS CPU with no hardware extensions except the atomic
15697 instructions.
15699 @item hs34
15700 Compile for ARC HS34 CPU.
15702 @item hs38
15703 Compile for ARC HS38 CPU.
15705 @item hs38_linux
15706 Compile for ARC HS38 CPU with all hardware extensions on.
15708 @item arc600_norm
15709 Compile for ARC 600 CPU with @code{norm} instructions enabled.
15711 @item arc600_mul32x16
15712 Compile for ARC 600 CPU with @code{norm} and 32x16-bit multiply 
15713 instructions enabled.
15715 @item arc600_mul64
15716 Compile for ARC 600 CPU with @code{norm} and @code{mul64}-family 
15717 instructions enabled.
15719 @item arc601_norm
15720 Compile for ARC 601 CPU with @code{norm} instructions enabled.
15722 @item arc601_mul32x16
15723 Compile for ARC 601 CPU with @code{norm} and 32x16-bit multiply
15724 instructions enabled.
15726 @item arc601_mul64
15727 Compile for ARC 601 CPU with @code{norm} and @code{mul64}-family
15728 instructions enabled.
15730 @item nps400
15731 Compile for ARC 700 on NPS400 chip.
15733 @item em_mini
15734 Compile for ARC EM minimalist configuration featuring reduced register
15735 set.
15737 @end table
15739 @item -mdpfp
15740 @opindex mdpfp
15741 @itemx -mdpfp-compact
15742 @opindex mdpfp-compact
15743 Generate double-precision FPX instructions, tuned for the compact
15744 implementation.
15746 @item -mdpfp-fast
15747 @opindex mdpfp-fast
15748 Generate double-precision FPX instructions, tuned for the fast
15749 implementation.
15751 @item -mno-dpfp-lrsr
15752 @opindex mno-dpfp-lrsr
15753 Disable @code{lr} and @code{sr} instructions from using FPX extension
15754 aux registers.
15756 @item -mea
15757 @opindex mea
15758 Generate extended arithmetic instructions.  Currently only
15759 @code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are
15760 supported.  This is always enabled for @option{-mcpu=ARC700}.
15762 @item -mno-mpy
15763 @opindex mno-mpy
15764 @opindex mmpy
15765 Do not generate @code{mpy}-family instructions for ARC700.  This option is
15766 deprecated.
15768 @item -mmul32x16
15769 @opindex mmul32x16
15770 Generate 32x16-bit multiply and multiply-accumulate instructions.
15772 @item -mmul64
15773 @opindex mmul64
15774 Generate @code{mul64} and @code{mulu64} instructions.  
15775 Only valid for @option{-mcpu=ARC600}.
15777 @item -mnorm
15778 @opindex mnorm
15779 Generate @code{norm} instructions.  This is the default if @option{-mcpu=ARC700}
15780 is in effect.
15782 @item -mspfp
15783 @opindex mspfp
15784 @itemx -mspfp-compact
15785 @opindex mspfp-compact
15786 Generate single-precision FPX instructions, tuned for the compact
15787 implementation.
15789 @item -mspfp-fast
15790 @opindex mspfp-fast
15791 Generate single-precision FPX instructions, tuned for the fast
15792 implementation.
15794 @item -msimd
15795 @opindex msimd
15796 Enable generation of ARC SIMD instructions via target-specific
15797 builtins.  Only valid for @option{-mcpu=ARC700}.
15799 @item -msoft-float
15800 @opindex msoft-float
15801 This option ignored; it is provided for compatibility purposes only.
15802 Software floating-point code is emitted by default, and this default
15803 can overridden by FPX options; @option{-mspfp}, @option{-mspfp-compact}, or
15804 @option{-mspfp-fast} for single precision, and @option{-mdpfp},
15805 @option{-mdpfp-compact}, or @option{-mdpfp-fast} for double precision.
15807 @item -mswap
15808 @opindex mswap
15809 Generate @code{swap} instructions.
15811 @item -matomic
15812 @opindex matomic
15813 This enables use of the locked load/store conditional extension to implement
15814 atomic memory built-in functions.  Not available for ARC 6xx or ARC
15815 EM cores.
15817 @item -mdiv-rem
15818 @opindex mdiv-rem
15819 Enable @code{div} and @code{rem} instructions for ARCv2 cores.
15821 @item -mcode-density
15822 @opindex mcode-density
15823 Enable code density instructions for ARC EM.  
15824 This option is on by default for ARC HS.
15826 @item -mll64
15827 @opindex mll64
15828 Enable double load/store operations for ARC HS cores.
15830 @item -mtp-regno=@var{regno}
15831 @opindex mtp-regno
15832 Specify thread pointer register number.
15834 @item -mmpy-option=@var{multo}
15835 @opindex mmpy-option
15836 Compile ARCv2 code with a multiplier design option.  You can specify 
15837 the option using either a string or numeric value for @var{multo}.  
15838 @samp{wlh1} is the default value.  The recognized values are:
15840 @table @samp
15841 @item 0
15842 @itemx none
15843 No multiplier available.
15845 @item 1
15846 @itemx w
15847 16x16 multiplier, fully pipelined.
15848 The following instructions are enabled: @code{mpyw} and @code{mpyuw}.
15850 @item 2
15851 @itemx wlh1
15852 32x32 multiplier, fully
15853 pipelined (1 stage).  The following instructions are additionally
15854 enabled: @code{mpy}, @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
15856 @item 3
15857 @itemx wlh2
15858 32x32 multiplier, fully pipelined
15859 (2 stages).  The following instructions are additionally enabled: @code{mpy},
15860 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
15862 @item 4
15863 @itemx wlh3
15864 Two 16x16 multipliers, blocking,
15865 sequential.  The following instructions are additionally enabled: @code{mpy},
15866 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
15868 @item 5
15869 @itemx wlh4
15870 One 16x16 multiplier, blocking,
15871 sequential.  The following instructions are additionally enabled: @code{mpy},
15872 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
15874 @item 6
15875 @itemx wlh5
15876 One 32x4 multiplier, blocking,
15877 sequential.  The following instructions are additionally enabled: @code{mpy},
15878 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
15880 @item 7
15881 @itemx plus_dmpy
15882 ARC HS SIMD support.
15884 @item 8
15885 @itemx plus_macd
15886 ARC HS SIMD support.
15888 @item 9
15889 @itemx plus_qmacw
15890 ARC HS SIMD support.
15892 @end table
15894 This option is only available for ARCv2 cores@.
15896 @item -mfpu=@var{fpu}
15897 @opindex mfpu
15898 Enables support for specific floating-point hardware extensions for ARCv2
15899 cores.  Supported values for @var{fpu} are:
15901 @table @samp
15903 @item fpus
15904 Enables support for single-precision floating-point hardware
15905 extensions@.
15907 @item fpud
15908 Enables support for double-precision floating-point hardware
15909 extensions.  The single-precision floating-point extension is also
15910 enabled.  Not available for ARC EM@.
15912 @item fpuda
15913 Enables support for double-precision floating-point hardware
15914 extensions using double-precision assist instructions.  The single-precision
15915 floating-point extension is also enabled.  This option is
15916 only available for ARC EM@.
15918 @item fpuda_div
15919 Enables support for double-precision floating-point hardware
15920 extensions using double-precision assist instructions.
15921 The single-precision floating-point, square-root, and divide 
15922 extensions are also enabled.  This option is
15923 only available for ARC EM@.
15925 @item fpuda_fma
15926 Enables support for double-precision floating-point hardware
15927 extensions using double-precision assist instructions.
15928 The single-precision floating-point and fused multiply and add 
15929 hardware extensions are also enabled.  This option is
15930 only available for ARC EM@.
15932 @item fpuda_all
15933 Enables support for double-precision floating-point hardware
15934 extensions using double-precision assist instructions.
15935 All single-precision floating-point hardware extensions are also
15936 enabled.  This option is only available for ARC EM@.
15938 @item fpus_div
15939 Enables support for single-precision floating-point, square-root and divide 
15940 hardware extensions@.
15942 @item fpud_div
15943 Enables support for double-precision floating-point, square-root and divide 
15944 hardware extensions.  This option
15945 includes option @samp{fpus_div}. Not available for ARC EM@.
15947 @item fpus_fma
15948 Enables support for single-precision floating-point and 
15949 fused multiply and add hardware extensions@.
15951 @item fpud_fma
15952 Enables support for double-precision floating-point and 
15953 fused multiply and add hardware extensions.  This option
15954 includes option @samp{fpus_fma}.  Not available for ARC EM@.
15956 @item fpus_all
15957 Enables support for all single-precision floating-point hardware
15958 extensions@.
15960 @item fpud_all
15961 Enables support for all single- and double-precision floating-point
15962 hardware extensions.  Not available for ARC EM@.
15964 @end table
15966 @item -mirq-ctrl-saved=@var{register-range}, @var{blink}, @var{lp_count}
15967 @opindex mirq-ctrl-saved
15968 Specifies general-purposes registers that the processor automatically
15969 saves/restores on interrupt entry and exit.  @var{register-range} is
15970 specified as two registers separated by a dash.  The register range
15971 always starts with @code{r0}, the upper limit is @code{fp} register.
15972 @var{blink} and @var{lp_count} are optional.  This option is only
15973 valid for ARC EM and ARC HS cores.
15975 @item -mrgf-banked-regs=@var{number}
15976 @opindex mrgf-banked-regs
15977 Specifies the number of registers replicated in second register bank
15978 on entry to fast interrupt.  Fast interrupts are interrupts with the
15979 highest priority level P0.  These interrupts save only PC and STATUS32
15980 registers to avoid memory transactions during interrupt entry and exit
15981 sequences.  Use this option when you are using fast interrupts in an
15982 ARC V2 family processor.  Permitted values are 4, 8, 16, and 32.
15984 @item -mlpc-width=@var{width}
15985 @opindex mlpc-width
15986 Specify the width of the @code{lp_count} register.  Valid values for
15987 @var{width} are 8, 16, 20, 24, 28 and 32 bits.  The default width is
15988 fixed to 32 bits.  If the width is less than 32, the compiler does not
15989 attempt to transform loops in your program to use the zero-delay loop
15990 mechanism unless it is known that the @code{lp_count} register can
15991 hold the required loop-counter value.  Depending on the width
15992 specified, the compiler and run-time library might continue to use the
15993 loop mechanism for various needs.  This option defines macro
15994 @code{__ARC_LPC_WIDTH__} with the value of @var{width}.
15996 @item -mrf16
15997 @opindex mrf16
15998 This option instructs the compiler to generate code for a 16-entry
15999 register file.  This option defines the @code{__ARC_RF16__}
16000 preprocessor macro.
16002 @item -mbranch-index
16003 @opindex mbranch-index
16004 Enable use of @code{bi} or @code{bih} instructions to implement jump
16005 tables.
16007 @end table
16009 The following options are passed through to the assembler, and also
16010 define preprocessor macro symbols.
16012 @c Flags used by the assembler, but for which we define preprocessor
16013 @c macro symbols as well.
16014 @table @gcctabopt
16015 @item -mdsp-packa
16016 @opindex mdsp-packa
16017 Passed down to the assembler to enable the DSP Pack A extensions.
16018 Also sets the preprocessor symbol @code{__Xdsp_packa}.  This option is
16019 deprecated.
16021 @item -mdvbf
16022 @opindex mdvbf
16023 Passed down to the assembler to enable the dual Viterbi butterfly
16024 extension.  Also sets the preprocessor symbol @code{__Xdvbf}.  This
16025 option is deprecated.
16027 @c ARC700 4.10 extension instruction
16028 @item -mlock
16029 @opindex mlock
16030 Passed down to the assembler to enable the locked load/store
16031 conditional extension.  Also sets the preprocessor symbol
16032 @code{__Xlock}.
16034 @item -mmac-d16
16035 @opindex mmac-d16
16036 Passed down to the assembler.  Also sets the preprocessor symbol
16037 @code{__Xxmac_d16}.  This option is deprecated.
16039 @item -mmac-24
16040 @opindex mmac-24
16041 Passed down to the assembler.  Also sets the preprocessor symbol
16042 @code{__Xxmac_24}.  This option is deprecated.
16044 @c ARC700 4.10 extension instruction
16045 @item -mrtsc
16046 @opindex mrtsc
16047 Passed down to the assembler to enable the 64-bit time-stamp counter
16048 extension instruction.  Also sets the preprocessor symbol
16049 @code{__Xrtsc}.  This option is deprecated.
16051 @c ARC700 4.10 extension instruction
16052 @item -mswape
16053 @opindex mswape
16054 Passed down to the assembler to enable the swap byte ordering
16055 extension instruction.  Also sets the preprocessor symbol
16056 @code{__Xswape}.
16058 @item -mtelephony
16059 @opindex mtelephony
16060 Passed down to the assembler to enable dual- and single-operand
16061 instructions for telephony.  Also sets the preprocessor symbol
16062 @code{__Xtelephony}.  This option is deprecated.
16064 @item -mxy
16065 @opindex mxy
16066 Passed down to the assembler to enable the XY memory extension.  Also
16067 sets the preprocessor symbol @code{__Xxy}.
16069 @end table
16071 The following options control how the assembly code is annotated:
16073 @c Assembly annotation options
16074 @table @gcctabopt
16075 @item -misize
16076 @opindex misize
16077 Annotate assembler instructions with estimated addresses.
16079 @item -mannotate-align
16080 @opindex mannotate-align
16081 Explain what alignment considerations lead to the decision to make an
16082 instruction short or long.
16084 @end table
16086 The following options are passed through to the linker:
16088 @c options passed through to the linker
16089 @table @gcctabopt
16090 @item -marclinux
16091 @opindex marclinux
16092 Passed through to the linker, to specify use of the @code{arclinux} emulation.
16093 This option is enabled by default in tool chains built for
16094 @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets
16095 when profiling is not requested.
16097 @item -marclinux_prof
16098 @opindex marclinux_prof
16099 Passed through to the linker, to specify use of the
16100 @code{arclinux_prof} emulation.  This option is enabled by default in
16101 tool chains built for @w{@code{arc-linux-uclibc}} and
16102 @w{@code{arceb-linux-uclibc}} targets when profiling is requested.
16104 @end table
16106 The following options control the semantics of generated code:
16108 @c semantically relevant code generation options
16109 @table @gcctabopt
16110 @item -mlong-calls
16111 @opindex mlong-calls
16112 Generate calls as register indirect calls, thus providing access
16113 to the full 32-bit address range.
16115 @item -mmedium-calls
16116 @opindex mmedium-calls
16117 Don't use less than 25-bit addressing range for calls, which is the
16118 offset available for an unconditional branch-and-link
16119 instruction.  Conditional execution of function calls is suppressed, to
16120 allow use of the 25-bit range, rather than the 21-bit range with
16121 conditional branch-and-link.  This is the default for tool chains built
16122 for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets.
16124 @item -G @var{num}
16125 @opindex G
16126 Put definitions of externally-visible data in a small data section if
16127 that data is no bigger than @var{num} bytes.  The default value of
16128 @var{num} is 4 for any ARC configuration, or 8 when we have double
16129 load/store operations.
16131 @item -mno-sdata
16132 @opindex mno-sdata
16133 @opindex msdata
16134 Do not generate sdata references.  This is the default for tool chains
16135 built for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}}
16136 targets.
16138 @item -mvolatile-cache
16139 @opindex mvolatile-cache
16140 Use ordinarily cached memory accesses for volatile references.  This is the
16141 default.
16143 @item -mno-volatile-cache
16144 @opindex mno-volatile-cache
16145 @opindex mvolatile-cache
16146 Enable cache bypass for volatile references.
16148 @end table
16150 The following options fine tune code generation:
16151 @c code generation tuning options
16152 @table @gcctabopt
16153 @item -malign-call
16154 @opindex malign-call
16155 Do alignment optimizations for call instructions.
16157 @item -mauto-modify-reg
16158 @opindex mauto-modify-reg
16159 Enable the use of pre/post modify with register displacement.
16161 @item -mbbit-peephole
16162 @opindex mbbit-peephole
16163 Enable bbit peephole2.
16165 @item -mno-brcc
16166 @opindex mno-brcc
16167 This option disables a target-specific pass in @file{arc_reorg} to
16168 generate compare-and-branch (@code{br@var{cc}}) instructions.  
16169 It has no effect on
16170 generation of these instructions driven by the combiner pass.
16172 @item -mcase-vector-pcrel
16173 @opindex mcase-vector-pcrel
16174 Use PC-relative switch case tables to enable case table shortening.
16175 This is the default for @option{-Os}.
16177 @item -mcompact-casesi
16178 @opindex mcompact-casesi
16179 Enable compact @code{casesi} pattern.  This is the default for @option{-Os},
16180 and only available for ARCv1 cores.  This option is deprecated.
16182 @item -mno-cond-exec
16183 @opindex mno-cond-exec
16184 Disable the ARCompact-specific pass to generate conditional 
16185 execution instructions.
16187 Due to delay slot scheduling and interactions between operand numbers,
16188 literal sizes, instruction lengths, and the support for conditional execution,
16189 the target-independent pass to generate conditional execution is often lacking,
16190 so the ARC port has kept a special pass around that tries to find more
16191 conditional execution generation opportunities after register allocation,
16192 branch shortening, and delay slot scheduling have been done.  This pass
16193 generally, but not always, improves performance and code size, at the cost of
16194 extra compilation time, which is why there is an option to switch it off.
16195 If you have a problem with call instructions exceeding their allowable
16196 offset range because they are conditionalized, you should consider using
16197 @option{-mmedium-calls} instead.
16199 @item -mearly-cbranchsi
16200 @opindex mearly-cbranchsi
16201 Enable pre-reload use of the @code{cbranchsi} pattern.
16203 @item -mexpand-adddi
16204 @opindex mexpand-adddi
16205 Expand @code{adddi3} and @code{subdi3} at RTL generation time into
16206 @code{add.f}, @code{adc} etc.  This option is deprecated.
16208 @item -mindexed-loads
16209 @opindex mindexed-loads
16210 Enable the use of indexed loads.  This can be problematic because some
16211 optimizers then assume that indexed stores exist, which is not
16212 the case.
16214 @item -mlra
16215 @opindex mlra
16216 Enable Local Register Allocation.  This is still experimental for ARC,
16217 so by default the compiler uses standard reload
16218 (i.e.@: @option{-mno-lra}).
16220 @item -mlra-priority-none
16221 @opindex mlra-priority-none
16222 Don't indicate any priority for target registers.
16224 @item -mlra-priority-compact
16225 @opindex mlra-priority-compact
16226 Indicate target register priority for r0..r3 / r12..r15.
16228 @item -mlra-priority-noncompact
16229 @opindex mlra-priority-noncompact
16230 Reduce target register priority for r0..r3 / r12..r15.
16232 @item -mmillicode
16233 @opindex mmillicode
16234 When optimizing for size (using @option{-Os}), prologues and epilogues
16235 that have to save or restore a large number of registers are often
16236 shortened by using call to a special function in libgcc; this is
16237 referred to as a @emph{millicode} call.  As these calls can pose
16238 performance issues, and/or cause linking issues when linking in a
16239 nonstandard way, this option is provided to turn on or off millicode
16240 call generation.
16242 @item -mcode-density-frame
16243 @opindex mcode-density-frame
16244 This option enable the compiler to emit @code{enter} and @code{leave}
16245 instructions.  These instructions are only valid for CPUs with
16246 code-density feature.
16248 @item -mmixed-code
16249 @opindex mmixed-code
16250 Tweak register allocation to help 16-bit instruction generation.
16251 This generally has the effect of decreasing the average instruction size
16252 while increasing the instruction count.
16254 @item -mq-class
16255 @opindex mq-class
16256 Enable @samp{q} instruction alternatives.
16257 This is the default for @option{-Os}.
16259 @item -mRcq
16260 @opindex mRcq
16261 Enable @samp{Rcq} constraint handling.  
16262 Most short code generation depends on this.
16263 This is the default.
16265 @item -mRcw
16266 @opindex mRcw
16267 Enable @samp{Rcw} constraint handling.  
16268 Most ccfsm condexec mostly depends on this.
16269 This is the default.
16271 @item -msize-level=@var{level}
16272 @opindex msize-level
16273 Fine-tune size optimization with regards to instruction lengths and alignment.
16274 The recognized values for @var{level} are:
16275 @table @samp
16276 @item 0
16277 No size optimization.  This level is deprecated and treated like @samp{1}.
16279 @item 1
16280 Short instructions are used opportunistically.
16282 @item 2
16283 In addition, alignment of loops and of code after barriers are dropped.
16285 @item 3
16286 In addition, optional data alignment is dropped, and the option @option{Os} is enabled.
16288 @end table
16290 This defaults to @samp{3} when @option{-Os} is in effect.  Otherwise,
16291 the behavior when this is not set is equivalent to level @samp{1}.
16293 @item -mtune=@var{cpu}
16294 @opindex mtune
16295 Set instruction scheduling parameters for @var{cpu}, overriding any implied
16296 by @option{-mcpu=}.
16298 Supported values for @var{cpu} are
16300 @table @samp
16301 @item ARC600
16302 Tune for ARC600 CPU.
16304 @item ARC601
16305 Tune for ARC601 CPU.
16307 @item ARC700
16308 Tune for ARC700 CPU with standard multiplier block.
16310 @item ARC700-xmac
16311 Tune for ARC700 CPU with XMAC block.
16313 @item ARC725D
16314 Tune for ARC725D CPU.
16316 @item ARC750D
16317 Tune for ARC750D CPU.
16319 @end table
16321 @item -mmultcost=@var{num}
16322 @opindex mmultcost
16323 Cost to assume for a multiply instruction, with @samp{4} being equal to a
16324 normal instruction.
16326 @item -munalign-prob-threshold=@var{probability}
16327 @opindex munalign-prob-threshold
16328 Set probability threshold for unaligning branches.
16329 When tuning for @samp{ARC700} and optimizing for speed, branches without
16330 filled delay slot are preferably emitted unaligned and long, unless
16331 profiling indicates that the probability for the branch to be taken
16332 is below @var{probability}.  @xref{Cross-profiling}.
16333 The default is (REG_BR_PROB_BASE/2), i.e.@: 5000.
16335 @end table
16337 The following options are maintained for backward compatibility, but
16338 are now deprecated and will be removed in a future release:
16340 @c Deprecated options
16341 @table @gcctabopt
16343 @item -margonaut
16344 @opindex margonaut
16345 Obsolete FPX.
16347 @item -mbig-endian
16348 @opindex mbig-endian
16349 @itemx -EB
16350 @opindex EB
16351 Compile code for big-endian targets.  Use of these options is now
16352 deprecated.  Big-endian code is supported by configuring GCC to build
16353 @w{@code{arceb-elf32}} and @w{@code{arceb-linux-uclibc}} targets,
16354 for which big endian is the default.
16356 @item -mlittle-endian
16357 @opindex mlittle-endian
16358 @itemx -EL
16359 @opindex EL
16360 Compile code for little-endian targets.  Use of these options is now
16361 deprecated.  Little-endian code is supported by configuring GCC to build 
16362 @w{@code{arc-elf32}} and @w{@code{arc-linux-uclibc}} targets,
16363 for which little endian is the default.
16365 @item -mbarrel_shifter
16366 @opindex mbarrel_shifter
16367 Replaced by @option{-mbarrel-shifter}.
16369 @item -mdpfp_compact
16370 @opindex mdpfp_compact
16371 Replaced by @option{-mdpfp-compact}.
16373 @item -mdpfp_fast
16374 @opindex mdpfp_fast
16375 Replaced by @option{-mdpfp-fast}.
16377 @item -mdsp_packa
16378 @opindex mdsp_packa
16379 Replaced by @option{-mdsp-packa}.
16381 @item -mEA
16382 @opindex mEA
16383 Replaced by @option{-mea}.
16385 @item -mmac_24
16386 @opindex mmac_24
16387 Replaced by @option{-mmac-24}.
16389 @item -mmac_d16
16390 @opindex mmac_d16
16391 Replaced by @option{-mmac-d16}.
16393 @item -mspfp_compact
16394 @opindex mspfp_compact
16395 Replaced by @option{-mspfp-compact}.
16397 @item -mspfp_fast
16398 @opindex mspfp_fast
16399 Replaced by @option{-mspfp-fast}.
16401 @item -mtune=@var{cpu}
16402 @opindex mtune
16403 Values @samp{arc600}, @samp{arc601}, @samp{arc700} and
16404 @samp{arc700-xmac} for @var{cpu} are replaced by @samp{ARC600},
16405 @samp{ARC601}, @samp{ARC700} and @samp{ARC700-xmac} respectively.
16407 @item -multcost=@var{num}
16408 @opindex multcost
16409 Replaced by @option{-mmultcost}.
16411 @end table
16413 @node ARM Options
16414 @subsection ARM Options
16415 @cindex ARM options
16417 These @samp{-m} options are defined for the ARM port:
16419 @table @gcctabopt
16420 @item -mabi=@var{name}
16421 @opindex mabi
16422 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
16423 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
16425 @item -mapcs-frame
16426 @opindex mapcs-frame
16427 Generate a stack frame that is compliant with the ARM Procedure Call
16428 Standard for all functions, even if this is not strictly necessary for
16429 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
16430 with this option causes the stack frames not to be generated for
16431 leaf functions.  The default is @option{-mno-apcs-frame}.
16432 This option is deprecated.
16434 @item -mapcs
16435 @opindex mapcs
16436 This is a synonym for @option{-mapcs-frame} and is deprecated.
16438 @ignore
16439 @c not currently implemented
16440 @item -mapcs-stack-check
16441 @opindex mapcs-stack-check
16442 Generate code to check the amount of stack space available upon entry to
16443 every function (that actually uses some stack space).  If there is
16444 insufficient space available then either the function
16445 @code{__rt_stkovf_split_small} or @code{__rt_stkovf_split_big} is
16446 called, depending upon the amount of stack space required.  The runtime
16447 system is required to provide these functions.  The default is
16448 @option{-mno-apcs-stack-check}, since this produces smaller code.
16450 @c not currently implemented
16451 @item -mapcs-reentrant
16452 @opindex mapcs-reentrant
16453 Generate reentrant, position-independent code.  The default is
16454 @option{-mno-apcs-reentrant}.
16455 @end ignore
16457 @item -mthumb-interwork
16458 @opindex mthumb-interwork
16459 Generate code that supports calling between the ARM and Thumb
16460 instruction sets.  Without this option, on pre-v5 architectures, the
16461 two instruction sets cannot be reliably used inside one program.  The
16462 default is @option{-mno-thumb-interwork}, since slightly larger code
16463 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
16464 configurations this option is meaningless.
16466 @item -mno-sched-prolog
16467 @opindex mno-sched-prolog
16468 @opindex msched-prolog
16469 Prevent the reordering of instructions in the function prologue, or the
16470 merging of those instruction with the instructions in the function's
16471 body.  This means that all functions start with a recognizable set
16472 of instructions (or in fact one of a choice from a small set of
16473 different function prologues), and this information can be used to
16474 locate the start of functions inside an executable piece of code.  The
16475 default is @option{-msched-prolog}.
16477 @item -mfloat-abi=@var{name}
16478 @opindex mfloat-abi
16479 Specifies which floating-point ABI to use.  Permissible values
16480 are: @samp{soft}, @samp{softfp} and @samp{hard}.
16482 Specifying @samp{soft} causes GCC to generate output containing
16483 library calls for floating-point operations.
16484 @samp{softfp} allows the generation of code using hardware floating-point
16485 instructions, but still uses the soft-float calling conventions.
16486 @samp{hard} allows generation of floating-point instructions
16487 and uses FPU-specific calling conventions.
16489 The default depends on the specific target configuration.  Note that
16490 the hard-float and soft-float ABIs are not link-compatible; you must
16491 compile your entire program with the same ABI, and link with a
16492 compatible set of libraries.
16494 @item -mlittle-endian
16495 @opindex mlittle-endian
16496 Generate code for a processor running in little-endian mode.  This is
16497 the default for all standard configurations.
16499 @item -mbig-endian
16500 @opindex mbig-endian
16501 Generate code for a processor running in big-endian mode; the default is
16502 to compile code for a little-endian processor.
16504 @item -mbe8
16505 @itemx -mbe32
16506 @opindex mbe8
16507 When linking a big-endian image select between BE8 and BE32 formats.
16508 The option has no effect for little-endian images and is ignored.  The
16509 default is dependent on the selected target architecture.  For ARMv6
16510 and later architectures the default is BE8, for older architectures
16511 the default is BE32.  BE32 format has been deprecated by ARM.
16513 @item -march=@var{name}@r{[}+extension@dots{}@r{]}
16514 @opindex march
16515 This specifies the name of the target ARM architecture.  GCC uses this
16516 name to determine what kind of instructions it can emit when generating
16517 assembly code.  This option can be used in conjunction with or instead
16518 of the @option{-mcpu=} option.
16520 Permissible names are:
16521 @samp{armv4t},
16522 @samp{armv5t}, @samp{armv5te},
16523 @samp{armv6}, @samp{armv6j}, @samp{armv6k}, @samp{armv6kz}, @samp{armv6t2},
16524 @samp{armv6z}, @samp{armv6zk},
16525 @samp{armv7}, @samp{armv7-a}, @samp{armv7ve}, 
16526 @samp{armv8-a}, @samp{armv8.1-a}, @samp{armv8.2-a}, @samp{armv8.3-a},
16527 @samp{armv8.4-a},
16528 @samp{armv8.5-a},
16529 @samp{armv7-r},
16530 @samp{armv8-r},
16531 @samp{armv6-m}, @samp{armv6s-m},
16532 @samp{armv7-m}, @samp{armv7e-m},
16533 @samp{armv8-m.base}, @samp{armv8-m.main},
16534 @samp{iwmmxt} and @samp{iwmmxt2}.
16536 Additionally, the following architectures, which lack support for the
16537 Thumb execution state, are recognized but support is deprecated: @samp{armv4}.
16539 Many of the architectures support extensions.  These can be added by
16540 appending @samp{+@var{extension}} to the architecture name.  Extension
16541 options are processed in order and capabilities accumulate.  An extension
16542 will also enable any necessary base extensions
16543 upon which it depends.  For example, the @samp{+crypto} extension
16544 will always enable the @samp{+simd} extension.  The exception to the
16545 additive construction is for extensions that are prefixed with
16546 @samp{+no@dots{}}: these extensions disable the specified option and
16547 any other extensions that may depend on the presence of that
16548 extension.
16550 For example, @samp{-march=armv7-a+simd+nofp+vfpv4} is equivalent to
16551 writing @samp{-march=armv7-a+vfpv4} since the @samp{+simd} option is
16552 entirely disabled by the @samp{+nofp} option that follows it.
16554 Most extension names are generically named, but have an effect that is
16555 dependent upon the architecture to which it is applied.  For example,
16556 the @samp{+simd} option can be applied to both @samp{armv7-a} and
16557 @samp{armv8-a} architectures, but will enable the original ARMv7-A
16558 Advanced SIMD (Neon) extensions for @samp{armv7-a} and the ARMv8-A
16559 variant for @samp{armv8-a}.
16561 The table below lists the supported extensions for each architecture.
16562 Architectures not mentioned do not support any extensions.
16564 @table @samp
16565 @item armv5te
16566 @itemx armv6
16567 @itemx armv6j
16568 @itemx armv6k
16569 @itemx armv6kz
16570 @itemx armv6t2
16571 @itemx armv6z
16572 @itemx armv6zk
16573 @table @samp
16574 @item +fp
16575 The VFPv2 floating-point instructions.  The extension @samp{+vfpv2} can be
16576 used as an alias for this extension.
16578 @item +nofp
16579 Disable the floating-point instructions.
16580 @end table
16582 @item armv7
16583 The common subset of the ARMv7-A, ARMv7-R and ARMv7-M architectures.
16584 @table @samp
16585 @item +fp
16586 The VFPv3 floating-point instructions, with 16 double-precision
16587 registers.  The extension @samp{+vfpv3-d16} can be used as an alias
16588 for this extension.  Note that floating-point is not supported by the
16589 base ARMv7-M architecture, but is compatible with both the ARMv7-A and
16590 ARMv7-R architectures.
16592 @item +nofp
16593 Disable the floating-point instructions.
16594 @end table
16596 @item armv7-a
16597 @table @samp
16598 @item +fp
16599 The VFPv3 floating-point instructions, with 16 double-precision
16600 registers.  The extension @samp{+vfpv3-d16} can be used as an alias
16601 for this extension.
16603 @item +simd
16604 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions.
16605 The extensions @samp{+neon} and @samp{+neon-vfpv3} can be used as aliases
16606 for this extension.
16608 @item +vfpv3
16609 The VFPv3 floating-point instructions, with 32 double-precision
16610 registers.
16612 @item +vfpv3-d16-fp16
16613 The VFPv3 floating-point instructions, with 16 double-precision
16614 registers and the half-precision floating-point conversion operations.
16616 @item +vfpv3-fp16
16617 The VFPv3 floating-point instructions, with 32 double-precision
16618 registers and the half-precision floating-point conversion operations.
16620 @item +vfpv4-d16
16621 The VFPv4 floating-point instructions, with 16 double-precision
16622 registers.
16624 @item +vfpv4
16625 The VFPv4 floating-point instructions, with 32 double-precision
16626 registers.
16628 @item +neon-fp16
16629 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions, with
16630 the half-precision floating-point conversion operations.
16632 @item +neon-vfpv4
16633 The Advanced SIMD (Neon) v2 and the VFPv4 floating-point instructions.
16635 @item +nosimd
16636 Disable the Advanced SIMD instructions (does not disable floating point).
16638 @item +nofp
16639 Disable the floating-point and Advanced SIMD instructions.
16640 @end table
16642 @item armv7ve
16643 The extended version of the ARMv7-A architecture with support for
16644 virtualization.
16645 @table @samp
16646 @item +fp
16647 The VFPv4 floating-point instructions, with 16 double-precision registers.
16648 The extension @samp{+vfpv4-d16} can be used as an alias for this extension.
16650 @item +simd
16651 The Advanced SIMD (Neon) v2 and the VFPv4 floating-point instructions.  The
16652 extension @samp{+neon-vfpv4} can be used as an alias for this extension.
16654 @item +vfpv3-d16
16655 The VFPv3 floating-point instructions, with 16 double-precision
16656 registers.
16658 @item +vfpv3
16659 The VFPv3 floating-point instructions, with 32 double-precision
16660 registers.
16662 @item +vfpv3-d16-fp16
16663 The VFPv3 floating-point instructions, with 16 double-precision
16664 registers and the half-precision floating-point conversion operations.
16666 @item +vfpv3-fp16
16667 The VFPv3 floating-point instructions, with 32 double-precision
16668 registers and the half-precision floating-point conversion operations.
16670 @item +vfpv4-d16
16671 The VFPv4 floating-point instructions, with 16 double-precision
16672 registers.
16674 @item +vfpv4
16675 The VFPv4 floating-point instructions, with 32 double-precision
16676 registers.
16678 @item +neon
16679 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions.
16680 The extension @samp{+neon-vfpv3} can be used as an alias for this extension.
16682 @item +neon-fp16
16683 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions, with
16684 the half-precision floating-point conversion operations.
16686 @item +nosimd
16687 Disable the Advanced SIMD instructions (does not disable floating point).
16689 @item +nofp
16690 Disable the floating-point and Advanced SIMD instructions.
16691 @end table
16693 @item armv8-a
16694 @table @samp
16695 @item +crc
16696 The Cyclic Redundancy Check (CRC) instructions.
16697 @item +simd
16698 The ARMv8-A Advanced SIMD and floating-point instructions.
16699 @item +crypto
16700 The cryptographic instructions.
16701 @item +nocrypto
16702 Disable the cryptographic instructions.
16703 @item +nofp
16704 Disable the floating-point, Advanced SIMD and cryptographic instructions.
16705 @item +sb
16706 Speculation Barrier Instruction.
16707 @item +predres
16708 Execution and Data Prediction Restriction Instructions.
16709 @end table
16711 @item armv8.1-a
16712 @table @samp
16713 @item +simd
16714 The ARMv8.1-A Advanced SIMD and floating-point instructions.
16716 @item +crypto
16717 The cryptographic instructions.  This also enables the Advanced SIMD and
16718 floating-point instructions.
16720 @item +nocrypto
16721 Disable the cryptographic instructions.
16723 @item +nofp
16724 Disable the floating-point, Advanced SIMD and cryptographic instructions.
16726 @item +sb
16727 Speculation Barrier Instruction.
16729 @item +predres
16730 Execution and Data Prediction Restriction Instructions.
16731 @end table
16733 @item armv8.2-a
16734 @itemx armv8.3-a
16735 @table @samp
16736 @item +fp16
16737 The half-precision floating-point data processing instructions.
16738 This also enables the Advanced SIMD and floating-point instructions.
16740 @item +fp16fml
16741 The half-precision floating-point fmla extension.  This also enables
16742 the half-precision floating-point extension and Advanced SIMD and
16743 floating-point instructions.
16745 @item +simd
16746 The ARMv8.1-A Advanced SIMD and floating-point instructions.
16748 @item +crypto
16749 The cryptographic instructions.  This also enables the Advanced SIMD and
16750 floating-point instructions.
16752 @item +dotprod
16753 Enable the Dot Product extension.  This also enables Advanced SIMD instructions.
16755 @item +nocrypto
16756 Disable the cryptographic extension.
16758 @item +nofp
16759 Disable the floating-point, Advanced SIMD and cryptographic instructions.
16761 @item +sb
16762 Speculation Barrier Instruction.
16764 @item +predres
16765 Execution and Data Prediction Restriction Instructions.
16766 @end table
16768 @item armv8.4-a
16769 @table @samp
16770 @item +fp16
16771 The half-precision floating-point data processing instructions.
16772 This also enables the Advanced SIMD and floating-point instructions as well
16773 as the Dot Product extension and the half-precision floating-point fmla
16774 extension.
16776 @item +simd
16777 The ARMv8.3-A Advanced SIMD and floating-point instructions as well as the
16778 Dot Product extension.
16780 @item +crypto
16781 The cryptographic instructions.  This also enables the Advanced SIMD and
16782 floating-point instructions as well as the Dot Product extension.
16784 @item +nocrypto
16785 Disable the cryptographic extension.
16787 @item +nofp
16788 Disable the floating-point, Advanced SIMD and cryptographic instructions.
16790 @item +sb
16791 Speculation Barrier Instruction.
16793 @item +predres
16794 Execution and Data Prediction Restriction Instructions.
16795 @end table
16797 @item armv8.5-a
16798 @table @samp
16799 @item +fp16
16800 The half-precision floating-point data processing instructions.
16801 This also enables the Advanced SIMD and floating-point instructions as well
16802 as the Dot Product extension and the half-precision floating-point fmla
16803 extension.
16805 @item +simd
16806 The ARMv8.3-A Advanced SIMD and floating-point instructions as well as the
16807 Dot Product extension.
16809 @item +crypto
16810 The cryptographic instructions.  This also enables the Advanced SIMD and
16811 floating-point instructions as well as the Dot Product extension.
16813 @item +nocrypto
16814 Disable the cryptographic extension.
16816 @item +nofp
16817 Disable the floating-point, Advanced SIMD and cryptographic instructions.
16818 @end table
16820 @item armv7-r
16821 @table @samp
16822 @item +fp.sp
16823 The single-precision VFPv3 floating-point instructions.  The extension
16824 @samp{+vfpv3xd} can be used as an alias for this extension.
16826 @item +fp
16827 The VFPv3 floating-point instructions with 16 double-precision registers.
16828 The extension +vfpv3-d16 can be used as an alias for this extension.
16830 @item +nofp
16831 Disable the floating-point extension.
16833 @item +idiv
16834 The ARM-state integer division instructions.
16836 @item +noidiv
16837 Disable the ARM-state integer division extension.
16838 @end table
16840 @item armv7e-m
16841 @table @samp
16842 @item +fp
16843 The single-precision VFPv4 floating-point instructions.
16845 @item +fpv5
16846 The single-precision FPv5 floating-point instructions.
16848 @item +fp.dp
16849 The single- and double-precision FPv5 floating-point instructions.
16851 @item +nofp
16852 Disable the floating-point extensions.
16853 @end table
16855 @item  armv8-m.main
16856 @table @samp
16857 @item +dsp
16858 The DSP instructions.
16860 @item +nodsp
16861 Disable the DSP extension.
16863 @item +fp
16864 The single-precision floating-point instructions.
16866 @item +fp.dp
16867 The single- and double-precision floating-point instructions.
16869 @item +nofp
16870 Disable the floating-point extension.
16871 @end table
16873 @item armv8-r
16874 @table @samp
16875 @item +crc
16876 The Cyclic Redundancy Check (CRC) instructions.
16877 @item +fp.sp
16878 The single-precision FPv5 floating-point instructions.
16879 @item +simd
16880 The ARMv8-A Advanced SIMD and floating-point instructions.
16881 @item +crypto
16882 The cryptographic instructions.
16883 @item +nocrypto
16884 Disable the cryptographic instructions.
16885 @item +nofp
16886 Disable the floating-point, Advanced SIMD and cryptographic instructions.
16887 @end table
16889 @end table
16891 @option{-march=native} causes the compiler to auto-detect the architecture
16892 of the build computer.  At present, this feature is only supported on
16893 GNU/Linux, and not all architectures are recognized.  If the auto-detect
16894 is unsuccessful the option has no effect.
16896 @item -mtune=@var{name}
16897 @opindex mtune
16898 This option specifies the name of the target ARM processor for
16899 which GCC should tune the performance of the code.
16900 For some ARM implementations better performance can be obtained by using
16901 this option.
16902 Permissible names are: @samp{arm2}, @samp{arm250},
16903 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
16904 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
16905 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
16906 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
16907 @samp{arm720},
16908 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
16909 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
16910 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
16911 @samp{strongarm1110},
16912 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
16913 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
16914 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
16915 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
16916 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
16917 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
16918 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
16919 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8},
16920 @samp{cortex-a9}, @samp{cortex-a12}, @samp{cortex-a15}, @samp{cortex-a17},
16921 @samp{cortex-a32}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55},
16922 @samp{cortex-a57}, @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-a75},
16923 @samp{cortex-a76}, @samp{ares}, @samp{cortex-r4}, @samp{cortex-r4f},
16924 @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-r8}, @samp{cortex-r52},
16925 @samp{cortex-m33},
16926 @samp{cortex-m23},
16927 @samp{cortex-m7},
16928 @samp{cortex-m4},
16929 @samp{cortex-m3},
16930 @samp{cortex-m1},
16931 @samp{cortex-m0},
16932 @samp{cortex-m0plus},
16933 @samp{cortex-m1.small-multiply},
16934 @samp{cortex-m0.small-multiply},
16935 @samp{cortex-m0plus.small-multiply},
16936 @samp{exynos-m1},
16937 @samp{marvell-pj4},
16938 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
16939 @samp{fa526}, @samp{fa626},
16940 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te},
16941 @samp{xgene1}.
16943 Additionally, this option can specify that GCC should tune the performance
16944 of the code for a big.LITTLE system.  Permissible names are:
16945 @samp{cortex-a15.cortex-a7}, @samp{cortex-a17.cortex-a7},
16946 @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
16947 @samp{cortex-a72.cortex-a35}, @samp{cortex-a73.cortex-a53},
16948 @samp{cortex-a75.cortex-a55}, @samp{cortex-a76.cortex-a55}.
16950 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
16951 performance for a blend of processors within architecture @var{arch}.
16952 The aim is to generate code that run well on the current most popular
16953 processors, balancing between optimizations that benefit some CPUs in the
16954 range, and avoiding performance pitfalls of other CPUs.  The effects of
16955 this option may change in future GCC versions as CPU models come and go.
16957 @option{-mtune} permits the same extension options as @option{-mcpu}, but
16958 the extension options do not affect the tuning of the generated code.
16960 @option{-mtune=native} causes the compiler to auto-detect the CPU
16961 of the build computer.  At present, this feature is only supported on
16962 GNU/Linux, and not all architectures are recognized.  If the auto-detect is
16963 unsuccessful the option has no effect.
16965 @item -mcpu=@var{name}@r{[}+extension@dots{}@r{]}
16966 @opindex mcpu
16967 This specifies the name of the target ARM processor.  GCC uses this name
16968 to derive the name of the target ARM architecture (as if specified
16969 by @option{-march}) and the ARM processor type for which to tune for
16970 performance (as if specified by @option{-mtune}).  Where this option
16971 is used in conjunction with @option{-march} or @option{-mtune},
16972 those options take precedence over the appropriate part of this option.
16974 Many of the supported CPUs implement optional architectural
16975 extensions.  Where this is so the architectural extensions are
16976 normally enabled by default.  If implementations that lack the
16977 extension exist, then the extension syntax can be used to disable
16978 those extensions that have been omitted.  For floating-point and
16979 Advanced SIMD (Neon) instructions, the settings of the options
16980 @option{-mfloat-abi} and @option{-mfpu} must also be considered:
16981 floating-point and Advanced SIMD instructions will only be used if
16982 @option{-mfloat-abi} is not set to @samp{soft}; and any setting of
16983 @option{-mfpu} other than @samp{auto} will override the available
16984 floating-point and SIMD extension instructions.
16986 For example, @samp{cortex-a9} can be found in three major
16987 configurations: integer only, with just a floating-point unit or with
16988 floating-point and Advanced SIMD.  The default is to enable all the
16989 instructions, but the extensions @samp{+nosimd} and @samp{+nofp} can
16990 be used to disable just the SIMD or both the SIMD and floating-point
16991 instructions respectively.
16993 Permissible names for this option are the same as those for
16994 @option{-mtune}.
16996 The following extension options are common to the listed CPUs:
16998 @table @samp
16999 @item +nodsp
17000 Disable the DSP instructions on @samp{cortex-m33}.
17002 @item  +nofp
17003 Disables the floating-point instructions on @samp{arm9e},
17004 @samp{arm946e-s}, @samp{arm966e-s}, @samp{arm968e-s}, @samp{arm10e},
17005 @samp{arm1020e}, @samp{arm1022e}, @samp{arm926ej-s},
17006 @samp{arm1026ej-s}, @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-r8},
17007 @samp{cortex-m4}, @samp{cortex-m7} and @samp{cortex-m33}.
17008 Disables the floating-point and SIMD instructions on
17009 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7},
17010 @samp{cortex-a8}, @samp{cortex-a9}, @samp{cortex-a12},
17011 @samp{cortex-a15}, @samp{cortex-a17}, @samp{cortex-a15.cortex-a7},
17012 @samp{cortex-a17.cortex-a7}, @samp{cortex-a32}, @samp{cortex-a35},
17013 @samp{cortex-a53} and @samp{cortex-a55}.
17015 @item +nofp.dp
17016 Disables the double-precision component of the floating-point instructions
17017 on @samp{cortex-r5}, @samp{cortex-r52} and @samp{cortex-m7}.
17019 @item +nosimd
17020 Disables the SIMD (but not floating-point) instructions on
17021 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7}
17022 and @samp{cortex-a9}.
17024 @item +crypto
17025 Enables the cryptographic instructions on @samp{cortex-a32},
17026 @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55}, @samp{cortex-a57},
17027 @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-a75}, @samp{exynos-m1},
17028 @samp{xgene1}, @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
17029 @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53} and
17030 @samp{cortex-a75.cortex-a55}.
17031 @end table
17033 Additionally the @samp{generic-armv7-a} pseudo target defaults to
17034 VFPv3 with 16 double-precision registers.  It supports the following
17035 extension options: @samp{vfpv3-d16}, @samp{vfpv3},
17036 @samp{vfpv3-d16-fp16}, @samp{vfpv3-fp16}, @samp{vfpv4-d16},
17037 @samp{vfpv4}, @samp{neon}, @samp{neon-vfpv3}, @samp{neon-fp16},
17038 @samp{neon-vfpv4}.  The meanings are the same as for the extensions to
17039 @option{-march=armv7-a}.
17041 @option{-mcpu=generic-@var{arch}} is also permissible, and is
17042 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
17043 See @option{-mtune} for more information.
17045 @option{-mcpu=native} causes the compiler to auto-detect the CPU
17046 of the build computer.  At present, this feature is only supported on
17047 GNU/Linux, and not all architectures are recognized.  If the auto-detect
17048 is unsuccessful the option has no effect.
17050 @item -mfpu=@var{name}
17051 @opindex mfpu
17052 This specifies what floating-point hardware (or hardware emulation) is
17053 available on the target.  Permissible names are: @samp{auto}, @samp{vfpv2},
17054 @samp{vfpv3},
17055 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
17056 @samp{vfpv3xd-fp16}, @samp{neon-vfpv3}, @samp{neon-fp16}, @samp{vfpv4},
17057 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
17058 @samp{fpv5-d16}, @samp{fpv5-sp-d16},
17059 @samp{fp-armv8}, @samp{neon-fp-armv8} and @samp{crypto-neon-fp-armv8}.
17060 Note that @samp{neon} is an alias for @samp{neon-vfpv3} and @samp{vfp}
17061 is an alias for @samp{vfpv2}.
17063 The setting @samp{auto} is the default and is special.  It causes the
17064 compiler to select the floating-point and Advanced SIMD instructions
17065 based on the settings of @option{-mcpu} and @option{-march}.
17067 If the selected floating-point hardware includes the NEON extension
17068 (e.g.@: @option{-mfpu=neon}), note that floating-point
17069 operations are not generated by GCC's auto-vectorization pass unless
17070 @option{-funsafe-math-optimizations} is also specified.  This is
17071 because NEON hardware does not fully implement the IEEE 754 standard for
17072 floating-point arithmetic (in particular denormal values are treated as
17073 zero), so the use of NEON instructions may lead to a loss of precision.
17075 You can also set the fpu name at function level by using the @code{target("fpu=")} function attributes (@pxref{ARM Function Attributes}) or pragmas (@pxref{Function Specific Option Pragmas}).
17077 @item -mfp16-format=@var{name}
17078 @opindex mfp16-format
17079 Specify the format of the @code{__fp16} half-precision floating-point type.
17080 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
17081 the default is @samp{none}, in which case the @code{__fp16} type is not
17082 defined.  @xref{Half-Precision}, for more information.
17084 @item -mstructure-size-boundary=@var{n}
17085 @opindex mstructure-size-boundary
17086 The sizes of all structures and unions are rounded up to a multiple
17087 of the number of bits set by this option.  Permissible values are 8, 32
17088 and 64.  The default value varies for different toolchains.  For the COFF
17089 targeted toolchain the default value is 8.  A value of 64 is only allowed
17090 if the underlying ABI supports it.
17092 Specifying a larger number can produce faster, more efficient code, but
17093 can also increase the size of the program.  Different values are potentially
17094 incompatible.  Code compiled with one value cannot necessarily expect to
17095 work with code or libraries compiled with another value, if they exchange
17096 information using structures or unions.
17098 This option is deprecated.
17100 @item -mabort-on-noreturn
17101 @opindex mabort-on-noreturn
17102 Generate a call to the function @code{abort} at the end of a
17103 @code{noreturn} function.  It is executed if the function tries to
17104 return.
17106 @item -mlong-calls
17107 @itemx -mno-long-calls
17108 @opindex mlong-calls
17109 @opindex mno-long-calls
17110 Tells the compiler to perform function calls by first loading the
17111 address of the function into a register and then performing a subroutine
17112 call on this register.  This switch is needed if the target function
17113 lies outside of the 64-megabyte addressing range of the offset-based
17114 version of subroutine call instruction.
17116 Even if this switch is enabled, not all function calls are turned
17117 into long calls.  The heuristic is that static functions, functions
17118 that have the @code{short_call} attribute, functions that are inside
17119 the scope of a @code{#pragma no_long_calls} directive, and functions whose
17120 definitions have already been compiled within the current compilation
17121 unit are not turned into long calls.  The exceptions to this rule are
17122 that weak function definitions, functions with the @code{long_call}
17123 attribute or the @code{section} attribute, and functions that are within
17124 the scope of a @code{#pragma long_calls} directive are always
17125 turned into long calls.
17127 This feature is not enabled by default.  Specifying
17128 @option{-mno-long-calls} restores the default behavior, as does
17129 placing the function calls within the scope of a @code{#pragma
17130 long_calls_off} directive.  Note these switches have no effect on how
17131 the compiler generates code to handle function calls via function
17132 pointers.
17134 @item -msingle-pic-base
17135 @opindex msingle-pic-base
17136 Treat the register used for PIC addressing as read-only, rather than
17137 loading it in the prologue for each function.  The runtime system is
17138 responsible for initializing this register with an appropriate value
17139 before execution begins.
17141 @item -mpic-register=@var{reg}
17142 @opindex mpic-register
17143 Specify the register to be used for PIC addressing.
17144 For standard PIC base case, the default is any suitable register
17145 determined by compiler.  For single PIC base case, the default is
17146 @samp{R9} if target is EABI based or stack-checking is enabled,
17147 otherwise the default is @samp{R10}.
17149 @item -mpic-data-is-text-relative
17150 @opindex mpic-data-is-text-relative
17151 Assume that the displacement between the text and data segments is fixed
17152 at static link time.  This permits using PC-relative addressing
17153 operations to access data known to be in the data segment.  For
17154 non-VxWorks RTP targets, this option is enabled by default.  When
17155 disabled on such targets, it will enable @option{-msingle-pic-base} by
17156 default.
17158 @item -mpoke-function-name
17159 @opindex mpoke-function-name
17160 Write the name of each function into the text section, directly
17161 preceding the function prologue.  The generated code is similar to this:
17163 @smallexample
17164      t0
17165          .ascii "arm_poke_function_name", 0
17166          .align
17167      t1
17168          .word 0xff000000 + (t1 - t0)
17169      arm_poke_function_name
17170          mov     ip, sp
17171          stmfd   sp!, @{fp, ip, lr, pc@}
17172          sub     fp, ip, #4
17173 @end smallexample
17175 When performing a stack backtrace, code can inspect the value of
17176 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
17177 location @code{pc - 12} and the top 8 bits are set, then we know that
17178 there is a function name embedded immediately preceding this location
17179 and has length @code{((pc[-3]) & 0xff000000)}.
17181 @item -mthumb
17182 @itemx -marm
17183 @opindex marm
17184 @opindex mthumb
17186 Select between generating code that executes in ARM and Thumb
17187 states.  The default for most configurations is to generate code
17188 that executes in ARM state, but the default can be changed by
17189 configuring GCC with the @option{--with-mode=}@var{state}
17190 configure option.
17192 You can also override the ARM and Thumb mode for each function
17193 by using the @code{target("thumb")} and @code{target("arm")} function attributes
17194 (@pxref{ARM Function Attributes}) or pragmas (@pxref{Function Specific Option Pragmas}).
17196 @item -mflip-thumb 
17197 @opindex mflip-thumb
17198 Switch ARM/Thumb modes on alternating functions.
17199 This option is provided for regression testing of mixed Thumb/ARM code
17200 generation, and is not intended for ordinary use in compiling code.
17202 @item -mtpcs-frame
17203 @opindex mtpcs-frame
17204 Generate a stack frame that is compliant with the Thumb Procedure Call
17205 Standard for all non-leaf functions.  (A leaf function is one that does
17206 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
17208 @item -mtpcs-leaf-frame
17209 @opindex mtpcs-leaf-frame
17210 Generate a stack frame that is compliant with the Thumb Procedure Call
17211 Standard for all leaf functions.  (A leaf function is one that does
17212 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
17214 @item -mcallee-super-interworking
17215 @opindex mcallee-super-interworking
17216 Gives all externally visible functions in the file being compiled an ARM
17217 instruction set header which switches to Thumb mode before executing the
17218 rest of the function.  This allows these functions to be called from
17219 non-interworking code.  This option is not valid in AAPCS configurations
17220 because interworking is enabled by default.
17222 @item -mcaller-super-interworking
17223 @opindex mcaller-super-interworking
17224 Allows calls via function pointers (including virtual functions) to
17225 execute correctly regardless of whether the target code has been
17226 compiled for interworking or not.  There is a small overhead in the cost
17227 of executing a function pointer if this option is enabled.  This option
17228 is not valid in AAPCS configurations because interworking is enabled
17229 by default.
17231 @item -mtp=@var{name}
17232 @opindex mtp
17233 Specify the access model for the thread local storage pointer.  The valid
17234 models are @samp{soft}, which generates calls to @code{__aeabi_read_tp},
17235 @samp{cp15}, which fetches the thread pointer from @code{cp15} directly
17236 (supported in the arm6k architecture), and @samp{auto}, which uses the
17237 best available method for the selected processor.  The default setting is
17238 @samp{auto}.
17240 @item -mtls-dialect=@var{dialect}
17241 @opindex mtls-dialect
17242 Specify the dialect to use for accessing thread local storage.  Two
17243 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
17244 @samp{gnu} dialect selects the original GNU scheme for supporting
17245 local and global dynamic TLS models.  The @samp{gnu2} dialect
17246 selects the GNU descriptor scheme, which provides better performance
17247 for shared libraries.  The GNU descriptor scheme is compatible with
17248 the original scheme, but does require new assembler, linker and
17249 library support.  Initial and local exec TLS models are unaffected by
17250 this option and always use the original scheme.
17252 @item -mword-relocations
17253 @opindex mword-relocations
17254 Only generate absolute relocations on word-sized values (i.e.@: R_ARM_ABS32).
17255 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
17256 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
17257 is specified. This option conflicts with @option{-mslow-flash-data}.
17259 @item -mfix-cortex-m3-ldrd
17260 @opindex mfix-cortex-m3-ldrd
17261 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
17262 with overlapping destination and base registers are used.  This option avoids
17263 generating these instructions.  This option is enabled by default when
17264 @option{-mcpu=cortex-m3} is specified.
17266 @item -munaligned-access
17267 @itemx -mno-unaligned-access
17268 @opindex munaligned-access
17269 @opindex mno-unaligned-access
17270 Enables (or disables) reading and writing of 16- and 32- bit values
17271 from addresses that are not 16- or 32- bit aligned.  By default
17272 unaligned access is disabled for all pre-ARMv6, all ARMv6-M and for
17273 ARMv8-M Baseline architectures, and enabled for all other
17274 architectures.  If unaligned access is not enabled then words in packed
17275 data structures are accessed a byte at a time.
17277 The ARM attribute @code{Tag_CPU_unaligned_access} is set in the
17278 generated object file to either true or false, depending upon the
17279 setting of this option.  If unaligned access is enabled then the
17280 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} is also
17281 defined.
17283 @item -mneon-for-64bits
17284 @opindex mneon-for-64bits
17285 Enables using Neon to handle scalar 64-bits operations. This is
17286 disabled by default since the cost of moving data from core registers
17287 to Neon is high.
17289 @item -mslow-flash-data
17290 @opindex mslow-flash-data
17291 Assume loading data from flash is slower than fetching instruction.
17292 Therefore literal load is minimized for better performance.
17293 This option is only supported when compiling for ARMv7 M-profile and
17294 off by default. It conflicts with @option{-mword-relocations}.
17296 @item -masm-syntax-unified
17297 @opindex masm-syntax-unified
17298 Assume inline assembler is using unified asm syntax.  The default is
17299 currently off which implies divided syntax.  This option has no impact
17300 on Thumb2. However, this may change in future releases of GCC.
17301 Divided syntax should be considered deprecated.
17303 @item -mrestrict-it
17304 @opindex mrestrict-it
17305 Restricts generation of IT blocks to conform to the rules of ARMv8-A.
17306 IT blocks can only contain a single 16-bit instruction from a select
17307 set of instructions. This option is on by default for ARMv8-A Thumb mode.
17309 @item -mprint-tune-info
17310 @opindex mprint-tune-info
17311 Print CPU tuning information as comment in assembler file.  This is
17312 an option used only for regression testing of the compiler and not
17313 intended for ordinary use in compiling code.  This option is disabled
17314 by default.
17316 @item -mverbose-cost-dump
17317 @opindex mverbose-cost-dump
17318 Enable verbose cost model dumping in the debug dump files.  This option is
17319 provided for use in debugging the compiler.
17321 @item -mpure-code
17322 @opindex mpure-code
17323 Do not allow constant data to be placed in code sections.
17324 Additionally, when compiling for ELF object format give all text sections the
17325 ELF processor-specific section attribute @code{SHF_ARM_PURECODE}.  This option
17326 is only available when generating non-pic code for M-profile targets with the
17327 MOVT instruction.
17329 @item -mcmse
17330 @opindex mcmse
17331 Generate secure code as per the "ARMv8-M Security Extensions: Requirements on
17332 Development Tools Engineering Specification", which can be found on
17333 @url{http://infocenter.arm.com/help/topic/com.arm.doc.ecm0359818/ECM0359818_armv8m_security_extensions_reqs_on_dev_tools_1_0.pdf}.
17334 @end table
17336 @node AVR Options
17337 @subsection AVR Options
17338 @cindex AVR Options
17340 These options are defined for AVR implementations:
17342 @table @gcctabopt
17343 @item -mmcu=@var{mcu}
17344 @opindex mmcu
17345 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
17347 The default for this option is@tie{}@samp{avr2}.
17349 GCC supports the following AVR devices and ISAs:
17351 @include avr-mmcu.texi
17353 @item -mabsdata
17354 @opindex mabsdata
17356 Assume that all data in static storage can be accessed by LDS / STS
17357 instructions.  This option has only an effect on reduced Tiny devices like
17358 ATtiny40.  See also the @code{absdata}
17359 @ref{AVR Variable Attributes,variable attribute}.
17361 @item -maccumulate-args
17362 @opindex maccumulate-args
17363 Accumulate outgoing function arguments and acquire/release the needed
17364 stack space for outgoing function arguments once in function
17365 prologue/epilogue.  Without this option, outgoing arguments are pushed
17366 before calling a function and popped afterwards.
17368 Popping the arguments after the function call can be expensive on
17369 AVR so that accumulating the stack space might lead to smaller
17370 executables because arguments need not be removed from the
17371 stack after such a function call.
17373 This option can lead to reduced code size for functions that perform
17374 several calls to functions that get their arguments on the stack like
17375 calls to printf-like functions.
17377 @item -mbranch-cost=@var{cost}
17378 @opindex mbranch-cost
17379 Set the branch costs for conditional branch instructions to
17380 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
17381 integers. The default branch cost is 0.
17383 @item -mcall-prologues
17384 @opindex mcall-prologues
17385 Functions prologues/epilogues are expanded as calls to appropriate
17386 subroutines.  Code size is smaller.
17388 @item -mgas-isr-prologues
17389 @opindex mgas-isr-prologues
17390 Interrupt service routines (ISRs) may use the @code{__gcc_isr} pseudo
17391 instruction supported by GNU Binutils.
17392 If this option is on, the feature can still be disabled for individual
17393 ISRs by means of the @ref{AVR Function Attributes,,@code{no_gccisr}}
17394 function attribute.  This feature is activated per default
17395 if optimization is on (but not with @option{-Og}, @pxref{Optimize Options}),
17396 and if GNU Binutils support @w{@uref{https://sourceware.org/PR21683,PR21683}}.
17398 @item -mint8
17399 @opindex mint8
17400 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
17401 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
17402 and @code{long long} is 4 bytes.  Please note that this option does not
17403 conform to the C standards, but it results in smaller code
17404 size.
17406 @item -mmain-is-OS_task
17407 @opindex mmain-is-OS_task
17408 Do not save registers in @code{main}.  The effect is the same like
17409 attaching attribute @ref{AVR Function Attributes,,@code{OS_task}}
17410 to @code{main}. It is activated per default if optimization is on.
17412 @item -mn-flash=@var{num}
17413 @opindex mn-flash
17414 Assume that the flash memory has a size of 
17415 @var{num} times 64@tie{}KiB.
17417 @item -mno-interrupts
17418 @opindex mno-interrupts
17419 Generated code is not compatible with hardware interrupts.
17420 Code size is smaller.
17422 @item -mrelax
17423 @opindex mrelax
17424 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
17425 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
17426 Setting @option{-mrelax} just adds the @option{--mlink-relax} option to
17427 the assembler's command line and the @option{--relax} option to the
17428 linker's command line.
17430 Jump relaxing is performed by the linker because jump offsets are not
17431 known before code is located. Therefore, the assembler code generated by the
17432 compiler is the same, but the instructions in the executable may
17433 differ from instructions in the assembler code.
17435 Relaxing must be turned on if linker stubs are needed, see the
17436 section on @code{EIND} and linker stubs below.
17438 @item -mrmw
17439 @opindex mrmw
17440 Assume that the device supports the Read-Modify-Write
17441 instructions @code{XCH}, @code{LAC}, @code{LAS} and @code{LAT}.
17443 @item -mshort-calls
17444 @opindex mshort-calls
17446 Assume that @code{RJMP} and @code{RCALL} can target the whole
17447 program memory.
17449 This option is used internally for multilib selection.  It is
17450 not an optimization option, and you don't need to set it by hand.
17452 @item -msp8
17453 @opindex msp8
17454 Treat the stack pointer register as an 8-bit register,
17455 i.e.@: assume the high byte of the stack pointer is zero.
17456 In general, you don't need to set this option by hand.
17458 This option is used internally by the compiler to select and
17459 build multilibs for architectures @code{avr2} and @code{avr25}.
17460 These architectures mix devices with and without @code{SPH}.
17461 For any setting other than @option{-mmcu=avr2} or @option{-mmcu=avr25}
17462 the compiler driver adds or removes this option from the compiler
17463 proper's command line, because the compiler then knows if the device
17464 or architecture has an 8-bit stack pointer and thus no @code{SPH}
17465 register or not.
17467 @item -mstrict-X
17468 @opindex mstrict-X
17469 Use address register @code{X} in a way proposed by the hardware.  This means
17470 that @code{X} is only used in indirect, post-increment or
17471 pre-decrement addressing.
17473 Without this option, the @code{X} register may be used in the same way
17474 as @code{Y} or @code{Z} which then is emulated by additional
17475 instructions.  
17476 For example, loading a value with @code{X+const} addressing with a
17477 small non-negative @code{const < 64} to a register @var{Rn} is
17478 performed as
17480 @example
17481 adiw r26, const   ; X += const
17482 ld   @var{Rn}, X        ; @var{Rn} = *X
17483 sbiw r26, const   ; X -= const
17484 @end example
17486 @item -mtiny-stack
17487 @opindex mtiny-stack
17488 Only change the lower 8@tie{}bits of the stack pointer.
17490 @item -mfract-convert-truncate
17491 @opindex mfract-convert-truncate
17492 Allow to use truncation instead of rounding towards zero for fractional fixed-point types.
17494 @item -nodevicelib
17495 @opindex nodevicelib
17496 Don't link against AVR-LibC's device specific library @code{lib<mcu>.a}.
17498 @item -Waddr-space-convert
17499 @opindex Waddr-space-convert
17500 @opindex Wno-addr-space-convert
17501 Warn about conversions between address spaces in the case where the
17502 resulting address space is not contained in the incoming address space.
17504 @item -Wmisspelled-isr
17505 @opindex Wmisspelled-isr
17506 @opindex Wno-misspelled-isr
17507 Warn if the ISR is misspelled, i.e.@: without __vector prefix.
17508 Enabled by default.
17509 @end table
17511 @subsubsection @code{EIND} and Devices with More Than 128 Ki Bytes of Flash
17512 @cindex @code{EIND}
17513 Pointers in the implementation are 16@tie{}bits wide.
17514 The address of a function or label is represented as word address so
17515 that indirect jumps and calls can target any code address in the
17516 range of 64@tie{}Ki words.
17518 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
17519 bytes of program memory space, there is a special function register called
17520 @code{EIND} that serves as most significant part of the target address
17521 when @code{EICALL} or @code{EIJMP} instructions are used.
17523 Indirect jumps and calls on these devices are handled as follows by
17524 the compiler and are subject to some limitations:
17526 @itemize @bullet
17528 @item
17529 The compiler never sets @code{EIND}.
17531 @item
17532 The compiler uses @code{EIND} implicitly in @code{EICALL}/@code{EIJMP}
17533 instructions or might read @code{EIND} directly in order to emulate an
17534 indirect call/jump by means of a @code{RET} instruction.
17536 @item
17537 The compiler assumes that @code{EIND} never changes during the startup
17538 code or during the application. In particular, @code{EIND} is not
17539 saved/restored in function or interrupt service routine
17540 prologue/epilogue.
17542 @item
17543 For indirect calls to functions and computed goto, the linker
17544 generates @emph{stubs}. Stubs are jump pads sometimes also called
17545 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
17546 The stub contains a direct jump to the desired address.
17548 @item
17549 Linker relaxation must be turned on so that the linker generates
17550 the stubs correctly in all situations. See the compiler option
17551 @option{-mrelax} and the linker option @option{--relax}.
17552 There are corner cases where the linker is supposed to generate stubs
17553 but aborts without relaxation and without a helpful error message.
17555 @item
17556 The default linker script is arranged for code with @code{EIND = 0}.
17557 If code is supposed to work for a setup with @code{EIND != 0}, a custom
17558 linker script has to be used in order to place the sections whose
17559 name start with @code{.trampolines} into the segment where @code{EIND}
17560 points to.
17562 @item
17563 The startup code from libgcc never sets @code{EIND}.
17564 Notice that startup code is a blend of code from libgcc and AVR-LibC.
17565 For the impact of AVR-LibC on @code{EIND}, see the
17566 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
17568 @item
17569 It is legitimate for user-specific startup code to set up @code{EIND}
17570 early, for example by means of initialization code located in
17571 section @code{.init3}. Such code runs prior to general startup code
17572 that initializes RAM and calls constructors, but after the bit
17573 of startup code from AVR-LibC that sets @code{EIND} to the segment
17574 where the vector table is located.
17575 @example
17576 #include <avr/io.h>
17578 static void
17579 __attribute__((section(".init3"),naked,used,no_instrument_function))
17580 init3_set_eind (void)
17582   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
17583                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
17585 @end example
17587 @noindent
17588 The @code{__trampolines_start} symbol is defined in the linker script.
17590 @item
17591 Stubs are generated automatically by the linker if
17592 the following two conditions are met:
17593 @itemize @minus
17595 @item The address of a label is taken by means of the @code{gs} modifier
17596 (short for @emph{generate stubs}) like so:
17597 @example
17598 LDI r24, lo8(gs(@var{func}))
17599 LDI r25, hi8(gs(@var{func}))
17600 @end example
17601 @item The final location of that label is in a code segment
17602 @emph{outside} the segment where the stubs are located.
17603 @end itemize
17605 @item
17606 The compiler emits such @code{gs} modifiers for code labels in the
17607 following situations:
17608 @itemize @minus
17609 @item Taking address of a function or code label.
17610 @item Computed goto.
17611 @item If prologue-save function is used, see @option{-mcall-prologues}
17612 command-line option.
17613 @item Switch/case dispatch tables. If you do not want such dispatch
17614 tables you can specify the @option{-fno-jump-tables} command-line option.
17615 @item C and C++ constructors/destructors called during startup/shutdown.
17616 @item If the tools hit a @code{gs()} modifier explained above.
17617 @end itemize
17619 @item
17620 Jumping to non-symbolic addresses like so is @emph{not} supported:
17622 @example
17623 int main (void)
17625     /* Call function at word address 0x2 */
17626     return ((int(*)(void)) 0x2)();
17628 @end example
17630 Instead, a stub has to be set up, i.e.@: the function has to be called
17631 through a symbol (@code{func_4} in the example):
17633 @example
17634 int main (void)
17636     extern int func_4 (void);
17638     /* Call function at byte address 0x4 */
17639     return func_4();
17641 @end example
17643 and the application be linked with @option{-Wl,--defsym,func_4=0x4}.
17644 Alternatively, @code{func_4} can be defined in the linker script.
17645 @end itemize
17647 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
17648 @cindex @code{RAMPD}
17649 @cindex @code{RAMPX}
17650 @cindex @code{RAMPY}
17651 @cindex @code{RAMPZ}
17652 Some AVR devices support memories larger than the 64@tie{}KiB range
17653 that can be accessed with 16-bit pointers.  To access memory locations
17654 outside this 64@tie{}KiB range, the content of a @code{RAMP}
17655 register is used as high part of the address:
17656 The @code{X}, @code{Y}, @code{Z} address register is concatenated
17657 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
17658 register, respectively, to get a wide address. Similarly,
17659 @code{RAMPD} is used together with direct addressing.
17661 @itemize
17662 @item
17663 The startup code initializes the @code{RAMP} special function
17664 registers with zero.
17666 @item
17667 If a @ref{AVR Named Address Spaces,named address space} other than
17668 generic or @code{__flash} is used, then @code{RAMPZ} is set
17669 as needed before the operation.
17671 @item
17672 If the device supports RAM larger than 64@tie{}KiB and the compiler
17673 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
17674 is reset to zero after the operation.
17676 @item
17677 If the device comes with a specific @code{RAMP} register, the ISR
17678 prologue/epilogue saves/restores that SFR and initializes it with
17679 zero in case the ISR code might (implicitly) use it.
17681 @item
17682 RAM larger than 64@tie{}KiB is not supported by GCC for AVR targets.
17683 If you use inline assembler to read from locations outside the
17684 16-bit address range and change one of the @code{RAMP} registers,
17685 you must reset it to zero after the access.
17687 @end itemize
17689 @subsubsection AVR Built-in Macros
17691 GCC defines several built-in macros so that the user code can test
17692 for the presence or absence of features.  Almost any of the following
17693 built-in macros are deduced from device capabilities and thus
17694 triggered by the @option{-mmcu=} command-line option.
17696 For even more AVR-specific built-in macros see
17697 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
17699 @table @code
17701 @item __AVR_ARCH__
17702 Build-in macro that resolves to a decimal number that identifies the
17703 architecture and depends on the @option{-mmcu=@var{mcu}} option.
17704 Possible values are:
17706 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
17707 @code{4}, @code{5}, @code{51}, @code{6}
17709 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3}, @code{avr31},
17710 @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51}, @code{avr6},
17712 respectively and
17714 @code{100},
17715 @code{102}, @code{103}, @code{104},
17716 @code{105}, @code{106}, @code{107}
17718 for @var{mcu}=@code{avrtiny},
17719 @code{avrxmega2}, @code{avrxmega3}, @code{avrxmega4},
17720 @code{avrxmega5}, @code{avrxmega6}, @code{avrxmega7}, respectively.
17721 If @var{mcu} specifies a device, this built-in macro is set
17722 accordingly. For example, with @option{-mmcu=atmega8} the macro is
17723 defined to @code{4}.
17725 @item __AVR_@var{Device}__
17726 Setting @option{-mmcu=@var{device}} defines this built-in macro which reflects
17727 the device's name. For example, @option{-mmcu=atmega8} defines the
17728 built-in macro @code{__AVR_ATmega8__}, @option{-mmcu=attiny261a} defines
17729 @code{__AVR_ATtiny261A__}, etc.
17731 The built-in macros' names follow
17732 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
17733 the device name as from the AVR user manual. The difference between
17734 @var{Device} in the built-in macro and @var{device} in
17735 @option{-mmcu=@var{device}} is that the latter is always lowercase.
17737 If @var{device} is not a device but only a core architecture like
17738 @samp{avr51}, this macro is not defined.
17740 @item __AVR_DEVICE_NAME__
17741 Setting @option{-mmcu=@var{device}} defines this built-in macro to
17742 the device's name. For example, with @option{-mmcu=atmega8} the macro
17743 is defined to @code{atmega8}.
17745 If @var{device} is not a device but only a core architecture like
17746 @samp{avr51}, this macro is not defined.
17748 @item __AVR_XMEGA__
17749 The device / architecture belongs to the XMEGA family of devices.
17751 @item __AVR_HAVE_ELPM__
17752 The device has the @code{ELPM} instruction.
17754 @item __AVR_HAVE_ELPMX__
17755 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
17756 R@var{n},Z+} instructions.
17758 @item __AVR_HAVE_MOVW__
17759 The device has the @code{MOVW} instruction to perform 16-bit
17760 register-register moves.
17762 @item __AVR_HAVE_LPMX__
17763 The device has the @code{LPM R@var{n},Z} and
17764 @code{LPM R@var{n},Z+} instructions.
17766 @item __AVR_HAVE_MUL__
17767 The device has a hardware multiplier. 
17769 @item __AVR_HAVE_JMP_CALL__
17770 The device has the @code{JMP} and @code{CALL} instructions.
17771 This is the case for devices with more than 8@tie{}KiB of program
17772 memory.
17774 @item __AVR_HAVE_EIJMP_EICALL__
17775 @itemx __AVR_3_BYTE_PC__
17776 The device has the @code{EIJMP} and @code{EICALL} instructions.
17777 This is the case for devices with more than 128@tie{}KiB of program memory.
17778 This also means that the program counter
17779 (PC) is 3@tie{}bytes wide.
17781 @item __AVR_2_BYTE_PC__
17782 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
17783 with up to 128@tie{}KiB of program memory.
17785 @item __AVR_HAVE_8BIT_SP__
17786 @itemx __AVR_HAVE_16BIT_SP__
17787 The stack pointer (SP) register is treated as 8-bit respectively
17788 16-bit register by the compiler.
17789 The definition of these macros is affected by @option{-mtiny-stack}.
17791 @item __AVR_HAVE_SPH__
17792 @itemx __AVR_SP8__
17793 The device has the SPH (high part of stack pointer) special function
17794 register or has an 8-bit stack pointer, respectively.
17795 The definition of these macros is affected by @option{-mmcu=} and
17796 in the cases of @option{-mmcu=avr2} and @option{-mmcu=avr25} also
17797 by @option{-msp8}.
17799 @item __AVR_HAVE_RAMPD__
17800 @itemx __AVR_HAVE_RAMPX__
17801 @itemx __AVR_HAVE_RAMPY__
17802 @itemx __AVR_HAVE_RAMPZ__
17803 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
17804 @code{RAMPZ} special function register, respectively.
17806 @item __NO_INTERRUPTS__
17807 This macro reflects the @option{-mno-interrupts} command-line option.
17809 @item __AVR_ERRATA_SKIP__
17810 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
17811 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
17812 instructions because of a hardware erratum.  Skip instructions are
17813 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
17814 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
17815 set.
17817 @item __AVR_ISA_RMW__
17818 The device has Read-Modify-Write instructions (XCH, LAC, LAS and LAT).
17820 @item __AVR_SFR_OFFSET__=@var{offset}
17821 Instructions that can address I/O special function registers directly
17822 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
17823 address as if addressed by an instruction to access RAM like @code{LD}
17824 or @code{STS}. This offset depends on the device architecture and has
17825 to be subtracted from the RAM address in order to get the
17826 respective I/O@tie{}address.
17828 @item __AVR_SHORT_CALLS__
17829 The @option{-mshort-calls} command line option is set.
17831 @item __AVR_PM_BASE_ADDRESS__=@var{addr}
17832 Some devices support reading from flash memory by means of @code{LD*}
17833 instructions.  The flash memory is seen in the data address space
17834 at an offset of @code{__AVR_PM_BASE_ADDRESS__}.  If this macro
17835 is not defined, this feature is not available.  If defined,
17836 the address space is linear and there is no need to put
17837 @code{.rodata} into RAM.  This is handled by the default linker
17838 description file, and is currently available for
17839 @code{avrtiny} and @code{avrxmega3}.  Even more convenient,
17840 there is no need to use address spaces like @code{__flash} or
17841 features like attribute @code{progmem} and @code{pgm_read_*}.
17843 @item __WITH_AVRLIBC__
17844 The compiler is configured to be used together with AVR-Libc.
17845 See the @option{--with-avrlibc} configure option.
17847 @end table
17849 @node Blackfin Options
17850 @subsection Blackfin Options
17851 @cindex Blackfin Options
17853 @table @gcctabopt
17854 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
17855 @opindex mcpu=
17856 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
17857 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
17858 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
17859 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
17860 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
17861 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
17862 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
17863 @samp{bf561}, @samp{bf592}.
17865 The optional @var{sirevision} specifies the silicon revision of the target
17866 Blackfin processor.  Any workarounds available for the targeted silicon revision
17867 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
17868 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
17869 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
17870 hexadecimal digits representing the major and minor numbers in the silicon
17871 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
17872 is not defined.  If @var{sirevision} is @samp{any}, the
17873 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
17874 If this optional @var{sirevision} is not used, GCC assumes the latest known
17875 silicon revision of the targeted Blackfin processor.
17877 GCC defines a preprocessor macro for the specified @var{cpu}.
17878 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
17879 provided by libgloss to be linked in if @option{-msim} is not given.
17881 Without this option, @samp{bf532} is used as the processor by default.
17883 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
17884 only the preprocessor macro is defined.
17886 @item -msim
17887 @opindex msim
17888 Specifies that the program will be run on the simulator.  This causes
17889 the simulator BSP provided by libgloss to be linked in.  This option
17890 has effect only for @samp{bfin-elf} toolchain.
17891 Certain other options, such as @option{-mid-shared-library} and
17892 @option{-mfdpic}, imply @option{-msim}.
17894 @item -momit-leaf-frame-pointer
17895 @opindex momit-leaf-frame-pointer
17896 Don't keep the frame pointer in a register for leaf functions.  This
17897 avoids the instructions to save, set up and restore frame pointers and
17898 makes an extra register available in leaf functions.
17900 @item -mspecld-anomaly
17901 @opindex mspecld-anomaly
17902 When enabled, the compiler ensures that the generated code does not
17903 contain speculative loads after jump instructions. If this option is used,
17904 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
17906 @item -mno-specld-anomaly
17907 @opindex mno-specld-anomaly
17908 @opindex mspecld-anomaly
17909 Don't generate extra code to prevent speculative loads from occurring.
17911 @item -mcsync-anomaly
17912 @opindex mcsync-anomaly
17913 When enabled, the compiler ensures that the generated code does not
17914 contain CSYNC or SSYNC instructions too soon after conditional branches.
17915 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
17917 @item -mno-csync-anomaly
17918 @opindex mno-csync-anomaly
17919 @opindex mcsync-anomaly
17920 Don't generate extra code to prevent CSYNC or SSYNC instructions from
17921 occurring too soon after a conditional branch.
17923 @item -mlow64k
17924 @opindex mlow64k
17925 When enabled, the compiler is free to take advantage of the knowledge that
17926 the entire program fits into the low 64k of memory.
17928 @item -mno-low64k
17929 @opindex mno-low64k
17930 Assume that the program is arbitrarily large.  This is the default.
17932 @item -mstack-check-l1
17933 @opindex mstack-check-l1
17934 Do stack checking using information placed into L1 scratchpad memory by the
17935 uClinux kernel.
17937 @item -mid-shared-library
17938 @opindex mid-shared-library
17939 Generate code that supports shared libraries via the library ID method.
17940 This allows for execute in place and shared libraries in an environment
17941 without virtual memory management.  This option implies @option{-fPIC}.
17942 With a @samp{bfin-elf} target, this option implies @option{-msim}.
17944 @item -mno-id-shared-library
17945 @opindex mno-id-shared-library
17946 @opindex mid-shared-library
17947 Generate code that doesn't assume ID-based shared libraries are being used.
17948 This is the default.
17950 @item -mleaf-id-shared-library
17951 @opindex mleaf-id-shared-library
17952 Generate code that supports shared libraries via the library ID method,
17953 but assumes that this library or executable won't link against any other
17954 ID shared libraries.  That allows the compiler to use faster code for jumps
17955 and calls.
17957 @item -mno-leaf-id-shared-library
17958 @opindex mno-leaf-id-shared-library
17959 @opindex mleaf-id-shared-library
17960 Do not assume that the code being compiled won't link against any ID shared
17961 libraries.  Slower code is generated for jump and call insns.
17963 @item -mshared-library-id=n
17964 @opindex mshared-library-id
17965 Specifies the identification number of the ID-based shared library being
17966 compiled.  Specifying a value of 0 generates more compact code; specifying
17967 other values forces the allocation of that number to the current
17968 library but is no more space- or time-efficient than omitting this option.
17970 @item -msep-data
17971 @opindex msep-data
17972 Generate code that allows the data segment to be located in a different
17973 area of memory from the text segment.  This allows for execute in place in
17974 an environment without virtual memory management by eliminating relocations
17975 against the text section.
17977 @item -mno-sep-data
17978 @opindex mno-sep-data
17979 @opindex msep-data
17980 Generate code that assumes that the data segment follows the text segment.
17981 This is the default.
17983 @item -mlong-calls
17984 @itemx -mno-long-calls
17985 @opindex mlong-calls
17986 @opindex mno-long-calls
17987 Tells the compiler to perform function calls by first loading the
17988 address of the function into a register and then performing a subroutine
17989 call on this register.  This switch is needed if the target function
17990 lies outside of the 24-bit addressing range of the offset-based
17991 version of subroutine call instruction.
17993 This feature is not enabled by default.  Specifying
17994 @option{-mno-long-calls} restores the default behavior.  Note these
17995 switches have no effect on how the compiler generates code to handle
17996 function calls via function pointers.
17998 @item -mfast-fp
17999 @opindex mfast-fp
18000 Link with the fast floating-point library. This library relaxes some of
18001 the IEEE floating-point standard's rules for checking inputs against
18002 Not-a-Number (NAN), in the interest of performance.
18004 @item -minline-plt
18005 @opindex minline-plt
18006 Enable inlining of PLT entries in function calls to functions that are
18007 not known to bind locally.  It has no effect without @option{-mfdpic}.
18009 @item -mmulticore
18010 @opindex mmulticore
18011 Build a standalone application for multicore Blackfin processors. 
18012 This option causes proper start files and link scripts supporting 
18013 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
18014 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
18016 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
18017 selects the one-application-per-core programming model.  Without
18018 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
18019 programming model is used. In this model, the main function of Core B
18020 should be named as @code{coreb_main}.
18022 If this option is not used, the single-core application programming
18023 model is used.
18025 @item -mcorea
18026 @opindex mcorea
18027 Build a standalone application for Core A of BF561 when using
18028 the one-application-per-core programming model. Proper start files
18029 and link scripts are used to support Core A, and the macro
18030 @code{__BFIN_COREA} is defined.
18031 This option can only be used in conjunction with @option{-mmulticore}.
18033 @item -mcoreb
18034 @opindex mcoreb
18035 Build a standalone application for Core B of BF561 when using
18036 the one-application-per-core programming model. Proper start files
18037 and link scripts are used to support Core B, and the macro
18038 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
18039 should be used instead of @code{main}. 
18040 This option can only be used in conjunction with @option{-mmulticore}.
18042 @item -msdram
18043 @opindex msdram
18044 Build a standalone application for SDRAM. Proper start files and
18045 link scripts are used to put the application into SDRAM, and the macro
18046 @code{__BFIN_SDRAM} is defined.
18047 The loader should initialize SDRAM before loading the application.
18049 @item -micplb
18050 @opindex micplb
18051 Assume that ICPLBs are enabled at run time.  This has an effect on certain
18052 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
18053 are enabled; for standalone applications the default is off.
18054 @end table
18056 @node C6X Options
18057 @subsection C6X Options
18058 @cindex C6X Options
18060 @table @gcctabopt
18061 @item -march=@var{name}
18062 @opindex march
18063 This specifies the name of the target architecture.  GCC uses this
18064 name to determine what kind of instructions it can emit when generating
18065 assembly code.  Permissible names are: @samp{c62x},
18066 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
18068 @item -mbig-endian
18069 @opindex mbig-endian
18070 Generate code for a big-endian target.
18072 @item -mlittle-endian
18073 @opindex mlittle-endian
18074 Generate code for a little-endian target.  This is the default.
18076 @item -msim
18077 @opindex msim
18078 Choose startup files and linker script suitable for the simulator.
18080 @item -msdata=default
18081 @opindex msdata=default
18082 Put small global and static data in the @code{.neardata} section,
18083 which is pointed to by register @code{B14}.  Put small uninitialized
18084 global and static data in the @code{.bss} section, which is adjacent
18085 to the @code{.neardata} section.  Put small read-only data into the
18086 @code{.rodata} section.  The corresponding sections used for large
18087 pieces of data are @code{.fardata}, @code{.far} and @code{.const}.
18089 @item -msdata=all
18090 @opindex msdata=all
18091 Put all data, not just small objects, into the sections reserved for
18092 small data, and use addressing relative to the @code{B14} register to
18093 access them.
18095 @item -msdata=none
18096 @opindex msdata=none
18097 Make no use of the sections reserved for small data, and use absolute
18098 addresses to access all data.  Put all initialized global and static
18099 data in the @code{.fardata} section, and all uninitialized data in the
18100 @code{.far} section.  Put all constant data into the @code{.const}
18101 section.
18102 @end table
18104 @node CRIS Options
18105 @subsection CRIS Options
18106 @cindex CRIS Options
18108 These options are defined specifically for the CRIS ports.
18110 @table @gcctabopt
18111 @item -march=@var{architecture-type}
18112 @itemx -mcpu=@var{architecture-type}
18113 @opindex march
18114 @opindex mcpu
18115 Generate code for the specified architecture.  The choices for
18116 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
18117 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
18118 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
18119 @samp{v10}.
18121 @item -mtune=@var{architecture-type}
18122 @opindex mtune
18123 Tune to @var{architecture-type} everything applicable about the generated
18124 code, except for the ABI and the set of available instructions.  The
18125 choices for @var{architecture-type} are the same as for
18126 @option{-march=@var{architecture-type}}.
18128 @item -mmax-stack-frame=@var{n}
18129 @opindex mmax-stack-frame
18130 Warn when the stack frame of a function exceeds @var{n} bytes.
18132 @item -metrax4
18133 @itemx -metrax100
18134 @opindex metrax4
18135 @opindex metrax100
18136 The options @option{-metrax4} and @option{-metrax100} are synonyms for
18137 @option{-march=v3} and @option{-march=v8} respectively.
18139 @item -mmul-bug-workaround
18140 @itemx -mno-mul-bug-workaround
18141 @opindex mmul-bug-workaround
18142 @opindex mno-mul-bug-workaround
18143 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
18144 models where it applies.  This option is active by default.
18146 @item -mpdebug
18147 @opindex mpdebug
18148 Enable CRIS-specific verbose debug-related information in the assembly
18149 code.  This option also has the effect of turning off the @samp{#NO_APP}
18150 formatted-code indicator to the assembler at the beginning of the
18151 assembly file.
18153 @item -mcc-init
18154 @opindex mcc-init
18155 Do not use condition-code results from previous instruction; always emit
18156 compare and test instructions before use of condition codes.
18158 @item -mno-side-effects
18159 @opindex mno-side-effects
18160 @opindex mside-effects
18161 Do not emit instructions with side effects in addressing modes other than
18162 post-increment.
18164 @item -mstack-align
18165 @itemx -mno-stack-align
18166 @itemx -mdata-align
18167 @itemx -mno-data-align
18168 @itemx -mconst-align
18169 @itemx -mno-const-align
18170 @opindex mstack-align
18171 @opindex mno-stack-align
18172 @opindex mdata-align
18173 @opindex mno-data-align
18174 @opindex mconst-align
18175 @opindex mno-const-align
18176 These options (@samp{no-} options) arrange (eliminate arrangements) for the
18177 stack frame, individual data and constants to be aligned for the maximum
18178 single data access size for the chosen CPU model.  The default is to
18179 arrange for 32-bit alignment.  ABI details such as structure layout are
18180 not affected by these options.
18182 @item -m32-bit
18183 @itemx -m16-bit
18184 @itemx -m8-bit
18185 @opindex m32-bit
18186 @opindex m16-bit
18187 @opindex m8-bit
18188 Similar to the stack- data- and const-align options above, these options
18189 arrange for stack frame, writable data and constants to all be 32-bit,
18190 16-bit or 8-bit aligned.  The default is 32-bit alignment.
18192 @item -mno-prologue-epilogue
18193 @itemx -mprologue-epilogue
18194 @opindex mno-prologue-epilogue
18195 @opindex mprologue-epilogue
18196 With @option{-mno-prologue-epilogue}, the normal function prologue and
18197 epilogue which set up the stack frame are omitted and no return
18198 instructions or return sequences are generated in the code.  Use this
18199 option only together with visual inspection of the compiled code: no
18200 warnings or errors are generated when call-saved registers must be saved,
18201 or storage for local variables needs to be allocated.
18203 @item -mno-gotplt
18204 @itemx -mgotplt
18205 @opindex mno-gotplt
18206 @opindex mgotplt
18207 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
18208 instruction sequences that load addresses for functions from the PLT part
18209 of the GOT rather than (traditional on other architectures) calls to the
18210 PLT@.  The default is @option{-mgotplt}.
18212 @item -melf
18213 @opindex melf
18214 Legacy no-op option only recognized with the cris-axis-elf and
18215 cris-axis-linux-gnu targets.
18217 @item -mlinux
18218 @opindex mlinux
18219 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
18221 @item -sim
18222 @opindex sim
18223 This option, recognized for the cris-axis-elf, arranges
18224 to link with input-output functions from a simulator library.  Code,
18225 initialized data and zero-initialized data are allocated consecutively.
18227 @item -sim2
18228 @opindex sim2
18229 Like @option{-sim}, but pass linker options to locate initialized data at
18230 0x40000000 and zero-initialized data at 0x80000000.
18231 @end table
18233 @node CR16 Options
18234 @subsection CR16 Options
18235 @cindex CR16 Options
18237 These options are defined specifically for the CR16 ports.
18239 @table @gcctabopt
18241 @item -mmac
18242 @opindex mmac
18243 Enable the use of multiply-accumulate instructions. Disabled by default.
18245 @item -mcr16cplus
18246 @itemx -mcr16c
18247 @opindex mcr16cplus
18248 @opindex mcr16c
18249 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
18250 is default.
18252 @item -msim
18253 @opindex msim
18254 Links the library libsim.a which is in compatible with simulator. Applicable
18255 to ELF compiler only.
18257 @item -mint32
18258 @opindex mint32
18259 Choose integer type as 32-bit wide.
18261 @item -mbit-ops
18262 @opindex mbit-ops
18263 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
18265 @item -mdata-model=@var{model}
18266 @opindex mdata-model
18267 Choose a data model. The choices for @var{model} are @samp{near},
18268 @samp{far} or @samp{medium}. @samp{medium} is default.
18269 However, @samp{far} is not valid with @option{-mcr16c}, as the
18270 CR16C architecture does not support the far data model.
18271 @end table
18273 @node C-SKY Options
18274 @subsection C-SKY Options
18275 @cindex C-SKY Options
18277 GCC supports these options when compiling for C-SKY V2 processors.
18279 @table @gcctabopt
18281 @item -march=@var{arch}
18282 @opindex march=
18283 Specify the C-SKY target architecture.  Valid values for @var{arch} are:
18284 @samp{ck801}, @samp{ck802}, @samp{ck803}, @samp{ck807}, and @samp{ck810}.
18285 The default is @samp{ck810}.
18287 @item -mcpu=@var{cpu}
18288 @opindex mcpu=
18289 Specify the C-SKY target processor.  Valid values for @var{cpu} are:
18290 @samp{ck801}, @samp{ck801t},
18291 @samp{ck802}, @samp{ck802t}, @samp{ck802j},
18292 @samp{ck803}, @samp{ck803h}, @samp{ck803t}, @samp{ck803ht},
18293 @samp{ck803f}, @samp{ck803fh}, @samp{ck803e}, @samp{ck803eh},
18294 @samp{ck803et}, @samp{ck803eht}, @samp{ck803ef}, @samp{ck803efh},
18295 @samp{ck803ft}, @samp{ck803eft}, @samp{ck803efht}, @samp{ck803r1},
18296 @samp{ck803hr1}, @samp{ck803tr1}, @samp{ck803htr1}, @samp{ck803fr1},
18297 @samp{ck803fhr1}, @samp{ck803er1}, @samp{ck803ehr1}, @samp{ck803etr1},
18298 @samp{ck803ehtr1}, @samp{ck803efr1}, @samp{ck803efhr1}, @samp{ck803ftr1},
18299 @samp{ck803eftr1}, @samp{ck803efhtr1},
18300 @samp{ck803s}, @samp{ck803st}, @samp{ck803se}, @samp{ck803sf},
18301 @samp{ck803sef}, @samp{ck803seft},
18302 @samp{ck807e}, @samp{ck807ef}, @samp{ck807}, @samp{ck807f},
18303 @samp{ck810e}, @samp{ck810et}, @samp{ck810ef}, @samp{ck810eft},
18304 @samp{ck810}, @samp{ck810v}, @samp{ck810f}, @samp{ck810t}, @samp{ck810fv},
18305 @samp{ck810tv}, @samp{ck810ft}, and @samp{ck810ftv}.
18307 @item -mbig-endian
18308 @opindex mbig-endian
18309 @itemx -EB
18310 @opindex EB
18311 @itemx -mlittle-endian
18312 @opindex mlittle-endian
18313 @itemx -EL
18314 @opindex EL
18316 Select big- or little-endian code.  The default is little-endian.
18318 @item -mhard-float
18319 @opindex mhard-float
18320 @itemx -msoft-float
18321 @opindex msoft-float
18323 Select hardware or software floating-point implementations.
18324 The default is soft float.
18326 @item -mdouble-float
18327 @itemx -mno-double-float
18328 @opindex mdouble-float
18329 When @option{-mhard-float} is in effect, enable generation of
18330 double-precision float instructions.  This is the default except
18331 when compiling for CK803.
18333 @item -mfdivdu
18334 @itemx -mno-fdivdu
18335 @opindex mfdivdu
18336 When @option{-mhard-float} is in effect, enable generation of
18337 @code{frecipd}, @code{fsqrtd}, and @code{fdivd} instructions.
18338 This is the default except when compiling for CK803.
18340 @item -mfpu=@var{fpu}
18341 @opindex mfpu=
18342 Select the floating-point processor.  This option can only be used with
18343 @option{-mhard-float}.
18344 Values for @var{fpu} are
18345 @samp{fpv2_sf} (equivalent to @samp{-mno-double-float -mno-fdivdu}),
18346 @samp{fpv2} (@samp{-mdouble-float -mno-divdu}), and
18347 @samp{fpv2_divd} (@samp{-mdouble-float -mdivdu}).
18349 @item -melrw
18350 @itemx -mno-elrw
18351 @opindex melrw
18352 Enable the extended @code{lrw} instruction.  This option defaults to on
18353 for CK801 and off otherwise.
18355 @item -mistack
18356 @itemx -mno-istack
18357 @opindex mistack
18358 Enable interrupt stack instructions; the default is off.
18360 The @option{-mistack} option is required to handle the
18361 @code{interrupt} and @code{isr} function attributes
18362 (@pxref{C-SKY Function Attributes}).
18364 @item -mmp
18365 @opindex mmp
18366 Enable multiprocessor instructions; the default is off.
18368 @item -mcp
18369 @opindex mcp
18370 Enable coprocessor instructions; the default is off.
18372 @item -mcache
18373 @opindex mcache
18374 Enable coprocessor instructions; the default is off.
18376 @item -msecurity
18377 @opindex msecurity
18378 Enable C-SKY security instructions; the default is off.
18380 @item -mtrust
18381 @opindex mtrust
18382 Enable C-SKY trust instructions; the default is off.
18384 @item -mdsp
18385 @opindex mdsp
18386 @itemx -medsp
18387 @opindex medsp
18388 @itemx -mvdsp
18389 @opindex mvdsp
18390 Enable C-SKY DSP, Enhanced DSP, or Vector DSP instructions, respectively.
18391 All of these options default to off.
18393 @item -mdiv
18394 @itemx -mno-div
18395 @opindex mdiv
18396 Generate divide instructions.  Default is off.
18398 @item -msmart
18399 @itemx -mno-smart
18400 @opindex msmart
18401 Generate code for Smart Mode, using only registers numbered 0-7 to allow
18402 use of 16-bit instructions.  This option is ignored for CK801 where this
18403 is the required behavior, and it defaults to on for CK802.
18404 For other targets, the default is off.
18406 @item -mhigh-registers
18407 @itemx -mno-high-registers
18408 @opindex mhigh-registers
18409 Generate code using the high registers numbered 16-31.  This option
18410 is not supported on CK801, CK802, or CK803, and is enabled by default
18411 for other processors.
18413 @item -manchor
18414 @itemx -mno-anchor
18415 @opindex manchor
18416 Generate code using global anchor symbol addresses.
18418 @item -mpushpop
18419 @itemx -mno-pushpop
18420 @opindex mpushpop
18421 Generate code using @code{push} and @code{pop} instructions.  This option
18422 defaults to on.
18424 @item -mmultiple-stld
18425 @itemx -mstm
18426 @itemx -mno-multiple-stld
18427 @itemx -mno-stm
18428 @opindex mmultiple-stld
18429 Generate code using @code{stm} and @code{ldm} instructions.  This option
18430 isn't supported on CK801 but is enabled by default on other processors.
18432 @item -mconstpool
18433 @itemx -mno-constpool
18434 @opindex mconstpool
18435 Create constant pools in the compiler instead of deferring it to the
18436 assembler.  This option is the default and required for correct code
18437 generation on CK801 and CK802, and is optional on other processors.
18439 @item -mstack-size
18440 @item -mno-stack-size
18441 @opindex mstack-size
18442 Emit @code{.stack_size} directives for each function in the assembly
18443 output.  This option defaults to off.
18445 @item -mccrt
18446 @itemx -mno-ccrt
18447 @opindex mccrt
18448 Generate code for the C-SKY compiler runtime instead of libgcc.  This
18449 option defaults to off.
18451 @item -mbranch-cost=@var{n}
18452 @opindex mbranch-cost=
18453 Set the branch costs to roughly @code{n} instructions.  The default is 1.
18455 @item -msched-prolog
18456 @itemx -mno-sched-prolog
18457 @opindex msched-prolog
18458 Permit scheduling of function prologue and epilogue sequences.  Using
18459 this option can result in code that is not compliant with the C-SKY V2 ABI
18460 prologue requirements and that cannot be debugged or backtraced.
18461 It is disabled by default.
18463 @end table
18465 @node Darwin Options
18466 @subsection Darwin Options
18467 @cindex Darwin options
18469 These options are defined for all architectures running the Darwin operating
18470 system.
18472 FSF GCC on Darwin does not create ``fat'' object files; it creates
18473 an object file for the single architecture that GCC was built to
18474 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
18475 @option{-arch} options are used; it does so by running the compiler or
18476 linker multiple times and joining the results together with
18477 @file{lipo}.
18479 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
18480 @samp{i686}) is determined by the flags that specify the ISA
18481 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
18482 @option{-force_cpusubtype_ALL} option can be used to override this.
18484 The Darwin tools vary in their behavior when presented with an ISA
18485 mismatch.  The assembler, @file{as}, only permits instructions to
18486 be used that are valid for the subtype of the file it is generating,
18487 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
18488 The linker for shared libraries, @file{/usr/bin/libtool}, fails
18489 and prints an error if asked to create a shared library with a less
18490 restrictive subtype than its input files (for instance, trying to put
18491 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
18492 for executables, @command{ld}, quietly gives the executable the most
18493 restrictive subtype of any of its input files.
18495 @table @gcctabopt
18496 @item -F@var{dir}
18497 @opindex F
18498 Add the framework directory @var{dir} to the head of the list of
18499 directories to be searched for header files.  These directories are
18500 interleaved with those specified by @option{-I} options and are
18501 scanned in a left-to-right order.
18503 A framework directory is a directory with frameworks in it.  A
18504 framework is a directory with a @file{Headers} and/or
18505 @file{PrivateHeaders} directory contained directly in it that ends
18506 in @file{.framework}.  The name of a framework is the name of this
18507 directory excluding the @file{.framework}.  Headers associated with
18508 the framework are found in one of those two directories, with
18509 @file{Headers} being searched first.  A subframework is a framework
18510 directory that is in a framework's @file{Frameworks} directory.
18511 Includes of subframework headers can only appear in a header of a
18512 framework that contains the subframework, or in a sibling subframework
18513 header.  Two subframeworks are siblings if they occur in the same
18514 framework.  A subframework should not have the same name as a
18515 framework; a warning is issued if this is violated.  Currently a
18516 subframework cannot have subframeworks; in the future, the mechanism
18517 may be extended to support this.  The standard frameworks can be found
18518 in @file{/System/Library/Frameworks} and
18519 @file{/Library/Frameworks}.  An example include looks like
18520 @code{#include <Framework/header.h>}, where @file{Framework} denotes
18521 the name of the framework and @file{header.h} is found in the
18522 @file{PrivateHeaders} or @file{Headers} directory.
18524 @item -iframework@var{dir}
18525 @opindex iframework
18526 Like @option{-F} except the directory is a treated as a system
18527 directory.  The main difference between this @option{-iframework} and
18528 @option{-F} is that with @option{-iframework} the compiler does not
18529 warn about constructs contained within header files found via
18530 @var{dir}.  This option is valid only for the C family of languages.
18532 @item -gused
18533 @opindex gused
18534 Emit debugging information for symbols that are used.  For stabs
18535 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
18536 This is by default ON@.
18538 @item -gfull
18539 @opindex gfull
18540 Emit debugging information for all symbols and types.
18542 @item -mmacosx-version-min=@var{version}
18543 The earliest version of MacOS X that this executable will run on
18544 is @var{version}.  Typical values of @var{version} include @code{10.1},
18545 @code{10.2}, and @code{10.3.9}.
18547 If the compiler was built to use the system's headers by default,
18548 then the default for this option is the system version on which the
18549 compiler is running, otherwise the default is to make choices that
18550 are compatible with as many systems and code bases as possible.
18552 @item -mkernel
18553 @opindex mkernel
18554 Enable kernel development mode.  The @option{-mkernel} option sets
18555 @option{-static}, @option{-fno-common}, @option{-fno-use-cxa-atexit},
18556 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
18557 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
18558 applicable.  This mode also sets @option{-mno-altivec},
18559 @option{-msoft-float}, @option{-fno-builtin} and
18560 @option{-mlong-branch} for PowerPC targets.
18562 @item -mone-byte-bool
18563 @opindex mone-byte-bool
18564 Override the defaults for @code{bool} so that @code{sizeof(bool)==1}.
18565 By default @code{sizeof(bool)} is @code{4} when compiling for
18566 Darwin/PowerPC and @code{1} when compiling for Darwin/x86, so this
18567 option has no effect on x86.
18569 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
18570 to generate code that is not binary compatible with code generated
18571 without that switch.  Using this switch may require recompiling all
18572 other modules in a program, including system libraries.  Use this
18573 switch to conform to a non-default data model.
18575 @item -mfix-and-continue
18576 @itemx -ffix-and-continue
18577 @itemx -findirect-data
18578 @opindex mfix-and-continue
18579 @opindex ffix-and-continue
18580 @opindex findirect-data
18581 Generate code suitable for fast turnaround development, such as to
18582 allow GDB to dynamically load @file{.o} files into already-running
18583 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
18584 are provided for backwards compatibility.
18586 @item -all_load
18587 @opindex all_load
18588 Loads all members of static archive libraries.
18589 See man ld(1) for more information.
18591 @item -arch_errors_fatal
18592 @opindex arch_errors_fatal
18593 Cause the errors having to do with files that have the wrong architecture
18594 to be fatal.
18596 @item -bind_at_load
18597 @opindex bind_at_load
18598 Causes the output file to be marked such that the dynamic linker will
18599 bind all undefined references when the file is loaded or launched.
18601 @item -bundle
18602 @opindex bundle
18603 Produce a Mach-o bundle format file.
18604 See man ld(1) for more information.
18606 @item -bundle_loader @var{executable}
18607 @opindex bundle_loader
18608 This option specifies the @var{executable} that will load the build
18609 output file being linked.  See man ld(1) for more information.
18611 @item -dynamiclib
18612 @opindex dynamiclib
18613 When passed this option, GCC produces a dynamic library instead of
18614 an executable when linking, using the Darwin @file{libtool} command.
18616 @item -force_cpusubtype_ALL
18617 @opindex force_cpusubtype_ALL
18618 This causes GCC's output file to have the @samp{ALL} subtype, instead of
18619 one controlled by the @option{-mcpu} or @option{-march} option.
18621 @item -allowable_client  @var{client_name}
18622 @itemx -client_name
18623 @itemx -compatibility_version
18624 @itemx -current_version
18625 @itemx -dead_strip
18626 @itemx -dependency-file
18627 @itemx -dylib_file
18628 @itemx -dylinker_install_name
18629 @itemx -dynamic
18630 @itemx -exported_symbols_list
18631 @itemx -filelist
18632 @need 800
18633 @itemx -flat_namespace
18634 @itemx -force_flat_namespace
18635 @itemx -headerpad_max_install_names
18636 @itemx -image_base
18637 @itemx -init
18638 @itemx -install_name
18639 @itemx -keep_private_externs
18640 @itemx -multi_module
18641 @itemx -multiply_defined
18642 @itemx -multiply_defined_unused
18643 @need 800
18644 @itemx -noall_load
18645 @itemx -no_dead_strip_inits_and_terms
18646 @itemx -nofixprebinding
18647 @itemx -nomultidefs
18648 @itemx -noprebind
18649 @itemx -noseglinkedit
18650 @itemx -pagezero_size
18651 @itemx -prebind
18652 @itemx -prebind_all_twolevel_modules
18653 @itemx -private_bundle
18654 @need 800
18655 @itemx -read_only_relocs
18656 @itemx -sectalign
18657 @itemx -sectobjectsymbols
18658 @itemx -whyload
18659 @itemx -seg1addr
18660 @itemx -sectcreate
18661 @itemx -sectobjectsymbols
18662 @itemx -sectorder
18663 @itemx -segaddr
18664 @itemx -segs_read_only_addr
18665 @need 800
18666 @itemx -segs_read_write_addr
18667 @itemx -seg_addr_table
18668 @itemx -seg_addr_table_filename
18669 @itemx -seglinkedit
18670 @itemx -segprot
18671 @itemx -segs_read_only_addr
18672 @itemx -segs_read_write_addr
18673 @itemx -single_module
18674 @itemx -static
18675 @itemx -sub_library
18676 @need 800
18677 @itemx -sub_umbrella
18678 @itemx -twolevel_namespace
18679 @itemx -umbrella
18680 @itemx -undefined
18681 @itemx -unexported_symbols_list
18682 @itemx -weak_reference_mismatches
18683 @itemx -whatsloaded
18684 @opindex allowable_client
18685 @opindex client_name
18686 @opindex compatibility_version
18687 @opindex current_version
18688 @opindex dead_strip
18689 @opindex dependency-file
18690 @opindex dylib_file
18691 @opindex dylinker_install_name
18692 @opindex dynamic
18693 @opindex exported_symbols_list
18694 @opindex filelist
18695 @opindex flat_namespace
18696 @opindex force_flat_namespace
18697 @opindex headerpad_max_install_names
18698 @opindex image_base
18699 @opindex init
18700 @opindex install_name
18701 @opindex keep_private_externs
18702 @opindex multi_module
18703 @opindex multiply_defined
18704 @opindex multiply_defined_unused
18705 @opindex noall_load
18706 @opindex no_dead_strip_inits_and_terms
18707 @opindex nofixprebinding
18708 @opindex nomultidefs
18709 @opindex noprebind
18710 @opindex noseglinkedit
18711 @opindex pagezero_size
18712 @opindex prebind
18713 @opindex prebind_all_twolevel_modules
18714 @opindex private_bundle
18715 @opindex read_only_relocs
18716 @opindex sectalign
18717 @opindex sectobjectsymbols
18718 @opindex whyload
18719 @opindex seg1addr
18720 @opindex sectcreate
18721 @opindex sectobjectsymbols
18722 @opindex sectorder
18723 @opindex segaddr
18724 @opindex segs_read_only_addr
18725 @opindex segs_read_write_addr
18726 @opindex seg_addr_table
18727 @opindex seg_addr_table_filename
18728 @opindex seglinkedit
18729 @opindex segprot
18730 @opindex segs_read_only_addr
18731 @opindex segs_read_write_addr
18732 @opindex single_module
18733 @opindex static
18734 @opindex sub_library
18735 @opindex sub_umbrella
18736 @opindex twolevel_namespace
18737 @opindex umbrella
18738 @opindex undefined
18739 @opindex unexported_symbols_list
18740 @opindex weak_reference_mismatches
18741 @opindex whatsloaded
18742 These options are passed to the Darwin linker.  The Darwin linker man page
18743 describes them in detail.
18744 @end table
18746 @node DEC Alpha Options
18747 @subsection DEC Alpha Options
18749 These @samp{-m} options are defined for the DEC Alpha implementations:
18751 @table @gcctabopt
18752 @item -mno-soft-float
18753 @itemx -msoft-float
18754 @opindex mno-soft-float
18755 @opindex msoft-float
18756 Use (do not use) the hardware floating-point instructions for
18757 floating-point operations.  When @option{-msoft-float} is specified,
18758 functions in @file{libgcc.a} are used to perform floating-point
18759 operations.  Unless they are replaced by routines that emulate the
18760 floating-point operations, or compiled in such a way as to call such
18761 emulations routines, these routines issue floating-point
18762 operations.   If you are compiling for an Alpha without floating-point
18763 operations, you must ensure that the library is built so as not to call
18764 them.
18766 Note that Alpha implementations without floating-point operations are
18767 required to have floating-point registers.
18769 @item -mfp-reg
18770 @itemx -mno-fp-regs
18771 @opindex mfp-reg
18772 @opindex mno-fp-regs
18773 Generate code that uses (does not use) the floating-point register set.
18774 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
18775 register set is not used, floating-point operands are passed in integer
18776 registers as if they were integers and floating-point results are passed
18777 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
18778 so any function with a floating-point argument or return value called by code
18779 compiled with @option{-mno-fp-regs} must also be compiled with that
18780 option.
18782 A typical use of this option is building a kernel that does not use,
18783 and hence need not save and restore, any floating-point registers.
18785 @item -mieee
18786 @opindex mieee
18787 The Alpha architecture implements floating-point hardware optimized for
18788 maximum performance.  It is mostly compliant with the IEEE floating-point
18789 standard.  However, for full compliance, software assistance is
18790 required.  This option generates code fully IEEE-compliant code
18791 @emph{except} that the @var{inexact-flag} is not maintained (see below).
18792 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
18793 defined during compilation.  The resulting code is less efficient but is
18794 able to correctly support denormalized numbers and exceptional IEEE
18795 values such as not-a-number and plus/minus infinity.  Other Alpha
18796 compilers call this option @option{-ieee_with_no_inexact}.
18798 @item -mieee-with-inexact
18799 @opindex mieee-with-inexact
18800 This is like @option{-mieee} except the generated code also maintains
18801 the IEEE @var{inexact-flag}.  Turning on this option causes the
18802 generated code to implement fully-compliant IEEE math.  In addition to
18803 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
18804 macro.  On some Alpha implementations the resulting code may execute
18805 significantly slower than the code generated by default.  Since there is
18806 very little code that depends on the @var{inexact-flag}, you should
18807 normally not specify this option.  Other Alpha compilers call this
18808 option @option{-ieee_with_inexact}.
18810 @item -mfp-trap-mode=@var{trap-mode}
18811 @opindex mfp-trap-mode
18812 This option controls what floating-point related traps are enabled.
18813 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
18814 The trap mode can be set to one of four values:
18816 @table @samp
18817 @item n
18818 This is the default (normal) setting.  The only traps that are enabled
18819 are the ones that cannot be disabled in software (e.g., division by zero
18820 trap).
18822 @item u
18823 In addition to the traps enabled by @samp{n}, underflow traps are enabled
18824 as well.
18826 @item su
18827 Like @samp{u}, but the instructions are marked to be safe for software
18828 completion (see Alpha architecture manual for details).
18830 @item sui
18831 Like @samp{su}, but inexact traps are enabled as well.
18832 @end table
18834 @item -mfp-rounding-mode=@var{rounding-mode}
18835 @opindex mfp-rounding-mode
18836 Selects the IEEE rounding mode.  Other Alpha compilers call this option
18837 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
18840 @table @samp
18841 @item n
18842 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
18843 the nearest machine number or towards the even machine number in case
18844 of a tie.
18846 @item m
18847 Round towards minus infinity.
18849 @item c
18850 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
18852 @item d
18853 Dynamic rounding mode.  A field in the floating-point control register
18854 (@var{fpcr}, see Alpha architecture reference manual) controls the
18855 rounding mode in effect.  The C library initializes this register for
18856 rounding towards plus infinity.  Thus, unless your program modifies the
18857 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
18858 @end table
18860 @item -mtrap-precision=@var{trap-precision}
18861 @opindex mtrap-precision
18862 In the Alpha architecture, floating-point traps are imprecise.  This
18863 means without software assistance it is impossible to recover from a
18864 floating trap and program execution normally needs to be terminated.
18865 GCC can generate code that can assist operating system trap handlers
18866 in determining the exact location that caused a floating-point trap.
18867 Depending on the requirements of an application, different levels of
18868 precisions can be selected:
18870 @table @samp
18871 @item p
18872 Program precision.  This option is the default and means a trap handler
18873 can only identify which program caused a floating-point exception.
18875 @item f
18876 Function precision.  The trap handler can determine the function that
18877 caused a floating-point exception.
18879 @item i
18880 Instruction precision.  The trap handler can determine the exact
18881 instruction that caused a floating-point exception.
18882 @end table
18884 Other Alpha compilers provide the equivalent options called
18885 @option{-scope_safe} and @option{-resumption_safe}.
18887 @item -mieee-conformant
18888 @opindex mieee-conformant
18889 This option marks the generated code as IEEE conformant.  You must not
18890 use this option unless you also specify @option{-mtrap-precision=i} and either
18891 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
18892 is to emit the line @samp{.eflag 48} in the function prologue of the
18893 generated assembly file.
18895 @item -mbuild-constants
18896 @opindex mbuild-constants
18897 Normally GCC examines a 32- or 64-bit integer constant to
18898 see if it can construct it from smaller constants in two or three
18899 instructions.  If it cannot, it outputs the constant as a literal and
18900 generates code to load it from the data segment at run time.
18902 Use this option to require GCC to construct @emph{all} integer constants
18903 using code, even if it takes more instructions (the maximum is six).
18905 You typically use this option to build a shared library dynamic
18906 loader.  Itself a shared library, it must relocate itself in memory
18907 before it can find the variables and constants in its own data segment.
18909 @item -mbwx
18910 @itemx -mno-bwx
18911 @itemx -mcix
18912 @itemx -mno-cix
18913 @itemx -mfix
18914 @itemx -mno-fix
18915 @itemx -mmax
18916 @itemx -mno-max
18917 @opindex mbwx
18918 @opindex mno-bwx
18919 @opindex mcix
18920 @opindex mno-cix
18921 @opindex mfix
18922 @opindex mno-fix
18923 @opindex mmax
18924 @opindex mno-max
18925 Indicate whether GCC should generate code to use the optional BWX,
18926 CIX, FIX and MAX instruction sets.  The default is to use the instruction
18927 sets supported by the CPU type specified via @option{-mcpu=} option or that
18928 of the CPU on which GCC was built if none is specified.
18930 @item -mfloat-vax
18931 @itemx -mfloat-ieee
18932 @opindex mfloat-vax
18933 @opindex mfloat-ieee
18934 Generate code that uses (does not use) VAX F and G floating-point
18935 arithmetic instead of IEEE single and double precision.
18937 @item -mexplicit-relocs
18938 @itemx -mno-explicit-relocs
18939 @opindex mexplicit-relocs
18940 @opindex mno-explicit-relocs
18941 Older Alpha assemblers provided no way to generate symbol relocations
18942 except via assembler macros.  Use of these macros does not allow
18943 optimal instruction scheduling.  GNU binutils as of version 2.12
18944 supports a new syntax that allows the compiler to explicitly mark
18945 which relocations should apply to which instructions.  This option
18946 is mostly useful for debugging, as GCC detects the capabilities of
18947 the assembler when it is built and sets the default accordingly.
18949 @item -msmall-data
18950 @itemx -mlarge-data
18951 @opindex msmall-data
18952 @opindex mlarge-data
18953 When @option{-mexplicit-relocs} is in effect, static data is
18954 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
18955 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
18956 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
18957 16-bit relocations off of the @code{$gp} register.  This limits the
18958 size of the small data area to 64KB, but allows the variables to be
18959 directly accessed via a single instruction.
18961 The default is @option{-mlarge-data}.  With this option the data area
18962 is limited to just below 2GB@.  Programs that require more than 2GB of
18963 data must use @code{malloc} or @code{mmap} to allocate the data in the
18964 heap instead of in the program's data segment.
18966 When generating code for shared libraries, @option{-fpic} implies
18967 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
18969 @item -msmall-text
18970 @itemx -mlarge-text
18971 @opindex msmall-text
18972 @opindex mlarge-text
18973 When @option{-msmall-text} is used, the compiler assumes that the
18974 code of the entire program (or shared library) fits in 4MB, and is
18975 thus reachable with a branch instruction.  When @option{-msmall-data}
18976 is used, the compiler can assume that all local symbols share the
18977 same @code{$gp} value, and thus reduce the number of instructions
18978 required for a function call from 4 to 1.
18980 The default is @option{-mlarge-text}.
18982 @item -mcpu=@var{cpu_type}
18983 @opindex mcpu
18984 Set the instruction set and instruction scheduling parameters for
18985 machine type @var{cpu_type}.  You can specify either the @samp{EV}
18986 style name or the corresponding chip number.  GCC supports scheduling
18987 parameters for the EV4, EV5 and EV6 family of processors and
18988 chooses the default values for the instruction set from the processor
18989 you specify.  If you do not specify a processor type, GCC defaults
18990 to the processor on which the compiler was built.
18992 Supported values for @var{cpu_type} are
18994 @table @samp
18995 @item ev4
18996 @itemx ev45
18997 @itemx 21064
18998 Schedules as an EV4 and has no instruction set extensions.
19000 @item ev5
19001 @itemx 21164
19002 Schedules as an EV5 and has no instruction set extensions.
19004 @item ev56
19005 @itemx 21164a
19006 Schedules as an EV5 and supports the BWX extension.
19008 @item pca56
19009 @itemx 21164pc
19010 @itemx 21164PC
19011 Schedules as an EV5 and supports the BWX and MAX extensions.
19013 @item ev6
19014 @itemx 21264
19015 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
19017 @item ev67
19018 @itemx 21264a
19019 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
19020 @end table
19022 Native toolchains also support the value @samp{native},
19023 which selects the best architecture option for the host processor.
19024 @option{-mcpu=native} has no effect if GCC does not recognize
19025 the processor.
19027 @item -mtune=@var{cpu_type}
19028 @opindex mtune
19029 Set only the instruction scheduling parameters for machine type
19030 @var{cpu_type}.  The instruction set is not changed.
19032 Native toolchains also support the value @samp{native},
19033 which selects the best architecture option for the host processor.
19034 @option{-mtune=native} has no effect if GCC does not recognize
19035 the processor.
19037 @item -mmemory-latency=@var{time}
19038 @opindex mmemory-latency
19039 Sets the latency the scheduler should assume for typical memory
19040 references as seen by the application.  This number is highly
19041 dependent on the memory access patterns used by the application
19042 and the size of the external cache on the machine.
19044 Valid options for @var{time} are
19046 @table @samp
19047 @item @var{number}
19048 A decimal number representing clock cycles.
19050 @item L1
19051 @itemx L2
19052 @itemx L3
19053 @itemx main
19054 The compiler contains estimates of the number of clock cycles for
19055 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
19056 (also called Dcache, Scache, and Bcache), as well as to main memory.
19057 Note that L3 is only valid for EV5.
19059 @end table
19060 @end table
19062 @node FR30 Options
19063 @subsection FR30 Options
19064 @cindex FR30 Options
19066 These options are defined specifically for the FR30 port.
19068 @table @gcctabopt
19070 @item -msmall-model
19071 @opindex msmall-model
19072 Use the small address space model.  This can produce smaller code, but
19073 it does assume that all symbolic values and addresses fit into a
19074 20-bit range.
19076 @item -mno-lsim
19077 @opindex mno-lsim
19078 Assume that runtime support has been provided and so there is no need
19079 to include the simulator library (@file{libsim.a}) on the linker
19080 command line.
19082 @end table
19084 @node FT32 Options
19085 @subsection FT32 Options
19086 @cindex FT32 Options
19088 These options are defined specifically for the FT32 port.
19090 @table @gcctabopt
19092 @item -msim
19093 @opindex msim
19094 Specifies that the program will be run on the simulator.  This causes
19095 an alternate runtime startup and library to be linked.
19096 You must not use this option when generating programs that will run on
19097 real hardware; you must provide your own runtime library for whatever
19098 I/O functions are needed.
19100 @item -mlra
19101 @opindex mlra
19102 Enable Local Register Allocation.  This is still experimental for FT32,
19103 so by default the compiler uses standard reload.
19105 @item -mnodiv
19106 @opindex mnodiv
19107 Do not use div and mod instructions.
19109 @item -mft32b
19110 @opindex mft32b
19111 Enable use of the extended instructions of the FT32B processor.
19113 @item -mcompress
19114 @opindex mcompress
19115 Compress all code using the Ft32B code compression scheme.
19117 @item -mnopm
19118 @opindex  mnopm
19119 Do not generate code that reads program memory.
19121 @end table
19123 @node FRV Options
19124 @subsection FRV Options
19125 @cindex FRV Options
19127 @table @gcctabopt
19128 @item -mgpr-32
19129 @opindex mgpr-32
19131 Only use the first 32 general-purpose registers.
19133 @item -mgpr-64
19134 @opindex mgpr-64
19136 Use all 64 general-purpose registers.
19138 @item -mfpr-32
19139 @opindex mfpr-32
19141 Use only the first 32 floating-point registers.
19143 @item -mfpr-64
19144 @opindex mfpr-64
19146 Use all 64 floating-point registers.
19148 @item -mhard-float
19149 @opindex mhard-float
19151 Use hardware instructions for floating-point operations.
19153 @item -msoft-float
19154 @opindex msoft-float
19156 Use library routines for floating-point operations.
19158 @item -malloc-cc
19159 @opindex malloc-cc
19161 Dynamically allocate condition code registers.
19163 @item -mfixed-cc
19164 @opindex mfixed-cc
19166 Do not try to dynamically allocate condition code registers, only
19167 use @code{icc0} and @code{fcc0}.
19169 @item -mdword
19170 @opindex mdword
19172 Change ABI to use double word insns.
19174 @item -mno-dword
19175 @opindex mno-dword
19176 @opindex mdword
19178 Do not use double word instructions.
19180 @item -mdouble
19181 @opindex mdouble
19183 Use floating-point double instructions.
19185 @item -mno-double
19186 @opindex mno-double
19188 Do not use floating-point double instructions.
19190 @item -mmedia
19191 @opindex mmedia
19193 Use media instructions.
19195 @item -mno-media
19196 @opindex mno-media
19198 Do not use media instructions.
19200 @item -mmuladd
19201 @opindex mmuladd
19203 Use multiply and add/subtract instructions.
19205 @item -mno-muladd
19206 @opindex mno-muladd
19208 Do not use multiply and add/subtract instructions.
19210 @item -mfdpic
19211 @opindex mfdpic
19213 Select the FDPIC ABI, which uses function descriptors to represent
19214 pointers to functions.  Without any PIC/PIE-related options, it
19215 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
19216 assumes GOT entries and small data are within a 12-bit range from the
19217 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
19218 are computed with 32 bits.
19219 With a @samp{bfin-elf} target, this option implies @option{-msim}.
19221 @item -minline-plt
19222 @opindex minline-plt
19224 Enable inlining of PLT entries in function calls to functions that are
19225 not known to bind locally.  It has no effect without @option{-mfdpic}.
19226 It's enabled by default if optimizing for speed and compiling for
19227 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
19228 optimization option such as @option{-O3} or above is present in the
19229 command line.
19231 @item -mTLS
19232 @opindex mTLS
19234 Assume a large TLS segment when generating thread-local code.
19236 @item -mtls
19237 @opindex mtls
19239 Do not assume a large TLS segment when generating thread-local code.
19241 @item -mgprel-ro
19242 @opindex mgprel-ro
19244 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
19245 that is known to be in read-only sections.  It's enabled by default,
19246 except for @option{-fpic} or @option{-fpie}: even though it may help
19247 make the global offset table smaller, it trades 1 instruction for 4.
19248 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
19249 one of which may be shared by multiple symbols, and it avoids the need
19250 for a GOT entry for the referenced symbol, so it's more likely to be a
19251 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
19253 @item -multilib-library-pic
19254 @opindex multilib-library-pic
19256 Link with the (library, not FD) pic libraries.  It's implied by
19257 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
19258 @option{-fpic} without @option{-mfdpic}.  You should never have to use
19259 it explicitly.
19261 @item -mlinked-fp
19262 @opindex mlinked-fp
19264 Follow the EABI requirement of always creating a frame pointer whenever
19265 a stack frame is allocated.  This option is enabled by default and can
19266 be disabled with @option{-mno-linked-fp}.
19268 @item -mlong-calls
19269 @opindex mlong-calls
19271 Use indirect addressing to call functions outside the current
19272 compilation unit.  This allows the functions to be placed anywhere
19273 within the 32-bit address space.
19275 @item -malign-labels
19276 @opindex malign-labels
19278 Try to align labels to an 8-byte boundary by inserting NOPs into the
19279 previous packet.  This option only has an effect when VLIW packing
19280 is enabled.  It doesn't create new packets; it merely adds NOPs to
19281 existing ones.
19283 @item -mlibrary-pic
19284 @opindex mlibrary-pic
19286 Generate position-independent EABI code.
19288 @item -macc-4
19289 @opindex macc-4
19291 Use only the first four media accumulator registers.
19293 @item -macc-8
19294 @opindex macc-8
19296 Use all eight media accumulator registers.
19298 @item -mpack
19299 @opindex mpack
19301 Pack VLIW instructions.
19303 @item -mno-pack
19304 @opindex mno-pack
19306 Do not pack VLIW instructions.
19308 @item -mno-eflags
19309 @opindex mno-eflags
19311 Do not mark ABI switches in e_flags.
19313 @item -mcond-move
19314 @opindex mcond-move
19316 Enable the use of conditional-move instructions (default).
19318 This switch is mainly for debugging the compiler and will likely be removed
19319 in a future version.
19321 @item -mno-cond-move
19322 @opindex mno-cond-move
19324 Disable the use of conditional-move instructions.
19326 This switch is mainly for debugging the compiler and will likely be removed
19327 in a future version.
19329 @item -mscc
19330 @opindex mscc
19332 Enable the use of conditional set instructions (default).
19334 This switch is mainly for debugging the compiler and will likely be removed
19335 in a future version.
19337 @item -mno-scc
19338 @opindex mno-scc
19340 Disable the use of conditional set instructions.
19342 This switch is mainly for debugging the compiler and will likely be removed
19343 in a future version.
19345 @item -mcond-exec
19346 @opindex mcond-exec
19348 Enable the use of conditional execution (default).
19350 This switch is mainly for debugging the compiler and will likely be removed
19351 in a future version.
19353 @item -mno-cond-exec
19354 @opindex mno-cond-exec
19356 Disable the use of conditional execution.
19358 This switch is mainly for debugging the compiler and will likely be removed
19359 in a future version.
19361 @item -mvliw-branch
19362 @opindex mvliw-branch
19364 Run a pass to pack branches into VLIW instructions (default).
19366 This switch is mainly for debugging the compiler and will likely be removed
19367 in a future version.
19369 @item -mno-vliw-branch
19370 @opindex mno-vliw-branch
19372 Do not run a pass to pack branches into VLIW instructions.
19374 This switch is mainly for debugging the compiler and will likely be removed
19375 in a future version.
19377 @item -mmulti-cond-exec
19378 @opindex mmulti-cond-exec
19380 Enable optimization of @code{&&} and @code{||} in conditional execution
19381 (default).
19383 This switch is mainly for debugging the compiler and will likely be removed
19384 in a future version.
19386 @item -mno-multi-cond-exec
19387 @opindex mno-multi-cond-exec
19389 Disable optimization of @code{&&} and @code{||} in conditional execution.
19391 This switch is mainly for debugging the compiler and will likely be removed
19392 in a future version.
19394 @item -mnested-cond-exec
19395 @opindex mnested-cond-exec
19397 Enable nested conditional execution optimizations (default).
19399 This switch is mainly for debugging the compiler and will likely be removed
19400 in a future version.
19402 @item -mno-nested-cond-exec
19403 @opindex mno-nested-cond-exec
19405 Disable nested conditional execution optimizations.
19407 This switch is mainly for debugging the compiler and will likely be removed
19408 in a future version.
19410 @item -moptimize-membar
19411 @opindex moptimize-membar
19413 This switch removes redundant @code{membar} instructions from the
19414 compiler-generated code.  It is enabled by default.
19416 @item -mno-optimize-membar
19417 @opindex mno-optimize-membar
19418 @opindex moptimize-membar
19420 This switch disables the automatic removal of redundant @code{membar}
19421 instructions from the generated code.
19423 @item -mtomcat-stats
19424 @opindex mtomcat-stats
19426 Cause gas to print out tomcat statistics.
19428 @item -mcpu=@var{cpu}
19429 @opindex mcpu
19431 Select the processor type for which to generate code.  Possible values are
19432 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
19433 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
19435 @end table
19437 @node GNU/Linux Options
19438 @subsection GNU/Linux Options
19440 These @samp{-m} options are defined for GNU/Linux targets:
19442 @table @gcctabopt
19443 @item -mglibc
19444 @opindex mglibc
19445 Use the GNU C library.  This is the default except
19446 on @samp{*-*-linux-*uclibc*}, @samp{*-*-linux-*musl*} and
19447 @samp{*-*-linux-*android*} targets.
19449 @item -muclibc
19450 @opindex muclibc
19451 Use uClibc C library.  This is the default on
19452 @samp{*-*-linux-*uclibc*} targets.
19454 @item -mmusl
19455 @opindex mmusl
19456 Use the musl C library.  This is the default on
19457 @samp{*-*-linux-*musl*} targets.
19459 @item -mbionic
19460 @opindex mbionic
19461 Use Bionic C library.  This is the default on
19462 @samp{*-*-linux-*android*} targets.
19464 @item -mandroid
19465 @opindex mandroid
19466 Compile code compatible with Android platform.  This is the default on
19467 @samp{*-*-linux-*android*} targets.
19469 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
19470 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
19471 this option makes the GCC driver pass Android-specific options to the linker.
19472 Finally, this option causes the preprocessor macro @code{__ANDROID__}
19473 to be defined.
19475 @item -tno-android-cc
19476 @opindex tno-android-cc
19477 Disable compilation effects of @option{-mandroid}, i.e., do not enable
19478 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
19479 @option{-fno-rtti} by default.
19481 @item -tno-android-ld
19482 @opindex tno-android-ld
19483 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
19484 linking options to the linker.
19486 @end table
19488 @node H8/300 Options
19489 @subsection H8/300 Options
19491 These @samp{-m} options are defined for the H8/300 implementations:
19493 @table @gcctabopt
19494 @item -mrelax
19495 @opindex mrelax
19496 Shorten some address references at link time, when possible; uses the
19497 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
19498 ld, Using ld}, for a fuller description.
19500 @item -mh
19501 @opindex mh
19502 Generate code for the H8/300H@.
19504 @item -ms
19505 @opindex ms
19506 Generate code for the H8S@.
19508 @item -mn
19509 @opindex mn
19510 Generate code for the H8S and H8/300H in the normal mode.  This switch
19511 must be used either with @option{-mh} or @option{-ms}.
19513 @item -ms2600
19514 @opindex ms2600
19515 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
19517 @item -mexr
19518 @opindex mexr
19519 Extended registers are stored on stack before execution of function
19520 with monitor attribute. Default option is @option{-mexr}.
19521 This option is valid only for H8S targets.
19523 @item -mno-exr
19524 @opindex mno-exr
19525 @opindex mexr
19526 Extended registers are not stored on stack before execution of function 
19527 with monitor attribute. Default option is @option{-mno-exr}. 
19528 This option is valid only for H8S targets.
19530 @item -mint32
19531 @opindex mint32
19532 Make @code{int} data 32 bits by default.
19534 @item -malign-300
19535 @opindex malign-300
19536 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
19537 The default for the H8/300H and H8S is to align longs and floats on
19538 4-byte boundaries.
19539 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
19540 This option has no effect on the H8/300.
19541 @end table
19543 @node HPPA Options
19544 @subsection HPPA Options
19545 @cindex HPPA Options
19547 These @samp{-m} options are defined for the HPPA family of computers:
19549 @table @gcctabopt
19550 @item -march=@var{architecture-type}
19551 @opindex march
19552 Generate code for the specified architecture.  The choices for
19553 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
19554 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
19555 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
19556 architecture option for your machine.  Code compiled for lower numbered
19557 architectures runs on higher numbered architectures, but not the
19558 other way around.
19560 @item -mpa-risc-1-0
19561 @itemx -mpa-risc-1-1
19562 @itemx -mpa-risc-2-0
19563 @opindex mpa-risc-1-0
19564 @opindex mpa-risc-1-1
19565 @opindex mpa-risc-2-0
19566 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
19568 @item -mcaller-copies
19569 @opindex mcaller-copies
19570 The caller copies function arguments passed by hidden reference.  This
19571 option should be used with care as it is not compatible with the default
19572 32-bit runtime.  However, only aggregates larger than eight bytes are
19573 passed by hidden reference and the option provides better compatibility
19574 with OpenMP.
19576 @item -mjump-in-delay
19577 @opindex mjump-in-delay
19578 This option is ignored and provided for compatibility purposes only.
19580 @item -mdisable-fpregs
19581 @opindex mdisable-fpregs
19582 Prevent floating-point registers from being used in any manner.  This is
19583 necessary for compiling kernels that perform lazy context switching of
19584 floating-point registers.  If you use this option and attempt to perform
19585 floating-point operations, the compiler aborts.
19587 @item -mdisable-indexing
19588 @opindex mdisable-indexing
19589 Prevent the compiler from using indexing address modes.  This avoids some
19590 rather obscure problems when compiling MIG generated code under MACH@.
19592 @item -mno-space-regs
19593 @opindex mno-space-regs
19594 @opindex mspace-regs
19595 Generate code that assumes the target has no space registers.  This allows
19596 GCC to generate faster indirect calls and use unscaled index address modes.
19598 Such code is suitable for level 0 PA systems and kernels.
19600 @item -mfast-indirect-calls
19601 @opindex mfast-indirect-calls
19602 Generate code that assumes calls never cross space boundaries.  This
19603 allows GCC to emit code that performs faster indirect calls.
19605 This option does not work in the presence of shared libraries or nested
19606 functions.
19608 @item -mfixed-range=@var{register-range}
19609 @opindex mfixed-range
19610 Generate code treating the given register range as fixed registers.
19611 A fixed register is one that the register allocator cannot use.  This is
19612 useful when compiling kernel code.  A register range is specified as
19613 two registers separated by a dash.  Multiple register ranges can be
19614 specified separated by a comma.
19616 @item -mlong-load-store
19617 @opindex mlong-load-store
19618 Generate 3-instruction load and store sequences as sometimes required by
19619 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
19620 the HP compilers.
19622 @item -mportable-runtime
19623 @opindex mportable-runtime
19624 Use the portable calling conventions proposed by HP for ELF systems.
19626 @item -mgas
19627 @opindex mgas
19628 Enable the use of assembler directives only GAS understands.
19630 @item -mschedule=@var{cpu-type}
19631 @opindex mschedule
19632 Schedule code according to the constraints for the machine type
19633 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
19634 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
19635 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
19636 proper scheduling option for your machine.  The default scheduling is
19637 @samp{8000}.
19639 @item -mlinker-opt
19640 @opindex mlinker-opt
19641 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
19642 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
19643 linkers in which they give bogus error messages when linking some programs.
19645 @item -msoft-float
19646 @opindex msoft-float
19647 Generate output containing library calls for floating point.
19648 @strong{Warning:} the requisite libraries are not available for all HPPA
19649 targets.  Normally the facilities of the machine's usual C compiler are
19650 used, but this cannot be done directly in cross-compilation.  You must make
19651 your own arrangements to provide suitable library functions for
19652 cross-compilation.
19654 @option{-msoft-float} changes the calling convention in the output file;
19655 therefore, it is only useful if you compile @emph{all} of a program with
19656 this option.  In particular, you need to compile @file{libgcc.a}, the
19657 library that comes with GCC, with @option{-msoft-float} in order for
19658 this to work.
19660 @item -msio
19661 @opindex msio
19662 Generate the predefine, @code{_SIO}, for server IO@.  The default is
19663 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
19664 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
19665 options are available under HP-UX and HI-UX@.
19667 @item -mgnu-ld
19668 @opindex mgnu-ld
19669 Use options specific to GNU @command{ld}.
19670 This passes @option{-shared} to @command{ld} when
19671 building a shared library.  It is the default when GCC is configured,
19672 explicitly or implicitly, with the GNU linker.  This option does not
19673 affect which @command{ld} is called; it only changes what parameters
19674 are passed to that @command{ld}.
19675 The @command{ld} that is called is determined by the
19676 @option{--with-ld} configure option, GCC's program search path, and
19677 finally by the user's @env{PATH}.  The linker used by GCC can be printed
19678 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
19679 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
19681 @item -mhp-ld
19682 @opindex mhp-ld
19683 Use options specific to HP @command{ld}.
19684 This passes @option{-b} to @command{ld} when building
19685 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
19686 links.  It is the default when GCC is configured, explicitly or
19687 implicitly, with the HP linker.  This option does not affect
19688 which @command{ld} is called; it only changes what parameters are passed to that
19689 @command{ld}.
19690 The @command{ld} that is called is determined by the @option{--with-ld}
19691 configure option, GCC's program search path, and finally by the user's
19692 @env{PATH}.  The linker used by GCC can be printed using @samp{which
19693 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
19694 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
19696 @item -mlong-calls
19697 @opindex mno-long-calls
19698 @opindex mlong-calls
19699 Generate code that uses long call sequences.  This ensures that a call
19700 is always able to reach linker generated stubs.  The default is to generate
19701 long calls only when the distance from the call site to the beginning
19702 of the function or translation unit, as the case may be, exceeds a
19703 predefined limit set by the branch type being used.  The limits for
19704 normal calls are 7,600,000 and 240,000 bytes, respectively for the
19705 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
19706 240,000 bytes.
19708 Distances are measured from the beginning of functions when using the
19709 @option{-ffunction-sections} option, or when using the @option{-mgas}
19710 and @option{-mno-portable-runtime} options together under HP-UX with
19711 the SOM linker.
19713 It is normally not desirable to use this option as it degrades
19714 performance.  However, it may be useful in large applications,
19715 particularly when partial linking is used to build the application.
19717 The types of long calls used depends on the capabilities of the
19718 assembler and linker, and the type of code being generated.  The
19719 impact on systems that support long absolute calls, and long pic
19720 symbol-difference or pc-relative calls should be relatively small.
19721 However, an indirect call is used on 32-bit ELF systems in pic code
19722 and it is quite long.
19724 @item -munix=@var{unix-std}
19725 @opindex march
19726 Generate compiler predefines and select a startfile for the specified
19727 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
19728 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
19729 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
19730 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
19731 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
19732 and later.
19734 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
19735 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
19736 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
19737 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
19738 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
19739 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
19741 It is @emph{important} to note that this option changes the interfaces
19742 for various library routines.  It also affects the operational behavior
19743 of the C library.  Thus, @emph{extreme} care is needed in using this
19744 option.
19746 Library code that is intended to operate with more than one UNIX
19747 standard must test, set and restore the variable @code{__xpg4_extended_mask}
19748 as appropriate.  Most GNU software doesn't provide this capability.
19750 @item -nolibdld
19751 @opindex nolibdld
19752 Suppress the generation of link options to search libdld.sl when the
19753 @option{-static} option is specified on HP-UX 10 and later.
19755 @item -static
19756 @opindex static
19757 The HP-UX implementation of setlocale in libc has a dependency on
19758 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
19759 when the @option{-static} option is specified, special link options
19760 are needed to resolve this dependency.
19762 On HP-UX 10 and later, the GCC driver adds the necessary options to
19763 link with libdld.sl when the @option{-static} option is specified.
19764 This causes the resulting binary to be dynamic.  On the 64-bit port,
19765 the linkers generate dynamic binaries by default in any case.  The
19766 @option{-nolibdld} option can be used to prevent the GCC driver from
19767 adding these link options.
19769 @item -threads
19770 @opindex threads
19771 Add support for multithreading with the @dfn{dce thread} library
19772 under HP-UX@.  This option sets flags for both the preprocessor and
19773 linker.
19774 @end table
19776 @node IA-64 Options
19777 @subsection IA-64 Options
19778 @cindex IA-64 Options
19780 These are the @samp{-m} options defined for the Intel IA-64 architecture.
19782 @table @gcctabopt
19783 @item -mbig-endian
19784 @opindex mbig-endian
19785 Generate code for a big-endian target.  This is the default for HP-UX@.
19787 @item -mlittle-endian
19788 @opindex mlittle-endian
19789 Generate code for a little-endian target.  This is the default for AIX5
19790 and GNU/Linux.
19792 @item -mgnu-as
19793 @itemx -mno-gnu-as
19794 @opindex mgnu-as
19795 @opindex mno-gnu-as
19796 Generate (or don't) code for the GNU assembler.  This is the default.
19797 @c Also, this is the default if the configure option @option{--with-gnu-as}
19798 @c is used.
19800 @item -mgnu-ld
19801 @itemx -mno-gnu-ld
19802 @opindex mgnu-ld
19803 @opindex mno-gnu-ld
19804 Generate (or don't) code for the GNU linker.  This is the default.
19805 @c Also, this is the default if the configure option @option{--with-gnu-ld}
19806 @c is used.
19808 @item -mno-pic
19809 @opindex mno-pic
19810 Generate code that does not use a global pointer register.  The result
19811 is not position independent code, and violates the IA-64 ABI@.
19813 @item -mvolatile-asm-stop
19814 @itemx -mno-volatile-asm-stop
19815 @opindex mvolatile-asm-stop
19816 @opindex mno-volatile-asm-stop
19817 Generate (or don't) a stop bit immediately before and after volatile asm
19818 statements.
19820 @item -mregister-names
19821 @itemx -mno-register-names
19822 @opindex mregister-names
19823 @opindex mno-register-names
19824 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
19825 the stacked registers.  This may make assembler output more readable.
19827 @item -mno-sdata
19828 @itemx -msdata
19829 @opindex mno-sdata
19830 @opindex msdata
19831 Disable (or enable) optimizations that use the small data section.  This may
19832 be useful for working around optimizer bugs.
19834 @item -mconstant-gp
19835 @opindex mconstant-gp
19836 Generate code that uses a single constant global pointer value.  This is
19837 useful when compiling kernel code.
19839 @item -mauto-pic
19840 @opindex mauto-pic
19841 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
19842 This is useful when compiling firmware code.
19844 @item -minline-float-divide-min-latency
19845 @opindex minline-float-divide-min-latency
19846 Generate code for inline divides of floating-point values
19847 using the minimum latency algorithm.
19849 @item -minline-float-divide-max-throughput
19850 @opindex minline-float-divide-max-throughput
19851 Generate code for inline divides of floating-point values
19852 using the maximum throughput algorithm.
19854 @item -mno-inline-float-divide
19855 @opindex mno-inline-float-divide
19856 Do not generate inline code for divides of floating-point values.
19858 @item -minline-int-divide-min-latency
19859 @opindex minline-int-divide-min-latency
19860 Generate code for inline divides of integer values
19861 using the minimum latency algorithm.
19863 @item -minline-int-divide-max-throughput
19864 @opindex minline-int-divide-max-throughput
19865 Generate code for inline divides of integer values
19866 using the maximum throughput algorithm.
19868 @item -mno-inline-int-divide
19869 @opindex mno-inline-int-divide
19870 @opindex minline-int-divide
19871 Do not generate inline code for divides of integer values.
19873 @item -minline-sqrt-min-latency
19874 @opindex minline-sqrt-min-latency
19875 Generate code for inline square roots
19876 using the minimum latency algorithm.
19878 @item -minline-sqrt-max-throughput
19879 @opindex minline-sqrt-max-throughput
19880 Generate code for inline square roots
19881 using the maximum throughput algorithm.
19883 @item -mno-inline-sqrt
19884 @opindex mno-inline-sqrt
19885 Do not generate inline code for @code{sqrt}.
19887 @item -mfused-madd
19888 @itemx -mno-fused-madd
19889 @opindex mfused-madd
19890 @opindex mno-fused-madd
19891 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
19892 instructions.  The default is to use these instructions.
19894 @item -mno-dwarf2-asm
19895 @itemx -mdwarf2-asm
19896 @opindex mno-dwarf2-asm
19897 @opindex mdwarf2-asm
19898 Don't (or do) generate assembler code for the DWARF line number debugging
19899 info.  This may be useful when not using the GNU assembler.
19901 @item -mearly-stop-bits
19902 @itemx -mno-early-stop-bits
19903 @opindex mearly-stop-bits
19904 @opindex mno-early-stop-bits
19905 Allow stop bits to be placed earlier than immediately preceding the
19906 instruction that triggered the stop bit.  This can improve instruction
19907 scheduling, but does not always do so.
19909 @item -mfixed-range=@var{register-range}
19910 @opindex mfixed-range
19911 Generate code treating the given register range as fixed registers.
19912 A fixed register is one that the register allocator cannot use.  This is
19913 useful when compiling kernel code.  A register range is specified as
19914 two registers separated by a dash.  Multiple register ranges can be
19915 specified separated by a comma.
19917 @item -mtls-size=@var{tls-size}
19918 @opindex mtls-size
19919 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
19922 @item -mtune=@var{cpu-type}
19923 @opindex mtune
19924 Tune the instruction scheduling for a particular CPU, Valid values are
19925 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
19926 and @samp{mckinley}.
19928 @item -milp32
19929 @itemx -mlp64
19930 @opindex milp32
19931 @opindex mlp64
19932 Generate code for a 32-bit or 64-bit environment.
19933 The 32-bit environment sets int, long and pointer to 32 bits.
19934 The 64-bit environment sets int to 32 bits and long and pointer
19935 to 64 bits.  These are HP-UX specific flags.
19937 @item -mno-sched-br-data-spec
19938 @itemx -msched-br-data-spec
19939 @opindex mno-sched-br-data-spec
19940 @opindex msched-br-data-spec
19941 (Dis/En)able data speculative scheduling before reload.
19942 This results in generation of @code{ld.a} instructions and
19943 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
19944 The default setting is disabled.
19946 @item -msched-ar-data-spec
19947 @itemx -mno-sched-ar-data-spec
19948 @opindex msched-ar-data-spec
19949 @opindex mno-sched-ar-data-spec
19950 (En/Dis)able data speculative scheduling after reload.
19951 This results in generation of @code{ld.a} instructions and
19952 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
19953 The default setting is enabled.
19955 @item -mno-sched-control-spec
19956 @itemx -msched-control-spec
19957 @opindex mno-sched-control-spec
19958 @opindex msched-control-spec
19959 (Dis/En)able control speculative scheduling.  This feature is
19960 available only during region scheduling (i.e.@: before reload).
19961 This results in generation of the @code{ld.s} instructions and
19962 the corresponding check instructions @code{chk.s}.
19963 The default setting is disabled.
19965 @item -msched-br-in-data-spec
19966 @itemx -mno-sched-br-in-data-spec
19967 @opindex msched-br-in-data-spec
19968 @opindex mno-sched-br-in-data-spec
19969 (En/Dis)able speculative scheduling of the instructions that
19970 are dependent on the data speculative loads before reload.
19971 This is effective only with @option{-msched-br-data-spec} enabled.
19972 The default setting is enabled.
19974 @item -msched-ar-in-data-spec
19975 @itemx -mno-sched-ar-in-data-spec
19976 @opindex msched-ar-in-data-spec
19977 @opindex mno-sched-ar-in-data-spec
19978 (En/Dis)able speculative scheduling of the instructions that
19979 are dependent on the data speculative loads after reload.
19980 This is effective only with @option{-msched-ar-data-spec} enabled.
19981 The default setting is enabled.
19983 @item -msched-in-control-spec
19984 @itemx -mno-sched-in-control-spec
19985 @opindex msched-in-control-spec
19986 @opindex mno-sched-in-control-spec
19987 (En/Dis)able speculative scheduling of the instructions that
19988 are dependent on the control speculative loads.
19989 This is effective only with @option{-msched-control-spec} enabled.
19990 The default setting is enabled.
19992 @item -mno-sched-prefer-non-data-spec-insns
19993 @itemx -msched-prefer-non-data-spec-insns
19994 @opindex mno-sched-prefer-non-data-spec-insns
19995 @opindex msched-prefer-non-data-spec-insns
19996 If enabled, data-speculative instructions are chosen for schedule
19997 only if there are no other choices at the moment.  This makes
19998 the use of the data speculation much more conservative.
19999 The default setting is disabled.
20001 @item -mno-sched-prefer-non-control-spec-insns
20002 @itemx -msched-prefer-non-control-spec-insns
20003 @opindex mno-sched-prefer-non-control-spec-insns
20004 @opindex msched-prefer-non-control-spec-insns
20005 If enabled, control-speculative instructions are chosen for schedule
20006 only if there are no other choices at the moment.  This makes
20007 the use of the control speculation much more conservative.
20008 The default setting is disabled.
20010 @item -mno-sched-count-spec-in-critical-path
20011 @itemx -msched-count-spec-in-critical-path
20012 @opindex mno-sched-count-spec-in-critical-path
20013 @opindex msched-count-spec-in-critical-path
20014 If enabled, speculative dependencies are considered during
20015 computation of the instructions priorities.  This makes the use of the
20016 speculation a bit more conservative.
20017 The default setting is disabled.
20019 @item -msched-spec-ldc
20020 @opindex msched-spec-ldc
20021 Use a simple data speculation check.  This option is on by default.
20023 @item -msched-control-spec-ldc
20024 @opindex msched-spec-ldc
20025 Use a simple check for control speculation.  This option is on by default.
20027 @item -msched-stop-bits-after-every-cycle
20028 @opindex msched-stop-bits-after-every-cycle
20029 Place a stop bit after every cycle when scheduling.  This option is on
20030 by default.
20032 @item -msched-fp-mem-deps-zero-cost
20033 @opindex msched-fp-mem-deps-zero-cost
20034 Assume that floating-point stores and loads are not likely to cause a conflict
20035 when placed into the same instruction group.  This option is disabled by
20036 default.
20038 @item -msel-sched-dont-check-control-spec
20039 @opindex msel-sched-dont-check-control-spec
20040 Generate checks for control speculation in selective scheduling.
20041 This flag is disabled by default.
20043 @item -msched-max-memory-insns=@var{max-insns}
20044 @opindex msched-max-memory-insns
20045 Limit on the number of memory insns per instruction group, giving lower
20046 priority to subsequent memory insns attempting to schedule in the same
20047 instruction group. Frequently useful to prevent cache bank conflicts.
20048 The default value is 1.
20050 @item -msched-max-memory-insns-hard-limit
20051 @opindex msched-max-memory-insns-hard-limit
20052 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
20053 disallowing more than that number in an instruction group.
20054 Otherwise, the limit is ``soft'', meaning that non-memory operations
20055 are preferred when the limit is reached, but memory operations may still
20056 be scheduled.
20058 @end table
20060 @node LM32 Options
20061 @subsection LM32 Options
20062 @cindex LM32 options
20064 These @option{-m} options are defined for the LatticeMico32 architecture:
20066 @table @gcctabopt
20067 @item -mbarrel-shift-enabled
20068 @opindex mbarrel-shift-enabled
20069 Enable barrel-shift instructions.
20071 @item -mdivide-enabled
20072 @opindex mdivide-enabled
20073 Enable divide and modulus instructions.
20075 @item -mmultiply-enabled
20076 @opindex multiply-enabled
20077 Enable multiply instructions.
20079 @item -msign-extend-enabled
20080 @opindex msign-extend-enabled
20081 Enable sign extend instructions.
20083 @item -muser-enabled
20084 @opindex muser-enabled
20085 Enable user-defined instructions.
20087 @end table
20089 @node M32C Options
20090 @subsection M32C Options
20091 @cindex M32C options
20093 @table @gcctabopt
20094 @item -mcpu=@var{name}
20095 @opindex mcpu=
20096 Select the CPU for which code is generated.  @var{name} may be one of
20097 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
20098 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
20099 the M32C/80 series.
20101 @item -msim
20102 @opindex msim
20103 Specifies that the program will be run on the simulator.  This causes
20104 an alternate runtime library to be linked in which supports, for
20105 example, file I/O@.  You must not use this option when generating
20106 programs that will run on real hardware; you must provide your own
20107 runtime library for whatever I/O functions are needed.
20109 @item -memregs=@var{number}
20110 @opindex memregs=
20111 Specifies the number of memory-based pseudo-registers GCC uses
20112 during code generation.  These pseudo-registers are used like real
20113 registers, so there is a tradeoff between GCC's ability to fit the
20114 code into available registers, and the performance penalty of using
20115 memory instead of registers.  Note that all modules in a program must
20116 be compiled with the same value for this option.  Because of that, you
20117 must not use this option with GCC's default runtime libraries.
20119 @end table
20121 @node M32R/D Options
20122 @subsection M32R/D Options
20123 @cindex M32R/D options
20125 These @option{-m} options are defined for Renesas M32R/D architectures:
20127 @table @gcctabopt
20128 @item -m32r2
20129 @opindex m32r2
20130 Generate code for the M32R/2@.
20132 @item -m32rx
20133 @opindex m32rx
20134 Generate code for the M32R/X@.
20136 @item -m32r
20137 @opindex m32r
20138 Generate code for the M32R@.  This is the default.
20140 @item -mmodel=small
20141 @opindex mmodel=small
20142 Assume all objects live in the lower 16MB of memory (so that their addresses
20143 can be loaded with the @code{ld24} instruction), and assume all subroutines
20144 are reachable with the @code{bl} instruction.
20145 This is the default.
20147 The addressability of a particular object can be set with the
20148 @code{model} attribute.
20150 @item -mmodel=medium
20151 @opindex mmodel=medium
20152 Assume objects may be anywhere in the 32-bit address space (the compiler
20153 generates @code{seth/add3} instructions to load their addresses), and
20154 assume all subroutines are reachable with the @code{bl} instruction.
20156 @item -mmodel=large
20157 @opindex mmodel=large
20158 Assume objects may be anywhere in the 32-bit address space (the compiler
20159 generates @code{seth/add3} instructions to load their addresses), and
20160 assume subroutines may not be reachable with the @code{bl} instruction
20161 (the compiler generates the much slower @code{seth/add3/jl}
20162 instruction sequence).
20164 @item -msdata=none
20165 @opindex msdata=none
20166 Disable use of the small data area.  Variables are put into
20167 one of @code{.data}, @code{.bss}, or @code{.rodata} (unless the
20168 @code{section} attribute has been specified).
20169 This is the default.
20171 The small data area consists of sections @code{.sdata} and @code{.sbss}.
20172 Objects may be explicitly put in the small data area with the
20173 @code{section} attribute using one of these sections.
20175 @item -msdata=sdata
20176 @opindex msdata=sdata
20177 Put small global and static data in the small data area, but do not
20178 generate special code to reference them.
20180 @item -msdata=use
20181 @opindex msdata=use
20182 Put small global and static data in the small data area, and generate
20183 special instructions to reference them.
20185 @item -G @var{num}
20186 @opindex G
20187 @cindex smaller data references
20188 Put global and static objects less than or equal to @var{num} bytes
20189 into the small data or BSS sections instead of the normal data or BSS
20190 sections.  The default value of @var{num} is 8.
20191 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
20192 for this option to have any effect.
20194 All modules should be compiled with the same @option{-G @var{num}} value.
20195 Compiling with different values of @var{num} may or may not work; if it
20196 doesn't the linker gives an error message---incorrect code is not
20197 generated.
20199 @item -mdebug
20200 @opindex mdebug
20201 Makes the M32R-specific code in the compiler display some statistics
20202 that might help in debugging programs.
20204 @item -malign-loops
20205 @opindex malign-loops
20206 Align all loops to a 32-byte boundary.
20208 @item -mno-align-loops
20209 @opindex mno-align-loops
20210 Do not enforce a 32-byte alignment for loops.  This is the default.
20212 @item -missue-rate=@var{number}
20213 @opindex missue-rate=@var{number}
20214 Issue @var{number} instructions per cycle.  @var{number} can only be 1
20215 or 2.
20217 @item -mbranch-cost=@var{number}
20218 @opindex mbranch-cost=@var{number}
20219 @var{number} can only be 1 or 2.  If it is 1 then branches are
20220 preferred over conditional code, if it is 2, then the opposite applies.
20222 @item -mflush-trap=@var{number}
20223 @opindex mflush-trap=@var{number}
20224 Specifies the trap number to use to flush the cache.  The default is
20225 12.  Valid numbers are between 0 and 15 inclusive.
20227 @item -mno-flush-trap
20228 @opindex mno-flush-trap
20229 Specifies that the cache cannot be flushed by using a trap.
20231 @item -mflush-func=@var{name}
20232 @opindex mflush-func=@var{name}
20233 Specifies the name of the operating system function to call to flush
20234 the cache.  The default is @samp{_flush_cache}, but a function call
20235 is only used if a trap is not available.
20237 @item -mno-flush-func
20238 @opindex mno-flush-func
20239 Indicates that there is no OS function for flushing the cache.
20241 @end table
20243 @node M680x0 Options
20244 @subsection M680x0 Options
20245 @cindex M680x0 options
20247 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
20248 The default settings depend on which architecture was selected when
20249 the compiler was configured; the defaults for the most common choices
20250 are given below.
20252 @table @gcctabopt
20253 @item -march=@var{arch}
20254 @opindex march
20255 Generate code for a specific M680x0 or ColdFire instruction set
20256 architecture.  Permissible values of @var{arch} for M680x0
20257 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
20258 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
20259 architectures are selected according to Freescale's ISA classification
20260 and the permissible values are: @samp{isaa}, @samp{isaaplus},
20261 @samp{isab} and @samp{isac}.
20263 GCC defines a macro @code{__mcf@var{arch}__} whenever it is generating
20264 code for a ColdFire target.  The @var{arch} in this macro is one of the
20265 @option{-march} arguments given above.
20267 When used together, @option{-march} and @option{-mtune} select code
20268 that runs on a family of similar processors but that is optimized
20269 for a particular microarchitecture.
20271 @item -mcpu=@var{cpu}
20272 @opindex mcpu
20273 Generate code for a specific M680x0 or ColdFire processor.
20274 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
20275 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
20276 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
20277 below, which also classifies the CPUs into families:
20279 @multitable @columnfractions 0.20 0.80
20280 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
20281 @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}
20282 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
20283 @item @samp{5206e} @tab @samp{5206e}
20284 @item @samp{5208} @tab @samp{5207} @samp{5208}
20285 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
20286 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
20287 @item @samp{5216} @tab @samp{5214} @samp{5216}
20288 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
20289 @item @samp{5225} @tab @samp{5224} @samp{5225}
20290 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
20291 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
20292 @item @samp{5249} @tab @samp{5249}
20293 @item @samp{5250} @tab @samp{5250}
20294 @item @samp{5271} @tab @samp{5270} @samp{5271}
20295 @item @samp{5272} @tab @samp{5272}
20296 @item @samp{5275} @tab @samp{5274} @samp{5275}
20297 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
20298 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
20299 @item @samp{5307} @tab @samp{5307}
20300 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
20301 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
20302 @item @samp{5407} @tab @samp{5407}
20303 @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}
20304 @end multitable
20306 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
20307 @var{arch} is compatible with @var{cpu}.  Other combinations of
20308 @option{-mcpu} and @option{-march} are rejected.
20310 GCC defines the macro @code{__mcf_cpu_@var{cpu}} when ColdFire target
20311 @var{cpu} is selected.  It also defines @code{__mcf_family_@var{family}},
20312 where the value of @var{family} is given by the table above.
20314 @item -mtune=@var{tune}
20315 @opindex mtune
20316 Tune the code for a particular microarchitecture within the
20317 constraints set by @option{-march} and @option{-mcpu}.
20318 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
20319 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
20320 and @samp{cpu32}.  The ColdFire microarchitectures
20321 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
20323 You can also use @option{-mtune=68020-40} for code that needs
20324 to run relatively well on 68020, 68030 and 68040 targets.
20325 @option{-mtune=68020-60} is similar but includes 68060 targets
20326 as well.  These two options select the same tuning decisions as
20327 @option{-m68020-40} and @option{-m68020-60} respectively.
20329 GCC defines the macros @code{__mc@var{arch}} and @code{__mc@var{arch}__}
20330 when tuning for 680x0 architecture @var{arch}.  It also defines
20331 @code{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
20332 option is used.  If GCC is tuning for a range of architectures,
20333 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
20334 it defines the macros for every architecture in the range.
20336 GCC also defines the macro @code{__m@var{uarch}__} when tuning for
20337 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
20338 of the arguments given above.
20340 @item -m68000
20341 @itemx -mc68000
20342 @opindex m68000
20343 @opindex mc68000
20344 Generate output for a 68000.  This is the default
20345 when the compiler is configured for 68000-based systems.
20346 It is equivalent to @option{-march=68000}.
20348 Use this option for microcontrollers with a 68000 or EC000 core,
20349 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
20351 @item -m68010
20352 @opindex m68010
20353 Generate output for a 68010.  This is the default
20354 when the compiler is configured for 68010-based systems.
20355 It is equivalent to @option{-march=68010}.
20357 @item -m68020
20358 @itemx -mc68020
20359 @opindex m68020
20360 @opindex mc68020
20361 Generate output for a 68020.  This is the default
20362 when the compiler is configured for 68020-based systems.
20363 It is equivalent to @option{-march=68020}.
20365 @item -m68030
20366 @opindex m68030
20367 Generate output for a 68030.  This is the default when the compiler is
20368 configured for 68030-based systems.  It is equivalent to
20369 @option{-march=68030}.
20371 @item -m68040
20372 @opindex m68040
20373 Generate output for a 68040.  This is the default when the compiler is
20374 configured for 68040-based systems.  It is equivalent to
20375 @option{-march=68040}.
20377 This option inhibits the use of 68881/68882 instructions that have to be
20378 emulated by software on the 68040.  Use this option if your 68040 does not
20379 have code to emulate those instructions.
20381 @item -m68060
20382 @opindex m68060
20383 Generate output for a 68060.  This is the default when the compiler is
20384 configured for 68060-based systems.  It is equivalent to
20385 @option{-march=68060}.
20387 This option inhibits the use of 68020 and 68881/68882 instructions that
20388 have to be emulated by software on the 68060.  Use this option if your 68060
20389 does not have code to emulate those instructions.
20391 @item -mcpu32
20392 @opindex mcpu32
20393 Generate output for a CPU32.  This is the default
20394 when the compiler is configured for CPU32-based systems.
20395 It is equivalent to @option{-march=cpu32}.
20397 Use this option for microcontrollers with a
20398 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
20399 68336, 68340, 68341, 68349 and 68360.
20401 @item -m5200
20402 @opindex m5200
20403 Generate output for a 520X ColdFire CPU@.  This is the default
20404 when the compiler is configured for 520X-based systems.
20405 It is equivalent to @option{-mcpu=5206}, and is now deprecated
20406 in favor of that option.
20408 Use this option for microcontroller with a 5200 core, including
20409 the MCF5202, MCF5203, MCF5204 and MCF5206.
20411 @item -m5206e
20412 @opindex m5206e
20413 Generate output for a 5206e ColdFire CPU@.  The option is now
20414 deprecated in favor of the equivalent @option{-mcpu=5206e}.
20416 @item -m528x
20417 @opindex m528x
20418 Generate output for a member of the ColdFire 528X family.
20419 The option is now deprecated in favor of the equivalent
20420 @option{-mcpu=528x}.
20422 @item -m5307
20423 @opindex m5307
20424 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
20425 in favor of the equivalent @option{-mcpu=5307}.
20427 @item -m5407
20428 @opindex m5407
20429 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
20430 in favor of the equivalent @option{-mcpu=5407}.
20432 @item -mcfv4e
20433 @opindex mcfv4e
20434 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
20435 This includes use of hardware floating-point instructions.
20436 The option is equivalent to @option{-mcpu=547x}, and is now
20437 deprecated in favor of that option.
20439 @item -m68020-40
20440 @opindex m68020-40
20441 Generate output for a 68040, without using any of the new instructions.
20442 This results in code that can run relatively efficiently on either a
20443 68020/68881 or a 68030 or a 68040.  The generated code does use the
20444 68881 instructions that are emulated on the 68040.
20446 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
20448 @item -m68020-60
20449 @opindex m68020-60
20450 Generate output for a 68060, without using any of the new instructions.
20451 This results in code that can run relatively efficiently on either a
20452 68020/68881 or a 68030 or a 68040.  The generated code does use the
20453 68881 instructions that are emulated on the 68060.
20455 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
20457 @item -mhard-float
20458 @itemx -m68881
20459 @opindex mhard-float
20460 @opindex m68881
20461 Generate floating-point instructions.  This is the default for 68020
20462 and above, and for ColdFire devices that have an FPU@.  It defines the
20463 macro @code{__HAVE_68881__} on M680x0 targets and @code{__mcffpu__}
20464 on ColdFire targets.
20466 @item -msoft-float
20467 @opindex msoft-float
20468 Do not generate floating-point instructions; use library calls instead.
20469 This is the default for 68000, 68010, and 68832 targets.  It is also
20470 the default for ColdFire devices that have no FPU.
20472 @item -mdiv
20473 @itemx -mno-div
20474 @opindex mdiv
20475 @opindex mno-div
20476 Generate (do not generate) ColdFire hardware divide and remainder
20477 instructions.  If @option{-march} is used without @option{-mcpu},
20478 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
20479 architectures.  Otherwise, the default is taken from the target CPU
20480 (either the default CPU, or the one specified by @option{-mcpu}).  For
20481 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
20482 @option{-mcpu=5206e}.
20484 GCC defines the macro @code{__mcfhwdiv__} when this option is enabled.
20486 @item -mshort
20487 @opindex mshort
20488 Consider type @code{int} to be 16 bits wide, like @code{short int}.
20489 Additionally, parameters passed on the stack are also aligned to a
20490 16-bit boundary even on targets whose API mandates promotion to 32-bit.
20492 @item -mno-short
20493 @opindex mno-short
20494 Do not consider type @code{int} to be 16 bits wide.  This is the default.
20496 @item -mnobitfield
20497 @itemx -mno-bitfield
20498 @opindex mnobitfield
20499 @opindex mno-bitfield
20500 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
20501 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
20503 @item -mbitfield
20504 @opindex mbitfield
20505 Do use the bit-field instructions.  The @option{-m68020} option implies
20506 @option{-mbitfield}.  This is the default if you use a configuration
20507 designed for a 68020.
20509 @item -mrtd
20510 @opindex mrtd
20511 Use a different function-calling convention, in which functions
20512 that take a fixed number of arguments return with the @code{rtd}
20513 instruction, which pops their arguments while returning.  This
20514 saves one instruction in the caller since there is no need to pop
20515 the arguments there.
20517 This calling convention is incompatible with the one normally
20518 used on Unix, so you cannot use it if you need to call libraries
20519 compiled with the Unix compiler.
20521 Also, you must provide function prototypes for all functions that
20522 take variable numbers of arguments (including @code{printf});
20523 otherwise incorrect code is generated for calls to those
20524 functions.
20526 In addition, seriously incorrect code results if you call a
20527 function with too many arguments.  (Normally, extra arguments are
20528 harmlessly ignored.)
20530 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
20531 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
20533 The default is @option{-mno-rtd}.
20535 @item -malign-int
20536 @itemx -mno-align-int
20537 @opindex malign-int
20538 @opindex mno-align-int
20539 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
20540 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
20541 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
20542 Aligning variables on 32-bit boundaries produces code that runs somewhat
20543 faster on processors with 32-bit busses at the expense of more memory.
20545 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
20546 aligns structures containing the above types differently than
20547 most published application binary interface specifications for the m68k.
20549 @item -mpcrel
20550 @opindex mpcrel
20551 Use the pc-relative addressing mode of the 68000 directly, instead of
20552 using a global offset table.  At present, this option implies @option{-fpic},
20553 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
20554 not presently supported with @option{-mpcrel}, though this could be supported for
20555 68020 and higher processors.
20557 @item -mno-strict-align
20558 @itemx -mstrict-align
20559 @opindex mno-strict-align
20560 @opindex mstrict-align
20561 Do not (do) assume that unaligned memory references are handled by
20562 the system.
20564 @item -msep-data
20565 Generate code that allows the data segment to be located in a different
20566 area of memory from the text segment.  This allows for execute-in-place in
20567 an environment without virtual memory management.  This option implies
20568 @option{-fPIC}.
20570 @item -mno-sep-data
20571 Generate code that assumes that the data segment follows the text segment.
20572 This is the default.
20574 @item -mid-shared-library
20575 Generate code that supports shared libraries via the library ID method.
20576 This allows for execute-in-place and shared libraries in an environment
20577 without virtual memory management.  This option implies @option{-fPIC}.
20579 @item -mno-id-shared-library
20580 Generate code that doesn't assume ID-based shared libraries are being used.
20581 This is the default.
20583 @item -mshared-library-id=n
20584 Specifies the identification number of the ID-based shared library being
20585 compiled.  Specifying a value of 0 generates more compact code; specifying
20586 other values forces the allocation of that number to the current
20587 library, but is no more space- or time-efficient than omitting this option.
20589 @item -mxgot
20590 @itemx -mno-xgot
20591 @opindex mxgot
20592 @opindex mno-xgot
20593 When generating position-independent code for ColdFire, generate code
20594 that works if the GOT has more than 8192 entries.  This code is
20595 larger and slower than code generated without this option.  On M680x0
20596 processors, this option is not needed; @option{-fPIC} suffices.
20598 GCC normally uses a single instruction to load values from the GOT@.
20599 While this is relatively efficient, it only works if the GOT
20600 is smaller than about 64k.  Anything larger causes the linker
20601 to report an error such as:
20603 @cindex relocation truncated to fit (ColdFire)
20604 @smallexample
20605 relocation truncated to fit: R_68K_GOT16O foobar
20606 @end smallexample
20608 If this happens, you should recompile your code with @option{-mxgot}.
20609 It should then work with very large GOTs.  However, code generated with
20610 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
20611 the value of a global symbol.
20613 Note that some linkers, including newer versions of the GNU linker,
20614 can create multiple GOTs and sort GOT entries.  If you have such a linker,
20615 you should only need to use @option{-mxgot} when compiling a single
20616 object file that accesses more than 8192 GOT entries.  Very few do.
20618 These options have no effect unless GCC is generating
20619 position-independent code.
20621 @item -mlong-jump-table-offsets
20622 @opindex mlong-jump-table-offsets
20623 Use 32-bit offsets in @code{switch} tables.  The default is to use
20624 16-bit offsets.
20626 @end table
20628 @node MCore Options
20629 @subsection MCore Options
20630 @cindex MCore options
20632 These are the @samp{-m} options defined for the Motorola M*Core
20633 processors.
20635 @table @gcctabopt
20637 @item -mhardlit
20638 @itemx -mno-hardlit
20639 @opindex mhardlit
20640 @opindex mno-hardlit
20641 Inline constants into the code stream if it can be done in two
20642 instructions or less.
20644 @item -mdiv
20645 @itemx -mno-div
20646 @opindex mdiv
20647 @opindex mno-div
20648 Use the divide instruction.  (Enabled by default).
20650 @item -mrelax-immediate
20651 @itemx -mno-relax-immediate
20652 @opindex mrelax-immediate
20653 @opindex mno-relax-immediate
20654 Allow arbitrary-sized immediates in bit operations.
20656 @item -mwide-bitfields
20657 @itemx -mno-wide-bitfields
20658 @opindex mwide-bitfields
20659 @opindex mno-wide-bitfields
20660 Always treat bit-fields as @code{int}-sized.
20662 @item -m4byte-functions
20663 @itemx -mno-4byte-functions
20664 @opindex m4byte-functions
20665 @opindex mno-4byte-functions
20666 Force all functions to be aligned to a 4-byte boundary.
20668 @item -mcallgraph-data
20669 @itemx -mno-callgraph-data
20670 @opindex mcallgraph-data
20671 @opindex mno-callgraph-data
20672 Emit callgraph information.
20674 @item -mslow-bytes
20675 @itemx -mno-slow-bytes
20676 @opindex mslow-bytes
20677 @opindex mno-slow-bytes
20678 Prefer word access when reading byte quantities.
20680 @item -mlittle-endian
20681 @itemx -mbig-endian
20682 @opindex mlittle-endian
20683 @opindex mbig-endian
20684 Generate code for a little-endian target.
20686 @item -m210
20687 @itemx -m340
20688 @opindex m210
20689 @opindex m340
20690 Generate code for the 210 processor.
20692 @item -mno-lsim
20693 @opindex mno-lsim
20694 Assume that runtime support has been provided and so omit the
20695 simulator library (@file{libsim.a)} from the linker command line.
20697 @item -mstack-increment=@var{size}
20698 @opindex mstack-increment
20699 Set the maximum amount for a single stack increment operation.  Large
20700 values can increase the speed of programs that contain functions
20701 that need a large amount of stack space, but they can also trigger a
20702 segmentation fault if the stack is extended too much.  The default
20703 value is 0x1000.
20705 @end table
20707 @node MeP Options
20708 @subsection MeP Options
20709 @cindex MeP options
20711 @table @gcctabopt
20713 @item -mabsdiff
20714 @opindex mabsdiff
20715 Enables the @code{abs} instruction, which is the absolute difference
20716 between two registers.
20718 @item -mall-opts
20719 @opindex mall-opts
20720 Enables all the optional instructions---average, multiply, divide, bit
20721 operations, leading zero, absolute difference, min/max, clip, and
20722 saturation.
20725 @item -maverage
20726 @opindex maverage
20727 Enables the @code{ave} instruction, which computes the average of two
20728 registers.
20730 @item -mbased=@var{n}
20731 @opindex mbased=
20732 Variables of size @var{n} bytes or smaller are placed in the
20733 @code{.based} section by default.  Based variables use the @code{$tp}
20734 register as a base register, and there is a 128-byte limit to the
20735 @code{.based} section.
20737 @item -mbitops
20738 @opindex mbitops
20739 Enables the bit operation instructions---bit test (@code{btstm}), set
20740 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
20741 test-and-set (@code{tas}).
20743 @item -mc=@var{name}
20744 @opindex mc=
20745 Selects which section constant data is placed in.  @var{name} may
20746 be @samp{tiny}, @samp{near}, or @samp{far}.
20748 @item -mclip
20749 @opindex mclip
20750 Enables the @code{clip} instruction.  Note that @option{-mclip} is not
20751 useful unless you also provide @option{-mminmax}.
20753 @item -mconfig=@var{name}
20754 @opindex mconfig=
20755 Selects one of the built-in core configurations.  Each MeP chip has
20756 one or more modules in it; each module has a core CPU and a variety of
20757 coprocessors, optional instructions, and peripherals.  The
20758 @code{MeP-Integrator} tool, not part of GCC, provides these
20759 configurations through this option; using this option is the same as
20760 using all the corresponding command-line options.  The default
20761 configuration is @samp{default}.
20763 @item -mcop
20764 @opindex mcop
20765 Enables the coprocessor instructions.  By default, this is a 32-bit
20766 coprocessor.  Note that the coprocessor is normally enabled via the
20767 @option{-mconfig=} option.
20769 @item -mcop32
20770 @opindex mcop32
20771 Enables the 32-bit coprocessor's instructions.
20773 @item -mcop64
20774 @opindex mcop64
20775 Enables the 64-bit coprocessor's instructions.
20777 @item -mivc2
20778 @opindex mivc2
20779 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
20781 @item -mdc
20782 @opindex mdc
20783 Causes constant variables to be placed in the @code{.near} section.
20785 @item -mdiv
20786 @opindex mdiv
20787 Enables the @code{div} and @code{divu} instructions.
20789 @item -meb
20790 @opindex meb
20791 Generate big-endian code.
20793 @item -mel
20794 @opindex mel
20795 Generate little-endian code.
20797 @item -mio-volatile
20798 @opindex mio-volatile
20799 Tells the compiler that any variable marked with the @code{io}
20800 attribute is to be considered volatile.
20802 @item -ml
20803 @opindex ml
20804 Causes variables to be assigned to the @code{.far} section by default.
20806 @item -mleadz
20807 @opindex mleadz
20808 Enables the @code{leadz} (leading zero) instruction.
20810 @item -mm
20811 @opindex mm
20812 Causes variables to be assigned to the @code{.near} section by default.
20814 @item -mminmax
20815 @opindex mminmax
20816 Enables the @code{min} and @code{max} instructions.
20818 @item -mmult
20819 @opindex mmult
20820 Enables the multiplication and multiply-accumulate instructions.
20822 @item -mno-opts
20823 @opindex mno-opts
20824 Disables all the optional instructions enabled by @option{-mall-opts}.
20826 @item -mrepeat
20827 @opindex mrepeat
20828 Enables the @code{repeat} and @code{erepeat} instructions, used for
20829 low-overhead looping.
20831 @item -ms
20832 @opindex ms
20833 Causes all variables to default to the @code{.tiny} section.  Note
20834 that there is a 65536-byte limit to this section.  Accesses to these
20835 variables use the @code{%gp} base register.
20837 @item -msatur
20838 @opindex msatur
20839 Enables the saturation instructions.  Note that the compiler does not
20840 currently generate these itself, but this option is included for
20841 compatibility with other tools, like @code{as}.
20843 @item -msdram
20844 @opindex msdram
20845 Link the SDRAM-based runtime instead of the default ROM-based runtime.
20847 @item -msim
20848 @opindex msim
20849 Link the simulator run-time libraries.
20851 @item -msimnovec
20852 @opindex msimnovec
20853 Link the simulator runtime libraries, excluding built-in support
20854 for reset and exception vectors and tables.
20856 @item -mtf
20857 @opindex mtf
20858 Causes all functions to default to the @code{.far} section.  Without
20859 this option, functions default to the @code{.near} section.
20861 @item -mtiny=@var{n}
20862 @opindex mtiny=
20863 Variables that are @var{n} bytes or smaller are allocated to the
20864 @code{.tiny} section.  These variables use the @code{$gp} base
20865 register.  The default for this option is 4, but note that there's a
20866 65536-byte limit to the @code{.tiny} section.
20868 @end table
20870 @node MicroBlaze Options
20871 @subsection MicroBlaze Options
20872 @cindex MicroBlaze Options
20874 @table @gcctabopt
20876 @item -msoft-float
20877 @opindex msoft-float
20878 Use software emulation for floating point (default).
20880 @item -mhard-float
20881 @opindex mhard-float
20882 Use hardware floating-point instructions.
20884 @item -mmemcpy
20885 @opindex mmemcpy
20886 Do not optimize block moves, use @code{memcpy}.
20888 @item -mno-clearbss
20889 @opindex mno-clearbss
20890 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
20892 @item -mcpu=@var{cpu-type}
20893 @opindex mcpu=
20894 Use features of, and schedule code for, the given CPU.
20895 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
20896 where @var{X} is a major version, @var{YY} is the minor version, and
20897 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
20898 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v6.00.a}.
20900 @item -mxl-soft-mul
20901 @opindex mxl-soft-mul
20902 Use software multiply emulation (default).
20904 @item -mxl-soft-div
20905 @opindex mxl-soft-div
20906 Use software emulation for divides (default).
20908 @item -mxl-barrel-shift
20909 @opindex mxl-barrel-shift
20910 Use the hardware barrel shifter.
20912 @item -mxl-pattern-compare
20913 @opindex mxl-pattern-compare
20914 Use pattern compare instructions.
20916 @item -msmall-divides
20917 @opindex msmall-divides
20918 Use table lookup optimization for small signed integer divisions.
20920 @item -mxl-stack-check
20921 @opindex mxl-stack-check
20922 This option is deprecated.  Use @option{-fstack-check} instead.
20924 @item -mxl-gp-opt
20925 @opindex mxl-gp-opt
20926 Use GP-relative @code{.sdata}/@code{.sbss} sections.
20928 @item -mxl-multiply-high
20929 @opindex mxl-multiply-high
20930 Use multiply high instructions for high part of 32x32 multiply.
20932 @item -mxl-float-convert
20933 @opindex mxl-float-convert
20934 Use hardware floating-point conversion instructions.
20936 @item -mxl-float-sqrt
20937 @opindex mxl-float-sqrt
20938 Use hardware floating-point square root instruction.
20940 @item -mbig-endian
20941 @opindex mbig-endian
20942 Generate code for a big-endian target.
20944 @item -mlittle-endian
20945 @opindex mlittle-endian
20946 Generate code for a little-endian target.
20948 @item -mxl-reorder
20949 @opindex mxl-reorder
20950 Use reorder instructions (swap and byte reversed load/store).
20952 @item -mxl-mode-@var{app-model}
20953 Select application model @var{app-model}.  Valid models are
20954 @table @samp
20955 @item executable
20956 normal executable (default), uses startup code @file{crt0.o}.
20958 @item -mpic-data-is-text-relative
20959 @opindex mpic-data-is-text-relative
20960 Assume that the displacement between the text and data segments is fixed
20961 at static link time.  This allows data to be referenced by offset from start of
20962 text address instead of GOT since PC-relative addressing is not supported.
20964 @item xmdstub
20965 for use with Xilinx Microprocessor Debugger (XMD) based
20966 software intrusive debug agent called xmdstub. This uses startup file
20967 @file{crt1.o} and sets the start address of the program to 0x800.
20969 @item bootstrap
20970 for applications that are loaded using a bootloader.
20971 This model uses startup file @file{crt2.o} which does not contain a processor
20972 reset vector handler. This is suitable for transferring control on a
20973 processor reset to the bootloader rather than the application.
20975 @item novectors
20976 for applications that do not require any of the
20977 MicroBlaze vectors. This option may be useful for applications running
20978 within a monitoring application. This model uses @file{crt3.o} as a startup file.
20979 @end table
20981 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
20982 @option{-mxl-mode-@var{app-model}}.
20984 @end table
20986 @node MIPS Options
20987 @subsection MIPS Options
20988 @cindex MIPS options
20990 @table @gcctabopt
20992 @item -EB
20993 @opindex EB
20994 Generate big-endian code.
20996 @item -EL
20997 @opindex EL
20998 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
20999 configurations.
21001 @item -march=@var{arch}
21002 @opindex march
21003 Generate code that runs on @var{arch}, which can be the name of a
21004 generic MIPS ISA, or the name of a particular processor.
21005 The ISA names are:
21006 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
21007 @samp{mips32}, @samp{mips32r2}, @samp{mips32r3}, @samp{mips32r5},
21008 @samp{mips32r6}, @samp{mips64}, @samp{mips64r2}, @samp{mips64r3},
21009 @samp{mips64r5} and @samp{mips64r6}.
21010 The processor names are:
21011 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
21012 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
21013 @samp{5kc}, @samp{5kf},
21014 @samp{20kc},
21015 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
21016 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
21017 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
21018 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
21019 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
21020 @samp{i6400}, @samp{i6500},
21021 @samp{interaptiv},
21022 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a}, @samp{gs464},
21023 @samp{gs464e}, @samp{gs264e},
21024 @samp{m4k},
21025 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
21026 @samp{m5100}, @samp{m5101},
21027 @samp{octeon}, @samp{octeon+}, @samp{octeon2}, @samp{octeon3},
21028 @samp{orion},
21029 @samp{p5600}, @samp{p6600},
21030 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
21031 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
21032 @samp{rm7000}, @samp{rm9000},
21033 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
21034 @samp{sb1},
21035 @samp{sr71000},
21036 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
21037 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
21038 @samp{xlr} and @samp{xlp}.
21039 The special value @samp{from-abi} selects the
21040 most compatible architecture for the selected ABI (that is,
21041 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
21043 The native Linux/GNU toolchain also supports the value @samp{native},
21044 which selects the best architecture option for the host processor.
21045 @option{-march=native} has no effect if GCC does not recognize
21046 the processor.
21048 In processor names, a final @samp{000} can be abbreviated as @samp{k}
21049 (for example, @option{-march=r2k}).  Prefixes are optional, and
21050 @samp{vr} may be written @samp{r}.
21052 Names of the form @samp{@var{n}f2_1} refer to processors with
21053 FPUs clocked at half the rate of the core, names of the form
21054 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
21055 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
21056 processors with FPUs clocked a ratio of 3:2 with respect to the core.
21057 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
21058 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
21059 accepted as synonyms for @samp{@var{n}f1_1}.
21061 GCC defines two macros based on the value of this option.  The first
21062 is @code{_MIPS_ARCH}, which gives the name of target architecture, as
21063 a string.  The second has the form @code{_MIPS_ARCH_@var{foo}},
21064 where @var{foo} is the capitalized value of @code{_MIPS_ARCH}@.
21065 For example, @option{-march=r2000} sets @code{_MIPS_ARCH}
21066 to @code{"r2000"} and defines the macro @code{_MIPS_ARCH_R2000}.
21068 Note that the @code{_MIPS_ARCH} macro uses the processor names given
21069 above.  In other words, it has the full prefix and does not
21070 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
21071 the macro names the resolved architecture (either @code{"mips1"} or
21072 @code{"mips3"}).  It names the default architecture when no
21073 @option{-march} option is given.
21075 @item -mtune=@var{arch}
21076 @opindex mtune
21077 Optimize for @var{arch}.  Among other things, this option controls
21078 the way instructions are scheduled, and the perceived cost of arithmetic
21079 operations.  The list of @var{arch} values is the same as for
21080 @option{-march}.
21082 When this option is not used, GCC optimizes for the processor
21083 specified by @option{-march}.  By using @option{-march} and
21084 @option{-mtune} together, it is possible to generate code that
21085 runs on a family of processors, but optimize the code for one
21086 particular member of that family.
21088 @option{-mtune} defines the macros @code{_MIPS_TUNE} and
21089 @code{_MIPS_TUNE_@var{foo}}, which work in the same way as the
21090 @option{-march} ones described above.
21092 @item -mips1
21093 @opindex mips1
21094 Equivalent to @option{-march=mips1}.
21096 @item -mips2
21097 @opindex mips2
21098 Equivalent to @option{-march=mips2}.
21100 @item -mips3
21101 @opindex mips3
21102 Equivalent to @option{-march=mips3}.
21104 @item -mips4
21105 @opindex mips4
21106 Equivalent to @option{-march=mips4}.
21108 @item -mips32
21109 @opindex mips32
21110 Equivalent to @option{-march=mips32}.
21112 @item -mips32r3
21113 @opindex mips32r3
21114 Equivalent to @option{-march=mips32r3}.
21116 @item -mips32r5
21117 @opindex mips32r5
21118 Equivalent to @option{-march=mips32r5}.
21120 @item -mips32r6
21121 @opindex mips32r6
21122 Equivalent to @option{-march=mips32r6}.
21124 @item -mips64
21125 @opindex mips64
21126 Equivalent to @option{-march=mips64}.
21128 @item -mips64r2
21129 @opindex mips64r2
21130 Equivalent to @option{-march=mips64r2}.
21132 @item -mips64r3
21133 @opindex mips64r3
21134 Equivalent to @option{-march=mips64r3}.
21136 @item -mips64r5
21137 @opindex mips64r5
21138 Equivalent to @option{-march=mips64r5}.
21140 @item -mips64r6
21141 @opindex mips64r6
21142 Equivalent to @option{-march=mips64r6}.
21144 @item -mips16
21145 @itemx -mno-mips16
21146 @opindex mips16
21147 @opindex mno-mips16
21148 Generate (do not generate) MIPS16 code.  If GCC is targeting a
21149 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
21151 MIPS16 code generation can also be controlled on a per-function basis
21152 by means of @code{mips16} and @code{nomips16} attributes.
21153 @xref{Function Attributes}, for more information.
21155 @item -mflip-mips16
21156 @opindex mflip-mips16
21157 Generate MIPS16 code on alternating functions.  This option is provided
21158 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
21159 not intended for ordinary use in compiling user code.
21161 @item -minterlink-compressed
21162 @itemx -mno-interlink-compressed
21163 @opindex minterlink-compressed
21164 @opindex mno-interlink-compressed
21165 Require (do not require) that code using the standard (uncompressed) MIPS ISA
21166 be link-compatible with MIPS16 and microMIPS code, and vice versa.
21168 For example, code using the standard ISA encoding cannot jump directly
21169 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
21170 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
21171 knows that the target of the jump is not compressed.
21173 @item -minterlink-mips16
21174 @itemx -mno-interlink-mips16
21175 @opindex minterlink-mips16
21176 @opindex mno-interlink-mips16
21177 Aliases of @option{-minterlink-compressed} and
21178 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
21179 and are retained for backwards compatibility.
21181 @item -mabi=32
21182 @itemx -mabi=o64
21183 @itemx -mabi=n32
21184 @itemx -mabi=64
21185 @itemx -mabi=eabi
21186 @opindex mabi=32
21187 @opindex mabi=o64
21188 @opindex mabi=n32
21189 @opindex mabi=64
21190 @opindex mabi=eabi
21191 Generate code for the given ABI@.
21193 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
21194 generates 64-bit code when you select a 64-bit architecture, but you
21195 can use @option{-mgp32} to get 32-bit code instead.
21197 For information about the O64 ABI, see
21198 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
21200 GCC supports a variant of the o32 ABI in which floating-point registers
21201 are 64 rather than 32 bits wide.  You can select this combination with
21202 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
21203 and @code{mfhc1} instructions and is therefore only supported for
21204 MIPS32R2, MIPS32R3 and MIPS32R5 processors.
21206 The register assignments for arguments and return values remain the
21207 same, but each scalar value is passed in a single 64-bit register
21208 rather than a pair of 32-bit registers.  For example, scalar
21209 floating-point values are returned in @samp{$f0} only, not a
21210 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
21211 remains the same in that the even-numbered double-precision registers
21212 are saved.
21214 Two additional variants of the o32 ABI are supported to enable
21215 a transition from 32-bit to 64-bit registers.  These are FPXX
21216 (@option{-mfpxx}) and FP64A (@option{-mfp64} @option{-mno-odd-spreg}).
21217 The FPXX extension mandates that all code must execute correctly
21218 when run using 32-bit or 64-bit registers.  The code can be interlinked
21219 with either FP32 or FP64, but not both.
21220 The FP64A extension is similar to the FP64 extension but forbids the
21221 use of odd-numbered single-precision registers.  This can be used
21222 in conjunction with the @code{FRE} mode of FPUs in MIPS32R5
21223 processors and allows both FP32 and FP64A code to interlink and
21224 run in the same process without changing FPU modes.
21226 @item -mabicalls
21227 @itemx -mno-abicalls
21228 @opindex mabicalls
21229 @opindex mno-abicalls
21230 Generate (do not generate) code that is suitable for SVR4-style
21231 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
21232 systems.
21234 @item -mshared
21235 @itemx -mno-shared
21236 Generate (do not generate) code that is fully position-independent,
21237 and that can therefore be linked into shared libraries.  This option
21238 only affects @option{-mabicalls}.
21240 All @option{-mabicalls} code has traditionally been position-independent,
21241 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
21242 as an extension, the GNU toolchain allows executables to use absolute
21243 accesses for locally-binding symbols.  It can also use shorter GP
21244 initialization sequences and generate direct calls to locally-defined
21245 functions.  This mode is selected by @option{-mno-shared}.
21247 @option{-mno-shared} depends on binutils 2.16 or higher and generates
21248 objects that can only be linked by the GNU linker.  However, the option
21249 does not affect the ABI of the final executable; it only affects the ABI
21250 of relocatable objects.  Using @option{-mno-shared} generally makes
21251 executables both smaller and quicker.
21253 @option{-mshared} is the default.
21255 @item -mplt
21256 @itemx -mno-plt
21257 @opindex mplt
21258 @opindex mno-plt
21259 Assume (do not assume) that the static and dynamic linkers
21260 support PLTs and copy relocations.  This option only affects
21261 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
21262 has no effect without @option{-msym32}.
21264 You can make @option{-mplt} the default by configuring
21265 GCC with @option{--with-mips-plt}.  The default is
21266 @option{-mno-plt} otherwise.
21268 @item -mxgot
21269 @itemx -mno-xgot
21270 @opindex mxgot
21271 @opindex mno-xgot
21272 Lift (do not lift) the usual restrictions on the size of the global
21273 offset table.
21275 GCC normally uses a single instruction to load values from the GOT@.
21276 While this is relatively efficient, it only works if the GOT
21277 is smaller than about 64k.  Anything larger causes the linker
21278 to report an error such as:
21280 @cindex relocation truncated to fit (MIPS)
21281 @smallexample
21282 relocation truncated to fit: R_MIPS_GOT16 foobar
21283 @end smallexample
21285 If this happens, you should recompile your code with @option{-mxgot}.
21286 This works with very large GOTs, although the code is also
21287 less efficient, since it takes three instructions to fetch the
21288 value of a global symbol.
21290 Note that some linkers can create multiple GOTs.  If you have such a
21291 linker, you should only need to use @option{-mxgot} when a single object
21292 file accesses more than 64k's worth of GOT entries.  Very few do.
21294 These options have no effect unless GCC is generating position
21295 independent code.
21297 @item -mgp32
21298 @opindex mgp32
21299 Assume that general-purpose registers are 32 bits wide.
21301 @item -mgp64
21302 @opindex mgp64
21303 Assume that general-purpose registers are 64 bits wide.
21305 @item -mfp32
21306 @opindex mfp32
21307 Assume that floating-point registers are 32 bits wide.
21309 @item -mfp64
21310 @opindex mfp64
21311 Assume that floating-point registers are 64 bits wide.
21313 @item -mfpxx
21314 @opindex mfpxx
21315 Do not assume the width of floating-point registers.
21317 @item -mhard-float
21318 @opindex mhard-float
21319 Use floating-point coprocessor instructions.
21321 @item -msoft-float
21322 @opindex msoft-float
21323 Do not use floating-point coprocessor instructions.  Implement
21324 floating-point calculations using library calls instead.
21326 @item -mno-float
21327 @opindex mno-float
21328 Equivalent to @option{-msoft-float}, but additionally asserts that the
21329 program being compiled does not perform any floating-point operations.
21330 This option is presently supported only by some bare-metal MIPS
21331 configurations, where it may select a special set of libraries
21332 that lack all floating-point support (including, for example, the
21333 floating-point @code{printf} formats).  
21334 If code compiled with @option{-mno-float} accidentally contains
21335 floating-point operations, it is likely to suffer a link-time
21336 or run-time failure.
21338 @item -msingle-float
21339 @opindex msingle-float
21340 Assume that the floating-point coprocessor only supports single-precision
21341 operations.
21343 @item -mdouble-float
21344 @opindex mdouble-float
21345 Assume that the floating-point coprocessor supports double-precision
21346 operations.  This is the default.
21348 @item -modd-spreg
21349 @itemx -mno-odd-spreg
21350 @opindex modd-spreg
21351 @opindex mno-odd-spreg
21352 Enable the use of odd-numbered single-precision floating-point registers
21353 for the o32 ABI.  This is the default for processors that are known to
21354 support these registers.  When using the o32 FPXX ABI, @option{-mno-odd-spreg}
21355 is set by default.
21357 @item -mabs=2008
21358 @itemx -mabs=legacy
21359 @opindex mabs=2008
21360 @opindex mabs=legacy
21361 These options control the treatment of the special not-a-number (NaN)
21362 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
21363 @code{neg.@i{fmt}} machine instructions.
21365 By default or when @option{-mabs=legacy} is used the legacy
21366 treatment is selected.  In this case these instructions are considered
21367 arithmetic and avoided where correct operation is required and the
21368 input operand might be a NaN.  A longer sequence of instructions that
21369 manipulate the sign bit of floating-point datum manually is used
21370 instead unless the @option{-ffinite-math-only} option has also been
21371 specified.
21373 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
21374 this case these instructions are considered non-arithmetic and therefore
21375 operating correctly in all cases, including in particular where the
21376 input operand is a NaN.  These instructions are therefore always used
21377 for the respective operations.
21379 @item -mnan=2008
21380 @itemx -mnan=legacy
21381 @opindex mnan=2008
21382 @opindex mnan=legacy
21383 These options control the encoding of the special not-a-number (NaN)
21384 IEEE 754 floating-point data.
21386 The @option{-mnan=legacy} option selects the legacy encoding.  In this
21387 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
21388 significand field being 0, whereas signaling NaNs (sNaNs) are denoted
21389 by the first bit of their trailing significand field being 1.
21391 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
21392 this case qNaNs are denoted by the first bit of their trailing
21393 significand field being 1, whereas sNaNs are denoted by the first bit of
21394 their trailing significand field being 0.
21396 The default is @option{-mnan=legacy} unless GCC has been configured with
21397 @option{--with-nan=2008}.
21399 @item -mllsc
21400 @itemx -mno-llsc
21401 @opindex mllsc
21402 @opindex mno-llsc
21403 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
21404 implement atomic memory built-in functions.  When neither option is
21405 specified, GCC uses the instructions if the target architecture
21406 supports them.
21408 @option{-mllsc} is useful if the runtime environment can emulate the
21409 instructions and @option{-mno-llsc} can be useful when compiling for
21410 nonstandard ISAs.  You can make either option the default by
21411 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
21412 respectively.  @option{--with-llsc} is the default for some
21413 configurations; see the installation documentation for details.
21415 @item -mdsp
21416 @itemx -mno-dsp
21417 @opindex mdsp
21418 @opindex mno-dsp
21419 Use (do not use) revision 1 of the MIPS DSP ASE@.
21420 @xref{MIPS DSP Built-in Functions}.  This option defines the
21421 preprocessor macro @code{__mips_dsp}.  It also defines
21422 @code{__mips_dsp_rev} to 1.
21424 @item -mdspr2
21425 @itemx -mno-dspr2
21426 @opindex mdspr2
21427 @opindex mno-dspr2
21428 Use (do not use) revision 2 of the MIPS DSP ASE@.
21429 @xref{MIPS DSP Built-in Functions}.  This option defines the
21430 preprocessor macros @code{__mips_dsp} and @code{__mips_dspr2}.
21431 It also defines @code{__mips_dsp_rev} to 2.
21433 @item -msmartmips
21434 @itemx -mno-smartmips
21435 @opindex msmartmips
21436 @opindex mno-smartmips
21437 Use (do not use) the MIPS SmartMIPS ASE.
21439 @item -mpaired-single
21440 @itemx -mno-paired-single
21441 @opindex mpaired-single
21442 @opindex mno-paired-single
21443 Use (do not use) paired-single floating-point instructions.
21444 @xref{MIPS Paired-Single Support}.  This option requires
21445 hardware floating-point support to be enabled.
21447 @item -mdmx
21448 @itemx -mno-mdmx
21449 @opindex mdmx
21450 @opindex mno-mdmx
21451 Use (do not use) MIPS Digital Media Extension instructions.
21452 This option can only be used when generating 64-bit code and requires
21453 hardware floating-point support to be enabled.
21455 @item -mips3d
21456 @itemx -mno-mips3d
21457 @opindex mips3d
21458 @opindex mno-mips3d
21459 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
21460 The option @option{-mips3d} implies @option{-mpaired-single}.
21462 @item -mmicromips
21463 @itemx -mno-micromips
21464 @opindex mmicromips
21465 @opindex mno-mmicromips
21466 Generate (do not generate) microMIPS code.
21468 MicroMIPS code generation can also be controlled on a per-function basis
21469 by means of @code{micromips} and @code{nomicromips} attributes.
21470 @xref{Function Attributes}, for more information.
21472 @item -mmt
21473 @itemx -mno-mt
21474 @opindex mmt
21475 @opindex mno-mt
21476 Use (do not use) MT Multithreading instructions.
21478 @item -mmcu
21479 @itemx -mno-mcu
21480 @opindex mmcu
21481 @opindex mno-mcu
21482 Use (do not use) the MIPS MCU ASE instructions.
21484 @item -meva
21485 @itemx -mno-eva
21486 @opindex meva
21487 @opindex mno-eva
21488 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
21490 @item -mvirt
21491 @itemx -mno-virt
21492 @opindex mvirt
21493 @opindex mno-virt
21494 Use (do not use) the MIPS Virtualization (VZ) instructions.
21496 @item -mxpa
21497 @itemx -mno-xpa
21498 @opindex mxpa
21499 @opindex mno-xpa
21500 Use (do not use) the MIPS eXtended Physical Address (XPA) instructions.
21502 @item -mcrc
21503 @itemx -mno-crc
21504 @opindex mcrc
21505 @opindex mno-crc
21506 Use (do not use) the MIPS Cyclic Redundancy Check (CRC) instructions.
21508 @item -mginv
21509 @itemx -mno-ginv
21510 @opindex mginv
21511 @opindex mno-ginv
21512 Use (do not use) the MIPS Global INValidate (GINV) instructions.
21514 @item -mloongson-mmi
21515 @itemx -mno-loongson-mmi
21516 @opindex mloongson-mmi
21517 @opindex mno-loongson-mmi
21518 Use (do not use) the MIPS Loongson MultiMedia extensions Instructions (MMI).
21520 @item -mloongson-ext
21521 @itemx -mno-loongson-ext
21522 @opindex mloongson-ext
21523 @opindex mno-loongson-ext
21524 Use (do not use) the MIPS Loongson EXTensions (EXT) instructions.
21526 @item -mloongson-ext2
21527 @itemx -mno-loongson-ext2
21528 @opindex mloongson-ext2
21529 @opindex mno-loongson-ext2
21530 Use (do not use) the MIPS Loongson EXTensions r2 (EXT2) instructions.
21532 @item -mlong64
21533 @opindex mlong64
21534 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
21535 an explanation of the default and the way that the pointer size is
21536 determined.
21538 @item -mlong32
21539 @opindex mlong32
21540 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
21542 The default size of @code{int}s, @code{long}s and pointers depends on
21543 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
21544 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
21545 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
21546 or the same size as integer registers, whichever is smaller.
21548 @item -msym32
21549 @itemx -mno-sym32
21550 @opindex msym32
21551 @opindex mno-sym32
21552 Assume (do not assume) that all symbols have 32-bit values, regardless
21553 of the selected ABI@.  This option is useful in combination with
21554 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
21555 to generate shorter and faster references to symbolic addresses.
21557 @item -G @var{num}
21558 @opindex G
21559 Put definitions of externally-visible data in a small data section
21560 if that data is no bigger than @var{num} bytes.  GCC can then generate
21561 more efficient accesses to the data; see @option{-mgpopt} for details.
21563 The default @option{-G} option depends on the configuration.
21565 @item -mlocal-sdata
21566 @itemx -mno-local-sdata
21567 @opindex mlocal-sdata
21568 @opindex mno-local-sdata
21569 Extend (do not extend) the @option{-G} behavior to local data too,
21570 such as to static variables in C@.  @option{-mlocal-sdata} is the
21571 default for all configurations.
21573 If the linker complains that an application is using too much small data,
21574 you might want to try rebuilding the less performance-critical parts with
21575 @option{-mno-local-sdata}.  You might also want to build large
21576 libraries with @option{-mno-local-sdata}, so that the libraries leave
21577 more room for the main program.
21579 @item -mextern-sdata
21580 @itemx -mno-extern-sdata
21581 @opindex mextern-sdata
21582 @opindex mno-extern-sdata
21583 Assume (do not assume) that externally-defined data is in
21584 a small data section if the size of that data is within the @option{-G} limit.
21585 @option{-mextern-sdata} is the default for all configurations.
21587 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
21588 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
21589 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
21590 is placed in a small data section.  If @var{Var} is defined by another
21591 module, you must either compile that module with a high-enough
21592 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
21593 definition.  If @var{Var} is common, you must link the application
21594 with a high-enough @option{-G} setting.
21596 The easiest way of satisfying these restrictions is to compile
21597 and link every module with the same @option{-G} option.  However,
21598 you may wish to build a library that supports several different
21599 small data limits.  You can do this by compiling the library with
21600 the highest supported @option{-G} setting and additionally using
21601 @option{-mno-extern-sdata} to stop the library from making assumptions
21602 about externally-defined data.
21604 @item -mgpopt
21605 @itemx -mno-gpopt
21606 @opindex mgpopt
21607 @opindex mno-gpopt
21608 Use (do not use) GP-relative accesses for symbols that are known to be
21609 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
21610 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
21611 configurations.
21613 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
21614 might not hold the value of @code{_gp}.  For example, if the code is
21615 part of a library that might be used in a boot monitor, programs that
21616 call boot monitor routines pass an unknown value in @code{$gp}.
21617 (In such situations, the boot monitor itself is usually compiled
21618 with @option{-G0}.)
21620 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
21621 @option{-mno-extern-sdata}.
21623 @item -membedded-data
21624 @itemx -mno-embedded-data
21625 @opindex membedded-data
21626 @opindex mno-embedded-data
21627 Allocate variables to the read-only data section first if possible, then
21628 next in the small data section if possible, otherwise in data.  This gives
21629 slightly slower code than the default, but reduces the amount of RAM required
21630 when executing, and thus may be preferred for some embedded systems.
21632 @item -muninit-const-in-rodata
21633 @itemx -mno-uninit-const-in-rodata
21634 @opindex muninit-const-in-rodata
21635 @opindex mno-uninit-const-in-rodata
21636 Put uninitialized @code{const} variables in the read-only data section.
21637 This option is only meaningful in conjunction with @option{-membedded-data}.
21639 @item -mcode-readable=@var{setting}
21640 @opindex mcode-readable
21641 Specify whether GCC may generate code that reads from executable sections.
21642 There are three possible settings:
21644 @table @gcctabopt
21645 @item -mcode-readable=yes
21646 Instructions may freely access executable sections.  This is the
21647 default setting.
21649 @item -mcode-readable=pcrel
21650 MIPS16 PC-relative load instructions can access executable sections,
21651 but other instructions must not do so.  This option is useful on 4KSc
21652 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
21653 It is also useful on processors that can be configured to have a dual
21654 instruction/data SRAM interface and that, like the M4K, automatically
21655 redirect PC-relative loads to the instruction RAM.
21657 @item -mcode-readable=no
21658 Instructions must not access executable sections.  This option can be
21659 useful on targets that are configured to have a dual instruction/data
21660 SRAM interface but that (unlike the M4K) do not automatically redirect
21661 PC-relative loads to the instruction RAM.
21662 @end table
21664 @item -msplit-addresses
21665 @itemx -mno-split-addresses
21666 @opindex msplit-addresses
21667 @opindex mno-split-addresses
21668 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
21669 relocation operators.  This option has been superseded by
21670 @option{-mexplicit-relocs} but is retained for backwards compatibility.
21672 @item -mexplicit-relocs
21673 @itemx -mno-explicit-relocs
21674 @opindex mexplicit-relocs
21675 @opindex mno-explicit-relocs
21676 Use (do not use) assembler relocation operators when dealing with symbolic
21677 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
21678 is to use assembler macros instead.
21680 @option{-mexplicit-relocs} is the default if GCC was configured
21681 to use an assembler that supports relocation operators.
21683 @item -mcheck-zero-division
21684 @itemx -mno-check-zero-division
21685 @opindex mcheck-zero-division
21686 @opindex mno-check-zero-division
21687 Trap (do not trap) on integer division by zero.
21689 The default is @option{-mcheck-zero-division}.
21691 @item -mdivide-traps
21692 @itemx -mdivide-breaks
21693 @opindex mdivide-traps
21694 @opindex mdivide-breaks
21695 MIPS systems check for division by zero by generating either a
21696 conditional trap or a break instruction.  Using traps results in
21697 smaller code, but is only supported on MIPS II and later.  Also, some
21698 versions of the Linux kernel have a bug that prevents trap from
21699 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
21700 allow conditional traps on architectures that support them and
21701 @option{-mdivide-breaks} to force the use of breaks.
21703 The default is usually @option{-mdivide-traps}, but this can be
21704 overridden at configure time using @option{--with-divide=breaks}.
21705 Divide-by-zero checks can be completely disabled using
21706 @option{-mno-check-zero-division}.
21708 @item -mload-store-pairs
21709 @itemx -mno-load-store-pairs
21710 @opindex mload-store-pairs
21711 @opindex mno-load-store-pairs
21712 Enable (disable) an optimization that pairs consecutive load or store
21713 instructions to enable load/store bonding.  This option is enabled by
21714 default but only takes effect when the selected architecture is known
21715 to support bonding.
21717 @item -mmemcpy
21718 @itemx -mno-memcpy
21719 @opindex mmemcpy
21720 @opindex mno-memcpy
21721 Force (do not force) the use of @code{memcpy} for non-trivial block
21722 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
21723 most constant-sized copies.
21725 @item -mlong-calls
21726 @itemx -mno-long-calls
21727 @opindex mlong-calls
21728 @opindex mno-long-calls
21729 Disable (do not disable) use of the @code{jal} instruction.  Calling
21730 functions using @code{jal} is more efficient but requires the caller
21731 and callee to be in the same 256 megabyte segment.
21733 This option has no effect on abicalls code.  The default is
21734 @option{-mno-long-calls}.
21736 @item -mmad
21737 @itemx -mno-mad
21738 @opindex mmad
21739 @opindex mno-mad
21740 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
21741 instructions, as provided by the R4650 ISA@.
21743 @item -mimadd
21744 @itemx -mno-imadd
21745 @opindex mimadd
21746 @opindex mno-imadd
21747 Enable (disable) use of the @code{madd} and @code{msub} integer
21748 instructions.  The default is @option{-mimadd} on architectures
21749 that support @code{madd} and @code{msub} except for the 74k 
21750 architecture where it was found to generate slower code.
21752 @item -mfused-madd
21753 @itemx -mno-fused-madd
21754 @opindex mfused-madd
21755 @opindex mno-fused-madd
21756 Enable (disable) use of the floating-point multiply-accumulate
21757 instructions, when they are available.  The default is
21758 @option{-mfused-madd}.
21760 On the R8000 CPU when multiply-accumulate instructions are used,
21761 the intermediate product is calculated to infinite precision
21762 and is not subject to the FCSR Flush to Zero bit.  This may be
21763 undesirable in some circumstances.  On other processors the result
21764 is numerically identical to the equivalent computation using
21765 separate multiply, add, subtract and negate instructions.
21767 @item -nocpp
21768 @opindex nocpp
21769 Tell the MIPS assembler to not run its preprocessor over user
21770 assembler files (with a @samp{.s} suffix) when assembling them.
21772 @item -mfix-24k
21773 @itemx -mno-fix-24k
21774 @opindex mfix-24k
21775 @opindex mno-fix-24k
21776 Work around the 24K E48 (lost data on stores during refill) errata.
21777 The workarounds are implemented by the assembler rather than by GCC@.
21779 @item -mfix-r4000
21780 @itemx -mno-fix-r4000
21781 @opindex mfix-r4000
21782 @opindex mno-fix-r4000
21783 Work around certain R4000 CPU errata:
21784 @itemize @minus
21785 @item
21786 A double-word or a variable shift may give an incorrect result if executed
21787 immediately after starting an integer division.
21788 @item
21789 A double-word or a variable shift may give an incorrect result if executed
21790 while an integer multiplication is in progress.
21791 @item
21792 An integer division may give an incorrect result if started in a delay slot
21793 of a taken branch or a jump.
21794 @end itemize
21796 @item -mfix-r4400
21797 @itemx -mno-fix-r4400
21798 @opindex mfix-r4400
21799 @opindex mno-fix-r4400
21800 Work around certain R4400 CPU errata:
21801 @itemize @minus
21802 @item
21803 A double-word or a variable shift may give an incorrect result if executed
21804 immediately after starting an integer division.
21805 @end itemize
21807 @item -mfix-r10000
21808 @itemx -mno-fix-r10000
21809 @opindex mfix-r10000
21810 @opindex mno-fix-r10000
21811 Work around certain R10000 errata:
21812 @itemize @minus
21813 @item
21814 @code{ll}/@code{sc} sequences may not behave atomically on revisions
21815 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
21816 @end itemize
21818 This option can only be used if the target architecture supports
21819 branch-likely instructions.  @option{-mfix-r10000} is the default when
21820 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
21821 otherwise.
21823 @item -mfix-rm7000
21824 @itemx -mno-fix-rm7000
21825 @opindex mfix-rm7000
21826 Work around the RM7000 @code{dmult}/@code{dmultu} errata.  The
21827 workarounds are implemented by the assembler rather than by GCC@.
21829 @item -mfix-vr4120
21830 @itemx -mno-fix-vr4120
21831 @opindex mfix-vr4120
21832 Work around certain VR4120 errata:
21833 @itemize @minus
21834 @item
21835 @code{dmultu} does not always produce the correct result.
21836 @item
21837 @code{div} and @code{ddiv} do not always produce the correct result if one
21838 of the operands is negative.
21839 @end itemize
21840 The workarounds for the division errata rely on special functions in
21841 @file{libgcc.a}.  At present, these functions are only provided by
21842 the @code{mips64vr*-elf} configurations.
21844 Other VR4120 errata require a NOP to be inserted between certain pairs of
21845 instructions.  These errata are handled by the assembler, not by GCC itself.
21847 @item -mfix-vr4130
21848 @opindex mfix-vr4130
21849 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
21850 workarounds are implemented by the assembler rather than by GCC,
21851 although GCC avoids using @code{mflo} and @code{mfhi} if the
21852 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
21853 instructions are available instead.
21855 @item -mfix-sb1
21856 @itemx -mno-fix-sb1
21857 @opindex mfix-sb1
21858 Work around certain SB-1 CPU core errata.
21859 (This flag currently works around the SB-1 revision 2
21860 ``F1'' and ``F2'' floating-point errata.)
21862 @item -mr10k-cache-barrier=@var{setting}
21863 @opindex mr10k-cache-barrier
21864 Specify whether GCC should insert cache barriers to avoid the
21865 side effects of speculation on R10K processors.
21867 In common with many processors, the R10K tries to predict the outcome
21868 of a conditional branch and speculatively executes instructions from
21869 the ``taken'' branch.  It later aborts these instructions if the
21870 predicted outcome is wrong.  However, on the R10K, even aborted
21871 instructions can have side effects.
21873 This problem only affects kernel stores and, depending on the system,
21874 kernel loads.  As an example, a speculatively-executed store may load
21875 the target memory into cache and mark the cache line as dirty, even if
21876 the store itself is later aborted.  If a DMA operation writes to the
21877 same area of memory before the ``dirty'' line is flushed, the cached
21878 data overwrites the DMA-ed data.  See the R10K processor manual
21879 for a full description, including other potential problems.
21881 One workaround is to insert cache barrier instructions before every memory
21882 access that might be speculatively executed and that might have side
21883 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
21884 controls GCC's implementation of this workaround.  It assumes that
21885 aborted accesses to any byte in the following regions does not have
21886 side effects:
21888 @enumerate
21889 @item
21890 the memory occupied by the current function's stack frame;
21892 @item
21893 the memory occupied by an incoming stack argument;
21895 @item
21896 the memory occupied by an object with a link-time-constant address.
21897 @end enumerate
21899 It is the kernel's responsibility to ensure that speculative
21900 accesses to these regions are indeed safe.
21902 If the input program contains a function declaration such as:
21904 @smallexample
21905 void foo (void);
21906 @end smallexample
21908 then the implementation of @code{foo} must allow @code{j foo} and
21909 @code{jal foo} to be executed speculatively.  GCC honors this
21910 restriction for functions it compiles itself.  It expects non-GCC
21911 functions (such as hand-written assembly code) to do the same.
21913 The option has three forms:
21915 @table @gcctabopt
21916 @item -mr10k-cache-barrier=load-store
21917 Insert a cache barrier before a load or store that might be
21918 speculatively executed and that might have side effects even
21919 if aborted.
21921 @item -mr10k-cache-barrier=store
21922 Insert a cache barrier before a store that might be speculatively
21923 executed and that might have side effects even if aborted.
21925 @item -mr10k-cache-barrier=none
21926 Disable the insertion of cache barriers.  This is the default setting.
21927 @end table
21929 @item -mflush-func=@var{func}
21930 @itemx -mno-flush-func
21931 @opindex mflush-func
21932 Specifies the function to call to flush the I and D caches, or to not
21933 call any such function.  If called, the function must take the same
21934 arguments as the common @code{_flush_func}, that is, the address of the
21935 memory range for which the cache is being flushed, the size of the
21936 memory range, and the number 3 (to flush both caches).  The default
21937 depends on the target GCC was configured for, but commonly is either
21938 @code{_flush_func} or @code{__cpu_flush}.
21940 @item mbranch-cost=@var{num}
21941 @opindex mbranch-cost
21942 Set the cost of branches to roughly @var{num} ``simple'' instructions.
21943 This cost is only a heuristic and is not guaranteed to produce
21944 consistent results across releases.  A zero cost redundantly selects
21945 the default, which is based on the @option{-mtune} setting.
21947 @item -mbranch-likely
21948 @itemx -mno-branch-likely
21949 @opindex mbranch-likely
21950 @opindex mno-branch-likely
21951 Enable or disable use of Branch Likely instructions, regardless of the
21952 default for the selected architecture.  By default, Branch Likely
21953 instructions may be generated if they are supported by the selected
21954 architecture.  An exception is for the MIPS32 and MIPS64 architectures
21955 and processors that implement those architectures; for those, Branch
21956 Likely instructions are not be generated by default because the MIPS32
21957 and MIPS64 architectures specifically deprecate their use.
21959 @item -mcompact-branches=never
21960 @itemx -mcompact-branches=optimal
21961 @itemx -mcompact-branches=always
21962 @opindex mcompact-branches=never
21963 @opindex mcompact-branches=optimal
21964 @opindex mcompact-branches=always
21965 These options control which form of branches will be generated.  The
21966 default is @option{-mcompact-branches=optimal}.
21968 The @option{-mcompact-branches=never} option ensures that compact branch
21969 instructions will never be generated.
21971 The @option{-mcompact-branches=always} option ensures that a compact
21972 branch instruction will be generated if available.  If a compact branch
21973 instruction is not available, a delay slot form of the branch will be
21974 used instead.
21976 This option is supported from MIPS Release 6 onwards.
21978 The @option{-mcompact-branches=optimal} option will cause a delay slot
21979 branch to be used if one is available in the current ISA and the delay
21980 slot is successfully filled.  If the delay slot is not filled, a compact
21981 branch will be chosen if one is available.
21983 @item -mfp-exceptions
21984 @itemx -mno-fp-exceptions
21985 @opindex mfp-exceptions
21986 Specifies whether FP exceptions are enabled.  This affects how
21987 FP instructions are scheduled for some processors.
21988 The default is that FP exceptions are
21989 enabled.
21991 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
21992 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
21993 FP pipe.
21995 @item -mvr4130-align
21996 @itemx -mno-vr4130-align
21997 @opindex mvr4130-align
21998 The VR4130 pipeline is two-way superscalar, but can only issue two
21999 instructions together if the first one is 8-byte aligned.  When this
22000 option is enabled, GCC aligns pairs of instructions that it
22001 thinks should execute in parallel.
22003 This option only has an effect when optimizing for the VR4130.
22004 It normally makes code faster, but at the expense of making it bigger.
22005 It is enabled by default at optimization level @option{-O3}.
22007 @item -msynci
22008 @itemx -mno-synci
22009 @opindex msynci
22010 Enable (disable) generation of @code{synci} instructions on
22011 architectures that support it.  The @code{synci} instructions (if
22012 enabled) are generated when @code{__builtin___clear_cache} is
22013 compiled.
22015 This option defaults to @option{-mno-synci}, but the default can be
22016 overridden by configuring GCC with @option{--with-synci}.
22018 When compiling code for single processor systems, it is generally safe
22019 to use @code{synci}.  However, on many multi-core (SMP) systems, it
22020 does not invalidate the instruction caches on all cores and may lead
22021 to undefined behavior.
22023 @item -mrelax-pic-calls
22024 @itemx -mno-relax-pic-calls
22025 @opindex mrelax-pic-calls
22026 Try to turn PIC calls that are normally dispatched via register
22027 @code{$25} into direct calls.  This is only possible if the linker can
22028 resolve the destination at link time and if the destination is within
22029 range for a direct call.
22031 @option{-mrelax-pic-calls} is the default if GCC was configured to use
22032 an assembler and a linker that support the @code{.reloc} assembly
22033 directive and @option{-mexplicit-relocs} is in effect.  With
22034 @option{-mno-explicit-relocs}, this optimization can be performed by the
22035 assembler and the linker alone without help from the compiler.
22037 @item -mmcount-ra-address
22038 @itemx -mno-mcount-ra-address
22039 @opindex mmcount-ra-address
22040 @opindex mno-mcount-ra-address
22041 Emit (do not emit) code that allows @code{_mcount} to modify the
22042 calling function's return address.  When enabled, this option extends
22043 the usual @code{_mcount} interface with a new @var{ra-address}
22044 parameter, which has type @code{intptr_t *} and is passed in register
22045 @code{$12}.  @code{_mcount} can then modify the return address by
22046 doing both of the following:
22047 @itemize
22048 @item
22049 Returning the new address in register @code{$31}.
22050 @item
22051 Storing the new address in @code{*@var{ra-address}},
22052 if @var{ra-address} is nonnull.
22053 @end itemize
22055 The default is @option{-mno-mcount-ra-address}.
22057 @item -mframe-header-opt
22058 @itemx -mno-frame-header-opt
22059 @opindex mframe-header-opt
22060 Enable (disable) frame header optimization in the o32 ABI.  When using the
22061 o32 ABI, calling functions will allocate 16 bytes on the stack for the called
22062 function to write out register arguments.  When enabled, this optimization
22063 will suppress the allocation of the frame header if it can be determined that
22064 it is unused.
22066 This optimization is off by default at all optimization levels.
22068 @item -mlxc1-sxc1
22069 @itemx -mno-lxc1-sxc1
22070 @opindex mlxc1-sxc1
22071 When applicable, enable (disable) the generation of @code{lwxc1},
22072 @code{swxc1}, @code{ldxc1}, @code{sdxc1} instructions.  Enabled by default.
22074 @item -mmadd4
22075 @itemx -mno-madd4
22076 @opindex mmadd4
22077 When applicable, enable (disable) the generation of 4-operand @code{madd.s},
22078 @code{madd.d} and related instructions.  Enabled by default.
22080 @end table
22082 @node MMIX Options
22083 @subsection MMIX Options
22084 @cindex MMIX Options
22086 These options are defined for the MMIX:
22088 @table @gcctabopt
22089 @item -mlibfuncs
22090 @itemx -mno-libfuncs
22091 @opindex mlibfuncs
22092 @opindex mno-libfuncs
22093 Specify that intrinsic library functions are being compiled, passing all
22094 values in registers, no matter the size.
22096 @item -mepsilon
22097 @itemx -mno-epsilon
22098 @opindex mepsilon
22099 @opindex mno-epsilon
22100 Generate floating-point comparison instructions that compare with respect
22101 to the @code{rE} epsilon register.
22103 @item -mabi=mmixware
22104 @itemx -mabi=gnu
22105 @opindex mabi=mmixware
22106 @opindex mabi=gnu
22107 Generate code that passes function parameters and return values that (in
22108 the called function) are seen as registers @code{$0} and up, as opposed to
22109 the GNU ABI which uses global registers @code{$231} and up.
22111 @item -mzero-extend
22112 @itemx -mno-zero-extend
22113 @opindex mzero-extend
22114 @opindex mno-zero-extend
22115 When reading data from memory in sizes shorter than 64 bits, use (do not
22116 use) zero-extending load instructions by default, rather than
22117 sign-extending ones.
22119 @item -mknuthdiv
22120 @itemx -mno-knuthdiv
22121 @opindex mknuthdiv
22122 @opindex mno-knuthdiv
22123 Make the result of a division yielding a remainder have the same sign as
22124 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
22125 remainder follows the sign of the dividend.  Both methods are
22126 arithmetically valid, the latter being almost exclusively used.
22128 @item -mtoplevel-symbols
22129 @itemx -mno-toplevel-symbols
22130 @opindex mtoplevel-symbols
22131 @opindex mno-toplevel-symbols
22132 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
22133 code can be used with the @code{PREFIX} assembly directive.
22135 @item -melf
22136 @opindex melf
22137 Generate an executable in the ELF format, rather than the default
22138 @samp{mmo} format used by the @command{mmix} simulator.
22140 @item -mbranch-predict
22141 @itemx -mno-branch-predict
22142 @opindex mbranch-predict
22143 @opindex mno-branch-predict
22144 Use (do not use) the probable-branch instructions, when static branch
22145 prediction indicates a probable branch.
22147 @item -mbase-addresses
22148 @itemx -mno-base-addresses
22149 @opindex mbase-addresses
22150 @opindex mno-base-addresses
22151 Generate (do not generate) code that uses @emph{base addresses}.  Using a
22152 base address automatically generates a request (handled by the assembler
22153 and the linker) for a constant to be set up in a global register.  The
22154 register is used for one or more base address requests within the range 0
22155 to 255 from the value held in the register.  The generally leads to short
22156 and fast code, but the number of different data items that can be
22157 addressed is limited.  This means that a program that uses lots of static
22158 data may require @option{-mno-base-addresses}.
22160 @item -msingle-exit
22161 @itemx -mno-single-exit
22162 @opindex msingle-exit
22163 @opindex mno-single-exit
22164 Force (do not force) generated code to have a single exit point in each
22165 function.
22166 @end table
22168 @node MN10300 Options
22169 @subsection MN10300 Options
22170 @cindex MN10300 options
22172 These @option{-m} options are defined for Matsushita MN10300 architectures:
22174 @table @gcctabopt
22175 @item -mmult-bug
22176 @opindex mmult-bug
22177 Generate code to avoid bugs in the multiply instructions for the MN10300
22178 processors.  This is the default.
22180 @item -mno-mult-bug
22181 @opindex mno-mult-bug
22182 Do not generate code to avoid bugs in the multiply instructions for the
22183 MN10300 processors.
22185 @item -mam33
22186 @opindex mam33
22187 Generate code using features specific to the AM33 processor.
22189 @item -mno-am33
22190 @opindex mno-am33
22191 Do not generate code using features specific to the AM33 processor.  This
22192 is the default.
22194 @item -mam33-2
22195 @opindex mam33-2
22196 Generate code using features specific to the AM33/2.0 processor.
22198 @item -mam34
22199 @opindex mam34
22200 Generate code using features specific to the AM34 processor.
22202 @item -mtune=@var{cpu-type}
22203 @opindex mtune
22204 Use the timing characteristics of the indicated CPU type when
22205 scheduling instructions.  This does not change the targeted processor
22206 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
22207 @samp{am33-2} or @samp{am34}.
22209 @item -mreturn-pointer-on-d0
22210 @opindex mreturn-pointer-on-d0
22211 When generating a function that returns a pointer, return the pointer
22212 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
22213 only in @code{a0}, and attempts to call such functions without a prototype
22214 result in errors.  Note that this option is on by default; use
22215 @option{-mno-return-pointer-on-d0} to disable it.
22217 @item -mno-crt0
22218 @opindex mno-crt0
22219 Do not link in the C run-time initialization object file.
22221 @item -mrelax
22222 @opindex mrelax
22223 Indicate to the linker that it should perform a relaxation optimization pass
22224 to shorten branches, calls and absolute memory addresses.  This option only
22225 has an effect when used on the command line for the final link step.
22227 This option makes symbolic debugging impossible.
22229 @item -mliw
22230 @opindex mliw
22231 Allow the compiler to generate @emph{Long Instruction Word}
22232 instructions if the target is the @samp{AM33} or later.  This is the
22233 default.  This option defines the preprocessor macro @code{__LIW__}.
22235 @item -mno-liw
22236 @opindex mno-liw
22237 Do not allow the compiler to generate @emph{Long Instruction Word}
22238 instructions.  This option defines the preprocessor macro
22239 @code{__NO_LIW__}.
22241 @item -msetlb
22242 @opindex msetlb
22243 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
22244 instructions if the target is the @samp{AM33} or later.  This is the
22245 default.  This option defines the preprocessor macro @code{__SETLB__}.
22247 @item -mno-setlb
22248 @opindex mno-setlb
22249 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
22250 instructions.  This option defines the preprocessor macro
22251 @code{__NO_SETLB__}.
22253 @end table
22255 @node Moxie Options
22256 @subsection Moxie Options
22257 @cindex Moxie Options
22259 @table @gcctabopt
22261 @item -meb
22262 @opindex meb
22263 Generate big-endian code.  This is the default for @samp{moxie-*-*}
22264 configurations.
22266 @item -mel
22267 @opindex mel
22268 Generate little-endian code.
22270 @item -mmul.x
22271 @opindex mmul.x
22272 Generate mul.x and umul.x instructions.  This is the default for
22273 @samp{moxiebox-*-*} configurations.
22275 @item -mno-crt0
22276 @opindex mno-crt0
22277 Do not link in the C run-time initialization object file.
22279 @end table
22281 @node MSP430 Options
22282 @subsection MSP430 Options
22283 @cindex MSP430 Options
22285 These options are defined for the MSP430:
22287 @table @gcctabopt
22289 @item -masm-hex
22290 @opindex masm-hex
22291 Force assembly output to always use hex constants.  Normally such
22292 constants are signed decimals, but this option is available for
22293 testsuite and/or aesthetic purposes.
22295 @item -mmcu=
22296 @opindex mmcu=
22297 Select the MCU to target.  This is used to create a C preprocessor
22298 symbol based upon the MCU name, converted to upper case and pre- and
22299 post-fixed with @samp{__}.  This in turn is used by the
22300 @file{msp430.h} header file to select an MCU-specific supplementary
22301 header file.
22303 The option also sets the ISA to use.  If the MCU name is one that is
22304 known to only support the 430 ISA then that is selected, otherwise the
22305 430X ISA is selected.  A generic MCU name of @samp{msp430} can also be
22306 used to select the 430 ISA.  Similarly the generic @samp{msp430x} MCU
22307 name selects the 430X ISA.
22309 In addition an MCU-specific linker script is added to the linker
22310 command line.  The script's name is the name of the MCU with
22311 @file{.ld} appended.  Thus specifying @option{-mmcu=xxx} on the @command{gcc}
22312 command line defines the C preprocessor symbol @code{__XXX__} and
22313 cause the linker to search for a script called @file{xxx.ld}.
22315 This option is also passed on to the assembler.
22317 @item -mwarn-mcu
22318 @itemx -mno-warn-mcu
22319 @opindex mwarn-mcu
22320 @opindex mno-warn-mcu
22321 This option enables or disables warnings about conflicts between the
22322 MCU name specified by the @option{-mmcu} option and the ISA set by the
22323 @option{-mcpu} option and/or the hardware multiply support set by the
22324 @option{-mhwmult} option.  It also toggles warnings about unrecognized
22325 MCU names.  This option is on by default.
22327 @item -mcpu=
22328 @opindex mcpu=
22329 Specifies the ISA to use.  Accepted values are @samp{msp430},
22330 @samp{msp430x} and @samp{msp430xv2}.  This option is deprecated.  The
22331 @option{-mmcu=} option should be used to select the ISA.
22333 @item -msim
22334 @opindex msim
22335 Link to the simulator runtime libraries and linker script.  Overrides
22336 any scripts that would be selected by the @option{-mmcu=} option.
22338 @item -mlarge
22339 @opindex mlarge
22340 Use large-model addressing (20-bit pointers, 32-bit @code{size_t}).
22342 @item -msmall
22343 @opindex msmall
22344 Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
22346 @item -mrelax
22347 @opindex mrelax
22348 This option is passed to the assembler and linker, and allows the
22349 linker to perform certain optimizations that cannot be done until
22350 the final link.
22352 @item mhwmult=
22353 @opindex mhwmult=
22354 Describes the type of hardware multiply supported by the target.
22355 Accepted values are @samp{none} for no hardware multiply, @samp{16bit}
22356 for the original 16-bit-only multiply supported by early MCUs.
22357 @samp{32bit} for the 16/32-bit multiply supported by later MCUs and
22358 @samp{f5series} for the 16/32-bit multiply supported by F5-series MCUs.
22359 A value of @samp{auto} can also be given.  This tells GCC to deduce
22360 the hardware multiply support based upon the MCU name provided by the
22361 @option{-mmcu} option.  If no @option{-mmcu} option is specified or if
22362 the MCU name is not recognized then no hardware multiply support is
22363 assumed.  @code{auto} is the default setting.
22365 Hardware multiplies are normally performed by calling a library
22366 routine.  This saves space in the generated code.  When compiling at
22367 @option{-O3} or higher however the hardware multiplier is invoked
22368 inline.  This makes for bigger, but faster code.
22370 The hardware multiply routines disable interrupts whilst running and
22371 restore the previous interrupt state when they finish.  This makes
22372 them safe to use inside interrupt handlers as well as in normal code.
22374 @item -minrt
22375 @opindex minrt
22376 Enable the use of a minimum runtime environment - no static
22377 initializers or constructors.  This is intended for memory-constrained
22378 devices.  The compiler includes special symbols in some objects
22379 that tell the linker and runtime which code fragments are required.
22381 @item -mcode-region=
22382 @itemx -mdata-region=
22383 @opindex mcode-region
22384 @opindex mdata-region
22385 These options tell the compiler where to place functions and data that
22386 do not have one of the @code{lower}, @code{upper}, @code{either} or
22387 @code{section} attributes.  Possible values are @code{lower},
22388 @code{upper}, @code{either} or @code{any}.  The first three behave
22389 like the corresponding attribute.  The fourth possible value -
22390 @code{any} - is the default.  It leaves placement entirely up to the
22391 linker script and how it assigns the standard sections
22392 (@code{.text}, @code{.data}, etc) to the memory regions.
22394 @item -msilicon-errata=
22395 @opindex msilicon-errata
22396 This option passes on a request to assembler to enable the fixes for
22397 the named silicon errata.
22399 @item -msilicon-errata-warn=
22400 @opindex msilicon-errata-warn
22401 This option passes on a request to the assembler to enable warning
22402 messages when a silicon errata might need to be applied.
22404 @end table
22406 @node NDS32 Options
22407 @subsection NDS32 Options
22408 @cindex NDS32 Options
22410 These options are defined for NDS32 implementations:
22412 @table @gcctabopt
22414 @item -mbig-endian
22415 @opindex mbig-endian
22416 Generate code in big-endian mode.
22418 @item -mlittle-endian
22419 @opindex mlittle-endian
22420 Generate code in little-endian mode.
22422 @item -mreduced-regs
22423 @opindex mreduced-regs
22424 Use reduced-set registers for register allocation.
22426 @item -mfull-regs
22427 @opindex mfull-regs
22428 Use full-set registers for register allocation.
22430 @item -mcmov
22431 @opindex mcmov
22432 Generate conditional move instructions.
22434 @item -mno-cmov
22435 @opindex mno-cmov
22436 Do not generate conditional move instructions.
22438 @item -mext-perf
22439 @opindex mext-perf
22440 Generate performance extension instructions.
22442 @item -mno-ext-perf
22443 @opindex mno-ext-perf
22444 Do not generate performance extension instructions.
22446 @item -mext-perf2
22447 @opindex mext-perf2
22448 Generate performance extension 2 instructions.
22450 @item -mno-ext-perf2
22451 @opindex mno-ext-perf2
22452 Do not generate performance extension 2 instructions.
22454 @item -mext-string
22455 @opindex mext-string
22456 Generate string extension instructions.
22458 @item -mno-ext-string
22459 @opindex mno-ext-string
22460 Do not generate string extension instructions.
22462 @item -mv3push
22463 @opindex mv3push
22464 Generate v3 push25/pop25 instructions.
22466 @item -mno-v3push
22467 @opindex mno-v3push
22468 Do not generate v3 push25/pop25 instructions.
22470 @item -m16-bit
22471 @opindex m16-bit
22472 Generate 16-bit instructions.
22474 @item -mno-16-bit
22475 @opindex mno-16-bit
22476 Do not generate 16-bit instructions.
22478 @item -misr-vector-size=@var{num}
22479 @opindex misr-vector-size
22480 Specify the size of each interrupt vector, which must be 4 or 16.
22482 @item -mcache-block-size=@var{num}
22483 @opindex mcache-block-size
22484 Specify the size of each cache block,
22485 which must be a power of 2 between 4 and 512.
22487 @item -march=@var{arch}
22488 @opindex march
22489 Specify the name of the target architecture.
22491 @item -mcmodel=@var{code-model}
22492 @opindex mcmodel
22493 Set the code model to one of
22494 @table @asis
22495 @item @samp{small}
22496 All the data and read-only data segments must be within 512KB addressing space.
22497 The text segment must be within 16MB addressing space.
22498 @item @samp{medium}
22499 The data segment must be within 512KB while the read-only data segment can be
22500 within 4GB addressing space.  The text segment should be still within 16MB
22501 addressing space.
22502 @item @samp{large}
22503 All the text and data segments can be within 4GB addressing space.
22504 @end table
22506 @item -mctor-dtor
22507 @opindex mctor-dtor
22508 Enable constructor/destructor feature.
22510 @item -mrelax
22511 @opindex mrelax
22512 Guide linker to relax instructions.
22514 @end table
22516 @node Nios II Options
22517 @subsection Nios II Options
22518 @cindex Nios II options
22519 @cindex Altera Nios II options
22521 These are the options defined for the Altera Nios II processor.
22523 @table @gcctabopt
22525 @item -G @var{num}
22526 @opindex G
22527 @cindex smaller data references
22528 Put global and static objects less than or equal to @var{num} bytes
22529 into the small data or BSS sections instead of the normal data or BSS
22530 sections.  The default value of @var{num} is 8.
22532 @item -mgpopt=@var{option}
22533 @itemx -mgpopt
22534 @itemx -mno-gpopt
22535 @opindex mgpopt
22536 @opindex mno-gpopt
22537 Generate (do not generate) GP-relative accesses.  The following 
22538 @var{option} names are recognized:
22540 @table @samp
22542 @item none
22543 Do not generate GP-relative accesses.
22545 @item local
22546 Generate GP-relative accesses for small data objects that are not 
22547 external, weak, or uninitialized common symbols.  
22548 Also use GP-relative addressing for objects that
22549 have been explicitly placed in a small data section via a @code{section}
22550 attribute.
22552 @item global
22553 As for @samp{local}, but also generate GP-relative accesses for
22554 small data objects that are external, weak, or common.  If you use this option,
22555 you must ensure that all parts of your program (including libraries) are
22556 compiled with the same @option{-G} setting.
22558 @item data
22559 Generate GP-relative accesses for all data objects in the program.  If you
22560 use this option, the entire data and BSS segments
22561 of your program must fit in 64K of memory and you must use an appropriate
22562 linker script to allocate them within the addressable range of the
22563 global pointer.
22565 @item all
22566 Generate GP-relative addresses for function pointers as well as data
22567 pointers.  If you use this option, the entire text, data, and BSS segments
22568 of your program must fit in 64K of memory and you must use an appropriate
22569 linker script to allocate them within the addressable range of the
22570 global pointer.
22572 @end table
22574 @option{-mgpopt} is equivalent to @option{-mgpopt=local}, and
22575 @option{-mno-gpopt} is equivalent to @option{-mgpopt=none}.
22577 The default is @option{-mgpopt} except when @option{-fpic} or
22578 @option{-fPIC} is specified to generate position-independent code.
22579 Note that the Nios II ABI does not permit GP-relative accesses from
22580 shared libraries.
22582 You may need to specify @option{-mno-gpopt} explicitly when building
22583 programs that include large amounts of small data, including large
22584 GOT data sections.  In this case, the 16-bit offset for GP-relative
22585 addressing may not be large enough to allow access to the entire 
22586 small data section.
22588 @item -mgprel-sec=@var{regexp}
22589 @opindex mgprel-sec
22590 This option specifies additional section names that can be accessed via
22591 GP-relative addressing.  It is most useful in conjunction with 
22592 @code{section} attributes on variable declarations 
22593 (@pxref{Common Variable Attributes}) and a custom linker script.  
22594 The @var{regexp} is a POSIX Extended Regular Expression.
22596 This option does not affect the behavior of the @option{-G} option, and 
22597 the specified sections are in addition to the standard @code{.sdata}
22598 and @code{.sbss} small-data sections that are recognized by @option{-mgpopt}.
22600 @item -mr0rel-sec=@var{regexp}
22601 @opindex mr0rel-sec
22602 This option specifies names of sections that can be accessed via a 
22603 16-bit offset from @code{r0}; that is, in the low 32K or high 32K 
22604 of the 32-bit address space.  It is most useful in conjunction with 
22605 @code{section} attributes on variable declarations 
22606 (@pxref{Common Variable Attributes}) and a custom linker script.  
22607 The @var{regexp} is a POSIX Extended Regular Expression.
22609 In contrast to the use of GP-relative addressing for small data, 
22610 zero-based addressing is never generated by default and there are no 
22611 conventional section names used in standard linker scripts for sections
22612 in the low or high areas of memory.
22614 @item -mel
22615 @itemx -meb
22616 @opindex mel
22617 @opindex meb
22618 Generate little-endian (default) or big-endian (experimental) code,
22619 respectively.
22621 @item -march=@var{arch}
22622 @opindex march
22623 This specifies the name of the target Nios II architecture.  GCC uses this
22624 name to determine what kind of instructions it can emit when generating
22625 assembly code.  Permissible names are: @samp{r1}, @samp{r2}.
22627 The preprocessor macro @code{__nios2_arch__} is available to programs,
22628 with value 1 or 2, indicating the targeted ISA level.
22630 @item -mbypass-cache
22631 @itemx -mno-bypass-cache
22632 @opindex mno-bypass-cache
22633 @opindex mbypass-cache
22634 Force all load and store instructions to always bypass cache by 
22635 using I/O variants of the instructions. The default is not to
22636 bypass the cache.
22638 @item -mno-cache-volatile 
22639 @itemx -mcache-volatile       
22640 @opindex mcache-volatile 
22641 @opindex mno-cache-volatile
22642 Volatile memory access bypass the cache using the I/O variants of 
22643 the load and store instructions. The default is not to bypass the cache.
22645 @item -mno-fast-sw-div
22646 @itemx -mfast-sw-div
22647 @opindex mno-fast-sw-div
22648 @opindex mfast-sw-div
22649 Do not use table-based fast divide for small numbers. The default 
22650 is to use the fast divide at @option{-O3} and above.
22652 @item -mno-hw-mul
22653 @itemx -mhw-mul
22654 @itemx -mno-hw-mulx
22655 @itemx -mhw-mulx
22656 @itemx -mno-hw-div
22657 @itemx -mhw-div
22658 @opindex mno-hw-mul
22659 @opindex mhw-mul
22660 @opindex mno-hw-mulx
22661 @opindex mhw-mulx
22662 @opindex mno-hw-div
22663 @opindex mhw-div
22664 Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of 
22665 instructions by the compiler. The default is to emit @code{mul}
22666 and not emit @code{div} and @code{mulx}.
22668 @item -mbmx
22669 @itemx -mno-bmx
22670 @itemx -mcdx
22671 @itemx -mno-cdx
22672 Enable or disable generation of Nios II R2 BMX (bit manipulation) and
22673 CDX (code density) instructions.  Enabling these instructions also
22674 requires @option{-march=r2}.  Since these instructions are optional
22675 extensions to the R2 architecture, the default is not to emit them.
22677 @item -mcustom-@var{insn}=@var{N}
22678 @itemx -mno-custom-@var{insn}
22679 @opindex mcustom-@var{insn}
22680 @opindex mno-custom-@var{insn}
22681 Each @option{-mcustom-@var{insn}=@var{N}} option enables use of a
22682 custom instruction with encoding @var{N} when generating code that uses 
22683 @var{insn}.  For example, @option{-mcustom-fadds=253} generates custom
22684 instruction 253 for single-precision floating-point add operations instead
22685 of the default behavior of using a library call.
22687 The following values of @var{insn} are supported.  Except as otherwise
22688 noted, floating-point operations are expected to be implemented with
22689 normal IEEE 754 semantics and correspond directly to the C operators or the
22690 equivalent GCC built-in functions (@pxref{Other Builtins}).
22692 Single-precision floating point:
22693 @table @asis
22695 @item @samp{fadds}, @samp{fsubs}, @samp{fdivs}, @samp{fmuls}
22696 Binary arithmetic operations.
22698 @item @samp{fnegs}
22699 Unary negation.
22701 @item @samp{fabss}
22702 Unary absolute value.
22704 @item @samp{fcmpeqs}, @samp{fcmpges}, @samp{fcmpgts}, @samp{fcmples}, @samp{fcmplts}, @samp{fcmpnes}
22705 Comparison operations.
22707 @item @samp{fmins}, @samp{fmaxs}
22708 Floating-point minimum and maximum.  These instructions are only
22709 generated if @option{-ffinite-math-only} is specified.
22711 @item @samp{fsqrts}
22712 Unary square root operation.
22714 @item @samp{fcoss}, @samp{fsins}, @samp{ftans}, @samp{fatans}, @samp{fexps}, @samp{flogs}
22715 Floating-point trigonometric and exponential functions.  These instructions
22716 are only generated if @option{-funsafe-math-optimizations} is also specified.
22718 @end table
22720 Double-precision floating point:
22721 @table @asis
22723 @item @samp{faddd}, @samp{fsubd}, @samp{fdivd}, @samp{fmuld}
22724 Binary arithmetic operations.
22726 @item @samp{fnegd}
22727 Unary negation.
22729 @item @samp{fabsd}
22730 Unary absolute value.
22732 @item @samp{fcmpeqd}, @samp{fcmpged}, @samp{fcmpgtd}, @samp{fcmpled}, @samp{fcmpltd}, @samp{fcmpned}
22733 Comparison operations.
22735 @item @samp{fmind}, @samp{fmaxd}
22736 Double-precision minimum and maximum.  These instructions are only
22737 generated if @option{-ffinite-math-only} is specified.
22739 @item @samp{fsqrtd}
22740 Unary square root operation.
22742 @item @samp{fcosd}, @samp{fsind}, @samp{ftand}, @samp{fatand}, @samp{fexpd}, @samp{flogd}
22743 Double-precision trigonometric and exponential functions.  These instructions
22744 are only generated if @option{-funsafe-math-optimizations} is also specified.
22746 @end table
22748 Conversions:
22749 @table @asis
22750 @item @samp{fextsd}
22751 Conversion from single precision to double precision.
22753 @item @samp{ftruncds}
22754 Conversion from double precision to single precision.
22756 @item @samp{fixsi}, @samp{fixsu}, @samp{fixdi}, @samp{fixdu}
22757 Conversion from floating point to signed or unsigned integer types, with
22758 truncation towards zero.
22760 @item @samp{round}
22761 Conversion from single-precision floating point to signed integer,
22762 rounding to the nearest integer and ties away from zero.
22763 This corresponds to the @code{__builtin_lroundf} function when
22764 @option{-fno-math-errno} is used.
22766 @item @samp{floatis}, @samp{floatus}, @samp{floatid}, @samp{floatud}
22767 Conversion from signed or unsigned integer types to floating-point types.
22769 @end table
22771 In addition, all of the following transfer instructions for internal
22772 registers X and Y must be provided to use any of the double-precision
22773 floating-point instructions.  Custom instructions taking two
22774 double-precision source operands expect the first operand in the
22775 64-bit register X.  The other operand (or only operand of a unary
22776 operation) is given to the custom arithmetic instruction with the
22777 least significant half in source register @var{src1} and the most
22778 significant half in @var{src2}.  A custom instruction that returns a
22779 double-precision result returns the most significant 32 bits in the
22780 destination register and the other half in 32-bit register Y.  
22781 GCC automatically generates the necessary code sequences to write
22782 register X and/or read register Y when double-precision floating-point
22783 instructions are used.
22785 @table @asis
22787 @item @samp{fwrx}
22788 Write @var{src1} into the least significant half of X and @var{src2} into
22789 the most significant half of X.
22791 @item @samp{fwry}
22792 Write @var{src1} into Y.
22794 @item @samp{frdxhi}, @samp{frdxlo}
22795 Read the most or least (respectively) significant half of X and store it in
22796 @var{dest}.
22798 @item @samp{frdy}
22799 Read the value of Y and store it into @var{dest}.
22800 @end table
22802 Note that you can gain more local control over generation of Nios II custom
22803 instructions by using the @code{target("custom-@var{insn}=@var{N}")}
22804 and @code{target("no-custom-@var{insn}")} function attributes
22805 (@pxref{Function Attributes})
22806 or pragmas (@pxref{Function Specific Option Pragmas}).
22808 @item -mcustom-fpu-cfg=@var{name}
22809 @opindex mcustom-fpu-cfg
22811 This option enables a predefined, named set of custom instruction encodings
22812 (see @option{-mcustom-@var{insn}} above).  
22813 Currently, the following sets are defined:
22815 @option{-mcustom-fpu-cfg=60-1} is equivalent to:
22816 @gccoptlist{-mcustom-fmuls=252 @gol
22817 -mcustom-fadds=253 @gol
22818 -mcustom-fsubs=254 @gol
22819 -fsingle-precision-constant}
22821 @option{-mcustom-fpu-cfg=60-2} is equivalent to:
22822 @gccoptlist{-mcustom-fmuls=252 @gol
22823 -mcustom-fadds=253 @gol
22824 -mcustom-fsubs=254 @gol
22825 -mcustom-fdivs=255 @gol
22826 -fsingle-precision-constant}
22828 @option{-mcustom-fpu-cfg=72-3} is equivalent to:
22829 @gccoptlist{-mcustom-floatus=243 @gol
22830 -mcustom-fixsi=244 @gol
22831 -mcustom-floatis=245 @gol
22832 -mcustom-fcmpgts=246 @gol
22833 -mcustom-fcmples=249 @gol
22834 -mcustom-fcmpeqs=250 @gol
22835 -mcustom-fcmpnes=251 @gol
22836 -mcustom-fmuls=252 @gol
22837 -mcustom-fadds=253 @gol
22838 -mcustom-fsubs=254 @gol
22839 -mcustom-fdivs=255 @gol
22840 -fsingle-precision-constant}
22842 Custom instruction assignments given by individual
22843 @option{-mcustom-@var{insn}=} options override those given by
22844 @option{-mcustom-fpu-cfg=}, regardless of the
22845 order of the options on the command line.
22847 Note that you can gain more local control over selection of a FPU
22848 configuration by using the @code{target("custom-fpu-cfg=@var{name}")}
22849 function attribute (@pxref{Function Attributes})
22850 or pragma (@pxref{Function Specific Option Pragmas}).
22852 @end table
22854 These additional @samp{-m} options are available for the Altera Nios II
22855 ELF (bare-metal) target:
22857 @table @gcctabopt
22859 @item -mhal
22860 @opindex mhal
22861 Link with HAL BSP.  This suppresses linking with the GCC-provided C runtime
22862 startup and termination code, and is typically used in conjunction with
22863 @option{-msys-crt0=} to specify the location of the alternate startup code
22864 provided by the HAL BSP.
22866 @item -msmallc
22867 @opindex msmallc
22868 Link with a limited version of the C library, @option{-lsmallc}, rather than
22869 Newlib.
22871 @item -msys-crt0=@var{startfile}
22872 @opindex msys-crt0
22873 @var{startfile} is the file name of the startfile (crt0) to use 
22874 when linking.  This option is only useful in conjunction with @option{-mhal}.
22876 @item -msys-lib=@var{systemlib}
22877 @opindex msys-lib
22878 @var{systemlib} is the library name of the library that provides
22879 low-level system calls required by the C library,
22880 e.g.@: @code{read} and @code{write}.
22881 This option is typically used to link with a library provided by a HAL BSP.
22883 @end table
22885 @node Nvidia PTX Options
22886 @subsection Nvidia PTX Options
22887 @cindex Nvidia PTX options
22888 @cindex nvptx options
22890 These options are defined for Nvidia PTX:
22892 @table @gcctabopt
22894 @item -m32
22895 @itemx -m64
22896 @opindex m32
22897 @opindex m64
22898 Generate code for 32-bit or 64-bit ABI.
22900 @item -misa=@var{ISA-string}
22901 @opindex march
22902 Generate code for given the specified PTX ISA (e.g.@: @samp{sm_35}).  ISA
22903 strings must be lower-case.  Valid ISA strings include @samp{sm_30} and
22904 @samp{sm_35}.  The default ISA is sm_30.
22906 @item -mmainkernel
22907 @opindex mmainkernel
22908 Link in code for a __main kernel.  This is for stand-alone instead of
22909 offloading execution.
22911 @item -moptimize
22912 @opindex moptimize
22913 Apply partitioned execution optimizations.  This is the default when any
22914 level of optimization is selected.
22916 @item -msoft-stack
22917 @opindex msoft-stack
22918 Generate code that does not use @code{.local} memory
22919 directly for stack storage. Instead, a per-warp stack pointer is
22920 maintained explicitly. This enables variable-length stack allocation (with
22921 variable-length arrays or @code{alloca}), and when global memory is used for
22922 underlying storage, makes it possible to access automatic variables from other
22923 threads, or with atomic instructions. This code generation variant is used
22924 for OpenMP offloading, but the option is exposed on its own for the purpose
22925 of testing the compiler; to generate code suitable for linking into programs
22926 using OpenMP offloading, use option @option{-mgomp}.
22928 @item -muniform-simt
22929 @opindex muniform-simt
22930 Switch to code generation variant that allows to execute all threads in each
22931 warp, while maintaining memory state and side effects as if only one thread
22932 in each warp was active outside of OpenMP SIMD regions.  All atomic operations
22933 and calls to runtime (malloc, free, vprintf) are conditionally executed (iff
22934 current lane index equals the master lane index), and the register being
22935 assigned is copied via a shuffle instruction from the master lane.  Outside of
22936 SIMD regions lane 0 is the master; inside, each thread sees itself as the
22937 master.  Shared memory array @code{int __nvptx_uni[]} stores all-zeros or
22938 all-ones bitmasks for each warp, indicating current mode (0 outside of SIMD
22939 regions).  Each thread can bitwise-and the bitmask at position @code{tid.y}
22940 with current lane index to compute the master lane index.
22942 @item -mgomp
22943 @opindex mgomp
22944 Generate code for use in OpenMP offloading: enables @option{-msoft-stack} and
22945 @option{-muniform-simt} options, and selects corresponding multilib variant.
22947 @end table
22949 @node OpenRISC Options
22950 @subsection OpenRISC Options
22951 @cindex OpenRISC Options
22953 These options are defined for OpenRISC:
22955 @table @gcctabopt
22957 @item -mboard=@var{name}
22958 @opindex mboard
22959 Configure a board specific runtime.  This will be passed to the linker for
22960 newlib board library linking.  The default is @code{or1ksim}.
22962 @item -mnewlib
22963 @opindex mnewlib
22964 For compatibility, it's always newlib for elf now.
22966 @item -mhard-div
22967 @opindex mhard-div
22968 Generate code for hardware which supports divide instructions.  This is the
22969 default.
22971 @item -mhard-mul
22972 @opindex mhard-mul
22973 Generate code for hardware which supports multiply instructions.  This is the
22974 default.
22976 @item -mcmov
22977 @opindex mcmov
22978 Generate code for hardware which supports the conditional move (@code{l.cmov})
22979 instruction.
22981 @item -mror
22982 @opindex mror
22983 Generate code for hardware which supports rotate right instructions.
22985 @item -msext
22986 @opindex msext
22987 Generate code for hardware which supports sign-extension instructions.
22989 @item -msfimm
22990 @opindex msfimm
22991 Generate code for hardware which supports set flag immediate (@code{l.sf*i})
22992 instructions.
22994 @item -mshftimm
22995 @opindex mshftimm
22996 Generate code for hardware which supports shift immediate related instructions
22997 (i.e. @code{l.srai}, @code{l.srli}, @code{l.slli}, @code{1.rori}).  Note, to
22998 enable generation of the @code{l.rori} instruction the @option{-mror} flag must
22999 also be specified.
23001 @item -msoft-div
23002 @opindex msoft-div
23003 Generate code for hardware which requires divide instruction emulation.
23005 @item -msoft-mul
23006 @opindex msoft-mul
23007 Generate code for hardware which requires multiply instruction emulation.
23009 @end table
23011 @node PDP-11 Options
23012 @subsection PDP-11 Options
23013 @cindex PDP-11 Options
23015 These options are defined for the PDP-11:
23017 @table @gcctabopt
23018 @item -mfpu
23019 @opindex mfpu
23020 Use hardware FPP floating point.  This is the default.  (FIS floating
23021 point on the PDP-11/40 is not supported.)  Implies -m45.
23023 @item -msoft-float
23024 @opindex msoft-float
23025 Do not use hardware floating point.
23027 @item -mac0
23028 @opindex mac0
23029 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
23031 @item -mno-ac0
23032 @opindex mno-ac0
23033 Return floating-point results in memory.  This is the default.
23035 @item -m40
23036 @opindex m40
23037 Generate code for a PDP-11/40.  Implies -msoft-float -mno-split.
23039 @item -m45
23040 @opindex m45
23041 Generate code for a PDP-11/45.  This is the default.
23043 @item -m10
23044 @opindex m10
23045 Generate code for a PDP-11/10.  Implies -msoft-float -mno-split.
23047 @item -mint16
23048 @itemx -mno-int32
23049 @opindex mint16
23050 @opindex mno-int32
23051 Use 16-bit @code{int}.  This is the default.
23053 @item -mint32
23054 @itemx -mno-int16
23055 @opindex mint32
23056 @opindex mno-int16
23057 Use 32-bit @code{int}.
23059 @item -msplit
23060 @opindex msplit
23061 Target has split instruction and data space.  Implies -m45.
23063 @item -munix-asm
23064 @opindex munix-asm
23065 Use Unix assembler syntax.
23067 @item -mdec-asm
23068 @opindex mdec-asm
23069 Use DEC assembler syntax.
23071 @item -mgnu-asm
23072 @opindex mgnu-asm
23073 Use GNU assembler syntax.  This is the default.
23075 @item -mlra
23076 @opindex mlra
23077 Use the new LRA register allocator.  By default, the old ``reload''
23078 allocator is used.
23079 @end table
23081 @node picoChip Options
23082 @subsection picoChip Options
23083 @cindex picoChip options
23085 These @samp{-m} options are defined for picoChip implementations:
23087 @table @gcctabopt
23089 @item -mae=@var{ae_type}
23090 @opindex mcpu
23091 Set the instruction set, register set, and instruction scheduling
23092 parameters for array element type @var{ae_type}.  Supported values
23093 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
23095 @option{-mae=ANY} selects a completely generic AE type.  Code
23096 generated with this option runs on any of the other AE types.  The
23097 code is not as efficient as it would be if compiled for a specific
23098 AE type, and some types of operation (e.g., multiplication) do not
23099 work properly on all types of AE.
23101 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
23102 for compiled code, and is the default.
23104 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
23105 option may suffer from poor performance of byte (char) manipulation,
23106 since the DSP AE does not provide hardware support for byte load/stores.
23108 @item -msymbol-as-address
23109 Enable the compiler to directly use a symbol name as an address in a
23110 load/store instruction, without first loading it into a
23111 register.  Typically, the use of this option generates larger
23112 programs, which run faster than when the option isn't used.  However, the
23113 results vary from program to program, so it is left as a user option,
23114 rather than being permanently enabled.
23116 @item -mno-inefficient-warnings
23117 Disables warnings about the generation of inefficient code.  These
23118 warnings can be generated, for example, when compiling code that
23119 performs byte-level memory operations on the MAC AE type.  The MAC AE has
23120 no hardware support for byte-level memory operations, so all byte
23121 load/stores must be synthesized from word load/store operations.  This is
23122 inefficient and a warning is generated to indicate
23123 that you should rewrite the code to avoid byte operations, or to target
23124 an AE type that has the necessary hardware support.  This option disables
23125 these warnings.
23127 @end table
23129 @node PowerPC Options
23130 @subsection PowerPC Options
23131 @cindex PowerPC options
23133 These are listed under @xref{RS/6000 and PowerPC Options}.
23135 @node PowerPC SPE Options
23136 @subsection PowerPC SPE Options
23137 @cindex PowerPC SPE options
23139 These @samp{-m} options are defined for PowerPC SPE:
23140 @table @gcctabopt
23141 @item -mmfcrf
23142 @itemx -mno-mfcrf
23143 @itemx -mpopcntb
23144 @itemx -mno-popcntb
23145 @opindex mmfcrf
23146 @opindex mno-mfcrf
23147 @opindex mpopcntb
23148 @opindex mno-popcntb
23149 You use these options to specify which instructions are available on the
23150 processor you are using.  The default value of these options is
23151 determined when configuring GCC@.  Specifying the
23152 @option{-mcpu=@var{cpu_type}} overrides the specification of these
23153 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
23154 rather than the options listed above.
23156 The @option{-mmfcrf} option allows GCC to generate the move from
23157 condition register field instruction implemented on the POWER4
23158 processor and other processors that support the PowerPC V2.01
23159 architecture.
23160 The @option{-mpopcntb} option allows GCC to generate the popcount and
23161 double-precision FP reciprocal estimate instruction implemented on the
23162 POWER5 processor and other processors that support the PowerPC V2.02
23163 architecture.
23165 @item -mcpu=@var{cpu_type}
23166 @opindex mcpu
23167 Set architecture type, register usage, and
23168 instruction scheduling parameters for machine type @var{cpu_type}.
23169 Supported values for @var{cpu_type} are @samp{8540}, @samp{8548},
23170 and @samp{native}.
23172 @option{-mcpu=powerpc} specifies pure 32-bit PowerPC (either
23173 endian), with an appropriate, generic processor model assumed for
23174 scheduling purposes.
23176 Specifying @samp{native} as cpu type detects and selects the
23177 architecture option that corresponds to the host processor of the
23178 system performing the compilation.
23179 @option{-mcpu=native} has no effect if GCC does not recognize the
23180 processor.
23182 The other options specify a specific processor.  Code generated under
23183 those options runs best on that processor, and may not run at all on
23184 others.
23186 The @option{-mcpu} options automatically enable or disable the
23187 following options:
23189 @gccoptlist{-mhard-float  -mmfcrf  -mmultiple @gol
23190 -mpopcntb -mpopcntd @gol
23191 -msingle-float -mdouble-float @gol
23192 -mfloat128}
23194 The particular options set for any particular CPU varies between
23195 compiler versions, depending on what setting seems to produce optimal
23196 code for that CPU; it doesn't necessarily reflect the actual hardware's
23197 capabilities.  If you wish to set an individual option to a particular
23198 value, you may specify it after the @option{-mcpu} option, like
23199 @option{-mcpu=8548}.
23201 @item -mtune=@var{cpu_type}
23202 @opindex mtune
23203 Set the instruction scheduling parameters for machine type
23204 @var{cpu_type}, but do not set the architecture type or register usage,
23205 as @option{-mcpu=@var{cpu_type}} does.  The same
23206 values for @var{cpu_type} are used for @option{-mtune} as for
23207 @option{-mcpu}.  If both are specified, the code generated uses the
23208 architecture and registers set by @option{-mcpu}, but the
23209 scheduling parameters set by @option{-mtune}.
23211 @item -msecure-plt
23212 @opindex msecure-plt
23213 Generate code that allows @command{ld} and @command{ld.so}
23214 to build executables and shared
23215 libraries with non-executable @code{.plt} and @code{.got} sections.
23216 This is a PowerPC
23217 32-bit SYSV ABI option.
23219 @item -mbss-plt
23220 @opindex mbss-plt
23221 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
23222 fills in, and
23223 requires @code{.plt} and @code{.got}
23224 sections that are both writable and executable.
23225 This is a PowerPC 32-bit SYSV ABI option.
23227 @item -misel
23228 @itemx -mno-isel
23229 @opindex misel
23230 @opindex mno-isel
23231 This switch enables or disables the generation of ISEL instructions.
23233 @item -misel=@var{yes/no}
23234 This switch has been deprecated.  Use @option{-misel} and
23235 @option{-mno-isel} instead.
23237 @item -mspe
23238 @itemx -mno-spe
23239 @opindex mspe
23240 @opindex mno-spe
23241 This switch enables or disables the generation of SPE simd
23242 instructions.
23244 @item -mspe=@var{yes/no}
23245 This option has been deprecated.  Use @option{-mspe} and
23246 @option{-mno-spe} instead.
23248 @item -mfloat128
23249 @itemx -mno-float128
23250 @opindex mfloat128
23251 @opindex mno-float128
23252 Enable/disable the @var{__float128} keyword for IEEE 128-bit floating point
23253 and use either software emulation for IEEE 128-bit floating point or
23254 hardware instructions.
23256 @item -mfloat-gprs=@var{yes/single/double/no}
23257 @itemx -mfloat-gprs
23258 @opindex mfloat-gprs
23259 This switch enables or disables the generation of floating-point
23260 operations on the general-purpose registers for architectures that
23261 support it.
23263 The argument @samp{yes} or @samp{single} enables the use of
23264 single-precision floating-point operations.
23266 The argument @samp{double} enables the use of single and
23267 double-precision floating-point operations.
23269 The argument @samp{no} disables floating-point operations on the
23270 general-purpose registers.
23272 This option is currently only available on the MPC854x.
23274 @item -mfull-toc
23275 @itemx -mno-fp-in-toc
23276 @itemx -mno-sum-in-toc
23277 @itemx -mminimal-toc
23278 @opindex mfull-toc
23279 @opindex mno-fp-in-toc
23280 @opindex mno-sum-in-toc
23281 @opindex mminimal-toc
23282 Modify generation of the TOC (Table Of Contents), which is created for
23283 every executable file.  The @option{-mfull-toc} option is selected by
23284 default.  In that case, GCC allocates at least one TOC entry for
23285 each unique non-automatic variable reference in your program.  GCC
23286 also places floating-point constants in the TOC@.  However, only
23287 16,384 entries are available in the TOC@.
23289 If you receive a linker error message that saying you have overflowed
23290 the available TOC space, you can reduce the amount of TOC space used
23291 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
23292 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
23293 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
23294 generate code to calculate the sum of an address and a constant at
23295 run time instead of putting that sum into the TOC@.  You may specify one
23296 or both of these options.  Each causes GCC to produce very slightly
23297 slower and larger code at the expense of conserving TOC space.
23299 If you still run out of space in the TOC even when you specify both of
23300 these options, specify @option{-mminimal-toc} instead.  This option causes
23301 GCC to make only one TOC entry for every file.  When you specify this
23302 option, GCC produces code that is slower and larger but which
23303 uses extremely little TOC space.  You may wish to use this option
23304 only on files that contain less frequently-executed code.
23306 @item -maix32
23307 @opindex maix32
23308 Disables the 64-bit ABI.  GCC defaults to @option{-maix32}.
23310 @item -mxl-compat
23311 @itemx -mno-xl-compat
23312 @opindex mxl-compat
23313 @opindex mno-xl-compat
23314 Produce code that conforms more closely to IBM XL compiler semantics
23315 when using AIX-compatible ABI@.  Pass floating-point arguments to
23316 prototyped functions beyond the register save area (RSA) on the stack
23317 in addition to argument FPRs.  Do not assume that most significant
23318 double in 128-bit long double value is properly rounded when comparing
23319 values and converting to double.  Use XL symbol names for long double
23320 support routines.
23322 The AIX calling convention was extended but not initially documented to
23323 handle an obscure K&R C case of calling a function that takes the
23324 address of its arguments with fewer arguments than declared.  IBM XL
23325 compilers access floating-point arguments that do not fit in the
23326 RSA from the stack when a subroutine is compiled without
23327 optimization.  Because always storing floating-point arguments on the
23328 stack is inefficient and rarely needed, this option is not enabled by
23329 default and only is necessary when calling subroutines compiled by IBM
23330 XL compilers without optimization.
23332 @item -malign-natural
23333 @itemx -malign-power
23334 @opindex malign-natural
23335 @opindex malign-power
23336 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
23337 @option{-malign-natural} overrides the ABI-defined alignment of larger
23338 types, such as floating-point doubles, on their natural size-based boundary.
23339 The option @option{-malign-power} instructs GCC to follow the ABI-specified
23340 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
23342 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
23343 is not supported.
23345 @item -msoft-float
23346 @itemx -mhard-float
23347 @opindex msoft-float
23348 @opindex mhard-float
23349 Generate code that does not use (uses) the floating-point register set.
23350 Software floating-point emulation is provided if you use the
23351 @option{-msoft-float} option, and pass the option to GCC when linking.
23353 @item -msingle-float
23354 @itemx -mdouble-float
23355 @opindex msingle-float
23356 @opindex mdouble-float
23357 Generate code for single- or double-precision floating-point operations.
23358 @option{-mdouble-float} implies @option{-msingle-float}.
23360 @item -mmultiple
23361 @itemx -mno-multiple
23362 @opindex mmultiple
23363 @opindex mno-multiple
23364 Generate code that uses (does not use) the load multiple word
23365 instructions and the store multiple word instructions.  These
23366 instructions are generated by default on POWER systems, and not
23367 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
23368 PowerPC systems, since those instructions do not work when the
23369 processor is in little-endian mode.  The exceptions are PPC740 and
23370 PPC750 which permit these instructions in little-endian mode.
23372 @item -mupdate
23373 @itemx -mno-update
23374 @opindex mupdate
23375 @opindex mno-update
23376 Generate code that uses (does not use) the load or store instructions
23377 that update the base register to the address of the calculated memory
23378 location.  These instructions are generated by default.  If you use
23379 @option{-mno-update}, there is a small window between the time that the
23380 stack pointer is updated and the address of the previous frame is
23381 stored, which means code that walks the stack frame across interrupts or
23382 signals may get corrupted data.
23384 @item -mavoid-indexed-addresses
23385 @itemx -mno-avoid-indexed-addresses
23386 @opindex mavoid-indexed-addresses
23387 @opindex mno-avoid-indexed-addresses
23388 Generate code that tries to avoid (not avoid) the use of indexed load
23389 or store instructions. These instructions can incur a performance
23390 penalty on Power6 processors in certain situations, such as when
23391 stepping through large arrays that cross a 16M boundary.  This option
23392 is enabled by default when targeting Power6 and disabled otherwise.
23394 @item -mfused-madd
23395 @itemx -mno-fused-madd
23396 @opindex mfused-madd
23397 @opindex mno-fused-madd
23398 Generate code that uses (does not use) the floating-point multiply and
23399 accumulate instructions.  These instructions are generated by default
23400 if hardware floating point is used.  The machine-dependent
23401 @option{-mfused-madd} option is now mapped to the machine-independent
23402 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
23403 mapped to @option{-ffp-contract=off}.
23405 @item -mno-strict-align
23406 @itemx -mstrict-align
23407 @opindex mno-strict-align
23408 @opindex mstrict-align
23409 On System V.4 and embedded PowerPC systems do not (do) assume that
23410 unaligned memory references are handled by the system.
23412 @item -mrelocatable
23413 @itemx -mno-relocatable
23414 @opindex mrelocatable
23415 @opindex mno-relocatable
23416 Generate code that allows (does not allow) a static executable to be
23417 relocated to a different address at run time.  A simple embedded
23418 PowerPC system loader should relocate the entire contents of
23419 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
23420 a table of 32-bit addresses generated by this option.  For this to
23421 work, all objects linked together must be compiled with
23422 @option{-mrelocatable} or @option{-mrelocatable-lib}.
23423 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
23425 @item -mrelocatable-lib
23426 @itemx -mno-relocatable-lib
23427 @opindex mrelocatable-lib
23428 @opindex mno-relocatable-lib
23429 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
23430 @code{.fixup} section to allow static executables to be relocated at
23431 run time, but @option{-mrelocatable-lib} does not use the smaller stack
23432 alignment of @option{-mrelocatable}.  Objects compiled with
23433 @option{-mrelocatable-lib} may be linked with objects compiled with
23434 any combination of the @option{-mrelocatable} options.
23436 @item -mno-toc
23437 @itemx -mtoc
23438 @opindex mno-toc
23439 @opindex mtoc
23440 On System V.4 and embedded PowerPC systems do not (do) assume that
23441 register 2 contains a pointer to a global area pointing to the addresses
23442 used in the program.
23444 @item -mlittle
23445 @itemx -mlittle-endian
23446 @opindex mlittle
23447 @opindex mlittle-endian
23448 On System V.4 and embedded PowerPC systems compile code for the
23449 processor in little-endian mode.  The @option{-mlittle-endian} option is
23450 the same as @option{-mlittle}.
23452 @item -mbig
23453 @itemx -mbig-endian
23454 @opindex mbig
23455 @opindex mbig-endian
23456 On System V.4 and embedded PowerPC systems compile code for the
23457 processor in big-endian mode.  The @option{-mbig-endian} option is
23458 the same as @option{-mbig}.
23460 @item -mdynamic-no-pic
23461 @opindex mdynamic-no-pic
23462 On Darwin and Mac OS X systems, compile code so that it is not
23463 relocatable, but that its external references are relocatable.  The
23464 resulting code is suitable for applications, but not shared
23465 libraries.
23467 @item -msingle-pic-base
23468 @opindex msingle-pic-base
23469 Treat the register used for PIC addressing as read-only, rather than
23470 loading it in the prologue for each function.  The runtime system is
23471 responsible for initializing this register with an appropriate value
23472 before execution begins.
23474 @item -mprioritize-restricted-insns=@var{priority}
23475 @opindex mprioritize-restricted-insns
23476 This option controls the priority that is assigned to
23477 dispatch-slot restricted instructions during the second scheduling
23478 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
23479 or @samp{2} to assign no, highest, or second-highest (respectively)
23480 priority to dispatch-slot restricted
23481 instructions.
23483 @item -msched-costly-dep=@var{dependence_type}
23484 @opindex msched-costly-dep
23485 This option controls which dependences are considered costly
23486 by the target during instruction scheduling.  The argument
23487 @var{dependence_type} takes one of the following values:
23489 @table @asis
23490 @item @samp{no}
23491 No dependence is costly.
23493 @item @samp{all}
23494 All dependences are costly.
23496 @item @samp{true_store_to_load}
23497 A true dependence from store to load is costly.
23499 @item @samp{store_to_load}
23500 Any dependence from store to load is costly.
23502 @item @var{number}
23503 Any dependence for which the latency is greater than or equal to
23504 @var{number} is costly.
23505 @end table
23507 @item -minsert-sched-nops=@var{scheme}
23508 @opindex minsert-sched-nops
23509 This option controls which NOP insertion scheme is used during
23510 the second scheduling pass.  The argument @var{scheme} takes one of the
23511 following values:
23513 @table @asis
23514 @item @samp{no}
23515 Don't insert NOPs.
23517 @item @samp{pad}
23518 Pad with NOPs any dispatch group that has vacant issue slots,
23519 according to the scheduler's grouping.
23521 @item @samp{regroup_exact}
23522 Insert NOPs to force costly dependent insns into
23523 separate groups.  Insert exactly as many NOPs as needed to force an insn
23524 to a new group, according to the estimated processor grouping.
23526 @item @var{number}
23527 Insert NOPs to force costly dependent insns into
23528 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
23529 @end table
23531 @item -mcall-sysv
23532 @opindex mcall-sysv
23533 On System V.4 and embedded PowerPC systems compile code using calling
23534 conventions that adhere to the March 1995 draft of the System V
23535 Application Binary Interface, PowerPC processor supplement.  This is the
23536 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
23538 @item -mcall-sysv-eabi
23539 @itemx -mcall-eabi
23540 @opindex mcall-sysv-eabi
23541 @opindex mcall-eabi
23542 Specify both @option{-mcall-sysv} and @option{-meabi} options.
23544 @item -mcall-sysv-noeabi
23545 @opindex mcall-sysv-noeabi
23546 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
23548 @item -mcall-aixdesc
23549 @opindex m
23550 On System V.4 and embedded PowerPC systems compile code for the AIX
23551 operating system.
23553 @item -mcall-linux
23554 @opindex mcall-linux
23555 On System V.4 and embedded PowerPC systems compile code for the
23556 Linux-based GNU system.
23558 @item -mcall-freebsd
23559 @opindex mcall-freebsd
23560 On System V.4 and embedded PowerPC systems compile code for the
23561 FreeBSD operating system.
23563 @item -mcall-netbsd
23564 @opindex mcall-netbsd
23565 On System V.4 and embedded PowerPC systems compile code for the
23566 NetBSD operating system.
23568 @item -mcall-openbsd
23569 @opindex mcall-netbsd
23570 On System V.4 and embedded PowerPC systems compile code for the
23571 OpenBSD operating system.
23573 @item -maix-struct-return
23574 @opindex maix-struct-return
23575 Return all structures in memory (as specified by the AIX ABI)@.
23577 @item -msvr4-struct-return
23578 @opindex msvr4-struct-return
23579 Return structures smaller than 8 bytes in registers (as specified by the
23580 SVR4 ABI)@.
23582 @item -mabi=@var{abi-type}
23583 @opindex mabi
23584 Extend the current ABI with a particular extension, or remove such extension.
23585 Valid values are @samp{altivec}, @samp{no-altivec}, @samp{spe},
23586 @samp{no-spe}, @samp{ibmlongdouble}, @samp{ieeelongdouble},
23587 @samp{elfv1}, @samp{elfv2}@.
23589 @item -mabi=spe
23590 @opindex mabi=spe
23591 Extend the current ABI with SPE ABI extensions.  This does not change
23592 the default ABI, instead it adds the SPE ABI extensions to the current
23593 ABI@.
23595 @item -mabi=no-spe
23596 @opindex mabi=no-spe
23597 Disable Book-E SPE ABI extensions for the current ABI@.
23599 @item -mabi=ibmlongdouble
23600 @opindex mabi=ibmlongdouble
23601 Change the current ABI to use IBM extended-precision long double.
23602 This is not likely to work if your system defaults to using IEEE
23603 extended-precision long double.  If you change the long double type
23604 from IEEE extended-precision, the compiler will issue a warning unless
23605 you use the @option{-Wno-psabi} option.
23607 @item -mabi=ieeelongdouble
23608 @opindex mabi=ieeelongdouble
23609 Change the current ABI to use IEEE extended-precision long double.
23610 This is not likely to work if your system defaults to using IBM
23611 extended-precision long double.  If you change the long double type
23612 from IBM extended-precision, the compiler will issue a warning unless
23613 you use the @option{-Wno-psabi} option.
23615 @item -mabi=elfv1
23616 @opindex mabi=elfv1
23617 Change the current ABI to use the ELFv1 ABI.
23618 This is the default ABI for big-endian PowerPC 64-bit Linux.
23619 Overriding the default ABI requires special system support and is
23620 likely to fail in spectacular ways.
23622 @item -mabi=elfv2
23623 @opindex mabi=elfv2
23624 Change the current ABI to use the ELFv2 ABI.
23625 This is the default ABI for little-endian PowerPC 64-bit Linux.
23626 Overriding the default ABI requires special system support and is
23627 likely to fail in spectacular ways.
23629 @item -mgnu-attribute
23630 @itemx -mno-gnu-attribute
23631 @opindex mgnu-attribute
23632 @opindex mno-gnu-attribute
23633 Emit .gnu_attribute assembly directives to set tag/value pairs in a
23634 .gnu.attributes section that specify ABI variations in function
23635 parameters or return values.
23637 @item -mprototype
23638 @itemx -mno-prototype
23639 @opindex mprototype
23640 @opindex mno-prototype
23641 On System V.4 and embedded PowerPC systems assume that all calls to
23642 variable argument functions are properly prototyped.  Otherwise, the
23643 compiler must insert an instruction before every non-prototyped call to
23644 set or clear bit 6 of the condition code register (@code{CR}) to
23645 indicate whether floating-point values are passed in the floating-point
23646 registers in case the function takes variable arguments.  With
23647 @option{-mprototype}, only calls to prototyped variable argument functions
23648 set or clear the bit.
23650 @item -msim
23651 @opindex msim
23652 On embedded PowerPC systems, assume that the startup module is called
23653 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
23654 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
23655 configurations.
23657 @item -mmvme
23658 @opindex mmvme
23659 On embedded PowerPC systems, assume that the startup module is called
23660 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
23661 @file{libc.a}.
23663 @item -mads
23664 @opindex mads
23665 On embedded PowerPC systems, assume that the startup module is called
23666 @file{crt0.o} and the standard C libraries are @file{libads.a} and
23667 @file{libc.a}.
23669 @item -myellowknife
23670 @opindex myellowknife
23671 On embedded PowerPC systems, assume that the startup module is called
23672 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
23673 @file{libc.a}.
23675 @item -mvxworks
23676 @opindex mvxworks
23677 On System V.4 and embedded PowerPC systems, specify that you are
23678 compiling for a VxWorks system.
23680 @item -memb
23681 @opindex memb
23682 On embedded PowerPC systems, set the @code{PPC_EMB} bit in the ELF flags
23683 header to indicate that @samp{eabi} extended relocations are used.
23685 @item -meabi
23686 @itemx -mno-eabi
23687 @opindex meabi
23688 @opindex mno-eabi
23689 On System V.4 and embedded PowerPC systems do (do not) adhere to the
23690 Embedded Applications Binary Interface (EABI), which is a set of
23691 modifications to the System V.4 specifications.  Selecting @option{-meabi}
23692 means that the stack is aligned to an 8-byte boundary, a function
23693 @code{__eabi} is called from @code{main} to set up the EABI
23694 environment, and the @option{-msdata} option can use both @code{r2} and
23695 @code{r13} to point to two separate small data areas.  Selecting
23696 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
23697 no EABI initialization function is called from @code{main}, and the
23698 @option{-msdata} option only uses @code{r13} to point to a single
23699 small data area.  The @option{-meabi} option is on by default if you
23700 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
23702 @item -msdata=eabi
23703 @opindex msdata=eabi
23704 On System V.4 and embedded PowerPC systems, put small initialized
23705 @code{const} global and static data in the @code{.sdata2} section, which
23706 is pointed to by register @code{r2}.  Put small initialized
23707 non-@code{const} global and static data in the @code{.sdata} section,
23708 which is pointed to by register @code{r13}.  Put small uninitialized
23709 global and static data in the @code{.sbss} section, which is adjacent to
23710 the @code{.sdata} section.  The @option{-msdata=eabi} option is
23711 incompatible with the @option{-mrelocatable} option.  The
23712 @option{-msdata=eabi} option also sets the @option{-memb} option.
23714 @item -msdata=sysv
23715 @opindex msdata=sysv
23716 On System V.4 and embedded PowerPC systems, put small global and static
23717 data in the @code{.sdata} section, which is pointed to by register
23718 @code{r13}.  Put small uninitialized global and static data in the
23719 @code{.sbss} section, which is adjacent to the @code{.sdata} section.
23720 The @option{-msdata=sysv} option is incompatible with the
23721 @option{-mrelocatable} option.
23723 @item -msdata=default
23724 @itemx -msdata
23725 @opindex msdata=default
23726 @opindex msdata
23727 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
23728 compile code the same as @option{-msdata=eabi}, otherwise compile code the
23729 same as @option{-msdata=sysv}.
23731 @item -msdata=data
23732 @opindex msdata=data
23733 On System V.4 and embedded PowerPC systems, put small global
23734 data in the @code{.sdata} section.  Put small uninitialized global
23735 data in the @code{.sbss} section.  Do not use register @code{r13}
23736 to address small data however.  This is the default behavior unless
23737 other @option{-msdata} options are used.
23739 @item -msdata=none
23740 @itemx -mno-sdata
23741 @opindex msdata=none
23742 @opindex mno-sdata
23743 On embedded PowerPC systems, put all initialized global and static data
23744 in the @code{.data} section, and all uninitialized data in the
23745 @code{.bss} section.
23747 @item -mblock-move-inline-limit=@var{num}
23748 @opindex mblock-move-inline-limit
23749 Inline all block moves (such as calls to @code{memcpy} or structure
23750 copies) less than or equal to @var{num} bytes.  The minimum value for
23751 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
23752 targets.  The default value is target-specific.
23754 @item -G @var{num}
23755 @opindex G
23756 @cindex smaller data references (PowerPC)
23757 @cindex .sdata/.sdata2 references (PowerPC)
23758 On embedded PowerPC systems, put global and static items less than or
23759 equal to @var{num} bytes into the small data or BSS sections instead of
23760 the normal data or BSS section.  By default, @var{num} is 8.  The
23761 @option{-G @var{num}} switch is also passed to the linker.
23762 All modules should be compiled with the same @option{-G @var{num}} value.
23764 @item -mregnames
23765 @itemx -mno-regnames
23766 @opindex mregnames
23767 @opindex mno-regnames
23768 On System V.4 and embedded PowerPC systems do (do not) emit register
23769 names in the assembly language output using symbolic forms.
23771 @item -mlongcall
23772 @itemx -mno-longcall
23773 @opindex mlongcall
23774 @opindex mno-longcall
23775 By default assume that all calls are far away so that a longer and more
23776 expensive calling sequence is required.  This is required for calls
23777 farther than 32 megabytes (33,554,432 bytes) from the current location.
23778 A short call is generated if the compiler knows
23779 the call cannot be that far away.  This setting can be overridden by
23780 the @code{shortcall} function attribute, or by @code{#pragma
23781 longcall(0)}.
23783 Some linkers are capable of detecting out-of-range calls and generating
23784 glue code on the fly.  On these systems, long calls are unnecessary and
23785 generate slower code.  As of this writing, the AIX linker can do this,
23786 as can the GNU linker for PowerPC/64.  It is planned to add this feature
23787 to the GNU linker for 32-bit PowerPC systems as well.
23789 In the future, GCC may ignore all longcall specifications
23790 when the linker is known to generate glue.
23792 @item -mtls-markers
23793 @itemx -mno-tls-markers
23794 @opindex mtls-markers
23795 @opindex mno-tls-markers
23796 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
23797 specifying the function argument.  The relocation allows the linker to
23798 reliably associate function call with argument setup instructions for
23799 TLS optimization, which in turn allows GCC to better schedule the
23800 sequence.
23802 @item -mrecip
23803 @itemx -mno-recip
23804 @opindex mrecip
23805 This option enables use of the reciprocal estimate and
23806 reciprocal square root estimate instructions with additional
23807 Newton-Raphson steps to increase precision instead of doing a divide or
23808 square root and divide for floating-point arguments.  You should use
23809 the @option{-ffast-math} option when using @option{-mrecip} (or at
23810 least @option{-funsafe-math-optimizations},
23811 @option{-ffinite-math-only}, @option{-freciprocal-math} and
23812 @option{-fno-trapping-math}).  Note that while the throughput of the
23813 sequence is generally higher than the throughput of the non-reciprocal
23814 instruction, the precision of the sequence can be decreased by up to 2
23815 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
23816 roots.
23818 @item -mrecip=@var{opt}
23819 @opindex mrecip=opt
23820 This option controls which reciprocal estimate instructions
23821 may be used.  @var{opt} is a comma-separated list of options, which may
23822 be preceded by a @code{!} to invert the option:
23824 @table @samp
23826 @item all
23827 Enable all estimate instructions.
23829 @item default
23830 Enable the default instructions, equivalent to @option{-mrecip}.
23832 @item none
23833 Disable all estimate instructions, equivalent to @option{-mno-recip}.
23835 @item div
23836 Enable the reciprocal approximation instructions for both
23837 single and double precision.
23839 @item divf
23840 Enable the single-precision reciprocal approximation instructions.
23842 @item divd
23843 Enable the double-precision reciprocal approximation instructions.
23845 @item rsqrt
23846 Enable the reciprocal square root approximation instructions for both
23847 single and double precision.
23849 @item rsqrtf
23850 Enable the single-precision reciprocal square root approximation instructions.
23852 @item rsqrtd
23853 Enable the double-precision reciprocal square root approximation instructions.
23855 @end table
23857 So, for example, @option{-mrecip=all,!rsqrtd} enables
23858 all of the reciprocal estimate instructions, except for the
23859 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
23860 which handle the double-precision reciprocal square root calculations.
23862 @item -mrecip-precision
23863 @itemx -mno-recip-precision
23864 @opindex mrecip-precision
23865 Assume (do not assume) that the reciprocal estimate instructions
23866 provide higher-precision estimates than is mandated by the PowerPC
23867 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
23868 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
23869 The double-precision square root estimate instructions are not generated by
23870 default on low-precision machines, since they do not provide an
23871 estimate that converges after three steps.
23873 @item -mpointers-to-nested-functions
23874 @itemx -mno-pointers-to-nested-functions
23875 @opindex mpointers-to-nested-functions
23876 Generate (do not generate) code to load up the static chain register
23877 (@code{r11}) when calling through a pointer on AIX and 64-bit Linux
23878 systems where a function pointer points to a 3-word descriptor giving
23879 the function address, TOC value to be loaded in register @code{r2}, and
23880 static chain value to be loaded in register @code{r11}.  The
23881 @option{-mpointers-to-nested-functions} is on by default.  You cannot
23882 call through pointers to nested functions or pointers
23883 to functions compiled in other languages that use the static chain if
23884 you use @option{-mno-pointers-to-nested-functions}.
23886 @item -msave-toc-indirect
23887 @itemx -mno-save-toc-indirect
23888 @opindex msave-toc-indirect
23889 Generate (do not generate) code to save the TOC value in the reserved
23890 stack location in the function prologue if the function calls through
23891 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
23892 saved in the prologue, it is saved just before the call through the
23893 pointer.  The @option{-mno-save-toc-indirect} option is the default.
23895 @item -mcompat-align-parm
23896 @itemx -mno-compat-align-parm
23897 @opindex mcompat-align-parm
23898 Generate (do not generate) code to pass structure parameters with a
23899 maximum alignment of 64 bits, for compatibility with older versions
23900 of GCC.
23902 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
23903 structure parameter on a 128-bit boundary when that structure contained
23904 a member requiring 128-bit alignment.  This is corrected in more
23905 recent versions of GCC.  This option may be used to generate code
23906 that is compatible with functions compiled with older versions of
23907 GCC.
23909 The @option{-mno-compat-align-parm} option is the default.
23911 @item -mstack-protector-guard=@var{guard}
23912 @itemx -mstack-protector-guard-reg=@var{reg}
23913 @itemx -mstack-protector-guard-offset=@var{offset}
23914 @itemx -mstack-protector-guard-symbol=@var{symbol}
23915 @opindex mstack-protector-guard
23916 @opindex mstack-protector-guard-reg
23917 @opindex mstack-protector-guard-offset
23918 @opindex mstack-protector-guard-symbol
23919 Generate stack protection code using canary at @var{guard}.  Supported
23920 locations are @samp{global} for global canary or @samp{tls} for per-thread
23921 canary in the TLS block (the default with GNU libc version 2.4 or later).
23923 With the latter choice the options
23924 @option{-mstack-protector-guard-reg=@var{reg}} and
23925 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
23926 which register to use as base register for reading the canary, and from what
23927 offset from that base register. The default for those is as specified in the
23928 relevant ABI.  @option{-mstack-protector-guard-symbol=@var{symbol}} overrides
23929 the offset with a symbol reference to a canary in the TLS block.
23930 @end table
23933 @node RISC-V Options
23934 @subsection RISC-V Options
23935 @cindex RISC-V Options
23937 These command-line options are defined for RISC-V targets:
23939 @table @gcctabopt
23940 @item -mbranch-cost=@var{n}
23941 @opindex mbranch-cost
23942 Set the cost of branches to roughly @var{n} instructions.
23944 @item -mplt
23945 @itemx -mno-plt
23946 @opindex plt
23947 When generating PIC code, do or don't allow the use of PLTs. Ignored for
23948 non-PIC.  The default is @option{-mplt}.
23950 @item -mabi=@var{ABI-string}
23951 @opindex mabi
23952 Specify integer and floating-point calling convention.  @var{ABI-string}
23953 contains two parts: the size of integer types and the registers used for
23954 floating-point types.  For example @samp{-march=rv64ifd -mabi=lp64d} means that
23955 @samp{long} and pointers are 64-bit (implicitly defining @samp{int} to be
23956 32-bit), and that floating-point values up to 64 bits wide are passed in F
23957 registers.  Contrast this with @samp{-march=rv64ifd -mabi=lp64f}, which still
23958 allows the compiler to generate code that uses the F and D extensions but only
23959 allows floating-point values up to 32 bits long to be passed in registers; or
23960 @samp{-march=rv64ifd -mabi=lp64}, in which no floating-point arguments will be
23961 passed in registers.
23963 The default for this argument is system dependent, users who want a specific
23964 calling convention should specify one explicitly.  The valid calling
23965 conventions are: @samp{ilp32}, @samp{ilp32f}, @samp{ilp32d}, @samp{lp64},
23966 @samp{lp64f}, and @samp{lp64d}.  Some calling conventions are impossible to
23967 implement on some ISAs: for example, @samp{-march=rv32if -mabi=ilp32d} is
23968 invalid because the ABI requires 64-bit values be passed in F registers, but F
23969 registers are only 32 bits wide.  There is also the @samp{ilp32e} ABI that can
23970 only be used with the @samp{rv32e} architecture.  This ABI is not well
23971 specified at present, and is subject to change.
23973 @item -mfdiv
23974 @itemx -mno-fdiv
23975 @opindex mfdiv
23976 Do or don't use hardware floating-point divide and square root instructions.
23977 This requires the F or D extensions for floating-point registers.  The default
23978 is to use them if the specified architecture has these instructions.
23980 @item -mdiv
23981 @itemx -mno-div
23982 @opindex mdiv
23983 Do or don't use hardware instructions for integer division.  This requires the
23984 M extension.  The default is to use them if the specified architecture has
23985 these instructions.
23987 @item -march=@var{ISA-string}
23988 @opindex march
23989 Generate code for given RISC-V ISA (e.g.@: @samp{rv64im}).  ISA strings must be
23990 lower-case.  Examples include @samp{rv64i}, @samp{rv32g}, @samp{rv32e}, and
23991 @samp{rv32imaf}.
23993 @item -mtune=@var{processor-string}
23994 @opindex mtune
23995 Optimize the output for the given processor, specified by microarchitecture
23996 name.
23998 @item -mpreferred-stack-boundary=@var{num}
23999 @opindex mpreferred-stack-boundary
24000 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
24001 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
24002 the default is 4 (16 bytes or 128-bits).
24004 @strong{Warning:} If you use this switch, then you must build all modules with
24005 the same value, including any libraries.  This includes the system libraries
24006 and startup modules.
24008 @item -msmall-data-limit=@var{n}
24009 @opindex msmall-data-limit
24010 Put global and static data smaller than @var{n} bytes into a special section
24011 (on some targets).
24013 @item -msave-restore
24014 @itemx -mno-save-restore
24015 @opindex msave-restore
24016 Do or don't use smaller but slower prologue and epilogue code that uses
24017 library function calls.  The default is to use fast inline prologues and
24018 epilogues.
24020 @item -mstrict-align
24021 @itemx -mno-strict-align
24022 @opindex mstrict-align
24023 Do not or do generate unaligned memory accesses.  The default is set depending
24024 on whether the processor we are optimizing for supports fast unaligned access
24025 or not.
24027 @item -mcmodel=medlow
24028 @opindex mcmodel=medlow
24029 Generate code for the medium-low code model. The program and its statically
24030 defined symbols must lie within a single 2 GiB address range and must lie
24031 between absolute addresses @minus{}2 GiB and +2 GiB. Programs can be
24032 statically or dynamically linked. This is the default code model.
24034 @item -mcmodel=medany
24035 @opindex mcmodel=medany
24036 Generate code for the medium-any code model. The program and its statically
24037 defined symbols must be within any single 2 GiB address range. Programs can be
24038 statically or dynamically linked.
24040 @item -mexplicit-relocs
24041 @itemx -mno-exlicit-relocs
24042 Use or do not use assembler relocation operators when dealing with symbolic
24043 addresses.  The alternative is to use assembler macros instead, which may
24044 limit optimization.
24046 @item -mrelax
24047 @itemx -mno-relax
24048 Take advantage of linker relaxations to reduce the number of instructions
24049 required to materialize symbol addresses. The default is to take advantage of
24050 linker relaxations.
24052 @end table
24054 @node RL78 Options
24055 @subsection RL78 Options
24056 @cindex RL78 Options
24058 @table @gcctabopt
24060 @item -msim
24061 @opindex msim
24062 Links in additional target libraries to support operation within a
24063 simulator.
24065 @item -mmul=none
24066 @itemx -mmul=g10
24067 @itemx -mmul=g13
24068 @itemx -mmul=g14
24069 @itemx -mmul=rl78
24070 @opindex mmul
24071 Specifies the type of hardware multiplication and division support to
24072 be used.  The simplest is @code{none}, which uses software for both
24073 multiplication and division.  This is the default.  The @code{g13}
24074 value is for the hardware multiply/divide peripheral found on the
24075 RL78/G13 (S2 core) targets.  The @code{g14} value selects the use of
24076 the multiplication and division instructions supported by the RL78/G14
24077 (S3 core) parts.  The value @code{rl78} is an alias for @code{g14} and
24078 the value @code{mg10} is an alias for @code{none}.
24080 In addition a C preprocessor macro is defined, based upon the setting
24081 of this option.  Possible values are: @code{__RL78_MUL_NONE__},
24082 @code{__RL78_MUL_G13__} or @code{__RL78_MUL_G14__}.
24084 @item -mcpu=g10
24085 @itemx -mcpu=g13
24086 @itemx -mcpu=g14
24087 @itemx -mcpu=rl78
24088 @opindex mcpu
24089 Specifies the RL78 core to target.  The default is the G14 core, also
24090 known as an S3 core or just RL78.  The G13 or S2 core does not have
24091 multiply or divide instructions, instead it uses a hardware peripheral
24092 for these operations.  The G10 or S1 core does not have register
24093 banks, so it uses a different calling convention.
24095 If this option is set it also selects the type of hardware multiply
24096 support to use, unless this is overridden by an explicit
24097 @option{-mmul=none} option on the command line.  Thus specifying
24098 @option{-mcpu=g13} enables the use of the G13 hardware multiply
24099 peripheral and specifying @option{-mcpu=g10} disables the use of
24100 hardware multiplications altogether.
24102 Note, although the RL78/G14 core is the default target, specifying
24103 @option{-mcpu=g14} or @option{-mcpu=rl78} on the command line does
24104 change the behavior of the toolchain since it also enables G14
24105 hardware multiply support.  If these options are not specified on the
24106 command line then software multiplication routines will be used even
24107 though the code targets the RL78 core.  This is for backwards
24108 compatibility with older toolchains which did not have hardware
24109 multiply and divide support.
24111 In addition a C preprocessor macro is defined, based upon the setting
24112 of this option.  Possible values are: @code{__RL78_G10__},
24113 @code{__RL78_G13__} or @code{__RL78_G14__}.
24115 @item -mg10
24116 @itemx -mg13
24117 @itemx -mg14
24118 @itemx -mrl78
24119 @opindex mg10
24120 @opindex mg13
24121 @opindex mg14
24122 @opindex mrl78
24123 These are aliases for the corresponding @option{-mcpu=} option.  They
24124 are provided for backwards compatibility.
24126 @item -mallregs
24127 @opindex mallregs
24128 Allow the compiler to use all of the available registers.  By default
24129 registers @code{r24..r31} are reserved for use in interrupt handlers.
24130 With this option enabled these registers can be used in ordinary
24131 functions as well.
24133 @item -m64bit-doubles
24134 @itemx -m32bit-doubles
24135 @opindex m64bit-doubles
24136 @opindex m32bit-doubles
24137 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
24138 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
24139 @option{-m32bit-doubles}.
24141 @item -msave-mduc-in-interrupts
24142 @itemx -mno-save-mduc-in-interrupts
24143 @opindex msave-mduc-in-interrupts
24144 @opindex mno-save-mduc-in-interrupts
24145 Specifies that interrupt handler functions should preserve the
24146 MDUC registers.  This is only necessary if normal code might use
24147 the MDUC registers, for example because it performs multiplication
24148 and division operations.  The default is to ignore the MDUC registers
24149 as this makes the interrupt handlers faster.  The target option -mg13
24150 needs to be passed for this to work as this feature is only available
24151 on the G13 target (S2 core).  The MDUC registers will only be saved
24152 if the interrupt handler performs a multiplication or division
24153 operation or it calls another function.
24155 @end table
24157 @node RS/6000 and PowerPC Options
24158 @subsection IBM RS/6000 and PowerPC Options
24159 @cindex RS/6000 and PowerPC Options
24160 @cindex IBM RS/6000 and PowerPC Options
24162 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
24163 @table @gcctabopt
24164 @item -mpowerpc-gpopt
24165 @itemx -mno-powerpc-gpopt
24166 @itemx -mpowerpc-gfxopt
24167 @itemx -mno-powerpc-gfxopt
24168 @need 800
24169 @itemx -mpowerpc64
24170 @itemx -mno-powerpc64
24171 @itemx -mmfcrf
24172 @itemx -mno-mfcrf
24173 @itemx -mpopcntb
24174 @itemx -mno-popcntb
24175 @itemx -mpopcntd
24176 @itemx -mno-popcntd
24177 @itemx -mfprnd
24178 @itemx -mno-fprnd
24179 @need 800
24180 @itemx -mcmpb
24181 @itemx -mno-cmpb
24182 @itemx -mmfpgpr
24183 @itemx -mno-mfpgpr
24184 @itemx -mhard-dfp
24185 @itemx -mno-hard-dfp
24186 @opindex mpowerpc-gpopt
24187 @opindex mno-powerpc-gpopt
24188 @opindex mpowerpc-gfxopt
24189 @opindex mno-powerpc-gfxopt
24190 @opindex mpowerpc64
24191 @opindex mno-powerpc64
24192 @opindex mmfcrf
24193 @opindex mno-mfcrf
24194 @opindex mpopcntb
24195 @opindex mno-popcntb
24196 @opindex mpopcntd
24197 @opindex mno-popcntd
24198 @opindex mfprnd
24199 @opindex mno-fprnd
24200 @opindex mcmpb
24201 @opindex mno-cmpb
24202 @opindex mmfpgpr
24203 @opindex mno-mfpgpr
24204 @opindex mhard-dfp
24205 @opindex mno-hard-dfp
24206 You use these options to specify which instructions are available on the
24207 processor you are using.  The default value of these options is
24208 determined when configuring GCC@.  Specifying the
24209 @option{-mcpu=@var{cpu_type}} overrides the specification of these
24210 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
24211 rather than the options listed above.
24213 Specifying @option{-mpowerpc-gpopt} allows
24214 GCC to use the optional PowerPC architecture instructions in the
24215 General Purpose group, including floating-point square root.  Specifying
24216 @option{-mpowerpc-gfxopt} allows GCC to
24217 use the optional PowerPC architecture instructions in the Graphics
24218 group, including floating-point select.
24220 The @option{-mmfcrf} option allows GCC to generate the move from
24221 condition register field instruction implemented on the POWER4
24222 processor and other processors that support the PowerPC V2.01
24223 architecture.
24224 The @option{-mpopcntb} option allows GCC to generate the popcount and
24225 double-precision FP reciprocal estimate instruction implemented on the
24226 POWER5 processor and other processors that support the PowerPC V2.02
24227 architecture.
24228 The @option{-mpopcntd} option allows GCC to generate the popcount
24229 instruction implemented on the POWER7 processor and other processors
24230 that support the PowerPC V2.06 architecture.
24231 The @option{-mfprnd} option allows GCC to generate the FP round to
24232 integer instructions implemented on the POWER5+ processor and other
24233 processors that support the PowerPC V2.03 architecture.
24234 The @option{-mcmpb} option allows GCC to generate the compare bytes
24235 instruction implemented on the POWER6 processor and other processors
24236 that support the PowerPC V2.05 architecture.
24237 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
24238 general-purpose register instructions implemented on the POWER6X
24239 processor and other processors that support the extended PowerPC V2.05
24240 architecture.
24241 The @option{-mhard-dfp} option allows GCC to generate the decimal
24242 floating-point instructions implemented on some POWER processors.
24244 The @option{-mpowerpc64} option allows GCC to generate the additional
24245 64-bit instructions that are found in the full PowerPC64 architecture
24246 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
24247 @option{-mno-powerpc64}.
24249 @item -mcpu=@var{cpu_type}
24250 @opindex mcpu
24251 Set architecture type, register usage, and
24252 instruction scheduling parameters for machine type @var{cpu_type}.
24253 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
24254 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
24255 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
24256 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
24257 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
24258 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
24259 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
24260 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
24261 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
24262 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8},
24263 @samp{power9}, @samp{powerpc}, @samp{powerpc64}, @samp{powerpc64le},
24264 @samp{rs64}, and @samp{native}.
24266 @option{-mcpu=powerpc}, @option{-mcpu=powerpc64}, and
24267 @option{-mcpu=powerpc64le} specify pure 32-bit PowerPC (either
24268 endian), 64-bit big endian PowerPC and 64-bit little endian PowerPC
24269 architecture machine types, with an appropriate, generic processor
24270 model assumed for scheduling purposes.
24272 Specifying @samp{native} as cpu type detects and selects the
24273 architecture option that corresponds to the host processor of the
24274 system performing the compilation.
24275 @option{-mcpu=native} has no effect if GCC does not recognize the
24276 processor.
24278 The other options specify a specific processor.  Code generated under
24279 those options runs best on that processor, and may not run at all on
24280 others.
24282 The @option{-mcpu} options automatically enable or disable the
24283 following options:
24285 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
24286 -mpopcntb -mpopcntd  -mpowerpc64 @gol
24287 -mpowerpc-gpopt  -mpowerpc-gfxopt @gol
24288 -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
24289 -mcrypto -mhtm -mpower8-fusion -mpower8-vector @gol
24290 -mquad-memory -mquad-memory-atomic -mfloat128 -mfloat128-hardware}
24292 The particular options set for any particular CPU varies between
24293 compiler versions, depending on what setting seems to produce optimal
24294 code for that CPU; it doesn't necessarily reflect the actual hardware's
24295 capabilities.  If you wish to set an individual option to a particular
24296 value, you may specify it after the @option{-mcpu} option, like
24297 @option{-mcpu=970 -mno-altivec}.
24299 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
24300 not enabled or disabled by the @option{-mcpu} option at present because
24301 AIX does not have full support for these options.  You may still
24302 enable or disable them individually if you're sure it'll work in your
24303 environment.
24305 @item -mtune=@var{cpu_type}
24306 @opindex mtune
24307 Set the instruction scheduling parameters for machine type
24308 @var{cpu_type}, but do not set the architecture type or register usage,
24309 as @option{-mcpu=@var{cpu_type}} does.  The same
24310 values for @var{cpu_type} are used for @option{-mtune} as for
24311 @option{-mcpu}.  If both are specified, the code generated uses the
24312 architecture and registers set by @option{-mcpu}, but the
24313 scheduling parameters set by @option{-mtune}.
24315 @item -mcmodel=small
24316 @opindex mcmodel=small
24317 Generate PowerPC64 code for the small model: The TOC is limited to
24318 64k.
24320 @item -mcmodel=medium
24321 @opindex mcmodel=medium
24322 Generate PowerPC64 code for the medium model: The TOC and other static
24323 data may be up to a total of 4G in size.  This is the default for 64-bit
24324 Linux.
24326 @item -mcmodel=large
24327 @opindex mcmodel=large
24328 Generate PowerPC64 code for the large model: The TOC may be up to 4G
24329 in size.  Other data and code is only limited by the 64-bit address
24330 space.
24332 @item -maltivec
24333 @itemx -mno-altivec
24334 @opindex maltivec
24335 @opindex mno-altivec
24336 Generate code that uses (does not use) AltiVec instructions, and also
24337 enable the use of built-in functions that allow more direct access to
24338 the AltiVec instruction set.  You may also need to set
24339 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
24340 enhancements.
24342 When @option{-maltivec} is used, rather than @option{-maltivec=le} or
24343 @option{-maltivec=be}, the element order for AltiVec intrinsics such
24344 as @code{vec_splat}, @code{vec_extract}, and @code{vec_insert} 
24345 match array element order corresponding to the endianness of the
24346 target.  That is, element zero identifies the leftmost element in a
24347 vector register when targeting a big-endian platform, and identifies
24348 the rightmost element in a vector register when targeting a
24349 little-endian platform.
24351 @item -maltivec=be
24352 @opindex maltivec=be
24353 Generate AltiVec instructions using big-endian element order,
24354 regardless of whether the target is big- or little-endian.  This is
24355 the default when targeting a big-endian platform.  Using this option
24356 is currently deprecated.  Support for this feature will be removed in
24357 GCC 9.
24359 The element order is used to interpret element numbers in AltiVec
24360 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
24361 @code{vec_insert}.  By default, these match array element order
24362 corresponding to the endianness for the target.
24364 @item -maltivec=le
24365 @opindex maltivec=le
24366 Generate AltiVec instructions using little-endian element order,
24367 regardless of whether the target is big- or little-endian.  This is
24368 the default when targeting a little-endian platform.  This option is
24369 currently ignored when targeting a big-endian platform.
24371 The element order is used to interpret element numbers in AltiVec
24372 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
24373 @code{vec_insert}.  By default, these match array element order
24374 corresponding to the endianness for the target.
24376 @item -mvrsave
24377 @itemx -mno-vrsave
24378 @opindex mvrsave
24379 @opindex mno-vrsave
24380 Generate VRSAVE instructions when generating AltiVec code.
24382 @item -msecure-plt
24383 @opindex msecure-plt
24384 Generate code that allows @command{ld} and @command{ld.so}
24385 to build executables and shared
24386 libraries with non-executable @code{.plt} and @code{.got} sections.
24387 This is a PowerPC
24388 32-bit SYSV ABI option.
24390 @item -mbss-plt
24391 @opindex mbss-plt
24392 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
24393 fills in, and
24394 requires @code{.plt} and @code{.got}
24395 sections that are both writable and executable.
24396 This is a PowerPC 32-bit SYSV ABI option.
24398 @item -misel
24399 @itemx -mno-isel
24400 @opindex misel
24401 @opindex mno-isel
24402 This switch enables or disables the generation of ISEL instructions.
24404 @item -mvsx
24405 @itemx -mno-vsx
24406 @opindex mvsx
24407 @opindex mno-vsx
24408 Generate code that uses (does not use) vector/scalar (VSX)
24409 instructions, and also enable the use of built-in functions that allow
24410 more direct access to the VSX instruction set.
24412 @item -mcrypto
24413 @itemx -mno-crypto
24414 @opindex mcrypto
24415 @opindex mno-crypto
24416 Enable the use (disable) of the built-in functions that allow direct
24417 access to the cryptographic instructions that were added in version
24418 2.07 of the PowerPC ISA.
24420 @item -mhtm
24421 @itemx -mno-htm
24422 @opindex mhtm
24423 @opindex mno-htm
24424 Enable (disable) the use of the built-in functions that allow direct
24425 access to the Hardware Transactional Memory (HTM) instructions that
24426 were added in version 2.07 of the PowerPC ISA.
24428 @item -mpower8-fusion
24429 @itemx -mno-power8-fusion
24430 @opindex mpower8-fusion
24431 @opindex mno-power8-fusion
24432 Generate code that keeps (does not keeps) some integer operations
24433 adjacent so that the instructions can be fused together on power8 and
24434 later processors.
24436 @item -mpower8-vector
24437 @itemx -mno-power8-vector
24438 @opindex mpower8-vector
24439 @opindex mno-power8-vector
24440 Generate code that uses (does not use) the vector and scalar
24441 instructions that were added in version 2.07 of the PowerPC ISA.  Also
24442 enable the use of built-in functions that allow more direct access to
24443 the vector instructions.
24445 @item -mquad-memory
24446 @itemx -mno-quad-memory
24447 @opindex mquad-memory
24448 @opindex mno-quad-memory
24449 Generate code that uses (does not use) the non-atomic quad word memory
24450 instructions.  The @option{-mquad-memory} option requires use of
24451 64-bit mode.
24453 @item -mquad-memory-atomic
24454 @itemx -mno-quad-memory-atomic
24455 @opindex mquad-memory-atomic
24456 @opindex mno-quad-memory-atomic
24457 Generate code that uses (does not use) the atomic quad word memory
24458 instructions.  The @option{-mquad-memory-atomic} option requires use of
24459 64-bit mode.
24461 @item -mfloat128
24462 @itemx -mno-float128
24463 @opindex mfloat128
24464 @opindex mno-float128
24465 Enable/disable the @var{__float128} keyword for IEEE 128-bit floating point
24466 and use either software emulation for IEEE 128-bit floating point or
24467 hardware instructions.
24469 The VSX instruction set (@option{-mvsx}, @option{-mcpu=power7},
24470 @option{-mcpu=power8}), or @option{-mcpu=power9} must be enabled to
24471 use the IEEE 128-bit floating point support.  The IEEE 128-bit
24472 floating point support only works on PowerPC Linux systems.
24474 The default for @option{-mfloat128} is enabled on PowerPC Linux
24475 systems using the VSX instruction set, and disabled on other systems.
24477 If you use the ISA 3.0 instruction set (@option{-mpower9-vector} or
24478 @option{-mcpu=power9}) on a 64-bit system, the IEEE 128-bit floating
24479 point support will also enable the generation of ISA 3.0 IEEE 128-bit
24480 floating point instructions.  Otherwise, if you do not specify to
24481 generate ISA 3.0 instructions or you are targeting a 32-bit big endian
24482 system, IEEE 128-bit floating point will be done with software
24483 emulation.
24485 @item -mfloat128-hardware
24486 @itemx -mno-float128-hardware
24487 @opindex mfloat128-hardware
24488 @opindex mno-float128-hardware
24489 Enable/disable using ISA 3.0 hardware instructions to support the
24490 @var{__float128} data type.
24492 The default for @option{-mfloat128-hardware} is enabled on PowerPC
24493 Linux systems using the ISA 3.0 instruction set, and disabled on other
24494 systems.
24496 @item -m32
24497 @itemx -m64
24498 @opindex m32
24499 @opindex m64
24500 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
24501 targets (including GNU/Linux).  The 32-bit environment sets int, long
24502 and pointer to 32 bits and generates code that runs on any PowerPC
24503 variant.  The 64-bit environment sets int to 32 bits and long and
24504 pointer to 64 bits, and generates code for PowerPC64, as for
24505 @option{-mpowerpc64}.
24507 @item -mfull-toc
24508 @itemx -mno-fp-in-toc
24509 @itemx -mno-sum-in-toc
24510 @itemx -mminimal-toc
24511 @opindex mfull-toc
24512 @opindex mno-fp-in-toc
24513 @opindex mno-sum-in-toc
24514 @opindex mminimal-toc
24515 Modify generation of the TOC (Table Of Contents), which is created for
24516 every executable file.  The @option{-mfull-toc} option is selected by
24517 default.  In that case, GCC allocates at least one TOC entry for
24518 each unique non-automatic variable reference in your program.  GCC
24519 also places floating-point constants in the TOC@.  However, only
24520 16,384 entries are available in the TOC@.
24522 If you receive a linker error message that saying you have overflowed
24523 the available TOC space, you can reduce the amount of TOC space used
24524 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
24525 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
24526 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
24527 generate code to calculate the sum of an address and a constant at
24528 run time instead of putting that sum into the TOC@.  You may specify one
24529 or both of these options.  Each causes GCC to produce very slightly
24530 slower and larger code at the expense of conserving TOC space.
24532 If you still run out of space in the TOC even when you specify both of
24533 these options, specify @option{-mminimal-toc} instead.  This option causes
24534 GCC to make only one TOC entry for every file.  When you specify this
24535 option, GCC produces code that is slower and larger but which
24536 uses extremely little TOC space.  You may wish to use this option
24537 only on files that contain less frequently-executed code.
24539 @item -maix64
24540 @itemx -maix32
24541 @opindex maix64
24542 @opindex maix32
24543 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
24544 @code{long} type, and the infrastructure needed to support them.
24545 Specifying @option{-maix64} implies @option{-mpowerpc64},
24546 while @option{-maix32} disables the 64-bit ABI and
24547 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
24549 @item -mxl-compat
24550 @itemx -mno-xl-compat
24551 @opindex mxl-compat
24552 @opindex mno-xl-compat
24553 Produce code that conforms more closely to IBM XL compiler semantics
24554 when using AIX-compatible ABI@.  Pass floating-point arguments to
24555 prototyped functions beyond the register save area (RSA) on the stack
24556 in addition to argument FPRs.  Do not assume that most significant
24557 double in 128-bit long double value is properly rounded when comparing
24558 values and converting to double.  Use XL symbol names for long double
24559 support routines.
24561 The AIX calling convention was extended but not initially documented to
24562 handle an obscure K&R C case of calling a function that takes the
24563 address of its arguments with fewer arguments than declared.  IBM XL
24564 compilers access floating-point arguments that do not fit in the
24565 RSA from the stack when a subroutine is compiled without
24566 optimization.  Because always storing floating-point arguments on the
24567 stack is inefficient and rarely needed, this option is not enabled by
24568 default and only is necessary when calling subroutines compiled by IBM
24569 XL compilers without optimization.
24571 @item -mpe
24572 @opindex mpe
24573 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
24574 application written to use message passing with special startup code to
24575 enable the application to run.  The system must have PE installed in the
24576 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
24577 must be overridden with the @option{-specs=} option to specify the
24578 appropriate directory location.  The Parallel Environment does not
24579 support threads, so the @option{-mpe} option and the @option{-pthread}
24580 option are incompatible.
24582 @item -malign-natural
24583 @itemx -malign-power
24584 @opindex malign-natural
24585 @opindex malign-power
24586 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
24587 @option{-malign-natural} overrides the ABI-defined alignment of larger
24588 types, such as floating-point doubles, on their natural size-based boundary.
24589 The option @option{-malign-power} instructs GCC to follow the ABI-specified
24590 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
24592 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
24593 is not supported.
24595 @item -msoft-float
24596 @itemx -mhard-float
24597 @opindex msoft-float
24598 @opindex mhard-float
24599 Generate code that does not use (uses) the floating-point register set.
24600 Software floating-point emulation is provided if you use the
24601 @option{-msoft-float} option, and pass the option to GCC when linking.
24603 @item -mmultiple
24604 @itemx -mno-multiple
24605 @opindex mmultiple
24606 @opindex mno-multiple
24607 Generate code that uses (does not use) the load multiple word
24608 instructions and the store multiple word instructions.  These
24609 instructions are generated by default on POWER systems, and not
24610 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
24611 PowerPC systems, since those instructions do not work when the
24612 processor is in little-endian mode.  The exceptions are PPC740 and
24613 PPC750 which permit these instructions in little-endian mode.
24615 @item -mupdate
24616 @itemx -mno-update
24617 @opindex mupdate
24618 @opindex mno-update
24619 Generate code that uses (does not use) the load or store instructions
24620 that update the base register to the address of the calculated memory
24621 location.  These instructions are generated by default.  If you use
24622 @option{-mno-update}, there is a small window between the time that the
24623 stack pointer is updated and the address of the previous frame is
24624 stored, which means code that walks the stack frame across interrupts or
24625 signals may get corrupted data.
24627 @item -mavoid-indexed-addresses
24628 @itemx -mno-avoid-indexed-addresses
24629 @opindex mavoid-indexed-addresses
24630 @opindex mno-avoid-indexed-addresses
24631 Generate code that tries to avoid (not avoid) the use of indexed load
24632 or store instructions. These instructions can incur a performance
24633 penalty on Power6 processors in certain situations, such as when
24634 stepping through large arrays that cross a 16M boundary.  This option
24635 is enabled by default when targeting Power6 and disabled otherwise.
24637 @item -mfused-madd
24638 @itemx -mno-fused-madd
24639 @opindex mfused-madd
24640 @opindex mno-fused-madd
24641 Generate code that uses (does not use) the floating-point multiply and
24642 accumulate instructions.  These instructions are generated by default
24643 if hardware floating point is used.  The machine-dependent
24644 @option{-mfused-madd} option is now mapped to the machine-independent
24645 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
24646 mapped to @option{-ffp-contract=off}.
24648 @item -mmulhw
24649 @itemx -mno-mulhw
24650 @opindex mmulhw
24651 @opindex mno-mulhw
24652 Generate code that uses (does not use) the half-word multiply and
24653 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
24654 These instructions are generated by default when targeting those
24655 processors.
24657 @item -mdlmzb
24658 @itemx -mno-dlmzb
24659 @opindex mdlmzb
24660 @opindex mno-dlmzb
24661 Generate code that uses (does not use) the string-search @samp{dlmzb}
24662 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
24663 generated by default when targeting those processors.
24665 @item -mno-bit-align
24666 @itemx -mbit-align
24667 @opindex mno-bit-align
24668 @opindex mbit-align
24669 On System V.4 and embedded PowerPC systems do not (do) force structures
24670 and unions that contain bit-fields to be aligned to the base type of the
24671 bit-field.
24673 For example, by default a structure containing nothing but 8
24674 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
24675 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
24676 the structure is aligned to a 1-byte boundary and is 1 byte in
24677 size.
24679 @item -mno-strict-align
24680 @itemx -mstrict-align
24681 @opindex mno-strict-align
24682 @opindex mstrict-align
24683 On System V.4 and embedded PowerPC systems do not (do) assume that
24684 unaligned memory references are handled by the system.
24686 @item -mrelocatable
24687 @itemx -mno-relocatable
24688 @opindex mrelocatable
24689 @opindex mno-relocatable
24690 Generate code that allows (does not allow) a static executable to be
24691 relocated to a different address at run time.  A simple embedded
24692 PowerPC system loader should relocate the entire contents of
24693 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
24694 a table of 32-bit addresses generated by this option.  For this to
24695 work, all objects linked together must be compiled with
24696 @option{-mrelocatable} or @option{-mrelocatable-lib}.
24697 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
24699 @item -mrelocatable-lib
24700 @itemx -mno-relocatable-lib
24701 @opindex mrelocatable-lib
24702 @opindex mno-relocatable-lib
24703 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
24704 @code{.fixup} section to allow static executables to be relocated at
24705 run time, but @option{-mrelocatable-lib} does not use the smaller stack
24706 alignment of @option{-mrelocatable}.  Objects compiled with
24707 @option{-mrelocatable-lib} may be linked with objects compiled with
24708 any combination of the @option{-mrelocatable} options.
24710 @item -mno-toc
24711 @itemx -mtoc
24712 @opindex mno-toc
24713 @opindex mtoc
24714 On System V.4 and embedded PowerPC systems do not (do) assume that
24715 register 2 contains a pointer to a global area pointing to the addresses
24716 used in the program.
24718 @item -mlittle
24719 @itemx -mlittle-endian
24720 @opindex mlittle
24721 @opindex mlittle-endian
24722 On System V.4 and embedded PowerPC systems compile code for the
24723 processor in little-endian mode.  The @option{-mlittle-endian} option is
24724 the same as @option{-mlittle}.
24726 @item -mbig
24727 @itemx -mbig-endian
24728 @opindex mbig
24729 @opindex mbig-endian
24730 On System V.4 and embedded PowerPC systems compile code for the
24731 processor in big-endian mode.  The @option{-mbig-endian} option is
24732 the same as @option{-mbig}.
24734 @item -mdynamic-no-pic
24735 @opindex mdynamic-no-pic
24736 On Darwin and Mac OS X systems, compile code so that it is not
24737 relocatable, but that its external references are relocatable.  The
24738 resulting code is suitable for applications, but not shared
24739 libraries.
24741 @item -msingle-pic-base
24742 @opindex msingle-pic-base
24743 Treat the register used for PIC addressing as read-only, rather than
24744 loading it in the prologue for each function.  The runtime system is
24745 responsible for initializing this register with an appropriate value
24746 before execution begins.
24748 @item -mprioritize-restricted-insns=@var{priority}
24749 @opindex mprioritize-restricted-insns
24750 This option controls the priority that is assigned to
24751 dispatch-slot restricted instructions during the second scheduling
24752 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
24753 or @samp{2} to assign no, highest, or second-highest (respectively) 
24754 priority to dispatch-slot restricted
24755 instructions.
24757 @item -msched-costly-dep=@var{dependence_type}
24758 @opindex msched-costly-dep
24759 This option controls which dependences are considered costly
24760 by the target during instruction scheduling.  The argument
24761 @var{dependence_type} takes one of the following values:
24763 @table @asis
24764 @item @samp{no}
24765 No dependence is costly.
24767 @item @samp{all}
24768 All dependences are costly.
24770 @item @samp{true_store_to_load}
24771 A true dependence from store to load is costly.
24773 @item @samp{store_to_load}
24774 Any dependence from store to load is costly.
24776 @item @var{number}
24777 Any dependence for which the latency is greater than or equal to 
24778 @var{number} is costly.
24779 @end table
24781 @item -minsert-sched-nops=@var{scheme}
24782 @opindex minsert-sched-nops
24783 This option controls which NOP insertion scheme is used during
24784 the second scheduling pass.  The argument @var{scheme} takes one of the
24785 following values:
24787 @table @asis
24788 @item @samp{no}
24789 Don't insert NOPs.
24791 @item @samp{pad}
24792 Pad with NOPs any dispatch group that has vacant issue slots,
24793 according to the scheduler's grouping.
24795 @item @samp{regroup_exact}
24796 Insert NOPs to force costly dependent insns into
24797 separate groups.  Insert exactly as many NOPs as needed to force an insn
24798 to a new group, according to the estimated processor grouping.
24800 @item @var{number}
24801 Insert NOPs to force costly dependent insns into
24802 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
24803 @end table
24805 @item -mcall-sysv
24806 @opindex mcall-sysv
24807 On System V.4 and embedded PowerPC systems compile code using calling
24808 conventions that adhere to the March 1995 draft of the System V
24809 Application Binary Interface, PowerPC processor supplement.  This is the
24810 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
24812 @item -mcall-sysv-eabi
24813 @itemx -mcall-eabi
24814 @opindex mcall-sysv-eabi
24815 @opindex mcall-eabi
24816 Specify both @option{-mcall-sysv} and @option{-meabi} options.
24818 @item -mcall-sysv-noeabi
24819 @opindex mcall-sysv-noeabi
24820 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
24822 @item -mcall-aixdesc
24823 @opindex m
24824 On System V.4 and embedded PowerPC systems compile code for the AIX
24825 operating system.
24827 @item -mcall-linux
24828 @opindex mcall-linux
24829 On System V.4 and embedded PowerPC systems compile code for the
24830 Linux-based GNU system.
24832 @item -mcall-freebsd
24833 @opindex mcall-freebsd
24834 On System V.4 and embedded PowerPC systems compile code for the
24835 FreeBSD operating system.
24837 @item -mcall-netbsd
24838 @opindex mcall-netbsd
24839 On System V.4 and embedded PowerPC systems compile code for the
24840 NetBSD operating system.
24842 @item -mcall-openbsd
24843 @opindex mcall-netbsd
24844 On System V.4 and embedded PowerPC systems compile code for the
24845 OpenBSD operating system.
24847 @item -mtraceback=@var{traceback_type}
24848 @opindex mtraceback
24849 Select the type of traceback table. Valid values for @var{traceback_type}
24850 are @samp{full}, @samp{part}, and @samp{no}.
24852 @item -maix-struct-return
24853 @opindex maix-struct-return
24854 Return all structures in memory (as specified by the AIX ABI)@.
24856 @item -msvr4-struct-return
24857 @opindex msvr4-struct-return
24858 Return structures smaller than 8 bytes in registers (as specified by the
24859 SVR4 ABI)@.
24861 @item -mabi=@var{abi-type}
24862 @opindex mabi
24863 Extend the current ABI with a particular extension, or remove such extension.
24864 Valid values are @samp{altivec}, @samp{no-altivec},
24865 @samp{ibmlongdouble}, @samp{ieeelongdouble},
24866 @samp{elfv1}, @samp{elfv2}@.
24868 @item -mabi=ibmlongdouble
24869 @opindex mabi=ibmlongdouble
24870 Change the current ABI to use IBM extended-precision long double.
24871 This is not likely to work if your system defaults to using IEEE
24872 extended-precision long double.  If you change the long double type
24873 from IEEE extended-precision, the compiler will issue a warning unless
24874 you use the @option{-Wno-psabi} option.
24876 @item -mabi=ieeelongdouble
24877 @opindex mabi=ieeelongdouble
24878 Change the current ABI to use IEEE extended-precision long double.
24879 This is not likely to work if your system defaults to using IBM
24880 extended-precision long double.  If you change the long double type
24881 from IBM extended-precision, the compiler will issue a warning unless
24882 you use the @option{-Wno-psabi} option.
24884 @item -mabi=elfv1
24885 @opindex mabi=elfv1
24886 Change the current ABI to use the ELFv1 ABI.
24887 This is the default ABI for big-endian PowerPC 64-bit Linux.
24888 Overriding the default ABI requires special system support and is
24889 likely to fail in spectacular ways.
24891 @item -mabi=elfv2
24892 @opindex mabi=elfv2
24893 Change the current ABI to use the ELFv2 ABI.
24894 This is the default ABI for little-endian PowerPC 64-bit Linux.
24895 Overriding the default ABI requires special system support and is
24896 likely to fail in spectacular ways.
24898 @item -mgnu-attribute
24899 @itemx -mno-gnu-attribute
24900 @opindex mgnu-attribute
24901 @opindex mno-gnu-attribute
24902 Emit .gnu_attribute assembly directives to set tag/value pairs in a
24903 .gnu.attributes section that specify ABI variations in function
24904 parameters or return values.
24906 @item -mprototype
24907 @itemx -mno-prototype
24908 @opindex mprototype
24909 @opindex mno-prototype
24910 On System V.4 and embedded PowerPC systems assume that all calls to
24911 variable argument functions are properly prototyped.  Otherwise, the
24912 compiler must insert an instruction before every non-prototyped call to
24913 set or clear bit 6 of the condition code register (@code{CR}) to
24914 indicate whether floating-point values are passed in the floating-point
24915 registers in case the function takes variable arguments.  With
24916 @option{-mprototype}, only calls to prototyped variable argument functions
24917 set or clear the bit.
24919 @item -msim
24920 @opindex msim
24921 On embedded PowerPC systems, assume that the startup module is called
24922 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
24923 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
24924 configurations.
24926 @item -mmvme
24927 @opindex mmvme
24928 On embedded PowerPC systems, assume that the startup module is called
24929 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
24930 @file{libc.a}.
24932 @item -mads
24933 @opindex mads
24934 On embedded PowerPC systems, assume that the startup module is called
24935 @file{crt0.o} and the standard C libraries are @file{libads.a} and
24936 @file{libc.a}.
24938 @item -myellowknife
24939 @opindex myellowknife
24940 On embedded PowerPC systems, assume that the startup module is called
24941 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
24942 @file{libc.a}.
24944 @item -mvxworks
24945 @opindex mvxworks
24946 On System V.4 and embedded PowerPC systems, specify that you are
24947 compiling for a VxWorks system.
24949 @item -memb
24950 @opindex memb
24951 On embedded PowerPC systems, set the @code{PPC_EMB} bit in the ELF flags
24952 header to indicate that @samp{eabi} extended relocations are used.
24954 @item -meabi
24955 @itemx -mno-eabi
24956 @opindex meabi
24957 @opindex mno-eabi
24958 On System V.4 and embedded PowerPC systems do (do not) adhere to the
24959 Embedded Applications Binary Interface (EABI), which is a set of
24960 modifications to the System V.4 specifications.  Selecting @option{-meabi}
24961 means that the stack is aligned to an 8-byte boundary, a function
24962 @code{__eabi} is called from @code{main} to set up the EABI
24963 environment, and the @option{-msdata} option can use both @code{r2} and
24964 @code{r13} to point to two separate small data areas.  Selecting
24965 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
24966 no EABI initialization function is called from @code{main}, and the
24967 @option{-msdata} option only uses @code{r13} to point to a single
24968 small data area.  The @option{-meabi} option is on by default if you
24969 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
24971 @item -msdata=eabi
24972 @opindex msdata=eabi
24973 On System V.4 and embedded PowerPC systems, put small initialized
24974 @code{const} global and static data in the @code{.sdata2} section, which
24975 is pointed to by register @code{r2}.  Put small initialized
24976 non-@code{const} global and static data in the @code{.sdata} section,
24977 which is pointed to by register @code{r13}.  Put small uninitialized
24978 global and static data in the @code{.sbss} section, which is adjacent to
24979 the @code{.sdata} section.  The @option{-msdata=eabi} option is
24980 incompatible with the @option{-mrelocatable} option.  The
24981 @option{-msdata=eabi} option also sets the @option{-memb} option.
24983 @item -msdata=sysv
24984 @opindex msdata=sysv
24985 On System V.4 and embedded PowerPC systems, put small global and static
24986 data in the @code{.sdata} section, which is pointed to by register
24987 @code{r13}.  Put small uninitialized global and static data in the
24988 @code{.sbss} section, which is adjacent to the @code{.sdata} section.
24989 The @option{-msdata=sysv} option is incompatible with the
24990 @option{-mrelocatable} option.
24992 @item -msdata=default
24993 @itemx -msdata
24994 @opindex msdata=default
24995 @opindex msdata
24996 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
24997 compile code the same as @option{-msdata=eabi}, otherwise compile code the
24998 same as @option{-msdata=sysv}.
25000 @item -msdata=data
25001 @opindex msdata=data
25002 On System V.4 and embedded PowerPC systems, put small global
25003 data in the @code{.sdata} section.  Put small uninitialized global
25004 data in the @code{.sbss} section.  Do not use register @code{r13}
25005 to address small data however.  This is the default behavior unless
25006 other @option{-msdata} options are used.
25008 @item -msdata=none
25009 @itemx -mno-sdata
25010 @opindex msdata=none
25011 @opindex mno-sdata
25012 On embedded PowerPC systems, put all initialized global and static data
25013 in the @code{.data} section, and all uninitialized data in the
25014 @code{.bss} section.
25016 @item -mreadonly-in-sdata
25017 @opindex mreadonly-in-sdata
25018 @opindex mno-readonly-in-sdata
25019 Put read-only objects in the @code{.sdata} section as well.  This is the
25020 default.
25022 @item -mblock-move-inline-limit=@var{num}
25023 @opindex mblock-move-inline-limit
25024 Inline all block moves (such as calls to @code{memcpy} or structure
25025 copies) less than or equal to @var{num} bytes.  The minimum value for
25026 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
25027 targets.  The default value is target-specific.
25029 @item -mblock-compare-inline-limit=@var{num}
25030 @opindex mblock-compare-inline-limit
25031 Generate non-looping inline code for all block compares (such as calls
25032 to @code{memcmp} or structure compares) less than or equal to @var{num}
25033 bytes. If @var{num} is 0, all inline expansion (non-loop and loop) of
25034 block compare is disabled. The default value is target-specific.
25036 @item -mblock-compare-inline-loop-limit=@var{num}
25037 @opindex mblock-compare-inline-loop-limit
25038 Generate an inline expansion using loop code for all block compares that
25039 are less than or equal to @var{num} bytes, but greater than the limit
25040 for non-loop inline block compare expansion. If the block length is not
25041 constant, at most @var{num} bytes will be compared before @code{memcmp}
25042 is called to compare the remainder of the block. The default value is
25043 target-specific.
25045 @item -mstring-compare-inline-limit=@var{num}
25046 @opindex mstring-compare-inline-limit
25047 Compare at most @var{num} string bytes with inline code.
25048 If the difference or end of string is not found at the
25049 end of the inline compare a call to @code{strcmp} or @code{strncmp} will
25050 take care of the rest of the comparison. The default is 64 bytes.
25052 @item -G @var{num}
25053 @opindex G
25054 @cindex smaller data references (PowerPC)
25055 @cindex .sdata/.sdata2 references (PowerPC)
25056 On embedded PowerPC systems, put global and static items less than or
25057 equal to @var{num} bytes into the small data or BSS sections instead of
25058 the normal data or BSS section.  By default, @var{num} is 8.  The
25059 @option{-G @var{num}} switch is also passed to the linker.
25060 All modules should be compiled with the same @option{-G @var{num}} value.
25062 @item -mregnames
25063 @itemx -mno-regnames
25064 @opindex mregnames
25065 @opindex mno-regnames
25066 On System V.4 and embedded PowerPC systems do (do not) emit register
25067 names in the assembly language output using symbolic forms.
25069 @item -mlongcall
25070 @itemx -mno-longcall
25071 @opindex mlongcall
25072 @opindex mno-longcall
25073 By default assume that all calls are far away so that a longer and more
25074 expensive calling sequence is required.  This is required for calls
25075 farther than 32 megabytes (33,554,432 bytes) from the current location.
25076 A short call is generated if the compiler knows
25077 the call cannot be that far away.  This setting can be overridden by
25078 the @code{shortcall} function attribute, or by @code{#pragma
25079 longcall(0)}.
25081 Some linkers are capable of detecting out-of-range calls and generating
25082 glue code on the fly.  On these systems, long calls are unnecessary and
25083 generate slower code.  As of this writing, the AIX linker can do this,
25084 as can the GNU linker for PowerPC/64.  It is planned to add this feature
25085 to the GNU linker for 32-bit PowerPC systems as well.
25087 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
25088 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
25089 addresses represent the callee and the branch island.  The
25090 Darwin/PPC linker prefers the first address and generates a @code{bl
25091 callee} if the PPC @code{bl} instruction reaches the callee directly;
25092 otherwise, the linker generates @code{bl L42} to call the branch
25093 island.  The branch island is appended to the body of the
25094 calling function; it computes the full 32-bit address of the callee
25095 and jumps to it.
25097 On Mach-O (Darwin) systems, this option directs the compiler emit to
25098 the glue for every direct call, and the Darwin linker decides whether
25099 to use or discard it.
25101 In the future, GCC may ignore all longcall specifications
25102 when the linker is known to generate glue.
25104 @item -mtls-markers
25105 @itemx -mno-tls-markers
25106 @opindex mtls-markers
25107 @opindex mno-tls-markers
25108 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
25109 specifying the function argument.  The relocation allows the linker to
25110 reliably associate function call with argument setup instructions for
25111 TLS optimization, which in turn allows GCC to better schedule the
25112 sequence.
25114 @item -mrecip
25115 @itemx -mno-recip
25116 @opindex mrecip
25117 This option enables use of the reciprocal estimate and
25118 reciprocal square root estimate instructions with additional
25119 Newton-Raphson steps to increase precision instead of doing a divide or
25120 square root and divide for floating-point arguments.  You should use
25121 the @option{-ffast-math} option when using @option{-mrecip} (or at
25122 least @option{-funsafe-math-optimizations},
25123 @option{-ffinite-math-only}, @option{-freciprocal-math} and
25124 @option{-fno-trapping-math}).  Note that while the throughput of the
25125 sequence is generally higher than the throughput of the non-reciprocal
25126 instruction, the precision of the sequence can be decreased by up to 2
25127 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
25128 roots.
25130 @item -mrecip=@var{opt}
25131 @opindex mrecip=opt
25132 This option controls which reciprocal estimate instructions
25133 may be used.  @var{opt} is a comma-separated list of options, which may
25134 be preceded by a @code{!} to invert the option:
25136 @table @samp
25138 @item all
25139 Enable all estimate instructions.
25141 @item default 
25142 Enable the default instructions, equivalent to @option{-mrecip}.
25144 @item none 
25145 Disable all estimate instructions, equivalent to @option{-mno-recip}.
25147 @item div 
25148 Enable the reciprocal approximation instructions for both 
25149 single and double precision.
25151 @item divf 
25152 Enable the single-precision reciprocal approximation instructions.
25154 @item divd 
25155 Enable the double-precision reciprocal approximation instructions.
25157 @item rsqrt 
25158 Enable the reciprocal square root approximation instructions for both
25159 single and double precision.
25161 @item rsqrtf 
25162 Enable the single-precision reciprocal square root approximation instructions.
25164 @item rsqrtd 
25165 Enable the double-precision reciprocal square root approximation instructions.
25167 @end table
25169 So, for example, @option{-mrecip=all,!rsqrtd} enables
25170 all of the reciprocal estimate instructions, except for the
25171 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
25172 which handle the double-precision reciprocal square root calculations.
25174 @item -mrecip-precision
25175 @itemx -mno-recip-precision
25176 @opindex mrecip-precision
25177 Assume (do not assume) that the reciprocal estimate instructions
25178 provide higher-precision estimates than is mandated by the PowerPC
25179 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
25180 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
25181 The double-precision square root estimate instructions are not generated by
25182 default on low-precision machines, since they do not provide an
25183 estimate that converges after three steps.
25185 @item -mveclibabi=@var{type}
25186 @opindex mveclibabi
25187 Specifies the ABI type to use for vectorizing intrinsics using an
25188 external library.  The only type supported at present is @samp{mass},
25189 which specifies to use IBM's Mathematical Acceleration Subsystem
25190 (MASS) libraries for vectorizing intrinsics using external libraries.
25191 GCC currently emits calls to @code{acosd2}, @code{acosf4},
25192 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
25193 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
25194 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
25195 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
25196 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
25197 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
25198 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
25199 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
25200 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
25201 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
25202 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
25203 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
25204 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
25205 for power7.  Both @option{-ftree-vectorize} and
25206 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
25207 libraries must be specified at link time.
25209 @item -mfriz
25210 @itemx -mno-friz
25211 @opindex mfriz
25212 Generate (do not generate) the @code{friz} instruction when the
25213 @option{-funsafe-math-optimizations} option is used to optimize
25214 rounding of floating-point values to 64-bit integer and back to floating
25215 point.  The @code{friz} instruction does not return the same value if
25216 the floating-point number is too large to fit in an integer.
25218 @item -mpointers-to-nested-functions
25219 @itemx -mno-pointers-to-nested-functions
25220 @opindex mpointers-to-nested-functions
25221 Generate (do not generate) code to load up the static chain register
25222 (@code{r11}) when calling through a pointer on AIX and 64-bit Linux
25223 systems where a function pointer points to a 3-word descriptor giving
25224 the function address, TOC value to be loaded in register @code{r2}, and
25225 static chain value to be loaded in register @code{r11}.  The
25226 @option{-mpointers-to-nested-functions} is on by default.  You cannot
25227 call through pointers to nested functions or pointers
25228 to functions compiled in other languages that use the static chain if
25229 you use @option{-mno-pointers-to-nested-functions}.
25231 @item -msave-toc-indirect
25232 @itemx -mno-save-toc-indirect
25233 @opindex msave-toc-indirect
25234 Generate (do not generate) code to save the TOC value in the reserved
25235 stack location in the function prologue if the function calls through
25236 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
25237 saved in the prologue, it is saved just before the call through the
25238 pointer.  The @option{-mno-save-toc-indirect} option is the default.
25240 @item -mcompat-align-parm
25241 @itemx -mno-compat-align-parm
25242 @opindex mcompat-align-parm
25243 Generate (do not generate) code to pass structure parameters with a
25244 maximum alignment of 64 bits, for compatibility with older versions
25245 of GCC.
25247 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
25248 structure parameter on a 128-bit boundary when that structure contained
25249 a member requiring 128-bit alignment.  This is corrected in more
25250 recent versions of GCC.  This option may be used to generate code
25251 that is compatible with functions compiled with older versions of
25252 GCC.
25254 The @option{-mno-compat-align-parm} option is the default.
25256 @item -mstack-protector-guard=@var{guard}
25257 @itemx -mstack-protector-guard-reg=@var{reg}
25258 @itemx -mstack-protector-guard-offset=@var{offset}
25259 @itemx -mstack-protector-guard-symbol=@var{symbol}
25260 @opindex mstack-protector-guard
25261 @opindex mstack-protector-guard-reg
25262 @opindex mstack-protector-guard-offset
25263 @opindex mstack-protector-guard-symbol
25264 Generate stack protection code using canary at @var{guard}.  Supported
25265 locations are @samp{global} for global canary or @samp{tls} for per-thread
25266 canary in the TLS block (the default with GNU libc version 2.4 or later).
25268 With the latter choice the options
25269 @option{-mstack-protector-guard-reg=@var{reg}} and
25270 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
25271 which register to use as base register for reading the canary, and from what
25272 offset from that base register. The default for those is as specified in the
25273 relevant ABI.  @option{-mstack-protector-guard-symbol=@var{symbol}} overrides
25274 the offset with a symbol reference to a canary in the TLS block.
25275 @end table
25277 @node RX Options
25278 @subsection RX Options
25279 @cindex RX Options
25281 These command-line options are defined for RX targets:
25283 @table @gcctabopt
25284 @item -m64bit-doubles
25285 @itemx -m32bit-doubles
25286 @opindex m64bit-doubles
25287 @opindex m32bit-doubles
25288 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
25289 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
25290 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
25291 works on 32-bit values, which is why the default is
25292 @option{-m32bit-doubles}.
25294 @item -fpu
25295 @itemx -nofpu
25296 @opindex fpu
25297 @opindex nofpu
25298 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
25299 floating-point hardware.  The default is enabled for the RX600
25300 series and disabled for the RX200 series.
25302 Floating-point instructions are only generated for 32-bit floating-point 
25303 values, however, so the FPU hardware is not used for doubles if the
25304 @option{-m64bit-doubles} option is used.
25306 @emph{Note} If the @option{-fpu} option is enabled then
25307 @option{-funsafe-math-optimizations} is also enabled automatically.
25308 This is because the RX FPU instructions are themselves unsafe.
25310 @item -mcpu=@var{name}
25311 @opindex mcpu
25312 Selects the type of RX CPU to be targeted.  Currently three types are
25313 supported, the generic @samp{RX600} and @samp{RX200} series hardware and
25314 the specific @samp{RX610} CPU.  The default is @samp{RX600}.
25316 The only difference between @samp{RX600} and @samp{RX610} is that the
25317 @samp{RX610} does not support the @code{MVTIPL} instruction.
25319 The @samp{RX200} series does not have a hardware floating-point unit
25320 and so @option{-nofpu} is enabled by default when this type is
25321 selected.
25323 @item -mbig-endian-data
25324 @itemx -mlittle-endian-data
25325 @opindex mbig-endian-data
25326 @opindex mlittle-endian-data
25327 Store data (but not code) in the big-endian format.  The default is
25328 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
25329 format.
25331 @item -msmall-data-limit=@var{N}
25332 @opindex msmall-data-limit
25333 Specifies the maximum size in bytes of global and static variables
25334 which can be placed into the small data area.  Using the small data
25335 area can lead to smaller and faster code, but the size of area is
25336 limited and it is up to the programmer to ensure that the area does
25337 not overflow.  Also when the small data area is used one of the RX's
25338 registers (usually @code{r13}) is reserved for use pointing to this
25339 area, so it is no longer available for use by the compiler.  This
25340 could result in slower and/or larger code if variables are pushed onto
25341 the stack instead of being held in this register.
25343 Note, common variables (variables that have not been initialized) and
25344 constants are not placed into the small data area as they are assigned
25345 to other sections in the output executable.
25347 The default value is zero, which disables this feature.  Note, this
25348 feature is not enabled by default with higher optimization levels
25349 (@option{-O2} etc) because of the potentially detrimental effects of
25350 reserving a register.  It is up to the programmer to experiment and
25351 discover whether this feature is of benefit to their program.  See the
25352 description of the @option{-mpid} option for a description of how the
25353 actual register to hold the small data area pointer is chosen.
25355 @item -msim
25356 @itemx -mno-sim
25357 @opindex msim
25358 @opindex mno-sim
25359 Use the simulator runtime.  The default is to use the libgloss
25360 board-specific runtime.
25362 @item -mas100-syntax
25363 @itemx -mno-as100-syntax
25364 @opindex mas100-syntax
25365 @opindex mno-as100-syntax
25366 When generating assembler output use a syntax that is compatible with
25367 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
25368 assembler, but it has some restrictions so it is not generated by default.
25370 @item -mmax-constant-size=@var{N}
25371 @opindex mmax-constant-size
25372 Specifies the maximum size, in bytes, of a constant that can be used as
25373 an operand in a RX instruction.  Although the RX instruction set does
25374 allow constants of up to 4 bytes in length to be used in instructions,
25375 a longer value equates to a longer instruction.  Thus in some
25376 circumstances it can be beneficial to restrict the size of constants
25377 that are used in instructions.  Constants that are too big are instead
25378 placed into a constant pool and referenced via register indirection.
25380 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
25381 or 4 means that constants of any size are allowed.
25383 @item -mrelax
25384 @opindex mrelax
25385 Enable linker relaxation.  Linker relaxation is a process whereby the
25386 linker attempts to reduce the size of a program by finding shorter
25387 versions of various instructions.  Disabled by default.
25389 @item -mint-register=@var{N}
25390 @opindex mint-register
25391 Specify the number of registers to reserve for fast interrupt handler
25392 functions.  The value @var{N} can be between 0 and 4.  A value of 1
25393 means that register @code{r13} is reserved for the exclusive use
25394 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
25395 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
25396 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
25397 A value of 0, the default, does not reserve any registers.
25399 @item -msave-acc-in-interrupts
25400 @opindex msave-acc-in-interrupts
25401 Specifies that interrupt handler functions should preserve the
25402 accumulator register.  This is only necessary if normal code might use
25403 the accumulator register, for example because it performs 64-bit
25404 multiplications.  The default is to ignore the accumulator as this
25405 makes the interrupt handlers faster.
25407 @item -mpid
25408 @itemx -mno-pid
25409 @opindex mpid
25410 @opindex mno-pid
25411 Enables the generation of position independent data.  When enabled any
25412 access to constant data is done via an offset from a base address
25413 held in a register.  This allows the location of constant data to be
25414 determined at run time without requiring the executable to be
25415 relocated, which is a benefit to embedded applications with tight
25416 memory constraints.  Data that can be modified is not affected by this
25417 option.
25419 Note, using this feature reserves a register, usually @code{r13}, for
25420 the constant data base address.  This can result in slower and/or
25421 larger code, especially in complicated functions.
25423 The actual register chosen to hold the constant data base address
25424 depends upon whether the @option{-msmall-data-limit} and/or the
25425 @option{-mint-register} command-line options are enabled.  Starting
25426 with register @code{r13} and proceeding downwards, registers are
25427 allocated first to satisfy the requirements of @option{-mint-register},
25428 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
25429 is possible for the small data area register to be @code{r8} if both
25430 @option{-mint-register=4} and @option{-mpid} are specified on the
25431 command line.
25433 By default this feature is not enabled.  The default can be restored
25434 via the @option{-mno-pid} command-line option.
25436 @item -mno-warn-multiple-fast-interrupts
25437 @itemx -mwarn-multiple-fast-interrupts
25438 @opindex mno-warn-multiple-fast-interrupts
25439 @opindex mwarn-multiple-fast-interrupts
25440 Prevents GCC from issuing a warning message if it finds more than one
25441 fast interrupt handler when it is compiling a file.  The default is to
25442 issue a warning for each extra fast interrupt handler found, as the RX
25443 only supports one such interrupt.
25445 @item -mallow-string-insns
25446 @itemx -mno-allow-string-insns
25447 @opindex mallow-string-insns
25448 @opindex mno-allow-string-insns
25449 Enables or disables the use of the string manipulation instructions
25450 @code{SMOVF}, @code{SCMPU}, @code{SMOVB}, @code{SMOVU}, @code{SUNTIL}
25451 @code{SWHILE} and also the @code{RMPA} instruction.  These
25452 instructions may prefetch data, which is not safe to do if accessing
25453 an I/O register.  (See section 12.2.7 of the RX62N Group User's Manual
25454 for more information).
25456 The default is to allow these instructions, but it is not possible for
25457 GCC to reliably detect all circumstances where a string instruction
25458 might be used to access an I/O register, so their use cannot be
25459 disabled automatically.  Instead it is reliant upon the programmer to
25460 use the @option{-mno-allow-string-insns} option if their program
25461 accesses I/O space.
25463 When the instructions are enabled GCC defines the C preprocessor
25464 symbol @code{__RX_ALLOW_STRING_INSNS__}, otherwise it defines the
25465 symbol @code{__RX_DISALLOW_STRING_INSNS__}.
25467 @item -mjsr
25468 @itemx -mno-jsr
25469 @opindex mjsr
25470 @opindex mno-jsr
25471 Use only (or not only) @code{JSR} instructions to access functions.
25472 This option can be used when code size exceeds the range of @code{BSR}
25473 instructions.  Note that @option{-mno-jsr} does not mean to not use
25474 @code{JSR} but instead means that any type of branch may be used.
25475 @end table
25477 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
25478 has special significance to the RX port when used with the
25479 @code{interrupt} function attribute.  This attribute indicates a
25480 function intended to process fast interrupts.  GCC ensures
25481 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
25482 and/or @code{r13} and only provided that the normal use of the
25483 corresponding registers have been restricted via the
25484 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
25485 options.
25487 @node S/390 and zSeries Options
25488 @subsection S/390 and zSeries Options
25489 @cindex S/390 and zSeries Options
25491 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
25493 @table @gcctabopt
25494 @item -mhard-float
25495 @itemx -msoft-float
25496 @opindex mhard-float
25497 @opindex msoft-float
25498 Use (do not use) the hardware floating-point instructions and registers
25499 for floating-point operations.  When @option{-msoft-float} is specified,
25500 functions in @file{libgcc.a} are used to perform floating-point
25501 operations.  When @option{-mhard-float} is specified, the compiler
25502 generates IEEE floating-point instructions.  This is the default.
25504 @item -mhard-dfp
25505 @itemx -mno-hard-dfp
25506 @opindex mhard-dfp
25507 @opindex mno-hard-dfp
25508 Use (do not use) the hardware decimal-floating-point instructions for
25509 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
25510 specified, functions in @file{libgcc.a} are used to perform
25511 decimal-floating-point operations.  When @option{-mhard-dfp} is
25512 specified, the compiler generates decimal-floating-point hardware
25513 instructions.  This is the default for @option{-march=z9-ec} or higher.
25515 @item -mlong-double-64
25516 @itemx -mlong-double-128
25517 @opindex mlong-double-64
25518 @opindex mlong-double-128
25519 These switches control the size of @code{long double} type. A size
25520 of 64 bits makes the @code{long double} type equivalent to the @code{double}
25521 type. This is the default.
25523 @item -mbackchain
25524 @itemx -mno-backchain
25525 @opindex mbackchain
25526 @opindex mno-backchain
25527 Store (do not store) the address of the caller's frame as backchain pointer
25528 into the callee's stack frame.
25529 A backchain may be needed to allow debugging using tools that do not understand
25530 DWARF call frame information.
25531 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
25532 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
25533 the backchain is placed into the topmost word of the 96/160 byte register
25534 save area.
25536 In general, code compiled with @option{-mbackchain} is call-compatible with
25537 code compiled with @option{-mmo-backchain}; however, use of the backchain
25538 for debugging purposes usually requires that the whole binary is built with
25539 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
25540 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
25541 to build a linux kernel use @option{-msoft-float}.
25543 The default is to not maintain the backchain.
25545 @item -mpacked-stack
25546 @itemx -mno-packed-stack
25547 @opindex mpacked-stack
25548 @opindex mno-packed-stack
25549 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
25550 specified, the compiler uses the all fields of the 96/160 byte register save
25551 area only for their default purpose; unused fields still take up stack space.
25552 When @option{-mpacked-stack} is specified, register save slots are densely
25553 packed at the top of the register save area; unused space is reused for other
25554 purposes, allowing for more efficient use of the available stack space.
25555 However, when @option{-mbackchain} is also in effect, the topmost word of
25556 the save area is always used to store the backchain, and the return address
25557 register is always saved two words below the backchain.
25559 As long as the stack frame backchain is not used, code generated with
25560 @option{-mpacked-stack} is call-compatible with code generated with
25561 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
25562 S/390 or zSeries generated code that uses the stack frame backchain at run
25563 time, not just for debugging purposes.  Such code is not call-compatible
25564 with code compiled with @option{-mpacked-stack}.  Also, note that the
25565 combination of @option{-mbackchain},
25566 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
25567 to build a linux kernel use @option{-msoft-float}.
25569 The default is to not use the packed stack layout.
25571 @item -msmall-exec
25572 @itemx -mno-small-exec
25573 @opindex msmall-exec
25574 @opindex mno-small-exec
25575 Generate (or do not generate) code using the @code{bras} instruction
25576 to do subroutine calls.
25577 This only works reliably if the total executable size does not
25578 exceed 64k.  The default is to use the @code{basr} instruction instead,
25579 which does not have this limitation.
25581 @item -m64
25582 @itemx -m31
25583 @opindex m64
25584 @opindex m31
25585 When @option{-m31} is specified, generate code compliant to the
25586 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
25587 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
25588 particular to generate 64-bit instructions.  For the @samp{s390}
25589 targets, the default is @option{-m31}, while the @samp{s390x}
25590 targets default to @option{-m64}.
25592 @item -mzarch
25593 @itemx -mesa
25594 @opindex mzarch
25595 @opindex mesa
25596 When @option{-mzarch} is specified, generate code using the
25597 instructions available on z/Architecture.
25598 When @option{-mesa} is specified, generate code using the
25599 instructions available on ESA/390.  Note that @option{-mesa} is
25600 not possible with @option{-m64}.
25601 When generating code compliant to the GNU/Linux for S/390 ABI,
25602 the default is @option{-mesa}.  When generating code compliant
25603 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
25605 @item -mhtm
25606 @itemx -mno-htm
25607 @opindex mhtm
25608 @opindex mno-htm
25609 The @option{-mhtm} option enables a set of builtins making use of
25610 instructions available with the transactional execution facility
25611 introduced with the IBM zEnterprise EC12 machine generation
25612 @ref{S/390 System z Built-in Functions}.
25613 @option{-mhtm} is enabled by default when using @option{-march=zEC12}.
25615 @item -mvx
25616 @itemx -mno-vx
25617 @opindex mvx
25618 @opindex mno-vx
25619 When @option{-mvx} is specified, generate code using the instructions
25620 available with the vector extension facility introduced with the IBM
25621 z13 machine generation.
25622 This option changes the ABI for some vector type values with regard to
25623 alignment and calling conventions.  In case vector type values are
25624 being used in an ABI-relevant context a GAS @samp{.gnu_attribute}
25625 command will be added to mark the resulting binary with the ABI used.
25626 @option{-mvx} is enabled by default when using @option{-march=z13}.
25628 @item -mzvector
25629 @itemx -mno-zvector
25630 @opindex mzvector
25631 @opindex mno-zvector
25632 The @option{-mzvector} option enables vector language extensions and
25633 builtins using instructions available with the vector extension
25634 facility introduced with the IBM z13 machine generation.
25635 This option adds support for @samp{vector} to be used as a keyword to
25636 define vector type variables and arguments.  @samp{vector} is only
25637 available when GNU extensions are enabled.  It will not be expanded
25638 when requesting strict standard compliance e.g.@: with @option{-std=c99}.
25639 In addition to the GCC low-level builtins @option{-mzvector} enables
25640 a set of builtins added for compatibility with AltiVec-style
25641 implementations like Power and Cell.  In order to make use of these
25642 builtins the header file @file{vecintrin.h} needs to be included.
25643 @option{-mzvector} is disabled by default.
25645 @item -mmvcle
25646 @itemx -mno-mvcle
25647 @opindex mmvcle
25648 @opindex mno-mvcle
25649 Generate (or do not generate) code using the @code{mvcle} instruction
25650 to perform block moves.  When @option{-mno-mvcle} is specified,
25651 use a @code{mvc} loop instead.  This is the default unless optimizing for
25652 size.
25654 @item -mdebug
25655 @itemx -mno-debug
25656 @opindex mdebug
25657 @opindex mno-debug
25658 Print (or do not print) additional debug information when compiling.
25659 The default is to not print debug information.
25661 @item -march=@var{cpu-type}
25662 @opindex march
25663 Generate code that runs on @var{cpu-type}, which is the name of a
25664 system representing a certain processor type.  Possible values for
25665 @var{cpu-type} are @samp{z900}/@samp{arch5}, @samp{z990}/@samp{arch6},
25666 @samp{z9-109}, @samp{z9-ec}/@samp{arch7}, @samp{z10}/@samp{arch8},
25667 @samp{z196}/@samp{arch9}, @samp{zEC12}, @samp{z13}/@samp{arch11}, and
25668 @samp{native}.
25670 The default is @option{-march=z900}.
25672 Specifying @samp{native} as cpu type can be used to select the best
25673 architecture option for the host processor.
25674 @option{-march=native} has no effect if GCC does not recognize the
25675 processor.
25677 @item -mtune=@var{cpu-type}
25678 @opindex mtune
25679 Tune to @var{cpu-type} everything applicable about the generated code,
25680 except for the ABI and the set of available instructions.
25681 The list of @var{cpu-type} values is the same as for @option{-march}.
25682 The default is the value used for @option{-march}.
25684 @item -mtpf-trace
25685 @itemx -mno-tpf-trace
25686 @opindex mtpf-trace
25687 @opindex mno-tpf-trace
25688 Generate code that adds (does not add) in TPF OS specific branches to trace
25689 routines in the operating system.  This option is off by default, even
25690 when compiling for the TPF OS@.
25692 @item -mfused-madd
25693 @itemx -mno-fused-madd
25694 @opindex mfused-madd
25695 @opindex mno-fused-madd
25696 Generate code that uses (does not use) the floating-point multiply and
25697 accumulate instructions.  These instructions are generated by default if
25698 hardware floating point is used.
25700 @item -mwarn-framesize=@var{framesize}
25701 @opindex mwarn-framesize
25702 Emit a warning if the current function exceeds the given frame size.  Because
25703 this is a compile-time check it doesn't need to be a real problem when the program
25704 runs.  It is intended to identify functions that most probably cause
25705 a stack overflow.  It is useful to be used in an environment with limited stack
25706 size e.g.@: the linux kernel.
25708 @item -mwarn-dynamicstack
25709 @opindex mwarn-dynamicstack
25710 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
25711 arrays.  This is generally a bad idea with a limited stack size.
25713 @item -mstack-guard=@var{stack-guard}
25714 @itemx -mstack-size=@var{stack-size}
25715 @opindex mstack-guard
25716 @opindex mstack-size
25717 If these options are provided the S/390 back end emits additional instructions in
25718 the function prologue that trigger a trap if the stack size is @var{stack-guard}
25719 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
25720 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
25721 the frame size of the compiled function is chosen.
25722 These options are intended to be used to help debugging stack overflow problems.
25723 The additionally emitted code causes only little overhead and hence can also be
25724 used in production-like systems without greater performance degradation.  The given
25725 values have to be exact powers of 2 and @var{stack-size} has to be greater than
25726 @var{stack-guard} without exceeding 64k.
25727 In order to be efficient the extra code makes the assumption that the stack starts
25728 at an address aligned to the value given by @var{stack-size}.
25729 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
25731 @item -mhotpatch=@var{pre-halfwords},@var{post-halfwords}
25732 @opindex mhotpatch
25733 If the hotpatch option is enabled, a ``hot-patching'' function
25734 prologue is generated for all functions in the compilation unit.
25735 The funtion label is prepended with the given number of two-byte
25736 NOP instructions (@var{pre-halfwords}, maximum 1000000).  After
25737 the label, 2 * @var{post-halfwords} bytes are appended, using the
25738 largest NOP like instructions the architecture allows (maximum
25739 1000000).
25741 If both arguments are zero, hotpatching is disabled.
25743 This option can be overridden for individual functions with the
25744 @code{hotpatch} attribute.
25745 @end table
25747 @node Score Options
25748 @subsection Score Options
25749 @cindex Score Options
25751 These options are defined for Score implementations:
25753 @table @gcctabopt
25754 @item -meb
25755 @opindex meb
25756 Compile code for big-endian mode.  This is the default.
25758 @item -mel
25759 @opindex mel
25760 Compile code for little-endian mode.
25762 @item -mnhwloop
25763 @opindex mnhwloop
25764 Disable generation of @code{bcnz} instructions.
25766 @item -muls
25767 @opindex muls
25768 Enable generation of unaligned load and store instructions.
25770 @item -mmac
25771 @opindex mmac
25772 Enable the use of multiply-accumulate instructions. Disabled by default.
25774 @item -mscore5
25775 @opindex mscore5
25776 Specify the SCORE5 as the target architecture.
25778 @item -mscore5u
25779 @opindex mscore5u
25780 Specify the SCORE5U of the target architecture.
25782 @item -mscore7
25783 @opindex mscore7
25784 Specify the SCORE7 as the target architecture. This is the default.
25786 @item -mscore7d
25787 @opindex mscore7d
25788 Specify the SCORE7D as the target architecture.
25789 @end table
25791 @node SH Options
25792 @subsection SH Options
25794 These @samp{-m} options are defined for the SH implementations:
25796 @table @gcctabopt
25797 @item -m1
25798 @opindex m1
25799 Generate code for the SH1.
25801 @item -m2
25802 @opindex m2
25803 Generate code for the SH2.
25805 @item -m2e
25806 Generate code for the SH2e.
25808 @item -m2a-nofpu
25809 @opindex m2a-nofpu
25810 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
25811 that the floating-point unit is not used.
25813 @item -m2a-single-only
25814 @opindex m2a-single-only
25815 Generate code for the SH2a-FPU, in such a way that no double-precision
25816 floating-point operations are used.
25818 @item -m2a-single
25819 @opindex m2a-single
25820 Generate code for the SH2a-FPU assuming the floating-point unit is in
25821 single-precision mode by default.
25823 @item -m2a
25824 @opindex m2a
25825 Generate code for the SH2a-FPU assuming the floating-point unit is in
25826 double-precision mode by default.
25828 @item -m3
25829 @opindex m3
25830 Generate code for the SH3.
25832 @item -m3e
25833 @opindex m3e
25834 Generate code for the SH3e.
25836 @item -m4-nofpu
25837 @opindex m4-nofpu
25838 Generate code for the SH4 without a floating-point unit.
25840 @item -m4-single-only
25841 @opindex m4-single-only
25842 Generate code for the SH4 with a floating-point unit that only
25843 supports single-precision arithmetic.
25845 @item -m4-single
25846 @opindex m4-single
25847 Generate code for the SH4 assuming the floating-point unit is in
25848 single-precision mode by default.
25850 @item -m4
25851 @opindex m4
25852 Generate code for the SH4.
25854 @item -m4-100
25855 @opindex m4-100
25856 Generate code for SH4-100.
25858 @item -m4-100-nofpu
25859 @opindex m4-100-nofpu
25860 Generate code for SH4-100 in such a way that the
25861 floating-point unit is not used.
25863 @item -m4-100-single
25864 @opindex m4-100-single
25865 Generate code for SH4-100 assuming the floating-point unit is in
25866 single-precision mode by default.
25868 @item -m4-100-single-only
25869 @opindex m4-100-single-only
25870 Generate code for SH4-100 in such a way that no double-precision
25871 floating-point operations are used.
25873 @item -m4-200
25874 @opindex m4-200
25875 Generate code for SH4-200.
25877 @item -m4-200-nofpu
25878 @opindex m4-200-nofpu
25879 Generate code for SH4-200 without in such a way that the
25880 floating-point unit is not used.
25882 @item -m4-200-single
25883 @opindex m4-200-single
25884 Generate code for SH4-200 assuming the floating-point unit is in
25885 single-precision mode by default.
25887 @item -m4-200-single-only
25888 @opindex m4-200-single-only
25889 Generate code for SH4-200 in such a way that no double-precision
25890 floating-point operations are used.
25892 @item -m4-300
25893 @opindex m4-300
25894 Generate code for SH4-300.
25896 @item -m4-300-nofpu
25897 @opindex m4-300-nofpu
25898 Generate code for SH4-300 without in such a way that the
25899 floating-point unit is not used.
25901 @item -m4-300-single
25902 @opindex m4-300-single
25903 Generate code for SH4-300 in such a way that no double-precision
25904 floating-point operations are used.
25906 @item -m4-300-single-only
25907 @opindex m4-300-single-only
25908 Generate code for SH4-300 in such a way that no double-precision
25909 floating-point operations are used.
25911 @item -m4-340
25912 @opindex m4-340
25913 Generate code for SH4-340 (no MMU, no FPU).
25915 @item -m4-500
25916 @opindex m4-500
25917 Generate code for SH4-500 (no FPU).  Passes @option{-isa=sh4-nofpu} to the
25918 assembler.
25920 @item -m4a-nofpu
25921 @opindex m4a-nofpu
25922 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
25923 floating-point unit is not used.
25925 @item -m4a-single-only
25926 @opindex m4a-single-only
25927 Generate code for the SH4a, in such a way that no double-precision
25928 floating-point operations are used.
25930 @item -m4a-single
25931 @opindex m4a-single
25932 Generate code for the SH4a assuming the floating-point unit is in
25933 single-precision mode by default.
25935 @item -m4a
25936 @opindex m4a
25937 Generate code for the SH4a.
25939 @item -m4al
25940 @opindex m4al
25941 Same as @option{-m4a-nofpu}, except that it implicitly passes
25942 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
25943 instructions at the moment.
25945 @item -mb
25946 @opindex mb
25947 Compile code for the processor in big-endian mode.
25949 @item -ml
25950 @opindex ml
25951 Compile code for the processor in little-endian mode.
25953 @item -mdalign
25954 @opindex mdalign
25955 Align doubles at 64-bit boundaries.  Note that this changes the calling
25956 conventions, and thus some functions from the standard C library do
25957 not work unless you recompile it first with @option{-mdalign}.
25959 @item -mrelax
25960 @opindex mrelax
25961 Shorten some address references at link time, when possible; uses the
25962 linker option @option{-relax}.
25964 @item -mbigtable
25965 @opindex mbigtable
25966 Use 32-bit offsets in @code{switch} tables.  The default is to use
25967 16-bit offsets.
25969 @item -mbitops
25970 @opindex mbitops
25971 Enable the use of bit manipulation instructions on SH2A.
25973 @item -mfmovd
25974 @opindex mfmovd
25975 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
25976 alignment constraints.
25978 @item -mrenesas
25979 @opindex mrenesas
25980 Comply with the calling conventions defined by Renesas.
25982 @item -mno-renesas
25983 @opindex mno-renesas
25984 Comply with the calling conventions defined for GCC before the Renesas
25985 conventions were available.  This option is the default for all
25986 targets of the SH toolchain.
25988 @item -mnomacsave
25989 @opindex mnomacsave
25990 Mark the @code{MAC} register as call-clobbered, even if
25991 @option{-mrenesas} is given.
25993 @item -mieee
25994 @itemx -mno-ieee
25995 @opindex mieee
25996 @opindex mno-ieee
25997 Control the IEEE compliance of floating-point comparisons, which affects the
25998 handling of cases where the result of a comparison is unordered.  By default
25999 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
26000 enabled @option{-mno-ieee} is implicitly set, which results in faster
26001 floating-point greater-equal and less-equal comparisons.  The implicit settings
26002 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
26004 @item -minline-ic_invalidate
26005 @opindex minline-ic_invalidate
26006 Inline code to invalidate instruction cache entries after setting up
26007 nested function trampolines.
26008 This option has no effect if @option{-musermode} is in effect and the selected
26009 code generation option (e.g.@: @option{-m4}) does not allow the use of the @code{icbi}
26010 instruction.
26011 If the selected code generation option does not allow the use of the @code{icbi}
26012 instruction, and @option{-musermode} is not in effect, the inlined code
26013 manipulates the instruction cache address array directly with an associative
26014 write.  This not only requires privileged mode at run time, but it also
26015 fails if the cache line had been mapped via the TLB and has become unmapped.
26017 @item -misize
26018 @opindex misize
26019 Dump instruction size and location in the assembly code.
26021 @item -mpadstruct
26022 @opindex mpadstruct
26023 This option is deprecated.  It pads structures to multiple of 4 bytes,
26024 which is incompatible with the SH ABI@.
26026 @item -matomic-model=@var{model}
26027 @opindex matomic-model=@var{model}
26028 Sets the model of atomic operations and additional parameters as a comma
26029 separated list.  For details on the atomic built-in functions see
26030 @ref{__atomic Builtins}.  The following models and parameters are supported:
26032 @table @samp
26034 @item none
26035 Disable compiler generated atomic sequences and emit library calls for atomic
26036 operations.  This is the default if the target is not @code{sh*-*-linux*}.
26038 @item soft-gusa
26039 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
26040 built-in functions.  The generated atomic sequences require additional support
26041 from the interrupt/exception handling code of the system and are only suitable
26042 for SH3* and SH4* single-core systems.  This option is enabled by default when
26043 the target is @code{sh*-*-linux*} and SH3* or SH4*.  When the target is SH4A,
26044 this option also partially utilizes the hardware atomic instructions
26045 @code{movli.l} and @code{movco.l} to create more efficient code, unless
26046 @samp{strict} is specified.  
26048 @item soft-tcb
26049 Generate software atomic sequences that use a variable in the thread control
26050 block.  This is a variation of the gUSA sequences which can also be used on
26051 SH1* and SH2* targets.  The generated atomic sequences require additional
26052 support from the interrupt/exception handling code of the system and are only
26053 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
26054 parameter has to be specified as well.
26056 @item soft-imask
26057 Generate software atomic sequences that temporarily disable interrupts by
26058 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
26059 in privileged mode and is only suitable for single-core systems.  Additional
26060 support from the interrupt/exception handling code of the system is not
26061 required.  This model is enabled by default when the target is
26062 @code{sh*-*-linux*} and SH1* or SH2*.
26064 @item hard-llcs
26065 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
26066 instructions only.  This is only available on SH4A and is suitable for
26067 multi-core systems.  Since the hardware instructions support only 32 bit atomic
26068 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
26069 Code compiled with this option is also compatible with other software
26070 atomic model interrupt/exception handling systems if executed on an SH4A
26071 system.  Additional support from the interrupt/exception handling code of the
26072 system is not required for this model.
26074 @item gbr-offset=
26075 This parameter specifies the offset in bytes of the variable in the thread
26076 control block structure that should be used by the generated atomic sequences
26077 when the @samp{soft-tcb} model has been selected.  For other models this
26078 parameter is ignored.  The specified value must be an integer multiple of four
26079 and in the range 0-1020.
26081 @item strict
26082 This parameter prevents mixed usage of multiple atomic models, even if they
26083 are compatible, and makes the compiler generate atomic sequences of the
26084 specified model only.
26086 @end table
26088 @item -mtas
26089 @opindex mtas
26090 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
26091 Notice that depending on the particular hardware and software configuration
26092 this can degrade overall performance due to the operand cache line flushes
26093 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
26094 processors the @code{tas.b} instruction must be used with caution since it
26095 can result in data corruption for certain cache configurations.
26097 @item -mprefergot
26098 @opindex mprefergot
26099 When generating position-independent code, emit function calls using
26100 the Global Offset Table instead of the Procedure Linkage Table.
26102 @item -musermode
26103 @itemx -mno-usermode
26104 @opindex musermode
26105 @opindex mno-usermode
26106 Don't allow (allow) the compiler generating privileged mode code.  Specifying
26107 @option{-musermode} also implies @option{-mno-inline-ic_invalidate} if the
26108 inlined code would not work in user mode.  @option{-musermode} is the default
26109 when the target is @code{sh*-*-linux*}.  If the target is SH1* or SH2*
26110 @option{-musermode} has no effect, since there is no user mode.
26112 @item -multcost=@var{number}
26113 @opindex multcost=@var{number}
26114 Set the cost to assume for a multiply insn.
26116 @item -mdiv=@var{strategy}
26117 @opindex mdiv=@var{strategy}
26118 Set the division strategy to be used for integer division operations.
26119 @var{strategy} can be one of: 
26121 @table @samp
26123 @item call-div1
26124 Calls a library function that uses the single-step division instruction
26125 @code{div1} to perform the operation.  Division by zero calculates an
26126 unspecified result and does not trap.  This is the default except for SH4,
26127 SH2A and SHcompact.
26129 @item call-fp
26130 Calls a library function that performs the operation in double precision
26131 floating point.  Division by zero causes a floating-point exception.  This is
26132 the default for SHcompact with FPU.  Specifying this for targets that do not
26133 have a double precision FPU defaults to @code{call-div1}.
26135 @item call-table
26136 Calls a library function that uses a lookup table for small divisors and
26137 the @code{div1} instruction with case distinction for larger divisors.  Division
26138 by zero calculates an unspecified result and does not trap.  This is the default
26139 for SH4.  Specifying this for targets that do not have dynamic shift
26140 instructions defaults to @code{call-div1}.
26142 @end table
26144 When a division strategy has not been specified the default strategy is
26145 selected based on the current target.  For SH2A the default strategy is to
26146 use the @code{divs} and @code{divu} instructions instead of library function
26147 calls.
26149 @item -maccumulate-outgoing-args
26150 @opindex maccumulate-outgoing-args
26151 Reserve space once for outgoing arguments in the function prologue rather
26152 than around each call.  Generally beneficial for performance and size.  Also
26153 needed for unwinding to avoid changing the stack frame around conditional code.
26155 @item -mdivsi3_libfunc=@var{name}
26156 @opindex mdivsi3_libfunc=@var{name}
26157 Set the name of the library function used for 32-bit signed division to
26158 @var{name}.
26159 This only affects the name used in the @samp{call} division strategies, and
26160 the compiler still expects the same sets of input/output/clobbered registers as
26161 if this option were not present.
26163 @item -mfixed-range=@var{register-range}
26164 @opindex mfixed-range
26165 Generate code treating the given register range as fixed registers.
26166 A fixed register is one that the register allocator can not use.  This is
26167 useful when compiling kernel code.  A register range is specified as
26168 two registers separated by a dash.  Multiple register ranges can be
26169 specified separated by a comma.
26171 @item -mbranch-cost=@var{num}
26172 @opindex mbranch-cost=@var{num}
26173 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
26174 make the compiler try to generate more branch-free code if possible.  
26175 If not specified the value is selected depending on the processor type that
26176 is being compiled for.
26178 @item -mzdcbranch
26179 @itemx -mno-zdcbranch
26180 @opindex mzdcbranch
26181 @opindex mno-zdcbranch
26182 Assume (do not assume) that zero displacement conditional branch instructions
26183 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
26184 compiler prefers zero displacement branch code sequences.  This is
26185 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
26186 disabled by specifying @option{-mno-zdcbranch}.
26188 @item -mcbranch-force-delay-slot
26189 @opindex mcbranch-force-delay-slot
26190 Force the usage of delay slots for conditional branches, which stuffs the delay
26191 slot with a @code{nop} if a suitable instruction cannot be found.  By default
26192 this option is disabled.  It can be enabled to work around hardware bugs as
26193 found in the original SH7055.
26195 @item -mfused-madd
26196 @itemx -mno-fused-madd
26197 @opindex mfused-madd
26198 @opindex mno-fused-madd
26199 Generate code that uses (does not use) the floating-point multiply and
26200 accumulate instructions.  These instructions are generated by default
26201 if hardware floating point is used.  The machine-dependent
26202 @option{-mfused-madd} option is now mapped to the machine-independent
26203 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
26204 mapped to @option{-ffp-contract=off}.
26206 @item -mfsca
26207 @itemx -mno-fsca
26208 @opindex mfsca
26209 @opindex mno-fsca
26210 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
26211 and cosine approximations.  The option @option{-mfsca} must be used in
26212 combination with @option{-funsafe-math-optimizations}.  It is enabled by default
26213 when generating code for SH4A.  Using @option{-mno-fsca} disables sine and cosine
26214 approximations even if @option{-funsafe-math-optimizations} is in effect.
26216 @item -mfsrra
26217 @itemx -mno-fsrra
26218 @opindex mfsrra
26219 @opindex mno-fsrra
26220 Allow or disallow the compiler to emit the @code{fsrra} instruction for
26221 reciprocal square root approximations.  The option @option{-mfsrra} must be used
26222 in combination with @option{-funsafe-math-optimizations} and
26223 @option{-ffinite-math-only}.  It is enabled by default when generating code for
26224 SH4A.  Using @option{-mno-fsrra} disables reciprocal square root approximations
26225 even if @option{-funsafe-math-optimizations} and @option{-ffinite-math-only} are
26226 in effect.
26228 @item -mpretend-cmove
26229 @opindex mpretend-cmove
26230 Prefer zero-displacement conditional branches for conditional move instruction
26231 patterns.  This can result in faster code on the SH4 processor.
26233 @item -mfdpic
26234 @opindex fdpic
26235 Generate code using the FDPIC ABI.
26237 @end table
26239 @node Solaris 2 Options
26240 @subsection Solaris 2 Options
26241 @cindex Solaris 2 options
26243 These @samp{-m} options are supported on Solaris 2:
26245 @table @gcctabopt
26246 @item -mclear-hwcap
26247 @opindex mclear-hwcap
26248 @option{-mclear-hwcap} tells the compiler to remove the hardware
26249 capabilities generated by the Solaris assembler.  This is only necessary
26250 when object files use ISA extensions not supported by the current
26251 machine, but check at runtime whether or not to use them.
26253 @item -mimpure-text
26254 @opindex mimpure-text
26255 @option{-mimpure-text}, used in addition to @option{-shared}, tells
26256 the compiler to not pass @option{-z text} to the linker when linking a
26257 shared object.  Using this option, you can link position-dependent
26258 code into a shared object.
26260 @option{-mimpure-text} suppresses the ``relocations remain against
26261 allocatable but non-writable sections'' linker error message.
26262 However, the necessary relocations trigger copy-on-write, and the
26263 shared object is not actually shared across processes.  Instead of
26264 using @option{-mimpure-text}, you should compile all source code with
26265 @option{-fpic} or @option{-fPIC}.
26267 @end table
26269 These switches are supported in addition to the above on Solaris 2:
26271 @table @gcctabopt
26272 @item -pthreads
26273 @opindex pthreads
26274 This is a synonym for @option{-pthread}.
26275 @end table
26277 @node SPARC Options
26278 @subsection SPARC Options
26279 @cindex SPARC options
26281 These @samp{-m} options are supported on the SPARC:
26283 @table @gcctabopt
26284 @item -mno-app-regs
26285 @itemx -mapp-regs
26286 @opindex mno-app-regs
26287 @opindex mapp-regs
26288 Specify @option{-mapp-regs} to generate output using the global registers
26289 2 through 4, which the SPARC SVR4 ABI reserves for applications.  Like the
26290 global register 1, each global register 2 through 4 is then treated as an
26291 allocable register that is clobbered by function calls.  This is the default.
26293 To be fully SVR4 ABI-compliant at the cost of some performance loss,
26294 specify @option{-mno-app-regs}.  You should compile libraries and system
26295 software with this option.
26297 @item -mflat
26298 @itemx -mno-flat
26299 @opindex mflat
26300 @opindex mno-flat
26301 With @option{-mflat}, the compiler does not generate save/restore instructions
26302 and uses a ``flat'' or single register window model.  This model is compatible
26303 with the regular register window model.  The local registers and the input
26304 registers (0--5) are still treated as ``call-saved'' registers and are
26305 saved on the stack as needed.
26307 With @option{-mno-flat} (the default), the compiler generates save/restore
26308 instructions (except for leaf functions).  This is the normal operating mode.
26310 @item -mfpu
26311 @itemx -mhard-float
26312 @opindex mfpu
26313 @opindex mhard-float
26314 Generate output containing floating-point instructions.  This is the
26315 default.
26317 @item -mno-fpu
26318 @itemx -msoft-float
26319 @opindex mno-fpu
26320 @opindex msoft-float
26321 Generate output containing library calls for floating point.
26322 @strong{Warning:} the requisite libraries are not available for all SPARC
26323 targets.  Normally the facilities of the machine's usual C compiler are
26324 used, but this cannot be done directly in cross-compilation.  You must make
26325 your own arrangements to provide suitable library functions for
26326 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
26327 @samp{sparclite-*-*} do provide software floating-point support.
26329 @option{-msoft-float} changes the calling convention in the output file;
26330 therefore, it is only useful if you compile @emph{all} of a program with
26331 this option.  In particular, you need to compile @file{libgcc.a}, the
26332 library that comes with GCC, with @option{-msoft-float} in order for
26333 this to work.
26335 @item -mhard-quad-float
26336 @opindex mhard-quad-float
26337 Generate output containing quad-word (long double) floating-point
26338 instructions.
26340 @item -msoft-quad-float
26341 @opindex msoft-quad-float
26342 Generate output containing library calls for quad-word (long double)
26343 floating-point instructions.  The functions called are those specified
26344 in the SPARC ABI@.  This is the default.
26346 As of this writing, there are no SPARC implementations that have hardware
26347 support for the quad-word floating-point instructions.  They all invoke
26348 a trap handler for one of these instructions, and then the trap handler
26349 emulates the effect of the instruction.  Because of the trap handler overhead,
26350 this is much slower than calling the ABI library routines.  Thus the
26351 @option{-msoft-quad-float} option is the default.
26353 @item -mno-unaligned-doubles
26354 @itemx -munaligned-doubles
26355 @opindex mno-unaligned-doubles
26356 @opindex munaligned-doubles
26357 Assume that doubles have 8-byte alignment.  This is the default.
26359 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
26360 alignment only if they are contained in another type, or if they have an
26361 absolute address.  Otherwise, it assumes they have 4-byte alignment.
26362 Specifying this option avoids some rare compatibility problems with code
26363 generated by other compilers.  It is not the default because it results
26364 in a performance loss, especially for floating-point code.
26366 @item -muser-mode
26367 @itemx -mno-user-mode
26368 @opindex muser-mode
26369 @opindex mno-user-mode
26370 Do not generate code that can only run in supervisor mode.  This is relevant
26371 only for the @code{casa} instruction emitted for the LEON3 processor.  This
26372 is the default.
26374 @item -mfaster-structs
26375 @itemx -mno-faster-structs
26376 @opindex mfaster-structs
26377 @opindex mno-faster-structs
26378 With @option{-mfaster-structs}, the compiler assumes that structures
26379 should have 8-byte alignment.  This enables the use of pairs of
26380 @code{ldd} and @code{std} instructions for copies in structure
26381 assignment, in place of twice as many @code{ld} and @code{st} pairs.
26382 However, the use of this changed alignment directly violates the SPARC
26383 ABI@.  Thus, it's intended only for use on targets where the developer
26384 acknowledges that their resulting code is not directly in line with
26385 the rules of the ABI@.
26387 @item -mstd-struct-return
26388 @itemx -mno-std-struct-return
26389 @opindex mstd-struct-return
26390 @opindex mno-std-struct-return
26391 With @option{-mstd-struct-return}, the compiler generates checking code
26392 in functions returning structures or unions to detect size mismatches
26393 between the two sides of function calls, as per the 32-bit ABI@.
26395 The default is @option{-mno-std-struct-return}.  This option has no effect
26396 in 64-bit mode.
26398 @item -mlra
26399 @itemx -mno-lra
26400 @opindex mlra
26401 @opindex mno-lra
26402 Enable Local Register Allocation.  This is the default for SPARC since GCC 7
26403 so @option{-mno-lra} needs to be passed to get old Reload.
26405 @item -mcpu=@var{cpu_type}
26406 @opindex mcpu
26407 Set the instruction set, register set, and instruction scheduling parameters
26408 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
26409 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
26410 @samp{leon}, @samp{leon3}, @samp{leon3v7}, @samp{sparclite}, @samp{f930},
26411 @samp{f934}, @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
26412 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
26413 @samp{niagara3}, @samp{niagara4}, @samp{niagara7} and @samp{m8}.
26415 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
26416 which selects the best architecture option for the host processor.
26417 @option{-mcpu=native} has no effect if GCC does not recognize
26418 the processor.
26420 Default instruction scheduling parameters are used for values that select
26421 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
26422 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
26424 Here is a list of each supported architecture and their supported
26425 implementations.
26427 @table @asis
26428 @item v7
26429 cypress, leon3v7
26431 @item v8
26432 supersparc, hypersparc, leon, leon3
26434 @item sparclite
26435 f930, f934, sparclite86x
26437 @item sparclet
26438 tsc701
26440 @item v9
26441 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4,
26442 niagara7, m8
26443 @end table
26445 By default (unless configured otherwise), GCC generates code for the V7
26446 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
26447 additionally optimizes it for the Cypress CY7C602 chip, as used in the
26448 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
26449 SPARCStation 1, 2, IPX etc.
26451 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
26452 architecture.  The only difference from V7 code is that the compiler emits
26453 the integer multiply and integer divide instructions which exist in SPARC-V8
26454 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
26455 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
26456 2000 series.
26458 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
26459 the SPARC architecture.  This adds the integer multiply, integer divide step
26460 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
26461 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
26462 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
26463 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
26464 MB86934 chip, which is the more recent SPARClite with FPU@.
26466 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
26467 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
26468 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
26469 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
26470 optimizes it for the TEMIC SPARClet chip.
26472 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
26473 architecture.  This adds 64-bit integer and floating-point move instructions,
26474 3 additional floating-point condition code registers and conditional move
26475 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
26476 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
26477 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
26478 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
26479 @option{-mcpu=niagara}, the compiler additionally optimizes it for
26480 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
26481 additionally optimizes it for Sun UltraSPARC T2 chips. With
26482 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
26483 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
26484 additionally optimizes it for Sun UltraSPARC T4 chips.  With
26485 @option{-mcpu=niagara7}, the compiler additionally optimizes it for
26486 Oracle SPARC M7 chips.  With @option{-mcpu=m8}, the compiler
26487 additionally optimizes it for Oracle M8 chips.
26489 @item -mtune=@var{cpu_type}
26490 @opindex mtune
26491 Set the instruction scheduling parameters for machine type
26492 @var{cpu_type}, but do not set the instruction set or register set that the
26493 option @option{-mcpu=@var{cpu_type}} does.
26495 The same values for @option{-mcpu=@var{cpu_type}} can be used for
26496 @option{-mtune=@var{cpu_type}}, but the only useful values are those
26497 that select a particular CPU implementation.  Those are
26498 @samp{cypress}, @samp{supersparc}, @samp{hypersparc}, @samp{leon},
26499 @samp{leon3}, @samp{leon3v7}, @samp{f930}, @samp{f934},
26500 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
26501 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3},
26502 @samp{niagara4}, @samp{niagara7} and @samp{m8}.  With native Solaris
26503 and GNU/Linux toolchains, @samp{native} can also be used.
26505 @item -mv8plus
26506 @itemx -mno-v8plus
26507 @opindex mv8plus
26508 @opindex mno-v8plus
26509 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
26510 difference from the V8 ABI is that the global and out registers are
26511 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
26512 mode for all SPARC-V9 processors.
26514 @item -mvis
26515 @itemx -mno-vis
26516 @opindex mvis
26517 @opindex mno-vis
26518 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
26519 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
26521 @item -mvis2
26522 @itemx -mno-vis2
26523 @opindex mvis2
26524 @opindex mno-vis2
26525 With @option{-mvis2}, GCC generates code that takes advantage of
26526 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
26527 default is @option{-mvis2} when targeting a cpu that supports such
26528 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
26529 also sets @option{-mvis}.
26531 @item -mvis3
26532 @itemx -mno-vis3
26533 @opindex mvis3
26534 @opindex mno-vis3
26535 With @option{-mvis3}, GCC generates code that takes advantage of
26536 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
26537 default is @option{-mvis3} when targeting a cpu that supports such
26538 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
26539 also sets @option{-mvis2} and @option{-mvis}.
26541 @item -mvis4
26542 @itemx -mno-vis4
26543 @opindex mvis4
26544 @opindex mno-vis4
26545 With @option{-mvis4}, GCC generates code that takes advantage of
26546 version 4.0 of the UltraSPARC Visual Instruction Set extensions.  The
26547 default is @option{-mvis4} when targeting a cpu that supports such
26548 instructions, such as niagara-7 and later.  Setting @option{-mvis4}
26549 also sets @option{-mvis3}, @option{-mvis2} and @option{-mvis}.
26551 @item -mvis4b
26552 @itemx -mno-vis4b
26553 @opindex mvis4b
26554 @opindex mno-vis4b
26555 With @option{-mvis4b}, GCC generates code that takes advantage of
26556 version 4.0 of the UltraSPARC Visual Instruction Set extensions, plus
26557 the additional VIS instructions introduced in the Oracle SPARC
26558 Architecture 2017.  The default is @option{-mvis4b} when targeting a
26559 cpu that supports such instructions, such as m8 and later.  Setting
26560 @option{-mvis4b} also sets @option{-mvis4}, @option{-mvis3},
26561 @option{-mvis2} and @option{-mvis}.
26563 @item -mcbcond
26564 @itemx -mno-cbcond
26565 @opindex mcbcond
26566 @opindex mno-cbcond
26567 With @option{-mcbcond}, GCC generates code that takes advantage of the UltraSPARC
26568 Compare-and-Branch-on-Condition instructions.  The default is @option{-mcbcond}
26569 when targeting a CPU that supports such instructions, such as Niagara-4 and
26570 later.
26572 @item -mfmaf
26573 @itemx -mno-fmaf
26574 @opindex mfmaf
26575 @opindex mno-fmaf
26576 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
26577 Fused Multiply-Add Floating-point instructions.  The default is @option{-mfmaf}
26578 when targeting a CPU that supports such instructions, such as Niagara-3 and
26579 later.
26581 @item -mfsmuld
26582 @itemx -mno-fsmuld
26583 @opindex mfsmuld
26584 @opindex mno-fsmuld
26585 With @option{-mfsmuld}, GCC generates code that takes advantage of the
26586 Floating-point Multiply Single to Double (FsMULd) instruction.  The default is
26587 @option{-mfsmuld} when targeting a CPU supporting the architecture versions V8
26588 or V9 with FPU except @option{-mcpu=leon}.
26590 @item -mpopc
26591 @itemx -mno-popc
26592 @opindex mpopc
26593 @opindex mno-popc
26594 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
26595 Population Count instruction.  The default is @option{-mpopc}
26596 when targeting a CPU that supports such an instruction, such as Niagara-2 and
26597 later.
26599 @item -msubxc
26600 @itemx -mno-subxc
26601 @opindex msubxc
26602 @opindex mno-subxc
26603 With @option{-msubxc}, GCC generates code that takes advantage of the UltraSPARC
26604 Subtract-Extended-with-Carry instruction.  The default is @option{-msubxc}
26605 when targeting a CPU that supports such an instruction, such as Niagara-7 and
26606 later.
26608 @item -mfix-at697f
26609 @opindex mfix-at697f
26610 Enable the documented workaround for the single erratum of the Atmel AT697F
26611 processor (which corresponds to erratum #13 of the AT697E processor).
26613 @item -mfix-ut699
26614 @opindex mfix-ut699
26615 Enable the documented workarounds for the floating-point errata and the data
26616 cache nullify errata of the UT699 processor.
26618 @item -mfix-ut700
26619 @opindex mfix-ut700
26620 Enable the documented workaround for the back-to-back store errata of
26621 the UT699E/UT700 processor.
26623 @item -mfix-gr712rc
26624 @opindex mfix-gr712rc
26625 Enable the documented workaround for the back-to-back store errata of
26626 the GR712RC processor.
26627 @end table
26629 These @samp{-m} options are supported in addition to the above
26630 on SPARC-V9 processors in 64-bit environments:
26632 @table @gcctabopt
26633 @item -m32
26634 @itemx -m64
26635 @opindex m32
26636 @opindex m64
26637 Generate code for a 32-bit or 64-bit environment.
26638 The 32-bit environment sets int, long and pointer to 32 bits.
26639 The 64-bit environment sets int to 32 bits and long and pointer
26640 to 64 bits.
26642 @item -mcmodel=@var{which}
26643 @opindex mcmodel
26644 Set the code model to one of
26646 @table @samp
26647 @item medlow
26648 The Medium/Low code model: 64-bit addresses, programs
26649 must be linked in the low 32 bits of memory.  Programs can be statically
26650 or dynamically linked.
26652 @item medmid
26653 The Medium/Middle code model: 64-bit addresses, programs
26654 must be linked in the low 44 bits of memory, the text and data segments must
26655 be less than 2GB in size and the data segment must be located within 2GB of
26656 the text segment.
26658 @item medany
26659 The Medium/Anywhere code model: 64-bit addresses, programs
26660 may be linked anywhere in memory, the text and data segments must be less
26661 than 2GB in size and the data segment must be located within 2GB of the
26662 text segment.
26664 @item embmedany
26665 The Medium/Anywhere code model for embedded systems:
26666 64-bit addresses, the text and data segments must be less than 2GB in
26667 size, both starting anywhere in memory (determined at link time).  The
26668 global register %g4 points to the base of the data segment.  Programs
26669 are statically linked and PIC is not supported.
26670 @end table
26672 @item -mmemory-model=@var{mem-model}
26673 @opindex mmemory-model
26674 Set the memory model in force on the processor to one of
26676 @table @samp
26677 @item default
26678 The default memory model for the processor and operating system.
26680 @item rmo
26681 Relaxed Memory Order
26683 @item pso
26684 Partial Store Order
26686 @item tso
26687 Total Store Order
26689 @item sc
26690 Sequential Consistency
26691 @end table
26693 These memory models are formally defined in Appendix D of the SPARC-V9
26694 architecture manual, as set in the processor's @code{PSTATE.MM} field.
26696 @item -mstack-bias
26697 @itemx -mno-stack-bias
26698 @opindex mstack-bias
26699 @opindex mno-stack-bias
26700 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
26701 frame pointer if present, are offset by @minus{}2047 which must be added back
26702 when making stack frame references.  This is the default in 64-bit mode.
26703 Otherwise, assume no such offset is present.
26704 @end table
26706 @node SPU Options
26707 @subsection SPU Options
26708 @cindex SPU options
26710 These @samp{-m} options are supported on the SPU:
26712 @table @gcctabopt
26713 @item -mwarn-reloc
26714 @itemx -merror-reloc
26715 @opindex mwarn-reloc
26716 @opindex merror-reloc
26718 The loader for SPU does not handle dynamic relocations.  By default, GCC
26719 gives an error when it generates code that requires a dynamic
26720 relocation.  @option{-mno-error-reloc} disables the error,
26721 @option{-mwarn-reloc} generates a warning instead.
26723 @item -msafe-dma
26724 @itemx -munsafe-dma
26725 @opindex msafe-dma
26726 @opindex munsafe-dma
26728 Instructions that initiate or test completion of DMA must not be
26729 reordered with respect to loads and stores of the memory that is being
26730 accessed.
26731 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
26732 memory accesses, but that can lead to inefficient code in places where the
26733 memory is known to not change.  Rather than mark the memory as volatile,
26734 you can use @option{-msafe-dma} to tell the compiler to treat
26735 the DMA instructions as potentially affecting all memory.  
26737 @item -mbranch-hints
26738 @opindex mbranch-hints
26740 By default, GCC generates a branch hint instruction to avoid
26741 pipeline stalls for always-taken or probably-taken branches.  A hint
26742 is not generated closer than 8 instructions away from its branch.
26743 There is little reason to disable them, except for debugging purposes,
26744 or to make an object a little bit smaller.
26746 @item -msmall-mem
26747 @itemx -mlarge-mem
26748 @opindex msmall-mem
26749 @opindex mlarge-mem
26751 By default, GCC generates code assuming that addresses are never larger
26752 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
26753 a full 32-bit address.
26755 @item -mstdmain
26756 @opindex mstdmain
26758 By default, GCC links against startup code that assumes the SPU-style
26759 main function interface (which has an unconventional parameter list).
26760 With @option{-mstdmain}, GCC links your program against startup
26761 code that assumes a C99-style interface to @code{main}, including a
26762 local copy of @code{argv} strings.
26764 @item -mfixed-range=@var{register-range}
26765 @opindex mfixed-range
26766 Generate code treating the given register range as fixed registers.
26767 A fixed register is one that the register allocator cannot use.  This is
26768 useful when compiling kernel code.  A register range is specified as
26769 two registers separated by a dash.  Multiple register ranges can be
26770 specified separated by a comma.
26772 @item -mea32
26773 @itemx -mea64
26774 @opindex mea32
26775 @opindex mea64
26776 Compile code assuming that pointers to the PPU address space accessed
26777 via the @code{__ea} named address space qualifier are either 32 or 64
26778 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
26779 all object code in an executable must be compiled with the same setting.
26781 @item -maddress-space-conversion
26782 @itemx -mno-address-space-conversion
26783 @opindex maddress-space-conversion
26784 @opindex mno-address-space-conversion
26785 Allow/disallow treating the @code{__ea} address space as superset
26786 of the generic address space.  This enables explicit type casts
26787 between @code{__ea} and generic pointer as well as implicit
26788 conversions of generic pointers to @code{__ea} pointers.  The
26789 default is to allow address space pointer conversions.
26791 @item -mcache-size=@var{cache-size}
26792 @opindex mcache-size
26793 This option controls the version of libgcc that the compiler links to an
26794 executable and selects a software-managed cache for accessing variables
26795 in the @code{__ea} address space with a particular cache size.  Possible
26796 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
26797 and @samp{128}.  The default cache size is 64KB.
26799 @item -matomic-updates
26800 @itemx -mno-atomic-updates
26801 @opindex matomic-updates
26802 @opindex mno-atomic-updates
26803 This option controls the version of libgcc that the compiler links to an
26804 executable and selects whether atomic updates to the software-managed
26805 cache of PPU-side variables are used.  If you use atomic updates, changes
26806 to a PPU variable from SPU code using the @code{__ea} named address space
26807 qualifier do not interfere with changes to other PPU variables residing
26808 in the same cache line from PPU code.  If you do not use atomic updates,
26809 such interference may occur; however, writing back cache lines is
26810 more efficient.  The default behavior is to use atomic updates.
26812 @item -mdual-nops
26813 @itemx -mdual-nops=@var{n}
26814 @opindex mdual-nops
26815 By default, GCC inserts NOPs to increase dual issue when it expects
26816 it to increase performance.  @var{n} can be a value from 0 to 10.  A
26817 smaller @var{n} inserts fewer NOPs.  10 is the default, 0 is the
26818 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
26820 @item -mhint-max-nops=@var{n}
26821 @opindex mhint-max-nops
26822 Maximum number of NOPs to insert for a branch hint.  A branch hint must
26823 be at least 8 instructions away from the branch it is affecting.  GCC
26824 inserts up to @var{n} NOPs to enforce this, otherwise it does not
26825 generate the branch hint.
26827 @item -mhint-max-distance=@var{n}
26828 @opindex mhint-max-distance
26829 The encoding of the branch hint instruction limits the hint to be within
26830 256 instructions of the branch it is affecting.  By default, GCC makes
26831 sure it is within 125.
26833 @item -msafe-hints
26834 @opindex msafe-hints
26835 Work around a hardware bug that causes the SPU to stall indefinitely.
26836 By default, GCC inserts the @code{hbrp} instruction to make sure
26837 this stall won't happen.
26839 @end table
26841 @node System V Options
26842 @subsection Options for System V
26844 These additional options are available on System V Release 4 for
26845 compatibility with other compilers on those systems:
26847 @table @gcctabopt
26848 @item -G
26849 @opindex G
26850 Create a shared object.
26851 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
26853 @item -Qy
26854 @opindex Qy
26855 Identify the versions of each tool used by the compiler, in a
26856 @code{.ident} assembler directive in the output.
26858 @item -Qn
26859 @opindex Qn
26860 Refrain from adding @code{.ident} directives to the output file (this is
26861 the default).
26863 @item -YP,@var{dirs}
26864 @opindex YP
26865 Search the directories @var{dirs}, and no others, for libraries
26866 specified with @option{-l}.
26868 @item -Ym,@var{dir}
26869 @opindex Ym
26870 Look in the directory @var{dir} to find the M4 preprocessor.
26871 The assembler uses this option.
26872 @c This is supposed to go with a -Yd for predefined M4 macro files, but
26873 @c the generic assembler that comes with Solaris takes just -Ym.
26874 @end table
26876 @node TILE-Gx Options
26877 @subsection TILE-Gx Options
26878 @cindex TILE-Gx options
26880 These @samp{-m} options are supported on the TILE-Gx:
26882 @table @gcctabopt
26883 @item -mcmodel=small
26884 @opindex mcmodel=small
26885 Generate code for the small model.  The distance for direct calls is
26886 limited to 500M in either direction.  PC-relative addresses are 32
26887 bits.  Absolute addresses support the full address range.
26889 @item -mcmodel=large
26890 @opindex mcmodel=large
26891 Generate code for the large model.  There is no limitation on call
26892 distance, pc-relative addresses, or absolute addresses.
26894 @item -mcpu=@var{name}
26895 @opindex mcpu
26896 Selects the type of CPU to be targeted.  Currently the only supported
26897 type is @samp{tilegx}.
26899 @item -m32
26900 @itemx -m64
26901 @opindex m32
26902 @opindex m64
26903 Generate code for a 32-bit or 64-bit environment.  The 32-bit
26904 environment sets int, long, and pointer to 32 bits.  The 64-bit
26905 environment sets int to 32 bits and long and pointer to 64 bits.
26907 @item -mbig-endian
26908 @itemx -mlittle-endian
26909 @opindex mbig-endian
26910 @opindex mlittle-endian
26911 Generate code in big/little endian mode, respectively.
26912 @end table
26914 @node TILEPro Options
26915 @subsection TILEPro Options
26916 @cindex TILEPro options
26918 These @samp{-m} options are supported on the TILEPro:
26920 @table @gcctabopt
26921 @item -mcpu=@var{name}
26922 @opindex mcpu
26923 Selects the type of CPU to be targeted.  Currently the only supported
26924 type is @samp{tilepro}.
26926 @item -m32
26927 @opindex m32
26928 Generate code for a 32-bit environment, which sets int, long, and
26929 pointer to 32 bits.  This is the only supported behavior so the flag
26930 is essentially ignored.
26931 @end table
26933 @node V850 Options
26934 @subsection V850 Options
26935 @cindex V850 Options
26937 These @samp{-m} options are defined for V850 implementations:
26939 @table @gcctabopt
26940 @item -mlong-calls
26941 @itemx -mno-long-calls
26942 @opindex mlong-calls
26943 @opindex mno-long-calls
26944 Treat all calls as being far away (near).  If calls are assumed to be
26945 far away, the compiler always loads the function's address into a
26946 register, and calls indirect through the pointer.
26948 @item -mno-ep
26949 @itemx -mep
26950 @opindex mno-ep
26951 @opindex mep
26952 Do not optimize (do optimize) basic blocks that use the same index
26953 pointer 4 or more times to copy pointer into the @code{ep} register, and
26954 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
26955 option is on by default if you optimize.
26957 @item -mno-prolog-function
26958 @itemx -mprolog-function
26959 @opindex mno-prolog-function
26960 @opindex mprolog-function
26961 Do not use (do use) external functions to save and restore registers
26962 at the prologue and epilogue of a function.  The external functions
26963 are slower, but use less code space if more than one function saves
26964 the same number of registers.  The @option{-mprolog-function} option
26965 is on by default if you optimize.
26967 @item -mspace
26968 @opindex mspace
26969 Try to make the code as small as possible.  At present, this just turns
26970 on the @option{-mep} and @option{-mprolog-function} options.
26972 @item -mtda=@var{n}
26973 @opindex mtda
26974 Put static or global variables whose size is @var{n} bytes or less into
26975 the tiny data area that register @code{ep} points to.  The tiny data
26976 area can hold up to 256 bytes in total (128 bytes for byte references).
26978 @item -msda=@var{n}
26979 @opindex msda
26980 Put static or global variables whose size is @var{n} bytes or less into
26981 the small data area that register @code{gp} points to.  The small data
26982 area can hold up to 64 kilobytes.
26984 @item -mzda=@var{n}
26985 @opindex mzda
26986 Put static or global variables whose size is @var{n} bytes or less into
26987 the first 32 kilobytes of memory.
26989 @item -mv850
26990 @opindex mv850
26991 Specify that the target processor is the V850.
26993 @item -mv850e3v5
26994 @opindex mv850e3v5
26995 Specify that the target processor is the V850E3V5.  The preprocessor
26996 constant @code{__v850e3v5__} is defined if this option is used.
26998 @item -mv850e2v4
26999 @opindex mv850e2v4
27000 Specify that the target processor is the V850E3V5.  This is an alias for
27001 the @option{-mv850e3v5} option.
27003 @item -mv850e2v3
27004 @opindex mv850e2v3
27005 Specify that the target processor is the V850E2V3.  The preprocessor
27006 constant @code{__v850e2v3__} is defined if this option is used.
27008 @item -mv850e2
27009 @opindex mv850e2
27010 Specify that the target processor is the V850E2.  The preprocessor
27011 constant @code{__v850e2__} is defined if this option is used.
27013 @item -mv850e1
27014 @opindex mv850e1
27015 Specify that the target processor is the V850E1.  The preprocessor
27016 constants @code{__v850e1__} and @code{__v850e__} are defined if
27017 this option is used.
27019 @item -mv850es
27020 @opindex mv850es
27021 Specify that the target processor is the V850ES.  This is an alias for
27022 the @option{-mv850e1} option.
27024 @item -mv850e
27025 @opindex mv850e
27026 Specify that the target processor is the V850E@.  The preprocessor
27027 constant @code{__v850e__} is defined if this option is used.
27029 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
27030 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
27031 are defined then a default target processor is chosen and the
27032 relevant @samp{__v850*__} preprocessor constant is defined.
27034 The preprocessor constants @code{__v850} and @code{__v851__} are always
27035 defined, regardless of which processor variant is the target.
27037 @item -mdisable-callt
27038 @itemx -mno-disable-callt
27039 @opindex mdisable-callt
27040 @opindex mno-disable-callt
27041 This option suppresses generation of the @code{CALLT} instruction for the
27042 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
27043 architecture.
27045 This option is enabled by default when the RH850 ABI is
27046 in use (see @option{-mrh850-abi}), and disabled by default when the
27047 GCC ABI is in use.  If @code{CALLT} instructions are being generated
27048 then the C preprocessor symbol @code{__V850_CALLT__} is defined.
27050 @item -mrelax
27051 @itemx -mno-relax
27052 @opindex mrelax
27053 @opindex mno-relax
27054 Pass on (or do not pass on) the @option{-mrelax} command-line option
27055 to the assembler.
27057 @item -mlong-jumps
27058 @itemx -mno-long-jumps
27059 @opindex mlong-jumps
27060 @opindex mno-long-jumps
27061 Disable (or re-enable) the generation of PC-relative jump instructions.
27063 @item -msoft-float
27064 @itemx -mhard-float
27065 @opindex msoft-float
27066 @opindex mhard-float
27067 Disable (or re-enable) the generation of hardware floating point
27068 instructions.  This option is only significant when the target
27069 architecture is @samp{V850E2V3} or higher.  If hardware floating point
27070 instructions are being generated then the C preprocessor symbol
27071 @code{__FPU_OK__} is defined, otherwise the symbol
27072 @code{__NO_FPU__} is defined.
27074 @item -mloop
27075 @opindex mloop
27076 Enables the use of the e3v5 LOOP instruction.  The use of this
27077 instruction is not enabled by default when the e3v5 architecture is
27078 selected because its use is still experimental.
27080 @item -mrh850-abi
27081 @itemx -mghs
27082 @opindex mrh850-abi
27083 @opindex mghs
27084 Enables support for the RH850 version of the V850 ABI.  This is the
27085 default.  With this version of the ABI the following rules apply:
27087 @itemize
27088 @item
27089 Integer sized structures and unions are returned via a memory pointer
27090 rather than a register.
27092 @item
27093 Large structures and unions (more than 8 bytes in size) are passed by
27094 value.
27096 @item
27097 Functions are aligned to 16-bit boundaries.
27099 @item
27100 The @option{-m8byte-align} command-line option is supported.
27102 @item
27103 The @option{-mdisable-callt} command-line option is enabled by
27104 default.  The @option{-mno-disable-callt} command-line option is not
27105 supported.
27106 @end itemize
27108 When this version of the ABI is enabled the C preprocessor symbol
27109 @code{__V850_RH850_ABI__} is defined.
27111 @item -mgcc-abi
27112 @opindex mgcc-abi
27113 Enables support for the old GCC version of the V850 ABI.  With this
27114 version of the ABI the following rules apply:
27116 @itemize
27117 @item
27118 Integer sized structures and unions are returned in register @code{r10}.
27120 @item
27121 Large structures and unions (more than 8 bytes in size) are passed by
27122 reference.
27124 @item
27125 Functions are aligned to 32-bit boundaries, unless optimizing for
27126 size.
27128 @item
27129 The @option{-m8byte-align} command-line option is not supported.
27131 @item
27132 The @option{-mdisable-callt} command-line option is supported but not
27133 enabled by default.
27134 @end itemize
27136 When this version of the ABI is enabled the C preprocessor symbol
27137 @code{__V850_GCC_ABI__} is defined.
27139 @item -m8byte-align
27140 @itemx -mno-8byte-align
27141 @opindex m8byte-align
27142 @opindex mno-8byte-align
27143 Enables support for @code{double} and @code{long long} types to be
27144 aligned on 8-byte boundaries.  The default is to restrict the
27145 alignment of all objects to at most 4-bytes.  When
27146 @option{-m8byte-align} is in effect the C preprocessor symbol
27147 @code{__V850_8BYTE_ALIGN__} is defined.
27149 @item -mbig-switch
27150 @opindex mbig-switch
27151 Generate code suitable for big switch tables.  Use this option only if
27152 the assembler/linker complain about out of range branches within a switch
27153 table.
27155 @item -mapp-regs
27156 @opindex mapp-regs
27157 This option causes r2 and r5 to be used in the code generated by
27158 the compiler.  This setting is the default.
27160 @item -mno-app-regs
27161 @opindex mno-app-regs
27162 This option causes r2 and r5 to be treated as fixed registers.
27164 @end table
27166 @node VAX Options
27167 @subsection VAX Options
27168 @cindex VAX options
27170 These @samp{-m} options are defined for the VAX:
27172 @table @gcctabopt
27173 @item -munix
27174 @opindex munix
27175 Do not output certain jump instructions (@code{aobleq} and so on)
27176 that the Unix assembler for the VAX cannot handle across long
27177 ranges.
27179 @item -mgnu
27180 @opindex mgnu
27181 Do output those jump instructions, on the assumption that the
27182 GNU assembler is being used.
27184 @item -mg
27185 @opindex mg
27186 Output code for G-format floating-point numbers instead of D-format.
27187 @end table
27189 @node Visium Options
27190 @subsection Visium Options
27191 @cindex Visium options
27193 @table @gcctabopt
27195 @item -mdebug
27196 @opindex mdebug
27197 A program which performs file I/O and is destined to run on an MCM target
27198 should be linked with this option.  It causes the libraries libc.a and
27199 libdebug.a to be linked.  The program should be run on the target under
27200 the control of the GDB remote debugging stub.
27202 @item -msim
27203 @opindex msim
27204 A program which performs file I/O and is destined to run on the simulator
27205 should be linked with option.  This causes libraries libc.a and libsim.a to
27206 be linked.
27208 @item -mfpu
27209 @itemx -mhard-float
27210 @opindex mfpu
27211 @opindex mhard-float
27212 Generate code containing floating-point instructions.  This is the
27213 default.
27215 @item -mno-fpu
27216 @itemx -msoft-float
27217 @opindex mno-fpu
27218 @opindex msoft-float
27219 Generate code containing library calls for floating-point.
27221 @option{-msoft-float} changes the calling convention in the output file;
27222 therefore, it is only useful if you compile @emph{all} of a program with
27223 this option.  In particular, you need to compile @file{libgcc.a}, the
27224 library that comes with GCC, with @option{-msoft-float} in order for
27225 this to work.
27227 @item -mcpu=@var{cpu_type}
27228 @opindex mcpu
27229 Set the instruction set, register set, and instruction scheduling parameters
27230 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
27231 @samp{mcm}, @samp{gr5} and @samp{gr6}.
27233 @samp{mcm} is a synonym of @samp{gr5} present for backward compatibility.
27235 By default (unless configured otherwise), GCC generates code for the GR5
27236 variant of the Visium architecture.  
27238 With @option{-mcpu=gr6}, GCC generates code for the GR6 variant of the Visium
27239 architecture.  The only difference from GR5 code is that the compiler will
27240 generate block move instructions.
27242 @item -mtune=@var{cpu_type}
27243 @opindex mtune
27244 Set the instruction scheduling parameters for machine type @var{cpu_type},
27245 but do not set the instruction set or register set that the option
27246 @option{-mcpu=@var{cpu_type}} would.
27248 @item -msv-mode
27249 @opindex msv-mode
27250 Generate code for the supervisor mode, where there are no restrictions on
27251 the access to general registers.  This is the default.
27253 @item -muser-mode
27254 @opindex muser-mode
27255 Generate code for the user mode, where the access to some general registers
27256 is forbidden: on the GR5, registers r24 to r31 cannot be accessed in this
27257 mode; on the GR6, only registers r29 to r31 are affected.
27258 @end table
27260 @node VMS Options
27261 @subsection VMS Options
27263 These @samp{-m} options are defined for the VMS implementations:
27265 @table @gcctabopt
27266 @item -mvms-return-codes
27267 @opindex mvms-return-codes
27268 Return VMS condition codes from @code{main}. The default is to return POSIX-style
27269 condition (e.g.@: error) codes.
27271 @item -mdebug-main=@var{prefix}
27272 @opindex mdebug-main=@var{prefix}
27273 Flag the first routine whose name starts with @var{prefix} as the main
27274 routine for the debugger.
27276 @item -mmalloc64
27277 @opindex mmalloc64
27278 Default to 64-bit memory allocation routines.
27280 @item -mpointer-size=@var{size}
27281 @opindex mpointer-size=@var{size}
27282 Set the default size of pointers. Possible options for @var{size} are
27283 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
27284 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
27285 The later option disables @code{pragma pointer_size}.
27286 @end table
27288 @node VxWorks Options
27289 @subsection VxWorks Options
27290 @cindex VxWorks Options
27292 The options in this section are defined for all VxWorks targets.
27293 Options specific to the target hardware are listed with the other
27294 options for that target.
27296 @table @gcctabopt
27297 @item -mrtp
27298 @opindex mrtp
27299 GCC can generate code for both VxWorks kernels and real time processes
27300 (RTPs).  This option switches from the former to the latter.  It also
27301 defines the preprocessor macro @code{__RTP__}.
27303 @item -non-static
27304 @opindex non-static
27305 Link an RTP executable against shared libraries rather than static
27306 libraries.  The options @option{-static} and @option{-shared} can
27307 also be used for RTPs (@pxref{Link Options}); @option{-static}
27308 is the default.
27310 @item -Bstatic
27311 @itemx -Bdynamic
27312 @opindex Bstatic
27313 @opindex Bdynamic
27314 These options are passed down to the linker.  They are defined for
27315 compatibility with Diab.
27317 @item -Xbind-lazy
27318 @opindex Xbind-lazy
27319 Enable lazy binding of function calls.  This option is equivalent to
27320 @option{-Wl,-z,now} and is defined for compatibility with Diab.
27322 @item -Xbind-now
27323 @opindex Xbind-now
27324 Disable lazy binding of function calls.  This option is the default and
27325 is defined for compatibility with Diab.
27326 @end table
27328 @node x86 Options
27329 @subsection x86 Options
27330 @cindex x86 Options
27332 These @samp{-m} options are defined for the x86 family of computers.
27334 @table @gcctabopt
27336 @item -march=@var{cpu-type}
27337 @opindex march
27338 Generate instructions for the machine type @var{cpu-type}.  In contrast to
27339 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
27340 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
27341 to generate code that may not run at all on processors other than the one
27342 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
27343 @option{-mtune=@var{cpu-type}}.
27345 The choices for @var{cpu-type} are:
27347 @table @samp
27348 @item native
27349 This selects the CPU to generate code for at compilation time by determining
27350 the processor type of the compiling machine.  Using @option{-march=native}
27351 enables all instruction subsets supported by the local machine (hence
27352 the result might not run on different machines).  Using @option{-mtune=native}
27353 produces code optimized for the local machine under the constraints
27354 of the selected instruction set.  
27356 @item x86-64
27357 A generic CPU with 64-bit extensions.
27359 @item i386
27360 Original Intel i386 CPU@.
27362 @item i486
27363 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
27365 @item i586
27366 @itemx pentium
27367 Intel Pentium CPU with no MMX support.
27369 @item lakemont
27370 Intel Lakemont MCU, based on Intel Pentium CPU.
27372 @item pentium-mmx
27373 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
27375 @item pentiumpro
27376 Intel Pentium Pro CPU@.
27378 @item i686
27379 When used with @option{-march}, the Pentium Pro
27380 instruction set is used, so the code runs on all i686 family chips.
27381 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
27383 @item pentium2
27384 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
27385 support.
27387 @item pentium3
27388 @itemx pentium3m
27389 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
27390 set support.
27392 @item pentium-m
27393 Intel Pentium M; low-power version of Intel Pentium III CPU
27394 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
27396 @item pentium4
27397 @itemx pentium4m
27398 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
27400 @item prescott
27401 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
27402 set support.
27404 @item nocona
27405 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
27406 SSE2 and SSE3 instruction set support.
27408 @item core2
27409 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
27410 instruction set support.
27412 @item nehalem
27413 Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
27414 SSE4.1, SSE4.2 and POPCNT instruction set support.
27416 @item westmere
27417 Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
27418 SSE4.1, SSE4.2, POPCNT, AES and PCLMUL instruction set support.
27420 @item sandybridge
27421 Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
27422 SSE4.1, SSE4.2, POPCNT, AVX, AES and PCLMUL instruction set support.
27424 @item ivybridge
27425 Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
27426 SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C
27427 instruction set support.
27429 @item haswell
27430 Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
27431 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
27432 BMI, BMI2 and F16C instruction set support.
27434 @item broadwell
27435 Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
27436 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
27437 BMI, BMI2, F16C, RDSEED, ADCX and PREFETCHW instruction set support.
27439 @item skylake
27440 Intel Skylake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
27441 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
27442 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC and
27443 XSAVES instruction set support.
27445 @item bonnell
27446 Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
27447 instruction set support.
27449 @item silvermont
27450 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
27451 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL and RDRND instruction set support.
27453 @item goldmont
27454 Intel Goldmont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
27455 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL, RDRND, XSAVE, XSAVEOPT and FSGSBASE
27456 instruction set support.
27458 @item goldmont-plus
27459 Intel Goldmont Plus CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
27460 SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PCLMUL, RDRND, XSAVE, XSAVEOPT, FSGSBASE,
27461 PTWRITE, RDPID, SGX and UMIP instruction set support.
27463 @item tremont
27464 Intel Tremont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
27465 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL, RDRND, XSAVE, XSAVEOPT, FSGSBASE, PTWRITE,
27466 RDPID, SGX, UMIP, GFNI-SSE, CLWB and ENCLV instruction set support.
27468 @item knl
27469 Intel Knight's Landing CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
27470 SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
27471 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER and
27472 AVX512CD instruction set support.
27474 @item knm
27475 Intel Knights Mill CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
27476 SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
27477 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER, AVX512CD,
27478 AVX5124VNNIW, AVX5124FMAPS and AVX512VPOPCNTDQ instruction set support.
27480 @item skylake-avx512
27481 Intel Skylake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
27482 SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
27483 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F,
27484 CLWB, AVX512VL, AVX512BW, AVX512DQ and AVX512CD instruction set support.
27486 @item cannonlake
27487 Intel Cannonlake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2,
27488 SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE,
27489 RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC,
27490 XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI,
27491 AVX512IFMA, SHA and UMIP instruction set support.
27493 @item icelake-client
27494 Intel Icelake Client CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2,
27495 SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE,
27496 RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC,
27497 XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI,
27498 AVX512IFMA, SHA, CLWB, UMIP, RDPID, GFNI, AVX512VBMI2, AVX512VPOPCNTDQ,
27499 AVX512BITALG, AVX512VNNI, VPCLMULQDQ, VAES instruction set support.
27501 @item icelake-server
27502 Intel Icelake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2,
27503 SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE,
27504 RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC,
27505 XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI,
27506 AVX512IFMA, SHA, CLWB, UMIP, RDPID, GFNI, AVX512VBMI2, AVX512VPOPCNTDQ,
27507 AVX512BITALG, AVX512VNNI, VPCLMULQDQ, VAES, PCONFIG and WBNOINVD instruction
27508 set support.
27510 @item k6
27511 AMD K6 CPU with MMX instruction set support.
27513 @item k6-2
27514 @itemx k6-3
27515 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
27517 @item athlon
27518 @itemx athlon-tbird
27519 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
27520 support.
27522 @item athlon-4
27523 @itemx athlon-xp
27524 @itemx athlon-mp
27525 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
27526 instruction set support.
27528 @item k8
27529 @itemx opteron
27530 @itemx athlon64
27531 @itemx athlon-fx
27532 Processors based on the AMD K8 core with x86-64 instruction set support,
27533 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
27534 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
27535 instruction set extensions.)
27537 @item k8-sse3
27538 @itemx opteron-sse3
27539 @itemx athlon64-sse3
27540 Improved versions of AMD K8 cores with SSE3 instruction set support.
27542 @item amdfam10
27543 @itemx barcelona
27544 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
27545 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
27546 instruction set extensions.)
27548 @item bdver1
27549 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
27550 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
27551 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
27552 @item bdver2
27553 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
27554 supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX,
27555 SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
27556 extensions.)
27557 @item bdver3
27558 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
27559 supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, XOP, LWP, AES, 
27560 PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 
27561 64-bit instruction set extensions.
27562 @item bdver4
27563 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
27564 supersets BMI, BMI2, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, AVX2, XOP, LWP, 
27565 AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, 
27566 SSE4.2, ABM and 64-bit instruction set extensions.
27568 @item znver1
27569 AMD Family 17h core based CPUs with x86-64 instruction set support.  (This
27570 supersets BMI, BMI2, F16C, FMA, FSGSBASE, AVX, AVX2, ADCX, RDSEED, MWAITX,
27571 SHA, CLZERO, AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3,
27572 SSE4.1, SSE4.2, ABM, XSAVEC, XSAVES, CLFLUSHOPT, POPCNT, and 64-bit
27573 instruction set extensions.
27574 @item znver2
27575 AMD Family 17h core based CPUs with x86-64 instruction set support. (This
27576 supersets BMI, BMI2, ,CLWB, F16C, FMA, FSGSBASE, AVX, AVX2, ADCX, RDSEED,
27577 MWAITX, SHA, CLZERO, AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A,
27578 SSSE3, SSE4.1, SSE4.2, ABM, XSAVEC, XSAVES, CLFLUSHOPT, POPCNT, and 64-bit
27579 instruction set extensions.)
27582 @item btver1
27583 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
27584 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
27585 instruction set extensions.)
27587 @item btver2
27588 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
27589 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
27590 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
27592 @item winchip-c6
27593 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
27594 set support.
27596 @item winchip2
27597 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
27598 instruction set support.
27600 @item c3
27601 VIA C3 CPU with MMX and 3DNow!@: instruction set support.
27602 (No scheduling is implemented for this chip.)
27604 @item c3-2
27605 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
27606 (No scheduling is implemented for this chip.)
27608 @item c7
27609 VIA C7 (Esther) CPU with MMX, SSE, SSE2 and SSE3 instruction set support.
27610 (No scheduling is implemented for this chip.)
27612 @item samuel-2
27613 VIA Eden Samuel 2 CPU with MMX and 3DNow!@: instruction set support.
27614 (No scheduling is implemented for this chip.)
27616 @item nehemiah
27617 VIA Eden Nehemiah CPU with MMX and SSE instruction set support.
27618 (No scheduling is implemented for this chip.)
27620 @item esther
27621 VIA Eden Esther CPU with MMX, SSE, SSE2 and SSE3 instruction set support.
27622 (No scheduling is implemented for this chip.)
27624 @item eden-x2
27625 VIA Eden X2 CPU with x86-64, MMX, SSE, SSE2 and SSE3 instruction set support.
27626 (No scheduling is implemented for this chip.)
27628 @item eden-x4
27629 VIA Eden X4 CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2,
27630 AVX and AVX2 instruction set support.
27631 (No scheduling is implemented for this chip.)
27633 @item nano
27634 Generic VIA Nano CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
27635 instruction set support.
27636 (No scheduling is implemented for this chip.)
27638 @item nano-1000
27639 VIA Nano 1xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
27640 instruction set support.
27641 (No scheduling is implemented for this chip.)
27643 @item nano-2000
27644 VIA Nano 2xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
27645 instruction set support.
27646 (No scheduling is implemented for this chip.)
27648 @item nano-3000
27649 VIA Nano 3xxx CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
27650 instruction set support.
27651 (No scheduling is implemented for this chip.)
27653 @item nano-x2
27654 VIA Nano Dual Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
27655 instruction set support.
27656 (No scheduling is implemented for this chip.)
27658 @item nano-x4
27659 VIA Nano Quad Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
27660 instruction set support.
27661 (No scheduling is implemented for this chip.)
27663 @item geode
27664 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
27665 @end table
27667 @item -mtune=@var{cpu-type}
27668 @opindex mtune
27669 Tune to @var{cpu-type} everything applicable about the generated code, except
27670 for the ABI and the set of available instructions.  
27671 While picking a specific @var{cpu-type} schedules things appropriately
27672 for that particular chip, the compiler does not generate any code that
27673 cannot run on the default machine type unless you use a
27674 @option{-march=@var{cpu-type}} option.
27675 For example, if GCC is configured for i686-pc-linux-gnu
27676 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
27677 but still runs on i686 machines.
27679 The choices for @var{cpu-type} are the same as for @option{-march}.
27680 In addition, @option{-mtune} supports 2 extra choices for @var{cpu-type}:
27682 @table @samp
27683 @item generic
27684 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
27685 If you know the CPU on which your code will run, then you should use
27686 the corresponding @option{-mtune} or @option{-march} option instead of
27687 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
27688 of your application will have, then you should use this option.
27690 As new processors are deployed in the marketplace, the behavior of this
27691 option will change.  Therefore, if you upgrade to a newer version of
27692 GCC, code generation controlled by this option will change to reflect
27693 the processors
27694 that are most common at the time that version of GCC is released.
27696 There is no @option{-march=generic} option because @option{-march}
27697 indicates the instruction set the compiler can use, and there is no
27698 generic instruction set applicable to all processors.  In contrast,
27699 @option{-mtune} indicates the processor (or, in this case, collection of
27700 processors) for which the code is optimized.
27702 @item intel
27703 Produce code optimized for the most current Intel processors, which are
27704 Haswell and Silvermont for this version of GCC.  If you know the CPU
27705 on which your code will run, then you should use the corresponding
27706 @option{-mtune} or @option{-march} option instead of @option{-mtune=intel}.
27707 But, if you want your application performs better on both Haswell and
27708 Silvermont, then you should use this option.
27710 As new Intel processors are deployed in the marketplace, the behavior of
27711 this option will change.  Therefore, if you upgrade to a newer version of
27712 GCC, code generation controlled by this option will change to reflect
27713 the most current Intel processors at the time that version of GCC is
27714 released.
27716 There is no @option{-march=intel} option because @option{-march} indicates
27717 the instruction set the compiler can use, and there is no common
27718 instruction set applicable to all processors.  In contrast,
27719 @option{-mtune} indicates the processor (or, in this case, collection of
27720 processors) for which the code is optimized.
27721 @end table
27723 @item -mcpu=@var{cpu-type}
27724 @opindex mcpu
27725 A deprecated synonym for @option{-mtune}.
27727 @item -mfpmath=@var{unit}
27728 @opindex mfpmath
27729 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
27730 for @var{unit} are:
27732 @table @samp
27733 @item 387
27734 Use the standard 387 floating-point coprocessor present on the majority of chips and
27735 emulated otherwise.  Code compiled with this option runs almost everywhere.
27736 The temporary results are computed in 80-bit precision instead of the precision
27737 specified by the type, resulting in slightly different results compared to most
27738 of other chips.  See @option{-ffloat-store} for more detailed description.
27740 This is the default choice for non-Darwin x86-32 targets.
27742 @item sse
27743 Use scalar floating-point instructions present in the SSE instruction set.
27744 This instruction set is supported by Pentium III and newer chips,
27745 and in the AMD line
27746 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
27747 instruction set supports only single-precision arithmetic, thus the double and
27748 extended-precision arithmetic are still done using 387.  A later version, present
27749 only in Pentium 4 and AMD x86-64 chips, supports double-precision
27750 arithmetic too.
27752 For the x86-32 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
27753 or @option{-msse2} switches to enable SSE extensions and make this option
27754 effective.  For the x86-64 compiler, these extensions are enabled by default.
27756 The resulting code should be considerably faster in the majority of cases and avoid
27757 the numerical instability problems of 387 code, but may break some existing
27758 code that expects temporaries to be 80 bits.
27760 This is the default choice for the x86-64 compiler, Darwin x86-32 targets,
27761 and the default choice for x86-32 targets with the SSE2 instruction set
27762 when @option{-ffast-math} is enabled.
27764 @item sse,387
27765 @itemx sse+387
27766 @itemx both
27767 Attempt to utilize both instruction sets at once.  This effectively doubles the
27768 amount of available registers, and on chips with separate execution units for
27769 387 and SSE the execution resources too.  Use this option with care, as it is
27770 still experimental, because the GCC register allocator does not model separate
27771 functional units well, resulting in unstable performance.
27772 @end table
27774 @item -masm=@var{dialect}
27775 @opindex masm=@var{dialect}
27776 Output assembly instructions using selected @var{dialect}.  Also affects
27777 which dialect is used for basic @code{asm} (@pxref{Basic Asm}) and
27778 extended @code{asm} (@pxref{Extended Asm}). Supported choices (in dialect
27779 order) are @samp{att} or @samp{intel}. The default is @samp{att}. Darwin does
27780 not support @samp{intel}.
27782 @item -mieee-fp
27783 @itemx -mno-ieee-fp
27784 @opindex mieee-fp
27785 @opindex mno-ieee-fp
27786 Control whether or not the compiler uses IEEE floating-point
27787 comparisons.  These correctly handle the case where the result of a
27788 comparison is unordered.
27790 @item -m80387
27791 @itemx -mhard-float
27792 @opindex 80387
27793 @opindex mhard-float
27794 Generate output containing 80387 instructions for floating point.
27796 @item -mno-80387
27797 @itemx -msoft-float
27798 @opindex no-80387
27799 @opindex msoft-float
27800 Generate output containing library calls for floating point.
27802 @strong{Warning:} the requisite libraries are not part of GCC@.
27803 Normally the facilities of the machine's usual C compiler are used, but
27804 this cannot be done directly in cross-compilation.  You must make your
27805 own arrangements to provide suitable library functions for
27806 cross-compilation.
27808 On machines where a function returns floating-point results in the 80387
27809 register stack, some floating-point opcodes may be emitted even if
27810 @option{-msoft-float} is used.
27812 @item -mno-fp-ret-in-387
27813 @opindex mno-fp-ret-in-387
27814 @opindex mfp-ret-in-387
27815 Do not use the FPU registers for return values of functions.
27817 The usual calling convention has functions return values of types
27818 @code{float} and @code{double} in an FPU register, even if there
27819 is no FPU@.  The idea is that the operating system should emulate
27820 an FPU@.
27822 The option @option{-mno-fp-ret-in-387} causes such values to be returned
27823 in ordinary CPU registers instead.
27825 @item -mno-fancy-math-387
27826 @opindex mno-fancy-math-387
27827 @opindex mfancy-math-387
27828 Some 387 emulators do not support the @code{sin}, @code{cos} and
27829 @code{sqrt} instructions for the 387.  Specify this option to avoid
27830 generating those instructions.
27831 This option is overridden when @option{-march}
27832 indicates that the target CPU always has an FPU and so the
27833 instruction does not need emulation.  These
27834 instructions are not generated unless you also use the
27835 @option{-funsafe-math-optimizations} switch.
27837 @item -malign-double
27838 @itemx -mno-align-double
27839 @opindex malign-double
27840 @opindex mno-align-double
27841 Control whether GCC aligns @code{double}, @code{long double}, and
27842 @code{long long} variables on a two-word boundary or a one-word
27843 boundary.  Aligning @code{double} variables on a two-word boundary
27844 produces code that runs somewhat faster on a Pentium at the
27845 expense of more memory.
27847 On x86-64, @option{-malign-double} is enabled by default.
27849 @strong{Warning:} if you use the @option{-malign-double} switch,
27850 structures containing the above types are aligned differently than
27851 the published application binary interface specifications for the x86-32
27852 and are not binary compatible with structures in code compiled
27853 without that switch.
27855 @item -m96bit-long-double
27856 @itemx -m128bit-long-double
27857 @opindex m96bit-long-double
27858 @opindex m128bit-long-double
27859 These switches control the size of @code{long double} type.  The x86-32
27860 application binary interface specifies the size to be 96 bits,
27861 so @option{-m96bit-long-double} is the default in 32-bit mode.
27863 Modern architectures (Pentium and newer) prefer @code{long double}
27864 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
27865 conforming to the ABI, this is not possible.  So specifying
27866 @option{-m128bit-long-double} aligns @code{long double}
27867 to a 16-byte boundary by padding the @code{long double} with an additional
27868 32-bit zero.
27870 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
27871 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
27873 Notice that neither of these options enable any extra precision over the x87
27874 standard of 80 bits for a @code{long double}.
27876 @strong{Warning:} if you override the default value for your target ABI, this
27877 changes the size of 
27878 structures and arrays containing @code{long double} variables,
27879 as well as modifying the function calling convention for functions taking
27880 @code{long double}.  Hence they are not binary-compatible
27881 with code compiled without that switch.
27883 @item -mlong-double-64
27884 @itemx -mlong-double-80
27885 @itemx -mlong-double-128
27886 @opindex mlong-double-64
27887 @opindex mlong-double-80
27888 @opindex mlong-double-128
27889 These switches control the size of @code{long double} type. A size
27890 of 64 bits makes the @code{long double} type equivalent to the @code{double}
27891 type. This is the default for 32-bit Bionic C library.  A size
27892 of 128 bits makes the @code{long double} type equivalent to the
27893 @code{__float128} type. This is the default for 64-bit Bionic C library.
27895 @strong{Warning:} if you override the default value for your target ABI, this
27896 changes the size of
27897 structures and arrays containing @code{long double} variables,
27898 as well as modifying the function calling convention for functions taking
27899 @code{long double}.  Hence they are not binary-compatible
27900 with code compiled without that switch.
27902 @item -malign-data=@var{type}
27903 @opindex malign-data
27904 Control how GCC aligns variables.  Supported values for @var{type} are
27905 @samp{compat} uses increased alignment value compatible uses GCC 4.8
27906 and earlier, @samp{abi} uses alignment value as specified by the
27907 psABI, and @samp{cacheline} uses increased alignment value to match
27908 the cache line size.  @samp{compat} is the default.
27910 @item -mlarge-data-threshold=@var{threshold}
27911 @opindex mlarge-data-threshold
27912 When @option{-mcmodel=medium} is specified, data objects larger than
27913 @var{threshold} are placed in the large data section.  This value must be the
27914 same across all objects linked into the binary, and defaults to 65535.
27916 @item -mrtd
27917 @opindex mrtd
27918 Use a different function-calling convention, in which functions that
27919 take a fixed number of arguments return with the @code{ret @var{num}}
27920 instruction, which pops their arguments while returning.  This saves one
27921 instruction in the caller since there is no need to pop the arguments
27922 there.
27924 You can specify that an individual function is called with this calling
27925 sequence with the function attribute @code{stdcall}.  You can also
27926 override the @option{-mrtd} option by using the function attribute
27927 @code{cdecl}.  @xref{Function Attributes}.
27929 @strong{Warning:} this calling convention is incompatible with the one
27930 normally used on Unix, so you cannot use it if you need to call
27931 libraries compiled with the Unix compiler.
27933 Also, you must provide function prototypes for all functions that
27934 take variable numbers of arguments (including @code{printf});
27935 otherwise incorrect code is generated for calls to those
27936 functions.
27938 In addition, seriously incorrect code results if you call a
27939 function with too many arguments.  (Normally, extra arguments are
27940 harmlessly ignored.)
27942 @item -mregparm=@var{num}
27943 @opindex mregparm
27944 Control how many registers are used to pass integer arguments.  By
27945 default, no registers are used to pass arguments, and at most 3
27946 registers can be used.  You can control this behavior for a specific
27947 function by using the function attribute @code{regparm}.
27948 @xref{Function Attributes}.
27950 @strong{Warning:} if you use this switch, and
27951 @var{num} is nonzero, then you must build all modules with the same
27952 value, including any libraries.  This includes the system libraries and
27953 startup modules.
27955 @item -msseregparm
27956 @opindex msseregparm
27957 Use SSE register passing conventions for float and double arguments
27958 and return values.  You can control this behavior for a specific
27959 function by using the function attribute @code{sseregparm}.
27960 @xref{Function Attributes}.
27962 @strong{Warning:} if you use this switch then you must build all
27963 modules with the same value, including any libraries.  This includes
27964 the system libraries and startup modules.
27966 @item -mvect8-ret-in-mem
27967 @opindex mvect8-ret-in-mem
27968 Return 8-byte vectors in memory instead of MMX registers.  This is the
27969 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
27970 Studio compilers until version 12.  Later compiler versions (starting
27971 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
27972 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
27973 you need to remain compatible with existing code produced by those
27974 previous compiler versions or older versions of GCC@.
27976 @item -mpc32
27977 @itemx -mpc64
27978 @itemx -mpc80
27979 @opindex mpc32
27980 @opindex mpc64
27981 @opindex mpc80
27983 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
27984 is specified, the significands of results of floating-point operations are
27985 rounded to 24 bits (single precision); @option{-mpc64} rounds the
27986 significands of results of floating-point operations to 53 bits (double
27987 precision) and @option{-mpc80} rounds the significands of results of
27988 floating-point operations to 64 bits (extended double precision), which is
27989 the default.  When this option is used, floating-point operations in higher
27990 precisions are not available to the programmer without setting the FPU
27991 control word explicitly.
27993 Setting the rounding of floating-point operations to less than the default
27994 80 bits can speed some programs by 2% or more.  Note that some mathematical
27995 libraries assume that extended-precision (80-bit) floating-point operations
27996 are enabled by default; routines in such libraries could suffer significant
27997 loss of accuracy, typically through so-called ``catastrophic cancellation'',
27998 when this option is used to set the precision to less than extended precision.
28000 @item -mstackrealign
28001 @opindex mstackrealign
28002 Realign the stack at entry.  On the x86, the @option{-mstackrealign}
28003 option generates an alternate prologue and epilogue that realigns the
28004 run-time stack if necessary.  This supports mixing legacy codes that keep
28005 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
28006 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
28007 applicable to individual functions.
28009 @item -mpreferred-stack-boundary=@var{num}
28010 @opindex mpreferred-stack-boundary
28011 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
28012 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
28013 the default is 4 (16 bytes or 128 bits).
28015 @strong{Warning:} When generating code for the x86-64 architecture with
28016 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
28017 used to keep the stack boundary aligned to 8 byte boundary.  Since
28018 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
28019 intended to be used in controlled environment where stack space is
28020 important limitation.  This option leads to wrong code when functions
28021 compiled with 16 byte stack alignment (such as functions from a standard
28022 library) are called with misaligned stack.  In this case, SSE
28023 instructions may lead to misaligned memory access traps.  In addition,
28024 variable arguments are handled incorrectly for 16 byte aligned
28025 objects (including x87 long double and __int128), leading to wrong
28026 results.  You must build all modules with
28027 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
28028 includes the system libraries and startup modules.
28030 @item -mincoming-stack-boundary=@var{num}
28031 @opindex mincoming-stack-boundary
28032 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
28033 boundary.  If @option{-mincoming-stack-boundary} is not specified,
28034 the one specified by @option{-mpreferred-stack-boundary} is used.
28036 On Pentium and Pentium Pro, @code{double} and @code{long double} values
28037 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
28038 suffer significant run time performance penalties.  On Pentium III, the
28039 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
28040 properly if it is not 16-byte aligned.
28042 To ensure proper alignment of this values on the stack, the stack boundary
28043 must be as aligned as that required by any value stored on the stack.
28044 Further, every function must be generated such that it keeps the stack
28045 aligned.  Thus calling a function compiled with a higher preferred
28046 stack boundary from a function compiled with a lower preferred stack
28047 boundary most likely misaligns the stack.  It is recommended that
28048 libraries that use callbacks always use the default setting.
28050 This extra alignment does consume extra stack space, and generally
28051 increases code size.  Code that is sensitive to stack space usage, such
28052 as embedded systems and operating system kernels, may want to reduce the
28053 preferred alignment to @option{-mpreferred-stack-boundary=2}.
28055 @need 200
28056 @item -mmmx
28057 @opindex mmmx
28058 @need 200
28059 @itemx -msse
28060 @opindex msse
28061 @need 200
28062 @itemx -msse2
28063 @opindex msse2
28064 @need 200
28065 @itemx -msse3
28066 @opindex msse3
28067 @need 200
28068 @itemx -mssse3
28069 @opindex mssse3
28070 @need 200
28071 @itemx -msse4
28072 @opindex msse4
28073 @need 200
28074 @itemx -msse4a
28075 @opindex msse4a
28076 @need 200
28077 @itemx -msse4.1
28078 @opindex msse4.1
28079 @need 200
28080 @itemx -msse4.2
28081 @opindex msse4.2
28082 @need 200
28083 @itemx -mavx
28084 @opindex mavx
28085 @need 200
28086 @itemx -mavx2
28087 @opindex mavx2
28088 @need 200
28089 @itemx -mavx512f
28090 @opindex mavx512f
28091 @need 200
28092 @itemx -mavx512pf
28093 @opindex mavx512pf
28094 @need 200
28095 @itemx -mavx512er
28096 @opindex mavx512er
28097 @need 200
28098 @itemx -mavx512cd
28099 @opindex mavx512cd
28100 @need 200
28101 @itemx -mavx512vl
28102 @opindex mavx512vl
28103 @need 200
28104 @itemx -mavx512bw
28105 @opindex mavx512bw
28106 @need 200
28107 @itemx -mavx512dq
28108 @opindex mavx512dq
28109 @need 200
28110 @itemx -mavx512ifma
28111 @opindex mavx512ifma
28112 @need 200
28113 @itemx -mavx512vbmi
28114 @opindex mavx512vbmi
28115 @need 200
28116 @itemx -msha
28117 @opindex msha
28118 @need 200
28119 @itemx -maes
28120 @opindex maes
28121 @need 200
28122 @itemx -mpclmul
28123 @opindex mpclmul
28124 @need 200
28125 @itemx -mclflushopt
28126 @opindex mclflushopt
28127 @need 200
28128 @itemx -mfsgsbase
28129 @opindex mfsgsbase
28130 @need 200
28131 @itemx -mptwrite
28132 @opindex mptwrite
28133 @need 200
28134 @itemx -mrdrnd
28135 @opindex mrdrnd
28136 @need 200
28137 @itemx -mf16c
28138 @opindex mf16c
28139 @need 200
28140 @itemx -mfma
28141 @opindex mfma
28142 @need 200
28143 @itemx -mpconfig
28144 @opindex mpconfig
28145 @need 200
28146 @itemx -mwbnoinvd
28147 @opindex mwbnoinvd
28148 @need 200
28149 @itemx -mfma4
28150 @opindex mfma4
28151 @need 200
28152 @itemx -mprefetchwt1
28153 @opindex mprefetchwt1
28154 @need 200
28155 @itemx -mxop
28156 @opindex mxop
28157 @need 200
28158 @itemx -mlwp
28159 @opindex mlwp
28160 @need 200
28161 @itemx -m3dnow
28162 @opindex m3dnow
28163 @need 200
28164 @itemx -m3dnowa
28165 @opindex m3dnowa
28166 @need 200
28167 @itemx -mpopcnt
28168 @opindex mpopcnt
28169 @need 200
28170 @itemx -mabm
28171 @opindex mabm
28172 @need 200
28173 @itemx -mbmi
28174 @opindex mbmi
28175 @need 200
28176 @itemx -mbmi2
28177 @need 200
28178 @itemx -mlzcnt
28179 @opindex mlzcnt
28180 @need 200
28181 @itemx -mfxsr
28182 @opindex mfxsr
28183 @need 200
28184 @itemx -mxsave
28185 @opindex mxsave
28186 @need 200
28187 @itemx -mxsaveopt
28188 @opindex mxsaveopt
28189 @need 200
28190 @itemx -mxsavec
28191 @opindex mxsavec
28192 @need 200
28193 @itemx -mxsaves
28194 @opindex mxsaves
28195 @need 200
28196 @itemx -mrtm
28197 @opindex mrtm
28198 @need 200
28199 @itemx -mtbm
28200 @opindex mtbm
28201 @need 200
28202 @itemx -mmwaitx
28203 @opindex mmwaitx
28204 @need 200
28205 @itemx -mclzero
28206 @opindex mclzero
28207 @need 200
28208 @itemx -mpku
28209 @opindex mpku
28210 @need 200
28211 @itemx -mavx512vbmi2
28212 @opindex mavx512vbmi2
28213 @need 200
28214 @itemx -mgfni
28215 @opindex mgfni
28216 @need 200
28217 @itemx -mvaes
28218 @opindex mvaes
28219 @need 200
28220 @itemx -mwaitpkg
28221 @opindex mwaitpkg
28222 @need 200
28223 @itemx -mvpclmulqdq
28224 @opindex mvpclmulqdq
28225 @need 200
28226 @itemx -mavx512bitalg
28227 @opindex mavx512bitalg
28228 @need 200
28229 @itemx -mmovdiri
28230 @opindex mmovdiri
28231 @need 200
28232 @itemx -mmovdir64b
28233 @opindex mmovdir64b
28234 @need 200
28235 @itemx -mavx512vpopcntdq
28236 @opindex mavx512vpopcntdq
28237 @need 200
28238 @itemx -mcldemote
28239 @opindex mcldemote
28240 These switches enable the use of instructions in the MMX, SSE,
28241 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER, AVX512CD,
28242 SHA, AES, PCLMUL, FSGSBASE, PTWRITE, RDRND, F16C, FMA, SSE4A, FMA4, XOP, LWP, ABM,
28243 AVX512VL, AVX512BW, AVX512DQ, AVX512IFMA, AVX512VBMI, BMI, BMI2, VAES, WAITPKG,
28244 FXSR, XSAVE, XSAVEOPT, LZCNT, RTM, MWAITX, PKU, IBT, SHSTK, AVX512VBMI2,
28245 GFNI, VPCLMULQDQ, AVX512BITALG, MOVDIRI, MOVDIR64B,
28246 AVX512VPOPCNTDQ, CLDEMOTE, 3DNow!@: or enhanced 3DNow!@: extended instruction
28247 sets. Each has a corresponding @option{-mno-} option to disable use of these
28248 instructions.
28250 These extensions are also available as built-in functions: see
28251 @ref{x86 Built-in Functions}, for details of the functions enabled and
28252 disabled by these switches.
28254 To generate SSE/SSE2 instructions automatically from floating-point
28255 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
28257 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
28258 generates new AVX instructions or AVX equivalence for all SSEx instructions
28259 when needed.
28261 These options enable GCC to use these extended instructions in
28262 generated code, even without @option{-mfpmath=sse}.  Applications that
28263 perform run-time CPU detection must compile separate files for each
28264 supported architecture, using the appropriate flags.  In particular,
28265 the file containing the CPU detection code should be compiled without
28266 these options.
28268 @item -mdump-tune-features
28269 @opindex mdump-tune-features
28270 This option instructs GCC to dump the names of the x86 performance 
28271 tuning features and default settings. The names can be used in 
28272 @option{-mtune-ctrl=@var{feature-list}}.
28274 @item -mtune-ctrl=@var{feature-list}
28275 @opindex mtune-ctrl=@var{feature-list}
28276 This option is used to do fine grain control of x86 code generation features.
28277 @var{feature-list} is a comma separated list of @var{feature} names. See also
28278 @option{-mdump-tune-features}. When specified, the @var{feature} is turned
28279 on if it is not preceded with @samp{^}, otherwise, it is turned off. 
28280 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
28281 developers. Using it may lead to code paths not covered by testing and can
28282 potentially result in compiler ICEs or runtime errors.
28284 @item -mno-default
28285 @opindex mno-default
28286 This option instructs GCC to turn off all tunable features. See also 
28287 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
28289 @item -mcld
28290 @opindex mcld
28291 This option instructs GCC to emit a @code{cld} instruction in the prologue
28292 of functions that use string instructions.  String instructions depend on
28293 the DF flag to select between autoincrement or autodecrement mode.  While the
28294 ABI specifies the DF flag to be cleared on function entry, some operating
28295 systems violate this specification by not clearing the DF flag in their
28296 exception dispatchers.  The exception handler can be invoked with the DF flag
28297 set, which leads to wrong direction mode when string instructions are used.
28298 This option can be enabled by default on 32-bit x86 targets by configuring
28299 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
28300 instructions can be suppressed with the @option{-mno-cld} compiler option
28301 in this case.
28303 @item -mvzeroupper
28304 @opindex mvzeroupper
28305 This option instructs GCC to emit a @code{vzeroupper} instruction
28306 before a transfer of control flow out of the function to minimize
28307 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
28308 intrinsics.
28310 @item -mprefer-avx128
28311 @opindex mprefer-avx128
28312 This option instructs GCC to use 128-bit AVX instructions instead of
28313 256-bit AVX instructions in the auto-vectorizer.
28315 @item -mprefer-vector-width=@var{opt}
28316 @opindex mprefer-vector-width
28317 This option instructs GCC to use @var{opt}-bit vector width in instructions
28318 instead of default on the selected platform.
28320 @table @samp
28321 @item none
28322 No extra limitations applied to GCC other than defined by the selected platform.
28324 @item 128
28325 Prefer 128-bit vector width for instructions.
28327 @item 256
28328 Prefer 256-bit vector width for instructions.
28330 @item 512
28331 Prefer 512-bit vector width for instructions.
28332 @end table
28334 @item -mcx16
28335 @opindex mcx16
28336 This option enables GCC to generate @code{CMPXCHG16B} instructions in 64-bit
28337 code to implement compare-and-exchange operations on 16-byte aligned 128-bit
28338 objects.  This is useful for atomic updates of data structures exceeding one
28339 machine word in size.  The compiler uses this instruction to implement
28340 @ref{__sync Builtins}.  However, for @ref{__atomic Builtins} operating on
28341 128-bit integers, a library call is always used.
28343 @item -msahf
28344 @opindex msahf
28345 This option enables generation of @code{SAHF} instructions in 64-bit code.
28346 Early Intel Pentium 4 CPUs with Intel 64 support,
28347 prior to the introduction of Pentium 4 G1 step in December 2005,
28348 lacked the @code{LAHF} and @code{SAHF} instructions
28349 which are supported by AMD64.
28350 These are load and store instructions, respectively, for certain status flags.
28351 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
28352 @code{drem}, and @code{remainder} built-in functions;
28353 see @ref{Other Builtins} for details.
28355 @item -mmovbe
28356 @opindex mmovbe
28357 This option enables use of the @code{movbe} instruction to implement
28358 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
28360 @item -mshstk
28361 @opindex mshstk
28362 The @option{-mshstk} option enables shadow stack built-in functions
28363 from x86 Control-flow Enforcement Technology (CET).
28365 @item -mcrc32
28366 @opindex mcrc32
28367 This option enables built-in functions @code{__builtin_ia32_crc32qi},
28368 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
28369 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
28371 @item -mrecip
28372 @opindex mrecip
28373 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
28374 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
28375 with an additional Newton-Raphson step
28376 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
28377 (and their vectorized
28378 variants) for single-precision floating-point arguments.  These instructions
28379 are generated only when @option{-funsafe-math-optimizations} is enabled
28380 together with @option{-ffinite-math-only} and @option{-fno-trapping-math}.
28381 Note that while the throughput of the sequence is higher than the throughput
28382 of the non-reciprocal instruction, the precision of the sequence can be
28383 decreased by up to 2 ulp (i.e.@: the inverse of 1.0 equals 0.99999994).
28385 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
28386 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
28387 combination), and doesn't need @option{-mrecip}.
28389 Also note that GCC emits the above sequence with additional Newton-Raphson step
28390 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
28391 already with @option{-ffast-math} (or the above option combination), and
28392 doesn't need @option{-mrecip}.
28394 @item -mrecip=@var{opt}
28395 @opindex mrecip=opt
28396 This option controls which reciprocal estimate instructions
28397 may be used.  @var{opt} is a comma-separated list of options, which may
28398 be preceded by a @samp{!} to invert the option:
28400 @table @samp
28401 @item all
28402 Enable all estimate instructions.
28404 @item default
28405 Enable the default instructions, equivalent to @option{-mrecip}.
28407 @item none
28408 Disable all estimate instructions, equivalent to @option{-mno-recip}.
28410 @item div
28411 Enable the approximation for scalar division.
28413 @item vec-div
28414 Enable the approximation for vectorized division.
28416 @item sqrt
28417 Enable the approximation for scalar square root.
28419 @item vec-sqrt
28420 Enable the approximation for vectorized square root.
28421 @end table
28423 So, for example, @option{-mrecip=all,!sqrt} enables
28424 all of the reciprocal approximations, except for square root.
28426 @item -mveclibabi=@var{type}
28427 @opindex mveclibabi
28428 Specifies the ABI type to use for vectorizing intrinsics using an
28429 external library.  Supported values for @var{type} are @samp{svml} 
28430 for the Intel short
28431 vector math library and @samp{acml} for the AMD math core library.
28432 To use this option, both @option{-ftree-vectorize} and
28433 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
28434 ABI-compatible library must be specified at link time.
28436 GCC currently emits calls to @code{vmldExp2},
28437 @code{vmldLn2}, @code{vmldLog102}, @code{vmldPow2},
28438 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
28439 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
28440 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
28441 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4},
28442 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
28443 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
28444 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
28445 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
28446 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
28447 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
28448 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
28449 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
28450 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
28451 when @option{-mveclibabi=acml} is used.  
28453 @item -mabi=@var{name}
28454 @opindex mabi
28455 Generate code for the specified calling convention.  Permissible values
28456 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
28457 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
28458 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
28459 You can control this behavior for specific functions by
28460 using the function attributes @code{ms_abi} and @code{sysv_abi}.
28461 @xref{Function Attributes}.
28463 @item -mforce-indirect-call
28464 @opindex mforce-indirect-call
28465 Force all calls to functions to be indirect. This is useful
28466 when using Intel Processor Trace where it generates more precise timing
28467 information for function calls.
28469 @item -mcall-ms2sysv-xlogues
28470 @opindex mcall-ms2sysv-xlogues
28471 @opindex mno-call-ms2sysv-xlogues
28472 Due to differences in 64-bit ABIs, any Microsoft ABI function that calls a
28473 System V ABI function must consider RSI, RDI and XMM6-15 as clobbered.  By
28474 default, the code for saving and restoring these registers is emitted inline,
28475 resulting in fairly lengthy prologues and epilogues.  Using
28476 @option{-mcall-ms2sysv-xlogues} emits prologues and epilogues that
28477 use stubs in the static portion of libgcc to perform these saves and restores,
28478 thus reducing function size at the cost of a few extra instructions.
28480 @item -mtls-dialect=@var{type}
28481 @opindex mtls-dialect
28482 Generate code to access thread-local storage using the @samp{gnu} or
28483 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
28484 @samp{gnu2} is more efficient, but it may add compile- and run-time
28485 requirements that cannot be satisfied on all systems.
28487 @item -mpush-args
28488 @itemx -mno-push-args
28489 @opindex mpush-args
28490 @opindex mno-push-args
28491 Use PUSH operations to store outgoing parameters.  This method is shorter
28492 and usually equally fast as method using SUB/MOV operations and is enabled
28493 by default.  In some cases disabling it may improve performance because of
28494 improved scheduling and reduced dependencies.
28496 @item -maccumulate-outgoing-args
28497 @opindex maccumulate-outgoing-args
28498 If enabled, the maximum amount of space required for outgoing arguments is
28499 computed in the function prologue.  This is faster on most modern CPUs
28500 because of reduced dependencies, improved scheduling and reduced stack usage
28501 when the preferred stack boundary is not equal to 2.  The drawback is a notable
28502 increase in code size.  This switch implies @option{-mno-push-args}.
28504 @item -mthreads
28505 @opindex mthreads
28506 Support thread-safe exception handling on MinGW.  Programs that rely
28507 on thread-safe exception handling must compile and link all code with the
28508 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
28509 @option{-D_MT}; when linking, it links in a special thread helper library
28510 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
28512 @item -mms-bitfields
28513 @itemx -mno-ms-bitfields
28514 @opindex mms-bitfields
28515 @opindex mno-ms-bitfields
28517 Enable/disable bit-field layout compatible with the native Microsoft
28518 Windows compiler.  
28520 If @code{packed} is used on a structure, or if bit-fields are used,
28521 it may be that the Microsoft ABI lays out the structure differently
28522 than the way GCC normally does.  Particularly when moving packed
28523 data between functions compiled with GCC and the native Microsoft compiler
28524 (either via function call or as data in a file), it may be necessary to access
28525 either format.
28527 This option is enabled by default for Microsoft Windows
28528 targets.  This behavior can also be controlled locally by use of variable
28529 or type attributes.  For more information, see @ref{x86 Variable Attributes}
28530 and @ref{x86 Type Attributes}.
28532 The Microsoft structure layout algorithm is fairly simple with the exception
28533 of the bit-field packing.  
28534 The padding and alignment of members of structures and whether a bit-field 
28535 can straddle a storage-unit boundary are determine by these rules:
28537 @enumerate
28538 @item Structure members are stored sequentially in the order in which they are
28539 declared: the first member has the lowest memory address and the last member
28540 the highest.
28542 @item Every data object has an alignment requirement.  The alignment requirement
28543 for all data except structures, unions, and arrays is either the size of the
28544 object or the current packing size (specified with either the
28545 @code{aligned} attribute or the @code{pack} pragma),
28546 whichever is less.  For structures, unions, and arrays,
28547 the alignment requirement is the largest alignment requirement of its members.
28548 Every object is allocated an offset so that:
28550 @smallexample
28551 offset % alignment_requirement == 0
28552 @end smallexample
28554 @item Adjacent bit-fields are packed into the same 1-, 2-, or 4-byte allocation
28555 unit if the integral types are the same size and if the next bit-field fits
28556 into the current allocation unit without crossing the boundary imposed by the
28557 common alignment requirements of the bit-fields.
28558 @end enumerate
28560 MSVC interprets zero-length bit-fields in the following ways:
28562 @enumerate
28563 @item If a zero-length bit-field is inserted between two bit-fields that
28564 are normally coalesced, the bit-fields are not coalesced.
28566 For example:
28568 @smallexample
28569 struct
28570  @{
28571    unsigned long bf_1 : 12;
28572    unsigned long : 0;
28573    unsigned long bf_2 : 12;
28574  @} t1;
28575 @end smallexample
28577 @noindent
28578 The size of @code{t1} is 8 bytes with the zero-length bit-field.  If the
28579 zero-length bit-field were removed, @code{t1}'s size would be 4 bytes.
28581 @item If a zero-length bit-field is inserted after a bit-field, @code{foo}, and the
28582 alignment of the zero-length bit-field is greater than the member that follows it,
28583 @code{bar}, @code{bar} is aligned as the type of the zero-length bit-field.
28585 For example:
28587 @smallexample
28588 struct
28589  @{
28590    char foo : 4;
28591    short : 0;
28592    char bar;
28593  @} t2;
28595 struct
28596  @{
28597    char foo : 4;
28598    short : 0;
28599    double bar;
28600  @} t3;
28601 @end smallexample
28603 @noindent
28604 For @code{t2}, @code{bar} is placed at offset 2, rather than offset 1.
28605 Accordingly, the size of @code{t2} is 4.  For @code{t3}, the zero-length
28606 bit-field does not affect the alignment of @code{bar} or, as a result, the size
28607 of the structure.
28609 Taking this into account, it is important to note the following:
28611 @enumerate
28612 @item If a zero-length bit-field follows a normal bit-field, the type of the
28613 zero-length bit-field may affect the alignment of the structure as whole. For
28614 example, @code{t2} has a size of 4 bytes, since the zero-length bit-field follows a
28615 normal bit-field, and is of type short.
28617 @item Even if a zero-length bit-field is not followed by a normal bit-field, it may
28618 still affect the alignment of the structure:
28620 @smallexample
28621 struct
28622  @{
28623    char foo : 6;
28624    long : 0;
28625  @} t4;
28626 @end smallexample
28628 @noindent
28629 Here, @code{t4} takes up 4 bytes.
28630 @end enumerate
28632 @item Zero-length bit-fields following non-bit-field members are ignored:
28634 @smallexample
28635 struct
28636  @{
28637    char foo;
28638    long : 0;
28639    char bar;
28640  @} t5;
28641 @end smallexample
28643 @noindent
28644 Here, @code{t5} takes up 2 bytes.
28645 @end enumerate
28648 @item -mno-align-stringops
28649 @opindex mno-align-stringops
28650 @opindex malign-stringops
28651 Do not align the destination of inlined string operations.  This switch reduces
28652 code size and improves performance in case the destination is already aligned,
28653 but GCC doesn't know about it.
28655 @item -minline-all-stringops
28656 @opindex minline-all-stringops
28657 By default GCC inlines string operations only when the destination is 
28658 known to be aligned to least a 4-byte boundary.  
28659 This enables more inlining and increases code
28660 size, but may improve performance of code that depends on fast
28661 @code{memcpy}, @code{strlen},
28662 and @code{memset} for short lengths.
28664 @item -minline-stringops-dynamically
28665 @opindex minline-stringops-dynamically
28666 For string operations of unknown size, use run-time checks with
28667 inline code for small blocks and a library call for large blocks.
28669 @item -mstringop-strategy=@var{alg}
28670 @opindex mstringop-strategy=@var{alg}
28671 Override the internal decision heuristic for the particular algorithm to use
28672 for inlining string operations.  The allowed values for @var{alg} are:
28674 @table @samp
28675 @item rep_byte
28676 @itemx rep_4byte
28677 @itemx rep_8byte
28678 Expand using i386 @code{rep} prefix of the specified size.
28680 @item byte_loop
28681 @itemx loop
28682 @itemx unrolled_loop
28683 Expand into an inline loop.
28685 @item libcall
28686 Always use a library call.
28687 @end table
28689 @item -mmemcpy-strategy=@var{strategy}
28690 @opindex mmemcpy-strategy=@var{strategy}
28691 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
28692 should be inlined and what inline algorithm to use when the expected size
28693 of the copy operation is known. @var{strategy} 
28694 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
28695 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
28696 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
28697 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
28698 in the list must be specified in increasing order.  The minimal byte size for 
28699 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
28700 preceding range.
28702 @item -mmemset-strategy=@var{strategy}
28703 @opindex mmemset-strategy=@var{strategy}
28704 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
28705 @code{__builtin_memset} expansion.
28707 @item -momit-leaf-frame-pointer
28708 @opindex momit-leaf-frame-pointer
28709 Don't keep the frame pointer in a register for leaf functions.  This
28710 avoids the instructions to save, set up, and restore frame pointers and
28711 makes an extra register available in leaf functions.  The option
28712 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
28713 which might make debugging harder.
28715 @item -mtls-direct-seg-refs
28716 @itemx -mno-tls-direct-seg-refs
28717 @opindex mtls-direct-seg-refs
28718 Controls whether TLS variables may be accessed with offsets from the
28719 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
28720 or whether the thread base pointer must be added.  Whether or not this
28721 is valid depends on the operating system, and whether it maps the
28722 segment to cover the entire TLS area.
28724 For systems that use the GNU C Library, the default is on.
28726 @item -msse2avx
28727 @itemx -mno-sse2avx
28728 @opindex msse2avx
28729 Specify that the assembler should encode SSE instructions with VEX
28730 prefix.  The option @option{-mavx} turns this on by default.
28732 @item -mfentry
28733 @itemx -mno-fentry
28734 @opindex mfentry
28735 If profiling is active (@option{-pg}), put the profiling
28736 counter call before the prologue.
28737 Note: On x86 architectures the attribute @code{ms_hook_prologue}
28738 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
28740 @item -mrecord-mcount
28741 @itemx -mno-record-mcount
28742 @opindex mrecord-mcount
28743 If profiling is active (@option{-pg}), generate a __mcount_loc section
28744 that contains pointers to each profiling call. This is useful for
28745 automatically patching and out calls.
28747 @item -mnop-mcount
28748 @itemx -mno-nop-mcount
28749 @opindex mnop-mcount
28750 If profiling is active (@option{-pg}), generate the calls to
28751 the profiling functions as NOPs. This is useful when they
28752 should be patched in later dynamically. This is likely only
28753 useful together with @option{-mrecord-mcount}.
28755 @item -mskip-rax-setup
28756 @itemx -mno-skip-rax-setup
28757 @opindex mskip-rax-setup
28758 When generating code for the x86-64 architecture with SSE extensions
28759 disabled, @option{-mskip-rax-setup} can be used to skip setting up RAX
28760 register when there are no variable arguments passed in vector registers.
28762 @strong{Warning:} Since RAX register is used to avoid unnecessarily
28763 saving vector registers on stack when passing variable arguments, the
28764 impacts of this option are callees may waste some stack space,
28765 misbehave or jump to a random location.  GCC 4.4 or newer don't have
28766 those issues, regardless the RAX register value.
28768 @item -m8bit-idiv
28769 @itemx -mno-8bit-idiv
28770 @opindex m8bit-idiv
28771 On some processors, like Intel Atom, 8-bit unsigned integer divide is
28772 much faster than 32-bit/64-bit integer divide.  This option generates a
28773 run-time check.  If both dividend and divisor are within range of 0
28774 to 255, 8-bit unsigned integer divide is used instead of
28775 32-bit/64-bit integer divide.
28777 @item -mavx256-split-unaligned-load
28778 @itemx -mavx256-split-unaligned-store
28779 @opindex mavx256-split-unaligned-load
28780 @opindex mavx256-split-unaligned-store
28781 Split 32-byte AVX unaligned load and store.
28783 @item -mstack-protector-guard=@var{guard}
28784 @itemx -mstack-protector-guard-reg=@var{reg}
28785 @itemx -mstack-protector-guard-offset=@var{offset}
28786 @opindex mstack-protector-guard
28787 @opindex mstack-protector-guard-reg
28788 @opindex mstack-protector-guard-offset
28789 Generate stack protection code using canary at @var{guard}.  Supported
28790 locations are @samp{global} for global canary or @samp{tls} for per-thread
28791 canary in the TLS block (the default).  This option has effect only when
28792 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
28794 With the latter choice the options
28795 @option{-mstack-protector-guard-reg=@var{reg}} and
28796 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
28797 which segment register (@code{%fs} or @code{%gs}) to use as base register
28798 for reading the canary, and from what offset from that base register.
28799 The default for those is as specified in the relevant ABI.
28801 @item -mgeneral-regs-only
28802 @opindex mgeneral-regs-only
28803 Generate code that uses only the general-purpose registers.  This
28804 prevents the compiler from using floating-point, vector, mask and bound
28805 registers.
28807 @item -mindirect-branch=@var{choice}
28808 @opindex mindirect-branch
28809 Convert indirect call and jump with @var{choice}.  The default is
28810 @samp{keep}, which keeps indirect call and jump unmodified.
28811 @samp{thunk} converts indirect call and jump to call and return thunk.
28812 @samp{thunk-inline} converts indirect call and jump to inlined call
28813 and return thunk.  @samp{thunk-extern} converts indirect call and jump
28814 to external call and return thunk provided in a separate object file.
28815 You can control this behavior for a specific function by using the
28816 function attribute @code{indirect_branch}.  @xref{Function Attributes}.
28818 Note that @option{-mcmodel=large} is incompatible with
28819 @option{-mindirect-branch=thunk} and
28820 @option{-mindirect-branch=thunk-extern} since the thunk function may
28821 not be reachable in the large code model.
28823 Note that @option{-mindirect-branch=thunk-extern} is incompatible with
28824 @option{-fcf-protection=branch} since the external thunk can not be modified
28825 to disable control-flow check.
28827 @item -mfunction-return=@var{choice}
28828 @opindex mfunction-return
28829 Convert function return with @var{choice}.  The default is @samp{keep},
28830 which keeps function return unmodified.  @samp{thunk} converts function
28831 return to call and return thunk.  @samp{thunk-inline} converts function
28832 return to inlined call and return thunk.  @samp{thunk-extern} converts
28833 function return to external call and return thunk provided in a separate
28834 object file.  You can control this behavior for a specific function by
28835 using the function attribute @code{function_return}.
28836 @xref{Function Attributes}.
28838 Note that @option{-mcmodel=large} is incompatible with
28839 @option{-mfunction-return=thunk} and
28840 @option{-mfunction-return=thunk-extern} since the thunk function may
28841 not be reachable in the large code model.
28844 @item -mindirect-branch-register
28845 @opindex mindirect-branch-register
28846 Force indirect call and jump via register.
28848 @end table
28850 These @samp{-m} switches are supported in addition to the above
28851 on x86-64 processors in 64-bit environments.
28853 @table @gcctabopt
28854 @item -m32
28855 @itemx -m64
28856 @itemx -mx32
28857 @itemx -m16
28858 @itemx -miamcu
28859 @opindex m32
28860 @opindex m64
28861 @opindex mx32
28862 @opindex m16
28863 @opindex miamcu
28864 Generate code for a 16-bit, 32-bit or 64-bit environment.
28865 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
28866 to 32 bits, and
28867 generates code that runs on any i386 system.
28869 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
28870 types to 64 bits, and generates code for the x86-64 architecture.
28871 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
28872 and @option{-mdynamic-no-pic} options.
28874 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
28875 to 32 bits, and
28876 generates code for the x86-64 architecture.
28878 The @option{-m16} option is the same as @option{-m32}, except for that
28879 it outputs the @code{.code16gcc} assembly directive at the beginning of
28880 the assembly output so that the binary can run in 16-bit mode.
28882 The @option{-miamcu} option generates code which conforms to Intel MCU
28883 psABI.  It requires the @option{-m32} option to be turned on.
28885 @item -mno-red-zone
28886 @opindex mno-red-zone
28887 @opindex mred-zone
28888 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
28889 by the x86-64 ABI; it is a 128-byte area beyond the location of the
28890 stack pointer that is not modified by signal or interrupt handlers
28891 and therefore can be used for temporary data without adjusting the stack
28892 pointer.  The flag @option{-mno-red-zone} disables this red zone.
28894 @item -mcmodel=small
28895 @opindex mcmodel=small
28896 Generate code for the small code model: the program and its symbols must
28897 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
28898 Programs can be statically or dynamically linked.  This is the default
28899 code model.
28901 @item -mcmodel=kernel
28902 @opindex mcmodel=kernel
28903 Generate code for the kernel code model.  The kernel runs in the
28904 negative 2 GB of the address space.
28905 This model has to be used for Linux kernel code.
28907 @item -mcmodel=medium
28908 @opindex mcmodel=medium
28909 Generate code for the medium model: the program is linked in the lower 2
28910 GB of the address space.  Small symbols are also placed there.  Symbols
28911 with sizes larger than @option{-mlarge-data-threshold} are put into
28912 large data or BSS sections and can be located above 2GB.  Programs can
28913 be statically or dynamically linked.
28915 @item -mcmodel=large
28916 @opindex mcmodel=large
28917 Generate code for the large model.  This model makes no assumptions
28918 about addresses and sizes of sections.
28920 @item -maddress-mode=long
28921 @opindex maddress-mode=long
28922 Generate code for long address mode.  This is only supported for 64-bit
28923 and x32 environments.  It is the default address mode for 64-bit
28924 environments.
28926 @item -maddress-mode=short
28927 @opindex maddress-mode=short
28928 Generate code for short address mode.  This is only supported for 32-bit
28929 and x32 environments.  It is the default address mode for 32-bit and
28930 x32 environments.
28931 @end table
28933 @node x86 Windows Options
28934 @subsection x86 Windows Options
28935 @cindex x86 Windows Options
28936 @cindex Windows Options for x86
28938 These additional options are available for Microsoft Windows targets:
28940 @table @gcctabopt
28941 @item -mconsole
28942 @opindex mconsole
28943 This option
28944 specifies that a console application is to be generated, by
28945 instructing the linker to set the PE header subsystem type
28946 required for console applications.
28947 This option is available for Cygwin and MinGW targets and is
28948 enabled by default on those targets.
28950 @item -mdll
28951 @opindex mdll
28952 This option is available for Cygwin and MinGW targets.  It
28953 specifies that a DLL---a dynamic link library---is to be
28954 generated, enabling the selection of the required runtime
28955 startup object and entry point.
28957 @item -mnop-fun-dllimport
28958 @opindex mnop-fun-dllimport
28959 This option is available for Cygwin and MinGW targets.  It
28960 specifies that the @code{dllimport} attribute should be ignored.
28962 @item -mthread
28963 @opindex mthread
28964 This option is available for MinGW targets. It specifies
28965 that MinGW-specific thread support is to be used.
28967 @item -municode
28968 @opindex municode
28969 This option is available for MinGW-w64 targets.  It causes
28970 the @code{UNICODE} preprocessor macro to be predefined, and
28971 chooses Unicode-capable runtime startup code.
28973 @item -mwin32
28974 @opindex mwin32
28975 This option is available for Cygwin and MinGW targets.  It
28976 specifies that the typical Microsoft Windows predefined macros are to
28977 be set in the pre-processor, but does not influence the choice
28978 of runtime library/startup code.
28980 @item -mwindows
28981 @opindex mwindows
28982 This option is available for Cygwin and MinGW targets.  It
28983 specifies that a GUI application is to be generated by
28984 instructing the linker to set the PE header subsystem type
28985 appropriately.
28987 @item -fno-set-stack-executable
28988 @opindex fno-set-stack-executable
28989 @opindex fset-stack-executable
28990 This option is available for MinGW targets. It specifies that
28991 the executable flag for the stack used by nested functions isn't
28992 set. This is necessary for binaries running in kernel mode of
28993 Microsoft Windows, as there the User32 API, which is used to set executable
28994 privileges, isn't available.
28996 @item -fwritable-relocated-rdata
28997 @opindex fno-writable-relocated-rdata
28998 @opindex fwritable-relocated-rdata
28999 This option is available for MinGW and Cygwin targets.  It specifies
29000 that relocated-data in read-only section is put into the @code{.data}
29001 section.  This is a necessary for older runtimes not supporting
29002 modification of @code{.rdata} sections for pseudo-relocation.
29004 @item -mpe-aligned-commons
29005 @opindex mpe-aligned-commons
29006 This option is available for Cygwin and MinGW targets.  It
29007 specifies that the GNU extension to the PE file format that
29008 permits the correct alignment of COMMON variables should be
29009 used when generating code.  It is enabled by default if
29010 GCC detects that the target assembler found during configuration
29011 supports the feature.
29012 @end table
29014 See also under @ref{x86 Options} for standard options.
29016 @node Xstormy16 Options
29017 @subsection Xstormy16 Options
29018 @cindex Xstormy16 Options
29020 These options are defined for Xstormy16:
29022 @table @gcctabopt
29023 @item -msim
29024 @opindex msim
29025 Choose startup files and linker script suitable for the simulator.
29026 @end table
29028 @node Xtensa Options
29029 @subsection Xtensa Options
29030 @cindex Xtensa Options
29032 These options are supported for Xtensa targets:
29034 @table @gcctabopt
29035 @item -mconst16
29036 @itemx -mno-const16
29037 @opindex mconst16
29038 @opindex mno-const16
29039 Enable or disable use of @code{CONST16} instructions for loading
29040 constant values.  The @code{CONST16} instruction is currently not a
29041 standard option from Tensilica.  When enabled, @code{CONST16}
29042 instructions are always used in place of the standard @code{L32R}
29043 instructions.  The use of @code{CONST16} is enabled by default only if
29044 the @code{L32R} instruction is not available.
29046 @item -mfused-madd
29047 @itemx -mno-fused-madd
29048 @opindex mfused-madd
29049 @opindex mno-fused-madd
29050 Enable or disable use of fused multiply/add and multiply/subtract
29051 instructions in the floating-point option.  This has no effect if the
29052 floating-point option is not also enabled.  Disabling fused multiply/add
29053 and multiply/subtract instructions forces the compiler to use separate
29054 instructions for the multiply and add/subtract operations.  This may be
29055 desirable in some cases where strict IEEE 754-compliant results are
29056 required: the fused multiply add/subtract instructions do not round the
29057 intermediate result, thereby producing results with @emph{more} bits of
29058 precision than specified by the IEEE standard.  Disabling fused multiply
29059 add/subtract instructions also ensures that the program output is not
29060 sensitive to the compiler's ability to combine multiply and add/subtract
29061 operations.
29063 @item -mserialize-volatile
29064 @itemx -mno-serialize-volatile
29065 @opindex mserialize-volatile
29066 @opindex mno-serialize-volatile
29067 When this option is enabled, GCC inserts @code{MEMW} instructions before
29068 @code{volatile} memory references to guarantee sequential consistency.
29069 The default is @option{-mserialize-volatile}.  Use
29070 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
29072 @item -mforce-no-pic
29073 @opindex mforce-no-pic
29074 For targets, like GNU/Linux, where all user-mode Xtensa code must be
29075 position-independent code (PIC), this option disables PIC for compiling
29076 kernel code.
29078 @item -mtext-section-literals
29079 @itemx -mno-text-section-literals
29080 @opindex mtext-section-literals
29081 @opindex mno-text-section-literals
29082 These options control the treatment of literal pools.  The default is
29083 @option{-mno-text-section-literals}, which places literals in a separate
29084 section in the output file.  This allows the literal pool to be placed
29085 in a data RAM/ROM, and it also allows the linker to combine literal
29086 pools from separate object files to remove redundant literals and
29087 improve code size.  With @option{-mtext-section-literals}, the literals
29088 are interspersed in the text section in order to keep them as close as
29089 possible to their references.  This may be necessary for large assembly
29090 files.  Literals for each function are placed right before that function.
29092 @item -mauto-litpools
29093 @itemx -mno-auto-litpools
29094 @opindex mauto-litpools
29095 @opindex mno-auto-litpools
29096 These options control the treatment of literal pools.  The default is
29097 @option{-mno-auto-litpools}, which places literals in a separate
29098 section in the output file unless @option{-mtext-section-literals} is
29099 used.  With @option{-mauto-litpools} the literals are interspersed in
29100 the text section by the assembler.  Compiler does not produce explicit
29101 @code{.literal} directives and loads literals into registers with
29102 @code{MOVI} instructions instead of @code{L32R} to let the assembler
29103 do relaxation and place literals as necessary.  This option allows
29104 assembler to create several literal pools per function and assemble
29105 very big functions, which may not be possible with
29106 @option{-mtext-section-literals}.
29108 @item -mtarget-align
29109 @itemx -mno-target-align
29110 @opindex mtarget-align
29111 @opindex mno-target-align
29112 When this option is enabled, GCC instructs the assembler to
29113 automatically align instructions to reduce branch penalties at the
29114 expense of some code density.  The assembler attempts to widen density
29115 instructions to align branch targets and the instructions following call
29116 instructions.  If there are not enough preceding safe density
29117 instructions to align a target, no widening is performed.  The
29118 default is @option{-mtarget-align}.  These options do not affect the
29119 treatment of auto-aligned instructions like @code{LOOP}, which the
29120 assembler always aligns, either by widening density instructions or
29121 by inserting NOP instructions.
29123 @item -mlongcalls
29124 @itemx -mno-longcalls
29125 @opindex mlongcalls
29126 @opindex mno-longcalls
29127 When this option is enabled, GCC instructs the assembler to translate
29128 direct calls to indirect calls unless it can determine that the target
29129 of a direct call is in the range allowed by the call instruction.  This
29130 translation typically occurs for calls to functions in other source
29131 files.  Specifically, the assembler translates a direct @code{CALL}
29132 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
29133 The default is @option{-mno-longcalls}.  This option should be used in
29134 programs where the call target can potentially be out of range.  This
29135 option is implemented in the assembler, not the compiler, so the
29136 assembly code generated by GCC still shows direct call
29137 instructions---look at the disassembled object code to see the actual
29138 instructions.  Note that the assembler uses an indirect call for
29139 every cross-file call, not just those that really are out of range.
29140 @end table
29142 @node zSeries Options
29143 @subsection zSeries Options
29144 @cindex zSeries options
29146 These are listed under @xref{S/390 and zSeries Options}.
29149 @c man end
29151 @node Spec Files
29152 @section Specifying Subprocesses and the Switches to Pass to Them
29153 @cindex Spec Files
29155 @command{gcc} is a driver program.  It performs its job by invoking a
29156 sequence of other programs to do the work of compiling, assembling and
29157 linking.  GCC interprets its command-line parameters and uses these to
29158 deduce which programs it should invoke, and which command-line options
29159 it ought to place on their command lines.  This behavior is controlled
29160 by @dfn{spec strings}.  In most cases there is one spec string for each
29161 program that GCC can invoke, but a few programs have multiple spec
29162 strings to control their behavior.  The spec strings built into GCC can
29163 be overridden by using the @option{-specs=} command-line switch to specify
29164 a spec file.
29166 @dfn{Spec files} are plain-text files that are used to construct spec
29167 strings.  They consist of a sequence of directives separated by blank
29168 lines.  The type of directive is determined by the first non-whitespace
29169 character on the line, which can be one of the following:
29171 @table @code
29172 @item %@var{command}
29173 Issues a @var{command} to the spec file processor.  The commands that can
29174 appear here are:
29176 @table @code
29177 @item %include <@var{file}>
29178 @cindex @code{%include}
29179 Search for @var{file} and insert its text at the current point in the
29180 specs file.
29182 @item %include_noerr <@var{file}>
29183 @cindex @code{%include_noerr}
29184 Just like @samp{%include}, but do not generate an error message if the include
29185 file cannot be found.
29187 @item %rename @var{old_name} @var{new_name}
29188 @cindex @code{%rename}
29189 Rename the spec string @var{old_name} to @var{new_name}.
29191 @end table
29193 @item *[@var{spec_name}]:
29194 This tells the compiler to create, override or delete the named spec
29195 string.  All lines after this directive up to the next directive or
29196 blank line are considered to be the text for the spec string.  If this
29197 results in an empty string then the spec is deleted.  (Or, if the
29198 spec did not exist, then nothing happens.)  Otherwise, if the spec
29199 does not currently exist a new spec is created.  If the spec does
29200 exist then its contents are overridden by the text of this
29201 directive, unless the first character of that text is the @samp{+}
29202 character, in which case the text is appended to the spec.
29204 @item [@var{suffix}]:
29205 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
29206 and up to the next directive or blank line are considered to make up the
29207 spec string for the indicated suffix.  When the compiler encounters an
29208 input file with the named suffix, it processes the spec string in
29209 order to work out how to compile that file.  For example:
29211 @smallexample
29212 .ZZ:
29213 z-compile -input %i
29214 @end smallexample
29216 This says that any input file whose name ends in @samp{.ZZ} should be
29217 passed to the program @samp{z-compile}, which should be invoked with the
29218 command-line switch @option{-input} and with the result of performing the
29219 @samp{%i} substitution.  (See below.)
29221 As an alternative to providing a spec string, the text following a
29222 suffix directive can be one of the following:
29224 @table @code
29225 @item @@@var{language}
29226 This says that the suffix is an alias for a known @var{language}.  This is
29227 similar to using the @option{-x} command-line switch to GCC to specify a
29228 language explicitly.  For example:
29230 @smallexample
29231 .ZZ:
29232 @@c++
29233 @end smallexample
29235 Says that .ZZ files are, in fact, C++ source files.
29237 @item #@var{name}
29238 This causes an error messages saying:
29240 @smallexample
29241 @var{name} compiler not installed on this system.
29242 @end smallexample
29243 @end table
29245 GCC already has an extensive list of suffixes built into it.
29246 This directive adds an entry to the end of the list of suffixes, but
29247 since the list is searched from the end backwards, it is effectively
29248 possible to override earlier entries using this technique.
29250 @end table
29252 GCC has the following spec strings built into it.  Spec files can
29253 override these strings or create their own.  Note that individual
29254 targets can also add their own spec strings to this list.
29256 @smallexample
29257 asm          Options to pass to the assembler
29258 asm_final    Options to pass to the assembler post-processor
29259 cpp          Options to pass to the C preprocessor
29260 cc1          Options to pass to the C compiler
29261 cc1plus      Options to pass to the C++ compiler
29262 endfile      Object files to include at the end of the link
29263 link         Options to pass to the linker
29264 lib          Libraries to include on the command line to the linker
29265 libgcc       Decides which GCC support library to pass to the linker
29266 linker       Sets the name of the linker
29267 predefines   Defines to be passed to the C preprocessor
29268 signed_char  Defines to pass to CPP to say whether @code{char} is signed
29269              by default
29270 startfile    Object files to include at the start of the link
29271 @end smallexample
29273 Here is a small example of a spec file:
29275 @smallexample
29276 %rename lib                 old_lib
29278 *lib:
29279 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
29280 @end smallexample
29282 This example renames the spec called @samp{lib} to @samp{old_lib} and
29283 then overrides the previous definition of @samp{lib} with a new one.
29284 The new definition adds in some extra command-line options before
29285 including the text of the old definition.
29287 @dfn{Spec strings} are a list of command-line options to be passed to their
29288 corresponding program.  In addition, the spec strings can contain
29289 @samp{%}-prefixed sequences to substitute variable text or to
29290 conditionally insert text into the command line.  Using these constructs
29291 it is possible to generate quite complex command lines.
29293 Here is a table of all defined @samp{%}-sequences for spec
29294 strings.  Note that spaces are not generated automatically around the
29295 results of expanding these sequences.  Therefore you can concatenate them
29296 together or combine them with constant text in a single argument.
29298 @table @code
29299 @item %%
29300 Substitute one @samp{%} into the program name or argument.
29302 @item %i
29303 Substitute the name of the input file being processed.
29305 @item %b
29306 Substitute the basename of the input file being processed.
29307 This is the substring up to (and not including) the last period
29308 and not including the directory.
29310 @item %B
29311 This is the same as @samp{%b}, but include the file suffix (text after
29312 the last period).
29314 @item %d
29315 Marks the argument containing or following the @samp{%d} as a
29316 temporary file name, so that that file is deleted if GCC exits
29317 successfully.  Unlike @samp{%g}, this contributes no text to the
29318 argument.
29320 @item %g@var{suffix}
29321 Substitute a file name that has suffix @var{suffix} and is chosen
29322 once per compilation, and mark the argument in the same way as
29323 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
29324 name is now chosen in a way that is hard to predict even when previously
29325 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
29326 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
29327 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
29328 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
29329 was simply substituted with a file name chosen once per compilation,
29330 without regard to any appended suffix (which was therefore treated
29331 just like ordinary text), making such attacks more likely to succeed.
29333 @item %u@var{suffix}
29334 Like @samp{%g}, but generates a new temporary file name
29335 each time it appears instead of once per compilation.
29337 @item %U@var{suffix}
29338 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
29339 new one if there is no such last file name.  In the absence of any
29340 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
29341 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
29342 involves the generation of two distinct file names, one
29343 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
29344 simply substituted with a file name chosen for the previous @samp{%u},
29345 without regard to any appended suffix.
29347 @item %j@var{suffix}
29348 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
29349 writable, and if @option{-save-temps} is not used; 
29350 otherwise, substitute the name
29351 of a temporary file, just like @samp{%u}.  This temporary file is not
29352 meant for communication between processes, but rather as a junk
29353 disposal mechanism.
29355 @item %|@var{suffix}
29356 @itemx %m@var{suffix}
29357 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
29358 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
29359 all.  These are the two most common ways to instruct a program that it
29360 should read from standard input or write to standard output.  If you
29361 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
29362 construct: see for example @file{f/lang-specs.h}.
29364 @item %.@var{SUFFIX}
29365 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
29366 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
29367 terminated by the next space or %.
29369 @item %w
29370 Marks the argument containing or following the @samp{%w} as the
29371 designated output file of this compilation.  This puts the argument
29372 into the sequence of arguments that @samp{%o} substitutes.
29374 @item %o
29375 Substitutes the names of all the output files, with spaces
29376 automatically placed around them.  You should write spaces
29377 around the @samp{%o} as well or the results are undefined.
29378 @samp{%o} is for use in the specs for running the linker.
29379 Input files whose names have no recognized suffix are not compiled
29380 at all, but they are included among the output files, so they are
29381 linked.
29383 @item %O
29384 Substitutes the suffix for object files.  Note that this is
29385 handled specially when it immediately follows @samp{%g, %u, or %U},
29386 because of the need for those to form complete file names.  The
29387 handling is such that @samp{%O} is treated exactly as if it had already
29388 been substituted, except that @samp{%g, %u, and %U} do not currently
29389 support additional @var{suffix} characters following @samp{%O} as they do
29390 following, for example, @samp{.o}.
29392 @item %p
29393 Substitutes the standard macro predefinitions for the
29394 current target machine.  Use this when running @command{cpp}.
29396 @item %P
29397 Like @samp{%p}, but puts @samp{__} before and after the name of each
29398 predefined macro, except for macros that start with @samp{__} or with
29399 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
29402 @item %I
29403 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
29404 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
29405 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
29406 and @option{-imultilib} as necessary.
29408 @item %s
29409 Current argument is the name of a library or startup file of some sort.
29410 Search for that file in a standard list of directories and substitute
29411 the full name found.  The current working directory is included in the
29412 list of directories scanned.
29414 @item %T
29415 Current argument is the name of a linker script.  Search for that file
29416 in the current list of directories to scan for libraries. If the file
29417 is located insert a @option{--script} option into the command line
29418 followed by the full path name found.  If the file is not found then
29419 generate an error message.  Note: the current working directory is not
29420 searched.
29422 @item %e@var{str}
29423 Print @var{str} as an error message.  @var{str} is terminated by a newline.
29424 Use this when inconsistent options are detected.
29426 @item %(@var{name})
29427 Substitute the contents of spec string @var{name} at this point.
29429 @item %x@{@var{option}@}
29430 Accumulate an option for @samp{%X}.
29432 @item %X
29433 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
29434 spec string.
29436 @item %Y
29437 Output the accumulated assembler options specified by @option{-Wa}.
29439 @item %Z
29440 Output the accumulated preprocessor options specified by @option{-Wp}.
29442 @item %a
29443 Process the @code{asm} spec.  This is used to compute the
29444 switches to be passed to the assembler.
29446 @item %A
29447 Process the @code{asm_final} spec.  This is a spec string for
29448 passing switches to an assembler post-processor, if such a program is
29449 needed.
29451 @item %l
29452 Process the @code{link} spec.  This is the spec for computing the
29453 command line passed to the linker.  Typically it makes use of the
29454 @samp{%L %G %S %D and %E} sequences.
29456 @item %D
29457 Dump out a @option{-L} option for each directory that GCC believes might
29458 contain startup files.  If the target supports multilibs then the
29459 current multilib directory is prepended to each of these paths.
29461 @item %L
29462 Process the @code{lib} spec.  This is a spec string for deciding which
29463 libraries are included on the command line to the linker.
29465 @item %G
29466 Process the @code{libgcc} spec.  This is a spec string for deciding
29467 which GCC support library is included on the command line to the linker.
29469 @item %S
29470 Process the @code{startfile} spec.  This is a spec for deciding which
29471 object files are the first ones passed to the linker.  Typically
29472 this might be a file named @file{crt0.o}.
29474 @item %E
29475 Process the @code{endfile} spec.  This is a spec string that specifies
29476 the last object files that are passed to the linker.
29478 @item %C
29479 Process the @code{cpp} spec.  This is used to construct the arguments
29480 to be passed to the C preprocessor.
29482 @item %1
29483 Process the @code{cc1} spec.  This is used to construct the options to be
29484 passed to the actual C compiler (@command{cc1}).
29486 @item %2
29487 Process the @code{cc1plus} spec.  This is used to construct the options to be
29488 passed to the actual C++ compiler (@command{cc1plus}).
29490 @item %*
29491 Substitute the variable part of a matched option.  See below.
29492 Note that each comma in the substituted string is replaced by
29493 a single space.
29495 @item %<S
29496 Remove all occurrences of @code{-S} from the command line.  Note---this
29497 command is position dependent.  @samp{%} commands in the spec string
29498 before this one see @code{-S}, @samp{%} commands in the spec string
29499 after this one do not.
29501 @item %:@var{function}(@var{args})
29502 Call the named function @var{function}, passing it @var{args}.
29503 @var{args} is first processed as a nested spec string, then split
29504 into an argument vector in the usual fashion.  The function returns
29505 a string which is processed as if it had appeared literally as part
29506 of the current spec.
29508 The following built-in spec functions are provided:
29510 @table @code
29511 @item @code{getenv}
29512 The @code{getenv} spec function takes two arguments: an environment
29513 variable name and a string.  If the environment variable is not
29514 defined, a fatal error is issued.  Otherwise, the return value is the
29515 value of the environment variable concatenated with the string.  For
29516 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
29518 @smallexample
29519 %:getenv(TOPDIR /include)
29520 @end smallexample
29522 expands to @file{/path/to/top/include}.
29524 @item @code{if-exists}
29525 The @code{if-exists} spec function takes one argument, an absolute
29526 pathname to a file.  If the file exists, @code{if-exists} returns the
29527 pathname.  Here is a small example of its usage:
29529 @smallexample
29530 *startfile:
29531 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
29532 @end smallexample
29534 @item @code{if-exists-else}
29535 The @code{if-exists-else} spec function is similar to the @code{if-exists}
29536 spec function, except that it takes two arguments.  The first argument is
29537 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
29538 returns the pathname.  If it does not exist, it returns the second argument.
29539 This way, @code{if-exists-else} can be used to select one file or another,
29540 based on the existence of the first.  Here is a small example of its usage:
29542 @smallexample
29543 *startfile:
29544 crt0%O%s %:if-exists(crti%O%s) \
29545 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
29546 @end smallexample
29548 @item @code{replace-outfile}
29549 The @code{replace-outfile} spec function takes two arguments.  It looks for the
29550 first argument in the outfiles array and replaces it with the second argument.  Here
29551 is a small example of its usage:
29553 @smallexample
29554 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
29555 @end smallexample
29557 @item @code{remove-outfile}
29558 The @code{remove-outfile} spec function takes one argument.  It looks for the
29559 first argument in the outfiles array and removes it.  Here is a small example
29560 its usage:
29562 @smallexample
29563 %:remove-outfile(-lm)
29564 @end smallexample
29566 @item @code{pass-through-libs}
29567 The @code{pass-through-libs} spec function takes any number of arguments.  It
29568 finds any @option{-l} options and any non-options ending in @file{.a} (which it
29569 assumes are the names of linker input library archive files) and returns a
29570 result containing all the found arguments each prepended by
29571 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
29572 intended to be passed to the LTO linker plugin.
29574 @smallexample
29575 %:pass-through-libs(%G %L %G)
29576 @end smallexample
29578 @item @code{print-asm-header}
29579 The @code{print-asm-header} function takes no arguments and simply
29580 prints a banner like:
29582 @smallexample
29583 Assembler options
29584 =================
29586 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
29587 @end smallexample
29589 It is used to separate compiler options from assembler options
29590 in the @option{--target-help} output.
29591 @end table
29593 @item %@{S@}
29594 Substitutes the @code{-S} switch, if that switch is given to GCC@.
29595 If that switch is not specified, this substitutes nothing.  Note that
29596 the leading dash is omitted when specifying this option, and it is
29597 automatically inserted if the substitution is performed.  Thus the spec
29598 string @samp{%@{foo@}} matches the command-line option @option{-foo}
29599 and outputs the command-line option @option{-foo}.
29601 @item %W@{S@}
29602 Like %@{@code{S}@} but mark last argument supplied within as a file to be
29603 deleted on failure.
29605 @item %@{S*@}
29606 Substitutes all the switches specified to GCC whose names start
29607 with @code{-S}, but which also take an argument.  This is used for
29608 switches like @option{-o}, @option{-D}, @option{-I}, etc.
29609 GCC considers @option{-o foo} as being
29610 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
29611 text, including the space.  Thus two arguments are generated.
29613 @item %@{S*&T*@}
29614 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
29615 (the order of @code{S} and @code{T} in the spec is not significant).
29616 There can be any number of ampersand-separated variables; for each the
29617 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
29619 @item %@{S:X@}
29620 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
29622 @item %@{!S:X@}
29623 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
29625 @item %@{S*:X@}
29626 Substitutes @code{X} if one or more switches whose names start with
29627 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
29628 once, no matter how many such switches appeared.  However, if @code{%*}
29629 appears somewhere in @code{X}, then @code{X} is substituted once
29630 for each matching switch, with the @code{%*} replaced by the part of
29631 that switch matching the @code{*}.
29633 If @code{%*} appears as the last part of a spec sequence then a space
29634 is added after the end of the last substitution.  If there is more
29635 text in the sequence, however, then a space is not generated.  This
29636 allows the @code{%*} substitution to be used as part of a larger
29637 string.  For example, a spec string like this:
29639 @smallexample
29640 %@{mcu=*:--script=%*/memory.ld@}
29641 @end smallexample
29643 @noindent
29644 when matching an option like @option{-mcu=newchip} produces:
29646 @smallexample
29647 --script=newchip/memory.ld
29648 @end smallexample
29650 @item %@{.S:X@}
29651 Substitutes @code{X}, if processing a file with suffix @code{S}.
29653 @item %@{!.S:X@}
29654 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
29656 @item %@{,S:X@}
29657 Substitutes @code{X}, if processing a file for language @code{S}.
29659 @item %@{!,S:X@}
29660 Substitutes @code{X}, if not processing a file for language @code{S}.
29662 @item %@{S|P:X@}
29663 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
29664 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
29665 @code{*} sequences as well, although they have a stronger binding than
29666 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
29667 alternatives must be starred, and only the first matching alternative
29668 is substituted.
29670 For example, a spec string like this:
29672 @smallexample
29673 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
29674 @end smallexample
29676 @noindent
29677 outputs the following command-line options from the following input
29678 command-line options:
29680 @smallexample
29681 fred.c        -foo -baz
29682 jim.d         -bar -boggle
29683 -d fred.c     -foo -baz -boggle
29684 -d jim.d      -bar -baz -boggle
29685 @end smallexample
29687 @item %@{S:X; T:Y; :D@}
29689 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
29690 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
29691 be as many clauses as you need.  This may be combined with @code{.},
29692 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
29695 @end table
29697 The switch matching text @code{S} in a @samp{%@{S@}}, @samp{%@{S:X@}}
29698 or similar construct can use a backslash to ignore the special meaning
29699 of the character following it, thus allowing literal matching of a
29700 character that is otherwise specially treated.  For example,
29701 @samp{%@{std=iso9899\:1999:X@}} substitutes @code{X} if the
29702 @option{-std=iso9899:1999} option is given.
29704 The conditional text @code{X} in a @samp{%@{S:X@}} or similar
29705 construct may contain other nested @samp{%} constructs or spaces, or
29706 even newlines.  They are processed as usual, as described above.
29707 Trailing white space in @code{X} is ignored.  White space may also
29708 appear anywhere on the left side of the colon in these constructs,
29709 except between @code{.} or @code{*} and the corresponding word.
29711 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
29712 handled specifically in these constructs.  If another value of
29713 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
29714 @option{-W} switch is found later in the command line, the earlier
29715 switch value is ignored, except with @{@code{S}*@} where @code{S} is
29716 just one letter, which passes all matching options.
29718 The character @samp{|} at the beginning of the predicate text is used to
29719 indicate that a command should be piped to the following command, but
29720 only if @option{-pipe} is specified.
29722 It is built into GCC which switches take arguments and which do not.
29723 (You might think it would be useful to generalize this to allow each
29724 compiler's spec to say which switches take arguments.  But this cannot
29725 be done in a consistent fashion.  GCC cannot even decide which input
29726 files have been specified without knowing which switches take arguments,
29727 and it must know which input files to compile in order to tell which
29728 compilers to run).
29730 GCC also knows implicitly that arguments starting in @option{-l} are to be
29731 treated as compiler output files, and passed to the linker in their
29732 proper position among the other output files.
29734 @node Environment Variables
29735 @section Environment Variables Affecting GCC
29736 @cindex environment variables
29738 @c man begin ENVIRONMENT
29739 This section describes several environment variables that affect how GCC
29740 operates.  Some of them work by specifying directories or prefixes to use
29741 when searching for various kinds of files.  Some are used to specify other
29742 aspects of the compilation environment.
29744 Note that you can also specify places to search using options such as
29745 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
29746 take precedence over places specified using environment variables, which
29747 in turn take precedence over those specified by the configuration of GCC@.
29748 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
29749 GNU Compiler Collection (GCC) Internals}.
29751 @table @env
29752 @item LANG
29753 @itemx LC_CTYPE
29754 @c @itemx LC_COLLATE
29755 @itemx LC_MESSAGES
29756 @c @itemx LC_MONETARY
29757 @c @itemx LC_NUMERIC
29758 @c @itemx LC_TIME
29759 @itemx LC_ALL
29760 @findex LANG
29761 @findex LC_CTYPE
29762 @c @findex LC_COLLATE
29763 @findex LC_MESSAGES
29764 @c @findex LC_MONETARY
29765 @c @findex LC_NUMERIC
29766 @c @findex LC_TIME
29767 @findex LC_ALL
29768 @cindex locale
29769 These environment variables control the way that GCC uses
29770 localization information which allows GCC to work with different
29771 national conventions.  GCC inspects the locale categories
29772 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
29773 so.  These locale categories can be set to any value supported by your
29774 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
29775 Kingdom encoded in UTF-8.
29777 The @env{LC_CTYPE} environment variable specifies character
29778 classification.  GCC uses it to determine the character boundaries in
29779 a string; this is needed for some multibyte encodings that contain quote
29780 and escape characters that are otherwise interpreted as a string
29781 end or escape.
29783 The @env{LC_MESSAGES} environment variable specifies the language to
29784 use in diagnostic messages.
29786 If the @env{LC_ALL} environment variable is set, it overrides the value
29787 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
29788 and @env{LC_MESSAGES} default to the value of the @env{LANG}
29789 environment variable.  If none of these variables are set, GCC
29790 defaults to traditional C English behavior.
29792 @item TMPDIR
29793 @findex TMPDIR
29794 If @env{TMPDIR} is set, it specifies the directory to use for temporary
29795 files.  GCC uses temporary files to hold the output of one stage of
29796 compilation which is to be used as input to the next stage: for example,
29797 the output of the preprocessor, which is the input to the compiler
29798 proper.
29800 @item GCC_COMPARE_DEBUG
29801 @findex GCC_COMPARE_DEBUG
29802 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
29803 @option{-fcompare-debug} to the compiler driver.  See the documentation
29804 of this option for more details.
29806 @item GCC_EXEC_PREFIX
29807 @findex GCC_EXEC_PREFIX
29808 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
29809 names of the subprograms executed by the compiler.  No slash is added
29810 when this prefix is combined with the name of a subprogram, but you can
29811 specify a prefix that ends with a slash if you wish.
29813 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
29814 an appropriate prefix to use based on the pathname it is invoked with.
29816 If GCC cannot find the subprogram using the specified prefix, it
29817 tries looking in the usual places for the subprogram.
29819 The default value of @env{GCC_EXEC_PREFIX} is
29820 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
29821 the installed compiler. In many cases @var{prefix} is the value
29822 of @code{prefix} when you ran the @file{configure} script.
29824 Other prefixes specified with @option{-B} take precedence over this prefix.
29826 This prefix is also used for finding files such as @file{crt0.o} that are
29827 used for linking.
29829 In addition, the prefix is used in an unusual way in finding the
29830 directories to search for header files.  For each of the standard
29831 directories whose name normally begins with @samp{/usr/local/lib/gcc}
29832 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
29833 replacing that beginning with the specified prefix to produce an
29834 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
29835 @file{foo/bar} just before it searches the standard directory 
29836 @file{/usr/local/lib/bar}.
29837 If a standard directory begins with the configured
29838 @var{prefix} then the value of @var{prefix} is replaced by
29839 @env{GCC_EXEC_PREFIX} when looking for header files.
29841 @item COMPILER_PATH
29842 @findex COMPILER_PATH
29843 The value of @env{COMPILER_PATH} is a colon-separated list of
29844 directories, much like @env{PATH}.  GCC tries the directories thus
29845 specified when searching for subprograms, if it cannot find the
29846 subprograms using @env{GCC_EXEC_PREFIX}.
29848 @item LIBRARY_PATH
29849 @findex LIBRARY_PATH
29850 The value of @env{LIBRARY_PATH} is a colon-separated list of
29851 directories, much like @env{PATH}.  When configured as a native compiler,
29852 GCC tries the directories thus specified when searching for special
29853 linker files, if it cannot find them using @env{GCC_EXEC_PREFIX}.  Linking
29854 using GCC also uses these directories when searching for ordinary
29855 libraries for the @option{-l} option (but directories specified with
29856 @option{-L} come first).
29858 @item LANG
29859 @findex LANG
29860 @cindex locale definition
29861 This variable is used to pass locale information to the compiler.  One way in
29862 which this information is used is to determine the character set to be used
29863 when character literals, string literals and comments are parsed in C and C++.
29864 When the compiler is configured to allow multibyte characters,
29865 the following values for @env{LANG} are recognized:
29867 @table @samp
29868 @item C-JIS
29869 Recognize JIS characters.
29870 @item C-SJIS
29871 Recognize SJIS characters.
29872 @item C-EUCJP
29873 Recognize EUCJP characters.
29874 @end table
29876 If @env{LANG} is not defined, or if it has some other value, then the
29877 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
29878 recognize and translate multibyte characters.
29879 @end table
29881 @noindent
29882 Some additional environment variables affect the behavior of the
29883 preprocessor.
29885 @include cppenv.texi
29887 @c man end
29889 @node Precompiled Headers
29890 @section Using Precompiled Headers
29891 @cindex precompiled headers
29892 @cindex speed of compilation
29894 Often large projects have many header files that are included in every
29895 source file.  The time the compiler takes to process these header files
29896 over and over again can account for nearly all of the time required to
29897 build the project.  To make builds faster, GCC allows you to
29898 @dfn{precompile} a header file.
29900 To create a precompiled header file, simply compile it as you would any
29901 other file, if necessary using the @option{-x} option to make the driver
29902 treat it as a C or C++ header file.  You may want to use a
29903 tool like @command{make} to keep the precompiled header up-to-date when
29904 the headers it contains change.
29906 A precompiled header file is searched for when @code{#include} is
29907 seen in the compilation.  As it searches for the included file
29908 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
29909 compiler looks for a precompiled header in each directory just before it
29910 looks for the include file in that directory.  The name searched for is
29911 the name specified in the @code{#include} with @samp{.gch} appended.  If
29912 the precompiled header file cannot be used, it is ignored.
29914 For instance, if you have @code{#include "all.h"}, and you have
29915 @file{all.h.gch} in the same directory as @file{all.h}, then the
29916 precompiled header file is used if possible, and the original
29917 header is used otherwise.
29919 Alternatively, you might decide to put the precompiled header file in a
29920 directory and use @option{-I} to ensure that directory is searched
29921 before (or instead of) the directory containing the original header.
29922 Then, if you want to check that the precompiled header file is always
29923 used, you can put a file of the same name as the original header in this
29924 directory containing an @code{#error} command.
29926 This also works with @option{-include}.  So yet another way to use
29927 precompiled headers, good for projects not designed with precompiled
29928 header files in mind, is to simply take most of the header files used by
29929 a project, include them from another header file, precompile that header
29930 file, and @option{-include} the precompiled header.  If the header files
29931 have guards against multiple inclusion, they are skipped because
29932 they've already been included (in the precompiled header).
29934 If you need to precompile the same header file for different
29935 languages, targets, or compiler options, you can instead make a
29936 @emph{directory} named like @file{all.h.gch}, and put each precompiled
29937 header in the directory, perhaps using @option{-o}.  It doesn't matter
29938 what you call the files in the directory; every precompiled header in
29939 the directory is considered.  The first precompiled header
29940 encountered in the directory that is valid for this compilation is
29941 used; they're searched in no particular order.
29943 There are many other possibilities, limited only by your imagination,
29944 good sense, and the constraints of your build system.
29946 A precompiled header file can be used only when these conditions apply:
29948 @itemize
29949 @item
29950 Only one precompiled header can be used in a particular compilation.
29952 @item
29953 A precompiled header cannot be used once the first C token is seen.  You
29954 can have preprocessor directives before a precompiled header; you cannot
29955 include a precompiled header from inside another header.
29957 @item
29958 The precompiled header file must be produced for the same language as
29959 the current compilation.  You cannot use a C precompiled header for a C++
29960 compilation.
29962 @item
29963 The precompiled header file must have been produced by the same compiler
29964 binary as the current compilation is using.
29966 @item
29967 Any macros defined before the precompiled header is included must
29968 either be defined in the same way as when the precompiled header was
29969 generated, or must not affect the precompiled header, which usually
29970 means that they don't appear in the precompiled header at all.
29972 The @option{-D} option is one way to define a macro before a
29973 precompiled header is included; using a @code{#define} can also do it.
29974 There are also some options that define macros implicitly, like
29975 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
29976 defined this way.
29978 @item If debugging information is output when using the precompiled
29979 header, using @option{-g} or similar, the same kind of debugging information
29980 must have been output when building the precompiled header.  However,
29981 a precompiled header built using @option{-g} can be used in a compilation
29982 when no debugging information is being output.
29984 @item The same @option{-m} options must generally be used when building
29985 and using the precompiled header.  @xref{Submodel Options},
29986 for any cases where this rule is relaxed.
29988 @item Each of the following options must be the same when building and using
29989 the precompiled header:
29991 @gccoptlist{-fexceptions}
29993 @item
29994 Some other command-line options starting with @option{-f},
29995 @option{-p}, or @option{-O} must be defined in the same way as when
29996 the precompiled header was generated.  At present, it's not clear
29997 which options are safe to change and which are not; the safest choice
29998 is to use exactly the same options when generating and using the
29999 precompiled header.  The following are known to be safe:
30001 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
30002 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
30003 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
30004 -pedantic-errors}
30006 @end itemize
30008 For all of these except the last, the compiler automatically
30009 ignores the precompiled header if the conditions aren't met.  If you
30010 find an option combination that doesn't work and doesn't cause the
30011 precompiled header to be ignored, please consider filing a bug report,
30012 see @ref{Bugs}.
30014 If you do use differing options when generating and using the
30015 precompiled header, the actual behavior is a mixture of the
30016 behavior for the options.  For instance, if you use @option{-g} to
30017 generate the precompiled header but not when using it, you may or may
30018 not get debugging information for routines in the precompiled header.