2015-03-21 Sandra Loosemore <sandra@codesourcery.com>
[official-gcc.git] / gcc / doc / invoke.texi
blob5c6e410aa4a7a8974e655027f3dec92e2619e5b5
1 @c Copyright (C) 1988-2015 Free Software Foundation, Inc.
2 @c This is part of the GCC manual.
3 @c For copying conditions, see the file gcc.texi.
5 @ignore
6 @c man begin INCLUDE
7 @include gcc-vers.texi
8 @c man end
10 @c man begin COPYRIGHT
11 Copyright @copyright{} 1988-2015 Free Software Foundation, Inc.
13 Permission is granted to copy, distribute and/or modify this document
14 under the terms of the GNU Free Documentation License, Version 1.3 or
15 any later version published by the Free Software Foundation; with the
16 Invariant Sections being ``GNU General Public License'' and ``Funding
17 Free Software'', the Front-Cover texts being (a) (see below), and with
18 the Back-Cover Texts being (b) (see below).  A copy of the license is
19 included in the gfdl(7) man page.
21 (a) The FSF's Front-Cover Text is:
23      A GNU Manual
25 (b) The FSF's Back-Cover Text is:
27      You have freedom to copy and modify this GNU Manual, like GNU
28      software.  Copies published by the Free Software Foundation raise
29      funds for GNU development.
30 @c man end
31 @c Set file name and title for the man page.
32 @setfilename gcc
33 @settitle GNU project C and C++ compiler
34 @c man begin SYNOPSIS
35 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
36     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
37     [@option{-W}@var{warn}@dots{}] [@option{-Wpedantic}]
38     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
39     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
40     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
41     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
43 Only the most useful options are listed here; see below for the
44 remainder.  @command{g++} accepts mostly the same options as @command{gcc}.
45 @c man end
46 @c man begin SEEALSO
47 gpl(7), gfdl(7), fsf-funding(7),
48 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
49 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
50 @file{ld}, @file{binutils} and @file{gdb}.
51 @c man end
52 @c man begin BUGS
53 For instructions on reporting bugs, see
54 @w{@value{BUGURL}}.
55 @c man end
56 @c man begin AUTHOR
57 See the Info entry for @command{gcc}, or
58 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
59 for contributors to GCC@.
60 @c man end
61 @end ignore
63 @node Invoking GCC
64 @chapter GCC Command Options
65 @cindex GCC command options
66 @cindex command options
67 @cindex options, GCC command
69 @c man begin DESCRIPTION
70 When you invoke GCC, it normally does preprocessing, compilation,
71 assembly and linking.  The ``overall options'' allow you to stop this
72 process at an intermediate stage.  For example, the @option{-c} option
73 says not to run the linker.  Then the output consists of object files
74 output by the assembler.
76 Other options are passed on to one stage of processing.  Some options
77 control the preprocessor and others the compiler itself.  Yet other
78 options control the assembler and linker; most of these are not
79 documented here, since you rarely need to use any of them.
81 @cindex C compilation options
82 Most of the command-line options that you can use with GCC are useful
83 for C programs; when an option is only useful with another language
84 (usually C++), the explanation says so explicitly.  If the description
85 for a particular option does not mention a source language, you can use
86 that option with all supported languages.
88 @cindex C++ compilation options
89 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
90 options for compiling C++ programs.
92 @cindex grouping options
93 @cindex options, grouping
94 The @command{gcc} program accepts options and file names as operands.  Many
95 options have multi-letter names; therefore multiple single-letter options
96 may @emph{not} be grouped: @option{-dv} is very different from @w{@samp{-d
97 -v}}.
99 @cindex order of options
100 @cindex options, order
101 You can mix options and other arguments.  For the most part, the order
102 you use doesn't matter.  Order does matter when you use several
103 options of the same kind; for example, if you specify @option{-L} more
104 than once, the directories are searched in the order specified.  Also,
105 the placement of the @option{-l} option is significant.
107 Many options have long names starting with @samp{-f} or with
108 @samp{-W}---for example,
109 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
110 these have both positive and negative forms; the negative form of
111 @option{-ffoo} is @option{-fno-foo}.  This manual documents
112 only one of these two forms, whichever one is not the default.
114 @c man end
116 @xref{Option Index}, for an index to GCC's options.
118 @menu
119 * Option Summary::      Brief list of all options, without explanations.
120 * Overall Options::     Controlling the kind of output:
121                         an executable, object files, assembler files,
122                         or preprocessed source.
123 * Invoking G++::        Compiling C++ programs.
124 * C Dialect Options::   Controlling the variant of C language compiled.
125 * C++ Dialect Options:: Variations on C++.
126 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
127                         and Objective-C++.
128 * Language Independent Options:: Controlling how diagnostics should be
129                         formatted.
130 * Warning Options::     How picky should the compiler be?
131 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
132 * Optimize Options::    How much optimization?
133 * Preprocessor Options:: Controlling header files and macro definitions.
134                          Also, getting dependency information for Make.
135 * Assembler Options::   Passing options to the assembler.
136 * Link Options::        Specifying libraries and so on.
137 * Directory Options::   Where to find header files and libraries.
138                         Where to find the compiler executable files.
139 * Spec Files::          How to pass switches to sub-processes.
140 * Target Options::      Running a cross-compiler, or an old version of GCC.
141 * Submodel Options::    Specifying minor hardware or convention variations,
142                         such as 68010 vs 68020.
143 * Code Gen Options::    Specifying conventions for function calls, data layout
144                         and register usage.
145 * Environment Variables:: Env vars that affect GCC.
146 * Precompiled Headers:: Compiling a header once, and using it many times.
147 @end menu
149 @c man begin OPTIONS
151 @node Option Summary
152 @section Option Summary
154 Here is a summary of all the options, grouped by type.  Explanations are
155 in the following sections.
157 @table @emph
158 @item Overall Options
159 @xref{Overall Options,,Options Controlling the Kind of Output}.
160 @gccoptlist{-c  -S  -E  -o @var{file}  -no-canonical-prefixes  @gol
161 -pipe  -pass-exit-codes  @gol
162 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  --target-help  @gol
163 --version -wrapper @@@var{file} -fplugin=@var{file} -fplugin-arg-@var{name}=@var{arg}  @gol
164 -fdump-ada-spec@r{[}-slim@r{]} -fada-spec-parent=@var{unit} -fdump-go-spec=@var{file}}
166 @item C Language Options
167 @xref{C Dialect Options,,Options Controlling C Dialect}.
168 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
169 -aux-info @var{filename} -fallow-parameterless-variadic-functions @gol
170 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
171 -fhosted  -ffreestanding -fopenacc -fopenmp -fopenmp-simd @gol
172 -fms-extensions -fplan9-extensions -trigraphs -traditional -traditional-cpp @gol
173 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
174 -fsigned-bitfields  -fsigned-char @gol
175 -funsigned-bitfields  -funsigned-char}
177 @item C++ Language Options
178 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
179 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
180 -fconstexpr-depth=@var{n}  -ffriend-injection @gol
181 -fno-elide-constructors @gol
182 -fno-enforce-eh-specs @gol
183 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
184 -fno-implicit-templates @gol
185 -fno-implicit-inline-templates @gol
186 -fno-implement-inlines  -fms-extensions @gol
187 -fno-nonansi-builtins  -fnothrow-opt  -fno-operator-names @gol
188 -fno-optional-diags  -fpermissive @gol
189 -fno-pretty-templates @gol
190 -frepo  -fno-rtti -fsized-deallocation @gol
191 -fstats  -ftemplate-backtrace-limit=@var{n} @gol
192 -ftemplate-depth=@var{n} @gol
193 -fno-threadsafe-statics  -fuse-cxa-atexit @gol
194 -fno-weak  -nostdinc++ @gol
195 -fvisibility-inlines-hidden @gol
196 -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]} @gol
197 -fvtv-counts -fvtv-debug @gol
198 -fvisibility-ms-compat @gol
199 -fext-numeric-literals @gol
200 -Wabi=@var{n}  -Wabi-tag  -Wconversion-null  -Wctor-dtor-privacy @gol
201 -Wdelete-non-virtual-dtor -Wliteral-suffix -Wnarrowing @gol
202 -Wnoexcept -Wnon-virtual-dtor  -Wreorder @gol
203 -Weffc++  -Wstrict-null-sentinel @gol
204 -Wno-non-template-friend  -Wold-style-cast @gol
205 -Woverloaded-virtual  -Wno-pmf-conversions @gol
206 -Wsign-promo}
208 @item Objective-C and Objective-C++ Language Options
209 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
210 Objective-C and Objective-C++ Dialects}.
211 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
212 -fgnu-runtime  -fnext-runtime @gol
213 -fno-nil-receivers @gol
214 -fobjc-abi-version=@var{n} @gol
215 -fobjc-call-cxx-cdtors @gol
216 -fobjc-direct-dispatch @gol
217 -fobjc-exceptions @gol
218 -fobjc-gc @gol
219 -fobjc-nilcheck @gol
220 -fobjc-std=objc1 @gol
221 -fno-local-ivars @gol
222 -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]} @gol
223 -freplace-objc-classes @gol
224 -fzero-link @gol
225 -gen-decls @gol
226 -Wassign-intercept @gol
227 -Wno-protocol  -Wselector @gol
228 -Wstrict-selector-match @gol
229 -Wundeclared-selector}
231 @item Language Independent Options
232 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
233 @gccoptlist{-fmessage-length=@var{n}  @gol
234 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
235 -fdiagnostics-color=@r{[}auto@r{|}never@r{|}always@r{]}  @gol
236 -fno-diagnostics-show-option -fno-diagnostics-show-caret}
238 @item Warning Options
239 @xref{Warning Options,,Options to Request or Suppress Warnings}.
240 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -Wpedantic @gol
241 -pedantic-errors @gol
242 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  @gol
243 -Waggressive-loop-optimizations -Warray-bounds -Warray-bounds=@var{n} @gol
244 -Wbool-compare @gol
245 -Wno-attributes -Wno-builtin-macro-redefined @gol
246 -Wc90-c99-compat -Wc99-c11-compat @gol
247 -Wc++-compat -Wc++11-compat -Wc++14-compat -Wcast-align  -Wcast-qual  @gol
248 -Wchar-subscripts -Wclobbered  -Wcomment -Wconditionally-supported  @gol
249 -Wconversion -Wcoverage-mismatch -Wdate-time -Wdelete-incomplete -Wno-cpp  @gol
250 -Wno-deprecated -Wno-deprecated-declarations -Wno-designated-init @gol
251 -Wdisabled-optimization @gol
252 -Wno-discarded-qualifiers -Wno-discarded-array-qualifiers @gol
253 -Wno-div-by-zero -Wdouble-promotion -Wempty-body  -Wenum-compare @gol
254 -Wno-endif-labels -Werror  -Werror=* @gol
255 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
256 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
257 -Wformat-security  -Wformat-signedness  -Wformat-y2k @gol
258 -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol
259 -Wignored-qualifiers  -Wincompatible-pointer-types @gol
260 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
261 -Winit-self  -Winline  -Wno-int-conversion @gol
262 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
263 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
264 -Wlogical-op -Wlogical-not-parentheses -Wlong-long @gol
265 -Wmain -Wmaybe-uninitialized -Wmemset-transposed-args -Wmissing-braces @gol
266 -Wmissing-field-initializers -Wmissing-include-dirs @gol
267 -Wno-multichar  -Wnonnull  -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]} @gol
268  -Wodr  -Wno-overflow  -Wopenmp-simd @gol
269 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
270 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
271 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
272 -Wredundant-decls  -Wno-return-local-addr @gol
273 -Wreturn-type  -Wsequence-point  -Wshadow  -Wno-shadow-ivar @gol
274 -Wshift-count-negative -Wshift-count-overflow @gol
275 -Wsign-compare  -Wsign-conversion -Wfloat-conversion @gol
276 -Wsizeof-pointer-memaccess  -Wsizeof-array-argument @gol
277 -Wstack-protector -Wstack-usage=@var{len} -Wstrict-aliasing @gol
278 -Wstrict-aliasing=n @gol -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
279 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]} @gol
280 -Wsuggest-final-types @gol -Wsuggest-final-methods @gol -Wsuggest-override @gol
281 -Wmissing-format-attribute @gol
282 -Wswitch  -Wswitch-default  -Wswitch-enum -Wswitch-bool -Wsync-nand @gol
283 -Wsystem-headers  -Wtrampolines  -Wtrigraphs  -Wtype-limits  -Wundef @gol
284 -Wuninitialized  -Wunknown-pragmas  -Wno-pragmas @gol
285 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
286 -Wunused-label  -Wunused-local-typedefs -Wunused-parameter @gol
287 -Wno-unused-result -Wunused-value @gol -Wunused-variable @gol
288 -Wunused-but-set-parameter -Wunused-but-set-variable @gol
289 -Wuseless-cast -Wvariadic-macros -Wvector-operation-performance @gol
290 -Wvla -Wvolatile-register-var  -Wwrite-strings @gol
291 -Wzero-as-null-pointer-constant}
293 @item C and Objective-C-only Warning Options
294 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
295 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
296 -Wold-style-declaration  -Wold-style-definition @gol
297 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
298 -Wdeclaration-after-statement -Wpointer-sign}
300 @item Debugging Options
301 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
302 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
303 -fsanitize=@var{style} -fsanitize-recover -fsanitize-recover=@var{style} @gol
304 -fasan-shadow-offset=@var{number} -fsanitize-undefined-trap-on-error @gol
305 -fcheck-pointer-bounds -fchkp-check-incomplete-type @gol
306 -fchkp-first-field-has-own-bounds -fchkp-narrow-bounds @gol
307 -fchkp-narrow-to-innermost-array -fchkp-optimize @gol
308 -fchkp-use-fast-string-functions -fchkp-use-nochk-string-functions @gol
309 -fchkp-use-static-bounds -fchkp-use-static-const-bounds @gol
310 -fchkp-treat-zero-dynamic-size-as-infinite -fchkp-check-read @gol
311 -fchkp-check-read -fchkp-check-write -fchkp-store-bounds @gol
312 -fchkp-instrument-calls -fchkp-instrument-marked-only @gol
313 -fchkp-use-wrappers @gol
314 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
315 -fdisable-ipa-@var{pass_name} @gol
316 -fdisable-rtl-@var{pass_name} @gol
317 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
318 -fdisable-tree-@var{pass_name} @gol
319 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
320 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
321 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
322 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
323 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
324 -fdump-passes @gol
325 -fdump-statistics @gol
326 -fdump-tree-all @gol
327 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
328 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
329 -fdump-tree-cfg -fdump-tree-alias @gol
330 -fdump-tree-ch @gol
331 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
332 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
333 -fdump-tree-gimple@r{[}-raw@r{]} @gol
334 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
335 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
336 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
337 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
338 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
339 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
340 -fdump-tree-nrv -fdump-tree-vect @gol
341 -fdump-tree-sink @gol
342 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
343 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
344 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
345 -fdump-tree-vtable-verify @gol
346 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
347 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
348 -fdump-final-insns=@var{file} @gol
349 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
350 -feliminate-dwarf2-dups -fno-eliminate-unused-debug-types @gol
351 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
352 -fenable-@var{kind}-@var{pass} @gol
353 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
354 -fdebug-types-section -fmem-report-wpa @gol
355 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
356 -fopt-info @gol
357 -fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
358 -frandom-seed=@var{number} -fsched-verbose=@var{n} @gol
359 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
360 -fstack-usage  -ftest-coverage  -ftime-report -fvar-tracking @gol
361 -fvar-tracking-assignments  -fvar-tracking-assignments-toggle @gol
362 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
363 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
364 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
365 -gvms  -gxcoff  -gxcoff+ -gz@r{[}=@var{type}@r{]} @gol
366 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
367 -fdebug-prefix-map=@var{old}=@var{new} @gol
368 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
369 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
370 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
371 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
372 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
373 -print-sysroot -print-sysroot-headers-suffix @gol
374 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
376 @item Optimization Options
377 @xref{Optimize Options,,Options that Control Optimization}.
378 @gccoptlist{-faggressive-loop-optimizations -falign-functions[=@var{n}] @gol
379 -falign-jumps[=@var{n}] @gol
380 -falign-labels[=@var{n}] -falign-loops[=@var{n}] @gol
381 -fassociative-math -fauto-profile -fauto-profile[=@var{path}] @gol
382 -fauto-inc-dec -fbranch-probabilities @gol
383 -fbranch-target-load-optimize -fbranch-target-load-optimize2 @gol
384 -fbtr-bb-exclusive -fcaller-saves @gol
385 -fcheck-data-deps -fcombine-stack-adjustments -fconserve-stack @gol
386 -fcompare-elim -fcprop-registers -fcrossjumping @gol
387 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
388 -fcx-limited-range @gol
389 -fdata-sections -fdce -fdelayed-branch @gol
390 -fdelete-null-pointer-checks -fdevirtualize -fdevirtualize-speculatively @gol
391 -fdevirtualize-at-ltrans -fdse @gol
392 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects @gol
393 -ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
394 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
395 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
396 -fgcse-sm -fhoist-adjacent-loads -fif-conversion @gol
397 -fif-conversion2 -findirect-inlining @gol
398 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
399 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-cp-alignment @gol
400 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference -fipa-icf @gol
401 -fira-algorithm=@var{algorithm} @gol
402 -fira-region=@var{region} -fira-hoist-pressure @gol
403 -fira-loop-pressure -fno-ira-share-save-slots @gol
404 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
405 -fisolate-erroneous-paths-dereference -fisolate-erroneous-paths-attribute @gol
406 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
407 -flive-range-shrinkage @gol
408 -floop-block -floop-interchange -floop-strip-mine @gol  
409 -floop-unroll-and-jam -floop-nest-optimize @gol
410 -floop-parallelize-all -flra-remat -flto -flto-compression-level @gol
411 -flto-partition=@var{alg} -flto-report -flto-report-wpa -fmerge-all-constants @gol
412 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
413 -fmove-loop-invariants -fno-branch-count-reg @gol
414 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
415 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
416 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
417 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
418 -fomit-frame-pointer -foptimize-sibling-calls @gol
419 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
420 -fprefetch-loop-arrays -fprofile-report @gol
421 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
422 -fprofile-generate=@var{path} @gol
423 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
424 -fprofile-reorder-functions @gol
425 -freciprocal-math -free -frename-registers -freorder-blocks @gol
426 -freorder-blocks-and-partition -freorder-functions @gol
427 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
428 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
429 -fsched-spec-load -fsched-spec-load-dangerous @gol
430 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
431 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
432 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
433 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
434 -fschedule-fusion @gol
435 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
436 -fselective-scheduling -fselective-scheduling2 @gol
437 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
438 -fsemantic-interposition @gol
439 -fshrink-wrap -fsignaling-nans -fsingle-precision-constant @gol
440 -fsplit-ivs-in-unroller -fsplit-wide-types -fssa-phiopt @gol
441 -fstack-protector -fstack-protector-all -fstack-protector-strong @gol
442 -fstack-protector-explicit -fstdarg-opt -fstrict-aliasing @gol
443 -fstrict-overflow -fthread-jumps -ftracer -ftree-bit-ccp @gol
444 -ftree-builtin-call-dce -ftree-ccp -ftree-ch @gol
445 -ftree-coalesce-inline-vars -ftree-coalesce-vars -ftree-copy-prop @gol
446 -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
447 -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
448 -ftree-loop-if-convert-stores -ftree-loop-im @gol
449 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
450 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
451 -ftree-loop-vectorize @gol
452 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-partial-pre -ftree-pta @gol
453 -ftree-reassoc -ftree-sink -ftree-slsr -ftree-sra @gol
454 -ftree-switch-conversion -ftree-tail-merge -ftree-ter @gol
455 -ftree-vectorize -ftree-vrp @gol
456 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
457 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
458 -fipa-ra -fvariable-expansion-in-unroller -fvect-cost-model -fvpt @gol
459 -fweb -fwhole-program -fwpa -fuse-linker-plugin @gol
460 --param @var{name}=@var{value}
461 -O  -O0  -O1  -O2  -O3  -Os -Ofast -Og}
463 @item Preprocessor Options
464 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
465 @gccoptlist{-A@var{question}=@var{answer} @gol
466 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
467 -C  -dD  -dI  -dM  -dN @gol
468 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
469 -idirafter @var{dir} @gol
470 -include @var{file}  -imacros @var{file} @gol
471 -iprefix @var{file}  -iwithprefix @var{dir} @gol
472 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
473 -imultilib @var{dir} -isysroot @var{dir} @gol
474 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
475 -P  -fdebug-cpp -ftrack-macro-expansion -fworking-directory @gol
476 -remap -trigraphs  -undef  -U@var{macro}  @gol
477 -Wp,@var{option} -Xpreprocessor @var{option} -no-integrated-cpp}
479 @item Assembler Option
480 @xref{Assembler Options,,Passing Options to the Assembler}.
481 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
483 @item Linker Options
484 @xref{Link Options,,Options for Linking}.
485 @gccoptlist{@var{object-file-name}  -fuse-ld=@var{linker} -l@var{library} @gol
486 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
487 -s  -static -static-libgcc -static-libstdc++ @gol
488 -static-libasan -static-libtsan -static-liblsan -static-libubsan @gol
489 -static-libmpx -static-libmpxwrappers @gol
490 -shared -shared-libgcc  -symbolic @gol
491 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
492 -u @var{symbol} -z @var{keyword}}
494 @item Directory Options
495 @xref{Directory Options,,Options for Directory Search}.
496 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
497 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol
498 --sysroot=@var{dir} --no-sysroot-suffix}
500 @item Machine Dependent Options
501 @xref{Submodel Options,,Hardware Models and Configurations}.
502 @c This list is ordered alphanumerically by subsection name.
503 @c Try and put the significant identifier (CPU or system) first,
504 @c so users have a clue at guessing where the ones they want will be.
506 @emph{AArch64 Options}
507 @gccoptlist{-mabi=@var{name}  -mbig-endian  -mlittle-endian @gol
508 -mgeneral-regs-only @gol
509 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
510 -mstrict-align @gol
511 -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
512 -mtls-dialect=desc  -mtls-dialect=traditional @gol
513 -mfix-cortex-a53-835769  -mno-fix-cortex-a53-835769 @gol
514 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}}
516 @emph{Adapteva Epiphany Options}
517 @gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs @gol
518 -mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf @gol
519 -msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} @gol
520 -mround-nearest -mlong-calls -mshort-calls -msmall16 @gol
521 -mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} @gol
522 -msplit-vecmove-early -m1reg-@var{reg}}
524 @emph{ARC Options}
525 @gccoptlist{-mbarrel-shifter @gol
526 -mcpu=@var{cpu} -mA6 -mARC600 -mA7 -mARC700 @gol
527 -mdpfp -mdpfp-compact -mdpfp-fast -mno-dpfp-lrsr @gol
528 -mea -mno-mpy -mmul32x16 -mmul64 @gol
529 -mnorm -mspfp -mspfp-compact -mspfp-fast -msimd -msoft-float -mswap @gol
530 -mcrc -mdsp-packa -mdvbf -mlock -mmac-d16 -mmac-24 -mrtsc -mswape @gol
531 -mtelephony -mxy -misize -mannotate-align -marclinux -marclinux_prof @gol
532 -mepilogue-cfi -mlong-calls -mmedium-calls -msdata @gol
533 -mucb-mcount -mvolatile-cache @gol
534 -malign-call -mauto-modify-reg -mbbit-peephole -mno-brcc @gol
535 -mcase-vector-pcrel -mcompact-casesi -mno-cond-exec -mearly-cbranchsi @gol
536 -mexpand-adddi -mindexed-loads -mlra -mlra-priority-none @gol
537 -mlra-priority-compact mlra-priority-noncompact -mno-millicode @gol
538 -mmixed-code -mq-class -mRcq -mRcw -msize-level=@var{level} @gol
539 -mtune=@var{cpu} -mmultcost=@var{num} -munalign-prob-threshold=@var{probability}}
541 @emph{ARM Options}
542 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
543 -mabi=@var{name} @gol
544 -mapcs-stack-check  -mno-apcs-stack-check @gol
545 -mapcs-float  -mno-apcs-float @gol
546 -mapcs-reentrant  -mno-apcs-reentrant @gol
547 -msched-prolog  -mno-sched-prolog @gol
548 -mlittle-endian  -mbig-endian @gol
549 -mfloat-abi=@var{name} @gol
550 -mfp16-format=@var{name}
551 -mthumb-interwork  -mno-thumb-interwork @gol
552 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
553 -mstructure-size-boundary=@var{n} @gol
554 -mabort-on-noreturn @gol
555 -mlong-calls  -mno-long-calls @gol
556 -msingle-pic-base  -mno-single-pic-base @gol
557 -mpic-register=@var{reg} @gol
558 -mnop-fun-dllimport @gol
559 -mpoke-function-name @gol
560 -mthumb  -marm @gol
561 -mtpcs-frame  -mtpcs-leaf-frame @gol
562 -mcaller-super-interworking  -mcallee-super-interworking @gol
563 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
564 -mword-relocations @gol
565 -mfix-cortex-m3-ldrd @gol
566 -munaligned-access @gol
567 -mneon-for-64bits @gol
568 -mslow-flash-data @gol
569 -masm-syntax-unified @gol
570 -mrestrict-it}
572 @emph{AVR Options}
573 @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
574 -mcall-prologues -mint8 -mn_flash=@var{size} -mno-interrupts @gol
575 -mrelax -mrmw -mstrict-X -mtiny-stack -nodevicelib -Waddr-space-convert}
577 @emph{Blackfin Options}
578 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
579 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
580 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
581 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
582 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
583 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
584 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
585 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
586 -micplb}
588 @emph{C6X Options}
589 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
590 -msim -msdata=@var{sdata-type}}
592 @emph{CRIS Options}
593 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
594 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
595 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
596 -mstack-align  -mdata-align  -mconst-align @gol
597 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
598 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
599 -mmul-bug-workaround  -mno-mul-bug-workaround}
601 @emph{CR16 Options}
602 @gccoptlist{-mmac @gol
603 -mcr16cplus -mcr16c @gol
604 -msim -mint32 -mbit-ops
605 -mdata-model=@var{model}}
607 @emph{Darwin Options}
608 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
609 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
610 -client_name  -compatibility_version  -current_version @gol
611 -dead_strip @gol
612 -dependency-file  -dylib_file  -dylinker_install_name @gol
613 -dynamic  -dynamiclib  -exported_symbols_list @gol
614 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
615 -force_flat_namespace  -headerpad_max_install_names @gol
616 -iframework @gol
617 -image_base  -init  -install_name  -keep_private_externs @gol
618 -multi_module  -multiply_defined  -multiply_defined_unused @gol
619 -noall_load   -no_dead_strip_inits_and_terms @gol
620 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
621 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
622 -private_bundle  -read_only_relocs  -sectalign @gol
623 -sectobjectsymbols  -whyload  -seg1addr @gol
624 -sectcreate  -sectobjectsymbols  -sectorder @gol
625 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
626 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
627 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
628 -single_module  -static  -sub_library  -sub_umbrella @gol
629 -twolevel_namespace  -umbrella  -undefined @gol
630 -unexported_symbols_list  -weak_reference_mismatches @gol
631 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
632 -mkernel -mone-byte-bool}
634 @emph{DEC Alpha Options}
635 @gccoptlist{-mno-fp-regs  -msoft-float @gol
636 -mieee  -mieee-with-inexact  -mieee-conformant @gol
637 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
638 -mtrap-precision=@var{mode}  -mbuild-constants @gol
639 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
640 -mbwx  -mmax  -mfix  -mcix @gol
641 -mfloat-vax  -mfloat-ieee @gol
642 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
643 -msmall-text  -mlarge-text @gol
644 -mmemory-latency=@var{time}}
646 @emph{FR30 Options}
647 @gccoptlist{-msmall-model -mno-lsim}
649 @emph{FRV Options}
650 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
651 -mhard-float  -msoft-float @gol
652 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
653 -mdouble  -mno-double @gol
654 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
655 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
656 -mlinked-fp  -mlong-calls  -malign-labels @gol
657 -mlibrary-pic  -macc-4  -macc-8 @gol
658 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
659 -moptimize-membar -mno-optimize-membar @gol
660 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
661 -mvliw-branch  -mno-vliw-branch @gol
662 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
663 -mno-nested-cond-exec  -mtomcat-stats @gol
664 -mTLS -mtls @gol
665 -mcpu=@var{cpu}}
667 @emph{GNU/Linux Options}
668 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
669 -tno-android-cc -tno-android-ld}
671 @emph{H8/300 Options}
672 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr -mno-exr  -mint32  -malign-300}
674 @emph{HPPA Options}
675 @gccoptlist{-march=@var{architecture-type} @gol
676 -mdisable-fpregs  -mdisable-indexing @gol
677 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
678 -mfixed-range=@var{register-range} @gol
679 -mjump-in-delay -mlinker-opt -mlong-calls @gol
680 -mlong-load-store  -mno-disable-fpregs @gol
681 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
682 -mno-jump-in-delay  -mno-long-load-store @gol
683 -mno-portable-runtime  -mno-soft-float @gol
684 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
685 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
686 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
687 -munix=@var{unix-std}  -nolibdld  -static  -threads}
689 @emph{IA-64 Options}
690 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
691 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
692 -mconstant-gp  -mauto-pic  -mfused-madd @gol
693 -minline-float-divide-min-latency @gol
694 -minline-float-divide-max-throughput @gol
695 -mno-inline-float-divide @gol
696 -minline-int-divide-min-latency @gol
697 -minline-int-divide-max-throughput  @gol
698 -mno-inline-int-divide @gol
699 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
700 -mno-inline-sqrt @gol
701 -mdwarf2-asm -mearly-stop-bits @gol
702 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
703 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
704 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
705 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
706 -msched-spec-ldc -msched-spec-control-ldc @gol
707 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
708 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
709 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
710 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
712 @emph{LM32 Options}
713 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
714 -msign-extend-enabled -muser-enabled}
716 @emph{M32R/D Options}
717 @gccoptlist{-m32r2 -m32rx -m32r @gol
718 -mdebug @gol
719 -malign-loops -mno-align-loops @gol
720 -missue-rate=@var{number} @gol
721 -mbranch-cost=@var{number} @gol
722 -mmodel=@var{code-size-model-type} @gol
723 -msdata=@var{sdata-type} @gol
724 -mno-flush-func -mflush-func=@var{name} @gol
725 -mno-flush-trap -mflush-trap=@var{number} @gol
726 -G @var{num}}
728 @emph{M32C Options}
729 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
731 @emph{M680x0 Options}
732 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune} @gol
733 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
734 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
735 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
736 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
737 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
738 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
739 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
740 -mxgot -mno-xgot}
742 @emph{MCore Options}
743 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
744 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
745 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
746 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
747 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
749 @emph{MeP Options}
750 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
751 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
752 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
753 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
754 -mtiny=@var{n}}
756 @emph{MicroBlaze Options}
757 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
758 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
759 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
760 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
761 -mbig-endian -mlittle-endian -mxl-reorder -mxl-mode-@var{app-model}}
763 @emph{MIPS Options}
764 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
765 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips32r3  -mips32r5 @gol
766 -mips32r6  -mips64  -mips64r2  -mips64r3  -mips64r5  -mips64r6 @gol
767 -mips16  -mno-mips16  -mflip-mips16 @gol
768 -minterlink-compressed -mno-interlink-compressed @gol
769 -minterlink-mips16  -mno-interlink-mips16 @gol
770 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
771 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
772 -mgp32  -mgp64  -mfp32  -mfpxx  -mfp64  -mhard-float  -msoft-float @gol
773 -mno-float  -msingle-float  -mdouble-float @gol
774 -modd-spreg -mno-odd-spreg @gol
775 -mabs=@var{mode}  -mnan=@var{encoding} @gol
776 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
777 -mmcu -mmno-mcu @gol
778 -meva -mno-eva @gol
779 -mvirt -mno-virt @gol
780 -mxpa -mno-xpa @gol
781 -mmicromips -mno-micromips @gol
782 -mfpu=@var{fpu-type} @gol
783 -msmartmips  -mno-smartmips @gol
784 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
785 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
786 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
787 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
788 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
789 -membedded-data  -mno-embedded-data @gol
790 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
791 -mcode-readable=@var{setting} @gol
792 -msplit-addresses  -mno-split-addresses @gol
793 -mexplicit-relocs  -mno-explicit-relocs @gol
794 -mcheck-zero-division  -mno-check-zero-division @gol
795 -mdivide-traps  -mdivide-breaks @gol
796 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
797 -mmad -mno-mad -mimadd -mno-imadd -mfused-madd  -mno-fused-madd  -nocpp @gol
798 -mfix-24k -mno-fix-24k @gol
799 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
800 -mfix-r10000 -mno-fix-r10000  -mfix-rm7000 -mno-fix-rm7000 @gol
801 -mfix-vr4120  -mno-fix-vr4120 @gol
802 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
803 -mflush-func=@var{func}  -mno-flush-func @gol
804 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
805 -mfp-exceptions -mno-fp-exceptions @gol
806 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
807 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
809 @emph{MMIX Options}
810 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
811 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
812 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
813 -mno-base-addresses  -msingle-exit  -mno-single-exit}
815 @emph{MN10300 Options}
816 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
817 -mno-am33 -mam33 -mam33-2 -mam34 @gol
818 -mtune=@var{cpu-type} @gol
819 -mreturn-pointer-on-d0 @gol
820 -mno-crt0  -mrelax -mliw -msetlb}
822 @emph{Moxie Options}
823 @gccoptlist{-meb -mel -mmul.x -mno-crt0}
825 @emph{MSP430 Options}
826 @gccoptlist{-msim -masm-hex -mmcu= -mcpu= -mlarge -msmall -mrelax @gol
827 -mhwmult= -minrt}
829 @emph{NDS32 Options}
830 @gccoptlist{-mbig-endian -mlittle-endian @gol
831 -mreduced-regs -mfull-regs @gol
832 -mcmov -mno-cmov @gol
833 -mperf-ext -mno-perf-ext @gol
834 -mv3push -mno-v3push @gol
835 -m16bit -mno-16bit @gol
836 -misr-vector-size=@var{num} @gol
837 -mcache-block-size=@var{num} @gol
838 -march=@var{arch} @gol
839 -mcmodel=@var{code-model} @gol
840 -mctor-dtor -mrelax}
842 @emph{Nios II Options}
843 @gccoptlist{-G @var{num} -mgpopt=@var{option} -mgpopt -mno-gpopt @gol
844 -mel -meb @gol
845 -mno-bypass-cache -mbypass-cache @gol
846 -mno-cache-volatile -mcache-volatile @gol
847 -mno-fast-sw-div -mfast-sw-div @gol
848 -mhw-mul -mno-hw-mul -mhw-mulx -mno-hw-mulx -mno-hw-div -mhw-div @gol
849 -mcustom-@var{insn}=@var{N} -mno-custom-@var{insn} @gol
850 -mcustom-fpu-cfg=@var{name} @gol
851 -mhal -msmallc -msys-crt0=@var{name} -msys-lib=@var{name}}
853 @emph{Nvidia PTX Options}
854 @gccoptlist{-m32 -m64 -mmainkernel}
856 @emph{PDP-11 Options}
857 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
858 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
859 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
860 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
861 -mbranch-expensive  -mbranch-cheap @gol
862 -munix-asm  -mdec-asm}
864 @emph{picoChip Options}
865 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
866 -msymbol-as-address -mno-inefficient-warnings}
868 @emph{PowerPC Options}
869 See RS/6000 and PowerPC Options.
871 @emph{RL78 Options}
872 @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=rl78 @gol
873 -m64bit-doubles -m32bit-doubles}
875 @emph{RS/6000 and PowerPC Options}
876 @gccoptlist{-mcpu=@var{cpu-type} @gol
877 -mtune=@var{cpu-type} @gol
878 -mcmodel=@var{code-model} @gol
879 -mpowerpc64 @gol
880 -maltivec  -mno-altivec @gol
881 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
882 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
883 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
884 -mfprnd  -mno-fprnd @gol
885 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
886 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
887 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
888 -malign-power  -malign-natural @gol
889 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
890 -msingle-float -mdouble-float -msimple-fpu @gol
891 -mstring  -mno-string  -mupdate  -mno-update @gol
892 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
893 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
894 -mstrict-align  -mno-strict-align  -mrelocatable @gol
895 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
896 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
897 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
898 -mprioritize-restricted-insns=@var{priority} @gol
899 -msched-costly-dep=@var{dependence_type} @gol
900 -minsert-sched-nops=@var{scheme} @gol
901 -mcall-sysv  -mcall-netbsd @gol
902 -maix-struct-return  -msvr4-struct-return @gol
903 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
904 -mblock-move-inline-limit=@var{num} @gol
905 -misel -mno-isel @gol
906 -misel=yes  -misel=no @gol
907 -mspe -mno-spe @gol
908 -mspe=yes  -mspe=no @gol
909 -mpaired @gol
910 -mgen-cell-microcode -mwarn-cell-microcode @gol
911 -mvrsave -mno-vrsave @gol
912 -mmulhw -mno-mulhw @gol
913 -mdlmzb -mno-dlmzb @gol
914 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
915 -mprototype  -mno-prototype @gol
916 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
917 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
918 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
919 -mno-recip-precision @gol
920 -mveclibabi=@var{type} -mfriz -mno-friz @gol
921 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
922 -msave-toc-indirect -mno-save-toc-indirect @gol
923 -mpower8-fusion -mno-mpower8-fusion -mpower8-vector -mno-power8-vector @gol
924 -mcrypto -mno-crypto -mdirect-move -mno-direct-move @gol
925 -mquad-memory -mno-quad-memory @gol
926 -mquad-memory-atomic -mno-quad-memory-atomic @gol
927 -mcompat-align-parm -mno-compat-align-parm @gol
928 -mupper-regs-df -mno-upper-regs-df -mupper-regs-sf -mno-upper-regs-sf @gol
929 -mupper-regs -mno-upper-regs}
931 @emph{RX Options}
932 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
933 -mcpu=@gol
934 -mbig-endian-data -mlittle-endian-data @gol
935 -msmall-data @gol
936 -msim  -mno-sim@gol
937 -mas100-syntax -mno-as100-syntax@gol
938 -mrelax@gol
939 -mmax-constant-size=@gol
940 -mint-register=@gol
941 -mpid@gol
942 -mno-warn-multiple-fast-interrupts@gol
943 -msave-acc-in-interrupts}
945 @emph{S/390 and zSeries Options}
946 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
947 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
948 -mlong-double-64 -mlong-double-128 @gol
949 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
950 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
951 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
952 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
953 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard @gol
954 -mhotpatch=@var{halfwords},@var{halfwords}}
956 @emph{Score Options}
957 @gccoptlist{-meb -mel @gol
958 -mnhwloop @gol
959 -muls @gol
960 -mmac @gol
961 -mscore5 -mscore5u -mscore7 -mscore7d}
963 @emph{SH Options}
964 @gccoptlist{-m1  -m2  -m2e @gol
965 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
966 -m3  -m3e @gol
967 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
968 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
969 -m5-64media  -m5-64media-nofpu @gol
970 -m5-32media  -m5-32media-nofpu @gol
971 -m5-compact  -m5-compact-nofpu @gol
972 -mb  -ml  -mdalign  -mrelax @gol
973 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
974 -mieee -mno-ieee -mbitops  -misize  -minline-ic_invalidate -mpadstruct @gol
975 -mspace -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
976 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
977 -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
978 -maccumulate-outgoing-args -minvalid-symbols @gol
979 -matomic-model=@var{atomic-model} @gol
980 -mbranch-cost=@var{num} -mzdcbranch -mno-zdcbranch @gol
981 -mcbranch-force-delay-slot @gol
982 -mfused-madd -mno-fused-madd -mfsca -mno-fsca -mfsrra -mno-fsrra @gol
983 -mpretend-cmove -mtas}
985 @emph{Solaris 2 Options}
986 @gccoptlist{-mclear-hwcap -mno-clear-hwcap -mimpure-text  -mno-impure-text @gol
987 -pthreads -pthread}
989 @emph{SPARC Options}
990 @gccoptlist{-mcpu=@var{cpu-type} @gol
991 -mtune=@var{cpu-type} @gol
992 -mcmodel=@var{code-model} @gol
993 -mmemory-model=@var{mem-model} @gol
994 -m32  -m64  -mapp-regs  -mno-app-regs @gol
995 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
996 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
997 -mhard-quad-float  -msoft-quad-float @gol
998 -mstack-bias  -mno-stack-bias @gol
999 -munaligned-doubles  -mno-unaligned-doubles @gol
1000 -muser-mode  -mno-user-mode @gol
1001 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
1002 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
1003 -mcbcond -mno-cbcond @gol
1004 -mfmaf  -mno-fmaf  -mpopc  -mno-popc @gol
1005 -mfix-at697f -mfix-ut699}
1007 @emph{SPU Options}
1008 @gccoptlist{-mwarn-reloc -merror-reloc @gol
1009 -msafe-dma -munsafe-dma @gol
1010 -mbranch-hints @gol
1011 -msmall-mem -mlarge-mem -mstdmain @gol
1012 -mfixed-range=@var{register-range} @gol
1013 -mea32 -mea64 @gol
1014 -maddress-space-conversion -mno-address-space-conversion @gol
1015 -mcache-size=@var{cache-size} @gol
1016 -matomic-updates -mno-atomic-updates}
1018 @emph{System V Options}
1019 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
1021 @emph{TILE-Gx Options}
1022 @gccoptlist{-mcpu=CPU -m32 -m64 -mbig-endian -mlittle-endian @gol
1023 -mcmodel=@var{code-model}}
1025 @emph{TILEPro Options}
1026 @gccoptlist{-mcpu=@var{cpu} -m32}
1028 @emph{V850 Options}
1029 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
1030 -mprolog-function  -mno-prolog-function  -mspace @gol
1031 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
1032 -mapp-regs  -mno-app-regs @gol
1033 -mdisable-callt  -mno-disable-callt @gol
1034 -mv850e2v3 -mv850e2 -mv850e1 -mv850es @gol
1035 -mv850e -mv850 -mv850e3v5 @gol
1036 -mloop @gol
1037 -mrelax @gol
1038 -mlong-jumps @gol
1039 -msoft-float @gol
1040 -mhard-float @gol
1041 -mgcc-abi @gol
1042 -mrh850-abi @gol
1043 -mbig-switch}
1045 @emph{VAX Options}
1046 @gccoptlist{-mg  -mgnu  -munix}
1048 @emph{Visium Options}
1049 @gccoptlist{-mdebug -msim -mfpu -mno-fpu -mhard-float -msoft-float @gol
1050 -mcpu=@var{cpu-type} -mtune=@var{cpu-type} -msv-mode -muser-mode}
1052 @emph{VMS Options}
1053 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64 @gol
1054 -mpointer-size=@var{size}}
1056 @emph{VxWorks Options}
1057 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
1058 -Xbind-lazy  -Xbind-now}
1060 @emph{x86 Options}
1061 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1062 -mtune-ctrl=@var{feature-list} -mdump-tune-features -mno-default @gol
1063 -mfpmath=@var{unit} @gol
1064 -masm=@var{dialect}  -mno-fancy-math-387 @gol
1065 -mno-fp-ret-in-387  -msoft-float @gol
1066 -mno-wide-multiply  -mrtd  -malign-double @gol
1067 -mpreferred-stack-boundary=@var{num} @gol
1068 -mincoming-stack-boundary=@var{num} @gol
1069 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
1070 -mrecip -mrecip=@var{opt} @gol
1071 -mvzeroupper -mprefer-avx128 @gol
1072 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
1073 -mavx2 -mavx512f -mavx512pf -mavx512er -mavx512cd -msha @gol
1074 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma -mprefetchwt1 @gol
1075 -mclflushopt -mxsavec -mxsaves @gol
1076 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
1077 -mbmi2 -mfxsr -mxsave -mxsaveopt -mrtm -mlwp -mmpx -mthreads @gol
1078 -mno-align-stringops  -minline-all-stringops @gol
1079 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
1080 -mmemcpy-strategy=@var{strategy} -mmemset-strategy=@var{strategy} @gol
1081 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
1082 -m96bit-long-double -mlong-double-64 -mlong-double-80 -mlong-double-128 @gol
1083 -mregparm=@var{num}  -msseregparm @gol
1084 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
1085 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
1086 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
1087 -mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
1088 -m32 -m64 -mx32 -m16 -mlarge-data-threshold=@var{num} @gol
1089 -msse2avx -mfentry -mrecord-mcount -mnop-mcount -m8bit-idiv @gol
1090 -mavx256-split-unaligned-load -mavx256-split-unaligned-store @gol
1091 -malign-data=@var{type} -mstack-protector-guard=@var{guard}}
1093 @emph{x86 Windows Options}
1094 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
1095 -mnop-fun-dllimport -mthread @gol
1096 -municode -mwin32 -mwindows -fno-set-stack-executable}
1098 @emph{Xstormy16 Options}
1099 @gccoptlist{-msim}
1101 @emph{Xtensa Options}
1102 @gccoptlist{-mconst16 -mno-const16 @gol
1103 -mfused-madd  -mno-fused-madd @gol
1104 -mforce-no-pic @gol
1105 -mserialize-volatile  -mno-serialize-volatile @gol
1106 -mtext-section-literals  -mno-text-section-literals @gol
1107 -mtarget-align  -mno-target-align @gol
1108 -mlongcalls  -mno-longcalls}
1110 @emph{zSeries Options}
1111 See S/390 and zSeries Options.
1113 @item Code Generation Options
1114 @xref{Code Gen Options,,Options for Code Generation Conventions}.
1115 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
1116 -ffixed-@var{reg}  -fexceptions @gol
1117 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
1118 -fasynchronous-unwind-tables @gol
1119 -fno-gnu-unique @gol
1120 -finhibit-size-directive  -finstrument-functions @gol
1121 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
1122 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
1123 -fno-common  -fno-ident @gol
1124 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
1125 -fno-jump-tables @gol
1126 -frecord-gcc-switches @gol
1127 -freg-struct-return  -fshort-enums @gol
1128 -fshort-double  -fshort-wchar @gol
1129 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
1130 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
1131 -fno-stack-limit -fsplit-stack @gol
1132 -fleading-underscore  -ftls-model=@var{model} @gol
1133 -fstack-reuse=@var{reuse_level} @gol
1134 -ftrapv  -fwrapv  -fbounds-check @gol
1135 -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]} @gol
1136 -fstrict-volatile-bitfields -fsync-libcalls}
1137 @end table
1140 @node Overall Options
1141 @section Options Controlling the Kind of Output
1143 Compilation can involve up to four stages: preprocessing, compilation
1144 proper, assembly and linking, always in that order.  GCC is capable of
1145 preprocessing and compiling several files either into several
1146 assembler input files, or into one assembler input file; then each
1147 assembler input file produces an object file, and linking combines all
1148 the object files (those newly compiled, and those specified as input)
1149 into an executable file.
1151 @cindex file name suffix
1152 For any given input file, the file name suffix determines what kind of
1153 compilation is done:
1155 @table @gcctabopt
1156 @item @var{file}.c
1157 C source code that must be preprocessed.
1159 @item @var{file}.i
1160 C source code that should not be preprocessed.
1162 @item @var{file}.ii
1163 C++ source code that should not be preprocessed.
1165 @item @var{file}.m
1166 Objective-C source code.  Note that you must link with the @file{libobjc}
1167 library to make an Objective-C program work.
1169 @item @var{file}.mi
1170 Objective-C source code that should not be preprocessed.
1172 @item @var{file}.mm
1173 @itemx @var{file}.M
1174 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1175 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1176 to a literal capital M@.
1178 @item @var{file}.mii
1179 Objective-C++ source code that should not be preprocessed.
1181 @item @var{file}.h
1182 C, C++, Objective-C or Objective-C++ header file to be turned into a
1183 precompiled header (default), or C, C++ header file to be turned into an
1184 Ada spec (via the @option{-fdump-ada-spec} switch).
1186 @item @var{file}.cc
1187 @itemx @var{file}.cp
1188 @itemx @var{file}.cxx
1189 @itemx @var{file}.cpp
1190 @itemx @var{file}.CPP
1191 @itemx @var{file}.c++
1192 @itemx @var{file}.C
1193 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1194 the last two letters must both be literally @samp{x}.  Likewise,
1195 @samp{.C} refers to a literal capital C@.
1197 @item @var{file}.mm
1198 @itemx @var{file}.M
1199 Objective-C++ source code that must be preprocessed.
1201 @item @var{file}.mii
1202 Objective-C++ source code that should not be preprocessed.
1204 @item @var{file}.hh
1205 @itemx @var{file}.H
1206 @itemx @var{file}.hp
1207 @itemx @var{file}.hxx
1208 @itemx @var{file}.hpp
1209 @itemx @var{file}.HPP
1210 @itemx @var{file}.h++
1211 @itemx @var{file}.tcc
1212 C++ header file to be turned into a precompiled header or Ada spec.
1214 @item @var{file}.f
1215 @itemx @var{file}.for
1216 @itemx @var{file}.ftn
1217 Fixed form Fortran source code that should not be preprocessed.
1219 @item @var{file}.F
1220 @itemx @var{file}.FOR
1221 @itemx @var{file}.fpp
1222 @itemx @var{file}.FPP
1223 @itemx @var{file}.FTN
1224 Fixed form Fortran source code that must be preprocessed (with the traditional
1225 preprocessor).
1227 @item @var{file}.f90
1228 @itemx @var{file}.f95
1229 @itemx @var{file}.f03
1230 @itemx @var{file}.f08
1231 Free form Fortran source code that should not be preprocessed.
1233 @item @var{file}.F90
1234 @itemx @var{file}.F95
1235 @itemx @var{file}.F03
1236 @itemx @var{file}.F08
1237 Free form Fortran source code that must be preprocessed (with the
1238 traditional preprocessor).
1240 @item @var{file}.go
1241 Go source code.
1243 @c FIXME: Descriptions of Java file types.
1244 @c @var{file}.java
1245 @c @var{file}.class
1246 @c @var{file}.zip
1247 @c @var{file}.jar
1249 @item @var{file}.ads
1250 Ada source code file that contains a library unit declaration (a
1251 declaration of a package, subprogram, or generic, or a generic
1252 instantiation), or a library unit renaming declaration (a package,
1253 generic, or subprogram renaming declaration).  Such files are also
1254 called @dfn{specs}.
1256 @item @var{file}.adb
1257 Ada source code file containing a library unit body (a subprogram or
1258 package body).  Such files are also called @dfn{bodies}.
1260 @c GCC also knows about some suffixes for languages not yet included:
1261 @c Pascal:
1262 @c @var{file}.p
1263 @c @var{file}.pas
1264 @c Ratfor:
1265 @c @var{file}.r
1267 @item @var{file}.s
1268 Assembler code.
1270 @item @var{file}.S
1271 @itemx @var{file}.sx
1272 Assembler code that must be preprocessed.
1274 @item @var{other}
1275 An object file to be fed straight into linking.
1276 Any file name with no recognized suffix is treated this way.
1277 @end table
1279 @opindex x
1280 You can specify the input language explicitly with the @option{-x} option:
1282 @table @gcctabopt
1283 @item -x @var{language}
1284 Specify explicitly the @var{language} for the following input files
1285 (rather than letting the compiler choose a default based on the file
1286 name suffix).  This option applies to all following input files until
1287 the next @option{-x} option.  Possible values for @var{language} are:
1288 @smallexample
1289 c  c-header  cpp-output
1290 c++  c++-header  c++-cpp-output
1291 objective-c  objective-c-header  objective-c-cpp-output
1292 objective-c++ objective-c++-header objective-c++-cpp-output
1293 assembler  assembler-with-cpp
1295 f77  f77-cpp-input f95  f95-cpp-input
1297 java
1298 @end smallexample
1300 @item -x none
1301 Turn off any specification of a language, so that subsequent files are
1302 handled according to their file name suffixes (as they are if @option{-x}
1303 has not been used at all).
1305 @item -pass-exit-codes
1306 @opindex pass-exit-codes
1307 Normally the @command{gcc} program exits with the code of 1 if any
1308 phase of the compiler returns a non-success return code.  If you specify
1309 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1310 the numerically highest error produced by any phase returning an error
1311 indication.  The C, C++, and Fortran front ends return 4 if an internal
1312 compiler error is encountered.
1313 @end table
1315 If you only want some of the stages of compilation, you can use
1316 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1317 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1318 @command{gcc} is to stop.  Note that some combinations (for example,
1319 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1321 @table @gcctabopt
1322 @item -c
1323 @opindex c
1324 Compile or assemble the source files, but do not link.  The linking
1325 stage simply is not done.  The ultimate output is in the form of an
1326 object file for each source file.
1328 By default, the object file name for a source file is made by replacing
1329 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1331 Unrecognized input files, not requiring compilation or assembly, are
1332 ignored.
1334 @item -S
1335 @opindex S
1336 Stop after the stage of compilation proper; do not assemble.  The output
1337 is in the form of an assembler code file for each non-assembler input
1338 file specified.
1340 By default, the assembler file name for a source file is made by
1341 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1343 Input files that don't require compilation are ignored.
1345 @item -E
1346 @opindex E
1347 Stop after the preprocessing stage; do not run the compiler proper.  The
1348 output is in the form of preprocessed source code, which is sent to the
1349 standard output.
1351 Input files that don't require preprocessing are ignored.
1353 @cindex output file option
1354 @item -o @var{file}
1355 @opindex o
1356 Place output in file @var{file}.  This applies to whatever
1357 sort of output is being produced, whether it be an executable file,
1358 an object file, an assembler file or preprocessed C code.
1360 If @option{-o} is not specified, the default is to put an executable
1361 file in @file{a.out}, the object file for
1362 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1363 assembler file in @file{@var{source}.s}, a precompiled header file in
1364 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1365 standard output.
1367 @item -v
1368 @opindex v
1369 Print (on standard error output) the commands executed to run the stages
1370 of compilation.  Also print the version number of the compiler driver
1371 program and of the preprocessor and the compiler proper.
1373 @item -###
1374 @opindex ###
1375 Like @option{-v} except the commands are not executed and arguments
1376 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1377 This is useful for shell scripts to capture the driver-generated command lines.
1379 @item -pipe
1380 @opindex pipe
1381 Use pipes rather than temporary files for communication between the
1382 various stages of compilation.  This fails to work on some systems where
1383 the assembler is unable to read from a pipe; but the GNU assembler has
1384 no trouble.
1386 @item --help
1387 @opindex help
1388 Print (on the standard output) a description of the command-line options
1389 understood by @command{gcc}.  If the @option{-v} option is also specified
1390 then @option{--help} is also passed on to the various processes
1391 invoked by @command{gcc}, so that they can display the command-line options
1392 they accept.  If the @option{-Wextra} option has also been specified
1393 (prior to the @option{--help} option), then command-line options that
1394 have no documentation associated with them are also displayed.
1396 @item --target-help
1397 @opindex target-help
1398 Print (on the standard output) a description of target-specific command-line
1399 options for each tool.  For some targets extra target-specific
1400 information may also be printed.
1402 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1403 Print (on the standard output) a description of the command-line
1404 options understood by the compiler that fit into all specified classes
1405 and qualifiers.  These are the supported classes:
1407 @table @asis
1408 @item @samp{optimizers}
1409 Display all of the optimization options supported by the
1410 compiler.
1412 @item @samp{warnings}
1413 Display all of the options controlling warning messages
1414 produced by the compiler.
1416 @item @samp{target}
1417 Display target-specific options.  Unlike the
1418 @option{--target-help} option however, target-specific options of the
1419 linker and assembler are not displayed.  This is because those
1420 tools do not currently support the extended @option{--help=} syntax.
1422 @item @samp{params}
1423 Display the values recognized by the @option{--param}
1424 option.
1426 @item @var{language}
1427 Display the options supported for @var{language}, where
1428 @var{language} is the name of one of the languages supported in this
1429 version of GCC@.
1431 @item @samp{common}
1432 Display the options that are common to all languages.
1433 @end table
1435 These are the supported qualifiers:
1437 @table @asis
1438 @item @samp{undocumented}
1439 Display only those options that are undocumented.
1441 @item @samp{joined}
1442 Display options taking an argument that appears after an equal
1443 sign in the same continuous piece of text, such as:
1444 @samp{--help=target}.
1446 @item @samp{separate}
1447 Display options taking an argument that appears as a separate word
1448 following the original option, such as: @samp{-o output-file}.
1449 @end table
1451 Thus for example to display all the undocumented target-specific
1452 switches supported by the compiler, use:
1454 @smallexample
1455 --help=target,undocumented
1456 @end smallexample
1458 The sense of a qualifier can be inverted by prefixing it with the
1459 @samp{^} character, so for example to display all binary warning
1460 options (i.e., ones that are either on or off and that do not take an
1461 argument) that have a description, use:
1463 @smallexample
1464 --help=warnings,^joined,^undocumented
1465 @end smallexample
1467 The argument to @option{--help=} should not consist solely of inverted
1468 qualifiers.
1470 Combining several classes is possible, although this usually
1471 restricts the output so much that there is nothing to display.  One
1472 case where it does work, however, is when one of the classes is
1473 @var{target}.  For example, to display all the target-specific
1474 optimization options, use:
1476 @smallexample
1477 --help=target,optimizers
1478 @end smallexample
1480 The @option{--help=} option can be repeated on the command line.  Each
1481 successive use displays its requested class of options, skipping
1482 those that have already been displayed.
1484 If the @option{-Q} option appears on the command line before the
1485 @option{--help=} option, then the descriptive text displayed by
1486 @option{--help=} is changed.  Instead of describing the displayed
1487 options, an indication is given as to whether the option is enabled,
1488 disabled or set to a specific value (assuming that the compiler
1489 knows this at the point where the @option{--help=} option is used).
1491 Here is a truncated example from the ARM port of @command{gcc}:
1493 @smallexample
1494   % gcc -Q -mabi=2 --help=target -c
1495   The following options are target specific:
1496   -mabi=                                2
1497   -mabort-on-noreturn                   [disabled]
1498   -mapcs                                [disabled]
1499 @end smallexample
1501 The output is sensitive to the effects of previous command-line
1502 options, so for example it is possible to find out which optimizations
1503 are enabled at @option{-O2} by using:
1505 @smallexample
1506 -Q -O2 --help=optimizers
1507 @end smallexample
1509 Alternatively you can discover which binary optimizations are enabled
1510 by @option{-O3} by using:
1512 @smallexample
1513 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1514 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1515 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1516 @end smallexample
1518 @item -no-canonical-prefixes
1519 @opindex no-canonical-prefixes
1520 Do not expand any symbolic links, resolve references to @samp{/../}
1521 or @samp{/./}, or make the path absolute when generating a relative
1522 prefix.
1524 @item --version
1525 @opindex version
1526 Display the version number and copyrights of the invoked GCC@.
1528 @item -wrapper
1529 @opindex wrapper
1530 Invoke all subcommands under a wrapper program.  The name of the
1531 wrapper program and its parameters are passed as a comma separated
1532 list.
1534 @smallexample
1535 gcc -c t.c -wrapper gdb,--args
1536 @end smallexample
1538 @noindent
1539 This invokes all subprograms of @command{gcc} under
1540 @samp{gdb --args}, thus the invocation of @command{cc1} is
1541 @samp{gdb --args cc1 @dots{}}.
1543 @item -fplugin=@var{name}.so
1544 @opindex fplugin
1545 Load the plugin code in file @var{name}.so, assumed to be a
1546 shared object to be dlopen'd by the compiler.  The base name of
1547 the shared object file is used to identify the plugin for the
1548 purposes of argument parsing (See
1549 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1550 Each plugin should define the callback functions specified in the
1551 Plugins API.
1553 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1554 @opindex fplugin-arg
1555 Define an argument called @var{key} with a value of @var{value}
1556 for the plugin called @var{name}.
1558 @item -fdump-ada-spec@r{[}-slim@r{]}
1559 @opindex fdump-ada-spec
1560 For C and C++ source and include files, generate corresponding Ada specs.
1561 @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1562 GNAT User's Guide}, which provides detailed documentation on this feature.
1564 @item -fada-spec-parent=@var{unit}
1565 @opindex fada-spec-parent
1566 In conjunction with @option{-fdump-ada-spec@r{[}-slim@r{]}} above, generate
1567 Ada specs as child units of parent @var{unit}.
1569 @item -fdump-go-spec=@var{file}
1570 @opindex fdump-go-spec
1571 For input files in any language, generate corresponding Go
1572 declarations in @var{file}.  This generates Go @code{const},
1573 @code{type}, @code{var}, and @code{func} declarations which may be a
1574 useful way to start writing a Go interface to code written in some
1575 other language.
1577 @include @value{srcdir}/../libiberty/at-file.texi
1578 @end table
1580 @node Invoking G++
1581 @section Compiling C++ Programs
1583 @cindex suffixes for C++ source
1584 @cindex C++ source file suffixes
1585 C++ source files conventionally use one of the suffixes @samp{.C},
1586 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1587 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1588 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1589 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1590 files with these names and compiles them as C++ programs even if you
1591 call the compiler the same way as for compiling C programs (usually
1592 with the name @command{gcc}).
1594 @findex g++
1595 @findex c++
1596 However, the use of @command{gcc} does not add the C++ library.
1597 @command{g++} is a program that calls GCC and automatically specifies linking
1598 against the C++ library.  It treats @samp{.c},
1599 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1600 files unless @option{-x} is used.  This program is also useful when
1601 precompiling a C header file with a @samp{.h} extension for use in C++
1602 compilations.  On many systems, @command{g++} is also installed with
1603 the name @command{c++}.
1605 @cindex invoking @command{g++}
1606 When you compile C++ programs, you may specify many of the same
1607 command-line options that you use for compiling programs in any
1608 language; or command-line options meaningful for C and related
1609 languages; or options that are meaningful only for C++ programs.
1610 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1611 explanations of options for languages related to C@.
1612 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1613 explanations of options that are meaningful only for C++ programs.
1615 @node C Dialect Options
1616 @section Options Controlling C Dialect
1617 @cindex dialect options
1618 @cindex language dialect options
1619 @cindex options, dialect
1621 The following options control the dialect of C (or languages derived
1622 from C, such as C++, Objective-C and Objective-C++) that the compiler
1623 accepts:
1625 @table @gcctabopt
1626 @cindex ANSI support
1627 @cindex ISO support
1628 @item -ansi
1629 @opindex ansi
1630 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1631 equivalent to @option{-std=c++98}.
1633 This turns off certain features of GCC that are incompatible with ISO
1634 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1635 such as the @code{asm} and @code{typeof} keywords, and
1636 predefined macros such as @code{unix} and @code{vax} that identify the
1637 type of system you are using.  It also enables the undesirable and
1638 rarely used ISO trigraph feature.  For the C compiler,
1639 it disables recognition of C++ style @samp{//} comments as well as
1640 the @code{inline} keyword.
1642 The alternate keywords @code{__asm__}, @code{__extension__},
1643 @code{__inline__} and @code{__typeof__} continue to work despite
1644 @option{-ansi}.  You would not want to use them in an ISO C program, of
1645 course, but it is useful to put them in header files that might be included
1646 in compilations done with @option{-ansi}.  Alternate predefined macros
1647 such as @code{__unix__} and @code{__vax__} are also available, with or
1648 without @option{-ansi}.
1650 The @option{-ansi} option does not cause non-ISO programs to be
1651 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1652 addition to @option{-ansi}.  @xref{Warning Options}.
1654 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1655 option is used.  Some header files may notice this macro and refrain
1656 from declaring certain functions or defining certain macros that the
1657 ISO standard doesn't call for; this is to avoid interfering with any
1658 programs that might use these names for other things.
1660 Functions that are normally built in but do not have semantics
1661 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1662 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1663 built-in functions provided by GCC}, for details of the functions
1664 affected.
1666 @item -std=
1667 @opindex std
1668 Determine the language standard. @xref{Standards,,Language Standards
1669 Supported by GCC}, for details of these standard versions.  This option
1670 is currently only supported when compiling C or C++.
1672 The compiler can accept several base standards, such as @samp{c90} or
1673 @samp{c++98}, and GNU dialects of those standards, such as
1674 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1675 compiler accepts all programs following that standard plus those
1676 using GNU extensions that do not contradict it.  For example,
1677 @option{-std=c90} turns off certain features of GCC that are
1678 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1679 keywords, but not other GNU extensions that do not have a meaning in
1680 ISO C90, such as omitting the middle term of a @code{?:}
1681 expression. On the other hand, when a GNU dialect of a standard is
1682 specified, all features supported by the compiler are enabled, even when
1683 those features change the meaning of the base standard.  As a result, some
1684 strict-conforming programs may be rejected.  The particular standard
1685 is used by @option{-Wpedantic} to identify which features are GNU
1686 extensions given that version of the standard. For example
1687 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1688 comments, while @option{-std=gnu99 -Wpedantic} does not.
1690 A value for this option must be provided; possible values are
1692 @table @samp
1693 @item c90
1694 @itemx c89
1695 @itemx iso9899:1990
1696 Support all ISO C90 programs (certain GNU extensions that conflict
1697 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1699 @item iso9899:199409
1700 ISO C90 as modified in amendment 1.
1702 @item c99
1703 @itemx c9x
1704 @itemx iso9899:1999
1705 @itemx iso9899:199x
1706 ISO C99.  This standard is substantially completely supported, modulo
1707 bugs and floating-point issues
1708 (mainly but not entirely relating to optional C99 features from
1709 Annexes F and G).  See
1710 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1711 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1713 @item c11
1714 @itemx c1x
1715 @itemx iso9899:2011
1716 ISO C11, the 2011 revision of the ISO C standard.  This standard is
1717 substantially completely supported, modulo bugs, floating-point issues
1718 (mainly but not entirely relating to optional C11 features from
1719 Annexes F and G) and the optional Annexes K (Bounds-checking
1720 interfaces) and L (Analyzability).  The name @samp{c1x} is deprecated.
1722 @item gnu90
1723 @itemx gnu89
1724 GNU dialect of ISO C90 (including some C99 features).
1726 @item gnu99
1727 @itemx gnu9x
1728 GNU dialect of ISO C99.  The name @samp{gnu9x} is deprecated.
1730 @item gnu11
1731 @itemx gnu1x
1732 GNU dialect of ISO C11.  This is the default for C code.
1733 The name @samp{gnu1x} is deprecated.
1735 @item c++98
1736 @itemx c++03
1737 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1738 additional defect reports. Same as @option{-ansi} for C++ code.
1740 @item gnu++98
1741 @itemx gnu++03
1742 GNU dialect of @option{-std=c++98}.  This is the default for
1743 C++ code.
1745 @item c++11
1746 @itemx c++0x
1747 The 2011 ISO C++ standard plus amendments.
1748 The name @samp{c++0x} is deprecated.
1750 @item gnu++11
1751 @itemx gnu++0x
1752 GNU dialect of @option{-std=c++11}.
1753 The name @samp{gnu++0x} is deprecated.
1755 @item c++14
1756 @itemx c++1y
1757 The 2014 ISO C++ standard plus amendments.
1758 The name @samp{c++1y} is deprecated.
1760 @item gnu++14
1761 @itemx gnu++1y
1762 GNU dialect of @option{-std=c++14}.
1763 The name @samp{gnu++1y} is deprecated.
1765 @item c++1z
1766 The next revision of the ISO C++ standard, tentatively planned for
1767 2017.  Support is highly experimental, and will almost certainly
1768 change in incompatible ways in future releases.
1770 @item gnu++1z
1771 GNU dialect of @option{-std=c++1z}.  Support is highly experimental,
1772 and will almost certainly change in incompatible ways in future
1773 releases.
1774 @end table
1776 @item -fgnu89-inline
1777 @opindex fgnu89-inline
1778 The option @option{-fgnu89-inline} tells GCC to use the traditional
1779 GNU semantics for @code{inline} functions when in C99 mode.
1780 @xref{Inline,,An Inline Function is As Fast As a Macro}.
1781 Using this option is roughly equivalent to adding the
1782 @code{gnu_inline} function attribute to all inline functions
1783 (@pxref{Function Attributes}).
1785 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1786 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1787 specifies the default behavior).  
1788 This option is not supported in @option{-std=c90} or
1789 @option{-std=gnu90} mode.
1791 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1792 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1793 in effect for @code{inline} functions.  @xref{Common Predefined
1794 Macros,,,cpp,The C Preprocessor}.
1796 @item -aux-info @var{filename}
1797 @opindex aux-info
1798 Output to the given filename prototyped declarations for all functions
1799 declared and/or defined in a translation unit, including those in header
1800 files.  This option is silently ignored in any language other than C@.
1802 Besides declarations, the file indicates, in comments, the origin of
1803 each declaration (source file and line), whether the declaration was
1804 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1805 @samp{O} for old, respectively, in the first character after the line
1806 number and the colon), and whether it came from a declaration or a
1807 definition (@samp{C} or @samp{F}, respectively, in the following
1808 character).  In the case of function definitions, a K&R-style list of
1809 arguments followed by their declarations is also provided, inside
1810 comments, after the declaration.
1812 @item -fallow-parameterless-variadic-functions
1813 @opindex fallow-parameterless-variadic-functions
1814 Accept variadic functions without named parameters.
1816 Although it is possible to define such a function, this is not very
1817 useful as it is not possible to read the arguments.  This is only
1818 supported for C as this construct is allowed by C++.
1820 @item -fno-asm
1821 @opindex fno-asm
1822 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1823 keyword, so that code can use these words as identifiers.  You can use
1824 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1825 instead.  @option{-ansi} implies @option{-fno-asm}.
1827 In C++, this switch only affects the @code{typeof} keyword, since
1828 @code{asm} and @code{inline} are standard keywords.  You may want to
1829 use the @option{-fno-gnu-keywords} flag instead, which has the same
1830 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1831 switch only affects the @code{asm} and @code{typeof} keywords, since
1832 @code{inline} is a standard keyword in ISO C99.
1834 @item -fno-builtin
1835 @itemx -fno-builtin-@var{function}
1836 @opindex fno-builtin
1837 @cindex built-in functions
1838 Don't recognize built-in functions that do not begin with
1839 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1840 functions provided by GCC}, for details of the functions affected,
1841 including those which are not built-in functions when @option{-ansi} or
1842 @option{-std} options for strict ISO C conformance are used because they
1843 do not have an ISO standard meaning.
1845 GCC normally generates special code to handle certain built-in functions
1846 more efficiently; for instance, calls to @code{alloca} may become single
1847 instructions which adjust the stack directly, and calls to @code{memcpy}
1848 may become inline copy loops.  The resulting code is often both smaller
1849 and faster, but since the function calls no longer appear as such, you
1850 cannot set a breakpoint on those calls, nor can you change the behavior
1851 of the functions by linking with a different library.  In addition,
1852 when a function is recognized as a built-in function, GCC may use
1853 information about that function to warn about problems with calls to
1854 that function, or to generate more efficient code, even if the
1855 resulting code still contains calls to that function.  For example,
1856 warnings are given with @option{-Wformat} for bad calls to
1857 @code{printf} when @code{printf} is built in and @code{strlen} is
1858 known not to modify global memory.
1860 With the @option{-fno-builtin-@var{function}} option
1861 only the built-in function @var{function} is
1862 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1863 function is named that is not built-in in this version of GCC, this
1864 option is ignored.  There is no corresponding
1865 @option{-fbuiltin-@var{function}} option; if you wish to enable
1866 built-in functions selectively when using @option{-fno-builtin} or
1867 @option{-ffreestanding}, you may define macros such as:
1869 @smallexample
1870 #define abs(n)          __builtin_abs ((n))
1871 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1872 @end smallexample
1874 @item -fhosted
1875 @opindex fhosted
1876 @cindex hosted environment
1878 Assert that compilation targets a hosted environment.  This implies
1879 @option{-fbuiltin}.  A hosted environment is one in which the
1880 entire standard library is available, and in which @code{main} has a return
1881 type of @code{int}.  Examples are nearly everything except a kernel.
1882 This is equivalent to @option{-fno-freestanding}.
1884 @item -ffreestanding
1885 @opindex ffreestanding
1886 @cindex hosted environment
1888 Assert that compilation targets a freestanding environment.  This
1889 implies @option{-fno-builtin}.  A freestanding environment
1890 is one in which the standard library may not exist, and program startup may
1891 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1892 This is equivalent to @option{-fno-hosted}.
1894 @xref{Standards,,Language Standards Supported by GCC}, for details of
1895 freestanding and hosted environments.
1897 @item -fopenacc
1898 @opindex fopenacc
1899 @cindex OpenACC accelerator programming
1900 Enable handling of OpenACC directives @code{#pragma acc} in C/C++ and
1901 @code{!$acc} in Fortran.  When @option{-fopenacc} is specified, the
1902 compiler generates accelerated code according to the OpenACC Application
1903 Programming Interface v2.0 @w{@uref{http://www.openacc.org/}}.  This option
1904 implies @option{-pthread}, and thus is only supported on targets that
1905 have support for @option{-pthread}.
1907 Note that this is an experimental feature, incomplete, and subject to
1908 change in future versions of GCC.  See
1909 @w{@uref{https://gcc.gnu.org/wiki/OpenACC}} for more information.
1911 @item -fopenmp
1912 @opindex fopenmp
1913 @cindex OpenMP parallel
1914 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1915 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1916 compiler generates parallel code according to the OpenMP Application
1917 Program Interface v4.0 @w{@uref{http://www.openmp.org/}}.  This option
1918 implies @option{-pthread}, and thus is only supported on targets that
1919 have support for @option{-pthread}. @option{-fopenmp} implies
1920 @option{-fopenmp-simd}.
1922 @item -fopenmp-simd
1923 @opindex fopenmp-simd
1924 @cindex OpenMP SIMD
1925 @cindex SIMD
1926 Enable handling of OpenMP's SIMD directives with @code{#pragma omp}
1927 in C/C++ and @code{!$omp} in Fortran. Other OpenMP directives
1928 are ignored.
1930 @item -fcilkplus
1931 @opindex fcilkplus
1932 @cindex Enable Cilk Plus
1933 Enable the usage of Cilk Plus language extension features for C/C++.
1934 When the option @option{-fcilkplus} is specified, enable the usage of
1935 the Cilk Plus Language extension features for C/C++.  The present
1936 implementation follows ABI version 1.2.  This is an experimental
1937 feature that is only partially complete, and whose interface may
1938 change in future versions of GCC as the official specification
1939 changes.  Currently, all features but @code{_Cilk_for} have been
1940 implemented.
1942 @item -fgnu-tm
1943 @opindex fgnu-tm
1944 When the option @option{-fgnu-tm} is specified, the compiler
1945 generates code for the Linux variant of Intel's current Transactional
1946 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
1947 an experimental feature whose interface may change in future versions
1948 of GCC, as the official specification changes.  Please note that not
1949 all architectures are supported for this feature.
1951 For more information on GCC's support for transactional memory,
1952 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
1953 Transactional Memory Library}.
1955 Note that the transactional memory feature is not supported with
1956 non-call exceptions (@option{-fnon-call-exceptions}).
1958 @item -fms-extensions
1959 @opindex fms-extensions
1960 Accept some non-standard constructs used in Microsoft header files.
1962 In C++ code, this allows member names in structures to be similar
1963 to previous types declarations.
1965 @smallexample
1966 typedef int UOW;
1967 struct ABC @{
1968   UOW UOW;
1970 @end smallexample
1972 Some cases of unnamed fields in structures and unions are only
1973 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1974 fields within structs/unions}, for details.
1976 Note that this option is off for all targets but x86 
1977 targets using ms-abi.
1979 @item -fplan9-extensions
1980 @opindex fplan9-extensions
1981 Accept some non-standard constructs used in Plan 9 code.
1983 This enables @option{-fms-extensions}, permits passing pointers to
1984 structures with anonymous fields to functions that expect pointers to
1985 elements of the type of the field, and permits referring to anonymous
1986 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
1987 struct/union fields within structs/unions}, for details.  This is only
1988 supported for C, not C++.
1990 @item -trigraphs
1991 @opindex trigraphs
1992 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1993 options for strict ISO C conformance) implies @option{-trigraphs}.
1995 @cindex traditional C language
1996 @cindex C language, traditional
1997 @item -traditional
1998 @itemx -traditional-cpp
1999 @opindex traditional-cpp
2000 @opindex traditional
2001 Formerly, these options caused GCC to attempt to emulate a pre-standard
2002 C compiler.  They are now only supported with the @option{-E} switch.
2003 The preprocessor continues to support a pre-standard mode.  See the GNU
2004 CPP manual for details.
2006 @item -fcond-mismatch
2007 @opindex fcond-mismatch
2008 Allow conditional expressions with mismatched types in the second and
2009 third arguments.  The value of such an expression is void.  This option
2010 is not supported for C++.
2012 @item -flax-vector-conversions
2013 @opindex flax-vector-conversions
2014 Allow implicit conversions between vectors with differing numbers of
2015 elements and/or incompatible element types.  This option should not be
2016 used for new code.
2018 @item -funsigned-char
2019 @opindex funsigned-char
2020 Let the type @code{char} be unsigned, like @code{unsigned char}.
2022 Each kind of machine has a default for what @code{char} should
2023 be.  It is either like @code{unsigned char} by default or like
2024 @code{signed char} by default.
2026 Ideally, a portable program should always use @code{signed char} or
2027 @code{unsigned char} when it depends on the signedness of an object.
2028 But many programs have been written to use plain @code{char} and
2029 expect it to be signed, or expect it to be unsigned, depending on the
2030 machines they were written for.  This option, and its inverse, let you
2031 make such a program work with the opposite default.
2033 The type @code{char} is always a distinct type from each of
2034 @code{signed char} or @code{unsigned char}, even though its behavior
2035 is always just like one of those two.
2037 @item -fsigned-char
2038 @opindex fsigned-char
2039 Let the type @code{char} be signed, like @code{signed char}.
2041 Note that this is equivalent to @option{-fno-unsigned-char}, which is
2042 the negative form of @option{-funsigned-char}.  Likewise, the option
2043 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
2045 @item -fsigned-bitfields
2046 @itemx -funsigned-bitfields
2047 @itemx -fno-signed-bitfields
2048 @itemx -fno-unsigned-bitfields
2049 @opindex fsigned-bitfields
2050 @opindex funsigned-bitfields
2051 @opindex fno-signed-bitfields
2052 @opindex fno-unsigned-bitfields
2053 These options control whether a bit-field is signed or unsigned, when the
2054 declaration does not use either @code{signed} or @code{unsigned}.  By
2055 default, such a bit-field is signed, because this is consistent: the
2056 basic integer types such as @code{int} are signed types.
2057 @end table
2059 @node C++ Dialect Options
2060 @section Options Controlling C++ Dialect
2062 @cindex compiler options, C++
2063 @cindex C++ options, command-line
2064 @cindex options, C++
2065 This section describes the command-line options that are only meaningful
2066 for C++ programs.  You can also use most of the GNU compiler options
2067 regardless of what language your program is in.  For example, you
2068 might compile a file @file{firstClass.C} like this:
2070 @smallexample
2071 g++ -g -frepo -O -c firstClass.C
2072 @end smallexample
2074 @noindent
2075 In this example, only @option{-frepo} is an option meant
2076 only for C++ programs; you can use the other options with any
2077 language supported by GCC@.
2079 Here is a list of options that are @emph{only} for compiling C++ programs:
2081 @table @gcctabopt
2083 @item -fabi-version=@var{n}
2084 @opindex fabi-version
2085 Use version @var{n} of the C++ ABI@.  The default is version 0.
2087 Version 0 refers to the version conforming most closely to
2088 the C++ ABI specification.  Therefore, the ABI obtained using version 0
2089 will change in different versions of G++ as ABI bugs are fixed.
2091 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.  
2093 Version 2 is the version of the C++ ABI that first appeared in G++
2094 3.4, and was the default through G++ 4.9.
2096 Version 3 corrects an error in mangling a constant address as a
2097 template argument.
2099 Version 4, which first appeared in G++ 4.5, implements a standard
2100 mangling for vector types.
2102 Version 5, which first appeared in G++ 4.6, corrects the mangling of
2103 attribute const/volatile on function pointer types, decltype of a
2104 plain decl, and use of a function parameter in the declaration of
2105 another parameter.
2107 Version 6, which first appeared in G++ 4.7, corrects the promotion
2108 behavior of C++11 scoped enums and the mangling of template argument
2109 packs, const/static_cast, prefix ++ and --, and a class scope function
2110 used as a template argument.
2112 Version 7, which first appeared in G++ 4.8, that treats nullptr_t as a
2113 builtin type and corrects the mangling of lambdas in default argument
2114 scope.
2116 Version 8, which first appeared in G++ 4.9, corrects the substitution
2117 behavior of function types with function-cv-qualifiers.
2119 See also @option{-Wabi}.
2121 @item -fabi-compat-version=@var{n}
2122 @opindex fabi-compat-version
2123 On targets that support strong aliases, G++
2124 works around mangling changes by creating an alias with the correct
2125 mangled name when defining a symbol with an incorrect mangled name.
2126 This switch specifies which ABI version to use for the alias.
2128 With @option{-fabi-version=0} (the default), this defaults to 2.  If
2129 another ABI version is explicitly selected, this defaults to 0.
2131 The compatibility version is also set by @option{-Wabi=@var{n}}.
2133 @item -fno-access-control
2134 @opindex fno-access-control
2135 Turn off all access checking.  This switch is mainly useful for working
2136 around bugs in the access control code.
2138 @item -fcheck-new
2139 @opindex fcheck-new
2140 Check that the pointer returned by @code{operator new} is non-null
2141 before attempting to modify the storage allocated.  This check is
2142 normally unnecessary because the C++ standard specifies that
2143 @code{operator new} only returns @code{0} if it is declared
2144 @code{throw()}, in which case the compiler always checks the
2145 return value even without this option.  In all other cases, when
2146 @code{operator new} has a non-empty exception specification, memory
2147 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
2148 @samp{new (nothrow)}.
2150 @item -fconstexpr-depth=@var{n}
2151 @opindex fconstexpr-depth
2152 Set the maximum nested evaluation depth for C++11 constexpr functions
2153 to @var{n}.  A limit is needed to detect endless recursion during
2154 constant expression evaluation.  The minimum specified by the standard
2155 is 512.
2157 @item -fdeduce-init-list
2158 @opindex fdeduce-init-list
2159 Enable deduction of a template type parameter as
2160 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
2162 @smallexample
2163 template <class T> auto forward(T t) -> decltype (realfn (t))
2165   return realfn (t);
2168 void f()
2170   forward(@{1,2@}); // call forward<std::initializer_list<int>>
2172 @end smallexample
2174 This deduction was implemented as a possible extension to the
2175 originally proposed semantics for the C++11 standard, but was not part
2176 of the final standard, so it is disabled by default.  This option is
2177 deprecated, and may be removed in a future version of G++.
2179 @item -ffriend-injection
2180 @opindex ffriend-injection
2181 Inject friend functions into the enclosing namespace, so that they are
2182 visible outside the scope of the class in which they are declared.
2183 Friend functions were documented to work this way in the old Annotated
2184 C++ Reference Manual.  
2185 However, in ISO C++ a friend function that is not declared
2186 in an enclosing scope can only be found using argument dependent
2187 lookup.  GCC defaults to the standard behavior.
2189 This option is for compatibility, and may be removed in a future
2190 release of G++.
2192 @item -fno-elide-constructors
2193 @opindex fno-elide-constructors
2194 The C++ standard allows an implementation to omit creating a temporary
2195 that is only used to initialize another object of the same type.
2196 Specifying this option disables that optimization, and forces G++ to
2197 call the copy constructor in all cases.
2199 @item -fno-enforce-eh-specs
2200 @opindex fno-enforce-eh-specs
2201 Don't generate code to check for violation of exception specifications
2202 at run time.  This option violates the C++ standard, but may be useful
2203 for reducing code size in production builds, much like defining
2204 @code{NDEBUG}.  This does not give user code permission to throw
2205 exceptions in violation of the exception specifications; the compiler
2206 still optimizes based on the specifications, so throwing an
2207 unexpected exception results in undefined behavior at run time.
2209 @item -fextern-tls-init
2210 @itemx -fno-extern-tls-init
2211 @opindex fextern-tls-init
2212 @opindex fno-extern-tls-init
2213 The C++11 and OpenMP standards allow @code{thread_local} and
2214 @code{threadprivate} variables to have dynamic (runtime)
2215 initialization.  To support this, any use of such a variable goes
2216 through a wrapper function that performs any necessary initialization.
2217 When the use and definition of the variable are in the same
2218 translation unit, this overhead can be optimized away, but when the
2219 use is in a different translation unit there is significant overhead
2220 even if the variable doesn't actually need dynamic initialization.  If
2221 the programmer can be sure that no use of the variable in a
2222 non-defining TU needs to trigger dynamic initialization (either
2223 because the variable is statically initialized, or a use of the
2224 variable in the defining TU will be executed before any uses in
2225 another TU), they can avoid this overhead with the
2226 @option{-fno-extern-tls-init} option.
2228 On targets that support symbol aliases, the default is
2229 @option{-fextern-tls-init}.  On targets that do not support symbol
2230 aliases, the default is @option{-fno-extern-tls-init}.
2232 @item -ffor-scope
2233 @itemx -fno-for-scope
2234 @opindex ffor-scope
2235 @opindex fno-for-scope
2236 If @option{-ffor-scope} is specified, the scope of variables declared in
2237 a @i{for-init-statement} is limited to the @code{for} loop itself,
2238 as specified by the C++ standard.
2239 If @option{-fno-for-scope} is specified, the scope of variables declared in
2240 a @i{for-init-statement} extends to the end of the enclosing scope,
2241 as was the case in old versions of G++, and other (traditional)
2242 implementations of C++.
2244 If neither flag is given, the default is to follow the standard,
2245 but to allow and give a warning for old-style code that would
2246 otherwise be invalid, or have different behavior.
2248 @item -fno-gnu-keywords
2249 @opindex fno-gnu-keywords
2250 Do not recognize @code{typeof} as a keyword, so that code can use this
2251 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2252 @option{-ansi} implies @option{-fno-gnu-keywords}.
2254 @item -fno-implicit-templates
2255 @opindex fno-implicit-templates
2256 Never emit code for non-inline templates that are instantiated
2257 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2258 @xref{Template Instantiation}, for more information.
2260 @item -fno-implicit-inline-templates
2261 @opindex fno-implicit-inline-templates
2262 Don't emit code for implicit instantiations of inline templates, either.
2263 The default is to handle inlines differently so that compiles with and
2264 without optimization need the same set of explicit instantiations.
2266 @item -fno-implement-inlines
2267 @opindex fno-implement-inlines
2268 To save space, do not emit out-of-line copies of inline functions
2269 controlled by @code{#pragma implementation}.  This causes linker
2270 errors if these functions are not inlined everywhere they are called.
2272 @item -fms-extensions
2273 @opindex fms-extensions
2274 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2275 int and getting a pointer to member function via non-standard syntax.
2277 @item -fno-nonansi-builtins
2278 @opindex fno-nonansi-builtins
2279 Disable built-in declarations of functions that are not mandated by
2280 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2281 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2283 @item -fnothrow-opt
2284 @opindex fnothrow-opt
2285 Treat a @code{throw()} exception specification as if it were a
2286 @code{noexcept} specification to reduce or eliminate the text size
2287 overhead relative to a function with no exception specification.  If
2288 the function has local variables of types with non-trivial
2289 destructors, the exception specification actually makes the
2290 function smaller because the EH cleanups for those variables can be
2291 optimized away.  The semantic effect is that an exception thrown out of
2292 a function with such an exception specification results in a call
2293 to @code{terminate} rather than @code{unexpected}.
2295 @item -fno-operator-names
2296 @opindex fno-operator-names
2297 Do not treat the operator name keywords @code{and}, @code{bitand},
2298 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2299 synonyms as keywords.
2301 @item -fno-optional-diags
2302 @opindex fno-optional-diags
2303 Disable diagnostics that the standard says a compiler does not need to
2304 issue.  Currently, the only such diagnostic issued by G++ is the one for
2305 a name having multiple meanings within a class.
2307 @item -fpermissive
2308 @opindex fpermissive
2309 Downgrade some diagnostics about nonconformant code from errors to
2310 warnings.  Thus, using @option{-fpermissive} allows some
2311 nonconforming code to compile.
2313 @item -fno-pretty-templates
2314 @opindex fno-pretty-templates
2315 When an error message refers to a specialization of a function
2316 template, the compiler normally prints the signature of the
2317 template followed by the template arguments and any typedefs or
2318 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2319 rather than @code{void f(int)}) so that it's clear which template is
2320 involved.  When an error message refers to a specialization of a class
2321 template, the compiler omits any template arguments that match
2322 the default template arguments for that template.  If either of these
2323 behaviors make it harder to understand the error message rather than
2324 easier, you can use @option{-fno-pretty-templates} to disable them.
2326 @item -frepo
2327 @opindex frepo
2328 Enable automatic template instantiation at link time.  This option also
2329 implies @option{-fno-implicit-templates}.  @xref{Template
2330 Instantiation}, for more information.
2332 @item -fno-rtti
2333 @opindex fno-rtti
2334 Disable generation of information about every class with virtual
2335 functions for use by the C++ run-time type identification features
2336 (@code{dynamic_cast} and @code{typeid}).  If you don't use those parts
2337 of the language, you can save some space by using this flag.  Note that
2338 exception handling uses the same information, but G++ generates it as
2339 needed. The @code{dynamic_cast} operator can still be used for casts that
2340 do not require run-time type information, i.e.@: casts to @code{void *} or to
2341 unambiguous base classes.
2343 @item -fsized-deallocation
2344 @opindex fsized-deallocation
2345 Enable the built-in global declarations
2346 @smallexample
2347 void operator delete (void *, std::size_t) noexcept;
2348 void operator delete[] (void *, std::size_t) noexcept;
2349 @end smallexample
2350 as introduced in C++14.  This is useful for user-defined replacement
2351 deallocation functions that, for example, use the size of the object
2352 to make deallocation faster.  Enabled by default under
2353 @option{-std=c++14} and above.  The flag @option{-Wsized-deallocation}
2354 warns about places that might want to add a definition.
2356 @item -fstats
2357 @opindex fstats
2358 Emit statistics about front-end processing at the end of the compilation.
2359 This information is generally only useful to the G++ development team.
2361 @item -fstrict-enums
2362 @opindex fstrict-enums
2363 Allow the compiler to optimize using the assumption that a value of
2364 enumerated type can only be one of the values of the enumeration (as
2365 defined in the C++ standard; basically, a value that can be
2366 represented in the minimum number of bits needed to represent all the
2367 enumerators).  This assumption may not be valid if the program uses a
2368 cast to convert an arbitrary integer value to the enumerated type.
2370 @item -ftemplate-backtrace-limit=@var{n}
2371 @opindex ftemplate-backtrace-limit
2372 Set the maximum number of template instantiation notes for a single
2373 warning or error to @var{n}.  The default value is 10.
2375 @item -ftemplate-depth=@var{n}
2376 @opindex ftemplate-depth
2377 Set the maximum instantiation depth for template classes to @var{n}.
2378 A limit on the template instantiation depth is needed to detect
2379 endless recursions during template class instantiation.  ANSI/ISO C++
2380 conforming programs must not rely on a maximum depth greater than 17
2381 (changed to 1024 in C++11).  The default value is 900, as the compiler
2382 can run out of stack space before hitting 1024 in some situations.
2384 @item -fno-threadsafe-statics
2385 @opindex fno-threadsafe-statics
2386 Do not emit the extra code to use the routines specified in the C++
2387 ABI for thread-safe initialization of local statics.  You can use this
2388 option to reduce code size slightly in code that doesn't need to be
2389 thread-safe.
2391 @item -fuse-cxa-atexit
2392 @opindex fuse-cxa-atexit
2393 Register destructors for objects with static storage duration with the
2394 @code{__cxa_atexit} function rather than the @code{atexit} function.
2395 This option is required for fully standards-compliant handling of static
2396 destructors, but only works if your C library supports
2397 @code{__cxa_atexit}.
2399 @item -fno-use-cxa-get-exception-ptr
2400 @opindex fno-use-cxa-get-exception-ptr
2401 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2402 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2403 if the runtime routine is not available.
2405 @item -fvisibility-inlines-hidden
2406 @opindex fvisibility-inlines-hidden
2407 This switch declares that the user does not attempt to compare
2408 pointers to inline functions or methods where the addresses of the two functions
2409 are taken in different shared objects.
2411 The effect of this is that GCC may, effectively, mark inline methods with
2412 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2413 appear in the export table of a DSO and do not require a PLT indirection
2414 when used within the DSO@.  Enabling this option can have a dramatic effect
2415 on load and link times of a DSO as it massively reduces the size of the
2416 dynamic export table when the library makes heavy use of templates.
2418 The behavior of this switch is not quite the same as marking the
2419 methods as hidden directly, because it does not affect static variables
2420 local to the function or cause the compiler to deduce that
2421 the function is defined in only one shared object.
2423 You may mark a method as having a visibility explicitly to negate the
2424 effect of the switch for that method.  For example, if you do want to
2425 compare pointers to a particular inline method, you might mark it as
2426 having default visibility.  Marking the enclosing class with explicit
2427 visibility has no effect.
2429 Explicitly instantiated inline methods are unaffected by this option
2430 as their linkage might otherwise cross a shared library boundary.
2431 @xref{Template Instantiation}.
2433 @item -fvisibility-ms-compat
2434 @opindex fvisibility-ms-compat
2435 This flag attempts to use visibility settings to make GCC's C++
2436 linkage model compatible with that of Microsoft Visual Studio.
2438 The flag makes these changes to GCC's linkage model:
2440 @enumerate
2441 @item
2442 It sets the default visibility to @code{hidden}, like
2443 @option{-fvisibility=hidden}.
2445 @item
2446 Types, but not their members, are not hidden by default.
2448 @item
2449 The One Definition Rule is relaxed for types without explicit
2450 visibility specifications that are defined in more than one
2451 shared object: those declarations are permitted if they are
2452 permitted when this option is not used.
2453 @end enumerate
2455 In new code it is better to use @option{-fvisibility=hidden} and
2456 export those classes that are intended to be externally visible.
2457 Unfortunately it is possible for code to rely, perhaps accidentally,
2458 on the Visual Studio behavior.
2460 Among the consequences of these changes are that static data members
2461 of the same type with the same name but defined in different shared
2462 objects are different, so changing one does not change the other;
2463 and that pointers to function members defined in different shared
2464 objects may not compare equal.  When this flag is given, it is a
2465 violation of the ODR to define types with the same name differently.
2467 @item -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]}
2468 @opindex fvtable-verify
2469 Turn on (or off, if using @option{-fvtable-verify=none}) the security
2470 feature that verifies at run time, for every virtual call, that
2471 the vtable pointer through which the call is made is valid for the type of
2472 the object, and has not been corrupted or overwritten.  If an invalid vtable
2473 pointer is detected at run time, an error is reported and execution of the
2474 program is immediately halted.
2476 This option causes run-time data structures to be built at program startup,
2477 which are used for verifying the vtable pointers.  
2478 The options @samp{std} and @samp{preinit}
2479 control the timing of when these data structures are built.  In both cases the
2480 data structures are built before execution reaches @code{main}.  Using
2481 @option{-fvtable-verify=std} causes the data structures to be built after
2482 shared libraries have been loaded and initialized.
2483 @option{-fvtable-verify=preinit} causes them to be built before shared
2484 libraries have been loaded and initialized.
2486 If this option appears multiple times in the command line with different
2487 values specified, @samp{none} takes highest priority over both @samp{std} and
2488 @samp{preinit}; @samp{preinit} takes priority over @samp{std}.
2490 @item -fvtv-debug
2491 @opindex fvtv-debug
2492 When used in conjunction with @option{-fvtable-verify=std} or 
2493 @option{-fvtable-verify=preinit}, causes debug versions of the 
2494 runtime functions for the vtable verification feature to be called.  
2495 This flag also causes the compiler to log information about which 
2496 vtable pointers it finds for each class.
2497 This information is written to a file named @file{vtv_set_ptr_data.log} 
2498 in the directory named by the environment variable @env{VTV_LOGS_DIR} 
2499 if that is defined or the current working directory otherwise.
2501 Note:  This feature @emph{appends} data to the log file. If you want a fresh log
2502 file, be sure to delete any existing one.
2504 @item -fvtv-counts
2505 @opindex fvtv-counts
2506 This is a debugging flag.  When used in conjunction with
2507 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
2508 causes the compiler to keep track of the total number of virtual calls
2509 it encounters and the number of verifications it inserts.  It also
2510 counts the number of calls to certain run-time library functions
2511 that it inserts and logs this information for each compilation unit.
2512 The compiler writes this information to a file named
2513 @file{vtv_count_data.log} in the directory named by the environment
2514 variable @env{VTV_LOGS_DIR} if that is defined or the current working
2515 directory otherwise.  It also counts the size of the vtable pointer sets
2516 for each class, and writes this information to @file{vtv_class_set_sizes.log}
2517 in the same directory.
2519 Note:  This feature @emph{appends} data to the log files.  To get fresh log
2520 files, be sure to delete any existing ones.
2522 @item -fno-weak
2523 @opindex fno-weak
2524 Do not use weak symbol support, even if it is provided by the linker.
2525 By default, G++ uses weak symbols if they are available.  This
2526 option exists only for testing, and should not be used by end-users;
2527 it results in inferior code and has no benefits.  This option may
2528 be removed in a future release of G++.
2530 @item -nostdinc++
2531 @opindex nostdinc++
2532 Do not search for header files in the standard directories specific to
2533 C++, but do still search the other standard directories.  (This option
2534 is used when building the C++ library.)
2535 @end table
2537 In addition, these optimization, warning, and code generation options
2538 have meanings only for C++ programs:
2540 @table @gcctabopt
2541 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2542 @opindex Wabi
2543 @opindex Wno-abi
2544 When an explicit @option{-fabi-version=@var{n}} option is used, causes
2545 G++ to warn when it generates code that is probably not compatible with the
2546 vendor-neutral C++ ABI@.  Since G++ now defaults to
2547 @option{-fabi-version=0}, @option{-Wabi} has no effect unless either
2548 an older ABI version is selected (with @option{-fabi-version=@var{n}})
2549 or an older compatibility version is selected (with
2550 @option{-Wabi=@var{n}} or @option{-fabi-compat-version=@var{n}}).
2552 Although an effort has been made to warn about
2553 all such cases, there are probably some cases that are not warned about,
2554 even though G++ is generating incompatible code.  There may also be
2555 cases where warnings are emitted even though the code that is generated
2556 is compatible.
2558 You should rewrite your code to avoid these warnings if you are
2559 concerned about the fact that code generated by G++ may not be binary
2560 compatible with code generated by other compilers.
2562 @option{-Wabi} can also be used with an explicit version number to
2563 warn about compatibility with a particular @option{-fabi-version}
2564 level, e.g. @option{-Wabi=2} to warn about changes relative to
2565 @option{-fabi-version=2}.  Specifying a version number also sets
2566 @option{-fabi-compat-version=@var{n}}.
2568 The known incompatibilities in @option{-fabi-version=2} (which was the
2569 default from GCC 3.4 to 4.9) include:
2571 @itemize @bullet
2573 @item
2574 A template with a non-type template parameter of reference type was
2575 mangled incorrectly:
2576 @smallexample
2577 extern int N;
2578 template <int &> struct S @{@};
2579 void n (S<N>) @{2@}
2580 @end smallexample
2582 This was fixed in @option{-fabi-version=3}.
2584 @item
2585 SIMD vector types declared using @code{__attribute ((vector_size))} were
2586 mangled in a non-standard way that does not allow for overloading of
2587 functions taking vectors of different sizes.
2589 The mangling was changed in @option{-fabi-version=4}.
2591 @item
2592 @code{__attribute ((const))} and @code{noreturn} were mangled as type
2593 qualifiers, and @code{decltype} of a plain declaration was folded away.
2595 These mangling issues were fixed in @option{-fabi-version=5}.
2597 @item
2598 Scoped enumerators passed as arguments to a variadic function are
2599 promoted like unscoped enumerators, causing @code{va_arg} to complain.
2600 On most targets this does not actually affect the parameter passing
2601 ABI, as there is no way to pass an argument smaller than @code{int}.
2603 Also, the ABI changed the mangling of template argument packs,
2604 @code{const_cast}, @code{static_cast}, prefix increment/decrement, and
2605 a class scope function used as a template argument.
2607 These issues were corrected in @option{-fabi-version=6}.
2609 @item
2610 Lambdas in default argument scope were mangled incorrectly, and the
2611 ABI changed the mangling of @code{nullptr_t}.
2613 These issues were corrected in @option{-fabi-version=7}.
2615 @item
2616 When mangling a function type with function-cv-qualifiers, the
2617 un-qualified function type was incorrectly treated as a substitution
2618 candidate.
2620 This was fixed in @option{-fabi-version=8}.
2621 @end itemize
2623 It also warns about psABI-related changes.  The known psABI changes at this
2624 point include:
2626 @itemize @bullet
2628 @item
2629 For SysV/x86-64, unions with @code{long double} members are 
2630 passed in memory as specified in psABI.  For example:
2632 @smallexample
2633 union U @{
2634   long double ld;
2635   int i;
2637 @end smallexample
2639 @noindent
2640 @code{union U} is always passed in memory.
2642 @end itemize
2644 @item -Wabi-tag @r{(C++ and Objective-C++ only)}
2645 @opindex Wabi-tag
2646 @opindex -Wabi-tag
2647 Warn when a type with an ABI tag is used in a context that does not
2648 have that ABI tag.  See @ref{C++ Attributes} for more information
2649 about ABI tags.
2651 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2652 @opindex Wctor-dtor-privacy
2653 @opindex Wno-ctor-dtor-privacy
2654 Warn when a class seems unusable because all the constructors or
2655 destructors in that class are private, and it has neither friends nor
2656 public static member functions.  Also warn if there are no non-private
2657 methods, and there's at least one private member function that isn't
2658 a constructor or destructor.
2660 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2661 @opindex Wdelete-non-virtual-dtor
2662 @opindex Wno-delete-non-virtual-dtor
2663 Warn when @code{delete} is used to destroy an instance of a class that
2664 has virtual functions and non-virtual destructor. It is unsafe to delete
2665 an instance of a derived class through a pointer to a base class if the
2666 base class does not have a virtual destructor.  This warning is enabled
2667 by @option{-Wall}.
2669 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
2670 @opindex Wliteral-suffix
2671 @opindex Wno-literal-suffix
2672 Warn when a string or character literal is followed by a ud-suffix which does
2673 not begin with an underscore.  As a conforming extension, GCC treats such
2674 suffixes as separate preprocessing tokens in order to maintain backwards
2675 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
2676 For example:
2678 @smallexample
2679 #define __STDC_FORMAT_MACROS
2680 #include <inttypes.h>
2681 #include <stdio.h>
2683 int main() @{
2684   int64_t i64 = 123;
2685   printf("My int64: %"PRId64"\n", i64);
2687 @end smallexample
2689 In this case, @code{PRId64} is treated as a separate preprocessing token.
2691 This warning is enabled by default.
2693 @item -Wnarrowing @r{(C++ and Objective-C++ only)}
2694 @opindex Wnarrowing
2695 @opindex Wno-narrowing
2696 Warn when a narrowing conversion prohibited by C++11 occurs within
2697 @samp{@{ @}}, e.g.
2699 @smallexample
2700 int i = @{ 2.2 @}; // error: narrowing from double to int
2701 @end smallexample
2703 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2705 With @option{-std=c++11}, @option{-Wno-narrowing} suppresses for
2706 non-constants the diagnostic required by the standard.  Note that this
2707 does not affect the meaning of well-formed code; narrowing conversions
2708 are still considered ill-formed in SFINAE context.
2710 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2711 @opindex Wnoexcept
2712 @opindex Wno-noexcept
2713 Warn when a noexcept-expression evaluates to false because of a call
2714 to a function that does not have a non-throwing exception
2715 specification (i.e. @code{throw()} or @code{noexcept}) but is known by
2716 the compiler to never throw an exception.
2718 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2719 @opindex Wnon-virtual-dtor
2720 @opindex Wno-non-virtual-dtor
2721 Warn when a class has virtual functions and an accessible non-virtual
2722 destructor itself or in an accessible polymorphic base class, in which
2723 case it is possible but unsafe to delete an instance of a derived
2724 class through a pointer to the class itself or base class.  This
2725 warning is automatically enabled if @option{-Weffc++} is specified.
2727 @item -Wreorder @r{(C++ and Objective-C++ only)}
2728 @opindex Wreorder
2729 @opindex Wno-reorder
2730 @cindex reordering, warning
2731 @cindex warning for reordering of member initializers
2732 Warn when the order of member initializers given in the code does not
2733 match the order in which they must be executed.  For instance:
2735 @smallexample
2736 struct A @{
2737   int i;
2738   int j;
2739   A(): j (0), i (1) @{ @}
2741 @end smallexample
2743 @noindent
2744 The compiler rearranges the member initializers for @code{i}
2745 and @code{j} to match the declaration order of the members, emitting
2746 a warning to that effect.  This warning is enabled by @option{-Wall}.
2748 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
2749 @opindex fext-numeric-literals
2750 @opindex fno-ext-numeric-literals
2751 Accept imaginary, fixed-point, or machine-defined
2752 literal number suffixes as GNU extensions.
2753 When this option is turned off these suffixes are treated
2754 as C++11 user-defined literal numeric suffixes.
2755 This is on by default for all pre-C++11 dialects and all GNU dialects:
2756 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
2757 @option{-std=gnu++14}.
2758 This option is off by default
2759 for ISO C++11 onwards (@option{-std=c++11}, ...).
2760 @end table
2762 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2764 @table @gcctabopt
2765 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2766 @opindex Weffc++
2767 @opindex Wno-effc++
2768 Warn about violations of the following style guidelines from Scott Meyers'
2769 @cite{Effective C++} series of books:
2771 @itemize @bullet
2772 @item
2773 Define a copy constructor and an assignment operator for classes
2774 with dynamically-allocated memory.
2776 @item
2777 Prefer initialization to assignment in constructors.
2779 @item
2780 Have @code{operator=} return a reference to @code{*this}.
2782 @item
2783 Don't try to return a reference when you must return an object.
2785 @item
2786 Distinguish between prefix and postfix forms of increment and
2787 decrement operators.
2789 @item
2790 Never overload @code{&&}, @code{||}, or @code{,}.
2792 @end itemize
2794 This option also enables @option{-Wnon-virtual-dtor}, which is also
2795 one of the effective C++ recommendations.  However, the check is
2796 extended to warn about the lack of virtual destructor in accessible
2797 non-polymorphic bases classes too.
2799 When selecting this option, be aware that the standard library
2800 headers do not obey all of these guidelines; use @samp{grep -v}
2801 to filter out those warnings.
2803 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2804 @opindex Wstrict-null-sentinel
2805 @opindex Wno-strict-null-sentinel
2806 Warn about the use of an uncasted @code{NULL} as sentinel.  When
2807 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2808 to @code{__null}.  Although it is a null pointer constant rather than a
2809 null pointer, it is guaranteed to be of the same size as a pointer.
2810 But this use is not portable across different compilers.
2812 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2813 @opindex Wno-non-template-friend
2814 @opindex Wnon-template-friend
2815 Disable warnings when non-templatized friend functions are declared
2816 within a template.  Since the advent of explicit template specification
2817 support in G++, if the name of the friend is an unqualified-id (i.e.,
2818 @samp{friend foo(int)}), the C++ language specification demands that the
2819 friend declare or define an ordinary, nontemplate function.  (Section
2820 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2821 could be interpreted as a particular specialization of a templatized
2822 function.  Because this non-conforming behavior is no longer the default
2823 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2824 check existing code for potential trouble spots and is on by default.
2825 This new compiler behavior can be turned off with
2826 @option{-Wno-non-template-friend}, which keeps the conformant compiler code
2827 but disables the helpful warning.
2829 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2830 @opindex Wold-style-cast
2831 @opindex Wno-old-style-cast
2832 Warn if an old-style (C-style) cast to a non-void type is used within
2833 a C++ program.  The new-style casts (@code{dynamic_cast},
2834 @code{static_cast}, @code{reinterpret_cast}, and @code{const_cast}) are
2835 less vulnerable to unintended effects and much easier to search for.
2837 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2838 @opindex Woverloaded-virtual
2839 @opindex Wno-overloaded-virtual
2840 @cindex overloaded virtual function, warning
2841 @cindex warning for overloaded virtual function
2842 Warn when a function declaration hides virtual functions from a
2843 base class.  For example, in:
2845 @smallexample
2846 struct A @{
2847   virtual void f();
2850 struct B: public A @{
2851   void f(int);
2853 @end smallexample
2855 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2856 like:
2858 @smallexample
2859 B* b;
2860 b->f();
2861 @end smallexample
2863 @noindent
2864 fails to compile.
2866 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2867 @opindex Wno-pmf-conversions
2868 @opindex Wpmf-conversions
2869 Disable the diagnostic for converting a bound pointer to member function
2870 to a plain pointer.
2872 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2873 @opindex Wsign-promo
2874 @opindex Wno-sign-promo
2875 Warn when overload resolution chooses a promotion from unsigned or
2876 enumerated type to a signed type, over a conversion to an unsigned type of
2877 the same size.  Previous versions of G++ tried to preserve
2878 unsignedness, but the standard mandates the current behavior.
2879 @end table
2881 @node Objective-C and Objective-C++ Dialect Options
2882 @section Options Controlling Objective-C and Objective-C++ Dialects
2884 @cindex compiler options, Objective-C and Objective-C++
2885 @cindex Objective-C and Objective-C++ options, command-line
2886 @cindex options, Objective-C and Objective-C++
2887 (NOTE: This manual does not describe the Objective-C and Objective-C++
2888 languages themselves.  @xref{Standards,,Language Standards
2889 Supported by GCC}, for references.)
2891 This section describes the command-line options that are only meaningful
2892 for Objective-C and Objective-C++ programs.  You can also use most of
2893 the language-independent GNU compiler options.
2894 For example, you might compile a file @file{some_class.m} like this:
2896 @smallexample
2897 gcc -g -fgnu-runtime -O -c some_class.m
2898 @end smallexample
2900 @noindent
2901 In this example, @option{-fgnu-runtime} is an option meant only for
2902 Objective-C and Objective-C++ programs; you can use the other options with
2903 any language supported by GCC@.
2905 Note that since Objective-C is an extension of the C language, Objective-C
2906 compilations may also use options specific to the C front-end (e.g.,
2907 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2908 C++-specific options (e.g., @option{-Wabi}).
2910 Here is a list of options that are @emph{only} for compiling Objective-C
2911 and Objective-C++ programs:
2913 @table @gcctabopt
2914 @item -fconstant-string-class=@var{class-name}
2915 @opindex fconstant-string-class
2916 Use @var{class-name} as the name of the class to instantiate for each
2917 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2918 class name is @code{NXConstantString} if the GNU runtime is being used, and
2919 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2920 @option{-fconstant-cfstrings} option, if also present, overrides the
2921 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2922 to be laid out as constant CoreFoundation strings.
2924 @item -fgnu-runtime
2925 @opindex fgnu-runtime
2926 Generate object code compatible with the standard GNU Objective-C
2927 runtime.  This is the default for most types of systems.
2929 @item -fnext-runtime
2930 @opindex fnext-runtime
2931 Generate output compatible with the NeXT runtime.  This is the default
2932 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2933 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2934 used.
2936 @item -fno-nil-receivers
2937 @opindex fno-nil-receivers
2938 Assume that all Objective-C message dispatches (@code{[receiver
2939 message:arg]}) in this translation unit ensure that the receiver is
2940 not @code{nil}.  This allows for more efficient entry points in the
2941 runtime to be used.  This option is only available in conjunction with
2942 the NeXT runtime and ABI version 0 or 1.
2944 @item -fobjc-abi-version=@var{n}
2945 @opindex fobjc-abi-version
2946 Use version @var{n} of the Objective-C ABI for the selected runtime.
2947 This option is currently supported only for the NeXT runtime.  In that
2948 case, Version 0 is the traditional (32-bit) ABI without support for
2949 properties and other Objective-C 2.0 additions.  Version 1 is the
2950 traditional (32-bit) ABI with support for properties and other
2951 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
2952 nothing is specified, the default is Version 0 on 32-bit target
2953 machines, and Version 2 on 64-bit target machines.
2955 @item -fobjc-call-cxx-cdtors
2956 @opindex fobjc-call-cxx-cdtors
2957 For each Objective-C class, check if any of its instance variables is a
2958 C++ object with a non-trivial default constructor.  If so, synthesize a
2959 special @code{- (id) .cxx_construct} instance method which runs
2960 non-trivial default constructors on any such instance variables, in order,
2961 and then return @code{self}.  Similarly, check if any instance variable
2962 is a C++ object with a non-trivial destructor, and if so, synthesize a
2963 special @code{- (void) .cxx_destruct} method which runs
2964 all such default destructors, in reverse order.
2966 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
2967 methods thusly generated only operate on instance variables
2968 declared in the current Objective-C class, and not those inherited
2969 from superclasses.  It is the responsibility of the Objective-C
2970 runtime to invoke all such methods in an object's inheritance
2971 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
2972 by the runtime immediately after a new object instance is allocated;
2973 the @code{- (void) .cxx_destruct} methods are invoked immediately
2974 before the runtime deallocates an object instance.
2976 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2977 support for invoking the @code{- (id) .cxx_construct} and
2978 @code{- (void) .cxx_destruct} methods.
2980 @item -fobjc-direct-dispatch
2981 @opindex fobjc-direct-dispatch
2982 Allow fast jumps to the message dispatcher.  On Darwin this is
2983 accomplished via the comm page.
2985 @item -fobjc-exceptions
2986 @opindex fobjc-exceptions
2987 Enable syntactic support for structured exception handling in
2988 Objective-C, similar to what is offered by C++ and Java.  This option
2989 is required to use the Objective-C keywords @code{@@try},
2990 @code{@@throw}, @code{@@catch}, @code{@@finally} and
2991 @code{@@synchronized}.  This option is available with both the GNU
2992 runtime and the NeXT runtime (but not available in conjunction with
2993 the NeXT runtime on Mac OS X 10.2 and earlier).
2995 @item -fobjc-gc
2996 @opindex fobjc-gc
2997 Enable garbage collection (GC) in Objective-C and Objective-C++
2998 programs.  This option is only available with the NeXT runtime; the
2999 GNU runtime has a different garbage collection implementation that
3000 does not require special compiler flags.
3002 @item -fobjc-nilcheck
3003 @opindex fobjc-nilcheck
3004 For the NeXT runtime with version 2 of the ABI, check for a nil
3005 receiver in method invocations before doing the actual method call.
3006 This is the default and can be disabled using
3007 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
3008 checked for nil in this way no matter what this flag is set to.
3009 Currently this flag does nothing when the GNU runtime, or an older
3010 version of the NeXT runtime ABI, is used.
3012 @item -fobjc-std=objc1
3013 @opindex fobjc-std
3014 Conform to the language syntax of Objective-C 1.0, the language
3015 recognized by GCC 4.0.  This only affects the Objective-C additions to
3016 the C/C++ language; it does not affect conformance to C/C++ standards,
3017 which is controlled by the separate C/C++ dialect option flags.  When
3018 this option is used with the Objective-C or Objective-C++ compiler,
3019 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
3020 This is useful if you need to make sure that your Objective-C code can
3021 be compiled with older versions of GCC@.
3023 @item -freplace-objc-classes
3024 @opindex freplace-objc-classes
3025 Emit a special marker instructing @command{ld(1)} not to statically link in
3026 the resulting object file, and allow @command{dyld(1)} to load it in at
3027 run time instead.  This is used in conjunction with the Fix-and-Continue
3028 debugging mode, where the object file in question may be recompiled and
3029 dynamically reloaded in the course of program execution, without the need
3030 to restart the program itself.  Currently, Fix-and-Continue functionality
3031 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
3032 and later.
3034 @item -fzero-link
3035 @opindex fzero-link
3036 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
3037 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
3038 compile time) with static class references that get initialized at load time,
3039 which improves run-time performance.  Specifying the @option{-fzero-link} flag
3040 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
3041 to be retained.  This is useful in Zero-Link debugging mode, since it allows
3042 for individual class implementations to be modified during program execution.
3043 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
3044 regardless of command-line options.
3046 @item -fno-local-ivars
3047 @opindex fno-local-ivars
3048 @opindex flocal-ivars
3049 By default instance variables in Objective-C can be accessed as if
3050 they were local variables from within the methods of the class they're
3051 declared in.  This can lead to shadowing between instance variables
3052 and other variables declared either locally inside a class method or
3053 globally with the same name.  Specifying the @option{-fno-local-ivars}
3054 flag disables this behavior thus avoiding variable shadowing issues.
3056 @item -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]}
3057 @opindex fivar-visibility
3058 Set the default instance variable visibility to the specified option
3059 so that instance variables declared outside the scope of any access
3060 modifier directives default to the specified visibility.
3062 @item -gen-decls
3063 @opindex gen-decls
3064 Dump interface declarations for all classes seen in the source file to a
3065 file named @file{@var{sourcename}.decl}.
3067 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
3068 @opindex Wassign-intercept
3069 @opindex Wno-assign-intercept
3070 Warn whenever an Objective-C assignment is being intercepted by the
3071 garbage collector.
3073 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
3074 @opindex Wno-protocol
3075 @opindex Wprotocol
3076 If a class is declared to implement a protocol, a warning is issued for
3077 every method in the protocol that is not implemented by the class.  The
3078 default behavior is to issue a warning for every method not explicitly
3079 implemented in the class, even if a method implementation is inherited
3080 from the superclass.  If you use the @option{-Wno-protocol} option, then
3081 methods inherited from the superclass are considered to be implemented,
3082 and no warning is issued for them.
3084 @item -Wselector @r{(Objective-C and Objective-C++ only)}
3085 @opindex Wselector
3086 @opindex Wno-selector
3087 Warn if multiple methods of different types for the same selector are
3088 found during compilation.  The check is performed on the list of methods
3089 in the final stage of compilation.  Additionally, a check is performed
3090 for each selector appearing in a @code{@@selector(@dots{})}
3091 expression, and a corresponding method for that selector has been found
3092 during compilation.  Because these checks scan the method table only at
3093 the end of compilation, these warnings are not produced if the final
3094 stage of compilation is not reached, for example because an error is
3095 found during compilation, or because the @option{-fsyntax-only} option is
3096 being used.
3098 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
3099 @opindex Wstrict-selector-match
3100 @opindex Wno-strict-selector-match
3101 Warn if multiple methods with differing argument and/or return types are
3102 found for a given selector when attempting to send a message using this
3103 selector to a receiver of type @code{id} or @code{Class}.  When this flag
3104 is off (which is the default behavior), the compiler omits such warnings
3105 if any differences found are confined to types that share the same size
3106 and alignment.
3108 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
3109 @opindex Wundeclared-selector
3110 @opindex Wno-undeclared-selector
3111 Warn if a @code{@@selector(@dots{})} expression referring to an
3112 undeclared selector is found.  A selector is considered undeclared if no
3113 method with that name has been declared before the
3114 @code{@@selector(@dots{})} expression, either explicitly in an
3115 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
3116 an @code{@@implementation} section.  This option always performs its
3117 checks as soon as a @code{@@selector(@dots{})} expression is found,
3118 while @option{-Wselector} only performs its checks in the final stage of
3119 compilation.  This also enforces the coding style convention
3120 that methods and selectors must be declared before being used.
3122 @item -print-objc-runtime-info
3123 @opindex print-objc-runtime-info
3124 Generate C header describing the largest structure that is passed by
3125 value, if any.
3127 @end table
3129 @node Language Independent Options
3130 @section Options to Control Diagnostic Messages Formatting
3131 @cindex options to control diagnostics formatting
3132 @cindex diagnostic messages
3133 @cindex message formatting
3135 Traditionally, diagnostic messages have been formatted irrespective of
3136 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
3137 options described below
3138 to control the formatting algorithm for diagnostic messages, 
3139 e.g.@: how many characters per line, how often source location
3140 information should be reported.  Note that some language front ends may not
3141 honor these options.
3143 @table @gcctabopt
3144 @item -fmessage-length=@var{n}
3145 @opindex fmessage-length
3146 Try to format error messages so that they fit on lines of about
3147 @var{n} characters.  If @var{n} is zero, then no line-wrapping is
3148 done; each error message appears on a single line.  This is the
3149 default for all front ends.
3151 @item -fdiagnostics-show-location=once
3152 @opindex fdiagnostics-show-location
3153 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
3154 reporter to emit source location information @emph{once}; that is, in
3155 case the message is too long to fit on a single physical line and has to
3156 be wrapped, the source location won't be emitted (as prefix) again,
3157 over and over, in subsequent continuation lines.  This is the default
3158 behavior.
3160 @item -fdiagnostics-show-location=every-line
3161 Only meaningful in line-wrapping mode.  Instructs the diagnostic
3162 messages reporter to emit the same source location information (as
3163 prefix) for physical lines that result from the process of breaking
3164 a message which is too long to fit on a single line.
3166 @item -fdiagnostics-color[=@var{WHEN}]
3167 @itemx -fno-diagnostics-color
3168 @opindex fdiagnostics-color
3169 @cindex highlight, color, colour
3170 @vindex GCC_COLORS @r{environment variable}
3171 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
3172 or @samp{auto}.  The default depends on how the compiler has been configured,
3173 it can be any of the above @var{WHEN} options or also @samp{never}
3174 if @env{GCC_COLORS} environment variable isn't present in the environment,
3175 and @samp{auto} otherwise.
3176 @samp{auto} means to use color only when the standard error is a terminal.
3177 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
3178 aliases for @option{-fdiagnostics-color=always} and
3179 @option{-fdiagnostics-color=never}, respectively.
3181 The colors are defined by the environment variable @env{GCC_COLORS}.
3182 Its value is a colon-separated list of capabilities and Select Graphic
3183 Rendition (SGR) substrings. SGR commands are interpreted by the
3184 terminal or terminal emulator.  (See the section in the documentation
3185 of your text terminal for permitted values and their meanings as
3186 character attributes.)  These substring values are integers in decimal
3187 representation and can be concatenated with semicolons.
3188 Common values to concatenate include
3189 @samp{1} for bold,
3190 @samp{4} for underline,
3191 @samp{5} for blink,
3192 @samp{7} for inverse,
3193 @samp{39} for default foreground color,
3194 @samp{30} to @samp{37} for foreground colors,
3195 @samp{90} to @samp{97} for 16-color mode foreground colors,
3196 @samp{38;5;0} to @samp{38;5;255}
3197 for 88-color and 256-color modes foreground colors,
3198 @samp{49} for default background color,
3199 @samp{40} to @samp{47} for background colors,
3200 @samp{100} to @samp{107} for 16-color mode background colors,
3201 and @samp{48;5;0} to @samp{48;5;255}
3202 for 88-color and 256-color modes background colors.
3204 The default @env{GCC_COLORS} is
3205 @smallexample
3206 error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01
3207 @end smallexample
3208 @noindent
3209 where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
3210 @samp{01;36} is bold cyan, @samp{01;32} is bold green and
3211 @samp{01} is bold. Setting @env{GCC_COLORS} to the empty
3212 string disables colors.
3213 Supported capabilities are as follows.
3215 @table @code
3216 @item error=
3217 @vindex error GCC_COLORS @r{capability}
3218 SGR substring for error: markers.
3220 @item warning=
3221 @vindex warning GCC_COLORS @r{capability}
3222 SGR substring for warning: markers.
3224 @item note=
3225 @vindex note GCC_COLORS @r{capability}
3226 SGR substring for note: markers.
3228 @item caret=
3229 @vindex caret GCC_COLORS @r{capability}
3230 SGR substring for caret line.
3232 @item locus=
3233 @vindex locus GCC_COLORS @r{capability}
3234 SGR substring for location information, @samp{file:line} or
3235 @samp{file:line:column} etc.
3237 @item quote=
3238 @vindex quote GCC_COLORS @r{capability}
3239 SGR substring for information printed within quotes.
3240 @end table
3242 @item -fno-diagnostics-show-option
3243 @opindex fno-diagnostics-show-option
3244 @opindex fdiagnostics-show-option
3245 By default, each diagnostic emitted includes text indicating the
3246 command-line option that directly controls the diagnostic (if such an
3247 option is known to the diagnostic machinery).  Specifying the
3248 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
3250 @item -fno-diagnostics-show-caret
3251 @opindex fno-diagnostics-show-caret
3252 @opindex fdiagnostics-show-caret
3253 By default, each diagnostic emitted includes the original source line
3254 and a caret '^' indicating the column.  This option suppresses this
3255 information.  The source line is truncated to @var{n} characters, if
3256 the @option{-fmessage-length=n} option is given.  When the output is done
3257 to the terminal, the width is limited to the width given by the
3258 @env{COLUMNS} environment variable or, if not set, to the terminal width.
3260 @end table
3262 @node Warning Options
3263 @section Options to Request or Suppress Warnings
3264 @cindex options to control warnings
3265 @cindex warning messages
3266 @cindex messages, warning
3267 @cindex suppressing warnings
3269 Warnings are diagnostic messages that report constructions that
3270 are not inherently erroneous but that are risky or suggest there
3271 may have been an error.
3273 The following language-independent options do not enable specific
3274 warnings but control the kinds of diagnostics produced by GCC@.
3276 @table @gcctabopt
3277 @cindex syntax checking
3278 @item -fsyntax-only
3279 @opindex fsyntax-only
3280 Check the code for syntax errors, but don't do anything beyond that.
3282 @item -fmax-errors=@var{n}
3283 @opindex fmax-errors
3284 Limits the maximum number of error messages to @var{n}, at which point
3285 GCC bails out rather than attempting to continue processing the source
3286 code.  If @var{n} is 0 (the default), there is no limit on the number
3287 of error messages produced.  If @option{-Wfatal-errors} is also
3288 specified, then @option{-Wfatal-errors} takes precedence over this
3289 option.
3291 @item -w
3292 @opindex w
3293 Inhibit all warning messages.
3295 @item -Werror
3296 @opindex Werror
3297 @opindex Wno-error
3298 Make all warnings into errors.
3300 @item -Werror=
3301 @opindex Werror=
3302 @opindex Wno-error=
3303 Make the specified warning into an error.  The specifier for a warning
3304 is appended; for example @option{-Werror=switch} turns the warnings
3305 controlled by @option{-Wswitch} into errors.  This switch takes a
3306 negative form, to be used to negate @option{-Werror} for specific
3307 warnings; for example @option{-Wno-error=switch} makes
3308 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3309 is in effect.
3311 The warning message for each controllable warning includes the
3312 option that controls the warning.  That option can then be used with
3313 @option{-Werror=} and @option{-Wno-error=} as described above.
3314 (Printing of the option in the warning message can be disabled using the
3315 @option{-fno-diagnostics-show-option} flag.)
3317 Note that specifying @option{-Werror=}@var{foo} automatically implies
3318 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3319 imply anything.
3321 @item -Wfatal-errors
3322 @opindex Wfatal-errors
3323 @opindex Wno-fatal-errors
3324 This option causes the compiler to abort compilation on the first error
3325 occurred rather than trying to keep going and printing further error
3326 messages.
3328 @end table
3330 You can request many specific warnings with options beginning with
3331 @samp{-W}, for example @option{-Wimplicit} to request warnings on
3332 implicit declarations.  Each of these specific warning options also
3333 has a negative form beginning @samp{-Wno-} to turn off warnings; for
3334 example, @option{-Wno-implicit}.  This manual lists only one of the
3335 two forms, whichever is not the default.  For further
3336 language-specific options also refer to @ref{C++ Dialect Options} and
3337 @ref{Objective-C and Objective-C++ Dialect Options}.
3339 Some options, such as @option{-Wall} and @option{-Wextra}, turn on other
3340 options, such as @option{-Wunused}, which may turn on further options,
3341 such as @option{-Wunused-value}. The combined effect of positive and
3342 negative forms is that more specific options have priority over less
3343 specific ones, independently of their position in the command-line. For
3344 options of the same specificity, the last one takes effect. Options
3345 enabled or disabled via pragmas (@pxref{Diagnostic Pragmas}) take effect
3346 as if they appeared at the end of the command-line.
3348 When an unrecognized warning option is requested (e.g.,
3349 @option{-Wunknown-warning}), GCC emits a diagnostic stating
3350 that the option is not recognized.  However, if the @option{-Wno-} form
3351 is used, the behavior is slightly different: no diagnostic is
3352 produced for @option{-Wno-unknown-warning} unless other diagnostics
3353 are being produced.  This allows the use of new @option{-Wno-} options
3354 with old compilers, but if something goes wrong, the compiler
3355 warns that an unrecognized option is present.
3357 @table @gcctabopt
3358 @item -Wpedantic
3359 @itemx -pedantic
3360 @opindex pedantic
3361 @opindex Wpedantic
3362 Issue all the warnings demanded by strict ISO C and ISO C++;
3363 reject all programs that use forbidden extensions, and some other
3364 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
3365 version of the ISO C standard specified by any @option{-std} option used.
3367 Valid ISO C and ISO C++ programs should compile properly with or without
3368 this option (though a rare few require @option{-ansi} or a
3369 @option{-std} option specifying the required version of ISO C)@.  However,
3370 without this option, certain GNU extensions and traditional C and C++
3371 features are supported as well.  With this option, they are rejected.
3373 @option{-Wpedantic} does not cause warning messages for use of the
3374 alternate keywords whose names begin and end with @samp{__}.  Pedantic
3375 warnings are also disabled in the expression that follows
3376 @code{__extension__}.  However, only system header files should use
3377 these escape routes; application programs should avoid them.
3378 @xref{Alternate Keywords}.
3380 Some users try to use @option{-Wpedantic} to check programs for strict ISO
3381 C conformance.  They soon find that it does not do quite what they want:
3382 it finds some non-ISO practices, but not all---only those for which
3383 ISO C @emph{requires} a diagnostic, and some others for which
3384 diagnostics have been added.
3386 A feature to report any failure to conform to ISO C might be useful in
3387 some instances, but would require considerable additional work and would
3388 be quite different from @option{-Wpedantic}.  We don't have plans to
3389 support such a feature in the near future.
3391 Where the standard specified with @option{-std} represents a GNU
3392 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3393 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3394 extended dialect is based.  Warnings from @option{-Wpedantic} are given
3395 where they are required by the base standard.  (It does not make sense
3396 for such warnings to be given only for features not in the specified GNU
3397 C dialect, since by definition the GNU dialects of C include all
3398 features the compiler supports with the given option, and there would be
3399 nothing to warn about.)
3401 @item -pedantic-errors
3402 @opindex pedantic-errors
3403 Give an error whenever the @dfn{base standard} (see @option{-Wpedantic})
3404 requires a diagnostic, in some cases where there is undefined behavior
3405 at compile-time and in some other cases that do not prevent compilation
3406 of programs that are valid according to the standard. This is not
3407 equivalent to @option{-Werror=pedantic}, since there are errors enabled
3408 by this option and not enabled by the latter and vice versa.
3410 @item -Wall
3411 @opindex Wall
3412 @opindex Wno-all
3413 This enables all the warnings about constructions that some users
3414 consider questionable, and that are easy to avoid (or modify to
3415 prevent the warning), even in conjunction with macros.  This also
3416 enables some language-specific warnings described in @ref{C++ Dialect
3417 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3419 @option{-Wall} turns on the following warning flags:
3421 @gccoptlist{-Waddress   @gol
3422 -Warray-bounds=1 @r{(only with} @option{-O2}@r{)}  @gol
3423 -Wc++11-compat  -Wc++14-compat@gol
3424 -Wchar-subscripts  @gol
3425 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
3426 -Wimplicit-int @r{(C and Objective-C only)} @gol
3427 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3428 -Wcomment  @gol
3429 -Wformat   @gol
3430 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3431 -Wmaybe-uninitialized @gol
3432 -Wmissing-braces @r{(only for C/ObjC)} @gol
3433 -Wnonnull  @gol
3434 -Wopenmp-simd @gol
3435 -Wparentheses  @gol
3436 -Wpointer-sign  @gol
3437 -Wreorder   @gol
3438 -Wreturn-type  @gol
3439 -Wsequence-point  @gol
3440 -Wsign-compare @r{(only in C++)}  @gol
3441 -Wstrict-aliasing  @gol
3442 -Wstrict-overflow=1  @gol
3443 -Wswitch  @gol
3444 -Wtrigraphs  @gol
3445 -Wuninitialized  @gol
3446 -Wunknown-pragmas  @gol
3447 -Wunused-function  @gol
3448 -Wunused-label     @gol
3449 -Wunused-value     @gol
3450 -Wunused-variable  @gol
3451 -Wvolatile-register-var @gol
3454 Note that some warning flags are not implied by @option{-Wall}.  Some of
3455 them warn about constructions that users generally do not consider
3456 questionable, but which occasionally you might wish to check for;
3457 others warn about constructions that are necessary or hard to avoid in
3458 some cases, and there is no simple way to modify the code to suppress
3459 the warning. Some of them are enabled by @option{-Wextra} but many of
3460 them must be enabled individually.
3462 @item -Wextra
3463 @opindex W
3464 @opindex Wextra
3465 @opindex Wno-extra
3466 This enables some extra warning flags that are not enabled by
3467 @option{-Wall}. (This option used to be called @option{-W}.  The older
3468 name is still supported, but the newer name is more descriptive.)
3470 @gccoptlist{-Wclobbered  @gol
3471 -Wempty-body  @gol
3472 -Wignored-qualifiers @gol
3473 -Wmissing-field-initializers  @gol
3474 -Wmissing-parameter-type @r{(C only)}  @gol
3475 -Wold-style-declaration @r{(C only)}  @gol
3476 -Woverride-init  @gol
3477 -Wsign-compare  @gol
3478 -Wtype-limits  @gol
3479 -Wuninitialized  @gol
3480 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3481 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3484 The option @option{-Wextra} also prints warning messages for the
3485 following cases:
3487 @itemize @bullet
3489 @item
3490 A pointer is compared against integer zero with @code{<}, @code{<=},
3491 @code{>}, or @code{>=}.
3493 @item
3494 (C++ only) An enumerator and a non-enumerator both appear in a
3495 conditional expression.
3497 @item
3498 (C++ only) Ambiguous virtual bases.
3500 @item
3501 (C++ only) Subscripting an array that has been declared @code{register}.
3503 @item
3504 (C++ only) Taking the address of a variable that has been declared
3505 @code{register}.
3507 @item
3508 (C++ only) A base class is not initialized in a derived class's copy
3509 constructor.
3511 @end itemize
3513 @item -Wchar-subscripts
3514 @opindex Wchar-subscripts
3515 @opindex Wno-char-subscripts
3516 Warn if an array subscript has type @code{char}.  This is a common cause
3517 of error, as programmers often forget that this type is signed on some
3518 machines.
3519 This warning is enabled by @option{-Wall}.
3521 @item -Wcomment
3522 @opindex Wcomment
3523 @opindex Wno-comment
3524 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3525 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3526 This warning is enabled by @option{-Wall}.
3528 @item -Wno-coverage-mismatch
3529 @opindex Wno-coverage-mismatch
3530 Warn if feedback profiles do not match when using the
3531 @option{-fprofile-use} option.
3532 If a source file is changed between compiling with @option{-fprofile-gen} and
3533 with @option{-fprofile-use}, the files with the profile feedback can fail
3534 to match the source file and GCC cannot use the profile feedback
3535 information.  By default, this warning is enabled and is treated as an
3536 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3537 warning or @option{-Wno-error=coverage-mismatch} can be used to
3538 disable the error.  Disabling the error for this warning can result in
3539 poorly optimized code and is useful only in the
3540 case of very minor changes such as bug fixes to an existing code-base.
3541 Completely disabling the warning is not recommended.
3543 @item -Wno-cpp
3544 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3546 Suppress warning messages emitted by @code{#warning} directives.
3548 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3549 @opindex Wdouble-promotion
3550 @opindex Wno-double-promotion
3551 Give a warning when a value of type @code{float} is implicitly
3552 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3553 floating-point unit implement @code{float} in hardware, but emulate
3554 @code{double} in software.  On such a machine, doing computations
3555 using @code{double} values is much more expensive because of the
3556 overhead required for software emulation.
3558 It is easy to accidentally do computations with @code{double} because
3559 floating-point literals are implicitly of type @code{double}.  For
3560 example, in:
3561 @smallexample
3562 @group
3563 float area(float radius)
3565    return 3.14159 * radius * radius;
3567 @end group
3568 @end smallexample
3569 the compiler performs the entire computation with @code{double}
3570 because the floating-point literal is a @code{double}.
3572 @item -Wformat
3573 @itemx -Wformat=@var{n}
3574 @opindex Wformat
3575 @opindex Wno-format
3576 @opindex ffreestanding
3577 @opindex fno-builtin
3578 @opindex Wformat=
3579 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3580 the arguments supplied have types appropriate to the format string
3581 specified, and that the conversions specified in the format string make
3582 sense.  This includes standard functions, and others specified by format
3583 attributes (@pxref{Function Attributes}), in the @code{printf},
3584 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3585 not in the C standard) families (or other target-specific families).
3586 Which functions are checked without format attributes having been
3587 specified depends on the standard version selected, and such checks of
3588 functions without the attribute specified are disabled by
3589 @option{-ffreestanding} or @option{-fno-builtin}.
3591 The formats are checked against the format features supported by GNU
3592 libc version 2.2.  These include all ISO C90 and C99 features, as well
3593 as features from the Single Unix Specification and some BSD and GNU
3594 extensions.  Other library implementations may not support all these
3595 features; GCC does not support warning about features that go beyond a
3596 particular library's limitations.  However, if @option{-Wpedantic} is used
3597 with @option{-Wformat}, warnings are given about format features not
3598 in the selected standard version (but not for @code{strfmon} formats,
3599 since those are not in any version of the C standard).  @xref{C Dialect
3600 Options,,Options Controlling C Dialect}.
3602 @table @gcctabopt
3603 @item -Wformat=1
3604 @itemx -Wformat
3605 @opindex Wformat
3606 @opindex Wformat=1
3607 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
3608 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
3609 @option{-Wformat} also checks for null format arguments for several
3610 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
3611 aspects of this level of format checking can be disabled by the
3612 options: @option{-Wno-format-contains-nul},
3613 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
3614 @option{-Wformat} is enabled by @option{-Wall}.
3616 @item -Wno-format-contains-nul
3617 @opindex Wno-format-contains-nul
3618 @opindex Wformat-contains-nul
3619 If @option{-Wformat} is specified, do not warn about format strings that
3620 contain NUL bytes.
3622 @item -Wno-format-extra-args
3623 @opindex Wno-format-extra-args
3624 @opindex Wformat-extra-args
3625 If @option{-Wformat} is specified, do not warn about excess arguments to a
3626 @code{printf} or @code{scanf} format function.  The C standard specifies
3627 that such arguments are ignored.
3629 Where the unused arguments lie between used arguments that are
3630 specified with @samp{$} operand number specifications, normally
3631 warnings are still given, since the implementation could not know what
3632 type to pass to @code{va_arg} to skip the unused arguments.  However,
3633 in the case of @code{scanf} formats, this option suppresses the
3634 warning if the unused arguments are all pointers, since the Single
3635 Unix Specification says that such unused arguments are allowed.
3637 @item -Wno-format-zero-length
3638 @opindex Wno-format-zero-length
3639 @opindex Wformat-zero-length
3640 If @option{-Wformat} is specified, do not warn about zero-length formats.
3641 The C standard specifies that zero-length formats are allowed.
3644 @item -Wformat=2
3645 @opindex Wformat=2
3646 Enable @option{-Wformat} plus additional format checks.  Currently
3647 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
3648 -Wformat-y2k}.
3650 @item -Wformat-nonliteral
3651 @opindex Wformat-nonliteral
3652 @opindex Wno-format-nonliteral
3653 If @option{-Wformat} is specified, also warn if the format string is not a
3654 string literal and so cannot be checked, unless the format function
3655 takes its format arguments as a @code{va_list}.
3657 @item -Wformat-security
3658 @opindex Wformat-security
3659 @opindex Wno-format-security
3660 If @option{-Wformat} is specified, also warn about uses of format
3661 functions that represent possible security problems.  At present, this
3662 warns about calls to @code{printf} and @code{scanf} functions where the
3663 format string is not a string literal and there are no format arguments,
3664 as in @code{printf (foo);}.  This may be a security hole if the format
3665 string came from untrusted input and contains @samp{%n}.  (This is
3666 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3667 in future warnings may be added to @option{-Wformat-security} that are not
3668 included in @option{-Wformat-nonliteral}.)
3670 @item -Wformat-signedness
3671 @opindex Wformat-signedness
3672 @opindex Wno-format-signedness
3673 If @option{-Wformat} is specified, also warn if the format string
3674 requires an unsigned argument and the argument is signed and vice versa.
3676 @item -Wformat-y2k
3677 @opindex Wformat-y2k
3678 @opindex Wno-format-y2k
3679 If @option{-Wformat} is specified, also warn about @code{strftime}
3680 formats that may yield only a two-digit year.
3681 @end table
3683 @item -Wnonnull
3684 @opindex Wnonnull
3685 @opindex Wno-nonnull
3686 Warn about passing a null pointer for arguments marked as
3687 requiring a non-null value by the @code{nonnull} function attribute.
3689 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3690 can be disabled with the @option{-Wno-nonnull} option.
3692 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3693 @opindex Winit-self
3694 @opindex Wno-init-self
3695 Warn about uninitialized variables that are initialized with themselves.
3696 Note this option can only be used with the @option{-Wuninitialized} option.
3698 For example, GCC warns about @code{i} being uninitialized in the
3699 following snippet only when @option{-Winit-self} has been specified:
3700 @smallexample
3701 @group
3702 int f()
3704   int i = i;
3705   return i;
3707 @end group
3708 @end smallexample
3710 This warning is enabled by @option{-Wall} in C++.
3712 @item -Wimplicit-int @r{(C and Objective-C only)}
3713 @opindex Wimplicit-int
3714 @opindex Wno-implicit-int
3715 Warn when a declaration does not specify a type.
3716 This warning is enabled by @option{-Wall}.
3718 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3719 @opindex Wimplicit-function-declaration
3720 @opindex Wno-implicit-function-declaration
3721 Give a warning whenever a function is used before being declared. In
3722 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3723 enabled by default and it is made into an error by
3724 @option{-pedantic-errors}. This warning is also enabled by
3725 @option{-Wall}.
3727 @item -Wimplicit @r{(C and Objective-C only)}
3728 @opindex Wimplicit
3729 @opindex Wno-implicit
3730 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3731 This warning is enabled by @option{-Wall}.
3733 @item -Wignored-qualifiers @r{(C and C++ only)}
3734 @opindex Wignored-qualifiers
3735 @opindex Wno-ignored-qualifiers
3736 Warn if the return type of a function has a type qualifier
3737 such as @code{const}.  For ISO C such a type qualifier has no effect,
3738 since the value returned by a function is not an lvalue.
3739 For C++, the warning is only emitted for scalar types or @code{void}.
3740 ISO C prohibits qualified @code{void} return types on function
3741 definitions, so such return types always receive a warning
3742 even without this option.
3744 This warning is also enabled by @option{-Wextra}.
3746 @item -Wmain
3747 @opindex Wmain
3748 @opindex Wno-main
3749 Warn if the type of @code{main} is suspicious.  @code{main} should be
3750 a function with external linkage, returning int, taking either zero
3751 arguments, two, or three arguments of appropriate types.  This warning
3752 is enabled by default in C++ and is enabled by either @option{-Wall}
3753 or @option{-Wpedantic}.
3755 @item -Wmissing-braces
3756 @opindex Wmissing-braces
3757 @opindex Wno-missing-braces
3758 Warn if an aggregate or union initializer is not fully bracketed.  In
3759 the following example, the initializer for @code{a} is not fully
3760 bracketed, but that for @code{b} is fully bracketed.  This warning is
3761 enabled by @option{-Wall} in C.
3763 @smallexample
3764 int a[2][2] = @{ 0, 1, 2, 3 @};
3765 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3766 @end smallexample
3768 This warning is enabled by @option{-Wall}.
3770 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3771 @opindex Wmissing-include-dirs
3772 @opindex Wno-missing-include-dirs
3773 Warn if a user-supplied include directory does not exist.
3775 @item -Wparentheses
3776 @opindex Wparentheses
3777 @opindex Wno-parentheses
3778 Warn if parentheses are omitted in certain contexts, such
3779 as when there is an assignment in a context where a truth value
3780 is expected, or when operators are nested whose precedence people
3781 often get confused about.
3783 Also warn if a comparison like @code{x<=y<=z} appears; this is
3784 equivalent to @code{(x<=y ? 1 : 0) <= z}, which is a different
3785 interpretation from that of ordinary mathematical notation.
3787 Also warn about constructions where there may be confusion to which
3788 @code{if} statement an @code{else} branch belongs.  Here is an example of
3789 such a case:
3791 @smallexample
3792 @group
3794   if (a)
3795     if (b)
3796       foo ();
3797   else
3798     bar ();
3800 @end group
3801 @end smallexample
3803 In C/C++, every @code{else} branch belongs to the innermost possible
3804 @code{if} statement, which in this example is @code{if (b)}.  This is
3805 often not what the programmer expected, as illustrated in the above
3806 example by indentation the programmer chose.  When there is the
3807 potential for this confusion, GCC issues a warning when this flag
3808 is specified.  To eliminate the warning, add explicit braces around
3809 the innermost @code{if} statement so there is no way the @code{else}
3810 can belong to the enclosing @code{if}.  The resulting code
3811 looks like this:
3813 @smallexample
3814 @group
3816   if (a)
3817     @{
3818       if (b)
3819         foo ();
3820       else
3821         bar ();
3822     @}
3824 @end group
3825 @end smallexample
3827 Also warn for dangerous uses of the GNU extension to
3828 @code{?:} with omitted middle operand. When the condition
3829 in the @code{?}: operator is a boolean expression, the omitted value is
3830 always 1.  Often programmers expect it to be a value computed
3831 inside the conditional expression instead.
3833 This warning is enabled by @option{-Wall}.
3835 @item -Wsequence-point
3836 @opindex Wsequence-point
3837 @opindex Wno-sequence-point
3838 Warn about code that may have undefined semantics because of violations
3839 of sequence point rules in the C and C++ standards.
3841 The C and C++ standards define the order in which expressions in a C/C++
3842 program are evaluated in terms of @dfn{sequence points}, which represent
3843 a partial ordering between the execution of parts of the program: those
3844 executed before the sequence point, and those executed after it.  These
3845 occur after the evaluation of a full expression (one which is not part
3846 of a larger expression), after the evaluation of the first operand of a
3847 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3848 function is called (but after the evaluation of its arguments and the
3849 expression denoting the called function), and in certain other places.
3850 Other than as expressed by the sequence point rules, the order of
3851 evaluation of subexpressions of an expression is not specified.  All
3852 these rules describe only a partial order rather than a total order,
3853 since, for example, if two functions are called within one expression
3854 with no sequence point between them, the order in which the functions
3855 are called is not specified.  However, the standards committee have
3856 ruled that function calls do not overlap.
3858 It is not specified when between sequence points modifications to the
3859 values of objects take effect.  Programs whose behavior depends on this
3860 have undefined behavior; the C and C++ standards specify that ``Between
3861 the previous and next sequence point an object shall have its stored
3862 value modified at most once by the evaluation of an expression.
3863 Furthermore, the prior value shall be read only to determine the value
3864 to be stored.''.  If a program breaks these rules, the results on any
3865 particular implementation are entirely unpredictable.
3867 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3868 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3869 diagnosed by this option, and it may give an occasional false positive
3870 result, but in general it has been found fairly effective at detecting
3871 this sort of problem in programs.
3873 The standard is worded confusingly, therefore there is some debate
3874 over the precise meaning of the sequence point rules in subtle cases.
3875 Links to discussions of the problem, including proposed formal
3876 definitions, may be found on the GCC readings page, at
3877 @uref{http://gcc.gnu.org/@/readings.html}.
3879 This warning is enabled by @option{-Wall} for C and C++.
3881 @item -Wno-return-local-addr
3882 @opindex Wno-return-local-addr
3883 @opindex Wreturn-local-addr
3884 Do not warn about returning a pointer (or in C++, a reference) to a
3885 variable that goes out of scope after the function returns.
3887 @item -Wreturn-type
3888 @opindex Wreturn-type
3889 @opindex Wno-return-type
3890 Warn whenever a function is defined with a return type that defaults
3891 to @code{int}.  Also warn about any @code{return} statement with no
3892 return value in a function whose return type is not @code{void}
3893 (falling off the end of the function body is considered returning
3894 without a value), and about a @code{return} statement with an
3895 expression in a function whose return type is @code{void}.
3897 For C++, a function without return type always produces a diagnostic
3898 message, even when @option{-Wno-return-type} is specified.  The only
3899 exceptions are @code{main} and functions defined in system headers.
3901 This warning is enabled by @option{-Wall}.
3903 @item -Wshift-count-negative
3904 @opindex Wshift-count-negative
3905 @opindex Wno-shift-count-negative
3906 Warn if shift count is negative. This warning is enabled by default.
3908 @item -Wshift-count-overflow
3909 @opindex Wshift-count-overflow
3910 @opindex Wno-shift-count-overflow
3911 Warn if shift count >= width of type. This warning is enabled by default.
3913 @item -Wswitch
3914 @opindex Wswitch
3915 @opindex Wno-switch
3916 Warn whenever a @code{switch} statement has an index of enumerated type
3917 and lacks a @code{case} for one or more of the named codes of that
3918 enumeration.  (The presence of a @code{default} label prevents this
3919 warning.)  @code{case} labels outside the enumeration range also
3920 provoke warnings when this option is used (even if there is a
3921 @code{default} label).
3922 This warning is enabled by @option{-Wall}.
3924 @item -Wswitch-default
3925 @opindex Wswitch-default
3926 @opindex Wno-switch-default
3927 Warn whenever a @code{switch} statement does not have a @code{default}
3928 case.
3930 @item -Wswitch-enum
3931 @opindex Wswitch-enum
3932 @opindex Wno-switch-enum
3933 Warn whenever a @code{switch} statement has an index of enumerated type
3934 and lacks a @code{case} for one or more of the named codes of that
3935 enumeration.  @code{case} labels outside the enumeration range also
3936 provoke warnings when this option is used.  The only difference
3937 between @option{-Wswitch} and this option is that this option gives a
3938 warning about an omitted enumeration code even if there is a
3939 @code{default} label.
3941 @item -Wswitch-bool
3942 @opindex Wswitch-bool
3943 @opindex Wno-switch-bool
3944 Warn whenever a @code{switch} statement has an index of boolean type.
3945 It is possible to suppress this warning by casting the controlling
3946 expression to a type other than @code{bool}.  For example:
3947 @smallexample
3948 @group
3949 switch ((int) (a == 4))
3950   @{
3951   @dots{}
3952   @}
3953 @end group
3954 @end smallexample
3955 This warning is enabled by default for C and C++ programs.
3957 @item -Wsync-nand @r{(C and C++ only)}
3958 @opindex Wsync-nand
3959 @opindex Wno-sync-nand
3960 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3961 built-in functions are used.  These functions changed semantics in GCC 4.4.
3963 @item -Wtrigraphs
3964 @opindex Wtrigraphs
3965 @opindex Wno-trigraphs
3966 Warn if any trigraphs are encountered that might change the meaning of
3967 the program (trigraphs within comments are not warned about).
3968 This warning is enabled by @option{-Wall}.
3970 @item -Wunused-but-set-parameter
3971 @opindex Wunused-but-set-parameter
3972 @opindex Wno-unused-but-set-parameter
3973 Warn whenever a function parameter is assigned to, but otherwise unused
3974 (aside from its declaration).
3976 To suppress this warning use the @code{unused} attribute
3977 (@pxref{Variable Attributes}).
3979 This warning is also enabled by @option{-Wunused} together with
3980 @option{-Wextra}.
3982 @item -Wunused-but-set-variable
3983 @opindex Wunused-but-set-variable
3984 @opindex Wno-unused-but-set-variable
3985 Warn whenever a local variable is assigned to, but otherwise unused
3986 (aside from its declaration).
3987 This warning is enabled by @option{-Wall}.
3989 To suppress this warning use the @code{unused} attribute
3990 (@pxref{Variable Attributes}).
3992 This warning is also enabled by @option{-Wunused}, which is enabled
3993 by @option{-Wall}.
3995 @item -Wunused-function
3996 @opindex Wunused-function
3997 @opindex Wno-unused-function
3998 Warn whenever a static function is declared but not defined or a
3999 non-inline static function is unused.
4000 This warning is enabled by @option{-Wall}.
4002 @item -Wunused-label
4003 @opindex Wunused-label
4004 @opindex Wno-unused-label
4005 Warn whenever a label is declared but not used.
4006 This warning is enabled by @option{-Wall}.
4008 To suppress this warning use the @code{unused} attribute
4009 (@pxref{Variable Attributes}).
4011 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
4012 @opindex Wunused-local-typedefs
4013 Warn when a typedef locally defined in a function is not used.
4014 This warning is enabled by @option{-Wall}.
4016 @item -Wunused-parameter
4017 @opindex Wunused-parameter
4018 @opindex Wno-unused-parameter
4019 Warn whenever a function parameter is unused aside from its declaration.
4021 To suppress this warning use the @code{unused} attribute
4022 (@pxref{Variable Attributes}).
4024 @item -Wno-unused-result
4025 @opindex Wunused-result
4026 @opindex Wno-unused-result
4027 Do not warn if a caller of a function marked with attribute
4028 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
4029 its return value. The default is @option{-Wunused-result}.
4031 @item -Wunused-variable
4032 @opindex Wunused-variable
4033 @opindex Wno-unused-variable
4034 Warn whenever a local variable or non-constant static variable is unused
4035 aside from its declaration.
4036 This warning is enabled by @option{-Wall}.
4038 To suppress this warning use the @code{unused} attribute
4039 (@pxref{Variable Attributes}).
4041 @item -Wunused-value
4042 @opindex Wunused-value
4043 @opindex Wno-unused-value
4044 Warn whenever a statement computes a result that is explicitly not
4045 used. To suppress this warning cast the unused expression to
4046 @code{void}. This includes an expression-statement or the left-hand
4047 side of a comma expression that contains no side effects. For example,
4048 an expression such as @code{x[i,j]} causes a warning, while
4049 @code{x[(void)i,j]} does not.
4051 This warning is enabled by @option{-Wall}.
4053 @item -Wunused
4054 @opindex Wunused
4055 @opindex Wno-unused
4056 All the above @option{-Wunused} options combined.
4058 In order to get a warning about an unused function parameter, you must
4059 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
4060 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
4062 @item -Wuninitialized
4063 @opindex Wuninitialized
4064 @opindex Wno-uninitialized
4065 Warn if an automatic variable is used without first being initialized
4066 or if a variable may be clobbered by a @code{setjmp} call. In C++,
4067 warn if a non-static reference or non-static @code{const} member
4068 appears in a class without constructors.
4070 If you want to warn about code that uses the uninitialized value of the
4071 variable in its own initializer, use the @option{-Winit-self} option.
4073 These warnings occur for individual uninitialized or clobbered
4074 elements of structure, union or array variables as well as for
4075 variables that are uninitialized or clobbered as a whole.  They do
4076 not occur for variables or elements declared @code{volatile}.  Because
4077 these warnings depend on optimization, the exact variables or elements
4078 for which there are warnings depends on the precise optimization
4079 options and version of GCC used.
4081 Note that there may be no warning about a variable that is used only
4082 to compute a value that itself is never used, because such
4083 computations may be deleted by data flow analysis before the warnings
4084 are printed.
4086 @item -Wmaybe-uninitialized
4087 @opindex Wmaybe-uninitialized
4088 @opindex Wno-maybe-uninitialized
4089 For an automatic variable, if there exists a path from the function
4090 entry to a use of the variable that is initialized, but there exist
4091 some other paths for which the variable is not initialized, the compiler
4092 emits a warning if it cannot prove the uninitialized paths are not
4093 executed at run time. These warnings are made optional because GCC is
4094 not smart enough to see all the reasons why the code might be correct
4095 in spite of appearing to have an error.  Here is one example of how
4096 this can happen:
4098 @smallexample
4099 @group
4101   int x;
4102   switch (y)
4103     @{
4104     case 1: x = 1;
4105       break;
4106     case 2: x = 4;
4107       break;
4108     case 3: x = 5;
4109     @}
4110   foo (x);
4112 @end group
4113 @end smallexample
4115 @noindent
4116 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
4117 always initialized, but GCC doesn't know this. To suppress the
4118 warning, you need to provide a default case with assert(0) or
4119 similar code.
4121 @cindex @code{longjmp} warnings
4122 This option also warns when a non-volatile automatic variable might be
4123 changed by a call to @code{longjmp}.  These warnings as well are possible
4124 only in optimizing compilation.
4126 The compiler sees only the calls to @code{setjmp}.  It cannot know
4127 where @code{longjmp} will be called; in fact, a signal handler could
4128 call it at any point in the code.  As a result, you may get a warning
4129 even when there is in fact no problem because @code{longjmp} cannot
4130 in fact be called at the place that would cause a problem.
4132 Some spurious warnings can be avoided if you declare all the functions
4133 you use that never return as @code{noreturn}.  @xref{Function
4134 Attributes}.
4136 This warning is enabled by @option{-Wall} or @option{-Wextra}.
4138 @item -Wunknown-pragmas
4139 @opindex Wunknown-pragmas
4140 @opindex Wno-unknown-pragmas
4141 @cindex warning for unknown pragmas
4142 @cindex unknown pragmas, warning
4143 @cindex pragmas, warning of unknown
4144 Warn when a @code{#pragma} directive is encountered that is not understood by 
4145 GCC@.  If this command-line option is used, warnings are even issued
4146 for unknown pragmas in system header files.  This is not the case if
4147 the warnings are only enabled by the @option{-Wall} command-line option.
4149 @item -Wno-pragmas
4150 @opindex Wno-pragmas
4151 @opindex Wpragmas
4152 Do not warn about misuses of pragmas, such as incorrect parameters,
4153 invalid syntax, or conflicts between pragmas.  See also
4154 @option{-Wunknown-pragmas}.
4156 @item -Wstrict-aliasing
4157 @opindex Wstrict-aliasing
4158 @opindex Wno-strict-aliasing
4159 This option is only active when @option{-fstrict-aliasing} is active.
4160 It warns about code that might break the strict aliasing rules that the
4161 compiler is using for optimization.  The warning does not catch all
4162 cases, but does attempt to catch the more common pitfalls.  It is
4163 included in @option{-Wall}.
4164 It is equivalent to @option{-Wstrict-aliasing=3}
4166 @item -Wstrict-aliasing=n
4167 @opindex Wstrict-aliasing=n
4168 This option is only active when @option{-fstrict-aliasing} is active.
4169 It warns about code that might break the strict aliasing rules that the
4170 compiler is using for optimization.
4171 Higher levels correspond to higher accuracy (fewer false positives).
4172 Higher levels also correspond to more effort, similar to the way @option{-O} 
4173 works.
4174 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
4176 Level 1: Most aggressive, quick, least accurate.
4177 Possibly useful when higher levels
4178 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
4179 false negatives.  However, it has many false positives.
4180 Warns for all pointer conversions between possibly incompatible types,
4181 even if never dereferenced.  Runs in the front end only.
4183 Level 2: Aggressive, quick, not too precise.
4184 May still have many false positives (not as many as level 1 though),
4185 and few false negatives (but possibly more than level 1).
4186 Unlike level 1, it only warns when an address is taken.  Warns about
4187 incomplete types.  Runs in the front end only.
4189 Level 3 (default for @option{-Wstrict-aliasing}):
4190 Should have very few false positives and few false
4191 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
4192 Takes care of the common pun+dereference pattern in the front end:
4193 @code{*(int*)&some_float}.
4194 If optimization is enabled, it also runs in the back end, where it deals
4195 with multiple statement cases using flow-sensitive points-to information.
4196 Only warns when the converted pointer is dereferenced.
4197 Does not warn about incomplete types.
4199 @item -Wstrict-overflow
4200 @itemx -Wstrict-overflow=@var{n}
4201 @opindex Wstrict-overflow
4202 @opindex Wno-strict-overflow
4203 This option is only active when @option{-fstrict-overflow} is active.
4204 It warns about cases where the compiler optimizes based on the
4205 assumption that signed overflow does not occur.  Note that it does not
4206 warn about all cases where the code might overflow: it only warns
4207 about cases where the compiler implements some optimization.  Thus
4208 this warning depends on the optimization level.
4210 An optimization that assumes that signed overflow does not occur is
4211 perfectly safe if the values of the variables involved are such that
4212 overflow never does, in fact, occur.  Therefore this warning can
4213 easily give a false positive: a warning about code that is not
4214 actually a problem.  To help focus on important issues, several
4215 warning levels are defined.  No warnings are issued for the use of
4216 undefined signed overflow when estimating how many iterations a loop
4217 requires, in particular when determining whether a loop will be
4218 executed at all.
4220 @table @gcctabopt
4221 @item -Wstrict-overflow=1
4222 Warn about cases that are both questionable and easy to avoid.  For
4223 example,  with @option{-fstrict-overflow}, the compiler simplifies
4224 @code{x + 1 > x} to @code{1}.  This level of
4225 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
4226 are not, and must be explicitly requested.
4228 @item -Wstrict-overflow=2
4229 Also warn about other cases where a comparison is simplified to a
4230 constant.  For example: @code{abs (x) >= 0}.  This can only be
4231 simplified when @option{-fstrict-overflow} is in effect, because
4232 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
4233 zero.  @option{-Wstrict-overflow} (with no level) is the same as
4234 @option{-Wstrict-overflow=2}.
4236 @item -Wstrict-overflow=3
4237 Also warn about other cases where a comparison is simplified.  For
4238 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
4240 @item -Wstrict-overflow=4
4241 Also warn about other simplifications not covered by the above cases.
4242 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
4244 @item -Wstrict-overflow=5
4245 Also warn about cases where the compiler reduces the magnitude of a
4246 constant involved in a comparison.  For example: @code{x + 2 > y} is
4247 simplified to @code{x + 1 >= y}.  This is reported only at the
4248 highest warning level because this simplification applies to many
4249 comparisons, so this warning level gives a very large number of
4250 false positives.
4251 @end table
4253 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]}
4254 @opindex Wsuggest-attribute=
4255 @opindex Wno-suggest-attribute=
4256 Warn for cases where adding an attribute may be beneficial. The
4257 attributes currently supported are listed below.
4259 @table @gcctabopt
4260 @item -Wsuggest-attribute=pure
4261 @itemx -Wsuggest-attribute=const
4262 @itemx -Wsuggest-attribute=noreturn
4263 @opindex Wsuggest-attribute=pure
4264 @opindex Wno-suggest-attribute=pure
4265 @opindex Wsuggest-attribute=const
4266 @opindex Wno-suggest-attribute=const
4267 @opindex Wsuggest-attribute=noreturn
4268 @opindex Wno-suggest-attribute=noreturn
4270 Warn about functions that might be candidates for attributes
4271 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
4272 functions visible in other compilation units or (in the case of @code{pure} and
4273 @code{const}) if it cannot prove that the function returns normally. A function
4274 returns normally if it doesn't contain an infinite loop or return abnormally
4275 by throwing, calling @code{abort} or trapping.  This analysis requires option
4276 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
4277 higher.  Higher optimization levels improve the accuracy of the analysis.
4279 @item -Wsuggest-attribute=format
4280 @itemx -Wmissing-format-attribute
4281 @opindex Wsuggest-attribute=format
4282 @opindex Wmissing-format-attribute
4283 @opindex Wno-suggest-attribute=format
4284 @opindex Wno-missing-format-attribute
4285 @opindex Wformat
4286 @opindex Wno-format
4288 Warn about function pointers that might be candidates for @code{format}
4289 attributes.  Note these are only possible candidates, not absolute ones.
4290 GCC guesses that function pointers with @code{format} attributes that
4291 are used in assignment, initialization, parameter passing or return
4292 statements should have a corresponding @code{format} attribute in the
4293 resulting type.  I.e.@: the left-hand side of the assignment or
4294 initialization, the type of the parameter variable, or the return type
4295 of the containing function respectively should also have a @code{format}
4296 attribute to avoid the warning.
4298 GCC also warns about function definitions that might be
4299 candidates for @code{format} attributes.  Again, these are only
4300 possible candidates.  GCC guesses that @code{format} attributes
4301 might be appropriate for any function that calls a function like
4302 @code{vprintf} or @code{vscanf}, but this might not always be the
4303 case, and some functions for which @code{format} attributes are
4304 appropriate may not be detected.
4305 @end table
4307 @item -Wsuggest-final-types
4308 @opindex Wno-suggest-final-types
4309 @opindex Wsuggest-final-types
4310 Warn about types with virtual methods where code quality would be improved
4311 if the type were declared with the C++11 @code{final} specifier, 
4312 or, if possible,
4313 declared in an anonymous namespace. This allows GCC to more aggressively
4314 devirtualize the polymorphic calls. This warning is more effective with link
4315 time optimization, where the information about the class hierarchy graph is
4316 more complete.
4318 @item -Wsuggest-final-methods
4319 @opindex Wno-suggest-final-methods
4320 @opindex Wsuggest-final-methods
4321 Warn about virtual methods where code quality would be improved if the method
4322 were declared with the C++11 @code{final} specifier, 
4323 or, if possible, its type were
4324 declared in an anonymous namespace or with the @code{final} specifier.
4325 This warning is
4326 more effective with link time optimization, where the information about the
4327 class hierarchy graph is more complete. It is recommended to first consider
4328 suggestions of @option{-Wsuggest-final-types} and then rebuild with new
4329 annotations.
4331 @item -Wsuggest-override
4332 Warn about overriding virtual functions that are not marked with the override
4333 keyword.
4335 @item -Warray-bounds
4336 @itemx -Warray-bounds=@var{n}
4337 @opindex Wno-array-bounds
4338 @opindex Warray-bounds
4339 This option is only active when @option{-ftree-vrp} is active
4340 (default for @option{-O2} and above). It warns about subscripts to arrays
4341 that are always out of bounds. This warning is enabled by @option{-Wall}.
4343 @table @gcctabopt
4344 @item -Warray-bounds=1
4345 This is the warning level of @option{-Warray-bounds} and is enabled
4346 by @option{-Wall}; higher levels are not, and must be explicitly requested.
4348 @item -Warray-bounds=2
4349 This warning level also warns about out of bounds access for
4350 arrays at the end of a struct and for arrays accessed through
4351 pointers. This warning level may give a larger number of
4352 false positives and is deactivated by default.
4353 @end table
4356 @item -Wbool-compare
4357 @opindex Wno-bool-compare
4358 @opindex Wbool-compare
4359 Warn about boolean expression compared with an integer value different from
4360 @code{true}/@code{false}.  For instance, the following comparison is
4361 always false:
4362 @smallexample
4363 int n = 5;
4364 @dots{}
4365 if ((n > 1) == 2) @{ @dots{} @}
4366 @end smallexample
4367 This warning is enabled by @option{-Wall}.
4369 @item -Wno-discarded-qualifiers @r{(C and Objective-C only)}
4370 @opindex Wno-discarded-qualifiers
4371 @opindex Wdiscarded-qualifiers
4372 Do not warn if type qualifiers on pointers are being discarded.
4373 Typically, the compiler warns if a @code{const char *} variable is
4374 passed to a function that takes a @code{char *} parameter.  This option
4375 can be used to suppress such a warning.
4377 @item -Wno-discarded-array-qualifiers @r{(C and Objective-C only)}
4378 @opindex Wno-discarded-array-qualifiers
4379 @opindex Wdiscarded-array-qualifiers
4380 Do not warn if type qualifiers on arrays which are pointer targets
4381 are being discarded. Typically, the compiler warns if a
4382 @code{const int (*)[]} variable is passed to a function that
4383 takes a @code{int (*)[]} parameter.  This option can be used to
4384 suppress such a warning.
4386 @item -Wno-incompatible-pointer-types @r{(C and Objective-C only)}
4387 @opindex Wno-incompatible-pointer-types
4388 @opindex Wincompatible-pointer-types
4389 Do not warn when there is a conversion between pointers that have incompatible
4390 types.  This warning is for cases not covered by @option{-Wno-pointer-sign},
4391 which warns for pointer argument passing or assignment with different
4392 signedness.
4394 @item -Wno-int-conversion @r{(C and Objective-C only)}
4395 @opindex Wno-int-conversion
4396 @opindex Wint-conversion
4397 Do not warn about incompatible integer to pointer and pointer to integer
4398 conversions.  This warning is about implicit conversions; for explicit
4399 conversions the warnings @option{-Wno-int-to-pointer-cast} and
4400 @option{-Wno-pointer-to-int-cast} may be used.
4402 @item -Wno-div-by-zero
4403 @opindex Wno-div-by-zero
4404 @opindex Wdiv-by-zero
4405 Do not warn about compile-time integer division by zero.  Floating-point
4406 division by zero is not warned about, as it can be a legitimate way of
4407 obtaining infinities and NaNs.
4409 @item -Wsystem-headers
4410 @opindex Wsystem-headers
4411 @opindex Wno-system-headers
4412 @cindex warnings from system headers
4413 @cindex system headers, warnings from
4414 Print warning messages for constructs found in system header files.
4415 Warnings from system headers are normally suppressed, on the assumption
4416 that they usually do not indicate real problems and would only make the
4417 compiler output harder to read.  Using this command-line option tells
4418 GCC to emit warnings from system headers as if they occurred in user
4419 code.  However, note that using @option{-Wall} in conjunction with this
4420 option does @emph{not} warn about unknown pragmas in system
4421 headers---for that, @option{-Wunknown-pragmas} must also be used.
4423 @item -Wtrampolines
4424 @opindex Wtrampolines
4425 @opindex Wno-trampolines
4426 Warn about trampolines generated for pointers to nested functions.
4427 A trampoline is a small piece of data or code that is created at run
4428 time on the stack when the address of a nested function is taken, and is
4429 used to call the nested function indirectly.  For some targets, it is
4430 made up of data only and thus requires no special treatment.  But, for
4431 most targets, it is made up of code and thus requires the stack to be
4432 made executable in order for the program to work properly.
4434 @item -Wfloat-equal
4435 @opindex Wfloat-equal
4436 @opindex Wno-float-equal
4437 Warn if floating-point values are used in equality comparisons.
4439 The idea behind this is that sometimes it is convenient (for the
4440 programmer) to consider floating-point values as approximations to
4441 infinitely precise real numbers.  If you are doing this, then you need
4442 to compute (by analyzing the code, or in some other way) the maximum or
4443 likely maximum error that the computation introduces, and allow for it
4444 when performing comparisons (and when producing output, but that's a
4445 different problem).  In particular, instead of testing for equality, you
4446 should check to see whether the two values have ranges that overlap; and
4447 this is done with the relational operators, so equality comparisons are
4448 probably mistaken.
4450 @item -Wtraditional @r{(C and Objective-C only)}
4451 @opindex Wtraditional
4452 @opindex Wno-traditional
4453 Warn about certain constructs that behave differently in traditional and
4454 ISO C@.  Also warn about ISO C constructs that have no traditional C
4455 equivalent, and/or problematic constructs that should be avoided.
4457 @itemize @bullet
4458 @item
4459 Macro parameters that appear within string literals in the macro body.
4460 In traditional C macro replacement takes place within string literals,
4461 but in ISO C it does not.
4463 @item
4464 In traditional C, some preprocessor directives did not exist.
4465 Traditional preprocessors only considered a line to be a directive
4466 if the @samp{#} appeared in column 1 on the line.  Therefore
4467 @option{-Wtraditional} warns about directives that traditional C
4468 understands but ignores because the @samp{#} does not appear as the
4469 first character on the line.  It also suggests you hide directives like
4470 @code{#pragma} not understood by traditional C by indenting them.  Some
4471 traditional implementations do not recognize @code{#elif}, so this option
4472 suggests avoiding it altogether.
4474 @item
4475 A function-like macro that appears without arguments.
4477 @item
4478 The unary plus operator.
4480 @item
4481 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
4482 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
4483 constants.)  Note, these suffixes appear in macros defined in the system
4484 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
4485 Use of these macros in user code might normally lead to spurious
4486 warnings, however GCC's integrated preprocessor has enough context to
4487 avoid warning in these cases.
4489 @item
4490 A function declared external in one block and then used after the end of
4491 the block.
4493 @item
4494 A @code{switch} statement has an operand of type @code{long}.
4496 @item
4497 A non-@code{static} function declaration follows a @code{static} one.
4498 This construct is not accepted by some traditional C compilers.
4500 @item
4501 The ISO type of an integer constant has a different width or
4502 signedness from its traditional type.  This warning is only issued if
4503 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
4504 typically represent bit patterns, are not warned about.
4506 @item
4507 Usage of ISO string concatenation is detected.
4509 @item
4510 Initialization of automatic aggregates.
4512 @item
4513 Identifier conflicts with labels.  Traditional C lacks a separate
4514 namespace for labels.
4516 @item
4517 Initialization of unions.  If the initializer is zero, the warning is
4518 omitted.  This is done under the assumption that the zero initializer in
4519 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
4520 initializer warnings and relies on default initialization to zero in the
4521 traditional C case.
4523 @item
4524 Conversions by prototypes between fixed/floating-point values and vice
4525 versa.  The absence of these prototypes when compiling with traditional
4526 C causes serious problems.  This is a subset of the possible
4527 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
4529 @item
4530 Use of ISO C style function definitions.  This warning intentionally is
4531 @emph{not} issued for prototype declarations or variadic functions
4532 because these ISO C features appear in your code when using
4533 libiberty's traditional C compatibility macros, @code{PARAMS} and
4534 @code{VPARAMS}.  This warning is also bypassed for nested functions
4535 because that feature is already a GCC extension and thus not relevant to
4536 traditional C compatibility.
4537 @end itemize
4539 @item -Wtraditional-conversion @r{(C and Objective-C only)}
4540 @opindex Wtraditional-conversion
4541 @opindex Wno-traditional-conversion
4542 Warn if a prototype causes a type conversion that is different from what
4543 would happen to the same argument in the absence of a prototype.  This
4544 includes conversions of fixed point to floating and vice versa, and
4545 conversions changing the width or signedness of a fixed-point argument
4546 except when the same as the default promotion.
4548 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
4549 @opindex Wdeclaration-after-statement
4550 @opindex Wno-declaration-after-statement
4551 Warn when a declaration is found after a statement in a block.  This
4552 construct, known from C++, was introduced with ISO C99 and is by default
4553 allowed in GCC@.  It is not supported by ISO C90.  @xref{Mixed Declarations}.
4555 @item -Wundef
4556 @opindex Wundef
4557 @opindex Wno-undef
4558 Warn if an undefined identifier is evaluated in an @code{#if} directive.
4560 @item -Wno-endif-labels
4561 @opindex Wno-endif-labels
4562 @opindex Wendif-labels
4563 Do not warn whenever an @code{#else} or an @code{#endif} are followed by text.
4565 @item -Wshadow
4566 @opindex Wshadow
4567 @opindex Wno-shadow
4568 Warn whenever a local variable or type declaration shadows another
4569 variable, parameter, type, class member (in C++), or instance variable
4570 (in Objective-C) or whenever a built-in function is shadowed. Note
4571 that in C++, the compiler warns if a local variable shadows an
4572 explicit typedef, but not if it shadows a struct/class/enum.
4574 @item -Wno-shadow-ivar @r{(Objective-C only)}
4575 @opindex Wno-shadow-ivar
4576 @opindex Wshadow-ivar
4577 Do not warn whenever a local variable shadows an instance variable in an
4578 Objective-C method.
4580 @item -Wlarger-than=@var{len}
4581 @opindex Wlarger-than=@var{len}
4582 @opindex Wlarger-than-@var{len}
4583 Warn whenever an object of larger than @var{len} bytes is defined.
4585 @item -Wframe-larger-than=@var{len}
4586 @opindex Wframe-larger-than
4587 Warn if the size of a function frame is larger than @var{len} bytes.
4588 The computation done to determine the stack frame size is approximate
4589 and not conservative.
4590 The actual requirements may be somewhat greater than @var{len}
4591 even if you do not get a warning.  In addition, any space allocated
4592 via @code{alloca}, variable-length arrays, or related constructs
4593 is not included by the compiler when determining
4594 whether or not to issue a warning.
4596 @item -Wno-free-nonheap-object
4597 @opindex Wno-free-nonheap-object
4598 @opindex Wfree-nonheap-object
4599 Do not warn when attempting to free an object that was not allocated
4600 on the heap.
4602 @item -Wstack-usage=@var{len}
4603 @opindex Wstack-usage
4604 Warn if the stack usage of a function might be larger than @var{len} bytes.
4605 The computation done to determine the stack usage is conservative.
4606 Any space allocated via @code{alloca}, variable-length arrays, or related
4607 constructs is included by the compiler when determining whether or not to
4608 issue a warning.
4610 The message is in keeping with the output of @option{-fstack-usage}.
4612 @itemize
4613 @item
4614 If the stack usage is fully static but exceeds the specified amount, it's:
4616 @smallexample
4617   warning: stack usage is 1120 bytes
4618 @end smallexample
4619 @item
4620 If the stack usage is (partly) dynamic but bounded, it's:
4622 @smallexample
4623   warning: stack usage might be 1648 bytes
4624 @end smallexample
4625 @item
4626 If the stack usage is (partly) dynamic and not bounded, it's:
4628 @smallexample
4629   warning: stack usage might be unbounded
4630 @end smallexample
4631 @end itemize
4633 @item -Wunsafe-loop-optimizations
4634 @opindex Wunsafe-loop-optimizations
4635 @opindex Wno-unsafe-loop-optimizations
4636 Warn if the loop cannot be optimized because the compiler cannot
4637 assume anything on the bounds of the loop indices.  With
4638 @option{-funsafe-loop-optimizations} warn if the compiler makes
4639 such assumptions.
4641 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
4642 @opindex Wno-pedantic-ms-format
4643 @opindex Wpedantic-ms-format
4644 When used in combination with @option{-Wformat}
4645 and @option{-pedantic} without GNU extensions, this option
4646 disables the warnings about non-ISO @code{printf} / @code{scanf} format
4647 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
4648 which depend on the MS runtime.
4650 @item -Wpointer-arith
4651 @opindex Wpointer-arith
4652 @opindex Wno-pointer-arith
4653 Warn about anything that depends on the ``size of'' a function type or
4654 of @code{void}.  GNU C assigns these types a size of 1, for
4655 convenience in calculations with @code{void *} pointers and pointers
4656 to functions.  In C++, warn also when an arithmetic operation involves
4657 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
4659 @item -Wtype-limits
4660 @opindex Wtype-limits
4661 @opindex Wno-type-limits
4662 Warn if a comparison is always true or always false due to the limited
4663 range of the data type, but do not warn for constant expressions.  For
4664 example, warn if an unsigned variable is compared against zero with
4665 @code{<} or @code{>=}.  This warning is also enabled by
4666 @option{-Wextra}.
4668 @item -Wbad-function-cast @r{(C and Objective-C only)}
4669 @opindex Wbad-function-cast
4670 @opindex Wno-bad-function-cast
4671 Warn when a function call is cast to a non-matching type.
4672 For example, warn if a call to a function returning an integer type 
4673 is cast to a pointer type.
4675 @item -Wc90-c99-compat @r{(C and Objective-C only)}
4676 @opindex Wc90-c99-compat
4677 @opindex Wno-c90-c99-compat
4678 Warn about features not present in ISO C90, but present in ISO C99.
4679 For instance, warn about use of variable length arrays, @code{long long}
4680 type, @code{bool} type, compound literals, designated initializers, and so
4681 on.  This option is independent of the standards mode.  Warnings are disabled
4682 in the expression that follows @code{__extension__}.
4684 @item -Wc99-c11-compat @r{(C and Objective-C only)}
4685 @opindex Wc99-c11-compat
4686 @opindex Wno-c99-c11-compat
4687 Warn about features not present in ISO C99, but present in ISO C11.
4688 For instance, warn about use of anonymous structures and unions,
4689 @code{_Atomic} type qualifier, @code{_Thread_local} storage-class specifier,
4690 @code{_Alignas} specifier, @code{Alignof} operator, @code{_Generic} keyword,
4691 and so on.  This option is independent of the standards mode.  Warnings are
4692 disabled in the expression that follows @code{__extension__}.
4694 @item -Wc++-compat @r{(C and Objective-C only)}
4695 @opindex Wc++-compat
4696 Warn about ISO C constructs that are outside of the common subset of
4697 ISO C and ISO C++, e.g.@: request for implicit conversion from
4698 @code{void *} to a pointer to non-@code{void} type.
4700 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
4701 @opindex Wc++11-compat
4702 Warn about C++ constructs whose meaning differs between ISO C++ 1998
4703 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
4704 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
4705 enabled by @option{-Wall}.
4707 @item -Wc++14-compat @r{(C++ and Objective-C++ only)}
4708 @opindex Wc++14-compat
4709 Warn about C++ constructs whose meaning differs between ISO C++ 2011
4710 and ISO C++ 2014.  This warning is enabled by @option{-Wall}.
4712 @item -Wcast-qual
4713 @opindex Wcast-qual
4714 @opindex Wno-cast-qual
4715 Warn whenever a pointer is cast so as to remove a type qualifier from
4716 the target type.  For example, warn if a @code{const char *} is cast
4717 to an ordinary @code{char *}.
4719 Also warn when making a cast that introduces a type qualifier in an
4720 unsafe way.  For example, casting @code{char **} to @code{const char **}
4721 is unsafe, as in this example:
4723 @smallexample
4724   /* p is char ** value.  */
4725   const char **q = (const char **) p;
4726   /* Assignment of readonly string to const char * is OK.  */
4727   *q = "string";
4728   /* Now char** pointer points to read-only memory.  */
4729   **p = 'b';
4730 @end smallexample
4732 @item -Wcast-align
4733 @opindex Wcast-align
4734 @opindex Wno-cast-align
4735 Warn whenever a pointer is cast such that the required alignment of the
4736 target is increased.  For example, warn if a @code{char *} is cast to
4737 an @code{int *} on machines where integers can only be accessed at
4738 two- or four-byte boundaries.
4740 @item -Wwrite-strings
4741 @opindex Wwrite-strings
4742 @opindex Wno-write-strings
4743 When compiling C, give string constants the type @code{const
4744 char[@var{length}]} so that copying the address of one into a
4745 non-@code{const} @code{char *} pointer produces a warning.  These
4746 warnings help you find at compile time code that can try to write
4747 into a string constant, but only if you have been very careful about
4748 using @code{const} in declarations and prototypes.  Otherwise, it is
4749 just a nuisance. This is why we did not make @option{-Wall} request
4750 these warnings.
4752 When compiling C++, warn about the deprecated conversion from string
4753 literals to @code{char *}.  This warning is enabled by default for C++
4754 programs.
4756 @item -Wclobbered
4757 @opindex Wclobbered
4758 @opindex Wno-clobbered
4759 Warn for variables that might be changed by @code{longjmp} or
4760 @code{vfork}.  This warning is also enabled by @option{-Wextra}.
4762 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
4763 @opindex Wconditionally-supported
4764 @opindex Wno-conditionally-supported
4765 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
4767 @item -Wconversion
4768 @opindex Wconversion
4769 @opindex Wno-conversion
4770 Warn for implicit conversions that may alter a value. This includes
4771 conversions between real and integer, like @code{abs (x)} when
4772 @code{x} is @code{double}; conversions between signed and unsigned,
4773 like @code{unsigned ui = -1}; and conversions to smaller types, like
4774 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4775 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4776 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4777 conversions between signed and unsigned integers can be disabled by
4778 using @option{-Wno-sign-conversion}.
4780 For C++, also warn for confusing overload resolution for user-defined
4781 conversions; and conversions that never use a type conversion
4782 operator: conversions to @code{void}, the same type, a base class or a
4783 reference to them. Warnings about conversions between signed and
4784 unsigned integers are disabled by default in C++ unless
4785 @option{-Wsign-conversion} is explicitly enabled.
4787 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4788 @opindex Wconversion-null
4789 @opindex Wno-conversion-null
4790 Do not warn for conversions between @code{NULL} and non-pointer
4791 types. @option{-Wconversion-null} is enabled by default.
4793 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
4794 @opindex Wzero-as-null-pointer-constant
4795 @opindex Wno-zero-as-null-pointer-constant
4796 Warn when a literal '0' is used as null pointer constant.  This can
4797 be useful to facilitate the conversion to @code{nullptr} in C++11.
4799 @item -Wdate-time
4800 @opindex Wdate-time
4801 @opindex Wno-date-time
4802 Warn when macros @code{__TIME__}, @code{__DATE__} or @code{__TIMESTAMP__}
4803 are encountered as they might prevent bit-wise-identical reproducible
4804 compilations.
4806 @item -Wdelete-incomplete @r{(C++ and Objective-C++ only)}
4807 @opindex Wdelete-incomplete
4808 @opindex Wno-delete-incomplete
4809 Warn when deleting a pointer to incomplete type, which may cause
4810 undefined behavior at runtime.  This warning is enabled by default.
4812 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
4813 @opindex Wuseless-cast
4814 @opindex Wno-useless-cast
4815 Warn when an expression is casted to its own type.
4817 @item -Wempty-body
4818 @opindex Wempty-body
4819 @opindex Wno-empty-body
4820 Warn if an empty body occurs in an @code{if}, @code{else} or @code{do
4821 while} statement.  This warning is also enabled by @option{-Wextra}.
4823 @item -Wenum-compare
4824 @opindex Wenum-compare
4825 @opindex Wno-enum-compare
4826 Warn about a comparison between values of different enumerated types.
4827 In C++ enumeral mismatches in conditional expressions are also
4828 diagnosed and the warning is enabled by default.  In C this warning is 
4829 enabled by @option{-Wall}.
4831 @item -Wjump-misses-init @r{(C, Objective-C only)}
4832 @opindex Wjump-misses-init
4833 @opindex Wno-jump-misses-init
4834 Warn if a @code{goto} statement or a @code{switch} statement jumps
4835 forward across the initialization of a variable, or jumps backward to a
4836 label after the variable has been initialized.  This only warns about
4837 variables that are initialized when they are declared.  This warning is
4838 only supported for C and Objective-C; in C++ this sort of branch is an
4839 error in any case.
4841 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4842 can be disabled with the @option{-Wno-jump-misses-init} option.
4844 @item -Wsign-compare
4845 @opindex Wsign-compare
4846 @opindex Wno-sign-compare
4847 @cindex warning for comparison of signed and unsigned values
4848 @cindex comparison of signed and unsigned values, warning
4849 @cindex signed and unsigned values, comparison warning
4850 Warn when a comparison between signed and unsigned values could produce
4851 an incorrect result when the signed value is converted to unsigned.
4852 This warning is also enabled by @option{-Wextra}; to get the other warnings
4853 of @option{-Wextra} without this warning, use @option{-Wextra -Wno-sign-compare}.
4855 @item -Wsign-conversion
4856 @opindex Wsign-conversion
4857 @opindex Wno-sign-conversion
4858 Warn for implicit conversions that may change the sign of an integer
4859 value, like assigning a signed integer expression to an unsigned
4860 integer variable. An explicit cast silences the warning. In C, this
4861 option is enabled also by @option{-Wconversion}.
4863 @item -Wfloat-conversion
4864 @opindex Wfloat-conversion
4865 @opindex Wno-float-conversion
4866 Warn for implicit conversions that reduce the precision of a real value.
4867 This includes conversions from real to integer, and from higher precision
4868 real to lower precision real values.  This option is also enabled by
4869 @option{-Wconversion}.
4871 @item -Wsized-deallocation @r{(C++ and Objective-C++ only)}
4872 @opindex Wsized-deallocation
4873 @opindex Wno-sized-deallocation
4874 Warn about a definition of an unsized deallocation function
4875 @smallexample
4876 void operator delete (void *) noexcept;
4877 void operator delete[] (void *) noexcept;
4878 @end smallexample
4879 without a definition of the corresponding sized deallocation function
4880 @smallexample
4881 void operator delete (void *, std::size_t) noexcept;
4882 void operator delete[] (void *, std::size_t) noexcept;
4883 @end smallexample
4884 or vice versa.  Enabled by @option{-Wextra} along with
4885 @option{-fsized-deallocation}.
4887 @item -Wsizeof-pointer-memaccess
4888 @opindex Wsizeof-pointer-memaccess
4889 @opindex Wno-sizeof-pointer-memaccess
4890 Warn for suspicious length parameters to certain string and memory built-in
4891 functions if the argument uses @code{sizeof}.  This warning warns e.g.@:
4892 about @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not an array,
4893 but a pointer, and suggests a possible fix, or about
4894 @code{memcpy (&foo, ptr, sizeof (&foo));}.  This warning is enabled by
4895 @option{-Wall}.
4897 @item -Wsizeof-array-argument
4898 @opindex Wsizeof-array-argument
4899 @opindex Wno-sizeof-array-argument
4900 Warn when the @code{sizeof} operator is applied to a parameter that is
4901 declared as an array in a function definition.  This warning is enabled by
4902 default for C and C++ programs.
4904 @item -Wmemset-transposed-args
4905 @opindex Wmemset-transposed-args
4906 @opindex Wno-memset-transposed-args
4907 Warn for suspicious calls to the @code{memset} built-in function, if the
4908 second argument is not zero and the third argument is zero.  This warns e.g.@
4909 about @code{memset (buf, sizeof buf, 0)} where most probably
4910 @code{memset (buf, 0, sizeof buf)} was meant instead.  The diagnostics
4911 is only emitted if the third argument is literal zero, if it is some expression
4912 that is folded to zero, or e.g. a cast of zero to some type etc., it
4913 is far less likely that user has mistakenly exchanged the arguments and
4914 no warning is emitted.  This warning is enabled by @option{-Wall}.
4916 @item -Waddress
4917 @opindex Waddress
4918 @opindex Wno-address
4919 Warn about suspicious uses of memory addresses. These include using
4920 the address of a function in a conditional expression, such as
4921 @code{void func(void); if (func)}, and comparisons against the memory
4922 address of a string literal, such as @code{if (x == "abc")}.  Such
4923 uses typically indicate a programmer error: the address of a function
4924 always evaluates to true, so their use in a conditional usually
4925 indicate that the programmer forgot the parentheses in a function
4926 call; and comparisons against string literals result in unspecified
4927 behavior and are not portable in C, so they usually indicate that the
4928 programmer intended to use @code{strcmp}.  This warning is enabled by
4929 @option{-Wall}.
4931 @item -Wlogical-op
4932 @opindex Wlogical-op
4933 @opindex Wno-logical-op
4934 Warn about suspicious uses of logical operators in expressions.
4935 This includes using logical operators in contexts where a
4936 bit-wise operator is likely to be expected.
4938 @item -Wlogical-not-parentheses
4939 @opindex Wlogical-not-parentheses
4940 @opindex Wno-logical-not-parentheses
4941 Warn about logical not used on the left hand side operand of a comparison.
4942 This option does not warn if the RHS operand is of a boolean type.  Its
4943 purpose is to detect suspicious code like the following:
4944 @smallexample
4945 int a;
4946 @dots{}
4947 if (!a > 1) @{ @dots{} @}
4948 @end smallexample
4950 It is possible to suppress the warning by wrapping the LHS into
4951 parentheses:
4952 @smallexample
4953 if ((!a) > 1) @{ @dots{} @}
4954 @end smallexample
4956 This warning is enabled by @option{-Wall}.
4958 @item -Waggregate-return
4959 @opindex Waggregate-return
4960 @opindex Wno-aggregate-return
4961 Warn if any functions that return structures or unions are defined or
4962 called.  (In languages where you can return an array, this also elicits
4963 a warning.)
4965 @item -Wno-aggressive-loop-optimizations
4966 @opindex Wno-aggressive-loop-optimizations
4967 @opindex Waggressive-loop-optimizations
4968 Warn if in a loop with constant number of iterations the compiler detects
4969 undefined behavior in some statement during one or more of the iterations.
4971 @item -Wno-attributes
4972 @opindex Wno-attributes
4973 @opindex Wattributes
4974 Do not warn if an unexpected @code{__attribute__} is used, such as
4975 unrecognized attributes, function attributes applied to variables,
4976 etc.  This does not stop errors for incorrect use of supported
4977 attributes.
4979 @item -Wno-builtin-macro-redefined
4980 @opindex Wno-builtin-macro-redefined
4981 @opindex Wbuiltin-macro-redefined
4982 Do not warn if certain built-in macros are redefined.  This suppresses
4983 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4984 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4986 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4987 @opindex Wstrict-prototypes
4988 @opindex Wno-strict-prototypes
4989 Warn if a function is declared or defined without specifying the
4990 argument types.  (An old-style function definition is permitted without
4991 a warning if preceded by a declaration that specifies the argument
4992 types.)
4994 @item -Wold-style-declaration @r{(C and Objective-C only)}
4995 @opindex Wold-style-declaration
4996 @opindex Wno-old-style-declaration
4997 Warn for obsolescent usages, according to the C Standard, in a
4998 declaration. For example, warn if storage-class specifiers like
4999 @code{static} are not the first things in a declaration.  This warning
5000 is also enabled by @option{-Wextra}.
5002 @item -Wold-style-definition @r{(C and Objective-C only)}
5003 @opindex Wold-style-definition
5004 @opindex Wno-old-style-definition
5005 Warn if an old-style function definition is used.  A warning is given
5006 even if there is a previous prototype.
5008 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
5009 @opindex Wmissing-parameter-type
5010 @opindex Wno-missing-parameter-type
5011 A function parameter is declared without a type specifier in K&R-style
5012 functions:
5014 @smallexample
5015 void foo(bar) @{ @}
5016 @end smallexample
5018 This warning is also enabled by @option{-Wextra}.
5020 @item -Wmissing-prototypes @r{(C and Objective-C only)}
5021 @opindex Wmissing-prototypes
5022 @opindex Wno-missing-prototypes
5023 Warn if a global function is defined without a previous prototype
5024 declaration.  This warning is issued even if the definition itself
5025 provides a prototype.  Use this option to detect global functions
5026 that do not have a matching prototype declaration in a header file.
5027 This option is not valid for C++ because all function declarations
5028 provide prototypes and a non-matching declaration declares an
5029 overload rather than conflict with an earlier declaration.
5030 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
5032 @item -Wmissing-declarations
5033 @opindex Wmissing-declarations
5034 @opindex Wno-missing-declarations
5035 Warn if a global function is defined without a previous declaration.
5036 Do so even if the definition itself provides a prototype.
5037 Use this option to detect global functions that are not declared in
5038 header files.  In C, no warnings are issued for functions with previous
5039 non-prototype declarations; use @option{-Wmissing-prototypes} to detect
5040 missing prototypes.  In C++, no warnings are issued for function templates,
5041 or for inline functions, or for functions in anonymous namespaces.
5043 @item -Wmissing-field-initializers
5044 @opindex Wmissing-field-initializers
5045 @opindex Wno-missing-field-initializers
5046 @opindex W
5047 @opindex Wextra
5048 @opindex Wno-extra
5049 Warn if a structure's initializer has some fields missing.  For
5050 example, the following code causes such a warning, because
5051 @code{x.h} is implicitly zero:
5053 @smallexample
5054 struct s @{ int f, g, h; @};
5055 struct s x = @{ 3, 4 @};
5056 @end smallexample
5058 This option does not warn about designated initializers, so the following
5059 modification does not trigger a warning:
5061 @smallexample
5062 struct s @{ int f, g, h; @};
5063 struct s x = @{ .f = 3, .g = 4 @};
5064 @end smallexample
5066 In C++ this option does not warn either about the empty @{ @}
5067 initializer, for example:
5069 @smallexample
5070 struct s @{ int f, g, h; @};
5071 s x = @{ @};
5072 @end smallexample
5074 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
5075 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
5077 @item -Wno-multichar
5078 @opindex Wno-multichar
5079 @opindex Wmultichar
5080 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
5081 Usually they indicate a typo in the user's code, as they have
5082 implementation-defined values, and should not be used in portable code.
5084 @item -Wnormalized@r{[}=@r{<}none@r{|}id@r{|}nfc@r{|}nfkc@r{>]}
5085 @opindex Wnormalized=
5086 @opindex Wnormalized
5087 @opindex Wno-normalized
5088 @cindex NFC
5089 @cindex NFKC
5090 @cindex character set, input normalization
5091 In ISO C and ISO C++, two identifiers are different if they are
5092 different sequences of characters.  However, sometimes when characters
5093 outside the basic ASCII character set are used, you can have two
5094 different character sequences that look the same.  To avoid confusion,
5095 the ISO 10646 standard sets out some @dfn{normalization rules} which
5096 when applied ensure that two sequences that look the same are turned into
5097 the same sequence.  GCC can warn you if you are using identifiers that
5098 have not been normalized; this option controls that warning.
5100 There are four levels of warning supported by GCC@.  The default is
5101 @option{-Wnormalized=nfc}, which warns about any identifier that is
5102 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
5103 recommended form for most uses.  It is equivalent to
5104 @option{-Wnormalized}.
5106 Unfortunately, there are some characters allowed in identifiers by
5107 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
5108 identifiers.  That is, there's no way to use these symbols in portable
5109 ISO C or C++ and have all your identifiers in NFC@.
5110 @option{-Wnormalized=id} suppresses the warning for these characters.
5111 It is hoped that future versions of the standards involved will correct
5112 this, which is why this option is not the default.
5114 You can switch the warning off for all characters by writing
5115 @option{-Wnormalized=none} or @option{-Wno-normalized}.  You should
5116 only do this if you are using some other normalization scheme (like
5117 ``D''), because otherwise you can easily create bugs that are
5118 literally impossible to see.
5120 Some characters in ISO 10646 have distinct meanings but look identical
5121 in some fonts or display methodologies, especially once formatting has
5122 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
5123 LETTER N'', displays just like a regular @code{n} that has been
5124 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
5125 normalization scheme to convert all these into a standard form as
5126 well, and GCC warns if your code is not in NFKC if you use
5127 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
5128 about every identifier that contains the letter O because it might be
5129 confused with the digit 0, and so is not the default, but may be
5130 useful as a local coding convention if the programming environment 
5131 cannot be fixed to display these characters distinctly.
5133 @item -Wno-deprecated
5134 @opindex Wno-deprecated
5135 @opindex Wdeprecated
5136 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
5138 @item -Wno-deprecated-declarations
5139 @opindex Wno-deprecated-declarations
5140 @opindex Wdeprecated-declarations
5141 Do not warn about uses of functions (@pxref{Function Attributes}),
5142 variables (@pxref{Variable Attributes}), and types (@pxref{Type
5143 Attributes}) marked as deprecated by using the @code{deprecated}
5144 attribute.
5146 @item -Wno-overflow
5147 @opindex Wno-overflow
5148 @opindex Woverflow
5149 Do not warn about compile-time overflow in constant expressions.
5151 @item -Wno-odr
5152 @opindex Wno-odr
5153 @opindex Wodr
5154 Warn about One Definition Rule violations during link-time optimization.
5155 Requires @option{-flto-odr-type-merging} to be enabled.  Enabled by default.
5157 @item -Wopenmp-simd
5158 @opindex Wopenm-simd
5159 Warn if the vectorizer cost model overrides the OpenMP or the Cilk Plus
5160 simd directive set by user.  The @option{-fsimd-cost-model=unlimited}
5161 option can be used to relax the cost model.
5163 @item -Woverride-init @r{(C and Objective-C only)}
5164 @opindex Woverride-init
5165 @opindex Wno-override-init
5166 @opindex W
5167 @opindex Wextra
5168 @opindex Wno-extra
5169 Warn if an initialized field without side effects is overridden when
5170 using designated initializers (@pxref{Designated Inits, , Designated
5171 Initializers}).
5173 This warning is included in @option{-Wextra}.  To get other
5174 @option{-Wextra} warnings without this one, use @option{-Wextra
5175 -Wno-override-init}.
5177 @item -Wpacked
5178 @opindex Wpacked
5179 @opindex Wno-packed
5180 Warn if a structure is given the packed attribute, but the packed
5181 attribute has no effect on the layout or size of the structure.
5182 Such structures may be mis-aligned for little benefit.  For
5183 instance, in this code, the variable @code{f.x} in @code{struct bar}
5184 is misaligned even though @code{struct bar} does not itself
5185 have the packed attribute:
5187 @smallexample
5188 @group
5189 struct foo @{
5190   int x;
5191   char a, b, c, d;
5192 @} __attribute__((packed));
5193 struct bar @{
5194   char z;
5195   struct foo f;
5197 @end group
5198 @end smallexample
5200 @item -Wpacked-bitfield-compat
5201 @opindex Wpacked-bitfield-compat
5202 @opindex Wno-packed-bitfield-compat
5203 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
5204 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
5205 the change can lead to differences in the structure layout.  GCC
5206 informs you when the offset of such a field has changed in GCC 4.4.
5207 For example there is no longer a 4-bit padding between field @code{a}
5208 and @code{b} in this structure:
5210 @smallexample
5211 struct foo
5213   char a:4;
5214   char b:8;
5215 @} __attribute__ ((packed));
5216 @end smallexample
5218 This warning is enabled by default.  Use
5219 @option{-Wno-packed-bitfield-compat} to disable this warning.
5221 @item -Wpadded
5222 @opindex Wpadded
5223 @opindex Wno-padded
5224 Warn if padding is included in a structure, either to align an element
5225 of the structure or to align the whole structure.  Sometimes when this
5226 happens it is possible to rearrange the fields of the structure to
5227 reduce the padding and so make the structure smaller.
5229 @item -Wredundant-decls
5230 @opindex Wredundant-decls
5231 @opindex Wno-redundant-decls
5232 Warn if anything is declared more than once in the same scope, even in
5233 cases where multiple declaration is valid and changes nothing.
5235 @item -Wnested-externs @r{(C and Objective-C only)}
5236 @opindex Wnested-externs
5237 @opindex Wno-nested-externs
5238 Warn if an @code{extern} declaration is encountered within a function.
5240 @item -Wno-inherited-variadic-ctor
5241 @opindex Winherited-variadic-ctor
5242 @opindex Wno-inherited-variadic-ctor
5243 Suppress warnings about use of C++11 inheriting constructors when the
5244 base class inherited from has a C variadic constructor; the warning is
5245 on by default because the ellipsis is not inherited.
5247 @item -Winline
5248 @opindex Winline
5249 @opindex Wno-inline
5250 Warn if a function that is declared as inline cannot be inlined.
5251 Even with this option, the compiler does not warn about failures to
5252 inline functions declared in system headers.
5254 The compiler uses a variety of heuristics to determine whether or not
5255 to inline a function.  For example, the compiler takes into account
5256 the size of the function being inlined and the amount of inlining
5257 that has already been done in the current function.  Therefore,
5258 seemingly insignificant changes in the source program can cause the
5259 warnings produced by @option{-Winline} to appear or disappear.
5261 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
5262 @opindex Wno-invalid-offsetof
5263 @opindex Winvalid-offsetof
5264 Suppress warnings from applying the @code{offsetof} macro to a non-POD
5265 type.  According to the 2014 ISO C++ standard, applying @code{offsetof}
5266 to a non-standard-layout type is undefined.  In existing C++ implementations,
5267 however, @code{offsetof} typically gives meaningful results.
5268 This flag is for users who are aware that they are
5269 writing nonportable code and who have deliberately chosen to ignore the
5270 warning about it.
5272 The restrictions on @code{offsetof} may be relaxed in a future version
5273 of the C++ standard.
5275 @item -Wno-int-to-pointer-cast
5276 @opindex Wno-int-to-pointer-cast
5277 @opindex Wint-to-pointer-cast
5278 Suppress warnings from casts to pointer type of an integer of a
5279 different size. In C++, casting to a pointer type of smaller size is
5280 an error. @option{Wint-to-pointer-cast} is enabled by default.
5283 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
5284 @opindex Wno-pointer-to-int-cast
5285 @opindex Wpointer-to-int-cast
5286 Suppress warnings from casts from a pointer to an integer type of a
5287 different size.
5289 @item -Winvalid-pch
5290 @opindex Winvalid-pch
5291 @opindex Wno-invalid-pch
5292 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
5293 the search path but can't be used.
5295 @item -Wlong-long
5296 @opindex Wlong-long
5297 @opindex Wno-long-long
5298 Warn if @code{long long} type is used.  This is enabled by either
5299 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
5300 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
5302 @item -Wvariadic-macros
5303 @opindex Wvariadic-macros
5304 @opindex Wno-variadic-macros
5305 Warn if variadic macros are used in ISO C90 mode, or if the GNU
5306 alternate syntax is used in ISO C99 mode.  This is enabled by either
5307 @option{-Wpedantic} or @option{-Wtraditional}.  To inhibit the warning
5308 messages, use @option{-Wno-variadic-macros}.
5310 @item -Wvarargs
5311 @opindex Wvarargs
5312 @opindex Wno-varargs
5313 Warn upon questionable usage of the macros used to handle variable
5314 arguments like @code{va_start}.  This is default.  To inhibit the
5315 warning messages, use @option{-Wno-varargs}.
5317 @item -Wvector-operation-performance
5318 @opindex Wvector-operation-performance
5319 @opindex Wno-vector-operation-performance
5320 Warn if vector operation is not implemented via SIMD capabilities of the
5321 architecture.  Mainly useful for the performance tuning.
5322 Vector operation can be implemented @code{piecewise}, which means that the
5323 scalar operation is performed on every vector element; 
5324 @code{in parallel}, which means that the vector operation is implemented
5325 using scalars of wider type, which normally is more performance efficient;
5326 and @code{as a single scalar}, which means that vector fits into a
5327 scalar type.
5329 @item -Wno-virtual-move-assign
5330 @opindex Wvirtual-move-assign
5331 @opindex Wno-virtual-move-assign
5332 Suppress warnings about inheriting from a virtual base with a
5333 non-trivial C++11 move assignment operator.  This is dangerous because
5334 if the virtual base is reachable along more than one path, it is
5335 moved multiple times, which can mean both objects end up in the
5336 moved-from state.  If the move assignment operator is written to avoid
5337 moving from a moved-from object, this warning can be disabled.
5339 @item -Wvla
5340 @opindex Wvla
5341 @opindex Wno-vla
5342 Warn if variable length array is used in the code.
5343 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
5344 the variable length array.
5346 @item -Wvolatile-register-var
5347 @opindex Wvolatile-register-var
5348 @opindex Wno-volatile-register-var
5349 Warn if a register variable is declared volatile.  The volatile
5350 modifier does not inhibit all optimizations that may eliminate reads
5351 and/or writes to register variables.  This warning is enabled by
5352 @option{-Wall}.
5354 @item -Wdisabled-optimization
5355 @opindex Wdisabled-optimization
5356 @opindex Wno-disabled-optimization
5357 Warn if a requested optimization pass is disabled.  This warning does
5358 not generally indicate that there is anything wrong with your code; it
5359 merely indicates that GCC's optimizers are unable to handle the code
5360 effectively.  Often, the problem is that your code is too big or too
5361 complex; GCC refuses to optimize programs when the optimization
5362 itself is likely to take inordinate amounts of time.
5364 @item -Wpointer-sign @r{(C and Objective-C only)}
5365 @opindex Wpointer-sign
5366 @opindex Wno-pointer-sign
5367 Warn for pointer argument passing or assignment with different signedness.
5368 This option is only supported for C and Objective-C@.  It is implied by
5369 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
5370 @option{-Wno-pointer-sign}.
5372 @item -Wstack-protector
5373 @opindex Wstack-protector
5374 @opindex Wno-stack-protector
5375 This option is only active when @option{-fstack-protector} is active.  It
5376 warns about functions that are not protected against stack smashing.
5378 @item -Woverlength-strings
5379 @opindex Woverlength-strings
5380 @opindex Wno-overlength-strings
5381 Warn about string constants that are longer than the ``minimum
5382 maximum'' length specified in the C standard.  Modern compilers
5383 generally allow string constants that are much longer than the
5384 standard's minimum limit, but very portable programs should avoid
5385 using longer strings.
5387 The limit applies @emph{after} string constant concatenation, and does
5388 not count the trailing NUL@.  In C90, the limit was 509 characters; in
5389 C99, it was raised to 4095.  C++98 does not specify a normative
5390 minimum maximum, so we do not diagnose overlength strings in C++@.
5392 This option is implied by @option{-Wpedantic}, and can be disabled with
5393 @option{-Wno-overlength-strings}.
5395 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
5396 @opindex Wunsuffixed-float-constants
5398 Issue a warning for any floating constant that does not have
5399 a suffix.  When used together with @option{-Wsystem-headers} it
5400 warns about such constants in system header files.  This can be useful
5401 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
5402 from the decimal floating-point extension to C99.
5404 @item -Wno-designated-init @r{(C and Objective-C only)}
5405 Suppress warnings when a positional initializer is used to initialize
5406 a structure that has been marked with the @code{designated_init}
5407 attribute.
5409 @end table
5411 @node Debugging Options
5412 @section Options for Debugging Your Program or GCC
5413 @cindex options, debugging
5414 @cindex debugging information options
5416 GCC has various special options that are used for debugging
5417 either your program or GCC:
5419 @table @gcctabopt
5420 @item -g
5421 @opindex g
5422 Produce debugging information in the operating system's native format
5423 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
5424 information.
5426 On most systems that use stabs format, @option{-g} enables use of extra
5427 debugging information that only GDB can use; this extra information
5428 makes debugging work better in GDB but probably makes other debuggers
5429 crash or
5430 refuse to read the program.  If you want to control for certain whether
5431 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
5432 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
5434 GCC allows you to use @option{-g} with
5435 @option{-O}.  The shortcuts taken by optimized code may occasionally
5436 produce surprising results: some variables you declared may not exist
5437 at all; flow of control may briefly move where you did not expect it;
5438 some statements may not be executed because they compute constant
5439 results or their values are already at hand; some statements may
5440 execute in different places because they have been moved out of loops.
5442 Nevertheless it proves possible to debug optimized output.  This makes
5443 it reasonable to use the optimizer for programs that might have bugs.
5445 The following options are useful when GCC is generated with the
5446 capability for more than one debugging format.
5448 @item -gsplit-dwarf
5449 @opindex gsplit-dwarf
5450 Separate as much dwarf debugging information as possible into a
5451 separate output file with the extension .dwo.  This option allows
5452 the build system to avoid linking files with debug information.  To
5453 be useful, this option requires a debugger capable of reading .dwo
5454 files.
5456 @item -ggdb
5457 @opindex ggdb
5458 Produce debugging information for use by GDB@.  This means to use the
5459 most expressive format available (DWARF 2, stabs, or the native format
5460 if neither of those are supported), including GDB extensions if at all
5461 possible.
5463 @item -gpubnames
5464 @opindex gpubnames
5465 Generate dwarf .debug_pubnames and .debug_pubtypes sections.
5467 @item -ggnu-pubnames
5468 @opindex ggnu-pubnames
5469 Generate .debug_pubnames and .debug_pubtypes sections in a format
5470 suitable for conversion into a GDB@ index.  This option is only useful
5471 with a linker that can produce GDB@ index version 7.
5473 @item -gstabs
5474 @opindex gstabs
5475 Produce debugging information in stabs format (if that is supported),
5476 without GDB extensions.  This is the format used by DBX on most BSD
5477 systems.  On MIPS, Alpha and System V Release 4 systems this option
5478 produces stabs debugging output that is not understood by DBX or SDB@.
5479 On System V Release 4 systems this option requires the GNU assembler.
5481 @item -feliminate-unused-debug-symbols
5482 @opindex feliminate-unused-debug-symbols
5483 Produce debugging information in stabs format (if that is supported),
5484 for only symbols that are actually used.
5486 @item -femit-class-debug-always
5487 @opindex femit-class-debug-always
5488 Instead of emitting debugging information for a C++ class in only one
5489 object file, emit it in all object files using the class.  This option
5490 should be used only with debuggers that are unable to handle the way GCC
5491 normally emits debugging information for classes because using this
5492 option increases the size of debugging information by as much as a
5493 factor of two.
5495 @item -fdebug-types-section
5496 @opindex fdebug-types-section
5497 @opindex fno-debug-types-section
5498 When using DWARF Version 4 or higher, type DIEs can be put into
5499 their own @code{.debug_types} section instead of making them part of the
5500 @code{.debug_info} section.  It is more efficient to put them in a separate
5501 comdat sections since the linker can then remove duplicates.
5502 But not all DWARF consumers support @code{.debug_types} sections yet
5503 and on some objects @code{.debug_types} produces larger instead of smaller
5504 debugging information.
5506 @item -gstabs+
5507 @opindex gstabs+
5508 Produce debugging information in stabs format (if that is supported),
5509 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5510 use of these extensions is likely to make other debuggers crash or
5511 refuse to read the program.
5513 @item -gcoff
5514 @opindex gcoff
5515 Produce debugging information in COFF format (if that is supported).
5516 This is the format used by SDB on most System V systems prior to
5517 System V Release 4.
5519 @item -gxcoff
5520 @opindex gxcoff
5521 Produce debugging information in XCOFF format (if that is supported).
5522 This is the format used by the DBX debugger on IBM RS/6000 systems.
5524 @item -gxcoff+
5525 @opindex gxcoff+
5526 Produce debugging information in XCOFF format (if that is supported),
5527 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5528 use of these extensions is likely to make other debuggers crash or
5529 refuse to read the program, and may cause assemblers other than the GNU
5530 assembler (GAS) to fail with an error.
5532 @item -gdwarf-@var{version}
5533 @opindex gdwarf-@var{version}
5534 Produce debugging information in DWARF format (if that is supported).
5535 The value of @var{version} may be either 2, 3, 4 or 5; the default version
5536 for most targets is 4.  DWARF Version 5 is only experimental.
5538 Note that with DWARF Version 2, some ports require and always
5539 use some non-conflicting DWARF 3 extensions in the unwind tables.
5541 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
5542 for maximum benefit.
5544 @item -grecord-gcc-switches
5545 @opindex grecord-gcc-switches
5546 This switch causes the command-line options used to invoke the
5547 compiler that may affect code generation to be appended to the
5548 DW_AT_producer attribute in DWARF debugging information.  The options
5549 are concatenated with spaces separating them from each other and from
5550 the compiler version.  See also @option{-frecord-gcc-switches} for another
5551 way of storing compiler options into the object file.  This is the default.
5553 @item -gno-record-gcc-switches
5554 @opindex gno-record-gcc-switches
5555 Disallow appending command-line options to the DW_AT_producer attribute
5556 in DWARF debugging information.
5558 @item -gstrict-dwarf
5559 @opindex gstrict-dwarf
5560 Disallow using extensions of later DWARF standard version than selected
5561 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
5562 DWARF extensions from later standard versions is allowed.
5564 @item -gno-strict-dwarf
5565 @opindex gno-strict-dwarf
5566 Allow using extensions of later DWARF standard version than selected with
5567 @option{-gdwarf-@var{version}}.
5569 @item -gz@r{[}=@var{type}@r{]}
5570 @opindex gz
5571 Produce compressed debug sections in DWARF format, if that is supported.
5572 If @var{type} is not given, the default type depends on the capabilities
5573 of the assembler and linker used.  @var{type} may be one of
5574 @samp{none} (don't compress debug sections), @samp{zlib} (use zlib
5575 compression in ELF gABI format), or @samp{zlib-gnu} (use zlib
5576 compression in traditional GNU format).  If the linker doesn't support
5577 writing compressed debug sections, the option is rejected.  Otherwise,
5578 if the assembler does not support them, @option{-gz} is silently ignored
5579 when producing object files.
5581 @item -gvms
5582 @opindex gvms
5583 Produce debugging information in Alpha/VMS debug format (if that is
5584 supported).  This is the format used by DEBUG on Alpha/VMS systems.
5586 @item -g@var{level}
5587 @itemx -ggdb@var{level}
5588 @itemx -gstabs@var{level}
5589 @itemx -gcoff@var{level}
5590 @itemx -gxcoff@var{level}
5591 @itemx -gvms@var{level}
5592 Request debugging information and also use @var{level} to specify how
5593 much information.  The default level is 2.
5595 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
5596 @option{-g}.
5598 Level 1 produces minimal information, enough for making backtraces in
5599 parts of the program that you don't plan to debug.  This includes
5600 descriptions of functions and external variables, and line number
5601 tables, but no information about local variables.
5603 Level 3 includes extra information, such as all the macro definitions
5604 present in the program.  Some debuggers support macro expansion when
5605 you use @option{-g3}.
5607 @option{-gdwarf-2} does not accept a concatenated debug level, because
5608 GCC used to support an option @option{-gdwarf} that meant to generate
5609 debug information in version 1 of the DWARF format (which is very
5610 different from version 2), and it would have been too confusing.  That
5611 debug format is long obsolete, but the option cannot be changed now.
5612 Instead use an additional @option{-g@var{level}} option to change the
5613 debug level for DWARF.
5615 @item -gtoggle
5616 @opindex gtoggle
5617 Turn off generation of debug info, if leaving out this option
5618 generates it, or turn it on at level 2 otherwise.  The position of this
5619 argument in the command line does not matter; it takes effect after all
5620 other options are processed, and it does so only once, no matter how
5621 many times it is given.  This is mainly intended to be used with
5622 @option{-fcompare-debug}.
5624 @item -fsanitize=address
5625 @opindex fsanitize=address
5626 Enable AddressSanitizer, a fast memory error detector.
5627 Memory access instructions are instrumented to detect
5628 out-of-bounds and use-after-free bugs.
5629 See @uref{http://code.google.com/p/address-sanitizer/} for
5630 more details.  The run-time behavior can be influenced using the
5631 @env{ASAN_OPTIONS} environment variable; see
5632 @url{https://code.google.com/p/address-sanitizer/wiki/Flags#Run-time_flags} for
5633 a list of supported options.
5635 @item -fsanitize=kernel-address
5636 @opindex fsanitize=kernel-address
5637 Enable AddressSanitizer for Linux kernel.
5638 See @uref{http://code.google.com/p/address-sanitizer/wiki/AddressSanitizerForKernel} for more details.
5640 @item -fsanitize=thread
5641 @opindex fsanitize=thread
5642 Enable ThreadSanitizer, a fast data race detector.
5643 Memory access instructions are instrumented to detect
5644 data race bugs.  See @uref{http://code.google.com/p/thread-sanitizer/} for more
5645 details. The run-time behavior can be influenced using the @env{TSAN_OPTIONS}
5646 environment variable; see
5647 @url{https://code.google.com/p/thread-sanitizer/wiki/Flags} for a list of
5648 supported options.
5650 @item -fsanitize=leak
5651 @opindex fsanitize=leak
5652 Enable LeakSanitizer, a memory leak detector.
5653 This option only matters for linking of executables and if neither
5654 @option{-fsanitize=address} nor @option{-fsanitize=thread} is used.  In that
5655 case the executable is linked against a library that overrides @code{malloc}
5656 and other allocator functions.  See
5657 @uref{https://code.google.com/p/address-sanitizer/wiki/LeakSanitizer} for more
5658 details.  The run-time behavior can be influenced using the
5659 @env{LSAN_OPTIONS} environment variable.
5661 @item -fsanitize=undefined
5662 @opindex fsanitize=undefined
5663 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector.
5664 Various computations are instrumented to detect undefined behavior
5665 at runtime.  Current suboptions are:
5667 @table @gcctabopt
5669 @item -fsanitize=shift
5670 @opindex fsanitize=shift
5671 This option enables checking that the result of a shift operation is
5672 not undefined.  Note that what exactly is considered undefined differs
5673 slightly between C and C++, as well as between ISO C90 and C99, etc.
5675 @item -fsanitize=integer-divide-by-zero
5676 @opindex fsanitize=integer-divide-by-zero
5677 Detect integer division by zero as well as @code{INT_MIN / -1} division.
5679 @item -fsanitize=unreachable
5680 @opindex fsanitize=unreachable
5681 With this option, the compiler turns the @code{__builtin_unreachable}
5682 call into a diagnostics message call instead.  When reaching the
5683 @code{__builtin_unreachable} call, the behavior is undefined.
5685 @item -fsanitize=vla-bound
5686 @opindex fsanitize=vla-bound
5687 This option instructs the compiler to check that the size of a variable
5688 length array is positive.
5690 @item -fsanitize=null
5691 @opindex fsanitize=null
5692 This option enables pointer checking.  Particularly, the application
5693 built with this option turned on will issue an error message when it
5694 tries to dereference a NULL pointer, or if a reference (possibly an
5695 rvalue reference) is bound to a NULL pointer, or if a method is invoked
5696 on an object pointed by a NULL pointer.
5698 @item -fsanitize=return
5699 @opindex fsanitize=return
5700 This option enables return statement checking.  Programs
5701 built with this option turned on will issue an error message
5702 when the end of a non-void function is reached without actually
5703 returning a value.  This option works in C++ only.
5705 @item -fsanitize=signed-integer-overflow
5706 @opindex fsanitize=signed-integer-overflow
5707 This option enables signed integer overflow checking.  We check that
5708 the result of @code{+}, @code{*}, and both unary and binary @code{-}
5709 does not overflow in the signed arithmetics.  Note, integer promotion
5710 rules must be taken into account.  That is, the following is not an
5711 overflow:
5712 @smallexample
5713 signed char a = SCHAR_MAX;
5714 a++;
5715 @end smallexample
5717 @item -fsanitize=bounds
5718 @opindex fsanitize=bounds
5719 This option enables instrumentation of array bounds.  Various out of bounds
5720 accesses are detected.  Flexible array members, flexible array member-like
5721 arrays, and initializers of variables with static storage are not instrumented.
5723 @item -fsanitize=alignment
5724 @opindex fsanitize=alignment
5726 This option enables checking of alignment of pointers when they are
5727 dereferenced, or when a reference is bound to insufficiently aligned target,
5728 or when a method or constructor is invoked on insufficiently aligned object.
5730 @item -fsanitize=object-size
5731 @opindex fsanitize=object-size
5732 This option enables instrumentation of memory references using the
5733 @code{__builtin_object_size} function.  Various out of bounds pointer
5734 accesses are detected.
5736 @item -fsanitize=float-divide-by-zero
5737 @opindex fsanitize=float-divide-by-zero
5738 Detect floating-point division by zero.  Unlike other similar options,
5739 @option{-fsanitize=float-divide-by-zero} is not enabled by
5740 @option{-fsanitize=undefined}, since floating-point division by zero can
5741 be a legitimate way of obtaining infinities and NaNs.
5743 @item -fsanitize=float-cast-overflow
5744 @opindex fsanitize=float-cast-overflow
5745 This option enables floating-point type to integer conversion checking.
5746 We check that the result of the conversion does not overflow.
5747 Unlike other similar options, @option{-fsanitize=float-cast-overflow} is
5748 not enabled by @option{-fsanitize=undefined}.
5749 This option does not work well with @code{FE_INVALID} exceptions enabled.
5751 @item -fsanitize=nonnull-attribute
5752 @opindex fsanitize=nonnull-attribute
5754 This option enables instrumentation of calls, checking whether null values
5755 are not passed to arguments marked as requiring a non-null value by the
5756 @code{nonnull} function attribute.
5758 @item -fsanitize=returns-nonnull-attribute
5759 @opindex fsanitize=returns-nonnull-attribute
5761 This option enables instrumentation of return statements in functions
5762 marked with @code{returns_nonnull} function attribute, to detect returning
5763 of null values from such functions.
5765 @item -fsanitize=bool
5766 @opindex fsanitize=bool
5768 This option enables instrumentation of loads from bool.  If a value other
5769 than 0/1 is loaded, a run-time error is issued.
5771 @item -fsanitize=enum
5772 @opindex fsanitize=enum
5774 This option enables instrumentation of loads from an enum type.  If
5775 a value outside the range of values for the enum type is loaded,
5776 a run-time error is issued.
5778 @item -fsanitize=vptr
5779 @opindex fsanitize=vptr
5781 This option enables instrumentation of C++ member function calls, member
5782 accesses and some conversions between pointers to base and derived classes,
5783 to verify the referenced object has the correct dynamic type.
5785 @end table
5787 While @option{-ftrapv} causes traps for signed overflows to be emitted,
5788 @option{-fsanitize=undefined} gives a diagnostic message.
5789 This currently works only for the C family of languages.
5791 @item -fno-sanitize=all
5792 @opindex fno-sanitize=all
5794 This option disables all previously enabled sanitizers.
5795 @option{-fsanitize=all} is not allowed, as some sanitizers cannot be used
5796 together.
5798 @item -fasan-shadow-offset=@var{number}
5799 @opindex fasan-shadow-offset
5800 This option forces GCC to use custom shadow offset in AddressSanitizer checks.
5801 It is useful for experimenting with different shadow memory layouts in
5802 Kernel AddressSanitizer.
5804 @item -fsanitize-recover@r{[}=@var{opts}@r{]}
5805 @opindex fsanitize-recover
5806 @opindex fno-sanitize-recover
5807 @option{-fsanitize-recover=} controls error recovery mode for sanitizers
5808 mentioned in comma-separated list of @var{opts}.  Enabling this option
5809 for a sanitizer component causes it to attempt to continue
5810 running the program as if no error happened.  This means multiple
5811 runtime errors can be reported in a single program run, and the exit
5812 code of the program may indicate success even when errors
5813 have been reported.  The @option{-fno-sanitize-recover=} option
5814 can be used to alter
5815 this behavior: only the first detected error is reported
5816 and program then exits with a non-zero exit code.
5818 Currently this feature only works for @option{-fsanitize=undefined} (and its suboptions
5819 except for @option{-fsanitize=unreachable} and @option{-fsanitize=return}),
5820 @option{-fsanitize=float-cast-overflow}, @option{-fsanitize=float-divide-by-zero} and
5821 @option{-fsanitize=kernel-address}.  For these sanitizers error recovery is turned on by default.
5822 @option{-fsanitize-recover=all} and @option{-fno-sanitize-recover=all} is also
5823 accepted, the former enables recovery for all sanitizers that support it,
5824 the latter disables recovery for all sanitizers that support it.
5826 Syntax without explicit @var{opts} parameter is deprecated.  It is equivalent to
5827 @smallexample
5828 -fsanitize-recover=undefined,float-cast-overflow,float-divide-by-zero
5829 @end smallexample
5830 @noindent
5831 Similarly @option{-fno-sanitize-recover} is equivalent to
5832 @smallexample
5833 -fno-sanitize-recover=undefined,float-cast-overflow,float-divide-by-zero
5834 @end smallexample
5836 @item -fsanitize-undefined-trap-on-error
5837 @opindex fsanitize-undefined-trap-on-error
5838 The @option{-fsanitize-undefined-trap-on-error} option instructs the compiler to
5839 report undefined behavior using @code{__builtin_trap} rather than
5840 a @code{libubsan} library routine.  The advantage of this is that the
5841 @code{libubsan} library is not needed and is not linked in, so this
5842 is usable even in freestanding environments.
5844 @item -fcheck-pointer-bounds
5845 @opindex fcheck-pointer-bounds
5846 @opindex fno-check-pointer-bounds
5847 @cindex Pointer Bounds Checker options
5848 Enable Pointer Bounds Checker instrumentation.  Each memory reference
5849 is instrumented with checks of the pointer used for memory access against
5850 bounds associated with that pointer.  
5852 Currently there
5853 is only an implementation for Intel MPX available, thus x86 target
5854 and @option{-mmpx} are required to enable this feature.  
5855 MPX-based instrumentation requires
5856 a runtime library to enable MPX in hardware and handle bounds
5857 violation signals.  By default when @option{-fcheck-pointer-bounds}
5858 and @option{-mmpx} options are used to link a program, the GCC driver
5859 links against the @file{libmpx} runtime library.  MPX-based instrumentation
5860 may be used for debugging and also may be included in production code
5861 to increase program security.  Depending on usage, you may
5862 have different requirements for the runtime library.  The current version
5863 of the MPX runtime library is more oriented for use as a debugging
5864 tool.  MPX runtime library usage implies @option{-lpthread}.  See
5865 also @option{-static-libmpx}.  The runtime library  behavior can be
5866 influenced using various @env{CHKP_RT_*} environment variables.  See
5867 @uref{https://gcc.gnu.org/wiki/Intel%20MPX%20support%20in%20the%20GCC%20compiler}
5868 for more details.
5870 Generated instrumentation may be controlled by various
5871 @option{-fchkp-*} options and by the @code{bnd_variable_size}
5872 structure field attribute (@pxref{Type Attributes}) and
5873 @code{bnd_legacy}, and @code{bnd_instrument} function attributes
5874 (@pxref{Function Attributes}).  GCC also provides a number of built-in
5875 functions for controlling the Pointer Bounds Checker.  @xref{Pointer
5876 Bounds Checker builtins}, for more information.
5878 @item -fchkp-check-incomplete-type
5879 @opindex fchkp-check-incomplete-type
5880 @opindex fno-chkp-check-incomplete-type
5881 Generate pointer bounds checks for variables with incomplete type.
5882 Enabled by default.  
5884 @item -fchkp-narrow-bounds
5885 @opindex fchkp-narrow-bounds
5886 @opindex fno-chkp-narrow-bounds
5887 Controls bounds used by Pointer Bounds Checker for pointers to object
5888 fields.  If narrowing is enabled then field bounds are used.  Otherwise
5889 object bounds are used.  See also @option{-fchkp-narrow-to-innermost-array}
5890 and @option{-fchkp-first-field-has-own-bounds}.  Enabled by default.
5892 @item -fchkp-first-field-has-own-bounds
5893 @opindex fchkp-first-field-has-own-bounds
5894 @opindex fno-chkp-first-field-has-own-bounds
5895 Forces Pointer Bounds Checker to use narrowed bounds for the address of the
5896 first field in the structure.  By default a pointer to the first field has
5897 the same bounds as a pointer to the whole structure.
5899 @item -fchkp-narrow-to-innermost-array
5900 @opindex fchkp-narrow-to-innermost-array
5901 @opindex fno-chkp-narrow-to-innermost-array
5902 Forces Pointer Bounds Checker to use bounds of the innermost arrays in
5903 case of nested static array access.  By default this option is disabled and
5904 bounds of the outermost array are used.
5906 @item -fchkp-optimize
5907 @opindex fchkp-optimize
5908 @opindex fno-chkp-optimize
5909 Enables Pointer Bounds Checker optimizations.  Enabled by default at
5910 optimization levels @option{-O}, @option{-O2}, @option{-O3}.
5912 @item -fchkp-use-fast-string-functions
5913 @opindex fchkp-use-fast-string-functions
5914 @opindex fno-chkp-use-fast-string-functions
5915 Enables use of @code{*_nobnd} versions of string functions (not copying bounds)
5916 by Pointer Bounds Checker.  Disabled by default.
5918 @item -fchkp-use-nochk-string-functions
5919 @opindex fchkp-use-nochk-string-functions
5920 @opindex fno-chkp-use-nochk-string-functions
5921 Enables use of @code{*_nochk} versions of string functions (not checking bounds)
5922 by Pointer Bounds Checker.  Disabled by default.
5924 @item -fchkp-use-static-bounds
5925 @opindex fchkp-use-static-bounds
5926 @opindex fno-chkp-use-static-bounds
5927 Allow Pointer Bounds Checker to generate static bounds holding
5928 bounds of static variables.  Enabled by default.
5930 @item -fchkp-use-static-const-bounds
5931 @opindex fchkp-use-static-const-bounds
5932 @opindex fno-chkp-use-static-const-bounds
5933 Use statically-initialized bounds for constant bounds instead of
5934 generating them each time they are required.  By default enabled when
5935 @option{-fchkp-use-static-bounds} is enabled.
5937 @item -fchkp-treat-zero-dynamic-size-as-infinite
5938 @opindex fchkp-treat-zero-dynamic-size-as-infinite
5939 @opindex fno-chkp-treat-zero-dynamic-size-as-infinite
5940 With this option, objects with incomplete type whose
5941 dynamically-obtained size is zero are treated as having infinite size
5942 instead by Pointer Bounds
5943 Checker.  This option may be helpful if a program is linked with a library
5944 missing size information for some symbols.  Disabled by default.
5946 @item -fchkp-check-read
5947 @opindex fchkp-check-read
5948 @opindex fno-chkp-check-read
5949 Instructs Pointer Bounds Checker to generate checks for all read
5950 accesses to memory.  Enabled by default.
5952 @item -fchkp-check-write
5953 @opindex fchkp-check-write
5954 @opindex fno-chkp-check-write
5955 Instructs Pointer Bounds Checker to generate checks for all write
5956 accesses to memory.  Enabled by default.
5958 @item -fchkp-store-bounds
5959 @opindex fchkp-store-bounds
5960 @opindex fno-chkp-store-bounds
5961 Instructs Pointer Bounds Checker to generate bounds stores for
5962 pointer writes.  Enabled by default.
5964 @item -fchkp-instrument-calls
5965 @opindex fchkp-instrument-calls
5966 @opindex fno-chkp-instrument-calls
5967 Instructs Pointer Bounds Checker to pass pointer bounds to calls.
5968 Enabled by default.
5970 @item -fchkp-instrument-marked-only
5971 @opindex fchkp-instrument-marked-only
5972 @opindex fno-chkp-instrument-marked-only
5973 Instructs Pointer Bounds Checker to instrument only functions
5974 marked with the @code{bnd_instrument} attribute
5975 (@pxref{Function Attributes}).  Disabled by default.
5977 @item -fchkp-use-wrappers
5978 @opindex fchkp-use-wrappers
5979 @opindex fno-chkp-use-wrappers
5980 Allows Pointer Bounds Checker to replace calls to built-in functions
5981 with calls to wrapper functions.  When @option{-fchkp-use-wrappers}
5982 is used to link a program, the GCC driver automatically links
5983 against @file{libmpxwrappers}.  See also @option{-static-libmpxwrappers}.
5984 Enabled by default.
5986 @item -fdump-final-insns@r{[}=@var{file}@r{]}
5987 @opindex fdump-final-insns
5988 Dump the final internal representation (RTL) to @var{file}.  If the
5989 optional argument is omitted (or if @var{file} is @code{.}), the name
5990 of the dump file is determined by appending @code{.gkd} to the
5991 compilation output file name.
5993 @item -fcompare-debug@r{[}=@var{opts}@r{]}
5994 @opindex fcompare-debug
5995 @opindex fno-compare-debug
5996 If no error occurs during compilation, run the compiler a second time,
5997 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
5998 passed to the second compilation.  Dump the final internal
5999 representation in both compilations, and print an error if they differ.
6001 If the equal sign is omitted, the default @option{-gtoggle} is used.
6003 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
6004 and nonzero, implicitly enables @option{-fcompare-debug}.  If
6005 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
6006 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
6007 is used.
6009 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
6010 is equivalent to @option{-fno-compare-debug}, which disables the dumping
6011 of the final representation and the second compilation, preventing even
6012 @env{GCC_COMPARE_DEBUG} from taking effect.
6014 To verify full coverage during @option{-fcompare-debug} testing, set
6015 @env{GCC_COMPARE_DEBUG} to say @option{-fcompare-debug-not-overridden},
6016 which GCC rejects as an invalid option in any actual compilation
6017 (rather than preprocessing, assembly or linking).  To get just a
6018 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
6019 not overridden} will do.
6021 @item -fcompare-debug-second
6022 @opindex fcompare-debug-second
6023 This option is implicitly passed to the compiler for the second
6024 compilation requested by @option{-fcompare-debug}, along with options to
6025 silence warnings, and omitting other options that would cause
6026 side-effect compiler outputs to files or to the standard output.  Dump
6027 files and preserved temporary files are renamed so as to contain the
6028 @code{.gk} additional extension during the second compilation, to avoid
6029 overwriting those generated by the first.
6031 When this option is passed to the compiler driver, it causes the
6032 @emph{first} compilation to be skipped, which makes it useful for little
6033 other than debugging the compiler proper.
6035 @item -feliminate-dwarf2-dups
6036 @opindex feliminate-dwarf2-dups
6037 Compress DWARF 2 debugging information by eliminating duplicated
6038 information about each symbol.  This option only makes sense when
6039 generating DWARF 2 debugging information with @option{-gdwarf-2}.
6041 @item -femit-struct-debug-baseonly
6042 @opindex femit-struct-debug-baseonly
6043 Emit debug information for struct-like types
6044 only when the base name of the compilation source file
6045 matches the base name of file in which the struct is defined.
6047 This option substantially reduces the size of debugging information,
6048 but at significant potential loss in type information to the debugger.
6049 See @option{-femit-struct-debug-reduced} for a less aggressive option.
6050 See @option{-femit-struct-debug-detailed} for more detailed control.
6052 This option works only with DWARF 2.
6054 @item -femit-struct-debug-reduced
6055 @opindex femit-struct-debug-reduced
6056 Emit debug information for struct-like types
6057 only when the base name of the compilation source file
6058 matches the base name of file in which the type is defined,
6059 unless the struct is a template or defined in a system header.
6061 This option significantly reduces the size of debugging information,
6062 with some potential loss in type information to the debugger.
6063 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
6064 See @option{-femit-struct-debug-detailed} for more detailed control.
6066 This option works only with DWARF 2.
6068 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
6069 @opindex femit-struct-debug-detailed
6070 Specify the struct-like types
6071 for which the compiler generates debug information.
6072 The intent is to reduce duplicate struct debug information
6073 between different object files within the same program.
6075 This option is a detailed version of
6076 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
6077 which serves for most needs.
6079 A specification has the syntax@*
6080 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
6082 The optional first word limits the specification to
6083 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
6084 A struct type is used directly when it is the type of a variable, member.
6085 Indirect uses arise through pointers to structs.
6086 That is, when use of an incomplete struct is valid, the use is indirect.
6087 An example is
6088 @samp{struct one direct; struct two * indirect;}.
6090 The optional second word limits the specification to
6091 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
6092 Generic structs are a bit complicated to explain.
6093 For C++, these are non-explicit specializations of template classes,
6094 or non-template classes within the above.
6095 Other programming languages have generics,
6096 but @option{-femit-struct-debug-detailed} does not yet implement them.
6098 The third word specifies the source files for those
6099 structs for which the compiler should emit debug information.
6100 The values @samp{none} and @samp{any} have the normal meaning.
6101 The value @samp{base} means that
6102 the base of name of the file in which the type declaration appears
6103 must match the base of the name of the main compilation file.
6104 In practice, this means that when compiling @file{foo.c}, debug information
6105 is generated for types declared in that file and @file{foo.h},
6106 but not other header files.
6107 The value @samp{sys} means those types satisfying @samp{base}
6108 or declared in system or compiler headers.
6110 You may need to experiment to determine the best settings for your application.
6112 The default is @option{-femit-struct-debug-detailed=all}.
6114 This option works only with DWARF 2.
6116 @item -fno-merge-debug-strings
6117 @opindex fmerge-debug-strings
6118 @opindex fno-merge-debug-strings
6119 Direct the linker to not merge together strings in the debugging
6120 information that are identical in different object files.  Merging is
6121 not supported by all assemblers or linkers.  Merging decreases the size
6122 of the debug information in the output file at the cost of increasing
6123 link processing time.  Merging is enabled by default.
6125 @item -fdebug-prefix-map=@var{old}=@var{new}
6126 @opindex fdebug-prefix-map
6127 When compiling files in directory @file{@var{old}}, record debugging
6128 information describing them as in @file{@var{new}} instead.
6130 @item -fno-dwarf2-cfi-asm
6131 @opindex fdwarf2-cfi-asm
6132 @opindex fno-dwarf2-cfi-asm
6133 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
6134 instead of using GAS @code{.cfi_*} directives.
6136 @cindex @command{prof}
6137 @item -p
6138 @opindex p
6139 Generate extra code to write profile information suitable for the
6140 analysis program @command{prof}.  You must use this option when compiling
6141 the source files you want data about, and you must also use it when
6142 linking.
6144 @cindex @command{gprof}
6145 @item -pg
6146 @opindex pg
6147 Generate extra code to write profile information suitable for the
6148 analysis program @command{gprof}.  You must use this option when compiling
6149 the source files you want data about, and you must also use it when
6150 linking.
6152 @item -Q
6153 @opindex Q
6154 Makes the compiler print out each function name as it is compiled, and
6155 print some statistics about each pass when it finishes.
6157 @item -ftime-report
6158 @opindex ftime-report
6159 Makes the compiler print some statistics about the time consumed by each
6160 pass when it finishes.
6162 @item -fmem-report
6163 @opindex fmem-report
6164 Makes the compiler print some statistics about permanent memory
6165 allocation when it finishes.
6167 @item -fmem-report-wpa
6168 @opindex fmem-report-wpa
6169 Makes the compiler print some statistics about permanent memory
6170 allocation for the WPA phase only.
6172 @item -fpre-ipa-mem-report
6173 @opindex fpre-ipa-mem-report
6174 @item -fpost-ipa-mem-report
6175 @opindex fpost-ipa-mem-report
6176 Makes the compiler print some statistics about permanent memory
6177 allocation before or after interprocedural optimization.
6179 @item -fprofile-report
6180 @opindex fprofile-report
6181 Makes the compiler print some statistics about consistency of the
6182 (estimated) profile and effect of individual passes.
6184 @item -fstack-usage
6185 @opindex fstack-usage
6186 Makes the compiler output stack usage information for the program, on a
6187 per-function basis.  The filename for the dump is made by appending
6188 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
6189 the output file, if explicitly specified and it is not an executable,
6190 otherwise it is the basename of the source file.  An entry is made up
6191 of three fields:
6193 @itemize
6194 @item
6195 The name of the function.
6196 @item
6197 A number of bytes.
6198 @item
6199 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
6200 @end itemize
6202 The qualifier @code{static} means that the function manipulates the stack
6203 statically: a fixed number of bytes are allocated for the frame on function
6204 entry and released on function exit; no stack adjustments are otherwise made
6205 in the function.  The second field is this fixed number of bytes.
6207 The qualifier @code{dynamic} means that the function manipulates the stack
6208 dynamically: in addition to the static allocation described above, stack
6209 adjustments are made in the body of the function, for example to push/pop
6210 arguments around function calls.  If the qualifier @code{bounded} is also
6211 present, the amount of these adjustments is bounded at compile time and
6212 the second field is an upper bound of the total amount of stack used by
6213 the function.  If it is not present, the amount of these adjustments is
6214 not bounded at compile time and the second field only represents the
6215 bounded part.
6217 @item -fprofile-arcs
6218 @opindex fprofile-arcs
6219 Add code so that program flow @dfn{arcs} are instrumented.  During
6220 execution the program records how many times each branch and call is
6221 executed and how many times it is taken or returns.  When the compiled
6222 program exits it saves this data to a file called
6223 @file{@var{auxname}.gcda} for each source file.  The data may be used for
6224 profile-directed optimizations (@option{-fbranch-probabilities}), or for
6225 test coverage analysis (@option{-ftest-coverage}).  Each object file's
6226 @var{auxname} is generated from the name of the output file, if
6227 explicitly specified and it is not the final executable, otherwise it is
6228 the basename of the source file.  In both cases any suffix is removed
6229 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
6230 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
6231 @xref{Cross-profiling}.
6233 @cindex @command{gcov}
6234 @item --coverage
6235 @opindex coverage
6237 This option is used to compile and link code instrumented for coverage
6238 analysis.  The option is a synonym for @option{-fprofile-arcs}
6239 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
6240 linking).  See the documentation for those options for more details.
6242 @itemize
6244 @item
6245 Compile the source files with @option{-fprofile-arcs} plus optimization
6246 and code generation options.  For test coverage analysis, use the
6247 additional @option{-ftest-coverage} option.  You do not need to profile
6248 every source file in a program.
6250 @item
6251 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
6252 (the latter implies the former).
6254 @item
6255 Run the program on a representative workload to generate the arc profile
6256 information.  This may be repeated any number of times.  You can run
6257 concurrent instances of your program, and provided that the file system
6258 supports locking, the data files will be correctly updated.  Also
6259 @code{fork} calls are detected and correctly handled (double counting
6260 will not happen).
6262 @item
6263 For profile-directed optimizations, compile the source files again with
6264 the same optimization and code generation options plus
6265 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
6266 Control Optimization}).
6268 @item
6269 For test coverage analysis, use @command{gcov} to produce human readable
6270 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
6271 @command{gcov} documentation for further information.
6273 @end itemize
6275 With @option{-fprofile-arcs}, for each function of your program GCC
6276 creates a program flow graph, then finds a spanning tree for the graph.
6277 Only arcs that are not on the spanning tree have to be instrumented: the
6278 compiler adds code to count the number of times that these arcs are
6279 executed.  When an arc is the only exit or only entrance to a block, the
6280 instrumentation code can be added to the block; otherwise, a new basic
6281 block must be created to hold the instrumentation code.
6283 @need 2000
6284 @item -ftest-coverage
6285 @opindex ftest-coverage
6286 Produce a notes file that the @command{gcov} code-coverage utility
6287 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
6288 show program coverage.  Each source file's note file is called
6289 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
6290 above for a description of @var{auxname} and instructions on how to
6291 generate test coverage data.  Coverage data matches the source files
6292 more closely if you do not optimize.
6294 @item -fdbg-cnt-list
6295 @opindex fdbg-cnt-list
6296 Print the name and the counter upper bound for all debug counters.
6299 @item -fdbg-cnt=@var{counter-value-list}
6300 @opindex fdbg-cnt
6301 Set the internal debug counter upper bound.  @var{counter-value-list}
6302 is a comma-separated list of @var{name}:@var{value} pairs
6303 which sets the upper bound of each debug counter @var{name} to @var{value}.
6304 All debug counters have the initial upper bound of @code{UINT_MAX};
6305 thus @code{dbg_cnt} returns true always unless the upper bound
6306 is set by this option.
6307 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
6308 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
6310 @item -fenable-@var{kind}-@var{pass}
6311 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
6312 @opindex fdisable-
6313 @opindex fenable-
6315 This is a set of options that are used to explicitly disable/enable
6316 optimization passes.  These options are intended for use for debugging GCC.
6317 Compiler users should use regular options for enabling/disabling
6318 passes instead.
6320 @table @gcctabopt
6322 @item -fdisable-ipa-@var{pass}
6323 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
6324 statically invoked in the compiler multiple times, the pass name should be
6325 appended with a sequential number starting from 1.
6327 @item -fdisable-rtl-@var{pass}
6328 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
6329 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
6330 statically invoked in the compiler multiple times, the pass name should be
6331 appended with a sequential number starting from 1.  @var{range-list} is a 
6332 comma-separated list of function ranges or assembler names.  Each range is a number
6333 pair separated by a colon.  The range is inclusive in both ends.  If the range
6334 is trivial, the number pair can be simplified as a single number.  If the
6335 function's call graph node's @var{uid} falls within one of the specified ranges,
6336 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
6337 function header of a dump file, and the pass names can be dumped by using
6338 option @option{-fdump-passes}.
6340 @item -fdisable-tree-@var{pass}
6341 @itemx -fdisable-tree-@var{pass}=@var{range-list}
6342 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
6343 option arguments.
6345 @item -fenable-ipa-@var{pass}
6346 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
6347 statically invoked in the compiler multiple times, the pass name should be
6348 appended with a sequential number starting from 1.
6350 @item -fenable-rtl-@var{pass}
6351 @itemx -fenable-rtl-@var{pass}=@var{range-list}
6352 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
6353 description and examples.
6355 @item -fenable-tree-@var{pass}
6356 @itemx -fenable-tree-@var{pass}=@var{range-list}
6357 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
6358 of option arguments.
6360 @end table
6362 Here are some examples showing uses of these options.
6364 @smallexample
6366 # disable ccp1 for all functions
6367    -fdisable-tree-ccp1
6368 # disable complete unroll for function whose cgraph node uid is 1
6369    -fenable-tree-cunroll=1
6370 # disable gcse2 for functions at the following ranges [1,1],
6371 # [300,400], and [400,1000]
6372 # disable gcse2 for functions foo and foo2
6373    -fdisable-rtl-gcse2=foo,foo2
6374 # disable early inlining
6375    -fdisable-tree-einline
6376 # disable ipa inlining
6377    -fdisable-ipa-inline
6378 # enable tree full unroll
6379    -fenable-tree-unroll
6381 @end smallexample
6383 @item -d@var{letters}
6384 @itemx -fdump-rtl-@var{pass}
6385 @itemx -fdump-rtl-@var{pass}=@var{filename}
6386 @opindex d
6387 @opindex fdump-rtl-@var{pass}
6388 Says to make debugging dumps during compilation at times specified by
6389 @var{letters}.  This is used for debugging the RTL-based passes of the
6390 compiler.  The file names for most of the dumps are made by appending
6391 a pass number and a word to the @var{dumpname}, and the files are
6392 created in the directory of the output file. In case of
6393 @option{=@var{filename}} option, the dump is output on the given file
6394 instead of the pass numbered dump files. Note that the pass number is
6395 computed statically as passes get registered into the pass manager.
6396 Thus the numbering is not related to the dynamic order of execution of
6397 passes.  In particular, a pass installed by a plugin could have a
6398 number over 200 even if it executed quite early.  @var{dumpname} is
6399 generated from the name of the output file, if explicitly specified
6400 and it is not an executable, otherwise it is the basename of the
6401 source file. These switches may have different effects when
6402 @option{-E} is used for preprocessing.
6404 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
6405 @option{-d} option @var{letters}.  Here are the possible
6406 letters for use in @var{pass} and @var{letters}, and their meanings:
6408 @table @gcctabopt
6410 @item -fdump-rtl-alignments
6411 @opindex fdump-rtl-alignments
6412 Dump after branch alignments have been computed.
6414 @item -fdump-rtl-asmcons
6415 @opindex fdump-rtl-asmcons
6416 Dump after fixing rtl statements that have unsatisfied in/out constraints.
6418 @item -fdump-rtl-auto_inc_dec
6419 @opindex fdump-rtl-auto_inc_dec
6420 Dump after auto-inc-dec discovery.  This pass is only run on
6421 architectures that have auto inc or auto dec instructions.
6423 @item -fdump-rtl-barriers
6424 @opindex fdump-rtl-barriers
6425 Dump after cleaning up the barrier instructions.
6427 @item -fdump-rtl-bbpart
6428 @opindex fdump-rtl-bbpart
6429 Dump after partitioning hot and cold basic blocks.
6431 @item -fdump-rtl-bbro
6432 @opindex fdump-rtl-bbro
6433 Dump after block reordering.
6435 @item -fdump-rtl-btl1
6436 @itemx -fdump-rtl-btl2
6437 @opindex fdump-rtl-btl2
6438 @opindex fdump-rtl-btl2
6439 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
6440 after the two branch
6441 target load optimization passes.
6443 @item -fdump-rtl-bypass
6444 @opindex fdump-rtl-bypass
6445 Dump after jump bypassing and control flow optimizations.
6447 @item -fdump-rtl-combine
6448 @opindex fdump-rtl-combine
6449 Dump after the RTL instruction combination pass.
6451 @item -fdump-rtl-compgotos
6452 @opindex fdump-rtl-compgotos
6453 Dump after duplicating the computed gotos.
6455 @item -fdump-rtl-ce1
6456 @itemx -fdump-rtl-ce2
6457 @itemx -fdump-rtl-ce3
6458 @opindex fdump-rtl-ce1
6459 @opindex fdump-rtl-ce2
6460 @opindex fdump-rtl-ce3
6461 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
6462 @option{-fdump-rtl-ce3} enable dumping after the three
6463 if conversion passes.
6465 @item -fdump-rtl-cprop_hardreg
6466 @opindex fdump-rtl-cprop_hardreg
6467 Dump after hard register copy propagation.
6469 @item -fdump-rtl-csa
6470 @opindex fdump-rtl-csa
6471 Dump after combining stack adjustments.
6473 @item -fdump-rtl-cse1
6474 @itemx -fdump-rtl-cse2
6475 @opindex fdump-rtl-cse1
6476 @opindex fdump-rtl-cse2
6477 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
6478 the two common subexpression elimination passes.
6480 @item -fdump-rtl-dce
6481 @opindex fdump-rtl-dce
6482 Dump after the standalone dead code elimination passes.
6484 @item -fdump-rtl-dbr
6485 @opindex fdump-rtl-dbr
6486 Dump after delayed branch scheduling.
6488 @item -fdump-rtl-dce1
6489 @itemx -fdump-rtl-dce2
6490 @opindex fdump-rtl-dce1
6491 @opindex fdump-rtl-dce2
6492 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
6493 the two dead store elimination passes.
6495 @item -fdump-rtl-eh
6496 @opindex fdump-rtl-eh
6497 Dump after finalization of EH handling code.
6499 @item -fdump-rtl-eh_ranges
6500 @opindex fdump-rtl-eh_ranges
6501 Dump after conversion of EH handling range regions.
6503 @item -fdump-rtl-expand
6504 @opindex fdump-rtl-expand
6505 Dump after RTL generation.
6507 @item -fdump-rtl-fwprop1
6508 @itemx -fdump-rtl-fwprop2
6509 @opindex fdump-rtl-fwprop1
6510 @opindex fdump-rtl-fwprop2
6511 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
6512 dumping after the two forward propagation passes.
6514 @item -fdump-rtl-gcse1
6515 @itemx -fdump-rtl-gcse2
6516 @opindex fdump-rtl-gcse1
6517 @opindex fdump-rtl-gcse2
6518 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
6519 after global common subexpression elimination.
6521 @item -fdump-rtl-init-regs
6522 @opindex fdump-rtl-init-regs
6523 Dump after the initialization of the registers.
6525 @item -fdump-rtl-initvals
6526 @opindex fdump-rtl-initvals
6527 Dump after the computation of the initial value sets.
6529 @item -fdump-rtl-into_cfglayout
6530 @opindex fdump-rtl-into_cfglayout
6531 Dump after converting to cfglayout mode.
6533 @item -fdump-rtl-ira
6534 @opindex fdump-rtl-ira
6535 Dump after iterated register allocation.
6537 @item -fdump-rtl-jump
6538 @opindex fdump-rtl-jump
6539 Dump after the second jump optimization.
6541 @item -fdump-rtl-loop2
6542 @opindex fdump-rtl-loop2
6543 @option{-fdump-rtl-loop2} enables dumping after the rtl
6544 loop optimization passes.
6546 @item -fdump-rtl-mach
6547 @opindex fdump-rtl-mach
6548 Dump after performing the machine dependent reorganization pass, if that
6549 pass exists.
6551 @item -fdump-rtl-mode_sw
6552 @opindex fdump-rtl-mode_sw
6553 Dump after removing redundant mode switches.
6555 @item -fdump-rtl-rnreg
6556 @opindex fdump-rtl-rnreg
6557 Dump after register renumbering.
6559 @item -fdump-rtl-outof_cfglayout
6560 @opindex fdump-rtl-outof_cfglayout
6561 Dump after converting from cfglayout mode.
6563 @item -fdump-rtl-peephole2
6564 @opindex fdump-rtl-peephole2
6565 Dump after the peephole pass.
6567 @item -fdump-rtl-postreload
6568 @opindex fdump-rtl-postreload
6569 Dump after post-reload optimizations.
6571 @item -fdump-rtl-pro_and_epilogue
6572 @opindex fdump-rtl-pro_and_epilogue
6573 Dump after generating the function prologues and epilogues.
6575 @item -fdump-rtl-sched1
6576 @itemx -fdump-rtl-sched2
6577 @opindex fdump-rtl-sched1
6578 @opindex fdump-rtl-sched2
6579 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
6580 after the basic block scheduling passes.
6582 @item -fdump-rtl-ree
6583 @opindex fdump-rtl-ree
6584 Dump after sign/zero extension elimination.
6586 @item -fdump-rtl-seqabstr
6587 @opindex fdump-rtl-seqabstr
6588 Dump after common sequence discovery.
6590 @item -fdump-rtl-shorten
6591 @opindex fdump-rtl-shorten
6592 Dump after shortening branches.
6594 @item -fdump-rtl-sibling
6595 @opindex fdump-rtl-sibling
6596 Dump after sibling call optimizations.
6598 @item -fdump-rtl-split1
6599 @itemx -fdump-rtl-split2
6600 @itemx -fdump-rtl-split3
6601 @itemx -fdump-rtl-split4
6602 @itemx -fdump-rtl-split5
6603 @opindex fdump-rtl-split1
6604 @opindex fdump-rtl-split2
6605 @opindex fdump-rtl-split3
6606 @opindex fdump-rtl-split4
6607 @opindex fdump-rtl-split5
6608 These options enable dumping after five rounds of
6609 instruction splitting.
6611 @item -fdump-rtl-sms
6612 @opindex fdump-rtl-sms
6613 Dump after modulo scheduling.  This pass is only run on some
6614 architectures.
6616 @item -fdump-rtl-stack
6617 @opindex fdump-rtl-stack
6618 Dump after conversion from GCC's ``flat register file'' registers to the
6619 x87's stack-like registers.  This pass is only run on x86 variants.
6621 @item -fdump-rtl-subreg1
6622 @itemx -fdump-rtl-subreg2
6623 @opindex fdump-rtl-subreg1
6624 @opindex fdump-rtl-subreg2
6625 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
6626 the two subreg expansion passes.
6628 @item -fdump-rtl-unshare
6629 @opindex fdump-rtl-unshare
6630 Dump after all rtl has been unshared.
6632 @item -fdump-rtl-vartrack
6633 @opindex fdump-rtl-vartrack
6634 Dump after variable tracking.
6636 @item -fdump-rtl-vregs
6637 @opindex fdump-rtl-vregs
6638 Dump after converting virtual registers to hard registers.
6640 @item -fdump-rtl-web
6641 @opindex fdump-rtl-web
6642 Dump after live range splitting.
6644 @item -fdump-rtl-regclass
6645 @itemx -fdump-rtl-subregs_of_mode_init
6646 @itemx -fdump-rtl-subregs_of_mode_finish
6647 @itemx -fdump-rtl-dfinit
6648 @itemx -fdump-rtl-dfinish
6649 @opindex fdump-rtl-regclass
6650 @opindex fdump-rtl-subregs_of_mode_init
6651 @opindex fdump-rtl-subregs_of_mode_finish
6652 @opindex fdump-rtl-dfinit
6653 @opindex fdump-rtl-dfinish
6654 These dumps are defined but always produce empty files.
6656 @item -da
6657 @itemx -fdump-rtl-all
6658 @opindex da
6659 @opindex fdump-rtl-all
6660 Produce all the dumps listed above.
6662 @item -dA
6663 @opindex dA
6664 Annotate the assembler output with miscellaneous debugging information.
6666 @item -dD
6667 @opindex dD
6668 Dump all macro definitions, at the end of preprocessing, in addition to
6669 normal output.
6671 @item -dH
6672 @opindex dH
6673 Produce a core dump whenever an error occurs.
6675 @item -dp
6676 @opindex dp
6677 Annotate the assembler output with a comment indicating which
6678 pattern and alternative is used.  The length of each instruction is
6679 also printed.
6681 @item -dP
6682 @opindex dP
6683 Dump the RTL in the assembler output as a comment before each instruction.
6684 Also turns on @option{-dp} annotation.
6686 @item -dx
6687 @opindex dx
6688 Just generate RTL for a function instead of compiling it.  Usually used
6689 with @option{-fdump-rtl-expand}.
6690 @end table
6692 @item -fdump-noaddr
6693 @opindex fdump-noaddr
6694 When doing debugging dumps, suppress address output.  This makes it more
6695 feasible to use diff on debugging dumps for compiler invocations with
6696 different compiler binaries and/or different
6697 text / bss / data / heap / stack / dso start locations.
6699 @item -freport-bug
6700 @opindex freport-bug
6701 Collect and dump debug information into temporary file if ICE in C/C++
6702 compiler occured.
6704 @item -fdump-unnumbered
6705 @opindex fdump-unnumbered
6706 When doing debugging dumps, suppress instruction numbers and address output.
6707 This makes it more feasible to use diff on debugging dumps for compiler
6708 invocations with different options, in particular with and without
6709 @option{-g}.
6711 @item -fdump-unnumbered-links
6712 @opindex fdump-unnumbered-links
6713 When doing debugging dumps (see @option{-d} option above), suppress
6714 instruction numbers for the links to the previous and next instructions
6715 in a sequence.
6717 @item -fdump-translation-unit @r{(C++ only)}
6718 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
6719 @opindex fdump-translation-unit
6720 Dump a representation of the tree structure for the entire translation
6721 unit to a file.  The file name is made by appending @file{.tu} to the
6722 source file name, and the file is created in the same directory as the
6723 output file.  If the @samp{-@var{options}} form is used, @var{options}
6724 controls the details of the dump as described for the
6725 @option{-fdump-tree} options.
6727 @item -fdump-class-hierarchy @r{(C++ only)}
6728 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
6729 @opindex fdump-class-hierarchy
6730 Dump a representation of each class's hierarchy and virtual function
6731 table layout to a file.  The file name is made by appending
6732 @file{.class} to the source file name, and the file is created in the
6733 same directory as the output file.  If the @samp{-@var{options}} form
6734 is used, @var{options} controls the details of the dump as described
6735 for the @option{-fdump-tree} options.
6737 @item -fdump-ipa-@var{switch}
6738 @opindex fdump-ipa
6739 Control the dumping at various stages of inter-procedural analysis
6740 language tree to a file.  The file name is generated by appending a
6741 switch specific suffix to the source file name, and the file is created
6742 in the same directory as the output file.  The following dumps are
6743 possible:
6745 @table @samp
6746 @item all
6747 Enables all inter-procedural analysis dumps.
6749 @item cgraph
6750 Dumps information about call-graph optimization, unused function removal,
6751 and inlining decisions.
6753 @item inline
6754 Dump after function inlining.
6756 @end table
6758 @item -fdump-passes
6759 @opindex fdump-passes
6760 Dump the list of optimization passes that are turned on and off by
6761 the current command-line options.
6763 @item -fdump-statistics-@var{option}
6764 @opindex fdump-statistics
6765 Enable and control dumping of pass statistics in a separate file.  The
6766 file name is generated by appending a suffix ending in
6767 @samp{.statistics} to the source file name, and the file is created in
6768 the same directory as the output file.  If the @samp{-@var{option}}
6769 form is used, @samp{-stats} causes counters to be summed over the
6770 whole compilation unit while @samp{-details} dumps every event as
6771 the passes generate them.  The default with no option is to sum
6772 counters for each function compiled.
6774 @item -fdump-tree-@var{switch}
6775 @itemx -fdump-tree-@var{switch}-@var{options}
6776 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
6777 @opindex fdump-tree
6778 Control the dumping at various stages of processing the intermediate
6779 language tree to a file.  The file name is generated by appending a
6780 switch-specific suffix to the source file name, and the file is
6781 created in the same directory as the output file. In case of
6782 @option{=@var{filename}} option, the dump is output on the given file
6783 instead of the auto named dump files.  If the @samp{-@var{options}}
6784 form is used, @var{options} is a list of @samp{-} separated options
6785 which control the details of the dump.  Not all options are applicable
6786 to all dumps; those that are not meaningful are ignored.  The
6787 following options are available
6789 @table @samp
6790 @item address
6791 Print the address of each node.  Usually this is not meaningful as it
6792 changes according to the environment and source file.  Its primary use
6793 is for tying up a dump file with a debug environment.
6794 @item asmname
6795 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
6796 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
6797 use working backward from mangled names in the assembly file.
6798 @item slim
6799 When dumping front-end intermediate representations, inhibit dumping
6800 of members of a scope or body of a function merely because that scope
6801 has been reached.  Only dump such items when they are directly reachable
6802 by some other path.
6804 When dumping pretty-printed trees, this option inhibits dumping the
6805 bodies of control structures.
6807 When dumping RTL, print the RTL in slim (condensed) form instead of
6808 the default LISP-like representation.
6809 @item raw
6810 Print a raw representation of the tree.  By default, trees are
6811 pretty-printed into a C-like representation.
6812 @item details
6813 Enable more detailed dumps (not honored by every dump option). Also
6814 include information from the optimization passes.
6815 @item stats
6816 Enable dumping various statistics about the pass (not honored by every dump
6817 option).
6818 @item blocks
6819 Enable showing basic block boundaries (disabled in raw dumps).
6820 @item graph
6821 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
6822 dump a representation of the control flow graph suitable for viewing with
6823 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
6824 the file is pretty-printed as a subgraph, so that GraphViz can render them
6825 all in a single plot.
6827 This option currently only works for RTL dumps, and the RTL is always
6828 dumped in slim form.
6829 @item vops
6830 Enable showing virtual operands for every statement.
6831 @item lineno
6832 Enable showing line numbers for statements.
6833 @item uid
6834 Enable showing the unique ID (@code{DECL_UID}) for each variable.
6835 @item verbose
6836 Enable showing the tree dump for each statement.
6837 @item eh
6838 Enable showing the EH region number holding each statement.
6839 @item scev
6840 Enable showing scalar evolution analysis details.
6841 @item optimized
6842 Enable showing optimization information (only available in certain
6843 passes).
6844 @item missed
6845 Enable showing missed optimization information (only available in certain
6846 passes).
6847 @item note
6848 Enable other detailed optimization information (only available in
6849 certain passes).
6850 @item =@var{filename}
6851 Instead of an auto named dump file, output into the given file
6852 name. The file names @file{stdout} and @file{stderr} are treated
6853 specially and are considered already open standard streams. For
6854 example,
6856 @smallexample
6857 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
6858      -fdump-tree-pre=stderr file.c
6859 @end smallexample
6861 outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
6862 output on to @file{stderr}. If two conflicting dump filenames are
6863 given for the same pass, then the latter option overrides the earlier
6864 one.
6866 @item all
6867 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
6868 and @option{lineno}.
6870 @item optall
6871 Turn on all optimization options, i.e., @option{optimized},
6872 @option{missed}, and @option{note}.
6873 @end table
6875 The following tree dumps are possible:
6876 @table @samp
6878 @item original
6879 @opindex fdump-tree-original
6880 Dump before any tree based optimization, to @file{@var{file}.original}.
6882 @item optimized
6883 @opindex fdump-tree-optimized
6884 Dump after all tree based optimization, to @file{@var{file}.optimized}.
6886 @item gimple
6887 @opindex fdump-tree-gimple
6888 Dump each function before and after the gimplification pass to a file.  The
6889 file name is made by appending @file{.gimple} to the source file name.
6891 @item cfg
6892 @opindex fdump-tree-cfg
6893 Dump the control flow graph of each function to a file.  The file name is
6894 made by appending @file{.cfg} to the source file name.
6896 @item ch
6897 @opindex fdump-tree-ch
6898 Dump each function after copying loop headers.  The file name is made by
6899 appending @file{.ch} to the source file name.
6901 @item ssa
6902 @opindex fdump-tree-ssa
6903 Dump SSA related information to a file.  The file name is made by appending
6904 @file{.ssa} to the source file name.
6906 @item alias
6907 @opindex fdump-tree-alias
6908 Dump aliasing information for each function.  The file name is made by
6909 appending @file{.alias} to the source file name.
6911 @item ccp
6912 @opindex fdump-tree-ccp
6913 Dump each function after CCP@.  The file name is made by appending
6914 @file{.ccp} to the source file name.
6916 @item storeccp
6917 @opindex fdump-tree-storeccp
6918 Dump each function after STORE-CCP@.  The file name is made by appending
6919 @file{.storeccp} to the source file name.
6921 @item pre
6922 @opindex fdump-tree-pre
6923 Dump trees after partial redundancy elimination.  The file name is made
6924 by appending @file{.pre} to the source file name.
6926 @item fre
6927 @opindex fdump-tree-fre
6928 Dump trees after full redundancy elimination.  The file name is made
6929 by appending @file{.fre} to the source file name.
6931 @item copyprop
6932 @opindex fdump-tree-copyprop
6933 Dump trees after copy propagation.  The file name is made
6934 by appending @file{.copyprop} to the source file name.
6936 @item store_copyprop
6937 @opindex fdump-tree-store_copyprop
6938 Dump trees after store copy-propagation.  The file name is made
6939 by appending @file{.store_copyprop} to the source file name.
6941 @item dce
6942 @opindex fdump-tree-dce
6943 Dump each function after dead code elimination.  The file name is made by
6944 appending @file{.dce} to the source file name.
6946 @item sra
6947 @opindex fdump-tree-sra
6948 Dump each function after performing scalar replacement of aggregates.  The
6949 file name is made by appending @file{.sra} to the source file name.
6951 @item sink
6952 @opindex fdump-tree-sink
6953 Dump each function after performing code sinking.  The file name is made
6954 by appending @file{.sink} to the source file name.
6956 @item dom
6957 @opindex fdump-tree-dom
6958 Dump each function after applying dominator tree optimizations.  The file
6959 name is made by appending @file{.dom} to the source file name.
6961 @item dse
6962 @opindex fdump-tree-dse
6963 Dump each function after applying dead store elimination.  The file
6964 name is made by appending @file{.dse} to the source file name.
6966 @item phiopt
6967 @opindex fdump-tree-phiopt
6968 Dump each function after optimizing PHI nodes into straightline code.  The file
6969 name is made by appending @file{.phiopt} to the source file name.
6971 @item forwprop
6972 @opindex fdump-tree-forwprop
6973 Dump each function after forward propagating single use variables.  The file
6974 name is made by appending @file{.forwprop} to the source file name.
6976 @item copyrename
6977 @opindex fdump-tree-copyrename
6978 Dump each function after applying the copy rename optimization.  The file
6979 name is made by appending @file{.copyrename} to the source file name.
6981 @item nrv
6982 @opindex fdump-tree-nrv
6983 Dump each function after applying the named return value optimization on
6984 generic trees.  The file name is made by appending @file{.nrv} to the source
6985 file name.
6987 @item vect
6988 @opindex fdump-tree-vect
6989 Dump each function after applying vectorization of loops.  The file name is
6990 made by appending @file{.vect} to the source file name.
6992 @item slp
6993 @opindex fdump-tree-slp
6994 Dump each function after applying vectorization of basic blocks.  The file name
6995 is made by appending @file{.slp} to the source file name.
6997 @item vrp
6998 @opindex fdump-tree-vrp
6999 Dump each function after Value Range Propagation (VRP).  The file name
7000 is made by appending @file{.vrp} to the source file name.
7002 @item all
7003 @opindex fdump-tree-all
7004 Enable all the available tree dumps with the flags provided in this option.
7005 @end table
7007 @item -fopt-info
7008 @itemx -fopt-info-@var{options}
7009 @itemx -fopt-info-@var{options}=@var{filename}
7010 @opindex fopt-info
7011 Controls optimization dumps from various optimization passes. If the
7012 @samp{-@var{options}} form is used, @var{options} is a list of
7013 @samp{-} separated option keywords to select the dump details and
7014 optimizations.  
7016 The @var{options} can be divided into two groups: options describing the
7017 verbosity of the dump, and options describing which optimizations
7018 should be included. The options from both the groups can be freely
7019 mixed as they are non-overlapping. However, in case of any conflicts,
7020 the later options override the earlier options on the command
7021 line. 
7023 The following options control the dump verbosity:
7025 @table @samp
7026 @item optimized
7027 Print information when an optimization is successfully applied. It is
7028 up to a pass to decide which information is relevant. For example, the
7029 vectorizer passes print the source location of loops which are
7030 successfully vectorized.
7031 @item missed
7032 Print information about missed optimizations. Individual passes
7033 control which information to include in the output. 
7034 @item note
7035 Print verbose information about optimizations, such as certain
7036 transformations, more detailed messages about decisions etc.
7037 @item all
7038 Print detailed optimization information. This includes
7039 @samp{optimized}, @samp{missed}, and @samp{note}.
7040 @end table
7042 One or more of the following option keywords can be used to describe a
7043 group of optimizations:
7045 @table @samp
7046 @item ipa
7047 Enable dumps from all interprocedural optimizations.
7048 @item loop
7049 Enable dumps from all loop optimizations.
7050 @item inline
7051 Enable dumps from all inlining optimizations.
7052 @item vec
7053 Enable dumps from all vectorization optimizations.
7054 @item optall
7055 Enable dumps from all optimizations. This is a superset of
7056 the optimization groups listed above.
7057 @end table
7059 If @var{options} is
7060 omitted, it defaults to @samp{optimized-optall}, which means to dump all
7061 info about successful optimizations from all the passes.  
7063 If the @var{filename} is provided, then the dumps from all the
7064 applicable optimizations are concatenated into the @var{filename}.
7065 Otherwise the dump is output onto @file{stderr}. Though multiple
7066 @option{-fopt-info} options are accepted, only one of them can include
7067 a @var{filename}. If other filenames are provided then all but the
7068 first such option are ignored.
7070 Note that the output @var{filename} is overwritten
7071 in case of multiple translation units. If a combined output from
7072 multiple translation units is desired, @file{stderr} should be used
7073 instead.
7075 In the following example, the optimization info is output to
7076 @file{stderr}:
7078 @smallexample
7079 gcc -O3 -fopt-info
7080 @end smallexample
7082 This example:
7083 @smallexample
7084 gcc -O3 -fopt-info-missed=missed.all
7085 @end smallexample
7087 @noindent
7088 outputs missed optimization report from all the passes into
7089 @file{missed.all}, and this one:
7091 @smallexample
7092 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
7093 @end smallexample
7095 @noindent
7096 prints information about missed optimization opportunities from
7097 vectorization passes on @file{stderr}.  
7098 Note that @option{-fopt-info-vec-missed} is equivalent to 
7099 @option{-fopt-info-missed-vec}.
7101 As another example,
7102 @smallexample
7103 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
7104 @end smallexample
7106 @noindent
7107 outputs information about missed optimizations as well as
7108 optimized locations from all the inlining passes into
7109 @file{inline.txt}.
7111 Finally, consider:
7113 @smallexample
7114 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
7115 @end smallexample
7117 @noindent
7118 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
7119 in conflict since only one output file is allowed. In this case, only
7120 the first option takes effect and the subsequent options are
7121 ignored. Thus only @file{vec.miss} is produced which contains
7122 dumps from the vectorizer about missed opportunities.
7124 @item -frandom-seed=@var{number}
7125 @opindex frandom-seed
7126 This option provides a seed that GCC uses in place of
7127 random numbers in generating certain symbol names
7128 that have to be different in every compiled file.  It is also used to
7129 place unique stamps in coverage data files and the object files that
7130 produce them.  You can use the @option{-frandom-seed} option to produce
7131 reproducibly identical object files.
7133 The @var{number} should be different for every file you compile.
7135 @item -fsched-verbose=@var{n}
7136 @opindex fsched-verbose
7137 On targets that use instruction scheduling, this option controls the
7138 amount of debugging output the scheduler prints.  This information is
7139 written to standard error, unless @option{-fdump-rtl-sched1} or
7140 @option{-fdump-rtl-sched2} is specified, in which case it is output
7141 to the usual dump listing file, @file{.sched1} or @file{.sched2}
7142 respectively.  However for @var{n} greater than nine, the output is
7143 always printed to standard error.
7145 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
7146 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
7147 For @var{n} greater than one, it also output basic block probabilities,
7148 detailed ready list information and unit/insn info.  For @var{n} greater
7149 than two, it includes RTL at abort point, control-flow and regions info.
7150 And for @var{n} over four, @option{-fsched-verbose} also includes
7151 dependence info.
7153 @item -save-temps
7154 @itemx -save-temps=cwd
7155 @opindex save-temps
7156 Store the usual ``temporary'' intermediate files permanently; place them
7157 in the current directory and name them based on the source file.  Thus,
7158 compiling @file{foo.c} with @option{-c -save-temps} produces files
7159 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
7160 preprocessed @file{foo.i} output file even though the compiler now
7161 normally uses an integrated preprocessor.
7163 When used in combination with the @option{-x} command-line option,
7164 @option{-save-temps} is sensible enough to avoid over writing an
7165 input source file with the same extension as an intermediate file.
7166 The corresponding intermediate file may be obtained by renaming the
7167 source file before using @option{-save-temps}.
7169 If you invoke GCC in parallel, compiling several different source
7170 files that share a common base name in different subdirectories or the
7171 same source file compiled for multiple output destinations, it is
7172 likely that the different parallel compilers will interfere with each
7173 other, and overwrite the temporary files.  For instance:
7175 @smallexample
7176 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
7177 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
7178 @end smallexample
7180 may result in @file{foo.i} and @file{foo.o} being written to
7181 simultaneously by both compilers.
7183 @item -save-temps=obj
7184 @opindex save-temps=obj
7185 Store the usual ``temporary'' intermediate files permanently.  If the
7186 @option{-o} option is used, the temporary files are based on the
7187 object file.  If the @option{-o} option is not used, the
7188 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
7190 For example:
7192 @smallexample
7193 gcc -save-temps=obj -c foo.c
7194 gcc -save-temps=obj -c bar.c -o dir/xbar.o
7195 gcc -save-temps=obj foobar.c -o dir2/yfoobar
7196 @end smallexample
7198 @noindent
7199 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
7200 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
7201 @file{dir2/yfoobar.o}.
7203 @item -time@r{[}=@var{file}@r{]}
7204 @opindex time
7205 Report the CPU time taken by each subprocess in the compilation
7206 sequence.  For C source files, this is the compiler proper and assembler
7207 (plus the linker if linking is done).
7209 Without the specification of an output file, the output looks like this:
7211 @smallexample
7212 # cc1 0.12 0.01
7213 # as 0.00 0.01
7214 @end smallexample
7216 The first number on each line is the ``user time'', that is time spent
7217 executing the program itself.  The second number is ``system time'',
7218 time spent executing operating system routines on behalf of the program.
7219 Both numbers are in seconds.
7221 With the specification of an output file, the output is appended to the
7222 named file, and it looks like this:
7224 @smallexample
7225 0.12 0.01 cc1 @var{options}
7226 0.00 0.01 as @var{options}
7227 @end smallexample
7229 The ``user time'' and the ``system time'' are moved before the program
7230 name, and the options passed to the program are displayed, so that one
7231 can later tell what file was being compiled, and with which options.
7233 @item -fvar-tracking
7234 @opindex fvar-tracking
7235 Run variable tracking pass.  It computes where variables are stored at each
7236 position in code.  Better debugging information is then generated
7237 (if the debugging information format supports this information).
7239 It is enabled by default when compiling with optimization (@option{-Os},
7240 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
7241 the debug info format supports it.
7243 @item -fvar-tracking-assignments
7244 @opindex fvar-tracking-assignments
7245 @opindex fno-var-tracking-assignments
7246 Annotate assignments to user variables early in the compilation and
7247 attempt to carry the annotations over throughout the compilation all the
7248 way to the end, in an attempt to improve debug information while
7249 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
7251 It can be enabled even if var-tracking is disabled, in which case
7252 annotations are created and maintained, but discarded at the end.
7253 By default, this flag is enabled together with @option{-fvar-tracking},
7254 except when selective scheduling is enabled.
7256 @item -fvar-tracking-assignments-toggle
7257 @opindex fvar-tracking-assignments-toggle
7258 @opindex fno-var-tracking-assignments-toggle
7259 Toggle @option{-fvar-tracking-assignments}, in the same way that
7260 @option{-gtoggle} toggles @option{-g}.
7262 @item -print-file-name=@var{library}
7263 @opindex print-file-name
7264 Print the full absolute name of the library file @var{library} that
7265 would be used when linking---and don't do anything else.  With this
7266 option, GCC does not compile or link anything; it just prints the
7267 file name.
7269 @item -print-multi-directory
7270 @opindex print-multi-directory
7271 Print the directory name corresponding to the multilib selected by any
7272 other switches present in the command line.  This directory is supposed
7273 to exist in @env{GCC_EXEC_PREFIX}.
7275 @item -print-multi-lib
7276 @opindex print-multi-lib
7277 Print the mapping from multilib directory names to compiler switches
7278 that enable them.  The directory name is separated from the switches by
7279 @samp{;}, and each switch starts with an @samp{@@} instead of the
7280 @samp{-}, without spaces between multiple switches.  This is supposed to
7281 ease shell processing.
7283 @item -print-multi-os-directory
7284 @opindex print-multi-os-directory
7285 Print the path to OS libraries for the selected
7286 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
7287 present in the @file{lib} subdirectory and no multilibs are used, this is
7288 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
7289 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
7290 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
7291 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
7293 @item -print-multiarch
7294 @opindex print-multiarch
7295 Print the path to OS libraries for the selected multiarch,
7296 relative to some @file{lib} subdirectory.
7298 @item -print-prog-name=@var{program}
7299 @opindex print-prog-name
7300 Like @option{-print-file-name}, but searches for a program such as @command{cpp}.
7302 @item -print-libgcc-file-name
7303 @opindex print-libgcc-file-name
7304 Same as @option{-print-file-name=libgcc.a}.
7306 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
7307 but you do want to link with @file{libgcc.a}.  You can do:
7309 @smallexample
7310 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
7311 @end smallexample
7313 @item -print-search-dirs
7314 @opindex print-search-dirs
7315 Print the name of the configured installation directory and a list of
7316 program and library directories @command{gcc} searches---and don't do anything else.
7318 This is useful when @command{gcc} prints the error message
7319 @samp{installation problem, cannot exec cpp0: No such file or directory}.
7320 To resolve this you either need to put @file{cpp0} and the other compiler
7321 components where @command{gcc} expects to find them, or you can set the environment
7322 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
7323 Don't forget the trailing @samp{/}.
7324 @xref{Environment Variables}.
7326 @item -print-sysroot
7327 @opindex print-sysroot
7328 Print the target sysroot directory that is used during
7329 compilation.  This is the target sysroot specified either at configure
7330 time or using the @option{--sysroot} option, possibly with an extra
7331 suffix that depends on compilation options.  If no target sysroot is
7332 specified, the option prints nothing.
7334 @item -print-sysroot-headers-suffix
7335 @opindex print-sysroot-headers-suffix
7336 Print the suffix added to the target sysroot when searching for
7337 headers, or give an error if the compiler is not configured with such
7338 a suffix---and don't do anything else.
7340 @item -dumpmachine
7341 @opindex dumpmachine
7342 Print the compiler's target machine (for example,
7343 @samp{i686-pc-linux-gnu})---and don't do anything else.
7345 @item -dumpversion
7346 @opindex dumpversion
7347 Print the compiler version (for example, @code{3.0})---and don't do
7348 anything else.
7350 @item -dumpspecs
7351 @opindex dumpspecs
7352 Print the compiler's built-in specs---and don't do anything else.  (This
7353 is used when GCC itself is being built.)  @xref{Spec Files}.
7355 @item -fno-eliminate-unused-debug-types
7356 @opindex feliminate-unused-debug-types
7357 @opindex fno-eliminate-unused-debug-types
7358 Normally, when producing DWARF 2 output, GCC avoids producing debug symbol 
7359 output for types that are nowhere used in the source file being compiled.
7360 Sometimes it is useful to have GCC emit debugging
7361 information for all types declared in a compilation
7362 unit, regardless of whether or not they are actually used
7363 in that compilation unit, for example 
7364 if, in the debugger, you want to cast a value to a type that is
7365 not actually used in your program (but is declared).  More often,
7366 however, this results in a significant amount of wasted space.
7367 @end table
7369 @node Optimize Options
7370 @section Options That Control Optimization
7371 @cindex optimize options
7372 @cindex options, optimization
7374 These options control various sorts of optimizations.
7376 Without any optimization option, the compiler's goal is to reduce the
7377 cost of compilation and to make debugging produce the expected
7378 results.  Statements are independent: if you stop the program with a
7379 breakpoint between statements, you can then assign a new value to any
7380 variable or change the program counter to any other statement in the
7381 function and get exactly the results you expect from the source
7382 code.
7384 Turning on optimization flags makes the compiler attempt to improve
7385 the performance and/or code size at the expense of compilation time
7386 and possibly the ability to debug the program.
7388 The compiler performs optimization based on the knowledge it has of the
7389 program.  Compiling multiple files at once to a single output file mode allows
7390 the compiler to use information gained from all of the files when compiling
7391 each of them.
7393 Not all optimizations are controlled directly by a flag.  Only
7394 optimizations that have a flag are listed in this section.
7396 Most optimizations are only enabled if an @option{-O} level is set on
7397 the command line.  Otherwise they are disabled, even if individual
7398 optimization flags are specified.
7400 Depending on the target and how GCC was configured, a slightly different
7401 set of optimizations may be enabled at each @option{-O} level than
7402 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
7403 to find out the exact set of optimizations that are enabled at each level.
7404 @xref{Overall Options}, for examples.
7406 @table @gcctabopt
7407 @item -O
7408 @itemx -O1
7409 @opindex O
7410 @opindex O1
7411 Optimize.  Optimizing compilation takes somewhat more time, and a lot
7412 more memory for a large function.
7414 With @option{-O}, the compiler tries to reduce code size and execution
7415 time, without performing any optimizations that take a great deal of
7416 compilation time.
7418 @option{-O} turns on the following optimization flags:
7419 @gccoptlist{
7420 -fauto-inc-dec @gol
7421 -fbranch-count-reg @gol
7422 -fcombine-stack-adjustments @gol
7423 -fcompare-elim @gol
7424 -fcprop-registers @gol
7425 -fdce @gol
7426 -fdefer-pop @gol
7427 -fdelayed-branch @gol
7428 -fdse @gol
7429 -fforward-propagate @gol
7430 -fguess-branch-probability @gol
7431 -fif-conversion2 @gol
7432 -fif-conversion @gol
7433 -finline-functions-called-once @gol
7434 -fipa-pure-const @gol
7435 -fipa-profile @gol
7436 -fipa-reference @gol
7437 -fmerge-constants @gol
7438 -fmove-loop-invariants @gol
7439 -fshrink-wrap @gol
7440 -fsplit-wide-types @gol
7441 -ftree-bit-ccp @gol
7442 -ftree-ccp @gol
7443 -fssa-phiopt @gol
7444 -ftree-ch @gol
7445 -ftree-copy-prop @gol
7446 -ftree-copyrename @gol
7447 -ftree-dce @gol
7448 -ftree-dominator-opts @gol
7449 -ftree-dse @gol
7450 -ftree-forwprop @gol
7451 -ftree-fre @gol
7452 -ftree-phiprop @gol
7453 -ftree-sink @gol
7454 -ftree-slsr @gol
7455 -ftree-sra @gol
7456 -ftree-pta @gol
7457 -ftree-ter @gol
7458 -funit-at-a-time}
7460 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
7461 where doing so does not interfere with debugging.
7463 @item -O2
7464 @opindex O2
7465 Optimize even more.  GCC performs nearly all supported optimizations
7466 that do not involve a space-speed tradeoff.
7467 As compared to @option{-O}, this option increases both compilation time
7468 and the performance of the generated code.
7470 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
7471 also turns on the following optimization flags:
7472 @gccoptlist{-fthread-jumps @gol
7473 -falign-functions  -falign-jumps @gol
7474 -falign-loops  -falign-labels @gol
7475 -fcaller-saves @gol
7476 -fcrossjumping @gol
7477 -fcse-follow-jumps  -fcse-skip-blocks @gol
7478 -fdelete-null-pointer-checks @gol
7479 -fdevirtualize -fdevirtualize-speculatively @gol
7480 -fexpensive-optimizations @gol
7481 -fgcse  -fgcse-lm  @gol
7482 -fhoist-adjacent-loads @gol
7483 -finline-small-functions @gol
7484 -findirect-inlining @gol
7485 -fipa-cp @gol
7486 -fipa-cp-alignment @gol
7487 -fipa-sra @gol
7488 -fipa-icf @gol
7489 -fisolate-erroneous-paths-dereference @gol
7490 -flra-remat @gol
7491 -foptimize-sibling-calls @gol
7492 -foptimize-strlen @gol
7493 -fpartial-inlining @gol
7494 -fpeephole2 @gol
7495 -freorder-blocks -freorder-blocks-and-partition -freorder-functions @gol
7496 -frerun-cse-after-loop  @gol
7497 -fsched-interblock  -fsched-spec @gol
7498 -fschedule-insns  -fschedule-insns2 @gol
7499 -fstrict-aliasing -fstrict-overflow @gol
7500 -ftree-builtin-call-dce @gol
7501 -ftree-switch-conversion -ftree-tail-merge @gol
7502 -ftree-pre @gol
7503 -ftree-vrp @gol
7504 -fipa-ra}
7506 Please note the warning under @option{-fgcse} about
7507 invoking @option{-O2} on programs that use computed gotos.
7509 @item -O3
7510 @opindex O3
7511 Optimize yet more.  @option{-O3} turns on all optimizations specified
7512 by @option{-O2} and also turns on the @option{-finline-functions},
7513 @option{-funswitch-loops}, @option{-fpredictive-commoning},
7514 @option{-fgcse-after-reload}, @option{-ftree-loop-vectorize},
7515 @option{-ftree-loop-distribute-patterns},
7516 @option{-ftree-slp-vectorize}, @option{-fvect-cost-model},
7517 @option{-ftree-partial-pre} and @option{-fipa-cp-clone} options.
7519 @item -O0
7520 @opindex O0
7521 Reduce compilation time and make debugging produce the expected
7522 results.  This is the default.
7524 @item -Os
7525 @opindex Os
7526 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
7527 do not typically increase code size.  It also performs further
7528 optimizations designed to reduce code size.
7530 @option{-Os} disables the following optimization flags:
7531 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
7532 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
7533 -fprefetch-loop-arrays}
7535 @item -Ofast
7536 @opindex Ofast
7537 Disregard strict standards compliance.  @option{-Ofast} enables all
7538 @option{-O3} optimizations.  It also enables optimizations that are not
7539 valid for all standard-compliant programs.
7540 It turns on @option{-ffast-math} and the Fortran-specific
7541 @option{-fno-protect-parens} and @option{-fstack-arrays}.
7543 @item -Og
7544 @opindex Og
7545 Optimize debugging experience.  @option{-Og} enables optimizations
7546 that do not interfere with debugging. It should be the optimization
7547 level of choice for the standard edit-compile-debug cycle, offering
7548 a reasonable level of optimization while maintaining fast compilation
7549 and a good debugging experience.
7551 If you use multiple @option{-O} options, with or without level numbers,
7552 the last such option is the one that is effective.
7553 @end table
7555 Options of the form @option{-f@var{flag}} specify machine-independent
7556 flags.  Most flags have both positive and negative forms; the negative
7557 form of @option{-ffoo} is @option{-fno-foo}.  In the table
7558 below, only one of the forms is listed---the one you typically 
7559 use.  You can figure out the other form by either removing @samp{no-}
7560 or adding it.
7562 The following options control specific optimizations.  They are either
7563 activated by @option{-O} options or are related to ones that are.  You
7564 can use the following flags in the rare cases when ``fine-tuning'' of
7565 optimizations to be performed is desired.
7567 @table @gcctabopt
7568 @item -fno-defer-pop
7569 @opindex fno-defer-pop
7570 Always pop the arguments to each function call as soon as that function
7571 returns.  For machines that must pop arguments after a function call,
7572 the compiler normally lets arguments accumulate on the stack for several
7573 function calls and pops them all at once.
7575 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7577 @item -fforward-propagate
7578 @opindex fforward-propagate
7579 Perform a forward propagation pass on RTL@.  The pass tries to combine two
7580 instructions and checks if the result can be simplified.  If loop unrolling
7581 is active, two passes are performed and the second is scheduled after
7582 loop unrolling.
7584 This option is enabled by default at optimization levels @option{-O},
7585 @option{-O2}, @option{-O3}, @option{-Os}.
7587 @item -ffp-contract=@var{style}
7588 @opindex ffp-contract
7589 @option{-ffp-contract=off} disables floating-point expression contraction.
7590 @option{-ffp-contract=fast} enables floating-point expression contraction
7591 such as forming of fused multiply-add operations if the target has
7592 native support for them.
7593 @option{-ffp-contract=on} enables floating-point expression contraction
7594 if allowed by the language standard.  This is currently not implemented
7595 and treated equal to @option{-ffp-contract=off}.
7597 The default is @option{-ffp-contract=fast}.
7599 @item -fomit-frame-pointer
7600 @opindex fomit-frame-pointer
7601 Don't keep the frame pointer in a register for functions that
7602 don't need one.  This avoids the instructions to save, set up and
7603 restore frame pointers; it also makes an extra register available
7604 in many functions.  @strong{It also makes debugging impossible on
7605 some machines.}
7607 On some machines, such as the VAX, this flag has no effect, because
7608 the standard calling sequence automatically handles the frame pointer
7609 and nothing is saved by pretending it doesn't exist.  The
7610 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
7611 whether a target machine supports this flag.  @xref{Registers,,Register
7612 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
7614 The default setting (when not optimizing for
7615 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets is
7616 @option{-fomit-frame-pointer}.  You can configure GCC with the
7617 @option{--enable-frame-pointer} configure option to change the default.
7619 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7621 @item -foptimize-sibling-calls
7622 @opindex foptimize-sibling-calls
7623 Optimize sibling and tail recursive calls.
7625 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7627 @item -foptimize-strlen
7628 @opindex foptimize-strlen
7629 Optimize various standard C string functions (e.g. @code{strlen},
7630 @code{strchr} or @code{strcpy}) and
7631 their @code{_FORTIFY_SOURCE} counterparts into faster alternatives.
7633 Enabled at levels @option{-O2}, @option{-O3}.
7635 @item -fno-inline
7636 @opindex fno-inline
7637 Do not expand any functions inline apart from those marked with
7638 the @code{always_inline} attribute.  This is the default when not
7639 optimizing.
7641 Single functions can be exempted from inlining by marking them
7642 with the @code{noinline} attribute.
7644 @item -finline-small-functions
7645 @opindex finline-small-functions
7646 Integrate functions into their callers when their body is smaller than expected
7647 function call code (so overall size of program gets smaller).  The compiler
7648 heuristically decides which functions are simple enough to be worth integrating
7649 in this way.  This inlining applies to all functions, even those not declared
7650 inline.
7652 Enabled at level @option{-O2}.
7654 @item -findirect-inlining
7655 @opindex findirect-inlining
7656 Inline also indirect calls that are discovered to be known at compile
7657 time thanks to previous inlining.  This option has any effect only
7658 when inlining itself is turned on by the @option{-finline-functions}
7659 or @option{-finline-small-functions} options.
7661 Enabled at level @option{-O2}.
7663 @item -finline-functions
7664 @opindex finline-functions
7665 Consider all functions for inlining, even if they are not declared inline.
7666 The compiler heuristically decides which functions are worth integrating
7667 in this way.
7669 If all calls to a given function are integrated, and the function is
7670 declared @code{static}, then the function is normally not output as
7671 assembler code in its own right.
7673 Enabled at level @option{-O3}.
7675 @item -finline-functions-called-once
7676 @opindex finline-functions-called-once
7677 Consider all @code{static} functions called once for inlining into their
7678 caller even if they are not marked @code{inline}.  If a call to a given
7679 function is integrated, then the function is not output as assembler code
7680 in its own right.
7682 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
7684 @item -fearly-inlining
7685 @opindex fearly-inlining
7686 Inline functions marked by @code{always_inline} and functions whose body seems
7687 smaller than the function call overhead early before doing
7688 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
7689 makes profiling significantly cheaper and usually inlining faster on programs
7690 having large chains of nested wrapper functions.
7692 Enabled by default.
7694 @item -fipa-sra
7695 @opindex fipa-sra
7696 Perform interprocedural scalar replacement of aggregates, removal of
7697 unused parameters and replacement of parameters passed by reference
7698 by parameters passed by value.
7700 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
7702 @item -finline-limit=@var{n}
7703 @opindex finline-limit
7704 By default, GCC limits the size of functions that can be inlined.  This flag
7705 allows coarse control of this limit.  @var{n} is the size of functions that
7706 can be inlined in number of pseudo instructions.
7708 Inlining is actually controlled by a number of parameters, which may be
7709 specified individually by using @option{--param @var{name}=@var{value}}.
7710 The @option{-finline-limit=@var{n}} option sets some of these parameters
7711 as follows:
7713 @table @gcctabopt
7714 @item max-inline-insns-single
7715 is set to @var{n}/2.
7716 @item max-inline-insns-auto
7717 is set to @var{n}/2.
7718 @end table
7720 See below for a documentation of the individual
7721 parameters controlling inlining and for the defaults of these parameters.
7723 @emph{Note:} there may be no value to @option{-finline-limit} that results
7724 in default behavior.
7726 @emph{Note:} pseudo instruction represents, in this particular context, an
7727 abstract measurement of function's size.  In no way does it represent a count
7728 of assembly instructions and as such its exact meaning might change from one
7729 release to an another.
7731 @item -fno-keep-inline-dllexport
7732 @opindex fno-keep-inline-dllexport
7733 This is a more fine-grained version of @option{-fkeep-inline-functions},
7734 which applies only to functions that are declared using the @code{dllexport}
7735 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
7736 Functions}.)
7738 @item -fkeep-inline-functions
7739 @opindex fkeep-inline-functions
7740 In C, emit @code{static} functions that are declared @code{inline}
7741 into the object file, even if the function has been inlined into all
7742 of its callers.  This switch does not affect functions using the
7743 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
7744 inline functions into the object file.
7746 @item -fkeep-static-consts
7747 @opindex fkeep-static-consts
7748 Emit variables declared @code{static const} when optimization isn't turned
7749 on, even if the variables aren't referenced.
7751 GCC enables this option by default.  If you want to force the compiler to
7752 check if a variable is referenced, regardless of whether or not
7753 optimization is turned on, use the @option{-fno-keep-static-consts} option.
7755 @item -fmerge-constants
7756 @opindex fmerge-constants
7757 Attempt to merge identical constants (string constants and floating-point
7758 constants) across compilation units.
7760 This option is the default for optimized compilation if the assembler and
7761 linker support it.  Use @option{-fno-merge-constants} to inhibit this
7762 behavior.
7764 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7766 @item -fmerge-all-constants
7767 @opindex fmerge-all-constants
7768 Attempt to merge identical constants and identical variables.
7770 This option implies @option{-fmerge-constants}.  In addition to
7771 @option{-fmerge-constants} this considers e.g.@: even constant initialized
7772 arrays or initialized constant variables with integral or floating-point
7773 types.  Languages like C or C++ require each variable, including multiple
7774 instances of the same variable in recursive calls, to have distinct locations,
7775 so using this option results in non-conforming
7776 behavior.
7778 @item -fmodulo-sched
7779 @opindex fmodulo-sched
7780 Perform swing modulo scheduling immediately before the first scheduling
7781 pass.  This pass looks at innermost loops and reorders their
7782 instructions by overlapping different iterations.
7784 @item -fmodulo-sched-allow-regmoves
7785 @opindex fmodulo-sched-allow-regmoves
7786 Perform more aggressive SMS-based modulo scheduling with register moves
7787 allowed.  By setting this flag certain anti-dependences edges are
7788 deleted, which triggers the generation of reg-moves based on the
7789 life-range analysis.  This option is effective only with
7790 @option{-fmodulo-sched} enabled.
7792 @item -fno-branch-count-reg
7793 @opindex fno-branch-count-reg
7794 Do not use ``decrement and branch'' instructions on a count register,
7795 but instead generate a sequence of instructions that decrement a
7796 register, compare it against zero, then branch based upon the result.
7797 This option is only meaningful on architectures that support such
7798 instructions, which include x86, PowerPC, IA-64 and S/390.
7800 Enabled by default at @option{-O1} and higher.
7802 The default is @option{-fbranch-count-reg}.
7804 @item -fno-function-cse
7805 @opindex fno-function-cse
7806 Do not put function addresses in registers; make each instruction that
7807 calls a constant function contain the function's address explicitly.
7809 This option results in less efficient code, but some strange hacks
7810 that alter the assembler output may be confused by the optimizations
7811 performed when this option is not used.
7813 The default is @option{-ffunction-cse}
7815 @item -fno-zero-initialized-in-bss
7816 @opindex fno-zero-initialized-in-bss
7817 If the target supports a BSS section, GCC by default puts variables that
7818 are initialized to zero into BSS@.  This can save space in the resulting
7819 code.
7821 This option turns off this behavior because some programs explicitly
7822 rely on variables going to the data section---e.g., so that the
7823 resulting executable can find the beginning of that section and/or make
7824 assumptions based on that.
7826 The default is @option{-fzero-initialized-in-bss}.
7828 @item -fthread-jumps
7829 @opindex fthread-jumps
7830 Perform optimizations that check to see if a jump branches to a
7831 location where another comparison subsumed by the first is found.  If
7832 so, the first branch is redirected to either the destination of the
7833 second branch or a point immediately following it, depending on whether
7834 the condition is known to be true or false.
7836 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7838 @item -fsplit-wide-types
7839 @opindex fsplit-wide-types
7840 When using a type that occupies multiple registers, such as @code{long
7841 long} on a 32-bit system, split the registers apart and allocate them
7842 independently.  This normally generates better code for those types,
7843 but may make debugging more difficult.
7845 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
7846 @option{-Os}.
7848 @item -fcse-follow-jumps
7849 @opindex fcse-follow-jumps
7850 In common subexpression elimination (CSE), scan through jump instructions
7851 when the target of the jump is not reached by any other path.  For
7852 example, when CSE encounters an @code{if} statement with an
7853 @code{else} clause, CSE follows the jump when the condition
7854 tested is false.
7856 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7858 @item -fcse-skip-blocks
7859 @opindex fcse-skip-blocks
7860 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
7861 follow jumps that conditionally skip over blocks.  When CSE
7862 encounters a simple @code{if} statement with no else clause,
7863 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
7864 body of the @code{if}.
7866 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7868 @item -frerun-cse-after-loop
7869 @opindex frerun-cse-after-loop
7870 Re-run common subexpression elimination after loop optimizations are
7871 performed.
7873 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7875 @item -fgcse
7876 @opindex fgcse
7877 Perform a global common subexpression elimination pass.
7878 This pass also performs global constant and copy propagation.
7880 @emph{Note:} When compiling a program using computed gotos, a GCC
7881 extension, you may get better run-time performance if you disable
7882 the global common subexpression elimination pass by adding
7883 @option{-fno-gcse} to the command line.
7885 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7887 @item -fgcse-lm
7888 @opindex fgcse-lm
7889 When @option{-fgcse-lm} is enabled, global common subexpression elimination
7890 attempts to move loads that are only killed by stores into themselves.  This
7891 allows a loop containing a load/store sequence to be changed to a load outside
7892 the loop, and a copy/store within the loop.
7894 Enabled by default when @option{-fgcse} is enabled.
7896 @item -fgcse-sm
7897 @opindex fgcse-sm
7898 When @option{-fgcse-sm} is enabled, a store motion pass is run after
7899 global common subexpression elimination.  This pass attempts to move
7900 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
7901 loops containing a load/store sequence can be changed to a load before
7902 the loop and a store after the loop.
7904 Not enabled at any optimization level.
7906 @item -fgcse-las
7907 @opindex fgcse-las
7908 When @option{-fgcse-las} is enabled, the global common subexpression
7909 elimination pass eliminates redundant loads that come after stores to the
7910 same memory location (both partial and full redundancies).
7912 Not enabled at any optimization level.
7914 @item -fgcse-after-reload
7915 @opindex fgcse-after-reload
7916 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
7917 pass is performed after reload.  The purpose of this pass is to clean up
7918 redundant spilling.
7920 @item -faggressive-loop-optimizations
7921 @opindex faggressive-loop-optimizations
7922 This option tells the loop optimizer to use language constraints to
7923 derive bounds for the number of iterations of a loop.  This assumes that
7924 loop code does not invoke undefined behavior by for example causing signed
7925 integer overflows or out-of-bound array accesses.  The bounds for the
7926 number of iterations of a loop are used to guide loop unrolling and peeling
7927 and loop exit test optimizations.
7928 This option is enabled by default.
7930 @item -funsafe-loop-optimizations
7931 @opindex funsafe-loop-optimizations
7932 This option tells the loop optimizer to assume that loop indices do not
7933 overflow, and that loops with nontrivial exit condition are not
7934 infinite.  This enables a wider range of loop optimizations even if
7935 the loop optimizer itself cannot prove that these assumptions are valid.
7936 If you use @option{-Wunsafe-loop-optimizations}, the compiler warns you
7937 if it finds this kind of loop.
7939 @item -fcrossjumping
7940 @opindex fcrossjumping
7941 Perform cross-jumping transformation.
7942 This transformation unifies equivalent code and saves code size.  The
7943 resulting code may or may not perform better than without cross-jumping.
7945 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7947 @item -fauto-inc-dec
7948 @opindex fauto-inc-dec
7949 Combine increments or decrements of addresses with memory accesses.
7950 This pass is always skipped on architectures that do not have
7951 instructions to support this.  Enabled by default at @option{-O} and
7952 higher on architectures that support this.
7954 @item -fdce
7955 @opindex fdce
7956 Perform dead code elimination (DCE) on RTL@.
7957 Enabled by default at @option{-O} and higher.
7959 @item -fdse
7960 @opindex fdse
7961 Perform dead store elimination (DSE) on RTL@.
7962 Enabled by default at @option{-O} and higher.
7964 @item -fif-conversion
7965 @opindex fif-conversion
7966 Attempt to transform conditional jumps into branch-less equivalents.  This
7967 includes use of conditional moves, min, max, set flags and abs instructions, and
7968 some tricks doable by standard arithmetics.  The use of conditional execution
7969 on chips where it is available is controlled by @option{-fif-conversion2}.
7971 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7973 @item -fif-conversion2
7974 @opindex fif-conversion2
7975 Use conditional execution (where available) to transform conditional jumps into
7976 branch-less equivalents.
7978 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7980 @item -fdeclone-ctor-dtor
7981 @opindex fdeclone-ctor-dtor
7982 The C++ ABI requires multiple entry points for constructors and
7983 destructors: one for a base subobject, one for a complete object, and
7984 one for a virtual destructor that calls operator delete afterwards.
7985 For a hierarchy with virtual bases, the base and complete variants are
7986 clones, which means two copies of the function.  With this option, the
7987 base and complete variants are changed to be thunks that call a common
7988 implementation.
7990 Enabled by @option{-Os}.
7992 @item -fdelete-null-pointer-checks
7993 @opindex fdelete-null-pointer-checks
7994 Assume that programs cannot safely dereference null pointers, and that
7995 no code or data element resides there.  This enables simple constant
7996 folding optimizations at all optimization levels.  In addition, other
7997 optimization passes in GCC use this flag to control global dataflow
7998 analyses that eliminate useless checks for null pointers; these assume
7999 that if a pointer is checked after it has already been dereferenced,
8000 it cannot be null.
8002 Note however that in some environments this assumption is not true.
8003 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
8004 for programs that depend on that behavior.
8006 Some targets, especially embedded ones, disable this option at all levels.
8007 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
8008 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
8009 are enabled independently at different optimization levels.
8011 @item -fdevirtualize
8012 @opindex fdevirtualize
8013 Attempt to convert calls to virtual functions to direct calls.  This
8014 is done both within a procedure and interprocedurally as part of
8015 indirect inlining (@option{-findirect-inlining}) and interprocedural constant
8016 propagation (@option{-fipa-cp}).
8017 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8019 @item -fdevirtualize-speculatively
8020 @opindex fdevirtualize-speculatively
8021 Attempt to convert calls to virtual functions to speculative direct calls.
8022 Based on the analysis of the type inheritance graph, determine for a given call
8023 the set of likely targets. If the set is small, preferably of size 1, change
8024 the call into a conditional deciding between direct and indirect calls.  The
8025 speculative calls enable more optimizations, such as inlining.  When they seem
8026 useless after further optimization, they are converted back into original form.
8028 @item -fdevirtualize-at-ltrans
8029 @opindex fdevirtualize-at-ltrans
8030 Stream extra information needed for aggressive devirtualization when running
8031 the link-time optimizer in local transformation mode.  
8032 This option enables more devirtualization but
8033 significantly increases the size of streamed data. For this reason it is
8034 disabled by default.
8036 @item -fexpensive-optimizations
8037 @opindex fexpensive-optimizations
8038 Perform a number of minor optimizations that are relatively expensive.
8040 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8042 @item -free
8043 @opindex free
8044 Attempt to remove redundant extension instructions.  This is especially
8045 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
8046 registers after writing to their lower 32-bit half.
8048 Enabled for Alpha, AArch64 and x86 at levels @option{-O2},
8049 @option{-O3}, @option{-Os}.
8051 @item -fno-lifetime-dse
8052 @opindex fno-lifetime-dse
8053 In C++ the value of an object is only affected by changes within its
8054 lifetime: when the constructor begins, the object has an indeterminate
8055 value, and any changes during the lifetime of the object are dead when
8056 the object is destroyed.  Normally dead store elimination will take
8057 advantage of this; if your code relies on the value of the object
8058 storage persisting beyond the lifetime of the object, you can use this
8059 flag to disable this optimization.
8061 @item -flive-range-shrinkage
8062 @opindex flive-range-shrinkage
8063 Attempt to decrease register pressure through register live range
8064 shrinkage.  This is helpful for fast processors with small or moderate
8065 size register sets.
8067 @item -fira-algorithm=@var{algorithm}
8068 @opindex fira-algorithm
8069 Use the specified coloring algorithm for the integrated register
8070 allocator.  The @var{algorithm} argument can be @samp{priority}, which
8071 specifies Chow's priority coloring, or @samp{CB}, which specifies
8072 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
8073 for all architectures, but for those targets that do support it, it is
8074 the default because it generates better code.
8076 @item -fira-region=@var{region}
8077 @opindex fira-region
8078 Use specified regions for the integrated register allocator.  The
8079 @var{region} argument should be one of the following:
8081 @table @samp
8083 @item all
8084 Use all loops as register allocation regions.
8085 This can give the best results for machines with a small and/or
8086 irregular register set.
8088 @item mixed
8089 Use all loops except for loops with small register pressure 
8090 as the regions.  This value usually gives
8091 the best results in most cases and for most architectures,
8092 and is enabled by default when compiling with optimization for speed
8093 (@option{-O}, @option{-O2}, @dots{}).
8095 @item one
8096 Use all functions as a single region.  
8097 This typically results in the smallest code size, and is enabled by default for
8098 @option{-Os} or @option{-O0}.
8100 @end table
8102 @item -fira-hoist-pressure
8103 @opindex fira-hoist-pressure
8104 Use IRA to evaluate register pressure in the code hoisting pass for
8105 decisions to hoist expressions.  This option usually results in smaller
8106 code, but it can slow the compiler down.
8108 This option is enabled at level @option{-Os} for all targets.
8110 @item -fira-loop-pressure
8111 @opindex fira-loop-pressure
8112 Use IRA to evaluate register pressure in loops for decisions to move
8113 loop invariants.  This option usually results in generation
8114 of faster and smaller code on machines with large register files (>= 32
8115 registers), but it can slow the compiler down.
8117 This option is enabled at level @option{-O3} for some targets.
8119 @item -fno-ira-share-save-slots
8120 @opindex fno-ira-share-save-slots
8121 Disable sharing of stack slots used for saving call-used hard
8122 registers living through a call.  Each hard register gets a
8123 separate stack slot, and as a result function stack frames are
8124 larger.
8126 @item -fno-ira-share-spill-slots
8127 @opindex fno-ira-share-spill-slots
8128 Disable sharing of stack slots allocated for pseudo-registers.  Each
8129 pseudo-register that does not get a hard register gets a separate
8130 stack slot, and as a result function stack frames are larger.
8132 @item -fira-verbose=@var{n}
8133 @opindex fira-verbose
8134 Control the verbosity of the dump file for the integrated register allocator.
8135 The default value is 5.  If the value @var{n} is greater or equal to 10,
8136 the dump output is sent to stderr using the same format as @var{n} minus 10.
8138 @item -flra-remat
8139 @opindex flra-remat
8140 Enable CFG-sensitive rematerialization in LRA.  Instead of loading
8141 values of spilled pseudos, LRA tries to rematerialize (recalculate)
8142 values if it is profitable.
8144 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8146 @item -fdelayed-branch
8147 @opindex fdelayed-branch
8148 If supported for the target machine, attempt to reorder instructions
8149 to exploit instruction slots available after delayed branch
8150 instructions.
8152 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8154 @item -fschedule-insns
8155 @opindex fschedule-insns
8156 If supported for the target machine, attempt to reorder instructions to
8157 eliminate execution stalls due to required data being unavailable.  This
8158 helps machines that have slow floating point or memory load instructions
8159 by allowing other instructions to be issued until the result of the load
8160 or floating-point instruction is required.
8162 Enabled at levels @option{-O2}, @option{-O3}.
8164 @item -fschedule-insns2
8165 @opindex fschedule-insns2
8166 Similar to @option{-fschedule-insns}, but requests an additional pass of
8167 instruction scheduling after register allocation has been done.  This is
8168 especially useful on machines with a relatively small number of
8169 registers and where memory load instructions take more than one cycle.
8171 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8173 @item -fno-sched-interblock
8174 @opindex fno-sched-interblock
8175 Don't schedule instructions across basic blocks.  This is normally
8176 enabled by default when scheduling before register allocation, i.e.@:
8177 with @option{-fschedule-insns} or at @option{-O2} or higher.
8179 @item -fno-sched-spec
8180 @opindex fno-sched-spec
8181 Don't allow speculative motion of non-load instructions.  This is normally
8182 enabled by default when scheduling before register allocation, i.e.@:
8183 with @option{-fschedule-insns} or at @option{-O2} or higher.
8185 @item -fsched-pressure
8186 @opindex fsched-pressure
8187 Enable register pressure sensitive insn scheduling before register
8188 allocation.  This only makes sense when scheduling before register
8189 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
8190 @option{-O2} or higher.  Usage of this option can improve the
8191 generated code and decrease its size by preventing register pressure
8192 increase above the number of available hard registers and subsequent
8193 spills in register allocation.
8195 @item -fsched-spec-load
8196 @opindex fsched-spec-load
8197 Allow speculative motion of some load instructions.  This only makes
8198 sense when scheduling before register allocation, i.e.@: with
8199 @option{-fschedule-insns} or at @option{-O2} or higher.
8201 @item -fsched-spec-load-dangerous
8202 @opindex fsched-spec-load-dangerous
8203 Allow speculative motion of more load instructions.  This only makes
8204 sense when scheduling before register allocation, i.e.@: with
8205 @option{-fschedule-insns} or at @option{-O2} or higher.
8207 @item -fsched-stalled-insns
8208 @itemx -fsched-stalled-insns=@var{n}
8209 @opindex fsched-stalled-insns
8210 Define how many insns (if any) can be moved prematurely from the queue
8211 of stalled insns into the ready list during the second scheduling pass.
8212 @option{-fno-sched-stalled-insns} means that no insns are moved
8213 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
8214 on how many queued insns can be moved prematurely.
8215 @option{-fsched-stalled-insns} without a value is equivalent to
8216 @option{-fsched-stalled-insns=1}.
8218 @item -fsched-stalled-insns-dep
8219 @itemx -fsched-stalled-insns-dep=@var{n}
8220 @opindex fsched-stalled-insns-dep
8221 Define how many insn groups (cycles) are examined for a dependency
8222 on a stalled insn that is a candidate for premature removal from the queue
8223 of stalled insns.  This has an effect only during the second scheduling pass,
8224 and only if @option{-fsched-stalled-insns} is used.
8225 @option{-fno-sched-stalled-insns-dep} is equivalent to
8226 @option{-fsched-stalled-insns-dep=0}.
8227 @option{-fsched-stalled-insns-dep} without a value is equivalent to
8228 @option{-fsched-stalled-insns-dep=1}.
8230 @item -fsched2-use-superblocks
8231 @opindex fsched2-use-superblocks
8232 When scheduling after register allocation, use superblock scheduling.
8233 This allows motion across basic block boundaries,
8234 resulting in faster schedules.  This option is experimental, as not all machine
8235 descriptions used by GCC model the CPU closely enough to avoid unreliable
8236 results from the algorithm.
8238 This only makes sense when scheduling after register allocation, i.e.@: with
8239 @option{-fschedule-insns2} or at @option{-O2} or higher.
8241 @item -fsched-group-heuristic
8242 @opindex fsched-group-heuristic
8243 Enable the group heuristic in the scheduler.  This heuristic favors
8244 the instruction that belongs to a schedule group.  This is enabled
8245 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
8246 or @option{-fschedule-insns2} or at @option{-O2} or higher.
8248 @item -fsched-critical-path-heuristic
8249 @opindex fsched-critical-path-heuristic
8250 Enable the critical-path heuristic in the scheduler.  This heuristic favors
8251 instructions on the critical path.  This is enabled by default when
8252 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
8253 or @option{-fschedule-insns2} or at @option{-O2} or higher.
8255 @item -fsched-spec-insn-heuristic
8256 @opindex fsched-spec-insn-heuristic
8257 Enable the speculative instruction heuristic in the scheduler.  This
8258 heuristic favors speculative instructions with greater dependency weakness.
8259 This is enabled by default when scheduling is enabled, i.e.@:
8260 with @option{-fschedule-insns} or @option{-fschedule-insns2}
8261 or at @option{-O2} or higher.
8263 @item -fsched-rank-heuristic
8264 @opindex fsched-rank-heuristic
8265 Enable the rank heuristic in the scheduler.  This heuristic favors
8266 the instruction belonging to a basic block with greater size or frequency.
8267 This is enabled by default when scheduling is enabled, i.e.@:
8268 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8269 at @option{-O2} or higher.
8271 @item -fsched-last-insn-heuristic
8272 @opindex fsched-last-insn-heuristic
8273 Enable the last-instruction heuristic in the scheduler.  This heuristic
8274 favors the instruction that is less dependent on the last instruction
8275 scheduled.  This is enabled by default when scheduling is enabled,
8276 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8277 at @option{-O2} or higher.
8279 @item -fsched-dep-count-heuristic
8280 @opindex fsched-dep-count-heuristic
8281 Enable the dependent-count heuristic in the scheduler.  This heuristic
8282 favors the instruction that has more instructions depending on it.
8283 This is enabled by default when scheduling is enabled, i.e.@:
8284 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8285 at @option{-O2} or higher.
8287 @item -freschedule-modulo-scheduled-loops
8288 @opindex freschedule-modulo-scheduled-loops
8289 Modulo scheduling is performed before traditional scheduling.  If a loop
8290 is modulo scheduled, later scheduling passes may change its schedule.  
8291 Use this option to control that behavior.
8293 @item -fselective-scheduling
8294 @opindex fselective-scheduling
8295 Schedule instructions using selective scheduling algorithm.  Selective
8296 scheduling runs instead of the first scheduler pass.
8298 @item -fselective-scheduling2
8299 @opindex fselective-scheduling2
8300 Schedule instructions using selective scheduling algorithm.  Selective
8301 scheduling runs instead of the second scheduler pass.
8303 @item -fsel-sched-pipelining
8304 @opindex fsel-sched-pipelining
8305 Enable software pipelining of innermost loops during selective scheduling.
8306 This option has no effect unless one of @option{-fselective-scheduling} or
8307 @option{-fselective-scheduling2} is turned on.
8309 @item -fsel-sched-pipelining-outer-loops
8310 @opindex fsel-sched-pipelining-outer-loops
8311 When pipelining loops during selective scheduling, also pipeline outer loops.
8312 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
8314 @item -fsemantic-interposition
8315 @opindex fsemantic-interposition
8316 Some object formats, like ELF, allow interposing of symbols by the 
8317 dynamic linker.
8318 This means that for symbols exported from the DSO, the compiler cannot perform
8319 interprocedural propagation, inlining and other optimizations in anticipation
8320 that the function or variable in question may change. While this feature is
8321 useful, for example, to rewrite memory allocation functions by a debugging
8322 implementation, it is expensive in the terms of code quality.
8323 With @option{-fno-semantic-interposition} the compiler assumes that 
8324 if interposition happens for functions the overwriting function will have 
8325 precisely the same semantics (and side effects). 
8326 Similarly if interposition happens
8327 for variables, the constructor of the variable will be the same. The flag
8328 has no effect for functions explicitly declared inline 
8329 (where it is never allowed for interposition to change semantics) 
8330 and for symbols explicitly declared weak.
8332 @item -fshrink-wrap
8333 @opindex fshrink-wrap
8334 Emit function prologues only before parts of the function that need it,
8335 rather than at the top of the function.  This flag is enabled by default at
8336 @option{-O} and higher.
8338 @item -fcaller-saves
8339 @opindex fcaller-saves
8340 Enable allocation of values to registers that are clobbered by
8341 function calls, by emitting extra instructions to save and restore the
8342 registers around such calls.  Such allocation is done only when it
8343 seems to result in better code.
8345 This option is always enabled by default on certain machines, usually
8346 those which have no call-preserved registers to use instead.
8348 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8350 @item -fcombine-stack-adjustments
8351 @opindex fcombine-stack-adjustments
8352 Tracks stack adjustments (pushes and pops) and stack memory references
8353 and then tries to find ways to combine them.
8355 Enabled by default at @option{-O1} and higher.
8357 @item -fipa-ra
8358 @opindex fipa-ra
8359 Use caller save registers for allocation if those registers are not used by
8360 any called function.  In that case it is not necessary to save and restore
8361 them around calls.  This is only possible if called functions are part of
8362 same compilation unit as current function and they are compiled before it.
8364 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8366 @item -fconserve-stack
8367 @opindex fconserve-stack
8368 Attempt to minimize stack usage.  The compiler attempts to use less
8369 stack space, even if that makes the program slower.  This option
8370 implies setting the @option{large-stack-frame} parameter to 100
8371 and the @option{large-stack-frame-growth} parameter to 400.
8373 @item -ftree-reassoc
8374 @opindex ftree-reassoc
8375 Perform reassociation on trees.  This flag is enabled by default
8376 at @option{-O} and higher.
8378 @item -ftree-pre
8379 @opindex ftree-pre
8380 Perform partial redundancy elimination (PRE) on trees.  This flag is
8381 enabled by default at @option{-O2} and @option{-O3}.
8383 @item -ftree-partial-pre
8384 @opindex ftree-partial-pre
8385 Make partial redundancy elimination (PRE) more aggressive.  This flag is
8386 enabled by default at @option{-O3}.
8388 @item -ftree-forwprop
8389 @opindex ftree-forwprop
8390 Perform forward propagation on trees.  This flag is enabled by default
8391 at @option{-O} and higher.
8393 @item -ftree-fre
8394 @opindex ftree-fre
8395 Perform full redundancy elimination (FRE) on trees.  The difference
8396 between FRE and PRE is that FRE only considers expressions
8397 that are computed on all paths leading to the redundant computation.
8398 This analysis is faster than PRE, though it exposes fewer redundancies.
8399 This flag is enabled by default at @option{-O} and higher.
8401 @item -ftree-phiprop
8402 @opindex ftree-phiprop
8403 Perform hoisting of loads from conditional pointers on trees.  This
8404 pass is enabled by default at @option{-O} and higher.
8406 @item -fhoist-adjacent-loads
8407 @opindex fhoist-adjacent-loads
8408 Speculatively hoist loads from both branches of an if-then-else if the
8409 loads are from adjacent locations in the same structure and the target
8410 architecture has a conditional move instruction.  This flag is enabled
8411 by default at @option{-O2} and higher.
8413 @item -ftree-copy-prop
8414 @opindex ftree-copy-prop
8415 Perform copy propagation on trees.  This pass eliminates unnecessary
8416 copy operations.  This flag is enabled by default at @option{-O} and
8417 higher.
8419 @item -fipa-pure-const
8420 @opindex fipa-pure-const
8421 Discover which functions are pure or constant.
8422 Enabled by default at @option{-O} and higher.
8424 @item -fipa-reference
8425 @opindex fipa-reference
8426 Discover which static variables do not escape the
8427 compilation unit.
8428 Enabled by default at @option{-O} and higher.
8430 @item -fipa-pta
8431 @opindex fipa-pta
8432 Perform interprocedural pointer analysis and interprocedural modification
8433 and reference analysis.  This option can cause excessive memory and
8434 compile-time usage on large compilation units.  It is not enabled by
8435 default at any optimization level.
8437 @item -fipa-profile
8438 @opindex fipa-profile
8439 Perform interprocedural profile propagation.  The functions called only from
8440 cold functions are marked as cold. Also functions executed once (such as
8441 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
8442 functions and loop less parts of functions executed once are then optimized for
8443 size.
8444 Enabled by default at @option{-O} and higher.
8446 @item -fipa-cp
8447 @opindex fipa-cp
8448 Perform interprocedural constant propagation.
8449 This optimization analyzes the program to determine when values passed
8450 to functions are constants and then optimizes accordingly.
8451 This optimization can substantially increase performance
8452 if the application has constants passed to functions.
8453 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
8455 @item -fipa-cp-clone
8456 @opindex fipa-cp-clone
8457 Perform function cloning to make interprocedural constant propagation stronger.
8458 When enabled, interprocedural constant propagation performs function cloning
8459 when externally visible function can be called with constant arguments.
8460 Because this optimization can create multiple copies of functions,
8461 it may significantly increase code size
8462 (see @option{--param ipcp-unit-growth=@var{value}}).
8463 This flag is enabled by default at @option{-O3}.
8465 @item -fipa-cp-alignment
8466 @opindex -fipa-cp-alignment
8467 When enabled, this optimization propagates alignment of function
8468 parameters to support better vectorization and string operations.
8470 This flag is enabled by default at @option{-O2} and @option{-Os}.  It
8471 requires that @option{-fipa-cp} is enabled.
8473 @item -fipa-icf
8474 @opindex fipa-icf
8475 Perform Identical Code Folding for functions and read-only variables.
8476 The optimization reduces code size and may disturb unwind stacks by replacing
8477 a function by equivalent one with a different name. The optimization works
8478 more effectively with link time optimization enabled.
8480 Nevertheless the behavior is similar to Gold Linker ICF optimization, GCC ICF
8481 works on different levels and thus the optimizations are not same - there are
8482 equivalences that are found only by GCC and equivalences found only by Gold.
8484 This flag is enabled by default at @option{-O2} and @option{-Os}.
8486 @item -fisolate-erroneous-paths-dereference
8487 @opindex fisolate-erroneous-paths-dereference
8488 Detect paths that trigger erroneous or undefined behavior due to
8489 dereferencing a null pointer.  Isolate those paths from the main control
8490 flow and turn the statement with erroneous or undefined behavior into a trap.
8491 This flag is enabled by default at @option{-O2} and higher.
8493 @item -fisolate-erroneous-paths-attribute
8494 @opindex fisolate-erroneous-paths-attribute
8495 Detect paths that trigger erroneous or undefined behavior due a null value
8496 being used in a way forbidden by a @code{returns_nonnull} or @code{nonnull}
8497 attribute.  Isolate those paths from the main control flow and turn the
8498 statement with erroneous or undefined behavior into a trap.  This is not
8499 currently enabled, but may be enabled by @option{-O2} in the future.
8501 @item -ftree-sink
8502 @opindex ftree-sink
8503 Perform forward store motion  on trees.  This flag is
8504 enabled by default at @option{-O} and higher.
8506 @item -ftree-bit-ccp
8507 @opindex ftree-bit-ccp
8508 Perform sparse conditional bit constant propagation on trees and propagate
8509 pointer alignment information.
8510 This pass only operates on local scalar variables and is enabled by default
8511 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
8513 @item -ftree-ccp
8514 @opindex ftree-ccp
8515 Perform sparse conditional constant propagation (CCP) on trees.  This
8516 pass only operates on local scalar variables and is enabled by default
8517 at @option{-O} and higher.
8519 @item -fssa-phiopt
8520 @opindex fssa-phiopt
8521 Perform pattern matching on SSA PHI nodes to optimize conditional
8522 code.  This pass is enabled by default at @option{-O} and higher.
8524 @item -ftree-switch-conversion
8525 @opindex ftree-switch-conversion
8526 Perform conversion of simple initializations in a switch to
8527 initializations from a scalar array.  This flag is enabled by default
8528 at @option{-O2} and higher.
8530 @item -ftree-tail-merge
8531 @opindex ftree-tail-merge
8532 Look for identical code sequences.  When found, replace one with a jump to the
8533 other.  This optimization is known as tail merging or cross jumping.  This flag
8534 is enabled by default at @option{-O2} and higher.  The compilation time
8535 in this pass can
8536 be limited using @option{max-tail-merge-comparisons} parameter and
8537 @option{max-tail-merge-iterations} parameter.
8539 @item -ftree-dce
8540 @opindex ftree-dce
8541 Perform dead code elimination (DCE) on trees.  This flag is enabled by
8542 default at @option{-O} and higher.
8544 @item -ftree-builtin-call-dce
8545 @opindex ftree-builtin-call-dce
8546 Perform conditional dead code elimination (DCE) for calls to built-in functions
8547 that may set @code{errno} but are otherwise side-effect free.  This flag is
8548 enabled by default at @option{-O2} and higher if @option{-Os} is not also
8549 specified.
8551 @item -ftree-dominator-opts
8552 @opindex ftree-dominator-opts
8553 Perform a variety of simple scalar cleanups (constant/copy
8554 propagation, redundancy elimination, range propagation and expression
8555 simplification) based on a dominator tree traversal.  This also
8556 performs jump threading (to reduce jumps to jumps). This flag is
8557 enabled by default at @option{-O} and higher.
8559 @item -ftree-dse
8560 @opindex ftree-dse
8561 Perform dead store elimination (DSE) on trees.  A dead store is a store into
8562 a memory location that is later overwritten by another store without
8563 any intervening loads.  In this case the earlier store can be deleted.  This
8564 flag is enabled by default at @option{-O} and higher.
8566 @item -ftree-ch
8567 @opindex ftree-ch
8568 Perform loop header copying on trees.  This is beneficial since it increases
8569 effectiveness of code motion optimizations.  It also saves one jump.  This flag
8570 is enabled by default at @option{-O} and higher.  It is not enabled
8571 for @option{-Os}, since it usually increases code size.
8573 @item -ftree-loop-optimize
8574 @opindex ftree-loop-optimize
8575 Perform loop optimizations on trees.  This flag is enabled by default
8576 at @option{-O} and higher.
8578 @item -ftree-loop-linear
8579 @opindex ftree-loop-linear
8580 Perform loop interchange transformations on tree.  Same as
8581 @option{-floop-interchange}.  To use this code transformation, GCC has
8582 to be configured with @option{--with-isl} to enable the Graphite loop
8583 transformation infrastructure.
8585 @item -floop-interchange
8586 @opindex floop-interchange
8587 Perform loop interchange transformations on loops.  Interchanging two
8588 nested loops switches the inner and outer loops.  For example, given a
8589 loop like:
8590 @smallexample
8591 DO J = 1, M
8592   DO I = 1, N
8593     A(J, I) = A(J, I) * C
8594   ENDDO
8595 ENDDO
8596 @end smallexample
8597 @noindent
8598 loop interchange transforms the loop as if it were written:
8599 @smallexample
8600 DO I = 1, N
8601   DO J = 1, M
8602     A(J, I) = A(J, I) * C
8603   ENDDO
8604 ENDDO
8605 @end smallexample
8606 which can be beneficial when @code{N} is larger than the caches,
8607 because in Fortran, the elements of an array are stored in memory
8608 contiguously by column, and the original loop iterates over rows,
8609 potentially creating at each access a cache miss.  This optimization
8610 applies to all the languages supported by GCC and is not limited to
8611 Fortran.  To use this code transformation, GCC has to be configured
8612 with @option{--with-isl} to enable the Graphite loop transformation
8613 infrastructure.
8615 @item -floop-strip-mine
8616 @opindex floop-strip-mine
8617 Perform loop strip mining transformations on loops.  Strip mining
8618 splits a loop into two nested loops.  The outer loop has strides
8619 equal to the strip size and the inner loop has strides of the
8620 original loop within a strip.  The strip length can be changed
8621 using the @option{loop-block-tile-size} parameter.  For example,
8622 given a loop like:
8623 @smallexample
8624 DO I = 1, N
8625   A(I) = A(I) + C
8626 ENDDO
8627 @end smallexample
8628 @noindent
8629 loop strip mining transforms the loop as if it were written:
8630 @smallexample
8631 DO II = 1, N, 51
8632   DO I = II, min (II + 50, N)
8633     A(I) = A(I) + C
8634   ENDDO
8635 ENDDO
8636 @end smallexample
8637 This optimization applies to all the languages supported by GCC and is
8638 not limited to Fortran.  To use this code transformation, GCC has to
8639 be configured with @option{--with-isl} to enable the Graphite loop
8640 transformation infrastructure.
8642 @item -floop-block
8643 @opindex floop-block
8644 Perform loop blocking transformations on loops.  Blocking strip mines
8645 each loop in the loop nest such that the memory accesses of the
8646 element loops fit inside caches.  The strip length can be changed
8647 using the @option{loop-block-tile-size} parameter.  For example, given
8648 a loop like:
8649 @smallexample
8650 DO I = 1, N
8651   DO J = 1, M
8652     A(J, I) = B(I) + C(J)
8653   ENDDO
8654 ENDDO
8655 @end smallexample
8656 @noindent
8657 loop blocking transforms the loop as if it were written:
8658 @smallexample
8659 DO II = 1, N, 51
8660   DO JJ = 1, M, 51
8661     DO I = II, min (II + 50, N)
8662       DO J = JJ, min (JJ + 50, M)
8663         A(J, I) = B(I) + C(J)
8664       ENDDO
8665     ENDDO
8666   ENDDO
8667 ENDDO
8668 @end smallexample
8669 which can be beneficial when @code{M} is larger than the caches,
8670 because the innermost loop iterates over a smaller amount of data
8671 which can be kept in the caches.  This optimization applies to all the
8672 languages supported by GCC and is not limited to Fortran.  To use this
8673 code transformation, GCC has to be configured with @option{--with-isl}
8674 to enable the Graphite loop transformation infrastructure.
8676 @item -fgraphite-identity
8677 @opindex fgraphite-identity
8678 Enable the identity transformation for graphite.  For every SCoP we generate
8679 the polyhedral representation and transform it back to gimple.  Using
8680 @option{-fgraphite-identity} we can check the costs or benefits of the
8681 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
8682 are also performed by the code generator ISL, like index splitting and
8683 dead code elimination in loops.
8685 @item -floop-nest-optimize
8686 @opindex floop-nest-optimize
8687 Enable the ISL based loop nest optimizer.  This is a generic loop nest
8688 optimizer based on the Pluto optimization algorithms.  It calculates a loop
8689 structure optimized for data-locality and parallelism.  This option
8690 is experimental.
8692 @item -floop-unroll-and-jam
8693 @opindex floop-unroll-and-jam
8694 Enable unroll and jam for the ISL based loop nest optimizer.  The unroll 
8695 factor can be changed using the @option{loop-unroll-jam-size} parameter.
8696 The unrolled dimension (counting from the most inner one) can be changed 
8697 using the @option{loop-unroll-jam-depth} parameter.                 .
8699 @item -floop-parallelize-all
8700 @opindex floop-parallelize-all
8701 Use the Graphite data dependence analysis to identify loops that can
8702 be parallelized.  Parallelize all the loops that can be analyzed to
8703 not contain loop carried dependences without checking that it is
8704 profitable to parallelize the loops.
8706 @item -fcheck-data-deps
8707 @opindex fcheck-data-deps
8708 Compare the results of several data dependence analyzers.  This option
8709 is used for debugging the data dependence analyzers.
8711 @item -ftree-loop-if-convert
8712 @opindex ftree-loop-if-convert
8713 Attempt to transform conditional jumps in the innermost loops to
8714 branch-less equivalents.  The intent is to remove control-flow from
8715 the innermost loops in order to improve the ability of the
8716 vectorization pass to handle these loops.  This is enabled by default
8717 if vectorization is enabled.
8719 @item -ftree-loop-if-convert-stores
8720 @opindex ftree-loop-if-convert-stores
8721 Attempt to also if-convert conditional jumps containing memory writes.
8722 This transformation can be unsafe for multi-threaded programs as it
8723 transforms conditional memory writes into unconditional memory writes.
8724 For example,
8725 @smallexample
8726 for (i = 0; i < N; i++)
8727   if (cond)
8728     A[i] = expr;
8729 @end smallexample
8730 is transformed to
8731 @smallexample
8732 for (i = 0; i < N; i++)
8733   A[i] = cond ? expr : A[i];
8734 @end smallexample
8735 potentially producing data races.
8737 @item -ftree-loop-distribution
8738 @opindex ftree-loop-distribution
8739 Perform loop distribution.  This flag can improve cache performance on
8740 big loop bodies and allow further loop optimizations, like
8741 parallelization or vectorization, to take place.  For example, the loop
8742 @smallexample
8743 DO I = 1, N
8744   A(I) = B(I) + C
8745   D(I) = E(I) * F
8746 ENDDO
8747 @end smallexample
8748 is transformed to
8749 @smallexample
8750 DO I = 1, N
8751    A(I) = B(I) + C
8752 ENDDO
8753 DO I = 1, N
8754    D(I) = E(I) * F
8755 ENDDO
8756 @end smallexample
8758 @item -ftree-loop-distribute-patterns
8759 @opindex ftree-loop-distribute-patterns
8760 Perform loop distribution of patterns that can be code generated with
8761 calls to a library.  This flag is enabled by default at @option{-O3}.
8763 This pass distributes the initialization loops and generates a call to
8764 memset zero.  For example, the loop
8765 @smallexample
8766 DO I = 1, N
8767   A(I) = 0
8768   B(I) = A(I) + I
8769 ENDDO
8770 @end smallexample
8771 is transformed to
8772 @smallexample
8773 DO I = 1, N
8774    A(I) = 0
8775 ENDDO
8776 DO I = 1, N
8777    B(I) = A(I) + I
8778 ENDDO
8779 @end smallexample
8780 and the initialization loop is transformed into a call to memset zero.
8782 @item -ftree-loop-im
8783 @opindex ftree-loop-im
8784 Perform loop invariant motion on trees.  This pass moves only invariants that
8785 are hard to handle at RTL level (function calls, operations that expand to
8786 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
8787 operands of conditions that are invariant out of the loop, so that we can use
8788 just trivial invariantness analysis in loop unswitching.  The pass also includes
8789 store motion.
8791 @item -ftree-loop-ivcanon
8792 @opindex ftree-loop-ivcanon
8793 Create a canonical counter for number of iterations in loops for which
8794 determining number of iterations requires complicated analysis.  Later
8795 optimizations then may determine the number easily.  Useful especially
8796 in connection with unrolling.
8798 @item -fivopts
8799 @opindex fivopts
8800 Perform induction variable optimizations (strength reduction, induction
8801 variable merging and induction variable elimination) on trees.
8803 @item -ftree-parallelize-loops=n
8804 @opindex ftree-parallelize-loops
8805 Parallelize loops, i.e., split their iteration space to run in n threads.
8806 This is only possible for loops whose iterations are independent
8807 and can be arbitrarily reordered.  The optimization is only
8808 profitable on multiprocessor machines, for loops that are CPU-intensive,
8809 rather than constrained e.g.@: by memory bandwidth.  This option
8810 implies @option{-pthread}, and thus is only supported on targets
8811 that have support for @option{-pthread}.
8813 @item -ftree-pta
8814 @opindex ftree-pta
8815 Perform function-local points-to analysis on trees.  This flag is
8816 enabled by default at @option{-O} and higher.
8818 @item -ftree-sra
8819 @opindex ftree-sra
8820 Perform scalar replacement of aggregates.  This pass replaces structure
8821 references with scalars to prevent committing structures to memory too
8822 early.  This flag is enabled by default at @option{-O} and higher.
8824 @item -ftree-copyrename
8825 @opindex ftree-copyrename
8826 Perform copy renaming on trees.  This pass attempts to rename compiler
8827 temporaries to other variables at copy locations, usually resulting in
8828 variable names which more closely resemble the original variables.  This flag
8829 is enabled by default at @option{-O} and higher.
8831 @item -ftree-coalesce-inlined-vars
8832 @opindex ftree-coalesce-inlined-vars
8833 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
8834 combine small user-defined variables too, but only if they are inlined
8835 from other functions.  It is a more limited form of
8836 @option{-ftree-coalesce-vars}.  This may harm debug information of such
8837 inlined variables, but it keeps variables of the inlined-into
8838 function apart from each other, such that they are more likely to
8839 contain the expected values in a debugging session.
8841 @item -ftree-coalesce-vars
8842 @opindex ftree-coalesce-vars
8843 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
8844 combine small user-defined variables too, instead of just compiler
8845 temporaries.  This may severely limit the ability to debug an optimized
8846 program compiled with @option{-fno-var-tracking-assignments}.  In the
8847 negated form, this flag prevents SSA coalescing of user variables,
8848 including inlined ones.  This option is enabled by default.
8850 @item -ftree-ter
8851 @opindex ftree-ter
8852 Perform temporary expression replacement during the SSA->normal phase.  Single
8853 use/single def temporaries are replaced at their use location with their
8854 defining expression.  This results in non-GIMPLE code, but gives the expanders
8855 much more complex trees to work on resulting in better RTL generation.  This is
8856 enabled by default at @option{-O} and higher.
8858 @item -ftree-slsr
8859 @opindex ftree-slsr
8860 Perform straight-line strength reduction on trees.  This recognizes related
8861 expressions involving multiplications and replaces them by less expensive
8862 calculations when possible.  This is enabled by default at @option{-O} and
8863 higher.
8865 @item -ftree-vectorize
8866 @opindex ftree-vectorize
8867 Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
8868 and @option{-ftree-slp-vectorize} if not explicitly specified.
8870 @item -ftree-loop-vectorize
8871 @opindex ftree-loop-vectorize
8872 Perform loop vectorization on trees. This flag is enabled by default at
8873 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8875 @item -ftree-slp-vectorize
8876 @opindex ftree-slp-vectorize
8877 Perform basic block vectorization on trees. This flag is enabled by default at
8878 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8880 @item -fvect-cost-model=@var{model}
8881 @opindex fvect-cost-model
8882 Alter the cost model used for vectorization.  The @var{model} argument
8883 should be one of @samp{unlimited}, @samp{dynamic} or @samp{cheap}.
8884 With the @samp{unlimited} model the vectorized code-path is assumed
8885 to be profitable while with the @samp{dynamic} model a runtime check
8886 guards the vectorized code-path to enable it only for iteration
8887 counts that will likely execute faster than when executing the original
8888 scalar loop.  The @samp{cheap} model disables vectorization of
8889 loops where doing so would be cost prohibitive for example due to
8890 required runtime checks for data dependence or alignment but otherwise
8891 is equal to the @samp{dynamic} model.
8892 The default cost model depends on other optimization flags and is
8893 either @samp{dynamic} or @samp{cheap}.
8895 @item -fsimd-cost-model=@var{model}
8896 @opindex fsimd-cost-model
8897 Alter the cost model used for vectorization of loops marked with the OpenMP
8898 or Cilk Plus simd directive.  The @var{model} argument should be one of
8899 @samp{unlimited}, @samp{dynamic}, @samp{cheap}.  All values of @var{model}
8900 have the same meaning as described in @option{-fvect-cost-model} and by
8901 default a cost model defined with @option{-fvect-cost-model} is used.
8903 @item -ftree-vrp
8904 @opindex ftree-vrp
8905 Perform Value Range Propagation on trees.  This is similar to the
8906 constant propagation pass, but instead of values, ranges of values are
8907 propagated.  This allows the optimizers to remove unnecessary range
8908 checks like array bound checks and null pointer checks.  This is
8909 enabled by default at @option{-O2} and higher.  Null pointer check
8910 elimination is only done if @option{-fdelete-null-pointer-checks} is
8911 enabled.
8913 @item -fsplit-ivs-in-unroller
8914 @opindex fsplit-ivs-in-unroller
8915 Enables expression of values of induction variables in later iterations
8916 of the unrolled loop using the value in the first iteration.  This breaks
8917 long dependency chains, thus improving efficiency of the scheduling passes.
8919 A combination of @option{-fweb} and CSE is often sufficient to obtain the
8920 same effect.  However, that is not reliable in cases where the loop body
8921 is more complicated than a single basic block.  It also does not work at all
8922 on some architectures due to restrictions in the CSE pass.
8924 This optimization is enabled by default.
8926 @item -fvariable-expansion-in-unroller
8927 @opindex fvariable-expansion-in-unroller
8928 With this option, the compiler creates multiple copies of some
8929 local variables when unrolling a loop, which can result in superior code.
8931 @item -fpartial-inlining
8932 @opindex fpartial-inlining
8933 Inline parts of functions.  This option has any effect only
8934 when inlining itself is turned on by the @option{-finline-functions}
8935 or @option{-finline-small-functions} options.
8937 Enabled at level @option{-O2}.
8939 @item -fpredictive-commoning
8940 @opindex fpredictive-commoning
8941 Perform predictive commoning optimization, i.e., reusing computations
8942 (especially memory loads and stores) performed in previous
8943 iterations of loops.
8945 This option is enabled at level @option{-O3}.
8947 @item -fprefetch-loop-arrays
8948 @opindex fprefetch-loop-arrays
8949 If supported by the target machine, generate instructions to prefetch
8950 memory to improve the performance of loops that access large arrays.
8952 This option may generate better or worse code; results are highly
8953 dependent on the structure of loops within the source code.
8955 Disabled at level @option{-Os}.
8957 @item -fno-peephole
8958 @itemx -fno-peephole2
8959 @opindex fno-peephole
8960 @opindex fno-peephole2
8961 Disable any machine-specific peephole optimizations.  The difference
8962 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
8963 are implemented in the compiler; some targets use one, some use the
8964 other, a few use both.
8966 @option{-fpeephole} is enabled by default.
8967 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8969 @item -fno-guess-branch-probability
8970 @opindex fno-guess-branch-probability
8971 Do not guess branch probabilities using heuristics.
8973 GCC uses heuristics to guess branch probabilities if they are
8974 not provided by profiling feedback (@option{-fprofile-arcs}).  These
8975 heuristics are based on the control flow graph.  If some branch probabilities
8976 are specified by @code{__builtin_expect}, then the heuristics are
8977 used to guess branch probabilities for the rest of the control flow graph,
8978 taking the @code{__builtin_expect} info into account.  The interactions
8979 between the heuristics and @code{__builtin_expect} can be complex, and in
8980 some cases, it may be useful to disable the heuristics so that the effects
8981 of @code{__builtin_expect} are easier to understand.
8983 The default is @option{-fguess-branch-probability} at levels
8984 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8986 @item -freorder-blocks
8987 @opindex freorder-blocks
8988 Reorder basic blocks in the compiled function in order to reduce number of
8989 taken branches and improve code locality.
8991 Enabled at levels @option{-O2}, @option{-O3}.
8993 @item -freorder-blocks-and-partition
8994 @opindex freorder-blocks-and-partition
8995 In addition to reordering basic blocks in the compiled function, in order
8996 to reduce number of taken branches, partitions hot and cold basic blocks
8997 into separate sections of the assembly and .o files, to improve
8998 paging and cache locality performance.
9000 This optimization is automatically turned off in the presence of
9001 exception handling, for linkonce sections, for functions with a user-defined
9002 section attribute and on any architecture that does not support named
9003 sections.
9005 Enabled for x86 at levels @option{-O2}, @option{-O3}.
9007 @item -freorder-functions
9008 @opindex freorder-functions
9009 Reorder functions in the object file in order to
9010 improve code locality.  This is implemented by using special
9011 subsections @code{.text.hot} for most frequently executed functions and
9012 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
9013 the linker so object file format must support named sections and linker must
9014 place them in a reasonable way.
9016 Also profile feedback must be available to make this option effective.  See
9017 @option{-fprofile-arcs} for details.
9019 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9021 @item -fstrict-aliasing
9022 @opindex fstrict-aliasing
9023 Allow the compiler to assume the strictest aliasing rules applicable to
9024 the language being compiled.  For C (and C++), this activates
9025 optimizations based on the type of expressions.  In particular, an
9026 object of one type is assumed never to reside at the same address as an
9027 object of a different type, unless the types are almost the same.  For
9028 example, an @code{unsigned int} can alias an @code{int}, but not a
9029 @code{void*} or a @code{double}.  A character type may alias any other
9030 type.
9032 @anchor{Type-punning}Pay special attention to code like this:
9033 @smallexample
9034 union a_union @{
9035   int i;
9036   double d;
9039 int f() @{
9040   union a_union t;
9041   t.d = 3.0;
9042   return t.i;
9044 @end smallexample
9045 The practice of reading from a different union member than the one most
9046 recently written to (called ``type-punning'') is common.  Even with
9047 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
9048 is accessed through the union type.  So, the code above works as
9049 expected.  @xref{Structures unions enumerations and bit-fields
9050 implementation}.  However, this code might not:
9051 @smallexample
9052 int f() @{
9053   union a_union t;
9054   int* ip;
9055   t.d = 3.0;
9056   ip = &t.i;
9057   return *ip;
9059 @end smallexample
9061 Similarly, access by taking the address, casting the resulting pointer
9062 and dereferencing the result has undefined behavior, even if the cast
9063 uses a union type, e.g.:
9064 @smallexample
9065 int f() @{
9066   double d = 3.0;
9067   return ((union a_union *) &d)->i;
9069 @end smallexample
9071 The @option{-fstrict-aliasing} option is enabled at levels
9072 @option{-O2}, @option{-O3}, @option{-Os}.
9074 @item -fstrict-overflow
9075 @opindex fstrict-overflow
9076 Allow the compiler to assume strict signed overflow rules, depending
9077 on the language being compiled.  For C (and C++) this means that
9078 overflow when doing arithmetic with signed numbers is undefined, which
9079 means that the compiler may assume that it does not happen.  This
9080 permits various optimizations.  For example, the compiler assumes
9081 that an expression like @code{i + 10 > i} is always true for
9082 signed @code{i}.  This assumption is only valid if signed overflow is
9083 undefined, as the expression is false if @code{i + 10} overflows when
9084 using twos complement arithmetic.  When this option is in effect any
9085 attempt to determine whether an operation on signed numbers 
9086 overflows must be written carefully to not actually involve overflow.
9088 This option also allows the compiler to assume strict pointer
9089 semantics: given a pointer to an object, if adding an offset to that
9090 pointer does not produce a pointer to the same object, the addition is
9091 undefined.  This permits the compiler to conclude that @code{p + u >
9092 p} is always true for a pointer @code{p} and unsigned integer
9093 @code{u}.  This assumption is only valid because pointer wraparound is
9094 undefined, as the expression is false if @code{p + u} overflows using
9095 twos complement arithmetic.
9097 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
9098 that integer signed overflow is fully defined: it wraps.  When
9099 @option{-fwrapv} is used, there is no difference between
9100 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
9101 integers.  With @option{-fwrapv} certain types of overflow are
9102 permitted.  For example, if the compiler gets an overflow when doing
9103 arithmetic on constants, the overflowed value can still be used with
9104 @option{-fwrapv}, but not otherwise.
9106 The @option{-fstrict-overflow} option is enabled at levels
9107 @option{-O2}, @option{-O3}, @option{-Os}.
9109 @item -falign-functions
9110 @itemx -falign-functions=@var{n}
9111 @opindex falign-functions
9112 Align the start of functions to the next power-of-two greater than
9113 @var{n}, skipping up to @var{n} bytes.  For instance,
9114 @option{-falign-functions=32} aligns functions to the next 32-byte
9115 boundary, but @option{-falign-functions=24} aligns to the next
9116 32-byte boundary only if this can be done by skipping 23 bytes or less.
9118 @option{-fno-align-functions} and @option{-falign-functions=1} are
9119 equivalent and mean that functions are not aligned.
9121 Some assemblers only support this flag when @var{n} is a power of two;
9122 in that case, it is rounded up.
9124 If @var{n} is not specified or is zero, use a machine-dependent default.
9126 Enabled at levels @option{-O2}, @option{-O3}.
9128 @item -falign-labels
9129 @itemx -falign-labels=@var{n}
9130 @opindex falign-labels
9131 Align all branch targets to a power-of-two boundary, skipping up to
9132 @var{n} bytes like @option{-falign-functions}.  This option can easily
9133 make code slower, because it must insert dummy operations for when the
9134 branch target is reached in the usual flow of the code.
9136 @option{-fno-align-labels} and @option{-falign-labels=1} are
9137 equivalent and mean that labels are not aligned.
9139 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
9140 are greater than this value, then their values are used instead.
9142 If @var{n} is not specified or is zero, use a machine-dependent default
9143 which is very likely to be @samp{1}, meaning no alignment.
9145 Enabled at levels @option{-O2}, @option{-O3}.
9147 @item -falign-loops
9148 @itemx -falign-loops=@var{n}
9149 @opindex falign-loops
9150 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
9151 like @option{-falign-functions}.  If the loops are
9152 executed many times, this makes up for any execution of the dummy
9153 operations.
9155 @option{-fno-align-loops} and @option{-falign-loops=1} are
9156 equivalent and mean that loops are not aligned.
9158 If @var{n} is not specified or is zero, use a machine-dependent default.
9160 Enabled at levels @option{-O2}, @option{-O3}.
9162 @item -falign-jumps
9163 @itemx -falign-jumps=@var{n}
9164 @opindex falign-jumps
9165 Align branch targets to a power-of-two boundary, for branch targets
9166 where the targets can only be reached by jumping, skipping up to @var{n}
9167 bytes like @option{-falign-functions}.  In this case, no dummy operations
9168 need be executed.
9170 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
9171 equivalent and mean that loops are not aligned.
9173 If @var{n} is not specified or is zero, use a machine-dependent default.
9175 Enabled at levels @option{-O2}, @option{-O3}.
9177 @item -funit-at-a-time
9178 @opindex funit-at-a-time
9179 This option is left for compatibility reasons. @option{-funit-at-a-time}
9180 has no effect, while @option{-fno-unit-at-a-time} implies
9181 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
9183 Enabled by default.
9185 @item -fno-toplevel-reorder
9186 @opindex fno-toplevel-reorder
9187 Do not reorder top-level functions, variables, and @code{asm}
9188 statements.  Output them in the same order that they appear in the
9189 input file.  When this option is used, unreferenced static variables
9190 are not removed.  This option is intended to support existing code
9191 that relies on a particular ordering.  For new code, it is better to
9192 use attributes when possible.
9194 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
9195 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
9196 targets.
9198 @item -fweb
9199 @opindex fweb
9200 Constructs webs as commonly used for register allocation purposes and assign
9201 each web individual pseudo register.  This allows the register allocation pass
9202 to operate on pseudos directly, but also strengthens several other optimization
9203 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
9204 however, make debugging impossible, since variables no longer stay in a
9205 ``home register''.
9207 Enabled by default with @option{-funroll-loops}.
9209 @item -fwhole-program
9210 @opindex fwhole-program
9211 Assume that the current compilation unit represents the whole program being
9212 compiled.  All public functions and variables with the exception of @code{main}
9213 and those merged by attribute @code{externally_visible} become static functions
9214 and in effect are optimized more aggressively by interprocedural optimizers.
9216 This option should not be used in combination with @option{-flto}.
9217 Instead relying on a linker plugin should provide safer and more precise
9218 information.
9220 @item -flto[=@var{n}]
9221 @opindex flto
9222 This option runs the standard link-time optimizer.  When invoked
9223 with source code, it generates GIMPLE (one of GCC's internal
9224 representations) and writes it to special ELF sections in the object
9225 file.  When the object files are linked together, all the function
9226 bodies are read from these ELF sections and instantiated as if they
9227 had been part of the same translation unit.
9229 To use the link-time optimizer, @option{-flto} and optimization
9230 options should be specified at compile time and during the final link.
9231 For example:
9233 @smallexample
9234 gcc -c -O2 -flto foo.c
9235 gcc -c -O2 -flto bar.c
9236 gcc -o myprog -flto -O2 foo.o bar.o
9237 @end smallexample
9239 The first two invocations to GCC save a bytecode representation
9240 of GIMPLE into special ELF sections inside @file{foo.o} and
9241 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
9242 @file{foo.o} and @file{bar.o}, merges the two files into a single
9243 internal image, and compiles the result as usual.  Since both
9244 @file{foo.o} and @file{bar.o} are merged into a single image, this
9245 causes all the interprocedural analyses and optimizations in GCC to
9246 work across the two files as if they were a single one.  This means,
9247 for example, that the inliner is able to inline functions in
9248 @file{bar.o} into functions in @file{foo.o} and vice-versa.
9250 Another (simpler) way to enable link-time optimization is:
9252 @smallexample
9253 gcc -o myprog -flto -O2 foo.c bar.c
9254 @end smallexample
9256 The above generates bytecode for @file{foo.c} and @file{bar.c},
9257 merges them together into a single GIMPLE representation and optimizes
9258 them as usual to produce @file{myprog}.
9260 The only important thing to keep in mind is that to enable link-time
9261 optimizations you need to use the GCC driver to perform the link-step.
9262 GCC then automatically performs link-time optimization if any of the
9263 objects involved were compiled with the @option{-flto} command-line option.  
9264 You generally
9265 should specify the optimization options to be used for link-time
9266 optimization though GCC tries to be clever at guessing an
9267 optimization level to use from the options used at compile-time
9268 if you fail to specify one at link-time.  You can always override
9269 the automatic decision to do link-time optimization at link-time
9270 by passing @option{-fno-lto} to the link command.
9272 To make whole program optimization effective, it is necessary to make
9273 certain whole program assumptions.  The compiler needs to know
9274 what functions and variables can be accessed by libraries and runtime
9275 outside of the link-time optimized unit.  When supported by the linker,
9276 the linker plugin (see @option{-fuse-linker-plugin}) passes information
9277 to the compiler about used and externally visible symbols.  When
9278 the linker plugin is not available, @option{-fwhole-program} should be
9279 used to allow the compiler to make these assumptions, which leads
9280 to more aggressive optimization decisions.
9282 When @option{-fuse-linker-plugin} is not enabled then, when a file is
9283 compiled with @option{-flto}, the generated object file is larger than
9284 a regular object file because it contains GIMPLE bytecodes and the usual
9285 final code (see @option{-ffat-lto-objects}.  This means that
9286 object files with LTO information can be linked as normal object
9287 files; if @option{-fno-lto} is passed to the linker, no
9288 interprocedural optimizations are applied.  Note that when
9289 @option{-fno-fat-lto-objects} is enabled the compile-stage is faster
9290 but you cannot perform a regular, non-LTO link on them.
9292 Additionally, the optimization flags used to compile individual files
9293 are not necessarily related to those used at link time.  For instance,
9295 @smallexample
9296 gcc -c -O0 -ffat-lto-objects -flto foo.c
9297 gcc -c -O0 -ffat-lto-objects -flto bar.c
9298 gcc -o myprog -O3 foo.o bar.o
9299 @end smallexample
9301 This produces individual object files with unoptimized assembler
9302 code, but the resulting binary @file{myprog} is optimized at
9303 @option{-O3}.  If, instead, the final binary is generated with
9304 @option{-fno-lto}, then @file{myprog} is not optimized.
9306 When producing the final binary, GCC only
9307 applies link-time optimizations to those files that contain bytecode.
9308 Therefore, you can mix and match object files and libraries with
9309 GIMPLE bytecodes and final object code.  GCC automatically selects
9310 which files to optimize in LTO mode and which files to link without
9311 further processing.
9313 There are some code generation flags preserved by GCC when
9314 generating bytecodes, as they need to be used during the final link
9315 stage.  Generally options specified at link-time override those
9316 specified at compile-time.
9318 If you do not specify an optimization level option @option{-O} at
9319 link-time then GCC computes one based on the optimization levels
9320 used when compiling the object files.  The highest optimization
9321 level wins here.
9323 Currently, the following options and their setting are take from
9324 the first object file that explicitely specified it: 
9325 @option{-fPIC}, @option{-fpic}, @option{-fpie}, @option{-fcommon},
9326 @option{-fexceptions}, @option{-fnon-call-exceptions}, @option{-fgnu-tm}
9327 and all the @option{-m} target flags.
9329 Certain ABI changing flags are required to match in all compilation-units
9330 and trying to override this at link-time with a conflicting value
9331 is ignored.  This includes options such as @option{-freg-struct-return}
9332 and @option{-fpcc-struct-return}. 
9334 Other options such as @option{-ffp-contract}, @option{-fno-strict-overflow},
9335 @option{-fwrapv}, @option{-fno-trapv} or @option{-fno-strict-aliasing}
9336 are passed through to the link stage and merged conservatively for
9337 conflicting translation units.  Specifically
9338 @option{-fno-strict-overflow}, @option{-fwrapv} and @option{-fno-trapv} take
9339 precedence and for example @option{-ffp-contract=off} takes precedence
9340 over @option{-ffp-contract=fast}.  You can override them at linke-time.
9342 It is recommended that you compile all the files participating in the
9343 same link with the same options and also specify those options at
9344 link time.
9346 If LTO encounters objects with C linkage declared with incompatible
9347 types in separate translation units to be linked together (undefined
9348 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
9349 issued.  The behavior is still undefined at run time.  Similar
9350 diagnostics may be raised for other languages.
9352 Another feature of LTO is that it is possible to apply interprocedural
9353 optimizations on files written in different languages:
9355 @smallexample
9356 gcc -c -flto foo.c
9357 g++ -c -flto bar.cc
9358 gfortran -c -flto baz.f90
9359 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
9360 @end smallexample
9362 Notice that the final link is done with @command{g++} to get the C++
9363 runtime libraries and @option{-lgfortran} is added to get the Fortran
9364 runtime libraries.  In general, when mixing languages in LTO mode, you
9365 should use the same link command options as when mixing languages in a
9366 regular (non-LTO) compilation.
9368 If object files containing GIMPLE bytecode are stored in a library archive, say
9369 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
9370 are using a linker with plugin support.  To create static libraries suitable
9371 for LTO, use @command{gcc-ar} and @command{gcc-ranlib} instead of @command{ar}
9372 and @command{ranlib}; 
9373 to show the symbols of object files with GIMPLE bytecode, use
9374 @command{gcc-nm}.  Those commands require that @command{ar}, @command{ranlib}
9375 and @command{nm} have been compiled with plugin support.  At link time, use the the
9376 flag @option{-fuse-linker-plugin} to ensure that the library participates in
9377 the LTO optimization process:
9379 @smallexample
9380 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
9381 @end smallexample
9383 With the linker plugin enabled, the linker extracts the needed
9384 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
9385 to make them part of the aggregated GIMPLE image to be optimized.
9387 If you are not using a linker with plugin support and/or do not
9388 enable the linker plugin, then the objects inside @file{libfoo.a}
9389 are extracted and linked as usual, but they do not participate
9390 in the LTO optimization process.  In order to make a static library suitable
9391 for both LTO optimization and usual linkage, compile its object files with
9392 @option{-flto} @option{-ffat-lto-objects}.
9394 Link-time optimizations do not require the presence of the whole program to
9395 operate.  If the program does not require any symbols to be exported, it is
9396 possible to combine @option{-flto} and @option{-fwhole-program} to allow
9397 the interprocedural optimizers to use more aggressive assumptions which may
9398 lead to improved optimization opportunities.
9399 Use of @option{-fwhole-program} is not needed when linker plugin is
9400 active (see @option{-fuse-linker-plugin}).
9402 The current implementation of LTO makes no
9403 attempt to generate bytecode that is portable between different
9404 types of hosts.  The bytecode files are versioned and there is a
9405 strict version check, so bytecode files generated in one version of
9406 GCC do not work with an older or newer version of GCC.
9408 Link-time optimization does not work well with generation of debugging
9409 information.  Combining @option{-flto} with
9410 @option{-g} is currently experimental and expected to produce unexpected
9411 results.
9413 If you specify the optional @var{n}, the optimization and code
9414 generation done at link time is executed in parallel using @var{n}
9415 parallel jobs by utilizing an installed @command{make} program.  The
9416 environment variable @env{MAKE} may be used to override the program
9417 used.  The default value for @var{n} is 1.
9419 You can also specify @option{-flto=jobserver} to use GNU make's
9420 job server mode to determine the number of parallel jobs. This
9421 is useful when the Makefile calling GCC is already executing in parallel.
9422 You must prepend a @samp{+} to the command recipe in the parent Makefile
9423 for this to work.  This option likely only works if @env{MAKE} is
9424 GNU make.
9426 @item -flto-partition=@var{alg}
9427 @opindex flto-partition
9428 Specify the partitioning algorithm used by the link-time optimizer.
9429 The value is either @samp{1to1} to specify a partitioning mirroring
9430 the original source files or @samp{balanced} to specify partitioning
9431 into equally sized chunks (whenever possible) or @samp{max} to create
9432 new partition for every symbol where possible.  Specifying @samp{none}
9433 as an algorithm disables partitioning and streaming completely. 
9434 The default value is @samp{balanced}. While @samp{1to1} can be used
9435 as an workaround for various code ordering issues, the @samp{max}
9436 partitioning is intended for internal testing only.
9437 The value @samp{one} specifies that exactly one partition should be
9438 used while the value @samp{none} bypasses partitioning and executes
9439 the link-time optimization step directly from the WPA phase.
9441 @item -flto-odr-type-merging
9442 @opindex flto-odr-type-merging
9443 Enable streaming of mangled types names of C++ types and their unification
9444 at linktime.  This increases size of LTO object files, but enable
9445 diagnostics about One Definition Rule violations.
9447 @item -flto-compression-level=@var{n}
9448 @opindex flto-compression-level
9449 This option specifies the level of compression used for intermediate
9450 language written to LTO object files, and is only meaningful in
9451 conjunction with LTO mode (@option{-flto}).  Valid
9452 values are 0 (no compression) to 9 (maximum compression).  Values
9453 outside this range are clamped to either 0 or 9.  If the option is not
9454 given, a default balanced compression setting is used.
9456 @item -flto-report
9457 @opindex flto-report
9458 Prints a report with internal details on the workings of the link-time
9459 optimizer.  The contents of this report vary from version to version.
9460 It is meant to be useful to GCC developers when processing object
9461 files in LTO mode (via @option{-flto}).
9463 Disabled by default.
9465 @item -flto-report-wpa
9466 @opindex flto-report-wpa
9467 Like @option{-flto-report}, but only print for the WPA phase of Link
9468 Time Optimization.
9470 @item -fuse-linker-plugin
9471 @opindex fuse-linker-plugin
9472 Enables the use of a linker plugin during link-time optimization.  This
9473 option relies on plugin support in the linker, which is available in gold
9474 or in GNU ld 2.21 or newer.
9476 This option enables the extraction of object files with GIMPLE bytecode out
9477 of library archives. This improves the quality of optimization by exposing
9478 more code to the link-time optimizer.  This information specifies what
9479 symbols can be accessed externally (by non-LTO object or during dynamic
9480 linking).  Resulting code quality improvements on binaries (and shared
9481 libraries that use hidden visibility) are similar to @option{-fwhole-program}.
9482 See @option{-flto} for a description of the effect of this flag and how to
9483 use it.
9485 This option is enabled by default when LTO support in GCC is enabled
9486 and GCC was configured for use with
9487 a linker supporting plugins (GNU ld 2.21 or newer or gold).
9489 @item -ffat-lto-objects
9490 @opindex ffat-lto-objects
9491 Fat LTO objects are object files that contain both the intermediate language
9492 and the object code. This makes them usable for both LTO linking and normal
9493 linking. This option is effective only when compiling with @option{-flto}
9494 and is ignored at link time.
9496 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
9497 requires the complete toolchain to be aware of LTO. It requires a linker with
9498 linker plugin support for basic functionality.  Additionally,
9499 @command{nm}, @command{ar} and @command{ranlib}
9500 need to support linker plugins to allow a full-featured build environment
9501 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
9502 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
9503 to these tools. With non fat LTO makefiles need to be modified to use them.
9505 The default is @option{-fno-fat-lto-objects} on targets with linker plugin
9506 support.
9508 @item -fcompare-elim
9509 @opindex fcompare-elim
9510 After register allocation and post-register allocation instruction splitting,
9511 identify arithmetic instructions that compute processor flags similar to a
9512 comparison operation based on that arithmetic.  If possible, eliminate the
9513 explicit comparison operation.
9515 This pass only applies to certain targets that cannot explicitly represent
9516 the comparison operation before register allocation is complete.
9518 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9520 @item -fcprop-registers
9521 @opindex fcprop-registers
9522 After register allocation and post-register allocation instruction splitting,
9523 perform a copy-propagation pass to try to reduce scheduling dependencies
9524 and occasionally eliminate the copy.
9526 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9528 @item -fprofile-correction
9529 @opindex fprofile-correction
9530 Profiles collected using an instrumented binary for multi-threaded programs may
9531 be inconsistent due to missed counter updates. When this option is specified,
9532 GCC uses heuristics to correct or smooth out such inconsistencies. By
9533 default, GCC emits an error message when an inconsistent profile is detected.
9535 @item -fprofile-dir=@var{path}
9536 @opindex fprofile-dir
9538 Set the directory to search for the profile data files in to @var{path}.
9539 This option affects only the profile data generated by
9540 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
9541 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
9542 and its related options.  Both absolute and relative paths can be used.
9543 By default, GCC uses the current directory as @var{path}, thus the
9544 profile data file appears in the same directory as the object file.
9546 @item -fprofile-generate
9547 @itemx -fprofile-generate=@var{path}
9548 @opindex fprofile-generate
9550 Enable options usually used for instrumenting application to produce
9551 profile useful for later recompilation with profile feedback based
9552 optimization.  You must use @option{-fprofile-generate} both when
9553 compiling and when linking your program.
9555 The following options are enabled: @option{-fprofile-arcs}, @option{-fprofile-values}, @option{-fvpt}.
9557 If @var{path} is specified, GCC looks at the @var{path} to find
9558 the profile feedback data files. See @option{-fprofile-dir}.
9560 @item -fprofile-use
9561 @itemx -fprofile-use=@var{path}
9562 @opindex fprofile-use
9563 Enable profile feedback-directed optimizations, 
9564 and the following optimizations
9565 which are generally profitable only with profile feedback available:
9566 @option{-fbranch-probabilities}, @option{-fvpt},
9567 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
9568 @option{-ftree-vectorize}, and @option{ftree-loop-distribute-patterns}.
9570 By default, GCC emits an error message if the feedback profiles do not
9571 match the source code.  This error can be turned into a warning by using
9572 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
9573 code.
9575 If @var{path} is specified, GCC looks at the @var{path} to find
9576 the profile feedback data files. See @option{-fprofile-dir}.
9578 @item -fauto-profile
9579 @itemx -fauto-profile=@var{path}
9580 @opindex fauto-profile
9581 Enable sampling-based feedback-directed optimizations, 
9582 and the following optimizations
9583 which are generally profitable only with profile feedback available:
9584 @option{-fbranch-probabilities}, @option{-fvpt},
9585 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
9586 @option{-ftree-vectorize},
9587 @option{-finline-functions}, @option{-fipa-cp}, @option{-fipa-cp-clone},
9588 @option{-fpredictive-commoning}, @option{-funswitch-loops},
9589 @option{-fgcse-after-reload}, and @option{-ftree-loop-distribute-patterns}.
9591 @var{path} is the name of a file containing AutoFDO profile information.
9592 If omitted, it defaults to @file{fbdata.afdo} in the current directory.
9594 Producing an AutoFDO profile data file requires running your program
9595 with the @command{perf} utility on a supported GNU/Linux target system.
9596 For more information, see @uref{https://perf.wiki.kernel.org/}.
9598 E.g.
9599 @smallexample
9600 perf record -e br_inst_retired:near_taken -b -o perf.data \
9601     -- your_program
9602 @end smallexample
9604 Then use the @command{create_gcov} tool to convert the raw profile data
9605 to a format that can be used by GCC.@  You must also supply the 
9606 unstripped binary for your program to this tool.  
9607 See @uref{https://github.com/google/autofdo}.
9609 E.g.
9610 @smallexample
9611 create_gcov --binary=your_program.unstripped --profile=perf.data \
9612     --gcov=profile.afdo
9613 @end smallexample
9614 @end table
9616 The following options control compiler behavior regarding floating-point 
9617 arithmetic.  These options trade off between speed and
9618 correctness.  All must be specifically enabled.
9620 @table @gcctabopt
9621 @item -ffloat-store
9622 @opindex ffloat-store
9623 Do not store floating-point variables in registers, and inhibit other
9624 options that might change whether a floating-point value is taken from a
9625 register or memory.
9627 @cindex floating-point precision
9628 This option prevents undesirable excess precision on machines such as
9629 the 68000 where the floating registers (of the 68881) keep more
9630 precision than a @code{double} is supposed to have.  Similarly for the
9631 x86 architecture.  For most programs, the excess precision does only
9632 good, but a few programs rely on the precise definition of IEEE floating
9633 point.  Use @option{-ffloat-store} for such programs, after modifying
9634 them to store all pertinent intermediate computations into variables.
9636 @item -fexcess-precision=@var{style}
9637 @opindex fexcess-precision
9638 This option allows further control over excess precision on machines
9639 where floating-point registers have more precision than the IEEE
9640 @code{float} and @code{double} types and the processor does not
9641 support operations rounding to those types.  By default,
9642 @option{-fexcess-precision=fast} is in effect; this means that
9643 operations are carried out in the precision of the registers and that
9644 it is unpredictable when rounding to the types specified in the source
9645 code takes place.  When compiling C, if
9646 @option{-fexcess-precision=standard} is specified then excess
9647 precision follows the rules specified in ISO C99; in particular,
9648 both casts and assignments cause values to be rounded to their
9649 semantic types (whereas @option{-ffloat-store} only affects
9650 assignments).  This option is enabled by default for C if a strict
9651 conformance option such as @option{-std=c99} is used.
9653 @opindex mfpmath
9654 @option{-fexcess-precision=standard} is not implemented for languages
9655 other than C, and has no effect if
9656 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
9657 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
9658 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
9659 semantics apply without excess precision, and in the latter, rounding
9660 is unpredictable.
9662 @item -ffast-math
9663 @opindex ffast-math
9664 Sets the options @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
9665 @option{-ffinite-math-only}, @option{-fno-rounding-math},
9666 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
9668 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
9670 This option is not turned on by any @option{-O} option besides
9671 @option{-Ofast} since it can result in incorrect output for programs
9672 that depend on an exact implementation of IEEE or ISO rules/specifications
9673 for math functions. It may, however, yield faster code for programs
9674 that do not require the guarantees of these specifications.
9676 @item -fno-math-errno
9677 @opindex fno-math-errno
9678 Do not set @code{errno} after calling math functions that are executed
9679 with a single instruction, e.g., @code{sqrt}.  A program that relies on
9680 IEEE exceptions for math error handling may want to use this flag
9681 for speed while maintaining IEEE arithmetic compatibility.
9683 This option is not turned on by any @option{-O} option since
9684 it can result in incorrect output for programs that depend on
9685 an exact implementation of IEEE or ISO rules/specifications for
9686 math functions. It may, however, yield faster code for programs
9687 that do not require the guarantees of these specifications.
9689 The default is @option{-fmath-errno}.
9691 On Darwin systems, the math library never sets @code{errno}.  There is
9692 therefore no reason for the compiler to consider the possibility that
9693 it might, and @option{-fno-math-errno} is the default.
9695 @item -funsafe-math-optimizations
9696 @opindex funsafe-math-optimizations
9698 Allow optimizations for floating-point arithmetic that (a) assume
9699 that arguments and results are valid and (b) may violate IEEE or
9700 ANSI standards.  When used at link-time, it may include libraries
9701 or startup files that change the default FPU control word or other
9702 similar optimizations.
9704 This option is not turned on by any @option{-O} option since
9705 it can result in incorrect output for programs that depend on
9706 an exact implementation of IEEE or ISO rules/specifications for
9707 math functions. It may, however, yield faster code for programs
9708 that do not require the guarantees of these specifications.
9709 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
9710 @option{-fassociative-math} and @option{-freciprocal-math}.
9712 The default is @option{-fno-unsafe-math-optimizations}.
9714 @item -fassociative-math
9715 @opindex fassociative-math
9717 Allow re-association of operands in series of floating-point operations.
9718 This violates the ISO C and C++ language standard by possibly changing
9719 computation result.  NOTE: re-ordering may change the sign of zero as
9720 well as ignore NaNs and inhibit or create underflow or overflow (and
9721 thus cannot be used on code that relies on rounding behavior like
9722 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
9723 and thus may not be used when ordered comparisons are required.
9724 This option requires that both @option{-fno-signed-zeros} and
9725 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
9726 much sense with @option{-frounding-math}. For Fortran the option
9727 is automatically enabled when both @option{-fno-signed-zeros} and
9728 @option{-fno-trapping-math} are in effect.
9730 The default is @option{-fno-associative-math}.
9732 @item -freciprocal-math
9733 @opindex freciprocal-math
9735 Allow the reciprocal of a value to be used instead of dividing by
9736 the value if this enables optimizations.  For example @code{x / y}
9737 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
9738 is subject to common subexpression elimination.  Note that this loses
9739 precision and increases the number of flops operating on the value.
9741 The default is @option{-fno-reciprocal-math}.
9743 @item -ffinite-math-only
9744 @opindex ffinite-math-only
9745 Allow optimizations for floating-point arithmetic that assume
9746 that arguments and results are not NaNs or +-Infs.
9748 This option is not turned on by any @option{-O} option since
9749 it can result in incorrect output for programs that depend on
9750 an exact implementation of IEEE or ISO rules/specifications for
9751 math functions. It may, however, yield faster code for programs
9752 that do not require the guarantees of these specifications.
9754 The default is @option{-fno-finite-math-only}.
9756 @item -fno-signed-zeros
9757 @opindex fno-signed-zeros
9758 Allow optimizations for floating-point arithmetic that ignore the
9759 signedness of zero.  IEEE arithmetic specifies the behavior of
9760 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
9761 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
9762 This option implies that the sign of a zero result isn't significant.
9764 The default is @option{-fsigned-zeros}.
9766 @item -fno-trapping-math
9767 @opindex fno-trapping-math
9768 Compile code assuming that floating-point operations cannot generate
9769 user-visible traps.  These traps include division by zero, overflow,
9770 underflow, inexact result and invalid operation.  This option requires
9771 that @option{-fno-signaling-nans} be in effect.  Setting this option may
9772 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
9774 This option should never be turned on by any @option{-O} option since
9775 it can result in incorrect output for programs that depend on
9776 an exact implementation of IEEE or ISO rules/specifications for
9777 math functions.
9779 The default is @option{-ftrapping-math}.
9781 @item -frounding-math
9782 @opindex frounding-math
9783 Disable transformations and optimizations that assume default floating-point
9784 rounding behavior.  This is round-to-zero for all floating point
9785 to integer conversions, and round-to-nearest for all other arithmetic
9786 truncations.  This option should be specified for programs that change
9787 the FP rounding mode dynamically, or that may be executed with a
9788 non-default rounding mode.  This option disables constant folding of
9789 floating-point expressions at compile time (which may be affected by
9790 rounding mode) and arithmetic transformations that are unsafe in the
9791 presence of sign-dependent rounding modes.
9793 The default is @option{-fno-rounding-math}.
9795 This option is experimental and does not currently guarantee to
9796 disable all GCC optimizations that are affected by rounding mode.
9797 Future versions of GCC may provide finer control of this setting
9798 using C99's @code{FENV_ACCESS} pragma.  This command-line option
9799 will be used to specify the default state for @code{FENV_ACCESS}.
9801 @item -fsignaling-nans
9802 @opindex fsignaling-nans
9803 Compile code assuming that IEEE signaling NaNs may generate user-visible
9804 traps during floating-point operations.  Setting this option disables
9805 optimizations that may change the number of exceptions visible with
9806 signaling NaNs.  This option implies @option{-ftrapping-math}.
9808 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
9809 be defined.
9811 The default is @option{-fno-signaling-nans}.
9813 This option is experimental and does not currently guarantee to
9814 disable all GCC optimizations that affect signaling NaN behavior.
9816 @item -fsingle-precision-constant
9817 @opindex fsingle-precision-constant
9818 Treat floating-point constants as single precision instead of
9819 implicitly converting them to double-precision constants.
9821 @item -fcx-limited-range
9822 @opindex fcx-limited-range
9823 When enabled, this option states that a range reduction step is not
9824 needed when performing complex division.  Also, there is no checking
9825 whether the result of a complex multiplication or division is @code{NaN
9826 + I*NaN}, with an attempt to rescue the situation in that case.  The
9827 default is @option{-fno-cx-limited-range}, but is enabled by
9828 @option{-ffast-math}.
9830 This option controls the default setting of the ISO C99
9831 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
9832 all languages.
9834 @item -fcx-fortran-rules
9835 @opindex fcx-fortran-rules
9836 Complex multiplication and division follow Fortran rules.  Range
9837 reduction is done as part of complex division, but there is no checking
9838 whether the result of a complex multiplication or division is @code{NaN
9839 + I*NaN}, with an attempt to rescue the situation in that case.
9841 The default is @option{-fno-cx-fortran-rules}.
9843 @end table
9845 The following options control optimizations that may improve
9846 performance, but are not enabled by any @option{-O} options.  This
9847 section includes experimental options that may produce broken code.
9849 @table @gcctabopt
9850 @item -fbranch-probabilities
9851 @opindex fbranch-probabilities
9852 After running a program compiled with @option{-fprofile-arcs}
9853 (@pxref{Debugging Options,, Options for Debugging Your Program or
9854 @command{gcc}}), you can compile it a second time using
9855 @option{-fbranch-probabilities}, to improve optimizations based on
9856 the number of times each branch was taken.  When a program
9857 compiled with @option{-fprofile-arcs} exits, it saves arc execution
9858 counts to a file called @file{@var{sourcename}.gcda} for each source
9859 file.  The information in this data file is very dependent on the
9860 structure of the generated code, so you must use the same source code
9861 and the same optimization options for both compilations.
9863 With @option{-fbranch-probabilities}, GCC puts a
9864 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
9865 These can be used to improve optimization.  Currently, they are only
9866 used in one place: in @file{reorg.c}, instead of guessing which path a
9867 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
9868 exactly determine which path is taken more often.
9870 @item -fprofile-values
9871 @opindex fprofile-values
9872 If combined with @option{-fprofile-arcs}, it adds code so that some
9873 data about values of expressions in the program is gathered.
9875 With @option{-fbranch-probabilities}, it reads back the data gathered
9876 from profiling values of expressions for usage in optimizations.
9878 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
9880 @item -fprofile-reorder-functions
9881 @opindex fprofile-reorder-functions
9882 Function reordering based on profile instrumentation collects
9883 first time of execution of a function and orders these functions
9884 in ascending order.
9886 Enabled with @option{-fprofile-use}.
9888 @item -fvpt
9889 @opindex fvpt
9890 If combined with @option{-fprofile-arcs}, this option instructs the compiler
9891 to add code to gather information about values of expressions.
9893 With @option{-fbranch-probabilities}, it reads back the data gathered
9894 and actually performs the optimizations based on them.
9895 Currently the optimizations include specialization of division operations
9896 using the knowledge about the value of the denominator.
9898 @item -frename-registers
9899 @opindex frename-registers
9900 Attempt to avoid false dependencies in scheduled code by making use
9901 of registers left over after register allocation.  This optimization
9902 most benefits processors with lots of registers.  Depending on the
9903 debug information format adopted by the target, however, it can
9904 make debugging impossible, since variables no longer stay in
9905 a ``home register''.
9907 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
9909 @item -fschedule-fusion
9910 @opindex fschedule-fusion
9911 Performs a target dependent pass over the instruction stream to schedule
9912 instructions of same type together because target machine can execute them
9913 more efficiently if they are adjacent to each other in the instruction flow.
9915 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9917 @item -ftracer
9918 @opindex ftracer
9919 Perform tail duplication to enlarge superblock size.  This transformation
9920 simplifies the control flow of the function allowing other optimizations to do
9921 a better job.
9923 Enabled with @option{-fprofile-use}.
9925 @item -funroll-loops
9926 @opindex funroll-loops
9927 Unroll loops whose number of iterations can be determined at compile time or
9928 upon entry to the loop.  @option{-funroll-loops} implies
9929 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
9930 It also turns on complete loop peeling (i.e.@: complete removal of loops with
9931 a small constant number of iterations).  This option makes code larger, and may
9932 or may not make it run faster.
9934 Enabled with @option{-fprofile-use}.
9936 @item -funroll-all-loops
9937 @opindex funroll-all-loops
9938 Unroll all loops, even if their number of iterations is uncertain when
9939 the loop is entered.  This usually makes programs run more slowly.
9940 @option{-funroll-all-loops} implies the same options as
9941 @option{-funroll-loops}.
9943 @item -fpeel-loops
9944 @opindex fpeel-loops
9945 Peels loops for which there is enough information that they do not
9946 roll much (from profile feedback).  It also turns on complete loop peeling
9947 (i.e.@: complete removal of loops with small constant number of iterations).
9949 Enabled with @option{-fprofile-use}.
9951 @item -fmove-loop-invariants
9952 @opindex fmove-loop-invariants
9953 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
9954 at level @option{-O1}
9956 @item -funswitch-loops
9957 @opindex funswitch-loops
9958 Move branches with loop invariant conditions out of the loop, with duplicates
9959 of the loop on both branches (modified according to result of the condition).
9961 @item -ffunction-sections
9962 @itemx -fdata-sections
9963 @opindex ffunction-sections
9964 @opindex fdata-sections
9965 Place each function or data item into its own section in the output
9966 file if the target supports arbitrary sections.  The name of the
9967 function or the name of the data item determines the section's name
9968 in the output file.
9970 Use these options on systems where the linker can perform optimizations
9971 to improve locality of reference in the instruction space.  Most systems
9972 using the ELF object format and SPARC processors running Solaris 2 have
9973 linkers with such optimizations.  AIX may have these optimizations in
9974 the future.
9976 Only use these options when there are significant benefits from doing
9977 so.  When you specify these options, the assembler and linker
9978 create larger object and executable files and are also slower.
9979 You cannot use @command{gprof} on all systems if you
9980 specify this option, and you may have problems with debugging if
9981 you specify both this option and @option{-g}.
9983 @item -fbranch-target-load-optimize
9984 @opindex fbranch-target-load-optimize
9985 Perform branch target register load optimization before prologue / epilogue
9986 threading.
9987 The use of target registers can typically be exposed only during reload,
9988 thus hoisting loads out of loops and doing inter-block scheduling needs
9989 a separate optimization pass.
9991 @item -fbranch-target-load-optimize2
9992 @opindex fbranch-target-load-optimize2
9993 Perform branch target register load optimization after prologue / epilogue
9994 threading.
9996 @item -fbtr-bb-exclusive
9997 @opindex fbtr-bb-exclusive
9998 When performing branch target register load optimization, don't reuse
9999 branch target registers within any basic block.
10001 @item -fstack-protector
10002 @opindex fstack-protector
10003 Emit extra code to check for buffer overflows, such as stack smashing
10004 attacks.  This is done by adding a guard variable to functions with
10005 vulnerable objects.  This includes functions that call @code{alloca}, and
10006 functions with buffers larger than 8 bytes.  The guards are initialized
10007 when a function is entered and then checked when the function exits.
10008 If a guard check fails, an error message is printed and the program exits.
10010 @item -fstack-protector-all
10011 @opindex fstack-protector-all
10012 Like @option{-fstack-protector} except that all functions are protected.
10014 @item -fstack-protector-strong
10015 @opindex fstack-protector-strong
10016 Like @option{-fstack-protector} but includes additional functions to
10017 be protected --- those that have local array definitions, or have
10018 references to local frame addresses.
10020 @item -fstack-protector-explicit
10021 @opindex fstack-protector-explicit
10022 Like @option{-fstack-protector} but only protects those functions which
10023 have the @code{stack_protect} attribute
10025 @item -fstdarg-opt
10026 @opindex fstdarg-opt
10027 Optimize the prologue of variadic argument functions with respect to usage of
10028 those arguments.
10030 @item -fsection-anchors
10031 @opindex fsection-anchors
10032 Try to reduce the number of symbolic address calculations by using
10033 shared ``anchor'' symbols to address nearby objects.  This transformation
10034 can help to reduce the number of GOT entries and GOT accesses on some
10035 targets.
10037 For example, the implementation of the following function @code{foo}:
10039 @smallexample
10040 static int a, b, c;
10041 int foo (void) @{ return a + b + c; @}
10042 @end smallexample
10044 @noindent
10045 usually calculates the addresses of all three variables, but if you
10046 compile it with @option{-fsection-anchors}, it accesses the variables
10047 from a common anchor point instead.  The effect is similar to the
10048 following pseudocode (which isn't valid C):
10050 @smallexample
10051 int foo (void)
10053   register int *xr = &x;
10054   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
10056 @end smallexample
10058 Not all targets support this option.
10060 @item --param @var{name}=@var{value}
10061 @opindex param
10062 In some places, GCC uses various constants to control the amount of
10063 optimization that is done.  For example, GCC does not inline functions
10064 that contain more than a certain number of instructions.  You can
10065 control some of these constants on the command line using the
10066 @option{--param} option.
10068 The names of specific parameters, and the meaning of the values, are
10069 tied to the internals of the compiler, and are subject to change
10070 without notice in future releases.
10072 In each case, the @var{value} is an integer.  The allowable choices for
10073 @var{name} are:
10075 @table @gcctabopt
10076 @item predictable-branch-outcome
10077 When branch is predicted to be taken with probability lower than this threshold
10078 (in percent), then it is considered well predictable. The default is 10.
10080 @item max-crossjump-edges
10081 The maximum number of incoming edges to consider for cross-jumping.
10082 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
10083 the number of edges incoming to each block.  Increasing values mean
10084 more aggressive optimization, making the compilation time increase with
10085 probably small improvement in executable size.
10087 @item min-crossjump-insns
10088 The minimum number of instructions that must be matched at the end
10089 of two blocks before cross-jumping is performed on them.  This
10090 value is ignored in the case where all instructions in the block being
10091 cross-jumped from are matched.  The default value is 5.
10093 @item max-grow-copy-bb-insns
10094 The maximum code size expansion factor when copying basic blocks
10095 instead of jumping.  The expansion is relative to a jump instruction.
10096 The default value is 8.
10098 @item max-goto-duplication-insns
10099 The maximum number of instructions to duplicate to a block that jumps
10100 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
10101 passes, GCC factors computed gotos early in the compilation process,
10102 and unfactors them as late as possible.  Only computed jumps at the
10103 end of a basic blocks with no more than max-goto-duplication-insns are
10104 unfactored.  The default value is 8.
10106 @item max-delay-slot-insn-search
10107 The maximum number of instructions to consider when looking for an
10108 instruction to fill a delay slot.  If more than this arbitrary number of
10109 instructions are searched, the time savings from filling the delay slot
10110 are minimal, so stop searching.  Increasing values mean more
10111 aggressive optimization, making the compilation time increase with probably
10112 small improvement in execution time.
10114 @item max-delay-slot-live-search
10115 When trying to fill delay slots, the maximum number of instructions to
10116 consider when searching for a block with valid live register
10117 information.  Increasing this arbitrarily chosen value means more
10118 aggressive optimization, increasing the compilation time.  This parameter
10119 should be removed when the delay slot code is rewritten to maintain the
10120 control-flow graph.
10122 @item max-gcse-memory
10123 The approximate maximum amount of memory that can be allocated in
10124 order to perform the global common subexpression elimination
10125 optimization.  If more memory than specified is required, the
10126 optimization is not done.
10128 @item max-gcse-insertion-ratio
10129 If the ratio of expression insertions to deletions is larger than this value
10130 for any expression, then RTL PRE inserts or removes the expression and thus
10131 leaves partially redundant computations in the instruction stream.  The default value is 20.
10133 @item max-pending-list-length
10134 The maximum number of pending dependencies scheduling allows
10135 before flushing the current state and starting over.  Large functions
10136 with few branches or calls can create excessively large lists which
10137 needlessly consume memory and resources.
10139 @item max-modulo-backtrack-attempts
10140 The maximum number of backtrack attempts the scheduler should make
10141 when modulo scheduling a loop.  Larger values can exponentially increase
10142 compilation time.
10144 @item max-inline-insns-single
10145 Several parameters control the tree inliner used in GCC@.
10146 This number sets the maximum number of instructions (counted in GCC's
10147 internal representation) in a single function that the tree inliner
10148 considers for inlining.  This only affects functions declared
10149 inline and methods implemented in a class declaration (C++).
10150 The default value is 400.
10152 @item max-inline-insns-auto
10153 When you use @option{-finline-functions} (included in @option{-O3}),
10154 a lot of functions that would otherwise not be considered for inlining
10155 by the compiler are investigated.  To those functions, a different
10156 (more restrictive) limit compared to functions declared inline can
10157 be applied.
10158 The default value is 40.
10160 @item inline-min-speedup
10161 When estimated performance improvement of caller + callee runtime exceeds this
10162 threshold (in precent), the function can be inlined regardless the limit on
10163 @option{--param max-inline-insns-single} and @option{--param
10164 max-inline-insns-auto}.
10166 @item large-function-insns
10167 The limit specifying really large functions.  For functions larger than this
10168 limit after inlining, inlining is constrained by
10169 @option{--param large-function-growth}.  This parameter is useful primarily
10170 to avoid extreme compilation time caused by non-linear algorithms used by the
10171 back end.
10172 The default value is 2700.
10174 @item large-function-growth
10175 Specifies maximal growth of large function caused by inlining in percents.
10176 The default value is 100 which limits large function growth to 2.0 times
10177 the original size.
10179 @item large-unit-insns
10180 The limit specifying large translation unit.  Growth caused by inlining of
10181 units larger than this limit is limited by @option{--param inline-unit-growth}.
10182 For small units this might be too tight.
10183 For example, consider a unit consisting of function A
10184 that is inline and B that just calls A three times.  If B is small relative to
10185 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
10186 large units consisting of small inlineable functions, however, the overall unit
10187 growth limit is needed to avoid exponential explosion of code size.  Thus for
10188 smaller units, the size is increased to @option{--param large-unit-insns}
10189 before applying @option{--param inline-unit-growth}.  The default is 10000.
10191 @item inline-unit-growth
10192 Specifies maximal overall growth of the compilation unit caused by inlining.
10193 The default value is 15 which limits unit growth to 1.15 times the original
10194 size. Cold functions (either marked cold via an attribute or by profile
10195 feedback) are not accounted into the unit size.
10197 @item ipcp-unit-growth
10198 Specifies maximal overall growth of the compilation unit caused by
10199 interprocedural constant propagation.  The default value is 10 which limits
10200 unit growth to 1.1 times the original size.
10202 @item large-stack-frame
10203 The limit specifying large stack frames.  While inlining the algorithm is trying
10204 to not grow past this limit too much.  The default value is 256 bytes.
10206 @item large-stack-frame-growth
10207 Specifies maximal growth of large stack frames caused by inlining in percents.
10208 The default value is 1000 which limits large stack frame growth to 11 times
10209 the original size.
10211 @item max-inline-insns-recursive
10212 @itemx max-inline-insns-recursive-auto
10213 Specifies the maximum number of instructions an out-of-line copy of a
10214 self-recursive inline
10215 function can grow into by performing recursive inlining.
10217 @option{--param max-inline-insns-recursive} applies to functions
10218 declared inline.
10219 For functions not declared inline, recursive inlining
10220 happens only when @option{-finline-functions} (included in @option{-O3}) is
10221 enabled; @option{--param max-inline-insns-recursive-auto} applies instead.  The
10222 default value is 450.
10224 @item max-inline-recursive-depth
10225 @itemx max-inline-recursive-depth-auto
10226 Specifies the maximum recursion depth used for recursive inlining.
10228 @option{--param max-inline-recursive-depth} applies to functions
10229 declared inline.  For functions not declared inline, recursive inlining
10230 happens only when @option{-finline-functions} (included in @option{-O3}) is
10231 enabled; @option{--param max-inline-recursive-depth-auto} applies instead.  The
10232 default value is 8.
10234 @item min-inline-recursive-probability
10235 Recursive inlining is profitable only for function having deep recursion
10236 in average and can hurt for function having little recursion depth by
10237 increasing the prologue size or complexity of function body to other
10238 optimizers.
10240 When profile feedback is available (see @option{-fprofile-generate}) the actual
10241 recursion depth can be guessed from probability that function recurses via a
10242 given call expression.  This parameter limits inlining only to call expressions
10243 whose probability exceeds the given threshold (in percents).
10244 The default value is 10.
10246 @item early-inlining-insns
10247 Specify growth that the early inliner can make.  In effect it increases
10248 the amount of inlining for code having a large abstraction penalty.
10249 The default value is 14.
10251 @item max-early-inliner-iterations
10252 Limit of iterations of the early inliner.  This basically bounds
10253 the number of nested indirect calls the early inliner can resolve.
10254 Deeper chains are still handled by late inlining.
10256 @item comdat-sharing-probability
10257 Probability (in percent) that C++ inline function with comdat visibility
10258 are shared across multiple compilation units.  The default value is 20.
10260 @item profile-func-internal-id
10261 A parameter to control whether to use function internal id in profile
10262 database lookup. If the value is 0, the compiler uses an id that
10263 is based on function assembler name and filename, which makes old profile
10264 data more tolerant to source changes such as function reordering etc.
10265 The default value is 0.
10267 @item min-vect-loop-bound
10268 The minimum number of iterations under which loops are not vectorized
10269 when @option{-ftree-vectorize} is used.  The number of iterations after
10270 vectorization needs to be greater than the value specified by this option
10271 to allow vectorization.  The default value is 0.
10273 @item gcse-cost-distance-ratio
10274 Scaling factor in calculation of maximum distance an expression
10275 can be moved by GCSE optimizations.  This is currently supported only in the
10276 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
10277 is with simple expressions, i.e., the expressions that have cost
10278 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
10279 hoisting of simple expressions.  The default value is 10.
10281 @item gcse-unrestricted-cost
10282 Cost, roughly measured as the cost of a single typical machine
10283 instruction, at which GCSE optimizations do not constrain
10284 the distance an expression can travel.  This is currently
10285 supported only in the code hoisting pass.  The lesser the cost,
10286 the more aggressive code hoisting is.  Specifying 0 
10287 allows all expressions to travel unrestricted distances.
10288 The default value is 3.
10290 @item max-hoist-depth
10291 The depth of search in the dominator tree for expressions to hoist.
10292 This is used to avoid quadratic behavior in hoisting algorithm.
10293 The value of 0 does not limit on the search, but may slow down compilation
10294 of huge functions.  The default value is 30.
10296 @item max-tail-merge-comparisons
10297 The maximum amount of similar bbs to compare a bb with.  This is used to
10298 avoid quadratic behavior in tree tail merging.  The default value is 10.
10300 @item max-tail-merge-iterations
10301 The maximum amount of iterations of the pass over the function.  This is used to
10302 limit compilation time in tree tail merging.  The default value is 2.
10304 @item max-unrolled-insns
10305 The maximum number of instructions that a loop may have to be unrolled.
10306 If a loop is unrolled, this parameter also determines how many times
10307 the loop code is unrolled.
10309 @item max-average-unrolled-insns
10310 The maximum number of instructions biased by probabilities of their execution
10311 that a loop may have to be unrolled.  If a loop is unrolled,
10312 this parameter also determines how many times the loop code is unrolled.
10314 @item max-unroll-times
10315 The maximum number of unrollings of a single loop.
10317 @item max-peeled-insns
10318 The maximum number of instructions that a loop may have to be peeled.
10319 If a loop is peeled, this parameter also determines how many times
10320 the loop code is peeled.
10322 @item max-peel-times
10323 The maximum number of peelings of a single loop.
10325 @item max-peel-branches
10326 The maximum number of branches on the hot path through the peeled sequence.
10328 @item max-completely-peeled-insns
10329 The maximum number of insns of a completely peeled loop.
10331 @item max-completely-peel-times
10332 The maximum number of iterations of a loop to be suitable for complete peeling.
10334 @item max-completely-peel-loop-nest-depth
10335 The maximum depth of a loop nest suitable for complete peeling.
10337 @item max-unswitch-insns
10338 The maximum number of insns of an unswitched loop.
10340 @item max-unswitch-level
10341 The maximum number of branches unswitched in a single loop.
10343 @item lim-expensive
10344 The minimum cost of an expensive expression in the loop invariant motion.
10346 @item iv-consider-all-candidates-bound
10347 Bound on number of candidates for induction variables, below which
10348 all candidates are considered for each use in induction variable
10349 optimizations.  If there are more candidates than this,
10350 only the most relevant ones are considered to avoid quadratic time complexity.
10352 @item iv-max-considered-uses
10353 The induction variable optimizations give up on loops that contain more
10354 induction variable uses.
10356 @item iv-always-prune-cand-set-bound
10357 If the number of candidates in the set is smaller than this value,
10358 always try to remove unnecessary ivs from the set
10359 when adding a new one.
10361 @item scev-max-expr-size
10362 Bound on size of expressions used in the scalar evolutions analyzer.
10363 Large expressions slow the analyzer.
10365 @item scev-max-expr-complexity
10366 Bound on the complexity of the expressions in the scalar evolutions analyzer.
10367 Complex expressions slow the analyzer.
10369 @item omega-max-vars
10370 The maximum number of variables in an Omega constraint system.
10371 The default value is 128.
10373 @item omega-max-geqs
10374 The maximum number of inequalities in an Omega constraint system.
10375 The default value is 256.
10377 @item omega-max-eqs
10378 The maximum number of equalities in an Omega constraint system.
10379 The default value is 128.
10381 @item omega-max-wild-cards
10382 The maximum number of wildcard variables that the Omega solver is
10383 able to insert.  The default value is 18.
10385 @item omega-hash-table-size
10386 The size of the hash table in the Omega solver.  The default value is
10387 550.
10389 @item omega-max-keys
10390 The maximal number of keys used by the Omega solver.  The default
10391 value is 500.
10393 @item omega-eliminate-redundant-constraints
10394 When set to 1, use expensive methods to eliminate all redundant
10395 constraints.  The default value is 0.
10397 @item vect-max-version-for-alignment-checks
10398 The maximum number of run-time checks that can be performed when
10399 doing loop versioning for alignment in the vectorizer.
10401 @item vect-max-version-for-alias-checks
10402 The maximum number of run-time checks that can be performed when
10403 doing loop versioning for alias in the vectorizer.
10405 @item vect-max-peeling-for-alignment
10406 The maximum number of loop peels to enhance access alignment
10407 for vectorizer. Value -1 means 'no limit'.
10409 @item max-iterations-to-track
10410 The maximum number of iterations of a loop the brute-force algorithm
10411 for analysis of the number of iterations of the loop tries to evaluate.
10413 @item hot-bb-count-ws-permille
10414 A basic block profile count is considered hot if it contributes to 
10415 the given permillage (i.e. 0...1000) of the entire profiled execution.
10417 @item hot-bb-frequency-fraction
10418 Select fraction of the entry block frequency of executions of basic block in
10419 function given basic block needs to have to be considered hot.
10421 @item max-predicted-iterations
10422 The maximum number of loop iterations we predict statically.  This is useful
10423 in cases where a function contains a single loop with known bound and
10424 another loop with unknown bound.
10425 The known number of iterations is predicted correctly, while
10426 the unknown number of iterations average to roughly 10.  This means that the
10427 loop without bounds appears artificially cold relative to the other one.
10429 @item builtin-expect-probability
10430 Control the probability of the expression having the specified value. This
10431 parameter takes a percentage (i.e. 0 ... 100) as input.
10432 The default probability of 90 is obtained empirically.
10434 @item align-threshold
10436 Select fraction of the maximal frequency of executions of a basic block in
10437 a function to align the basic block.
10439 @item align-loop-iterations
10441 A loop expected to iterate at least the selected number of iterations is
10442 aligned.
10444 @item tracer-dynamic-coverage
10445 @itemx tracer-dynamic-coverage-feedback
10447 This value is used to limit superblock formation once the given percentage of
10448 executed instructions is covered.  This limits unnecessary code size
10449 expansion.
10451 The @option{tracer-dynamic-coverage-feedback} parameter
10452 is used only when profile
10453 feedback is available.  The real profiles (as opposed to statically estimated
10454 ones) are much less balanced allowing the threshold to be larger value.
10456 @item tracer-max-code-growth
10457 Stop tail duplication once code growth has reached given percentage.  This is
10458 a rather artificial limit, as most of the duplicates are eliminated later in
10459 cross jumping, so it may be set to much higher values than is the desired code
10460 growth.
10462 @item tracer-min-branch-ratio
10464 Stop reverse growth when the reverse probability of best edge is less than this
10465 threshold (in percent).
10467 @item tracer-min-branch-ratio
10468 @itemx tracer-min-branch-ratio-feedback
10470 Stop forward growth if the best edge has probability lower than this
10471 threshold.
10473 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
10474 compilation for profile feedback and one for compilation without.  The value
10475 for compilation with profile feedback needs to be more conservative (higher) in
10476 order to make tracer effective.
10478 @item max-cse-path-length
10480 The maximum number of basic blocks on path that CSE considers.
10481 The default is 10.
10483 @item max-cse-insns
10484 The maximum number of instructions CSE processes before flushing.
10485 The default is 1000.
10487 @item ggc-min-expand
10489 GCC uses a garbage collector to manage its own memory allocation.  This
10490 parameter specifies the minimum percentage by which the garbage
10491 collector's heap should be allowed to expand between collections.
10492 Tuning this may improve compilation speed; it has no effect on code
10493 generation.
10495 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
10496 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
10497 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
10498 GCC is not able to calculate RAM on a particular platform, the lower
10499 bound of 30% is used.  Setting this parameter and
10500 @option{ggc-min-heapsize} to zero causes a full collection to occur at
10501 every opportunity.  This is extremely slow, but can be useful for
10502 debugging.
10504 @item ggc-min-heapsize
10506 Minimum size of the garbage collector's heap before it begins bothering
10507 to collect garbage.  The first collection occurs after the heap expands
10508 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
10509 tuning this may improve compilation speed, and has no effect on code
10510 generation.
10512 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
10513 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
10514 with a lower bound of 4096 (four megabytes) and an upper bound of
10515 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
10516 particular platform, the lower bound is used.  Setting this parameter
10517 very large effectively disables garbage collection.  Setting this
10518 parameter and @option{ggc-min-expand} to zero causes a full collection
10519 to occur at every opportunity.
10521 @item max-reload-search-insns
10522 The maximum number of instruction reload should look backward for equivalent
10523 register.  Increasing values mean more aggressive optimization, making the
10524 compilation time increase with probably slightly better performance.
10525 The default value is 100.
10527 @item max-cselib-memory-locations
10528 The maximum number of memory locations cselib should take into account.
10529 Increasing values mean more aggressive optimization, making the compilation time
10530 increase with probably slightly better performance.  The default value is 500.
10532 @item reorder-blocks-duplicate
10533 @itemx reorder-blocks-duplicate-feedback
10535 Used by the basic block reordering pass to decide whether to use unconditional
10536 branch or duplicate the code on its destination.  Code is duplicated when its
10537 estimated size is smaller than this value multiplied by the estimated size of
10538 unconditional jump in the hot spots of the program.
10540 The @option{reorder-block-duplicate-feedback} parameter
10541 is used only when profile
10542 feedback is available.  It may be set to higher values than
10543 @option{reorder-block-duplicate} since information about the hot spots is more
10544 accurate.
10546 @item max-sched-ready-insns
10547 The maximum number of instructions ready to be issued the scheduler should
10548 consider at any given time during the first scheduling pass.  Increasing
10549 values mean more thorough searches, making the compilation time increase
10550 with probably little benefit.  The default value is 100.
10552 @item max-sched-region-blocks
10553 The maximum number of blocks in a region to be considered for
10554 interblock scheduling.  The default value is 10.
10556 @item max-pipeline-region-blocks
10557 The maximum number of blocks in a region to be considered for
10558 pipelining in the selective scheduler.  The default value is 15.
10560 @item max-sched-region-insns
10561 The maximum number of insns in a region to be considered for
10562 interblock scheduling.  The default value is 100.
10564 @item max-pipeline-region-insns
10565 The maximum number of insns in a region to be considered for
10566 pipelining in the selective scheduler.  The default value is 200.
10568 @item min-spec-prob
10569 The minimum probability (in percents) of reaching a source block
10570 for interblock speculative scheduling.  The default value is 40.
10572 @item max-sched-extend-regions-iters
10573 The maximum number of iterations through CFG to extend regions.
10574 A value of 0 (the default) disables region extensions.
10576 @item max-sched-insn-conflict-delay
10577 The maximum conflict delay for an insn to be considered for speculative motion.
10578 The default value is 3.
10580 @item sched-spec-prob-cutoff
10581 The minimal probability of speculation success (in percents), so that
10582 speculative insns are scheduled.
10583 The default value is 40.
10585 @item sched-spec-state-edge-prob-cutoff
10586 The minimum probability an edge must have for the scheduler to save its
10587 state across it.
10588 The default value is 10.
10590 @item sched-mem-true-dep-cost
10591 Minimal distance (in CPU cycles) between store and load targeting same
10592 memory locations.  The default value is 1.
10594 @item selsched-max-lookahead
10595 The maximum size of the lookahead window of selective scheduling.  It is a
10596 depth of search for available instructions.
10597 The default value is 50.
10599 @item selsched-max-sched-times
10600 The maximum number of times that an instruction is scheduled during
10601 selective scheduling.  This is the limit on the number of iterations
10602 through which the instruction may be pipelined.  The default value is 2.
10604 @item selsched-max-insns-to-rename
10605 The maximum number of best instructions in the ready list that are considered
10606 for renaming in the selective scheduler.  The default value is 2.
10608 @item sms-min-sc
10609 The minimum value of stage count that swing modulo scheduler
10610 generates.  The default value is 2.
10612 @item max-last-value-rtl
10613 The maximum size measured as number of RTLs that can be recorded in an expression
10614 in combiner for a pseudo register as last known value of that register.  The default
10615 is 10000.
10617 @item max-combine-insns
10618 The maximum number of instructions the RTL combiner tries to combine.
10619 The default value is 2 at @option{-Og} and 4 otherwise.
10621 @item integer-share-limit
10622 Small integer constants can use a shared data structure, reducing the
10623 compiler's memory usage and increasing its speed.  This sets the maximum
10624 value of a shared integer constant.  The default value is 256.
10626 @item ssp-buffer-size
10627 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
10628 protection when @option{-fstack-protection} is used.
10630 @item min-size-for-stack-sharing
10631 The minimum size of variables taking part in stack slot sharing when not
10632 optimizing. The default value is 32.
10634 @item max-jump-thread-duplication-stmts
10635 Maximum number of statements allowed in a block that needs to be
10636 duplicated when threading jumps.
10638 @item max-fields-for-field-sensitive
10639 Maximum number of fields in a structure treated in
10640 a field sensitive manner during pointer analysis.  The default is zero
10641 for @option{-O0} and @option{-O1},
10642 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
10644 @item prefetch-latency
10645 Estimate on average number of instructions that are executed before
10646 prefetch finishes.  The distance prefetched ahead is proportional
10647 to this constant.  Increasing this number may also lead to less
10648 streams being prefetched (see @option{simultaneous-prefetches}).
10650 @item simultaneous-prefetches
10651 Maximum number of prefetches that can run at the same time.
10653 @item l1-cache-line-size
10654 The size of cache line in L1 cache, in bytes.
10656 @item l1-cache-size
10657 The size of L1 cache, in kilobytes.
10659 @item l2-cache-size
10660 The size of L2 cache, in kilobytes.
10662 @item min-insn-to-prefetch-ratio
10663 The minimum ratio between the number of instructions and the
10664 number of prefetches to enable prefetching in a loop.
10666 @item prefetch-min-insn-to-mem-ratio
10667 The minimum ratio between the number of instructions and the
10668 number of memory references to enable prefetching in a loop.
10670 @item use-canonical-types
10671 Whether the compiler should use the ``canonical'' type system.  By
10672 default, this should always be 1, which uses a more efficient internal
10673 mechanism for comparing types in C++ and Objective-C++.  However, if
10674 bugs in the canonical type system are causing compilation failures,
10675 set this value to 0 to disable canonical types.
10677 @item switch-conversion-max-branch-ratio
10678 Switch initialization conversion refuses to create arrays that are
10679 bigger than @option{switch-conversion-max-branch-ratio} times the number of
10680 branches in the switch.
10682 @item max-partial-antic-length
10683 Maximum length of the partial antic set computed during the tree
10684 partial redundancy elimination optimization (@option{-ftree-pre}) when
10685 optimizing at @option{-O3} and above.  For some sorts of source code
10686 the enhanced partial redundancy elimination optimization can run away,
10687 consuming all of the memory available on the host machine.  This
10688 parameter sets a limit on the length of the sets that are computed,
10689 which prevents the runaway behavior.  Setting a value of 0 for
10690 this parameter allows an unlimited set length.
10692 @item sccvn-max-scc-size
10693 Maximum size of a strongly connected component (SCC) during SCCVN
10694 processing.  If this limit is hit, SCCVN processing for the whole
10695 function is not done and optimizations depending on it are
10696 disabled.  The default maximum SCC size is 10000.
10698 @item sccvn-max-alias-queries-per-access
10699 Maximum number of alias-oracle queries we perform when looking for
10700 redundancies for loads and stores.  If this limit is hit the search
10701 is aborted and the load or store is not considered redundant.  The
10702 number of queries is algorithmically limited to the number of
10703 stores on all paths from the load to the function entry.
10704 The default maxmimum number of queries is 1000.
10706 @item ira-max-loops-num
10707 IRA uses regional register allocation by default.  If a function
10708 contains more loops than the number given by this parameter, only at most
10709 the given number of the most frequently-executed loops form regions
10710 for regional register allocation.  The default value of the
10711 parameter is 100.
10713 @item ira-max-conflict-table-size 
10714 Although IRA uses a sophisticated algorithm to compress the conflict
10715 table, the table can still require excessive amounts of memory for
10716 huge functions.  If the conflict table for a function could be more
10717 than the size in MB given by this parameter, the register allocator
10718 instead uses a faster, simpler, and lower-quality
10719 algorithm that does not require building a pseudo-register conflict table.  
10720 The default value of the parameter is 2000.
10722 @item ira-loop-reserved-regs
10723 IRA can be used to evaluate more accurate register pressure in loops
10724 for decisions to move loop invariants (see @option{-O3}).  The number
10725 of available registers reserved for some other purposes is given
10726 by this parameter.  The default value of the parameter is 2, which is
10727 the minimal number of registers needed by typical instructions.
10728 This value is the best found from numerous experiments.
10730 @item lra-inheritance-ebb-probability-cutoff
10731 LRA tries to reuse values reloaded in registers in subsequent insns.
10732 This optimization is called inheritance.  EBB is used as a region to
10733 do this optimization.  The parameter defines a minimal fall-through
10734 edge probability in percentage used to add BB to inheritance EBB in
10735 LRA.  The default value of the parameter is 40.  The value was chosen
10736 from numerous runs of SPEC2000 on x86-64.
10738 @item loop-invariant-max-bbs-in-loop
10739 Loop invariant motion can be very expensive, both in compilation time and
10740 in amount of needed compile-time memory, with very large loops.  Loops
10741 with more basic blocks than this parameter won't have loop invariant
10742 motion optimization performed on them.  The default value of the
10743 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
10745 @item loop-max-datarefs-for-datadeps
10746 Building data dapendencies is expensive for very large loops.  This
10747 parameter limits the number of data references in loops that are
10748 considered for data dependence analysis.  These large loops are no
10749 handled by the optimizations using loop data dependencies.
10750 The default value is 1000.
10752 @item max-vartrack-size
10753 Sets a maximum number of hash table slots to use during variable
10754 tracking dataflow analysis of any function.  If this limit is exceeded
10755 with variable tracking at assignments enabled, analysis for that
10756 function is retried without it, after removing all debug insns from
10757 the function.  If the limit is exceeded even without debug insns, var
10758 tracking analysis is completely disabled for the function.  Setting
10759 the parameter to zero makes it unlimited.
10761 @item max-vartrack-expr-depth
10762 Sets a maximum number of recursion levels when attempting to map
10763 variable names or debug temporaries to value expressions.  This trades
10764 compilation time for more complete debug information.  If this is set too
10765 low, value expressions that are available and could be represented in
10766 debug information may end up not being used; setting this higher may
10767 enable the compiler to find more complex debug expressions, but compile
10768 time and memory use may grow.  The default is 12.
10770 @item min-nondebug-insn-uid
10771 Use uids starting at this parameter for nondebug insns.  The range below
10772 the parameter is reserved exclusively for debug insns created by
10773 @option{-fvar-tracking-assignments}, but debug insns may get
10774 (non-overlapping) uids above it if the reserved range is exhausted.
10776 @item ipa-sra-ptr-growth-factor
10777 IPA-SRA replaces a pointer to an aggregate with one or more new
10778 parameters only when their cumulative size is less or equal to
10779 @option{ipa-sra-ptr-growth-factor} times the size of the original
10780 pointer parameter.
10782 @item sra-max-scalarization-size-Ospeed
10783 @item sra-max-scalarization-size-Osize
10784 The two Scalar Reduction of Aggregates passes (SRA and IPA-SRA) aim to
10785 replace scalar parts of aggregates with uses of independent scalar
10786 variables.  These parameters control the maximum size, in storage units,
10787 of aggregate which is considered for replacement when compiling for
10788 speed
10789 (@option{sra-max-scalarization-size-Ospeed}) or size
10790 (@option{sra-max-scalarization-size-Osize}) respectively.
10792 @item tm-max-aggregate-size
10793 When making copies of thread-local variables in a transaction, this
10794 parameter specifies the size in bytes after which variables are
10795 saved with the logging functions as opposed to save/restore code
10796 sequence pairs.  This option only applies when using
10797 @option{-fgnu-tm}.
10799 @item graphite-max-nb-scop-params
10800 To avoid exponential effects in the Graphite loop transforms, the
10801 number of parameters in a Static Control Part (SCoP) is bounded.  The
10802 default value is 10 parameters.  A variable whose value is unknown at
10803 compilation time and defined outside a SCoP is a parameter of the SCoP.
10805 @item graphite-max-bbs-per-function
10806 To avoid exponential effects in the detection of SCoPs, the size of
10807 the functions analyzed by Graphite is bounded.  The default value is
10808 100 basic blocks.
10810 @item loop-block-tile-size
10811 Loop blocking or strip mining transforms, enabled with
10812 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
10813 loop in the loop nest by a given number of iterations.  The strip
10814 length can be changed using the @option{loop-block-tile-size}
10815 parameter.  The default value is 51 iterations.
10817 @item loop-unroll-jam-size
10818 Specify the unroll factor for the @option{-floop-unroll-and-jam} option.  The 
10819 default value is 4.
10821 @item loop-unroll-jam-depth
10822 Specify the dimension to be unrolled (counting from the most inner loop)
10823 for the  @option{-floop-unroll-and-jam}.  The default value is 2.
10825 @item ipa-cp-value-list-size
10826 IPA-CP attempts to track all possible values and types passed to a function's
10827 parameter in order to propagate them and perform devirtualization.
10828 @option{ipa-cp-value-list-size} is the maximum number of values and types it
10829 stores per one formal parameter of a function.
10831 @item ipa-cp-eval-threshold
10832 IPA-CP calculates its own score of cloning profitability heuristics
10833 and performs those cloning opportunities with scores that exceed
10834 @option{ipa-cp-eval-threshold}.
10836 @item ipa-max-agg-items
10837 IPA-CP is also capable to propagate a number of scalar values passed
10838 in an aggregate. @option{ipa-max-agg-items} controls the maximum
10839 number of such values per one parameter.
10841 @item ipa-cp-loop-hint-bonus
10842 When IPA-CP determines that a cloning candidate would make the number
10843 of iterations of a loop known, it adds a bonus of
10844 @option{ipa-cp-loop-hint-bonus} to the profitability score of
10845 the candidate.
10847 @item ipa-cp-array-index-hint-bonus
10848 When IPA-CP determines that a cloning candidate would make the index of
10849 an array access known, it adds a bonus of
10850 @option{ipa-cp-array-index-hint-bonus} to the profitability
10851 score of the candidate.
10853 @item ipa-max-aa-steps
10854 During its analysis of function bodies, IPA-CP employs alias analysis
10855 in order to track values pointed to by function parameters.  In order
10856 not spend too much time analyzing huge functions, it gives up and
10857 consider all memory clobbered after examining
10858 @option{ipa-max-aa-steps} statements modifying memory.
10860 @item lto-partitions
10861 Specify desired number of partitions produced during WHOPR compilation.
10862 The number of partitions should exceed the number of CPUs used for compilation.
10863 The default value is 32.
10865 @item lto-minpartition
10866 Size of minimal partition for WHOPR (in estimated instructions).
10867 This prevents expenses of splitting very small programs into too many
10868 partitions.
10870 @item cxx-max-namespaces-for-diagnostic-help
10871 The maximum number of namespaces to consult for suggestions when C++
10872 name lookup fails for an identifier.  The default is 1000.
10874 @item sink-frequency-threshold
10875 The maximum relative execution frequency (in percents) of the target block
10876 relative to a statement's original block to allow statement sinking of a
10877 statement.  Larger numbers result in more aggressive statement sinking.
10878 The default value is 75.  A small positive adjustment is applied for
10879 statements with memory operands as those are even more profitable so sink.
10881 @item max-stores-to-sink
10882 The maximum number of conditional stores paires that can be sunk.  Set to 0
10883 if either vectorization (@option{-ftree-vectorize}) or if-conversion
10884 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
10886 @item allow-store-data-races
10887 Allow optimizers to introduce new data races on stores.
10888 Set to 1 to allow, otherwise to 0.  This option is enabled by default
10889 at optimization level @option{-Ofast}.
10891 @item case-values-threshold
10892 The smallest number of different values for which it is best to use a
10893 jump-table instead of a tree of conditional branches.  If the value is
10894 0, use the default for the machine.  The default is 0.
10896 @item tree-reassoc-width
10897 Set the maximum number of instructions executed in parallel in
10898 reassociated tree. This parameter overrides target dependent
10899 heuristics used by default if has non zero value.
10901 @item sched-pressure-algorithm
10902 Choose between the two available implementations of
10903 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
10904 and is the more likely to prevent instructions from being reordered.
10905 Algorithm 2 was designed to be a compromise between the relatively
10906 conservative approach taken by algorithm 1 and the rather aggressive
10907 approach taken by the default scheduler.  It relies more heavily on
10908 having a regular register file and accurate register pressure classes.
10909 See @file{haifa-sched.c} in the GCC sources for more details.
10911 The default choice depends on the target.
10913 @item max-slsr-cand-scan
10914 Set the maximum number of existing candidates that are considered when
10915 seeking a basis for a new straight-line strength reduction candidate.
10917 @item asan-globals
10918 Enable buffer overflow detection for global objects.  This kind
10919 of protection is enabled by default if you are using
10920 @option{-fsanitize=address} option.
10921 To disable global objects protection use @option{--param asan-globals=0}.
10923 @item asan-stack
10924 Enable buffer overflow detection for stack objects.  This kind of
10925 protection is enabled by default when using@option{-fsanitize=address}.
10926 To disable stack protection use @option{--param asan-stack=0} option.
10928 @item asan-instrument-reads
10929 Enable buffer overflow detection for memory reads.  This kind of
10930 protection is enabled by default when using @option{-fsanitize=address}.
10931 To disable memory reads protection use
10932 @option{--param asan-instrument-reads=0}.
10934 @item asan-instrument-writes
10935 Enable buffer overflow detection for memory writes.  This kind of
10936 protection is enabled by default when using @option{-fsanitize=address}.
10937 To disable memory writes protection use
10938 @option{--param asan-instrument-writes=0} option.
10940 @item asan-memintrin
10941 Enable detection for built-in functions.  This kind of protection
10942 is enabled by default when using @option{-fsanitize=address}.
10943 To disable built-in functions protection use
10944 @option{--param asan-memintrin=0}.
10946 @item asan-use-after-return
10947 Enable detection of use-after-return.  This kind of protection
10948 is enabled by default when using @option{-fsanitize=address} option.
10949 To disable use-after-return detection use 
10950 @option{--param asan-use-after-return=0}.
10952 @item asan-instrumentation-with-call-threshold
10953 If number of memory accesses in function being instrumented
10954 is greater or equal to this number, use callbacks instead of inline checks.
10955 E.g. to disable inline code use
10956 @option{--param asan-instrumentation-with-call-threshold=0}.
10958 @item chkp-max-ctor-size
10959 Static constructors generated by Pointer Bounds Checker may become very
10960 large and significantly increase compile time at optimization level
10961 @option{-O1} and higher.  This parameter is a maximum nubmer of statements
10962 in a single generated constructor.  Default value is 5000.
10964 @item max-fsm-thread-path-insns
10965 Maximum number of instructions to copy when duplicating blocks on a
10966 finite state automaton jump thread path.  The default is 100.
10968 @item max-fsm-thread-length
10969 Maximum number of basic blocks on a finite state automaton jump thread
10970 path.  The default is 10.
10972 @item max-fsm-thread-paths
10973 Maximum number of new jump thread paths to create for a finite state
10974 automaton.  The default is 50.
10976 @end table
10977 @end table
10979 @node Preprocessor Options
10980 @section Options Controlling the Preprocessor
10981 @cindex preprocessor options
10982 @cindex options, preprocessor
10984 These options control the C preprocessor, which is run on each C source
10985 file before actual compilation.
10987 If you use the @option{-E} option, nothing is done except preprocessing.
10988 Some of these options make sense only together with @option{-E} because
10989 they cause the preprocessor output to be unsuitable for actual
10990 compilation.
10992 @table @gcctabopt
10993 @item -Wp,@var{option}
10994 @opindex Wp
10995 You can use @option{-Wp,@var{option}} to bypass the compiler driver
10996 and pass @var{option} directly through to the preprocessor.  If
10997 @var{option} contains commas, it is split into multiple options at the
10998 commas.  However, many options are modified, translated or interpreted
10999 by the compiler driver before being passed to the preprocessor, and
11000 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
11001 interface is undocumented and subject to change, so whenever possible
11002 you should avoid using @option{-Wp} and let the driver handle the
11003 options instead.
11005 @item -Xpreprocessor @var{option}
11006 @opindex Xpreprocessor
11007 Pass @var{option} as an option to the preprocessor.  You can use this to
11008 supply system-specific preprocessor options that GCC does not 
11009 recognize.
11011 If you want to pass an option that takes an argument, you must use
11012 @option{-Xpreprocessor} twice, once for the option and once for the argument.
11014 @item -no-integrated-cpp
11015 @opindex no-integrated-cpp
11016 Perform preprocessing as a separate pass before compilation.
11017 By default, GCC performs preprocessing as an integrated part of
11018 input tokenization and parsing.
11019 If this option is provided, the appropriate language front end
11020 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
11021 and Objective-C, respectively) is instead invoked twice,
11022 once for preprocessing only and once for actual compilation
11023 of the preprocessed input.
11024 This option may be useful in conjunction with the @option{-B} or
11025 @option{-wrapper} options to specify an alternate preprocessor or
11026 perform additional processing of the program source between
11027 normal preprocessing and compilation.
11028 @end table
11030 @include cppopts.texi
11032 @node Assembler Options
11033 @section Passing Options to the Assembler
11035 @c prevent bad page break with this line
11036 You can pass options to the assembler.
11038 @table @gcctabopt
11039 @item -Wa,@var{option}
11040 @opindex Wa
11041 Pass @var{option} as an option to the assembler.  If @var{option}
11042 contains commas, it is split into multiple options at the commas.
11044 @item -Xassembler @var{option}
11045 @opindex Xassembler
11046 Pass @var{option} as an option to the assembler.  You can use this to
11047 supply system-specific assembler options that GCC does not
11048 recognize.
11050 If you want to pass an option that takes an argument, you must use
11051 @option{-Xassembler} twice, once for the option and once for the argument.
11053 @end table
11055 @node Link Options
11056 @section Options for Linking
11057 @cindex link options
11058 @cindex options, linking
11060 These options come into play when the compiler links object files into
11061 an executable output file.  They are meaningless if the compiler is
11062 not doing a link step.
11064 @table @gcctabopt
11065 @cindex file names
11066 @item @var{object-file-name}
11067 A file name that does not end in a special recognized suffix is
11068 considered to name an object file or library.  (Object files are
11069 distinguished from libraries by the linker according to the file
11070 contents.)  If linking is done, these object files are used as input
11071 to the linker.
11073 @item -c
11074 @itemx -S
11075 @itemx -E
11076 @opindex c
11077 @opindex S
11078 @opindex E
11079 If any of these options is used, then the linker is not run, and
11080 object file names should not be used as arguments.  @xref{Overall
11081 Options}.
11083 @item -fuse-ld=bfd
11084 @opindex fuse-ld=bfd
11085 Use the @command{bfd} linker instead of the default linker.
11087 @item -fuse-ld=gold
11088 @opindex fuse-ld=gold
11089 Use the @command{gold} linker instead of the default linker.
11091 @cindex Libraries
11092 @item -l@var{library}
11093 @itemx -l @var{library}
11094 @opindex l
11095 Search the library named @var{library} when linking.  (The second
11096 alternative with the library as a separate argument is only for
11097 POSIX compliance and is not recommended.)
11099 It makes a difference where in the command you write this option; the
11100 linker searches and processes libraries and object files in the order they
11101 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
11102 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
11103 to functions in @samp{z}, those functions may not be loaded.
11105 The linker searches a standard list of directories for the library,
11106 which is actually a file named @file{lib@var{library}.a}.  The linker
11107 then uses this file as if it had been specified precisely by name.
11109 The directories searched include several standard system directories
11110 plus any that you specify with @option{-L}.
11112 Normally the files found this way are library files---archive files
11113 whose members are object files.  The linker handles an archive file by
11114 scanning through it for members which define symbols that have so far
11115 been referenced but not defined.  But if the file that is found is an
11116 ordinary object file, it is linked in the usual fashion.  The only
11117 difference between using an @option{-l} option and specifying a file name
11118 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
11119 and searches several directories.
11121 @item -lobjc
11122 @opindex lobjc
11123 You need this special case of the @option{-l} option in order to
11124 link an Objective-C or Objective-C++ program.
11126 @item -nostartfiles
11127 @opindex nostartfiles
11128 Do not use the standard system startup files when linking.
11129 The standard system libraries are used normally, unless @option{-nostdlib}
11130 or @option{-nodefaultlibs} is used.
11132 @item -nodefaultlibs
11133 @opindex nodefaultlibs
11134 Do not use the standard system libraries when linking.
11135 Only the libraries you specify are passed to the linker, and options
11136 specifying linkage of the system libraries, such as @option{-static-libgcc}
11137 or @option{-shared-libgcc}, are ignored.  
11138 The standard startup files are used normally, unless @option{-nostartfiles}
11139 is used.  
11141 The compiler may generate calls to @code{memcmp},
11142 @code{memset}, @code{memcpy} and @code{memmove}.
11143 These entries are usually resolved by entries in
11144 libc.  These entry points should be supplied through some other
11145 mechanism when this option is specified.
11147 @item -nostdlib
11148 @opindex nostdlib
11149 Do not use the standard system startup files or libraries when linking.
11150 No startup files and only the libraries you specify are passed to
11151 the linker, and options specifying linkage of the system libraries, such as
11152 @option{-static-libgcc} or @option{-shared-libgcc}, are ignored.
11154 The compiler may generate calls to @code{memcmp}, @code{memset},
11155 @code{memcpy} and @code{memmove}.
11156 These entries are usually resolved by entries in
11157 libc.  These entry points should be supplied through some other
11158 mechanism when this option is specified.
11160 @cindex @option{-lgcc}, use with @option{-nostdlib}
11161 @cindex @option{-nostdlib} and unresolved references
11162 @cindex unresolved references and @option{-nostdlib}
11163 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
11164 @cindex @option{-nodefaultlibs} and unresolved references
11165 @cindex unresolved references and @option{-nodefaultlibs}
11166 One of the standard libraries bypassed by @option{-nostdlib} and
11167 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
11168 which GCC uses to overcome shortcomings of particular machines, or special
11169 needs for some languages.
11170 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
11171 Collection (GCC) Internals},
11172 for more discussion of @file{libgcc.a}.)
11173 In most cases, you need @file{libgcc.a} even when you want to avoid
11174 other standard libraries.  In other words, when you specify @option{-nostdlib}
11175 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
11176 This ensures that you have no unresolved references to internal GCC
11177 library subroutines.
11178 (An example of such an internal subroutine is @code{__main}, used to ensure C++
11179 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
11180 GNU Compiler Collection (GCC) Internals}.)
11182 @item -pie
11183 @opindex pie
11184 Produce a position independent executable on targets that support it.
11185 For predictable results, you must also specify the same set of options
11186 used for compilation (@option{-fpie}, @option{-fPIE},
11187 or model suboptions) when you specify this linker option.
11189 @item -rdynamic
11190 @opindex rdynamic
11191 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
11192 that support it. This instructs the linker to add all symbols, not
11193 only used ones, to the dynamic symbol table. This option is needed
11194 for some uses of @code{dlopen} or to allow obtaining backtraces
11195 from within a program.
11197 @item -s
11198 @opindex s
11199 Remove all symbol table and relocation information from the executable.
11201 @item -static
11202 @opindex static
11203 On systems that support dynamic linking, this prevents linking with the shared
11204 libraries.  On other systems, this option has no effect.
11206 @item -shared
11207 @opindex shared
11208 Produce a shared object which can then be linked with other objects to
11209 form an executable.  Not all systems support this option.  For predictable
11210 results, you must also specify the same set of options used for compilation
11211 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
11212 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
11213 needs to build supplementary stub code for constructors to work.  On
11214 multi-libbed systems, @samp{gcc -shared} must select the correct support
11215 libraries to link against.  Failing to supply the correct flags may lead
11216 to subtle defects.  Supplying them in cases where they are not necessary
11217 is innocuous.}
11219 @item -shared-libgcc
11220 @itemx -static-libgcc
11221 @opindex shared-libgcc
11222 @opindex static-libgcc
11223 On systems that provide @file{libgcc} as a shared library, these options
11224 force the use of either the shared or static version, respectively.
11225 If no shared version of @file{libgcc} was built when the compiler was
11226 configured, these options have no effect.
11228 There are several situations in which an application should use the
11229 shared @file{libgcc} instead of the static version.  The most common
11230 of these is when the application wishes to throw and catch exceptions
11231 across different shared libraries.  In that case, each of the libraries
11232 as well as the application itself should use the shared @file{libgcc}.
11234 Therefore, the G++ and GCJ drivers automatically add
11235 @option{-shared-libgcc} whenever you build a shared library or a main
11236 executable, because C++ and Java programs typically use exceptions, so
11237 this is the right thing to do.
11239 If, instead, you use the GCC driver to create shared libraries, you may
11240 find that they are not always linked with the shared @file{libgcc}.
11241 If GCC finds, at its configuration time, that you have a non-GNU linker
11242 or a GNU linker that does not support option @option{--eh-frame-hdr},
11243 it links the shared version of @file{libgcc} into shared libraries
11244 by default.  Otherwise, it takes advantage of the linker and optimizes
11245 away the linking with the shared version of @file{libgcc}, linking with
11246 the static version of libgcc by default.  This allows exceptions to
11247 propagate through such shared libraries, without incurring relocation
11248 costs at library load time.
11250 However, if a library or main executable is supposed to throw or catch
11251 exceptions, you must link it using the G++ or GCJ driver, as appropriate
11252 for the languages used in the program, or using the option
11253 @option{-shared-libgcc}, such that it is linked with the shared
11254 @file{libgcc}.
11256 @item -static-libasan
11257 @opindex static-libasan
11258 When the @option{-fsanitize=address} option is used to link a program,
11259 the GCC driver automatically links against @option{libasan}.  If
11260 @file{libasan} is available as a shared library, and the @option{-static}
11261 option is not used, then this links against the shared version of
11262 @file{libasan}.  The @option{-static-libasan} option directs the GCC
11263 driver to link @file{libasan} statically, without necessarily linking
11264 other libraries statically.
11266 @item -static-libtsan
11267 @opindex static-libtsan
11268 When the @option{-fsanitize=thread} option is used to link a program,
11269 the GCC driver automatically links against @option{libtsan}.  If
11270 @file{libtsan} is available as a shared library, and the @option{-static}
11271 option is not used, then this links against the shared version of
11272 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
11273 driver to link @file{libtsan} statically, without necessarily linking
11274 other libraries statically.
11276 @item -static-liblsan
11277 @opindex static-liblsan
11278 When the @option{-fsanitize=leak} option is used to link a program,
11279 the GCC driver automatically links against @option{liblsan}.  If
11280 @file{liblsan} is available as a shared library, and the @option{-static}
11281 option is not used, then this links against the shared version of
11282 @file{liblsan}.  The @option{-static-liblsan} option directs the GCC
11283 driver to link @file{liblsan} statically, without necessarily linking
11284 other libraries statically.
11286 @item -static-libubsan
11287 @opindex static-libubsan
11288 When the @option{-fsanitize=undefined} option is used to link a program,
11289 the GCC driver automatically links against @option{libubsan}.  If
11290 @file{libubsan} is available as a shared library, and the @option{-static}
11291 option is not used, then this links against the shared version of
11292 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
11293 driver to link @file{libubsan} statically, without necessarily linking
11294 other libraries statically.
11296 @item -static-libmpx
11297 @opindex static-libmpx
11298 When the @option{-fcheck-pointer bounds} and @option{-mmpx} options are
11299 used to link a program, the GCC driver automatically links against
11300 @file{libmpx}.  If @file{libmpx} is available as a shared library,
11301 and the @option{-static} option is not used, then this links against
11302 the shared version of @file{libmpx}.  The @option{-static-libmpx}
11303 option directs the GCC driver to link @file{libmpx} statically,
11304 without necessarily linking other libraries statically.
11306 @item -static-libmpxwrappers
11307 @opindex static-libmpxwrappers
11308 When the @option{-fcheck-pointer bounds} and @option{-mmpx} options are used
11309 to link a program without also using @option{-fno-chkp-use-wrappers}, the
11310 GCC driver automatically links against @file{libmpxwrappers}.  If
11311 @file{libmpxwrappers} is available as a shared library, and the
11312 @option{-static} option is not used, then this links against the shared
11313 version of @file{libmpxwrappers}.  The @option{-static-libmpxwrappers}
11314 option directs the GCC driver to link @file{libmpxwrappers} statically,
11315 without necessarily linking other libraries statically.
11317 @item -static-libstdc++
11318 @opindex static-libstdc++
11319 When the @command{g++} program is used to link a C++ program, it
11320 normally automatically links against @option{libstdc++}.  If
11321 @file{libstdc++} is available as a shared library, and the
11322 @option{-static} option is not used, then this links against the
11323 shared version of @file{libstdc++}.  That is normally fine.  However, it
11324 is sometimes useful to freeze the version of @file{libstdc++} used by
11325 the program without going all the way to a fully static link.  The
11326 @option{-static-libstdc++} option directs the @command{g++} driver to
11327 link @file{libstdc++} statically, without necessarily linking other
11328 libraries statically.
11330 @item -symbolic
11331 @opindex symbolic
11332 Bind references to global symbols when building a shared object.  Warn
11333 about any unresolved references (unless overridden by the link editor
11334 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
11335 this option.
11337 @item -T @var{script}
11338 @opindex T
11339 @cindex linker script
11340 Use @var{script} as the linker script.  This option is supported by most
11341 systems using the GNU linker.  On some targets, such as bare-board
11342 targets without an operating system, the @option{-T} option may be required
11343 when linking to avoid references to undefined symbols.
11345 @item -Xlinker @var{option}
11346 @opindex Xlinker
11347 Pass @var{option} as an option to the linker.  You can use this to
11348 supply system-specific linker options that GCC does not recognize.
11350 If you want to pass an option that takes a separate argument, you must use
11351 @option{-Xlinker} twice, once for the option and once for the argument.
11352 For example, to pass @option{-assert definitions}, you must write
11353 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
11354 @option{-Xlinker "-assert definitions"}, because this passes the entire
11355 string as a single argument, which is not what the linker expects.
11357 When using the GNU linker, it is usually more convenient to pass
11358 arguments to linker options using the @option{@var{option}=@var{value}}
11359 syntax than as separate arguments.  For example, you can specify
11360 @option{-Xlinker -Map=output.map} rather than
11361 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
11362 this syntax for command-line options.
11364 @item -Wl,@var{option}
11365 @opindex Wl
11366 Pass @var{option} as an option to the linker.  If @var{option} contains
11367 commas, it is split into multiple options at the commas.  You can use this
11368 syntax to pass an argument to the option.
11369 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
11370 linker.  When using the GNU linker, you can also get the same effect with
11371 @option{-Wl,-Map=output.map}.
11373 @item -u @var{symbol}
11374 @opindex u
11375 Pretend the symbol @var{symbol} is undefined, to force linking of
11376 library modules to define it.  You can use @option{-u} multiple times with
11377 different symbols to force loading of additional library modules.
11379 @item -z @var{keyword}
11380 @opindex z
11381 @option{-z} is passed directly on to the linker along with the keyword
11382 @var{keyword}. See the section in the documentation of your linker for
11383 permitted values and their meanings.
11384 @end table
11386 @node Directory Options
11387 @section Options for Directory Search
11388 @cindex directory options
11389 @cindex options, directory search
11390 @cindex search path
11392 These options specify directories to search for header files, for
11393 libraries and for parts of the compiler:
11395 @table @gcctabopt
11396 @item -I@var{dir}
11397 @opindex I
11398 Add the directory @var{dir} to the head of the list of directories to be
11399 searched for header files.  This can be used to override a system header
11400 file, substituting your own version, since these directories are
11401 searched before the system header file directories.  However, you should
11402 not use this option to add directories that contain vendor-supplied
11403 system header files (use @option{-isystem} for that).  If you use more than
11404 one @option{-I} option, the directories are scanned in left-to-right
11405 order; the standard system directories come after.
11407 If a standard system include directory, or a directory specified with
11408 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
11409 option is ignored.  The directory is still searched but as a
11410 system directory at its normal position in the system include chain.
11411 This is to ensure that GCC's procedure to fix buggy system headers and
11412 the ordering for the @code{include_next} directive are not inadvertently changed.
11413 If you really need to change the search order for system directories,
11414 use the @option{-nostdinc} and/or @option{-isystem} options.
11416 @item -iplugindir=@var{dir}
11417 @opindex iplugindir=
11418 Set the directory to search for plugins that are passed
11419 by @option{-fplugin=@var{name}} instead of
11420 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
11421 to be used by the user, but only passed by the driver.
11423 @item -iquote@var{dir}
11424 @opindex iquote
11425 Add the directory @var{dir} to the head of the list of directories to
11426 be searched for header files only for the case of @code{#include
11427 "@var{file}"}; they are not searched for @code{#include <@var{file}>},
11428 otherwise just like @option{-I}.
11430 @item -L@var{dir}
11431 @opindex L
11432 Add directory @var{dir} to the list of directories to be searched
11433 for @option{-l}.
11435 @item -B@var{prefix}
11436 @opindex B
11437 This option specifies where to find the executables, libraries,
11438 include files, and data files of the compiler itself.
11440 The compiler driver program runs one or more of the subprograms
11441 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
11442 @var{prefix} as a prefix for each program it tries to run, both with and
11443 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
11445 For each subprogram to be run, the compiler driver first tries the
11446 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
11447 is not specified, the driver tries two standard prefixes, 
11448 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
11449 those results in a file name that is found, the unmodified program
11450 name is searched for using the directories specified in your
11451 @env{PATH} environment variable.
11453 The compiler checks to see if the path provided by @option{-B}
11454 refers to a directory, and if necessary it adds a directory
11455 separator character at the end of the path.
11457 @option{-B} prefixes that effectively specify directory names also apply
11458 to libraries in the linker, because the compiler translates these
11459 options into @option{-L} options for the linker.  They also apply to
11460 include files in the preprocessor, because the compiler translates these
11461 options into @option{-isystem} options for the preprocessor.  In this case,
11462 the compiler appends @samp{include} to the prefix.
11464 The runtime support file @file{libgcc.a} can also be searched for using
11465 the @option{-B} prefix, if needed.  If it is not found there, the two
11466 standard prefixes above are tried, and that is all.  The file is left
11467 out of the link if it is not found by those means.
11469 Another way to specify a prefix much like the @option{-B} prefix is to use
11470 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
11471 Variables}.
11473 As a special kludge, if the path provided by @option{-B} is
11474 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
11475 9, then it is replaced by @file{[dir/]include}.  This is to help
11476 with boot-strapping the compiler.
11478 @item -specs=@var{file}
11479 @opindex specs
11480 Process @var{file} after the compiler reads in the standard @file{specs}
11481 file, in order to override the defaults which the @command{gcc} driver
11482 program uses when determining what switches to pass to @command{cc1},
11483 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
11484 @option{-specs=@var{file}} can be specified on the command line, and they
11485 are processed in order, from left to right.
11487 @item --sysroot=@var{dir}
11488 @opindex sysroot
11489 Use @var{dir} as the logical root directory for headers and libraries.
11490 For example, if the compiler normally searches for headers in
11491 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
11492 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
11494 If you use both this option and the @option{-isysroot} option, then
11495 the @option{--sysroot} option applies to libraries, but the
11496 @option{-isysroot} option applies to header files.
11498 The GNU linker (beginning with version 2.16) has the necessary support
11499 for this option.  If your linker does not support this option, the
11500 header file aspect of @option{--sysroot} still works, but the
11501 library aspect does not.
11503 @item --no-sysroot-suffix
11504 @opindex no-sysroot-suffix
11505 For some targets, a suffix is added to the root directory specified
11506 with @option{--sysroot}, depending on the other options used, so that
11507 headers may for example be found in
11508 @file{@var{dir}/@var{suffix}/usr/include} instead of
11509 @file{@var{dir}/usr/include}.  This option disables the addition of
11510 such a suffix.
11512 @item -I-
11513 @opindex I-
11514 This option has been deprecated.  Please use @option{-iquote} instead for
11515 @option{-I} directories before the @option{-I-} and remove the @option{-I-}
11516 option.
11517 Any directories you specify with @option{-I} options before the @option{-I-}
11518 option are searched only for the case of @code{#include "@var{file}"};
11519 they are not searched for @code{#include <@var{file}>}.
11521 If additional directories are specified with @option{-I} options after
11522 the @option{-I-} option, these directories are searched for all @code{#include}
11523 directives.  (Ordinarily @emph{all} @option{-I} directories are used
11524 this way.)
11526 In addition, the @option{-I-} option inhibits the use of the current
11527 directory (where the current input file came from) as the first search
11528 directory for @code{#include "@var{file}"}.  There is no way to
11529 override this effect of @option{-I-}.  With @option{-I.} you can specify
11530 searching the directory that is current when the compiler is
11531 invoked.  That is not exactly the same as what the preprocessor does
11532 by default, but it is often satisfactory.
11534 @option{-I-} does not inhibit the use of the standard system directories
11535 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
11536 independent.
11537 @end table
11539 @c man end
11541 @node Spec Files
11542 @section Specifying Subprocesses and the Switches to Pass to Them
11543 @cindex Spec Files
11545 @command{gcc} is a driver program.  It performs its job by invoking a
11546 sequence of other programs to do the work of compiling, assembling and
11547 linking.  GCC interprets its command-line parameters and uses these to
11548 deduce which programs it should invoke, and which command-line options
11549 it ought to place on their command lines.  This behavior is controlled
11550 by @dfn{spec strings}.  In most cases there is one spec string for each
11551 program that GCC can invoke, but a few programs have multiple spec
11552 strings to control their behavior.  The spec strings built into GCC can
11553 be overridden by using the @option{-specs=} command-line switch to specify
11554 a spec file.
11556 @dfn{Spec files} are plaintext files that are used to construct spec
11557 strings.  They consist of a sequence of directives separated by blank
11558 lines.  The type of directive is determined by the first non-whitespace
11559 character on the line, which can be one of the following:
11561 @table @code
11562 @item %@var{command}
11563 Issues a @var{command} to the spec file processor.  The commands that can
11564 appear here are:
11566 @table @code
11567 @item %include <@var{file}>
11568 @cindex @code{%include}
11569 Search for @var{file} and insert its text at the current point in the
11570 specs file.
11572 @item %include_noerr <@var{file}>
11573 @cindex @code{%include_noerr}
11574 Just like @samp{%include}, but do not generate an error message if the include
11575 file cannot be found.
11577 @item %rename @var{old_name} @var{new_name}
11578 @cindex @code{%rename}
11579 Rename the spec string @var{old_name} to @var{new_name}.
11581 @end table
11583 @item *[@var{spec_name}]:
11584 This tells the compiler to create, override or delete the named spec
11585 string.  All lines after this directive up to the next directive or
11586 blank line are considered to be the text for the spec string.  If this
11587 results in an empty string then the spec is deleted.  (Or, if the
11588 spec did not exist, then nothing happens.)  Otherwise, if the spec
11589 does not currently exist a new spec is created.  If the spec does
11590 exist then its contents are overridden by the text of this
11591 directive, unless the first character of that text is the @samp{+}
11592 character, in which case the text is appended to the spec.
11594 @item [@var{suffix}]:
11595 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
11596 and up to the next directive or blank line are considered to make up the
11597 spec string for the indicated suffix.  When the compiler encounters an
11598 input file with the named suffix, it processes the spec string in
11599 order to work out how to compile that file.  For example:
11601 @smallexample
11602 .ZZ:
11603 z-compile -input %i
11604 @end smallexample
11606 This says that any input file whose name ends in @samp{.ZZ} should be
11607 passed to the program @samp{z-compile}, which should be invoked with the
11608 command-line switch @option{-input} and with the result of performing the
11609 @samp{%i} substitution.  (See below.)
11611 As an alternative to providing a spec string, the text following a
11612 suffix directive can be one of the following:
11614 @table @code
11615 @item @@@var{language}
11616 This says that the suffix is an alias for a known @var{language}.  This is
11617 similar to using the @option{-x} command-line switch to GCC to specify a
11618 language explicitly.  For example:
11620 @smallexample
11621 .ZZ:
11622 @@c++
11623 @end smallexample
11625 Says that .ZZ files are, in fact, C++ source files.
11627 @item #@var{name}
11628 This causes an error messages saying:
11630 @smallexample
11631 @var{name} compiler not installed on this system.
11632 @end smallexample
11633 @end table
11635 GCC already has an extensive list of suffixes built into it.
11636 This directive adds an entry to the end of the list of suffixes, but
11637 since the list is searched from the end backwards, it is effectively
11638 possible to override earlier entries using this technique.
11640 @end table
11642 GCC has the following spec strings built into it.  Spec files can
11643 override these strings or create their own.  Note that individual
11644 targets can also add their own spec strings to this list.
11646 @smallexample
11647 asm          Options to pass to the assembler
11648 asm_final    Options to pass to the assembler post-processor
11649 cpp          Options to pass to the C preprocessor
11650 cc1          Options to pass to the C compiler
11651 cc1plus      Options to pass to the C++ compiler
11652 endfile      Object files to include at the end of the link
11653 link         Options to pass to the linker
11654 lib          Libraries to include on the command line to the linker
11655 libgcc       Decides which GCC support library to pass to the linker
11656 linker       Sets the name of the linker
11657 predefines   Defines to be passed to the C preprocessor
11658 signed_char  Defines to pass to CPP to say whether @code{char} is signed
11659              by default
11660 startfile    Object files to include at the start of the link
11661 @end smallexample
11663 Here is a small example of a spec file:
11665 @smallexample
11666 %rename lib                 old_lib
11668 *lib:
11669 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
11670 @end smallexample
11672 This example renames the spec called @samp{lib} to @samp{old_lib} and
11673 then overrides the previous definition of @samp{lib} with a new one.
11674 The new definition adds in some extra command-line options before
11675 including the text of the old definition.
11677 @dfn{Spec strings} are a list of command-line options to be passed to their
11678 corresponding program.  In addition, the spec strings can contain
11679 @samp{%}-prefixed sequences to substitute variable text or to
11680 conditionally insert text into the command line.  Using these constructs
11681 it is possible to generate quite complex command lines.
11683 Here is a table of all defined @samp{%}-sequences for spec
11684 strings.  Note that spaces are not generated automatically around the
11685 results of expanding these sequences.  Therefore you can concatenate them
11686 together or combine them with constant text in a single argument.
11688 @table @code
11689 @item %%
11690 Substitute one @samp{%} into the program name or argument.
11692 @item %i
11693 Substitute the name of the input file being processed.
11695 @item %b
11696 Substitute the basename of the input file being processed.
11697 This is the substring up to (and not including) the last period
11698 and not including the directory.
11700 @item %B
11701 This is the same as @samp{%b}, but include the file suffix (text after
11702 the last period).
11704 @item %d
11705 Marks the argument containing or following the @samp{%d} as a
11706 temporary file name, so that that file is deleted if GCC exits
11707 successfully.  Unlike @samp{%g}, this contributes no text to the
11708 argument.
11710 @item %g@var{suffix}
11711 Substitute a file name that has suffix @var{suffix} and is chosen
11712 once per compilation, and mark the argument in the same way as
11713 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
11714 name is now chosen in a way that is hard to predict even when previously
11715 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
11716 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
11717 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
11718 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
11719 was simply substituted with a file name chosen once per compilation,
11720 without regard to any appended suffix (which was therefore treated
11721 just like ordinary text), making such attacks more likely to succeed.
11723 @item %u@var{suffix}
11724 Like @samp{%g}, but generates a new temporary file name
11725 each time it appears instead of once per compilation.
11727 @item %U@var{suffix}
11728 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
11729 new one if there is no such last file name.  In the absence of any
11730 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
11731 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
11732 involves the generation of two distinct file names, one
11733 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
11734 simply substituted with a file name chosen for the previous @samp{%u},
11735 without regard to any appended suffix.
11737 @item %j@var{suffix}
11738 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
11739 writable, and if @option{-save-temps} is not used; 
11740 otherwise, substitute the name
11741 of a temporary file, just like @samp{%u}.  This temporary file is not
11742 meant for communication between processes, but rather as a junk
11743 disposal mechanism.
11745 @item %|@var{suffix}
11746 @itemx %m@var{suffix}
11747 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
11748 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
11749 all.  These are the two most common ways to instruct a program that it
11750 should read from standard input or write to standard output.  If you
11751 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
11752 construct: see for example @file{f/lang-specs.h}.
11754 @item %.@var{SUFFIX}
11755 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
11756 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
11757 terminated by the next space or %.
11759 @item %w
11760 Marks the argument containing or following the @samp{%w} as the
11761 designated output file of this compilation.  This puts the argument
11762 into the sequence of arguments that @samp{%o} substitutes.
11764 @item %o
11765 Substitutes the names of all the output files, with spaces
11766 automatically placed around them.  You should write spaces
11767 around the @samp{%o} as well or the results are undefined.
11768 @samp{%o} is for use in the specs for running the linker.
11769 Input files whose names have no recognized suffix are not compiled
11770 at all, but they are included among the output files, so they are
11771 linked.
11773 @item %O
11774 Substitutes the suffix for object files.  Note that this is
11775 handled specially when it immediately follows @samp{%g, %u, or %U},
11776 because of the need for those to form complete file names.  The
11777 handling is such that @samp{%O} is treated exactly as if it had already
11778 been substituted, except that @samp{%g, %u, and %U} do not currently
11779 support additional @var{suffix} characters following @samp{%O} as they do
11780 following, for example, @samp{.o}.
11782 @item %p
11783 Substitutes the standard macro predefinitions for the
11784 current target machine.  Use this when running @command{cpp}.
11786 @item %P
11787 Like @samp{%p}, but puts @samp{__} before and after the name of each
11788 predefined macro, except for macros that start with @samp{__} or with
11789 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
11792 @item %I
11793 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
11794 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
11795 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
11796 and @option{-imultilib} as necessary.
11798 @item %s
11799 Current argument is the name of a library or startup file of some sort.
11800 Search for that file in a standard list of directories and substitute
11801 the full name found.  The current working directory is included in the
11802 list of directories scanned.
11804 @item %T
11805 Current argument is the name of a linker script.  Search for that file
11806 in the current list of directories to scan for libraries. If the file
11807 is located insert a @option{--script} option into the command line
11808 followed by the full path name found.  If the file is not found then
11809 generate an error message.  Note: the current working directory is not
11810 searched.
11812 @item %e@var{str}
11813 Print @var{str} as an error message.  @var{str} is terminated by a newline.
11814 Use this when inconsistent options are detected.
11816 @item %(@var{name})
11817 Substitute the contents of spec string @var{name} at this point.
11819 @item %x@{@var{option}@}
11820 Accumulate an option for @samp{%X}.
11822 @item %X
11823 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
11824 spec string.
11826 @item %Y
11827 Output the accumulated assembler options specified by @option{-Wa}.
11829 @item %Z
11830 Output the accumulated preprocessor options specified by @option{-Wp}.
11832 @item %a
11833 Process the @code{asm} spec.  This is used to compute the
11834 switches to be passed to the assembler.
11836 @item %A
11837 Process the @code{asm_final} spec.  This is a spec string for
11838 passing switches to an assembler post-processor, if such a program is
11839 needed.
11841 @item %l
11842 Process the @code{link} spec.  This is the spec for computing the
11843 command line passed to the linker.  Typically it makes use of the
11844 @samp{%L %G %S %D and %E} sequences.
11846 @item %D
11847 Dump out a @option{-L} option for each directory that GCC believes might
11848 contain startup files.  If the target supports multilibs then the
11849 current multilib directory is prepended to each of these paths.
11851 @item %L
11852 Process the @code{lib} spec.  This is a spec string for deciding which
11853 libraries are included on the command line to the linker.
11855 @item %G
11856 Process the @code{libgcc} spec.  This is a spec string for deciding
11857 which GCC support library is included on the command line to the linker.
11859 @item %S
11860 Process the @code{startfile} spec.  This is a spec for deciding which
11861 object files are the first ones passed to the linker.  Typically
11862 this might be a file named @file{crt0.o}.
11864 @item %E
11865 Process the @code{endfile} spec.  This is a spec string that specifies
11866 the last object files that are passed to the linker.
11868 @item %C
11869 Process the @code{cpp} spec.  This is used to construct the arguments
11870 to be passed to the C preprocessor.
11872 @item %1
11873 Process the @code{cc1} spec.  This is used to construct the options to be
11874 passed to the actual C compiler (@command{cc1}).
11876 @item %2
11877 Process the @code{cc1plus} spec.  This is used to construct the options to be
11878 passed to the actual C++ compiler (@command{cc1plus}).
11880 @item %*
11881 Substitute the variable part of a matched option.  See below.
11882 Note that each comma in the substituted string is replaced by
11883 a single space.
11885 @item %<@code{S}
11886 Remove all occurrences of @code{-S} from the command line.  Note---this
11887 command is position dependent.  @samp{%} commands in the spec string
11888 before this one see @code{-S}, @samp{%} commands in the spec string
11889 after this one do not.
11891 @item %:@var{function}(@var{args})
11892 Call the named function @var{function}, passing it @var{args}.
11893 @var{args} is first processed as a nested spec string, then split
11894 into an argument vector in the usual fashion.  The function returns
11895 a string which is processed as if it had appeared literally as part
11896 of the current spec.
11898 The following built-in spec functions are provided:
11900 @table @code
11901 @item @code{getenv}
11902 The @code{getenv} spec function takes two arguments: an environment
11903 variable name and a string.  If the environment variable is not
11904 defined, a fatal error is issued.  Otherwise, the return value is the
11905 value of the environment variable concatenated with the string.  For
11906 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
11908 @smallexample
11909 %:getenv(TOPDIR /include)
11910 @end smallexample
11912 expands to @file{/path/to/top/include}.
11914 @item @code{if-exists}
11915 The @code{if-exists} spec function takes one argument, an absolute
11916 pathname to a file.  If the file exists, @code{if-exists} returns the
11917 pathname.  Here is a small example of its usage:
11919 @smallexample
11920 *startfile:
11921 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
11922 @end smallexample
11924 @item @code{if-exists-else}
11925 The @code{if-exists-else} spec function is similar to the @code{if-exists}
11926 spec function, except that it takes two arguments.  The first argument is
11927 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
11928 returns the pathname.  If it does not exist, it returns the second argument.
11929 This way, @code{if-exists-else} can be used to select one file or another,
11930 based on the existence of the first.  Here is a small example of its usage:
11932 @smallexample
11933 *startfile:
11934 crt0%O%s %:if-exists(crti%O%s) \
11935 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
11936 @end smallexample
11938 @item @code{replace-outfile}
11939 The @code{replace-outfile} spec function takes two arguments.  It looks for the
11940 first argument in the outfiles array and replaces it with the second argument.  Here
11941 is a small example of its usage:
11943 @smallexample
11944 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
11945 @end smallexample
11947 @item @code{remove-outfile}
11948 The @code{remove-outfile} spec function takes one argument.  It looks for the
11949 first argument in the outfiles array and removes it.  Here is a small example
11950 its usage:
11952 @smallexample
11953 %:remove-outfile(-lm)
11954 @end smallexample
11956 @item @code{pass-through-libs}
11957 The @code{pass-through-libs} spec function takes any number of arguments.  It
11958 finds any @option{-l} options and any non-options ending in @file{.a} (which it
11959 assumes are the names of linker input library archive files) and returns a
11960 result containing all the found arguments each prepended by
11961 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
11962 intended to be passed to the LTO linker plugin.
11964 @smallexample
11965 %:pass-through-libs(%G %L %G)
11966 @end smallexample
11968 @item @code{print-asm-header}
11969 The @code{print-asm-header} function takes no arguments and simply
11970 prints a banner like:
11972 @smallexample
11973 Assembler options
11974 =================
11976 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
11977 @end smallexample
11979 It is used to separate compiler options from assembler options
11980 in the @option{--target-help} output.
11981 @end table
11983 @item %@{@code{S}@}
11984 Substitutes the @code{-S} switch, if that switch is given to GCC@.
11985 If that switch is not specified, this substitutes nothing.  Note that
11986 the leading dash is omitted when specifying this option, and it is
11987 automatically inserted if the substitution is performed.  Thus the spec
11988 string @samp{%@{foo@}} matches the command-line option @option{-foo}
11989 and outputs the command-line option @option{-foo}.
11991 @item %W@{@code{S}@}
11992 Like %@{@code{S}@} but mark last argument supplied within as a file to be
11993 deleted on failure.
11995 @item %@{@code{S}*@}
11996 Substitutes all the switches specified to GCC whose names start
11997 with @code{-S}, but which also take an argument.  This is used for
11998 switches like @option{-o}, @option{-D}, @option{-I}, etc.
11999 GCC considers @option{-o foo} as being
12000 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
12001 text, including the space.  Thus two arguments are generated.
12003 @item %@{@code{S}*&@code{T}*@}
12004 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
12005 (the order of @code{S} and @code{T} in the spec is not significant).
12006 There can be any number of ampersand-separated variables; for each the
12007 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
12009 @item %@{@code{S}:@code{X}@}
12010 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
12012 @item %@{!@code{S}:@code{X}@}
12013 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
12015 @item %@{@code{S}*:@code{X}@}
12016 Substitutes @code{X} if one or more switches whose names start with
12017 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
12018 once, no matter how many such switches appeared.  However, if @code{%*}
12019 appears somewhere in @code{X}, then @code{X} is substituted once
12020 for each matching switch, with the @code{%*} replaced by the part of
12021 that switch matching the @code{*}.
12023 If @code{%*} appears as the last part of a spec sequence then a space
12024 is added after the end of the last substitution.  If there is more
12025 text in the sequence, however, then a space is not generated.  This
12026 allows the @code{%*} substitution to be used as part of a larger
12027 string.  For example, a spec string like this:
12029 @smallexample
12030 %@{mcu=*:--script=%*/memory.ld@}
12031 @end smallexample
12033 @noindent
12034 when matching an option like @option{-mcu=newchip} produces:
12036 @smallexample
12037 --script=newchip/memory.ld
12038 @end smallexample
12040 @item %@{.@code{S}:@code{X}@}
12041 Substitutes @code{X}, if processing a file with suffix @code{S}.
12043 @item %@{!.@code{S}:@code{X}@}
12044 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
12046 @item %@{,@code{S}:@code{X}@}
12047 Substitutes @code{X}, if processing a file for language @code{S}.
12049 @item %@{!,@code{S}:@code{X}@}
12050 Substitutes @code{X}, if not processing a file for language @code{S}.
12052 @item %@{@code{S}|@code{P}:@code{X}@}
12053 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
12054 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
12055 @code{*} sequences as well, although they have a stronger binding than
12056 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
12057 alternatives must be starred, and only the first matching alternative
12058 is substituted.
12060 For example, a spec string like this:
12062 @smallexample
12063 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
12064 @end smallexample
12066 @noindent
12067 outputs the following command-line options from the following input
12068 command-line options:
12070 @smallexample
12071 fred.c        -foo -baz
12072 jim.d         -bar -boggle
12073 -d fred.c     -foo -baz -boggle
12074 -d jim.d      -bar -baz -boggle
12075 @end smallexample
12077 @item %@{S:X; T:Y; :D@}
12079 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
12080 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
12081 be as many clauses as you need.  This may be combined with @code{.},
12082 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
12085 @end table
12087 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
12088 construct may contain other nested @samp{%} constructs or spaces, or
12089 even newlines.  They are processed as usual, as described above.
12090 Trailing white space in @code{X} is ignored.  White space may also
12091 appear anywhere on the left side of the colon in these constructs,
12092 except between @code{.} or @code{*} and the corresponding word.
12094 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
12095 handled specifically in these constructs.  If another value of
12096 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
12097 @option{-W} switch is found later in the command line, the earlier
12098 switch value is ignored, except with @{@code{S}*@} where @code{S} is
12099 just one letter, which passes all matching options.
12101 The character @samp{|} at the beginning of the predicate text is used to
12102 indicate that a command should be piped to the following command, but
12103 only if @option{-pipe} is specified.
12105 It is built into GCC which switches take arguments and which do not.
12106 (You might think it would be useful to generalize this to allow each
12107 compiler's spec to say which switches take arguments.  But this cannot
12108 be done in a consistent fashion.  GCC cannot even decide which input
12109 files have been specified without knowing which switches take arguments,
12110 and it must know which input files to compile in order to tell which
12111 compilers to run).
12113 GCC also knows implicitly that arguments starting in @option{-l} are to be
12114 treated as compiler output files, and passed to the linker in their
12115 proper position among the other output files.
12117 @c man begin OPTIONS
12119 @node Target Options
12120 @section Specifying Target Machine and Compiler Version
12121 @cindex target options
12122 @cindex cross compiling
12123 @cindex specifying machine version
12124 @cindex specifying compiler version and target machine
12125 @cindex compiler version, specifying
12126 @cindex target machine, specifying
12128 The usual way to run GCC is to run the executable called @command{gcc}, or
12129 @command{@var{machine}-gcc} when cross-compiling, or
12130 @command{@var{machine}-gcc-@var{version}} to run a version other than the
12131 one that was installed last.
12133 @node Submodel Options
12134 @section Hardware Models and Configurations
12135 @cindex submodel options
12136 @cindex specifying hardware config
12137 @cindex hardware models and configurations, specifying
12138 @cindex machine dependent options
12140 Each target machine types can have its own
12141 special options, starting with @samp{-m}, to choose among various
12142 hardware models or configurations---for example, 68010 vs 68020,
12143 floating coprocessor or none.  A single installed version of the
12144 compiler can compile for any model or configuration, according to the
12145 options specified.
12147 Some configurations of the compiler also support additional special
12148 options, usually for compatibility with other compilers on the same
12149 platform.
12151 @c This list is ordered alphanumerically by subsection name.
12152 @c It should be the same order and spelling as these options are listed
12153 @c in Machine Dependent Options
12155 @menu
12156 * AArch64 Options::
12157 * Adapteva Epiphany Options::
12158 * ARC Options::
12159 * ARM Options::
12160 * AVR Options::
12161 * Blackfin Options::
12162 * C6X Options::
12163 * CRIS Options::
12164 * CR16 Options::
12165 * Darwin Options::
12166 * DEC Alpha Options::
12167 * FR30 Options::
12168 * FRV Options::
12169 * GNU/Linux Options::
12170 * H8/300 Options::
12171 * HPPA Options::
12172 * IA-64 Options::
12173 * LM32 Options::
12174 * M32C Options::
12175 * M32R/D Options::
12176 * M680x0 Options::
12177 * MCore Options::
12178 * MeP Options::
12179 * MicroBlaze Options::
12180 * MIPS Options::
12181 * MMIX Options::
12182 * MN10300 Options::
12183 * Moxie Options::
12184 * MSP430 Options::
12185 * NDS32 Options::
12186 * Nios II Options::
12187 * Nvidia PTX Options::
12188 * PDP-11 Options::
12189 * picoChip Options::
12190 * PowerPC Options::
12191 * RL78 Options::
12192 * RS/6000 and PowerPC Options::
12193 * RX Options::
12194 * S/390 and zSeries Options::
12195 * Score Options::
12196 * SH Options::
12197 * Solaris 2 Options::
12198 * SPARC Options::
12199 * SPU Options::
12200 * System V Options::
12201 * TILE-Gx Options::
12202 * TILEPro Options::
12203 * V850 Options::
12204 * VAX Options::
12205 * Visium Options::
12206 * VMS Options::
12207 * VxWorks Options::
12208 * x86 Options::
12209 * x86 Windows Options::
12210 * Xstormy16 Options::
12211 * Xtensa Options::
12212 * zSeries Options::
12213 @end menu
12215 @node AArch64 Options
12216 @subsection AArch64 Options
12217 @cindex AArch64 Options
12219 These options are defined for AArch64 implementations:
12221 @table @gcctabopt
12223 @item -mabi=@var{name}
12224 @opindex mabi
12225 Generate code for the specified data model.  Permissible values
12226 are @samp{ilp32} for SysV-like data model where int, long int and pointer
12227 are 32-bit, and @samp{lp64} for SysV-like data model where int is 32-bit,
12228 but long int and pointer are 64-bit.
12230 The default depends on the specific target configuration.  Note that
12231 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
12232 entire program with the same ABI, and link with a compatible set of libraries.
12234 @item -mbig-endian
12235 @opindex mbig-endian
12236 Generate big-endian code.  This is the default when GCC is configured for an
12237 @samp{aarch64_be-*-*} target.
12239 @item -mgeneral-regs-only
12240 @opindex mgeneral-regs-only
12241 Generate code which uses only the general registers.
12243 @item -mlittle-endian
12244 @opindex mlittle-endian
12245 Generate little-endian code.  This is the default when GCC is configured for an
12246 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
12248 @item -mcmodel=tiny
12249 @opindex mcmodel=tiny
12250 Generate code for the tiny code model.  The program and its statically defined
12251 symbols must be within 1GB of each other.  Pointers are 64 bits.  Programs can
12252 be statically or dynamically linked.  This model is not fully implemented and
12253 mostly treated as @samp{small}.
12255 @item -mcmodel=small
12256 @opindex mcmodel=small
12257 Generate code for the small code model.  The program and its statically defined
12258 symbols must be within 4GB of each other.  Pointers are 64 bits.  Programs can
12259 be statically or dynamically linked.  This is the default code model.
12261 @item -mcmodel=large
12262 @opindex mcmodel=large
12263 Generate code for the large code model.  This makes no assumptions about
12264 addresses and sizes of sections.  Pointers are 64 bits.  Programs can be
12265 statically linked only.
12267 @item -mstrict-align
12268 @opindex mstrict-align
12269 Do not assume that unaligned memory references are handled by the system.
12271 @item -momit-leaf-frame-pointer
12272 @itemx -mno-omit-leaf-frame-pointer
12273 @opindex momit-leaf-frame-pointer
12274 @opindex mno-omit-leaf-frame-pointer
12275 Omit or keep the frame pointer in leaf functions.  The former behaviour is the
12276 default.
12278 @item -mtls-dialect=desc
12279 @opindex mtls-dialect=desc
12280 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
12281 of TLS variables.  This is the default.
12283 @item -mtls-dialect=traditional
12284 @opindex mtls-dialect=traditional
12285 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
12286 of TLS variables.
12288 @item -mfix-cortex-a53-835769
12289 @itemx -mno-fix-cortex-a53-835769
12290 @opindex mfix-cortex-a53-835769
12291 @opindex mno-fix-cortex-a53-835769
12292 Enable or disable the workaround for the ARM Cortex-A53 erratum number 835769.
12293 This involves inserting a NOP instruction between memory instructions and
12294 64-bit integer multiply-accumulate instructions.
12296 @item -march=@var{name}
12297 @opindex march
12298 Specify the name of the target architecture, optionally suffixed by one or
12299 more feature modifiers.  This option has the form
12300 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
12301 only permissible value for @var{arch} is @samp{armv8-a}.  The permissible
12302 values for @var{feature} are documented in the sub-section below.
12304 Where conflicting feature modifiers are specified, the right-most feature is
12305 used.
12307 GCC uses this name to determine what kind of instructions it can emit when
12308 generating assembly code.
12310 Where @option{-march} is specified without either of @option{-mtune}
12311 or @option{-mcpu} also being specified, the code is tuned to perform
12312 well across a range of target processors implementing the target
12313 architecture.
12315 @item -mtune=@var{name}
12316 @opindex mtune
12317 Specify the name of the target processor for which GCC should tune the
12318 performance of the code.  Permissible values for this option are:
12319 @samp{generic}, @samp{cortex-a53}, @samp{cortex-a57},
12320 @samp{cortex-a72}, @samp{thunderx}, @samp{xgene1}.
12322 Additionally, this option can specify that GCC should tune the performance
12323 of the code for a big.LITTLE system.  Permissible values for this
12324 option are: @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53}.
12326 Where none of @option{-mtune=}, @option{-mcpu=} or @option{-march=}
12327 are specified, the code is tuned to perform well across a range
12328 of target processors.
12330 This option cannot be suffixed by feature modifiers.
12332 @item -mcpu=@var{name}
12333 @opindex mcpu
12334 Specify the name of the target processor, optionally suffixed by one or more
12335 feature modifiers.  This option has the form
12336 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
12337 permissible values for @var{cpu} are the same as those available for
12338 @option{-mtune}.
12340 The permissible values for @var{feature} are documented in the sub-section
12341 below.
12343 Where conflicting feature modifiers are specified, the right-most feature is
12344 used.
12346 GCC uses this name to determine what kind of instructions it can emit when
12347 generating assembly code (as if by @option{-march}) and to determine
12348 the target processor for which to tune for performance (as if
12349 by @option{-mtune}).  Where this option is used in conjunction
12350 with @option{-march} or @option{-mtune}, those options take precedence
12351 over the appropriate part of this option.
12352 @end table
12354 @subsubsection @option{-march} and @option{-mcpu} Feature Modifiers
12355 @cindex @option{-march} feature modifiers
12356 @cindex @option{-mcpu} feature modifiers
12357 Feature modifiers used with @option{-march} and @option{-mcpu} can be one
12358 the following:
12360 @table @samp
12361 @item crc
12362 Enable CRC extension.
12363 @item crypto
12364 Enable Crypto extension.  This implies Advanced SIMD is enabled.
12365 @item fp
12366 Enable floating-point instructions.
12367 @item simd
12368 Enable Advanced SIMD instructions.  This implies floating-point instructions
12369 are enabled.  This is the default for all current possible values for options
12370 @option{-march} and @option{-mcpu=}.
12371 @end table
12373 @node Adapteva Epiphany Options
12374 @subsection Adapteva Epiphany Options
12376 These @samp{-m} options are defined for Adapteva Epiphany:
12378 @table @gcctabopt
12379 @item -mhalf-reg-file
12380 @opindex mhalf-reg-file
12381 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
12382 That allows code to run on hardware variants that lack these registers.
12384 @item -mprefer-short-insn-regs
12385 @opindex mprefer-short-insn-regs
12386 Preferrentially allocate registers that allow short instruction generation.
12387 This can result in increased instruction count, so this may either reduce or
12388 increase overall code size.
12390 @item -mbranch-cost=@var{num}
12391 @opindex mbranch-cost
12392 Set the cost of branches to roughly @var{num} ``simple'' instructions.
12393 This cost is only a heuristic and is not guaranteed to produce
12394 consistent results across releases.
12396 @item -mcmove
12397 @opindex mcmove
12398 Enable the generation of conditional moves.
12400 @item -mnops=@var{num}
12401 @opindex mnops
12402 Emit @var{num} NOPs before every other generated instruction.
12404 @item -mno-soft-cmpsf
12405 @opindex mno-soft-cmpsf
12406 For single-precision floating-point comparisons, emit an @code{fsub} instruction
12407 and test the flags.  This is faster than a software comparison, but can
12408 get incorrect results in the presence of NaNs, or when two different small
12409 numbers are compared such that their difference is calculated as zero.
12410 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
12411 software comparisons.
12413 @item -mstack-offset=@var{num}
12414 @opindex mstack-offset
12415 Set the offset between the top of the stack and the stack pointer.
12416 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
12417 can be used by leaf functions without stack allocation.
12418 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
12419 Note also that this option changes the ABI; compiling a program with a
12420 different stack offset than the libraries have been compiled with
12421 generally does not work.
12422 This option can be useful if you want to evaluate if a different stack
12423 offset would give you better code, but to actually use a different stack
12424 offset to build working programs, it is recommended to configure the
12425 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
12427 @item -mno-round-nearest
12428 @opindex mno-round-nearest
12429 Make the scheduler assume that the rounding mode has been set to
12430 truncating.  The default is @option{-mround-nearest}.
12432 @item -mlong-calls
12433 @opindex mlong-calls
12434 If not otherwise specified by an attribute, assume all calls might be beyond
12435 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
12436 function address into a register before performing a (otherwise direct) call.
12437 This is the default.
12439 @item -mshort-calls
12440 @opindex short-calls
12441 If not otherwise specified by an attribute, assume all direct calls are
12442 in the range of the @code{b} / @code{bl} instructions, so use these instructions
12443 for direct calls.  The default is @option{-mlong-calls}.
12445 @item -msmall16
12446 @opindex msmall16
12447 Assume addresses can be loaded as 16-bit unsigned values.  This does not
12448 apply to function addresses for which @option{-mlong-calls} semantics
12449 are in effect.
12451 @item -mfp-mode=@var{mode}
12452 @opindex mfp-mode
12453 Set the prevailing mode of the floating-point unit.
12454 This determines the floating-point mode that is provided and expected
12455 at function call and return time.  Making this mode match the mode you
12456 predominantly need at function start can make your programs smaller and
12457 faster by avoiding unnecessary mode switches.
12459 @var{mode} can be set to one the following values:
12461 @table @samp
12462 @item caller
12463 Any mode at function entry is valid, and retained or restored when
12464 the function returns, and when it calls other functions.
12465 This mode is useful for compiling libraries or other compilation units
12466 you might want to incorporate into different programs with different
12467 prevailing FPU modes, and the convenience of being able to use a single
12468 object file outweighs the size and speed overhead for any extra
12469 mode switching that might be needed, compared with what would be needed
12470 with a more specific choice of prevailing FPU mode.
12472 @item truncate
12473 This is the mode used for floating-point calculations with
12474 truncating (i.e.@: round towards zero) rounding mode.  That includes
12475 conversion from floating point to integer.
12477 @item round-nearest
12478 This is the mode used for floating-point calculations with
12479 round-to-nearest-or-even rounding mode.
12481 @item int
12482 This is the mode used to perform integer calculations in the FPU, e.g.@:
12483 integer multiply, or integer multiply-and-accumulate.
12484 @end table
12486 The default is @option{-mfp-mode=caller}
12488 @item -mnosplit-lohi
12489 @itemx -mno-postinc
12490 @itemx -mno-postmodify
12491 @opindex mnosplit-lohi
12492 @opindex mno-postinc
12493 @opindex mno-postmodify
12494 Code generation tweaks that disable, respectively, splitting of 32-bit
12495 loads, generation of post-increment addresses, and generation of
12496 post-modify addresses.  The defaults are @option{msplit-lohi},
12497 @option{-mpost-inc}, and @option{-mpost-modify}.
12499 @item -mnovect-double
12500 @opindex mno-vect-double
12501 Change the preferred SIMD mode to SImode.  The default is
12502 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
12504 @item -max-vect-align=@var{num}
12505 @opindex max-vect-align
12506 The maximum alignment for SIMD vector mode types.
12507 @var{num} may be 4 or 8.  The default is 8.
12508 Note that this is an ABI change, even though many library function
12509 interfaces are unaffected if they don't use SIMD vector modes
12510 in places that affect size and/or alignment of relevant types.
12512 @item -msplit-vecmove-early
12513 @opindex msplit-vecmove-early
12514 Split vector moves into single word moves before reload.  In theory this
12515 can give better register allocation, but so far the reverse seems to be
12516 generally the case.
12518 @item -m1reg-@var{reg}
12519 @opindex m1reg-
12520 Specify a register to hold the constant @minus{}1, which makes loading small negative
12521 constants and certain bitmasks faster.
12522 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
12523 which specify use of that register as a fixed register,
12524 and @samp{none}, which means that no register is used for this
12525 purpose.  The default is @option{-m1reg-none}.
12527 @end table
12529 @node ARC Options
12530 @subsection ARC Options
12531 @cindex ARC options
12533 The following options control the architecture variant for which code
12534 is being compiled:
12536 @c architecture variants
12537 @table @gcctabopt
12539 @item -mbarrel-shifter
12540 @opindex mbarrel-shifter
12541 Generate instructions supported by barrel shifter.  This is the default
12542 unless @option{-mcpu=ARC601} is in effect.
12544 @item -mcpu=@var{cpu}
12545 @opindex mcpu
12546 Set architecture type, register usage, and instruction scheduling
12547 parameters for @var{cpu}.  There are also shortcut alias options
12548 available for backward compatibility and convenience.  Supported
12549 values for @var{cpu} are
12551 @table @samp
12552 @opindex mA6
12553 @opindex mARC600
12554 @item ARC600
12555 Compile for ARC600.  Aliases: @option{-mA6}, @option{-mARC600}.
12557 @item ARC601
12558 @opindex mARC601
12559 Compile for ARC601.  Alias: @option{-mARC601}.
12561 @item ARC700
12562 @opindex mA7
12563 @opindex mARC700
12564 Compile for ARC700.  Aliases: @option{-mA7}, @option{-mARC700}.
12565 This is the default when configured with @option{--with-cpu=arc700}@.
12566 @end table
12568 @item -mdpfp
12569 @opindex mdpfp
12570 @itemx -mdpfp-compact
12571 @opindex mdpfp-compact
12572 FPX: Generate Double Precision FPX instructions, tuned for the compact
12573 implementation.
12575 @item -mdpfp-fast
12576 @opindex mdpfp-fast
12577 FPX: Generate Double Precision FPX instructions, tuned for the fast
12578 implementation.
12580 @item -mno-dpfp-lrsr
12581 @opindex mno-dpfp-lrsr
12582 Disable LR and SR instructions from using FPX extension aux registers.
12584 @item -mea
12585 @opindex mea
12586 Generate Extended arithmetic instructions.  Currently only
12587 @code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are
12588 supported.  This is always enabled for @option{-mcpu=ARC700}.
12590 @item -mno-mpy
12591 @opindex mno-mpy
12592 Do not generate mpy instructions for ARC700.
12594 @item -mmul32x16
12595 @opindex mmul32x16
12596 Generate 32x16 bit multiply and mac instructions.
12598 @item -mmul64
12599 @opindex mmul64
12600 Generate mul64 and mulu64 instructions.  Only valid for @option{-mcpu=ARC600}.
12602 @item -mnorm
12603 @opindex mnorm
12604 Generate norm instruction.  This is the default if @option{-mcpu=ARC700}
12605 is in effect.
12607 @item -mspfp
12608 @opindex mspfp
12609 @itemx -mspfp-compact
12610 @opindex mspfp-compact
12611 FPX: Generate Single Precision FPX instructions, tuned for the compact
12612 implementation.
12614 @item -mspfp-fast
12615 @opindex mspfp-fast
12616 FPX: Generate Single Precision FPX instructions, tuned for the fast
12617 implementation.
12619 @item -msimd
12620 @opindex msimd
12621 Enable generation of ARC SIMD instructions via target-specific
12622 builtins.  Only valid for @option{-mcpu=ARC700}.
12624 @item -msoft-float
12625 @opindex msoft-float
12626 This option ignored; it is provided for compatibility purposes only.
12627 Software floating point code is emitted by default, and this default
12628 can overridden by FPX options; @samp{mspfp}, @samp{mspfp-compact}, or
12629 @samp{mspfp-fast} for single precision, and @samp{mdpfp},
12630 @samp{mdpfp-compact}, or @samp{mdpfp-fast} for double precision.
12632 @item -mswap
12633 @opindex mswap
12634 Generate swap instructions.
12636 @end table
12638 The following options are passed through to the assembler, and also
12639 define preprocessor macro symbols.
12641 @c Flags used by the assembler, but for which we define preprocessor
12642 @c macro symbols as well.
12643 @table @gcctabopt
12644 @item -mdsp-packa
12645 @opindex mdsp-packa
12646 Passed down to the assembler to enable the DSP Pack A extensions.
12647 Also sets the preprocessor symbol @code{__Xdsp_packa}.
12649 @item -mdvbf
12650 @opindex mdvbf
12651 Passed down to the assembler to enable the dual viterbi butterfly
12652 extension.  Also sets the preprocessor symbol @code{__Xdvbf}.
12654 @c ARC700 4.10 extension instruction
12655 @item -mlock
12656 @opindex mlock
12657 Passed down to the assembler to enable the Locked Load/Store
12658 Conditional extension.  Also sets the preprocessor symbol
12659 @code{__Xlock}.
12661 @item -mmac-d16
12662 @opindex mmac-d16
12663 Passed down to the assembler.  Also sets the preprocessor symbol
12664 @code{__Xxmac_d16}.
12666 @item -mmac-24
12667 @opindex mmac-24
12668 Passed down to the assembler.  Also sets the preprocessor symbol
12669 @code{__Xxmac_24}.
12671 @c ARC700 4.10 extension instruction
12672 @item -mrtsc
12673 @opindex mrtsc
12674 Passed down to the assembler to enable the 64-bit Time-Stamp Counter
12675 extension instruction.  Also sets the preprocessor symbol
12676 @code{__Xrtsc}.
12678 @c ARC700 4.10 extension instruction
12679 @item -mswape
12680 @opindex mswape
12681 Passed down to the assembler to enable the swap byte ordering
12682 extension instruction.  Also sets the preprocessor symbol
12683 @code{__Xswape}.
12685 @item -mtelephony
12686 @opindex mtelephony
12687 Passed down to the assembler to enable dual and single operand
12688 instructions for telephony.  Also sets the preprocessor symbol
12689 @code{__Xtelephony}.
12691 @item -mxy
12692 @opindex mxy
12693 Passed down to the assembler to enable the XY Memory extension.  Also
12694 sets the preprocessor symbol @code{__Xxy}.
12696 @end table
12698 The following options control how the assembly code is annotated:
12700 @c Assembly annotation options
12701 @table @gcctabopt
12702 @item -misize
12703 @opindex misize
12704 Annotate assembler instructions with estimated addresses.
12706 @item -mannotate-align
12707 @opindex mannotate-align
12708 Explain what alignment considerations lead to the decision to make an
12709 instruction short or long.
12711 @end table
12713 The following options are passed through to the linker:
12715 @c options passed through to the linker
12716 @table @gcctabopt
12717 @item -marclinux
12718 @opindex marclinux
12719 Passed through to the linker, to specify use of the @code{arclinux} emulation.
12720 This option is enabled by default in tool chains built for
12721 @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets
12722 when profiling is not requested.
12724 @item -marclinux_prof
12725 @opindex marclinux_prof
12726 Passed through to the linker, to specify use of the
12727 @code{arclinux_prof} emulation.  This option is enabled by default in
12728 tool chains built for @w{@code{arc-linux-uclibc}} and
12729 @w{@code{arceb-linux-uclibc}} targets when profiling is requested.
12731 @end table
12733 The following options control the semantics of generated code:
12735 @c semantically relevant code generation options
12736 @table @gcctabopt
12737 @item -mepilogue-cfi
12738 @opindex mepilogue-cfi
12739 Enable generation of call frame information for epilogues.
12741 @item -mno-epilogue-cfi
12742 @opindex mno-epilogue-cfi
12743 Disable generation of call frame information for epilogues.
12745 @item -mlong-calls
12746 @opindex mlong-calls
12747 Generate call insns as register indirect calls, thus providing access
12748 to the full 32-bit address range.
12750 @item -mmedium-calls
12751 @opindex mmedium-calls
12752 Don't use less than 25 bit addressing range for calls, which is the
12753 offset available for an unconditional branch-and-link
12754 instruction.  Conditional execution of function calls is suppressed, to
12755 allow use of the 25-bit range, rather than the 21-bit range with
12756 conditional branch-and-link.  This is the default for tool chains built
12757 for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets.
12759 @item -mno-sdata
12760 @opindex mno-sdata
12761 Do not generate sdata references.  This is the default for tool chains
12762 built for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}}
12763 targets.
12765 @item -mucb-mcount
12766 @opindex mucb-mcount
12767 Instrument with mcount calls as used in UCB code.  I.e. do the
12768 counting in the callee, not the caller.  By default ARC instrumentation
12769 counts in the caller.
12771 @item -mvolatile-cache
12772 @opindex mvolatile-cache
12773 Use ordinarily cached memory accesses for volatile references.  This is the
12774 default.
12776 @item -mno-volatile-cache
12777 @opindex mno-volatile-cache
12778 Enable cache bypass for volatile references.
12780 @end table
12782 The following options fine tune code generation:
12783 @c code generation tuning options
12784 @table @gcctabopt
12785 @item -malign-call
12786 @opindex malign-call
12787 Do alignment optimizations for call instructions.
12789 @item -mauto-modify-reg
12790 @opindex mauto-modify-reg
12791 Enable the use of pre/post modify with register displacement.
12793 @item -mbbit-peephole
12794 @opindex mbbit-peephole
12795 Enable bbit peephole2.
12797 @item -mno-brcc
12798 @opindex mno-brcc
12799 This option disables a target-specific pass in @file{arc_reorg} to
12800 generate @code{BRcc} instructions.  It has no effect on @code{BRcc}
12801 generation driven by the combiner pass.
12803 @item -mcase-vector-pcrel
12804 @opindex mcase-vector-pcrel
12805 Use pc-relative switch case tables - this enables case table shortening.
12806 This is the default for @option{-Os}.
12808 @item -mcompact-casesi
12809 @opindex mcompact-casesi
12810 Enable compact casesi pattern.
12811 This is the default for @option{-Os}.
12813 @item -mno-cond-exec
12814 @opindex mno-cond-exec
12815 Disable ARCompact specific pass to generate conditional execution instructions.
12816 Due to delay slot scheduling and interactions between operand numbers,
12817 literal sizes, instruction lengths, and the support for conditional execution,
12818 the target-independent pass to generate conditional execution is often lacking,
12819 so the ARC port has kept a special pass around that tries to find more
12820 conditional execution generating opportunities after register allocation,
12821 branch shortening, and delay slot scheduling have been done.  This pass
12822 generally, but not always, improves performance and code size, at the cost of
12823 extra compilation time, which is why there is an option to switch it off.
12824 If you have a problem with call instructions exceeding their allowable
12825 offset range because they are conditionalized, you should consider using
12826 @option{-mmedium-calls} instead.
12828 @item -mearly-cbranchsi
12829 @opindex mearly-cbranchsi
12830 Enable pre-reload use of the cbranchsi pattern.
12832 @item -mexpand-adddi
12833 @opindex mexpand-adddi
12834 Expand @code{adddi3} and @code{subdi3} at rtl generation time into
12835 @code{add.f}, @code{adc} etc.
12837 @item -mindexed-loads
12838 @opindex mindexed-loads
12839 Enable the use of indexed loads.  This can be problematic because some
12840 optimizers then assume that indexed stores exist, which is not
12841 the case.
12843 @item -mlra
12844 @opindex mlra
12845 Enable Local Register Allocation.  This is still experimental for ARC,
12846 so by default the compiler uses standard reload
12847 (i.e. @option{-mno-lra}).
12849 @item -mlra-priority-none
12850 @opindex mlra-priority-none
12851 Don't indicate any priority for target registers.
12853 @item -mlra-priority-compact
12854 @opindex mlra-priority-compact
12855 Indicate target register priority for r0..r3 / r12..r15.
12857 @item -mlra-priority-noncompact
12858 @opindex mlra-priority-noncompact
12859 Reduce target regsiter priority for r0..r3 / r12..r15.
12861 @item -mno-millicode
12862 @opindex mno-millicode
12863 When optimizing for size (using @option{-Os}), prologues and epilogues
12864 that have to save or restore a large number of registers are often
12865 shortened by using call to a special function in libgcc; this is
12866 referred to as a @emph{millicode} call.  As these calls can pose
12867 performance issues, and/or cause linking issues when linking in a
12868 nonstandard way, this option is provided to turn off millicode call
12869 generation.
12871 @item -mmixed-code
12872 @opindex mmixed-code
12873 Tweak register allocation to help 16-bit instruction generation.
12874 This generally has the effect of decreasing the average instruction size
12875 while increasing the instruction count.
12877 @item -mq-class
12878 @opindex mq-class
12879 Enable 'q' instruction alternatives.
12880 This is the default for @option{-Os}.
12882 @item -mRcq
12883 @opindex mRcq
12884 Enable Rcq constraint handling - most short code generation depends on this.
12885 This is the default.
12887 @item -mRcw
12888 @opindex mRcw
12889 Enable Rcw constraint handling - ccfsm condexec mostly depends on this.
12890 This is the default.
12892 @item -msize-level=@var{level}
12893 @opindex msize-level
12894 Fine-tune size optimization with regards to instruction lengths and alignment.
12895 The recognized values for @var{level} are:
12896 @table @samp
12897 @item 0
12898 No size optimization.  This level is deprecated and treated like @samp{1}.
12900 @item 1
12901 Short instructions are used opportunistically.
12903 @item 2
12904 In addition, alignment of loops and of code after barriers are dropped.
12906 @item 3
12907 In addition, optional data alignment is dropped, and the option @option{Os} is enabled.
12909 @end table
12911 This defaults to @samp{3} when @option{-Os} is in effect.  Otherwise,
12912 the behavior when this is not set is equivalent to level @samp{1}.
12914 @item -mtune=@var{cpu}
12915 @opindex mtune
12916 Set instruction scheduling parameters for @var{cpu}, overriding any implied
12917 by @option{-mcpu=}.
12919 Supported values for @var{cpu} are
12921 @table @samp
12922 @item ARC600
12923 Tune for ARC600 cpu.
12925 @item ARC601
12926 Tune for ARC601 cpu.
12928 @item ARC700
12929 Tune for ARC700 cpu with standard multiplier block.
12931 @item ARC700-xmac
12932 Tune for ARC700 cpu with XMAC block.
12934 @item ARC725D
12935 Tune for ARC725D cpu.
12937 @item ARC750D
12938 Tune for ARC750D cpu.
12940 @end table
12942 @item -mmultcost=@var{num}
12943 @opindex mmultcost
12944 Cost to assume for a multiply instruction, with @samp{4} being equal to a
12945 normal instruction.
12947 @item -munalign-prob-threshold=@var{probability}
12948 @opindex munalign-prob-threshold
12949 Set probability threshold for unaligning branches.
12950 When tuning for @samp{ARC700} and optimizing for speed, branches without
12951 filled delay slot are preferably emitted unaligned and long, unless
12952 profiling indicates that the probability for the branch to be taken
12953 is below @var{probability}.  @xref{Cross-profiling}.
12954 The default is (REG_BR_PROB_BASE/2), i.e.@: 5000.
12956 @end table
12958 The following options are maintained for backward compatibility, but
12959 are now deprecated and will be removed in a future release:
12961 @c Deprecated options
12962 @table @gcctabopt
12964 @item -margonaut
12965 @opindex margonaut
12966 Obsolete FPX.
12968 @item -mbig-endian
12969 @opindex mbig-endian
12970 @itemx -EB
12971 @opindex EB
12972 Compile code for big endian targets.  Use of these options is now
12973 deprecated.  Users wanting big-endian code, should use the
12974 @w{@code{arceb-elf32}} and @w{@code{arceb-linux-uclibc}} targets when
12975 building the tool chain, for which big-endian is the default.
12977 @item -mlittle-endian
12978 @opindex mlittle-endian
12979 @itemx -EL
12980 @opindex EL
12981 Compile code for little endian targets.  Use of these options is now
12982 deprecated.  Users wanting little-endian code should use the
12983 @w{@code{arc-elf32}} and @w{@code{arc-linux-uclibc}} targets when
12984 building the tool chain, for which little-endian is the default.
12986 @item -mbarrel_shifter
12987 @opindex mbarrel_shifter
12988 Replaced by @option{-mbarrel-shifter}.
12990 @item -mdpfp_compact
12991 @opindex mdpfp_compact
12992 Replaced by @option{-mdpfp-compact}.
12994 @item -mdpfp_fast
12995 @opindex mdpfp_fast
12996 Replaced by @option{-mdpfp-fast}.
12998 @item -mdsp_packa
12999 @opindex mdsp_packa
13000 Replaced by @option{-mdsp-packa}.
13002 @item -mEA
13003 @opindex mEA
13004 Replaced by @option{-mea}.
13006 @item -mmac_24
13007 @opindex mmac_24
13008 Replaced by @option{-mmac-24}.
13010 @item -mmac_d16
13011 @opindex mmac_d16
13012 Replaced by @option{-mmac-d16}.
13014 @item -mspfp_compact
13015 @opindex mspfp_compact
13016 Replaced by @option{-mspfp-compact}.
13018 @item -mspfp_fast
13019 @opindex mspfp_fast
13020 Replaced by @option{-mspfp-fast}.
13022 @item -mtune=@var{cpu}
13023 @opindex mtune
13024 Values @samp{arc600}, @samp{arc601}, @samp{arc700} and
13025 @samp{arc700-xmac} for @var{cpu} are replaced by @samp{ARC600},
13026 @samp{ARC601}, @samp{ARC700} and @samp{ARC700-xmac} respectively
13028 @item -multcost=@var{num}
13029 @opindex multcost
13030 Replaced by @option{-mmultcost}.
13032 @end table
13034 @node ARM Options
13035 @subsection ARM Options
13036 @cindex ARM options
13038 These @samp{-m} options are defined for the ARM port:
13040 @table @gcctabopt
13041 @item -mabi=@var{name}
13042 @opindex mabi
13043 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
13044 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
13046 @item -mapcs-frame
13047 @opindex mapcs-frame
13048 Generate a stack frame that is compliant with the ARM Procedure Call
13049 Standard for all functions, even if this is not strictly necessary for
13050 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
13051 with this option causes the stack frames not to be generated for
13052 leaf functions.  The default is @option{-mno-apcs-frame}.
13053 This option is deprecated.
13055 @item -mapcs
13056 @opindex mapcs
13057 This is a synonym for @option{-mapcs-frame} and is deprecated.
13059 @ignore
13060 @c not currently implemented
13061 @item -mapcs-stack-check
13062 @opindex mapcs-stack-check
13063 Generate code to check the amount of stack space available upon entry to
13064 every function (that actually uses some stack space).  If there is
13065 insufficient space available then either the function
13066 @code{__rt_stkovf_split_small} or @code{__rt_stkovf_split_big} is
13067 called, depending upon the amount of stack space required.  The runtime
13068 system is required to provide these functions.  The default is
13069 @option{-mno-apcs-stack-check}, since this produces smaller code.
13071 @c not currently implemented
13072 @item -mapcs-float
13073 @opindex mapcs-float
13074 Pass floating-point arguments using the floating-point registers.  This is
13075 one of the variants of the APCS@.  This option is recommended if the
13076 target hardware has a floating-point unit or if a lot of floating-point
13077 arithmetic is going to be performed by the code.  The default is
13078 @option{-mno-apcs-float}, since the size of integer-only code is 
13079 slightly increased if @option{-mapcs-float} is used.
13081 @c not currently implemented
13082 @item -mapcs-reentrant
13083 @opindex mapcs-reentrant
13084 Generate reentrant, position-independent code.  The default is
13085 @option{-mno-apcs-reentrant}.
13086 @end ignore
13088 @item -mthumb-interwork
13089 @opindex mthumb-interwork
13090 Generate code that supports calling between the ARM and Thumb
13091 instruction sets.  Without this option, on pre-v5 architectures, the
13092 two instruction sets cannot be reliably used inside one program.  The
13093 default is @option{-mno-thumb-interwork}, since slightly larger code
13094 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
13095 configurations this option is meaningless.
13097 @item -mno-sched-prolog
13098 @opindex mno-sched-prolog
13099 Prevent the reordering of instructions in the function prologue, or the
13100 merging of those instruction with the instructions in the function's
13101 body.  This means that all functions start with a recognizable set
13102 of instructions (or in fact one of a choice from a small set of
13103 different function prologues), and this information can be used to
13104 locate the start of functions inside an executable piece of code.  The
13105 default is @option{-msched-prolog}.
13107 @item -mfloat-abi=@var{name}
13108 @opindex mfloat-abi
13109 Specifies which floating-point ABI to use.  Permissible values
13110 are: @samp{soft}, @samp{softfp} and @samp{hard}.
13112 Specifying @samp{soft} causes GCC to generate output containing
13113 library calls for floating-point operations.
13114 @samp{softfp} allows the generation of code using hardware floating-point
13115 instructions, but still uses the soft-float calling conventions.
13116 @samp{hard} allows generation of floating-point instructions
13117 and uses FPU-specific calling conventions.
13119 The default depends on the specific target configuration.  Note that
13120 the hard-float and soft-float ABIs are not link-compatible; you must
13121 compile your entire program with the same ABI, and link with a
13122 compatible set of libraries.
13124 @item -mlittle-endian
13125 @opindex mlittle-endian
13126 Generate code for a processor running in little-endian mode.  This is
13127 the default for all standard configurations.
13129 @item -mbig-endian
13130 @opindex mbig-endian
13131 Generate code for a processor running in big-endian mode; the default is
13132 to compile code for a little-endian processor.
13134 @item -march=@var{name}
13135 @opindex march
13136 This specifies the name of the target ARM architecture.  GCC uses this
13137 name to determine what kind of instructions it can emit when generating
13138 assembly code.  This option can be used in conjunction with or instead
13139 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
13140 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
13141 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
13142 @samp{armv6}, @samp{armv6j},
13143 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
13144 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m}, @samp{armv7e-m},
13145 @samp{armv7ve}, @samp{armv8-a}, @samp{armv8-a+crc},
13146 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
13148 @option{-march=armv7ve} is the armv7-a architecture with virtualization
13149 extensions.
13151 @option{-march=armv8-a+crc} enables code generation for the ARMv8-A
13152 architecture together with the optional CRC32 extensions.
13154 @option{-march=native} causes the compiler to auto-detect the architecture
13155 of the build computer.  At present, this feature is only supported on
13156 GNU/Linux, and not all architectures are recognized.  If the auto-detect
13157 is unsuccessful the option has no effect.
13159 @item -mtune=@var{name}
13160 @opindex mtune
13161 This option specifies the name of the target ARM processor for
13162 which GCC should tune the performance of the code.
13163 For some ARM implementations better performance can be obtained by using
13164 this option.
13165 Permissible names are: @samp{arm2}, @samp{arm250},
13166 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
13167 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
13168 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
13169 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
13170 @samp{arm720},
13171 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
13172 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
13173 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
13174 @samp{strongarm1110},
13175 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
13176 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
13177 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
13178 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
13179 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
13180 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
13181 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
13182 @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8}, @samp{cortex-a9},
13183 @samp{cortex-a12}, @samp{cortex-a15}, @samp{cortex-a53},
13184 @samp{cortex-a57}, @samp{cortex-a72},
13185 @samp{cortex-r4},
13186 @samp{cortex-r4f}, @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-m7},
13187 @samp{cortex-m4},
13188 @samp{cortex-m3},
13189 @samp{cortex-m1},
13190 @samp{cortex-m0},
13191 @samp{cortex-m0plus},
13192 @samp{cortex-m1.small-multiply},
13193 @samp{cortex-m0.small-multiply},
13194 @samp{cortex-m0plus.small-multiply},
13195 @samp{marvell-pj4},
13196 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
13197 @samp{fa526}, @samp{fa626},
13198 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te},
13199 @samp{xgene1}.
13201 Additionally, this option can specify that GCC should tune the performance
13202 of the code for a big.LITTLE system.  Permissible names are:
13203 @samp{cortex-a15.cortex-a7}, @samp{cortex-a57.cortex-a53},
13204 @samp{cortex-a72.cortex-a53}.
13206 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
13207 performance for a blend of processors within architecture @var{arch}.
13208 The aim is to generate code that run well on the current most popular
13209 processors, balancing between optimizations that benefit some CPUs in the
13210 range, and avoiding performance pitfalls of other CPUs.  The effects of
13211 this option may change in future GCC versions as CPU models come and go.
13213 @option{-mtune=native} causes the compiler to auto-detect the CPU
13214 of the build computer.  At present, this feature is only supported on
13215 GNU/Linux, and not all architectures are recognized.  If the auto-detect is
13216 unsuccessful the option has no effect.
13218 @item -mcpu=@var{name}
13219 @opindex mcpu
13220 This specifies the name of the target ARM processor.  GCC uses this name
13221 to derive the name of the target ARM architecture (as if specified
13222 by @option{-march}) and the ARM processor type for which to tune for
13223 performance (as if specified by @option{-mtune}).  Where this option
13224 is used in conjunction with @option{-march} or @option{-mtune},
13225 those options take precedence over the appropriate part of this option.
13227 Permissible names for this option are the same as those for
13228 @option{-mtune}.
13230 @option{-mcpu=generic-@var{arch}} is also permissible, and is
13231 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
13232 See @option{-mtune} for more information.
13234 @option{-mcpu=native} causes the compiler to auto-detect the CPU
13235 of the build computer.  At present, this feature is only supported on
13236 GNU/Linux, and not all architectures are recognized.  If the auto-detect
13237 is unsuccessful the option has no effect.
13239 @item -mfpu=@var{name}
13240 @opindex mfpu
13241 This specifies what floating-point hardware (or hardware emulation) is
13242 available on the target.  Permissible names are: @samp{vfp}, @samp{vfpv3},
13243 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
13244 @samp{vfpv3xd-fp16}, @samp{neon}, @samp{neon-fp16}, @samp{vfpv4},
13245 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
13246 @samp{fpv5-d16}, @samp{fpv5-sp-d16},
13247 @samp{fp-armv8}, @samp{neon-fp-armv8}, and @samp{crypto-neon-fp-armv8}.
13249 If @option{-msoft-float} is specified this specifies the format of
13250 floating-point values.
13252 If the selected floating-point hardware includes the NEON extension
13253 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
13254 operations are not generated by GCC's auto-vectorization pass unless
13255 @option{-funsafe-math-optimizations} is also specified.  This is
13256 because NEON hardware does not fully implement the IEEE 754 standard for
13257 floating-point arithmetic (in particular denormal values are treated as
13258 zero), so the use of NEON instructions may lead to a loss of precision.
13260 @item -mfp16-format=@var{name}
13261 @opindex mfp16-format
13262 Specify the format of the @code{__fp16} half-precision floating-point type.
13263 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
13264 the default is @samp{none}, in which case the @code{__fp16} type is not
13265 defined.  @xref{Half-Precision}, for more information.
13267 @item -mstructure-size-boundary=@var{n}
13268 @opindex mstructure-size-boundary
13269 The sizes of all structures and unions are rounded up to a multiple
13270 of the number of bits set by this option.  Permissible values are 8, 32
13271 and 64.  The default value varies for different toolchains.  For the COFF
13272 targeted toolchain the default value is 8.  A value of 64 is only allowed
13273 if the underlying ABI supports it.
13275 Specifying a larger number can produce faster, more efficient code, but
13276 can also increase the size of the program.  Different values are potentially
13277 incompatible.  Code compiled with one value cannot necessarily expect to
13278 work with code or libraries compiled with another value, if they exchange
13279 information using structures or unions.
13281 @item -mabort-on-noreturn
13282 @opindex mabort-on-noreturn
13283 Generate a call to the function @code{abort} at the end of a
13284 @code{noreturn} function.  It is executed if the function tries to
13285 return.
13287 @item -mlong-calls
13288 @itemx -mno-long-calls
13289 @opindex mlong-calls
13290 @opindex mno-long-calls
13291 Tells the compiler to perform function calls by first loading the
13292 address of the function into a register and then performing a subroutine
13293 call on this register.  This switch is needed if the target function
13294 lies outside of the 64-megabyte addressing range of the offset-based
13295 version of subroutine call instruction.
13297 Even if this switch is enabled, not all function calls are turned
13298 into long calls.  The heuristic is that static functions, functions
13299 that have the @code{short_call} attribute, functions that are inside
13300 the scope of a @code{#pragma no_long_calls} directive, and functions whose
13301 definitions have already been compiled within the current compilation
13302 unit are not turned into long calls.  The exceptions to this rule are
13303 that weak function definitions, functions with the @code{long_call}
13304 attribute or the @code{section} attribute, and functions that are within
13305 the scope of a @code{#pragma long_calls} directive are always
13306 turned into long calls.
13308 This feature is not enabled by default.  Specifying
13309 @option{-mno-long-calls} restores the default behavior, as does
13310 placing the function calls within the scope of a @code{#pragma
13311 long_calls_off} directive.  Note these switches have no effect on how
13312 the compiler generates code to handle function calls via function
13313 pointers.
13315 @item -msingle-pic-base
13316 @opindex msingle-pic-base
13317 Treat the register used for PIC addressing as read-only, rather than
13318 loading it in the prologue for each function.  The runtime system is
13319 responsible for initializing this register with an appropriate value
13320 before execution begins.
13322 @item -mpic-register=@var{reg}
13323 @opindex mpic-register
13324 Specify the register to be used for PIC addressing.
13325 For standard PIC base case, the default is any suitable register
13326 determined by compiler.  For single PIC base case, the default is
13327 @samp{R9} if target is EABI based or stack-checking is enabled,
13328 otherwise the default is @samp{R10}.
13330 @item -mpic-data-is-text-relative
13331 @opindex mpic-data-is-text-relative
13332 Assume that each data segments are relative to text segment at load time.
13333 Therefore, it permits addressing data using PC-relative operations.
13334 This option is on by default for targets other than VxWorks RTP.
13336 @item -mpoke-function-name
13337 @opindex mpoke-function-name
13338 Write the name of each function into the text section, directly
13339 preceding the function prologue.  The generated code is similar to this:
13341 @smallexample
13342      t0
13343          .ascii "arm_poke_function_name", 0
13344          .align
13345      t1
13346          .word 0xff000000 + (t1 - t0)
13347      arm_poke_function_name
13348          mov     ip, sp
13349          stmfd   sp!, @{fp, ip, lr, pc@}
13350          sub     fp, ip, #4
13351 @end smallexample
13353 When performing a stack backtrace, code can inspect the value of
13354 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
13355 location @code{pc - 12} and the top 8 bits are set, then we know that
13356 there is a function name embedded immediately preceding this location
13357 and has length @code{((pc[-3]) & 0xff000000)}.
13359 @item -mthumb
13360 @itemx -marm
13361 @opindex marm
13362 @opindex mthumb
13364 Select between generating code that executes in ARM and Thumb
13365 states.  The default for most configurations is to generate code
13366 that executes in ARM state, but the default can be changed by
13367 configuring GCC with the @option{--with-mode=}@var{state}
13368 configure option.
13370 @item -mtpcs-frame
13371 @opindex mtpcs-frame
13372 Generate a stack frame that is compliant with the Thumb Procedure Call
13373 Standard for all non-leaf functions.  (A leaf function is one that does
13374 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
13376 @item -mtpcs-leaf-frame
13377 @opindex mtpcs-leaf-frame
13378 Generate a stack frame that is compliant with the Thumb Procedure Call
13379 Standard for all leaf functions.  (A leaf function is one that does
13380 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
13382 @item -mcallee-super-interworking
13383 @opindex mcallee-super-interworking
13384 Gives all externally visible functions in the file being compiled an ARM
13385 instruction set header which switches to Thumb mode before executing the
13386 rest of the function.  This allows these functions to be called from
13387 non-interworking code.  This option is not valid in AAPCS configurations
13388 because interworking is enabled by default.
13390 @item -mcaller-super-interworking
13391 @opindex mcaller-super-interworking
13392 Allows calls via function pointers (including virtual functions) to
13393 execute correctly regardless of whether the target code has been
13394 compiled for interworking or not.  There is a small overhead in the cost
13395 of executing a function pointer if this option is enabled.  This option
13396 is not valid in AAPCS configurations because interworking is enabled
13397 by default.
13399 @item -mtp=@var{name}
13400 @opindex mtp
13401 Specify the access model for the thread local storage pointer.  The valid
13402 models are @samp{soft}, which generates calls to @code{__aeabi_read_tp},
13403 @samp{cp15}, which fetches the thread pointer from @code{cp15} directly
13404 (supported in the arm6k architecture), and @samp{auto}, which uses the
13405 best available method for the selected processor.  The default setting is
13406 @samp{auto}.
13408 @item -mtls-dialect=@var{dialect}
13409 @opindex mtls-dialect
13410 Specify the dialect to use for accessing thread local storage.  Two
13411 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
13412 @samp{gnu} dialect selects the original GNU scheme for supporting
13413 local and global dynamic TLS models.  The @samp{gnu2} dialect
13414 selects the GNU descriptor scheme, which provides better performance
13415 for shared libraries.  The GNU descriptor scheme is compatible with
13416 the original scheme, but does require new assembler, linker and
13417 library support.  Initial and local exec TLS models are unaffected by
13418 this option and always use the original scheme.
13420 @item -mword-relocations
13421 @opindex mword-relocations
13422 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
13423 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
13424 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
13425 is specified.
13427 @item -mfix-cortex-m3-ldrd
13428 @opindex mfix-cortex-m3-ldrd
13429 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
13430 with overlapping destination and base registers are used.  This option avoids
13431 generating these instructions.  This option is enabled by default when
13432 @option{-mcpu=cortex-m3} is specified.
13434 @item -munaligned-access
13435 @itemx -mno-unaligned-access
13436 @opindex munaligned-access
13437 @opindex mno-unaligned-access
13438 Enables (or disables) reading and writing of 16- and 32- bit values
13439 from addresses that are not 16- or 32- bit aligned.  By default
13440 unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
13441 architectures, and enabled for all other architectures.  If unaligned
13442 access is not enabled then words in packed data structures are
13443 accessed a byte at a time.
13445 The ARM attribute @code{Tag_CPU_unaligned_access} is set in the
13446 generated object file to either true or false, depending upon the
13447 setting of this option.  If unaligned access is enabled then the
13448 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} is also
13449 defined.
13451 @item -mneon-for-64bits
13452 @opindex mneon-for-64bits
13453 Enables using Neon to handle scalar 64-bits operations. This is
13454 disabled by default since the cost of moving data from core registers
13455 to Neon is high.
13457 @item -mslow-flash-data
13458 @opindex mslow-flash-data
13459 Assume loading data from flash is slower than fetching instruction.
13460 Therefore literal load is minimized for better performance.
13461 This option is only supported when compiling for ARMv7 M-profile and
13462 off by default.
13464 @item -masm-syntax-unified
13465 @opindex masm-syntax-unified
13466 Assume inline assembler is using unified asm syntax.  The default is
13467 currently off which implies divided syntax.  Currently this option is
13468 available only for Thumb1 and has no effect on ARM state and Thumb2.
13469 However, this may change in future releases of GCC.  Divided syntax
13470 should be considered deprecated.
13472 @item -mrestrict-it
13473 @opindex mrestrict-it
13474 Restricts generation of IT blocks to conform to the rules of ARMv8.
13475 IT blocks can only contain a single 16-bit instruction from a select
13476 set of instructions. This option is on by default for ARMv8 Thumb mode.
13477 @end table
13479 @node AVR Options
13480 @subsection AVR Options
13481 @cindex AVR Options
13483 These options are defined for AVR implementations:
13485 @table @gcctabopt
13486 @item -mmcu=@var{mcu}
13487 @opindex mmcu
13488 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
13490 The default for this option is@tie{}@samp{avr2}.
13492 GCC supports the following AVR devices and ISAs:
13494 @include avr-mmcu.texi
13496 @item -maccumulate-args
13497 @opindex maccumulate-args
13498 Accumulate outgoing function arguments and acquire/release the needed
13499 stack space for outgoing function arguments once in function
13500 prologue/epilogue.  Without this option, outgoing arguments are pushed
13501 before calling a function and popped afterwards.
13503 Popping the arguments after the function call can be expensive on
13504 AVR so that accumulating the stack space might lead to smaller
13505 executables because arguments need not to be removed from the
13506 stack after such a function call.
13508 This option can lead to reduced code size for functions that perform
13509 several calls to functions that get their arguments on the stack like
13510 calls to printf-like functions.
13512 @item -mbranch-cost=@var{cost}
13513 @opindex mbranch-cost
13514 Set the branch costs for conditional branch instructions to
13515 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
13516 integers. The default branch cost is 0.
13518 @item -mcall-prologues
13519 @opindex mcall-prologues
13520 Functions prologues/epilogues are expanded as calls to appropriate
13521 subroutines.  Code size is smaller.
13523 @item -mint8
13524 @opindex mint8
13525 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
13526 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
13527 and @code{long long} is 4 bytes.  Please note that this option does not
13528 conform to the C standards, but it results in smaller code
13529 size.
13531 @item -mn-flash=@var{num}
13532 @opindex mn-flash
13533 Assume that the flash memory has a size of 
13534 @var{num} times 64@tie{}KiB.
13536 @item -mno-interrupts
13537 @opindex mno-interrupts
13538 Generated code is not compatible with hardware interrupts.
13539 Code size is smaller.
13541 @item -mrelax
13542 @opindex mrelax
13543 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
13544 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
13545 Setting @option{-mrelax} just adds the @option{--mlink-relax} option to
13546 the assembler's command line and the @option{--relax} option to the
13547 linker's command line.
13549 Jump relaxing is performed by the linker because jump offsets are not
13550 known before code is located. Therefore, the assembler code generated by the
13551 compiler is the same, but the instructions in the executable may
13552 differ from instructions in the assembler code.
13554 Relaxing must be turned on if linker stubs are needed, see the
13555 section on @code{EIND} and linker stubs below.
13557 @item -mrmw
13558 @opindex mrmw
13559 Assume that the device supports the Read-Modify-Write
13560 instructions @code{XCH}, @code{LAC}, @code{LAS} and @code{LAT}.
13562 @item -msp8
13563 @opindex msp8
13564 Treat the stack pointer register as an 8-bit register,
13565 i.e.@: assume the high byte of the stack pointer is zero.
13566 In general, you don't need to set this option by hand.
13568 This option is used internally by the compiler to select and
13569 build multilibs for architectures @code{avr2} and @code{avr25}.
13570 These architectures mix devices with and without @code{SPH}.
13571 For any setting other than @option{-mmcu=avr2} or @option{-mmcu=avr25}
13572 the compiler driver adds or removes this option from the compiler
13573 proper's command line, because the compiler then knows if the device
13574 or architecture has an 8-bit stack pointer and thus no @code{SPH}
13575 register or not.
13577 @item -mstrict-X
13578 @opindex mstrict-X
13579 Use address register @code{X} in a way proposed by the hardware.  This means
13580 that @code{X} is only used in indirect, post-increment or
13581 pre-decrement addressing.
13583 Without this option, the @code{X} register may be used in the same way
13584 as @code{Y} or @code{Z} which then is emulated by additional
13585 instructions.  
13586 For example, loading a value with @code{X+const} addressing with a
13587 small non-negative @code{const < 64} to a register @var{Rn} is
13588 performed as
13590 @example
13591 adiw r26, const   ; X += const
13592 ld   @var{Rn}, X        ; @var{Rn} = *X
13593 sbiw r26, const   ; X -= const
13594 @end example
13596 @item -mtiny-stack
13597 @opindex mtiny-stack
13598 Only change the lower 8@tie{}bits of the stack pointer.
13600 @item -nodevicelib
13601 @opindex nodevicelib
13602 Don't link against AVR-LibC's device specific library @code{libdev.a}.
13604 @item -Waddr-space-convert
13605 @opindex Waddr-space-convert
13606 Warn about conversions between address spaces in the case where the
13607 resulting address space is not contained in the incoming address space.
13608 @end table
13610 @subsubsection @code{EIND} and Devices with More Than 128 Ki Bytes of Flash
13611 @cindex @code{EIND}
13612 Pointers in the implementation are 16@tie{}bits wide.
13613 The address of a function or label is represented as word address so
13614 that indirect jumps and calls can target any code address in the
13615 range of 64@tie{}Ki words.
13617 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
13618 bytes of program memory space, there is a special function register called
13619 @code{EIND} that serves as most significant part of the target address
13620 when @code{EICALL} or @code{EIJMP} instructions are used.
13622 Indirect jumps and calls on these devices are handled as follows by
13623 the compiler and are subject to some limitations:
13625 @itemize @bullet
13627 @item
13628 The compiler never sets @code{EIND}.
13630 @item
13631 The compiler uses @code{EIND} implicitely in @code{EICALL}/@code{EIJMP}
13632 instructions or might read @code{EIND} directly in order to emulate an
13633 indirect call/jump by means of a @code{RET} instruction.
13635 @item
13636 The compiler assumes that @code{EIND} never changes during the startup
13637 code or during the application. In particular, @code{EIND} is not
13638 saved/restored in function or interrupt service routine
13639 prologue/epilogue.
13641 @item
13642 For indirect calls to functions and computed goto, the linker
13643 generates @emph{stubs}. Stubs are jump pads sometimes also called
13644 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
13645 The stub contains a direct jump to the desired address.
13647 @item
13648 Linker relaxation must be turned on so that the linker generates
13649 the stubs correctly in all situations. See the compiler option
13650 @option{-mrelax} and the linker option @option{--relax}.
13651 There are corner cases where the linker is supposed to generate stubs
13652 but aborts without relaxation and without a helpful error message.
13654 @item
13655 The default linker script is arranged for code with @code{EIND = 0}.
13656 If code is supposed to work for a setup with @code{EIND != 0}, a custom
13657 linker script has to be used in order to place the sections whose
13658 name start with @code{.trampolines} into the segment where @code{EIND}
13659 points to.
13661 @item
13662 The startup code from libgcc never sets @code{EIND}.
13663 Notice that startup code is a blend of code from libgcc and AVR-LibC.
13664 For the impact of AVR-LibC on @code{EIND}, see the
13665 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
13667 @item
13668 It is legitimate for user-specific startup code to set up @code{EIND}
13669 early, for example by means of initialization code located in
13670 section @code{.init3}. Such code runs prior to general startup code
13671 that initializes RAM and calls constructors, but after the bit
13672 of startup code from AVR-LibC that sets @code{EIND} to the segment
13673 where the vector table is located.
13674 @example
13675 #include <avr/io.h>
13677 static void
13678 __attribute__((section(".init3"),naked,used,no_instrument_function))
13679 init3_set_eind (void)
13681   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
13682                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
13684 @end example
13686 @noindent
13687 The @code{__trampolines_start} symbol is defined in the linker script.
13689 @item
13690 Stubs are generated automatically by the linker if
13691 the following two conditions are met:
13692 @itemize @minus
13694 @item The address of a label is taken by means of the @code{gs} modifier
13695 (short for @emph{generate stubs}) like so:
13696 @example
13697 LDI r24, lo8(gs(@var{func}))
13698 LDI r25, hi8(gs(@var{func}))
13699 @end example
13700 @item The final location of that label is in a code segment
13701 @emph{outside} the segment where the stubs are located.
13702 @end itemize
13704 @item
13705 The compiler emits such @code{gs} modifiers for code labels in the
13706 following situations:
13707 @itemize @minus
13708 @item Taking address of a function or code label.
13709 @item Computed goto.
13710 @item If prologue-save function is used, see @option{-mcall-prologues}
13711 command-line option.
13712 @item Switch/case dispatch tables. If you do not want such dispatch
13713 tables you can specify the @option{-fno-jump-tables} command-line option.
13714 @item C and C++ constructors/destructors called during startup/shutdown.
13715 @item If the tools hit a @code{gs()} modifier explained above.
13716 @end itemize
13718 @item
13719 Jumping to non-symbolic addresses like so is @emph{not} supported:
13721 @example
13722 int main (void)
13724     /* Call function at word address 0x2 */
13725     return ((int(*)(void)) 0x2)();
13727 @end example
13729 Instead, a stub has to be set up, i.e.@: the function has to be called
13730 through a symbol (@code{func_4} in the example):
13732 @example
13733 int main (void)
13735     extern int func_4 (void);
13737     /* Call function at byte address 0x4 */
13738     return func_4();
13740 @end example
13742 and the application be linked with @option{-Wl,--defsym,func_4=0x4}.
13743 Alternatively, @code{func_4} can be defined in the linker script.
13744 @end itemize
13746 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
13747 @cindex @code{RAMPD}
13748 @cindex @code{RAMPX}
13749 @cindex @code{RAMPY}
13750 @cindex @code{RAMPZ}
13751 Some AVR devices support memories larger than the 64@tie{}KiB range
13752 that can be accessed with 16-bit pointers.  To access memory locations
13753 outside this 64@tie{}KiB range, the contentent of a @code{RAMP}
13754 register is used as high part of the address:
13755 The @code{X}, @code{Y}, @code{Z} address register is concatenated
13756 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
13757 register, respectively, to get a wide address. Similarly,
13758 @code{RAMPD} is used together with direct addressing.
13760 @itemize
13761 @item
13762 The startup code initializes the @code{RAMP} special function
13763 registers with zero.
13765 @item
13766 If a @ref{AVR Named Address Spaces,named address space} other than
13767 generic or @code{__flash} is used, then @code{RAMPZ} is set
13768 as needed before the operation.
13770 @item
13771 If the device supports RAM larger than 64@tie{}KiB and the compiler
13772 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
13773 is reset to zero after the operation.
13775 @item
13776 If the device comes with a specific @code{RAMP} register, the ISR
13777 prologue/epilogue saves/restores that SFR and initializes it with
13778 zero in case the ISR code might (implicitly) use it.
13780 @item
13781 RAM larger than 64@tie{}KiB is not supported by GCC for AVR targets.
13782 If you use inline assembler to read from locations outside the
13783 16-bit address range and change one of the @code{RAMP} registers,
13784 you must reset it to zero after the access.
13786 @end itemize
13788 @subsubsection AVR Built-in Macros
13790 GCC defines several built-in macros so that the user code can test
13791 for the presence or absence of features.  Almost any of the following
13792 built-in macros are deduced from device capabilities and thus
13793 triggered by the @option{-mmcu=} command-line option.
13795 For even more AVR-specific built-in macros see
13796 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
13798 @table @code
13800 @item __AVR_ARCH__
13801 Build-in macro that resolves to a decimal number that identifies the
13802 architecture and depends on the @option{-mmcu=@var{mcu}} option.
13803 Possible values are:
13805 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
13806 @code{4}, @code{5}, @code{51}, @code{6}
13808 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3}, @code{avr31},
13809 @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51}, @code{avr6},
13811 respectively and
13813 @code{100}, @code{102}, @code{104},
13814 @code{105}, @code{106}, @code{107}
13816 for @var{mcu}=@code{avrtiny}, @code{avrxmega2}, @code{avrxmega4},
13817 @code{avrxmega5}, @code{avrxmega6}, @code{avrxmega7}, respectively.
13818 If @var{mcu} specifies a device, this built-in macro is set
13819 accordingly. For example, with @option{-mmcu=atmega8} the macro is
13820 defined to @code{4}.
13822 @item __AVR_@var{Device}__
13823 Setting @option{-mmcu=@var{device}} defines this built-in macro which reflects
13824 the device's name. For example, @option{-mmcu=atmega8} defines the
13825 built-in macro @code{__AVR_ATmega8__}, @option{-mmcu=attiny261a} defines
13826 @code{__AVR_ATtiny261A__}, etc.
13828 The built-in macros' names follow
13829 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
13830 the device name as from the AVR user manual. The difference between
13831 @var{Device} in the built-in macro and @var{device} in
13832 @option{-mmcu=@var{device}} is that the latter is always lowercase.
13834 If @var{device} is not a device but only a core architecture like
13835 @samp{avr51}, this macro is not defined.
13837 @item __AVR_DEVICE_NAME__
13838 Setting @option{-mmcu=@var{device}} defines this built-in macro to
13839 the device's name. For example, with @option{-mmcu=atmega8} the macro
13840 is defined to @code{atmega8}.
13842 If @var{device} is not a device but only a core architecture like
13843 @samp{avr51}, this macro is not defined.
13845 @item __AVR_XMEGA__
13846 The device / architecture belongs to the XMEGA family of devices.
13848 @item __AVR_HAVE_ELPM__
13849 The device has the the @code{ELPM} instruction.
13851 @item __AVR_HAVE_ELPMX__
13852 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
13853 R@var{n},Z+} instructions.
13855 @item __AVR_HAVE_MOVW__
13856 The device has the @code{MOVW} instruction to perform 16-bit
13857 register-register moves.
13859 @item __AVR_HAVE_LPMX__
13860 The device has the @code{LPM R@var{n},Z} and
13861 @code{LPM R@var{n},Z+} instructions.
13863 @item __AVR_HAVE_MUL__
13864 The device has a hardware multiplier. 
13866 @item __AVR_HAVE_JMP_CALL__
13867 The device has the @code{JMP} and @code{CALL} instructions.
13868 This is the case for devices with at least 16@tie{}KiB of program
13869 memory.
13871 @item __AVR_HAVE_EIJMP_EICALL__
13872 @itemx __AVR_3_BYTE_PC__
13873 The device has the @code{EIJMP} and @code{EICALL} instructions.
13874 This is the case for devices with more than 128@tie{}KiB of program memory.
13875 This also means that the program counter
13876 (PC) is 3@tie{}bytes wide.
13878 @item __AVR_2_BYTE_PC__
13879 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
13880 with up to 128@tie{}KiB of program memory.
13882 @item __AVR_HAVE_8BIT_SP__
13883 @itemx __AVR_HAVE_16BIT_SP__
13884 The stack pointer (SP) register is treated as 8-bit respectively
13885 16-bit register by the compiler.
13886 The definition of these macros is affected by @option{-mtiny-stack}.
13888 @item __AVR_HAVE_SPH__
13889 @itemx __AVR_SP8__
13890 The device has the SPH (high part of stack pointer) special function
13891 register or has an 8-bit stack pointer, respectively.
13892 The definition of these macros is affected by @option{-mmcu=} and
13893 in the cases of @option{-mmcu=avr2} and @option{-mmcu=avr25} also
13894 by @option{-msp8}.
13896 @item __AVR_HAVE_RAMPD__
13897 @itemx __AVR_HAVE_RAMPX__
13898 @itemx __AVR_HAVE_RAMPY__
13899 @itemx __AVR_HAVE_RAMPZ__
13900 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
13901 @code{RAMPZ} special function register, respectively.
13903 @item __NO_INTERRUPTS__
13904 This macro reflects the @option{-mno-interrupts} command line option.
13906 @item __AVR_ERRATA_SKIP__
13907 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
13908 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
13909 instructions because of a hardware erratum.  Skip instructions are
13910 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
13911 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
13912 set.
13914 @item __AVR_ISA_RMW__
13915 The device has Read-Modify-Write instructions (XCH, LAC, LAS and LAT).
13917 @item __AVR_SFR_OFFSET__=@var{offset}
13918 Instructions that can address I/O special function registers directly
13919 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
13920 address as if addressed by an instruction to access RAM like @code{LD}
13921 or @code{STS}. This offset depends on the device architecture and has
13922 to be subtracted from the RAM address in order to get the
13923 respective I/O@tie{}address.
13925 @item __WITH_AVRLIBC__
13926 The compiler is configured to be used together with AVR-Libc.
13927 See the @option{--with-avrlibc} configure option.
13929 @end table
13931 @node Blackfin Options
13932 @subsection Blackfin Options
13933 @cindex Blackfin Options
13935 @table @gcctabopt
13936 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
13937 @opindex mcpu=
13938 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
13939 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
13940 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
13941 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
13942 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
13943 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
13944 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
13945 @samp{bf561}, @samp{bf592}.
13947 The optional @var{sirevision} specifies the silicon revision of the target
13948 Blackfin processor.  Any workarounds available for the targeted silicon revision
13949 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
13950 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
13951 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
13952 hexadecimal digits representing the major and minor numbers in the silicon
13953 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
13954 is not defined.  If @var{sirevision} is @samp{any}, the
13955 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
13956 If this optional @var{sirevision} is not used, GCC assumes the latest known
13957 silicon revision of the targeted Blackfin processor.
13959 GCC defines a preprocessor macro for the specified @var{cpu}.
13960 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
13961 provided by libgloss to be linked in if @option{-msim} is not given.
13963 Without this option, @samp{bf532} is used as the processor by default.
13965 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
13966 only the preprocessor macro is defined.
13968 @item -msim
13969 @opindex msim
13970 Specifies that the program will be run on the simulator.  This causes
13971 the simulator BSP provided by libgloss to be linked in.  This option
13972 has effect only for @samp{bfin-elf} toolchain.
13973 Certain other options, such as @option{-mid-shared-library} and
13974 @option{-mfdpic}, imply @option{-msim}.
13976 @item -momit-leaf-frame-pointer
13977 @opindex momit-leaf-frame-pointer
13978 Don't keep the frame pointer in a register for leaf functions.  This
13979 avoids the instructions to save, set up and restore frame pointers and
13980 makes an extra register available in leaf functions.  The option
13981 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
13982 which might make debugging harder.
13984 @item -mspecld-anomaly
13985 @opindex mspecld-anomaly
13986 When enabled, the compiler ensures that the generated code does not
13987 contain speculative loads after jump instructions. If this option is used,
13988 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
13990 @item -mno-specld-anomaly
13991 @opindex mno-specld-anomaly
13992 Don't generate extra code to prevent speculative loads from occurring.
13994 @item -mcsync-anomaly
13995 @opindex mcsync-anomaly
13996 When enabled, the compiler ensures that the generated code does not
13997 contain CSYNC or SSYNC instructions too soon after conditional branches.
13998 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
14000 @item -mno-csync-anomaly
14001 @opindex mno-csync-anomaly
14002 Don't generate extra code to prevent CSYNC or SSYNC instructions from
14003 occurring too soon after a conditional branch.
14005 @item -mlow-64k
14006 @opindex mlow-64k
14007 When enabled, the compiler is free to take advantage of the knowledge that
14008 the entire program fits into the low 64k of memory.
14010 @item -mno-low-64k
14011 @opindex mno-low-64k
14012 Assume that the program is arbitrarily large.  This is the default.
14014 @item -mstack-check-l1
14015 @opindex mstack-check-l1
14016 Do stack checking using information placed into L1 scratchpad memory by the
14017 uClinux kernel.
14019 @item -mid-shared-library
14020 @opindex mid-shared-library
14021 Generate code that supports shared libraries via the library ID method.
14022 This allows for execute in place and shared libraries in an environment
14023 without virtual memory management.  This option implies @option{-fPIC}.
14024 With a @samp{bfin-elf} target, this option implies @option{-msim}.
14026 @item -mno-id-shared-library
14027 @opindex mno-id-shared-library
14028 Generate code that doesn't assume ID-based shared libraries are being used.
14029 This is the default.
14031 @item -mleaf-id-shared-library
14032 @opindex mleaf-id-shared-library
14033 Generate code that supports shared libraries via the library ID method,
14034 but assumes that this library or executable won't link against any other
14035 ID shared libraries.  That allows the compiler to use faster code for jumps
14036 and calls.
14038 @item -mno-leaf-id-shared-library
14039 @opindex mno-leaf-id-shared-library
14040 Do not assume that the code being compiled won't link against any ID shared
14041 libraries.  Slower code is generated for jump and call insns.
14043 @item -mshared-library-id=n
14044 @opindex mshared-library-id
14045 Specifies the identification number of the ID-based shared library being
14046 compiled.  Specifying a value of 0 generates more compact code; specifying
14047 other values forces the allocation of that number to the current
14048 library but is no more space- or time-efficient than omitting this option.
14050 @item -msep-data
14051 @opindex msep-data
14052 Generate code that allows the data segment to be located in a different
14053 area of memory from the text segment.  This allows for execute in place in
14054 an environment without virtual memory management by eliminating relocations
14055 against the text section.
14057 @item -mno-sep-data
14058 @opindex mno-sep-data
14059 Generate code that assumes that the data segment follows the text segment.
14060 This is the default.
14062 @item -mlong-calls
14063 @itemx -mno-long-calls
14064 @opindex mlong-calls
14065 @opindex mno-long-calls
14066 Tells the compiler to perform function calls by first loading the
14067 address of the function into a register and then performing a subroutine
14068 call on this register.  This switch is needed if the target function
14069 lies outside of the 24-bit addressing range of the offset-based
14070 version of subroutine call instruction.
14072 This feature is not enabled by default.  Specifying
14073 @option{-mno-long-calls} restores the default behavior.  Note these
14074 switches have no effect on how the compiler generates code to handle
14075 function calls via function pointers.
14077 @item -mfast-fp
14078 @opindex mfast-fp
14079 Link with the fast floating-point library. This library relaxes some of
14080 the IEEE floating-point standard's rules for checking inputs against
14081 Not-a-Number (NAN), in the interest of performance.
14083 @item -minline-plt
14084 @opindex minline-plt
14085 Enable inlining of PLT entries in function calls to functions that are
14086 not known to bind locally.  It has no effect without @option{-mfdpic}.
14088 @item -mmulticore
14089 @opindex mmulticore
14090 Build a standalone application for multicore Blackfin processors. 
14091 This option causes proper start files and link scripts supporting 
14092 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
14093 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
14095 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
14096 selects the one-application-per-core programming model.  Without
14097 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
14098 programming model is used. In this model, the main function of Core B
14099 should be named as @code{coreb_main}.
14101 If this option is not used, the single-core application programming
14102 model is used.
14104 @item -mcorea
14105 @opindex mcorea
14106 Build a standalone application for Core A of BF561 when using
14107 the one-application-per-core programming model. Proper start files
14108 and link scripts are used to support Core A, and the macro
14109 @code{__BFIN_COREA} is defined.
14110 This option can only be used in conjunction with @option{-mmulticore}.
14112 @item -mcoreb
14113 @opindex mcoreb
14114 Build a standalone application for Core B of BF561 when using
14115 the one-application-per-core programming model. Proper start files
14116 and link scripts are used to support Core B, and the macro
14117 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
14118 should be used instead of @code{main}. 
14119 This option can only be used in conjunction with @option{-mmulticore}.
14121 @item -msdram
14122 @opindex msdram
14123 Build a standalone application for SDRAM. Proper start files and
14124 link scripts are used to put the application into SDRAM, and the macro
14125 @code{__BFIN_SDRAM} is defined.
14126 The loader should initialize SDRAM before loading the application.
14128 @item -micplb
14129 @opindex micplb
14130 Assume that ICPLBs are enabled at run time.  This has an effect on certain
14131 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
14132 are enabled; for standalone applications the default is off.
14133 @end table
14135 @node C6X Options
14136 @subsection C6X Options
14137 @cindex C6X Options
14139 @table @gcctabopt
14140 @item -march=@var{name}
14141 @opindex march
14142 This specifies the name of the target architecture.  GCC uses this
14143 name to determine what kind of instructions it can emit when generating
14144 assembly code.  Permissible names are: @samp{c62x},
14145 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
14147 @item -mbig-endian
14148 @opindex mbig-endian
14149 Generate code for a big-endian target.
14151 @item -mlittle-endian
14152 @opindex mlittle-endian
14153 Generate code for a little-endian target.  This is the default.
14155 @item -msim
14156 @opindex msim
14157 Choose startup files and linker script suitable for the simulator.
14159 @item -msdata=default
14160 @opindex msdata=default
14161 Put small global and static data in the @code{.neardata} section,
14162 which is pointed to by register @code{B14}.  Put small uninitialized
14163 global and static data in the @code{.bss} section, which is adjacent
14164 to the @code{.neardata} section.  Put small read-only data into the
14165 @code{.rodata} section.  The corresponding sections used for large
14166 pieces of data are @code{.fardata}, @code{.far} and @code{.const}.
14168 @item -msdata=all
14169 @opindex msdata=all
14170 Put all data, not just small objects, into the sections reserved for
14171 small data, and use addressing relative to the @code{B14} register to
14172 access them.
14174 @item -msdata=none
14175 @opindex msdata=none
14176 Make no use of the sections reserved for small data, and use absolute
14177 addresses to access all data.  Put all initialized global and static
14178 data in the @code{.fardata} section, and all uninitialized data in the
14179 @code{.far} section.  Put all constant data into the @code{.const}
14180 section.
14181 @end table
14183 @node CRIS Options
14184 @subsection CRIS Options
14185 @cindex CRIS Options
14187 These options are defined specifically for the CRIS ports.
14189 @table @gcctabopt
14190 @item -march=@var{architecture-type}
14191 @itemx -mcpu=@var{architecture-type}
14192 @opindex march
14193 @opindex mcpu
14194 Generate code for the specified architecture.  The choices for
14195 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
14196 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
14197 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
14198 @samp{v10}.
14200 @item -mtune=@var{architecture-type}
14201 @opindex mtune
14202 Tune to @var{architecture-type} everything applicable about the generated
14203 code, except for the ABI and the set of available instructions.  The
14204 choices for @var{architecture-type} are the same as for
14205 @option{-march=@var{architecture-type}}.
14207 @item -mmax-stack-frame=@var{n}
14208 @opindex mmax-stack-frame
14209 Warn when the stack frame of a function exceeds @var{n} bytes.
14211 @item -metrax4
14212 @itemx -metrax100
14213 @opindex metrax4
14214 @opindex metrax100
14215 The options @option{-metrax4} and @option{-metrax100} are synonyms for
14216 @option{-march=v3} and @option{-march=v8} respectively.
14218 @item -mmul-bug-workaround
14219 @itemx -mno-mul-bug-workaround
14220 @opindex mmul-bug-workaround
14221 @opindex mno-mul-bug-workaround
14222 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
14223 models where it applies.  This option is active by default.
14225 @item -mpdebug
14226 @opindex mpdebug
14227 Enable CRIS-specific verbose debug-related information in the assembly
14228 code.  This option also has the effect of turning off the @samp{#NO_APP}
14229 formatted-code indicator to the assembler at the beginning of the
14230 assembly file.
14232 @item -mcc-init
14233 @opindex mcc-init
14234 Do not use condition-code results from previous instruction; always emit
14235 compare and test instructions before use of condition codes.
14237 @item -mno-side-effects
14238 @opindex mno-side-effects
14239 Do not emit instructions with side effects in addressing modes other than
14240 post-increment.
14242 @item -mstack-align
14243 @itemx -mno-stack-align
14244 @itemx -mdata-align
14245 @itemx -mno-data-align
14246 @itemx -mconst-align
14247 @itemx -mno-const-align
14248 @opindex mstack-align
14249 @opindex mno-stack-align
14250 @opindex mdata-align
14251 @opindex mno-data-align
14252 @opindex mconst-align
14253 @opindex mno-const-align
14254 These options (@samp{no-} options) arrange (eliminate arrangements) for the
14255 stack frame, individual data and constants to be aligned for the maximum
14256 single data access size for the chosen CPU model.  The default is to
14257 arrange for 32-bit alignment.  ABI details such as structure layout are
14258 not affected by these options.
14260 @item -m32-bit
14261 @itemx -m16-bit
14262 @itemx -m8-bit
14263 @opindex m32-bit
14264 @opindex m16-bit
14265 @opindex m8-bit
14266 Similar to the stack- data- and const-align options above, these options
14267 arrange for stack frame, writable data and constants to all be 32-bit,
14268 16-bit or 8-bit aligned.  The default is 32-bit alignment.
14270 @item -mno-prologue-epilogue
14271 @itemx -mprologue-epilogue
14272 @opindex mno-prologue-epilogue
14273 @opindex mprologue-epilogue
14274 With @option{-mno-prologue-epilogue}, the normal function prologue and
14275 epilogue which set up the stack frame are omitted and no return
14276 instructions or return sequences are generated in the code.  Use this
14277 option only together with visual inspection of the compiled code: no
14278 warnings or errors are generated when call-saved registers must be saved,
14279 or storage for local variables needs to be allocated.
14281 @item -mno-gotplt
14282 @itemx -mgotplt
14283 @opindex mno-gotplt
14284 @opindex mgotplt
14285 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
14286 instruction sequences that load addresses for functions from the PLT part
14287 of the GOT rather than (traditional on other architectures) calls to the
14288 PLT@.  The default is @option{-mgotplt}.
14290 @item -melf
14291 @opindex melf
14292 Legacy no-op option only recognized with the cris-axis-elf and
14293 cris-axis-linux-gnu targets.
14295 @item -mlinux
14296 @opindex mlinux
14297 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
14299 @item -sim
14300 @opindex sim
14301 This option, recognized for the cris-axis-elf, arranges
14302 to link with input-output functions from a simulator library.  Code,
14303 initialized data and zero-initialized data are allocated consecutively.
14305 @item -sim2
14306 @opindex sim2
14307 Like @option{-sim}, but pass linker options to locate initialized data at
14308 0x40000000 and zero-initialized data at 0x80000000.
14309 @end table
14311 @node CR16 Options
14312 @subsection CR16 Options
14313 @cindex CR16 Options
14315 These options are defined specifically for the CR16 ports.
14317 @table @gcctabopt
14319 @item -mmac
14320 @opindex mmac
14321 Enable the use of multiply-accumulate instructions. Disabled by default.
14323 @item -mcr16cplus
14324 @itemx -mcr16c
14325 @opindex mcr16cplus
14326 @opindex mcr16c
14327 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
14328 is default.
14330 @item -msim
14331 @opindex msim
14332 Links the library libsim.a which is in compatible with simulator. Applicable
14333 to ELF compiler only.
14335 @item -mint32
14336 @opindex mint32
14337 Choose integer type as 32-bit wide.
14339 @item -mbit-ops
14340 @opindex mbit-ops
14341 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
14343 @item -mdata-model=@var{model}
14344 @opindex mdata-model
14345 Choose a data model. The choices for @var{model} are @samp{near},
14346 @samp{far} or @samp{medium}. @samp{medium} is default.
14347 However, @samp{far} is not valid with @option{-mcr16c}, as the
14348 CR16C architecture does not support the far data model.
14349 @end table
14351 @node Darwin Options
14352 @subsection Darwin Options
14353 @cindex Darwin options
14355 These options are defined for all architectures running the Darwin operating
14356 system.
14358 FSF GCC on Darwin does not create ``fat'' object files; it creates
14359 an object file for the single architecture that GCC was built to
14360 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
14361 @option{-arch} options are used; it does so by running the compiler or
14362 linker multiple times and joining the results together with
14363 @file{lipo}.
14365 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
14366 @samp{i686}) is determined by the flags that specify the ISA
14367 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
14368 @option{-force_cpusubtype_ALL} option can be used to override this.
14370 The Darwin tools vary in their behavior when presented with an ISA
14371 mismatch.  The assembler, @file{as}, only permits instructions to
14372 be used that are valid for the subtype of the file it is generating,
14373 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
14374 The linker for shared libraries, @file{/usr/bin/libtool}, fails
14375 and prints an error if asked to create a shared library with a less
14376 restrictive subtype than its input files (for instance, trying to put
14377 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
14378 for executables, @command{ld}, quietly gives the executable the most
14379 restrictive subtype of any of its input files.
14381 @table @gcctabopt
14382 @item -F@var{dir}
14383 @opindex F
14384 Add the framework directory @var{dir} to the head of the list of
14385 directories to be searched for header files.  These directories are
14386 interleaved with those specified by @option{-I} options and are
14387 scanned in a left-to-right order.
14389 A framework directory is a directory with frameworks in it.  A
14390 framework is a directory with a @file{Headers} and/or
14391 @file{PrivateHeaders} directory contained directly in it that ends
14392 in @file{.framework}.  The name of a framework is the name of this
14393 directory excluding the @file{.framework}.  Headers associated with
14394 the framework are found in one of those two directories, with
14395 @file{Headers} being searched first.  A subframework is a framework
14396 directory that is in a framework's @file{Frameworks} directory.
14397 Includes of subframework headers can only appear in a header of a
14398 framework that contains the subframework, or in a sibling subframework
14399 header.  Two subframeworks are siblings if they occur in the same
14400 framework.  A subframework should not have the same name as a
14401 framework; a warning is issued if this is violated.  Currently a
14402 subframework cannot have subframeworks; in the future, the mechanism
14403 may be extended to support this.  The standard frameworks can be found
14404 in @file{/System/Library/Frameworks} and
14405 @file{/Library/Frameworks}.  An example include looks like
14406 @code{#include <Framework/header.h>}, where @file{Framework} denotes
14407 the name of the framework and @file{header.h} is found in the
14408 @file{PrivateHeaders} or @file{Headers} directory.
14410 @item -iframework@var{dir}
14411 @opindex iframework
14412 Like @option{-F} except the directory is a treated as a system
14413 directory.  The main difference between this @option{-iframework} and
14414 @option{-F} is that with @option{-iframework} the compiler does not
14415 warn about constructs contained within header files found via
14416 @var{dir}.  This option is valid only for the C family of languages.
14418 @item -gused
14419 @opindex gused
14420 Emit debugging information for symbols that are used.  For stabs
14421 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
14422 This is by default ON@.
14424 @item -gfull
14425 @opindex gfull
14426 Emit debugging information for all symbols and types.
14428 @item -mmacosx-version-min=@var{version}
14429 The earliest version of MacOS X that this executable will run on
14430 is @var{version}.  Typical values of @var{version} include @code{10.1},
14431 @code{10.2}, and @code{10.3.9}.
14433 If the compiler was built to use the system's headers by default,
14434 then the default for this option is the system version on which the
14435 compiler is running, otherwise the default is to make choices that
14436 are compatible with as many systems and code bases as possible.
14438 @item -mkernel
14439 @opindex mkernel
14440 Enable kernel development mode.  The @option{-mkernel} option sets
14441 @option{-static}, @option{-fno-common}, @option{-fno-use-cxa-atexit},
14442 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
14443 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
14444 applicable.  This mode also sets @option{-mno-altivec},
14445 @option{-msoft-float}, @option{-fno-builtin} and
14446 @option{-mlong-branch} for PowerPC targets.
14448 @item -mone-byte-bool
14449 @opindex mone-byte-bool
14450 Override the defaults for @code{bool} so that @code{sizeof(bool)==1}.
14451 By default @code{sizeof(bool)} is @code{4} when compiling for
14452 Darwin/PowerPC and @code{1} when compiling for Darwin/x86, so this
14453 option has no effect on x86.
14455 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
14456 to generate code that is not binary compatible with code generated
14457 without that switch.  Using this switch may require recompiling all
14458 other modules in a program, including system libraries.  Use this
14459 switch to conform to a non-default data model.
14461 @item -mfix-and-continue
14462 @itemx -ffix-and-continue
14463 @itemx -findirect-data
14464 @opindex mfix-and-continue
14465 @opindex ffix-and-continue
14466 @opindex findirect-data
14467 Generate code suitable for fast turnaround development, such as to
14468 allow GDB to dynamically load @file{.o} files into already-running
14469 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
14470 are provided for backwards compatibility.
14472 @item -all_load
14473 @opindex all_load
14474 Loads all members of static archive libraries.
14475 See man ld(1) for more information.
14477 @item -arch_errors_fatal
14478 @opindex arch_errors_fatal
14479 Cause the errors having to do with files that have the wrong architecture
14480 to be fatal.
14482 @item -bind_at_load
14483 @opindex bind_at_load
14484 Causes the output file to be marked such that the dynamic linker will
14485 bind all undefined references when the file is loaded or launched.
14487 @item -bundle
14488 @opindex bundle
14489 Produce a Mach-o bundle format file.
14490 See man ld(1) for more information.
14492 @item -bundle_loader @var{executable}
14493 @opindex bundle_loader
14494 This option specifies the @var{executable} that will load the build
14495 output file being linked.  See man ld(1) for more information.
14497 @item -dynamiclib
14498 @opindex dynamiclib
14499 When passed this option, GCC produces a dynamic library instead of
14500 an executable when linking, using the Darwin @file{libtool} command.
14502 @item -force_cpusubtype_ALL
14503 @opindex force_cpusubtype_ALL
14504 This causes GCC's output file to have the @samp{ALL} subtype, instead of
14505 one controlled by the @option{-mcpu} or @option{-march} option.
14507 @item -allowable_client  @var{client_name}
14508 @itemx -client_name
14509 @itemx -compatibility_version
14510 @itemx -current_version
14511 @itemx -dead_strip
14512 @itemx -dependency-file
14513 @itemx -dylib_file
14514 @itemx -dylinker_install_name
14515 @itemx -dynamic
14516 @itemx -exported_symbols_list
14517 @itemx -filelist
14518 @need 800
14519 @itemx -flat_namespace
14520 @itemx -force_flat_namespace
14521 @itemx -headerpad_max_install_names
14522 @itemx -image_base
14523 @itemx -init
14524 @itemx -install_name
14525 @itemx -keep_private_externs
14526 @itemx -multi_module
14527 @itemx -multiply_defined
14528 @itemx -multiply_defined_unused
14529 @need 800
14530 @itemx -noall_load
14531 @itemx -no_dead_strip_inits_and_terms
14532 @itemx -nofixprebinding
14533 @itemx -nomultidefs
14534 @itemx -noprebind
14535 @itemx -noseglinkedit
14536 @itemx -pagezero_size
14537 @itemx -prebind
14538 @itemx -prebind_all_twolevel_modules
14539 @itemx -private_bundle
14540 @need 800
14541 @itemx -read_only_relocs
14542 @itemx -sectalign
14543 @itemx -sectobjectsymbols
14544 @itemx -whyload
14545 @itemx -seg1addr
14546 @itemx -sectcreate
14547 @itemx -sectobjectsymbols
14548 @itemx -sectorder
14549 @itemx -segaddr
14550 @itemx -segs_read_only_addr
14551 @need 800
14552 @itemx -segs_read_write_addr
14553 @itemx -seg_addr_table
14554 @itemx -seg_addr_table_filename
14555 @itemx -seglinkedit
14556 @itemx -segprot
14557 @itemx -segs_read_only_addr
14558 @itemx -segs_read_write_addr
14559 @itemx -single_module
14560 @itemx -static
14561 @itemx -sub_library
14562 @need 800
14563 @itemx -sub_umbrella
14564 @itemx -twolevel_namespace
14565 @itemx -umbrella
14566 @itemx -undefined
14567 @itemx -unexported_symbols_list
14568 @itemx -weak_reference_mismatches
14569 @itemx -whatsloaded
14570 @opindex allowable_client
14571 @opindex client_name
14572 @opindex compatibility_version
14573 @opindex current_version
14574 @opindex dead_strip
14575 @opindex dependency-file
14576 @opindex dylib_file
14577 @opindex dylinker_install_name
14578 @opindex dynamic
14579 @opindex exported_symbols_list
14580 @opindex filelist
14581 @opindex flat_namespace
14582 @opindex force_flat_namespace
14583 @opindex headerpad_max_install_names
14584 @opindex image_base
14585 @opindex init
14586 @opindex install_name
14587 @opindex keep_private_externs
14588 @opindex multi_module
14589 @opindex multiply_defined
14590 @opindex multiply_defined_unused
14591 @opindex noall_load
14592 @opindex no_dead_strip_inits_and_terms
14593 @opindex nofixprebinding
14594 @opindex nomultidefs
14595 @opindex noprebind
14596 @opindex noseglinkedit
14597 @opindex pagezero_size
14598 @opindex prebind
14599 @opindex prebind_all_twolevel_modules
14600 @opindex private_bundle
14601 @opindex read_only_relocs
14602 @opindex sectalign
14603 @opindex sectobjectsymbols
14604 @opindex whyload
14605 @opindex seg1addr
14606 @opindex sectcreate
14607 @opindex sectobjectsymbols
14608 @opindex sectorder
14609 @opindex segaddr
14610 @opindex segs_read_only_addr
14611 @opindex segs_read_write_addr
14612 @opindex seg_addr_table
14613 @opindex seg_addr_table_filename
14614 @opindex seglinkedit
14615 @opindex segprot
14616 @opindex segs_read_only_addr
14617 @opindex segs_read_write_addr
14618 @opindex single_module
14619 @opindex static
14620 @opindex sub_library
14621 @opindex sub_umbrella
14622 @opindex twolevel_namespace
14623 @opindex umbrella
14624 @opindex undefined
14625 @opindex unexported_symbols_list
14626 @opindex weak_reference_mismatches
14627 @opindex whatsloaded
14628 These options are passed to the Darwin linker.  The Darwin linker man page
14629 describes them in detail.
14630 @end table
14632 @node DEC Alpha Options
14633 @subsection DEC Alpha Options
14635 These @samp{-m} options are defined for the DEC Alpha implementations:
14637 @table @gcctabopt
14638 @item -mno-soft-float
14639 @itemx -msoft-float
14640 @opindex mno-soft-float
14641 @opindex msoft-float
14642 Use (do not use) the hardware floating-point instructions for
14643 floating-point operations.  When @option{-msoft-float} is specified,
14644 functions in @file{libgcc.a} are used to perform floating-point
14645 operations.  Unless they are replaced by routines that emulate the
14646 floating-point operations, or compiled in such a way as to call such
14647 emulations routines, these routines issue floating-point
14648 operations.   If you are compiling for an Alpha without floating-point
14649 operations, you must ensure that the library is built so as not to call
14650 them.
14652 Note that Alpha implementations without floating-point operations are
14653 required to have floating-point registers.
14655 @item -mfp-reg
14656 @itemx -mno-fp-regs
14657 @opindex mfp-reg
14658 @opindex mno-fp-regs
14659 Generate code that uses (does not use) the floating-point register set.
14660 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
14661 register set is not used, floating-point operands are passed in integer
14662 registers as if they were integers and floating-point results are passed
14663 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
14664 so any function with a floating-point argument or return value called by code
14665 compiled with @option{-mno-fp-regs} must also be compiled with that
14666 option.
14668 A typical use of this option is building a kernel that does not use,
14669 and hence need not save and restore, any floating-point registers.
14671 @item -mieee
14672 @opindex mieee
14673 The Alpha architecture implements floating-point hardware optimized for
14674 maximum performance.  It is mostly compliant with the IEEE floating-point
14675 standard.  However, for full compliance, software assistance is
14676 required.  This option generates code fully IEEE-compliant code
14677 @emph{except} that the @var{inexact-flag} is not maintained (see below).
14678 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
14679 defined during compilation.  The resulting code is less efficient but is
14680 able to correctly support denormalized numbers and exceptional IEEE
14681 values such as not-a-number and plus/minus infinity.  Other Alpha
14682 compilers call this option @option{-ieee_with_no_inexact}.
14684 @item -mieee-with-inexact
14685 @opindex mieee-with-inexact
14686 This is like @option{-mieee} except the generated code also maintains
14687 the IEEE @var{inexact-flag}.  Turning on this option causes the
14688 generated code to implement fully-compliant IEEE math.  In addition to
14689 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
14690 macro.  On some Alpha implementations the resulting code may execute
14691 significantly slower than the code generated by default.  Since there is
14692 very little code that depends on the @var{inexact-flag}, you should
14693 normally not specify this option.  Other Alpha compilers call this
14694 option @option{-ieee_with_inexact}.
14696 @item -mfp-trap-mode=@var{trap-mode}
14697 @opindex mfp-trap-mode
14698 This option controls what floating-point related traps are enabled.
14699 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
14700 The trap mode can be set to one of four values:
14702 @table @samp
14703 @item n
14704 This is the default (normal) setting.  The only traps that are enabled
14705 are the ones that cannot be disabled in software (e.g., division by zero
14706 trap).
14708 @item u
14709 In addition to the traps enabled by @samp{n}, underflow traps are enabled
14710 as well.
14712 @item su
14713 Like @samp{u}, but the instructions are marked to be safe for software
14714 completion (see Alpha architecture manual for details).
14716 @item sui
14717 Like @samp{su}, but inexact traps are enabled as well.
14718 @end table
14720 @item -mfp-rounding-mode=@var{rounding-mode}
14721 @opindex mfp-rounding-mode
14722 Selects the IEEE rounding mode.  Other Alpha compilers call this option
14723 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
14726 @table @samp
14727 @item n
14728 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
14729 the nearest machine number or towards the even machine number in case
14730 of a tie.
14732 @item m
14733 Round towards minus infinity.
14735 @item c
14736 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
14738 @item d
14739 Dynamic rounding mode.  A field in the floating-point control register
14740 (@var{fpcr}, see Alpha architecture reference manual) controls the
14741 rounding mode in effect.  The C library initializes this register for
14742 rounding towards plus infinity.  Thus, unless your program modifies the
14743 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
14744 @end table
14746 @item -mtrap-precision=@var{trap-precision}
14747 @opindex mtrap-precision
14748 In the Alpha architecture, floating-point traps are imprecise.  This
14749 means without software assistance it is impossible to recover from a
14750 floating trap and program execution normally needs to be terminated.
14751 GCC can generate code that can assist operating system trap handlers
14752 in determining the exact location that caused a floating-point trap.
14753 Depending on the requirements of an application, different levels of
14754 precisions can be selected:
14756 @table @samp
14757 @item p
14758 Program precision.  This option is the default and means a trap handler
14759 can only identify which program caused a floating-point exception.
14761 @item f
14762 Function precision.  The trap handler can determine the function that
14763 caused a floating-point exception.
14765 @item i
14766 Instruction precision.  The trap handler can determine the exact
14767 instruction that caused a floating-point exception.
14768 @end table
14770 Other Alpha compilers provide the equivalent options called
14771 @option{-scope_safe} and @option{-resumption_safe}.
14773 @item -mieee-conformant
14774 @opindex mieee-conformant
14775 This option marks the generated code as IEEE conformant.  You must not
14776 use this option unless you also specify @option{-mtrap-precision=i} and either
14777 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
14778 is to emit the line @samp{.eflag 48} in the function prologue of the
14779 generated assembly file.
14781 @item -mbuild-constants
14782 @opindex mbuild-constants
14783 Normally GCC examines a 32- or 64-bit integer constant to
14784 see if it can construct it from smaller constants in two or three
14785 instructions.  If it cannot, it outputs the constant as a literal and
14786 generates code to load it from the data segment at run time.
14788 Use this option to require GCC to construct @emph{all} integer constants
14789 using code, even if it takes more instructions (the maximum is six).
14791 You typically use this option to build a shared library dynamic
14792 loader.  Itself a shared library, it must relocate itself in memory
14793 before it can find the variables and constants in its own data segment.
14795 @item -mbwx
14796 @itemx -mno-bwx
14797 @itemx -mcix
14798 @itemx -mno-cix
14799 @itemx -mfix
14800 @itemx -mno-fix
14801 @itemx -mmax
14802 @itemx -mno-max
14803 @opindex mbwx
14804 @opindex mno-bwx
14805 @opindex mcix
14806 @opindex mno-cix
14807 @opindex mfix
14808 @opindex mno-fix
14809 @opindex mmax
14810 @opindex mno-max
14811 Indicate whether GCC should generate code to use the optional BWX,
14812 CIX, FIX and MAX instruction sets.  The default is to use the instruction
14813 sets supported by the CPU type specified via @option{-mcpu=} option or that
14814 of the CPU on which GCC was built if none is specified.
14816 @item -mfloat-vax
14817 @itemx -mfloat-ieee
14818 @opindex mfloat-vax
14819 @opindex mfloat-ieee
14820 Generate code that uses (does not use) VAX F and G floating-point
14821 arithmetic instead of IEEE single and double precision.
14823 @item -mexplicit-relocs
14824 @itemx -mno-explicit-relocs
14825 @opindex mexplicit-relocs
14826 @opindex mno-explicit-relocs
14827 Older Alpha assemblers provided no way to generate symbol relocations
14828 except via assembler macros.  Use of these macros does not allow
14829 optimal instruction scheduling.  GNU binutils as of version 2.12
14830 supports a new syntax that allows the compiler to explicitly mark
14831 which relocations should apply to which instructions.  This option
14832 is mostly useful for debugging, as GCC detects the capabilities of
14833 the assembler when it is built and sets the default accordingly.
14835 @item -msmall-data
14836 @itemx -mlarge-data
14837 @opindex msmall-data
14838 @opindex mlarge-data
14839 When @option{-mexplicit-relocs} is in effect, static data is
14840 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
14841 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
14842 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
14843 16-bit relocations off of the @code{$gp} register.  This limits the
14844 size of the small data area to 64KB, but allows the variables to be
14845 directly accessed via a single instruction.
14847 The default is @option{-mlarge-data}.  With this option the data area
14848 is limited to just below 2GB@.  Programs that require more than 2GB of
14849 data must use @code{malloc} or @code{mmap} to allocate the data in the
14850 heap instead of in the program's data segment.
14852 When generating code for shared libraries, @option{-fpic} implies
14853 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
14855 @item -msmall-text
14856 @itemx -mlarge-text
14857 @opindex msmall-text
14858 @opindex mlarge-text
14859 When @option{-msmall-text} is used, the compiler assumes that the
14860 code of the entire program (or shared library) fits in 4MB, and is
14861 thus reachable with a branch instruction.  When @option{-msmall-data}
14862 is used, the compiler can assume that all local symbols share the
14863 same @code{$gp} value, and thus reduce the number of instructions
14864 required for a function call from 4 to 1.
14866 The default is @option{-mlarge-text}.
14868 @item -mcpu=@var{cpu_type}
14869 @opindex mcpu
14870 Set the instruction set and instruction scheduling parameters for
14871 machine type @var{cpu_type}.  You can specify either the @samp{EV}
14872 style name or the corresponding chip number.  GCC supports scheduling
14873 parameters for the EV4, EV5 and EV6 family of processors and
14874 chooses the default values for the instruction set from the processor
14875 you specify.  If you do not specify a processor type, GCC defaults
14876 to the processor on which the compiler was built.
14878 Supported values for @var{cpu_type} are
14880 @table @samp
14881 @item ev4
14882 @itemx ev45
14883 @itemx 21064
14884 Schedules as an EV4 and has no instruction set extensions.
14886 @item ev5
14887 @itemx 21164
14888 Schedules as an EV5 and has no instruction set extensions.
14890 @item ev56
14891 @itemx 21164a
14892 Schedules as an EV5 and supports the BWX extension.
14894 @item pca56
14895 @itemx 21164pc
14896 @itemx 21164PC
14897 Schedules as an EV5 and supports the BWX and MAX extensions.
14899 @item ev6
14900 @itemx 21264
14901 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
14903 @item ev67
14904 @itemx 21264a
14905 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
14906 @end table
14908 Native toolchains also support the value @samp{native},
14909 which selects the best architecture option for the host processor.
14910 @option{-mcpu=native} has no effect if GCC does not recognize
14911 the processor.
14913 @item -mtune=@var{cpu_type}
14914 @opindex mtune
14915 Set only the instruction scheduling parameters for machine type
14916 @var{cpu_type}.  The instruction set is not changed.
14918 Native toolchains also support the value @samp{native},
14919 which selects the best architecture option for the host processor.
14920 @option{-mtune=native} has no effect if GCC does not recognize
14921 the processor.
14923 @item -mmemory-latency=@var{time}
14924 @opindex mmemory-latency
14925 Sets the latency the scheduler should assume for typical memory
14926 references as seen by the application.  This number is highly
14927 dependent on the memory access patterns used by the application
14928 and the size of the external cache on the machine.
14930 Valid options for @var{time} are
14932 @table @samp
14933 @item @var{number}
14934 A decimal number representing clock cycles.
14936 @item L1
14937 @itemx L2
14938 @itemx L3
14939 @itemx main
14940 The compiler contains estimates of the number of clock cycles for
14941 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
14942 (also called Dcache, Scache, and Bcache), as well as to main memory.
14943 Note that L3 is only valid for EV5.
14945 @end table
14946 @end table
14948 @node FR30 Options
14949 @subsection FR30 Options
14950 @cindex FR30 Options
14952 These options are defined specifically for the FR30 port.
14954 @table @gcctabopt
14956 @item -msmall-model
14957 @opindex msmall-model
14958 Use the small address space model.  This can produce smaller code, but
14959 it does assume that all symbolic values and addresses fit into a
14960 20-bit range.
14962 @item -mno-lsim
14963 @opindex mno-lsim
14964 Assume that runtime support has been provided and so there is no need
14965 to include the simulator library (@file{libsim.a}) on the linker
14966 command line.
14968 @end table
14970 @node FRV Options
14971 @subsection FRV Options
14972 @cindex FRV Options
14974 @table @gcctabopt
14975 @item -mgpr-32
14976 @opindex mgpr-32
14978 Only use the first 32 general-purpose registers.
14980 @item -mgpr-64
14981 @opindex mgpr-64
14983 Use all 64 general-purpose registers.
14985 @item -mfpr-32
14986 @opindex mfpr-32
14988 Use only the first 32 floating-point registers.
14990 @item -mfpr-64
14991 @opindex mfpr-64
14993 Use all 64 floating-point registers.
14995 @item -mhard-float
14996 @opindex mhard-float
14998 Use hardware instructions for floating-point operations.
15000 @item -msoft-float
15001 @opindex msoft-float
15003 Use library routines for floating-point operations.
15005 @item -malloc-cc
15006 @opindex malloc-cc
15008 Dynamically allocate condition code registers.
15010 @item -mfixed-cc
15011 @opindex mfixed-cc
15013 Do not try to dynamically allocate condition code registers, only
15014 use @code{icc0} and @code{fcc0}.
15016 @item -mdword
15017 @opindex mdword
15019 Change ABI to use double word insns.
15021 @item -mno-dword
15022 @opindex mno-dword
15024 Do not use double word instructions.
15026 @item -mdouble
15027 @opindex mdouble
15029 Use floating-point double instructions.
15031 @item -mno-double
15032 @opindex mno-double
15034 Do not use floating-point double instructions.
15036 @item -mmedia
15037 @opindex mmedia
15039 Use media instructions.
15041 @item -mno-media
15042 @opindex mno-media
15044 Do not use media instructions.
15046 @item -mmuladd
15047 @opindex mmuladd
15049 Use multiply and add/subtract instructions.
15051 @item -mno-muladd
15052 @opindex mno-muladd
15054 Do not use multiply and add/subtract instructions.
15056 @item -mfdpic
15057 @opindex mfdpic
15059 Select the FDPIC ABI, which uses function descriptors to represent
15060 pointers to functions.  Without any PIC/PIE-related options, it
15061 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
15062 assumes GOT entries and small data are within a 12-bit range from the
15063 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
15064 are computed with 32 bits.
15065 With a @samp{bfin-elf} target, this option implies @option{-msim}.
15067 @item -minline-plt
15068 @opindex minline-plt
15070 Enable inlining of PLT entries in function calls to functions that are
15071 not known to bind locally.  It has no effect without @option{-mfdpic}.
15072 It's enabled by default if optimizing for speed and compiling for
15073 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
15074 optimization option such as @option{-O3} or above is present in the
15075 command line.
15077 @item -mTLS
15078 @opindex mTLS
15080 Assume a large TLS segment when generating thread-local code.
15082 @item -mtls
15083 @opindex mtls
15085 Do not assume a large TLS segment when generating thread-local code.
15087 @item -mgprel-ro
15088 @opindex mgprel-ro
15090 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
15091 that is known to be in read-only sections.  It's enabled by default,
15092 except for @option{-fpic} or @option{-fpie}: even though it may help
15093 make the global offset table smaller, it trades 1 instruction for 4.
15094 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
15095 one of which may be shared by multiple symbols, and it avoids the need
15096 for a GOT entry for the referenced symbol, so it's more likely to be a
15097 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
15099 @item -multilib-library-pic
15100 @opindex multilib-library-pic
15102 Link with the (library, not FD) pic libraries.  It's implied by
15103 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
15104 @option{-fpic} without @option{-mfdpic}.  You should never have to use
15105 it explicitly.
15107 @item -mlinked-fp
15108 @opindex mlinked-fp
15110 Follow the EABI requirement of always creating a frame pointer whenever
15111 a stack frame is allocated.  This option is enabled by default and can
15112 be disabled with @option{-mno-linked-fp}.
15114 @item -mlong-calls
15115 @opindex mlong-calls
15117 Use indirect addressing to call functions outside the current
15118 compilation unit.  This allows the functions to be placed anywhere
15119 within the 32-bit address space.
15121 @item -malign-labels
15122 @opindex malign-labels
15124 Try to align labels to an 8-byte boundary by inserting NOPs into the
15125 previous packet.  This option only has an effect when VLIW packing
15126 is enabled.  It doesn't create new packets; it merely adds NOPs to
15127 existing ones.
15129 @item -mlibrary-pic
15130 @opindex mlibrary-pic
15132 Generate position-independent EABI code.
15134 @item -macc-4
15135 @opindex macc-4
15137 Use only the first four media accumulator registers.
15139 @item -macc-8
15140 @opindex macc-8
15142 Use all eight media accumulator registers.
15144 @item -mpack
15145 @opindex mpack
15147 Pack VLIW instructions.
15149 @item -mno-pack
15150 @opindex mno-pack
15152 Do not pack VLIW instructions.
15154 @item -mno-eflags
15155 @opindex mno-eflags
15157 Do not mark ABI switches in e_flags.
15159 @item -mcond-move
15160 @opindex mcond-move
15162 Enable the use of conditional-move instructions (default).
15164 This switch is mainly for debugging the compiler and will likely be removed
15165 in a future version.
15167 @item -mno-cond-move
15168 @opindex mno-cond-move
15170 Disable the use of conditional-move instructions.
15172 This switch is mainly for debugging the compiler and will likely be removed
15173 in a future version.
15175 @item -mscc
15176 @opindex mscc
15178 Enable the use of conditional set instructions (default).
15180 This switch is mainly for debugging the compiler and will likely be removed
15181 in a future version.
15183 @item -mno-scc
15184 @opindex mno-scc
15186 Disable the use of conditional set instructions.
15188 This switch is mainly for debugging the compiler and will likely be removed
15189 in a future version.
15191 @item -mcond-exec
15192 @opindex mcond-exec
15194 Enable the use of conditional execution (default).
15196 This switch is mainly for debugging the compiler and will likely be removed
15197 in a future version.
15199 @item -mno-cond-exec
15200 @opindex mno-cond-exec
15202 Disable the use of conditional execution.
15204 This switch is mainly for debugging the compiler and will likely be removed
15205 in a future version.
15207 @item -mvliw-branch
15208 @opindex mvliw-branch
15210 Run a pass to pack branches into VLIW instructions (default).
15212 This switch is mainly for debugging the compiler and will likely be removed
15213 in a future version.
15215 @item -mno-vliw-branch
15216 @opindex mno-vliw-branch
15218 Do not run a pass to pack branches into VLIW instructions.
15220 This switch is mainly for debugging the compiler and will likely be removed
15221 in a future version.
15223 @item -mmulti-cond-exec
15224 @opindex mmulti-cond-exec
15226 Enable optimization of @code{&&} and @code{||} in conditional execution
15227 (default).
15229 This switch is mainly for debugging the compiler and will likely be removed
15230 in a future version.
15232 @item -mno-multi-cond-exec
15233 @opindex mno-multi-cond-exec
15235 Disable optimization of @code{&&} and @code{||} in conditional execution.
15237 This switch is mainly for debugging the compiler and will likely be removed
15238 in a future version.
15240 @item -mnested-cond-exec
15241 @opindex mnested-cond-exec
15243 Enable nested conditional execution optimizations (default).
15245 This switch is mainly for debugging the compiler and will likely be removed
15246 in a future version.
15248 @item -mno-nested-cond-exec
15249 @opindex mno-nested-cond-exec
15251 Disable nested conditional execution optimizations.
15253 This switch is mainly for debugging the compiler and will likely be removed
15254 in a future version.
15256 @item -moptimize-membar
15257 @opindex moptimize-membar
15259 This switch removes redundant @code{membar} instructions from the
15260 compiler-generated code.  It is enabled by default.
15262 @item -mno-optimize-membar
15263 @opindex mno-optimize-membar
15265 This switch disables the automatic removal of redundant @code{membar}
15266 instructions from the generated code.
15268 @item -mtomcat-stats
15269 @opindex mtomcat-stats
15271 Cause gas to print out tomcat statistics.
15273 @item -mcpu=@var{cpu}
15274 @opindex mcpu
15276 Select the processor type for which to generate code.  Possible values are
15277 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
15278 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
15280 @end table
15282 @node GNU/Linux Options
15283 @subsection GNU/Linux Options
15285 These @samp{-m} options are defined for GNU/Linux targets:
15287 @table @gcctabopt
15288 @item -mglibc
15289 @opindex mglibc
15290 Use the GNU C library.  This is the default except
15291 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
15293 @item -muclibc
15294 @opindex muclibc
15295 Use uClibc C library.  This is the default on
15296 @samp{*-*-linux-*uclibc*} targets.
15298 @item -mbionic
15299 @opindex mbionic
15300 Use Bionic C library.  This is the default on
15301 @samp{*-*-linux-*android*} targets.
15303 @item -mandroid
15304 @opindex mandroid
15305 Compile code compatible with Android platform.  This is the default on
15306 @samp{*-*-linux-*android*} targets.
15308 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
15309 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
15310 this option makes the GCC driver pass Android-specific options to the linker.
15311 Finally, this option causes the preprocessor macro @code{__ANDROID__}
15312 to be defined.
15314 @item -tno-android-cc
15315 @opindex tno-android-cc
15316 Disable compilation effects of @option{-mandroid}, i.e., do not enable
15317 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
15318 @option{-fno-rtti} by default.
15320 @item -tno-android-ld
15321 @opindex tno-android-ld
15322 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
15323 linking options to the linker.
15325 @end table
15327 @node H8/300 Options
15328 @subsection H8/300 Options
15330 These @samp{-m} options are defined for the H8/300 implementations:
15332 @table @gcctabopt
15333 @item -mrelax
15334 @opindex mrelax
15335 Shorten some address references at link time, when possible; uses the
15336 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
15337 ld, Using ld}, for a fuller description.
15339 @item -mh
15340 @opindex mh
15341 Generate code for the H8/300H@.
15343 @item -ms
15344 @opindex ms
15345 Generate code for the H8S@.
15347 @item -mn
15348 @opindex mn
15349 Generate code for the H8S and H8/300H in the normal mode.  This switch
15350 must be used either with @option{-mh} or @option{-ms}.
15352 @item -ms2600
15353 @opindex ms2600
15354 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
15356 @item -mexr
15357 @opindex mexr
15358 Extended registers are stored on stack before execution of function
15359 with monitor attribute. Default option is @option{-mexr}.
15360 This option is valid only for H8S targets.
15362 @item -mno-exr
15363 @opindex mno-exr
15364 Extended registers are not stored on stack before execution of function 
15365 with monitor attribute. Default option is @option{-mno-exr}. 
15366 This option is valid only for H8S targets.
15368 @item -mint32
15369 @opindex mint32
15370 Make @code{int} data 32 bits by default.
15372 @item -malign-300
15373 @opindex malign-300
15374 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
15375 The default for the H8/300H and H8S is to align longs and floats on
15376 4-byte boundaries.
15377 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
15378 This option has no effect on the H8/300.
15379 @end table
15381 @node HPPA Options
15382 @subsection HPPA Options
15383 @cindex HPPA Options
15385 These @samp{-m} options are defined for the HPPA family of computers:
15387 @table @gcctabopt
15388 @item -march=@var{architecture-type}
15389 @opindex march
15390 Generate code for the specified architecture.  The choices for
15391 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
15392 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
15393 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
15394 architecture option for your machine.  Code compiled for lower numbered
15395 architectures runs on higher numbered architectures, but not the
15396 other way around.
15398 @item -mpa-risc-1-0
15399 @itemx -mpa-risc-1-1
15400 @itemx -mpa-risc-2-0
15401 @opindex mpa-risc-1-0
15402 @opindex mpa-risc-1-1
15403 @opindex mpa-risc-2-0
15404 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
15406 @item -mjump-in-delay
15407 @opindex mjump-in-delay
15408 This option is ignored and provided for compatibility purposes only.
15410 @item -mdisable-fpregs
15411 @opindex mdisable-fpregs
15412 Prevent floating-point registers from being used in any manner.  This is
15413 necessary for compiling kernels that perform lazy context switching of
15414 floating-point registers.  If you use this option and attempt to perform
15415 floating-point operations, the compiler aborts.
15417 @item -mdisable-indexing
15418 @opindex mdisable-indexing
15419 Prevent the compiler from using indexing address modes.  This avoids some
15420 rather obscure problems when compiling MIG generated code under MACH@.
15422 @item -mno-space-regs
15423 @opindex mno-space-regs
15424 Generate code that assumes the target has no space registers.  This allows
15425 GCC to generate faster indirect calls and use unscaled index address modes.
15427 Such code is suitable for level 0 PA systems and kernels.
15429 @item -mfast-indirect-calls
15430 @opindex mfast-indirect-calls
15431 Generate code that assumes calls never cross space boundaries.  This
15432 allows GCC to emit code that performs faster indirect calls.
15434 This option does not work in the presence of shared libraries or nested
15435 functions.
15437 @item -mfixed-range=@var{register-range}
15438 @opindex mfixed-range
15439 Generate code treating the given register range as fixed registers.
15440 A fixed register is one that the register allocator cannot use.  This is
15441 useful when compiling kernel code.  A register range is specified as
15442 two registers separated by a dash.  Multiple register ranges can be
15443 specified separated by a comma.
15445 @item -mlong-load-store
15446 @opindex mlong-load-store
15447 Generate 3-instruction load and store sequences as sometimes required by
15448 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
15449 the HP compilers.
15451 @item -mportable-runtime
15452 @opindex mportable-runtime
15453 Use the portable calling conventions proposed by HP for ELF systems.
15455 @item -mgas
15456 @opindex mgas
15457 Enable the use of assembler directives only GAS understands.
15459 @item -mschedule=@var{cpu-type}
15460 @opindex mschedule
15461 Schedule code according to the constraints for the machine type
15462 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
15463 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
15464 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
15465 proper scheduling option for your machine.  The default scheduling is
15466 @samp{8000}.
15468 @item -mlinker-opt
15469 @opindex mlinker-opt
15470 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
15471 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
15472 linkers in which they give bogus error messages when linking some programs.
15474 @item -msoft-float
15475 @opindex msoft-float
15476 Generate output containing library calls for floating point.
15477 @strong{Warning:} the requisite libraries are not available for all HPPA
15478 targets.  Normally the facilities of the machine's usual C compiler are
15479 used, but this cannot be done directly in cross-compilation.  You must make
15480 your own arrangements to provide suitable library functions for
15481 cross-compilation.
15483 @option{-msoft-float} changes the calling convention in the output file;
15484 therefore, it is only useful if you compile @emph{all} of a program with
15485 this option.  In particular, you need to compile @file{libgcc.a}, the
15486 library that comes with GCC, with @option{-msoft-float} in order for
15487 this to work.
15489 @item -msio
15490 @opindex msio
15491 Generate the predefine, @code{_SIO}, for server IO@.  The default is
15492 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
15493 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
15494 options are available under HP-UX and HI-UX@.
15496 @item -mgnu-ld
15497 @opindex mgnu-ld
15498 Use options specific to GNU @command{ld}.
15499 This passes @option{-shared} to @command{ld} when
15500 building a shared library.  It is the default when GCC is configured,
15501 explicitly or implicitly, with the GNU linker.  This option does not
15502 affect which @command{ld} is called; it only changes what parameters
15503 are passed to that @command{ld}.
15504 The @command{ld} that is called is determined by the
15505 @option{--with-ld} configure option, GCC's program search path, and
15506 finally by the user's @env{PATH}.  The linker used by GCC can be printed
15507 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
15508 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
15510 @item -mhp-ld
15511 @opindex mhp-ld
15512 Use options specific to HP @command{ld}.
15513 This passes @option{-b} to @command{ld} when building
15514 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
15515 links.  It is the default when GCC is configured, explicitly or
15516 implicitly, with the HP linker.  This option does not affect
15517 which @command{ld} is called; it only changes what parameters are passed to that
15518 @command{ld}.
15519 The @command{ld} that is called is determined by the @option{--with-ld}
15520 configure option, GCC's program search path, and finally by the user's
15521 @env{PATH}.  The linker used by GCC can be printed using @samp{which
15522 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
15523 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
15525 @item -mlong-calls
15526 @opindex mno-long-calls
15527 Generate code that uses long call sequences.  This ensures that a call
15528 is always able to reach linker generated stubs.  The default is to generate
15529 long calls only when the distance from the call site to the beginning
15530 of the function or translation unit, as the case may be, exceeds a
15531 predefined limit set by the branch type being used.  The limits for
15532 normal calls are 7,600,000 and 240,000 bytes, respectively for the
15533 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
15534 240,000 bytes.
15536 Distances are measured from the beginning of functions when using the
15537 @option{-ffunction-sections} option, or when using the @option{-mgas}
15538 and @option{-mno-portable-runtime} options together under HP-UX with
15539 the SOM linker.
15541 It is normally not desirable to use this option as it degrades
15542 performance.  However, it may be useful in large applications,
15543 particularly when partial linking is used to build the application.
15545 The types of long calls used depends on the capabilities of the
15546 assembler and linker, and the type of code being generated.  The
15547 impact on systems that support long absolute calls, and long pic
15548 symbol-difference or pc-relative calls should be relatively small.
15549 However, an indirect call is used on 32-bit ELF systems in pic code
15550 and it is quite long.
15552 @item -munix=@var{unix-std}
15553 @opindex march
15554 Generate compiler predefines and select a startfile for the specified
15555 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
15556 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
15557 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
15558 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
15559 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
15560 and later.
15562 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
15563 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
15564 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
15565 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
15566 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
15567 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
15569 It is @emph{important} to note that this option changes the interfaces
15570 for various library routines.  It also affects the operational behavior
15571 of the C library.  Thus, @emph{extreme} care is needed in using this
15572 option.
15574 Library code that is intended to operate with more than one UNIX
15575 standard must test, set and restore the variable @code{__xpg4_extended_mask}
15576 as appropriate.  Most GNU software doesn't provide this capability.
15578 @item -nolibdld
15579 @opindex nolibdld
15580 Suppress the generation of link options to search libdld.sl when the
15581 @option{-static} option is specified on HP-UX 10 and later.
15583 @item -static
15584 @opindex static
15585 The HP-UX implementation of setlocale in libc has a dependency on
15586 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
15587 when the @option{-static} option is specified, special link options
15588 are needed to resolve this dependency.
15590 On HP-UX 10 and later, the GCC driver adds the necessary options to
15591 link with libdld.sl when the @option{-static} option is specified.
15592 This causes the resulting binary to be dynamic.  On the 64-bit port,
15593 the linkers generate dynamic binaries by default in any case.  The
15594 @option{-nolibdld} option can be used to prevent the GCC driver from
15595 adding these link options.
15597 @item -threads
15598 @opindex threads
15599 Add support for multithreading with the @dfn{dce thread} library
15600 under HP-UX@.  This option sets flags for both the preprocessor and
15601 linker.
15602 @end table
15604 @node IA-64 Options
15605 @subsection IA-64 Options
15606 @cindex IA-64 Options
15608 These are the @samp{-m} options defined for the Intel IA-64 architecture.
15610 @table @gcctabopt
15611 @item -mbig-endian
15612 @opindex mbig-endian
15613 Generate code for a big-endian target.  This is the default for HP-UX@.
15615 @item -mlittle-endian
15616 @opindex mlittle-endian
15617 Generate code for a little-endian target.  This is the default for AIX5
15618 and GNU/Linux.
15620 @item -mgnu-as
15621 @itemx -mno-gnu-as
15622 @opindex mgnu-as
15623 @opindex mno-gnu-as
15624 Generate (or don't) code for the GNU assembler.  This is the default.
15625 @c Also, this is the default if the configure option @option{--with-gnu-as}
15626 @c is used.
15628 @item -mgnu-ld
15629 @itemx -mno-gnu-ld
15630 @opindex mgnu-ld
15631 @opindex mno-gnu-ld
15632 Generate (or don't) code for the GNU linker.  This is the default.
15633 @c Also, this is the default if the configure option @option{--with-gnu-ld}
15634 @c is used.
15636 @item -mno-pic
15637 @opindex mno-pic
15638 Generate code that does not use a global pointer register.  The result
15639 is not position independent code, and violates the IA-64 ABI@.
15641 @item -mvolatile-asm-stop
15642 @itemx -mno-volatile-asm-stop
15643 @opindex mvolatile-asm-stop
15644 @opindex mno-volatile-asm-stop
15645 Generate (or don't) a stop bit immediately before and after volatile asm
15646 statements.
15648 @item -mregister-names
15649 @itemx -mno-register-names
15650 @opindex mregister-names
15651 @opindex mno-register-names
15652 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
15653 the stacked registers.  This may make assembler output more readable.
15655 @item -mno-sdata
15656 @itemx -msdata
15657 @opindex mno-sdata
15658 @opindex msdata
15659 Disable (or enable) optimizations that use the small data section.  This may
15660 be useful for working around optimizer bugs.
15662 @item -mconstant-gp
15663 @opindex mconstant-gp
15664 Generate code that uses a single constant global pointer value.  This is
15665 useful when compiling kernel code.
15667 @item -mauto-pic
15668 @opindex mauto-pic
15669 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
15670 This is useful when compiling firmware code.
15672 @item -minline-float-divide-min-latency
15673 @opindex minline-float-divide-min-latency
15674 Generate code for inline divides of floating-point values
15675 using the minimum latency algorithm.
15677 @item -minline-float-divide-max-throughput
15678 @opindex minline-float-divide-max-throughput
15679 Generate code for inline divides of floating-point values
15680 using the maximum throughput algorithm.
15682 @item -mno-inline-float-divide
15683 @opindex mno-inline-float-divide
15684 Do not generate inline code for divides of floating-point values.
15686 @item -minline-int-divide-min-latency
15687 @opindex minline-int-divide-min-latency
15688 Generate code for inline divides of integer values
15689 using the minimum latency algorithm.
15691 @item -minline-int-divide-max-throughput
15692 @opindex minline-int-divide-max-throughput
15693 Generate code for inline divides of integer values
15694 using the maximum throughput algorithm.
15696 @item -mno-inline-int-divide
15697 @opindex mno-inline-int-divide
15698 Do not generate inline code for divides of integer values.
15700 @item -minline-sqrt-min-latency
15701 @opindex minline-sqrt-min-latency
15702 Generate code for inline square roots
15703 using the minimum latency algorithm.
15705 @item -minline-sqrt-max-throughput
15706 @opindex minline-sqrt-max-throughput
15707 Generate code for inline square roots
15708 using the maximum throughput algorithm.
15710 @item -mno-inline-sqrt
15711 @opindex mno-inline-sqrt
15712 Do not generate inline code for @code{sqrt}.
15714 @item -mfused-madd
15715 @itemx -mno-fused-madd
15716 @opindex mfused-madd
15717 @opindex mno-fused-madd
15718 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
15719 instructions.  The default is to use these instructions.
15721 @item -mno-dwarf2-asm
15722 @itemx -mdwarf2-asm
15723 @opindex mno-dwarf2-asm
15724 @opindex mdwarf2-asm
15725 Don't (or do) generate assembler code for the DWARF 2 line number debugging
15726 info.  This may be useful when not using the GNU assembler.
15728 @item -mearly-stop-bits
15729 @itemx -mno-early-stop-bits
15730 @opindex mearly-stop-bits
15731 @opindex mno-early-stop-bits
15732 Allow stop bits to be placed earlier than immediately preceding the
15733 instruction that triggered the stop bit.  This can improve instruction
15734 scheduling, but does not always do so.
15736 @item -mfixed-range=@var{register-range}
15737 @opindex mfixed-range
15738 Generate code treating the given register range as fixed registers.
15739 A fixed register is one that the register allocator cannot use.  This is
15740 useful when compiling kernel code.  A register range is specified as
15741 two registers separated by a dash.  Multiple register ranges can be
15742 specified separated by a comma.
15744 @item -mtls-size=@var{tls-size}
15745 @opindex mtls-size
15746 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
15749 @item -mtune=@var{cpu-type}
15750 @opindex mtune
15751 Tune the instruction scheduling for a particular CPU, Valid values are
15752 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
15753 and @samp{mckinley}.
15755 @item -milp32
15756 @itemx -mlp64
15757 @opindex milp32
15758 @opindex mlp64
15759 Generate code for a 32-bit or 64-bit environment.
15760 The 32-bit environment sets int, long and pointer to 32 bits.
15761 The 64-bit environment sets int to 32 bits and long and pointer
15762 to 64 bits.  These are HP-UX specific flags.
15764 @item -mno-sched-br-data-spec
15765 @itemx -msched-br-data-spec
15766 @opindex mno-sched-br-data-spec
15767 @opindex msched-br-data-spec
15768 (Dis/En)able data speculative scheduling before reload.
15769 This results in generation of @code{ld.a} instructions and
15770 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
15771 The default is 'disable'.
15773 @item -msched-ar-data-spec
15774 @itemx -mno-sched-ar-data-spec
15775 @opindex msched-ar-data-spec
15776 @opindex mno-sched-ar-data-spec
15777 (En/Dis)able data speculative scheduling after reload.
15778 This results in generation of @code{ld.a} instructions and
15779 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
15780 The default is 'enable'.
15782 @item -mno-sched-control-spec
15783 @itemx -msched-control-spec
15784 @opindex mno-sched-control-spec
15785 @opindex msched-control-spec
15786 (Dis/En)able control speculative scheduling.  This feature is
15787 available only during region scheduling (i.e.@: before reload).
15788 This results in generation of the @code{ld.s} instructions and
15789 the corresponding check instructions @code{chk.s}.
15790 The default is 'disable'.
15792 @item -msched-br-in-data-spec
15793 @itemx -mno-sched-br-in-data-spec
15794 @opindex msched-br-in-data-spec
15795 @opindex mno-sched-br-in-data-spec
15796 (En/Dis)able speculative scheduling of the instructions that
15797 are dependent on the data speculative loads before reload.
15798 This is effective only with @option{-msched-br-data-spec} enabled.
15799 The default is 'enable'.
15801 @item -msched-ar-in-data-spec
15802 @itemx -mno-sched-ar-in-data-spec
15803 @opindex msched-ar-in-data-spec
15804 @opindex mno-sched-ar-in-data-spec
15805 (En/Dis)able speculative scheduling of the instructions that
15806 are dependent on the data speculative loads after reload.
15807 This is effective only with @option{-msched-ar-data-spec} enabled.
15808 The default is 'enable'.
15810 @item -msched-in-control-spec
15811 @itemx -mno-sched-in-control-spec
15812 @opindex msched-in-control-spec
15813 @opindex mno-sched-in-control-spec
15814 (En/Dis)able speculative scheduling of the instructions that
15815 are dependent on the control speculative loads.
15816 This is effective only with @option{-msched-control-spec} enabled.
15817 The default is 'enable'.
15819 @item -mno-sched-prefer-non-data-spec-insns
15820 @itemx -msched-prefer-non-data-spec-insns
15821 @opindex mno-sched-prefer-non-data-spec-insns
15822 @opindex msched-prefer-non-data-spec-insns
15823 If enabled, data-speculative instructions are chosen for schedule
15824 only if there are no other choices at the moment.  This makes
15825 the use of the data speculation much more conservative.
15826 The default is 'disable'.
15828 @item -mno-sched-prefer-non-control-spec-insns
15829 @itemx -msched-prefer-non-control-spec-insns
15830 @opindex mno-sched-prefer-non-control-spec-insns
15831 @opindex msched-prefer-non-control-spec-insns
15832 If enabled, control-speculative instructions are chosen for schedule
15833 only if there are no other choices at the moment.  This makes
15834 the use of the control speculation much more conservative.
15835 The default is 'disable'.
15837 @item -mno-sched-count-spec-in-critical-path
15838 @itemx -msched-count-spec-in-critical-path
15839 @opindex mno-sched-count-spec-in-critical-path
15840 @opindex msched-count-spec-in-critical-path
15841 If enabled, speculative dependencies are considered during
15842 computation of the instructions priorities.  This makes the use of the
15843 speculation a bit more conservative.
15844 The default is 'disable'.
15846 @item -msched-spec-ldc
15847 @opindex msched-spec-ldc
15848 Use a simple data speculation check.  This option is on by default.
15850 @item -msched-control-spec-ldc
15851 @opindex msched-spec-ldc
15852 Use a simple check for control speculation.  This option is on by default.
15854 @item -msched-stop-bits-after-every-cycle
15855 @opindex msched-stop-bits-after-every-cycle
15856 Place a stop bit after every cycle when scheduling.  This option is on
15857 by default.
15859 @item -msched-fp-mem-deps-zero-cost
15860 @opindex msched-fp-mem-deps-zero-cost
15861 Assume that floating-point stores and loads are not likely to cause a conflict
15862 when placed into the same instruction group.  This option is disabled by
15863 default.
15865 @item -msel-sched-dont-check-control-spec
15866 @opindex msel-sched-dont-check-control-spec
15867 Generate checks for control speculation in selective scheduling.
15868 This flag is disabled by default.
15870 @item -msched-max-memory-insns=@var{max-insns}
15871 @opindex msched-max-memory-insns
15872 Limit on the number of memory insns per instruction group, giving lower
15873 priority to subsequent memory insns attempting to schedule in the same
15874 instruction group. Frequently useful to prevent cache bank conflicts.
15875 The default value is 1.
15877 @item -msched-max-memory-insns-hard-limit
15878 @opindex msched-max-memory-insns-hard-limit
15879 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
15880 disallowing more than that number in an instruction group.
15881 Otherwise, the limit is ``soft'', meaning that non-memory operations
15882 are preferred when the limit is reached, but memory operations may still
15883 be scheduled.
15885 @end table
15887 @node LM32 Options
15888 @subsection LM32 Options
15889 @cindex LM32 options
15891 These @option{-m} options are defined for the LatticeMico32 architecture:
15893 @table @gcctabopt
15894 @item -mbarrel-shift-enabled
15895 @opindex mbarrel-shift-enabled
15896 Enable barrel-shift instructions.
15898 @item -mdivide-enabled
15899 @opindex mdivide-enabled
15900 Enable divide and modulus instructions.
15902 @item -mmultiply-enabled
15903 @opindex multiply-enabled
15904 Enable multiply instructions.
15906 @item -msign-extend-enabled
15907 @opindex msign-extend-enabled
15908 Enable sign extend instructions.
15910 @item -muser-enabled
15911 @opindex muser-enabled
15912 Enable user-defined instructions.
15914 @end table
15916 @node M32C Options
15917 @subsection M32C Options
15918 @cindex M32C options
15920 @table @gcctabopt
15921 @item -mcpu=@var{name}
15922 @opindex mcpu=
15923 Select the CPU for which code is generated.  @var{name} may be one of
15924 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
15925 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
15926 the M32C/80 series.
15928 @item -msim
15929 @opindex msim
15930 Specifies that the program will be run on the simulator.  This causes
15931 an alternate runtime library to be linked in which supports, for
15932 example, file I/O@.  You must not use this option when generating
15933 programs that will run on real hardware; you must provide your own
15934 runtime library for whatever I/O functions are needed.
15936 @item -memregs=@var{number}
15937 @opindex memregs=
15938 Specifies the number of memory-based pseudo-registers GCC uses
15939 during code generation.  These pseudo-registers are used like real
15940 registers, so there is a tradeoff between GCC's ability to fit the
15941 code into available registers, and the performance penalty of using
15942 memory instead of registers.  Note that all modules in a program must
15943 be compiled with the same value for this option.  Because of that, you
15944 must not use this option with GCC's default runtime libraries.
15946 @end table
15948 @node M32R/D Options
15949 @subsection M32R/D Options
15950 @cindex M32R/D options
15952 These @option{-m} options are defined for Renesas M32R/D architectures:
15954 @table @gcctabopt
15955 @item -m32r2
15956 @opindex m32r2
15957 Generate code for the M32R/2@.
15959 @item -m32rx
15960 @opindex m32rx
15961 Generate code for the M32R/X@.
15963 @item -m32r
15964 @opindex m32r
15965 Generate code for the M32R@.  This is the default.
15967 @item -mmodel=small
15968 @opindex mmodel=small
15969 Assume all objects live in the lower 16MB of memory (so that their addresses
15970 can be loaded with the @code{ld24} instruction), and assume all subroutines
15971 are reachable with the @code{bl} instruction.
15972 This is the default.
15974 The addressability of a particular object can be set with the
15975 @code{model} attribute.
15977 @item -mmodel=medium
15978 @opindex mmodel=medium
15979 Assume objects may be anywhere in the 32-bit address space (the compiler
15980 generates @code{seth/add3} instructions to load their addresses), and
15981 assume all subroutines are reachable with the @code{bl} instruction.
15983 @item -mmodel=large
15984 @opindex mmodel=large
15985 Assume objects may be anywhere in the 32-bit address space (the compiler
15986 generates @code{seth/add3} instructions to load their addresses), and
15987 assume subroutines may not be reachable with the @code{bl} instruction
15988 (the compiler generates the much slower @code{seth/add3/jl}
15989 instruction sequence).
15991 @item -msdata=none
15992 @opindex msdata=none
15993 Disable use of the small data area.  Variables are put into
15994 one of @code{.data}, @code{.bss}, or @code{.rodata} (unless the
15995 @code{section} attribute has been specified).
15996 This is the default.
15998 The small data area consists of sections @code{.sdata} and @code{.sbss}.
15999 Objects may be explicitly put in the small data area with the
16000 @code{section} attribute using one of these sections.
16002 @item -msdata=sdata
16003 @opindex msdata=sdata
16004 Put small global and static data in the small data area, but do not
16005 generate special code to reference them.
16007 @item -msdata=use
16008 @opindex msdata=use
16009 Put small global and static data in the small data area, and generate
16010 special instructions to reference them.
16012 @item -G @var{num}
16013 @opindex G
16014 @cindex smaller data references
16015 Put global and static objects less than or equal to @var{num} bytes
16016 into the small data or BSS sections instead of the normal data or BSS
16017 sections.  The default value of @var{num} is 8.
16018 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
16019 for this option to have any effect.
16021 All modules should be compiled with the same @option{-G @var{num}} value.
16022 Compiling with different values of @var{num} may or may not work; if it
16023 doesn't the linker gives an error message---incorrect code is not
16024 generated.
16026 @item -mdebug
16027 @opindex mdebug
16028 Makes the M32R-specific code in the compiler display some statistics
16029 that might help in debugging programs.
16031 @item -malign-loops
16032 @opindex malign-loops
16033 Align all loops to a 32-byte boundary.
16035 @item -mno-align-loops
16036 @opindex mno-align-loops
16037 Do not enforce a 32-byte alignment for loops.  This is the default.
16039 @item -missue-rate=@var{number}
16040 @opindex missue-rate=@var{number}
16041 Issue @var{number} instructions per cycle.  @var{number} can only be 1
16042 or 2.
16044 @item -mbranch-cost=@var{number}
16045 @opindex mbranch-cost=@var{number}
16046 @var{number} can only be 1 or 2.  If it is 1 then branches are
16047 preferred over conditional code, if it is 2, then the opposite applies.
16049 @item -mflush-trap=@var{number}
16050 @opindex mflush-trap=@var{number}
16051 Specifies the trap number to use to flush the cache.  The default is
16052 12.  Valid numbers are between 0 and 15 inclusive.
16054 @item -mno-flush-trap
16055 @opindex mno-flush-trap
16056 Specifies that the cache cannot be flushed by using a trap.
16058 @item -mflush-func=@var{name}
16059 @opindex mflush-func=@var{name}
16060 Specifies the name of the operating system function to call to flush
16061 the cache.  The default is @samp{_flush_cache}, but a function call
16062 is only used if a trap is not available.
16064 @item -mno-flush-func
16065 @opindex mno-flush-func
16066 Indicates that there is no OS function for flushing the cache.
16068 @end table
16070 @node M680x0 Options
16071 @subsection M680x0 Options
16072 @cindex M680x0 options
16074 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
16075 The default settings depend on which architecture was selected when
16076 the compiler was configured; the defaults for the most common choices
16077 are given below.
16079 @table @gcctabopt
16080 @item -march=@var{arch}
16081 @opindex march
16082 Generate code for a specific M680x0 or ColdFire instruction set
16083 architecture.  Permissible values of @var{arch} for M680x0
16084 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
16085 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
16086 architectures are selected according to Freescale's ISA classification
16087 and the permissible values are: @samp{isaa}, @samp{isaaplus},
16088 @samp{isab} and @samp{isac}.
16090 GCC defines a macro @code{__mcf@var{arch}__} whenever it is generating
16091 code for a ColdFire target.  The @var{arch} in this macro is one of the
16092 @option{-march} arguments given above.
16094 When used together, @option{-march} and @option{-mtune} select code
16095 that runs on a family of similar processors but that is optimized
16096 for a particular microarchitecture.
16098 @item -mcpu=@var{cpu}
16099 @opindex mcpu
16100 Generate code for a specific M680x0 or ColdFire processor.
16101 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
16102 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
16103 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
16104 below, which also classifies the CPUs into families:
16106 @multitable @columnfractions 0.20 0.80
16107 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
16108 @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}
16109 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
16110 @item @samp{5206e} @tab @samp{5206e}
16111 @item @samp{5208} @tab @samp{5207} @samp{5208}
16112 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
16113 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
16114 @item @samp{5216} @tab @samp{5214} @samp{5216}
16115 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
16116 @item @samp{5225} @tab @samp{5224} @samp{5225}
16117 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
16118 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
16119 @item @samp{5249} @tab @samp{5249}
16120 @item @samp{5250} @tab @samp{5250}
16121 @item @samp{5271} @tab @samp{5270} @samp{5271}
16122 @item @samp{5272} @tab @samp{5272}
16123 @item @samp{5275} @tab @samp{5274} @samp{5275}
16124 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
16125 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
16126 @item @samp{5307} @tab @samp{5307}
16127 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
16128 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
16129 @item @samp{5407} @tab @samp{5407}
16130 @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}
16131 @end multitable
16133 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
16134 @var{arch} is compatible with @var{cpu}.  Other combinations of
16135 @option{-mcpu} and @option{-march} are rejected.
16137 GCC defines the macro @code{__mcf_cpu_@var{cpu}} when ColdFire target
16138 @var{cpu} is selected.  It also defines @code{__mcf_family_@var{family}},
16139 where the value of @var{family} is given by the table above.
16141 @item -mtune=@var{tune}
16142 @opindex mtune
16143 Tune the code for a particular microarchitecture within the
16144 constraints set by @option{-march} and @option{-mcpu}.
16145 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
16146 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
16147 and @samp{cpu32}.  The ColdFire microarchitectures
16148 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
16150 You can also use @option{-mtune=68020-40} for code that needs
16151 to run relatively well on 68020, 68030 and 68040 targets.
16152 @option{-mtune=68020-60} is similar but includes 68060 targets
16153 as well.  These two options select the same tuning decisions as
16154 @option{-m68020-40} and @option{-m68020-60} respectively.
16156 GCC defines the macros @code{__mc@var{arch}} and @code{__mc@var{arch}__}
16157 when tuning for 680x0 architecture @var{arch}.  It also defines
16158 @code{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
16159 option is used.  If GCC is tuning for a range of architectures,
16160 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
16161 it defines the macros for every architecture in the range.
16163 GCC also defines the macro @code{__m@var{uarch}__} when tuning for
16164 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
16165 of the arguments given above.
16167 @item -m68000
16168 @itemx -mc68000
16169 @opindex m68000
16170 @opindex mc68000
16171 Generate output for a 68000.  This is the default
16172 when the compiler is configured for 68000-based systems.
16173 It is equivalent to @option{-march=68000}.
16175 Use this option for microcontrollers with a 68000 or EC000 core,
16176 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
16178 @item -m68010
16179 @opindex m68010
16180 Generate output for a 68010.  This is the default
16181 when the compiler is configured for 68010-based systems.
16182 It is equivalent to @option{-march=68010}.
16184 @item -m68020
16185 @itemx -mc68020
16186 @opindex m68020
16187 @opindex mc68020
16188 Generate output for a 68020.  This is the default
16189 when the compiler is configured for 68020-based systems.
16190 It is equivalent to @option{-march=68020}.
16192 @item -m68030
16193 @opindex m68030
16194 Generate output for a 68030.  This is the default when the compiler is
16195 configured for 68030-based systems.  It is equivalent to
16196 @option{-march=68030}.
16198 @item -m68040
16199 @opindex m68040
16200 Generate output for a 68040.  This is the default when the compiler is
16201 configured for 68040-based systems.  It is equivalent to
16202 @option{-march=68040}.
16204 This option inhibits the use of 68881/68882 instructions that have to be
16205 emulated by software on the 68040.  Use this option if your 68040 does not
16206 have code to emulate those instructions.
16208 @item -m68060
16209 @opindex m68060
16210 Generate output for a 68060.  This is the default when the compiler is
16211 configured for 68060-based systems.  It is equivalent to
16212 @option{-march=68060}.
16214 This option inhibits the use of 68020 and 68881/68882 instructions that
16215 have to be emulated by software on the 68060.  Use this option if your 68060
16216 does not have code to emulate those instructions.
16218 @item -mcpu32
16219 @opindex mcpu32
16220 Generate output for a CPU32.  This is the default
16221 when the compiler is configured for CPU32-based systems.
16222 It is equivalent to @option{-march=cpu32}.
16224 Use this option for microcontrollers with a
16225 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
16226 68336, 68340, 68341, 68349 and 68360.
16228 @item -m5200
16229 @opindex m5200
16230 Generate output for a 520X ColdFire CPU@.  This is the default
16231 when the compiler is configured for 520X-based systems.
16232 It is equivalent to @option{-mcpu=5206}, and is now deprecated
16233 in favor of that option.
16235 Use this option for microcontroller with a 5200 core, including
16236 the MCF5202, MCF5203, MCF5204 and MCF5206.
16238 @item -m5206e
16239 @opindex m5206e
16240 Generate output for a 5206e ColdFire CPU@.  The option is now
16241 deprecated in favor of the equivalent @option{-mcpu=5206e}.
16243 @item -m528x
16244 @opindex m528x
16245 Generate output for a member of the ColdFire 528X family.
16246 The option is now deprecated in favor of the equivalent
16247 @option{-mcpu=528x}.
16249 @item -m5307
16250 @opindex m5307
16251 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
16252 in favor of the equivalent @option{-mcpu=5307}.
16254 @item -m5407
16255 @opindex m5407
16256 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
16257 in favor of the equivalent @option{-mcpu=5407}.
16259 @item -mcfv4e
16260 @opindex mcfv4e
16261 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
16262 This includes use of hardware floating-point instructions.
16263 The option is equivalent to @option{-mcpu=547x}, and is now
16264 deprecated in favor of that option.
16266 @item -m68020-40
16267 @opindex m68020-40
16268 Generate output for a 68040, without using any of the new instructions.
16269 This results in code that can run relatively efficiently on either a
16270 68020/68881 or a 68030 or a 68040.  The generated code does use the
16271 68881 instructions that are emulated on the 68040.
16273 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
16275 @item -m68020-60
16276 @opindex m68020-60
16277 Generate output for a 68060, without using any of the new instructions.
16278 This results in code that can run relatively efficiently on either a
16279 68020/68881 or a 68030 or a 68040.  The generated code does use the
16280 68881 instructions that are emulated on the 68060.
16282 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
16284 @item -mhard-float
16285 @itemx -m68881
16286 @opindex mhard-float
16287 @opindex m68881
16288 Generate floating-point instructions.  This is the default for 68020
16289 and above, and for ColdFire devices that have an FPU@.  It defines the
16290 macro @code{__HAVE_68881__} on M680x0 targets and @code{__mcffpu__}
16291 on ColdFire targets.
16293 @item -msoft-float
16294 @opindex msoft-float
16295 Do not generate floating-point instructions; use library calls instead.
16296 This is the default for 68000, 68010, and 68832 targets.  It is also
16297 the default for ColdFire devices that have no FPU.
16299 @item -mdiv
16300 @itemx -mno-div
16301 @opindex mdiv
16302 @opindex mno-div
16303 Generate (do not generate) ColdFire hardware divide and remainder
16304 instructions.  If @option{-march} is used without @option{-mcpu},
16305 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
16306 architectures.  Otherwise, the default is taken from the target CPU
16307 (either the default CPU, or the one specified by @option{-mcpu}).  For
16308 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
16309 @option{-mcpu=5206e}.
16311 GCC defines the macro @code{__mcfhwdiv__} when this option is enabled.
16313 @item -mshort
16314 @opindex mshort
16315 Consider type @code{int} to be 16 bits wide, like @code{short int}.
16316 Additionally, parameters passed on the stack are also aligned to a
16317 16-bit boundary even on targets whose API mandates promotion to 32-bit.
16319 @item -mno-short
16320 @opindex mno-short
16321 Do not consider type @code{int} to be 16 bits wide.  This is the default.
16323 @item -mnobitfield
16324 @itemx -mno-bitfield
16325 @opindex mnobitfield
16326 @opindex mno-bitfield
16327 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
16328 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
16330 @item -mbitfield
16331 @opindex mbitfield
16332 Do use the bit-field instructions.  The @option{-m68020} option implies
16333 @option{-mbitfield}.  This is the default if you use a configuration
16334 designed for a 68020.
16336 @item -mrtd
16337 @opindex mrtd
16338 Use a different function-calling convention, in which functions
16339 that take a fixed number of arguments return with the @code{rtd}
16340 instruction, which pops their arguments while returning.  This
16341 saves one instruction in the caller since there is no need to pop
16342 the arguments there.
16344 This calling convention is incompatible with the one normally
16345 used on Unix, so you cannot use it if you need to call libraries
16346 compiled with the Unix compiler.
16348 Also, you must provide function prototypes for all functions that
16349 take variable numbers of arguments (including @code{printf});
16350 otherwise incorrect code is generated for calls to those
16351 functions.
16353 In addition, seriously incorrect code results if you call a
16354 function with too many arguments.  (Normally, extra arguments are
16355 harmlessly ignored.)
16357 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
16358 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
16360 @item -mno-rtd
16361 @opindex mno-rtd
16362 Do not use the calling conventions selected by @option{-mrtd}.
16363 This is the default.
16365 @item -malign-int
16366 @itemx -mno-align-int
16367 @opindex malign-int
16368 @opindex mno-align-int
16369 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
16370 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
16371 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
16372 Aligning variables on 32-bit boundaries produces code that runs somewhat
16373 faster on processors with 32-bit busses at the expense of more memory.
16375 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
16376 aligns structures containing the above types differently than
16377 most published application binary interface specifications for the m68k.
16379 @item -mpcrel
16380 @opindex mpcrel
16381 Use the pc-relative addressing mode of the 68000 directly, instead of
16382 using a global offset table.  At present, this option implies @option{-fpic},
16383 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
16384 not presently supported with @option{-mpcrel}, though this could be supported for
16385 68020 and higher processors.
16387 @item -mno-strict-align
16388 @itemx -mstrict-align
16389 @opindex mno-strict-align
16390 @opindex mstrict-align
16391 Do not (do) assume that unaligned memory references are handled by
16392 the system.
16394 @item -msep-data
16395 Generate code that allows the data segment to be located in a different
16396 area of memory from the text segment.  This allows for execute-in-place in
16397 an environment without virtual memory management.  This option implies
16398 @option{-fPIC}.
16400 @item -mno-sep-data
16401 Generate code that assumes that the data segment follows the text segment.
16402 This is the default.
16404 @item -mid-shared-library
16405 Generate code that supports shared libraries via the library ID method.
16406 This allows for execute-in-place and shared libraries in an environment
16407 without virtual memory management.  This option implies @option{-fPIC}.
16409 @item -mno-id-shared-library
16410 Generate code that doesn't assume ID-based shared libraries are being used.
16411 This is the default.
16413 @item -mshared-library-id=n
16414 Specifies the identification number of the ID-based shared library being
16415 compiled.  Specifying a value of 0 generates more compact code; specifying
16416 other values forces the allocation of that number to the current
16417 library, but is no more space- or time-efficient than omitting this option.
16419 @item -mxgot
16420 @itemx -mno-xgot
16421 @opindex mxgot
16422 @opindex mno-xgot
16423 When generating position-independent code for ColdFire, generate code
16424 that works if the GOT has more than 8192 entries.  This code is
16425 larger and slower than code generated without this option.  On M680x0
16426 processors, this option is not needed; @option{-fPIC} suffices.
16428 GCC normally uses a single instruction to load values from the GOT@.
16429 While this is relatively efficient, it only works if the GOT
16430 is smaller than about 64k.  Anything larger causes the linker
16431 to report an error such as:
16433 @cindex relocation truncated to fit (ColdFire)
16434 @smallexample
16435 relocation truncated to fit: R_68K_GOT16O foobar
16436 @end smallexample
16438 If this happens, you should recompile your code with @option{-mxgot}.
16439 It should then work with very large GOTs.  However, code generated with
16440 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
16441 the value of a global symbol.
16443 Note that some linkers, including newer versions of the GNU linker,
16444 can create multiple GOTs and sort GOT entries.  If you have such a linker,
16445 you should only need to use @option{-mxgot} when compiling a single
16446 object file that accesses more than 8192 GOT entries.  Very few do.
16448 These options have no effect unless GCC is generating
16449 position-independent code.
16451 @end table
16453 @node MCore Options
16454 @subsection MCore Options
16455 @cindex MCore options
16457 These are the @samp{-m} options defined for the Motorola M*Core
16458 processors.
16460 @table @gcctabopt
16462 @item -mhardlit
16463 @itemx -mno-hardlit
16464 @opindex mhardlit
16465 @opindex mno-hardlit
16466 Inline constants into the code stream if it can be done in two
16467 instructions or less.
16469 @item -mdiv
16470 @itemx -mno-div
16471 @opindex mdiv
16472 @opindex mno-div
16473 Use the divide instruction.  (Enabled by default).
16475 @item -mrelax-immediate
16476 @itemx -mno-relax-immediate
16477 @opindex mrelax-immediate
16478 @opindex mno-relax-immediate
16479 Allow arbitrary-sized immediates in bit operations.
16481 @item -mwide-bitfields
16482 @itemx -mno-wide-bitfields
16483 @opindex mwide-bitfields
16484 @opindex mno-wide-bitfields
16485 Always treat bit-fields as @code{int}-sized.
16487 @item -m4byte-functions
16488 @itemx -mno-4byte-functions
16489 @opindex m4byte-functions
16490 @opindex mno-4byte-functions
16491 Force all functions to be aligned to a 4-byte boundary.
16493 @item -mcallgraph-data
16494 @itemx -mno-callgraph-data
16495 @opindex mcallgraph-data
16496 @opindex mno-callgraph-data
16497 Emit callgraph information.
16499 @item -mslow-bytes
16500 @itemx -mno-slow-bytes
16501 @opindex mslow-bytes
16502 @opindex mno-slow-bytes
16503 Prefer word access when reading byte quantities.
16505 @item -mlittle-endian
16506 @itemx -mbig-endian
16507 @opindex mlittle-endian
16508 @opindex mbig-endian
16509 Generate code for a little-endian target.
16511 @item -m210
16512 @itemx -m340
16513 @opindex m210
16514 @opindex m340
16515 Generate code for the 210 processor.
16517 @item -mno-lsim
16518 @opindex mno-lsim
16519 Assume that runtime support has been provided and so omit the
16520 simulator library (@file{libsim.a)} from the linker command line.
16522 @item -mstack-increment=@var{size}
16523 @opindex mstack-increment
16524 Set the maximum amount for a single stack increment operation.  Large
16525 values can increase the speed of programs that contain functions
16526 that need a large amount of stack space, but they can also trigger a
16527 segmentation fault if the stack is extended too much.  The default
16528 value is 0x1000.
16530 @end table
16532 @node MeP Options
16533 @subsection MeP Options
16534 @cindex MeP options
16536 @table @gcctabopt
16538 @item -mabsdiff
16539 @opindex mabsdiff
16540 Enables the @code{abs} instruction, which is the absolute difference
16541 between two registers.
16543 @item -mall-opts
16544 @opindex mall-opts
16545 Enables all the optional instructions---average, multiply, divide, bit
16546 operations, leading zero, absolute difference, min/max, clip, and
16547 saturation.
16550 @item -maverage
16551 @opindex maverage
16552 Enables the @code{ave} instruction, which computes the average of two
16553 registers.
16555 @item -mbased=@var{n}
16556 @opindex mbased=
16557 Variables of size @var{n} bytes or smaller are placed in the
16558 @code{.based} section by default.  Based variables use the @code{$tp}
16559 register as a base register, and there is a 128-byte limit to the
16560 @code{.based} section.
16562 @item -mbitops
16563 @opindex mbitops
16564 Enables the bit operation instructions---bit test (@code{btstm}), set
16565 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
16566 test-and-set (@code{tas}).
16568 @item -mc=@var{name}
16569 @opindex mc=
16570 Selects which section constant data is placed in.  @var{name} may
16571 be @samp{tiny}, @samp{near}, or @samp{far}.
16573 @item -mclip
16574 @opindex mclip
16575 Enables the @code{clip} instruction.  Note that @option{-mclip} is not
16576 useful unless you also provide @option{-mminmax}.
16578 @item -mconfig=@var{name}
16579 @opindex mconfig=
16580 Selects one of the built-in core configurations.  Each MeP chip has
16581 one or more modules in it; each module has a core CPU and a variety of
16582 coprocessors, optional instructions, and peripherals.  The
16583 @code{MeP-Integrator} tool, not part of GCC, provides these
16584 configurations through this option; using this option is the same as
16585 using all the corresponding command-line options.  The default
16586 configuration is @samp{default}.
16588 @item -mcop
16589 @opindex mcop
16590 Enables the coprocessor instructions.  By default, this is a 32-bit
16591 coprocessor.  Note that the coprocessor is normally enabled via the
16592 @option{-mconfig=} option.
16594 @item -mcop32
16595 @opindex mcop32
16596 Enables the 32-bit coprocessor's instructions.
16598 @item -mcop64
16599 @opindex mcop64
16600 Enables the 64-bit coprocessor's instructions.
16602 @item -mivc2
16603 @opindex mivc2
16604 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
16606 @item -mdc
16607 @opindex mdc
16608 Causes constant variables to be placed in the @code{.near} section.
16610 @item -mdiv
16611 @opindex mdiv
16612 Enables the @code{div} and @code{divu} instructions.
16614 @item -meb
16615 @opindex meb
16616 Generate big-endian code.
16618 @item -mel
16619 @opindex mel
16620 Generate little-endian code.
16622 @item -mio-volatile
16623 @opindex mio-volatile
16624 Tells the compiler that any variable marked with the @code{io}
16625 attribute is to be considered volatile.
16627 @item -ml
16628 @opindex ml
16629 Causes variables to be assigned to the @code{.far} section by default.
16631 @item -mleadz
16632 @opindex mleadz
16633 Enables the @code{leadz} (leading zero) instruction.
16635 @item -mm
16636 @opindex mm
16637 Causes variables to be assigned to the @code{.near} section by default.
16639 @item -mminmax
16640 @opindex mminmax
16641 Enables the @code{min} and @code{max} instructions.
16643 @item -mmult
16644 @opindex mmult
16645 Enables the multiplication and multiply-accumulate instructions.
16647 @item -mno-opts
16648 @opindex mno-opts
16649 Disables all the optional instructions enabled by @option{-mall-opts}.
16651 @item -mrepeat
16652 @opindex mrepeat
16653 Enables the @code{repeat} and @code{erepeat} instructions, used for
16654 low-overhead looping.
16656 @item -ms
16657 @opindex ms
16658 Causes all variables to default to the @code{.tiny} section.  Note
16659 that there is a 65536-byte limit to this section.  Accesses to these
16660 variables use the @code{%gp} base register.
16662 @item -msatur
16663 @opindex msatur
16664 Enables the saturation instructions.  Note that the compiler does not
16665 currently generate these itself, but this option is included for
16666 compatibility with other tools, like @code{as}.
16668 @item -msdram
16669 @opindex msdram
16670 Link the SDRAM-based runtime instead of the default ROM-based runtime.
16672 @item -msim
16673 @opindex msim
16674 Link the simulator run-time libraries.
16676 @item -msimnovec
16677 @opindex msimnovec
16678 Link the simulator runtime libraries, excluding built-in support
16679 for reset and exception vectors and tables.
16681 @item -mtf
16682 @opindex mtf
16683 Causes all functions to default to the @code{.far} section.  Without
16684 this option, functions default to the @code{.near} section.
16686 @item -mtiny=@var{n}
16687 @opindex mtiny=
16688 Variables that are @var{n} bytes or smaller are allocated to the
16689 @code{.tiny} section.  These variables use the @code{$gp} base
16690 register.  The default for this option is 4, but note that there's a
16691 65536-byte limit to the @code{.tiny} section.
16693 @end table
16695 @node MicroBlaze Options
16696 @subsection MicroBlaze Options
16697 @cindex MicroBlaze Options
16699 @table @gcctabopt
16701 @item -msoft-float
16702 @opindex msoft-float
16703 Use software emulation for floating point (default).
16705 @item -mhard-float
16706 @opindex mhard-float
16707 Use hardware floating-point instructions.
16709 @item -mmemcpy
16710 @opindex mmemcpy
16711 Do not optimize block moves, use @code{memcpy}.
16713 @item -mno-clearbss
16714 @opindex mno-clearbss
16715 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
16717 @item -mcpu=@var{cpu-type}
16718 @opindex mcpu=
16719 Use features of, and schedule code for, the given CPU.
16720 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
16721 where @var{X} is a major version, @var{YY} is the minor version, and
16722 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
16723 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
16725 @item -mxl-soft-mul
16726 @opindex mxl-soft-mul
16727 Use software multiply emulation (default).
16729 @item -mxl-soft-div
16730 @opindex mxl-soft-div
16731 Use software emulation for divides (default).
16733 @item -mxl-barrel-shift
16734 @opindex mxl-barrel-shift
16735 Use the hardware barrel shifter.
16737 @item -mxl-pattern-compare
16738 @opindex mxl-pattern-compare
16739 Use pattern compare instructions.
16741 @item -msmall-divides
16742 @opindex msmall-divides
16743 Use table lookup optimization for small signed integer divisions.
16745 @item -mxl-stack-check
16746 @opindex mxl-stack-check
16747 This option is deprecated.  Use @option{-fstack-check} instead.
16749 @item -mxl-gp-opt
16750 @opindex mxl-gp-opt
16751 Use GP-relative @code{.sdata}/@code{.sbss} sections.
16753 @item -mxl-multiply-high
16754 @opindex mxl-multiply-high
16755 Use multiply high instructions for high part of 32x32 multiply.
16757 @item -mxl-float-convert
16758 @opindex mxl-float-convert
16759 Use hardware floating-point conversion instructions.
16761 @item -mxl-float-sqrt
16762 @opindex mxl-float-sqrt
16763 Use hardware floating-point square root instruction.
16765 @item -mbig-endian
16766 @opindex mbig-endian
16767 Generate code for a big-endian target.
16769 @item -mlittle-endian
16770 @opindex mlittle-endian
16771 Generate code for a little-endian target.
16773 @item -mxl-reorder
16774 @opindex mxl-reorder
16775 Use reorder instructions (swap and byte reversed load/store).
16777 @item -mxl-mode-@var{app-model}
16778 Select application model @var{app-model}.  Valid models are
16779 @table @samp
16780 @item executable
16781 normal executable (default), uses startup code @file{crt0.o}.
16783 @item xmdstub
16784 for use with Xilinx Microprocessor Debugger (XMD) based
16785 software intrusive debug agent called xmdstub. This uses startup file
16786 @file{crt1.o} and sets the start address of the program to 0x800.
16788 @item bootstrap
16789 for applications that are loaded using a bootloader.
16790 This model uses startup file @file{crt2.o} which does not contain a processor
16791 reset vector handler. This is suitable for transferring control on a
16792 processor reset to the bootloader rather than the application.
16794 @item novectors
16795 for applications that do not require any of the
16796 MicroBlaze vectors. This option may be useful for applications running
16797 within a monitoring application. This model uses @file{crt3.o} as a startup file.
16798 @end table
16800 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
16801 @option{-mxl-mode-@var{app-model}}.
16803 @end table
16805 @node MIPS Options
16806 @subsection MIPS Options
16807 @cindex MIPS options
16809 @table @gcctabopt
16811 @item -EB
16812 @opindex EB
16813 Generate big-endian code.
16815 @item -EL
16816 @opindex EL
16817 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
16818 configurations.
16820 @item -march=@var{arch}
16821 @opindex march
16822 Generate code that runs on @var{arch}, which can be the name of a
16823 generic MIPS ISA, or the name of a particular processor.
16824 The ISA names are:
16825 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
16826 @samp{mips32}, @samp{mips32r2}, @samp{mips32r3}, @samp{mips32r5},
16827 @samp{mips32r6}, @samp{mips64}, @samp{mips64r2}, @samp{mips64r3},
16828 @samp{mips64r5} and @samp{mips64r6}.
16829 The processor names are:
16830 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
16831 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
16832 @samp{5kc}, @samp{5kf},
16833 @samp{20kc},
16834 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
16835 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
16836 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
16837 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
16838 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
16839 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
16840 @samp{m4k},
16841 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
16842 @samp{octeon}, @samp{octeon+}, @samp{octeon2}, @samp{octeon3},
16843 @samp{orion},
16844 @samp{p5600},
16845 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
16846 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
16847 @samp{rm7000}, @samp{rm9000},
16848 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
16849 @samp{sb1},
16850 @samp{sr71000},
16851 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
16852 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
16853 @samp{xlr} and @samp{xlp}.
16854 The special value @samp{from-abi} selects the
16855 most compatible architecture for the selected ABI (that is,
16856 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
16858 The native Linux/GNU toolchain also supports the value @samp{native},
16859 which selects the best architecture option for the host processor.
16860 @option{-march=native} has no effect if GCC does not recognize
16861 the processor.
16863 In processor names, a final @samp{000} can be abbreviated as @samp{k}
16864 (for example, @option{-march=r2k}).  Prefixes are optional, and
16865 @samp{vr} may be written @samp{r}.
16867 Names of the form @samp{@var{n}f2_1} refer to processors with
16868 FPUs clocked at half the rate of the core, names of the form
16869 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
16870 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
16871 processors with FPUs clocked a ratio of 3:2 with respect to the core.
16872 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
16873 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
16874 accepted as synonyms for @samp{@var{n}f1_1}.
16876 GCC defines two macros based on the value of this option.  The first
16877 is @code{_MIPS_ARCH}, which gives the name of target architecture, as
16878 a string.  The second has the form @code{_MIPS_ARCH_@var{foo}},
16879 where @var{foo} is the capitalized value of @code{_MIPS_ARCH}@.
16880 For example, @option{-march=r2000} sets @code{_MIPS_ARCH}
16881 to @code{"r2000"} and defines the macro @code{_MIPS_ARCH_R2000}.
16883 Note that the @code{_MIPS_ARCH} macro uses the processor names given
16884 above.  In other words, it has the full prefix and does not
16885 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
16886 the macro names the resolved architecture (either @code{"mips1"} or
16887 @code{"mips3"}).  It names the default architecture when no
16888 @option{-march} option is given.
16890 @item -mtune=@var{arch}
16891 @opindex mtune
16892 Optimize for @var{arch}.  Among other things, this option controls
16893 the way instructions are scheduled, and the perceived cost of arithmetic
16894 operations.  The list of @var{arch} values is the same as for
16895 @option{-march}.
16897 When this option is not used, GCC optimizes for the processor
16898 specified by @option{-march}.  By using @option{-march} and
16899 @option{-mtune} together, it is possible to generate code that
16900 runs on a family of processors, but optimize the code for one
16901 particular member of that family.
16903 @option{-mtune} defines the macros @code{_MIPS_TUNE} and
16904 @code{_MIPS_TUNE_@var{foo}}, which work in the same way as the
16905 @option{-march} ones described above.
16907 @item -mips1
16908 @opindex mips1
16909 Equivalent to @option{-march=mips1}.
16911 @item -mips2
16912 @opindex mips2
16913 Equivalent to @option{-march=mips2}.
16915 @item -mips3
16916 @opindex mips3
16917 Equivalent to @option{-march=mips3}.
16919 @item -mips4
16920 @opindex mips4
16921 Equivalent to @option{-march=mips4}.
16923 @item -mips32
16924 @opindex mips32
16925 Equivalent to @option{-march=mips32}.
16927 @item -mips32r3
16928 @opindex mips32r3
16929 Equivalent to @option{-march=mips32r3}.
16931 @item -mips32r5
16932 @opindex mips32r5
16933 Equivalent to @option{-march=mips32r5}.
16935 @item -mips32r6
16936 @opindex mips32r6
16937 Equivalent to @option{-march=mips32r6}.
16939 @item -mips64
16940 @opindex mips64
16941 Equivalent to @option{-march=mips64}.
16943 @item -mips64r2
16944 @opindex mips64r2
16945 Equivalent to @option{-march=mips64r2}.
16947 @item -mips64r3
16948 @opindex mips64r3
16949 Equivalent to @option{-march=mips64r3}.
16951 @item -mips64r5
16952 @opindex mips64r5
16953 Equivalent to @option{-march=mips64r5}.
16955 @item -mips64r6
16956 @opindex mips64r6
16957 Equivalent to @option{-march=mips64r6}.
16959 @item -mips16
16960 @itemx -mno-mips16
16961 @opindex mips16
16962 @opindex mno-mips16
16963 Generate (do not generate) MIPS16 code.  If GCC is targeting a
16964 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
16966 MIPS16 code generation can also be controlled on a per-function basis
16967 by means of @code{mips16} and @code{nomips16} attributes.
16968 @xref{Function Attributes}, for more information.
16970 @item -mflip-mips16
16971 @opindex mflip-mips16
16972 Generate MIPS16 code on alternating functions.  This option is provided
16973 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
16974 not intended for ordinary use in compiling user code.
16976 @item -minterlink-compressed
16977 @item -mno-interlink-compressed
16978 @opindex minterlink-compressed
16979 @opindex mno-interlink-compressed
16980 Require (do not require) that code using the standard (uncompressed) MIPS ISA
16981 be link-compatible with MIPS16 and microMIPS code, and vice versa.
16983 For example, code using the standard ISA encoding cannot jump directly
16984 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
16985 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
16986 knows that the target of the jump is not compressed.
16988 @item -minterlink-mips16
16989 @itemx -mno-interlink-mips16
16990 @opindex minterlink-mips16
16991 @opindex mno-interlink-mips16
16992 Aliases of @option{-minterlink-compressed} and
16993 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
16994 and are retained for backwards compatibility.
16996 @item -mabi=32
16997 @itemx -mabi=o64
16998 @itemx -mabi=n32
16999 @itemx -mabi=64
17000 @itemx -mabi=eabi
17001 @opindex mabi=32
17002 @opindex mabi=o64
17003 @opindex mabi=n32
17004 @opindex mabi=64
17005 @opindex mabi=eabi
17006 Generate code for the given ABI@.
17008 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
17009 generates 64-bit code when you select a 64-bit architecture, but you
17010 can use @option{-mgp32} to get 32-bit code instead.
17012 For information about the O64 ABI, see
17013 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
17015 GCC supports a variant of the o32 ABI in which floating-point registers
17016 are 64 rather than 32 bits wide.  You can select this combination with
17017 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
17018 and @code{mfhc1} instructions and is therefore only supported for
17019 MIPS32R2, MIPS32R3 and MIPS32R5 processors.
17021 The register assignments for arguments and return values remain the
17022 same, but each scalar value is passed in a single 64-bit register
17023 rather than a pair of 32-bit registers.  For example, scalar
17024 floating-point values are returned in @samp{$f0} only, not a
17025 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
17026 remains the same in that the even-numbered double-precision registers
17027 are saved.
17029 Two additional variants of the o32 ABI are supported to enable
17030 a transition from 32-bit to 64-bit registers.  These are FPXX
17031 (@option{-mfpxx}) and FP64A (@option{-mfp64} @option{-mno-odd-spreg}).
17032 The FPXX extension mandates that all code must execute correctly
17033 when run using 32-bit or 64-bit registers.  The code can be interlinked
17034 with either FP32 or FP64, but not both.
17035 The FP64A extension is similar to the FP64 extension but forbids the
17036 use of odd-numbered single-precision registers.  This can be used
17037 in conjunction with the @code{FRE} mode of FPUs in MIPS32R5
17038 processors and allows both FP32 and FP64A code to interlink and
17039 run in the same process without changing FPU modes.
17041 @item -mabicalls
17042 @itemx -mno-abicalls
17043 @opindex mabicalls
17044 @opindex mno-abicalls
17045 Generate (do not generate) code that is suitable for SVR4-style
17046 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
17047 systems.
17049 @item -mshared
17050 @itemx -mno-shared
17051 Generate (do not generate) code that is fully position-independent,
17052 and that can therefore be linked into shared libraries.  This option
17053 only affects @option{-mabicalls}.
17055 All @option{-mabicalls} code has traditionally been position-independent,
17056 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
17057 as an extension, the GNU toolchain allows executables to use absolute
17058 accesses for locally-binding symbols.  It can also use shorter GP
17059 initialization sequences and generate direct calls to locally-defined
17060 functions.  This mode is selected by @option{-mno-shared}.
17062 @option{-mno-shared} depends on binutils 2.16 or higher and generates
17063 objects that can only be linked by the GNU linker.  However, the option
17064 does not affect the ABI of the final executable; it only affects the ABI
17065 of relocatable objects.  Using @option{-mno-shared} generally makes
17066 executables both smaller and quicker.
17068 @option{-mshared} is the default.
17070 @item -mplt
17071 @itemx -mno-plt
17072 @opindex mplt
17073 @opindex mno-plt
17074 Assume (do not assume) that the static and dynamic linkers
17075 support PLTs and copy relocations.  This option only affects
17076 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
17077 has no effect without @option{-msym32}.
17079 You can make @option{-mplt} the default by configuring
17080 GCC with @option{--with-mips-plt}.  The default is
17081 @option{-mno-plt} otherwise.
17083 @item -mxgot
17084 @itemx -mno-xgot
17085 @opindex mxgot
17086 @opindex mno-xgot
17087 Lift (do not lift) the usual restrictions on the size of the global
17088 offset table.
17090 GCC normally uses a single instruction to load values from the GOT@.
17091 While this is relatively efficient, it only works if the GOT
17092 is smaller than about 64k.  Anything larger causes the linker
17093 to report an error such as:
17095 @cindex relocation truncated to fit (MIPS)
17096 @smallexample
17097 relocation truncated to fit: R_MIPS_GOT16 foobar
17098 @end smallexample
17100 If this happens, you should recompile your code with @option{-mxgot}.
17101 This works with very large GOTs, although the code is also
17102 less efficient, since it takes three instructions to fetch the
17103 value of a global symbol.
17105 Note that some linkers can create multiple GOTs.  If you have such a
17106 linker, you should only need to use @option{-mxgot} when a single object
17107 file accesses more than 64k's worth of GOT entries.  Very few do.
17109 These options have no effect unless GCC is generating position
17110 independent code.
17112 @item -mgp32
17113 @opindex mgp32
17114 Assume that general-purpose registers are 32 bits wide.
17116 @item -mgp64
17117 @opindex mgp64
17118 Assume that general-purpose registers are 64 bits wide.
17120 @item -mfp32
17121 @opindex mfp32
17122 Assume that floating-point registers are 32 bits wide.
17124 @item -mfp64
17125 @opindex mfp64
17126 Assume that floating-point registers are 64 bits wide.
17128 @item -mfpxx
17129 @opindex mfpxx
17130 Do not assume the width of floating-point registers.
17132 @item -mhard-float
17133 @opindex mhard-float
17134 Use floating-point coprocessor instructions.
17136 @item -msoft-float
17137 @opindex msoft-float
17138 Do not use floating-point coprocessor instructions.  Implement
17139 floating-point calculations using library calls instead.
17141 @item -mno-float
17142 @opindex mno-float
17143 Equivalent to @option{-msoft-float}, but additionally asserts that the
17144 program being compiled does not perform any floating-point operations.
17145 This option is presently supported only by some bare-metal MIPS
17146 configurations, where it may select a special set of libraries
17147 that lack all floating-point support (including, for example, the
17148 floating-point @code{printf} formats).  
17149 If code compiled with @option{-mno-float} accidentally contains
17150 floating-point operations, it is likely to suffer a link-time
17151 or run-time failure.
17153 @item -msingle-float
17154 @opindex msingle-float
17155 Assume that the floating-point coprocessor only supports single-precision
17156 operations.
17158 @item -mdouble-float
17159 @opindex mdouble-float
17160 Assume that the floating-point coprocessor supports double-precision
17161 operations.  This is the default.
17163 @item -modd-spreg
17164 @itemx -mno-odd-spreg
17165 @opindex modd-spreg
17166 @opindex mno-odd-spreg
17167 Enable the use of odd-numbered single-precision floating-point registers
17168 for the o32 ABI.  This is the default for processors that are known to
17169 support these registers.  When using the o32 FPXX ABI, @option{-mno-odd-spreg}
17170 is set by default.
17172 @item -mabs=2008
17173 @itemx -mabs=legacy
17174 @opindex mabs=2008
17175 @opindex mabs=legacy
17176 These options control the treatment of the special not-a-number (NaN)
17177 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
17178 @code{neg.@i{fmt}} machine instructions.
17180 By default or when @option{-mabs=legacy} is used the legacy
17181 treatment is selected.  In this case these instructions are considered
17182 arithmetic and avoided where correct operation is required and the
17183 input operand might be a NaN.  A longer sequence of instructions that
17184 manipulate the sign bit of floating-point datum manually is used
17185 instead unless the @option{-ffinite-math-only} option has also been
17186 specified.
17188 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
17189 this case these instructions are considered non-arithmetic and therefore
17190 operating correctly in all cases, including in particular where the
17191 input operand is a NaN.  These instructions are therefore always used
17192 for the respective operations.
17194 @item -mnan=2008
17195 @itemx -mnan=legacy
17196 @opindex mnan=2008
17197 @opindex mnan=legacy
17198 These options control the encoding of the special not-a-number (NaN)
17199 IEEE 754 floating-point data.
17201 The @option{-mnan=legacy} option selects the legacy encoding.  In this
17202 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
17203 significand field being 0, whereas signalling NaNs (sNaNs) are denoted
17204 by the first bit of their trailing significand field being 1.
17206 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
17207 this case qNaNs are denoted by the first bit of their trailing
17208 significand field being 1, whereas sNaNs are denoted by the first bit of
17209 their trailing significand field being 0.
17211 The default is @option{-mnan=legacy} unless GCC has been configured with
17212 @option{--with-nan=2008}.
17214 @item -mllsc
17215 @itemx -mno-llsc
17216 @opindex mllsc
17217 @opindex mno-llsc
17218 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
17219 implement atomic memory built-in functions.  When neither option is
17220 specified, GCC uses the instructions if the target architecture
17221 supports them.
17223 @option{-mllsc} is useful if the runtime environment can emulate the
17224 instructions and @option{-mno-llsc} can be useful when compiling for
17225 nonstandard ISAs.  You can make either option the default by
17226 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
17227 respectively.  @option{--with-llsc} is the default for some
17228 configurations; see the installation documentation for details.
17230 @item -mdsp
17231 @itemx -mno-dsp
17232 @opindex mdsp
17233 @opindex mno-dsp
17234 Use (do not use) revision 1 of the MIPS DSP ASE@.
17235 @xref{MIPS DSP Built-in Functions}.  This option defines the
17236 preprocessor macro @code{__mips_dsp}.  It also defines
17237 @code{__mips_dsp_rev} to 1.
17239 @item -mdspr2
17240 @itemx -mno-dspr2
17241 @opindex mdspr2
17242 @opindex mno-dspr2
17243 Use (do not use) revision 2 of the MIPS DSP ASE@.
17244 @xref{MIPS DSP Built-in Functions}.  This option defines the
17245 preprocessor macros @code{__mips_dsp} and @code{__mips_dspr2}.
17246 It also defines @code{__mips_dsp_rev} to 2.
17248 @item -msmartmips
17249 @itemx -mno-smartmips
17250 @opindex msmartmips
17251 @opindex mno-smartmips
17252 Use (do not use) the MIPS SmartMIPS ASE.
17254 @item -mpaired-single
17255 @itemx -mno-paired-single
17256 @opindex mpaired-single
17257 @opindex mno-paired-single
17258 Use (do not use) paired-single floating-point instructions.
17259 @xref{MIPS Paired-Single Support}.  This option requires
17260 hardware floating-point support to be enabled.
17262 @item -mdmx
17263 @itemx -mno-mdmx
17264 @opindex mdmx
17265 @opindex mno-mdmx
17266 Use (do not use) MIPS Digital Media Extension instructions.
17267 This option can only be used when generating 64-bit code and requires
17268 hardware floating-point support to be enabled.
17270 @item -mips3d
17271 @itemx -mno-mips3d
17272 @opindex mips3d
17273 @opindex mno-mips3d
17274 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
17275 The option @option{-mips3d} implies @option{-mpaired-single}.
17277 @item -mmicromips
17278 @itemx -mno-micromips
17279 @opindex mmicromips
17280 @opindex mno-mmicromips
17281 Generate (do not generate) microMIPS code.
17283 MicroMIPS code generation can also be controlled on a per-function basis
17284 by means of @code{micromips} and @code{nomicromips} attributes.
17285 @xref{Function Attributes}, for more information.
17287 @item -mmt
17288 @itemx -mno-mt
17289 @opindex mmt
17290 @opindex mno-mt
17291 Use (do not use) MT Multithreading instructions.
17293 @item -mmcu
17294 @itemx -mno-mcu
17295 @opindex mmcu
17296 @opindex mno-mcu
17297 Use (do not use) the MIPS MCU ASE instructions.
17299 @item -meva
17300 @itemx -mno-eva
17301 @opindex meva
17302 @opindex mno-eva
17303 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
17305 @item -mvirt
17306 @itemx -mno-virt
17307 @opindex mvirt
17308 @opindex mno-virt
17309 Use (do not use) the MIPS Virtualization Application Specific instructions.
17311 @item -mxpa
17312 @itemx -mno-xpa
17313 @opindex mxpa
17314 @opindex mno-xpa
17315 Use (do not use) the MIPS eXtended Physical Address (XPA) instructions.
17317 @item -mlong64
17318 @opindex mlong64
17319 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
17320 an explanation of the default and the way that the pointer size is
17321 determined.
17323 @item -mlong32
17324 @opindex mlong32
17325 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
17327 The default size of @code{int}s, @code{long}s and pointers depends on
17328 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
17329 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
17330 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
17331 or the same size as integer registers, whichever is smaller.
17333 @item -msym32
17334 @itemx -mno-sym32
17335 @opindex msym32
17336 @opindex mno-sym32
17337 Assume (do not assume) that all symbols have 32-bit values, regardless
17338 of the selected ABI@.  This option is useful in combination with
17339 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
17340 to generate shorter and faster references to symbolic addresses.
17342 @item -G @var{num}
17343 @opindex G
17344 Put definitions of externally-visible data in a small data section
17345 if that data is no bigger than @var{num} bytes.  GCC can then generate
17346 more efficient accesses to the data; see @option{-mgpopt} for details.
17348 The default @option{-G} option depends on the configuration.
17350 @item -mlocal-sdata
17351 @itemx -mno-local-sdata
17352 @opindex mlocal-sdata
17353 @opindex mno-local-sdata
17354 Extend (do not extend) the @option{-G} behavior to local data too,
17355 such as to static variables in C@.  @option{-mlocal-sdata} is the
17356 default for all configurations.
17358 If the linker complains that an application is using too much small data,
17359 you might want to try rebuilding the less performance-critical parts with
17360 @option{-mno-local-sdata}.  You might also want to build large
17361 libraries with @option{-mno-local-sdata}, so that the libraries leave
17362 more room for the main program.
17364 @item -mextern-sdata
17365 @itemx -mno-extern-sdata
17366 @opindex mextern-sdata
17367 @opindex mno-extern-sdata
17368 Assume (do not assume) that externally-defined data is in
17369 a small data section if the size of that data is within the @option{-G} limit.
17370 @option{-mextern-sdata} is the default for all configurations.
17372 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
17373 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
17374 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
17375 is placed in a small data section.  If @var{Var} is defined by another
17376 module, you must either compile that module with a high-enough
17377 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
17378 definition.  If @var{Var} is common, you must link the application
17379 with a high-enough @option{-G} setting.
17381 The easiest way of satisfying these restrictions is to compile
17382 and link every module with the same @option{-G} option.  However,
17383 you may wish to build a library that supports several different
17384 small data limits.  You can do this by compiling the library with
17385 the highest supported @option{-G} setting and additionally using
17386 @option{-mno-extern-sdata} to stop the library from making assumptions
17387 about externally-defined data.
17389 @item -mgpopt
17390 @itemx -mno-gpopt
17391 @opindex mgpopt
17392 @opindex mno-gpopt
17393 Use (do not use) GP-relative accesses for symbols that are known to be
17394 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
17395 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
17396 configurations.
17398 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
17399 might not hold the value of @code{_gp}.  For example, if the code is
17400 part of a library that might be used in a boot monitor, programs that
17401 call boot monitor routines pass an unknown value in @code{$gp}.
17402 (In such situations, the boot monitor itself is usually compiled
17403 with @option{-G0}.)
17405 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
17406 @option{-mno-extern-sdata}.
17408 @item -membedded-data
17409 @itemx -mno-embedded-data
17410 @opindex membedded-data
17411 @opindex mno-embedded-data
17412 Allocate variables to the read-only data section first if possible, then
17413 next in the small data section if possible, otherwise in data.  This gives
17414 slightly slower code than the default, but reduces the amount of RAM required
17415 when executing, and thus may be preferred for some embedded systems.
17417 @item -muninit-const-in-rodata
17418 @itemx -mno-uninit-const-in-rodata
17419 @opindex muninit-const-in-rodata
17420 @opindex mno-uninit-const-in-rodata
17421 Put uninitialized @code{const} variables in the read-only data section.
17422 This option is only meaningful in conjunction with @option{-membedded-data}.
17424 @item -mcode-readable=@var{setting}
17425 @opindex mcode-readable
17426 Specify whether GCC may generate code that reads from executable sections.
17427 There are three possible settings:
17429 @table @gcctabopt
17430 @item -mcode-readable=yes
17431 Instructions may freely access executable sections.  This is the
17432 default setting.
17434 @item -mcode-readable=pcrel
17435 MIPS16 PC-relative load instructions can access executable sections,
17436 but other instructions must not do so.  This option is useful on 4KSc
17437 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
17438 It is also useful on processors that can be configured to have a dual
17439 instruction/data SRAM interface and that, like the M4K, automatically
17440 redirect PC-relative loads to the instruction RAM.
17442 @item -mcode-readable=no
17443 Instructions must not access executable sections.  This option can be
17444 useful on targets that are configured to have a dual instruction/data
17445 SRAM interface but that (unlike the M4K) do not automatically redirect
17446 PC-relative loads to the instruction RAM.
17447 @end table
17449 @item -msplit-addresses
17450 @itemx -mno-split-addresses
17451 @opindex msplit-addresses
17452 @opindex mno-split-addresses
17453 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
17454 relocation operators.  This option has been superseded by
17455 @option{-mexplicit-relocs} but is retained for backwards compatibility.
17457 @item -mexplicit-relocs
17458 @itemx -mno-explicit-relocs
17459 @opindex mexplicit-relocs
17460 @opindex mno-explicit-relocs
17461 Use (do not use) assembler relocation operators when dealing with symbolic
17462 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
17463 is to use assembler macros instead.
17465 @option{-mexplicit-relocs} is the default if GCC was configured
17466 to use an assembler that supports relocation operators.
17468 @item -mcheck-zero-division
17469 @itemx -mno-check-zero-division
17470 @opindex mcheck-zero-division
17471 @opindex mno-check-zero-division
17472 Trap (do not trap) on integer division by zero.
17474 The default is @option{-mcheck-zero-division}.
17476 @item -mdivide-traps
17477 @itemx -mdivide-breaks
17478 @opindex mdivide-traps
17479 @opindex mdivide-breaks
17480 MIPS systems check for division by zero by generating either a
17481 conditional trap or a break instruction.  Using traps results in
17482 smaller code, but is only supported on MIPS II and later.  Also, some
17483 versions of the Linux kernel have a bug that prevents trap from
17484 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
17485 allow conditional traps on architectures that support them and
17486 @option{-mdivide-breaks} to force the use of breaks.
17488 The default is usually @option{-mdivide-traps}, but this can be
17489 overridden at configure time using @option{--with-divide=breaks}.
17490 Divide-by-zero checks can be completely disabled using
17491 @option{-mno-check-zero-division}.
17493 @item -mmemcpy
17494 @itemx -mno-memcpy
17495 @opindex mmemcpy
17496 @opindex mno-memcpy
17497 Force (do not force) the use of @code{memcpy} for non-trivial block
17498 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
17499 most constant-sized copies.
17501 @item -mlong-calls
17502 @itemx -mno-long-calls
17503 @opindex mlong-calls
17504 @opindex mno-long-calls
17505 Disable (do not disable) use of the @code{jal} instruction.  Calling
17506 functions using @code{jal} is more efficient but requires the caller
17507 and callee to be in the same 256 megabyte segment.
17509 This option has no effect on abicalls code.  The default is
17510 @option{-mno-long-calls}.
17512 @item -mmad
17513 @itemx -mno-mad
17514 @opindex mmad
17515 @opindex mno-mad
17516 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
17517 instructions, as provided by the R4650 ISA@.
17519 @item -mimadd
17520 @itemx -mno-imadd
17521 @opindex mimadd
17522 @opindex mno-imadd
17523 Enable (disable) use of the @code{madd} and @code{msub} integer
17524 instructions.  The default is @option{-mimadd} on architectures
17525 that support @code{madd} and @code{msub} except for the 74k 
17526 architecture where it was found to generate slower code.
17528 @item -mfused-madd
17529 @itemx -mno-fused-madd
17530 @opindex mfused-madd
17531 @opindex mno-fused-madd
17532 Enable (disable) use of the floating-point multiply-accumulate
17533 instructions, when they are available.  The default is
17534 @option{-mfused-madd}.
17536 On the R8000 CPU when multiply-accumulate instructions are used,
17537 the intermediate product is calculated to infinite precision
17538 and is not subject to the FCSR Flush to Zero bit.  This may be
17539 undesirable in some circumstances.  On other processors the result
17540 is numerically identical to the equivalent computation using
17541 separate multiply, add, subtract and negate instructions.
17543 @item -nocpp
17544 @opindex nocpp
17545 Tell the MIPS assembler to not run its preprocessor over user
17546 assembler files (with a @samp{.s} suffix) when assembling them.
17548 @item -mfix-24k
17549 @item -mno-fix-24k
17550 @opindex mfix-24k
17551 @opindex mno-fix-24k
17552 Work around the 24K E48 (lost data on stores during refill) errata.
17553 The workarounds are implemented by the assembler rather than by GCC@.
17555 @item -mfix-r4000
17556 @itemx -mno-fix-r4000
17557 @opindex mfix-r4000
17558 @opindex mno-fix-r4000
17559 Work around certain R4000 CPU errata:
17560 @itemize @minus
17561 @item
17562 A double-word or a variable shift may give an incorrect result if executed
17563 immediately after starting an integer division.
17564 @item
17565 A double-word or a variable shift may give an incorrect result if executed
17566 while an integer multiplication is in progress.
17567 @item
17568 An integer division may give an incorrect result if started in a delay slot
17569 of a taken branch or a jump.
17570 @end itemize
17572 @item -mfix-r4400
17573 @itemx -mno-fix-r4400
17574 @opindex mfix-r4400
17575 @opindex mno-fix-r4400
17576 Work around certain R4400 CPU errata:
17577 @itemize @minus
17578 @item
17579 A double-word or a variable shift may give an incorrect result if executed
17580 immediately after starting an integer division.
17581 @end itemize
17583 @item -mfix-r10000
17584 @itemx -mno-fix-r10000
17585 @opindex mfix-r10000
17586 @opindex mno-fix-r10000
17587 Work around certain R10000 errata:
17588 @itemize @minus
17589 @item
17590 @code{ll}/@code{sc} sequences may not behave atomically on revisions
17591 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
17592 @end itemize
17594 This option can only be used if the target architecture supports
17595 branch-likely instructions.  @option{-mfix-r10000} is the default when
17596 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
17597 otherwise.
17599 @item -mfix-rm7000
17600 @itemx -mno-fix-rm7000
17601 @opindex mfix-rm7000
17602 Work around the RM7000 @code{dmult}/@code{dmultu} errata.  The
17603 workarounds are implemented by the assembler rather than by GCC@.
17605 @item -mfix-vr4120
17606 @itemx -mno-fix-vr4120
17607 @opindex mfix-vr4120
17608 Work around certain VR4120 errata:
17609 @itemize @minus
17610 @item
17611 @code{dmultu} does not always produce the correct result.
17612 @item
17613 @code{div} and @code{ddiv} do not always produce the correct result if one
17614 of the operands is negative.
17615 @end itemize
17616 The workarounds for the division errata rely on special functions in
17617 @file{libgcc.a}.  At present, these functions are only provided by
17618 the @code{mips64vr*-elf} configurations.
17620 Other VR4120 errata require a NOP to be inserted between certain pairs of
17621 instructions.  These errata are handled by the assembler, not by GCC itself.
17623 @item -mfix-vr4130
17624 @opindex mfix-vr4130
17625 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
17626 workarounds are implemented by the assembler rather than by GCC,
17627 although GCC avoids using @code{mflo} and @code{mfhi} if the
17628 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
17629 instructions are available instead.
17631 @item -mfix-sb1
17632 @itemx -mno-fix-sb1
17633 @opindex mfix-sb1
17634 Work around certain SB-1 CPU core errata.
17635 (This flag currently works around the SB-1 revision 2
17636 ``F1'' and ``F2'' floating-point errata.)
17638 @item -mr10k-cache-barrier=@var{setting}
17639 @opindex mr10k-cache-barrier
17640 Specify whether GCC should insert cache barriers to avoid the
17641 side-effects of speculation on R10K processors.
17643 In common with many processors, the R10K tries to predict the outcome
17644 of a conditional branch and speculatively executes instructions from
17645 the ``taken'' branch.  It later aborts these instructions if the
17646 predicted outcome is wrong.  However, on the R10K, even aborted
17647 instructions can have side effects.
17649 This problem only affects kernel stores and, depending on the system,
17650 kernel loads.  As an example, a speculatively-executed store may load
17651 the target memory into cache and mark the cache line as dirty, even if
17652 the store itself is later aborted.  If a DMA operation writes to the
17653 same area of memory before the ``dirty'' line is flushed, the cached
17654 data overwrites the DMA-ed data.  See the R10K processor manual
17655 for a full description, including other potential problems.
17657 One workaround is to insert cache barrier instructions before every memory
17658 access that might be speculatively executed and that might have side
17659 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
17660 controls GCC's implementation of this workaround.  It assumes that
17661 aborted accesses to any byte in the following regions does not have
17662 side effects:
17664 @enumerate
17665 @item
17666 the memory occupied by the current function's stack frame;
17668 @item
17669 the memory occupied by an incoming stack argument;
17671 @item
17672 the memory occupied by an object with a link-time-constant address.
17673 @end enumerate
17675 It is the kernel's responsibility to ensure that speculative
17676 accesses to these regions are indeed safe.
17678 If the input program contains a function declaration such as:
17680 @smallexample
17681 void foo (void);
17682 @end smallexample
17684 then the implementation of @code{foo} must allow @code{j foo} and
17685 @code{jal foo} to be executed speculatively.  GCC honors this
17686 restriction for functions it compiles itself.  It expects non-GCC
17687 functions (such as hand-written assembly code) to do the same.
17689 The option has three forms:
17691 @table @gcctabopt
17692 @item -mr10k-cache-barrier=load-store
17693 Insert a cache barrier before a load or store that might be
17694 speculatively executed and that might have side effects even
17695 if aborted.
17697 @item -mr10k-cache-barrier=store
17698 Insert a cache barrier before a store that might be speculatively
17699 executed and that might have side effects even if aborted.
17701 @item -mr10k-cache-barrier=none
17702 Disable the insertion of cache barriers.  This is the default setting.
17703 @end table
17705 @item -mflush-func=@var{func}
17706 @itemx -mno-flush-func
17707 @opindex mflush-func
17708 Specifies the function to call to flush the I and D caches, or to not
17709 call any such function.  If called, the function must take the same
17710 arguments as the common @code{_flush_func}, that is, the address of the
17711 memory range for which the cache is being flushed, the size of the
17712 memory range, and the number 3 (to flush both caches).  The default
17713 depends on the target GCC was configured for, but commonly is either
17714 @code{_flush_func} or @code{__cpu_flush}.
17716 @item mbranch-cost=@var{num}
17717 @opindex mbranch-cost
17718 Set the cost of branches to roughly @var{num} ``simple'' instructions.
17719 This cost is only a heuristic and is not guaranteed to produce
17720 consistent results across releases.  A zero cost redundantly selects
17721 the default, which is based on the @option{-mtune} setting.
17723 @item -mbranch-likely
17724 @itemx -mno-branch-likely
17725 @opindex mbranch-likely
17726 @opindex mno-branch-likely
17727 Enable or disable use of Branch Likely instructions, regardless of the
17728 default for the selected architecture.  By default, Branch Likely
17729 instructions may be generated if they are supported by the selected
17730 architecture.  An exception is for the MIPS32 and MIPS64 architectures
17731 and processors that implement those architectures; for those, Branch
17732 Likely instructions are not be generated by default because the MIPS32
17733 and MIPS64 architectures specifically deprecate their use.
17735 @item -mfp-exceptions
17736 @itemx -mno-fp-exceptions
17737 @opindex mfp-exceptions
17738 Specifies whether FP exceptions are enabled.  This affects how
17739 FP instructions are scheduled for some processors.
17740 The default is that FP exceptions are
17741 enabled.
17743 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
17744 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
17745 FP pipe.
17747 @item -mvr4130-align
17748 @itemx -mno-vr4130-align
17749 @opindex mvr4130-align
17750 The VR4130 pipeline is two-way superscalar, but can only issue two
17751 instructions together if the first one is 8-byte aligned.  When this
17752 option is enabled, GCC aligns pairs of instructions that it
17753 thinks should execute in parallel.
17755 This option only has an effect when optimizing for the VR4130.
17756 It normally makes code faster, but at the expense of making it bigger.
17757 It is enabled by default at optimization level @option{-O3}.
17759 @item -msynci
17760 @itemx -mno-synci
17761 @opindex msynci
17762 Enable (disable) generation of @code{synci} instructions on
17763 architectures that support it.  The @code{synci} instructions (if
17764 enabled) are generated when @code{__builtin___clear_cache} is
17765 compiled.
17767 This option defaults to @option{-mno-synci}, but the default can be
17768 overridden by configuring GCC with @option{--with-synci}.
17770 When compiling code for single processor systems, it is generally safe
17771 to use @code{synci}.  However, on many multi-core (SMP) systems, it
17772 does not invalidate the instruction caches on all cores and may lead
17773 to undefined behavior.
17775 @item -mrelax-pic-calls
17776 @itemx -mno-relax-pic-calls
17777 @opindex mrelax-pic-calls
17778 Try to turn PIC calls that are normally dispatched via register
17779 @code{$25} into direct calls.  This is only possible if the linker can
17780 resolve the destination at link-time and if the destination is within
17781 range for a direct call.
17783 @option{-mrelax-pic-calls} is the default if GCC was configured to use
17784 an assembler and a linker that support the @code{.reloc} assembly
17785 directive and @option{-mexplicit-relocs} is in effect.  With
17786 @option{-mno-explicit-relocs}, this optimization can be performed by the
17787 assembler and the linker alone without help from the compiler.
17789 @item -mmcount-ra-address
17790 @itemx -mno-mcount-ra-address
17791 @opindex mmcount-ra-address
17792 @opindex mno-mcount-ra-address
17793 Emit (do not emit) code that allows @code{_mcount} to modify the
17794 calling function's return address.  When enabled, this option extends
17795 the usual @code{_mcount} interface with a new @var{ra-address}
17796 parameter, which has type @code{intptr_t *} and is passed in register
17797 @code{$12}.  @code{_mcount} can then modify the return address by
17798 doing both of the following:
17799 @itemize
17800 @item
17801 Returning the new address in register @code{$31}.
17802 @item
17803 Storing the new address in @code{*@var{ra-address}},
17804 if @var{ra-address} is nonnull.
17805 @end itemize
17807 The default is @option{-mno-mcount-ra-address}.
17809 @end table
17811 @node MMIX Options
17812 @subsection MMIX Options
17813 @cindex MMIX Options
17815 These options are defined for the MMIX:
17817 @table @gcctabopt
17818 @item -mlibfuncs
17819 @itemx -mno-libfuncs
17820 @opindex mlibfuncs
17821 @opindex mno-libfuncs
17822 Specify that intrinsic library functions are being compiled, passing all
17823 values in registers, no matter the size.
17825 @item -mepsilon
17826 @itemx -mno-epsilon
17827 @opindex mepsilon
17828 @opindex mno-epsilon
17829 Generate floating-point comparison instructions that compare with respect
17830 to the @code{rE} epsilon register.
17832 @item -mabi=mmixware
17833 @itemx -mabi=gnu
17834 @opindex mabi=mmixware
17835 @opindex mabi=gnu
17836 Generate code that passes function parameters and return values that (in
17837 the called function) are seen as registers @code{$0} and up, as opposed to
17838 the GNU ABI which uses global registers @code{$231} and up.
17840 @item -mzero-extend
17841 @itemx -mno-zero-extend
17842 @opindex mzero-extend
17843 @opindex mno-zero-extend
17844 When reading data from memory in sizes shorter than 64 bits, use (do not
17845 use) zero-extending load instructions by default, rather than
17846 sign-extending ones.
17848 @item -mknuthdiv
17849 @itemx -mno-knuthdiv
17850 @opindex mknuthdiv
17851 @opindex mno-knuthdiv
17852 Make the result of a division yielding a remainder have the same sign as
17853 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
17854 remainder follows the sign of the dividend.  Both methods are
17855 arithmetically valid, the latter being almost exclusively used.
17857 @item -mtoplevel-symbols
17858 @itemx -mno-toplevel-symbols
17859 @opindex mtoplevel-symbols
17860 @opindex mno-toplevel-symbols
17861 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
17862 code can be used with the @code{PREFIX} assembly directive.
17864 @item -melf
17865 @opindex melf
17866 Generate an executable in the ELF format, rather than the default
17867 @samp{mmo} format used by the @command{mmix} simulator.
17869 @item -mbranch-predict
17870 @itemx -mno-branch-predict
17871 @opindex mbranch-predict
17872 @opindex mno-branch-predict
17873 Use (do not use) the probable-branch instructions, when static branch
17874 prediction indicates a probable branch.
17876 @item -mbase-addresses
17877 @itemx -mno-base-addresses
17878 @opindex mbase-addresses
17879 @opindex mno-base-addresses
17880 Generate (do not generate) code that uses @emph{base addresses}.  Using a
17881 base address automatically generates a request (handled by the assembler
17882 and the linker) for a constant to be set up in a global register.  The
17883 register is used for one or more base address requests within the range 0
17884 to 255 from the value held in the register.  The generally leads to short
17885 and fast code, but the number of different data items that can be
17886 addressed is limited.  This means that a program that uses lots of static
17887 data may require @option{-mno-base-addresses}.
17889 @item -msingle-exit
17890 @itemx -mno-single-exit
17891 @opindex msingle-exit
17892 @opindex mno-single-exit
17893 Force (do not force) generated code to have a single exit point in each
17894 function.
17895 @end table
17897 @node MN10300 Options
17898 @subsection MN10300 Options
17899 @cindex MN10300 options
17901 These @option{-m} options are defined for Matsushita MN10300 architectures:
17903 @table @gcctabopt
17904 @item -mmult-bug
17905 @opindex mmult-bug
17906 Generate code to avoid bugs in the multiply instructions for the MN10300
17907 processors.  This is the default.
17909 @item -mno-mult-bug
17910 @opindex mno-mult-bug
17911 Do not generate code to avoid bugs in the multiply instructions for the
17912 MN10300 processors.
17914 @item -mam33
17915 @opindex mam33
17916 Generate code using features specific to the AM33 processor.
17918 @item -mno-am33
17919 @opindex mno-am33
17920 Do not generate code using features specific to the AM33 processor.  This
17921 is the default.
17923 @item -mam33-2
17924 @opindex mam33-2
17925 Generate code using features specific to the AM33/2.0 processor.
17927 @item -mam34
17928 @opindex mam34
17929 Generate code using features specific to the AM34 processor.
17931 @item -mtune=@var{cpu-type}
17932 @opindex mtune
17933 Use the timing characteristics of the indicated CPU type when
17934 scheduling instructions.  This does not change the targeted processor
17935 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
17936 @samp{am33-2} or @samp{am34}.
17938 @item -mreturn-pointer-on-d0
17939 @opindex mreturn-pointer-on-d0
17940 When generating a function that returns a pointer, return the pointer
17941 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
17942 only in @code{a0}, and attempts to call such functions without a prototype
17943 result in errors.  Note that this option is on by default; use
17944 @option{-mno-return-pointer-on-d0} to disable it.
17946 @item -mno-crt0
17947 @opindex mno-crt0
17948 Do not link in the C run-time initialization object file.
17950 @item -mrelax
17951 @opindex mrelax
17952 Indicate to the linker that it should perform a relaxation optimization pass
17953 to shorten branches, calls and absolute memory addresses.  This option only
17954 has an effect when used on the command line for the final link step.
17956 This option makes symbolic debugging impossible.
17958 @item -mliw
17959 @opindex mliw
17960 Allow the compiler to generate @emph{Long Instruction Word}
17961 instructions if the target is the @samp{AM33} or later.  This is the
17962 default.  This option defines the preprocessor macro @code{__LIW__}.
17964 @item -mnoliw
17965 @opindex mnoliw
17966 Do not allow the compiler to generate @emph{Long Instruction Word}
17967 instructions.  This option defines the preprocessor macro
17968 @code{__NO_LIW__}.
17970 @item -msetlb
17971 @opindex msetlb
17972 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
17973 instructions if the target is the @samp{AM33} or later.  This is the
17974 default.  This option defines the preprocessor macro @code{__SETLB__}.
17976 @item -mnosetlb
17977 @opindex mnosetlb
17978 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
17979 instructions.  This option defines the preprocessor macro
17980 @code{__NO_SETLB__}.
17982 @end table
17984 @node Moxie Options
17985 @subsection Moxie Options
17986 @cindex Moxie Options
17988 @table @gcctabopt
17990 @item -meb
17991 @opindex meb
17992 Generate big-endian code.  This is the default for @samp{moxie-*-*}
17993 configurations.
17995 @item -mel
17996 @opindex mel
17997 Generate little-endian code.
17999 @item -mmul.x
18000 @opindex mmul.x
18001 Generate mul.x and umul.x instructions.  This is the default for
18002 @samp{moxiebox-*-*} configurations.
18004 @item -mno-crt0
18005 @opindex mno-crt0
18006 Do not link in the C run-time initialization object file.
18008 @end table
18010 @node MSP430 Options
18011 @subsection MSP430 Options
18012 @cindex MSP430 Options
18014 These options are defined for the MSP430:
18016 @table @gcctabopt
18018 @item -masm-hex
18019 @opindex masm-hex
18020 Force assembly output to always use hex constants.  Normally such
18021 constants are signed decimals, but this option is available for
18022 testsuite and/or aesthetic purposes.
18024 @item -mmcu=
18025 @opindex mmcu=
18026 Select the MCU to target.  This is used to create a C preprocessor
18027 symbol based upon the MCU name, converted to upper case and pre- and
18028 post-fixed with @samp{__}.  This in turn is used by the
18029 @file{msp430.h} header file to select an MCU-specific supplementary
18030 header file.
18032 The option also sets the ISA to use.  If the MCU name is one that is
18033 known to only support the 430 ISA then that is selected, otherwise the
18034 430X ISA is selected.  A generic MCU name of @samp{msp430} can also be
18035 used to select the 430 ISA.  Similarly the generic @samp{msp430x} MCU
18036 name selects the 430X ISA.
18038 In addition an MCU-specific linker script is added to the linker
18039 command line.  The script's name is the name of the MCU with
18040 @file{.ld} appended.  Thus specifying @option{-mmcu=xxx} on the @command{gcc}
18041 command line defines the C preprocessor symbol @code{__XXX__} and
18042 cause the linker to search for a script called @file{xxx.ld}.
18044 This option is also passed on to the assembler.
18046 @item -mcpu=
18047 @opindex mcpu=
18048 Specifies the ISA to use.  Accepted values are @samp{msp430},
18049 @samp{msp430x} and @samp{msp430xv2}.  This option is deprecated.  The
18050 @option{-mmcu=} option should be used to select the ISA.
18052 @item -msim
18053 @opindex msim
18054 Link to the simulator runtime libraries and linker script.  Overrides
18055 any scripts that would be selected by the @option{-mmcu=} option.
18057 @item -mlarge
18058 @opindex mlarge
18059 Use large-model addressing (20-bit pointers, 32-bit @code{size_t}).
18061 @item -msmall
18062 @opindex msmall
18063 Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
18065 @item -mrelax
18066 @opindex mrelax
18067 This option is passed to the assembler and linker, and allows the
18068 linker to perform certain optimizations that cannot be done until
18069 the final link.
18071 @item mhwmult=
18072 @opindex mhwmult=
18073 Describes the type of hardware multiply supported by the target.
18074 Accepted values are @samp{none} for no hardware multiply, @samp{16bit}
18075 for the original 16-bit-only multiply supported by early MCUs.
18076 @samp{32bit} for the 16/32-bit multiply supported by later MCUs and
18077 @samp{f5series} for the 16/32-bit multiply supported by F5-series MCUs.
18078 A value of @samp{auto} can also be given.  This tells GCC to deduce
18079 the hardware multiply support based upon the MCU name provided by the
18080 @option{-mmcu} option.  If no @option{-mmcu} option is specified then
18081 @samp{32bit} hardware multiply support is assumed.  @samp{auto} is the
18082 default setting.
18084 Hardware multiplies are normally performed by calling a library
18085 routine.  This saves space in the generated code.  When compiling at
18086 @option{-O3} or higher however the hardware multiplier is invoked
18087 inline.  This makes for bigger, but faster code.
18089 The hardware multiply routines disable interrupts whilst running and
18090 restore the previous interrupt state when they finish.  This makes
18091 them safe to use inside interrupt handlers as well as in normal code.
18093 @item -minrt
18094 @opindex minrt
18095 Enable the use of a minimum runtime environment - no static
18096 initializers or constructors.  This is intended for memory-constrained
18097 devices.  The compiler includes special symbols in some objects
18098 that tell the linker and runtime which code fragments are required.
18100 @end table
18102 @node NDS32 Options
18103 @subsection NDS32 Options
18104 @cindex NDS32 Options
18106 These options are defined for NDS32 implementations:
18108 @table @gcctabopt
18110 @item -mbig-endian
18111 @opindex mbig-endian
18112 Generate code in big-endian mode.
18114 @item -mlittle-endian
18115 @opindex mlittle-endian
18116 Generate code in little-endian mode.
18118 @item -mreduced-regs
18119 @opindex mreduced-regs
18120 Use reduced-set registers for register allocation.
18122 @item -mfull-regs
18123 @opindex mfull-regs
18124 Use full-set registers for register allocation.
18126 @item -mcmov
18127 @opindex mcmov
18128 Generate conditional move instructions.
18130 @item -mno-cmov
18131 @opindex mno-cmov
18132 Do not generate conditional move instructions.
18134 @item -mperf-ext
18135 @opindex mperf-ext
18136 Generate performance extension instructions.
18138 @item -mno-perf-ext
18139 @opindex mno-perf-ext
18140 Do not generate performance extension instructions.
18142 @item -mv3push
18143 @opindex mv3push
18144 Generate v3 push25/pop25 instructions.
18146 @item -mno-v3push
18147 @opindex mno-v3push
18148 Do not generate v3 push25/pop25 instructions.
18150 @item -m16-bit
18151 @opindex m16-bit
18152 Generate 16-bit instructions.
18154 @item -mno-16-bit
18155 @opindex mno-16-bit
18156 Do not generate 16-bit instructions.
18158 @item -misr-vector-size=@var{num}
18159 @opindex misr-vector-size
18160 Specify the size of each interrupt vector, which must be 4 or 16.
18162 @item -mcache-block-size=@var{num}
18163 @opindex mcache-block-size
18164 Specify the size of each cache block,
18165 which must be a power of 2 between 4 and 512.
18167 @item -march=@var{arch}
18168 @opindex march
18169 Specify the name of the target architecture.
18171 @item -mcmodel=@var{code-model}
18172 @opindex mcmodel
18173 Set the code model to one of
18174 @table @asis
18175 @item @samp{small}
18176 All the data and read-only data segments must be within 512KB addressing space.
18177 The text segment must be within 16MB addressing space.
18178 @item @samp{medium}
18179 The data segment must be within 512KB while the read-only data segment can be
18180 within 4GB addressing space.  The text segment should be still within 16MB
18181 addressing space.
18182 @item @samp{large}
18183 All the text and data segments can be within 4GB addressing space.
18184 @end table
18186 @item -mctor-dtor
18187 @opindex mctor-dtor
18188 Enable constructor/destructor feature.
18190 @item -mrelax
18191 @opindex mrelax
18192 Guide linker to relax instructions.
18194 @end table
18196 @node Nios II Options
18197 @subsection Nios II Options
18198 @cindex Nios II options
18199 @cindex Altera Nios II options
18201 These are the options defined for the Altera Nios II processor.
18203 @table @gcctabopt
18205 @item -G @var{num}
18206 @opindex G
18207 @cindex smaller data references
18208 Put global and static objects less than or equal to @var{num} bytes
18209 into the small data or BSS sections instead of the normal data or BSS
18210 sections.  The default value of @var{num} is 8.
18212 @item -mgpopt=@var{option}
18213 @item -mgpopt
18214 @itemx -mno-gpopt
18215 @opindex mgpopt
18216 @opindex mno-gpopt
18217 Generate (do not generate) GP-relative accesses.  The following 
18218 @var{option} names are recognized:
18220 @table @samp
18222 @item none
18223 Do not generate GP-relative accesses.
18225 @item local
18226 Generate GP-relative accesses for small data objects that are not 
18227 external or weak.  Also use GP-relative addressing for objects that
18228 have been explicitly placed in a small data section via a @code{section}
18229 attribute.
18231 @item global
18232 As for @samp{local}, but also generate GP-relative accesses for
18233 small data objects that are external or weak.  If you use this option,
18234 you must ensure that all parts of your program (including libraries) are
18235 compiled with the same @option{-G} setting.
18237 @item data
18238 Generate GP-relative accesses for all data objects in the program.  If you
18239 use this option, the entire data and BSS segments
18240 of your program must fit in 64K of memory and you must use an appropriate
18241 linker script to allocate them within the addressible range of the
18242 global pointer.
18244 @item all
18245 Generate GP-relative addresses for function pointers as well as data
18246 pointers.  If you use this option, the entire text, data, and BSS segments
18247 of your program must fit in 64K of memory and you must use an appropriate
18248 linker script to allocate them within the addressible range of the
18249 global pointer.
18251 @end table
18253 @option{-mgpopt} is equivalent to @option{-mgpopt=local}, and
18254 @option{-mno-gpopt} is equivalent to @option{-mgpopt=none}.
18256 The default is @option{-mgpopt} except when @option{-fpic} or
18257 @option{-fPIC} is specified to generate position-independent code.
18258 Note that the Nios II ABI does not permit GP-relative accesses from
18259 shared libraries.
18261 You may need to specify @option{-mno-gpopt} explicitly when building
18262 programs that include large amounts of small data, including large
18263 GOT data sections.  In this case, the 16-bit offset for GP-relative
18264 addressing may not be large enough to allow access to the entire 
18265 small data section.
18267 @item -mel
18268 @itemx -meb
18269 @opindex mel
18270 @opindex meb
18271 Generate little-endian (default) or big-endian (experimental) code,
18272 respectively.
18274 @item -mbypass-cache
18275 @itemx -mno-bypass-cache
18276 @opindex mno-bypass-cache
18277 @opindex mbypass-cache
18278 Force all load and store instructions to always bypass cache by 
18279 using I/O variants of the instructions. The default is not to
18280 bypass the cache.
18282 @item -mno-cache-volatile 
18283 @itemx -mcache-volatile       
18284 @opindex mcache-volatile 
18285 @opindex mno-cache-volatile
18286 Volatile memory access bypass the cache using the I/O variants of 
18287 the load and store instructions. The default is not to bypass the cache.
18289 @item -mno-fast-sw-div
18290 @itemx -mfast-sw-div
18291 @opindex mno-fast-sw-div
18292 @opindex mfast-sw-div
18293 Do not use table-based fast divide for small numbers. The default 
18294 is to use the fast divide at @option{-O3} and above.
18296 @item -mno-hw-mul
18297 @itemx -mhw-mul
18298 @itemx -mno-hw-mulx
18299 @itemx -mhw-mulx
18300 @itemx -mno-hw-div
18301 @itemx -mhw-div
18302 @opindex mno-hw-mul
18303 @opindex mhw-mul
18304 @opindex mno-hw-mulx
18305 @opindex mhw-mulx
18306 @opindex mno-hw-div
18307 @opindex mhw-div
18308 Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of 
18309 instructions by the compiler. The default is to emit @code{mul}
18310 and not emit @code{div} and @code{mulx}.
18312 @item -mcustom-@var{insn}=@var{N}
18313 @itemx -mno-custom-@var{insn}
18314 @opindex mcustom-@var{insn}
18315 @opindex mno-custom-@var{insn}
18316 Each @option{-mcustom-@var{insn}=@var{N}} option enables use of a
18317 custom instruction with encoding @var{N} when generating code that uses 
18318 @var{insn}.  For example, @option{-mcustom-fadds=253} generates custom
18319 instruction 253 for single-precision floating-point add operations instead
18320 of the default behavior of using a library call.
18322 The following values of @var{insn} are supported.  Except as otherwise
18323 noted, floating-point operations are expected to be implemented with
18324 normal IEEE 754 semantics and correspond directly to the C operators or the
18325 equivalent GCC built-in functions (@pxref{Other Builtins}).
18327 Single-precision floating point:
18328 @table @asis
18330 @item @samp{fadds}, @samp{fsubs}, @samp{fdivs}, @samp{fmuls}
18331 Binary arithmetic operations.
18333 @item @samp{fnegs}
18334 Unary negation.
18336 @item @samp{fabss}
18337 Unary absolute value.
18339 @item @samp{fcmpeqs}, @samp{fcmpges}, @samp{fcmpgts}, @samp{fcmples}, @samp{fcmplts}, @samp{fcmpnes}
18340 Comparison operations.
18342 @item @samp{fmins}, @samp{fmaxs}
18343 Floating-point minimum and maximum.  These instructions are only
18344 generated if @option{-ffinite-math-only} is specified.
18346 @item @samp{fsqrts}
18347 Unary square root operation.
18349 @item @samp{fcoss}, @samp{fsins}, @samp{ftans}, @samp{fatans}, @samp{fexps}, @samp{flogs}
18350 Floating-point trigonometric and exponential functions.  These instructions
18351 are only generated if @option{-funsafe-math-optimizations} is also specified.
18353 @end table
18355 Double-precision floating point:
18356 @table @asis
18358 @item @samp{faddd}, @samp{fsubd}, @samp{fdivd}, @samp{fmuld}
18359 Binary arithmetic operations.
18361 @item @samp{fnegd}
18362 Unary negation.
18364 @item @samp{fabsd}
18365 Unary absolute value.
18367 @item @samp{fcmpeqd}, @samp{fcmpged}, @samp{fcmpgtd}, @samp{fcmpled}, @samp{fcmpltd}, @samp{fcmpned}
18368 Comparison operations.
18370 @item @samp{fmind}, @samp{fmaxd}
18371 Double-precision minimum and maximum.  These instructions are only
18372 generated if @option{-ffinite-math-only} is specified.
18374 @item @samp{fsqrtd}
18375 Unary square root operation.
18377 @item @samp{fcosd}, @samp{fsind}, @samp{ftand}, @samp{fatand}, @samp{fexpd}, @samp{flogd}
18378 Double-precision trigonometric and exponential functions.  These instructions
18379 are only generated if @option{-funsafe-math-optimizations} is also specified.
18381 @end table
18383 Conversions:
18384 @table @asis
18385 @item @samp{fextsd}
18386 Conversion from single precision to double precision.
18388 @item @samp{ftruncds}
18389 Conversion from double precision to single precision.
18391 @item @samp{fixsi}, @samp{fixsu}, @samp{fixdi}, @samp{fixdu}
18392 Conversion from floating point to signed or unsigned integer types, with
18393 truncation towards zero.
18395 @item @samp{round}
18396 Conversion from single-precision floating point to signed integer,
18397 rounding to the nearest integer and ties away from zero.
18398 This corresponds to the @code{__builtin_lroundf} function when
18399 @option{-fno-math-errno} is used.
18401 @item @samp{floatis}, @samp{floatus}, @samp{floatid}, @samp{floatud}
18402 Conversion from signed or unsigned integer types to floating-point types.
18404 @end table
18406 In addition, all of the following transfer instructions for internal
18407 registers X and Y must be provided to use any of the double-precision
18408 floating-point instructions.  Custom instructions taking two
18409 double-precision source operands expect the first operand in the
18410 64-bit register X.  The other operand (or only operand of a unary
18411 operation) is given to the custom arithmetic instruction with the
18412 least significant half in source register @var{src1} and the most
18413 significant half in @var{src2}.  A custom instruction that returns a
18414 double-precision result returns the most significant 32 bits in the
18415 destination register and the other half in 32-bit register Y.  
18416 GCC automatically generates the necessary code sequences to write
18417 register X and/or read register Y when double-precision floating-point
18418 instructions are used.
18420 @table @asis
18422 @item @samp{fwrx}
18423 Write @var{src1} into the least significant half of X and @var{src2} into
18424 the most significant half of X.
18426 @item @samp{fwry}
18427 Write @var{src1} into Y.
18429 @item @samp{frdxhi}, @samp{frdxlo}
18430 Read the most or least (respectively) significant half of X and store it in
18431 @var{dest}.
18433 @item @samp{frdy}
18434 Read the value of Y and store it into @var{dest}.
18435 @end table
18437 Note that you can gain more local control over generation of Nios II custom
18438 instructions by using the @code{target("custom-@var{insn}=@var{N}")}
18439 and @code{target("no-custom-@var{insn}")} function attributes
18440 (@pxref{Function Attributes})
18441 or pragmas (@pxref{Function Specific Option Pragmas}).
18443 @item -mcustom-fpu-cfg=@var{name}
18444 @opindex mcustom-fpu-cfg
18446 This option enables a predefined, named set of custom instruction encodings
18447 (see @option{-mcustom-@var{insn}} above).  
18448 Currently, the following sets are defined:
18450 @option{-mcustom-fpu-cfg=60-1} is equivalent to:
18451 @gccoptlist{-mcustom-fmuls=252 @gol
18452 -mcustom-fadds=253 @gol
18453 -mcustom-fsubs=254 @gol
18454 -fsingle-precision-constant}
18456 @option{-mcustom-fpu-cfg=60-2} is equivalent to:
18457 @gccoptlist{-mcustom-fmuls=252 @gol
18458 -mcustom-fadds=253 @gol
18459 -mcustom-fsubs=254 @gol
18460 -mcustom-fdivs=255 @gol
18461 -fsingle-precision-constant}
18463 @option{-mcustom-fpu-cfg=72-3} is equivalent to:
18464 @gccoptlist{-mcustom-floatus=243 @gol
18465 -mcustom-fixsi=244 @gol
18466 -mcustom-floatis=245 @gol
18467 -mcustom-fcmpgts=246 @gol
18468 -mcustom-fcmples=249 @gol
18469 -mcustom-fcmpeqs=250 @gol
18470 -mcustom-fcmpnes=251 @gol
18471 -mcustom-fmuls=252 @gol
18472 -mcustom-fadds=253 @gol
18473 -mcustom-fsubs=254 @gol
18474 -mcustom-fdivs=255 @gol
18475 -fsingle-precision-constant}
18477 Custom instruction assignments given by individual
18478 @option{-mcustom-@var{insn}=} options override those given by
18479 @option{-mcustom-fpu-cfg=}, regardless of the
18480 order of the options on the command line.
18482 Note that you can gain more local control over selection of a FPU
18483 configuration by using the @code{target("custom-fpu-cfg=@var{name}")}
18484 function attribute (@pxref{Function Attributes})
18485 or pragma (@pxref{Function Specific Option Pragmas}).
18487 @end table
18489 These additional @samp{-m} options are available for the Altera Nios II
18490 ELF (bare-metal) target:
18492 @table @gcctabopt
18494 @item -mhal
18495 @opindex mhal
18496 Link with HAL BSP.  This suppresses linking with the GCC-provided C runtime
18497 startup and termination code, and is typically used in conjunction with
18498 @option{-msys-crt0=} to specify the location of the alternate startup code
18499 provided by the HAL BSP.
18501 @item -msmallc
18502 @opindex msmallc
18503 Link with a limited version of the C library, @option{-lsmallc}, rather than
18504 Newlib.
18506 @item -msys-crt0=@var{startfile}
18507 @opindex msys-crt0
18508 @var{startfile} is the file name of the startfile (crt0) to use 
18509 when linking.  This option is only useful in conjunction with @option{-mhal}.
18511 @item -msys-lib=@var{systemlib}
18512 @opindex msys-lib
18513 @var{systemlib} is the library name of the library that provides
18514 low-level system calls required by the C library,
18515 e.g. @code{read} and @code{write}.
18516 This option is typically used to link with a library provided by a HAL BSP.
18518 @end table
18520 @node Nvidia PTX Options
18521 @subsection Nvidia PTX Options
18522 @cindex Nvidia PTX options
18523 @cindex nvptx options
18525 These options are defined for Nvidia PTX:
18527 @table @gcctabopt
18529 @item -m32
18530 @itemx -m64
18531 @opindex m32
18532 @opindex m64
18533 Generate code for 32-bit or 64-bit ABI.
18535 @item -mmainkernel
18536 @opindex mmainkernel
18537 Link in code for a __main kernel.  This is for stand-alone instead of
18538 offloading execution.
18540 @end table
18542 @node PDP-11 Options
18543 @subsection PDP-11 Options
18544 @cindex PDP-11 Options
18546 These options are defined for the PDP-11:
18548 @table @gcctabopt
18549 @item -mfpu
18550 @opindex mfpu
18551 Use hardware FPP floating point.  This is the default.  (FIS floating
18552 point on the PDP-11/40 is not supported.)
18554 @item -msoft-float
18555 @opindex msoft-float
18556 Do not use hardware floating point.
18558 @item -mac0
18559 @opindex mac0
18560 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
18562 @item -mno-ac0
18563 @opindex mno-ac0
18564 Return floating-point results in memory.  This is the default.
18566 @item -m40
18567 @opindex m40
18568 Generate code for a PDP-11/40.
18570 @item -m45
18571 @opindex m45
18572 Generate code for a PDP-11/45.  This is the default.
18574 @item -m10
18575 @opindex m10
18576 Generate code for a PDP-11/10.
18578 @item -mbcopy-builtin
18579 @opindex mbcopy-builtin
18580 Use inline @code{movmemhi} patterns for copying memory.  This is the
18581 default.
18583 @item -mbcopy
18584 @opindex mbcopy
18585 Do not use inline @code{movmemhi} patterns for copying memory.
18587 @item -mint16
18588 @itemx -mno-int32
18589 @opindex mint16
18590 @opindex mno-int32
18591 Use 16-bit @code{int}.  This is the default.
18593 @item -mint32
18594 @itemx -mno-int16
18595 @opindex mint32
18596 @opindex mno-int16
18597 Use 32-bit @code{int}.
18599 @item -mfloat64
18600 @itemx -mno-float32
18601 @opindex mfloat64
18602 @opindex mno-float32
18603 Use 64-bit @code{float}.  This is the default.
18605 @item -mfloat32
18606 @itemx -mno-float64
18607 @opindex mfloat32
18608 @opindex mno-float64
18609 Use 32-bit @code{float}.
18611 @item -mabshi
18612 @opindex mabshi
18613 Use @code{abshi2} pattern.  This is the default.
18615 @item -mno-abshi
18616 @opindex mno-abshi
18617 Do not use @code{abshi2} pattern.
18619 @item -mbranch-expensive
18620 @opindex mbranch-expensive
18621 Pretend that branches are expensive.  This is for experimenting with
18622 code generation only.
18624 @item -mbranch-cheap
18625 @opindex mbranch-cheap
18626 Do not pretend that branches are expensive.  This is the default.
18628 @item -munix-asm
18629 @opindex munix-asm
18630 Use Unix assembler syntax.  This is the default when configured for
18631 @samp{pdp11-*-bsd}.
18633 @item -mdec-asm
18634 @opindex mdec-asm
18635 Use DEC assembler syntax.  This is the default when configured for any
18636 PDP-11 target other than @samp{pdp11-*-bsd}.
18637 @end table
18639 @node picoChip Options
18640 @subsection picoChip Options
18641 @cindex picoChip options
18643 These @samp{-m} options are defined for picoChip implementations:
18645 @table @gcctabopt
18647 @item -mae=@var{ae_type}
18648 @opindex mcpu
18649 Set the instruction set, register set, and instruction scheduling
18650 parameters for array element type @var{ae_type}.  Supported values
18651 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
18653 @option{-mae=ANY} selects a completely generic AE type.  Code
18654 generated with this option runs on any of the other AE types.  The
18655 code is not as efficient as it would be if compiled for a specific
18656 AE type, and some types of operation (e.g., multiplication) do not
18657 work properly on all types of AE.
18659 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
18660 for compiled code, and is the default.
18662 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
18663 option may suffer from poor performance of byte (char) manipulation,
18664 since the DSP AE does not provide hardware support for byte load/stores.
18666 @item -msymbol-as-address
18667 Enable the compiler to directly use a symbol name as an address in a
18668 load/store instruction, without first loading it into a
18669 register.  Typically, the use of this option generates larger
18670 programs, which run faster than when the option isn't used.  However, the
18671 results vary from program to program, so it is left as a user option,
18672 rather than being permanently enabled.
18674 @item -mno-inefficient-warnings
18675 Disables warnings about the generation of inefficient code.  These
18676 warnings can be generated, for example, when compiling code that
18677 performs byte-level memory operations on the MAC AE type.  The MAC AE has
18678 no hardware support for byte-level memory operations, so all byte
18679 load/stores must be synthesized from word load/store operations.  This is
18680 inefficient and a warning is generated to indicate
18681 that you should rewrite the code to avoid byte operations, or to target
18682 an AE type that has the necessary hardware support.  This option disables
18683 these warnings.
18685 @end table
18687 @node PowerPC Options
18688 @subsection PowerPC Options
18689 @cindex PowerPC options
18691 These are listed under @xref{RS/6000 and PowerPC Options}.
18693 @node RL78 Options
18694 @subsection RL78 Options
18695 @cindex RL78 Options
18697 @table @gcctabopt
18699 @item -msim
18700 @opindex msim
18701 Links in additional target libraries to support operation within a
18702 simulator.
18704 @item -mmul=none
18705 @itemx -mmul=g13
18706 @itemx -mmul=rl78
18707 @opindex mmul
18708 Specifies the type of hardware multiplication support to be used.  The
18709 default is @samp{none}, which uses software multiplication functions.
18710 The @samp{g13} option is for the hardware multiply/divide peripheral
18711 only on the RL78/G13 targets.  The @samp{rl78} option is for the
18712 standard hardware multiplication defined in the RL78 software manual.
18714 @item -m64bit-doubles
18715 @itemx -m32bit-doubles
18716 @opindex m64bit-doubles
18717 @opindex m32bit-doubles
18718 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
18719 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
18720 @option{-m32bit-doubles}.
18722 @end table
18724 @node RS/6000 and PowerPC Options
18725 @subsection IBM RS/6000 and PowerPC Options
18726 @cindex RS/6000 and PowerPC Options
18727 @cindex IBM RS/6000 and PowerPC Options
18729 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
18730 @table @gcctabopt
18731 @item -mpowerpc-gpopt
18732 @itemx -mno-powerpc-gpopt
18733 @itemx -mpowerpc-gfxopt
18734 @itemx -mno-powerpc-gfxopt
18735 @need 800
18736 @itemx -mpowerpc64
18737 @itemx -mno-powerpc64
18738 @itemx -mmfcrf
18739 @itemx -mno-mfcrf
18740 @itemx -mpopcntb
18741 @itemx -mno-popcntb
18742 @itemx -mpopcntd
18743 @itemx -mno-popcntd
18744 @itemx -mfprnd
18745 @itemx -mno-fprnd
18746 @need 800
18747 @itemx -mcmpb
18748 @itemx -mno-cmpb
18749 @itemx -mmfpgpr
18750 @itemx -mno-mfpgpr
18751 @itemx -mhard-dfp
18752 @itemx -mno-hard-dfp
18753 @opindex mpowerpc-gpopt
18754 @opindex mno-powerpc-gpopt
18755 @opindex mpowerpc-gfxopt
18756 @opindex mno-powerpc-gfxopt
18757 @opindex mpowerpc64
18758 @opindex mno-powerpc64
18759 @opindex mmfcrf
18760 @opindex mno-mfcrf
18761 @opindex mpopcntb
18762 @opindex mno-popcntb
18763 @opindex mpopcntd
18764 @opindex mno-popcntd
18765 @opindex mfprnd
18766 @opindex mno-fprnd
18767 @opindex mcmpb
18768 @opindex mno-cmpb
18769 @opindex mmfpgpr
18770 @opindex mno-mfpgpr
18771 @opindex mhard-dfp
18772 @opindex mno-hard-dfp
18773 You use these options to specify which instructions are available on the
18774 processor you are using.  The default value of these options is
18775 determined when configuring GCC@.  Specifying the
18776 @option{-mcpu=@var{cpu_type}} overrides the specification of these
18777 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
18778 rather than the options listed above.
18780 Specifying @option{-mpowerpc-gpopt} allows
18781 GCC to use the optional PowerPC architecture instructions in the
18782 General Purpose group, including floating-point square root.  Specifying
18783 @option{-mpowerpc-gfxopt} allows GCC to
18784 use the optional PowerPC architecture instructions in the Graphics
18785 group, including floating-point select.
18787 The @option{-mmfcrf} option allows GCC to generate the move from
18788 condition register field instruction implemented on the POWER4
18789 processor and other processors that support the PowerPC V2.01
18790 architecture.
18791 The @option{-mpopcntb} option allows GCC to generate the popcount and
18792 double-precision FP reciprocal estimate instruction implemented on the
18793 POWER5 processor and other processors that support the PowerPC V2.02
18794 architecture.
18795 The @option{-mpopcntd} option allows GCC to generate the popcount
18796 instruction implemented on the POWER7 processor and other processors
18797 that support the PowerPC V2.06 architecture.
18798 The @option{-mfprnd} option allows GCC to generate the FP round to
18799 integer instructions implemented on the POWER5+ processor and other
18800 processors that support the PowerPC V2.03 architecture.
18801 The @option{-mcmpb} option allows GCC to generate the compare bytes
18802 instruction implemented on the POWER6 processor and other processors
18803 that support the PowerPC V2.05 architecture.
18804 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
18805 general-purpose register instructions implemented on the POWER6X
18806 processor and other processors that support the extended PowerPC V2.05
18807 architecture.
18808 The @option{-mhard-dfp} option allows GCC to generate the decimal
18809 floating-point instructions implemented on some POWER processors.
18811 The @option{-mpowerpc64} option allows GCC to generate the additional
18812 64-bit instructions that are found in the full PowerPC64 architecture
18813 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
18814 @option{-mno-powerpc64}.
18816 @item -mcpu=@var{cpu_type}
18817 @opindex mcpu
18818 Set architecture type, register usage, and
18819 instruction scheduling parameters for machine type @var{cpu_type}.
18820 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
18821 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
18822 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
18823 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
18824 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
18825 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
18826 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
18827 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
18828 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
18829 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8}, @samp{powerpc},
18830 @samp{powerpc64}, @samp{powerpc64le}, and @samp{rs64}.
18832 @option{-mcpu=powerpc}, @option{-mcpu=powerpc64}, and
18833 @option{-mcpu=powerpc64le} specify pure 32-bit PowerPC (either
18834 endian), 64-bit big endian PowerPC and 64-bit little endian PowerPC
18835 architecture machine types, with an appropriate, generic processor
18836 model assumed for scheduling purposes.
18838 The other options specify a specific processor.  Code generated under
18839 those options runs best on that processor, and may not run at all on
18840 others.
18842 The @option{-mcpu} options automatically enable or disable the
18843 following options:
18845 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
18846 -mpopcntb -mpopcntd  -mpowerpc64 @gol
18847 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
18848 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
18849 -mcrypto -mdirect-move -mpower8-fusion -mpower8-vector @gol
18850 -mquad-memory -mquad-memory-atomic}
18852 The particular options set for any particular CPU varies between
18853 compiler versions, depending on what setting seems to produce optimal
18854 code for that CPU; it doesn't necessarily reflect the actual hardware's
18855 capabilities.  If you wish to set an individual option to a particular
18856 value, you may specify it after the @option{-mcpu} option, like
18857 @option{-mcpu=970 -mno-altivec}.
18859 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
18860 not enabled or disabled by the @option{-mcpu} option at present because
18861 AIX does not have full support for these options.  You may still
18862 enable or disable them individually if you're sure it'll work in your
18863 environment.
18865 @item -mtune=@var{cpu_type}
18866 @opindex mtune
18867 Set the instruction scheduling parameters for machine type
18868 @var{cpu_type}, but do not set the architecture type or register usage,
18869 as @option{-mcpu=@var{cpu_type}} does.  The same
18870 values for @var{cpu_type} are used for @option{-mtune} as for
18871 @option{-mcpu}.  If both are specified, the code generated uses the
18872 architecture and registers set by @option{-mcpu}, but the
18873 scheduling parameters set by @option{-mtune}.
18875 @item -mcmodel=small
18876 @opindex mcmodel=small
18877 Generate PowerPC64 code for the small model: The TOC is limited to
18878 64k.
18880 @item -mcmodel=medium
18881 @opindex mcmodel=medium
18882 Generate PowerPC64 code for the medium model: The TOC and other static
18883 data may be up to a total of 4G in size.
18885 @item -mcmodel=large
18886 @opindex mcmodel=large
18887 Generate PowerPC64 code for the large model: The TOC may be up to 4G
18888 in size.  Other data and code is only limited by the 64-bit address
18889 space.
18891 @item -maltivec
18892 @itemx -mno-altivec
18893 @opindex maltivec
18894 @opindex mno-altivec
18895 Generate code that uses (does not use) AltiVec instructions, and also
18896 enable the use of built-in functions that allow more direct access to
18897 the AltiVec instruction set.  You may also need to set
18898 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
18899 enhancements.
18901 When @option{-maltivec} is used, rather than @option{-maltivec=le} or
18902 @option{-maltivec=be}, the element order for Altivec intrinsics such
18903 as @code{vec_splat}, @code{vec_extract}, and @code{vec_insert} 
18904 match array element order corresponding to the endianness of the
18905 target.  That is, element zero identifies the leftmost element in a
18906 vector register when targeting a big-endian platform, and identifies
18907 the rightmost element in a vector register when targeting a
18908 little-endian platform.
18910 @item -maltivec=be
18911 @opindex maltivec=be
18912 Generate Altivec instructions using big-endian element order,
18913 regardless of whether the target is big- or little-endian.  This is
18914 the default when targeting a big-endian platform.
18916 The element order is used to interpret element numbers in Altivec
18917 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
18918 @code{vec_insert}.  By default, these match array element order
18919 corresponding to the endianness for the target.
18921 @item -maltivec=le
18922 @opindex maltivec=le
18923 Generate Altivec instructions using little-endian element order,
18924 regardless of whether the target is big- or little-endian.  This is
18925 the default when targeting a little-endian platform.  This option is
18926 currently ignored when targeting a big-endian platform.
18928 The element order is used to interpret element numbers in Altivec
18929 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
18930 @code{vec_insert}.  By default, these match array element order
18931 corresponding to the endianness for the target.
18933 @item -mvrsave
18934 @itemx -mno-vrsave
18935 @opindex mvrsave
18936 @opindex mno-vrsave
18937 Generate VRSAVE instructions when generating AltiVec code.
18939 @item -mgen-cell-microcode
18940 @opindex mgen-cell-microcode
18941 Generate Cell microcode instructions.
18943 @item -mwarn-cell-microcode
18944 @opindex mwarn-cell-microcode
18945 Warn when a Cell microcode instruction is emitted.  An example
18946 of a Cell microcode instruction is a variable shift.
18948 @item -msecure-plt
18949 @opindex msecure-plt
18950 Generate code that allows @command{ld} and @command{ld.so}
18951 to build executables and shared
18952 libraries with non-executable @code{.plt} and @code{.got} sections.
18953 This is a PowerPC
18954 32-bit SYSV ABI option.
18956 @item -mbss-plt
18957 @opindex mbss-plt
18958 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
18959 fills in, and
18960 requires @code{.plt} and @code{.got}
18961 sections that are both writable and executable.
18962 This is a PowerPC 32-bit SYSV ABI option.
18964 @item -misel
18965 @itemx -mno-isel
18966 @opindex misel
18967 @opindex mno-isel
18968 This switch enables or disables the generation of ISEL instructions.
18970 @item -misel=@var{yes/no}
18971 This switch has been deprecated.  Use @option{-misel} and
18972 @option{-mno-isel} instead.
18974 @item -mspe
18975 @itemx -mno-spe
18976 @opindex mspe
18977 @opindex mno-spe
18978 This switch enables or disables the generation of SPE simd
18979 instructions.
18981 @item -mpaired
18982 @itemx -mno-paired
18983 @opindex mpaired
18984 @opindex mno-paired
18985 This switch enables or disables the generation of PAIRED simd
18986 instructions.
18988 @item -mspe=@var{yes/no}
18989 This option has been deprecated.  Use @option{-mspe} and
18990 @option{-mno-spe} instead.
18992 @item -mvsx
18993 @itemx -mno-vsx
18994 @opindex mvsx
18995 @opindex mno-vsx
18996 Generate code that uses (does not use) vector/scalar (VSX)
18997 instructions, and also enable the use of built-in functions that allow
18998 more direct access to the VSX instruction set.
19000 @item -mcrypto
19001 @itemx -mno-crypto
19002 @opindex mcrypto
19003 @opindex mno-crypto
19004 Enable the use (disable) of the built-in functions that allow direct
19005 access to the cryptographic instructions that were added in version
19006 2.07 of the PowerPC ISA.
19008 @item -mdirect-move
19009 @itemx -mno-direct-move
19010 @opindex mdirect-move
19011 @opindex mno-direct-move
19012 Generate code that uses (does not use) the instructions to move data
19013 between the general purpose registers and the vector/scalar (VSX)
19014 registers that were added in version 2.07 of the PowerPC ISA.
19016 @item -mpower8-fusion
19017 @itemx -mno-power8-fusion
19018 @opindex mpower8-fusion
19019 @opindex mno-power8-fusion
19020 Generate code that keeps (does not keeps) some integer operations
19021 adjacent so that the instructions can be fused together on power8 and
19022 later processors.
19024 @item -mpower8-vector
19025 @itemx -mno-power8-vector
19026 @opindex mpower8-vector
19027 @opindex mno-power8-vector
19028 Generate code that uses (does not use) the vector and scalar
19029 instructions that were added in version 2.07 of the PowerPC ISA.  Also
19030 enable the use of built-in functions that allow more direct access to
19031 the vector instructions.
19033 @item -mquad-memory
19034 @itemx -mno-quad-memory
19035 @opindex mquad-memory
19036 @opindex mno-quad-memory
19037 Generate code that uses (does not use) the non-atomic quad word memory
19038 instructions.  The @option{-mquad-memory} option requires use of
19039 64-bit mode.
19041 @item -mquad-memory-atomic
19042 @itemx -mno-quad-memory-atomic
19043 @opindex mquad-memory-atomic
19044 @opindex mno-quad-memory-atomic
19045 Generate code that uses (does not use) the atomic quad word memory
19046 instructions.  The @option{-mquad-memory-atomic} option requires use of
19047 64-bit mode.
19049 @item -mupper-regs-df
19050 @itemx -mno-upper-regs-df
19051 @opindex mupper-regs-df
19052 @opindex mno-upper-regs-df
19053 Generate code that uses (does not use) the scalar double precision
19054 instructions that target all 64 registers in the vector/scalar
19055 floating point register set that were added in version 2.06 of the
19056 PowerPC ISA.  @option{-mupper-regs-df} is turned on by default if you
19057 use any of the @option{-mcpu=power7}, @option{-mcpu=power8}, or
19058 @option{-mvsx} options.
19060 @item -mupper-regs-sf
19061 @itemx -mno-upper-regs-sf
19062 @opindex mupper-regs-sf
19063 @opindex mno-upper-regs-sf
19064 Generate code that uses (does not use) the scalar single precision
19065 instructions that target all 64 registers in the vector/scalar
19066 floating point register set that were added in version 2.07 of the
19067 PowerPC ISA.  @option{-mupper-regs-sf} is turned on by default if you
19068 use either of the @option{-mcpu=power8} or @option{-mpower8-vector}
19069 options.
19071 @item -mupper-regs
19072 @itemx -mno-upper-regs
19073 @opindex mupper-regs
19074 @opindex mno-upper-regs
19075 Generate code that uses (does not use) the scalar
19076 instructions that target all 64 registers in the vector/scalar
19077 floating point register set, depending on the model of the machine.
19079 If the @option{-mno-upper-regs} option is used, it turns off both
19080 @option{-mupper-regs-sf} and @option{-mupper-regs-df} options.
19082 @item -mfloat-gprs=@var{yes/single/double/no}
19083 @itemx -mfloat-gprs
19084 @opindex mfloat-gprs
19085 This switch enables or disables the generation of floating-point
19086 operations on the general-purpose registers for architectures that
19087 support it.
19089 The argument @samp{yes} or @samp{single} enables the use of
19090 single-precision floating-point operations.
19092 The argument @samp{double} enables the use of single and
19093 double-precision floating-point operations.
19095 The argument @samp{no} disables floating-point operations on the
19096 general-purpose registers.
19098 This option is currently only available on the MPC854x.
19100 @item -m32
19101 @itemx -m64
19102 @opindex m32
19103 @opindex m64
19104 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
19105 targets (including GNU/Linux).  The 32-bit environment sets int, long
19106 and pointer to 32 bits and generates code that runs on any PowerPC
19107 variant.  The 64-bit environment sets int to 32 bits and long and
19108 pointer to 64 bits, and generates code for PowerPC64, as for
19109 @option{-mpowerpc64}.
19111 @item -mfull-toc
19112 @itemx -mno-fp-in-toc
19113 @itemx -mno-sum-in-toc
19114 @itemx -mminimal-toc
19115 @opindex mfull-toc
19116 @opindex mno-fp-in-toc
19117 @opindex mno-sum-in-toc
19118 @opindex mminimal-toc
19119 Modify generation of the TOC (Table Of Contents), which is created for
19120 every executable file.  The @option{-mfull-toc} option is selected by
19121 default.  In that case, GCC allocates at least one TOC entry for
19122 each unique non-automatic variable reference in your program.  GCC
19123 also places floating-point constants in the TOC@.  However, only
19124 16,384 entries are available in the TOC@.
19126 If you receive a linker error message that saying you have overflowed
19127 the available TOC space, you can reduce the amount of TOC space used
19128 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
19129 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
19130 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
19131 generate code to calculate the sum of an address and a constant at
19132 run time instead of putting that sum into the TOC@.  You may specify one
19133 or both of these options.  Each causes GCC to produce very slightly
19134 slower and larger code at the expense of conserving TOC space.
19136 If you still run out of space in the TOC even when you specify both of
19137 these options, specify @option{-mminimal-toc} instead.  This option causes
19138 GCC to make only one TOC entry for every file.  When you specify this
19139 option, GCC produces code that is slower and larger but which
19140 uses extremely little TOC space.  You may wish to use this option
19141 only on files that contain less frequently-executed code.
19143 @item -maix64
19144 @itemx -maix32
19145 @opindex maix64
19146 @opindex maix32
19147 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
19148 @code{long} type, and the infrastructure needed to support them.
19149 Specifying @option{-maix64} implies @option{-mpowerpc64},
19150 while @option{-maix32} disables the 64-bit ABI and
19151 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
19153 @item -mxl-compat
19154 @itemx -mno-xl-compat
19155 @opindex mxl-compat
19156 @opindex mno-xl-compat
19157 Produce code that conforms more closely to IBM XL compiler semantics
19158 when using AIX-compatible ABI@.  Pass floating-point arguments to
19159 prototyped functions beyond the register save area (RSA) on the stack
19160 in addition to argument FPRs.  Do not assume that most significant
19161 double in 128-bit long double value is properly rounded when comparing
19162 values and converting to double.  Use XL symbol names for long double
19163 support routines.
19165 The AIX calling convention was extended but not initially documented to
19166 handle an obscure K&R C case of calling a function that takes the
19167 address of its arguments with fewer arguments than declared.  IBM XL
19168 compilers access floating-point arguments that do not fit in the
19169 RSA from the stack when a subroutine is compiled without
19170 optimization.  Because always storing floating-point arguments on the
19171 stack is inefficient and rarely needed, this option is not enabled by
19172 default and only is necessary when calling subroutines compiled by IBM
19173 XL compilers without optimization.
19175 @item -mpe
19176 @opindex mpe
19177 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
19178 application written to use message passing with special startup code to
19179 enable the application to run.  The system must have PE installed in the
19180 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
19181 must be overridden with the @option{-specs=} option to specify the
19182 appropriate directory location.  The Parallel Environment does not
19183 support threads, so the @option{-mpe} option and the @option{-pthread}
19184 option are incompatible.
19186 @item -malign-natural
19187 @itemx -malign-power
19188 @opindex malign-natural
19189 @opindex malign-power
19190 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
19191 @option{-malign-natural} overrides the ABI-defined alignment of larger
19192 types, such as floating-point doubles, on their natural size-based boundary.
19193 The option @option{-malign-power} instructs GCC to follow the ABI-specified
19194 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
19196 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
19197 is not supported.
19199 @item -msoft-float
19200 @itemx -mhard-float
19201 @opindex msoft-float
19202 @opindex mhard-float
19203 Generate code that does not use (uses) the floating-point register set.
19204 Software floating-point emulation is provided if you use the
19205 @option{-msoft-float} option, and pass the option to GCC when linking.
19207 @item -msingle-float
19208 @itemx -mdouble-float
19209 @opindex msingle-float
19210 @opindex mdouble-float
19211 Generate code for single- or double-precision floating-point operations.
19212 @option{-mdouble-float} implies @option{-msingle-float}.
19214 @item -msimple-fpu
19215 @opindex msimple-fpu
19216 Do not generate @code{sqrt} and @code{div} instructions for hardware
19217 floating-point unit.
19219 @item -mfpu=@var{name}
19220 @opindex mfpu
19221 Specify type of floating-point unit.  Valid values for @var{name} are
19222 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
19223 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
19224 @samp{sp_full} (equivalent to @option{-msingle-float}),
19225 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
19227 @item -mxilinx-fpu
19228 @opindex mxilinx-fpu
19229 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
19231 @item -mmultiple
19232 @itemx -mno-multiple
19233 @opindex mmultiple
19234 @opindex mno-multiple
19235 Generate code that uses (does not use) the load multiple word
19236 instructions and the store multiple word instructions.  These
19237 instructions are generated by default on POWER systems, and not
19238 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
19239 PowerPC systems, since those instructions do not work when the
19240 processor is in little-endian mode.  The exceptions are PPC740 and
19241 PPC750 which permit these instructions in little-endian mode.
19243 @item -mstring
19244 @itemx -mno-string
19245 @opindex mstring
19246 @opindex mno-string
19247 Generate code that uses (does not use) the load string instructions
19248 and the store string word instructions to save multiple registers and
19249 do small block moves.  These instructions are generated by default on
19250 POWER systems, and not generated on PowerPC systems.  Do not use
19251 @option{-mstring} on little-endian PowerPC systems, since those
19252 instructions do not work when the processor is in little-endian mode.
19253 The exceptions are PPC740 and PPC750 which permit these instructions
19254 in little-endian mode.
19256 @item -mupdate
19257 @itemx -mno-update
19258 @opindex mupdate
19259 @opindex mno-update
19260 Generate code that uses (does not use) the load or store instructions
19261 that update the base register to the address of the calculated memory
19262 location.  These instructions are generated by default.  If you use
19263 @option{-mno-update}, there is a small window between the time that the
19264 stack pointer is updated and the address of the previous frame is
19265 stored, which means code that walks the stack frame across interrupts or
19266 signals may get corrupted data.
19268 @item -mavoid-indexed-addresses
19269 @itemx -mno-avoid-indexed-addresses
19270 @opindex mavoid-indexed-addresses
19271 @opindex mno-avoid-indexed-addresses
19272 Generate code that tries to avoid (not avoid) the use of indexed load
19273 or store instructions. These instructions can incur a performance
19274 penalty on Power6 processors in certain situations, such as when
19275 stepping through large arrays that cross a 16M boundary.  This option
19276 is enabled by default when targeting Power6 and disabled otherwise.
19278 @item -mfused-madd
19279 @itemx -mno-fused-madd
19280 @opindex mfused-madd
19281 @opindex mno-fused-madd
19282 Generate code that uses (does not use) the floating-point multiply and
19283 accumulate instructions.  These instructions are generated by default
19284 if hardware floating point is used.  The machine-dependent
19285 @option{-mfused-madd} option is now mapped to the machine-independent
19286 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
19287 mapped to @option{-ffp-contract=off}.
19289 @item -mmulhw
19290 @itemx -mno-mulhw
19291 @opindex mmulhw
19292 @opindex mno-mulhw
19293 Generate code that uses (does not use) the half-word multiply and
19294 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
19295 These instructions are generated by default when targeting those
19296 processors.
19298 @item -mdlmzb
19299 @itemx -mno-dlmzb
19300 @opindex mdlmzb
19301 @opindex mno-dlmzb
19302 Generate code that uses (does not use) the string-search @samp{dlmzb}
19303 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
19304 generated by default when targeting those processors.
19306 @item -mno-bit-align
19307 @itemx -mbit-align
19308 @opindex mno-bit-align
19309 @opindex mbit-align
19310 On System V.4 and embedded PowerPC systems do not (do) force structures
19311 and unions that contain bit-fields to be aligned to the base type of the
19312 bit-field.
19314 For example, by default a structure containing nothing but 8
19315 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
19316 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
19317 the structure is aligned to a 1-byte boundary and is 1 byte in
19318 size.
19320 @item -mno-strict-align
19321 @itemx -mstrict-align
19322 @opindex mno-strict-align
19323 @opindex mstrict-align
19324 On System V.4 and embedded PowerPC systems do not (do) assume that
19325 unaligned memory references are handled by the system.
19327 @item -mrelocatable
19328 @itemx -mno-relocatable
19329 @opindex mrelocatable
19330 @opindex mno-relocatable
19331 Generate code that allows (does not allow) a static executable to be
19332 relocated to a different address at run time.  A simple embedded
19333 PowerPC system loader should relocate the entire contents of
19334 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
19335 a table of 32-bit addresses generated by this option.  For this to
19336 work, all objects linked together must be compiled with
19337 @option{-mrelocatable} or @option{-mrelocatable-lib}.
19338 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
19340 @item -mrelocatable-lib
19341 @itemx -mno-relocatable-lib
19342 @opindex mrelocatable-lib
19343 @opindex mno-relocatable-lib
19344 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
19345 @code{.fixup} section to allow static executables to be relocated at
19346 run time, but @option{-mrelocatable-lib} does not use the smaller stack
19347 alignment of @option{-mrelocatable}.  Objects compiled with
19348 @option{-mrelocatable-lib} may be linked with objects compiled with
19349 any combination of the @option{-mrelocatable} options.
19351 @item -mno-toc
19352 @itemx -mtoc
19353 @opindex mno-toc
19354 @opindex mtoc
19355 On System V.4 and embedded PowerPC systems do not (do) assume that
19356 register 2 contains a pointer to a global area pointing to the addresses
19357 used in the program.
19359 @item -mlittle
19360 @itemx -mlittle-endian
19361 @opindex mlittle
19362 @opindex mlittle-endian
19363 On System V.4 and embedded PowerPC systems compile code for the
19364 processor in little-endian mode.  The @option{-mlittle-endian} option is
19365 the same as @option{-mlittle}.
19367 @item -mbig
19368 @itemx -mbig-endian
19369 @opindex mbig
19370 @opindex mbig-endian
19371 On System V.4 and embedded PowerPC systems compile code for the
19372 processor in big-endian mode.  The @option{-mbig-endian} option is
19373 the same as @option{-mbig}.
19375 @item -mdynamic-no-pic
19376 @opindex mdynamic-no-pic
19377 On Darwin and Mac OS X systems, compile code so that it is not
19378 relocatable, but that its external references are relocatable.  The
19379 resulting code is suitable for applications, but not shared
19380 libraries.
19382 @item -msingle-pic-base
19383 @opindex msingle-pic-base
19384 Treat the register used for PIC addressing as read-only, rather than
19385 loading it in the prologue for each function.  The runtime system is
19386 responsible for initializing this register with an appropriate value
19387 before execution begins.
19389 @item -mprioritize-restricted-insns=@var{priority}
19390 @opindex mprioritize-restricted-insns
19391 This option controls the priority that is assigned to
19392 dispatch-slot restricted instructions during the second scheduling
19393 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
19394 or @samp{2} to assign no, highest, or second-highest (respectively) 
19395 priority to dispatch-slot restricted
19396 instructions.
19398 @item -msched-costly-dep=@var{dependence_type}
19399 @opindex msched-costly-dep
19400 This option controls which dependences are considered costly
19401 by the target during instruction scheduling.  The argument
19402 @var{dependence_type} takes one of the following values:
19404 @table @asis
19405 @item @samp{no}
19406 No dependence is costly.
19408 @item @samp{all}
19409 All dependences are costly.
19411 @item @samp{true_store_to_load}
19412 A true dependence from store to load is costly.
19414 @item @samp{store_to_load}
19415 Any dependence from store to load is costly.
19417 @item @var{number}
19418 Any dependence for which the latency is greater than or equal to 
19419 @var{number} is costly.
19420 @end table
19422 @item -minsert-sched-nops=@var{scheme}
19423 @opindex minsert-sched-nops
19424 This option controls which NOP insertion scheme is used during
19425 the second scheduling pass.  The argument @var{scheme} takes one of the
19426 following values:
19428 @table @asis
19429 @item @samp{no}
19430 Don't insert NOPs.
19432 @item @samp{pad}
19433 Pad with NOPs any dispatch group that has vacant issue slots,
19434 according to the scheduler's grouping.
19436 @item @samp{regroup_exact}
19437 Insert NOPs to force costly dependent insns into
19438 separate groups.  Insert exactly as many NOPs as needed to force an insn
19439 to a new group, according to the estimated processor grouping.
19441 @item @var{number}
19442 Insert NOPs to force costly dependent insns into
19443 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
19444 @end table
19446 @item -mcall-sysv
19447 @opindex mcall-sysv
19448 On System V.4 and embedded PowerPC systems compile code using calling
19449 conventions that adhere to the March 1995 draft of the System V
19450 Application Binary Interface, PowerPC processor supplement.  This is the
19451 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
19453 @item -mcall-sysv-eabi
19454 @itemx -mcall-eabi
19455 @opindex mcall-sysv-eabi
19456 @opindex mcall-eabi
19457 Specify both @option{-mcall-sysv} and @option{-meabi} options.
19459 @item -mcall-sysv-noeabi
19460 @opindex mcall-sysv-noeabi
19461 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
19463 @item -mcall-aixdesc
19464 @opindex m
19465 On System V.4 and embedded PowerPC systems compile code for the AIX
19466 operating system.
19468 @item -mcall-linux
19469 @opindex mcall-linux
19470 On System V.4 and embedded PowerPC systems compile code for the
19471 Linux-based GNU system.
19473 @item -mcall-freebsd
19474 @opindex mcall-freebsd
19475 On System V.4 and embedded PowerPC systems compile code for the
19476 FreeBSD operating system.
19478 @item -mcall-netbsd
19479 @opindex mcall-netbsd
19480 On System V.4 and embedded PowerPC systems compile code for the
19481 NetBSD operating system.
19483 @item -mcall-openbsd
19484 @opindex mcall-netbsd
19485 On System V.4 and embedded PowerPC systems compile code for the
19486 OpenBSD operating system.
19488 @item -maix-struct-return
19489 @opindex maix-struct-return
19490 Return all structures in memory (as specified by the AIX ABI)@.
19492 @item -msvr4-struct-return
19493 @opindex msvr4-struct-return
19494 Return structures smaller than 8 bytes in registers (as specified by the
19495 SVR4 ABI)@.
19497 @item -mabi=@var{abi-type}
19498 @opindex mabi
19499 Extend the current ABI with a particular extension, or remove such extension.
19500 Valid values are @samp{altivec}, @samp{no-altivec}, @samp{spe},
19501 @samp{no-spe}, @samp{ibmlongdouble}, @samp{ieeelongdouble},
19502 @samp{elfv1}, @samp{elfv2}@.
19504 @item -mabi=spe
19505 @opindex mabi=spe
19506 Extend the current ABI with SPE ABI extensions.  This does not change
19507 the default ABI, instead it adds the SPE ABI extensions to the current
19508 ABI@.
19510 @item -mabi=no-spe
19511 @opindex mabi=no-spe
19512 Disable Book-E SPE ABI extensions for the current ABI@.
19514 @item -mabi=ibmlongdouble
19515 @opindex mabi=ibmlongdouble
19516 Change the current ABI to use IBM extended-precision long double.
19517 This is a PowerPC 32-bit SYSV ABI option.
19519 @item -mabi=ieeelongdouble
19520 @opindex mabi=ieeelongdouble
19521 Change the current ABI to use IEEE extended-precision long double.
19522 This is a PowerPC 32-bit Linux ABI option.
19524 @item -mabi=elfv1
19525 @opindex mabi=elfv1
19526 Change the current ABI to use the ELFv1 ABI.
19527 This is the default ABI for big-endian PowerPC 64-bit Linux.
19528 Overriding the default ABI requires special system support and is
19529 likely to fail in spectacular ways.
19531 @item -mabi=elfv2
19532 @opindex mabi=elfv2
19533 Change the current ABI to use the ELFv2 ABI.
19534 This is the default ABI for little-endian PowerPC 64-bit Linux.
19535 Overriding the default ABI requires special system support and is
19536 likely to fail in spectacular ways.
19538 @item -mprototype
19539 @itemx -mno-prototype
19540 @opindex mprototype
19541 @opindex mno-prototype
19542 On System V.4 and embedded PowerPC systems assume that all calls to
19543 variable argument functions are properly prototyped.  Otherwise, the
19544 compiler must insert an instruction before every non-prototyped call to
19545 set or clear bit 6 of the condition code register (@code{CR}) to
19546 indicate whether floating-point values are passed in the floating-point
19547 registers in case the function takes variable arguments.  With
19548 @option{-mprototype}, only calls to prototyped variable argument functions
19549 set or clear the bit.
19551 @item -msim
19552 @opindex msim
19553 On embedded PowerPC systems, assume that the startup module is called
19554 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
19555 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
19556 configurations.
19558 @item -mmvme
19559 @opindex mmvme
19560 On embedded PowerPC systems, assume that the startup module is called
19561 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
19562 @file{libc.a}.
19564 @item -mads
19565 @opindex mads
19566 On embedded PowerPC systems, assume that the startup module is called
19567 @file{crt0.o} and the standard C libraries are @file{libads.a} and
19568 @file{libc.a}.
19570 @item -myellowknife
19571 @opindex myellowknife
19572 On embedded PowerPC systems, assume that the startup module is called
19573 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
19574 @file{libc.a}.
19576 @item -mvxworks
19577 @opindex mvxworks
19578 On System V.4 and embedded PowerPC systems, specify that you are
19579 compiling for a VxWorks system.
19581 @item -memb
19582 @opindex memb
19583 On embedded PowerPC systems, set the @code{PPC_EMB} bit in the ELF flags
19584 header to indicate that @samp{eabi} extended relocations are used.
19586 @item -meabi
19587 @itemx -mno-eabi
19588 @opindex meabi
19589 @opindex mno-eabi
19590 On System V.4 and embedded PowerPC systems do (do not) adhere to the
19591 Embedded Applications Binary Interface (EABI), which is a set of
19592 modifications to the System V.4 specifications.  Selecting @option{-meabi}
19593 means that the stack is aligned to an 8-byte boundary, a function
19594 @code{__eabi} is called from @code{main} to set up the EABI
19595 environment, and the @option{-msdata} option can use both @code{r2} and
19596 @code{r13} to point to two separate small data areas.  Selecting
19597 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
19598 no EABI initialization function is called from @code{main}, and the
19599 @option{-msdata} option only uses @code{r13} to point to a single
19600 small data area.  The @option{-meabi} option is on by default if you
19601 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
19603 @item -msdata=eabi
19604 @opindex msdata=eabi
19605 On System V.4 and embedded PowerPC systems, put small initialized
19606 @code{const} global and static data in the @code{.sdata2} section, which
19607 is pointed to by register @code{r2}.  Put small initialized
19608 non-@code{const} global and static data in the @code{.sdata} section,
19609 which is pointed to by register @code{r13}.  Put small uninitialized
19610 global and static data in the @code{.sbss} section, which is adjacent to
19611 the @code{.sdata} section.  The @option{-msdata=eabi} option is
19612 incompatible with the @option{-mrelocatable} option.  The
19613 @option{-msdata=eabi} option also sets the @option{-memb} option.
19615 @item -msdata=sysv
19616 @opindex msdata=sysv
19617 On System V.4 and embedded PowerPC systems, put small global and static
19618 data in the @code{.sdata} section, which is pointed to by register
19619 @code{r13}.  Put small uninitialized global and static data in the
19620 @code{.sbss} section, which is adjacent to the @code{.sdata} section.
19621 The @option{-msdata=sysv} option is incompatible with the
19622 @option{-mrelocatable} option.
19624 @item -msdata=default
19625 @itemx -msdata
19626 @opindex msdata=default
19627 @opindex msdata
19628 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
19629 compile code the same as @option{-msdata=eabi}, otherwise compile code the
19630 same as @option{-msdata=sysv}.
19632 @item -msdata=data
19633 @opindex msdata=data
19634 On System V.4 and embedded PowerPC systems, put small global
19635 data in the @code{.sdata} section.  Put small uninitialized global
19636 data in the @code{.sbss} section.  Do not use register @code{r13}
19637 to address small data however.  This is the default behavior unless
19638 other @option{-msdata} options are used.
19640 @item -msdata=none
19641 @itemx -mno-sdata
19642 @opindex msdata=none
19643 @opindex mno-sdata
19644 On embedded PowerPC systems, put all initialized global and static data
19645 in the @code{.data} section, and all uninitialized data in the
19646 @code{.bss} section.
19648 @item -mblock-move-inline-limit=@var{num}
19649 @opindex mblock-move-inline-limit
19650 Inline all block moves (such as calls to @code{memcpy} or structure
19651 copies) less than or equal to @var{num} bytes.  The minimum value for
19652 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
19653 targets.  The default value is target-specific.
19655 @item -G @var{num}
19656 @opindex G
19657 @cindex smaller data references (PowerPC)
19658 @cindex .sdata/.sdata2 references (PowerPC)
19659 On embedded PowerPC systems, put global and static items less than or
19660 equal to @var{num} bytes into the small data or BSS sections instead of
19661 the normal data or BSS section.  By default, @var{num} is 8.  The
19662 @option{-G @var{num}} switch is also passed to the linker.
19663 All modules should be compiled with the same @option{-G @var{num}} value.
19665 @item -mregnames
19666 @itemx -mno-regnames
19667 @opindex mregnames
19668 @opindex mno-regnames
19669 On System V.4 and embedded PowerPC systems do (do not) emit register
19670 names in the assembly language output using symbolic forms.
19672 @item -mlongcall
19673 @itemx -mno-longcall
19674 @opindex mlongcall
19675 @opindex mno-longcall
19676 By default assume that all calls are far away so that a longer and more
19677 expensive calling sequence is required.  This is required for calls
19678 farther than 32 megabytes (33,554,432 bytes) from the current location.
19679 A short call is generated if the compiler knows
19680 the call cannot be that far away.  This setting can be overridden by
19681 the @code{shortcall} function attribute, or by @code{#pragma
19682 longcall(0)}.
19684 Some linkers are capable of detecting out-of-range calls and generating
19685 glue code on the fly.  On these systems, long calls are unnecessary and
19686 generate slower code.  As of this writing, the AIX linker can do this,
19687 as can the GNU linker for PowerPC/64.  It is planned to add this feature
19688 to the GNU linker for 32-bit PowerPC systems as well.
19690 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
19691 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
19692 addresses represent the callee and the branch island.  The
19693 Darwin/PPC linker prefers the first address and generates a @code{bl
19694 callee} if the PPC @code{bl} instruction reaches the callee directly;
19695 otherwise, the linker generates @code{bl L42} to call the branch
19696 island.  The branch island is appended to the body of the
19697 calling function; it computes the full 32-bit address of the callee
19698 and jumps to it.
19700 On Mach-O (Darwin) systems, this option directs the compiler emit to
19701 the glue for every direct call, and the Darwin linker decides whether
19702 to use or discard it.
19704 In the future, GCC may ignore all longcall specifications
19705 when the linker is known to generate glue.
19707 @item -mtls-markers
19708 @itemx -mno-tls-markers
19709 @opindex mtls-markers
19710 @opindex mno-tls-markers
19711 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
19712 specifying the function argument.  The relocation allows the linker to
19713 reliably associate function call with argument setup instructions for
19714 TLS optimization, which in turn allows GCC to better schedule the
19715 sequence.
19717 @item -pthread
19718 @opindex pthread
19719 Adds support for multithreading with the @dfn{pthreads} library.
19720 This option sets flags for both the preprocessor and linker.
19722 @item -mrecip
19723 @itemx -mno-recip
19724 @opindex mrecip
19725 This option enables use of the reciprocal estimate and
19726 reciprocal square root estimate instructions with additional
19727 Newton-Raphson steps to increase precision instead of doing a divide or
19728 square root and divide for floating-point arguments.  You should use
19729 the @option{-ffast-math} option when using @option{-mrecip} (or at
19730 least @option{-funsafe-math-optimizations},
19731 @option{-finite-math-only}, @option{-freciprocal-math} and
19732 @option{-fno-trapping-math}).  Note that while the throughput of the
19733 sequence is generally higher than the throughput of the non-reciprocal
19734 instruction, the precision of the sequence can be decreased by up to 2
19735 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
19736 roots.
19738 @item -mrecip=@var{opt}
19739 @opindex mrecip=opt
19740 This option controls which reciprocal estimate instructions
19741 may be used.  @var{opt} is a comma-separated list of options, which may
19742 be preceded by a @code{!} to invert the option:
19744 @table @samp
19746 @item all
19747 Enable all estimate instructions.
19749 @item default 
19750 Enable the default instructions, equivalent to @option{-mrecip}.
19752 @item none 
19753 Disable all estimate instructions, equivalent to @option{-mno-recip}.
19755 @item div 
19756 Enable the reciprocal approximation instructions for both 
19757 single and double precision.
19759 @item divf 
19760 Enable the single-precision reciprocal approximation instructions.
19762 @item divd 
19763 Enable the double-precision reciprocal approximation instructions.
19765 @item rsqrt 
19766 Enable the reciprocal square root approximation instructions for both
19767 single and double precision.
19769 @item rsqrtf 
19770 Enable the single-precision reciprocal square root approximation instructions.
19772 @item rsqrtd 
19773 Enable the double-precision reciprocal square root approximation instructions.
19775 @end table
19777 So, for example, @option{-mrecip=all,!rsqrtd} enables
19778 all of the reciprocal estimate instructions, except for the
19779 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
19780 which handle the double-precision reciprocal square root calculations.
19782 @item -mrecip-precision
19783 @itemx -mno-recip-precision
19784 @opindex mrecip-precision
19785 Assume (do not assume) that the reciprocal estimate instructions
19786 provide higher-precision estimates than is mandated by the PowerPC
19787 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
19788 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
19789 The double-precision square root estimate instructions are not generated by
19790 default on low-precision machines, since they do not provide an
19791 estimate that converges after three steps.
19793 @item -mveclibabi=@var{type}
19794 @opindex mveclibabi
19795 Specifies the ABI type to use for vectorizing intrinsics using an
19796 external library.  The only type supported at present is @samp{mass},
19797 which specifies to use IBM's Mathematical Acceleration Subsystem
19798 (MASS) libraries for vectorizing intrinsics using external libraries.
19799 GCC currently emits calls to @code{acosd2}, @code{acosf4},
19800 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
19801 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
19802 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
19803 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
19804 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
19805 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
19806 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
19807 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
19808 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
19809 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
19810 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
19811 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
19812 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
19813 for power7.  Both @option{-ftree-vectorize} and
19814 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
19815 libraries must be specified at link time.
19817 @item -mfriz
19818 @itemx -mno-friz
19819 @opindex mfriz
19820 Generate (do not generate) the @code{friz} instruction when the
19821 @option{-funsafe-math-optimizations} option is used to optimize
19822 rounding of floating-point values to 64-bit integer and back to floating
19823 point.  The @code{friz} instruction does not return the same value if
19824 the floating-point number is too large to fit in an integer.
19826 @item -mpointers-to-nested-functions
19827 @itemx -mno-pointers-to-nested-functions
19828 @opindex mpointers-to-nested-functions
19829 Generate (do not generate) code to load up the static chain register
19830 (@code{r11}) when calling through a pointer on AIX and 64-bit Linux
19831 systems where a function pointer points to a 3-word descriptor giving
19832 the function address, TOC value to be loaded in register @code{r2}, and
19833 static chain value to be loaded in register @code{r11}.  The
19834 @option{-mpointers-to-nested-functions} is on by default.  You cannot
19835 call through pointers to nested functions or pointers
19836 to functions compiled in other languages that use the static chain if
19837 you use @option{-mno-pointers-to-nested-functions}.
19839 @item -msave-toc-indirect
19840 @itemx -mno-save-toc-indirect
19841 @opindex msave-toc-indirect
19842 Generate (do not generate) code to save the TOC value in the reserved
19843 stack location in the function prologue if the function calls through
19844 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
19845 saved in the prologue, it is saved just before the call through the
19846 pointer.  The @option{-mno-save-toc-indirect} option is the default.
19848 @item -mcompat-align-parm
19849 @itemx -mno-compat-align-parm
19850 @opindex mcompat-align-parm
19851 Generate (do not generate) code to pass structure parameters with a
19852 maximum alignment of 64 bits, for compatibility with older versions
19853 of GCC.
19855 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
19856 structure parameter on a 128-bit boundary when that structure contained
19857 a member requiring 128-bit alignment.  This is corrected in more
19858 recent versions of GCC.  This option may be used to generate code
19859 that is compatible with functions compiled with older versions of
19860 GCC.
19862 The @option{-mno-compat-align-parm} option is the default.
19863 @end table
19865 @node RX Options
19866 @subsection RX Options
19867 @cindex RX Options
19869 These command-line options are defined for RX targets:
19871 @table @gcctabopt
19872 @item -m64bit-doubles
19873 @itemx -m32bit-doubles
19874 @opindex m64bit-doubles
19875 @opindex m32bit-doubles
19876 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
19877 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
19878 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
19879 works on 32-bit values, which is why the default is
19880 @option{-m32bit-doubles}.
19882 @item -fpu
19883 @itemx -nofpu
19884 @opindex fpu
19885 @opindex nofpu
19886 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
19887 floating-point hardware.  The default is enabled for the RX600
19888 series and disabled for the RX200 series.
19890 Floating-point instructions are only generated for 32-bit floating-point 
19891 values, however, so the FPU hardware is not used for doubles if the
19892 @option{-m64bit-doubles} option is used.
19894 @emph{Note} If the @option{-fpu} option is enabled then
19895 @option{-funsafe-math-optimizations} is also enabled automatically.
19896 This is because the RX FPU instructions are themselves unsafe.
19898 @item -mcpu=@var{name}
19899 @opindex mcpu
19900 Selects the type of RX CPU to be targeted.  Currently three types are
19901 supported, the generic @samp{RX600} and @samp{RX200} series hardware and
19902 the specific @samp{RX610} CPU.  The default is @samp{RX600}.
19904 The only difference between @samp{RX600} and @samp{RX610} is that the
19905 @samp{RX610} does not support the @code{MVTIPL} instruction.
19907 The @samp{RX200} series does not have a hardware floating-point unit
19908 and so @option{-nofpu} is enabled by default when this type is
19909 selected.
19911 @item -mbig-endian-data
19912 @itemx -mlittle-endian-data
19913 @opindex mbig-endian-data
19914 @opindex mlittle-endian-data
19915 Store data (but not code) in the big-endian format.  The default is
19916 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
19917 format.
19919 @item -msmall-data-limit=@var{N}
19920 @opindex msmall-data-limit
19921 Specifies the maximum size in bytes of global and static variables
19922 which can be placed into the small data area.  Using the small data
19923 area can lead to smaller and faster code, but the size of area is
19924 limited and it is up to the programmer to ensure that the area does
19925 not overflow.  Also when the small data area is used one of the RX's
19926 registers (usually @code{r13}) is reserved for use pointing to this
19927 area, so it is no longer available for use by the compiler.  This
19928 could result in slower and/or larger code if variables are pushed onto
19929 the stack instead of being held in this register.
19931 Note, common variables (variables that have not been initialized) and
19932 constants are not placed into the small data area as they are assigned
19933 to other sections in the output executable.
19935 The default value is zero, which disables this feature.  Note, this
19936 feature is not enabled by default with higher optimization levels
19937 (@option{-O2} etc) because of the potentially detrimental effects of
19938 reserving a register.  It is up to the programmer to experiment and
19939 discover whether this feature is of benefit to their program.  See the
19940 description of the @option{-mpid} option for a description of how the
19941 actual register to hold the small data area pointer is chosen.
19943 @item -msim
19944 @itemx -mno-sim
19945 @opindex msim
19946 @opindex mno-sim
19947 Use the simulator runtime.  The default is to use the libgloss
19948 board-specific runtime.
19950 @item -mas100-syntax
19951 @itemx -mno-as100-syntax
19952 @opindex mas100-syntax
19953 @opindex mno-as100-syntax
19954 When generating assembler output use a syntax that is compatible with
19955 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
19956 assembler, but it has some restrictions so it is not generated by default.
19958 @item -mmax-constant-size=@var{N}
19959 @opindex mmax-constant-size
19960 Specifies the maximum size, in bytes, of a constant that can be used as
19961 an operand in a RX instruction.  Although the RX instruction set does
19962 allow constants of up to 4 bytes in length to be used in instructions,
19963 a longer value equates to a longer instruction.  Thus in some
19964 circumstances it can be beneficial to restrict the size of constants
19965 that are used in instructions.  Constants that are too big are instead
19966 placed into a constant pool and referenced via register indirection.
19968 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
19969 or 4 means that constants of any size are allowed.
19971 @item -mrelax
19972 @opindex mrelax
19973 Enable linker relaxation.  Linker relaxation is a process whereby the
19974 linker attempts to reduce the size of a program by finding shorter
19975 versions of various instructions.  Disabled by default.
19977 @item -mint-register=@var{N}
19978 @opindex mint-register
19979 Specify the number of registers to reserve for fast interrupt handler
19980 functions.  The value @var{N} can be between 0 and 4.  A value of 1
19981 means that register @code{r13} is reserved for the exclusive use
19982 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
19983 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
19984 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
19985 A value of 0, the default, does not reserve any registers.
19987 @item -msave-acc-in-interrupts
19988 @opindex msave-acc-in-interrupts
19989 Specifies that interrupt handler functions should preserve the
19990 accumulator register.  This is only necessary if normal code might use
19991 the accumulator register, for example because it performs 64-bit
19992 multiplications.  The default is to ignore the accumulator as this
19993 makes the interrupt handlers faster.
19995 @item -mpid
19996 @itemx -mno-pid
19997 @opindex mpid
19998 @opindex mno-pid
19999 Enables the generation of position independent data.  When enabled any
20000 access to constant data is done via an offset from a base address
20001 held in a register.  This allows the location of constant data to be
20002 determined at run time without requiring the executable to be
20003 relocated, which is a benefit to embedded applications with tight
20004 memory constraints.  Data that can be modified is not affected by this
20005 option.
20007 Note, using this feature reserves a register, usually @code{r13}, for
20008 the constant data base address.  This can result in slower and/or
20009 larger code, especially in complicated functions.
20011 The actual register chosen to hold the constant data base address
20012 depends upon whether the @option{-msmall-data-limit} and/or the
20013 @option{-mint-register} command-line options are enabled.  Starting
20014 with register @code{r13} and proceeding downwards, registers are
20015 allocated first to satisfy the requirements of @option{-mint-register},
20016 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
20017 is possible for the small data area register to be @code{r8} if both
20018 @option{-mint-register=4} and @option{-mpid} are specified on the
20019 command line.
20021 By default this feature is not enabled.  The default can be restored
20022 via the @option{-mno-pid} command-line option.
20024 @item -mno-warn-multiple-fast-interrupts
20025 @itemx -mwarn-multiple-fast-interrupts
20026 @opindex mno-warn-multiple-fast-interrupts
20027 @opindex mwarn-multiple-fast-interrupts
20028 Prevents GCC from issuing a warning message if it finds more than one
20029 fast interrupt handler when it is compiling a file.  The default is to
20030 issue a warning for each extra fast interrupt handler found, as the RX
20031 only supports one such interrupt.
20033 @end table
20035 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
20036 has special significance to the RX port when used with the
20037 @code{interrupt} function attribute.  This attribute indicates a
20038 function intended to process fast interrupts.  GCC ensures
20039 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
20040 and/or @code{r13} and only provided that the normal use of the
20041 corresponding registers have been restricted via the
20042 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
20043 options.
20045 @node S/390 and zSeries Options
20046 @subsection S/390 and zSeries Options
20047 @cindex S/390 and zSeries Options
20049 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
20051 @table @gcctabopt
20052 @item -mhard-float
20053 @itemx -msoft-float
20054 @opindex mhard-float
20055 @opindex msoft-float
20056 Use (do not use) the hardware floating-point instructions and registers
20057 for floating-point operations.  When @option{-msoft-float} is specified,
20058 functions in @file{libgcc.a} are used to perform floating-point
20059 operations.  When @option{-mhard-float} is specified, the compiler
20060 generates IEEE floating-point instructions.  This is the default.
20062 @item -mhard-dfp
20063 @itemx -mno-hard-dfp
20064 @opindex mhard-dfp
20065 @opindex mno-hard-dfp
20066 Use (do not use) the hardware decimal-floating-point instructions for
20067 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
20068 specified, functions in @file{libgcc.a} are used to perform
20069 decimal-floating-point operations.  When @option{-mhard-dfp} is
20070 specified, the compiler generates decimal-floating-point hardware
20071 instructions.  This is the default for @option{-march=z9-ec} or higher.
20073 @item -mlong-double-64
20074 @itemx -mlong-double-128
20075 @opindex mlong-double-64
20076 @opindex mlong-double-128
20077 These switches control the size of @code{long double} type. A size
20078 of 64 bits makes the @code{long double} type equivalent to the @code{double}
20079 type. This is the default.
20081 @item -mbackchain
20082 @itemx -mno-backchain
20083 @opindex mbackchain
20084 @opindex mno-backchain
20085 Store (do not store) the address of the caller's frame as backchain pointer
20086 into the callee's stack frame.
20087 A backchain may be needed to allow debugging using tools that do not understand
20088 DWARF 2 call frame information.
20089 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
20090 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
20091 the backchain is placed into the topmost word of the 96/160 byte register
20092 save area.
20094 In general, code compiled with @option{-mbackchain} is call-compatible with
20095 code compiled with @option{-mmo-backchain}; however, use of the backchain
20096 for debugging purposes usually requires that the whole binary is built with
20097 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
20098 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
20099 to build a linux kernel use @option{-msoft-float}.
20101 The default is to not maintain the backchain.
20103 @item -mpacked-stack
20104 @itemx -mno-packed-stack
20105 @opindex mpacked-stack
20106 @opindex mno-packed-stack
20107 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
20108 specified, the compiler uses the all fields of the 96/160 byte register save
20109 area only for their default purpose; unused fields still take up stack space.
20110 When @option{-mpacked-stack} is specified, register save slots are densely
20111 packed at the top of the register save area; unused space is reused for other
20112 purposes, allowing for more efficient use of the available stack space.
20113 However, when @option{-mbackchain} is also in effect, the topmost word of
20114 the save area is always used to store the backchain, and the return address
20115 register is always saved two words below the backchain.
20117 As long as the stack frame backchain is not used, code generated with
20118 @option{-mpacked-stack} is call-compatible with code generated with
20119 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
20120 S/390 or zSeries generated code that uses the stack frame backchain at run
20121 time, not just for debugging purposes.  Such code is not call-compatible
20122 with code compiled with @option{-mpacked-stack}.  Also, note that the
20123 combination of @option{-mbackchain},
20124 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
20125 to build a linux kernel use @option{-msoft-float}.
20127 The default is to not use the packed stack layout.
20129 @item -msmall-exec
20130 @itemx -mno-small-exec
20131 @opindex msmall-exec
20132 @opindex mno-small-exec
20133 Generate (or do not generate) code using the @code{bras} instruction
20134 to do subroutine calls.
20135 This only works reliably if the total executable size does not
20136 exceed 64k.  The default is to use the @code{basr} instruction instead,
20137 which does not have this limitation.
20139 @item -m64
20140 @itemx -m31
20141 @opindex m64
20142 @opindex m31
20143 When @option{-m31} is specified, generate code compliant to the
20144 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
20145 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
20146 particular to generate 64-bit instructions.  For the @samp{s390}
20147 targets, the default is @option{-m31}, while the @samp{s390x}
20148 targets default to @option{-m64}.
20150 @item -mzarch
20151 @itemx -mesa
20152 @opindex mzarch
20153 @opindex mesa
20154 When @option{-mzarch} is specified, generate code using the
20155 instructions available on z/Architecture.
20156 When @option{-mesa} is specified, generate code using the
20157 instructions available on ESA/390.  Note that @option{-mesa} is
20158 not possible with @option{-m64}.
20159 When generating code compliant to the GNU/Linux for S/390 ABI,
20160 the default is @option{-mesa}.  When generating code compliant
20161 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
20163 @item -mmvcle
20164 @itemx -mno-mvcle
20165 @opindex mmvcle
20166 @opindex mno-mvcle
20167 Generate (or do not generate) code using the @code{mvcle} instruction
20168 to perform block moves.  When @option{-mno-mvcle} is specified,
20169 use a @code{mvc} loop instead.  This is the default unless optimizing for
20170 size.
20172 @item -mdebug
20173 @itemx -mno-debug
20174 @opindex mdebug
20175 @opindex mno-debug
20176 Print (or do not print) additional debug information when compiling.
20177 The default is to not print debug information.
20179 @item -march=@var{cpu-type}
20180 @opindex march
20181 Generate code that runs on @var{cpu-type}, which is the name of a system
20182 representing a certain processor type.  Possible values for
20183 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
20184 @samp{z9-109}, @samp{z9-ec}, @samp{z10},  @samp{z196}, and @samp{zEC12}.
20185 When generating code using the instructions available on z/Architecture,
20186 the default is @option{-march=z900}.  Otherwise, the default is
20187 @option{-march=g5}.
20189 @item -mtune=@var{cpu-type}
20190 @opindex mtune
20191 Tune to @var{cpu-type} everything applicable about the generated code,
20192 except for the ABI and the set of available instructions.
20193 The list of @var{cpu-type} values is the same as for @option{-march}.
20194 The default is the value used for @option{-march}.
20196 @item -mtpf-trace
20197 @itemx -mno-tpf-trace
20198 @opindex mtpf-trace
20199 @opindex mno-tpf-trace
20200 Generate code that adds (does not add) in TPF OS specific branches to trace
20201 routines in the operating system.  This option is off by default, even
20202 when compiling for the TPF OS@.
20204 @item -mfused-madd
20205 @itemx -mno-fused-madd
20206 @opindex mfused-madd
20207 @opindex mno-fused-madd
20208 Generate code that uses (does not use) the floating-point multiply and
20209 accumulate instructions.  These instructions are generated by default if
20210 hardware floating point is used.
20212 @item -mwarn-framesize=@var{framesize}
20213 @opindex mwarn-framesize
20214 Emit a warning if the current function exceeds the given frame size.  Because
20215 this is a compile-time check it doesn't need to be a real problem when the program
20216 runs.  It is intended to identify functions that most probably cause
20217 a stack overflow.  It is useful to be used in an environment with limited stack
20218 size e.g.@: the linux kernel.
20220 @item -mwarn-dynamicstack
20221 @opindex mwarn-dynamicstack
20222 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
20223 arrays.  This is generally a bad idea with a limited stack size.
20225 @item -mstack-guard=@var{stack-guard}
20226 @itemx -mstack-size=@var{stack-size}
20227 @opindex mstack-guard
20228 @opindex mstack-size
20229 If these options are provided the S/390 back end emits additional instructions in
20230 the function prologue that trigger a trap if the stack size is @var{stack-guard}
20231 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
20232 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
20233 the frame size of the compiled function is chosen.
20234 These options are intended to be used to help debugging stack overflow problems.
20235 The additionally emitted code causes only little overhead and hence can also be
20236 used in production-like systems without greater performance degradation.  The given
20237 values have to be exact powers of 2 and @var{stack-size} has to be greater than
20238 @var{stack-guard} without exceeding 64k.
20239 In order to be efficient the extra code makes the assumption that the stack starts
20240 at an address aligned to the value given by @var{stack-size}.
20241 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
20243 @item -mhotpatch=@var{pre-halfwords},@var{post-halfwords}
20244 @opindex mhotpatch
20245 If the hotpatch option is enabled, a ``hot-patching'' function
20246 prologue is generated for all functions in the compilation unit.
20247 The funtion label is prepended with the given number of two-byte
20248 NOP instructions (@var{pre-halfwords}, maximum 1000000).  After
20249 the label, 2 * @var{post-halfwords} bytes are appended, using the
20250 largest NOP like instructions the architecture allows (maximum
20251 1000000).
20253 If both arguments are zero, hotpatching is disabled.
20255 This option can be overridden for individual functions with the
20256 @code{hotpatch} attribute.
20257 @end table
20259 @node Score Options
20260 @subsection Score Options
20261 @cindex Score Options
20263 These options are defined for Score implementations:
20265 @table @gcctabopt
20266 @item -meb
20267 @opindex meb
20268 Compile code for big-endian mode.  This is the default.
20270 @item -mel
20271 @opindex mel
20272 Compile code for little-endian mode.
20274 @item -mnhwloop
20275 @opindex mnhwloop
20276 Disable generation of @code{bcnz} instructions.
20278 @item -muls
20279 @opindex muls
20280 Enable generation of unaligned load and store instructions.
20282 @item -mmac
20283 @opindex mmac
20284 Enable the use of multiply-accumulate instructions. Disabled by default.
20286 @item -mscore5
20287 @opindex mscore5
20288 Specify the SCORE5 as the target architecture.
20290 @item -mscore5u
20291 @opindex mscore5u
20292 Specify the SCORE5U of the target architecture.
20294 @item -mscore7
20295 @opindex mscore7
20296 Specify the SCORE7 as the target architecture. This is the default.
20298 @item -mscore7d
20299 @opindex mscore7d
20300 Specify the SCORE7D as the target architecture.
20301 @end table
20303 @node SH Options
20304 @subsection SH Options
20306 These @samp{-m} options are defined for the SH implementations:
20308 @table @gcctabopt
20309 @item -m1
20310 @opindex m1
20311 Generate code for the SH1.
20313 @item -m2
20314 @opindex m2
20315 Generate code for the SH2.
20317 @item -m2e
20318 Generate code for the SH2e.
20320 @item -m2a-nofpu
20321 @opindex m2a-nofpu
20322 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
20323 that the floating-point unit is not used.
20325 @item -m2a-single-only
20326 @opindex m2a-single-only
20327 Generate code for the SH2a-FPU, in such a way that no double-precision
20328 floating-point operations are used.
20330 @item -m2a-single
20331 @opindex m2a-single
20332 Generate code for the SH2a-FPU assuming the floating-point unit is in
20333 single-precision mode by default.
20335 @item -m2a
20336 @opindex m2a
20337 Generate code for the SH2a-FPU assuming the floating-point unit is in
20338 double-precision mode by default.
20340 @item -m3
20341 @opindex m3
20342 Generate code for the SH3.
20344 @item -m3e
20345 @opindex m3e
20346 Generate code for the SH3e.
20348 @item -m4-nofpu
20349 @opindex m4-nofpu
20350 Generate code for the SH4 without a floating-point unit.
20352 @item -m4-single-only
20353 @opindex m4-single-only
20354 Generate code for the SH4 with a floating-point unit that only
20355 supports single-precision arithmetic.
20357 @item -m4-single
20358 @opindex m4-single
20359 Generate code for the SH4 assuming the floating-point unit is in
20360 single-precision mode by default.
20362 @item -m4
20363 @opindex m4
20364 Generate code for the SH4.
20366 @item -m4-100
20367 @opindex m4-100
20368 Generate code for SH4-100.
20370 @item -m4-100-nofpu
20371 @opindex m4-100-nofpu
20372 Generate code for SH4-100 in such a way that the
20373 floating-point unit is not used.
20375 @item -m4-100-single
20376 @opindex m4-100-single
20377 Generate code for SH4-100 assuming the floating-point unit is in
20378 single-precision mode by default.
20380 @item -m4-100-single-only
20381 @opindex m4-100-single-only
20382 Generate code for SH4-100 in such a way that no double-precision
20383 floating-point operations are used.
20385 @item -m4-200
20386 @opindex m4-200
20387 Generate code for SH4-200.
20389 @item -m4-200-nofpu
20390 @opindex m4-200-nofpu
20391 Generate code for SH4-200 without in such a way that the
20392 floating-point unit is not used.
20394 @item -m4-200-single
20395 @opindex m4-200-single
20396 Generate code for SH4-200 assuming the floating-point unit is in
20397 single-precision mode by default.
20399 @item -m4-200-single-only
20400 @opindex m4-200-single-only
20401 Generate code for SH4-200 in such a way that no double-precision
20402 floating-point operations are used.
20404 @item -m4-300
20405 @opindex m4-300
20406 Generate code for SH4-300.
20408 @item -m4-300-nofpu
20409 @opindex m4-300-nofpu
20410 Generate code for SH4-300 without in such a way that the
20411 floating-point unit is not used.
20413 @item -m4-300-single
20414 @opindex m4-300-single
20415 Generate code for SH4-300 in such a way that no double-precision
20416 floating-point operations are used.
20418 @item -m4-300-single-only
20419 @opindex m4-300-single-only
20420 Generate code for SH4-300 in such a way that no double-precision
20421 floating-point operations are used.
20423 @item -m4-340
20424 @opindex m4-340
20425 Generate code for SH4-340 (no MMU, no FPU).
20427 @item -m4-500
20428 @opindex m4-500
20429 Generate code for SH4-500 (no FPU).  Passes @option{-isa=sh4-nofpu} to the
20430 assembler.
20432 @item -m4a-nofpu
20433 @opindex m4a-nofpu
20434 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
20435 floating-point unit is not used.
20437 @item -m4a-single-only
20438 @opindex m4a-single-only
20439 Generate code for the SH4a, in such a way that no double-precision
20440 floating-point operations are used.
20442 @item -m4a-single
20443 @opindex m4a-single
20444 Generate code for the SH4a assuming the floating-point unit is in
20445 single-precision mode by default.
20447 @item -m4a
20448 @opindex m4a
20449 Generate code for the SH4a.
20451 @item -m4al
20452 @opindex m4al
20453 Same as @option{-m4a-nofpu}, except that it implicitly passes
20454 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
20455 instructions at the moment.
20457 @item -m5-32media
20458 @opindex m5-32media
20459 Generate 32-bit code for SHmedia.
20461 @item -m5-32media-nofpu
20462 @opindex m5-32media-nofpu
20463 Generate 32-bit code for SHmedia in such a way that the
20464 floating-point unit is not used.
20466 @item -m5-64media
20467 @opindex m5-64media
20468 Generate 64-bit code for SHmedia.
20470 @item -m5-64media-nofpu
20471 @opindex m5-64media-nofpu
20472 Generate 64-bit code for SHmedia in such a way that the
20473 floating-point unit is not used.
20475 @item -m5-compact
20476 @opindex m5-compact
20477 Generate code for SHcompact.
20479 @item -m5-compact-nofpu
20480 @opindex m5-compact-nofpu
20481 Generate code for SHcompact in such a way that the
20482 floating-point unit is not used.
20484 @item -mb
20485 @opindex mb
20486 Compile code for the processor in big-endian mode.
20488 @item -ml
20489 @opindex ml
20490 Compile code for the processor in little-endian mode.
20492 @item -mdalign
20493 @opindex mdalign
20494 Align doubles at 64-bit boundaries.  Note that this changes the calling
20495 conventions, and thus some functions from the standard C library do
20496 not work unless you recompile it first with @option{-mdalign}.
20498 @item -mrelax
20499 @opindex mrelax
20500 Shorten some address references at link time, when possible; uses the
20501 linker option @option{-relax}.
20503 @item -mbigtable
20504 @opindex mbigtable
20505 Use 32-bit offsets in @code{switch} tables.  The default is to use
20506 16-bit offsets.
20508 @item -mbitops
20509 @opindex mbitops
20510 Enable the use of bit manipulation instructions on SH2A.
20512 @item -mfmovd
20513 @opindex mfmovd
20514 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
20515 alignment constraints.
20517 @item -mrenesas
20518 @opindex mrenesas
20519 Comply with the calling conventions defined by Renesas.
20521 @item -mno-renesas
20522 @opindex mno-renesas
20523 Comply with the calling conventions defined for GCC before the Renesas
20524 conventions were available.  This option is the default for all
20525 targets of the SH toolchain.
20527 @item -mnomacsave
20528 @opindex mnomacsave
20529 Mark the @code{MAC} register as call-clobbered, even if
20530 @option{-mrenesas} is given.
20532 @item -mieee
20533 @itemx -mno-ieee
20534 @opindex mieee
20535 @opindex mno-ieee
20536 Control the IEEE compliance of floating-point comparisons, which affects the
20537 handling of cases where the result of a comparison is unordered.  By default
20538 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
20539 enabled @option{-mno-ieee} is implicitly set, which results in faster
20540 floating-point greater-equal and less-equal comparisons.  The implcit settings
20541 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
20543 @item -minline-ic_invalidate
20544 @opindex minline-ic_invalidate
20545 Inline code to invalidate instruction cache entries after setting up
20546 nested function trampolines.
20547 This option has no effect if @option{-musermode} is in effect and the selected
20548 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
20549 instruction.
20550 If the selected code generation option does not allow the use of the @code{icbi}
20551 instruction, and @option{-musermode} is not in effect, the inlined code
20552 manipulates the instruction cache address array directly with an associative
20553 write.  This not only requires privileged mode at run time, but it also
20554 fails if the cache line had been mapped via the TLB and has become unmapped.
20556 @item -misize
20557 @opindex misize
20558 Dump instruction size and location in the assembly code.
20560 @item -mpadstruct
20561 @opindex mpadstruct
20562 This option is deprecated.  It pads structures to multiple of 4 bytes,
20563 which is incompatible with the SH ABI@.
20565 @item -matomic-model=@var{model}
20566 @opindex matomic-model=@var{model}
20567 Sets the model of atomic operations and additional parameters as a comma
20568 separated list.  For details on the atomic built-in functions see
20569 @ref{__atomic Builtins}.  The following models and parameters are supported:
20571 @table @samp
20573 @item none
20574 Disable compiler generated atomic sequences and emit library calls for atomic
20575 operations.  This is the default if the target is not @code{sh*-*-linux*}.
20577 @item soft-gusa
20578 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
20579 built-in functions.  The generated atomic sequences require additional support
20580 from the interrupt/exception handling code of the system and are only suitable
20581 for SH3* and SH4* single-core systems.  This option is enabled by default when
20582 the target is @code{sh*-*-linux*} and SH3* or SH4*.  When the target is SH4A,
20583 this option also partially utilizes the hardware atomic instructions
20584 @code{movli.l} and @code{movco.l} to create more efficient code, unless
20585 @samp{strict} is specified.  
20587 @item soft-tcb
20588 Generate software atomic sequences that use a variable in the thread control
20589 block.  This is a variation of the gUSA sequences which can also be used on
20590 SH1* and SH2* targets.  The generated atomic sequences require additional
20591 support from the interrupt/exception handling code of the system and are only
20592 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
20593 parameter has to be specified as well.
20595 @item soft-imask
20596 Generate software atomic sequences that temporarily disable interrupts by
20597 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
20598 in privileged mode and is only suitable for single-core systems.  Additional
20599 support from the interrupt/exception handling code of the system is not
20600 required.  This model is enabled by default when the target is
20601 @code{sh*-*-linux*} and SH1* or SH2*.
20603 @item hard-llcs
20604 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
20605 instructions only.  This is only available on SH4A and is suitable for
20606 multi-core systems.  Since the hardware instructions support only 32 bit atomic
20607 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
20608 Code compiled with this option is also compatible with other software
20609 atomic model interrupt/exception handling systems if executed on an SH4A
20610 system.  Additional support from the interrupt/exception handling code of the
20611 system is not required for this model.
20613 @item gbr-offset=
20614 This parameter specifies the offset in bytes of the variable in the thread
20615 control block structure that should be used by the generated atomic sequences
20616 when the @samp{soft-tcb} model has been selected.  For other models this
20617 parameter is ignored.  The specified value must be an integer multiple of four
20618 and in the range 0-1020.
20620 @item strict
20621 This parameter prevents mixed usage of multiple atomic models, even if they
20622 are compatible, and makes the compiler generate atomic sequences of the
20623 specified model only.
20625 @end table
20627 @item -mtas
20628 @opindex mtas
20629 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
20630 Notice that depending on the particular hardware and software configuration
20631 this can degrade overall performance due to the operand cache line flushes
20632 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
20633 processors the @code{tas.b} instruction must be used with caution since it
20634 can result in data corruption for certain cache configurations.
20636 @item -mprefergot
20637 @opindex mprefergot
20638 When generating position-independent code, emit function calls using
20639 the Global Offset Table instead of the Procedure Linkage Table.
20641 @item -musermode
20642 @itemx -mno-usermode
20643 @opindex musermode
20644 @opindex mno-usermode
20645 Don't allow (allow) the compiler generating privileged mode code.  Specifying
20646 @option{-musermode} also implies @option{-mno-inline-ic_invalidate} if the
20647 inlined code would not work in user mode.  @option{-musermode} is the default
20648 when the target is @code{sh*-*-linux*}.  If the target is SH1* or SH2*
20649 @option{-musermode} has no effect, since there is no user mode.
20651 @item -multcost=@var{number}
20652 @opindex multcost=@var{number}
20653 Set the cost to assume for a multiply insn.
20655 @item -mdiv=@var{strategy}
20656 @opindex mdiv=@var{strategy}
20657 Set the division strategy to be used for integer division operations.
20658 For SHmedia @var{strategy} can be one of: 
20660 @table @samp
20662 @item fp 
20663 Performs the operation in floating point.  This has a very high latency,
20664 but needs only a few instructions, so it might be a good choice if
20665 your code has enough easily-exploitable ILP to allow the compiler to
20666 schedule the floating-point instructions together with other instructions.
20667 Division by zero causes a floating-point exception.
20669 @item inv
20670 Uses integer operations to calculate the inverse of the divisor,
20671 and then multiplies the dividend with the inverse.  This strategy allows
20672 CSE and hoisting of the inverse calculation.  Division by zero calculates
20673 an unspecified result, but does not trap.
20675 @item inv:minlat
20676 A variant of @samp{inv} where, if no CSE or hoisting opportunities
20677 have been found, or if the entire operation has been hoisted to the same
20678 place, the last stages of the inverse calculation are intertwined with the
20679 final multiply to reduce the overall latency, at the expense of using a few
20680 more instructions, and thus offering fewer scheduling opportunities with
20681 other code.
20683 @item call
20684 Calls a library function that usually implements the @samp{inv:minlat}
20685 strategy.
20686 This gives high code density for @code{m5-*media-nofpu} compilations.
20688 @item call2
20689 Uses a different entry point of the same library function, where it
20690 assumes that a pointer to a lookup table has already been set up, which
20691 exposes the pointer load to CSE and code hoisting optimizations.
20693 @item inv:call
20694 @itemx inv:call2
20695 @itemx inv:fp
20696 Use the @samp{inv} algorithm for initial
20697 code generation, but if the code stays unoptimized, revert to the @samp{call},
20698 @samp{call2}, or @samp{fp} strategies, respectively.  Note that the
20699 potentially-trapping side effect of division by zero is carried by a
20700 separate instruction, so it is possible that all the integer instructions
20701 are hoisted out, but the marker for the side effect stays where it is.
20702 A recombination to floating-point operations or a call is not possible
20703 in that case.
20705 @item inv20u
20706 @itemx inv20l
20707 Variants of the @samp{inv:minlat} strategy.  In the case
20708 that the inverse calculation is not separated from the multiply, they speed
20709 up division where the dividend fits into 20 bits (plus sign where applicable)
20710 by inserting a test to skip a number of operations in this case; this test
20711 slows down the case of larger dividends.  @samp{inv20u} assumes the case of a such
20712 a small dividend to be unlikely, and @samp{inv20l} assumes it to be likely.
20714 @end table
20716 For targets other than SHmedia @var{strategy} can be one of:
20718 @table @samp
20720 @item call-div1
20721 Calls a library function that uses the single-step division instruction
20722 @code{div1} to perform the operation.  Division by zero calculates an
20723 unspecified result and does not trap.  This is the default except for SH4,
20724 SH2A and SHcompact.
20726 @item call-fp
20727 Calls a library function that performs the operation in double precision
20728 floating point.  Division by zero causes a floating-point exception.  This is
20729 the default for SHcompact with FPU.  Specifying this for targets that do not
20730 have a double precision FPU defaults to @code{call-div1}.
20732 @item call-table
20733 Calls a library function that uses a lookup table for small divisors and
20734 the @code{div1} instruction with case distinction for larger divisors.  Division
20735 by zero calculates an unspecified result and does not trap.  This is the default
20736 for SH4.  Specifying this for targets that do not have dynamic shift
20737 instructions defaults to @code{call-div1}.
20739 @end table
20741 When a division strategy has not been specified the default strategy is
20742 selected based on the current target.  For SH2A the default strategy is to
20743 use the @code{divs} and @code{divu} instructions instead of library function
20744 calls.
20746 @item -maccumulate-outgoing-args
20747 @opindex maccumulate-outgoing-args
20748 Reserve space once for outgoing arguments in the function prologue rather
20749 than around each call.  Generally beneficial for performance and size.  Also
20750 needed for unwinding to avoid changing the stack frame around conditional code.
20752 @item -mdivsi3_libfunc=@var{name}
20753 @opindex mdivsi3_libfunc=@var{name}
20754 Set the name of the library function used for 32-bit signed division to
20755 @var{name}.
20756 This only affects the name used in the @samp{call} and @samp{inv:call}
20757 division strategies, and the compiler still expects the same
20758 sets of input/output/clobbered registers as if this option were not present.
20760 @item -mfixed-range=@var{register-range}
20761 @opindex mfixed-range
20762 Generate code treating the given register range as fixed registers.
20763 A fixed register is one that the register allocator can not use.  This is
20764 useful when compiling kernel code.  A register range is specified as
20765 two registers separated by a dash.  Multiple register ranges can be
20766 specified separated by a comma.
20768 @item -mindexed-addressing
20769 @opindex mindexed-addressing
20770 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
20771 This is only safe if the hardware and/or OS implement 32-bit wrap-around
20772 semantics for the indexed addressing mode.  The architecture allows the
20773 implementation of processors with 64-bit MMU, which the OS could use to
20774 get 32-bit addressing, but since no current hardware implementation supports
20775 this or any other way to make the indexed addressing mode safe to use in
20776 the 32-bit ABI, the default is @option{-mno-indexed-addressing}.
20778 @item -mgettrcost=@var{number}
20779 @opindex mgettrcost=@var{number}
20780 Set the cost assumed for the @code{gettr} instruction to @var{number}.
20781 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
20783 @item -mpt-fixed
20784 @opindex mpt-fixed
20785 Assume @code{pt*} instructions won't trap.  This generally generates
20786 better-scheduled code, but is unsafe on current hardware.
20787 The current architecture
20788 definition says that @code{ptabs} and @code{ptrel} trap when the target 
20789 anded with 3 is 3.
20790 This has the unintentional effect of making it unsafe to schedule these
20791 instructions before a branch, or hoist them out of a loop.  For example,
20792 @code{__do_global_ctors}, a part of @file{libgcc}
20793 that runs constructors at program
20794 startup, calls functions in a list which is delimited by @minus{}1.  With the
20795 @option{-mpt-fixed} option, the @code{ptabs} is done before testing against @minus{}1.
20796 That means that all the constructors run a bit more quickly, but when
20797 the loop comes to the end of the list, the program crashes because @code{ptabs}
20798 loads @minus{}1 into a target register.  
20800 Since this option is unsafe for any
20801 hardware implementing the current architecture specification, the default
20802 is @option{-mno-pt-fixed}.  Unless specified explicitly with 
20803 @option{-mgettrcost}, @option{-mno-pt-fixed} also implies @option{-mgettrcost=100};
20804 this deters register allocation from using target registers for storing
20805 ordinary integers.
20807 @item -minvalid-symbols
20808 @opindex minvalid-symbols
20809 Assume symbols might be invalid.  Ordinary function symbols generated by
20810 the compiler are always valid to load with
20811 @code{movi}/@code{shori}/@code{ptabs} or
20812 @code{movi}/@code{shori}/@code{ptrel},
20813 but with assembler and/or linker tricks it is possible
20814 to generate symbols that cause @code{ptabs} or @code{ptrel} to trap.
20815 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
20816 It prevents cross-basic-block CSE, hoisting and most scheduling
20817 of symbol loads.  The default is @option{-mno-invalid-symbols}.
20819 @item -mbranch-cost=@var{num}
20820 @opindex mbranch-cost=@var{num}
20821 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
20822 make the compiler try to generate more branch-free code if possible.  
20823 If not specified the value is selected depending on the processor type that
20824 is being compiled for.
20826 @item -mzdcbranch
20827 @itemx -mno-zdcbranch
20828 @opindex mzdcbranch
20829 @opindex mno-zdcbranch
20830 Assume (do not assume) that zero displacement conditional branch instructions
20831 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
20832 compiler prefers zero displacement branch code sequences.  This is
20833 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
20834 disabled by specifying @option{-mno-zdcbranch}.
20836 @item -mcbranch-force-delay-slot
20837 @opindex mcbranch-force-delay-slot
20838 Force the usage of delay slots for conditional branches, which stuffs the delay
20839 slot with a @code{nop} if a suitable instruction can't be found.  By default
20840 this option is disabled.  It can be enabled to work around hardware bugs as
20841 found in the original SH7055.
20843 @item -mfused-madd
20844 @itemx -mno-fused-madd
20845 @opindex mfused-madd
20846 @opindex mno-fused-madd
20847 Generate code that uses (does not use) the floating-point multiply and
20848 accumulate instructions.  These instructions are generated by default
20849 if hardware floating point is used.  The machine-dependent
20850 @option{-mfused-madd} option is now mapped to the machine-independent
20851 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
20852 mapped to @option{-ffp-contract=off}.
20854 @item -mfsca
20855 @itemx -mno-fsca
20856 @opindex mfsca
20857 @opindex mno-fsca
20858 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
20859 and cosine approximations.  The option @option{-mfsca} must be used in
20860 combination with @option{-funsafe-math-optimizations}.  It is enabled by default
20861 when generating code for SH4A.  Using @option{-mno-fsca} disables sine and cosine
20862 approximations even if @option{-funsafe-math-optimizations} is in effect.
20864 @item -mfsrra
20865 @itemx -mno-fsrra
20866 @opindex mfsrra
20867 @opindex mno-fsrra
20868 Allow or disallow the compiler to emit the @code{fsrra} instruction for
20869 reciprocal square root approximations.  The option @option{-mfsrra} must be used
20870 in combination with @option{-funsafe-math-optimizations} and
20871 @option{-ffinite-math-only}.  It is enabled by default when generating code for
20872 SH4A.  Using @option{-mno-fsrra} disables reciprocal square root approximations
20873 even if @option{-funsafe-math-optimizations} and @option{-ffinite-math-only} are
20874 in effect.
20876 @item -mpretend-cmove
20877 @opindex mpretend-cmove
20878 Prefer zero-displacement conditional branches for conditional move instruction
20879 patterns.  This can result in faster code on the SH4 processor.
20881 @end table
20883 @node Solaris 2 Options
20884 @subsection Solaris 2 Options
20885 @cindex Solaris 2 options
20887 These @samp{-m} options are supported on Solaris 2:
20889 @table @gcctabopt
20890 @item -mclear-hwcap
20891 @opindex mclear-hwcap
20892 @option{-mclear-hwcap} tells the compiler to remove the hardware
20893 capabilities generated by the Solaris assembler.  This is only necessary
20894 when object files use ISA extensions not supported by the current
20895 machine, but check at runtime whether or not to use them.
20897 @item -mimpure-text
20898 @opindex mimpure-text
20899 @option{-mimpure-text}, used in addition to @option{-shared}, tells
20900 the compiler to not pass @option{-z text} to the linker when linking a
20901 shared object.  Using this option, you can link position-dependent
20902 code into a shared object.
20904 @option{-mimpure-text} suppresses the ``relocations remain against
20905 allocatable but non-writable sections'' linker error message.
20906 However, the necessary relocations trigger copy-on-write, and the
20907 shared object is not actually shared across processes.  Instead of
20908 using @option{-mimpure-text}, you should compile all source code with
20909 @option{-fpic} or @option{-fPIC}.
20911 @end table
20913 These switches are supported in addition to the above on Solaris 2:
20915 @table @gcctabopt
20916 @item -pthreads
20917 @opindex pthreads
20918 Add support for multithreading using the POSIX threads library.  This
20919 option sets flags for both the preprocessor and linker.  This option does
20920 not affect the thread safety of object code produced  by the compiler or
20921 that of libraries supplied with it.
20923 @item -pthread
20924 @opindex pthread
20925 This is a synonym for @option{-pthreads}.
20926 @end table
20928 @node SPARC Options
20929 @subsection SPARC Options
20930 @cindex SPARC options
20932 These @samp{-m} options are supported on the SPARC:
20934 @table @gcctabopt
20935 @item -mno-app-regs
20936 @itemx -mapp-regs
20937 @opindex mno-app-regs
20938 @opindex mapp-regs
20939 Specify @option{-mapp-regs} to generate output using the global registers
20940 2 through 4, which the SPARC SVR4 ABI reserves for applications.  Like the
20941 global register 1, each global register 2 through 4 is then treated as an
20942 allocable register that is clobbered by function calls.  This is the default.
20944 To be fully SVR4 ABI-compliant at the cost of some performance loss,
20945 specify @option{-mno-app-regs}.  You should compile libraries and system
20946 software with this option.
20948 @item -mflat
20949 @itemx -mno-flat
20950 @opindex mflat
20951 @opindex mno-flat
20952 With @option{-mflat}, the compiler does not generate save/restore instructions
20953 and uses a ``flat'' or single register window model.  This model is compatible
20954 with the regular register window model.  The local registers and the input
20955 registers (0--5) are still treated as ``call-saved'' registers and are
20956 saved on the stack as needed.
20958 With @option{-mno-flat} (the default), the compiler generates save/restore
20959 instructions (except for leaf functions).  This is the normal operating mode.
20961 @item -mfpu
20962 @itemx -mhard-float
20963 @opindex mfpu
20964 @opindex mhard-float
20965 Generate output containing floating-point instructions.  This is the
20966 default.
20968 @item -mno-fpu
20969 @itemx -msoft-float
20970 @opindex mno-fpu
20971 @opindex msoft-float
20972 Generate output containing library calls for floating point.
20973 @strong{Warning:} the requisite libraries are not available for all SPARC
20974 targets.  Normally the facilities of the machine's usual C compiler are
20975 used, but this cannot be done directly in cross-compilation.  You must make
20976 your own arrangements to provide suitable library functions for
20977 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
20978 @samp{sparclite-*-*} do provide software floating-point support.
20980 @option{-msoft-float} changes the calling convention in the output file;
20981 therefore, it is only useful if you compile @emph{all} of a program with
20982 this option.  In particular, you need to compile @file{libgcc.a}, the
20983 library that comes with GCC, with @option{-msoft-float} in order for
20984 this to work.
20986 @item -mhard-quad-float
20987 @opindex mhard-quad-float
20988 Generate output containing quad-word (long double) floating-point
20989 instructions.
20991 @item -msoft-quad-float
20992 @opindex msoft-quad-float
20993 Generate output containing library calls for quad-word (long double)
20994 floating-point instructions.  The functions called are those specified
20995 in the SPARC ABI@.  This is the default.
20997 As of this writing, there are no SPARC implementations that have hardware
20998 support for the quad-word floating-point instructions.  They all invoke
20999 a trap handler for one of these instructions, and then the trap handler
21000 emulates the effect of the instruction.  Because of the trap handler overhead,
21001 this is much slower than calling the ABI library routines.  Thus the
21002 @option{-msoft-quad-float} option is the default.
21004 @item -mno-unaligned-doubles
21005 @itemx -munaligned-doubles
21006 @opindex mno-unaligned-doubles
21007 @opindex munaligned-doubles
21008 Assume that doubles have 8-byte alignment.  This is the default.
21010 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
21011 alignment only if they are contained in another type, or if they have an
21012 absolute address.  Otherwise, it assumes they have 4-byte alignment.
21013 Specifying this option avoids some rare compatibility problems with code
21014 generated by other compilers.  It is not the default because it results
21015 in a performance loss, especially for floating-point code.
21017 @item -muser-mode
21018 @itemx -mno-user-mode
21019 @opindex muser-mode
21020 @opindex mno-user-mode
21021 Do not generate code that can only run in supervisor mode.  This is relevant
21022 only for the @code{casa} instruction emitted for the LEON3 processor.  The
21023 default is @option{-mno-user-mode}.
21025 @item -mno-faster-structs
21026 @itemx -mfaster-structs
21027 @opindex mno-faster-structs
21028 @opindex mfaster-structs
21029 With @option{-mfaster-structs}, the compiler assumes that structures
21030 should have 8-byte alignment.  This enables the use of pairs of
21031 @code{ldd} and @code{std} instructions for copies in structure
21032 assignment, in place of twice as many @code{ld} and @code{st} pairs.
21033 However, the use of this changed alignment directly violates the SPARC
21034 ABI@.  Thus, it's intended only for use on targets where the developer
21035 acknowledges that their resulting code is not directly in line with
21036 the rules of the ABI@.
21038 @item -mcpu=@var{cpu_type}
21039 @opindex mcpu
21040 Set the instruction set, register set, and instruction scheduling parameters
21041 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
21042 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
21043 @samp{leon}, @samp{leon3}, @samp{leon3v7}, @samp{sparclite}, @samp{f930},
21044 @samp{f934}, @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
21045 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
21046 @samp{niagara3} and @samp{niagara4}.
21048 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
21049 which selects the best architecture option for the host processor.
21050 @option{-mcpu=native} has no effect if GCC does not recognize
21051 the processor.
21053 Default instruction scheduling parameters are used for values that select
21054 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
21055 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
21057 Here is a list of each supported architecture and their supported
21058 implementations.
21060 @table @asis
21061 @item v7
21062 cypress, leon3v7
21064 @item v8
21065 supersparc, hypersparc, leon, leon3
21067 @item sparclite
21068 f930, f934, sparclite86x
21070 @item sparclet
21071 tsc701
21073 @item v9
21074 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4
21075 @end table
21077 By default (unless configured otherwise), GCC generates code for the V7
21078 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
21079 additionally optimizes it for the Cypress CY7C602 chip, as used in the
21080 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
21081 SPARCStation 1, 2, IPX etc.
21083 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
21084 architecture.  The only difference from V7 code is that the compiler emits
21085 the integer multiply and integer divide instructions which exist in SPARC-V8
21086 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
21087 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
21088 2000 series.
21090 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
21091 the SPARC architecture.  This adds the integer multiply, integer divide step
21092 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
21093 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
21094 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
21095 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
21096 MB86934 chip, which is the more recent SPARClite with FPU@.
21098 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
21099 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
21100 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
21101 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
21102 optimizes it for the TEMIC SPARClet chip.
21104 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
21105 architecture.  This adds 64-bit integer and floating-point move instructions,
21106 3 additional floating-point condition code registers and conditional move
21107 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
21108 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
21109 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
21110 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
21111 @option{-mcpu=niagara}, the compiler additionally optimizes it for
21112 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
21113 additionally optimizes it for Sun UltraSPARC T2 chips. With
21114 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
21115 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
21116 additionally optimizes it for Sun UltraSPARC T4 chips.
21118 @item -mtune=@var{cpu_type}
21119 @opindex mtune
21120 Set the instruction scheduling parameters for machine type
21121 @var{cpu_type}, but do not set the instruction set or register set that the
21122 option @option{-mcpu=@var{cpu_type}} does.
21124 The same values for @option{-mcpu=@var{cpu_type}} can be used for
21125 @option{-mtune=@var{cpu_type}}, but the only useful values are those
21126 that select a particular CPU implementation.  Those are @samp{cypress},
21127 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{leon3},
21128 @samp{leon3v7}, @samp{f930}, @samp{f934}, @samp{sparclite86x}, @samp{tsc701},
21129 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
21130 @samp{niagara3} and @samp{niagara4}.  With native Solaris and GNU/Linux
21131 toolchains, @samp{native} can also be used.
21133 @item -mv8plus
21134 @itemx -mno-v8plus
21135 @opindex mv8plus
21136 @opindex mno-v8plus
21137 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
21138 difference from the V8 ABI is that the global and out registers are
21139 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
21140 mode for all SPARC-V9 processors.
21142 @item -mvis
21143 @itemx -mno-vis
21144 @opindex mvis
21145 @opindex mno-vis
21146 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
21147 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
21149 @item -mvis2
21150 @itemx -mno-vis2
21151 @opindex mvis2
21152 @opindex mno-vis2
21153 With @option{-mvis2}, GCC generates code that takes advantage of
21154 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
21155 default is @option{-mvis2} when targeting a cpu that supports such
21156 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
21157 also sets @option{-mvis}.
21159 @item -mvis3
21160 @itemx -mno-vis3
21161 @opindex mvis3
21162 @opindex mno-vis3
21163 With @option{-mvis3}, GCC generates code that takes advantage of
21164 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
21165 default is @option{-mvis3} when targeting a cpu that supports such
21166 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
21167 also sets @option{-mvis2} and @option{-mvis}.
21169 @item -mcbcond
21170 @itemx -mno-cbcond
21171 @opindex mcbcond
21172 @opindex mno-cbcond
21173 With @option{-mcbcond}, GCC generates code that takes advantage of
21174 compare-and-branch instructions, as defined in the Sparc Architecture 2011.
21175 The default is @option{-mcbcond} when targeting a cpu that supports such
21176 instructions, such as niagara-4 and later.
21178 @item -mpopc
21179 @itemx -mno-popc
21180 @opindex mpopc
21181 @opindex mno-popc
21182 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
21183 population count instruction.  The default is @option{-mpopc}
21184 when targeting a cpu that supports such instructions, such as Niagara-2 and
21185 later.
21187 @item -mfmaf
21188 @itemx -mno-fmaf
21189 @opindex mfmaf
21190 @opindex mno-fmaf
21191 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
21192 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
21193 when targeting a cpu that supports such instructions, such as Niagara-3 and
21194 later.
21196 @item -mfix-at697f
21197 @opindex mfix-at697f
21198 Enable the documented workaround for the single erratum of the Atmel AT697F
21199 processor (which corresponds to erratum #13 of the AT697E processor).
21201 @item -mfix-ut699
21202 @opindex mfix-ut699
21203 Enable the documented workarounds for the floating-point errata and the data
21204 cache nullify errata of the UT699 processor.
21205 @end table
21207 These @samp{-m} options are supported in addition to the above
21208 on SPARC-V9 processors in 64-bit environments:
21210 @table @gcctabopt
21211 @item -m32
21212 @itemx -m64
21213 @opindex m32
21214 @opindex m64
21215 Generate code for a 32-bit or 64-bit environment.
21216 The 32-bit environment sets int, long and pointer to 32 bits.
21217 The 64-bit environment sets int to 32 bits and long and pointer
21218 to 64 bits.
21220 @item -mcmodel=@var{which}
21221 @opindex mcmodel
21222 Set the code model to one of
21224 @table @samp
21225 @item medlow
21226 The Medium/Low code model: 64-bit addresses, programs
21227 must be linked in the low 32 bits of memory.  Programs can be statically
21228 or dynamically linked.
21230 @item medmid
21231 The Medium/Middle code model: 64-bit addresses, programs
21232 must be linked in the low 44 bits of memory, the text and data segments must
21233 be less than 2GB in size and the data segment must be located within 2GB of
21234 the text segment.
21236 @item medany
21237 The Medium/Anywhere code model: 64-bit addresses, programs
21238 may be linked anywhere in memory, the text and data segments must be less
21239 than 2GB in size and the data segment must be located within 2GB of the
21240 text segment.
21242 @item embmedany
21243 The Medium/Anywhere code model for embedded systems:
21244 64-bit addresses, the text and data segments must be less than 2GB in
21245 size, both starting anywhere in memory (determined at link time).  The
21246 global register %g4 points to the base of the data segment.  Programs
21247 are statically linked and PIC is not supported.
21248 @end table
21250 @item -mmemory-model=@var{mem-model}
21251 @opindex mmemory-model
21252 Set the memory model in force on the processor to one of
21254 @table @samp
21255 @item default
21256 The default memory model for the processor and operating system.
21258 @item rmo
21259 Relaxed Memory Order
21261 @item pso
21262 Partial Store Order
21264 @item tso
21265 Total Store Order
21267 @item sc
21268 Sequential Consistency
21269 @end table
21271 These memory models are formally defined in Appendix D of the Sparc V9
21272 architecture manual, as set in the processor's @code{PSTATE.MM} field.
21274 @item -mstack-bias
21275 @itemx -mno-stack-bias
21276 @opindex mstack-bias
21277 @opindex mno-stack-bias
21278 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
21279 frame pointer if present, are offset by @minus{}2047 which must be added back
21280 when making stack frame references.  This is the default in 64-bit mode.
21281 Otherwise, assume no such offset is present.
21282 @end table
21284 @node SPU Options
21285 @subsection SPU Options
21286 @cindex SPU options
21288 These @samp{-m} options are supported on the SPU:
21290 @table @gcctabopt
21291 @item -mwarn-reloc
21292 @itemx -merror-reloc
21293 @opindex mwarn-reloc
21294 @opindex merror-reloc
21296 The loader for SPU does not handle dynamic relocations.  By default, GCC
21297 gives an error when it generates code that requires a dynamic
21298 relocation.  @option{-mno-error-reloc} disables the error,
21299 @option{-mwarn-reloc} generates a warning instead.
21301 @item -msafe-dma
21302 @itemx -munsafe-dma
21303 @opindex msafe-dma
21304 @opindex munsafe-dma
21306 Instructions that initiate or test completion of DMA must not be
21307 reordered with respect to loads and stores of the memory that is being
21308 accessed.
21309 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
21310 memory accesses, but that can lead to inefficient code in places where the
21311 memory is known to not change.  Rather than mark the memory as volatile,
21312 you can use @option{-msafe-dma} to tell the compiler to treat
21313 the DMA instructions as potentially affecting all memory.  
21315 @item -mbranch-hints
21316 @opindex mbranch-hints
21318 By default, GCC generates a branch hint instruction to avoid
21319 pipeline stalls for always-taken or probably-taken branches.  A hint
21320 is not generated closer than 8 instructions away from its branch.
21321 There is little reason to disable them, except for debugging purposes,
21322 or to make an object a little bit smaller.
21324 @item -msmall-mem
21325 @itemx -mlarge-mem
21326 @opindex msmall-mem
21327 @opindex mlarge-mem
21329 By default, GCC generates code assuming that addresses are never larger
21330 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
21331 a full 32-bit address.
21333 @item -mstdmain
21334 @opindex mstdmain
21336 By default, GCC links against startup code that assumes the SPU-style
21337 main function interface (which has an unconventional parameter list).
21338 With @option{-mstdmain}, GCC links your program against startup
21339 code that assumes a C99-style interface to @code{main}, including a
21340 local copy of @code{argv} strings.
21342 @item -mfixed-range=@var{register-range}
21343 @opindex mfixed-range
21344 Generate code treating the given register range as fixed registers.
21345 A fixed register is one that the register allocator cannot use.  This is
21346 useful when compiling kernel code.  A register range is specified as
21347 two registers separated by a dash.  Multiple register ranges can be
21348 specified separated by a comma.
21350 @item -mea32
21351 @itemx -mea64
21352 @opindex mea32
21353 @opindex mea64
21354 Compile code assuming that pointers to the PPU address space accessed
21355 via the @code{__ea} named address space qualifier are either 32 or 64
21356 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
21357 all object code in an executable must be compiled with the same setting.
21359 @item -maddress-space-conversion
21360 @itemx -mno-address-space-conversion
21361 @opindex maddress-space-conversion
21362 @opindex mno-address-space-conversion
21363 Allow/disallow treating the @code{__ea} address space as superset
21364 of the generic address space.  This enables explicit type casts
21365 between @code{__ea} and generic pointer as well as implicit
21366 conversions of generic pointers to @code{__ea} pointers.  The
21367 default is to allow address space pointer conversions.
21369 @item -mcache-size=@var{cache-size}
21370 @opindex mcache-size
21371 This option controls the version of libgcc that the compiler links to an
21372 executable and selects a software-managed cache for accessing variables
21373 in the @code{__ea} address space with a particular cache size.  Possible
21374 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
21375 and @samp{128}.  The default cache size is 64KB.
21377 @item -matomic-updates
21378 @itemx -mno-atomic-updates
21379 @opindex matomic-updates
21380 @opindex mno-atomic-updates
21381 This option controls the version of libgcc that the compiler links to an
21382 executable and selects whether atomic updates to the software-managed
21383 cache of PPU-side variables are used.  If you use atomic updates, changes
21384 to a PPU variable from SPU code using the @code{__ea} named address space
21385 qualifier do not interfere with changes to other PPU variables residing
21386 in the same cache line from PPU code.  If you do not use atomic updates,
21387 such interference may occur; however, writing back cache lines is
21388 more efficient.  The default behavior is to use atomic updates.
21390 @item -mdual-nops
21391 @itemx -mdual-nops=@var{n}
21392 @opindex mdual-nops
21393 By default, GCC inserts nops to increase dual issue when it expects
21394 it to increase performance.  @var{n} can be a value from 0 to 10.  A
21395 smaller @var{n} inserts fewer nops.  10 is the default, 0 is the
21396 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
21398 @item -mhint-max-nops=@var{n}
21399 @opindex mhint-max-nops
21400 Maximum number of nops to insert for a branch hint.  A branch hint must
21401 be at least 8 instructions away from the branch it is affecting.  GCC
21402 inserts up to @var{n} nops to enforce this, otherwise it does not
21403 generate the branch hint.
21405 @item -mhint-max-distance=@var{n}
21406 @opindex mhint-max-distance
21407 The encoding of the branch hint instruction limits the hint to be within
21408 256 instructions of the branch it is affecting.  By default, GCC makes
21409 sure it is within 125.
21411 @item -msafe-hints
21412 @opindex msafe-hints
21413 Work around a hardware bug that causes the SPU to stall indefinitely.
21414 By default, GCC inserts the @code{hbrp} instruction to make sure
21415 this stall won't happen.
21417 @end table
21419 @node System V Options
21420 @subsection Options for System V
21422 These additional options are available on System V Release 4 for
21423 compatibility with other compilers on those systems:
21425 @table @gcctabopt
21426 @item -G
21427 @opindex G
21428 Create a shared object.
21429 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
21431 @item -Qy
21432 @opindex Qy
21433 Identify the versions of each tool used by the compiler, in a
21434 @code{.ident} assembler directive in the output.
21436 @item -Qn
21437 @opindex Qn
21438 Refrain from adding @code{.ident} directives to the output file (this is
21439 the default).
21441 @item -YP,@var{dirs}
21442 @opindex YP
21443 Search the directories @var{dirs}, and no others, for libraries
21444 specified with @option{-l}.
21446 @item -Ym,@var{dir}
21447 @opindex Ym
21448 Look in the directory @var{dir} to find the M4 preprocessor.
21449 The assembler uses this option.
21450 @c This is supposed to go with a -Yd for predefined M4 macro files, but
21451 @c the generic assembler that comes with Solaris takes just -Ym.
21452 @end table
21454 @node TILE-Gx Options
21455 @subsection TILE-Gx Options
21456 @cindex TILE-Gx options
21458 These @samp{-m} options are supported on the TILE-Gx:
21460 @table @gcctabopt
21461 @item -mcmodel=small
21462 @opindex mcmodel=small
21463 Generate code for the small model.  The distance for direct calls is
21464 limited to 500M in either direction.  PC-relative addresses are 32
21465 bits.  Absolute addresses support the full address range.
21467 @item -mcmodel=large
21468 @opindex mcmodel=large
21469 Generate code for the large model.  There is no limitation on call
21470 distance, pc-relative addresses, or absolute addresses.
21472 @item -mcpu=@var{name}
21473 @opindex mcpu
21474 Selects the type of CPU to be targeted.  Currently the only supported
21475 type is @samp{tilegx}.
21477 @item -m32
21478 @itemx -m64
21479 @opindex m32
21480 @opindex m64
21481 Generate code for a 32-bit or 64-bit environment.  The 32-bit
21482 environment sets int, long, and pointer to 32 bits.  The 64-bit
21483 environment sets int to 32 bits and long and pointer to 64 bits.
21485 @item -mbig-endian
21486 @itemx -mlittle-endian
21487 @opindex mbig-endian
21488 @opindex mlittle-endian
21489 Generate code in big/little endian mode, respectively.
21490 @end table
21492 @node TILEPro Options
21493 @subsection TILEPro Options
21494 @cindex TILEPro options
21496 These @samp{-m} options are supported on the TILEPro:
21498 @table @gcctabopt
21499 @item -mcpu=@var{name}
21500 @opindex mcpu
21501 Selects the type of CPU to be targeted.  Currently the only supported
21502 type is @samp{tilepro}.
21504 @item -m32
21505 @opindex m32
21506 Generate code for a 32-bit environment, which sets int, long, and
21507 pointer to 32 bits.  This is the only supported behavior so the flag
21508 is essentially ignored.
21509 @end table
21511 @node V850 Options
21512 @subsection V850 Options
21513 @cindex V850 Options
21515 These @samp{-m} options are defined for V850 implementations:
21517 @table @gcctabopt
21518 @item -mlong-calls
21519 @itemx -mno-long-calls
21520 @opindex mlong-calls
21521 @opindex mno-long-calls
21522 Treat all calls as being far away (near).  If calls are assumed to be
21523 far away, the compiler always loads the function's address into a
21524 register, and calls indirect through the pointer.
21526 @item -mno-ep
21527 @itemx -mep
21528 @opindex mno-ep
21529 @opindex mep
21530 Do not optimize (do optimize) basic blocks that use the same index
21531 pointer 4 or more times to copy pointer into the @code{ep} register, and
21532 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
21533 option is on by default if you optimize.
21535 @item -mno-prolog-function
21536 @itemx -mprolog-function
21537 @opindex mno-prolog-function
21538 @opindex mprolog-function
21539 Do not use (do use) external functions to save and restore registers
21540 at the prologue and epilogue of a function.  The external functions
21541 are slower, but use less code space if more than one function saves
21542 the same number of registers.  The @option{-mprolog-function} option
21543 is on by default if you optimize.
21545 @item -mspace
21546 @opindex mspace
21547 Try to make the code as small as possible.  At present, this just turns
21548 on the @option{-mep} and @option{-mprolog-function} options.
21550 @item -mtda=@var{n}
21551 @opindex mtda
21552 Put static or global variables whose size is @var{n} bytes or less into
21553 the tiny data area that register @code{ep} points to.  The tiny data
21554 area can hold up to 256 bytes in total (128 bytes for byte references).
21556 @item -msda=@var{n}
21557 @opindex msda
21558 Put static or global variables whose size is @var{n} bytes or less into
21559 the small data area that register @code{gp} points to.  The small data
21560 area can hold up to 64 kilobytes.
21562 @item -mzda=@var{n}
21563 @opindex mzda
21564 Put static or global variables whose size is @var{n} bytes or less into
21565 the first 32 kilobytes of memory.
21567 @item -mv850
21568 @opindex mv850
21569 Specify that the target processor is the V850.
21571 @item -mv850e3v5
21572 @opindex mv850e3v5
21573 Specify that the target processor is the V850E3V5.  The preprocessor
21574 constant @code{__v850e3v5__} is defined if this option is used.
21576 @item -mv850e2v4
21577 @opindex mv850e2v4
21578 Specify that the target processor is the V850E3V5.  This is an alias for
21579 the @option{-mv850e3v5} option.
21581 @item -mv850e2v3
21582 @opindex mv850e2v3
21583 Specify that the target processor is the V850E2V3.  The preprocessor
21584 constant @code{__v850e2v3__} is defined if this option is used.
21586 @item -mv850e2
21587 @opindex mv850e2
21588 Specify that the target processor is the V850E2.  The preprocessor
21589 constant @code{__v850e2__} is defined if this option is used.
21591 @item -mv850e1
21592 @opindex mv850e1
21593 Specify that the target processor is the V850E1.  The preprocessor
21594 constants @code{__v850e1__} and @code{__v850e__} are defined if
21595 this option is used.
21597 @item -mv850es
21598 @opindex mv850es
21599 Specify that the target processor is the V850ES.  This is an alias for
21600 the @option{-mv850e1} option.
21602 @item -mv850e
21603 @opindex mv850e
21604 Specify that the target processor is the V850E@.  The preprocessor
21605 constant @code{__v850e__} is defined if this option is used.
21607 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
21608 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
21609 are defined then a default target processor is chosen and the
21610 relevant @samp{__v850*__} preprocessor constant is defined.
21612 The preprocessor constants @code{__v850} and @code{__v851__} are always
21613 defined, regardless of which processor variant is the target.
21615 @item -mdisable-callt
21616 @itemx -mno-disable-callt
21617 @opindex mdisable-callt
21618 @opindex mno-disable-callt
21619 This option suppresses generation of the @code{CALLT} instruction for the
21620 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
21621 architecture.
21623 This option is enabled by default when the RH850 ABI is
21624 in use (see @option{-mrh850-abi}), and disabled by default when the
21625 GCC ABI is in use.  If @code{CALLT} instructions are being generated
21626 then the C preprocessor symbol @code{__V850_CALLT__} is defined.
21628 @item -mrelax
21629 @itemx -mno-relax
21630 @opindex mrelax
21631 @opindex mno-relax
21632 Pass on (or do not pass on) the @option{-mrelax} command line option
21633 to the assembler.
21635 @item -mlong-jumps
21636 @itemx -mno-long-jumps
21637 @opindex mlong-jumps
21638 @opindex mno-long-jumps
21639 Disable (or re-enable) the generation of PC-relative jump instructions.
21641 @item -msoft-float
21642 @itemx -mhard-float
21643 @opindex msoft-float
21644 @opindex mhard-float
21645 Disable (or re-enable) the generation of hardware floating point
21646 instructions.  This option is only significant when the target
21647 architecture is @samp{V850E2V3} or higher.  If hardware floating point
21648 instructions are being generated then the C preprocessor symbol
21649 @code{__FPU_OK__} is defined, otherwise the symbol
21650 @code{__NO_FPU__} is defined.
21652 @item -mloop
21653 @opindex mloop
21654 Enables the use of the e3v5 LOOP instruction.  The use of this
21655 instruction is not enabled by default when the e3v5 architecture is
21656 selected because its use is still experimental.
21658 @item -mrh850-abi
21659 @itemx -mghs
21660 @opindex mrh850-abi
21661 @opindex mghs
21662 Enables support for the RH850 version of the V850 ABI.  This is the
21663 default.  With this version of the ABI the following rules apply:
21665 @itemize
21666 @item
21667 Integer sized structures and unions are returned via a memory pointer
21668 rather than a register.
21670 @item
21671 Large structures and unions (more than 8 bytes in size) are passed by
21672 value.
21674 @item
21675 Functions are aligned to 16-bit boundaries.
21677 @item
21678 The @option{-m8byte-align} command line option is supported.
21680 @item
21681 The @option{-mdisable-callt} command line option is enabled by
21682 default.  The @option{-mno-disable-callt} command line option is not
21683 supported.
21684 @end itemize
21686 When this version of the ABI is enabled the C preprocessor symbol
21687 @code{__V850_RH850_ABI__} is defined.
21689 @item -mgcc-abi
21690 @opindex mgcc-abi
21691 Enables support for the old GCC version of the V850 ABI.  With this
21692 version of the ABI the following rules apply:
21694 @itemize
21695 @item
21696 Integer sized structures and unions are returned in register @code{r10}.
21698 @item
21699 Large structures and unions (more than 8 bytes in size) are passed by
21700 reference.
21702 @item
21703 Functions are aligned to 32-bit boundaries, unless optimizing for
21704 size.
21706 @item
21707 The @option{-m8byte-align} command line option is not supported.
21709 @item
21710 The @option{-mdisable-callt} command line option is supported but not
21711 enabled by default.
21712 @end itemize
21714 When this version of the ABI is enabled the C preprocessor symbol
21715 @code{__V850_GCC_ABI__} is defined.
21717 @item -m8byte-align
21718 @itemx -mno-8byte-align
21719 @opindex m8byte-align
21720 @opindex mno-8byte-align
21721 Enables support for @code{double} and @code{long long} types to be
21722 aligned on 8-byte boundaries.  The default is to restrict the
21723 alignment of all objects to at most 4-bytes.  When
21724 @option{-m8byte-align} is in effect the C preprocessor symbol
21725 @code{__V850_8BYTE_ALIGN__} is defined.
21727 @item -mbig-switch
21728 @opindex mbig-switch
21729 Generate code suitable for big switch tables.  Use this option only if
21730 the assembler/linker complain about out of range branches within a switch
21731 table.
21733 @item -mapp-regs
21734 @opindex mapp-regs
21735 This option causes r2 and r5 to be used in the code generated by
21736 the compiler.  This setting is the default.
21738 @item -mno-app-regs
21739 @opindex mno-app-regs
21740 This option causes r2 and r5 to be treated as fixed registers.
21742 @end table
21744 @node VAX Options
21745 @subsection VAX Options
21746 @cindex VAX options
21748 These @samp{-m} options are defined for the VAX:
21750 @table @gcctabopt
21751 @item -munix
21752 @opindex munix
21753 Do not output certain jump instructions (@code{aobleq} and so on)
21754 that the Unix assembler for the VAX cannot handle across long
21755 ranges.
21757 @item -mgnu
21758 @opindex mgnu
21759 Do output those jump instructions, on the assumption that the
21760 GNU assembler is being used.
21762 @item -mg
21763 @opindex mg
21764 Output code for G-format floating-point numbers instead of D-format.
21765 @end table
21767 @node Visium Options
21768 @subsection Visium Options
21769 @cindex Visium options
21771 @table @gcctabopt
21773 @item -mdebug
21774 @opindex mdebug
21775 A program which performs file I/O and is destined to run on an MCM target
21776 should be linked with this option.  It causes the libraries libc.a and
21777 libdebug.a to be linked.  The program should be run on the target under
21778 the control of the GDB remote debugging stub.
21780 @item -msim
21781 @opindex msim
21782 A program which performs file I/O and is destined to run on the simulator
21783 should be linked with option.  This causes libraries libc.a and libsim.a to
21784 be linked.
21786 @item -mfpu
21787 @itemx -mhard-float
21788 @opindex mfpu
21789 @opindex mhard-float
21790 Generate code containing floating-point instructions.  This is the
21791 default.
21793 @item -mno-fpu
21794 @itemx -msoft-float
21795 @opindex mno-fpu
21796 @opindex msoft-float
21797 Generate code containing library calls for floating-point.
21799 @option{-msoft-float} changes the calling convention in the output file;
21800 therefore, it is only useful if you compile @emph{all} of a program with
21801 this option.  In particular, you need to compile @file{libgcc.a}, the
21802 library that comes with GCC, with @option{-msoft-float} in order for
21803 this to work.
21805 @item -mcpu=@var{cpu_type}
21806 @opindex mcpu
21807 Set the instruction set, register set, and instruction scheduling parameters
21808 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
21809 @samp{mcm}, @samp{gr5} and @samp{gr6}.
21811 @samp{mcm} is a synonym of @samp{gr5} present for backward compatibility.
21813 By default (unless configured otherwise), GCC generates code for the GR5
21814 variant of the Visium architecture.  
21816 With @option{-mcpu=gr6}, GCC generates code for the GR6 variant of the Visium
21817 architecture.  The only difference from GR5 code is that the compiler will
21818 generate block move instructions.
21820 @item -mtune=@var{cpu_type}
21821 @opindex mtune
21822 Set the instruction scheduling parameters for machine type @var{cpu_type},
21823 but do not set the instruction set or register set that the option
21824 @option{-mcpu=@var{cpu_type}} would.
21826 @item -msv-mode
21827 @opindex msv-mode
21828 Generate code for the supervisor mode, where there are no restrictions on
21829 the access to general registers.  This is the default.
21831 @item -muser-mode
21832 @opindex muser-mode
21833 Generate code for the user mode, where the access to some general registers
21834 is forbidden: on the GR5, registers r24 to r31 cannot be accessed in this
21835 mode; on the GR6, only registers r29 to r31 are affected.
21836 @end table
21838 @node VMS Options
21839 @subsection VMS Options
21841 These @samp{-m} options are defined for the VMS implementations:
21843 @table @gcctabopt
21844 @item -mvms-return-codes
21845 @opindex mvms-return-codes
21846 Return VMS condition codes from @code{main}. The default is to return POSIX-style
21847 condition (e.g.@ error) codes.
21849 @item -mdebug-main=@var{prefix}
21850 @opindex mdebug-main=@var{prefix}
21851 Flag the first routine whose name starts with @var{prefix} as the main
21852 routine for the debugger.
21854 @item -mmalloc64
21855 @opindex mmalloc64
21856 Default to 64-bit memory allocation routines.
21858 @item -mpointer-size=@var{size}
21859 @opindex mpointer-size=@var{size}
21860 Set the default size of pointers. Possible options for @var{size} are
21861 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
21862 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
21863 The later option disables @code{pragma pointer_size}.
21864 @end table
21866 @node VxWorks Options
21867 @subsection VxWorks Options
21868 @cindex VxWorks Options
21870 The options in this section are defined for all VxWorks targets.
21871 Options specific to the target hardware are listed with the other
21872 options for that target.
21874 @table @gcctabopt
21875 @item -mrtp
21876 @opindex mrtp
21877 GCC can generate code for both VxWorks kernels and real time processes
21878 (RTPs).  This option switches from the former to the latter.  It also
21879 defines the preprocessor macro @code{__RTP__}.
21881 @item -non-static
21882 @opindex non-static
21883 Link an RTP executable against shared libraries rather than static
21884 libraries.  The options @option{-static} and @option{-shared} can
21885 also be used for RTPs (@pxref{Link Options}); @option{-static}
21886 is the default.
21888 @item -Bstatic
21889 @itemx -Bdynamic
21890 @opindex Bstatic
21891 @opindex Bdynamic
21892 These options are passed down to the linker.  They are defined for
21893 compatibility with Diab.
21895 @item -Xbind-lazy
21896 @opindex Xbind-lazy
21897 Enable lazy binding of function calls.  This option is equivalent to
21898 @option{-Wl,-z,now} and is defined for compatibility with Diab.
21900 @item -Xbind-now
21901 @opindex Xbind-now
21902 Disable lazy binding of function calls.  This option is the default and
21903 is defined for compatibility with Diab.
21904 @end table
21906 @node x86 Options
21907 @subsection x86 Options
21908 @cindex x86 Options
21910 These @samp{-m} options are defined for the x86 family of computers.
21912 @table @gcctabopt
21914 @item -march=@var{cpu-type}
21915 @opindex march
21916 Generate instructions for the machine type @var{cpu-type}.  In contrast to
21917 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
21918 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
21919 to generate code that may not run at all on processors other than the one
21920 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
21921 @option{-mtune=@var{cpu-type}}.
21923 The choices for @var{cpu-type} are:
21925 @table @samp
21926 @item native
21927 This selects the CPU to generate code for at compilation time by determining
21928 the processor type of the compiling machine.  Using @option{-march=native}
21929 enables all instruction subsets supported by the local machine (hence
21930 the result might not run on different machines).  Using @option{-mtune=native}
21931 produces code optimized for the local machine under the constraints
21932 of the selected instruction set.  
21934 @item i386
21935 Original Intel i386 CPU@.
21937 @item i486
21938 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
21940 @item i586
21941 @itemx pentium
21942 Intel Pentium CPU with no MMX support.
21944 @item pentium-mmx
21945 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
21947 @item pentiumpro
21948 Intel Pentium Pro CPU@.
21950 @item i686
21951 When used with @option{-march}, the Pentium Pro
21952 instruction set is used, so the code runs on all i686 family chips.
21953 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
21955 @item pentium2
21956 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
21957 support.
21959 @item pentium3
21960 @itemx pentium3m
21961 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
21962 set support.
21964 @item pentium-m
21965 Intel Pentium M; low-power version of Intel Pentium III CPU
21966 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
21968 @item pentium4
21969 @itemx pentium4m
21970 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
21972 @item prescott
21973 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
21974 set support.
21976 @item nocona
21977 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
21978 SSE2 and SSE3 instruction set support.
21980 @item core2
21981 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
21982 instruction set support.
21984 @item nehalem
21985 Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
21986 SSE4.1, SSE4.2 and POPCNT instruction set support.
21988 @item westmere
21989 Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
21990 SSE4.1, SSE4.2, POPCNT, AES and PCLMUL instruction set support.
21992 @item sandybridge
21993 Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
21994 SSE4.1, SSE4.2, POPCNT, AVX, AES and PCLMUL instruction set support.
21996 @item ivybridge
21997 Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
21998 SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C
21999 instruction set support.
22001 @item haswell
22002 Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
22003 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
22004 BMI, BMI2 and F16C instruction set support.
22006 @item broadwell
22007 Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
22008 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
22009 BMI, BMI2, F16C, RDSEED, ADCX and PREFETCHW instruction set support.
22011 @item bonnell
22012 Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
22013 instruction set support.
22015 @item silvermont
22016 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
22017 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL and RDRND instruction set support.
22019 @item knl
22020 Intel Knight's Landing CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
22021 SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
22022 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER and
22023 AVX512CD instruction set support.
22025 @item k6
22026 AMD K6 CPU with MMX instruction set support.
22028 @item k6-2
22029 @itemx k6-3
22030 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
22032 @item athlon
22033 @itemx athlon-tbird
22034 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
22035 support.
22037 @item athlon-4
22038 @itemx athlon-xp
22039 @itemx athlon-mp
22040 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
22041 instruction set support.
22043 @item k8
22044 @itemx opteron
22045 @itemx athlon64
22046 @itemx athlon-fx
22047 Processors based on the AMD K8 core with x86-64 instruction set support,
22048 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
22049 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
22050 instruction set extensions.)
22052 @item k8-sse3
22053 @itemx opteron-sse3
22054 @itemx athlon64-sse3
22055 Improved versions of AMD K8 cores with SSE3 instruction set support.
22057 @item amdfam10
22058 @itemx barcelona
22059 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
22060 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
22061 instruction set extensions.)
22063 @item bdver1
22064 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
22065 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
22066 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
22067 @item bdver2
22068 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
22069 supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX,
22070 SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
22071 extensions.)
22072 @item bdver3
22073 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
22074 supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, XOP, LWP, AES, 
22075 PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 
22076 64-bit instruction set extensions.
22077 @item bdver4
22078 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
22079 supersets BMI, BMI2, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, AVX2, XOP, LWP, 
22080 AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, 
22081 SSE4.2, ABM and 64-bit instruction set extensions.
22083 @item btver1
22084 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
22085 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
22086 instruction set extensions.)
22088 @item btver2
22089 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
22090 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
22091 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
22093 @item winchip-c6
22094 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
22095 set support.
22097 @item winchip2
22098 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
22099 instruction set support.
22101 @item c3
22102 VIA C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
22103 implemented for this chip.)
22105 @item c3-2
22106 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
22107 (No scheduling is
22108 implemented for this chip.)
22110 @item geode
22111 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
22112 @end table
22114 @item -mtune=@var{cpu-type}
22115 @opindex mtune
22116 Tune to @var{cpu-type} everything applicable about the generated code, except
22117 for the ABI and the set of available instructions.  
22118 While picking a specific @var{cpu-type} schedules things appropriately
22119 for that particular chip, the compiler does not generate any code that
22120 cannot run on the default machine type unless you use a
22121 @option{-march=@var{cpu-type}} option.
22122 For example, if GCC is configured for i686-pc-linux-gnu
22123 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
22124 but still runs on i686 machines.
22126 The choices for @var{cpu-type} are the same as for @option{-march}.
22127 In addition, @option{-mtune} supports 2 extra choices for @var{cpu-type}:
22129 @table @samp
22130 @item generic
22131 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
22132 If you know the CPU on which your code will run, then you should use
22133 the corresponding @option{-mtune} or @option{-march} option instead of
22134 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
22135 of your application will have, then you should use this option.
22137 As new processors are deployed in the marketplace, the behavior of this
22138 option will change.  Therefore, if you upgrade to a newer version of
22139 GCC, code generation controlled by this option will change to reflect
22140 the processors
22141 that are most common at the time that version of GCC is released.
22143 There is no @option{-march=generic} option because @option{-march}
22144 indicates the instruction set the compiler can use, and there is no
22145 generic instruction set applicable to all processors.  In contrast,
22146 @option{-mtune} indicates the processor (or, in this case, collection of
22147 processors) for which the code is optimized.
22149 @item intel
22150 Produce code optimized for the most current Intel processors, which are
22151 Haswell and Silvermont for this version of GCC.  If you know the CPU
22152 on which your code will run, then you should use the corresponding
22153 @option{-mtune} or @option{-march} option instead of @option{-mtune=intel}.
22154 But, if you want your application performs better on both Haswell and
22155 Silvermont, then you should use this option.
22157 As new Intel processors are deployed in the marketplace, the behavior of
22158 this option will change.  Therefore, if you upgrade to a newer version of
22159 GCC, code generation controlled by this option will change to reflect
22160 the most current Intel processors at the time that version of GCC is
22161 released.
22163 There is no @option{-march=intel} option because @option{-march} indicates
22164 the instruction set the compiler can use, and there is no common
22165 instruction set applicable to all processors.  In contrast,
22166 @option{-mtune} indicates the processor (or, in this case, collection of
22167 processors) for which the code is optimized.
22168 @end table
22170 @item -mcpu=@var{cpu-type}
22171 @opindex mcpu
22172 A deprecated synonym for @option{-mtune}.
22174 @item -mfpmath=@var{unit}
22175 @opindex mfpmath
22176 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
22177 for @var{unit} are:
22179 @table @samp
22180 @item 387
22181 Use the standard 387 floating-point coprocessor present on the majority of chips and
22182 emulated otherwise.  Code compiled with this option runs almost everywhere.
22183 The temporary results are computed in 80-bit precision instead of the precision
22184 specified by the type, resulting in slightly different results compared to most
22185 of other chips.  See @option{-ffloat-store} for more detailed description.
22187 This is the default choice for x86-32 targets.
22189 @item sse
22190 Use scalar floating-point instructions present in the SSE instruction set.
22191 This instruction set is supported by Pentium III and newer chips,
22192 and in the AMD line
22193 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
22194 instruction set supports only single-precision arithmetic, thus the double and
22195 extended-precision arithmetic are still done using 387.  A later version, present
22196 only in Pentium 4 and AMD x86-64 chips, supports double-precision
22197 arithmetic too.
22199 For the x86-32 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
22200 or @option{-msse2} switches to enable SSE extensions and make this option
22201 effective.  For the x86-64 compiler, these extensions are enabled by default.
22203 The resulting code should be considerably faster in the majority of cases and avoid
22204 the numerical instability problems of 387 code, but may break some existing
22205 code that expects temporaries to be 80 bits.
22207 This is the default choice for the x86-64 compiler.
22209 @item sse,387
22210 @itemx sse+387
22211 @itemx both
22212 Attempt to utilize both instruction sets at once.  This effectively doubles the
22213 amount of available registers, and on chips with separate execution units for
22214 387 and SSE the execution resources too.  Use this option with care, as it is
22215 still experimental, because the GCC register allocator does not model separate
22216 functional units well, resulting in unstable performance.
22217 @end table
22219 @item -masm=@var{dialect}
22220 @opindex masm=@var{dialect}
22221 Output assembly instructions using selected @var{dialect}.  Also affects
22222 which dialect is used for basic @code{asm} (@pxref{Basic Asm}) and
22223 extended @code{asm} (@pxref{Extended Asm}). Supported choices (in dialect
22224 order) are @samp{att} or @samp{intel}. The default is @samp{att}. Darwin does
22225 not support @samp{intel}.
22227 @item -mieee-fp
22228 @itemx -mno-ieee-fp
22229 @opindex mieee-fp
22230 @opindex mno-ieee-fp
22231 Control whether or not the compiler uses IEEE floating-point
22232 comparisons.  These correctly handle the case where the result of a
22233 comparison is unordered.
22235 @item -msoft-float
22236 @opindex msoft-float
22237 Generate output containing library calls for floating point.
22239 @strong{Warning:} the requisite libraries are not part of GCC@.
22240 Normally the facilities of the machine's usual C compiler are used, but
22241 this can't be done directly in cross-compilation.  You must make your
22242 own arrangements to provide suitable library functions for
22243 cross-compilation.
22245 On machines where a function returns floating-point results in the 80387
22246 register stack, some floating-point opcodes may be emitted even if
22247 @option{-msoft-float} is used.
22249 @item -mno-fp-ret-in-387
22250 @opindex mno-fp-ret-in-387
22251 Do not use the FPU registers for return values of functions.
22253 The usual calling convention has functions return values of types
22254 @code{float} and @code{double} in an FPU register, even if there
22255 is no FPU@.  The idea is that the operating system should emulate
22256 an FPU@.
22258 The option @option{-mno-fp-ret-in-387} causes such values to be returned
22259 in ordinary CPU registers instead.
22261 @item -mno-fancy-math-387
22262 @opindex mno-fancy-math-387
22263 Some 387 emulators do not support the @code{sin}, @code{cos} and
22264 @code{sqrt} instructions for the 387.  Specify this option to avoid
22265 generating those instructions.  This option is the default on FreeBSD,
22266 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
22267 indicates that the target CPU always has an FPU and so the
22268 instruction does not need emulation.  These
22269 instructions are not generated unless you also use the
22270 @option{-funsafe-math-optimizations} switch.
22272 @item -malign-double
22273 @itemx -mno-align-double
22274 @opindex malign-double
22275 @opindex mno-align-double
22276 Control whether GCC aligns @code{double}, @code{long double}, and
22277 @code{long long} variables on a two-word boundary or a one-word
22278 boundary.  Aligning @code{double} variables on a two-word boundary
22279 produces code that runs somewhat faster on a Pentium at the
22280 expense of more memory.
22282 On x86-64, @option{-malign-double} is enabled by default.
22284 @strong{Warning:} if you use the @option{-malign-double} switch,
22285 structures containing the above types are aligned differently than
22286 the published application binary interface specifications for the x86-32
22287 and are not binary compatible with structures in code compiled
22288 without that switch.
22290 @item -m96bit-long-double
22291 @itemx -m128bit-long-double
22292 @opindex m96bit-long-double
22293 @opindex m128bit-long-double
22294 These switches control the size of @code{long double} type.  The x86-32
22295 application binary interface specifies the size to be 96 bits,
22296 so @option{-m96bit-long-double} is the default in 32-bit mode.
22298 Modern architectures (Pentium and newer) prefer @code{long double}
22299 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
22300 conforming to the ABI, this is not possible.  So specifying
22301 @option{-m128bit-long-double} aligns @code{long double}
22302 to a 16-byte boundary by padding the @code{long double} with an additional
22303 32-bit zero.
22305 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
22306 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
22308 Notice that neither of these options enable any extra precision over the x87
22309 standard of 80 bits for a @code{long double}.
22311 @strong{Warning:} if you override the default value for your target ABI, this
22312 changes the size of 
22313 structures and arrays containing @code{long double} variables,
22314 as well as modifying the function calling convention for functions taking
22315 @code{long double}.  Hence they are not binary-compatible
22316 with code compiled without that switch.
22318 @item -mlong-double-64
22319 @itemx -mlong-double-80
22320 @itemx -mlong-double-128
22321 @opindex mlong-double-64
22322 @opindex mlong-double-80
22323 @opindex mlong-double-128
22324 These switches control the size of @code{long double} type. A size
22325 of 64 bits makes the @code{long double} type equivalent to the @code{double}
22326 type. This is the default for 32-bit Bionic C library.  A size
22327 of 128 bits makes the @code{long double} type equivalent to the
22328 @code{__float128} type. This is the default for 64-bit Bionic C library.
22330 @strong{Warning:} if you override the default value for your target ABI, this
22331 changes the size of
22332 structures and arrays containing @code{long double} variables,
22333 as well as modifying the function calling convention for functions taking
22334 @code{long double}.  Hence they are not binary-compatible
22335 with code compiled without that switch.
22337 @item -malign-data=@var{type}
22338 @opindex malign-data
22339 Control how GCC aligns variables.  Supported values for @var{type} are
22340 @samp{compat} uses increased alignment value compatible uses GCC 4.8
22341 and earlier, @samp{abi} uses alignment value as specified by the
22342 psABI, and @samp{cacheline} uses increased alignment value to match
22343 the cache line size.  @samp{compat} is the default.
22345 @item -mlarge-data-threshold=@var{threshold}
22346 @opindex mlarge-data-threshold
22347 When @option{-mcmodel=medium} is specified, data objects larger than
22348 @var{threshold} are placed in the large data section.  This value must be the
22349 same across all objects linked into the binary, and defaults to 65535.
22351 @item -mrtd
22352 @opindex mrtd
22353 Use a different function-calling convention, in which functions that
22354 take a fixed number of arguments return with the @code{ret @var{num}}
22355 instruction, which pops their arguments while returning.  This saves one
22356 instruction in the caller since there is no need to pop the arguments
22357 there.
22359 You can specify that an individual function is called with this calling
22360 sequence with the function attribute @code{stdcall}.  You can also
22361 override the @option{-mrtd} option by using the function attribute
22362 @code{cdecl}.  @xref{Function Attributes}.
22364 @strong{Warning:} this calling convention is incompatible with the one
22365 normally used on Unix, so you cannot use it if you need to call
22366 libraries compiled with the Unix compiler.
22368 Also, you must provide function prototypes for all functions that
22369 take variable numbers of arguments (including @code{printf});
22370 otherwise incorrect code is generated for calls to those
22371 functions.
22373 In addition, seriously incorrect code results if you call a
22374 function with too many arguments.  (Normally, extra arguments are
22375 harmlessly ignored.)
22377 @item -mregparm=@var{num}
22378 @opindex mregparm
22379 Control how many registers are used to pass integer arguments.  By
22380 default, no registers are used to pass arguments, and at most 3
22381 registers can be used.  You can control this behavior for a specific
22382 function by using the function attribute @code{regparm}.
22383 @xref{Function Attributes}.
22385 @strong{Warning:} if you use this switch, and
22386 @var{num} is nonzero, then you must build all modules with the same
22387 value, including any libraries.  This includes the system libraries and
22388 startup modules.
22390 @item -msseregparm
22391 @opindex msseregparm
22392 Use SSE register passing conventions for float and double arguments
22393 and return values.  You can control this behavior for a specific
22394 function by using the function attribute @code{sseregparm}.
22395 @xref{Function Attributes}.
22397 @strong{Warning:} if you use this switch then you must build all
22398 modules with the same value, including any libraries.  This includes
22399 the system libraries and startup modules.
22401 @item -mvect8-ret-in-mem
22402 @opindex mvect8-ret-in-mem
22403 Return 8-byte vectors in memory instead of MMX registers.  This is the
22404 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
22405 Studio compilers until version 12.  Later compiler versions (starting
22406 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
22407 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
22408 you need to remain compatible with existing code produced by those
22409 previous compiler versions or older versions of GCC@.
22411 @item -mpc32
22412 @itemx -mpc64
22413 @itemx -mpc80
22414 @opindex mpc32
22415 @opindex mpc64
22416 @opindex mpc80
22418 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
22419 is specified, the significands of results of floating-point operations are
22420 rounded to 24 bits (single precision); @option{-mpc64} rounds the
22421 significands of results of floating-point operations to 53 bits (double
22422 precision) and @option{-mpc80} rounds the significands of results of
22423 floating-point operations to 64 bits (extended double precision), which is
22424 the default.  When this option is used, floating-point operations in higher
22425 precisions are not available to the programmer without setting the FPU
22426 control word explicitly.
22428 Setting the rounding of floating-point operations to less than the default
22429 80 bits can speed some programs by 2% or more.  Note that some mathematical
22430 libraries assume that extended-precision (80-bit) floating-point operations
22431 are enabled by default; routines in such libraries could suffer significant
22432 loss of accuracy, typically through so-called ``catastrophic cancellation'',
22433 when this option is used to set the precision to less than extended precision.
22435 @item -mstackrealign
22436 @opindex mstackrealign
22437 Realign the stack at entry.  On the x86, the @option{-mstackrealign}
22438 option generates an alternate prologue and epilogue that realigns the
22439 run-time stack if necessary.  This supports mixing legacy codes that keep
22440 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
22441 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
22442 applicable to individual functions.
22444 @item -mpreferred-stack-boundary=@var{num}
22445 @opindex mpreferred-stack-boundary
22446 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
22447 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
22448 the default is 4 (16 bytes or 128 bits).
22450 @strong{Warning:} When generating code for the x86-64 architecture with
22451 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
22452 used to keep the stack boundary aligned to 8 byte boundary.  Since
22453 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
22454 intended to be used in controlled environment where stack space is
22455 important limitation.  This option leads to wrong code when functions
22456 compiled with 16 byte stack alignment (such as functions from a standard
22457 library) are called with misaligned stack.  In this case, SSE
22458 instructions may lead to misaligned memory access traps.  In addition,
22459 variable arguments are handled incorrectly for 16 byte aligned
22460 objects (including x87 long double and __int128), leading to wrong
22461 results.  You must build all modules with
22462 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
22463 includes the system libraries and startup modules.
22465 @item -mincoming-stack-boundary=@var{num}
22466 @opindex mincoming-stack-boundary
22467 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
22468 boundary.  If @option{-mincoming-stack-boundary} is not specified,
22469 the one specified by @option{-mpreferred-stack-boundary} is used.
22471 On Pentium and Pentium Pro, @code{double} and @code{long double} values
22472 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
22473 suffer significant run time performance penalties.  On Pentium III, the
22474 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
22475 properly if it is not 16-byte aligned.
22477 To ensure proper alignment of this values on the stack, the stack boundary
22478 must be as aligned as that required by any value stored on the stack.
22479 Further, every function must be generated such that it keeps the stack
22480 aligned.  Thus calling a function compiled with a higher preferred
22481 stack boundary from a function compiled with a lower preferred stack
22482 boundary most likely misaligns the stack.  It is recommended that
22483 libraries that use callbacks always use the default setting.
22485 This extra alignment does consume extra stack space, and generally
22486 increases code size.  Code that is sensitive to stack space usage, such
22487 as embedded systems and operating system kernels, may want to reduce the
22488 preferred alignment to @option{-mpreferred-stack-boundary=2}.
22490 @need 200
22491 @item -mmmx
22492 @opindex mmmx
22493 @need 200
22494 @itemx -msse
22495 @opindex msse
22496 @need 200
22497 @itemx -msse2
22498 @need 200
22499 @itemx -msse3
22500 @need 200
22501 @itemx -mssse3
22502 @need 200
22503 @itemx -msse4
22504 @need 200
22505 @itemx -msse4a
22506 @need 200
22507 @itemx -msse4.1
22508 @need 200
22509 @itemx -msse4.2
22510 @need 200
22511 @itemx -mavx
22512 @opindex mavx
22513 @need 200
22514 @itemx -mavx2
22515 @need 200
22516 @itemx -mavx512f
22517 @need 200
22518 @itemx -mavx512pf
22519 @need 200
22520 @itemx -mavx512er
22521 @need 200
22522 @itemx -mavx512cd
22523 @need 200
22524 @itemx -msha
22525 @opindex msha
22526 @need 200
22527 @itemx -maes
22528 @opindex maes
22529 @need 200
22530 @itemx -mpclmul
22531 @opindex mpclmul
22532 @need 200
22533 @itemx -mclfushopt
22534 @opindex mclfushopt
22535 @need 200
22536 @itemx -mfsgsbase
22537 @opindex mfsgsbase
22538 @need 200
22539 @itemx -mrdrnd
22540 @opindex mrdrnd
22541 @need 200
22542 @itemx -mf16c
22543 @opindex mf16c
22544 @need 200
22545 @itemx -mfma
22546 @opindex mfma
22547 @need 200
22548 @itemx -mfma4
22549 @need 200
22550 @itemx -mno-fma4
22551 @need 200
22552 @itemx -mprefetchwt1
22553 @opindex mprefetchwt1
22554 @need 200
22555 @itemx -mxop
22556 @opindex mxop
22557 @need 200
22558 @itemx -mlwp
22559 @opindex mlwp
22560 @need 200
22561 @itemx -m3dnow
22562 @opindex m3dnow
22563 @need 200
22564 @itemx -mpopcnt
22565 @opindex mpopcnt
22566 @need 200
22567 @itemx -mabm
22568 @opindex mabm
22569 @need 200
22570 @itemx -mbmi
22571 @opindex mbmi
22572 @need 200
22573 @itemx -mbmi2
22574 @need 200
22575 @itemx -mlzcnt
22576 @opindex mlzcnt
22577 @need 200
22578 @itemx -mfxsr
22579 @opindex mfxsr
22580 @need 200
22581 @itemx -mxsave
22582 @opindex mxsave
22583 @need 200
22584 @itemx -mxsaveopt
22585 @opindex mxsaveopt
22586 @need 200
22587 @itemx -mxsavec
22588 @opindex mxsavec
22589 @need 200
22590 @itemx -mxsaves
22591 @opindex mxsaves
22592 @need 200
22593 @itemx -mrtm
22594 @opindex mrtm
22595 @need 200
22596 @itemx -mtbm
22597 @opindex mtbm
22598 @need 200
22599 @itemx -mmpx
22600 @opindex mmpx
22601 These switches enable the use of instructions in the MMX, SSE,
22602 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER, AVX512CD,
22603 SHA, AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A, FMA4, XOP, LWP, ABM,
22604 BMI, BMI2, FXSR, XSAVE, XSAVEOPT, LZCNT, RTM, MPX or 3DNow!@:
22605 extended instruction sets.  Each has a corresponding @option{-mno-} option
22606 to disable use of these instructions.
22608 These extensions are also available as built-in functions: see
22609 @ref{x86 Built-in Functions}, for details of the functions enabled and
22610 disabled by these switches.
22612 To generate SSE/SSE2 instructions automatically from floating-point
22613 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
22615 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
22616 generates new AVX instructions or AVX equivalence for all SSEx instructions
22617 when needed.
22619 These options enable GCC to use these extended instructions in
22620 generated code, even without @option{-mfpmath=sse}.  Applications that
22621 perform run-time CPU detection must compile separate files for each
22622 supported architecture, using the appropriate flags.  In particular,
22623 the file containing the CPU detection code should be compiled without
22624 these options.
22626 @item -mdump-tune-features
22627 @opindex mdump-tune-features
22628 This option instructs GCC to dump the names of the x86 performance 
22629 tuning features and default settings. The names can be used in 
22630 @option{-mtune-ctrl=@var{feature-list}}.
22632 @item -mtune-ctrl=@var{feature-list}
22633 @opindex mtune-ctrl=@var{feature-list}
22634 This option is used to do fine grain control of x86 code generation features.
22635 @var{feature-list} is a comma separated list of @var{feature} names. See also
22636 @option{-mdump-tune-features}. When specified, the @var{feature} is turned
22637 on if it is not preceded with @samp{^}, otherwise, it is turned off. 
22638 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
22639 developers. Using it may lead to code paths not covered by testing and can
22640 potentially result in compiler ICEs or runtime errors.
22642 @item -mno-default
22643 @opindex mno-default
22644 This option instructs GCC to turn off all tunable features. See also 
22645 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
22647 @item -mcld
22648 @opindex mcld
22649 This option instructs GCC to emit a @code{cld} instruction in the prologue
22650 of functions that use string instructions.  String instructions depend on
22651 the DF flag to select between autoincrement or autodecrement mode.  While the
22652 ABI specifies the DF flag to be cleared on function entry, some operating
22653 systems violate this specification by not clearing the DF flag in their
22654 exception dispatchers.  The exception handler can be invoked with the DF flag
22655 set, which leads to wrong direction mode when string instructions are used.
22656 This option can be enabled by default on 32-bit x86 targets by configuring
22657 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
22658 instructions can be suppressed with the @option{-mno-cld} compiler option
22659 in this case.
22661 @item -mvzeroupper
22662 @opindex mvzeroupper
22663 This option instructs GCC to emit a @code{vzeroupper} instruction
22664 before a transfer of control flow out of the function to minimize
22665 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
22666 intrinsics.
22668 @item -mprefer-avx128
22669 @opindex mprefer-avx128
22670 This option instructs GCC to use 128-bit AVX instructions instead of
22671 256-bit AVX instructions in the auto-vectorizer.
22673 @item -mcx16
22674 @opindex mcx16
22675 This option enables GCC to generate @code{CMPXCHG16B} instructions.
22676 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
22677 (or oword) data types.  
22678 This is useful for high-resolution counters that can be updated
22679 by multiple processors (or cores).  This instruction is generated as part of
22680 atomic built-in functions: see @ref{__sync Builtins} or
22681 @ref{__atomic Builtins} for details.
22683 @item -msahf
22684 @opindex msahf
22685 This option enables generation of @code{SAHF} instructions in 64-bit code.
22686 Early Intel Pentium 4 CPUs with Intel 64 support,
22687 prior to the introduction of Pentium 4 G1 step in December 2005,
22688 lacked the @code{LAHF} and @code{SAHF} instructions
22689 which are supported by AMD64.
22690 These are load and store instructions, respectively, for certain status flags.
22691 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
22692 @code{drem}, and @code{remainder} built-in functions;
22693 see @ref{Other Builtins} for details.
22695 @item -mmovbe
22696 @opindex mmovbe
22697 This option enables use of the @code{movbe} instruction to implement
22698 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
22700 @item -mcrc32
22701 @opindex mcrc32
22702 This option enables built-in functions @code{__builtin_ia32_crc32qi},
22703 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
22704 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
22706 @item -mrecip
22707 @opindex mrecip
22708 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
22709 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
22710 with an additional Newton-Raphson step
22711 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
22712 (and their vectorized
22713 variants) for single-precision floating-point arguments.  These instructions
22714 are generated only when @option{-funsafe-math-optimizations} is enabled
22715 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
22716 Note that while the throughput of the sequence is higher than the throughput
22717 of the non-reciprocal instruction, the precision of the sequence can be
22718 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
22720 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
22721 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
22722 combination), and doesn't need @option{-mrecip}.
22724 Also note that GCC emits the above sequence with additional Newton-Raphson step
22725 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
22726 already with @option{-ffast-math} (or the above option combination), and
22727 doesn't need @option{-mrecip}.
22729 @item -mrecip=@var{opt}
22730 @opindex mrecip=opt
22731 This option controls which reciprocal estimate instructions
22732 may be used.  @var{opt} is a comma-separated list of options, which may
22733 be preceded by a @samp{!} to invert the option:
22735 @table @samp
22736 @item all
22737 Enable all estimate instructions.
22739 @item default
22740 Enable the default instructions, equivalent to @option{-mrecip}.
22742 @item none
22743 Disable all estimate instructions, equivalent to @option{-mno-recip}.
22745 @item div
22746 Enable the approximation for scalar division.
22748 @item vec-div
22749 Enable the approximation for vectorized division.
22751 @item sqrt
22752 Enable the approximation for scalar square root.
22754 @item vec-sqrt
22755 Enable the approximation for vectorized square root.
22756 @end table
22758 So, for example, @option{-mrecip=all,!sqrt} enables
22759 all of the reciprocal approximations, except for square root.
22761 @item -mveclibabi=@var{type}
22762 @opindex mveclibabi
22763 Specifies the ABI type to use for vectorizing intrinsics using an
22764 external library.  Supported values for @var{type} are @samp{svml} 
22765 for the Intel short
22766 vector math library and @samp{acml} for the AMD math core library.
22767 To use this option, both @option{-ftree-vectorize} and
22768 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
22769 ABI-compatible library must be specified at link time.
22771 GCC currently emits calls to @code{vmldExp2},
22772 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
22773 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
22774 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
22775 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
22776 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
22777 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
22778 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
22779 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
22780 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
22781 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
22782 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
22783 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
22784 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
22785 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
22786 when @option{-mveclibabi=acml} is used.  
22788 @item -mabi=@var{name}
22789 @opindex mabi
22790 Generate code for the specified calling convention.  Permissible values
22791 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
22792 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
22793 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
22794 You can control this behavior for specific functions by
22795 using the function attributes @code{ms_abi} and @code{sysv_abi}.
22796 @xref{Function Attributes}.
22798 @item -mtls-dialect=@var{type}
22799 @opindex mtls-dialect
22800 Generate code to access thread-local storage using the @samp{gnu} or
22801 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
22802 @samp{gnu2} is more efficient, but it may add compile- and run-time
22803 requirements that cannot be satisfied on all systems.
22805 @item -mpush-args
22806 @itemx -mno-push-args
22807 @opindex mpush-args
22808 @opindex mno-push-args
22809 Use PUSH operations to store outgoing parameters.  This method is shorter
22810 and usually equally fast as method using SUB/MOV operations and is enabled
22811 by default.  In some cases disabling it may improve performance because of
22812 improved scheduling and reduced dependencies.
22814 @item -maccumulate-outgoing-args
22815 @opindex maccumulate-outgoing-args
22816 If enabled, the maximum amount of space required for outgoing arguments is
22817 computed in the function prologue.  This is faster on most modern CPUs
22818 because of reduced dependencies, improved scheduling and reduced stack usage
22819 when the preferred stack boundary is not equal to 2.  The drawback is a notable
22820 increase in code size.  This switch implies @option{-mno-push-args}.
22822 @item -mthreads
22823 @opindex mthreads
22824 Support thread-safe exception handling on MinGW.  Programs that rely
22825 on thread-safe exception handling must compile and link all code with the
22826 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
22827 @option{-D_MT}; when linking, it links in a special thread helper library
22828 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
22830 @item -mno-align-stringops
22831 @opindex mno-align-stringops
22832 Do not align the destination of inlined string operations.  This switch reduces
22833 code size and improves performance in case the destination is already aligned,
22834 but GCC doesn't know about it.
22836 @item -minline-all-stringops
22837 @opindex minline-all-stringops
22838 By default GCC inlines string operations only when the destination is 
22839 known to be aligned to least a 4-byte boundary.  
22840 This enables more inlining and increases code
22841 size, but may improve performance of code that depends on fast
22842 @code{memcpy}, @code{strlen},
22843 and @code{memset} for short lengths.
22845 @item -minline-stringops-dynamically
22846 @opindex minline-stringops-dynamically
22847 For string operations of unknown size, use run-time checks with
22848 inline code for small blocks and a library call for large blocks.
22850 @item -mstringop-strategy=@var{alg}
22851 @opindex mstringop-strategy=@var{alg}
22852 Override the internal decision heuristic for the particular algorithm to use
22853 for inlining string operations.  The allowed values for @var{alg} are:
22855 @table @samp
22856 @item rep_byte
22857 @itemx rep_4byte
22858 @itemx rep_8byte
22859 Expand using i386 @code{rep} prefix of the specified size.
22861 @item byte_loop
22862 @itemx loop
22863 @itemx unrolled_loop
22864 Expand into an inline loop.
22866 @item libcall
22867 Always use a library call.
22868 @end table
22870 @item -mmemcpy-strategy=@var{strategy}
22871 @opindex mmemcpy-strategy=@var{strategy}
22872 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
22873 should be inlined and what inline algorithm to use when the expected size
22874 of the copy operation is known. @var{strategy} 
22875 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
22876 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
22877 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
22878 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
22879 in the list must be specified in increasing order.  The minimal byte size for 
22880 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
22881 preceding range.
22883 @item -mmemset-strategy=@var{strategy}
22884 @opindex mmemset-strategy=@var{strategy}
22885 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
22886 @code{__builtin_memset} expansion.
22888 @item -momit-leaf-frame-pointer
22889 @opindex momit-leaf-frame-pointer
22890 Don't keep the frame pointer in a register for leaf functions.  This
22891 avoids the instructions to save, set up, and restore frame pointers and
22892 makes an extra register available in leaf functions.  The option
22893 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
22894 which might make debugging harder.
22896 @item -mtls-direct-seg-refs
22897 @itemx -mno-tls-direct-seg-refs
22898 @opindex mtls-direct-seg-refs
22899 Controls whether TLS variables may be accessed with offsets from the
22900 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
22901 or whether the thread base pointer must be added.  Whether or not this
22902 is valid depends on the operating system, and whether it maps the
22903 segment to cover the entire TLS area.
22905 For systems that use the GNU C Library, the default is on.
22907 @item -msse2avx
22908 @itemx -mno-sse2avx
22909 @opindex msse2avx
22910 Specify that the assembler should encode SSE instructions with VEX
22911 prefix.  The option @option{-mavx} turns this on by default.
22913 @item -mfentry
22914 @itemx -mno-fentry
22915 @opindex mfentry
22916 If profiling is active (@option{-pg}), put the profiling
22917 counter call before the prologue.
22918 Note: On x86 architectures the attribute @code{ms_hook_prologue}
22919 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
22921 @item -mrecord-mcount
22922 @itemx -mno-record-mcount
22923 @opindex mrecord-mcount
22924 If profiling is active (@option{-pg}), generate a __mcount_loc section
22925 that contains pointers to each profiling call. This is useful for
22926 automatically patching and out calls.
22928 @item -mnop-mcount
22929 @itemx -mno-nop-mcount
22930 @opindex mnop-mcount
22931 If profiling is active (@option{-pg}), generate the calls to
22932 the profiling functions as nops. This is useful when they
22933 should be patched in later dynamically. This is likely only
22934 useful together with @option{-mrecord-mcount}.
22936 @item -mskip-rax-setup
22937 @itemx -mno-skip-rax-setup
22938 @opindex mskip-rax-setup
22939 When generating code for the x86-64 architecture with SSE extensions
22940 disabled, @option{-skip-rax-setup} can be used to skip setting up RAX
22941 register when there are no variable arguments passed in vector registers.
22943 @strong{Warning:} Since RAX register is used to avoid unnecessarily
22944 saving vector registers on stack when passing variable arguments, the
22945 impacts of this option are callees may waste some stack space,
22946 misbehave or jump to a random location.  GCC 4.4 or newer don't have
22947 those issues, regardless the RAX register value.
22949 @item -m8bit-idiv
22950 @itemx -mno-8bit-idiv
22951 @opindex m8bit-idiv
22952 On some processors, like Intel Atom, 8-bit unsigned integer divide is
22953 much faster than 32-bit/64-bit integer divide.  This option generates a
22954 run-time check.  If both dividend and divisor are within range of 0
22955 to 255, 8-bit unsigned integer divide is used instead of
22956 32-bit/64-bit integer divide.
22958 @item -mavx256-split-unaligned-load
22959 @itemx -mavx256-split-unaligned-store
22960 @opindex mavx256-split-unaligned-load
22961 @opindex mavx256-split-unaligned-store
22962 Split 32-byte AVX unaligned load and store.
22964 @item -mstack-protector-guard=@var{guard}
22965 @opindex mstack-protector-guard=@var{guard}
22966 Generate stack protection code using canary at @var{guard}.  Supported
22967 locations are @samp{global} for global canary or @samp{tls} for per-thread
22968 canary in the TLS block (the default).  This option has effect only when
22969 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
22971 @end table
22973 These @samp{-m} switches are supported in addition to the above
22974 on x86-64 processors in 64-bit environments.
22976 @table @gcctabopt
22977 @item -m32
22978 @itemx -m64
22979 @itemx -mx32
22980 @itemx -m16
22981 @opindex m32
22982 @opindex m64
22983 @opindex mx32
22984 @opindex m16
22985 Generate code for a 16-bit, 32-bit or 64-bit environment.
22986 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
22987 to 32 bits, and
22988 generates code that runs on any i386 system.
22990 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
22991 types to 64 bits, and generates code for the x86-64 architecture.
22992 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
22993 and @option{-mdynamic-no-pic} options.
22995 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
22996 to 32 bits, and
22997 generates code for the x86-64 architecture.
22999 The @option{-m16} option is the same as @option{-m32}, except for that
23000 it outputs the @code{.code16gcc} assembly directive at the beginning of
23001 the assembly output so that the binary can run in 16-bit mode.
23003 @item -mno-red-zone
23004 @opindex mno-red-zone
23005 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
23006 by the x86-64 ABI; it is a 128-byte area beyond the location of the
23007 stack pointer that is not modified by signal or interrupt handlers
23008 and therefore can be used for temporary data without adjusting the stack
23009 pointer.  The flag @option{-mno-red-zone} disables this red zone.
23011 @item -mcmodel=small
23012 @opindex mcmodel=small
23013 Generate code for the small code model: the program and its symbols must
23014 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
23015 Programs can be statically or dynamically linked.  This is the default
23016 code model.
23018 @item -mcmodel=kernel
23019 @opindex mcmodel=kernel
23020 Generate code for the kernel code model.  The kernel runs in the
23021 negative 2 GB of the address space.
23022 This model has to be used for Linux kernel code.
23024 @item -mcmodel=medium
23025 @opindex mcmodel=medium
23026 Generate code for the medium model: the program is linked in the lower 2
23027 GB of the address space.  Small symbols are also placed there.  Symbols
23028 with sizes larger than @option{-mlarge-data-threshold} are put into
23029 large data or BSS sections and can be located above 2GB.  Programs can
23030 be statically or dynamically linked.
23032 @item -mcmodel=large
23033 @opindex mcmodel=large
23034 Generate code for the large model.  This model makes no assumptions
23035 about addresses and sizes of sections.
23037 @item -maddress-mode=long
23038 @opindex maddress-mode=long
23039 Generate code for long address mode.  This is only supported for 64-bit
23040 and x32 environments.  It is the default address mode for 64-bit
23041 environments.
23043 @item -maddress-mode=short
23044 @opindex maddress-mode=short
23045 Generate code for short address mode.  This is only supported for 32-bit
23046 and x32 environments.  It is the default address mode for 32-bit and
23047 x32 environments.
23048 @end table
23050 @node x86 Windows Options
23051 @subsection x86 Windows Options
23052 @cindex x86 Windows Options
23053 @cindex Windows Options for x86
23055 These additional options are available for Microsoft Windows targets:
23057 @table @gcctabopt
23058 @item -mconsole
23059 @opindex mconsole
23060 This option
23061 specifies that a console application is to be generated, by
23062 instructing the linker to set the PE header subsystem type
23063 required for console applications.
23064 This option is available for Cygwin and MinGW targets and is
23065 enabled by default on those targets.
23067 @item -mdll
23068 @opindex mdll
23069 This option is available for Cygwin and MinGW targets.  It
23070 specifies that a DLL---a dynamic link library---is to be
23071 generated, enabling the selection of the required runtime
23072 startup object and entry point.
23074 @item -mnop-fun-dllimport
23075 @opindex mnop-fun-dllimport
23076 This option is available for Cygwin and MinGW targets.  It
23077 specifies that the @code{dllimport} attribute should be ignored.
23079 @item -mthread
23080 @opindex mthread
23081 This option is available for MinGW targets. It specifies
23082 that MinGW-specific thread support is to be used.
23084 @item -municode
23085 @opindex municode
23086 This option is available for MinGW-w64 targets.  It causes
23087 the @code{UNICODE} preprocessor macro to be predefined, and
23088 chooses Unicode-capable runtime startup code.
23090 @item -mwin32
23091 @opindex mwin32
23092 This option is available for Cygwin and MinGW targets.  It
23093 specifies that the typical Microsoft Windows predefined macros are to
23094 be set in the pre-processor, but does not influence the choice
23095 of runtime library/startup code.
23097 @item -mwindows
23098 @opindex mwindows
23099 This option is available for Cygwin and MinGW targets.  It
23100 specifies that a GUI application is to be generated by
23101 instructing the linker to set the PE header subsystem type
23102 appropriately.
23104 @item -fno-set-stack-executable
23105 @opindex fno-set-stack-executable
23106 This option is available for MinGW targets. It specifies that
23107 the executable flag for the stack used by nested functions isn't
23108 set. This is necessary for binaries running in kernel mode of
23109 Microsoft Windows, as there the User32 API, which is used to set executable
23110 privileges, isn't available.
23112 @item -fwritable-relocated-rdata
23113 @opindex fno-writable-relocated-rdata
23114 This option is available for MinGW and Cygwin targets.  It specifies
23115 that relocated-data in read-only section is put into .data
23116 section.  This is a necessary for older runtimes not supporting
23117 modification of .rdata sections for pseudo-relocation.
23119 @item -mpe-aligned-commons
23120 @opindex mpe-aligned-commons
23121 This option is available for Cygwin and MinGW targets.  It
23122 specifies that the GNU extension to the PE file format that
23123 permits the correct alignment of COMMON variables should be
23124 used when generating code.  It is enabled by default if
23125 GCC detects that the target assembler found during configuration
23126 supports the feature.
23127 @end table
23129 See also under @ref{x86 Options} for standard options.
23131 @node Xstormy16 Options
23132 @subsection Xstormy16 Options
23133 @cindex Xstormy16 Options
23135 These options are defined for Xstormy16:
23137 @table @gcctabopt
23138 @item -msim
23139 @opindex msim
23140 Choose startup files and linker script suitable for the simulator.
23141 @end table
23143 @node Xtensa Options
23144 @subsection Xtensa Options
23145 @cindex Xtensa Options
23147 These options are supported for Xtensa targets:
23149 @table @gcctabopt
23150 @item -mconst16
23151 @itemx -mno-const16
23152 @opindex mconst16
23153 @opindex mno-const16
23154 Enable or disable use of @code{CONST16} instructions for loading
23155 constant values.  The @code{CONST16} instruction is currently not a
23156 standard option from Tensilica.  When enabled, @code{CONST16}
23157 instructions are always used in place of the standard @code{L32R}
23158 instructions.  The use of @code{CONST16} is enabled by default only if
23159 the @code{L32R} instruction is not available.
23161 @item -mfused-madd
23162 @itemx -mno-fused-madd
23163 @opindex mfused-madd
23164 @opindex mno-fused-madd
23165 Enable or disable use of fused multiply/add and multiply/subtract
23166 instructions in the floating-point option.  This has no effect if the
23167 floating-point option is not also enabled.  Disabling fused multiply/add
23168 and multiply/subtract instructions forces the compiler to use separate
23169 instructions for the multiply and add/subtract operations.  This may be
23170 desirable in some cases where strict IEEE 754-compliant results are
23171 required: the fused multiply add/subtract instructions do not round the
23172 intermediate result, thereby producing results with @emph{more} bits of
23173 precision than specified by the IEEE standard.  Disabling fused multiply
23174 add/subtract instructions also ensures that the program output is not
23175 sensitive to the compiler's ability to combine multiply and add/subtract
23176 operations.
23178 @item -mserialize-volatile
23179 @itemx -mno-serialize-volatile
23180 @opindex mserialize-volatile
23181 @opindex mno-serialize-volatile
23182 When this option is enabled, GCC inserts @code{MEMW} instructions before
23183 @code{volatile} memory references to guarantee sequential consistency.
23184 The default is @option{-mserialize-volatile}.  Use
23185 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
23187 @item -mforce-no-pic
23188 @opindex mforce-no-pic
23189 For targets, like GNU/Linux, where all user-mode Xtensa code must be
23190 position-independent code (PIC), this option disables PIC for compiling
23191 kernel code.
23193 @item -mtext-section-literals
23194 @itemx -mno-text-section-literals
23195 @opindex mtext-section-literals
23196 @opindex mno-text-section-literals
23197 These options control the treatment of literal pools.  The default is
23198 @option{-mno-text-section-literals}, which places literals in a separate
23199 section in the output file.  This allows the literal pool to be placed
23200 in a data RAM/ROM, and it also allows the linker to combine literal
23201 pools from separate object files to remove redundant literals and
23202 improve code size.  With @option{-mtext-section-literals}, the literals
23203 are interspersed in the text section in order to keep them as close as
23204 possible to their references.  This may be necessary for large assembly
23205 files.
23207 @item -mtarget-align
23208 @itemx -mno-target-align
23209 @opindex mtarget-align
23210 @opindex mno-target-align
23211 When this option is enabled, GCC instructs the assembler to
23212 automatically align instructions to reduce branch penalties at the
23213 expense of some code density.  The assembler attempts to widen density
23214 instructions to align branch targets and the instructions following call
23215 instructions.  If there are not enough preceding safe density
23216 instructions to align a target, no widening is performed.  The
23217 default is @option{-mtarget-align}.  These options do not affect the
23218 treatment of auto-aligned instructions like @code{LOOP}, which the
23219 assembler always aligns, either by widening density instructions or
23220 by inserting NOP instructions.
23222 @item -mlongcalls
23223 @itemx -mno-longcalls
23224 @opindex mlongcalls
23225 @opindex mno-longcalls
23226 When this option is enabled, GCC instructs the assembler to translate
23227 direct calls to indirect calls unless it can determine that the target
23228 of a direct call is in the range allowed by the call instruction.  This
23229 translation typically occurs for calls to functions in other source
23230 files.  Specifically, the assembler translates a direct @code{CALL}
23231 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
23232 The default is @option{-mno-longcalls}.  This option should be used in
23233 programs where the call target can potentially be out of range.  This
23234 option is implemented in the assembler, not the compiler, so the
23235 assembly code generated by GCC still shows direct call
23236 instructions---look at the disassembled object code to see the actual
23237 instructions.  Note that the assembler uses an indirect call for
23238 every cross-file call, not just those that really are out of range.
23239 @end table
23241 @node zSeries Options
23242 @subsection zSeries Options
23243 @cindex zSeries options
23245 These are listed under @xref{S/390 and zSeries Options}.
23247 @node Code Gen Options
23248 @section Options for Code Generation Conventions
23249 @cindex code generation conventions
23250 @cindex options, code generation
23251 @cindex run-time options
23253 These machine-independent options control the interface conventions
23254 used in code generation.
23256 Most of them have both positive and negative forms; the negative form
23257 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
23258 one of the forms is listed---the one that is not the default.  You
23259 can figure out the other form by either removing @samp{no-} or adding
23262 @table @gcctabopt
23263 @item -fbounds-check
23264 @opindex fbounds-check
23265 For front ends that support it, generate additional code to check that
23266 indices used to access arrays are within the declared range.  This is
23267 currently only supported by the Java and Fortran front ends, where
23268 this option defaults to true and false respectively.
23270 @item -fstack-reuse=@var{reuse-level}
23271 @opindex fstack_reuse
23272 This option controls stack space reuse for user declared local/auto variables
23273 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
23274 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
23275 local variables and temporaries, @samp{named_vars} enables the reuse only for
23276 user defined local variables with names, and @samp{none} disables stack reuse
23277 completely. The default value is @samp{all}. The option is needed when the
23278 program extends the lifetime of a scoped local variable or a compiler generated
23279 temporary beyond the end point defined by the language.  When a lifetime of
23280 a variable ends, and if the variable lives in memory, the optimizing compiler
23281 has the freedom to reuse its stack space with other temporaries or scoped
23282 local variables whose live range does not overlap with it. Legacy code extending
23283 local lifetime is likely to break with the stack reuse optimization.
23285 For example,
23287 @smallexample
23288    int *p;
23289    @{
23290      int local1;
23292      p = &local1;
23293      local1 = 10;
23294      ....
23295    @}
23296    @{
23297       int local2;
23298       local2 = 20;
23299       ...
23300    @}
23302    if (*p == 10)  // out of scope use of local1
23303      @{
23305      @}
23306 @end smallexample
23308 Another example:
23309 @smallexample
23311    struct A
23312    @{
23313        A(int k) : i(k), j(k) @{ @}
23314        int i;
23315        int j;
23316    @};
23318    A *ap;
23320    void foo(const A& ar)
23321    @{
23322       ap = &ar;
23323    @}
23325    void bar()
23326    @{
23327       foo(A(10)); // temp object's lifetime ends when foo returns
23329       @{
23330         A a(20);
23331         ....
23332       @}
23333       ap->i+= 10;  // ap references out of scope temp whose space
23334                    // is reused with a. What is the value of ap->i?
23335    @}
23337 @end smallexample
23339 The lifetime of a compiler generated temporary is well defined by the C++
23340 standard. When a lifetime of a temporary ends, and if the temporary lives
23341 in memory, the optimizing compiler has the freedom to reuse its stack
23342 space with other temporaries or scoped local variables whose live range
23343 does not overlap with it. However some of the legacy code relies on
23344 the behavior of older compilers in which temporaries' stack space is
23345 not reused, the aggressive stack reuse can lead to runtime errors. This
23346 option is used to control the temporary stack reuse optimization.
23348 @item -ftrapv
23349 @opindex ftrapv
23350 This option generates traps for signed overflow on addition, subtraction,
23351 multiplication operations.
23353 @item -fwrapv
23354 @opindex fwrapv
23355 This option instructs the compiler to assume that signed arithmetic
23356 overflow of addition, subtraction and multiplication wraps around
23357 using twos-complement representation.  This flag enables some optimizations
23358 and disables others.  This option is enabled by default for the Java
23359 front end, as required by the Java language specification.
23361 @item -fexceptions
23362 @opindex fexceptions
23363 Enable exception handling.  Generates extra code needed to propagate
23364 exceptions.  For some targets, this implies GCC generates frame
23365 unwind information for all functions, which can produce significant data
23366 size overhead, although it does not affect execution.  If you do not
23367 specify this option, GCC enables it by default for languages like
23368 C++ that normally require exception handling, and disables it for
23369 languages like C that do not normally require it.  However, you may need
23370 to enable this option when compiling C code that needs to interoperate
23371 properly with exception handlers written in C++.  You may also wish to
23372 disable this option if you are compiling older C++ programs that don't
23373 use exception handling.
23375 @item -fnon-call-exceptions
23376 @opindex fnon-call-exceptions
23377 Generate code that allows trapping instructions to throw exceptions.
23378 Note that this requires platform-specific runtime support that does
23379 not exist everywhere.  Moreover, it only allows @emph{trapping}
23380 instructions to throw exceptions, i.e.@: memory references or floating-point
23381 instructions.  It does not allow exceptions to be thrown from
23382 arbitrary signal handlers such as @code{SIGALRM}.
23384 @item -fdelete-dead-exceptions
23385 @opindex fdelete-dead-exceptions
23386 Consider that instructions that may throw exceptions but don't otherwise
23387 contribute to the execution of the program can be optimized away.
23388 This option is enabled by default for the Ada front end, as permitted by
23389 the Ada language specification.
23390 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
23392 @item -funwind-tables
23393 @opindex funwind-tables
23394 Similar to @option{-fexceptions}, except that it just generates any needed
23395 static data, but does not affect the generated code in any other way.
23396 You normally do not need to enable this option; instead, a language processor
23397 that needs this handling enables it on your behalf.
23399 @item -fasynchronous-unwind-tables
23400 @opindex fasynchronous-unwind-tables
23401 Generate unwind table in DWARF 2 format, if supported by target machine.  The
23402 table is exact at each instruction boundary, so it can be used for stack
23403 unwinding from asynchronous events (such as debugger or garbage collector).
23405 @item -fno-gnu-unique
23406 @opindex fno-gnu-unique
23407 On systems with recent GNU assembler and C library, the C++ compiler
23408 uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
23409 of template static data members and static local variables in inline
23410 functions are unique even in the presence of @code{RTLD_LOCAL}; this
23411 is necessary to avoid problems with a library used by two different
23412 @code{RTLD_LOCAL} plugins depending on a definition in one of them and
23413 therefore disagreeing with the other one about the binding of the
23414 symbol.  But this causes @code{dlclose} to be ignored for affected
23415 DSOs; if your program relies on reinitialization of a DSO via
23416 @code{dlclose} and @code{dlopen}, you can use
23417 @option{-fno-gnu-unique}.
23419 @item -fpcc-struct-return
23420 @opindex fpcc-struct-return
23421 Return ``short'' @code{struct} and @code{union} values in memory like
23422 longer ones, rather than in registers.  This convention is less
23423 efficient, but it has the advantage of allowing intercallability between
23424 GCC-compiled files and files compiled with other compilers, particularly
23425 the Portable C Compiler (pcc).
23427 The precise convention for returning structures in memory depends
23428 on the target configuration macros.
23430 Short structures and unions are those whose size and alignment match
23431 that of some integer type.
23433 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
23434 switch is not binary compatible with code compiled with the
23435 @option{-freg-struct-return} switch.
23436 Use it to conform to a non-default application binary interface.
23438 @item -freg-struct-return
23439 @opindex freg-struct-return
23440 Return @code{struct} and @code{union} values in registers when possible.
23441 This is more efficient for small structures than
23442 @option{-fpcc-struct-return}.
23444 If you specify neither @option{-fpcc-struct-return} nor
23445 @option{-freg-struct-return}, GCC defaults to whichever convention is
23446 standard for the target.  If there is no standard convention, GCC
23447 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
23448 the principal compiler.  In those cases, we can choose the standard, and
23449 we chose the more efficient register return alternative.
23451 @strong{Warning:} code compiled with the @option{-freg-struct-return}
23452 switch is not binary compatible with code compiled with the
23453 @option{-fpcc-struct-return} switch.
23454 Use it to conform to a non-default application binary interface.
23456 @item -fshort-enums
23457 @opindex fshort-enums
23458 Allocate to an @code{enum} type only as many bytes as it needs for the
23459 declared range of possible values.  Specifically, the @code{enum} type
23460 is equivalent to the smallest integer type that has enough room.
23462 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
23463 code that is not binary compatible with code generated without that switch.
23464 Use it to conform to a non-default application binary interface.
23466 @item -fshort-double
23467 @opindex fshort-double
23468 Use the same size for @code{double} as for @code{float}.
23470 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
23471 code that is not binary compatible with code generated without that switch.
23472 Use it to conform to a non-default application binary interface.
23474 @item -fshort-wchar
23475 @opindex fshort-wchar
23476 Override the underlying type for @code{wchar_t} to be @code{short
23477 unsigned int} instead of the default for the target.  This option is
23478 useful for building programs to run under WINE@.
23480 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
23481 code that is not binary compatible with code generated without that switch.
23482 Use it to conform to a non-default application binary interface.
23484 @item -fno-common
23485 @opindex fno-common
23486 In C code, controls the placement of uninitialized global variables.
23487 Unix C compilers have traditionally permitted multiple definitions of
23488 such variables in different compilation units by placing the variables
23489 in a common block.
23490 This is the behavior specified by @option{-fcommon}, and is the default
23491 for GCC on most targets.
23492 On the other hand, this behavior is not required by ISO C, and on some
23493 targets may carry a speed or code size penalty on variable references.
23494 The @option{-fno-common} option specifies that the compiler should place
23495 uninitialized global variables in the data section of the object file,
23496 rather than generating them as common blocks.
23497 This has the effect that if the same variable is declared
23498 (without @code{extern}) in two different compilations,
23499 you get a multiple-definition error when you link them.
23500 In this case, you must compile with @option{-fcommon} instead.
23501 Compiling with @option{-fno-common} is useful on targets for which
23502 it provides better performance, or if you wish to verify that the
23503 program will work on other systems that always treat uninitialized
23504 variable declarations this way.
23506 @item -fno-ident
23507 @opindex fno-ident
23508 Ignore the @code{#ident} directive.
23510 @item -finhibit-size-directive
23511 @opindex finhibit-size-directive
23512 Don't output a @code{.size} assembler directive, or anything else that
23513 would cause trouble if the function is split in the middle, and the
23514 two halves are placed at locations far apart in memory.  This option is
23515 used when compiling @file{crtstuff.c}; you should not need to use it
23516 for anything else.
23518 @item -fverbose-asm
23519 @opindex fverbose-asm
23520 Put extra commentary information in the generated assembly code to
23521 make it more readable.  This option is generally only of use to those
23522 who actually need to read the generated assembly code (perhaps while
23523 debugging the compiler itself).
23525 @option{-fno-verbose-asm}, the default, causes the
23526 extra information to be omitted and is useful when comparing two assembler
23527 files.
23529 @item -frecord-gcc-switches
23530 @opindex frecord-gcc-switches
23531 This switch causes the command line used to invoke the
23532 compiler to be recorded into the object file that is being created.
23533 This switch is only implemented on some targets and the exact format
23534 of the recording is target and binary file format dependent, but it
23535 usually takes the form of a section containing ASCII text.  This
23536 switch is related to the @option{-fverbose-asm} switch, but that
23537 switch only records information in the assembler output file as
23538 comments, so it never reaches the object file.
23539 See also @option{-grecord-gcc-switches} for another
23540 way of storing compiler options into the object file.
23542 @item -fpic
23543 @opindex fpic
23544 @cindex global offset table
23545 @cindex PIC
23546 Generate position-independent code (PIC) suitable for use in a shared
23547 library, if supported for the target machine.  Such code accesses all
23548 constant addresses through a global offset table (GOT)@.  The dynamic
23549 loader resolves the GOT entries when the program starts (the dynamic
23550 loader is not part of GCC; it is part of the operating system).  If
23551 the GOT size for the linked executable exceeds a machine-specific
23552 maximum size, you get an error message from the linker indicating that
23553 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
23554 instead.  (These maximums are 8k on the SPARC and 32k
23555 on the m68k and RS/6000.  The x86 has no such limit.)
23557 Position-independent code requires special support, and therefore works
23558 only on certain machines.  For the x86, GCC supports PIC for System V
23559 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
23560 position-independent.
23562 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
23563 are defined to 1.
23565 @item -fPIC
23566 @opindex fPIC
23567 If supported for the target machine, emit position-independent code,
23568 suitable for dynamic linking and avoiding any limit on the size of the
23569 global offset table.  This option makes a difference on the m68k,
23570 PowerPC and SPARC@.
23572 Position-independent code requires special support, and therefore works
23573 only on certain machines.
23575 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
23576 are defined to 2.
23578 @item -fpie
23579 @itemx -fPIE
23580 @opindex fpie
23581 @opindex fPIE
23582 These options are similar to @option{-fpic} and @option{-fPIC}, but
23583 generated position independent code can be only linked into executables.
23584 Usually these options are used when @option{-pie} GCC option is
23585 used during linking.
23587 @option{-fpie} and @option{-fPIE} both define the macros
23588 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
23589 for @option{-fpie} and 2 for @option{-fPIE}.
23591 @item -fno-jump-tables
23592 @opindex fno-jump-tables
23593 Do not use jump tables for switch statements even where it would be
23594 more efficient than other code generation strategies.  This option is
23595 of use in conjunction with @option{-fpic} or @option{-fPIC} for
23596 building code that forms part of a dynamic linker and cannot
23597 reference the address of a jump table.  On some targets, jump tables
23598 do not require a GOT and this option is not needed.
23600 @item -ffixed-@var{reg}
23601 @opindex ffixed
23602 Treat the register named @var{reg} as a fixed register; generated code
23603 should never refer to it (except perhaps as a stack pointer, frame
23604 pointer or in some other fixed role).
23606 @var{reg} must be the name of a register.  The register names accepted
23607 are machine-specific and are defined in the @code{REGISTER_NAMES}
23608 macro in the machine description macro file.
23610 This flag does not have a negative form, because it specifies a
23611 three-way choice.
23613 @item -fcall-used-@var{reg}
23614 @opindex fcall-used
23615 Treat the register named @var{reg} as an allocable register that is
23616 clobbered by function calls.  It may be allocated for temporaries or
23617 variables that do not live across a call.  Functions compiled this way
23618 do not save and restore the register @var{reg}.
23620 It is an error to use this flag with the frame pointer or stack pointer.
23621 Use of this flag for other registers that have fixed pervasive roles in
23622 the machine's execution model produces disastrous results.
23624 This flag does not have a negative form, because it specifies a
23625 three-way choice.
23627 @item -fcall-saved-@var{reg}
23628 @opindex fcall-saved
23629 Treat the register named @var{reg} as an allocable register saved by
23630 functions.  It may be allocated even for temporaries or variables that
23631 live across a call.  Functions compiled this way save and restore
23632 the register @var{reg} if they use it.
23634 It is an error to use this flag with the frame pointer or stack pointer.
23635 Use of this flag for other registers that have fixed pervasive roles in
23636 the machine's execution model produces disastrous results.
23638 A different sort of disaster results from the use of this flag for
23639 a register in which function values may be returned.
23641 This flag does not have a negative form, because it specifies a
23642 three-way choice.
23644 @item -fpack-struct[=@var{n}]
23645 @opindex fpack-struct
23646 Without a value specified, pack all structure members together without
23647 holes.  When a value is specified (which must be a small power of two), pack
23648 structure members according to this value, representing the maximum
23649 alignment (that is, objects with default alignment requirements larger than
23650 this are output potentially unaligned at the next fitting location.
23652 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
23653 code that is not binary compatible with code generated without that switch.
23654 Additionally, it makes the code suboptimal.
23655 Use it to conform to a non-default application binary interface.
23657 @item -finstrument-functions
23658 @opindex finstrument-functions
23659 Generate instrumentation calls for entry and exit to functions.  Just
23660 after function entry and just before function exit, the following
23661 profiling functions are called with the address of the current
23662 function and its call site.  (On some platforms,
23663 @code{__builtin_return_address} does not work beyond the current
23664 function, so the call site information may not be available to the
23665 profiling functions otherwise.)
23667 @smallexample
23668 void __cyg_profile_func_enter (void *this_fn,
23669                                void *call_site);
23670 void __cyg_profile_func_exit  (void *this_fn,
23671                                void *call_site);
23672 @end smallexample
23674 The first argument is the address of the start of the current function,
23675 which may be looked up exactly in the symbol table.
23677 This instrumentation is also done for functions expanded inline in other
23678 functions.  The profiling calls indicate where, conceptually, the
23679 inline function is entered and exited.  This means that addressable
23680 versions of such functions must be available.  If all your uses of a
23681 function are expanded inline, this may mean an additional expansion of
23682 code size.  If you use @code{extern inline} in your C code, an
23683 addressable version of such functions must be provided.  (This is
23684 normally the case anyway, but if you get lucky and the optimizer always
23685 expands the functions inline, you might have gotten away without
23686 providing static copies.)
23688 A function may be given the attribute @code{no_instrument_function}, in
23689 which case this instrumentation is not done.  This can be used, for
23690 example, for the profiling functions listed above, high-priority
23691 interrupt routines, and any functions from which the profiling functions
23692 cannot safely be called (perhaps signal handlers, if the profiling
23693 routines generate output or allocate memory).
23695 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
23696 @opindex finstrument-functions-exclude-file-list
23698 Set the list of functions that are excluded from instrumentation (see
23699 the description of @option{-finstrument-functions}).  If the file that
23700 contains a function definition matches with one of @var{file}, then
23701 that function is not instrumented.  The match is done on substrings:
23702 if the @var{file} parameter is a substring of the file name, it is
23703 considered to be a match.
23705 For example:
23707 @smallexample
23708 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
23709 @end smallexample
23711 @noindent
23712 excludes any inline function defined in files whose pathnames
23713 contain @file{/bits/stl} or @file{include/sys}.
23715 If, for some reason, you want to include letter @samp{,} in one of
23716 @var{sym}, write @samp{\,}. For example,
23717 @option{-finstrument-functions-exclude-file-list='\,\,tmp'}
23718 (note the single quote surrounding the option).
23720 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
23721 @opindex finstrument-functions-exclude-function-list
23723 This is similar to @option{-finstrument-functions-exclude-file-list},
23724 but this option sets the list of function names to be excluded from
23725 instrumentation.  The function name to be matched is its user-visible
23726 name, such as @code{vector<int> blah(const vector<int> &)}, not the
23727 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
23728 match is done on substrings: if the @var{sym} parameter is a substring
23729 of the function name, it is considered to be a match.  For C99 and C++
23730 extended identifiers, the function name must be given in UTF-8, not
23731 using universal character names.
23733 @item -fstack-check
23734 @opindex fstack-check
23735 Generate code to verify that you do not go beyond the boundary of the
23736 stack.  You should specify this flag if you are running in an
23737 environment with multiple threads, but you only rarely need to specify it in
23738 a single-threaded environment since stack overflow is automatically
23739 detected on nearly all systems if there is only one stack.
23741 Note that this switch does not actually cause checking to be done; the
23742 operating system or the language runtime must do that.  The switch causes
23743 generation of code to ensure that they see the stack being extended.
23745 You can additionally specify a string parameter: @samp{no} means no
23746 checking, @samp{generic} means force the use of old-style checking,
23747 @samp{specific} means use the best checking method and is equivalent
23748 to bare @option{-fstack-check}.
23750 Old-style checking is a generic mechanism that requires no specific
23751 target support in the compiler but comes with the following drawbacks:
23753 @enumerate
23754 @item
23755 Modified allocation strategy for large objects: they are always
23756 allocated dynamically if their size exceeds a fixed threshold.
23758 @item
23759 Fixed limit on the size of the static frame of functions: when it is
23760 topped by a particular function, stack checking is not reliable and
23761 a warning is issued by the compiler.
23763 @item
23764 Inefficiency: because of both the modified allocation strategy and the
23765 generic implementation, code performance is hampered.
23766 @end enumerate
23768 Note that old-style stack checking is also the fallback method for
23769 @samp{specific} if no target support has been added in the compiler.
23771 @item -fstack-limit-register=@var{reg}
23772 @itemx -fstack-limit-symbol=@var{sym}
23773 @itemx -fno-stack-limit
23774 @opindex fstack-limit-register
23775 @opindex fstack-limit-symbol
23776 @opindex fno-stack-limit
23777 Generate code to ensure that the stack does not grow beyond a certain value,
23778 either the value of a register or the address of a symbol.  If a larger
23779 stack is required, a signal is raised at run time.  For most targets,
23780 the signal is raised before the stack overruns the boundary, so
23781 it is possible to catch the signal without taking special precautions.
23783 For instance, if the stack starts at absolute address @samp{0x80000000}
23784 and grows downwards, you can use the flags
23785 @option{-fstack-limit-symbol=__stack_limit} and
23786 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
23787 of 128KB@.  Note that this may only work with the GNU linker.
23789 @item -fsplit-stack
23790 @opindex fsplit-stack
23791 Generate code to automatically split the stack before it overflows.
23792 The resulting program has a discontiguous stack which can only
23793 overflow if the program is unable to allocate any more memory.  This
23794 is most useful when running threaded programs, as it is no longer
23795 necessary to calculate a good stack size to use for each thread.  This
23796 is currently only implemented for the x86 targets running
23797 GNU/Linux.
23799 When code compiled with @option{-fsplit-stack} calls code compiled
23800 without @option{-fsplit-stack}, there may not be much stack space
23801 available for the latter code to run.  If compiling all code,
23802 including library code, with @option{-fsplit-stack} is not an option,
23803 then the linker can fix up these calls so that the code compiled
23804 without @option{-fsplit-stack} always has a large stack.  Support for
23805 this is implemented in the gold linker in GNU binutils release 2.21
23806 and later.
23808 @item -fleading-underscore
23809 @opindex fleading-underscore
23810 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
23811 change the way C symbols are represented in the object file.  One use
23812 is to help link with legacy assembly code.
23814 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
23815 generate code that is not binary compatible with code generated without that
23816 switch.  Use it to conform to a non-default application binary interface.
23817 Not all targets provide complete support for this switch.
23819 @item -ftls-model=@var{model}
23820 @opindex ftls-model
23821 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
23822 The @var{model} argument should be one of @samp{global-dynamic},
23823 @samp{local-dynamic}, @samp{initial-exec} or @samp{local-exec}.
23824 Note that the choice is subject to optimization: the compiler may use
23825 a more efficient model for symbols not visible outside of the translation
23826 unit, or if @option{-fpic} is not given on the command line.
23828 The default without @option{-fpic} is @samp{initial-exec}; with
23829 @option{-fpic} the default is @samp{global-dynamic}.
23831 @item -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]}
23832 @opindex fvisibility
23833 Set the default ELF image symbol visibility to the specified option---all
23834 symbols are marked with this unless overridden within the code.
23835 Using this feature can very substantially improve linking and
23836 load times of shared object libraries, produce more optimized
23837 code, provide near-perfect API export and prevent symbol clashes.
23838 It is @strong{strongly} recommended that you use this in any shared objects
23839 you distribute.
23841 Despite the nomenclature, @samp{default} always means public; i.e.,
23842 available to be linked against from outside the shared object.
23843 @samp{protected} and @samp{internal} are pretty useless in real-world
23844 usage so the only other commonly used option is @samp{hidden}.
23845 The default if @option{-fvisibility} isn't specified is
23846 @samp{default}, i.e., make every symbol public.
23848 A good explanation of the benefits offered by ensuring ELF
23849 symbols have the correct visibility is given by ``How To Write
23850 Shared Libraries'' by Ulrich Drepper (which can be found at
23851 @w{@uref{http://www.akkadia.org/drepper/}})---however a superior
23852 solution made possible by this option to marking things hidden when
23853 the default is public is to make the default hidden and mark things
23854 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
23855 and @code{__attribute__ ((visibility("default")))} instead of
23856 @code{__declspec(dllexport)} you get almost identical semantics with
23857 identical syntax.  This is a great boon to those working with
23858 cross-platform projects.
23860 For those adding visibility support to existing code, you may find
23861 @code{#pragma GCC visibility} of use.  This works by you enclosing
23862 the declarations you wish to set visibility for with (for example)
23863 @code{#pragma GCC visibility push(hidden)} and
23864 @code{#pragma GCC visibility pop}.
23865 Bear in mind that symbol visibility should be viewed @strong{as
23866 part of the API interface contract} and thus all new code should
23867 always specify visibility when it is not the default; i.e., declarations
23868 only for use within the local DSO should @strong{always} be marked explicitly
23869 as hidden as so to avoid PLT indirection overheads---making this
23870 abundantly clear also aids readability and self-documentation of the code.
23871 Note that due to ISO C++ specification requirements, @code{operator new} and
23872 @code{operator delete} must always be of default visibility.
23874 Be aware that headers from outside your project, in particular system
23875 headers and headers from any other library you use, may not be
23876 expecting to be compiled with visibility other than the default.  You
23877 may need to explicitly say @code{#pragma GCC visibility push(default)}
23878 before including any such headers.
23880 @code{extern} declarations are not affected by @option{-fvisibility}, so
23881 a lot of code can be recompiled with @option{-fvisibility=hidden} with
23882 no modifications.  However, this means that calls to @code{extern}
23883 functions with no explicit visibility use the PLT, so it is more
23884 effective to use @code{__attribute ((visibility))} and/or
23885 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
23886 declarations should be treated as hidden.
23888 Note that @option{-fvisibility} does affect C++ vague linkage
23889 entities. This means that, for instance, an exception class that is
23890 be thrown between DSOs must be explicitly marked with default
23891 visibility so that the @samp{type_info} nodes are unified between
23892 the DSOs.
23894 An overview of these techniques, their benefits and how to use them
23895 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
23897 @item -fstrict-volatile-bitfields
23898 @opindex fstrict-volatile-bitfields
23899 This option should be used if accesses to volatile bit-fields (or other
23900 structure fields, although the compiler usually honors those types
23901 anyway) should use a single access of the width of the
23902 field's type, aligned to a natural alignment if possible.  For
23903 example, targets with memory-mapped peripheral registers might require
23904 all such accesses to be 16 bits wide; with this flag you can
23905 declare all peripheral bit-fields as @code{unsigned short} (assuming short
23906 is 16 bits on these targets) to force GCC to use 16-bit accesses
23907 instead of, perhaps, a more efficient 32-bit access.
23909 If this option is disabled, the compiler uses the most efficient
23910 instruction.  In the previous example, that might be a 32-bit load
23911 instruction, even though that accesses bytes that do not contain
23912 any portion of the bit-field, or memory-mapped registers unrelated to
23913 the one being updated.
23915 In some cases, such as when the @code{packed} attribute is applied to a 
23916 structure field, it may not be possible to access the field with a single
23917 read or write that is correctly aligned for the target machine.  In this
23918 case GCC falls back to generating multiple accesses rather than code that 
23919 will fault or truncate the result at run time.
23921 Note:  Due to restrictions of the C/C++11 memory model, write accesses are
23922 not allowed to touch non bit-field members.  It is therefore recommended
23923 to define all bits of the field's type as bit-field members.
23925 The default value of this option is determined by the application binary
23926 interface for the target processor.
23928 @item -fsync-libcalls
23929 @opindex fsync-libcalls
23930 This option controls whether any out-of-line instance of the @code{__sync}
23931 family of functions may be used to implement the C++11 @code{__atomic}
23932 family of functions.
23934 The default value of this option is enabled, thus the only useful form
23935 of the option is @option{-fno-sync-libcalls}.  This option is used in
23936 the implementation of the @file{libatomic} runtime library.
23938 @end table
23940 @c man end
23942 @node Environment Variables
23943 @section Environment Variables Affecting GCC
23944 @cindex environment variables
23946 @c man begin ENVIRONMENT
23947 This section describes several environment variables that affect how GCC
23948 operates.  Some of them work by specifying directories or prefixes to use
23949 when searching for various kinds of files.  Some are used to specify other
23950 aspects of the compilation environment.
23952 Note that you can also specify places to search using options such as
23953 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
23954 take precedence over places specified using environment variables, which
23955 in turn take precedence over those specified by the configuration of GCC@.
23956 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
23957 GNU Compiler Collection (GCC) Internals}.
23959 @table @env
23960 @item LANG
23961 @itemx LC_CTYPE
23962 @c @itemx LC_COLLATE
23963 @itemx LC_MESSAGES
23964 @c @itemx LC_MONETARY
23965 @c @itemx LC_NUMERIC
23966 @c @itemx LC_TIME
23967 @itemx LC_ALL
23968 @findex LANG
23969 @findex LC_CTYPE
23970 @c @findex LC_COLLATE
23971 @findex LC_MESSAGES
23972 @c @findex LC_MONETARY
23973 @c @findex LC_NUMERIC
23974 @c @findex LC_TIME
23975 @findex LC_ALL
23976 @cindex locale
23977 These environment variables control the way that GCC uses
23978 localization information which allows GCC to work with different
23979 national conventions.  GCC inspects the locale categories
23980 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
23981 so.  These locale categories can be set to any value supported by your
23982 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
23983 Kingdom encoded in UTF-8.
23985 The @env{LC_CTYPE} environment variable specifies character
23986 classification.  GCC uses it to determine the character boundaries in
23987 a string; this is needed for some multibyte encodings that contain quote
23988 and escape characters that are otherwise interpreted as a string
23989 end or escape.
23991 The @env{LC_MESSAGES} environment variable specifies the language to
23992 use in diagnostic messages.
23994 If the @env{LC_ALL} environment variable is set, it overrides the value
23995 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
23996 and @env{LC_MESSAGES} default to the value of the @env{LANG}
23997 environment variable.  If none of these variables are set, GCC
23998 defaults to traditional C English behavior.
24000 @item TMPDIR
24001 @findex TMPDIR
24002 If @env{TMPDIR} is set, it specifies the directory to use for temporary
24003 files.  GCC uses temporary files to hold the output of one stage of
24004 compilation which is to be used as input to the next stage: for example,
24005 the output of the preprocessor, which is the input to the compiler
24006 proper.
24008 @item GCC_COMPARE_DEBUG
24009 @findex GCC_COMPARE_DEBUG
24010 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
24011 @option{-fcompare-debug} to the compiler driver.  See the documentation
24012 of this option for more details.
24014 @item GCC_EXEC_PREFIX
24015 @findex GCC_EXEC_PREFIX
24016 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
24017 names of the subprograms executed by the compiler.  No slash is added
24018 when this prefix is combined with the name of a subprogram, but you can
24019 specify a prefix that ends with a slash if you wish.
24021 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
24022 an appropriate prefix to use based on the pathname it is invoked with.
24024 If GCC cannot find the subprogram using the specified prefix, it
24025 tries looking in the usual places for the subprogram.
24027 The default value of @env{GCC_EXEC_PREFIX} is
24028 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
24029 the installed compiler. In many cases @var{prefix} is the value
24030 of @code{prefix} when you ran the @file{configure} script.
24032 Other prefixes specified with @option{-B} take precedence over this prefix.
24034 This prefix is also used for finding files such as @file{crt0.o} that are
24035 used for linking.
24037 In addition, the prefix is used in an unusual way in finding the
24038 directories to search for header files.  For each of the standard
24039 directories whose name normally begins with @samp{/usr/local/lib/gcc}
24040 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
24041 replacing that beginning with the specified prefix to produce an
24042 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
24043 @file{foo/bar} just before it searches the standard directory 
24044 @file{/usr/local/lib/bar}.
24045 If a standard directory begins with the configured
24046 @var{prefix} then the value of @var{prefix} is replaced by
24047 @env{GCC_EXEC_PREFIX} when looking for header files.
24049 @item COMPILER_PATH
24050 @findex COMPILER_PATH
24051 The value of @env{COMPILER_PATH} is a colon-separated list of
24052 directories, much like @env{PATH}.  GCC tries the directories thus
24053 specified when searching for subprograms, if it can't find the
24054 subprograms using @env{GCC_EXEC_PREFIX}.
24056 @item LIBRARY_PATH
24057 @findex LIBRARY_PATH
24058 The value of @env{LIBRARY_PATH} is a colon-separated list of
24059 directories, much like @env{PATH}.  When configured as a native compiler,
24060 GCC tries the directories thus specified when searching for special
24061 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
24062 using GCC also uses these directories when searching for ordinary
24063 libraries for the @option{-l} option (but directories specified with
24064 @option{-L} come first).
24066 @item LANG
24067 @findex LANG
24068 @cindex locale definition
24069 This variable is used to pass locale information to the compiler.  One way in
24070 which this information is used is to determine the character set to be used
24071 when character literals, string literals and comments are parsed in C and C++.
24072 When the compiler is configured to allow multibyte characters,
24073 the following values for @env{LANG} are recognized:
24075 @table @samp
24076 @item C-JIS
24077 Recognize JIS characters.
24078 @item C-SJIS
24079 Recognize SJIS characters.
24080 @item C-EUCJP
24081 Recognize EUCJP characters.
24082 @end table
24084 If @env{LANG} is not defined, or if it has some other value, then the
24085 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
24086 recognize and translate multibyte characters.
24087 @end table
24089 @noindent
24090 Some additional environment variables affect the behavior of the
24091 preprocessor.
24093 @include cppenv.texi
24095 @c man end
24097 @node Precompiled Headers
24098 @section Using Precompiled Headers
24099 @cindex precompiled headers
24100 @cindex speed of compilation
24102 Often large projects have many header files that are included in every
24103 source file.  The time the compiler takes to process these header files
24104 over and over again can account for nearly all of the time required to
24105 build the project.  To make builds faster, GCC allows you to
24106 @dfn{precompile} a header file.
24108 To create a precompiled header file, simply compile it as you would any
24109 other file, if necessary using the @option{-x} option to make the driver
24110 treat it as a C or C++ header file.  You may want to use a
24111 tool like @command{make} to keep the precompiled header up-to-date when
24112 the headers it contains change.
24114 A precompiled header file is searched for when @code{#include} is
24115 seen in the compilation.  As it searches for the included file
24116 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
24117 compiler looks for a precompiled header in each directory just before it
24118 looks for the include file in that directory.  The name searched for is
24119 the name specified in the @code{#include} with @samp{.gch} appended.  If
24120 the precompiled header file can't be used, it is ignored.
24122 For instance, if you have @code{#include "all.h"}, and you have
24123 @file{all.h.gch} in the same directory as @file{all.h}, then the
24124 precompiled header file is used if possible, and the original
24125 header is used otherwise.
24127 Alternatively, you might decide to put the precompiled header file in a
24128 directory and use @option{-I} to ensure that directory is searched
24129 before (or instead of) the directory containing the original header.
24130 Then, if you want to check that the precompiled header file is always
24131 used, you can put a file of the same name as the original header in this
24132 directory containing an @code{#error} command.
24134 This also works with @option{-include}.  So yet another way to use
24135 precompiled headers, good for projects not designed with precompiled
24136 header files in mind, is to simply take most of the header files used by
24137 a project, include them from another header file, precompile that header
24138 file, and @option{-include} the precompiled header.  If the header files
24139 have guards against multiple inclusion, they are skipped because
24140 they've already been included (in the precompiled header).
24142 If you need to precompile the same header file for different
24143 languages, targets, or compiler options, you can instead make a
24144 @emph{directory} named like @file{all.h.gch}, and put each precompiled
24145 header in the directory, perhaps using @option{-o}.  It doesn't matter
24146 what you call the files in the directory; every precompiled header in
24147 the directory is considered.  The first precompiled header
24148 encountered in the directory that is valid for this compilation is
24149 used; they're searched in no particular order.
24151 There are many other possibilities, limited only by your imagination,
24152 good sense, and the constraints of your build system.
24154 A precompiled header file can be used only when these conditions apply:
24156 @itemize
24157 @item
24158 Only one precompiled header can be used in a particular compilation.
24160 @item
24161 A precompiled header can't be used once the first C token is seen.  You
24162 can have preprocessor directives before a precompiled header; you cannot
24163 include a precompiled header from inside another header.
24165 @item
24166 The precompiled header file must be produced for the same language as
24167 the current compilation.  You can't use a C precompiled header for a C++
24168 compilation.
24170 @item
24171 The precompiled header file must have been produced by the same compiler
24172 binary as the current compilation is using.
24174 @item
24175 Any macros defined before the precompiled header is included must
24176 either be defined in the same way as when the precompiled header was
24177 generated, or must not affect the precompiled header, which usually
24178 means that they don't appear in the precompiled header at all.
24180 The @option{-D} option is one way to define a macro before a
24181 precompiled header is included; using a @code{#define} can also do it.
24182 There are also some options that define macros implicitly, like
24183 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
24184 defined this way.
24186 @item If debugging information is output when using the precompiled
24187 header, using @option{-g} or similar, the same kind of debugging information
24188 must have been output when building the precompiled header.  However,
24189 a precompiled header built using @option{-g} can be used in a compilation
24190 when no debugging information is being output.
24192 @item The same @option{-m} options must generally be used when building
24193 and using the precompiled header.  @xref{Submodel Options},
24194 for any cases where this rule is relaxed.
24196 @item Each of the following options must be the same when building and using
24197 the precompiled header:
24199 @gccoptlist{-fexceptions}
24201 @item
24202 Some other command-line options starting with @option{-f},
24203 @option{-p}, or @option{-O} must be defined in the same way as when
24204 the precompiled header was generated.  At present, it's not clear
24205 which options are safe to change and which are not; the safest choice
24206 is to use exactly the same options when generating and using the
24207 precompiled header.  The following are known to be safe:
24209 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
24210 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
24211 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
24212 -pedantic-errors}
24214 @end itemize
24216 For all of these except the last, the compiler automatically
24217 ignores the precompiled header if the conditions aren't met.  If you
24218 find an option combination that doesn't work and doesn't cause the
24219 precompiled header to be ignored, please consider filing a bug report,
24220 see @ref{Bugs}.
24222 If you do use differing options when generating and using the
24223 precompiled header, the actual behavior is a mixture of the
24224 behavior for the options.  For instance, if you use @option{-g} to
24225 generate the precompiled header but not when using it, you may or may
24226 not get debugging information for routines in the precompiled header.