PR c++/65046
[official-gcc.git] / gcc / doc / invoke.texi
blob133cca9042ec630a385852508e376f02ee8ee6a6
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} 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} can
5161 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=} can be used to alter
5814 this behavior: only the first detected error is reported
5815 and program then exits with a non-zero exit code.
5817 Currently this feature only works for @option{-fsanitize=undefined} (and its suboptions
5818 except for @option{-fsanitize=unreachable} and @option{-fsanitize=return}),
5819 @option{-fsanitize=float-cast-overflow}, @option{-fsanitize=float-divide-by-zero} and
5820 @option{-fsanitize=kernel-address}.  For these sanitizers error recovery is turned on by default.
5821 @option{-fsanitize-recover=all} and @option{-fno-sanitize-recover=all} is also
5822 accepted, the former enables recovery for all sanitizers that support it,
5823 the latter disables recovery for all sanitizers that support it.
5825 Syntax without explicit @var{opts} parameter is deprecated.  It is equivalent to
5826 @smallexample
5827 -fsanitize-recover=undefined,float-cast-overflow,float-divide-by-zero
5828 @end smallexample
5829 @noindent
5830 Similarly @option{-fno-sanitize-recover} is equivalent to
5831 @smallexample
5832 -fno-sanitize-recover=undefined,float-cast-overflow,float-divide-by-zero
5833 @end smallexample
5835 @item -fsanitize-undefined-trap-on-error
5836 @opindex fsanitize-undefined-trap-on-error
5837 The @option{-fsanitize-undefined-trap-on-error} instructs the compiler to
5838 report undefined behavior using @code{__builtin_trap} rather than
5839 a @code{libubsan} library routine.  The advantage of this is that the
5840 @code{libubsan} library is not needed and is not linked in, so this
5841 is usable even in freestanding environments.
5843 @item -fcheck-pointer-bounds
5844 @opindex fcheck-pointer-bounds
5845 @opindex fno-check-pointer-bounds
5846 Enable Pointer Bounds Checker instrumentation.  Each memory reference
5847 is instrumented with checks of pointer used for memory access against
5848 bounds associated with that pointer.  Generated instrumentation may
5849 be controlled by various @option{-fchkp-*} options.  Currently there
5850 is only Intel MPX based implementation available, thus i386 target
5851 and @option{-mmpx} are required.  MPX based instrumentation requires
5852 a runtime library to enable MPX in a hardware and handle bounds
5853 violation signals.  By default when @option{-fcheck-pointer-bounds}
5854 and @option{-mmpx} options are used to link a program, the GCC driver
5855 links against @option{libmpx} runtime library.  MPX based instrumentation
5856 may be used for a debugging and also it may be included into a release
5857 version to increase program security.  Depending on usage you may
5858 put different requirements to runtime library.  Current version
5859  of MPX runtime library is more oriented to be used as a debugging
5860 tool.  MPX runtime library usage implies @option{-lpthread}.  See
5861 also @option{-static-libmpx}.  The runtime library  behavior can be
5862 influenced using various @env{CHKP_RT_*} environment variables.  See
5863 @uref{https://gcc.gnu.org/wiki/Intel%20MPX%20support%20in%20the%20GCC%20compiler}
5864 for more details.
5866 @item -fchkp-check-incomplete-type
5867 @opindex fchkp-check-incomplete-type
5868 @opindex fno-chkp-check-incomplete-type
5869 Generate pointer bounds checks for variables with incomplete type.
5870 Enabled by default
5872 @item -fchkp-narrow-bounds
5873 @opindex fchkp-narrow-bounds
5874 @opindex fno-chkp-narrow-bounds
5875 Controls bounds used by Pointer Bounds Checker for pointers to object
5876 fields.  If narrowing is enabled then field bounds are used.  Otherwise
5877 object bounds are used.  See also @option{-fchkp-narrow-to-innermost-array}
5878 and @option{-fchkp-first-field-has-own-bounds}.  Enabled by default.
5880 @item -fchkp-first-field-has-own-bounds
5881 @opindex fchkp-first-field-has-own-bounds
5882 @opindex fno-chkp-first-field-has-own-bounds
5883 Forces Pointer Bounds Checker to use narrowed bounds for address of the
5884 first field in the structure.  By default pointer to the first field has
5885 the same bounds as pointer to the whole structure.
5887 @item -fchkp-narrow-to-innermost-array
5888 @opindex fchkp-narrow-to-innermost-array
5889 @opindex fno-chkp-narrow-to-innermost-array
5890 Forces Pointer Bounds Checker to use bounds of the innermost arrays in
5891 case of nested static arryas access.  By default it is disabled and
5892 bounds of the outermost array are used.
5894 @item -fchkp-optimize
5895 @opindex fchkp-optimize
5896 @opindex fno-chkp-optimize
5897 Enables Pointer Bounds Checker optimizations.  Enabled by default at
5898 optimization levels @option{-O}, @option{-O2}, @option{-O3}.
5900 @item -fchkp-use-fast-string-functions
5901 @opindex fchkp-use-fast-string-functions
5902 @opindex fno-chkp-use-fast-string-functions
5903 Allow to use @code{*_nobnd} versions of string functions (not copying bounds)
5904 by Pointer Bounds Checker.  Disabled by default.
5906 @item -fchkp-use-nochk-string-functions
5907 @opindex fchkp-use-nochk-string-functions
5908 @opindex fno-chkp-use-nochk-string-functions
5909 Allow to use @code{*_nochk} versions of string functions (not checking bounds)
5910 by Pointer Bounds Checker.  Disabled by default.
5912 @item -fchkp-use-static-bounds
5913 @opindex fchkp-use-static-bounds
5914 @opindex fno-chkp-use-static-bounds
5915 Allow Pointer Bounds Checker to generate static bounds holding
5916 bounds of static variables.  Enabled by default.
5918 @item -fchkp-use-static-const-bounds
5919 @opindex fchkp-use-static-const-bounds
5920 @opindex fno-chkp-use-static-const-bounds
5921 Use statically initialized bounds for constant bounds instead of
5922 generating them each time it is required.  By default enabled when
5923 @option{-fchkp-use-static-bounds} is enabled.
5925 @item -fchkp-treat-zero-dynamic-size-as-infinite
5926 @opindex fchkp-treat-zero-dynamic-size-as-infinite
5927 @opindex fno-chkp-treat-zero-dynamic-size-as-infinite
5928 With this option zero size obtained dynamically for objects with
5929 incomplete type will be treated as infinite by Pointer Bounds
5930 Checker.  It may be helpful if program is linked with a library
5931 missing size information for some symbols.  Disabled by default.
5933 @item -fchkp-check-read
5934 @opindex fchkp-check-read
5935 @opindex fno-chkp-check-read
5936 Instructs Pointer Bounds Checker to generate checks for all read
5937 accesses to memory.  Enabled by default.
5939 @item -fchkp-check-write
5940 @opindex fchkp-check-write
5941 @opindex fno-chkp-check-write
5942 Instructs Pointer Bounds Checker to generate checks for all write
5943 accesses to memory.  Enabled by default.
5945 @item -fchkp-store-bounds
5946 @opindex fchkp-store-bounds
5947 @opindex fno-chkp-store-bounds
5948 Instructs Pointer Bounds Checker to generate bounds stores for
5949 pointer writes.  Enabled by default.
5951 @item -fchkp-instrument-calls
5952 @opindex fchkp-instrument-calls
5953 @opindex fno-chkp-instrument-calls
5954 Instructs Pointer Bounds Checker to pass pointer bounds to calls.
5955 Enabled by default.
5957 @item -fchkp-instrument-marked-only
5958 @opindex fchkp-instrument-marked-only
5959 @opindex fno-chkp-instrument-marked-only
5960 Instructs Pointer Bounds Checker to instrument only functions
5961 marked with @code{bnd_instrument} attribute.  Disabled by default.
5963 @item -fchkp-use-wrappers
5964 @opindex fchkp-use-wrappers
5965 @opindex fno-chkp-use-wrappers
5966 Allows Pointer Bounds Checker to replace calls to built-in function
5967 with calls to wrapper functions.  When the @option{-fchkp-use-wrappers}
5968 is used to link a program, the GCC driver automatically links
5969 agains @option{libmpxwrappers}.  See also @option{-static-libmpxwrappers}.
5970 Enabled by default.
5972 @item -fdump-final-insns@r{[}=@var{file}@r{]}
5973 @opindex fdump-final-insns
5974 Dump the final internal representation (RTL) to @var{file}.  If the
5975 optional argument is omitted (or if @var{file} is @code{.}), the name
5976 of the dump file is determined by appending @code{.gkd} to the
5977 compilation output file name.
5979 @item -fcompare-debug@r{[}=@var{opts}@r{]}
5980 @opindex fcompare-debug
5981 @opindex fno-compare-debug
5982 If no error occurs during compilation, run the compiler a second time,
5983 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
5984 passed to the second compilation.  Dump the final internal
5985 representation in both compilations, and print an error if they differ.
5987 If the equal sign is omitted, the default @option{-gtoggle} is used.
5989 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
5990 and nonzero, implicitly enables @option{-fcompare-debug}.  If
5991 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
5992 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
5993 is used.
5995 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
5996 is equivalent to @option{-fno-compare-debug}, which disables the dumping
5997 of the final representation and the second compilation, preventing even
5998 @env{GCC_COMPARE_DEBUG} from taking effect.
6000 To verify full coverage during @option{-fcompare-debug} testing, set
6001 @env{GCC_COMPARE_DEBUG} to say @option{-fcompare-debug-not-overridden},
6002 which GCC rejects as an invalid option in any actual compilation
6003 (rather than preprocessing, assembly or linking).  To get just a
6004 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
6005 not overridden} will do.
6007 @item -fcompare-debug-second
6008 @opindex fcompare-debug-second
6009 This option is implicitly passed to the compiler for the second
6010 compilation requested by @option{-fcompare-debug}, along with options to
6011 silence warnings, and omitting other options that would cause
6012 side-effect compiler outputs to files or to the standard output.  Dump
6013 files and preserved temporary files are renamed so as to contain the
6014 @code{.gk} additional extension during the second compilation, to avoid
6015 overwriting those generated by the first.
6017 When this option is passed to the compiler driver, it causes the
6018 @emph{first} compilation to be skipped, which makes it useful for little
6019 other than debugging the compiler proper.
6021 @item -feliminate-dwarf2-dups
6022 @opindex feliminate-dwarf2-dups
6023 Compress DWARF 2 debugging information by eliminating duplicated
6024 information about each symbol.  This option only makes sense when
6025 generating DWARF 2 debugging information with @option{-gdwarf-2}.
6027 @item -femit-struct-debug-baseonly
6028 @opindex femit-struct-debug-baseonly
6029 Emit debug information for struct-like types
6030 only when the base name of the compilation source file
6031 matches the base name of file in which the struct is defined.
6033 This option substantially reduces the size of debugging information,
6034 but at significant potential loss in type information to the debugger.
6035 See @option{-femit-struct-debug-reduced} for a less aggressive option.
6036 See @option{-femit-struct-debug-detailed} for more detailed control.
6038 This option works only with DWARF 2.
6040 @item -femit-struct-debug-reduced
6041 @opindex femit-struct-debug-reduced
6042 Emit debug information for struct-like types
6043 only when the base name of the compilation source file
6044 matches the base name of file in which the type is defined,
6045 unless the struct is a template or defined in a system header.
6047 This option significantly reduces the size of debugging information,
6048 with some potential loss in type information to the debugger.
6049 See @option{-femit-struct-debug-baseonly} for a more 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-detailed@r{[}=@var{spec-list}@r{]}
6055 @opindex femit-struct-debug-detailed
6056 Specify the struct-like types
6057 for which the compiler generates debug information.
6058 The intent is to reduce duplicate struct debug information
6059 between different object files within the same program.
6061 This option is a detailed version of
6062 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
6063 which serves for most needs.
6065 A specification has the syntax@*
6066 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
6068 The optional first word limits the specification to
6069 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
6070 A struct type is used directly when it is the type of a variable, member.
6071 Indirect uses arise through pointers to structs.
6072 That is, when use of an incomplete struct is valid, the use is indirect.
6073 An example is
6074 @samp{struct one direct; struct two * indirect;}.
6076 The optional second word limits the specification to
6077 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
6078 Generic structs are a bit complicated to explain.
6079 For C++, these are non-explicit specializations of template classes,
6080 or non-template classes within the above.
6081 Other programming languages have generics,
6082 but @option{-femit-struct-debug-detailed} does not yet implement them.
6084 The third word specifies the source files for those
6085 structs for which the compiler should emit debug information.
6086 The values @samp{none} and @samp{any} have the normal meaning.
6087 The value @samp{base} means that
6088 the base of name of the file in which the type declaration appears
6089 must match the base of the name of the main compilation file.
6090 In practice, this means that when compiling @file{foo.c}, debug information
6091 is generated for types declared in that file and @file{foo.h},
6092 but not other header files.
6093 The value @samp{sys} means those types satisfying @samp{base}
6094 or declared in system or compiler headers.
6096 You may need to experiment to determine the best settings for your application.
6098 The default is @option{-femit-struct-debug-detailed=all}.
6100 This option works only with DWARF 2.
6102 @item -fno-merge-debug-strings
6103 @opindex fmerge-debug-strings
6104 @opindex fno-merge-debug-strings
6105 Direct the linker to not merge together strings in the debugging
6106 information that are identical in different object files.  Merging is
6107 not supported by all assemblers or linkers.  Merging decreases the size
6108 of the debug information in the output file at the cost of increasing
6109 link processing time.  Merging is enabled by default.
6111 @item -fdebug-prefix-map=@var{old}=@var{new}
6112 @opindex fdebug-prefix-map
6113 When compiling files in directory @file{@var{old}}, record debugging
6114 information describing them as in @file{@var{new}} instead.
6116 @item -fno-dwarf2-cfi-asm
6117 @opindex fdwarf2-cfi-asm
6118 @opindex fno-dwarf2-cfi-asm
6119 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
6120 instead of using GAS @code{.cfi_*} directives.
6122 @cindex @command{prof}
6123 @item -p
6124 @opindex p
6125 Generate extra code to write profile information suitable for the
6126 analysis program @command{prof}.  You must use this option when compiling
6127 the source files you want data about, and you must also use it when
6128 linking.
6130 @cindex @command{gprof}
6131 @item -pg
6132 @opindex pg
6133 Generate extra code to write profile information suitable for the
6134 analysis program @command{gprof}.  You must use this option when compiling
6135 the source files you want data about, and you must also use it when
6136 linking.
6138 @item -Q
6139 @opindex Q
6140 Makes the compiler print out each function name as it is compiled, and
6141 print some statistics about each pass when it finishes.
6143 @item -ftime-report
6144 @opindex ftime-report
6145 Makes the compiler print some statistics about the time consumed by each
6146 pass when it finishes.
6148 @item -fmem-report
6149 @opindex fmem-report
6150 Makes the compiler print some statistics about permanent memory
6151 allocation when it finishes.
6153 @item -fmem-report-wpa
6154 @opindex fmem-report-wpa
6155 Makes the compiler print some statistics about permanent memory
6156 allocation for the WPA phase only.
6158 @item -fpre-ipa-mem-report
6159 @opindex fpre-ipa-mem-report
6160 @item -fpost-ipa-mem-report
6161 @opindex fpost-ipa-mem-report
6162 Makes the compiler print some statistics about permanent memory
6163 allocation before or after interprocedural optimization.
6165 @item -fprofile-report
6166 @opindex fprofile-report
6167 Makes the compiler print some statistics about consistency of the
6168 (estimated) profile and effect of individual passes.
6170 @item -fstack-usage
6171 @opindex fstack-usage
6172 Makes the compiler output stack usage information for the program, on a
6173 per-function basis.  The filename for the dump is made by appending
6174 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
6175 the output file, if explicitly specified and it is not an executable,
6176 otherwise it is the basename of the source file.  An entry is made up
6177 of three fields:
6179 @itemize
6180 @item
6181 The name of the function.
6182 @item
6183 A number of bytes.
6184 @item
6185 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
6186 @end itemize
6188 The qualifier @code{static} means that the function manipulates the stack
6189 statically: a fixed number of bytes are allocated for the frame on function
6190 entry and released on function exit; no stack adjustments are otherwise made
6191 in the function.  The second field is this fixed number of bytes.
6193 The qualifier @code{dynamic} means that the function manipulates the stack
6194 dynamically: in addition to the static allocation described above, stack
6195 adjustments are made in the body of the function, for example to push/pop
6196 arguments around function calls.  If the qualifier @code{bounded} is also
6197 present, the amount of these adjustments is bounded at compile time and
6198 the second field is an upper bound of the total amount of stack used by
6199 the function.  If it is not present, the amount of these adjustments is
6200 not bounded at compile time and the second field only represents the
6201 bounded part.
6203 @item -fprofile-arcs
6204 @opindex fprofile-arcs
6205 Add code so that program flow @dfn{arcs} are instrumented.  During
6206 execution the program records how many times each branch and call is
6207 executed and how many times it is taken or returns.  When the compiled
6208 program exits it saves this data to a file called
6209 @file{@var{auxname}.gcda} for each source file.  The data may be used for
6210 profile-directed optimizations (@option{-fbranch-probabilities}), or for
6211 test coverage analysis (@option{-ftest-coverage}).  Each object file's
6212 @var{auxname} is generated from the name of the output file, if
6213 explicitly specified and it is not the final executable, otherwise it is
6214 the basename of the source file.  In both cases any suffix is removed
6215 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
6216 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
6217 @xref{Cross-profiling}.
6219 @cindex @command{gcov}
6220 @item --coverage
6221 @opindex coverage
6223 This option is used to compile and link code instrumented for coverage
6224 analysis.  The option is a synonym for @option{-fprofile-arcs}
6225 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
6226 linking).  See the documentation for those options for more details.
6228 @itemize
6230 @item
6231 Compile the source files with @option{-fprofile-arcs} plus optimization
6232 and code generation options.  For test coverage analysis, use the
6233 additional @option{-ftest-coverage} option.  You do not need to profile
6234 every source file in a program.
6236 @item
6237 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
6238 (the latter implies the former).
6240 @item
6241 Run the program on a representative workload to generate the arc profile
6242 information.  This may be repeated any number of times.  You can run
6243 concurrent instances of your program, and provided that the file system
6244 supports locking, the data files will be correctly updated.  Also
6245 @code{fork} calls are detected and correctly handled (double counting
6246 will not happen).
6248 @item
6249 For profile-directed optimizations, compile the source files again with
6250 the same optimization and code generation options plus
6251 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
6252 Control Optimization}).
6254 @item
6255 For test coverage analysis, use @command{gcov} to produce human readable
6256 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
6257 @command{gcov} documentation for further information.
6259 @end itemize
6261 With @option{-fprofile-arcs}, for each function of your program GCC
6262 creates a program flow graph, then finds a spanning tree for the graph.
6263 Only arcs that are not on the spanning tree have to be instrumented: the
6264 compiler adds code to count the number of times that these arcs are
6265 executed.  When an arc is the only exit or only entrance to a block, the
6266 instrumentation code can be added to the block; otherwise, a new basic
6267 block must be created to hold the instrumentation code.
6269 @need 2000
6270 @item -ftest-coverage
6271 @opindex ftest-coverage
6272 Produce a notes file that the @command{gcov} code-coverage utility
6273 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
6274 show program coverage.  Each source file's note file is called
6275 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
6276 above for a description of @var{auxname} and instructions on how to
6277 generate test coverage data.  Coverage data matches the source files
6278 more closely if you do not optimize.
6280 @item -fdbg-cnt-list
6281 @opindex fdbg-cnt-list
6282 Print the name and the counter upper bound for all debug counters.
6285 @item -fdbg-cnt=@var{counter-value-list}
6286 @opindex fdbg-cnt
6287 Set the internal debug counter upper bound.  @var{counter-value-list}
6288 is a comma-separated list of @var{name}:@var{value} pairs
6289 which sets the upper bound of each debug counter @var{name} to @var{value}.
6290 All debug counters have the initial upper bound of @code{UINT_MAX};
6291 thus @code{dbg_cnt} returns true always unless the upper bound
6292 is set by this option.
6293 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
6294 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
6296 @item -fenable-@var{kind}-@var{pass}
6297 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
6298 @opindex fdisable-
6299 @opindex fenable-
6301 This is a set of options that are used to explicitly disable/enable
6302 optimization passes.  These options are intended for use for debugging GCC.
6303 Compiler users should use regular options for enabling/disabling
6304 passes instead.
6306 @table @gcctabopt
6308 @item -fdisable-ipa-@var{pass}
6309 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
6310 statically invoked in the compiler multiple times, the pass name should be
6311 appended with a sequential number starting from 1.
6313 @item -fdisable-rtl-@var{pass}
6314 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
6315 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
6316 statically invoked in the compiler multiple times, the pass name should be
6317 appended with a sequential number starting from 1.  @var{range-list} is a 
6318 comma-separated list of function ranges or assembler names.  Each range is a number
6319 pair separated by a colon.  The range is inclusive in both ends.  If the range
6320 is trivial, the number pair can be simplified as a single number.  If the
6321 function's call graph node's @var{uid} falls within one of the specified ranges,
6322 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
6323 function header of a dump file, and the pass names can be dumped by using
6324 option @option{-fdump-passes}.
6326 @item -fdisable-tree-@var{pass}
6327 @itemx -fdisable-tree-@var{pass}=@var{range-list}
6328 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
6329 option arguments.
6331 @item -fenable-ipa-@var{pass}
6332 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
6333 statically invoked in the compiler multiple times, the pass name should be
6334 appended with a sequential number starting from 1.
6336 @item -fenable-rtl-@var{pass}
6337 @itemx -fenable-rtl-@var{pass}=@var{range-list}
6338 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
6339 description and examples.
6341 @item -fenable-tree-@var{pass}
6342 @itemx -fenable-tree-@var{pass}=@var{range-list}
6343 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
6344 of option arguments.
6346 @end table
6348 Here are some examples showing uses of these options.
6350 @smallexample
6352 # disable ccp1 for all functions
6353    -fdisable-tree-ccp1
6354 # disable complete unroll for function whose cgraph node uid is 1
6355    -fenable-tree-cunroll=1
6356 # disable gcse2 for functions at the following ranges [1,1],
6357 # [300,400], and [400,1000]
6358 # disable gcse2 for functions foo and foo2
6359    -fdisable-rtl-gcse2=foo,foo2
6360 # disable early inlining
6361    -fdisable-tree-einline
6362 # disable ipa inlining
6363    -fdisable-ipa-inline
6364 # enable tree full unroll
6365    -fenable-tree-unroll
6367 @end smallexample
6369 @item -d@var{letters}
6370 @itemx -fdump-rtl-@var{pass}
6371 @itemx -fdump-rtl-@var{pass}=@var{filename}
6372 @opindex d
6373 @opindex fdump-rtl-@var{pass}
6374 Says to make debugging dumps during compilation at times specified by
6375 @var{letters}.  This is used for debugging the RTL-based passes of the
6376 compiler.  The file names for most of the dumps are made by appending
6377 a pass number and a word to the @var{dumpname}, and the files are
6378 created in the directory of the output file. In case of
6379 @option{=@var{filename}} option, the dump is output on the given file
6380 instead of the pass numbered dump files. Note that the pass number is
6381 computed statically as passes get registered into the pass manager.
6382 Thus the numbering is not related to the dynamic order of execution of
6383 passes.  In particular, a pass installed by a plugin could have a
6384 number over 200 even if it executed quite early.  @var{dumpname} is
6385 generated from the name of the output file, if explicitly specified
6386 and it is not an executable, otherwise it is the basename of the
6387 source file. These switches may have different effects when
6388 @option{-E} is used for preprocessing.
6390 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
6391 @option{-d} option @var{letters}.  Here are the possible
6392 letters for use in @var{pass} and @var{letters}, and their meanings:
6394 @table @gcctabopt
6396 @item -fdump-rtl-alignments
6397 @opindex fdump-rtl-alignments
6398 Dump after branch alignments have been computed.
6400 @item -fdump-rtl-asmcons
6401 @opindex fdump-rtl-asmcons
6402 Dump after fixing rtl statements that have unsatisfied in/out constraints.
6404 @item -fdump-rtl-auto_inc_dec
6405 @opindex fdump-rtl-auto_inc_dec
6406 Dump after auto-inc-dec discovery.  This pass is only run on
6407 architectures that have auto inc or auto dec instructions.
6409 @item -fdump-rtl-barriers
6410 @opindex fdump-rtl-barriers
6411 Dump after cleaning up the barrier instructions.
6413 @item -fdump-rtl-bbpart
6414 @opindex fdump-rtl-bbpart
6415 Dump after partitioning hot and cold basic blocks.
6417 @item -fdump-rtl-bbro
6418 @opindex fdump-rtl-bbro
6419 Dump after block reordering.
6421 @item -fdump-rtl-btl1
6422 @itemx -fdump-rtl-btl2
6423 @opindex fdump-rtl-btl2
6424 @opindex fdump-rtl-btl2
6425 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
6426 after the two branch
6427 target load optimization passes.
6429 @item -fdump-rtl-bypass
6430 @opindex fdump-rtl-bypass
6431 Dump after jump bypassing and control flow optimizations.
6433 @item -fdump-rtl-combine
6434 @opindex fdump-rtl-combine
6435 Dump after the RTL instruction combination pass.
6437 @item -fdump-rtl-compgotos
6438 @opindex fdump-rtl-compgotos
6439 Dump after duplicating the computed gotos.
6441 @item -fdump-rtl-ce1
6442 @itemx -fdump-rtl-ce2
6443 @itemx -fdump-rtl-ce3
6444 @opindex fdump-rtl-ce1
6445 @opindex fdump-rtl-ce2
6446 @opindex fdump-rtl-ce3
6447 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
6448 @option{-fdump-rtl-ce3} enable dumping after the three
6449 if conversion passes.
6451 @item -fdump-rtl-cprop_hardreg
6452 @opindex fdump-rtl-cprop_hardreg
6453 Dump after hard register copy propagation.
6455 @item -fdump-rtl-csa
6456 @opindex fdump-rtl-csa
6457 Dump after combining stack adjustments.
6459 @item -fdump-rtl-cse1
6460 @itemx -fdump-rtl-cse2
6461 @opindex fdump-rtl-cse1
6462 @opindex fdump-rtl-cse2
6463 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
6464 the two common subexpression elimination passes.
6466 @item -fdump-rtl-dce
6467 @opindex fdump-rtl-dce
6468 Dump after the standalone dead code elimination passes.
6470 @item -fdump-rtl-dbr
6471 @opindex fdump-rtl-dbr
6472 Dump after delayed branch scheduling.
6474 @item -fdump-rtl-dce1
6475 @itemx -fdump-rtl-dce2
6476 @opindex fdump-rtl-dce1
6477 @opindex fdump-rtl-dce2
6478 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
6479 the two dead store elimination passes.
6481 @item -fdump-rtl-eh
6482 @opindex fdump-rtl-eh
6483 Dump after finalization of EH handling code.
6485 @item -fdump-rtl-eh_ranges
6486 @opindex fdump-rtl-eh_ranges
6487 Dump after conversion of EH handling range regions.
6489 @item -fdump-rtl-expand
6490 @opindex fdump-rtl-expand
6491 Dump after RTL generation.
6493 @item -fdump-rtl-fwprop1
6494 @itemx -fdump-rtl-fwprop2
6495 @opindex fdump-rtl-fwprop1
6496 @opindex fdump-rtl-fwprop2
6497 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
6498 dumping after the two forward propagation passes.
6500 @item -fdump-rtl-gcse1
6501 @itemx -fdump-rtl-gcse2
6502 @opindex fdump-rtl-gcse1
6503 @opindex fdump-rtl-gcse2
6504 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
6505 after global common subexpression elimination.
6507 @item -fdump-rtl-init-regs
6508 @opindex fdump-rtl-init-regs
6509 Dump after the initialization of the registers.
6511 @item -fdump-rtl-initvals
6512 @opindex fdump-rtl-initvals
6513 Dump after the computation of the initial value sets.
6515 @item -fdump-rtl-into_cfglayout
6516 @opindex fdump-rtl-into_cfglayout
6517 Dump after converting to cfglayout mode.
6519 @item -fdump-rtl-ira
6520 @opindex fdump-rtl-ira
6521 Dump after iterated register allocation.
6523 @item -fdump-rtl-jump
6524 @opindex fdump-rtl-jump
6525 Dump after the second jump optimization.
6527 @item -fdump-rtl-loop2
6528 @opindex fdump-rtl-loop2
6529 @option{-fdump-rtl-loop2} enables dumping after the rtl
6530 loop optimization passes.
6532 @item -fdump-rtl-mach
6533 @opindex fdump-rtl-mach
6534 Dump after performing the machine dependent reorganization pass, if that
6535 pass exists.
6537 @item -fdump-rtl-mode_sw
6538 @opindex fdump-rtl-mode_sw
6539 Dump after removing redundant mode switches.
6541 @item -fdump-rtl-rnreg
6542 @opindex fdump-rtl-rnreg
6543 Dump after register renumbering.
6545 @item -fdump-rtl-outof_cfglayout
6546 @opindex fdump-rtl-outof_cfglayout
6547 Dump after converting from cfglayout mode.
6549 @item -fdump-rtl-peephole2
6550 @opindex fdump-rtl-peephole2
6551 Dump after the peephole pass.
6553 @item -fdump-rtl-postreload
6554 @opindex fdump-rtl-postreload
6555 Dump after post-reload optimizations.
6557 @item -fdump-rtl-pro_and_epilogue
6558 @opindex fdump-rtl-pro_and_epilogue
6559 Dump after generating the function prologues and epilogues.
6561 @item -fdump-rtl-sched1
6562 @itemx -fdump-rtl-sched2
6563 @opindex fdump-rtl-sched1
6564 @opindex fdump-rtl-sched2
6565 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
6566 after the basic block scheduling passes.
6568 @item -fdump-rtl-ree
6569 @opindex fdump-rtl-ree
6570 Dump after sign/zero extension elimination.
6572 @item -fdump-rtl-seqabstr
6573 @opindex fdump-rtl-seqabstr
6574 Dump after common sequence discovery.
6576 @item -fdump-rtl-shorten
6577 @opindex fdump-rtl-shorten
6578 Dump after shortening branches.
6580 @item -fdump-rtl-sibling
6581 @opindex fdump-rtl-sibling
6582 Dump after sibling call optimizations.
6584 @item -fdump-rtl-split1
6585 @itemx -fdump-rtl-split2
6586 @itemx -fdump-rtl-split3
6587 @itemx -fdump-rtl-split4
6588 @itemx -fdump-rtl-split5
6589 @opindex fdump-rtl-split1
6590 @opindex fdump-rtl-split2
6591 @opindex fdump-rtl-split3
6592 @opindex fdump-rtl-split4
6593 @opindex fdump-rtl-split5
6594 These options enable dumping after five rounds of
6595 instruction splitting.
6597 @item -fdump-rtl-sms
6598 @opindex fdump-rtl-sms
6599 Dump after modulo scheduling.  This pass is only run on some
6600 architectures.
6602 @item -fdump-rtl-stack
6603 @opindex fdump-rtl-stack
6604 Dump after conversion from GCC's ``flat register file'' registers to the
6605 x87's stack-like registers.  This pass is only run on x86 variants.
6607 @item -fdump-rtl-subreg1
6608 @itemx -fdump-rtl-subreg2
6609 @opindex fdump-rtl-subreg1
6610 @opindex fdump-rtl-subreg2
6611 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
6612 the two subreg expansion passes.
6614 @item -fdump-rtl-unshare
6615 @opindex fdump-rtl-unshare
6616 Dump after all rtl has been unshared.
6618 @item -fdump-rtl-vartrack
6619 @opindex fdump-rtl-vartrack
6620 Dump after variable tracking.
6622 @item -fdump-rtl-vregs
6623 @opindex fdump-rtl-vregs
6624 Dump after converting virtual registers to hard registers.
6626 @item -fdump-rtl-web
6627 @opindex fdump-rtl-web
6628 Dump after live range splitting.
6630 @item -fdump-rtl-regclass
6631 @itemx -fdump-rtl-subregs_of_mode_init
6632 @itemx -fdump-rtl-subregs_of_mode_finish
6633 @itemx -fdump-rtl-dfinit
6634 @itemx -fdump-rtl-dfinish
6635 @opindex fdump-rtl-regclass
6636 @opindex fdump-rtl-subregs_of_mode_init
6637 @opindex fdump-rtl-subregs_of_mode_finish
6638 @opindex fdump-rtl-dfinit
6639 @opindex fdump-rtl-dfinish
6640 These dumps are defined but always produce empty files.
6642 @item -da
6643 @itemx -fdump-rtl-all
6644 @opindex da
6645 @opindex fdump-rtl-all
6646 Produce all the dumps listed above.
6648 @item -dA
6649 @opindex dA
6650 Annotate the assembler output with miscellaneous debugging information.
6652 @item -dD
6653 @opindex dD
6654 Dump all macro definitions, at the end of preprocessing, in addition to
6655 normal output.
6657 @item -dH
6658 @opindex dH
6659 Produce a core dump whenever an error occurs.
6661 @item -dp
6662 @opindex dp
6663 Annotate the assembler output with a comment indicating which
6664 pattern and alternative is used.  The length of each instruction is
6665 also printed.
6667 @item -dP
6668 @opindex dP
6669 Dump the RTL in the assembler output as a comment before each instruction.
6670 Also turns on @option{-dp} annotation.
6672 @item -dx
6673 @opindex dx
6674 Just generate RTL for a function instead of compiling it.  Usually used
6675 with @option{-fdump-rtl-expand}.
6676 @end table
6678 @item -fdump-noaddr
6679 @opindex fdump-noaddr
6680 When doing debugging dumps, suppress address output.  This makes it more
6681 feasible to use diff on debugging dumps for compiler invocations with
6682 different compiler binaries and/or different
6683 text / bss / data / heap / stack / dso start locations.
6685 @item -freport-bug
6686 @opindex freport-bug
6687 Collect and dump debug information into temporary file if ICE in C/C++
6688 compiler occured.
6690 @item -fdump-unnumbered
6691 @opindex fdump-unnumbered
6692 When doing debugging dumps, suppress instruction numbers and address output.
6693 This makes it more feasible to use diff on debugging dumps for compiler
6694 invocations with different options, in particular with and without
6695 @option{-g}.
6697 @item -fdump-unnumbered-links
6698 @opindex fdump-unnumbered-links
6699 When doing debugging dumps (see @option{-d} option above), suppress
6700 instruction numbers for the links to the previous and next instructions
6701 in a sequence.
6703 @item -fdump-translation-unit @r{(C++ only)}
6704 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
6705 @opindex fdump-translation-unit
6706 Dump a representation of the tree structure for the entire translation
6707 unit to a file.  The file name is made by appending @file{.tu} to the
6708 source file name, and the file is created in the same directory as the
6709 output file.  If the @samp{-@var{options}} form is used, @var{options}
6710 controls the details of the dump as described for the
6711 @option{-fdump-tree} options.
6713 @item -fdump-class-hierarchy @r{(C++ only)}
6714 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
6715 @opindex fdump-class-hierarchy
6716 Dump a representation of each class's hierarchy and virtual function
6717 table layout to a file.  The file name is made by appending
6718 @file{.class} to the source file name, and the file is created in the
6719 same directory as the output file.  If the @samp{-@var{options}} form
6720 is used, @var{options} controls the details of the dump as described
6721 for the @option{-fdump-tree} options.
6723 @item -fdump-ipa-@var{switch}
6724 @opindex fdump-ipa
6725 Control the dumping at various stages of inter-procedural analysis
6726 language tree to a file.  The file name is generated by appending a
6727 switch specific suffix to the source file name, and the file is created
6728 in the same directory as the output file.  The following dumps are
6729 possible:
6731 @table @samp
6732 @item all
6733 Enables all inter-procedural analysis dumps.
6735 @item cgraph
6736 Dumps information about call-graph optimization, unused function removal,
6737 and inlining decisions.
6739 @item inline
6740 Dump after function inlining.
6742 @end table
6744 @item -fdump-passes
6745 @opindex fdump-passes
6746 Dump the list of optimization passes that are turned on and off by
6747 the current command-line options.
6749 @item -fdump-statistics-@var{option}
6750 @opindex fdump-statistics
6751 Enable and control dumping of pass statistics in a separate file.  The
6752 file name is generated by appending a suffix ending in
6753 @samp{.statistics} to the source file name, and the file is created in
6754 the same directory as the output file.  If the @samp{-@var{option}}
6755 form is used, @samp{-stats} causes counters to be summed over the
6756 whole compilation unit while @samp{-details} dumps every event as
6757 the passes generate them.  The default with no option is to sum
6758 counters for each function compiled.
6760 @item -fdump-tree-@var{switch}
6761 @itemx -fdump-tree-@var{switch}-@var{options}
6762 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
6763 @opindex fdump-tree
6764 Control the dumping at various stages of processing the intermediate
6765 language tree to a file.  The file name is generated by appending a
6766 switch-specific suffix to the source file name, and the file is
6767 created in the same directory as the output file. In case of
6768 @option{=@var{filename}} option, the dump is output on the given file
6769 instead of the auto named dump files.  If the @samp{-@var{options}}
6770 form is used, @var{options} is a list of @samp{-} separated options
6771 which control the details of the dump.  Not all options are applicable
6772 to all dumps; those that are not meaningful are ignored.  The
6773 following options are available
6775 @table @samp
6776 @item address
6777 Print the address of each node.  Usually this is not meaningful as it
6778 changes according to the environment and source file.  Its primary use
6779 is for tying up a dump file with a debug environment.
6780 @item asmname
6781 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
6782 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
6783 use working backward from mangled names in the assembly file.
6784 @item slim
6785 When dumping front-end intermediate representations, inhibit dumping
6786 of members of a scope or body of a function merely because that scope
6787 has been reached.  Only dump such items when they are directly reachable
6788 by some other path.
6790 When dumping pretty-printed trees, this option inhibits dumping the
6791 bodies of control structures.
6793 When dumping RTL, print the RTL in slim (condensed) form instead of
6794 the default LISP-like representation.
6795 @item raw
6796 Print a raw representation of the tree.  By default, trees are
6797 pretty-printed into a C-like representation.
6798 @item details
6799 Enable more detailed dumps (not honored by every dump option). Also
6800 include information from the optimization passes.
6801 @item stats
6802 Enable dumping various statistics about the pass (not honored by every dump
6803 option).
6804 @item blocks
6805 Enable showing basic block boundaries (disabled in raw dumps).
6806 @item graph
6807 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
6808 dump a representation of the control flow graph suitable for viewing with
6809 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
6810 the file is pretty-printed as a subgraph, so that GraphViz can render them
6811 all in a single plot.
6813 This option currently only works for RTL dumps, and the RTL is always
6814 dumped in slim form.
6815 @item vops
6816 Enable showing virtual operands for every statement.
6817 @item lineno
6818 Enable showing line numbers for statements.
6819 @item uid
6820 Enable showing the unique ID (@code{DECL_UID}) for each variable.
6821 @item verbose
6822 Enable showing the tree dump for each statement.
6823 @item eh
6824 Enable showing the EH region number holding each statement.
6825 @item scev
6826 Enable showing scalar evolution analysis details.
6827 @item optimized
6828 Enable showing optimization information (only available in certain
6829 passes).
6830 @item missed
6831 Enable showing missed optimization information (only available in certain
6832 passes).
6833 @item note
6834 Enable other detailed optimization information (only available in
6835 certain passes).
6836 @item =@var{filename}
6837 Instead of an auto named dump file, output into the given file
6838 name. The file names @file{stdout} and @file{stderr} are treated
6839 specially and are considered already open standard streams. For
6840 example,
6842 @smallexample
6843 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
6844      -fdump-tree-pre=stderr file.c
6845 @end smallexample
6847 outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
6848 output on to @file{stderr}. If two conflicting dump filenames are
6849 given for the same pass, then the latter option overrides the earlier
6850 one.
6852 @item all
6853 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
6854 and @option{lineno}.
6856 @item optall
6857 Turn on all optimization options, i.e., @option{optimized},
6858 @option{missed}, and @option{note}.
6859 @end table
6861 The following tree dumps are possible:
6862 @table @samp
6864 @item original
6865 @opindex fdump-tree-original
6866 Dump before any tree based optimization, to @file{@var{file}.original}.
6868 @item optimized
6869 @opindex fdump-tree-optimized
6870 Dump after all tree based optimization, to @file{@var{file}.optimized}.
6872 @item gimple
6873 @opindex fdump-tree-gimple
6874 Dump each function before and after the gimplification pass to a file.  The
6875 file name is made by appending @file{.gimple} to the source file name.
6877 @item cfg
6878 @opindex fdump-tree-cfg
6879 Dump the control flow graph of each function to a file.  The file name is
6880 made by appending @file{.cfg} to the source file name.
6882 @item ch
6883 @opindex fdump-tree-ch
6884 Dump each function after copying loop headers.  The file name is made by
6885 appending @file{.ch} to the source file name.
6887 @item ssa
6888 @opindex fdump-tree-ssa
6889 Dump SSA related information to a file.  The file name is made by appending
6890 @file{.ssa} to the source file name.
6892 @item alias
6893 @opindex fdump-tree-alias
6894 Dump aliasing information for each function.  The file name is made by
6895 appending @file{.alias} to the source file name.
6897 @item ccp
6898 @opindex fdump-tree-ccp
6899 Dump each function after CCP@.  The file name is made by appending
6900 @file{.ccp} to the source file name.
6902 @item storeccp
6903 @opindex fdump-tree-storeccp
6904 Dump each function after STORE-CCP@.  The file name is made by appending
6905 @file{.storeccp} to the source file name.
6907 @item pre
6908 @opindex fdump-tree-pre
6909 Dump trees after partial redundancy elimination.  The file name is made
6910 by appending @file{.pre} to the source file name.
6912 @item fre
6913 @opindex fdump-tree-fre
6914 Dump trees after full redundancy elimination.  The file name is made
6915 by appending @file{.fre} to the source file name.
6917 @item copyprop
6918 @opindex fdump-tree-copyprop
6919 Dump trees after copy propagation.  The file name is made
6920 by appending @file{.copyprop} to the source file name.
6922 @item store_copyprop
6923 @opindex fdump-tree-store_copyprop
6924 Dump trees after store copy-propagation.  The file name is made
6925 by appending @file{.store_copyprop} to the source file name.
6927 @item dce
6928 @opindex fdump-tree-dce
6929 Dump each function after dead code elimination.  The file name is made by
6930 appending @file{.dce} to the source file name.
6932 @item sra
6933 @opindex fdump-tree-sra
6934 Dump each function after performing scalar replacement of aggregates.  The
6935 file name is made by appending @file{.sra} to the source file name.
6937 @item sink
6938 @opindex fdump-tree-sink
6939 Dump each function after performing code sinking.  The file name is made
6940 by appending @file{.sink} to the source file name.
6942 @item dom
6943 @opindex fdump-tree-dom
6944 Dump each function after applying dominator tree optimizations.  The file
6945 name is made by appending @file{.dom} to the source file name.
6947 @item dse
6948 @opindex fdump-tree-dse
6949 Dump each function after applying dead store elimination.  The file
6950 name is made by appending @file{.dse} to the source file name.
6952 @item phiopt
6953 @opindex fdump-tree-phiopt
6954 Dump each function after optimizing PHI nodes into straightline code.  The file
6955 name is made by appending @file{.phiopt} to the source file name.
6957 @item forwprop
6958 @opindex fdump-tree-forwprop
6959 Dump each function after forward propagating single use variables.  The file
6960 name is made by appending @file{.forwprop} to the source file name.
6962 @item copyrename
6963 @opindex fdump-tree-copyrename
6964 Dump each function after applying the copy rename optimization.  The file
6965 name is made by appending @file{.copyrename} to the source file name.
6967 @item nrv
6968 @opindex fdump-tree-nrv
6969 Dump each function after applying the named return value optimization on
6970 generic trees.  The file name is made by appending @file{.nrv} to the source
6971 file name.
6973 @item vect
6974 @opindex fdump-tree-vect
6975 Dump each function after applying vectorization of loops.  The file name is
6976 made by appending @file{.vect} to the source file name.
6978 @item slp
6979 @opindex fdump-tree-slp
6980 Dump each function after applying vectorization of basic blocks.  The file name
6981 is made by appending @file{.slp} to the source file name.
6983 @item vrp
6984 @opindex fdump-tree-vrp
6985 Dump each function after Value Range Propagation (VRP).  The file name
6986 is made by appending @file{.vrp} to the source file name.
6988 @item all
6989 @opindex fdump-tree-all
6990 Enable all the available tree dumps with the flags provided in this option.
6991 @end table
6993 @item -fopt-info
6994 @itemx -fopt-info-@var{options}
6995 @itemx -fopt-info-@var{options}=@var{filename}
6996 @opindex fopt-info
6997 Controls optimization dumps from various optimization passes. If the
6998 @samp{-@var{options}} form is used, @var{options} is a list of
6999 @samp{-} separated option keywords to select the dump details and
7000 optimizations.  
7002 The @var{options} can be divided into two groups: options describing the
7003 verbosity of the dump, and options describing which optimizations
7004 should be included. The options from both the groups can be freely
7005 mixed as they are non-overlapping. However, in case of any conflicts,
7006 the later options override the earlier options on the command
7007 line. 
7009 The following options control the dump verbosity:
7011 @table @samp
7012 @item optimized
7013 Print information when an optimization is successfully applied. It is
7014 up to a pass to decide which information is relevant. For example, the
7015 vectorizer passes print the source location of loops which are
7016 successfully vectorized.
7017 @item missed
7018 Print information about missed optimizations. Individual passes
7019 control which information to include in the output. 
7020 @item note
7021 Print verbose information about optimizations, such as certain
7022 transformations, more detailed messages about decisions etc.
7023 @item all
7024 Print detailed optimization information. This includes
7025 @samp{optimized}, @samp{missed}, and @samp{note}.
7026 @end table
7028 One or more of the following option keywords can be used to describe a
7029 group of optimizations:
7031 @table @samp
7032 @item ipa
7033 Enable dumps from all interprocedural optimizations.
7034 @item loop
7035 Enable dumps from all loop optimizations.
7036 @item inline
7037 Enable dumps from all inlining optimizations.
7038 @item vec
7039 Enable dumps from all vectorization optimizations.
7040 @item optall
7041 Enable dumps from all optimizations. This is a superset of
7042 the optimization groups listed above.
7043 @end table
7045 If @var{options} is
7046 omitted, it defaults to @samp{optimized-optall}, which means to dump all
7047 info about successful optimizations from all the passes.  
7049 If the @var{filename} is provided, then the dumps from all the
7050 applicable optimizations are concatenated into the @var{filename}.
7051 Otherwise the dump is output onto @file{stderr}. Though multiple
7052 @option{-fopt-info} options are accepted, only one of them can include
7053 a @var{filename}. If other filenames are provided then all but the
7054 first such option are ignored.
7056 Note that the output @var{filename} is overwritten
7057 in case of multiple translation units. If a combined output from
7058 multiple translation units is desired, @file{stderr} should be used
7059 instead.
7061 In the following example, the optimization info is output to
7062 @file{stderr}:
7064 @smallexample
7065 gcc -O3 -fopt-info
7066 @end smallexample
7068 This example:
7069 @smallexample
7070 gcc -O3 -fopt-info-missed=missed.all
7071 @end smallexample
7073 @noindent
7074 outputs missed optimization report from all the passes into
7075 @file{missed.all}, and this one:
7077 @smallexample
7078 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
7079 @end smallexample
7081 @noindent
7082 prints information about missed optimization opportunities from
7083 vectorization passes on @file{stderr}.  
7084 Note that @option{-fopt-info-vec-missed} is equivalent to 
7085 @option{-fopt-info-missed-vec}.
7087 As another example,
7088 @smallexample
7089 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
7090 @end smallexample
7092 @noindent
7093 outputs information about missed optimizations as well as
7094 optimized locations from all the inlining passes into
7095 @file{inline.txt}.
7097 Finally, consider:
7099 @smallexample
7100 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
7101 @end smallexample
7103 @noindent
7104 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
7105 in conflict since only one output file is allowed. In this case, only
7106 the first option takes effect and the subsequent options are
7107 ignored. Thus only @file{vec.miss} is produced which contains
7108 dumps from the vectorizer about missed opportunities.
7110 @item -frandom-seed=@var{number}
7111 @opindex frandom-seed
7112 This option provides a seed that GCC uses in place of
7113 random numbers in generating certain symbol names
7114 that have to be different in every compiled file.  It is also used to
7115 place unique stamps in coverage data files and the object files that
7116 produce them.  You can use the @option{-frandom-seed} option to produce
7117 reproducibly identical object files.
7119 The @var{number} should be different for every file you compile.
7121 @item -fsched-verbose=@var{n}
7122 @opindex fsched-verbose
7123 On targets that use instruction scheduling, this option controls the
7124 amount of debugging output the scheduler prints.  This information is
7125 written to standard error, unless @option{-fdump-rtl-sched1} or
7126 @option{-fdump-rtl-sched2} is specified, in which case it is output
7127 to the usual dump listing file, @file{.sched1} or @file{.sched2}
7128 respectively.  However for @var{n} greater than nine, the output is
7129 always printed to standard error.
7131 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
7132 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
7133 For @var{n} greater than one, it also output basic block probabilities,
7134 detailed ready list information and unit/insn info.  For @var{n} greater
7135 than two, it includes RTL at abort point, control-flow and regions info.
7136 And for @var{n} over four, @option{-fsched-verbose} also includes
7137 dependence info.
7139 @item -save-temps
7140 @itemx -save-temps=cwd
7141 @opindex save-temps
7142 Store the usual ``temporary'' intermediate files permanently; place them
7143 in the current directory and name them based on the source file.  Thus,
7144 compiling @file{foo.c} with @option{-c -save-temps} produces files
7145 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
7146 preprocessed @file{foo.i} output file even though the compiler now
7147 normally uses an integrated preprocessor.
7149 When used in combination with the @option{-x} command-line option,
7150 @option{-save-temps} is sensible enough to avoid over writing an
7151 input source file with the same extension as an intermediate file.
7152 The corresponding intermediate file may be obtained by renaming the
7153 source file before using @option{-save-temps}.
7155 If you invoke GCC in parallel, compiling several different source
7156 files that share a common base name in different subdirectories or the
7157 same source file compiled for multiple output destinations, it is
7158 likely that the different parallel compilers will interfere with each
7159 other, and overwrite the temporary files.  For instance:
7161 @smallexample
7162 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
7163 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
7164 @end smallexample
7166 may result in @file{foo.i} and @file{foo.o} being written to
7167 simultaneously by both compilers.
7169 @item -save-temps=obj
7170 @opindex save-temps=obj
7171 Store the usual ``temporary'' intermediate files permanently.  If the
7172 @option{-o} option is used, the temporary files are based on the
7173 object file.  If the @option{-o} option is not used, the
7174 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
7176 For example:
7178 @smallexample
7179 gcc -save-temps=obj -c foo.c
7180 gcc -save-temps=obj -c bar.c -o dir/xbar.o
7181 gcc -save-temps=obj foobar.c -o dir2/yfoobar
7182 @end smallexample
7184 @noindent
7185 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
7186 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
7187 @file{dir2/yfoobar.o}.
7189 @item -time@r{[}=@var{file}@r{]}
7190 @opindex time
7191 Report the CPU time taken by each subprocess in the compilation
7192 sequence.  For C source files, this is the compiler proper and assembler
7193 (plus the linker if linking is done).
7195 Without the specification of an output file, the output looks like this:
7197 @smallexample
7198 # cc1 0.12 0.01
7199 # as 0.00 0.01
7200 @end smallexample
7202 The first number on each line is the ``user time'', that is time spent
7203 executing the program itself.  The second number is ``system time'',
7204 time spent executing operating system routines on behalf of the program.
7205 Both numbers are in seconds.
7207 With the specification of an output file, the output is appended to the
7208 named file, and it looks like this:
7210 @smallexample
7211 0.12 0.01 cc1 @var{options}
7212 0.00 0.01 as @var{options}
7213 @end smallexample
7215 The ``user time'' and the ``system time'' are moved before the program
7216 name, and the options passed to the program are displayed, so that one
7217 can later tell what file was being compiled, and with which options.
7219 @item -fvar-tracking
7220 @opindex fvar-tracking
7221 Run variable tracking pass.  It computes where variables are stored at each
7222 position in code.  Better debugging information is then generated
7223 (if the debugging information format supports this information).
7225 It is enabled by default when compiling with optimization (@option{-Os},
7226 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
7227 the debug info format supports it.
7229 @item -fvar-tracking-assignments
7230 @opindex fvar-tracking-assignments
7231 @opindex fno-var-tracking-assignments
7232 Annotate assignments to user variables early in the compilation and
7233 attempt to carry the annotations over throughout the compilation all the
7234 way to the end, in an attempt to improve debug information while
7235 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
7237 It can be enabled even if var-tracking is disabled, in which case
7238 annotations are created and maintained, but discarded at the end.
7239 By default, this flag is enabled together with @option{-fvar-tracking},
7240 except when selective scheduling is enabled.
7242 @item -fvar-tracking-assignments-toggle
7243 @opindex fvar-tracking-assignments-toggle
7244 @opindex fno-var-tracking-assignments-toggle
7245 Toggle @option{-fvar-tracking-assignments}, in the same way that
7246 @option{-gtoggle} toggles @option{-g}.
7248 @item -print-file-name=@var{library}
7249 @opindex print-file-name
7250 Print the full absolute name of the library file @var{library} that
7251 would be used when linking---and don't do anything else.  With this
7252 option, GCC does not compile or link anything; it just prints the
7253 file name.
7255 @item -print-multi-directory
7256 @opindex print-multi-directory
7257 Print the directory name corresponding to the multilib selected by any
7258 other switches present in the command line.  This directory is supposed
7259 to exist in @env{GCC_EXEC_PREFIX}.
7261 @item -print-multi-lib
7262 @opindex print-multi-lib
7263 Print the mapping from multilib directory names to compiler switches
7264 that enable them.  The directory name is separated from the switches by
7265 @samp{;}, and each switch starts with an @samp{@@} instead of the
7266 @samp{-}, without spaces between multiple switches.  This is supposed to
7267 ease shell processing.
7269 @item -print-multi-os-directory
7270 @opindex print-multi-os-directory
7271 Print the path to OS libraries for the selected
7272 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
7273 present in the @file{lib} subdirectory and no multilibs are used, this is
7274 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
7275 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
7276 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
7277 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
7279 @item -print-multiarch
7280 @opindex print-multiarch
7281 Print the path to OS libraries for the selected multiarch,
7282 relative to some @file{lib} subdirectory.
7284 @item -print-prog-name=@var{program}
7285 @opindex print-prog-name
7286 Like @option{-print-file-name}, but searches for a program such as @command{cpp}.
7288 @item -print-libgcc-file-name
7289 @opindex print-libgcc-file-name
7290 Same as @option{-print-file-name=libgcc.a}.
7292 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
7293 but you do want to link with @file{libgcc.a}.  You can do:
7295 @smallexample
7296 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
7297 @end smallexample
7299 @item -print-search-dirs
7300 @opindex print-search-dirs
7301 Print the name of the configured installation directory and a list of
7302 program and library directories @command{gcc} searches---and don't do anything else.
7304 This is useful when @command{gcc} prints the error message
7305 @samp{installation problem, cannot exec cpp0: No such file or directory}.
7306 To resolve this you either need to put @file{cpp0} and the other compiler
7307 components where @command{gcc} expects to find them, or you can set the environment
7308 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
7309 Don't forget the trailing @samp{/}.
7310 @xref{Environment Variables}.
7312 @item -print-sysroot
7313 @opindex print-sysroot
7314 Print the target sysroot directory that is used during
7315 compilation.  This is the target sysroot specified either at configure
7316 time or using the @option{--sysroot} option, possibly with an extra
7317 suffix that depends on compilation options.  If no target sysroot is
7318 specified, the option prints nothing.
7320 @item -print-sysroot-headers-suffix
7321 @opindex print-sysroot-headers-suffix
7322 Print the suffix added to the target sysroot when searching for
7323 headers, or give an error if the compiler is not configured with such
7324 a suffix---and don't do anything else.
7326 @item -dumpmachine
7327 @opindex dumpmachine
7328 Print the compiler's target machine (for example,
7329 @samp{i686-pc-linux-gnu})---and don't do anything else.
7331 @item -dumpversion
7332 @opindex dumpversion
7333 Print the compiler version (for example, @code{3.0})---and don't do
7334 anything else.
7336 @item -dumpspecs
7337 @opindex dumpspecs
7338 Print the compiler's built-in specs---and don't do anything else.  (This
7339 is used when GCC itself is being built.)  @xref{Spec Files}.
7341 @item -fno-eliminate-unused-debug-types
7342 @opindex feliminate-unused-debug-types
7343 @opindex fno-eliminate-unused-debug-types
7344 Normally, when producing DWARF 2 output, GCC avoids producing debug symbol 
7345 output for types that are nowhere used in the source file being compiled.
7346 Sometimes it is useful to have GCC emit debugging
7347 information for all types declared in a compilation
7348 unit, regardless of whether or not they are actually used
7349 in that compilation unit, for example 
7350 if, in the debugger, you want to cast a value to a type that is
7351 not actually used in your program (but is declared).  More often,
7352 however, this results in a significant amount of wasted space.
7353 @end table
7355 @node Optimize Options
7356 @section Options That Control Optimization
7357 @cindex optimize options
7358 @cindex options, optimization
7360 These options control various sorts of optimizations.
7362 Without any optimization option, the compiler's goal is to reduce the
7363 cost of compilation and to make debugging produce the expected
7364 results.  Statements are independent: if you stop the program with a
7365 breakpoint between statements, you can then assign a new value to any
7366 variable or change the program counter to any other statement in the
7367 function and get exactly the results you expect from the source
7368 code.
7370 Turning on optimization flags makes the compiler attempt to improve
7371 the performance and/or code size at the expense of compilation time
7372 and possibly the ability to debug the program.
7374 The compiler performs optimization based on the knowledge it has of the
7375 program.  Compiling multiple files at once to a single output file mode allows
7376 the compiler to use information gained from all of the files when compiling
7377 each of them.
7379 Not all optimizations are controlled directly by a flag.  Only
7380 optimizations that have a flag are listed in this section.
7382 Most optimizations are only enabled if an @option{-O} level is set on
7383 the command line.  Otherwise they are disabled, even if individual
7384 optimization flags are specified.
7386 Depending on the target and how GCC was configured, a slightly different
7387 set of optimizations may be enabled at each @option{-O} level than
7388 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
7389 to find out the exact set of optimizations that are enabled at each level.
7390 @xref{Overall Options}, for examples.
7392 @table @gcctabopt
7393 @item -O
7394 @itemx -O1
7395 @opindex O
7396 @opindex O1
7397 Optimize.  Optimizing compilation takes somewhat more time, and a lot
7398 more memory for a large function.
7400 With @option{-O}, the compiler tries to reduce code size and execution
7401 time, without performing any optimizations that take a great deal of
7402 compilation time.
7404 @option{-O} turns on the following optimization flags:
7405 @gccoptlist{
7406 -fauto-inc-dec @gol
7407 -fbranch-count-reg @gol
7408 -fcombine-stack-adjustments @gol
7409 -fcompare-elim @gol
7410 -fcprop-registers @gol
7411 -fdce @gol
7412 -fdefer-pop @gol
7413 -fdelayed-branch @gol
7414 -fdse @gol
7415 -fforward-propagate @gol
7416 -fguess-branch-probability @gol
7417 -fif-conversion2 @gol
7418 -fif-conversion @gol
7419 -finline-functions-called-once @gol
7420 -fipa-pure-const @gol
7421 -fipa-profile @gol
7422 -fipa-reference @gol
7423 -fmerge-constants @gol
7424 -fmove-loop-invariants @gol
7425 -fshrink-wrap @gol
7426 -fsplit-wide-types @gol
7427 -ftree-bit-ccp @gol
7428 -ftree-ccp @gol
7429 -fssa-phiopt @gol
7430 -ftree-ch @gol
7431 -ftree-copy-prop @gol
7432 -ftree-copyrename @gol
7433 -ftree-dce @gol
7434 -ftree-dominator-opts @gol
7435 -ftree-dse @gol
7436 -ftree-forwprop @gol
7437 -ftree-fre @gol
7438 -ftree-phiprop @gol
7439 -ftree-sink @gol
7440 -ftree-slsr @gol
7441 -ftree-sra @gol
7442 -ftree-pta @gol
7443 -ftree-ter @gol
7444 -funit-at-a-time}
7446 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
7447 where doing so does not interfere with debugging.
7449 @item -O2
7450 @opindex O2
7451 Optimize even more.  GCC performs nearly all supported optimizations
7452 that do not involve a space-speed tradeoff.
7453 As compared to @option{-O}, this option increases both compilation time
7454 and the performance of the generated code.
7456 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
7457 also turns on the following optimization flags:
7458 @gccoptlist{-fthread-jumps @gol
7459 -falign-functions  -falign-jumps @gol
7460 -falign-loops  -falign-labels @gol
7461 -fcaller-saves @gol
7462 -fcrossjumping @gol
7463 -fcse-follow-jumps  -fcse-skip-blocks @gol
7464 -fdelete-null-pointer-checks @gol
7465 -fdevirtualize -fdevirtualize-speculatively @gol
7466 -fexpensive-optimizations @gol
7467 -fgcse  -fgcse-lm  @gol
7468 -fhoist-adjacent-loads @gol
7469 -finline-small-functions @gol
7470 -findirect-inlining @gol
7471 -fipa-cp @gol
7472 -fipa-cp-alignment @gol
7473 -fipa-sra @gol
7474 -fipa-icf @gol
7475 -fisolate-erroneous-paths-dereference @gol
7476 -flra-remat @gol
7477 -foptimize-sibling-calls @gol
7478 -foptimize-strlen @gol
7479 -fpartial-inlining @gol
7480 -fpeephole2 @gol
7481 -freorder-blocks -freorder-blocks-and-partition -freorder-functions @gol
7482 -frerun-cse-after-loop  @gol
7483 -fsched-interblock  -fsched-spec @gol
7484 -fschedule-insns  -fschedule-insns2 @gol
7485 -fstrict-aliasing -fstrict-overflow @gol
7486 -ftree-builtin-call-dce @gol
7487 -ftree-switch-conversion -ftree-tail-merge @gol
7488 -ftree-pre @gol
7489 -ftree-vrp @gol
7490 -fipa-ra}
7492 Please note the warning under @option{-fgcse} about
7493 invoking @option{-O2} on programs that use computed gotos.
7495 @item -O3
7496 @opindex O3
7497 Optimize yet more.  @option{-O3} turns on all optimizations specified
7498 by @option{-O2} and also turns on the @option{-finline-functions},
7499 @option{-funswitch-loops}, @option{-fpredictive-commoning},
7500 @option{-fgcse-after-reload}, @option{-ftree-loop-vectorize},
7501 @option{-ftree-loop-distribute-patterns},
7502 @option{-ftree-slp-vectorize}, @option{-fvect-cost-model},
7503 @option{-ftree-partial-pre} and @option{-fipa-cp-clone} options.
7505 @item -O0
7506 @opindex O0
7507 Reduce compilation time and make debugging produce the expected
7508 results.  This is the default.
7510 @item -Os
7511 @opindex Os
7512 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
7513 do not typically increase code size.  It also performs further
7514 optimizations designed to reduce code size.
7516 @option{-Os} disables the following optimization flags:
7517 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
7518 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
7519 -fprefetch-loop-arrays}
7521 @item -Ofast
7522 @opindex Ofast
7523 Disregard strict standards compliance.  @option{-Ofast} enables all
7524 @option{-O3} optimizations.  It also enables optimizations that are not
7525 valid for all standard-compliant programs.
7526 It turns on @option{-ffast-math} and the Fortran-specific
7527 @option{-fno-protect-parens} and @option{-fstack-arrays}.
7529 @item -Og
7530 @opindex Og
7531 Optimize debugging experience.  @option{-Og} enables optimizations
7532 that do not interfere with debugging. It should be the optimization
7533 level of choice for the standard edit-compile-debug cycle, offering
7534 a reasonable level of optimization while maintaining fast compilation
7535 and a good debugging experience.
7537 If you use multiple @option{-O} options, with or without level numbers,
7538 the last such option is the one that is effective.
7539 @end table
7541 Options of the form @option{-f@var{flag}} specify machine-independent
7542 flags.  Most flags have both positive and negative forms; the negative
7543 form of @option{-ffoo} is @option{-fno-foo}.  In the table
7544 below, only one of the forms is listed---the one you typically 
7545 use.  You can figure out the other form by either removing @samp{no-}
7546 or adding it.
7548 The following options control specific optimizations.  They are either
7549 activated by @option{-O} options or are related to ones that are.  You
7550 can use the following flags in the rare cases when ``fine-tuning'' of
7551 optimizations to be performed is desired.
7553 @table @gcctabopt
7554 @item -fno-defer-pop
7555 @opindex fno-defer-pop
7556 Always pop the arguments to each function call as soon as that function
7557 returns.  For machines that must pop arguments after a function call,
7558 the compiler normally lets arguments accumulate on the stack for several
7559 function calls and pops them all at once.
7561 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7563 @item -fforward-propagate
7564 @opindex fforward-propagate
7565 Perform a forward propagation pass on RTL@.  The pass tries to combine two
7566 instructions and checks if the result can be simplified.  If loop unrolling
7567 is active, two passes are performed and the second is scheduled after
7568 loop unrolling.
7570 This option is enabled by default at optimization levels @option{-O},
7571 @option{-O2}, @option{-O3}, @option{-Os}.
7573 @item -ffp-contract=@var{style}
7574 @opindex ffp-contract
7575 @option{-ffp-contract=off} disables floating-point expression contraction.
7576 @option{-ffp-contract=fast} enables floating-point expression contraction
7577 such as forming of fused multiply-add operations if the target has
7578 native support for them.
7579 @option{-ffp-contract=on} enables floating-point expression contraction
7580 if allowed by the language standard.  This is currently not implemented
7581 and treated equal to @option{-ffp-contract=off}.
7583 The default is @option{-ffp-contract=fast}.
7585 @item -fomit-frame-pointer
7586 @opindex fomit-frame-pointer
7587 Don't keep the frame pointer in a register for functions that
7588 don't need one.  This avoids the instructions to save, set up and
7589 restore frame pointers; it also makes an extra register available
7590 in many functions.  @strong{It also makes debugging impossible on
7591 some machines.}
7593 On some machines, such as the VAX, this flag has no effect, because
7594 the standard calling sequence automatically handles the frame pointer
7595 and nothing is saved by pretending it doesn't exist.  The
7596 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
7597 whether a target machine supports this flag.  @xref{Registers,,Register
7598 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
7600 The default setting (when not optimizing for
7601 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets is
7602 @option{-fomit-frame-pointer}.  You can configure GCC with the
7603 @option{--enable-frame-pointer} configure option to change the default.
7605 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7607 @item -foptimize-sibling-calls
7608 @opindex foptimize-sibling-calls
7609 Optimize sibling and tail recursive calls.
7611 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7613 @item -foptimize-strlen
7614 @opindex foptimize-strlen
7615 Optimize various standard C string functions (e.g. @code{strlen},
7616 @code{strchr} or @code{strcpy}) and
7617 their @code{_FORTIFY_SOURCE} counterparts into faster alternatives.
7619 Enabled at levels @option{-O2}, @option{-O3}.
7621 @item -fno-inline
7622 @opindex fno-inline
7623 Do not expand any functions inline apart from those marked with
7624 the @code{always_inline} attribute.  This is the default when not
7625 optimizing.
7627 Single functions can be exempted from inlining by marking them
7628 with the @code{noinline} attribute.
7630 @item -finline-small-functions
7631 @opindex finline-small-functions
7632 Integrate functions into their callers when their body is smaller than expected
7633 function call code (so overall size of program gets smaller).  The compiler
7634 heuristically decides which functions are simple enough to be worth integrating
7635 in this way.  This inlining applies to all functions, even those not declared
7636 inline.
7638 Enabled at level @option{-O2}.
7640 @item -findirect-inlining
7641 @opindex findirect-inlining
7642 Inline also indirect calls that are discovered to be known at compile
7643 time thanks to previous inlining.  This option has any effect only
7644 when inlining itself is turned on by the @option{-finline-functions}
7645 or @option{-finline-small-functions} options.
7647 Enabled at level @option{-O2}.
7649 @item -finline-functions
7650 @opindex finline-functions
7651 Consider all functions for inlining, even if they are not declared inline.
7652 The compiler heuristically decides which functions are worth integrating
7653 in this way.
7655 If all calls to a given function are integrated, and the function is
7656 declared @code{static}, then the function is normally not output as
7657 assembler code in its own right.
7659 Enabled at level @option{-O3}.
7661 @item -finline-functions-called-once
7662 @opindex finline-functions-called-once
7663 Consider all @code{static} functions called once for inlining into their
7664 caller even if they are not marked @code{inline}.  If a call to a given
7665 function is integrated, then the function is not output as assembler code
7666 in its own right.
7668 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
7670 @item -fearly-inlining
7671 @opindex fearly-inlining
7672 Inline functions marked by @code{always_inline} and functions whose body seems
7673 smaller than the function call overhead early before doing
7674 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
7675 makes profiling significantly cheaper and usually inlining faster on programs
7676 having large chains of nested wrapper functions.
7678 Enabled by default.
7680 @item -fipa-sra
7681 @opindex fipa-sra
7682 Perform interprocedural scalar replacement of aggregates, removal of
7683 unused parameters and replacement of parameters passed by reference
7684 by parameters passed by value.
7686 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
7688 @item -finline-limit=@var{n}
7689 @opindex finline-limit
7690 By default, GCC limits the size of functions that can be inlined.  This flag
7691 allows coarse control of this limit.  @var{n} is the size of functions that
7692 can be inlined in number of pseudo instructions.
7694 Inlining is actually controlled by a number of parameters, which may be
7695 specified individually by using @option{--param @var{name}=@var{value}}.
7696 The @option{-finline-limit=@var{n}} option sets some of these parameters
7697 as follows:
7699 @table @gcctabopt
7700 @item max-inline-insns-single
7701 is set to @var{n}/2.
7702 @item max-inline-insns-auto
7703 is set to @var{n}/2.
7704 @end table
7706 See below for a documentation of the individual
7707 parameters controlling inlining and for the defaults of these parameters.
7709 @emph{Note:} there may be no value to @option{-finline-limit} that results
7710 in default behavior.
7712 @emph{Note:} pseudo instruction represents, in this particular context, an
7713 abstract measurement of function's size.  In no way does it represent a count
7714 of assembly instructions and as such its exact meaning might change from one
7715 release to an another.
7717 @item -fno-keep-inline-dllexport
7718 @opindex fno-keep-inline-dllexport
7719 This is a more fine-grained version of @option{-fkeep-inline-functions},
7720 which applies only to functions that are declared using the @code{dllexport}
7721 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
7722 Functions}.)
7724 @item -fkeep-inline-functions
7725 @opindex fkeep-inline-functions
7726 In C, emit @code{static} functions that are declared @code{inline}
7727 into the object file, even if the function has been inlined into all
7728 of its callers.  This switch does not affect functions using the
7729 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
7730 inline functions into the object file.
7732 @item -fkeep-static-consts
7733 @opindex fkeep-static-consts
7734 Emit variables declared @code{static const} when optimization isn't turned
7735 on, even if the variables aren't referenced.
7737 GCC enables this option by default.  If you want to force the compiler to
7738 check if a variable is referenced, regardless of whether or not
7739 optimization is turned on, use the @option{-fno-keep-static-consts} option.
7741 @item -fmerge-constants
7742 @opindex fmerge-constants
7743 Attempt to merge identical constants (string constants and floating-point
7744 constants) across compilation units.
7746 This option is the default for optimized compilation if the assembler and
7747 linker support it.  Use @option{-fno-merge-constants} to inhibit this
7748 behavior.
7750 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7752 @item -fmerge-all-constants
7753 @opindex fmerge-all-constants
7754 Attempt to merge identical constants and identical variables.
7756 This option implies @option{-fmerge-constants}.  In addition to
7757 @option{-fmerge-constants} this considers e.g.@: even constant initialized
7758 arrays or initialized constant variables with integral or floating-point
7759 types.  Languages like C or C++ require each variable, including multiple
7760 instances of the same variable in recursive calls, to have distinct locations,
7761 so using this option results in non-conforming
7762 behavior.
7764 @item -fmodulo-sched
7765 @opindex fmodulo-sched
7766 Perform swing modulo scheduling immediately before the first scheduling
7767 pass.  This pass looks at innermost loops and reorders their
7768 instructions by overlapping different iterations.
7770 @item -fmodulo-sched-allow-regmoves
7771 @opindex fmodulo-sched-allow-regmoves
7772 Perform more aggressive SMS-based modulo scheduling with register moves
7773 allowed.  By setting this flag certain anti-dependences edges are
7774 deleted, which triggers the generation of reg-moves based on the
7775 life-range analysis.  This option is effective only with
7776 @option{-fmodulo-sched} enabled.
7778 @item -fno-branch-count-reg
7779 @opindex fno-branch-count-reg
7780 Do not use ``decrement and branch'' instructions on a count register,
7781 but instead generate a sequence of instructions that decrement a
7782 register, compare it against zero, then branch based upon the result.
7783 This option is only meaningful on architectures that support such
7784 instructions, which include x86, PowerPC, IA-64 and S/390.
7786 Enabled by default at @option{-O1} and higher.
7788 The default is @option{-fbranch-count-reg}.
7790 @item -fno-function-cse
7791 @opindex fno-function-cse
7792 Do not put function addresses in registers; make each instruction that
7793 calls a constant function contain the function's address explicitly.
7795 This option results in less efficient code, but some strange hacks
7796 that alter the assembler output may be confused by the optimizations
7797 performed when this option is not used.
7799 The default is @option{-ffunction-cse}
7801 @item -fno-zero-initialized-in-bss
7802 @opindex fno-zero-initialized-in-bss
7803 If the target supports a BSS section, GCC by default puts variables that
7804 are initialized to zero into BSS@.  This can save space in the resulting
7805 code.
7807 This option turns off this behavior because some programs explicitly
7808 rely on variables going to the data section---e.g., so that the
7809 resulting executable can find the beginning of that section and/or make
7810 assumptions based on that.
7812 The default is @option{-fzero-initialized-in-bss}.
7814 @item -fthread-jumps
7815 @opindex fthread-jumps
7816 Perform optimizations that check to see if a jump branches to a
7817 location where another comparison subsumed by the first is found.  If
7818 so, the first branch is redirected to either the destination of the
7819 second branch or a point immediately following it, depending on whether
7820 the condition is known to be true or false.
7822 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7824 @item -fsplit-wide-types
7825 @opindex fsplit-wide-types
7826 When using a type that occupies multiple registers, such as @code{long
7827 long} on a 32-bit system, split the registers apart and allocate them
7828 independently.  This normally generates better code for those types,
7829 but may make debugging more difficult.
7831 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
7832 @option{-Os}.
7834 @item -fcse-follow-jumps
7835 @opindex fcse-follow-jumps
7836 In common subexpression elimination (CSE), scan through jump instructions
7837 when the target of the jump is not reached by any other path.  For
7838 example, when CSE encounters an @code{if} statement with an
7839 @code{else} clause, CSE follows the jump when the condition
7840 tested is false.
7842 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7844 @item -fcse-skip-blocks
7845 @opindex fcse-skip-blocks
7846 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
7847 follow jumps that conditionally skip over blocks.  When CSE
7848 encounters a simple @code{if} statement with no else clause,
7849 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
7850 body of the @code{if}.
7852 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7854 @item -frerun-cse-after-loop
7855 @opindex frerun-cse-after-loop
7856 Re-run common subexpression elimination after loop optimizations are
7857 performed.
7859 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7861 @item -fgcse
7862 @opindex fgcse
7863 Perform a global common subexpression elimination pass.
7864 This pass also performs global constant and copy propagation.
7866 @emph{Note:} When compiling a program using computed gotos, a GCC
7867 extension, you may get better run-time performance if you disable
7868 the global common subexpression elimination pass by adding
7869 @option{-fno-gcse} to the command line.
7871 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7873 @item -fgcse-lm
7874 @opindex fgcse-lm
7875 When @option{-fgcse-lm} is enabled, global common subexpression elimination
7876 attempts to move loads that are only killed by stores into themselves.  This
7877 allows a loop containing a load/store sequence to be changed to a load outside
7878 the loop, and a copy/store within the loop.
7880 Enabled by default when @option{-fgcse} is enabled.
7882 @item -fgcse-sm
7883 @opindex fgcse-sm
7884 When @option{-fgcse-sm} is enabled, a store motion pass is run after
7885 global common subexpression elimination.  This pass attempts to move
7886 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
7887 loops containing a load/store sequence can be changed to a load before
7888 the loop and a store after the loop.
7890 Not enabled at any optimization level.
7892 @item -fgcse-las
7893 @opindex fgcse-las
7894 When @option{-fgcse-las} is enabled, the global common subexpression
7895 elimination pass eliminates redundant loads that come after stores to the
7896 same memory location (both partial and full redundancies).
7898 Not enabled at any optimization level.
7900 @item -fgcse-after-reload
7901 @opindex fgcse-after-reload
7902 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
7903 pass is performed after reload.  The purpose of this pass is to clean up
7904 redundant spilling.
7906 @item -faggressive-loop-optimizations
7907 @opindex faggressive-loop-optimizations
7908 This option tells the loop optimizer to use language constraints to
7909 derive bounds for the number of iterations of a loop.  This assumes that
7910 loop code does not invoke undefined behavior by for example causing signed
7911 integer overflows or out-of-bound array accesses.  The bounds for the
7912 number of iterations of a loop are used to guide loop unrolling and peeling
7913 and loop exit test optimizations.
7914 This option is enabled by default.
7916 @item -funsafe-loop-optimizations
7917 @opindex funsafe-loop-optimizations
7918 This option tells the loop optimizer to assume that loop indices do not
7919 overflow, and that loops with nontrivial exit condition are not
7920 infinite.  This enables a wider range of loop optimizations even if
7921 the loop optimizer itself cannot prove that these assumptions are valid.
7922 If you use @option{-Wunsafe-loop-optimizations}, the compiler warns you
7923 if it finds this kind of loop.
7925 @item -fcrossjumping
7926 @opindex fcrossjumping
7927 Perform cross-jumping transformation.
7928 This transformation unifies equivalent code and saves code size.  The
7929 resulting code may or may not perform better than without cross-jumping.
7931 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7933 @item -fauto-inc-dec
7934 @opindex fauto-inc-dec
7935 Combine increments or decrements of addresses with memory accesses.
7936 This pass is always skipped on architectures that do not have
7937 instructions to support this.  Enabled by default at @option{-O} and
7938 higher on architectures that support this.
7940 @item -fdce
7941 @opindex fdce
7942 Perform dead code elimination (DCE) on RTL@.
7943 Enabled by default at @option{-O} and higher.
7945 @item -fdse
7946 @opindex fdse
7947 Perform dead store elimination (DSE) on RTL@.
7948 Enabled by default at @option{-O} and higher.
7950 @item -fif-conversion
7951 @opindex fif-conversion
7952 Attempt to transform conditional jumps into branch-less equivalents.  This
7953 includes use of conditional moves, min, max, set flags and abs instructions, and
7954 some tricks doable by standard arithmetics.  The use of conditional execution
7955 on chips where it is available is controlled by @option{-fif-conversion2}.
7957 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7959 @item -fif-conversion2
7960 @opindex fif-conversion2
7961 Use conditional execution (where available) to transform conditional jumps into
7962 branch-less equivalents.
7964 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7966 @item -fdeclone-ctor-dtor
7967 @opindex fdeclone-ctor-dtor
7968 The C++ ABI requires multiple entry points for constructors and
7969 destructors: one for a base subobject, one for a complete object, and
7970 one for a virtual destructor that calls operator delete afterwards.
7971 For a hierarchy with virtual bases, the base and complete variants are
7972 clones, which means two copies of the function.  With this option, the
7973 base and complete variants are changed to be thunks that call a common
7974 implementation.
7976 Enabled by @option{-Os}.
7978 @item -fdelete-null-pointer-checks
7979 @opindex fdelete-null-pointer-checks
7980 Assume that programs cannot safely dereference null pointers, and that
7981 no code or data element resides there.  This enables simple constant
7982 folding optimizations at all optimization levels.  In addition, other
7983 optimization passes in GCC use this flag to control global dataflow
7984 analyses that eliminate useless checks for null pointers; these assume
7985 that if a pointer is checked after it has already been dereferenced,
7986 it cannot be null.
7988 Note however that in some environments this assumption is not true.
7989 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
7990 for programs that depend on that behavior.
7992 Some targets, especially embedded ones, disable this option at all levels.
7993 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
7994 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
7995 are enabled independently at different optimization levels.
7997 @item -fdevirtualize
7998 @opindex fdevirtualize
7999 Attempt to convert calls to virtual functions to direct calls.  This
8000 is done both within a procedure and interprocedurally as part of
8001 indirect inlining (@option{-findirect-inlining}) and interprocedural constant
8002 propagation (@option{-fipa-cp}).
8003 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8005 @item -fdevirtualize-speculatively
8006 @opindex fdevirtualize-speculatively
8007 Attempt to convert calls to virtual functions to speculative direct calls.
8008 Based on the analysis of the type inheritance graph, determine for a given call
8009 the set of likely targets. If the set is small, preferably of size 1, change
8010 the call into a conditional deciding between direct and indirect calls.  The
8011 speculative calls enable more optimizations, such as inlining.  When they seem
8012 useless after further optimization, they are converted back into original form.
8014 @item -fdevirtualize-at-ltrans
8015 @opindex fdevirtualize-at-ltrans
8016 Stream extra information needed for aggressive devirtualization when running
8017 the link-time optimizer in local transformation mode.  
8018 This option enables more devirtualization but
8019 significantly increases the size of streamed data. For this reason it is
8020 disabled by default.
8022 @item -fexpensive-optimizations
8023 @opindex fexpensive-optimizations
8024 Perform a number of minor optimizations that are relatively expensive.
8026 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8028 @item -free
8029 @opindex free
8030 Attempt to remove redundant extension instructions.  This is especially
8031 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
8032 registers after writing to their lower 32-bit half.
8034 Enabled for Alpha, AArch64 and x86 at levels @option{-O2},
8035 @option{-O3}, @option{-Os}.
8037 @item -fno-lifetime-dse
8038 @opindex fno-lifetime-dse
8039 In C++ the value of an object is only affected by changes within its
8040 lifetime: when the constructor begins, the object has an indeterminate
8041 value, and any changes during the lifetime of the object are dead when
8042 the object is destroyed.  Normally dead store elimination will take
8043 advantage of this; if your code relies on the value of the object
8044 storage persisting beyond the lifetime of the object, you can use this
8045 flag to disable this optimization.
8047 @item -flive-range-shrinkage
8048 @opindex flive-range-shrinkage
8049 Attempt to decrease register pressure through register live range
8050 shrinkage.  This is helpful for fast processors with small or moderate
8051 size register sets.
8053 @item -fira-algorithm=@var{algorithm}
8054 @opindex fira-algorithm
8055 Use the specified coloring algorithm for the integrated register
8056 allocator.  The @var{algorithm} argument can be @samp{priority}, which
8057 specifies Chow's priority coloring, or @samp{CB}, which specifies
8058 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
8059 for all architectures, but for those targets that do support it, it is
8060 the default because it generates better code.
8062 @item -fira-region=@var{region}
8063 @opindex fira-region
8064 Use specified regions for the integrated register allocator.  The
8065 @var{region} argument should be one of the following:
8067 @table @samp
8069 @item all
8070 Use all loops as register allocation regions.
8071 This can give the best results for machines with a small and/or
8072 irregular register set.
8074 @item mixed
8075 Use all loops except for loops with small register pressure 
8076 as the regions.  This value usually gives
8077 the best results in most cases and for most architectures,
8078 and is enabled by default when compiling with optimization for speed
8079 (@option{-O}, @option{-O2}, @dots{}).
8081 @item one
8082 Use all functions as a single region.  
8083 This typically results in the smallest code size, and is enabled by default for
8084 @option{-Os} or @option{-O0}.
8086 @end table
8088 @item -fira-hoist-pressure
8089 @opindex fira-hoist-pressure
8090 Use IRA to evaluate register pressure in the code hoisting pass for
8091 decisions to hoist expressions.  This option usually results in smaller
8092 code, but it can slow the compiler down.
8094 This option is enabled at level @option{-Os} for all targets.
8096 @item -fira-loop-pressure
8097 @opindex fira-loop-pressure
8098 Use IRA to evaluate register pressure in loops for decisions to move
8099 loop invariants.  This option usually results in generation
8100 of faster and smaller code on machines with large register files (>= 32
8101 registers), but it can slow the compiler down.
8103 This option is enabled at level @option{-O3} for some targets.
8105 @item -fno-ira-share-save-slots
8106 @opindex fno-ira-share-save-slots
8107 Disable sharing of stack slots used for saving call-used hard
8108 registers living through a call.  Each hard register gets a
8109 separate stack slot, and as a result function stack frames are
8110 larger.
8112 @item -fno-ira-share-spill-slots
8113 @opindex fno-ira-share-spill-slots
8114 Disable sharing of stack slots allocated for pseudo-registers.  Each
8115 pseudo-register that does not get a hard register gets a separate
8116 stack slot, and as a result function stack frames are larger.
8118 @item -fira-verbose=@var{n}
8119 @opindex fira-verbose
8120 Control the verbosity of the dump file for the integrated register allocator.
8121 The default value is 5.  If the value @var{n} is greater or equal to 10,
8122 the dump output is sent to stderr using the same format as @var{n} minus 10.
8124 @item -flra-remat
8125 @opindex flra-remat
8126 Enable CFG-sensitive rematerialization in LRA.  Instead of loading
8127 values of spilled pseudos, LRA tries to rematerialize (recalculate)
8128 values if it is profitable.
8130 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8132 @item -fdelayed-branch
8133 @opindex fdelayed-branch
8134 If supported for the target machine, attempt to reorder instructions
8135 to exploit instruction slots available after delayed branch
8136 instructions.
8138 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8140 @item -fschedule-insns
8141 @opindex fschedule-insns
8142 If supported for the target machine, attempt to reorder instructions to
8143 eliminate execution stalls due to required data being unavailable.  This
8144 helps machines that have slow floating point or memory load instructions
8145 by allowing other instructions to be issued until the result of the load
8146 or floating-point instruction is required.
8148 Enabled at levels @option{-O2}, @option{-O3}.
8150 @item -fschedule-insns2
8151 @opindex fschedule-insns2
8152 Similar to @option{-fschedule-insns}, but requests an additional pass of
8153 instruction scheduling after register allocation has been done.  This is
8154 especially useful on machines with a relatively small number of
8155 registers and where memory load instructions take more than one cycle.
8157 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8159 @item -fno-sched-interblock
8160 @opindex fno-sched-interblock
8161 Don't schedule instructions across basic blocks.  This is normally
8162 enabled by default when scheduling before register allocation, i.e.@:
8163 with @option{-fschedule-insns} or at @option{-O2} or higher.
8165 @item -fno-sched-spec
8166 @opindex fno-sched-spec
8167 Don't allow speculative motion of non-load instructions.  This is normally
8168 enabled by default when scheduling before register allocation, i.e.@:
8169 with @option{-fschedule-insns} or at @option{-O2} or higher.
8171 @item -fsched-pressure
8172 @opindex fsched-pressure
8173 Enable register pressure sensitive insn scheduling before register
8174 allocation.  This only makes sense when scheduling before register
8175 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
8176 @option{-O2} or higher.  Usage of this option can improve the
8177 generated code and decrease its size by preventing register pressure
8178 increase above the number of available hard registers and subsequent
8179 spills in register allocation.
8181 @item -fsched-spec-load
8182 @opindex fsched-spec-load
8183 Allow speculative motion of some load instructions.  This only makes
8184 sense when scheduling before register allocation, i.e.@: with
8185 @option{-fschedule-insns} or at @option{-O2} or higher.
8187 @item -fsched-spec-load-dangerous
8188 @opindex fsched-spec-load-dangerous
8189 Allow speculative motion of more load instructions.  This only makes
8190 sense when scheduling before register allocation, i.e.@: with
8191 @option{-fschedule-insns} or at @option{-O2} or higher.
8193 @item -fsched-stalled-insns
8194 @itemx -fsched-stalled-insns=@var{n}
8195 @opindex fsched-stalled-insns
8196 Define how many insns (if any) can be moved prematurely from the queue
8197 of stalled insns into the ready list during the second scheduling pass.
8198 @option{-fno-sched-stalled-insns} means that no insns are moved
8199 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
8200 on how many queued insns can be moved prematurely.
8201 @option{-fsched-stalled-insns} without a value is equivalent to
8202 @option{-fsched-stalled-insns=1}.
8204 @item -fsched-stalled-insns-dep
8205 @itemx -fsched-stalled-insns-dep=@var{n}
8206 @opindex fsched-stalled-insns-dep
8207 Define how many insn groups (cycles) are examined for a dependency
8208 on a stalled insn that is a candidate for premature removal from the queue
8209 of stalled insns.  This has an effect only during the second scheduling pass,
8210 and only if @option{-fsched-stalled-insns} is used.
8211 @option{-fno-sched-stalled-insns-dep} is equivalent to
8212 @option{-fsched-stalled-insns-dep=0}.
8213 @option{-fsched-stalled-insns-dep} without a value is equivalent to
8214 @option{-fsched-stalled-insns-dep=1}.
8216 @item -fsched2-use-superblocks
8217 @opindex fsched2-use-superblocks
8218 When scheduling after register allocation, use superblock scheduling.
8219 This allows motion across basic block boundaries,
8220 resulting in faster schedules.  This option is experimental, as not all machine
8221 descriptions used by GCC model the CPU closely enough to avoid unreliable
8222 results from the algorithm.
8224 This only makes sense when scheduling after register allocation, i.e.@: with
8225 @option{-fschedule-insns2} or at @option{-O2} or higher.
8227 @item -fsched-group-heuristic
8228 @opindex fsched-group-heuristic
8229 Enable the group heuristic in the scheduler.  This heuristic favors
8230 the instruction that belongs to a schedule group.  This is enabled
8231 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
8232 or @option{-fschedule-insns2} or at @option{-O2} or higher.
8234 @item -fsched-critical-path-heuristic
8235 @opindex fsched-critical-path-heuristic
8236 Enable the critical-path heuristic in the scheduler.  This heuristic favors
8237 instructions on the critical path.  This is enabled by default when
8238 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
8239 or @option{-fschedule-insns2} or at @option{-O2} or higher.
8241 @item -fsched-spec-insn-heuristic
8242 @opindex fsched-spec-insn-heuristic
8243 Enable the speculative instruction heuristic in the scheduler.  This
8244 heuristic favors speculative instructions with greater dependency weakness.
8245 This is enabled by default when scheduling is enabled, i.e.@:
8246 with @option{-fschedule-insns} or @option{-fschedule-insns2}
8247 or at @option{-O2} or higher.
8249 @item -fsched-rank-heuristic
8250 @opindex fsched-rank-heuristic
8251 Enable the rank heuristic in the scheduler.  This heuristic favors
8252 the instruction belonging to a basic block with greater size or frequency.
8253 This is enabled by default when scheduling is enabled, i.e.@:
8254 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8255 at @option{-O2} or higher.
8257 @item -fsched-last-insn-heuristic
8258 @opindex fsched-last-insn-heuristic
8259 Enable the last-instruction heuristic in the scheduler.  This heuristic
8260 favors the instruction that is less dependent on the last instruction
8261 scheduled.  This is enabled by default when scheduling is enabled,
8262 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8263 at @option{-O2} or higher.
8265 @item -fsched-dep-count-heuristic
8266 @opindex fsched-dep-count-heuristic
8267 Enable the dependent-count heuristic in the scheduler.  This heuristic
8268 favors the instruction that has more instructions depending on it.
8269 This is enabled by default when scheduling is enabled, i.e.@:
8270 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8271 at @option{-O2} or higher.
8273 @item -freschedule-modulo-scheduled-loops
8274 @opindex freschedule-modulo-scheduled-loops
8275 Modulo scheduling is performed before traditional scheduling.  If a loop
8276 is modulo scheduled, later scheduling passes may change its schedule.  
8277 Use this option to control that behavior.
8279 @item -fselective-scheduling
8280 @opindex fselective-scheduling
8281 Schedule instructions using selective scheduling algorithm.  Selective
8282 scheduling runs instead of the first scheduler pass.
8284 @item -fselective-scheduling2
8285 @opindex fselective-scheduling2
8286 Schedule instructions using selective scheduling algorithm.  Selective
8287 scheduling runs instead of the second scheduler pass.
8289 @item -fsel-sched-pipelining
8290 @opindex fsel-sched-pipelining
8291 Enable software pipelining of innermost loops during selective scheduling.
8292 This option has no effect unless one of @option{-fselective-scheduling} or
8293 @option{-fselective-scheduling2} is turned on.
8295 @item -fsel-sched-pipelining-outer-loops
8296 @opindex fsel-sched-pipelining-outer-loops
8297 When pipelining loops during selective scheduling, also pipeline outer loops.
8298 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
8300 @item -fsemantic-interposition
8301 @opindex fsemantic-interposition
8302 Some object formats, like ELF, allow interposing of symbols by the 
8303 dynamic linker.
8304 This means that for symbols exported from the DSO, the compiler cannot perform
8305 interprocedural propagation, inlining and other optimizations in anticipation
8306 that the function or variable in question may change. While this feature is
8307 useful, for example, to rewrite memory allocation functions by a debugging
8308 implementation, it is expensive in the terms of code quality.
8309 With @option{-fno-semantic-interposition} the compiler assumes that 
8310 if interposition happens for functions the overwriting function will have 
8311 precisely the same semantics (and side effects). 
8312 Similarly if interposition happens
8313 for variables, the constructor of the variable will be the same. The flag
8314 has no effect for functions explicitly declared inline 
8315 (where it is never allowed for interposition to change semantics) 
8316 and for symbols explicitly declared weak.
8318 @item -fshrink-wrap
8319 @opindex fshrink-wrap
8320 Emit function prologues only before parts of the function that need it,
8321 rather than at the top of the function.  This flag is enabled by default at
8322 @option{-O} and higher.
8324 @item -fcaller-saves
8325 @opindex fcaller-saves
8326 Enable allocation of values to registers that are clobbered by
8327 function calls, by emitting extra instructions to save and restore the
8328 registers around such calls.  Such allocation is done only when it
8329 seems to result in better code.
8331 This option is always enabled by default on certain machines, usually
8332 those which have no call-preserved registers to use instead.
8334 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8336 @item -fcombine-stack-adjustments
8337 @opindex fcombine-stack-adjustments
8338 Tracks stack adjustments (pushes and pops) and stack memory references
8339 and then tries to find ways to combine them.
8341 Enabled by default at @option{-O1} and higher.
8343 @item -fipa-ra
8344 @opindex fipa-ra
8345 Use caller save registers for allocation if those registers are not used by
8346 any called function.  In that case it is not necessary to save and restore
8347 them around calls.  This is only possible if called functions are part of
8348 same compilation unit as current function and they are compiled before it.
8350 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8352 @item -fconserve-stack
8353 @opindex fconserve-stack
8354 Attempt to minimize stack usage.  The compiler attempts to use less
8355 stack space, even if that makes the program slower.  This option
8356 implies setting the @option{large-stack-frame} parameter to 100
8357 and the @option{large-stack-frame-growth} parameter to 400.
8359 @item -ftree-reassoc
8360 @opindex ftree-reassoc
8361 Perform reassociation on trees.  This flag is enabled by default
8362 at @option{-O} and higher.
8364 @item -ftree-pre
8365 @opindex ftree-pre
8366 Perform partial redundancy elimination (PRE) on trees.  This flag is
8367 enabled by default at @option{-O2} and @option{-O3}.
8369 @item -ftree-partial-pre
8370 @opindex ftree-partial-pre
8371 Make partial redundancy elimination (PRE) more aggressive.  This flag is
8372 enabled by default at @option{-O3}.
8374 @item -ftree-forwprop
8375 @opindex ftree-forwprop
8376 Perform forward propagation on trees.  This flag is enabled by default
8377 at @option{-O} and higher.
8379 @item -ftree-fre
8380 @opindex ftree-fre
8381 Perform full redundancy elimination (FRE) on trees.  The difference
8382 between FRE and PRE is that FRE only considers expressions
8383 that are computed on all paths leading to the redundant computation.
8384 This analysis is faster than PRE, though it exposes fewer redundancies.
8385 This flag is enabled by default at @option{-O} and higher.
8387 @item -ftree-phiprop
8388 @opindex ftree-phiprop
8389 Perform hoisting of loads from conditional pointers on trees.  This
8390 pass is enabled by default at @option{-O} and higher.
8392 @item -fhoist-adjacent-loads
8393 @opindex fhoist-adjacent-loads
8394 Speculatively hoist loads from both branches of an if-then-else if the
8395 loads are from adjacent locations in the same structure and the target
8396 architecture has a conditional move instruction.  This flag is enabled
8397 by default at @option{-O2} and higher.
8399 @item -ftree-copy-prop
8400 @opindex ftree-copy-prop
8401 Perform copy propagation on trees.  This pass eliminates unnecessary
8402 copy operations.  This flag is enabled by default at @option{-O} and
8403 higher.
8405 @item -fipa-pure-const
8406 @opindex fipa-pure-const
8407 Discover which functions are pure or constant.
8408 Enabled by default at @option{-O} and higher.
8410 @item -fipa-reference
8411 @opindex fipa-reference
8412 Discover which static variables do not escape the
8413 compilation unit.
8414 Enabled by default at @option{-O} and higher.
8416 @item -fipa-pta
8417 @opindex fipa-pta
8418 Perform interprocedural pointer analysis and interprocedural modification
8419 and reference analysis.  This option can cause excessive memory and
8420 compile-time usage on large compilation units.  It is not enabled by
8421 default at any optimization level.
8423 @item -fipa-profile
8424 @opindex fipa-profile
8425 Perform interprocedural profile propagation.  The functions called only from
8426 cold functions are marked as cold. Also functions executed once (such as
8427 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
8428 functions and loop less parts of functions executed once are then optimized for
8429 size.
8430 Enabled by default at @option{-O} and higher.
8432 @item -fipa-cp
8433 @opindex fipa-cp
8434 Perform interprocedural constant propagation.
8435 This optimization analyzes the program to determine when values passed
8436 to functions are constants and then optimizes accordingly.
8437 This optimization can substantially increase performance
8438 if the application has constants passed to functions.
8439 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
8441 @item -fipa-cp-clone
8442 @opindex fipa-cp-clone
8443 Perform function cloning to make interprocedural constant propagation stronger.
8444 When enabled, interprocedural constant propagation performs function cloning
8445 when externally visible function can be called with constant arguments.
8446 Because this optimization can create multiple copies of functions,
8447 it may significantly increase code size
8448 (see @option{--param ipcp-unit-growth=@var{value}}).
8449 This flag is enabled by default at @option{-O3}.
8451 @item -fipa-cp-alignment
8452 @opindex -fipa-cp-alignment
8453 When enabled, this optimization propagates alignment of function
8454 parameters to support better vectorization and string operations.
8456 This flag is enabled by default at @option{-O2} and @option{-Os}.  It
8457 requires that @option{-fipa-cp} is enabled.
8459 @item -fipa-icf
8460 @opindex fipa-icf
8461 Perform Identical Code Folding for functions and read-only variables.
8462 The optimization reduces code size and may disturb unwind stacks by replacing
8463 a function by equivalent one with a different name. The optimization works
8464 more effectively with link time optimization enabled.
8466 Nevertheless the behavior is similar to Gold Linker ICF optimization, GCC ICF
8467 works on different levels and thus the optimizations are not same - there are
8468 equivalences that are found only by GCC and equivalences found only by Gold.
8470 This flag is enabled by default at @option{-O2} and @option{-Os}.
8472 @item -fisolate-erroneous-paths-dereference
8473 @opindex fisolate-erroneous-paths-dereference
8474 Detect paths that trigger erroneous or undefined behavior due to
8475 dereferencing a null pointer.  Isolate those paths from the main control
8476 flow and turn the statement with erroneous or undefined behavior into a trap.
8477 This flag is enabled by default at @option{-O2} and higher.
8479 @item -fisolate-erroneous-paths-attribute
8480 @opindex fisolate-erroneous-paths-attribute
8481 Detect paths that trigger erroneous or undefined behavior due a null value
8482 being used in a way forbidden by a @code{returns_nonnull} or @code{nonnull}
8483 attribute.  Isolate those paths from the main control flow and turn the
8484 statement with erroneous or undefined behavior into a trap.  This is not
8485 currently enabled, but may be enabled by @option{-O2} in the future.
8487 @item -ftree-sink
8488 @opindex ftree-sink
8489 Perform forward store motion  on trees.  This flag is
8490 enabled by default at @option{-O} and higher.
8492 @item -ftree-bit-ccp
8493 @opindex ftree-bit-ccp
8494 Perform sparse conditional bit constant propagation on trees and propagate
8495 pointer alignment information.
8496 This pass only operates on local scalar variables and is enabled by default
8497 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
8499 @item -ftree-ccp
8500 @opindex ftree-ccp
8501 Perform sparse conditional constant propagation (CCP) on trees.  This
8502 pass only operates on local scalar variables and is enabled by default
8503 at @option{-O} and higher.
8505 @item -fssa-phiopt
8506 @opindex fssa-phiopt
8507 Perform pattern matching on SSA PHI nodes to optimize conditional
8508 code.  This pass is enabled by default at @option{-O} and higher.
8510 @item -ftree-switch-conversion
8511 @opindex ftree-switch-conversion
8512 Perform conversion of simple initializations in a switch to
8513 initializations from a scalar array.  This flag is enabled by default
8514 at @option{-O2} and higher.
8516 @item -ftree-tail-merge
8517 @opindex ftree-tail-merge
8518 Look for identical code sequences.  When found, replace one with a jump to the
8519 other.  This optimization is known as tail merging or cross jumping.  This flag
8520 is enabled by default at @option{-O2} and higher.  The compilation time
8521 in this pass can
8522 be limited using @option{max-tail-merge-comparisons} parameter and
8523 @option{max-tail-merge-iterations} parameter.
8525 @item -ftree-dce
8526 @opindex ftree-dce
8527 Perform dead code elimination (DCE) on trees.  This flag is enabled by
8528 default at @option{-O} and higher.
8530 @item -ftree-builtin-call-dce
8531 @opindex ftree-builtin-call-dce
8532 Perform conditional dead code elimination (DCE) for calls to built-in functions
8533 that may set @code{errno} but are otherwise side-effect free.  This flag is
8534 enabled by default at @option{-O2} and higher if @option{-Os} is not also
8535 specified.
8537 @item -ftree-dominator-opts
8538 @opindex ftree-dominator-opts
8539 Perform a variety of simple scalar cleanups (constant/copy
8540 propagation, redundancy elimination, range propagation and expression
8541 simplification) based on a dominator tree traversal.  This also
8542 performs jump threading (to reduce jumps to jumps). This flag is
8543 enabled by default at @option{-O} and higher.
8545 @item -ftree-dse
8546 @opindex ftree-dse
8547 Perform dead store elimination (DSE) on trees.  A dead store is a store into
8548 a memory location that is later overwritten by another store without
8549 any intervening loads.  In this case the earlier store can be deleted.  This
8550 flag is enabled by default at @option{-O} and higher.
8552 @item -ftree-ch
8553 @opindex ftree-ch
8554 Perform loop header copying on trees.  This is beneficial since it increases
8555 effectiveness of code motion optimizations.  It also saves one jump.  This flag
8556 is enabled by default at @option{-O} and higher.  It is not enabled
8557 for @option{-Os}, since it usually increases code size.
8559 @item -ftree-loop-optimize
8560 @opindex ftree-loop-optimize
8561 Perform loop optimizations on trees.  This flag is enabled by default
8562 at @option{-O} and higher.
8564 @item -ftree-loop-linear
8565 @opindex ftree-loop-linear
8566 Perform loop interchange transformations on tree.  Same as
8567 @option{-floop-interchange}.  To use this code transformation, GCC has
8568 to be configured with @option{--with-isl} to enable the Graphite loop
8569 transformation infrastructure.
8571 @item -floop-interchange
8572 @opindex floop-interchange
8573 Perform loop interchange transformations on loops.  Interchanging two
8574 nested loops switches the inner and outer loops.  For example, given a
8575 loop like:
8576 @smallexample
8577 DO J = 1, M
8578   DO I = 1, N
8579     A(J, I) = A(J, I) * C
8580   ENDDO
8581 ENDDO
8582 @end smallexample
8583 @noindent
8584 loop interchange transforms the loop as if it were written:
8585 @smallexample
8586 DO I = 1, N
8587   DO J = 1, M
8588     A(J, I) = A(J, I) * C
8589   ENDDO
8590 ENDDO
8591 @end smallexample
8592 which can be beneficial when @code{N} is larger than the caches,
8593 because in Fortran, the elements of an array are stored in memory
8594 contiguously by column, and the original loop iterates over rows,
8595 potentially creating at each access a cache miss.  This optimization
8596 applies to all the languages supported by GCC and is not limited to
8597 Fortran.  To use this code transformation, GCC has to be configured
8598 with @option{--with-isl} to enable the Graphite loop transformation
8599 infrastructure.
8601 @item -floop-strip-mine
8602 @opindex floop-strip-mine
8603 Perform loop strip mining transformations on loops.  Strip mining
8604 splits a loop into two nested loops.  The outer loop has strides
8605 equal to the strip size and the inner loop has strides of the
8606 original loop within a strip.  The strip length can be changed
8607 using the @option{loop-block-tile-size} parameter.  For example,
8608 given a loop like:
8609 @smallexample
8610 DO I = 1, N
8611   A(I) = A(I) + C
8612 ENDDO
8613 @end smallexample
8614 @noindent
8615 loop strip mining transforms the loop as if it were written:
8616 @smallexample
8617 DO II = 1, N, 51
8618   DO I = II, min (II + 50, N)
8619     A(I) = A(I) + C
8620   ENDDO
8621 ENDDO
8622 @end smallexample
8623 This optimization applies to all the languages supported by GCC and is
8624 not limited to Fortran.  To use this code transformation, GCC has to
8625 be configured with @option{--with-isl} to enable the Graphite loop
8626 transformation infrastructure.
8628 @item -floop-block
8629 @opindex floop-block
8630 Perform loop blocking transformations on loops.  Blocking strip mines
8631 each loop in the loop nest such that the memory accesses of the
8632 element loops fit inside caches.  The strip length can be changed
8633 using the @option{loop-block-tile-size} parameter.  For example, given
8634 a loop like:
8635 @smallexample
8636 DO I = 1, N
8637   DO J = 1, M
8638     A(J, I) = B(I) + C(J)
8639   ENDDO
8640 ENDDO
8641 @end smallexample
8642 @noindent
8643 loop blocking transforms the loop as if it were written:
8644 @smallexample
8645 DO II = 1, N, 51
8646   DO JJ = 1, M, 51
8647     DO I = II, min (II + 50, N)
8648       DO J = JJ, min (JJ + 50, M)
8649         A(J, I) = B(I) + C(J)
8650       ENDDO
8651     ENDDO
8652   ENDDO
8653 ENDDO
8654 @end smallexample
8655 which can be beneficial when @code{M} is larger than the caches,
8656 because the innermost loop iterates over a smaller amount of data
8657 which can be kept in the caches.  This optimization applies to all the
8658 languages supported by GCC and is not limited to Fortran.  To use this
8659 code transformation, GCC has to be configured with @option{--with-isl}
8660 to enable the Graphite loop transformation infrastructure.
8662 @item -fgraphite-identity
8663 @opindex fgraphite-identity
8664 Enable the identity transformation for graphite.  For every SCoP we generate
8665 the polyhedral representation and transform it back to gimple.  Using
8666 @option{-fgraphite-identity} we can check the costs or benefits of the
8667 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
8668 are also performed by the code generator ISL, like index splitting and
8669 dead code elimination in loops.
8671 @item -floop-nest-optimize
8672 @opindex floop-nest-optimize
8673 Enable the ISL based loop nest optimizer.  This is a generic loop nest
8674 optimizer based on the Pluto optimization algorithms.  It calculates a loop
8675 structure optimized for data-locality and parallelism.  This option
8676 is experimental.
8678 @item -floop-unroll-and-jam
8679 @opindex floop-unroll-and-jam
8680 Enable unroll and jam for the ISL based loop nest optimizer.  The unroll 
8681 factor can be changed using the @option{loop-unroll-jam-size} parameter.
8682 The unrolled dimension (counting from the most inner one) can be changed 
8683 using the @option{loop-unroll-jam-depth} parameter.                 .
8685 @item -floop-parallelize-all
8686 @opindex floop-parallelize-all
8687 Use the Graphite data dependence analysis to identify loops that can
8688 be parallelized.  Parallelize all the loops that can be analyzed to
8689 not contain loop carried dependences without checking that it is
8690 profitable to parallelize the loops.
8692 @item -fcheck-data-deps
8693 @opindex fcheck-data-deps
8694 Compare the results of several data dependence analyzers.  This option
8695 is used for debugging the data dependence analyzers.
8697 @item -ftree-loop-if-convert
8698 @opindex ftree-loop-if-convert
8699 Attempt to transform conditional jumps in the innermost loops to
8700 branch-less equivalents.  The intent is to remove control-flow from
8701 the innermost loops in order to improve the ability of the
8702 vectorization pass to handle these loops.  This is enabled by default
8703 if vectorization is enabled.
8705 @item -ftree-loop-if-convert-stores
8706 @opindex ftree-loop-if-convert-stores
8707 Attempt to also if-convert conditional jumps containing memory writes.
8708 This transformation can be unsafe for multi-threaded programs as it
8709 transforms conditional memory writes into unconditional memory writes.
8710 For example,
8711 @smallexample
8712 for (i = 0; i < N; i++)
8713   if (cond)
8714     A[i] = expr;
8715 @end smallexample
8716 is transformed to
8717 @smallexample
8718 for (i = 0; i < N; i++)
8719   A[i] = cond ? expr : A[i];
8720 @end smallexample
8721 potentially producing data races.
8723 @item -ftree-loop-distribution
8724 @opindex ftree-loop-distribution
8725 Perform loop distribution.  This flag can improve cache performance on
8726 big loop bodies and allow further loop optimizations, like
8727 parallelization or vectorization, to take place.  For example, the loop
8728 @smallexample
8729 DO I = 1, N
8730   A(I) = B(I) + C
8731   D(I) = E(I) * F
8732 ENDDO
8733 @end smallexample
8734 is transformed to
8735 @smallexample
8736 DO I = 1, N
8737    A(I) = B(I) + C
8738 ENDDO
8739 DO I = 1, N
8740    D(I) = E(I) * F
8741 ENDDO
8742 @end smallexample
8744 @item -ftree-loop-distribute-patterns
8745 @opindex ftree-loop-distribute-patterns
8746 Perform loop distribution of patterns that can be code generated with
8747 calls to a library.  This flag is enabled by default at @option{-O3}.
8749 This pass distributes the initialization loops and generates a call to
8750 memset zero.  For example, the loop
8751 @smallexample
8752 DO I = 1, N
8753   A(I) = 0
8754   B(I) = A(I) + I
8755 ENDDO
8756 @end smallexample
8757 is transformed to
8758 @smallexample
8759 DO I = 1, N
8760    A(I) = 0
8761 ENDDO
8762 DO I = 1, N
8763    B(I) = A(I) + I
8764 ENDDO
8765 @end smallexample
8766 and the initialization loop is transformed into a call to memset zero.
8768 @item -ftree-loop-im
8769 @opindex ftree-loop-im
8770 Perform loop invariant motion on trees.  This pass moves only invariants that
8771 are hard to handle at RTL level (function calls, operations that expand to
8772 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
8773 operands of conditions that are invariant out of the loop, so that we can use
8774 just trivial invariantness analysis in loop unswitching.  The pass also includes
8775 store motion.
8777 @item -ftree-loop-ivcanon
8778 @opindex ftree-loop-ivcanon
8779 Create a canonical counter for number of iterations in loops for which
8780 determining number of iterations requires complicated analysis.  Later
8781 optimizations then may determine the number easily.  Useful especially
8782 in connection with unrolling.
8784 @item -fivopts
8785 @opindex fivopts
8786 Perform induction variable optimizations (strength reduction, induction
8787 variable merging and induction variable elimination) on trees.
8789 @item -ftree-parallelize-loops=n
8790 @opindex ftree-parallelize-loops
8791 Parallelize loops, i.e., split their iteration space to run in n threads.
8792 This is only possible for loops whose iterations are independent
8793 and can be arbitrarily reordered.  The optimization is only
8794 profitable on multiprocessor machines, for loops that are CPU-intensive,
8795 rather than constrained e.g.@: by memory bandwidth.  This option
8796 implies @option{-pthread}, and thus is only supported on targets
8797 that have support for @option{-pthread}.
8799 @item -ftree-pta
8800 @opindex ftree-pta
8801 Perform function-local points-to analysis on trees.  This flag is
8802 enabled by default at @option{-O} and higher.
8804 @item -ftree-sra
8805 @opindex ftree-sra
8806 Perform scalar replacement of aggregates.  This pass replaces structure
8807 references with scalars to prevent committing structures to memory too
8808 early.  This flag is enabled by default at @option{-O} and higher.
8810 @item -ftree-copyrename
8811 @opindex ftree-copyrename
8812 Perform copy renaming on trees.  This pass attempts to rename compiler
8813 temporaries to other variables at copy locations, usually resulting in
8814 variable names which more closely resemble the original variables.  This flag
8815 is enabled by default at @option{-O} and higher.
8817 @item -ftree-coalesce-inlined-vars
8818 @opindex ftree-coalesce-inlined-vars
8819 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
8820 combine small user-defined variables too, but only if they are inlined
8821 from other functions.  It is a more limited form of
8822 @option{-ftree-coalesce-vars}.  This may harm debug information of such
8823 inlined variables, but it keeps variables of the inlined-into
8824 function apart from each other, such that they are more likely to
8825 contain the expected values in a debugging session.
8827 @item -ftree-coalesce-vars
8828 @opindex ftree-coalesce-vars
8829 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
8830 combine small user-defined variables too, instead of just compiler
8831 temporaries.  This may severely limit the ability to debug an optimized
8832 program compiled with @option{-fno-var-tracking-assignments}.  In the
8833 negated form, this flag prevents SSA coalescing of user variables,
8834 including inlined ones.  This option is enabled by default.
8836 @item -ftree-ter
8837 @opindex ftree-ter
8838 Perform temporary expression replacement during the SSA->normal phase.  Single
8839 use/single def temporaries are replaced at their use location with their
8840 defining expression.  This results in non-GIMPLE code, but gives the expanders
8841 much more complex trees to work on resulting in better RTL generation.  This is
8842 enabled by default at @option{-O} and higher.
8844 @item -ftree-slsr
8845 @opindex ftree-slsr
8846 Perform straight-line strength reduction on trees.  This recognizes related
8847 expressions involving multiplications and replaces them by less expensive
8848 calculations when possible.  This is enabled by default at @option{-O} and
8849 higher.
8851 @item -ftree-vectorize
8852 @opindex ftree-vectorize
8853 Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
8854 and @option{-ftree-slp-vectorize} if not explicitly specified.
8856 @item -ftree-loop-vectorize
8857 @opindex ftree-loop-vectorize
8858 Perform loop vectorization on trees. This flag is enabled by default at
8859 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8861 @item -ftree-slp-vectorize
8862 @opindex ftree-slp-vectorize
8863 Perform basic block vectorization on trees. This flag is enabled by default at
8864 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8866 @item -fvect-cost-model=@var{model}
8867 @opindex fvect-cost-model
8868 Alter the cost model used for vectorization.  The @var{model} argument
8869 should be one of @samp{unlimited}, @samp{dynamic} or @samp{cheap}.
8870 With the @samp{unlimited} model the vectorized code-path is assumed
8871 to be profitable while with the @samp{dynamic} model a runtime check
8872 guards the vectorized code-path to enable it only for iteration
8873 counts that will likely execute faster than when executing the original
8874 scalar loop.  The @samp{cheap} model disables vectorization of
8875 loops where doing so would be cost prohibitive for example due to
8876 required runtime checks for data dependence or alignment but otherwise
8877 is equal to the @samp{dynamic} model.
8878 The default cost model depends on other optimization flags and is
8879 either @samp{dynamic} or @samp{cheap}.
8881 @item -fsimd-cost-model=@var{model}
8882 @opindex fsimd-cost-model
8883 Alter the cost model used for vectorization of loops marked with the OpenMP
8884 or Cilk Plus simd directive.  The @var{model} argument should be one of
8885 @samp{unlimited}, @samp{dynamic}, @samp{cheap}.  All values of @var{model}
8886 have the same meaning as described in @option{-fvect-cost-model} and by
8887 default a cost model defined with @option{-fvect-cost-model} is used.
8889 @item -ftree-vrp
8890 @opindex ftree-vrp
8891 Perform Value Range Propagation on trees.  This is similar to the
8892 constant propagation pass, but instead of values, ranges of values are
8893 propagated.  This allows the optimizers to remove unnecessary range
8894 checks like array bound checks and null pointer checks.  This is
8895 enabled by default at @option{-O2} and higher.  Null pointer check
8896 elimination is only done if @option{-fdelete-null-pointer-checks} is
8897 enabled.
8899 @item -fsplit-ivs-in-unroller
8900 @opindex fsplit-ivs-in-unroller
8901 Enables expression of values of induction variables in later iterations
8902 of the unrolled loop using the value in the first iteration.  This breaks
8903 long dependency chains, thus improving efficiency of the scheduling passes.
8905 A combination of @option{-fweb} and CSE is often sufficient to obtain the
8906 same effect.  However, that is not reliable in cases where the loop body
8907 is more complicated than a single basic block.  It also does not work at all
8908 on some architectures due to restrictions in the CSE pass.
8910 This optimization is enabled by default.
8912 @item -fvariable-expansion-in-unroller
8913 @opindex fvariable-expansion-in-unroller
8914 With this option, the compiler creates multiple copies of some
8915 local variables when unrolling a loop, which can result in superior code.
8917 @item -fpartial-inlining
8918 @opindex fpartial-inlining
8919 Inline parts of functions.  This option has any effect only
8920 when inlining itself is turned on by the @option{-finline-functions}
8921 or @option{-finline-small-functions} options.
8923 Enabled at level @option{-O2}.
8925 @item -fpredictive-commoning
8926 @opindex fpredictive-commoning
8927 Perform predictive commoning optimization, i.e., reusing computations
8928 (especially memory loads and stores) performed in previous
8929 iterations of loops.
8931 This option is enabled at level @option{-O3}.
8933 @item -fprefetch-loop-arrays
8934 @opindex fprefetch-loop-arrays
8935 If supported by the target machine, generate instructions to prefetch
8936 memory to improve the performance of loops that access large arrays.
8938 This option may generate better or worse code; results are highly
8939 dependent on the structure of loops within the source code.
8941 Disabled at level @option{-Os}.
8943 @item -fno-peephole
8944 @itemx -fno-peephole2
8945 @opindex fno-peephole
8946 @opindex fno-peephole2
8947 Disable any machine-specific peephole optimizations.  The difference
8948 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
8949 are implemented in the compiler; some targets use one, some use the
8950 other, a few use both.
8952 @option{-fpeephole} is enabled by default.
8953 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8955 @item -fno-guess-branch-probability
8956 @opindex fno-guess-branch-probability
8957 Do not guess branch probabilities using heuristics.
8959 GCC uses heuristics to guess branch probabilities if they are
8960 not provided by profiling feedback (@option{-fprofile-arcs}).  These
8961 heuristics are based on the control flow graph.  If some branch probabilities
8962 are specified by @code{__builtin_expect}, then the heuristics are
8963 used to guess branch probabilities for the rest of the control flow graph,
8964 taking the @code{__builtin_expect} info into account.  The interactions
8965 between the heuristics and @code{__builtin_expect} can be complex, and in
8966 some cases, it may be useful to disable the heuristics so that the effects
8967 of @code{__builtin_expect} are easier to understand.
8969 The default is @option{-fguess-branch-probability} at levels
8970 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8972 @item -freorder-blocks
8973 @opindex freorder-blocks
8974 Reorder basic blocks in the compiled function in order to reduce number of
8975 taken branches and improve code locality.
8977 Enabled at levels @option{-O2}, @option{-O3}.
8979 @item -freorder-blocks-and-partition
8980 @opindex freorder-blocks-and-partition
8981 In addition to reordering basic blocks in the compiled function, in order
8982 to reduce number of taken branches, partitions hot and cold basic blocks
8983 into separate sections of the assembly and .o files, to improve
8984 paging and cache locality performance.
8986 This optimization is automatically turned off in the presence of
8987 exception handling, for linkonce sections, for functions with a user-defined
8988 section attribute and on any architecture that does not support named
8989 sections.
8991 Enabled for x86 at levels @option{-O2}, @option{-O3}.
8993 @item -freorder-functions
8994 @opindex freorder-functions
8995 Reorder functions in the object file in order to
8996 improve code locality.  This is implemented by using special
8997 subsections @code{.text.hot} for most frequently executed functions and
8998 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
8999 the linker so object file format must support named sections and linker must
9000 place them in a reasonable way.
9002 Also profile feedback must be available to make this option effective.  See
9003 @option{-fprofile-arcs} for details.
9005 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9007 @item -fstrict-aliasing
9008 @opindex fstrict-aliasing
9009 Allow the compiler to assume the strictest aliasing rules applicable to
9010 the language being compiled.  For C (and C++), this activates
9011 optimizations based on the type of expressions.  In particular, an
9012 object of one type is assumed never to reside at the same address as an
9013 object of a different type, unless the types are almost the same.  For
9014 example, an @code{unsigned int} can alias an @code{int}, but not a
9015 @code{void*} or a @code{double}.  A character type may alias any other
9016 type.
9018 @anchor{Type-punning}Pay special attention to code like this:
9019 @smallexample
9020 union a_union @{
9021   int i;
9022   double d;
9025 int f() @{
9026   union a_union t;
9027   t.d = 3.0;
9028   return t.i;
9030 @end smallexample
9031 The practice of reading from a different union member than the one most
9032 recently written to (called ``type-punning'') is common.  Even with
9033 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
9034 is accessed through the union type.  So, the code above works as
9035 expected.  @xref{Structures unions enumerations and bit-fields
9036 implementation}.  However, this code might not:
9037 @smallexample
9038 int f() @{
9039   union a_union t;
9040   int* ip;
9041   t.d = 3.0;
9042   ip = &t.i;
9043   return *ip;
9045 @end smallexample
9047 Similarly, access by taking the address, casting the resulting pointer
9048 and dereferencing the result has undefined behavior, even if the cast
9049 uses a union type, e.g.:
9050 @smallexample
9051 int f() @{
9052   double d = 3.0;
9053   return ((union a_union *) &d)->i;
9055 @end smallexample
9057 The @option{-fstrict-aliasing} option is enabled at levels
9058 @option{-O2}, @option{-O3}, @option{-Os}.
9060 @item -fstrict-overflow
9061 @opindex fstrict-overflow
9062 Allow the compiler to assume strict signed overflow rules, depending
9063 on the language being compiled.  For C (and C++) this means that
9064 overflow when doing arithmetic with signed numbers is undefined, which
9065 means that the compiler may assume that it does not happen.  This
9066 permits various optimizations.  For example, the compiler assumes
9067 that an expression like @code{i + 10 > i} is always true for
9068 signed @code{i}.  This assumption is only valid if signed overflow is
9069 undefined, as the expression is false if @code{i + 10} overflows when
9070 using twos complement arithmetic.  When this option is in effect any
9071 attempt to determine whether an operation on signed numbers 
9072 overflows must be written carefully to not actually involve overflow.
9074 This option also allows the compiler to assume strict pointer
9075 semantics: given a pointer to an object, if adding an offset to that
9076 pointer does not produce a pointer to the same object, the addition is
9077 undefined.  This permits the compiler to conclude that @code{p + u >
9078 p} is always true for a pointer @code{p} and unsigned integer
9079 @code{u}.  This assumption is only valid because pointer wraparound is
9080 undefined, as the expression is false if @code{p + u} overflows using
9081 twos complement arithmetic.
9083 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
9084 that integer signed overflow is fully defined: it wraps.  When
9085 @option{-fwrapv} is used, there is no difference between
9086 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
9087 integers.  With @option{-fwrapv} certain types of overflow are
9088 permitted.  For example, if the compiler gets an overflow when doing
9089 arithmetic on constants, the overflowed value can still be used with
9090 @option{-fwrapv}, but not otherwise.
9092 The @option{-fstrict-overflow} option is enabled at levels
9093 @option{-O2}, @option{-O3}, @option{-Os}.
9095 @item -falign-functions
9096 @itemx -falign-functions=@var{n}
9097 @opindex falign-functions
9098 Align the start of functions to the next power-of-two greater than
9099 @var{n}, skipping up to @var{n} bytes.  For instance,
9100 @option{-falign-functions=32} aligns functions to the next 32-byte
9101 boundary, but @option{-falign-functions=24} aligns to the next
9102 32-byte boundary only if this can be done by skipping 23 bytes or less.
9104 @option{-fno-align-functions} and @option{-falign-functions=1} are
9105 equivalent and mean that functions are not aligned.
9107 Some assemblers only support this flag when @var{n} is a power of two;
9108 in that case, it is rounded up.
9110 If @var{n} is not specified or is zero, use a machine-dependent default.
9112 Enabled at levels @option{-O2}, @option{-O3}.
9114 @item -falign-labels
9115 @itemx -falign-labels=@var{n}
9116 @opindex falign-labels
9117 Align all branch targets to a power-of-two boundary, skipping up to
9118 @var{n} bytes like @option{-falign-functions}.  This option can easily
9119 make code slower, because it must insert dummy operations for when the
9120 branch target is reached in the usual flow of the code.
9122 @option{-fno-align-labels} and @option{-falign-labels=1} are
9123 equivalent and mean that labels are not aligned.
9125 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
9126 are greater than this value, then their values are used instead.
9128 If @var{n} is not specified or is zero, use a machine-dependent default
9129 which is very likely to be @samp{1}, meaning no alignment.
9131 Enabled at levels @option{-O2}, @option{-O3}.
9133 @item -falign-loops
9134 @itemx -falign-loops=@var{n}
9135 @opindex falign-loops
9136 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
9137 like @option{-falign-functions}.  If the loops are
9138 executed many times, this makes up for any execution of the dummy
9139 operations.
9141 @option{-fno-align-loops} and @option{-falign-loops=1} are
9142 equivalent and mean that loops are not aligned.
9144 If @var{n} is not specified or is zero, use a machine-dependent default.
9146 Enabled at levels @option{-O2}, @option{-O3}.
9148 @item -falign-jumps
9149 @itemx -falign-jumps=@var{n}
9150 @opindex falign-jumps
9151 Align branch targets to a power-of-two boundary, for branch targets
9152 where the targets can only be reached by jumping, skipping up to @var{n}
9153 bytes like @option{-falign-functions}.  In this case, no dummy operations
9154 need be executed.
9156 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
9157 equivalent and mean that loops are not aligned.
9159 If @var{n} is not specified or is zero, use a machine-dependent default.
9161 Enabled at levels @option{-O2}, @option{-O3}.
9163 @item -funit-at-a-time
9164 @opindex funit-at-a-time
9165 This option is left for compatibility reasons. @option{-funit-at-a-time}
9166 has no effect, while @option{-fno-unit-at-a-time} implies
9167 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
9169 Enabled by default.
9171 @item -fno-toplevel-reorder
9172 @opindex fno-toplevel-reorder
9173 Do not reorder top-level functions, variables, and @code{asm}
9174 statements.  Output them in the same order that they appear in the
9175 input file.  When this option is used, unreferenced static variables
9176 are not removed.  This option is intended to support existing code
9177 that relies on a particular ordering.  For new code, it is better to
9178 use attributes when possible.
9180 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
9181 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
9182 targets.
9184 @item -fweb
9185 @opindex fweb
9186 Constructs webs as commonly used for register allocation purposes and assign
9187 each web individual pseudo register.  This allows the register allocation pass
9188 to operate on pseudos directly, but also strengthens several other optimization
9189 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
9190 however, make debugging impossible, since variables no longer stay in a
9191 ``home register''.
9193 Enabled by default with @option{-funroll-loops}.
9195 @item -fwhole-program
9196 @opindex fwhole-program
9197 Assume that the current compilation unit represents the whole program being
9198 compiled.  All public functions and variables with the exception of @code{main}
9199 and those merged by attribute @code{externally_visible} become static functions
9200 and in effect are optimized more aggressively by interprocedural optimizers.
9202 This option should not be used in combination with @option{-flto}.
9203 Instead relying on a linker plugin should provide safer and more precise
9204 information.
9206 @item -flto[=@var{n}]
9207 @opindex flto
9208 This option runs the standard link-time optimizer.  When invoked
9209 with source code, it generates GIMPLE (one of GCC's internal
9210 representations) and writes it to special ELF sections in the object
9211 file.  When the object files are linked together, all the function
9212 bodies are read from these ELF sections and instantiated as if they
9213 had been part of the same translation unit.
9215 To use the link-time optimizer, @option{-flto} and optimization
9216 options should be specified at compile time and during the final link.
9217 For example:
9219 @smallexample
9220 gcc -c -O2 -flto foo.c
9221 gcc -c -O2 -flto bar.c
9222 gcc -o myprog -flto -O2 foo.o bar.o
9223 @end smallexample
9225 The first two invocations to GCC save a bytecode representation
9226 of GIMPLE into special ELF sections inside @file{foo.o} and
9227 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
9228 @file{foo.o} and @file{bar.o}, merges the two files into a single
9229 internal image, and compiles the result as usual.  Since both
9230 @file{foo.o} and @file{bar.o} are merged into a single image, this
9231 causes all the interprocedural analyses and optimizations in GCC to
9232 work across the two files as if they were a single one.  This means,
9233 for example, that the inliner is able to inline functions in
9234 @file{bar.o} into functions in @file{foo.o} and vice-versa.
9236 Another (simpler) way to enable link-time optimization is:
9238 @smallexample
9239 gcc -o myprog -flto -O2 foo.c bar.c
9240 @end smallexample
9242 The above generates bytecode for @file{foo.c} and @file{bar.c},
9243 merges them together into a single GIMPLE representation and optimizes
9244 them as usual to produce @file{myprog}.
9246 The only important thing to keep in mind is that to enable link-time
9247 optimizations you need to use the GCC driver to perform the link-step.
9248 GCC then automatically performs link-time optimization if any of the
9249 objects involved were compiled with the @option{-flto}.  You generally
9250 should specify the optimization options to be used for link-time
9251 optimization though GCC tries to be clever at guessing an
9252 optimization level to use from the options used at compile-time
9253 if you fail to specify one at link-time.  You can always override
9254 the automatic decision to do link-time optimization at link-time
9255 by passing @option{-fno-lto} to the link command.
9257 To make whole program optimization effective, it is necessary to make
9258 certain whole program assumptions.  The compiler needs to know
9259 what functions and variables can be accessed by libraries and runtime
9260 outside of the link-time optimized unit.  When supported by the linker,
9261 the linker plugin (see @option{-fuse-linker-plugin}) passes information
9262 to the compiler about used and externally visible symbols.  When
9263 the linker plugin is not available, @option{-fwhole-program} should be
9264 used to allow the compiler to make these assumptions, which leads
9265 to more aggressive optimization decisions.
9267 When @option{-fuse-linker-plugin} is not enabled then, when a file is
9268 compiled with @option{-flto}, the generated object file is larger than
9269 a regular object file because it contains GIMPLE bytecodes and the usual
9270 final code (see @option{-ffat-lto-objects}.  This means that
9271 object files with LTO information can be linked as normal object
9272 files; if @option{-fno-lto} is passed to the linker, no
9273 interprocedural optimizations are applied.  Note that when
9274 @option{-fno-fat-lto-objects} is enabled the compile-stage is faster
9275 but you cannot perform a regular, non-LTO link on them.
9277 Additionally, the optimization flags used to compile individual files
9278 are not necessarily related to those used at link time.  For instance,
9280 @smallexample
9281 gcc -c -O0 -ffat-lto-objects -flto foo.c
9282 gcc -c -O0 -ffat-lto-objects -flto bar.c
9283 gcc -o myprog -O3 foo.o bar.o
9284 @end smallexample
9286 This produces individual object files with unoptimized assembler
9287 code, but the resulting binary @file{myprog} is optimized at
9288 @option{-O3}.  If, instead, the final binary is generated with
9289 @option{-fno-lto}, then @file{myprog} is not optimized.
9291 When producing the final binary, GCC only
9292 applies link-time optimizations to those files that contain bytecode.
9293 Therefore, you can mix and match object files and libraries with
9294 GIMPLE bytecodes and final object code.  GCC automatically selects
9295 which files to optimize in LTO mode and which files to link without
9296 further processing.
9298 There are some code generation flags preserved by GCC when
9299 generating bytecodes, as they need to be used during the final link
9300 stage.  Generally options specified at link-time override those
9301 specified at compile-time.
9303 If you do not specify an optimization level option @option{-O} at
9304 link-time then GCC computes one based on the optimization levels
9305 used when compiling the object files.  The highest optimization
9306 level wins here.
9308 Currently, the following options and their setting are take from
9309 the first object file that explicitely specified it: 
9310 @option{-fPIC}, @option{-fpic}, @option{-fpie}, @option{-fcommon},
9311 @option{-fexceptions}, @option{-fnon-call-exceptions}, @option{-fgnu-tm}
9312 and all the @option{-m} target flags.
9314 Certain ABI changing flags are required to match in all compilation-units
9315 and trying to override this at link-time with a conflicting value
9316 is ignored.  This includes options such as @option{-freg-struct-return}
9317 and @option{-fpcc-struct-return}. 
9319 Other options such as @option{-ffp-contract}, @option{-fno-strict-overflow},
9320 @option{-fwrapv}, @option{-fno-trapv} or @option{-fno-strict-aliasing}
9321 are passed through to the link stage and merged conservatively for
9322 conflicting translation units.  Specifically
9323 @option{-fno-strict-overflow}, @option{-fwrapv} and @option{-fno-trapv} take
9324 precedence and for example @option{-ffp-contract=off} takes precedence
9325 over @option{-ffp-contract=fast}.  You can override them at linke-time.
9327 It is recommended that you compile all the files participating in the
9328 same link with the same options and also specify those options at
9329 link time.
9331 If LTO encounters objects with C linkage declared with incompatible
9332 types in separate translation units to be linked together (undefined
9333 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
9334 issued.  The behavior is still undefined at run time.  Similar
9335 diagnostics may be raised for other languages.
9337 Another feature of LTO is that it is possible to apply interprocedural
9338 optimizations on files written in different languages:
9340 @smallexample
9341 gcc -c -flto foo.c
9342 g++ -c -flto bar.cc
9343 gfortran -c -flto baz.f90
9344 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
9345 @end smallexample
9347 Notice that the final link is done with @command{g++} to get the C++
9348 runtime libraries and @option{-lgfortran} is added to get the Fortran
9349 runtime libraries.  In general, when mixing languages in LTO mode, you
9350 should use the same link command options as when mixing languages in a
9351 regular (non-LTO) compilation.
9353 If object files containing GIMPLE bytecode are stored in a library archive, say
9354 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
9355 are using a linker with plugin support.  To create static libraries suitable
9356 for LTO, use @command{gcc-ar} and @command{gcc-ranlib} instead of @command{ar}
9357 and @command{ranlib}; 
9358 to show the symbols of object files with GIMPLE bytecode, use
9359 @command{gcc-nm}.  Those commands require that @command{ar}, @command{ranlib}
9360 and @command{nm} have been compiled with plugin support.  At link time, use the the
9361 flag @option{-fuse-linker-plugin} to ensure that the library participates in
9362 the LTO optimization process:
9364 @smallexample
9365 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
9366 @end smallexample
9368 With the linker plugin enabled, the linker extracts the needed
9369 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
9370 to make them part of the aggregated GIMPLE image to be optimized.
9372 If you are not using a linker with plugin support and/or do not
9373 enable the linker plugin, then the objects inside @file{libfoo.a}
9374 are extracted and linked as usual, but they do not participate
9375 in the LTO optimization process.  In order to make a static library suitable
9376 for both LTO optimization and usual linkage, compile its object files with
9377 @option{-flto} @option{-ffat-lto-objects}.
9379 Link-time optimizations do not require the presence of the whole program to
9380 operate.  If the program does not require any symbols to be exported, it is
9381 possible to combine @option{-flto} and @option{-fwhole-program} to allow
9382 the interprocedural optimizers to use more aggressive assumptions which may
9383 lead to improved optimization opportunities.
9384 Use of @option{-fwhole-program} is not needed when linker plugin is
9385 active (see @option{-fuse-linker-plugin}).
9387 The current implementation of LTO makes no
9388 attempt to generate bytecode that is portable between different
9389 types of hosts.  The bytecode files are versioned and there is a
9390 strict version check, so bytecode files generated in one version of
9391 GCC do not work with an older or newer version of GCC.
9393 Link-time optimization does not work well with generation of debugging
9394 information.  Combining @option{-flto} with
9395 @option{-g} is currently experimental and expected to produce unexpected
9396 results.
9398 If you specify the optional @var{n}, the optimization and code
9399 generation done at link time is executed in parallel using @var{n}
9400 parallel jobs by utilizing an installed @command{make} program.  The
9401 environment variable @env{MAKE} may be used to override the program
9402 used.  The default value for @var{n} is 1.
9404 You can also specify @option{-flto=jobserver} to use GNU make's
9405 job server mode to determine the number of parallel jobs. This
9406 is useful when the Makefile calling GCC is already executing in parallel.
9407 You must prepend a @samp{+} to the command recipe in the parent Makefile
9408 for this to work.  This option likely only works if @env{MAKE} is
9409 GNU make.
9411 @item -flto-partition=@var{alg}
9412 @opindex flto-partition
9413 Specify the partitioning algorithm used by the link-time optimizer.
9414 The value is either @samp{1to1} to specify a partitioning mirroring
9415 the original source files or @samp{balanced} to specify partitioning
9416 into equally sized chunks (whenever possible) or @samp{max} to create
9417 new partition for every symbol where possible.  Specifying @samp{none}
9418 as an algorithm disables partitioning and streaming completely. 
9419 The default value is @samp{balanced}. While @samp{1to1} can be used
9420 as an workaround for various code ordering issues, the @samp{max}
9421 partitioning is intended for internal testing only.
9422 The value @samp{one} specifies that exactly one partition should be
9423 used while the value @samp{none} bypasses partitioning and executes
9424 the link-time optimization step directly from the WPA phase.
9426 @item -flto-odr-type-merging
9427 @opindex flto-odr-type-merging
9428 Enable streaming of mangled types names of C++ types and their unification
9429 at linktime.  This increases size of LTO object files, but enable
9430 diagnostics about One Definition Rule violations.
9432 @item -flto-compression-level=@var{n}
9433 @opindex flto-compression-level
9434 This option specifies the level of compression used for intermediate
9435 language written to LTO object files, and is only meaningful in
9436 conjunction with LTO mode (@option{-flto}).  Valid
9437 values are 0 (no compression) to 9 (maximum compression).  Values
9438 outside this range are clamped to either 0 or 9.  If the option is not
9439 given, a default balanced compression setting is used.
9441 @item -flto-report
9442 @opindex flto-report
9443 Prints a report with internal details on the workings of the link-time
9444 optimizer.  The contents of this report vary from version to version.
9445 It is meant to be useful to GCC developers when processing object
9446 files in LTO mode (via @option{-flto}).
9448 Disabled by default.
9450 @item -flto-report-wpa
9451 @opindex flto-report-wpa
9452 Like @option{-flto-report}, but only print for the WPA phase of Link
9453 Time Optimization.
9455 @item -fuse-linker-plugin
9456 @opindex fuse-linker-plugin
9457 Enables the use of a linker plugin during link-time optimization.  This
9458 option relies on plugin support in the linker, which is available in gold
9459 or in GNU ld 2.21 or newer.
9461 This option enables the extraction of object files with GIMPLE bytecode out
9462 of library archives. This improves the quality of optimization by exposing
9463 more code to the link-time optimizer.  This information specifies what
9464 symbols can be accessed externally (by non-LTO object or during dynamic
9465 linking).  Resulting code quality improvements on binaries (and shared
9466 libraries that use hidden visibility) are similar to @option{-fwhole-program}.
9467 See @option{-flto} for a description of the effect of this flag and how to
9468 use it.
9470 This option is enabled by default when LTO support in GCC is enabled
9471 and GCC was configured for use with
9472 a linker supporting plugins (GNU ld 2.21 or newer or gold).
9474 @item -ffat-lto-objects
9475 @opindex ffat-lto-objects
9476 Fat LTO objects are object files that contain both the intermediate language
9477 and the object code. This makes them usable for both LTO linking and normal
9478 linking. This option is effective only when compiling with @option{-flto}
9479 and is ignored at link time.
9481 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
9482 requires the complete toolchain to be aware of LTO. It requires a linker with
9483 linker plugin support for basic functionality.  Additionally,
9484 @command{nm}, @command{ar} and @command{ranlib}
9485 need to support linker plugins to allow a full-featured build environment
9486 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
9487 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
9488 to these tools. With non fat LTO makefiles need to be modified to use them.
9490 The default is @option{-fno-fat-lto-objects} on targets with linker plugin
9491 support.
9493 @item -fcompare-elim
9494 @opindex fcompare-elim
9495 After register allocation and post-register allocation instruction splitting,
9496 identify arithmetic instructions that compute processor flags similar to a
9497 comparison operation based on that arithmetic.  If possible, eliminate the
9498 explicit comparison operation.
9500 This pass only applies to certain targets that cannot explicitly represent
9501 the comparison operation before register allocation is complete.
9503 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9505 @item -fcprop-registers
9506 @opindex fcprop-registers
9507 After register allocation and post-register allocation instruction splitting,
9508 perform a copy-propagation pass to try to reduce scheduling dependencies
9509 and occasionally eliminate the copy.
9511 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9513 @item -fprofile-correction
9514 @opindex fprofile-correction
9515 Profiles collected using an instrumented binary for multi-threaded programs may
9516 be inconsistent due to missed counter updates. When this option is specified,
9517 GCC uses heuristics to correct or smooth out such inconsistencies. By
9518 default, GCC emits an error message when an inconsistent profile is detected.
9520 @item -fprofile-dir=@var{path}
9521 @opindex fprofile-dir
9523 Set the directory to search for the profile data files in to @var{path}.
9524 This option affects only the profile data generated by
9525 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
9526 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
9527 and its related options.  Both absolute and relative paths can be used.
9528 By default, GCC uses the current directory as @var{path}, thus the
9529 profile data file appears in the same directory as the object file.
9531 @item -fprofile-generate
9532 @itemx -fprofile-generate=@var{path}
9533 @opindex fprofile-generate
9535 Enable options usually used for instrumenting application to produce
9536 profile useful for later recompilation with profile feedback based
9537 optimization.  You must use @option{-fprofile-generate} both when
9538 compiling and when linking your program.
9540 The following options are enabled: @option{-fprofile-arcs}, @option{-fprofile-values}, @option{-fvpt}.
9542 If @var{path} is specified, GCC looks at the @var{path} to find
9543 the profile feedback data files. See @option{-fprofile-dir}.
9545 @item -fprofile-use
9546 @itemx -fprofile-use=@var{path}
9547 @opindex fprofile-use
9548 Enable profile feedback-directed optimizations, 
9549 and the following optimizations
9550 which are generally profitable only with profile feedback available:
9551 @option{-fbranch-probabilities}, @option{-fvpt},
9552 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
9553 @option{-ftree-vectorize}, and @option{ftree-loop-distribute-patterns}.
9555 By default, GCC emits an error message if the feedback profiles do not
9556 match the source code.  This error can be turned into a warning by using
9557 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
9558 code.
9560 If @var{path} is specified, GCC looks at the @var{path} to find
9561 the profile feedback data files. See @option{-fprofile-dir}.
9563 @item -fauto-profile
9564 @itemx -fauto-profile=@var{path}
9565 @opindex fauto-profile
9566 Enable sampling-based feedback-directed optimizations, 
9567 and the following optimizations
9568 which are generally profitable only with profile feedback available:
9569 @option{-fbranch-probabilities}, @option{-fvpt},
9570 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
9571 @option{-ftree-vectorize},
9572 @option{-finline-functions}, @option{-fipa-cp}, @option{-fipa-cp-clone},
9573 @option{-fpredictive-commoning}, @option{-funswitch-loops},
9574 @option{-fgcse-after-reload}, and @option{-ftree-loop-distribute-patterns}.
9576 @var{path} is the name of a file containing AutoFDO profile information.
9577 If omitted, it defaults to @file{fbdata.afdo} in the current directory.
9579 Producing an AutoFDO profile data file requires running your program
9580 with the @command{perf} utility on a supported GNU/Linux target system.
9581 For more information, see @uref{https://perf.wiki.kernel.org/}.
9583 E.g.
9584 @smallexample
9585 perf record -e br_inst_retired:near_taken -b -o perf.data \
9586     -- your_program
9587 @end smallexample
9589 Then use the @command{create_gcov} tool to convert the raw profile data
9590 to a format that can be used by GCC.@  You must also supply the 
9591 unstripped binary for your program to this tool.  
9592 See @uref{https://github.com/google/autofdo}.
9594 E.g.
9595 @smallexample
9596 create_gcov --binary=your_program.unstripped --profile=perf.data \
9597     --gcov=profile.afdo
9598 @end smallexample
9599 @end table
9601 The following options control compiler behavior regarding floating-point 
9602 arithmetic.  These options trade off between speed and
9603 correctness.  All must be specifically enabled.
9605 @table @gcctabopt
9606 @item -ffloat-store
9607 @opindex ffloat-store
9608 Do not store floating-point variables in registers, and inhibit other
9609 options that might change whether a floating-point value is taken from a
9610 register or memory.
9612 @cindex floating-point precision
9613 This option prevents undesirable excess precision on machines such as
9614 the 68000 where the floating registers (of the 68881) keep more
9615 precision than a @code{double} is supposed to have.  Similarly for the
9616 x86 architecture.  For most programs, the excess precision does only
9617 good, but a few programs rely on the precise definition of IEEE floating
9618 point.  Use @option{-ffloat-store} for such programs, after modifying
9619 them to store all pertinent intermediate computations into variables.
9621 @item -fexcess-precision=@var{style}
9622 @opindex fexcess-precision
9623 This option allows further control over excess precision on machines
9624 where floating-point registers have more precision than the IEEE
9625 @code{float} and @code{double} types and the processor does not
9626 support operations rounding to those types.  By default,
9627 @option{-fexcess-precision=fast} is in effect; this means that
9628 operations are carried out in the precision of the registers and that
9629 it is unpredictable when rounding to the types specified in the source
9630 code takes place.  When compiling C, if
9631 @option{-fexcess-precision=standard} is specified then excess
9632 precision follows the rules specified in ISO C99; in particular,
9633 both casts and assignments cause values to be rounded to their
9634 semantic types (whereas @option{-ffloat-store} only affects
9635 assignments).  This option is enabled by default for C if a strict
9636 conformance option such as @option{-std=c99} is used.
9638 @opindex mfpmath
9639 @option{-fexcess-precision=standard} is not implemented for languages
9640 other than C, and has no effect if
9641 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
9642 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
9643 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
9644 semantics apply without excess precision, and in the latter, rounding
9645 is unpredictable.
9647 @item -ffast-math
9648 @opindex ffast-math
9649 Sets the options @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
9650 @option{-ffinite-math-only}, @option{-fno-rounding-math},
9651 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
9653 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
9655 This option is not turned on by any @option{-O} option besides
9656 @option{-Ofast} since it can result in incorrect output for programs
9657 that depend on an exact implementation of IEEE or ISO rules/specifications
9658 for math functions. It may, however, yield faster code for programs
9659 that do not require the guarantees of these specifications.
9661 @item -fno-math-errno
9662 @opindex fno-math-errno
9663 Do not set @code{errno} after calling math functions that are executed
9664 with a single instruction, e.g., @code{sqrt}.  A program that relies on
9665 IEEE exceptions for math error handling may want to use this flag
9666 for speed while maintaining IEEE arithmetic compatibility.
9668 This option is not turned on by any @option{-O} option since
9669 it can result in incorrect output for programs that depend on
9670 an exact implementation of IEEE or ISO rules/specifications for
9671 math functions. It may, however, yield faster code for programs
9672 that do not require the guarantees of these specifications.
9674 The default is @option{-fmath-errno}.
9676 On Darwin systems, the math library never sets @code{errno}.  There is
9677 therefore no reason for the compiler to consider the possibility that
9678 it might, and @option{-fno-math-errno} is the default.
9680 @item -funsafe-math-optimizations
9681 @opindex funsafe-math-optimizations
9683 Allow optimizations for floating-point arithmetic that (a) assume
9684 that arguments and results are valid and (b) may violate IEEE or
9685 ANSI standards.  When used at link-time, it may include libraries
9686 or startup files that change the default FPU control word or other
9687 similar optimizations.
9689 This option is not turned on by any @option{-O} option since
9690 it can result in incorrect output for programs that depend on
9691 an exact implementation of IEEE or ISO rules/specifications for
9692 math functions. It may, however, yield faster code for programs
9693 that do not require the guarantees of these specifications.
9694 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
9695 @option{-fassociative-math} and @option{-freciprocal-math}.
9697 The default is @option{-fno-unsafe-math-optimizations}.
9699 @item -fassociative-math
9700 @opindex fassociative-math
9702 Allow re-association of operands in series of floating-point operations.
9703 This violates the ISO C and C++ language standard by possibly changing
9704 computation result.  NOTE: re-ordering may change the sign of zero as
9705 well as ignore NaNs and inhibit or create underflow or overflow (and
9706 thus cannot be used on code that relies on rounding behavior like
9707 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
9708 and thus may not be used when ordered comparisons are required.
9709 This option requires that both @option{-fno-signed-zeros} and
9710 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
9711 much sense with @option{-frounding-math}. For Fortran the option
9712 is automatically enabled when both @option{-fno-signed-zeros} and
9713 @option{-fno-trapping-math} are in effect.
9715 The default is @option{-fno-associative-math}.
9717 @item -freciprocal-math
9718 @opindex freciprocal-math
9720 Allow the reciprocal of a value to be used instead of dividing by
9721 the value if this enables optimizations.  For example @code{x / y}
9722 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
9723 is subject to common subexpression elimination.  Note that this loses
9724 precision and increases the number of flops operating on the value.
9726 The default is @option{-fno-reciprocal-math}.
9728 @item -ffinite-math-only
9729 @opindex ffinite-math-only
9730 Allow optimizations for floating-point arithmetic that assume
9731 that arguments and results are not NaNs or +-Infs.
9733 This option is not turned on by any @option{-O} option since
9734 it can result in incorrect output for programs that depend on
9735 an exact implementation of IEEE or ISO rules/specifications for
9736 math functions. It may, however, yield faster code for programs
9737 that do not require the guarantees of these specifications.
9739 The default is @option{-fno-finite-math-only}.
9741 @item -fno-signed-zeros
9742 @opindex fno-signed-zeros
9743 Allow optimizations for floating-point arithmetic that ignore the
9744 signedness of zero.  IEEE arithmetic specifies the behavior of
9745 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
9746 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
9747 This option implies that the sign of a zero result isn't significant.
9749 The default is @option{-fsigned-zeros}.
9751 @item -fno-trapping-math
9752 @opindex fno-trapping-math
9753 Compile code assuming that floating-point operations cannot generate
9754 user-visible traps.  These traps include division by zero, overflow,
9755 underflow, inexact result and invalid operation.  This option requires
9756 that @option{-fno-signaling-nans} be in effect.  Setting this option may
9757 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
9759 This option should never be turned on by any @option{-O} option since
9760 it can result in incorrect output for programs that depend on
9761 an exact implementation of IEEE or ISO rules/specifications for
9762 math functions.
9764 The default is @option{-ftrapping-math}.
9766 @item -frounding-math
9767 @opindex frounding-math
9768 Disable transformations and optimizations that assume default floating-point
9769 rounding behavior.  This is round-to-zero for all floating point
9770 to integer conversions, and round-to-nearest for all other arithmetic
9771 truncations.  This option should be specified for programs that change
9772 the FP rounding mode dynamically, or that may be executed with a
9773 non-default rounding mode.  This option disables constant folding of
9774 floating-point expressions at compile time (which may be affected by
9775 rounding mode) and arithmetic transformations that are unsafe in the
9776 presence of sign-dependent rounding modes.
9778 The default is @option{-fno-rounding-math}.
9780 This option is experimental and does not currently guarantee to
9781 disable all GCC optimizations that are affected by rounding mode.
9782 Future versions of GCC may provide finer control of this setting
9783 using C99's @code{FENV_ACCESS} pragma.  This command-line option
9784 will be used to specify the default state for @code{FENV_ACCESS}.
9786 @item -fsignaling-nans
9787 @opindex fsignaling-nans
9788 Compile code assuming that IEEE signaling NaNs may generate user-visible
9789 traps during floating-point operations.  Setting this option disables
9790 optimizations that may change the number of exceptions visible with
9791 signaling NaNs.  This option implies @option{-ftrapping-math}.
9793 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
9794 be defined.
9796 The default is @option{-fno-signaling-nans}.
9798 This option is experimental and does not currently guarantee to
9799 disable all GCC optimizations that affect signaling NaN behavior.
9801 @item -fsingle-precision-constant
9802 @opindex fsingle-precision-constant
9803 Treat floating-point constants as single precision instead of
9804 implicitly converting them to double-precision constants.
9806 @item -fcx-limited-range
9807 @opindex fcx-limited-range
9808 When enabled, this option states that a range reduction step is not
9809 needed when performing complex division.  Also, there is no checking
9810 whether the result of a complex multiplication or division is @code{NaN
9811 + I*NaN}, with an attempt to rescue the situation in that case.  The
9812 default is @option{-fno-cx-limited-range}, but is enabled by
9813 @option{-ffast-math}.
9815 This option controls the default setting of the ISO C99
9816 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
9817 all languages.
9819 @item -fcx-fortran-rules
9820 @opindex fcx-fortran-rules
9821 Complex multiplication and division follow Fortran rules.  Range
9822 reduction is done as part of complex division, but there is no checking
9823 whether the result of a complex multiplication or division is @code{NaN
9824 + I*NaN}, with an attempt to rescue the situation in that case.
9826 The default is @option{-fno-cx-fortran-rules}.
9828 @end table
9830 The following options control optimizations that may improve
9831 performance, but are not enabled by any @option{-O} options.  This
9832 section includes experimental options that may produce broken code.
9834 @table @gcctabopt
9835 @item -fbranch-probabilities
9836 @opindex fbranch-probabilities
9837 After running a program compiled with @option{-fprofile-arcs}
9838 (@pxref{Debugging Options,, Options for Debugging Your Program or
9839 @command{gcc}}), you can compile it a second time using
9840 @option{-fbranch-probabilities}, to improve optimizations based on
9841 the number of times each branch was taken.  When a program
9842 compiled with @option{-fprofile-arcs} exits, it saves arc execution
9843 counts to a file called @file{@var{sourcename}.gcda} for each source
9844 file.  The information in this data file is very dependent on the
9845 structure of the generated code, so you must use the same source code
9846 and the same optimization options for both compilations.
9848 With @option{-fbranch-probabilities}, GCC puts a
9849 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
9850 These can be used to improve optimization.  Currently, they are only
9851 used in one place: in @file{reorg.c}, instead of guessing which path a
9852 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
9853 exactly determine which path is taken more often.
9855 @item -fprofile-values
9856 @opindex fprofile-values
9857 If combined with @option{-fprofile-arcs}, it adds code so that some
9858 data about values of expressions in the program is gathered.
9860 With @option{-fbranch-probabilities}, it reads back the data gathered
9861 from profiling values of expressions for usage in optimizations.
9863 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
9865 @item -fprofile-reorder-functions
9866 @opindex fprofile-reorder-functions
9867 Function reordering based on profile instrumentation collects
9868 first time of execution of a function and orders these functions
9869 in ascending order.
9871 Enabled with @option{-fprofile-use}.
9873 @item -fvpt
9874 @opindex fvpt
9875 If combined with @option{-fprofile-arcs}, this option instructs the compiler
9876 to add code to gather information about values of expressions.
9878 With @option{-fbranch-probabilities}, it reads back the data gathered
9879 and actually performs the optimizations based on them.
9880 Currently the optimizations include specialization of division operations
9881 using the knowledge about the value of the denominator.
9883 @item -frename-registers
9884 @opindex frename-registers
9885 Attempt to avoid false dependencies in scheduled code by making use
9886 of registers left over after register allocation.  This optimization
9887 most benefits processors with lots of registers.  Depending on the
9888 debug information format adopted by the target, however, it can
9889 make debugging impossible, since variables no longer stay in
9890 a ``home register''.
9892 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
9894 @item -fschedule-fusion
9895 @opindex fschedule-fusion
9896 Performs a target dependent pass over the instruction stream to schedule
9897 instructions of same type together because target machine can execute them
9898 more efficiently if they are adjacent to each other in the instruction flow.
9900 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9902 @item -ftracer
9903 @opindex ftracer
9904 Perform tail duplication to enlarge superblock size.  This transformation
9905 simplifies the control flow of the function allowing other optimizations to do
9906 a better job.
9908 Enabled with @option{-fprofile-use}.
9910 @item -funroll-loops
9911 @opindex funroll-loops
9912 Unroll loops whose number of iterations can be determined at compile time or
9913 upon entry to the loop.  @option{-funroll-loops} implies
9914 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
9915 It also turns on complete loop peeling (i.e.@: complete removal of loops with
9916 a small constant number of iterations).  This option makes code larger, and may
9917 or may not make it run faster.
9919 Enabled with @option{-fprofile-use}.
9921 @item -funroll-all-loops
9922 @opindex funroll-all-loops
9923 Unroll all loops, even if their number of iterations is uncertain when
9924 the loop is entered.  This usually makes programs run more slowly.
9925 @option{-funroll-all-loops} implies the same options as
9926 @option{-funroll-loops}.
9928 @item -fpeel-loops
9929 @opindex fpeel-loops
9930 Peels loops for which there is enough information that they do not
9931 roll much (from profile feedback).  It also turns on complete loop peeling
9932 (i.e.@: complete removal of loops with small constant number of iterations).
9934 Enabled with @option{-fprofile-use}.
9936 @item -fmove-loop-invariants
9937 @opindex fmove-loop-invariants
9938 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
9939 at level @option{-O1}
9941 @item -funswitch-loops
9942 @opindex funswitch-loops
9943 Move branches with loop invariant conditions out of the loop, with duplicates
9944 of the loop on both branches (modified according to result of the condition).
9946 @item -ffunction-sections
9947 @itemx -fdata-sections
9948 @opindex ffunction-sections
9949 @opindex fdata-sections
9950 Place each function or data item into its own section in the output
9951 file if the target supports arbitrary sections.  The name of the
9952 function or the name of the data item determines the section's name
9953 in the output file.
9955 Use these options on systems where the linker can perform optimizations
9956 to improve locality of reference in the instruction space.  Most systems
9957 using the ELF object format and SPARC processors running Solaris 2 have
9958 linkers with such optimizations.  AIX may have these optimizations in
9959 the future.
9961 Only use these options when there are significant benefits from doing
9962 so.  When you specify these options, the assembler and linker
9963 create larger object and executable files and are also slower.
9964 You cannot use @command{gprof} on all systems if you
9965 specify this option, and you may have problems with debugging if
9966 you specify both this option and @option{-g}.
9968 @item -fbranch-target-load-optimize
9969 @opindex fbranch-target-load-optimize
9970 Perform branch target register load optimization before prologue / epilogue
9971 threading.
9972 The use of target registers can typically be exposed only during reload,
9973 thus hoisting loads out of loops and doing inter-block scheduling needs
9974 a separate optimization pass.
9976 @item -fbranch-target-load-optimize2
9977 @opindex fbranch-target-load-optimize2
9978 Perform branch target register load optimization after prologue / epilogue
9979 threading.
9981 @item -fbtr-bb-exclusive
9982 @opindex fbtr-bb-exclusive
9983 When performing branch target register load optimization, don't reuse
9984 branch target registers within any basic block.
9986 @item -fstack-protector
9987 @opindex fstack-protector
9988 Emit extra code to check for buffer overflows, such as stack smashing
9989 attacks.  This is done by adding a guard variable to functions with
9990 vulnerable objects.  This includes functions that call @code{alloca}, and
9991 functions with buffers larger than 8 bytes.  The guards are initialized
9992 when a function is entered and then checked when the function exits.
9993 If a guard check fails, an error message is printed and the program exits.
9995 @item -fstack-protector-all
9996 @opindex fstack-protector-all
9997 Like @option{-fstack-protector} except that all functions are protected.
9999 @item -fstack-protector-strong
10000 @opindex fstack-protector-strong
10001 Like @option{-fstack-protector} but includes additional functions to
10002 be protected --- those that have local array definitions, or have
10003 references to local frame addresses.
10005 @item -fstack-protector-explicit
10006 @opindex fstack-protector-explicit
10007 Like @option{-fstack-protector} but only protects those functions which
10008 have the @code{stack_protect} attribute
10010 @item -fstdarg-opt
10011 @opindex fstdarg-opt
10012 Optimize the prologue of variadic argument functions with respect to usage of
10013 those arguments.
10015 @item -fsection-anchors
10016 @opindex fsection-anchors
10017 Try to reduce the number of symbolic address calculations by using
10018 shared ``anchor'' symbols to address nearby objects.  This transformation
10019 can help to reduce the number of GOT entries and GOT accesses on some
10020 targets.
10022 For example, the implementation of the following function @code{foo}:
10024 @smallexample
10025 static int a, b, c;
10026 int foo (void) @{ return a + b + c; @}
10027 @end smallexample
10029 @noindent
10030 usually calculates the addresses of all three variables, but if you
10031 compile it with @option{-fsection-anchors}, it accesses the variables
10032 from a common anchor point instead.  The effect is similar to the
10033 following pseudocode (which isn't valid C):
10035 @smallexample
10036 int foo (void)
10038   register int *xr = &x;
10039   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
10041 @end smallexample
10043 Not all targets support this option.
10045 @item --param @var{name}=@var{value}
10046 @opindex param
10047 In some places, GCC uses various constants to control the amount of
10048 optimization that is done.  For example, GCC does not inline functions
10049 that contain more than a certain number of instructions.  You can
10050 control some of these constants on the command line using the
10051 @option{--param} option.
10053 The names of specific parameters, and the meaning of the values, are
10054 tied to the internals of the compiler, and are subject to change
10055 without notice in future releases.
10057 In each case, the @var{value} is an integer.  The allowable choices for
10058 @var{name} are:
10060 @table @gcctabopt
10061 @item predictable-branch-outcome
10062 When branch is predicted to be taken with probability lower than this threshold
10063 (in percent), then it is considered well predictable. The default is 10.
10065 @item max-crossjump-edges
10066 The maximum number of incoming edges to consider for cross-jumping.
10067 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
10068 the number of edges incoming to each block.  Increasing values mean
10069 more aggressive optimization, making the compilation time increase with
10070 probably small improvement in executable size.
10072 @item min-crossjump-insns
10073 The minimum number of instructions that must be matched at the end
10074 of two blocks before cross-jumping is performed on them.  This
10075 value is ignored in the case where all instructions in the block being
10076 cross-jumped from are matched.  The default value is 5.
10078 @item max-grow-copy-bb-insns
10079 The maximum code size expansion factor when copying basic blocks
10080 instead of jumping.  The expansion is relative to a jump instruction.
10081 The default value is 8.
10083 @item max-goto-duplication-insns
10084 The maximum number of instructions to duplicate to a block that jumps
10085 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
10086 passes, GCC factors computed gotos early in the compilation process,
10087 and unfactors them as late as possible.  Only computed jumps at the
10088 end of a basic blocks with no more than max-goto-duplication-insns are
10089 unfactored.  The default value is 8.
10091 @item max-delay-slot-insn-search
10092 The maximum number of instructions to consider when looking for an
10093 instruction to fill a delay slot.  If more than this arbitrary number of
10094 instructions are searched, the time savings from filling the delay slot
10095 are minimal, so stop searching.  Increasing values mean more
10096 aggressive optimization, making the compilation time increase with probably
10097 small improvement in execution time.
10099 @item max-delay-slot-live-search
10100 When trying to fill delay slots, the maximum number of instructions to
10101 consider when searching for a block with valid live register
10102 information.  Increasing this arbitrarily chosen value means more
10103 aggressive optimization, increasing the compilation time.  This parameter
10104 should be removed when the delay slot code is rewritten to maintain the
10105 control-flow graph.
10107 @item max-gcse-memory
10108 The approximate maximum amount of memory that can be allocated in
10109 order to perform the global common subexpression elimination
10110 optimization.  If more memory than specified is required, the
10111 optimization is not done.
10113 @item max-gcse-insertion-ratio
10114 If the ratio of expression insertions to deletions is larger than this value
10115 for any expression, then RTL PRE inserts or removes the expression and thus
10116 leaves partially redundant computations in the instruction stream.  The default value is 20.
10118 @item max-pending-list-length
10119 The maximum number of pending dependencies scheduling allows
10120 before flushing the current state and starting over.  Large functions
10121 with few branches or calls can create excessively large lists which
10122 needlessly consume memory and resources.
10124 @item max-modulo-backtrack-attempts
10125 The maximum number of backtrack attempts the scheduler should make
10126 when modulo scheduling a loop.  Larger values can exponentially increase
10127 compilation time.
10129 @item max-inline-insns-single
10130 Several parameters control the tree inliner used in GCC@.
10131 This number sets the maximum number of instructions (counted in GCC's
10132 internal representation) in a single function that the tree inliner
10133 considers for inlining.  This only affects functions declared
10134 inline and methods implemented in a class declaration (C++).
10135 The default value is 400.
10137 @item max-inline-insns-auto
10138 When you use @option{-finline-functions} (included in @option{-O3}),
10139 a lot of functions that would otherwise not be considered for inlining
10140 by the compiler are investigated.  To those functions, a different
10141 (more restrictive) limit compared to functions declared inline can
10142 be applied.
10143 The default value is 40.
10145 @item inline-min-speedup
10146 When estimated performance improvement of caller + callee runtime exceeds this
10147 threshold (in precent), the function can be inlined regardless the limit on
10148 @option{--param max-inline-insns-single} and @option{--param
10149 max-inline-insns-auto}.
10151 @item large-function-insns
10152 The limit specifying really large functions.  For functions larger than this
10153 limit after inlining, inlining is constrained by
10154 @option{--param large-function-growth}.  This parameter is useful primarily
10155 to avoid extreme compilation time caused by non-linear algorithms used by the
10156 back end.
10157 The default value is 2700.
10159 @item large-function-growth
10160 Specifies maximal growth of large function caused by inlining in percents.
10161 The default value is 100 which limits large function growth to 2.0 times
10162 the original size.
10164 @item large-unit-insns
10165 The limit specifying large translation unit.  Growth caused by inlining of
10166 units larger than this limit is limited by @option{--param inline-unit-growth}.
10167 For small units this might be too tight.
10168 For example, consider a unit consisting of function A
10169 that is inline and B that just calls A three times.  If B is small relative to
10170 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
10171 large units consisting of small inlineable functions, however, the overall unit
10172 growth limit is needed to avoid exponential explosion of code size.  Thus for
10173 smaller units, the size is increased to @option{--param large-unit-insns}
10174 before applying @option{--param inline-unit-growth}.  The default is 10000.
10176 @item inline-unit-growth
10177 Specifies maximal overall growth of the compilation unit caused by inlining.
10178 The default value is 15 which limits unit growth to 1.15 times the original
10179 size. Cold functions (either marked cold via an attribute or by profile
10180 feedback) are not accounted into the unit size.
10182 @item ipcp-unit-growth
10183 Specifies maximal overall growth of the compilation unit caused by
10184 interprocedural constant propagation.  The default value is 10 which limits
10185 unit growth to 1.1 times the original size.
10187 @item large-stack-frame
10188 The limit specifying large stack frames.  While inlining the algorithm is trying
10189 to not grow past this limit too much.  The default value is 256 bytes.
10191 @item large-stack-frame-growth
10192 Specifies maximal growth of large stack frames caused by inlining in percents.
10193 The default value is 1000 which limits large stack frame growth to 11 times
10194 the original size.
10196 @item max-inline-insns-recursive
10197 @itemx max-inline-insns-recursive-auto
10198 Specifies the maximum number of instructions an out-of-line copy of a
10199 self-recursive inline
10200 function can grow into by performing recursive inlining.
10202 @option{--param max-inline-insns-recursive} applies to functions
10203 declared inline.
10204 For functions not declared inline, recursive inlining
10205 happens only when @option{-finline-functions} (included in @option{-O3}) is
10206 enabled; @option{--param max-inline-insns-recursive-auto} applies instead.  The
10207 default value is 450.
10209 @item max-inline-recursive-depth
10210 @itemx max-inline-recursive-depth-auto
10211 Specifies the maximum recursion depth used for recursive inlining.
10213 @option{--param max-inline-recursive-depth} applies to functions
10214 declared inline.  For functions not declared inline, recursive inlining
10215 happens only when @option{-finline-functions} (included in @option{-O3}) is
10216 enabled; @option{--param max-inline-recursive-depth-auto} applies instead.  The
10217 default value is 8.
10219 @item min-inline-recursive-probability
10220 Recursive inlining is profitable only for function having deep recursion
10221 in average and can hurt for function having little recursion depth by
10222 increasing the prologue size or complexity of function body to other
10223 optimizers.
10225 When profile feedback is available (see @option{-fprofile-generate}) the actual
10226 recursion depth can be guessed from probability that function recurses via a
10227 given call expression.  This parameter limits inlining only to call expressions
10228 whose probability exceeds the given threshold (in percents).
10229 The default value is 10.
10231 @item early-inlining-insns
10232 Specify growth that the early inliner can make.  In effect it increases
10233 the amount of inlining for code having a large abstraction penalty.
10234 The default value is 14.
10236 @item max-early-inliner-iterations
10237 Limit of iterations of the early inliner.  This basically bounds
10238 the number of nested indirect calls the early inliner can resolve.
10239 Deeper chains are still handled by late inlining.
10241 @item comdat-sharing-probability
10242 Probability (in percent) that C++ inline function with comdat visibility
10243 are shared across multiple compilation units.  The default value is 20.
10245 @item profile-func-internal-id
10246 A parameter to control whether to use function internal id in profile
10247 database lookup. If the value is 0, the compiler uses an id that
10248 is based on function assembler name and filename, which makes old profile
10249 data more tolerant to source changes such as function reordering etc.
10250 The default value is 0.
10252 @item min-vect-loop-bound
10253 The minimum number of iterations under which loops are not vectorized
10254 when @option{-ftree-vectorize} is used.  The number of iterations after
10255 vectorization needs to be greater than the value specified by this option
10256 to allow vectorization.  The default value is 0.
10258 @item gcse-cost-distance-ratio
10259 Scaling factor in calculation of maximum distance an expression
10260 can be moved by GCSE optimizations.  This is currently supported only in the
10261 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
10262 is with simple expressions, i.e., the expressions that have cost
10263 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
10264 hoisting of simple expressions.  The default value is 10.
10266 @item gcse-unrestricted-cost
10267 Cost, roughly measured as the cost of a single typical machine
10268 instruction, at which GCSE optimizations do not constrain
10269 the distance an expression can travel.  This is currently
10270 supported only in the code hoisting pass.  The lesser the cost,
10271 the more aggressive code hoisting is.  Specifying 0 
10272 allows all expressions to travel unrestricted distances.
10273 The default value is 3.
10275 @item max-hoist-depth
10276 The depth of search in the dominator tree for expressions to hoist.
10277 This is used to avoid quadratic behavior in hoisting algorithm.
10278 The value of 0 does not limit on the search, but may slow down compilation
10279 of huge functions.  The default value is 30.
10281 @item max-tail-merge-comparisons
10282 The maximum amount of similar bbs to compare a bb with.  This is used to
10283 avoid quadratic behavior in tree tail merging.  The default value is 10.
10285 @item max-tail-merge-iterations
10286 The maximum amount of iterations of the pass over the function.  This is used to
10287 limit compilation time in tree tail merging.  The default value is 2.
10289 @item max-unrolled-insns
10290 The maximum number of instructions that a loop may have to be unrolled.
10291 If a loop is unrolled, this parameter also determines how many times
10292 the loop code is unrolled.
10294 @item max-average-unrolled-insns
10295 The maximum number of instructions biased by probabilities of their execution
10296 that a loop may have to be unrolled.  If a loop is unrolled,
10297 this parameter also determines how many times the loop code is unrolled.
10299 @item max-unroll-times
10300 The maximum number of unrollings of a single loop.
10302 @item max-peeled-insns
10303 The maximum number of instructions that a loop may have to be peeled.
10304 If a loop is peeled, this parameter also determines how many times
10305 the loop code is peeled.
10307 @item max-peel-times
10308 The maximum number of peelings of a single loop.
10310 @item max-peel-branches
10311 The maximum number of branches on the hot path through the peeled sequence.
10313 @item max-completely-peeled-insns
10314 The maximum number of insns of a completely peeled loop.
10316 @item max-completely-peel-times
10317 The maximum number of iterations of a loop to be suitable for complete peeling.
10319 @item max-completely-peel-loop-nest-depth
10320 The maximum depth of a loop nest suitable for complete peeling.
10322 @item max-unswitch-insns
10323 The maximum number of insns of an unswitched loop.
10325 @item max-unswitch-level
10326 The maximum number of branches unswitched in a single loop.
10328 @item lim-expensive
10329 The minimum cost of an expensive expression in the loop invariant motion.
10331 @item iv-consider-all-candidates-bound
10332 Bound on number of candidates for induction variables, below which
10333 all candidates are considered for each use in induction variable
10334 optimizations.  If there are more candidates than this,
10335 only the most relevant ones are considered to avoid quadratic time complexity.
10337 @item iv-max-considered-uses
10338 The induction variable optimizations give up on loops that contain more
10339 induction variable uses.
10341 @item iv-always-prune-cand-set-bound
10342 If the number of candidates in the set is smaller than this value,
10343 always try to remove unnecessary ivs from the set
10344 when adding a new one.
10346 @item scev-max-expr-size
10347 Bound on size of expressions used in the scalar evolutions analyzer.
10348 Large expressions slow the analyzer.
10350 @item scev-max-expr-complexity
10351 Bound on the complexity of the expressions in the scalar evolutions analyzer.
10352 Complex expressions slow the analyzer.
10354 @item omega-max-vars
10355 The maximum number of variables in an Omega constraint system.
10356 The default value is 128.
10358 @item omega-max-geqs
10359 The maximum number of inequalities in an Omega constraint system.
10360 The default value is 256.
10362 @item omega-max-eqs
10363 The maximum number of equalities in an Omega constraint system.
10364 The default value is 128.
10366 @item omega-max-wild-cards
10367 The maximum number of wildcard variables that the Omega solver is
10368 able to insert.  The default value is 18.
10370 @item omega-hash-table-size
10371 The size of the hash table in the Omega solver.  The default value is
10372 550.
10374 @item omega-max-keys
10375 The maximal number of keys used by the Omega solver.  The default
10376 value is 500.
10378 @item omega-eliminate-redundant-constraints
10379 When set to 1, use expensive methods to eliminate all redundant
10380 constraints.  The default value is 0.
10382 @item vect-max-version-for-alignment-checks
10383 The maximum number of run-time checks that can be performed when
10384 doing loop versioning for alignment in the vectorizer.
10386 @item vect-max-version-for-alias-checks
10387 The maximum number of run-time checks that can be performed when
10388 doing loop versioning for alias in the vectorizer.
10390 @item vect-max-peeling-for-alignment
10391 The maximum number of loop peels to enhance access alignment
10392 for vectorizer. Value -1 means 'no limit'.
10394 @item max-iterations-to-track
10395 The maximum number of iterations of a loop the brute-force algorithm
10396 for analysis of the number of iterations of the loop tries to evaluate.
10398 @item hot-bb-count-ws-permille
10399 A basic block profile count is considered hot if it contributes to 
10400 the given permillage (i.e. 0...1000) of the entire profiled execution.
10402 @item hot-bb-frequency-fraction
10403 Select fraction of the entry block frequency of executions of basic block in
10404 function given basic block needs to have to be considered hot.
10406 @item max-predicted-iterations
10407 The maximum number of loop iterations we predict statically.  This is useful
10408 in cases where a function contains a single loop with known bound and
10409 another loop with unknown bound.
10410 The known number of iterations is predicted correctly, while
10411 the unknown number of iterations average to roughly 10.  This means that the
10412 loop without bounds appears artificially cold relative to the other one.
10414 @item builtin-expect-probability
10415 Control the probability of the expression having the specified value. This
10416 parameter takes a percentage (i.e. 0 ... 100) as input.
10417 The default probability of 90 is obtained empirically.
10419 @item align-threshold
10421 Select fraction of the maximal frequency of executions of a basic block in
10422 a function to align the basic block.
10424 @item align-loop-iterations
10426 A loop expected to iterate at least the selected number of iterations is
10427 aligned.
10429 @item tracer-dynamic-coverage
10430 @itemx tracer-dynamic-coverage-feedback
10432 This value is used to limit superblock formation once the given percentage of
10433 executed instructions is covered.  This limits unnecessary code size
10434 expansion.
10436 The @option{tracer-dynamic-coverage-feedback} is used only when profile
10437 feedback is available.  The real profiles (as opposed to statically estimated
10438 ones) are much less balanced allowing the threshold to be larger value.
10440 @item tracer-max-code-growth
10441 Stop tail duplication once code growth has reached given percentage.  This is
10442 a rather artificial limit, as most of the duplicates are eliminated later in
10443 cross jumping, so it may be set to much higher values than is the desired code
10444 growth.
10446 @item tracer-min-branch-ratio
10448 Stop reverse growth when the reverse probability of best edge is less than this
10449 threshold (in percent).
10451 @item tracer-min-branch-ratio
10452 @itemx tracer-min-branch-ratio-feedback
10454 Stop forward growth if the best edge has probability lower than this
10455 threshold.
10457 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
10458 compilation for profile feedback and one for compilation without.  The value
10459 for compilation with profile feedback needs to be more conservative (higher) in
10460 order to make tracer effective.
10462 @item max-cse-path-length
10464 The maximum number of basic blocks on path that CSE considers.
10465 The default is 10.
10467 @item max-cse-insns
10468 The maximum number of instructions CSE processes before flushing.
10469 The default is 1000.
10471 @item ggc-min-expand
10473 GCC uses a garbage collector to manage its own memory allocation.  This
10474 parameter specifies the minimum percentage by which the garbage
10475 collector's heap should be allowed to expand between collections.
10476 Tuning this may improve compilation speed; it has no effect on code
10477 generation.
10479 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
10480 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
10481 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
10482 GCC is not able to calculate RAM on a particular platform, the lower
10483 bound of 30% is used.  Setting this parameter and
10484 @option{ggc-min-heapsize} to zero causes a full collection to occur at
10485 every opportunity.  This is extremely slow, but can be useful for
10486 debugging.
10488 @item ggc-min-heapsize
10490 Minimum size of the garbage collector's heap before it begins bothering
10491 to collect garbage.  The first collection occurs after the heap expands
10492 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
10493 tuning this may improve compilation speed, and has no effect on code
10494 generation.
10496 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
10497 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
10498 with a lower bound of 4096 (four megabytes) and an upper bound of
10499 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
10500 particular platform, the lower bound is used.  Setting this parameter
10501 very large effectively disables garbage collection.  Setting this
10502 parameter and @option{ggc-min-expand} to zero causes a full collection
10503 to occur at every opportunity.
10505 @item max-reload-search-insns
10506 The maximum number of instruction reload should look backward for equivalent
10507 register.  Increasing values mean more aggressive optimization, making the
10508 compilation time increase with probably slightly better performance.
10509 The default value is 100.
10511 @item max-cselib-memory-locations
10512 The maximum number of memory locations cselib should take into account.
10513 Increasing values mean more aggressive optimization, making the compilation time
10514 increase with probably slightly better performance.  The default value is 500.
10516 @item reorder-blocks-duplicate
10517 @itemx reorder-blocks-duplicate-feedback
10519 Used by the basic block reordering pass to decide whether to use unconditional
10520 branch or duplicate the code on its destination.  Code is duplicated when its
10521 estimated size is smaller than this value multiplied by the estimated size of
10522 unconditional jump in the hot spots of the program.
10524 The @option{reorder-block-duplicate-feedback} is used only when profile
10525 feedback is available.  It may be set to higher values than
10526 @option{reorder-block-duplicate} since information about the hot spots is more
10527 accurate.
10529 @item max-sched-ready-insns
10530 The maximum number of instructions ready to be issued the scheduler should
10531 consider at any given time during the first scheduling pass.  Increasing
10532 values mean more thorough searches, making the compilation time increase
10533 with probably little benefit.  The default value is 100.
10535 @item max-sched-region-blocks
10536 The maximum number of blocks in a region to be considered for
10537 interblock scheduling.  The default value is 10.
10539 @item max-pipeline-region-blocks
10540 The maximum number of blocks in a region to be considered for
10541 pipelining in the selective scheduler.  The default value is 15.
10543 @item max-sched-region-insns
10544 The maximum number of insns in a region to be considered for
10545 interblock scheduling.  The default value is 100.
10547 @item max-pipeline-region-insns
10548 The maximum number of insns in a region to be considered for
10549 pipelining in the selective scheduler.  The default value is 200.
10551 @item min-spec-prob
10552 The minimum probability (in percents) of reaching a source block
10553 for interblock speculative scheduling.  The default value is 40.
10555 @item max-sched-extend-regions-iters
10556 The maximum number of iterations through CFG to extend regions.
10557 A value of 0 (the default) disables region extensions.
10559 @item max-sched-insn-conflict-delay
10560 The maximum conflict delay for an insn to be considered for speculative motion.
10561 The default value is 3.
10563 @item sched-spec-prob-cutoff
10564 The minimal probability of speculation success (in percents), so that
10565 speculative insns are scheduled.
10566 The default value is 40.
10568 @item sched-spec-state-edge-prob-cutoff
10569 The minimum probability an edge must have for the scheduler to save its
10570 state across it.
10571 The default value is 10.
10573 @item sched-mem-true-dep-cost
10574 Minimal distance (in CPU cycles) between store and load targeting same
10575 memory locations.  The default value is 1.
10577 @item selsched-max-lookahead
10578 The maximum size of the lookahead window of selective scheduling.  It is a
10579 depth of search for available instructions.
10580 The default value is 50.
10582 @item selsched-max-sched-times
10583 The maximum number of times that an instruction is scheduled during
10584 selective scheduling.  This is the limit on the number of iterations
10585 through which the instruction may be pipelined.  The default value is 2.
10587 @item selsched-max-insns-to-rename
10588 The maximum number of best instructions in the ready list that are considered
10589 for renaming in the selective scheduler.  The default value is 2.
10591 @item sms-min-sc
10592 The minimum value of stage count that swing modulo scheduler
10593 generates.  The default value is 2.
10595 @item max-last-value-rtl
10596 The maximum size measured as number of RTLs that can be recorded in an expression
10597 in combiner for a pseudo register as last known value of that register.  The default
10598 is 10000.
10600 @item max-combine-insns
10601 The maximum number of instructions the RTL combiner tries to combine.
10602 The default value is 2 at @option{-Og} and 4 otherwise.
10604 @item integer-share-limit
10605 Small integer constants can use a shared data structure, reducing the
10606 compiler's memory usage and increasing its speed.  This sets the maximum
10607 value of a shared integer constant.  The default value is 256.
10609 @item ssp-buffer-size
10610 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
10611 protection when @option{-fstack-protection} is used.
10613 @item min-size-for-stack-sharing
10614 The minimum size of variables taking part in stack slot sharing when not
10615 optimizing. The default value is 32.
10617 @item max-jump-thread-duplication-stmts
10618 Maximum number of statements allowed in a block that needs to be
10619 duplicated when threading jumps.
10621 @item max-fields-for-field-sensitive
10622 Maximum number of fields in a structure treated in
10623 a field sensitive manner during pointer analysis.  The default is zero
10624 for @option{-O0} and @option{-O1},
10625 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
10627 @item prefetch-latency
10628 Estimate on average number of instructions that are executed before
10629 prefetch finishes.  The distance prefetched ahead is proportional
10630 to this constant.  Increasing this number may also lead to less
10631 streams being prefetched (see @option{simultaneous-prefetches}).
10633 @item simultaneous-prefetches
10634 Maximum number of prefetches that can run at the same time.
10636 @item l1-cache-line-size
10637 The size of cache line in L1 cache, in bytes.
10639 @item l1-cache-size
10640 The size of L1 cache, in kilobytes.
10642 @item l2-cache-size
10643 The size of L2 cache, in kilobytes.
10645 @item min-insn-to-prefetch-ratio
10646 The minimum ratio between the number of instructions and the
10647 number of prefetches to enable prefetching in a loop.
10649 @item prefetch-min-insn-to-mem-ratio
10650 The minimum ratio between the number of instructions and the
10651 number of memory references to enable prefetching in a loop.
10653 @item use-canonical-types
10654 Whether the compiler should use the ``canonical'' type system.  By
10655 default, this should always be 1, which uses a more efficient internal
10656 mechanism for comparing types in C++ and Objective-C++.  However, if
10657 bugs in the canonical type system are causing compilation failures,
10658 set this value to 0 to disable canonical types.
10660 @item switch-conversion-max-branch-ratio
10661 Switch initialization conversion refuses to create arrays that are
10662 bigger than @option{switch-conversion-max-branch-ratio} times the number of
10663 branches in the switch.
10665 @item max-partial-antic-length
10666 Maximum length of the partial antic set computed during the tree
10667 partial redundancy elimination optimization (@option{-ftree-pre}) when
10668 optimizing at @option{-O3} and above.  For some sorts of source code
10669 the enhanced partial redundancy elimination optimization can run away,
10670 consuming all of the memory available on the host machine.  This
10671 parameter sets a limit on the length of the sets that are computed,
10672 which prevents the runaway behavior.  Setting a value of 0 for
10673 this parameter allows an unlimited set length.
10675 @item sccvn-max-scc-size
10676 Maximum size of a strongly connected component (SCC) during SCCVN
10677 processing.  If this limit is hit, SCCVN processing for the whole
10678 function is not done and optimizations depending on it are
10679 disabled.  The default maximum SCC size is 10000.
10681 @item sccvn-max-alias-queries-per-access
10682 Maximum number of alias-oracle queries we perform when looking for
10683 redundancies for loads and stores.  If this limit is hit the search
10684 is aborted and the load or store is not considered redundant.  The
10685 number of queries is algorithmically limited to the number of
10686 stores on all paths from the load to the function entry.
10687 The default maxmimum number of queries is 1000.
10689 @item ira-max-loops-num
10690 IRA uses regional register allocation by default.  If a function
10691 contains more loops than the number given by this parameter, only at most
10692 the given number of the most frequently-executed loops form regions
10693 for regional register allocation.  The default value of the
10694 parameter is 100.
10696 @item ira-max-conflict-table-size 
10697 Although IRA uses a sophisticated algorithm to compress the conflict
10698 table, the table can still require excessive amounts of memory for
10699 huge functions.  If the conflict table for a function could be more
10700 than the size in MB given by this parameter, the register allocator
10701 instead uses a faster, simpler, and lower-quality
10702 algorithm that does not require building a pseudo-register conflict table.  
10703 The default value of the parameter is 2000.
10705 @item ira-loop-reserved-regs
10706 IRA can be used to evaluate more accurate register pressure in loops
10707 for decisions to move loop invariants (see @option{-O3}).  The number
10708 of available registers reserved for some other purposes is given
10709 by this parameter.  The default value of the parameter is 2, which is
10710 the minimal number of registers needed by typical instructions.
10711 This value is the best found from numerous experiments.
10713 @item lra-inheritance-ebb-probability-cutoff
10714 LRA tries to reuse values reloaded in registers in subsequent insns.
10715 This optimization is called inheritance.  EBB is used as a region to
10716 do this optimization.  The parameter defines a minimal fall-through
10717 edge probability in percentage used to add BB to inheritance EBB in
10718 LRA.  The default value of the parameter is 40.  The value was chosen
10719 from numerous runs of SPEC2000 on x86-64.
10721 @item loop-invariant-max-bbs-in-loop
10722 Loop invariant motion can be very expensive, both in compilation time and
10723 in amount of needed compile-time memory, with very large loops.  Loops
10724 with more basic blocks than this parameter won't have loop invariant
10725 motion optimization performed on them.  The default value of the
10726 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
10728 @item loop-max-datarefs-for-datadeps
10729 Building data dapendencies is expensive for very large loops.  This
10730 parameter limits the number of data references in loops that are
10731 considered for data dependence analysis.  These large loops are no
10732 handled by the optimizations using loop data dependencies.
10733 The default value is 1000.
10735 @item max-vartrack-size
10736 Sets a maximum number of hash table slots to use during variable
10737 tracking dataflow analysis of any function.  If this limit is exceeded
10738 with variable tracking at assignments enabled, analysis for that
10739 function is retried without it, after removing all debug insns from
10740 the function.  If the limit is exceeded even without debug insns, var
10741 tracking analysis is completely disabled for the function.  Setting
10742 the parameter to zero makes it unlimited.
10744 @item max-vartrack-expr-depth
10745 Sets a maximum number of recursion levels when attempting to map
10746 variable names or debug temporaries to value expressions.  This trades
10747 compilation time for more complete debug information.  If this is set too
10748 low, value expressions that are available and could be represented in
10749 debug information may end up not being used; setting this higher may
10750 enable the compiler to find more complex debug expressions, but compile
10751 time and memory use may grow.  The default is 12.
10753 @item min-nondebug-insn-uid
10754 Use uids starting at this parameter for nondebug insns.  The range below
10755 the parameter is reserved exclusively for debug insns created by
10756 @option{-fvar-tracking-assignments}, but debug insns may get
10757 (non-overlapping) uids above it if the reserved range is exhausted.
10759 @item ipa-sra-ptr-growth-factor
10760 IPA-SRA replaces a pointer to an aggregate with one or more new
10761 parameters only when their cumulative size is less or equal to
10762 @option{ipa-sra-ptr-growth-factor} times the size of the original
10763 pointer parameter.
10765 @item sra-max-scalarization-size-Ospeed
10766 @item sra-max-scalarization-size-Osize
10767 The two Scalar Reduction of Aggregates passes (SRA and IPA-SRA) aim to
10768 replace scalar parts of aggregates with uses of independent scalar
10769 variables.  These parameters control the maximum size, in storage units,
10770 of aggregate which is considered for replacement when compiling for
10771 speed
10772 (@option{sra-max-scalarization-size-Ospeed}) or size
10773 (@option{sra-max-scalarization-size-Osize}) respectively.
10775 @item tm-max-aggregate-size
10776 When making copies of thread-local variables in a transaction, this
10777 parameter specifies the size in bytes after which variables are
10778 saved with the logging functions as opposed to save/restore code
10779 sequence pairs.  This option only applies when using
10780 @option{-fgnu-tm}.
10782 @item graphite-max-nb-scop-params
10783 To avoid exponential effects in the Graphite loop transforms, the
10784 number of parameters in a Static Control Part (SCoP) is bounded.  The
10785 default value is 10 parameters.  A variable whose value is unknown at
10786 compilation time and defined outside a SCoP is a parameter of the SCoP.
10788 @item graphite-max-bbs-per-function
10789 To avoid exponential effects in the detection of SCoPs, the size of
10790 the functions analyzed by Graphite is bounded.  The default value is
10791 100 basic blocks.
10793 @item loop-block-tile-size
10794 Loop blocking or strip mining transforms, enabled with
10795 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
10796 loop in the loop nest by a given number of iterations.  The strip
10797 length can be changed using the @option{loop-block-tile-size}
10798 parameter.  The default value is 51 iterations.
10800 @item loop-unroll-jam-size
10801 Specify the unroll factor for the @option{-floop-unroll-and-jam}.  The 
10802 default value is 4.
10804 @item loop-unroll-jam-depth
10805 Specify the dimension to be unrolled (counting from the most inner loop)
10806 for the  @option{-floop-unroll-and-jam}.  The default value is 2.
10808 @item ipa-cp-value-list-size
10809 IPA-CP attempts to track all possible values and types passed to a function's
10810 parameter in order to propagate them and perform devirtualization.
10811 @option{ipa-cp-value-list-size} is the maximum number of values and types it
10812 stores per one formal parameter of a function.
10814 @item ipa-cp-eval-threshold
10815 IPA-CP calculates its own score of cloning profitability heuristics
10816 and performs those cloning opportunities with scores that exceed
10817 @option{ipa-cp-eval-threshold}.
10819 @item ipa-max-agg-items
10820 IPA-CP is also capable to propagate a number of scalar values passed
10821 in an aggregate. @option{ipa-max-agg-items} controls the maximum
10822 number of such values per one parameter.
10824 @item ipa-cp-loop-hint-bonus
10825 When IPA-CP determines that a cloning candidate would make the number
10826 of iterations of a loop known, it adds a bonus of
10827 @option{ipa-cp-loop-hint-bonus} to the profitability score of
10828 the candidate.
10830 @item ipa-cp-array-index-hint-bonus
10831 When IPA-CP determines that a cloning candidate would make the index of
10832 an array access known, it adds a bonus of
10833 @option{ipa-cp-array-index-hint-bonus} to the profitability
10834 score of the candidate.
10836 @item ipa-max-aa-steps
10837 During its analysis of function bodies, IPA-CP employs alias analysis
10838 in order to track values pointed to by function parameters.  In order
10839 not spend too much time analyzing huge functions, it gives up and
10840 consider all memory clobbered after examining
10841 @option{ipa-max-aa-steps} statements modifying memory.
10843 @item lto-partitions
10844 Specify desired number of partitions produced during WHOPR compilation.
10845 The number of partitions should exceed the number of CPUs used for compilation.
10846 The default value is 32.
10848 @item lto-minpartition
10849 Size of minimal partition for WHOPR (in estimated instructions).
10850 This prevents expenses of splitting very small programs into too many
10851 partitions.
10853 @item cxx-max-namespaces-for-diagnostic-help
10854 The maximum number of namespaces to consult for suggestions when C++
10855 name lookup fails for an identifier.  The default is 1000.
10857 @item sink-frequency-threshold
10858 The maximum relative execution frequency (in percents) of the target block
10859 relative to a statement's original block to allow statement sinking of a
10860 statement.  Larger numbers result in more aggressive statement sinking.
10861 The default value is 75.  A small positive adjustment is applied for
10862 statements with memory operands as those are even more profitable so sink.
10864 @item max-stores-to-sink
10865 The maximum number of conditional stores paires that can be sunk.  Set to 0
10866 if either vectorization (@option{-ftree-vectorize}) or if-conversion
10867 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
10869 @item allow-store-data-races
10870 Allow optimizers to introduce new data races on stores.
10871 Set to 1 to allow, otherwise to 0.  This option is enabled by default
10872 at optimization level @option{-Ofast}.
10874 @item case-values-threshold
10875 The smallest number of different values for which it is best to use a
10876 jump-table instead of a tree of conditional branches.  If the value is
10877 0, use the default for the machine.  The default is 0.
10879 @item tree-reassoc-width
10880 Set the maximum number of instructions executed in parallel in
10881 reassociated tree. This parameter overrides target dependent
10882 heuristics used by default if has non zero value.
10884 @item sched-pressure-algorithm
10885 Choose between the two available implementations of
10886 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
10887 and is the more likely to prevent instructions from being reordered.
10888 Algorithm 2 was designed to be a compromise between the relatively
10889 conservative approach taken by algorithm 1 and the rather aggressive
10890 approach taken by the default scheduler.  It relies more heavily on
10891 having a regular register file and accurate register pressure classes.
10892 See @file{haifa-sched.c} in the GCC sources for more details.
10894 The default choice depends on the target.
10896 @item max-slsr-cand-scan
10897 Set the maximum number of existing candidates that are considered when
10898 seeking a basis for a new straight-line strength reduction candidate.
10900 @item asan-globals
10901 Enable buffer overflow detection for global objects.  This kind
10902 of protection is enabled by default if you are using
10903 @option{-fsanitize=address} option.
10904 To disable global objects protection use @option{--param asan-globals=0}.
10906 @item asan-stack
10907 Enable buffer overflow detection for stack objects.  This kind of
10908 protection is enabled by default when using@option{-fsanitize=address}.
10909 To disable stack protection use @option{--param asan-stack=0} option.
10911 @item asan-instrument-reads
10912 Enable buffer overflow detection for memory reads.  This kind of
10913 protection is enabled by default when using @option{-fsanitize=address}.
10914 To disable memory reads protection use
10915 @option{--param asan-instrument-reads=0}.
10917 @item asan-instrument-writes
10918 Enable buffer overflow detection for memory writes.  This kind of
10919 protection is enabled by default when using @option{-fsanitize=address}.
10920 To disable memory writes protection use
10921 @option{--param asan-instrument-writes=0} option.
10923 @item asan-memintrin
10924 Enable detection for built-in functions.  This kind of protection
10925 is enabled by default when using @option{-fsanitize=address}.
10926 To disable built-in functions protection use
10927 @option{--param asan-memintrin=0}.
10929 @item asan-use-after-return
10930 Enable detection of use-after-return.  This kind of protection
10931 is enabled by default when using @option{-fsanitize=address} option.
10932 To disable use-after-return detection use 
10933 @option{--param asan-use-after-return=0}.
10935 @item asan-instrumentation-with-call-threshold
10936 If number of memory accesses in function being instrumented
10937 is greater or equal to this number, use callbacks instead of inline checks.
10938 E.g. to disable inline code use
10939 @option{--param asan-instrumentation-with-call-threshold=0}.
10941 @item chkp-max-ctor-size
10942 Static constructors generated by Pointer Bounds Checker may become very
10943 large and significantly increase compile time at optimization level
10944 @option{-O1} and higher.  This parameter is a maximum nubmer of statements
10945 in a single generated constructor.  Default value is 5000.
10947 @item max-fsm-thread-path-insns
10948 Maximum number of instructions to copy when duplicating blocks on a
10949 finite state automaton jump thread path.  The default is 100.
10951 @item max-fsm-thread-length
10952 Maximum number of basic blocks on a finite state automaton jump thread
10953 path.  The default is 10.
10955 @item max-fsm-thread-paths
10956 Maximum number of new jump thread paths to create for a finite state
10957 automaton.  The default is 50.
10959 @end table
10960 @end table
10962 @node Preprocessor Options
10963 @section Options Controlling the Preprocessor
10964 @cindex preprocessor options
10965 @cindex options, preprocessor
10967 These options control the C preprocessor, which is run on each C source
10968 file before actual compilation.
10970 If you use the @option{-E} option, nothing is done except preprocessing.
10971 Some of these options make sense only together with @option{-E} because
10972 they cause the preprocessor output to be unsuitable for actual
10973 compilation.
10975 @table @gcctabopt
10976 @item -Wp,@var{option}
10977 @opindex Wp
10978 You can use @option{-Wp,@var{option}} to bypass the compiler driver
10979 and pass @var{option} directly through to the preprocessor.  If
10980 @var{option} contains commas, it is split into multiple options at the
10981 commas.  However, many options are modified, translated or interpreted
10982 by the compiler driver before being passed to the preprocessor, and
10983 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
10984 interface is undocumented and subject to change, so whenever possible
10985 you should avoid using @option{-Wp} and let the driver handle the
10986 options instead.
10988 @item -Xpreprocessor @var{option}
10989 @opindex Xpreprocessor
10990 Pass @var{option} as an option to the preprocessor.  You can use this to
10991 supply system-specific preprocessor options that GCC does not 
10992 recognize.
10994 If you want to pass an option that takes an argument, you must use
10995 @option{-Xpreprocessor} twice, once for the option and once for the argument.
10997 @item -no-integrated-cpp
10998 @opindex no-integrated-cpp
10999 Perform preprocessing as a separate pass before compilation.
11000 By default, GCC performs preprocessing as an integrated part of
11001 input tokenization and parsing.
11002 If this option is provided, the appropriate language front end
11003 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
11004 and Objective-C, respectively) is instead invoked twice,
11005 once for preprocessing only and once for actual compilation
11006 of the preprocessed input.
11007 This option may be useful in conjunction with the @option{-B} or
11008 @option{-wrapper} options to specify an alternate preprocessor or
11009 perform additional processing of the program source between
11010 normal preprocessing and compilation.
11011 @end table
11013 @include cppopts.texi
11015 @node Assembler Options
11016 @section Passing Options to the Assembler
11018 @c prevent bad page break with this line
11019 You can pass options to the assembler.
11021 @table @gcctabopt
11022 @item -Wa,@var{option}
11023 @opindex Wa
11024 Pass @var{option} as an option to the assembler.  If @var{option}
11025 contains commas, it is split into multiple options at the commas.
11027 @item -Xassembler @var{option}
11028 @opindex Xassembler
11029 Pass @var{option} as an option to the assembler.  You can use this to
11030 supply system-specific assembler options that GCC does not
11031 recognize.
11033 If you want to pass an option that takes an argument, you must use
11034 @option{-Xassembler} twice, once for the option and once for the argument.
11036 @end table
11038 @node Link Options
11039 @section Options for Linking
11040 @cindex link options
11041 @cindex options, linking
11043 These options come into play when the compiler links object files into
11044 an executable output file.  They are meaningless if the compiler is
11045 not doing a link step.
11047 @table @gcctabopt
11048 @cindex file names
11049 @item @var{object-file-name}
11050 A file name that does not end in a special recognized suffix is
11051 considered to name an object file or library.  (Object files are
11052 distinguished from libraries by the linker according to the file
11053 contents.)  If linking is done, these object files are used as input
11054 to the linker.
11056 @item -c
11057 @itemx -S
11058 @itemx -E
11059 @opindex c
11060 @opindex S
11061 @opindex E
11062 If any of these options is used, then the linker is not run, and
11063 object file names should not be used as arguments.  @xref{Overall
11064 Options}.
11066 @item -fuse-ld=bfd
11067 @opindex fuse-ld=bfd
11068 Use the @command{bfd} linker instead of the default linker.
11070 @item -fuse-ld=gold
11071 @opindex fuse-ld=gold
11072 Use the @command{gold} linker instead of the default linker.
11074 @cindex Libraries
11075 @item -l@var{library}
11076 @itemx -l @var{library}
11077 @opindex l
11078 Search the library named @var{library} when linking.  (The second
11079 alternative with the library as a separate argument is only for
11080 POSIX compliance and is not recommended.)
11082 It makes a difference where in the command you write this option; the
11083 linker searches and processes libraries and object files in the order they
11084 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
11085 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
11086 to functions in @samp{z}, those functions may not be loaded.
11088 The linker searches a standard list of directories for the library,
11089 which is actually a file named @file{lib@var{library}.a}.  The linker
11090 then uses this file as if it had been specified precisely by name.
11092 The directories searched include several standard system directories
11093 plus any that you specify with @option{-L}.
11095 Normally the files found this way are library files---archive files
11096 whose members are object files.  The linker handles an archive file by
11097 scanning through it for members which define symbols that have so far
11098 been referenced but not defined.  But if the file that is found is an
11099 ordinary object file, it is linked in the usual fashion.  The only
11100 difference between using an @option{-l} option and specifying a file name
11101 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
11102 and searches several directories.
11104 @item -lobjc
11105 @opindex lobjc
11106 You need this special case of the @option{-l} option in order to
11107 link an Objective-C or Objective-C++ program.
11109 @item -nostartfiles
11110 @opindex nostartfiles
11111 Do not use the standard system startup files when linking.
11112 The standard system libraries are used normally, unless @option{-nostdlib}
11113 or @option{-nodefaultlibs} is used.
11115 @item -nodefaultlibs
11116 @opindex nodefaultlibs
11117 Do not use the standard system libraries when linking.
11118 Only the libraries you specify are passed to the linker, and options
11119 specifying linkage of the system libraries, such as @option{-static-libgcc}
11120 or @option{-shared-libgcc}, are ignored.  
11121 The standard startup files are used normally, unless @option{-nostartfiles}
11122 is used.  
11124 The compiler may generate calls to @code{memcmp},
11125 @code{memset}, @code{memcpy} and @code{memmove}.
11126 These entries are usually resolved by entries in
11127 libc.  These entry points should be supplied through some other
11128 mechanism when this option is specified.
11130 @item -nostdlib
11131 @opindex nostdlib
11132 Do not use the standard system startup files or libraries when linking.
11133 No startup files and only the libraries you specify are passed to
11134 the linker, and options specifying linkage of the system libraries, such as
11135 @option{-static-libgcc} or @option{-shared-libgcc}, are ignored.
11137 The compiler may generate calls to @code{memcmp}, @code{memset},
11138 @code{memcpy} and @code{memmove}.
11139 These entries are usually resolved by entries in
11140 libc.  These entry points should be supplied through some other
11141 mechanism when this option is specified.
11143 @cindex @option{-lgcc}, use with @option{-nostdlib}
11144 @cindex @option{-nostdlib} and unresolved references
11145 @cindex unresolved references and @option{-nostdlib}
11146 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
11147 @cindex @option{-nodefaultlibs} and unresolved references
11148 @cindex unresolved references and @option{-nodefaultlibs}
11149 One of the standard libraries bypassed by @option{-nostdlib} and
11150 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
11151 which GCC uses to overcome shortcomings of particular machines, or special
11152 needs for some languages.
11153 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
11154 Collection (GCC) Internals},
11155 for more discussion of @file{libgcc.a}.)
11156 In most cases, you need @file{libgcc.a} even when you want to avoid
11157 other standard libraries.  In other words, when you specify @option{-nostdlib}
11158 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
11159 This ensures that you have no unresolved references to internal GCC
11160 library subroutines.
11161 (An example of such an internal subroutine is @code{__main}, used to ensure C++
11162 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
11163 GNU Compiler Collection (GCC) Internals}.)
11165 @item -pie
11166 @opindex pie
11167 Produce a position independent executable on targets that support it.
11168 For predictable results, you must also specify the same set of options
11169 used for compilation (@option{-fpie}, @option{-fPIE},
11170 or model suboptions) when you specify this linker option.
11172 @item -rdynamic
11173 @opindex rdynamic
11174 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
11175 that support it. This instructs the linker to add all symbols, not
11176 only used ones, to the dynamic symbol table. This option is needed
11177 for some uses of @code{dlopen} or to allow obtaining backtraces
11178 from within a program.
11180 @item -s
11181 @opindex s
11182 Remove all symbol table and relocation information from the executable.
11184 @item -static
11185 @opindex static
11186 On systems that support dynamic linking, this prevents linking with the shared
11187 libraries.  On other systems, this option has no effect.
11189 @item -shared
11190 @opindex shared
11191 Produce a shared object which can then be linked with other objects to
11192 form an executable.  Not all systems support this option.  For predictable
11193 results, you must also specify the same set of options used for compilation
11194 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
11195 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
11196 needs to build supplementary stub code for constructors to work.  On
11197 multi-libbed systems, @samp{gcc -shared} must select the correct support
11198 libraries to link against.  Failing to supply the correct flags may lead
11199 to subtle defects.  Supplying them in cases where they are not necessary
11200 is innocuous.}
11202 @item -shared-libgcc
11203 @itemx -static-libgcc
11204 @opindex shared-libgcc
11205 @opindex static-libgcc
11206 On systems that provide @file{libgcc} as a shared library, these options
11207 force the use of either the shared or static version, respectively.
11208 If no shared version of @file{libgcc} was built when the compiler was
11209 configured, these options have no effect.
11211 There are several situations in which an application should use the
11212 shared @file{libgcc} instead of the static version.  The most common
11213 of these is when the application wishes to throw and catch exceptions
11214 across different shared libraries.  In that case, each of the libraries
11215 as well as the application itself should use the shared @file{libgcc}.
11217 Therefore, the G++ and GCJ drivers automatically add
11218 @option{-shared-libgcc} whenever you build a shared library or a main
11219 executable, because C++ and Java programs typically use exceptions, so
11220 this is the right thing to do.
11222 If, instead, you use the GCC driver to create shared libraries, you may
11223 find that they are not always linked with the shared @file{libgcc}.
11224 If GCC finds, at its configuration time, that you have a non-GNU linker
11225 or a GNU linker that does not support option @option{--eh-frame-hdr},
11226 it links the shared version of @file{libgcc} into shared libraries
11227 by default.  Otherwise, it takes advantage of the linker and optimizes
11228 away the linking with the shared version of @file{libgcc}, linking with
11229 the static version of libgcc by default.  This allows exceptions to
11230 propagate through such shared libraries, without incurring relocation
11231 costs at library load time.
11233 However, if a library or main executable is supposed to throw or catch
11234 exceptions, you must link it using the G++ or GCJ driver, as appropriate
11235 for the languages used in the program, or using the option
11236 @option{-shared-libgcc}, such that it is linked with the shared
11237 @file{libgcc}.
11239 @item -static-libasan
11240 @opindex static-libasan
11241 When the @option{-fsanitize=address} option is used to link a program,
11242 the GCC driver automatically links against @option{libasan}.  If
11243 @file{libasan} is available as a shared library, and the @option{-static}
11244 option is not used, then this links against the shared version of
11245 @file{libasan}.  The @option{-static-libasan} option directs the GCC
11246 driver to link @file{libasan} statically, without necessarily linking
11247 other libraries statically.
11249 @item -static-libtsan
11250 @opindex static-libtsan
11251 When the @option{-fsanitize=thread} option is used to link a program,
11252 the GCC driver automatically links against @option{libtsan}.  If
11253 @file{libtsan} is available as a shared library, and the @option{-static}
11254 option is not used, then this links against the shared version of
11255 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
11256 driver to link @file{libtsan} statically, without necessarily linking
11257 other libraries statically.
11259 @item -static-liblsan
11260 @opindex static-liblsan
11261 When the @option{-fsanitize=leak} option is used to link a program,
11262 the GCC driver automatically links against @option{liblsan}.  If
11263 @file{liblsan} is available as a shared library, and the @option{-static}
11264 option is not used, then this links against the shared version of
11265 @file{liblsan}.  The @option{-static-liblsan} option directs the GCC
11266 driver to link @file{liblsan} statically, without necessarily linking
11267 other libraries statically.
11269 @item -static-libubsan
11270 @opindex static-libubsan
11271 When the @option{-fsanitize=undefined} option is used to link a program,
11272 the GCC driver automatically links against @option{libubsan}.  If
11273 @file{libubsan} is available as a shared library, and the @option{-static}
11274 option is not used, then this links against the shared version of
11275 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
11276 driver to link @file{libubsan} statically, without necessarily linking
11277 other libraries statically.
11279 @item -static-libmpx
11280 @opindex static-libmpx
11281 When @option{-fcheck-pointer bounds} and @option{-mmpx} options are
11282 used to link a program, the GCC driver automatically links against
11283 @option{libmpx}.  If @file{libmpx} is available as a shared library,
11284 and the @option{-static} option is not used, then this links against
11285 the shared version of @file{libmpx}.  The @option{-static-libmpx}
11286 option directs the GCC driver to link @file{libmpx} statically,
11287 without necessarily linking other libraries statically.
11289 @item -static-libmpxwrappers
11290 @opindex static-libmpxwrappers
11291 When @option{-fcheck-pointer bounds}, @option{-mmpx} options are used and
11292 @option{-fno-chkp-use-wrappers} option is not used to link a program, the
11293 GCC driver automatically links against @option{libmpxwrappers}.  If
11294 @file{libmpxwrappers} is available as a shared library, and the
11295 @option{-static} option is not used, then this links against the shared
11296 version of @file{libmpxwrappers}.  The @option{-static-libmpxwrappers}
11297 option directs the GCC driver to link @file{libmpxwrappers} statically,
11298 without necessarily linking other libraries statically.
11300 @item -static-libstdc++
11301 @opindex static-libstdc++
11302 When the @command{g++} program is used to link a C++ program, it
11303 normally automatically links against @option{libstdc++}.  If
11304 @file{libstdc++} is available as a shared library, and the
11305 @option{-static} option is not used, then this links against the
11306 shared version of @file{libstdc++}.  That is normally fine.  However, it
11307 is sometimes useful to freeze the version of @file{libstdc++} used by
11308 the program without going all the way to a fully static link.  The
11309 @option{-static-libstdc++} option directs the @command{g++} driver to
11310 link @file{libstdc++} statically, without necessarily linking other
11311 libraries statically.
11313 @item -symbolic
11314 @opindex symbolic
11315 Bind references to global symbols when building a shared object.  Warn
11316 about any unresolved references (unless overridden by the link editor
11317 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
11318 this option.
11320 @item -T @var{script}
11321 @opindex T
11322 @cindex linker script
11323 Use @var{script} as the linker script.  This option is supported by most
11324 systems using the GNU linker.  On some targets, such as bare-board
11325 targets without an operating system, the @option{-T} option may be required
11326 when linking to avoid references to undefined symbols.
11328 @item -Xlinker @var{option}
11329 @opindex Xlinker
11330 Pass @var{option} as an option to the linker.  You can use this to
11331 supply system-specific linker options that GCC does not recognize.
11333 If you want to pass an option that takes a separate argument, you must use
11334 @option{-Xlinker} twice, once for the option and once for the argument.
11335 For example, to pass @option{-assert definitions}, you must write
11336 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
11337 @option{-Xlinker "-assert definitions"}, because this passes the entire
11338 string as a single argument, which is not what the linker expects.
11340 When using the GNU linker, it is usually more convenient to pass
11341 arguments to linker options using the @option{@var{option}=@var{value}}
11342 syntax than as separate arguments.  For example, you can specify
11343 @option{-Xlinker -Map=output.map} rather than
11344 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
11345 this syntax for command-line options.
11347 @item -Wl,@var{option}
11348 @opindex Wl
11349 Pass @var{option} as an option to the linker.  If @var{option} contains
11350 commas, it is split into multiple options at the commas.  You can use this
11351 syntax to pass an argument to the option.
11352 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
11353 linker.  When using the GNU linker, you can also get the same effect with
11354 @option{-Wl,-Map=output.map}.
11356 @item -u @var{symbol}
11357 @opindex u
11358 Pretend the symbol @var{symbol} is undefined, to force linking of
11359 library modules to define it.  You can use @option{-u} multiple times with
11360 different symbols to force loading of additional library modules.
11362 @item -z @var{keyword}
11363 @opindex z
11364 @option{-z} is passed directly on to the linker along with the keyword
11365 @var{keyword}. See the section in the documentation of your linker for
11366 permitted values and their meanings.
11367 @end table
11369 @node Directory Options
11370 @section Options for Directory Search
11371 @cindex directory options
11372 @cindex options, directory search
11373 @cindex search path
11375 These options specify directories to search for header files, for
11376 libraries and for parts of the compiler:
11378 @table @gcctabopt
11379 @item -I@var{dir}
11380 @opindex I
11381 Add the directory @var{dir} to the head of the list of directories to be
11382 searched for header files.  This can be used to override a system header
11383 file, substituting your own version, since these directories are
11384 searched before the system header file directories.  However, you should
11385 not use this option to add directories that contain vendor-supplied
11386 system header files (use @option{-isystem} for that).  If you use more than
11387 one @option{-I} option, the directories are scanned in left-to-right
11388 order; the standard system directories come after.
11390 If a standard system include directory, or a directory specified with
11391 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
11392 option is ignored.  The directory is still searched but as a
11393 system directory at its normal position in the system include chain.
11394 This is to ensure that GCC's procedure to fix buggy system headers and
11395 the ordering for the @code{include_next} directive are not inadvertently changed.
11396 If you really need to change the search order for system directories,
11397 use the @option{-nostdinc} and/or @option{-isystem} options.
11399 @item -iplugindir=@var{dir}
11400 @opindex iplugindir=
11401 Set the directory to search for plugins that are passed
11402 by @option{-fplugin=@var{name}} instead of
11403 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
11404 to be used by the user, but only passed by the driver.
11406 @item -iquote@var{dir}
11407 @opindex iquote
11408 Add the directory @var{dir} to the head of the list of directories to
11409 be searched for header files only for the case of @code{#include
11410 "@var{file}"}; they are not searched for @code{#include <@var{file}>},
11411 otherwise just like @option{-I}.
11413 @item -L@var{dir}
11414 @opindex L
11415 Add directory @var{dir} to the list of directories to be searched
11416 for @option{-l}.
11418 @item -B@var{prefix}
11419 @opindex B
11420 This option specifies where to find the executables, libraries,
11421 include files, and data files of the compiler itself.
11423 The compiler driver program runs one or more of the subprograms
11424 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
11425 @var{prefix} as a prefix for each program it tries to run, both with and
11426 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
11428 For each subprogram to be run, the compiler driver first tries the
11429 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
11430 is not specified, the driver tries two standard prefixes, 
11431 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
11432 those results in a file name that is found, the unmodified program
11433 name is searched for using the directories specified in your
11434 @env{PATH} environment variable.
11436 The compiler checks to see if the path provided by the @option{-B}
11437 refers to a directory, and if necessary it adds a directory
11438 separator character at the end of the path.
11440 @option{-B} prefixes that effectively specify directory names also apply
11441 to libraries in the linker, because the compiler translates these
11442 options into @option{-L} options for the linker.  They also apply to
11443 include files in the preprocessor, because the compiler translates these
11444 options into @option{-isystem} options for the preprocessor.  In this case,
11445 the compiler appends @samp{include} to the prefix.
11447 The runtime support file @file{libgcc.a} can also be searched for using
11448 the @option{-B} prefix, if needed.  If it is not found there, the two
11449 standard prefixes above are tried, and that is all.  The file is left
11450 out of the link if it is not found by those means.
11452 Another way to specify a prefix much like the @option{-B} prefix is to use
11453 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
11454 Variables}.
11456 As a special kludge, if the path provided by @option{-B} is
11457 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
11458 9, then it is replaced by @file{[dir/]include}.  This is to help
11459 with boot-strapping the compiler.
11461 @item -specs=@var{file}
11462 @opindex specs
11463 Process @var{file} after the compiler reads in the standard @file{specs}
11464 file, in order to override the defaults which the @command{gcc} driver
11465 program uses when determining what switches to pass to @command{cc1},
11466 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
11467 @option{-specs=@var{file}} can be specified on the command line, and they
11468 are processed in order, from left to right.
11470 @item --sysroot=@var{dir}
11471 @opindex sysroot
11472 Use @var{dir} as the logical root directory for headers and libraries.
11473 For example, if the compiler normally searches for headers in
11474 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
11475 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
11477 If you use both this option and the @option{-isysroot} option, then
11478 the @option{--sysroot} option applies to libraries, but the
11479 @option{-isysroot} option applies to header files.
11481 The GNU linker (beginning with version 2.16) has the necessary support
11482 for this option.  If your linker does not support this option, the
11483 header file aspect of @option{--sysroot} still works, but the
11484 library aspect does not.
11486 @item --no-sysroot-suffix
11487 @opindex no-sysroot-suffix
11488 For some targets, a suffix is added to the root directory specified
11489 with @option{--sysroot}, depending on the other options used, so that
11490 headers may for example be found in
11491 @file{@var{dir}/@var{suffix}/usr/include} instead of
11492 @file{@var{dir}/usr/include}.  This option disables the addition of
11493 such a suffix.
11495 @item -I-
11496 @opindex I-
11497 This option has been deprecated.  Please use @option{-iquote} instead for
11498 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
11499 Any directories you specify with @option{-I} options before the @option{-I-}
11500 option are searched only for the case of @code{#include "@var{file}"};
11501 they are not searched for @code{#include <@var{file}>}.
11503 If additional directories are specified with @option{-I} options after
11504 the @option{-I-}, these directories are searched for all @code{#include}
11505 directives.  (Ordinarily @emph{all} @option{-I} directories are used
11506 this way.)
11508 In addition, the @option{-I-} option inhibits the use of the current
11509 directory (where the current input file came from) as the first search
11510 directory for @code{#include "@var{file}"}.  There is no way to
11511 override this effect of @option{-I-}.  With @option{-I.} you can specify
11512 searching the directory that is current when the compiler is
11513 invoked.  That is not exactly the same as what the preprocessor does
11514 by default, but it is often satisfactory.
11516 @option{-I-} does not inhibit the use of the standard system directories
11517 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
11518 independent.
11519 @end table
11521 @c man end
11523 @node Spec Files
11524 @section Specifying Subprocesses and the Switches to Pass to Them
11525 @cindex Spec Files
11527 @command{gcc} is a driver program.  It performs its job by invoking a
11528 sequence of other programs to do the work of compiling, assembling and
11529 linking.  GCC interprets its command-line parameters and uses these to
11530 deduce which programs it should invoke, and which command-line options
11531 it ought to place on their command lines.  This behavior is controlled
11532 by @dfn{spec strings}.  In most cases there is one spec string for each
11533 program that GCC can invoke, but a few programs have multiple spec
11534 strings to control their behavior.  The spec strings built into GCC can
11535 be overridden by using the @option{-specs=} command-line switch to specify
11536 a spec file.
11538 @dfn{Spec files} are plaintext files that are used to construct spec
11539 strings.  They consist of a sequence of directives separated by blank
11540 lines.  The type of directive is determined by the first non-whitespace
11541 character on the line, which can be one of the following:
11543 @table @code
11544 @item %@var{command}
11545 Issues a @var{command} to the spec file processor.  The commands that can
11546 appear here are:
11548 @table @code
11549 @item %include <@var{file}>
11550 @cindex @code{%include}
11551 Search for @var{file} and insert its text at the current point in the
11552 specs file.
11554 @item %include_noerr <@var{file}>
11555 @cindex @code{%include_noerr}
11556 Just like @samp{%include}, but do not generate an error message if the include
11557 file cannot be found.
11559 @item %rename @var{old_name} @var{new_name}
11560 @cindex @code{%rename}
11561 Rename the spec string @var{old_name} to @var{new_name}.
11563 @end table
11565 @item *[@var{spec_name}]:
11566 This tells the compiler to create, override or delete the named spec
11567 string.  All lines after this directive up to the next directive or
11568 blank line are considered to be the text for the spec string.  If this
11569 results in an empty string then the spec is deleted.  (Or, if the
11570 spec did not exist, then nothing happens.)  Otherwise, if the spec
11571 does not currently exist a new spec is created.  If the spec does
11572 exist then its contents are overridden by the text of this
11573 directive, unless the first character of that text is the @samp{+}
11574 character, in which case the text is appended to the spec.
11576 @item [@var{suffix}]:
11577 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
11578 and up to the next directive or blank line are considered to make up the
11579 spec string for the indicated suffix.  When the compiler encounters an
11580 input file with the named suffix, it processes the spec string in
11581 order to work out how to compile that file.  For example:
11583 @smallexample
11584 .ZZ:
11585 z-compile -input %i
11586 @end smallexample
11588 This says that any input file whose name ends in @samp{.ZZ} should be
11589 passed to the program @samp{z-compile}, which should be invoked with the
11590 command-line switch @option{-input} and with the result of performing the
11591 @samp{%i} substitution.  (See below.)
11593 As an alternative to providing a spec string, the text following a
11594 suffix directive can be one of the following:
11596 @table @code
11597 @item @@@var{language}
11598 This says that the suffix is an alias for a known @var{language}.  This is
11599 similar to using the @option{-x} command-line switch to GCC to specify a
11600 language explicitly.  For example:
11602 @smallexample
11603 .ZZ:
11604 @@c++
11605 @end smallexample
11607 Says that .ZZ files are, in fact, C++ source files.
11609 @item #@var{name}
11610 This causes an error messages saying:
11612 @smallexample
11613 @var{name} compiler not installed on this system.
11614 @end smallexample
11615 @end table
11617 GCC already has an extensive list of suffixes built into it.
11618 This directive adds an entry to the end of the list of suffixes, but
11619 since the list is searched from the end backwards, it is effectively
11620 possible to override earlier entries using this technique.
11622 @end table
11624 GCC has the following spec strings built into it.  Spec files can
11625 override these strings or create their own.  Note that individual
11626 targets can also add their own spec strings to this list.
11628 @smallexample
11629 asm          Options to pass to the assembler
11630 asm_final    Options to pass to the assembler post-processor
11631 cpp          Options to pass to the C preprocessor
11632 cc1          Options to pass to the C compiler
11633 cc1plus      Options to pass to the C++ compiler
11634 endfile      Object files to include at the end of the link
11635 link         Options to pass to the linker
11636 lib          Libraries to include on the command line to the linker
11637 libgcc       Decides which GCC support library to pass to the linker
11638 linker       Sets the name of the linker
11639 predefines   Defines to be passed to the C preprocessor
11640 signed_char  Defines to pass to CPP to say whether @code{char} is signed
11641              by default
11642 startfile    Object files to include at the start of the link
11643 @end smallexample
11645 Here is a small example of a spec file:
11647 @smallexample
11648 %rename lib                 old_lib
11650 *lib:
11651 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
11652 @end smallexample
11654 This example renames the spec called @samp{lib} to @samp{old_lib} and
11655 then overrides the previous definition of @samp{lib} with a new one.
11656 The new definition adds in some extra command-line options before
11657 including the text of the old definition.
11659 @dfn{Spec strings} are a list of command-line options to be passed to their
11660 corresponding program.  In addition, the spec strings can contain
11661 @samp{%}-prefixed sequences to substitute variable text or to
11662 conditionally insert text into the command line.  Using these constructs
11663 it is possible to generate quite complex command lines.
11665 Here is a table of all defined @samp{%}-sequences for spec
11666 strings.  Note that spaces are not generated automatically around the
11667 results of expanding these sequences.  Therefore you can concatenate them
11668 together or combine them with constant text in a single argument.
11670 @table @code
11671 @item %%
11672 Substitute one @samp{%} into the program name or argument.
11674 @item %i
11675 Substitute the name of the input file being processed.
11677 @item %b
11678 Substitute the basename of the input file being processed.
11679 This is the substring up to (and not including) the last period
11680 and not including the directory.
11682 @item %B
11683 This is the same as @samp{%b}, but include the file suffix (text after
11684 the last period).
11686 @item %d
11687 Marks the argument containing or following the @samp{%d} as a
11688 temporary file name, so that that file is deleted if GCC exits
11689 successfully.  Unlike @samp{%g}, this contributes no text to the
11690 argument.
11692 @item %g@var{suffix}
11693 Substitute a file name that has suffix @var{suffix} and is chosen
11694 once per compilation, and mark the argument in the same way as
11695 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
11696 name is now chosen in a way that is hard to predict even when previously
11697 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
11698 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
11699 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
11700 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
11701 was simply substituted with a file name chosen once per compilation,
11702 without regard to any appended suffix (which was therefore treated
11703 just like ordinary text), making such attacks more likely to succeed.
11705 @item %u@var{suffix}
11706 Like @samp{%g}, but generates a new temporary file name
11707 each time it appears instead of once per compilation.
11709 @item %U@var{suffix}
11710 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
11711 new one if there is no such last file name.  In the absence of any
11712 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
11713 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
11714 involves the generation of two distinct file names, one
11715 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
11716 simply substituted with a file name chosen for the previous @samp{%u},
11717 without regard to any appended suffix.
11719 @item %j@var{suffix}
11720 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
11721 writable, and if @option{-save-temps} is not used; 
11722 otherwise, substitute the name
11723 of a temporary file, just like @samp{%u}.  This temporary file is not
11724 meant for communication between processes, but rather as a junk
11725 disposal mechanism.
11727 @item %|@var{suffix}
11728 @itemx %m@var{suffix}
11729 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
11730 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
11731 all.  These are the two most common ways to instruct a program that it
11732 should read from standard input or write to standard output.  If you
11733 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
11734 construct: see for example @file{f/lang-specs.h}.
11736 @item %.@var{SUFFIX}
11737 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
11738 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
11739 terminated by the next space or %.
11741 @item %w
11742 Marks the argument containing or following the @samp{%w} as the
11743 designated output file of this compilation.  This puts the argument
11744 into the sequence of arguments that @samp{%o} substitutes.
11746 @item %o
11747 Substitutes the names of all the output files, with spaces
11748 automatically placed around them.  You should write spaces
11749 around the @samp{%o} as well or the results are undefined.
11750 @samp{%o} is for use in the specs for running the linker.
11751 Input files whose names have no recognized suffix are not compiled
11752 at all, but they are included among the output files, so they are
11753 linked.
11755 @item %O
11756 Substitutes the suffix for object files.  Note that this is
11757 handled specially when it immediately follows @samp{%g, %u, or %U},
11758 because of the need for those to form complete file names.  The
11759 handling is such that @samp{%O} is treated exactly as if it had already
11760 been substituted, except that @samp{%g, %u, and %U} do not currently
11761 support additional @var{suffix} characters following @samp{%O} as they do
11762 following, for example, @samp{.o}.
11764 @item %p
11765 Substitutes the standard macro predefinitions for the
11766 current target machine.  Use this when running @command{cpp}.
11768 @item %P
11769 Like @samp{%p}, but puts @samp{__} before and after the name of each
11770 predefined macro, except for macros that start with @samp{__} or with
11771 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
11774 @item %I
11775 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
11776 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
11777 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
11778 and @option{-imultilib} as necessary.
11780 @item %s
11781 Current argument is the name of a library or startup file of some sort.
11782 Search for that file in a standard list of directories and substitute
11783 the full name found.  The current working directory is included in the
11784 list of directories scanned.
11786 @item %T
11787 Current argument is the name of a linker script.  Search for that file
11788 in the current list of directories to scan for libraries. If the file
11789 is located insert a @option{--script} option into the command line
11790 followed by the full path name found.  If the file is not found then
11791 generate an error message.  Note: the current working directory is not
11792 searched.
11794 @item %e@var{str}
11795 Print @var{str} as an error message.  @var{str} is terminated by a newline.
11796 Use this when inconsistent options are detected.
11798 @item %(@var{name})
11799 Substitute the contents of spec string @var{name} at this point.
11801 @item %x@{@var{option}@}
11802 Accumulate an option for @samp{%X}.
11804 @item %X
11805 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
11806 spec string.
11808 @item %Y
11809 Output the accumulated assembler options specified by @option{-Wa}.
11811 @item %Z
11812 Output the accumulated preprocessor options specified by @option{-Wp}.
11814 @item %a
11815 Process the @code{asm} spec.  This is used to compute the
11816 switches to be passed to the assembler.
11818 @item %A
11819 Process the @code{asm_final} spec.  This is a spec string for
11820 passing switches to an assembler post-processor, if such a program is
11821 needed.
11823 @item %l
11824 Process the @code{link} spec.  This is the spec for computing the
11825 command line passed to the linker.  Typically it makes use of the
11826 @samp{%L %G %S %D and %E} sequences.
11828 @item %D
11829 Dump out a @option{-L} option for each directory that GCC believes might
11830 contain startup files.  If the target supports multilibs then the
11831 current multilib directory is prepended to each of these paths.
11833 @item %L
11834 Process the @code{lib} spec.  This is a spec string for deciding which
11835 libraries are included on the command line to the linker.
11837 @item %G
11838 Process the @code{libgcc} spec.  This is a spec string for deciding
11839 which GCC support library is included on the command line to the linker.
11841 @item %S
11842 Process the @code{startfile} spec.  This is a spec for deciding which
11843 object files are the first ones passed to the linker.  Typically
11844 this might be a file named @file{crt0.o}.
11846 @item %E
11847 Process the @code{endfile} spec.  This is a spec string that specifies
11848 the last object files that are passed to the linker.
11850 @item %C
11851 Process the @code{cpp} spec.  This is used to construct the arguments
11852 to be passed to the C preprocessor.
11854 @item %1
11855 Process the @code{cc1} spec.  This is used to construct the options to be
11856 passed to the actual C compiler (@command{cc1}).
11858 @item %2
11859 Process the @code{cc1plus} spec.  This is used to construct the options to be
11860 passed to the actual C++ compiler (@command{cc1plus}).
11862 @item %*
11863 Substitute the variable part of a matched option.  See below.
11864 Note that each comma in the substituted string is replaced by
11865 a single space.
11867 @item %<@code{S}
11868 Remove all occurrences of @code{-S} from the command line.  Note---this
11869 command is position dependent.  @samp{%} commands in the spec string
11870 before this one see @code{-S}, @samp{%} commands in the spec string
11871 after this one do not.
11873 @item %:@var{function}(@var{args})
11874 Call the named function @var{function}, passing it @var{args}.
11875 @var{args} is first processed as a nested spec string, then split
11876 into an argument vector in the usual fashion.  The function returns
11877 a string which is processed as if it had appeared literally as part
11878 of the current spec.
11880 The following built-in spec functions are provided:
11882 @table @code
11883 @item @code{getenv}
11884 The @code{getenv} spec function takes two arguments: an environment
11885 variable name and a string.  If the environment variable is not
11886 defined, a fatal error is issued.  Otherwise, the return value is the
11887 value of the environment variable concatenated with the string.  For
11888 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
11890 @smallexample
11891 %:getenv(TOPDIR /include)
11892 @end smallexample
11894 expands to @file{/path/to/top/include}.
11896 @item @code{if-exists}
11897 The @code{if-exists} spec function takes one argument, an absolute
11898 pathname to a file.  If the file exists, @code{if-exists} returns the
11899 pathname.  Here is a small example of its usage:
11901 @smallexample
11902 *startfile:
11903 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
11904 @end smallexample
11906 @item @code{if-exists-else}
11907 The @code{if-exists-else} spec function is similar to the @code{if-exists}
11908 spec function, except that it takes two arguments.  The first argument is
11909 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
11910 returns the pathname.  If it does not exist, it returns the second argument.
11911 This way, @code{if-exists-else} can be used to select one file or another,
11912 based on the existence of the first.  Here is a small example of its usage:
11914 @smallexample
11915 *startfile:
11916 crt0%O%s %:if-exists(crti%O%s) \
11917 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
11918 @end smallexample
11920 @item @code{replace-outfile}
11921 The @code{replace-outfile} spec function takes two arguments.  It looks for the
11922 first argument in the outfiles array and replaces it with the second argument.  Here
11923 is a small example of its usage:
11925 @smallexample
11926 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
11927 @end smallexample
11929 @item @code{remove-outfile}
11930 The @code{remove-outfile} spec function takes one argument.  It looks for the
11931 first argument in the outfiles array and removes it.  Here is a small example
11932 its usage:
11934 @smallexample
11935 %:remove-outfile(-lm)
11936 @end smallexample
11938 @item @code{pass-through-libs}
11939 The @code{pass-through-libs} spec function takes any number of arguments.  It
11940 finds any @option{-l} options and any non-options ending in @file{.a} (which it
11941 assumes are the names of linker input library archive files) and returns a
11942 result containing all the found arguments each prepended by
11943 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
11944 intended to be passed to the LTO linker plugin.
11946 @smallexample
11947 %:pass-through-libs(%G %L %G)
11948 @end smallexample
11950 @item @code{print-asm-header}
11951 The @code{print-asm-header} function takes no arguments and simply
11952 prints a banner like:
11954 @smallexample
11955 Assembler options
11956 =================
11958 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
11959 @end smallexample
11961 It is used to separate compiler options from assembler options
11962 in the @option{--target-help} output.
11963 @end table
11965 @item %@{@code{S}@}
11966 Substitutes the @code{-S} switch, if that switch is given to GCC@.
11967 If that switch is not specified, this substitutes nothing.  Note that
11968 the leading dash is omitted when specifying this option, and it is
11969 automatically inserted if the substitution is performed.  Thus the spec
11970 string @samp{%@{foo@}} matches the command-line option @option{-foo}
11971 and outputs the command-line option @option{-foo}.
11973 @item %W@{@code{S}@}
11974 Like %@{@code{S}@} but mark last argument supplied within as a file to be
11975 deleted on failure.
11977 @item %@{@code{S}*@}
11978 Substitutes all the switches specified to GCC whose names start
11979 with @code{-S}, but which also take an argument.  This is used for
11980 switches like @option{-o}, @option{-D}, @option{-I}, etc.
11981 GCC considers @option{-o foo} as being
11982 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
11983 text, including the space.  Thus two arguments are generated.
11985 @item %@{@code{S}*&@code{T}*@}
11986 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
11987 (the order of @code{S} and @code{T} in the spec is not significant).
11988 There can be any number of ampersand-separated variables; for each the
11989 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
11991 @item %@{@code{S}:@code{X}@}
11992 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
11994 @item %@{!@code{S}:@code{X}@}
11995 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
11997 @item %@{@code{S}*:@code{X}@}
11998 Substitutes @code{X} if one or more switches whose names start with
11999 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
12000 once, no matter how many such switches appeared.  However, if @code{%*}
12001 appears somewhere in @code{X}, then @code{X} is substituted once
12002 for each matching switch, with the @code{%*} replaced by the part of
12003 that switch matching the @code{*}.
12005 If @code{%*} appears as the last part of a spec sequence then a space
12006 is added after the end of the last substitution.  If there is more
12007 text in the sequence, however, then a space is not generated.  This
12008 allows the @code{%*} substitution to be used as part of a larger
12009 string.  For example, a spec string like this:
12011 @smallexample
12012 %@{mcu=*:--script=%*/memory.ld@}
12013 @end smallexample
12015 @noindent
12016 when matching an option like @option{-mcu=newchip} produces:
12018 @smallexample
12019 --script=newchip/memory.ld
12020 @end smallexample
12022 @item %@{.@code{S}:@code{X}@}
12023 Substitutes @code{X}, if processing a file with suffix @code{S}.
12025 @item %@{!.@code{S}:@code{X}@}
12026 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
12028 @item %@{,@code{S}:@code{X}@}
12029 Substitutes @code{X}, if processing a file for language @code{S}.
12031 @item %@{!,@code{S}:@code{X}@}
12032 Substitutes @code{X}, if not processing a file for language @code{S}.
12034 @item %@{@code{S}|@code{P}:@code{X}@}
12035 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
12036 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
12037 @code{*} sequences as well, although they have a stronger binding than
12038 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
12039 alternatives must be starred, and only the first matching alternative
12040 is substituted.
12042 For example, a spec string like this:
12044 @smallexample
12045 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
12046 @end smallexample
12048 @noindent
12049 outputs the following command-line options from the following input
12050 command-line options:
12052 @smallexample
12053 fred.c        -foo -baz
12054 jim.d         -bar -boggle
12055 -d fred.c     -foo -baz -boggle
12056 -d jim.d      -bar -baz -boggle
12057 @end smallexample
12059 @item %@{S:X; T:Y; :D@}
12061 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
12062 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
12063 be as many clauses as you need.  This may be combined with @code{.},
12064 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
12067 @end table
12069 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
12070 construct may contain other nested @samp{%} constructs or spaces, or
12071 even newlines.  They are processed as usual, as described above.
12072 Trailing white space in @code{X} is ignored.  White space may also
12073 appear anywhere on the left side of the colon in these constructs,
12074 except between @code{.} or @code{*} and the corresponding word.
12076 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
12077 handled specifically in these constructs.  If another value of
12078 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
12079 @option{-W} switch is found later in the command line, the earlier
12080 switch value is ignored, except with @{@code{S}*@} where @code{S} is
12081 just one letter, which passes all matching options.
12083 The character @samp{|} at the beginning of the predicate text is used to
12084 indicate that a command should be piped to the following command, but
12085 only if @option{-pipe} is specified.
12087 It is built into GCC which switches take arguments and which do not.
12088 (You might think it would be useful to generalize this to allow each
12089 compiler's spec to say which switches take arguments.  But this cannot
12090 be done in a consistent fashion.  GCC cannot even decide which input
12091 files have been specified without knowing which switches take arguments,
12092 and it must know which input files to compile in order to tell which
12093 compilers to run).
12095 GCC also knows implicitly that arguments starting in @option{-l} are to be
12096 treated as compiler output files, and passed to the linker in their
12097 proper position among the other output files.
12099 @c man begin OPTIONS
12101 @node Target Options
12102 @section Specifying Target Machine and Compiler Version
12103 @cindex target options
12104 @cindex cross compiling
12105 @cindex specifying machine version
12106 @cindex specifying compiler version and target machine
12107 @cindex compiler version, specifying
12108 @cindex target machine, specifying
12110 The usual way to run GCC is to run the executable called @command{gcc}, or
12111 @command{@var{machine}-gcc} when cross-compiling, or
12112 @command{@var{machine}-gcc-@var{version}} to run a version other than the
12113 one that was installed last.
12115 @node Submodel Options
12116 @section Hardware Models and Configurations
12117 @cindex submodel options
12118 @cindex specifying hardware config
12119 @cindex hardware models and configurations, specifying
12120 @cindex machine dependent options
12122 Each target machine types can have its own
12123 special options, starting with @samp{-m}, to choose among various
12124 hardware models or configurations---for example, 68010 vs 68020,
12125 floating coprocessor or none.  A single installed version of the
12126 compiler can compile for any model or configuration, according to the
12127 options specified.
12129 Some configurations of the compiler also support additional special
12130 options, usually for compatibility with other compilers on the same
12131 platform.
12133 @c This list is ordered alphanumerically by subsection name.
12134 @c It should be the same order and spelling as these options are listed
12135 @c in Machine Dependent Options
12137 @menu
12138 * AArch64 Options::
12139 * Adapteva Epiphany Options::
12140 * ARC Options::
12141 * ARM Options::
12142 * AVR Options::
12143 * Blackfin Options::
12144 * C6X Options::
12145 * CRIS Options::
12146 * CR16 Options::
12147 * Darwin Options::
12148 * DEC Alpha Options::
12149 * FR30 Options::
12150 * FRV Options::
12151 * GNU/Linux Options::
12152 * H8/300 Options::
12153 * HPPA Options::
12154 * IA-64 Options::
12155 * LM32 Options::
12156 * M32C Options::
12157 * M32R/D Options::
12158 * M680x0 Options::
12159 * MCore Options::
12160 * MeP Options::
12161 * MicroBlaze Options::
12162 * MIPS Options::
12163 * MMIX Options::
12164 * MN10300 Options::
12165 * Moxie Options::
12166 * MSP430 Options::
12167 * NDS32 Options::
12168 * Nios II Options::
12169 * Nvidia PTX Options::
12170 * PDP-11 Options::
12171 * picoChip Options::
12172 * PowerPC Options::
12173 * RL78 Options::
12174 * RS/6000 and PowerPC Options::
12175 * RX Options::
12176 * S/390 and zSeries Options::
12177 * Score Options::
12178 * SH Options::
12179 * Solaris 2 Options::
12180 * SPARC Options::
12181 * SPU Options::
12182 * System V Options::
12183 * TILE-Gx Options::
12184 * TILEPro Options::
12185 * V850 Options::
12186 * VAX Options::
12187 * Visium Options::
12188 * VMS Options::
12189 * VxWorks Options::
12190 * x86 Options::
12191 * x86 Windows Options::
12192 * Xstormy16 Options::
12193 * Xtensa Options::
12194 * zSeries Options::
12195 @end menu
12197 @node AArch64 Options
12198 @subsection AArch64 Options
12199 @cindex AArch64 Options
12201 These options are defined for AArch64 implementations:
12203 @table @gcctabopt
12205 @item -mabi=@var{name}
12206 @opindex mabi
12207 Generate code for the specified data model.  Permissible values
12208 are @samp{ilp32} for SysV-like data model where int, long int and pointer
12209 are 32-bit, and @samp{lp64} for SysV-like data model where int is 32-bit,
12210 but long int and pointer are 64-bit.
12212 The default depends on the specific target configuration.  Note that
12213 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
12214 entire program with the same ABI, and link with a compatible set of libraries.
12216 @item -mbig-endian
12217 @opindex mbig-endian
12218 Generate big-endian code.  This is the default when GCC is configured for an
12219 @samp{aarch64_be-*-*} target.
12221 @item -mgeneral-regs-only
12222 @opindex mgeneral-regs-only
12223 Generate code which uses only the general registers.
12225 @item -mlittle-endian
12226 @opindex mlittle-endian
12227 Generate little-endian code.  This is the default when GCC is configured for an
12228 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
12230 @item -mcmodel=tiny
12231 @opindex mcmodel=tiny
12232 Generate code for the tiny code model.  The program and its statically defined
12233 symbols must be within 1GB of each other.  Pointers are 64 bits.  Programs can
12234 be statically or dynamically linked.  This model is not fully implemented and
12235 mostly treated as @samp{small}.
12237 @item -mcmodel=small
12238 @opindex mcmodel=small
12239 Generate code for the small code model.  The program and its statically defined
12240 symbols must be within 4GB of each other.  Pointers are 64 bits.  Programs can
12241 be statically or dynamically linked.  This is the default code model.
12243 @item -mcmodel=large
12244 @opindex mcmodel=large
12245 Generate code for the large code model.  This makes no assumptions about
12246 addresses and sizes of sections.  Pointers are 64 bits.  Programs can be
12247 statically linked only.
12249 @item -mstrict-align
12250 @opindex mstrict-align
12251 Do not assume that unaligned memory references are handled by the system.
12253 @item -momit-leaf-frame-pointer
12254 @itemx -mno-omit-leaf-frame-pointer
12255 @opindex momit-leaf-frame-pointer
12256 @opindex mno-omit-leaf-frame-pointer
12257 Omit or keep the frame pointer in leaf functions.  The former behaviour is the
12258 default.
12260 @item -mtls-dialect=desc
12261 @opindex mtls-dialect=desc
12262 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
12263 of TLS variables.  This is the default.
12265 @item -mtls-dialect=traditional
12266 @opindex mtls-dialect=traditional
12267 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
12268 of TLS variables.
12270 @item -mfix-cortex-a53-835769
12271 @itemx -mno-fix-cortex-a53-835769
12272 @opindex mfix-cortex-a53-835769
12273 @opindex mno-fix-cortex-a53-835769
12274 Enable or disable the workaround for the ARM Cortex-A53 erratum number 835769.
12275 This involves inserting a NOP instruction between memory instructions and
12276 64-bit integer multiply-accumulate instructions.
12278 @item -march=@var{name}
12279 @opindex march
12280 Specify the name of the target architecture, optionally suffixed by one or
12281 more feature modifiers.  This option has the form
12282 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
12283 only permissible value for @var{arch} is @samp{armv8-a}.  The permissible
12284 values for @var{feature} are documented in the sub-section below.
12286 Where conflicting feature modifiers are specified, the right-most feature is
12287 used.
12289 GCC uses this name to determine what kind of instructions it can emit when
12290 generating assembly code.
12292 Where @option{-march} is specified without either of @option{-mtune}
12293 or @option{-mcpu} also being specified, the code is tuned to perform
12294 well across a range of target processors implementing the target
12295 architecture.
12297 @item -mtune=@var{name}
12298 @opindex mtune
12299 Specify the name of the target processor for which GCC should tune the
12300 performance of the code.  Permissible values for this option are:
12301 @samp{generic}, @samp{cortex-a53}, @samp{cortex-a57},
12302 @samp{cortex-a72}, @samp{thunderx}, @samp{xgene1}.
12304 Additionally, this option can specify that GCC should tune the performance
12305 of the code for a big.LITTLE system.  Permissible values for this
12306 option are: @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53}.
12308 Where none of @option{-mtune=}, @option{-mcpu=} or @option{-march=}
12309 are specified, the code is tuned to perform well across a range
12310 of target processors.
12312 This option cannot be suffixed by feature modifiers.
12314 @item -mcpu=@var{name}
12315 @opindex mcpu
12316 Specify the name of the target processor, optionally suffixed by one or more
12317 feature modifiers.  This option has the form
12318 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
12319 permissible values for @var{cpu} are the same as those available for
12320 @option{-mtune}.
12322 The permissible values for @var{feature} are documented in the sub-section
12323 below.
12325 Where conflicting feature modifiers are specified, the right-most feature is
12326 used.
12328 GCC uses this name to determine what kind of instructions it can emit when
12329 generating assembly code (as if by @option{-march}) and to determine
12330 the target processor for which to tune for performance (as if
12331 by @option{-mtune}).  Where this option is used in conjunction
12332 with @option{-march} or @option{-mtune}, those options take precedence
12333 over the appropriate part of this option.
12334 @end table
12336 @subsubsection @option{-march} and @option{-mcpu} Feature Modifiers
12337 @cindex @option{-march} feature modifiers
12338 @cindex @option{-mcpu} feature modifiers
12339 Feature modifiers used with @option{-march} and @option{-mcpu} can be one
12340 the following:
12342 @table @samp
12343 @item crc
12344 Enable CRC extension.
12345 @item crypto
12346 Enable Crypto extension.  This implies Advanced SIMD is enabled.
12347 @item fp
12348 Enable floating-point instructions.
12349 @item simd
12350 Enable Advanced SIMD instructions.  This implies floating-point instructions
12351 are enabled.  This is the default for all current possible values for options
12352 @option{-march} and @option{-mcpu=}.
12353 @end table
12355 @node Adapteva Epiphany Options
12356 @subsection Adapteva Epiphany Options
12358 These @samp{-m} options are defined for Adapteva Epiphany:
12360 @table @gcctabopt
12361 @item -mhalf-reg-file
12362 @opindex mhalf-reg-file
12363 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
12364 That allows code to run on hardware variants that lack these registers.
12366 @item -mprefer-short-insn-regs
12367 @opindex mprefer-short-insn-regs
12368 Preferrentially allocate registers that allow short instruction generation.
12369 This can result in increased instruction count, so this may either reduce or
12370 increase overall code size.
12372 @item -mbranch-cost=@var{num}
12373 @opindex mbranch-cost
12374 Set the cost of branches to roughly @var{num} ``simple'' instructions.
12375 This cost is only a heuristic and is not guaranteed to produce
12376 consistent results across releases.
12378 @item -mcmove
12379 @opindex mcmove
12380 Enable the generation of conditional moves.
12382 @item -mnops=@var{num}
12383 @opindex mnops
12384 Emit @var{num} NOPs before every other generated instruction.
12386 @item -mno-soft-cmpsf
12387 @opindex mno-soft-cmpsf
12388 For single-precision floating-point comparisons, emit an @code{fsub} instruction
12389 and test the flags.  This is faster than a software comparison, but can
12390 get incorrect results in the presence of NaNs, or when two different small
12391 numbers are compared such that their difference is calculated as zero.
12392 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
12393 software comparisons.
12395 @item -mstack-offset=@var{num}
12396 @opindex mstack-offset
12397 Set the offset between the top of the stack and the stack pointer.
12398 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
12399 can be used by leaf functions without stack allocation.
12400 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
12401 Note also that this option changes the ABI; compiling a program with a
12402 different stack offset than the libraries have been compiled with
12403 generally does not work.
12404 This option can be useful if you want to evaluate if a different stack
12405 offset would give you better code, but to actually use a different stack
12406 offset to build working programs, it is recommended to configure the
12407 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
12409 @item -mno-round-nearest
12410 @opindex mno-round-nearest
12411 Make the scheduler assume that the rounding mode has been set to
12412 truncating.  The default is @option{-mround-nearest}.
12414 @item -mlong-calls
12415 @opindex mlong-calls
12416 If not otherwise specified by an attribute, assume all calls might be beyond
12417 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
12418 function address into a register before performing a (otherwise direct) call.
12419 This is the default.
12421 @item -mshort-calls
12422 @opindex short-calls
12423 If not otherwise specified by an attribute, assume all direct calls are
12424 in the range of the @code{b} / @code{bl} instructions, so use these instructions
12425 for direct calls.  The default is @option{-mlong-calls}.
12427 @item -msmall16
12428 @opindex msmall16
12429 Assume addresses can be loaded as 16-bit unsigned values.  This does not
12430 apply to function addresses for which @option{-mlong-calls} semantics
12431 are in effect.
12433 @item -mfp-mode=@var{mode}
12434 @opindex mfp-mode
12435 Set the prevailing mode of the floating-point unit.
12436 This determines the floating-point mode that is provided and expected
12437 at function call and return time.  Making this mode match the mode you
12438 predominantly need at function start can make your programs smaller and
12439 faster by avoiding unnecessary mode switches.
12441 @var{mode} can be set to one the following values:
12443 @table @samp
12444 @item caller
12445 Any mode at function entry is valid, and retained or restored when
12446 the function returns, and when it calls other functions.
12447 This mode is useful for compiling libraries or other compilation units
12448 you might want to incorporate into different programs with different
12449 prevailing FPU modes, and the convenience of being able to use a single
12450 object file outweighs the size and speed overhead for any extra
12451 mode switching that might be needed, compared with what would be needed
12452 with a more specific choice of prevailing FPU mode.
12454 @item truncate
12455 This is the mode used for floating-point calculations with
12456 truncating (i.e.@: round towards zero) rounding mode.  That includes
12457 conversion from floating point to integer.
12459 @item round-nearest
12460 This is the mode used for floating-point calculations with
12461 round-to-nearest-or-even rounding mode.
12463 @item int
12464 This is the mode used to perform integer calculations in the FPU, e.g.@:
12465 integer multiply, or integer multiply-and-accumulate.
12466 @end table
12468 The default is @option{-mfp-mode=caller}
12470 @item -mnosplit-lohi
12471 @itemx -mno-postinc
12472 @itemx -mno-postmodify
12473 @opindex mnosplit-lohi
12474 @opindex mno-postinc
12475 @opindex mno-postmodify
12476 Code generation tweaks that disable, respectively, splitting of 32-bit
12477 loads, generation of post-increment addresses, and generation of
12478 post-modify addresses.  The defaults are @option{msplit-lohi},
12479 @option{-mpost-inc}, and @option{-mpost-modify}.
12481 @item -mnovect-double
12482 @opindex mno-vect-double
12483 Change the preferred SIMD mode to SImode.  The default is
12484 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
12486 @item -max-vect-align=@var{num}
12487 @opindex max-vect-align
12488 The maximum alignment for SIMD vector mode types.
12489 @var{num} may be 4 or 8.  The default is 8.
12490 Note that this is an ABI change, even though many library function
12491 interfaces are unaffected if they don't use SIMD vector modes
12492 in places that affect size and/or alignment of relevant types.
12494 @item -msplit-vecmove-early
12495 @opindex msplit-vecmove-early
12496 Split vector moves into single word moves before reload.  In theory this
12497 can give better register allocation, but so far the reverse seems to be
12498 generally the case.
12500 @item -m1reg-@var{reg}
12501 @opindex m1reg-
12502 Specify a register to hold the constant @minus{}1, which makes loading small negative
12503 constants and certain bitmasks faster.
12504 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
12505 which specify use of that register as a fixed register,
12506 and @samp{none}, which means that no register is used for this
12507 purpose.  The default is @option{-m1reg-none}.
12509 @end table
12511 @node ARC Options
12512 @subsection ARC Options
12513 @cindex ARC options
12515 The following options control the architecture variant for which code
12516 is being compiled:
12518 @c architecture variants
12519 @table @gcctabopt
12521 @item -mbarrel-shifter
12522 @opindex mbarrel-shifter
12523 Generate instructions supported by barrel shifter.  This is the default
12524 unless @option{-mcpu=ARC601} is in effect.
12526 @item -mcpu=@var{cpu}
12527 @opindex mcpu
12528 Set architecture type, register usage, and instruction scheduling
12529 parameters for @var{cpu}.  There are also shortcut alias options
12530 available for backward compatibility and convenience.  Supported
12531 values for @var{cpu} are
12533 @table @samp
12534 @opindex mA6
12535 @opindex mARC600
12536 @item ARC600
12537 Compile for ARC600.  Aliases: @option{-mA6}, @option{-mARC600}.
12539 @item ARC601
12540 @opindex mARC601
12541 Compile for ARC601.  Alias: @option{-mARC601}.
12543 @item ARC700
12544 @opindex mA7
12545 @opindex mARC700
12546 Compile for ARC700.  Aliases: @option{-mA7}, @option{-mARC700}.
12547 This is the default when configured with @option{--with-cpu=arc700}@.
12548 @end table
12550 @item -mdpfp
12551 @opindex mdpfp
12552 @itemx -mdpfp-compact
12553 @opindex mdpfp-compact
12554 FPX: Generate Double Precision FPX instructions, tuned for the compact
12555 implementation.
12557 @item -mdpfp-fast
12558 @opindex mdpfp-fast
12559 FPX: Generate Double Precision FPX instructions, tuned for the fast
12560 implementation.
12562 @item -mno-dpfp-lrsr
12563 @opindex mno-dpfp-lrsr
12564 Disable LR and SR instructions from using FPX extension aux registers.
12566 @item -mea
12567 @opindex mea
12568 Generate Extended arithmetic instructions.  Currently only
12569 @code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are
12570 supported.  This is always enabled for @option{-mcpu=ARC700}.
12572 @item -mno-mpy
12573 @opindex mno-mpy
12574 Do not generate mpy instructions for ARC700.
12576 @item -mmul32x16
12577 @opindex mmul32x16
12578 Generate 32x16 bit multiply and mac instructions.
12580 @item -mmul64
12581 @opindex mmul64
12582 Generate mul64 and mulu64 instructions.  Only valid for @option{-mcpu=ARC600}.
12584 @item -mnorm
12585 @opindex mnorm
12586 Generate norm instruction.  This is the default if @option{-mcpu=ARC700}
12587 is in effect.
12589 @item -mspfp
12590 @opindex mspfp
12591 @itemx -mspfp-compact
12592 @opindex mspfp-compact
12593 FPX: Generate Single Precision FPX instructions, tuned for the compact
12594 implementation.
12596 @item -mspfp-fast
12597 @opindex mspfp-fast
12598 FPX: Generate Single Precision FPX instructions, tuned for the fast
12599 implementation.
12601 @item -msimd
12602 @opindex msimd
12603 Enable generation of ARC SIMD instructions via target-specific
12604 builtins.  Only valid for @option{-mcpu=ARC700}.
12606 @item -msoft-float
12607 @opindex msoft-float
12608 This option ignored; it is provided for compatibility purposes only.
12609 Software floating point code is emitted by default, and this default
12610 can overridden by FPX options; @samp{mspfp}, @samp{mspfp-compact}, or
12611 @samp{mspfp-fast} for single precision, and @samp{mdpfp},
12612 @samp{mdpfp-compact}, or @samp{mdpfp-fast} for double precision.
12614 @item -mswap
12615 @opindex mswap
12616 Generate swap instructions.
12618 @end table
12620 The following options are passed through to the assembler, and also
12621 define preprocessor macro symbols.
12623 @c Flags used by the assembler, but for which we define preprocessor
12624 @c macro symbols as well.
12625 @table @gcctabopt
12626 @item -mdsp-packa
12627 @opindex mdsp-packa
12628 Passed down to the assembler to enable the DSP Pack A extensions.
12629 Also sets the preprocessor symbol @code{__Xdsp_packa}.
12631 @item -mdvbf
12632 @opindex mdvbf
12633 Passed down to the assembler to enable the dual viterbi butterfly
12634 extension.  Also sets the preprocessor symbol @code{__Xdvbf}.
12636 @c ARC700 4.10 extension instruction
12637 @item -mlock
12638 @opindex mlock
12639 Passed down to the assembler to enable the Locked Load/Store
12640 Conditional extension.  Also sets the preprocessor symbol
12641 @code{__Xlock}.
12643 @item -mmac-d16
12644 @opindex mmac-d16
12645 Passed down to the assembler.  Also sets the preprocessor symbol
12646 @code{__Xxmac_d16}.
12648 @item -mmac-24
12649 @opindex mmac-24
12650 Passed down to the assembler.  Also sets the preprocessor symbol
12651 @code{__Xxmac_24}.
12653 @c ARC700 4.10 extension instruction
12654 @item -mrtsc
12655 @opindex mrtsc
12656 Passed down to the assembler to enable the 64-bit Time-Stamp Counter
12657 extension instruction.  Also sets the preprocessor symbol
12658 @code{__Xrtsc}.
12660 @c ARC700 4.10 extension instruction
12661 @item -mswape
12662 @opindex mswape
12663 Passed down to the assembler to enable the swap byte ordering
12664 extension instruction.  Also sets the preprocessor symbol
12665 @code{__Xswape}.
12667 @item -mtelephony
12668 @opindex mtelephony
12669 Passed down to the assembler to enable dual and single operand
12670 instructions for telephony.  Also sets the preprocessor symbol
12671 @code{__Xtelephony}.
12673 @item -mxy
12674 @opindex mxy
12675 Passed down to the assembler to enable the XY Memory extension.  Also
12676 sets the preprocessor symbol @code{__Xxy}.
12678 @end table
12680 The following options control how the assembly code is annotated:
12682 @c Assembly annotation options
12683 @table @gcctabopt
12684 @item -misize
12685 @opindex misize
12686 Annotate assembler instructions with estimated addresses.
12688 @item -mannotate-align
12689 @opindex mannotate-align
12690 Explain what alignment considerations lead to the decision to make an
12691 instruction short or long.
12693 @end table
12695 The following options are passed through to the linker:
12697 @c options passed through to the linker
12698 @table @gcctabopt
12699 @item -marclinux
12700 @opindex marclinux
12701 Passed through to the linker, to specify use of the @code{arclinux} emulation.
12702 This option is enabled by default in tool chains built for
12703 @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets
12704 when profiling is not requested.
12706 @item -marclinux_prof
12707 @opindex marclinux_prof
12708 Passed through to the linker, to specify use of the
12709 @code{arclinux_prof} emulation.  This option is enabled by default in
12710 tool chains built for @w{@code{arc-linux-uclibc}} and
12711 @w{@code{arceb-linux-uclibc}} targets when profiling is requested.
12713 @end table
12715 The following options control the semantics of generated code:
12717 @c semantically relevant code generation options
12718 @table @gcctabopt
12719 @item -mepilogue-cfi
12720 @opindex mepilogue-cfi
12721 Enable generation of call frame information for epilogues.
12723 @item -mno-epilogue-cfi
12724 @opindex mno-epilogue-cfi
12725 Disable generation of call frame information for epilogues.
12727 @item -mlong-calls
12728 @opindex mlong-calls
12729 Generate call insns as register indirect calls, thus providing access
12730 to the full 32-bit address range.
12732 @item -mmedium-calls
12733 @opindex mmedium-calls
12734 Don't use less than 25 bit addressing range for calls, which is the
12735 offset available for an unconditional branch-and-link
12736 instruction.  Conditional execution of function calls is suppressed, to
12737 allow use of the 25-bit range, rather than the 21-bit range with
12738 conditional branch-and-link.  This is the default for tool chains built
12739 for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets.
12741 @item -mno-sdata
12742 @opindex mno-sdata
12743 Do not generate sdata references.  This is the default for tool chains
12744 built for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}}
12745 targets.
12747 @item -mucb-mcount
12748 @opindex mucb-mcount
12749 Instrument with mcount calls as used in UCB code.  I.e. do the
12750 counting in the callee, not the caller.  By default ARC instrumentation
12751 counts in the caller.
12753 @item -mvolatile-cache
12754 @opindex mvolatile-cache
12755 Use ordinarily cached memory accesses for volatile references.  This is the
12756 default.
12758 @item -mno-volatile-cache
12759 @opindex mno-volatile-cache
12760 Enable cache bypass for volatile references.
12762 @end table
12764 The following options fine tune code generation:
12765 @c code generation tuning options
12766 @table @gcctabopt
12767 @item -malign-call
12768 @opindex malign-call
12769 Do alignment optimizations for call instructions.
12771 @item -mauto-modify-reg
12772 @opindex mauto-modify-reg
12773 Enable the use of pre/post modify with register displacement.
12775 @item -mbbit-peephole
12776 @opindex mbbit-peephole
12777 Enable bbit peephole2.
12779 @item -mno-brcc
12780 @opindex mno-brcc
12781 This option disables a target-specific pass in @file{arc_reorg} to
12782 generate @code{BRcc} instructions.  It has no effect on @code{BRcc}
12783 generation driven by the combiner pass.
12785 @item -mcase-vector-pcrel
12786 @opindex mcase-vector-pcrel
12787 Use pc-relative switch case tables - this enables case table shortening.
12788 This is the default for @option{-Os}.
12790 @item -mcompact-casesi
12791 @opindex mcompact-casesi
12792 Enable compact casesi pattern.
12793 This is the default for @option{-Os}.
12795 @item -mno-cond-exec
12796 @opindex mno-cond-exec
12797 Disable ARCompact specific pass to generate conditional execution instructions.
12798 Due to delay slot scheduling and interactions between operand numbers,
12799 literal sizes, instruction lengths, and the support for conditional execution,
12800 the target-independent pass to generate conditional execution is often lacking,
12801 so the ARC port has kept a special pass around that tries to find more
12802 conditional execution generating opportunities after register allocation,
12803 branch shortening, and delay slot scheduling have been done.  This pass
12804 generally, but not always, improves performance and code size, at the cost of
12805 extra compilation time, which is why there is an option to switch it off.
12806 If you have a problem with call instructions exceeding their allowable
12807 offset range because they are conditionalized, you should consider using
12808 @option{-mmedium-calls} instead.
12810 @item -mearly-cbranchsi
12811 @opindex mearly-cbranchsi
12812 Enable pre-reload use of the cbranchsi pattern.
12814 @item -mexpand-adddi
12815 @opindex mexpand-adddi
12816 Expand @code{adddi3} and @code{subdi3} at rtl generation time into
12817 @code{add.f}, @code{adc} etc.
12819 @item -mindexed-loads
12820 @opindex mindexed-loads
12821 Enable the use of indexed loads.  This can be problematic because some
12822 optimizers then assume that indexed stores exist, which is not
12823 the case.
12825 @item -mlra
12826 @opindex mlra
12827 Enable Local Register Allocation.  This is still experimental for ARC,
12828 so by default the compiler uses standard reload
12829 (i.e. @option{-mno-lra}).
12831 @item -mlra-priority-none
12832 @opindex mlra-priority-none
12833 Don't indicate any priority for target registers.
12835 @item -mlra-priority-compact
12836 @opindex mlra-priority-compact
12837 Indicate target register priority for r0..r3 / r12..r15.
12839 @item -mlra-priority-noncompact
12840 @opindex mlra-priority-noncompact
12841 Reduce target regsiter priority for r0..r3 / r12..r15.
12843 @item -mno-millicode
12844 @opindex mno-millicode
12845 When optimizing for size (using @option{-Os}), prologues and epilogues
12846 that have to save or restore a large number of registers are often
12847 shortened by using call to a special function in libgcc; this is
12848 referred to as a @emph{millicode} call.  As these calls can pose
12849 performance issues, and/or cause linking issues when linking in a
12850 nonstandard way, this option is provided to turn off millicode call
12851 generation.
12853 @item -mmixed-code
12854 @opindex mmixed-code
12855 Tweak register allocation to help 16-bit instruction generation.
12856 This generally has the effect of decreasing the average instruction size
12857 while increasing the instruction count.
12859 @item -mq-class
12860 @opindex mq-class
12861 Enable 'q' instruction alternatives.
12862 This is the default for @option{-Os}.
12864 @item -mRcq
12865 @opindex mRcq
12866 Enable Rcq constraint handling - most short code generation depends on this.
12867 This is the default.
12869 @item -mRcw
12870 @opindex mRcw
12871 Enable Rcw constraint handling - ccfsm condexec mostly depends on this.
12872 This is the default.
12874 @item -msize-level=@var{level}
12875 @opindex msize-level
12876 Fine-tune size optimization with regards to instruction lengths and alignment.
12877 The recognized values for @var{level} are:
12878 @table @samp
12879 @item 0
12880 No size optimization.  This level is deprecated and treated like @samp{1}.
12882 @item 1
12883 Short instructions are used opportunistically.
12885 @item 2
12886 In addition, alignment of loops and of code after barriers are dropped.
12888 @item 3
12889 In addition, optional data alignment is dropped, and the option @option{Os} is enabled.
12891 @end table
12893 This defaults to @samp{3} when @option{-Os} is in effect.  Otherwise,
12894 the behavior when this is not set is equivalent to level @samp{1}.
12896 @item -mtune=@var{cpu}
12897 @opindex mtune
12898 Set instruction scheduling parameters for @var{cpu}, overriding any implied
12899 by @option{-mcpu=}.
12901 Supported values for @var{cpu} are
12903 @table @samp
12904 @item ARC600
12905 Tune for ARC600 cpu.
12907 @item ARC601
12908 Tune for ARC601 cpu.
12910 @item ARC700
12911 Tune for ARC700 cpu with standard multiplier block.
12913 @item ARC700-xmac
12914 Tune for ARC700 cpu with XMAC block.
12916 @item ARC725D
12917 Tune for ARC725D cpu.
12919 @item ARC750D
12920 Tune for ARC750D cpu.
12922 @end table
12924 @item -mmultcost=@var{num}
12925 @opindex mmultcost
12926 Cost to assume for a multiply instruction, with @samp{4} being equal to a
12927 normal instruction.
12929 @item -munalign-prob-threshold=@var{probability}
12930 @opindex munalign-prob-threshold
12931 Set probability threshold for unaligning branches.
12932 When tuning for @samp{ARC700} and optimizing for speed, branches without
12933 filled delay slot are preferably emitted unaligned and long, unless
12934 profiling indicates that the probability for the branch to be taken
12935 is below @var{probability}.  @xref{Cross-profiling}.
12936 The default is (REG_BR_PROB_BASE/2), i.e.@: 5000.
12938 @end table
12940 The following options are maintained for backward compatibility, but
12941 are now deprecated and will be removed in a future release:
12943 @c Deprecated options
12944 @table @gcctabopt
12946 @item -margonaut
12947 @opindex margonaut
12948 Obsolete FPX.
12950 @item -mbig-endian
12951 @opindex mbig-endian
12952 @itemx -EB
12953 @opindex EB
12954 Compile code for big endian targets.  Use of these options is now
12955 deprecated.  Users wanting big-endian code, should use the
12956 @w{@code{arceb-elf32}} and @w{@code{arceb-linux-uclibc}} targets when
12957 building the tool chain, for which big-endian is the default.
12959 @item -mlittle-endian
12960 @opindex mlittle-endian
12961 @itemx -EL
12962 @opindex EL
12963 Compile code for little endian targets.  Use of these options is now
12964 deprecated.  Users wanting little-endian code should use the
12965 @w{@code{arc-elf32}} and @w{@code{arc-linux-uclibc}} targets when
12966 building the tool chain, for which little-endian is the default.
12968 @item -mbarrel_shifter
12969 @opindex mbarrel_shifter
12970 Replaced by @option{-mbarrel-shifter}.
12972 @item -mdpfp_compact
12973 @opindex mdpfp_compact
12974 Replaced by @option{-mdpfp-compact}.
12976 @item -mdpfp_fast
12977 @opindex mdpfp_fast
12978 Replaced by @option{-mdpfp-fast}.
12980 @item -mdsp_packa
12981 @opindex mdsp_packa
12982 Replaced by @option{-mdsp-packa}.
12984 @item -mEA
12985 @opindex mEA
12986 Replaced by @option{-mea}.
12988 @item -mmac_24
12989 @opindex mmac_24
12990 Replaced by @option{-mmac-24}.
12992 @item -mmac_d16
12993 @opindex mmac_d16
12994 Replaced by @option{-mmac-d16}.
12996 @item -mspfp_compact
12997 @opindex mspfp_compact
12998 Replaced by @option{-mspfp-compact}.
13000 @item -mspfp_fast
13001 @opindex mspfp_fast
13002 Replaced by @option{-mspfp-fast}.
13004 @item -mtune=@var{cpu}
13005 @opindex mtune
13006 Values @samp{arc600}, @samp{arc601}, @samp{arc700} and
13007 @samp{arc700-xmac} for @var{cpu} are replaced by @samp{ARC600},
13008 @samp{ARC601}, @samp{ARC700} and @samp{ARC700-xmac} respectively
13010 @item -multcost=@var{num}
13011 @opindex multcost
13012 Replaced by @option{-mmultcost}.
13014 @end table
13016 @node ARM Options
13017 @subsection ARM Options
13018 @cindex ARM options
13020 These @samp{-m} options are defined for the ARM port:
13022 @table @gcctabopt
13023 @item -mabi=@var{name}
13024 @opindex mabi
13025 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
13026 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
13028 @item -mapcs-frame
13029 @opindex mapcs-frame
13030 Generate a stack frame that is compliant with the ARM Procedure Call
13031 Standard for all functions, even if this is not strictly necessary for
13032 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
13033 with this option causes the stack frames not to be generated for
13034 leaf functions.  The default is @option{-mno-apcs-frame}.
13035 This option is deprecated.
13037 @item -mapcs
13038 @opindex mapcs
13039 This is a synonym for @option{-mapcs-frame} and is deprecated.
13041 @ignore
13042 @c not currently implemented
13043 @item -mapcs-stack-check
13044 @opindex mapcs-stack-check
13045 Generate code to check the amount of stack space available upon entry to
13046 every function (that actually uses some stack space).  If there is
13047 insufficient space available then either the function
13048 @code{__rt_stkovf_split_small} or @code{__rt_stkovf_split_big} is
13049 called, depending upon the amount of stack space required.  The runtime
13050 system is required to provide these functions.  The default is
13051 @option{-mno-apcs-stack-check}, since this produces smaller code.
13053 @c not currently implemented
13054 @item -mapcs-float
13055 @opindex mapcs-float
13056 Pass floating-point arguments using the floating-point registers.  This is
13057 one of the variants of the APCS@.  This option is recommended if the
13058 target hardware has a floating-point unit or if a lot of floating-point
13059 arithmetic is going to be performed by the code.  The default is
13060 @option{-mno-apcs-float}, since the size of integer-only code is 
13061 slightly increased if @option{-mapcs-float} is used.
13063 @c not currently implemented
13064 @item -mapcs-reentrant
13065 @opindex mapcs-reentrant
13066 Generate reentrant, position-independent code.  The default is
13067 @option{-mno-apcs-reentrant}.
13068 @end ignore
13070 @item -mthumb-interwork
13071 @opindex mthumb-interwork
13072 Generate code that supports calling between the ARM and Thumb
13073 instruction sets.  Without this option, on pre-v5 architectures, the
13074 two instruction sets cannot be reliably used inside one program.  The
13075 default is @option{-mno-thumb-interwork}, since slightly larger code
13076 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
13077 configurations this option is meaningless.
13079 @item -mno-sched-prolog
13080 @opindex mno-sched-prolog
13081 Prevent the reordering of instructions in the function prologue, or the
13082 merging of those instruction with the instructions in the function's
13083 body.  This means that all functions start with a recognizable set
13084 of instructions (or in fact one of a choice from a small set of
13085 different function prologues), and this information can be used to
13086 locate the start of functions inside an executable piece of code.  The
13087 default is @option{-msched-prolog}.
13089 @item -mfloat-abi=@var{name}
13090 @opindex mfloat-abi
13091 Specifies which floating-point ABI to use.  Permissible values
13092 are: @samp{soft}, @samp{softfp} and @samp{hard}.
13094 Specifying @samp{soft} causes GCC to generate output containing
13095 library calls for floating-point operations.
13096 @samp{softfp} allows the generation of code using hardware floating-point
13097 instructions, but still uses the soft-float calling conventions.
13098 @samp{hard} allows generation of floating-point instructions
13099 and uses FPU-specific calling conventions.
13101 The default depends on the specific target configuration.  Note that
13102 the hard-float and soft-float ABIs are not link-compatible; you must
13103 compile your entire program with the same ABI, and link with a
13104 compatible set of libraries.
13106 @item -mlittle-endian
13107 @opindex mlittle-endian
13108 Generate code for a processor running in little-endian mode.  This is
13109 the default for all standard configurations.
13111 @item -mbig-endian
13112 @opindex mbig-endian
13113 Generate code for a processor running in big-endian mode; the default is
13114 to compile code for a little-endian processor.
13116 @item -march=@var{name}
13117 @opindex march
13118 This specifies the name of the target ARM architecture.  GCC uses this
13119 name to determine what kind of instructions it can emit when generating
13120 assembly code.  This option can be used in conjunction with or instead
13121 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
13122 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
13123 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
13124 @samp{armv6}, @samp{armv6j},
13125 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
13126 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m}, @samp{armv7e-m},
13127 @samp{armv7ve}, @samp{armv8-a}, @samp{armv8-a+crc},
13128 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
13130 @option{-march=armv7ve} is the armv7-a architecture with virtualization
13131 extensions.
13133 @option{-march=armv8-a+crc} enables code generation for the ARMv8-A
13134 architecture together with the optional CRC32 extensions.
13136 @option{-march=native} causes the compiler to auto-detect the architecture
13137 of the build computer.  At present, this feature is only supported on
13138 GNU/Linux, and not all architectures are recognized.  If the auto-detect
13139 is unsuccessful the option has no effect.
13141 @item -mtune=@var{name}
13142 @opindex mtune
13143 This option specifies the name of the target ARM processor for
13144 which GCC should tune the performance of the code.
13145 For some ARM implementations better performance can be obtained by using
13146 this option.
13147 Permissible names are: @samp{arm2}, @samp{arm250},
13148 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
13149 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
13150 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
13151 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
13152 @samp{arm720},
13153 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
13154 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
13155 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
13156 @samp{strongarm1110},
13157 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
13158 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
13159 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
13160 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
13161 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
13162 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
13163 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
13164 @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8}, @samp{cortex-a9},
13165 @samp{cortex-a12}, @samp{cortex-a15}, @samp{cortex-a53},
13166 @samp{cortex-a57}, @samp{cortex-a72},
13167 @samp{cortex-r4},
13168 @samp{cortex-r4f}, @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-m7},
13169 @samp{cortex-m4},
13170 @samp{cortex-m3},
13171 @samp{cortex-m1},
13172 @samp{cortex-m0},
13173 @samp{cortex-m0plus},
13174 @samp{cortex-m1.small-multiply},
13175 @samp{cortex-m0.small-multiply},
13176 @samp{cortex-m0plus.small-multiply},
13177 @samp{marvell-pj4},
13178 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
13179 @samp{fa526}, @samp{fa626},
13180 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te},
13181 @samp{xgene1}.
13183 Additionally, this option can specify that GCC should tune the performance
13184 of the code for a big.LITTLE system.  Permissible names are:
13185 @samp{cortex-a15.cortex-a7}, @samp{cortex-a57.cortex-a53},
13186 @samp{cortex-a72.cortex-a53}.
13188 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
13189 performance for a blend of processors within architecture @var{arch}.
13190 The aim is to generate code that run well on the current most popular
13191 processors, balancing between optimizations that benefit some CPUs in the
13192 range, and avoiding performance pitfalls of other CPUs.  The effects of
13193 this option may change in future GCC versions as CPU models come and go.
13195 @option{-mtune=native} causes the compiler to auto-detect the CPU
13196 of the build computer.  At present, this feature is only supported on
13197 GNU/Linux, and not all architectures are recognized.  If the auto-detect is
13198 unsuccessful the option has no effect.
13200 @item -mcpu=@var{name}
13201 @opindex mcpu
13202 This specifies the name of the target ARM processor.  GCC uses this name
13203 to derive the name of the target ARM architecture (as if specified
13204 by @option{-march}) and the ARM processor type for which to tune for
13205 performance (as if specified by @option{-mtune}).  Where this option
13206 is used in conjunction with @option{-march} or @option{-mtune},
13207 those options take precedence over the appropriate part of this option.
13209 Permissible names for this option are the same as those for
13210 @option{-mtune}.
13212 @option{-mcpu=generic-@var{arch}} is also permissible, and is
13213 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
13214 See @option{-mtune} for more information.
13216 @option{-mcpu=native} causes the compiler to auto-detect the CPU
13217 of the build computer.  At present, this feature is only supported on
13218 GNU/Linux, and not all architectures are recognized.  If the auto-detect
13219 is unsuccessful the option has no effect.
13221 @item -mfpu=@var{name}
13222 @opindex mfpu
13223 This specifies what floating-point hardware (or hardware emulation) is
13224 available on the target.  Permissible names are: @samp{vfp}, @samp{vfpv3},
13225 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
13226 @samp{vfpv3xd-fp16}, @samp{neon}, @samp{neon-fp16}, @samp{vfpv4},
13227 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
13228 @samp{fpv5-d16}, @samp{fpv5-sp-d16},
13229 @samp{fp-armv8}, @samp{neon-fp-armv8}, and @samp{crypto-neon-fp-armv8}.
13231 If @option{-msoft-float} is specified this specifies the format of
13232 floating-point values.
13234 If the selected floating-point hardware includes the NEON extension
13235 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
13236 operations are not generated by GCC's auto-vectorization pass unless
13237 @option{-funsafe-math-optimizations} is also specified.  This is
13238 because NEON hardware does not fully implement the IEEE 754 standard for
13239 floating-point arithmetic (in particular denormal values are treated as
13240 zero), so the use of NEON instructions may lead to a loss of precision.
13242 @item -mfp16-format=@var{name}
13243 @opindex mfp16-format
13244 Specify the format of the @code{__fp16} half-precision floating-point type.
13245 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
13246 the default is @samp{none}, in which case the @code{__fp16} type is not
13247 defined.  @xref{Half-Precision}, for more information.
13249 @item -mstructure-size-boundary=@var{n}
13250 @opindex mstructure-size-boundary
13251 The sizes of all structures and unions are rounded up to a multiple
13252 of the number of bits set by this option.  Permissible values are 8, 32
13253 and 64.  The default value varies for different toolchains.  For the COFF
13254 targeted toolchain the default value is 8.  A value of 64 is only allowed
13255 if the underlying ABI supports it.
13257 Specifying a larger number can produce faster, more efficient code, but
13258 can also increase the size of the program.  Different values are potentially
13259 incompatible.  Code compiled with one value cannot necessarily expect to
13260 work with code or libraries compiled with another value, if they exchange
13261 information using structures or unions.
13263 @item -mabort-on-noreturn
13264 @opindex mabort-on-noreturn
13265 Generate a call to the function @code{abort} at the end of a
13266 @code{noreturn} function.  It is executed if the function tries to
13267 return.
13269 @item -mlong-calls
13270 @itemx -mno-long-calls
13271 @opindex mlong-calls
13272 @opindex mno-long-calls
13273 Tells the compiler to perform function calls by first loading the
13274 address of the function into a register and then performing a subroutine
13275 call on this register.  This switch is needed if the target function
13276 lies outside of the 64-megabyte addressing range of the offset-based
13277 version of subroutine call instruction.
13279 Even if this switch is enabled, not all function calls are turned
13280 into long calls.  The heuristic is that static functions, functions
13281 that have the @code{short_call} attribute, functions that are inside
13282 the scope of a @code{#pragma no_long_calls} directive, and functions whose
13283 definitions have already been compiled within the current compilation
13284 unit are not turned into long calls.  The exceptions to this rule are
13285 that weak function definitions, functions with the @code{long_call}
13286 attribute or the @code{section} attribute, and functions that are within
13287 the scope of a @code{#pragma long_calls} directive are always
13288 turned into long calls.
13290 This feature is not enabled by default.  Specifying
13291 @option{-mno-long-calls} restores the default behavior, as does
13292 placing the function calls within the scope of a @code{#pragma
13293 long_calls_off} directive.  Note these switches have no effect on how
13294 the compiler generates code to handle function calls via function
13295 pointers.
13297 @item -msingle-pic-base
13298 @opindex msingle-pic-base
13299 Treat the register used for PIC addressing as read-only, rather than
13300 loading it in the prologue for each function.  The runtime system is
13301 responsible for initializing this register with an appropriate value
13302 before execution begins.
13304 @item -mpic-register=@var{reg}
13305 @opindex mpic-register
13306 Specify the register to be used for PIC addressing.
13307 For standard PIC base case, the default is any suitable register
13308 determined by compiler.  For single PIC base case, the default is
13309 @samp{R9} if target is EABI based or stack-checking is enabled,
13310 otherwise the default is @samp{R10}.
13312 @item -mpic-data-is-text-relative
13313 @opindex mpic-data-is-text-relative
13314 Assume that each data segments are relative to text segment at load time.
13315 Therefore, it permits addressing data using PC-relative operations.
13316 This option is on by default for targets other than VxWorks RTP.
13318 @item -mpoke-function-name
13319 @opindex mpoke-function-name
13320 Write the name of each function into the text section, directly
13321 preceding the function prologue.  The generated code is similar to this:
13323 @smallexample
13324      t0
13325          .ascii "arm_poke_function_name", 0
13326          .align
13327      t1
13328          .word 0xff000000 + (t1 - t0)
13329      arm_poke_function_name
13330          mov     ip, sp
13331          stmfd   sp!, @{fp, ip, lr, pc@}
13332          sub     fp, ip, #4
13333 @end smallexample
13335 When performing a stack backtrace, code can inspect the value of
13336 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
13337 location @code{pc - 12} and the top 8 bits are set, then we know that
13338 there is a function name embedded immediately preceding this location
13339 and has length @code{((pc[-3]) & 0xff000000)}.
13341 @item -mthumb
13342 @itemx -marm
13343 @opindex marm
13344 @opindex mthumb
13346 Select between generating code that executes in ARM and Thumb
13347 states.  The default for most configurations is to generate code
13348 that executes in ARM state, but the default can be changed by
13349 configuring GCC with the @option{--with-mode=}@var{state}
13350 configure option.
13352 @item -mtpcs-frame
13353 @opindex mtpcs-frame
13354 Generate a stack frame that is compliant with the Thumb Procedure Call
13355 Standard for all non-leaf functions.  (A leaf function is one that does
13356 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
13358 @item -mtpcs-leaf-frame
13359 @opindex mtpcs-leaf-frame
13360 Generate a stack frame that is compliant with the Thumb Procedure Call
13361 Standard for all leaf functions.  (A leaf function is one that does
13362 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
13364 @item -mcallee-super-interworking
13365 @opindex mcallee-super-interworking
13366 Gives all externally visible functions in the file being compiled an ARM
13367 instruction set header which switches to Thumb mode before executing the
13368 rest of the function.  This allows these functions to be called from
13369 non-interworking code.  This option is not valid in AAPCS configurations
13370 because interworking is enabled by default.
13372 @item -mcaller-super-interworking
13373 @opindex mcaller-super-interworking
13374 Allows calls via function pointers (including virtual functions) to
13375 execute correctly regardless of whether the target code has been
13376 compiled for interworking or not.  There is a small overhead in the cost
13377 of executing a function pointer if this option is enabled.  This option
13378 is not valid in AAPCS configurations because interworking is enabled
13379 by default.
13381 @item -mtp=@var{name}
13382 @opindex mtp
13383 Specify the access model for the thread local storage pointer.  The valid
13384 models are @samp{soft}, which generates calls to @code{__aeabi_read_tp},
13385 @samp{cp15}, which fetches the thread pointer from @code{cp15} directly
13386 (supported in the arm6k architecture), and @samp{auto}, which uses the
13387 best available method for the selected processor.  The default setting is
13388 @samp{auto}.
13390 @item -mtls-dialect=@var{dialect}
13391 @opindex mtls-dialect
13392 Specify the dialect to use for accessing thread local storage.  Two
13393 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
13394 @samp{gnu} dialect selects the original GNU scheme for supporting
13395 local and global dynamic TLS models.  The @samp{gnu2} dialect
13396 selects the GNU descriptor scheme, which provides better performance
13397 for shared libraries.  The GNU descriptor scheme is compatible with
13398 the original scheme, but does require new assembler, linker and
13399 library support.  Initial and local exec TLS models are unaffected by
13400 this option and always use the original scheme.
13402 @item -mword-relocations
13403 @opindex mword-relocations
13404 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
13405 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
13406 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
13407 is specified.
13409 @item -mfix-cortex-m3-ldrd
13410 @opindex mfix-cortex-m3-ldrd
13411 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
13412 with overlapping destination and base registers are used.  This option avoids
13413 generating these instructions.  This option is enabled by default when
13414 @option{-mcpu=cortex-m3} is specified.
13416 @item -munaligned-access
13417 @itemx -mno-unaligned-access
13418 @opindex munaligned-access
13419 @opindex mno-unaligned-access
13420 Enables (or disables) reading and writing of 16- and 32- bit values
13421 from addresses that are not 16- or 32- bit aligned.  By default
13422 unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
13423 architectures, and enabled for all other architectures.  If unaligned
13424 access is not enabled then words in packed data structures are
13425 accessed a byte at a time.
13427 The ARM attribute @code{Tag_CPU_unaligned_access} is set in the
13428 generated object file to either true or false, depending upon the
13429 setting of this option.  If unaligned access is enabled then the
13430 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} is also
13431 defined.
13433 @item -mneon-for-64bits
13434 @opindex mneon-for-64bits
13435 Enables using Neon to handle scalar 64-bits operations. This is
13436 disabled by default since the cost of moving data from core registers
13437 to Neon is high.
13439 @item -mslow-flash-data
13440 @opindex mslow-flash-data
13441 Assume loading data from flash is slower than fetching instruction.
13442 Therefore literal load is minimized for better performance.
13443 This option is only supported when compiling for ARMv7 M-profile and
13444 off by default.
13446 @item -masm-syntax-unified
13447 @opindex masm-syntax-unified
13448 Assume inline assembler is using unified asm syntax.  The default is
13449 currently off which implies divided syntax.  Currently this option is
13450 available only for Thumb1 and has no effect on ARM state and Thumb2.
13451 However, this may change in future releases of GCC.  Divided syntax
13452 should be considered deprecated.
13454 @item -mrestrict-it
13455 @opindex mrestrict-it
13456 Restricts generation of IT blocks to conform to the rules of ARMv8.
13457 IT blocks can only contain a single 16-bit instruction from a select
13458 set of instructions. This option is on by default for ARMv8 Thumb mode.
13459 @end table
13461 @node AVR Options
13462 @subsection AVR Options
13463 @cindex AVR Options
13465 These options are defined for AVR implementations:
13467 @table @gcctabopt
13468 @item -mmcu=@var{mcu}
13469 @opindex mmcu
13470 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
13472 The default for this option is@tie{}@samp{avr2}.
13474 GCC supports the following AVR devices and ISAs:
13476 @include avr-mmcu.texi
13478 @item -maccumulate-args
13479 @opindex maccumulate-args
13480 Accumulate outgoing function arguments and acquire/release the needed
13481 stack space for outgoing function arguments once in function
13482 prologue/epilogue.  Without this option, outgoing arguments are pushed
13483 before calling a function and popped afterwards.
13485 Popping the arguments after the function call can be expensive on
13486 AVR so that accumulating the stack space might lead to smaller
13487 executables because arguments need not to be removed from the
13488 stack after such a function call.
13490 This option can lead to reduced code size for functions that perform
13491 several calls to functions that get their arguments on the stack like
13492 calls to printf-like functions.
13494 @item -mbranch-cost=@var{cost}
13495 @opindex mbranch-cost
13496 Set the branch costs for conditional branch instructions to
13497 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
13498 integers. The default branch cost is 0.
13500 @item -mcall-prologues
13501 @opindex mcall-prologues
13502 Functions prologues/epilogues are expanded as calls to appropriate
13503 subroutines.  Code size is smaller.
13505 @item -mint8
13506 @opindex mint8
13507 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
13508 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
13509 and @code{long long} is 4 bytes.  Please note that this option does not
13510 conform to the C standards, but it results in smaller code
13511 size.
13513 @item -mn-flash=@var{num}
13514 @opindex mn-flash
13515 Assume that the flash memory has a size of 
13516 @var{num} times 64@tie{}KiB.
13518 @item -mno-interrupts
13519 @opindex mno-interrupts
13520 Generated code is not compatible with hardware interrupts.
13521 Code size is smaller.
13523 @item -mrelax
13524 @opindex mrelax
13525 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
13526 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
13527 Setting @option{-mrelax} just adds the @option{--mlink-relax} option to
13528 the assembler's command line and the @option{--relax} option to the
13529 linker's command line.
13531 Jump relaxing is performed by the linker because jump offsets are not
13532 known before code is located. Therefore, the assembler code generated by the
13533 compiler is the same, but the instructions in the executable may
13534 differ from instructions in the assembler code.
13536 Relaxing must be turned on if linker stubs are needed, see the
13537 section on @code{EIND} and linker stubs below.
13539 @item -mrmw
13540 @opindex mrmw
13541 Assume that the device supports the Read-Modify-Write
13542 instructions @code{XCH}, @code{LAC}, @code{LAS} and @code{LAT}.
13544 @item -msp8
13545 @opindex msp8
13546 Treat the stack pointer register as an 8-bit register,
13547 i.e.@: assume the high byte of the stack pointer is zero.
13548 In general, you don't need to set this option by hand.
13550 This option is used internally by the compiler to select and
13551 build multilibs for architectures @code{avr2} and @code{avr25}.
13552 These architectures mix devices with and without @code{SPH}.
13553 For any setting other than @option{-mmcu=avr2} or @option{-mmcu=avr25}
13554 the compiler driver adds or removes this option from the compiler
13555 proper's command line, because the compiler then knows if the device
13556 or architecture has an 8-bit stack pointer and thus no @code{SPH}
13557 register or not.
13559 @item -mstrict-X
13560 @opindex mstrict-X
13561 Use address register @code{X} in a way proposed by the hardware.  This means
13562 that @code{X} is only used in indirect, post-increment or
13563 pre-decrement addressing.
13565 Without this option, the @code{X} register may be used in the same way
13566 as @code{Y} or @code{Z} which then is emulated by additional
13567 instructions.  
13568 For example, loading a value with @code{X+const} addressing with a
13569 small non-negative @code{const < 64} to a register @var{Rn} is
13570 performed as
13572 @example
13573 adiw r26, const   ; X += const
13574 ld   @var{Rn}, X        ; @var{Rn} = *X
13575 sbiw r26, const   ; X -= const
13576 @end example
13578 @item -mtiny-stack
13579 @opindex mtiny-stack
13580 Only change the lower 8@tie{}bits of the stack pointer.
13582 @item -nodevicelib
13583 @opindex nodevicelib
13584 Don't link against AVR-LibC's device specific library @code{libdev.a}.
13586 @item -Waddr-space-convert
13587 @opindex Waddr-space-convert
13588 Warn about conversions between address spaces in the case where the
13589 resulting address space is not contained in the incoming address space.
13590 @end table
13592 @subsubsection @code{EIND} and Devices with More Than 128 Ki Bytes of Flash
13593 @cindex @code{EIND}
13594 Pointers in the implementation are 16@tie{}bits wide.
13595 The address of a function or label is represented as word address so
13596 that indirect jumps and calls can target any code address in the
13597 range of 64@tie{}Ki words.
13599 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
13600 bytes of program memory space, there is a special function register called
13601 @code{EIND} that serves as most significant part of the target address
13602 when @code{EICALL} or @code{EIJMP} instructions are used.
13604 Indirect jumps and calls on these devices are handled as follows by
13605 the compiler and are subject to some limitations:
13607 @itemize @bullet
13609 @item
13610 The compiler never sets @code{EIND}.
13612 @item
13613 The compiler uses @code{EIND} implicitely in @code{EICALL}/@code{EIJMP}
13614 instructions or might read @code{EIND} directly in order to emulate an
13615 indirect call/jump by means of a @code{RET} instruction.
13617 @item
13618 The compiler assumes that @code{EIND} never changes during the startup
13619 code or during the application. In particular, @code{EIND} is not
13620 saved/restored in function or interrupt service routine
13621 prologue/epilogue.
13623 @item
13624 For indirect calls to functions and computed goto, the linker
13625 generates @emph{stubs}. Stubs are jump pads sometimes also called
13626 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
13627 The stub contains a direct jump to the desired address.
13629 @item
13630 Linker relaxation must be turned on so that the linker generates
13631 the stubs correctly in all situations. See the compiler option
13632 @option{-mrelax} and the linker option @option{--relax}.
13633 There are corner cases where the linker is supposed to generate stubs
13634 but aborts without relaxation and without a helpful error message.
13636 @item
13637 The default linker script is arranged for code with @code{EIND = 0}.
13638 If code is supposed to work for a setup with @code{EIND != 0}, a custom
13639 linker script has to be used in order to place the sections whose
13640 name start with @code{.trampolines} into the segment where @code{EIND}
13641 points to.
13643 @item
13644 The startup code from libgcc never sets @code{EIND}.
13645 Notice that startup code is a blend of code from libgcc and AVR-LibC.
13646 For the impact of AVR-LibC on @code{EIND}, see the
13647 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
13649 @item
13650 It is legitimate for user-specific startup code to set up @code{EIND}
13651 early, for example by means of initialization code located in
13652 section @code{.init3}. Such code runs prior to general startup code
13653 that initializes RAM and calls constructors, but after the bit
13654 of startup code from AVR-LibC that sets @code{EIND} to the segment
13655 where the vector table is located.
13656 @example
13657 #include <avr/io.h>
13659 static void
13660 __attribute__((section(".init3"),naked,used,no_instrument_function))
13661 init3_set_eind (void)
13663   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
13664                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
13666 @end example
13668 @noindent
13669 The @code{__trampolines_start} symbol is defined in the linker script.
13671 @item
13672 Stubs are generated automatically by the linker if
13673 the following two conditions are met:
13674 @itemize @minus
13676 @item The address of a label is taken by means of the @code{gs} modifier
13677 (short for @emph{generate stubs}) like so:
13678 @example
13679 LDI r24, lo8(gs(@var{func}))
13680 LDI r25, hi8(gs(@var{func}))
13681 @end example
13682 @item The final location of that label is in a code segment
13683 @emph{outside} the segment where the stubs are located.
13684 @end itemize
13686 @item
13687 The compiler emits such @code{gs} modifiers for code labels in the
13688 following situations:
13689 @itemize @minus
13690 @item Taking address of a function or code label.
13691 @item Computed goto.
13692 @item If prologue-save function is used, see @option{-mcall-prologues}
13693 command-line option.
13694 @item Switch/case dispatch tables. If you do not want such dispatch
13695 tables you can specify the @option{-fno-jump-tables} command-line option.
13696 @item C and C++ constructors/destructors called during startup/shutdown.
13697 @item If the tools hit a @code{gs()} modifier explained above.
13698 @end itemize
13700 @item
13701 Jumping to non-symbolic addresses like so is @emph{not} supported:
13703 @example
13704 int main (void)
13706     /* Call function at word address 0x2 */
13707     return ((int(*)(void)) 0x2)();
13709 @end example
13711 Instead, a stub has to be set up, i.e.@: the function has to be called
13712 through a symbol (@code{func_4} in the example):
13714 @example
13715 int main (void)
13717     extern int func_4 (void);
13719     /* Call function at byte address 0x4 */
13720     return func_4();
13722 @end example
13724 and the application be linked with @option{-Wl,--defsym,func_4=0x4}.
13725 Alternatively, @code{func_4} can be defined in the linker script.
13726 @end itemize
13728 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
13729 @cindex @code{RAMPD}
13730 @cindex @code{RAMPX}
13731 @cindex @code{RAMPY}
13732 @cindex @code{RAMPZ}
13733 Some AVR devices support memories larger than the 64@tie{}KiB range
13734 that can be accessed with 16-bit pointers.  To access memory locations
13735 outside this 64@tie{}KiB range, the contentent of a @code{RAMP}
13736 register is used as high part of the address:
13737 The @code{X}, @code{Y}, @code{Z} address register is concatenated
13738 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
13739 register, respectively, to get a wide address. Similarly,
13740 @code{RAMPD} is used together with direct addressing.
13742 @itemize
13743 @item
13744 The startup code initializes the @code{RAMP} special function
13745 registers with zero.
13747 @item
13748 If a @ref{AVR Named Address Spaces,named address space} other than
13749 generic or @code{__flash} is used, then @code{RAMPZ} is set
13750 as needed before the operation.
13752 @item
13753 If the device supports RAM larger than 64@tie{}KiB and the compiler
13754 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
13755 is reset to zero after the operation.
13757 @item
13758 If the device comes with a specific @code{RAMP} register, the ISR
13759 prologue/epilogue saves/restores that SFR and initializes it with
13760 zero in case the ISR code might (implicitly) use it.
13762 @item
13763 RAM larger than 64@tie{}KiB is not supported by GCC for AVR targets.
13764 If you use inline assembler to read from locations outside the
13765 16-bit address range and change one of the @code{RAMP} registers,
13766 you must reset it to zero after the access.
13768 @end itemize
13770 @subsubsection AVR Built-in Macros
13772 GCC defines several built-in macros so that the user code can test
13773 for the presence or absence of features.  Almost any of the following
13774 built-in macros are deduced from device capabilities and thus
13775 triggered by the @option{-mmcu=} command-line option.
13777 For even more AVR-specific built-in macros see
13778 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
13780 @table @code
13782 @item __AVR_ARCH__
13783 Build-in macro that resolves to a decimal number that identifies the
13784 architecture and depends on the @option{-mmcu=@var{mcu}} option.
13785 Possible values are:
13787 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
13788 @code{4}, @code{5}, @code{51}, @code{6}
13790 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3}, @code{avr31},
13791 @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51}, @code{avr6},
13793 respectively and
13795 @code{100}, @code{102}, @code{104},
13796 @code{105}, @code{106}, @code{107}
13798 for @var{mcu}=@code{avrtiny}, @code{avrxmega2}, @code{avrxmega4},
13799 @code{avrxmega5}, @code{avrxmega6}, @code{avrxmega7}, respectively.
13800 If @var{mcu} specifies a device, this built-in macro is set
13801 accordingly. For example, with @option{-mmcu=atmega8} the macro is
13802 defined to @code{4}.
13804 @item __AVR_@var{Device}__
13805 Setting @option{-mmcu=@var{device}} defines this built-in macro which reflects
13806 the device's name. For example, @option{-mmcu=atmega8} defines the
13807 built-in macro @code{__AVR_ATmega8__}, @option{-mmcu=attiny261a} defines
13808 @code{__AVR_ATtiny261A__}, etc.
13810 The built-in macros' names follow
13811 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
13812 the device name as from the AVR user manual. The difference between
13813 @var{Device} in the built-in macro and @var{device} in
13814 @option{-mmcu=@var{device}} is that the latter is always lowercase.
13816 If @var{device} is not a device but only a core architecture like
13817 @samp{avr51}, this macro is not defined.
13819 @item __AVR_DEVICE_NAME__
13820 Setting @option{-mmcu=@var{device}} defines this built-in macro to
13821 the device's name. For example, with @option{-mmcu=atmega8} the macro
13822 is defined to @code{atmega8}.
13824 If @var{device} is not a device but only a core architecture like
13825 @samp{avr51}, this macro is not defined.
13827 @item __AVR_XMEGA__
13828 The device / architecture belongs to the XMEGA family of devices.
13830 @item __AVR_HAVE_ELPM__
13831 The device has the the @code{ELPM} instruction.
13833 @item __AVR_HAVE_ELPMX__
13834 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
13835 R@var{n},Z+} instructions.
13837 @item __AVR_HAVE_MOVW__
13838 The device has the @code{MOVW} instruction to perform 16-bit
13839 register-register moves.
13841 @item __AVR_HAVE_LPMX__
13842 The device has the @code{LPM R@var{n},Z} and
13843 @code{LPM R@var{n},Z+} instructions.
13845 @item __AVR_HAVE_MUL__
13846 The device has a hardware multiplier. 
13848 @item __AVR_HAVE_JMP_CALL__
13849 The device has the @code{JMP} and @code{CALL} instructions.
13850 This is the case for devices with at least 16@tie{}KiB of program
13851 memory.
13853 @item __AVR_HAVE_EIJMP_EICALL__
13854 @itemx __AVR_3_BYTE_PC__
13855 The device has the @code{EIJMP} and @code{EICALL} instructions.
13856 This is the case for devices with more than 128@tie{}KiB of program memory.
13857 This also means that the program counter
13858 (PC) is 3@tie{}bytes wide.
13860 @item __AVR_2_BYTE_PC__
13861 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
13862 with up to 128@tie{}KiB of program memory.
13864 @item __AVR_HAVE_8BIT_SP__
13865 @itemx __AVR_HAVE_16BIT_SP__
13866 The stack pointer (SP) register is treated as 8-bit respectively
13867 16-bit register by the compiler.
13868 The definition of these macros is affected by @option{-mtiny-stack}.
13870 @item __AVR_HAVE_SPH__
13871 @itemx __AVR_SP8__
13872 The device has the SPH (high part of stack pointer) special function
13873 register or has an 8-bit stack pointer, respectively.
13874 The definition of these macros is affected by @option{-mmcu=} and
13875 in the cases of @option{-mmcu=avr2} and @option{-mmcu=avr25} also
13876 by @option{-msp8}.
13878 @item __AVR_HAVE_RAMPD__
13879 @itemx __AVR_HAVE_RAMPX__
13880 @itemx __AVR_HAVE_RAMPY__
13881 @itemx __AVR_HAVE_RAMPZ__
13882 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
13883 @code{RAMPZ} special function register, respectively.
13885 @item __NO_INTERRUPTS__
13886 This macro reflects the @option{-mno-interrupts} command line option.
13888 @item __AVR_ERRATA_SKIP__
13889 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
13890 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
13891 instructions because of a hardware erratum.  Skip instructions are
13892 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
13893 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
13894 set.
13896 @item __AVR_ISA_RMW__
13897 The device has Read-Modify-Write instructions (XCH, LAC, LAS and LAT).
13899 @item __AVR_SFR_OFFSET__=@var{offset}
13900 Instructions that can address I/O special function registers directly
13901 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
13902 address as if addressed by an instruction to access RAM like @code{LD}
13903 or @code{STS}. This offset depends on the device architecture and has
13904 to be subtracted from the RAM address in order to get the
13905 respective I/O@tie{}address.
13907 @item __WITH_AVRLIBC__
13908 The compiler is configured to be used together with AVR-Libc.
13909 See the @option{--with-avrlibc} configure option.
13911 @end table
13913 @node Blackfin Options
13914 @subsection Blackfin Options
13915 @cindex Blackfin Options
13917 @table @gcctabopt
13918 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
13919 @opindex mcpu=
13920 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
13921 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
13922 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
13923 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
13924 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
13925 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
13926 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
13927 @samp{bf561}, @samp{bf592}.
13929 The optional @var{sirevision} specifies the silicon revision of the target
13930 Blackfin processor.  Any workarounds available for the targeted silicon revision
13931 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
13932 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
13933 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
13934 hexadecimal digits representing the major and minor numbers in the silicon
13935 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
13936 is not defined.  If @var{sirevision} is @samp{any}, the
13937 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
13938 If this optional @var{sirevision} is not used, GCC assumes the latest known
13939 silicon revision of the targeted Blackfin processor.
13941 GCC defines a preprocessor macro for the specified @var{cpu}.
13942 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
13943 provided by libgloss to be linked in if @option{-msim} is not given.
13945 Without this option, @samp{bf532} is used as the processor by default.
13947 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
13948 only the preprocessor macro is defined.
13950 @item -msim
13951 @opindex msim
13952 Specifies that the program will be run on the simulator.  This causes
13953 the simulator BSP provided by libgloss to be linked in.  This option
13954 has effect only for @samp{bfin-elf} toolchain.
13955 Certain other options, such as @option{-mid-shared-library} and
13956 @option{-mfdpic}, imply @option{-msim}.
13958 @item -momit-leaf-frame-pointer
13959 @opindex momit-leaf-frame-pointer
13960 Don't keep the frame pointer in a register for leaf functions.  This
13961 avoids the instructions to save, set up and restore frame pointers and
13962 makes an extra register available in leaf functions.  The option
13963 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
13964 which might make debugging harder.
13966 @item -mspecld-anomaly
13967 @opindex mspecld-anomaly
13968 When enabled, the compiler ensures that the generated code does not
13969 contain speculative loads after jump instructions. If this option is used,
13970 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
13972 @item -mno-specld-anomaly
13973 @opindex mno-specld-anomaly
13974 Don't generate extra code to prevent speculative loads from occurring.
13976 @item -mcsync-anomaly
13977 @opindex mcsync-anomaly
13978 When enabled, the compiler ensures that the generated code does not
13979 contain CSYNC or SSYNC instructions too soon after conditional branches.
13980 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
13982 @item -mno-csync-anomaly
13983 @opindex mno-csync-anomaly
13984 Don't generate extra code to prevent CSYNC or SSYNC instructions from
13985 occurring too soon after a conditional branch.
13987 @item -mlow-64k
13988 @opindex mlow-64k
13989 When enabled, the compiler is free to take advantage of the knowledge that
13990 the entire program fits into the low 64k of memory.
13992 @item -mno-low-64k
13993 @opindex mno-low-64k
13994 Assume that the program is arbitrarily large.  This is the default.
13996 @item -mstack-check-l1
13997 @opindex mstack-check-l1
13998 Do stack checking using information placed into L1 scratchpad memory by the
13999 uClinux kernel.
14001 @item -mid-shared-library
14002 @opindex mid-shared-library
14003 Generate code that supports shared libraries via the library ID method.
14004 This allows for execute in place and shared libraries in an environment
14005 without virtual memory management.  This option implies @option{-fPIC}.
14006 With a @samp{bfin-elf} target, this option implies @option{-msim}.
14008 @item -mno-id-shared-library
14009 @opindex mno-id-shared-library
14010 Generate code that doesn't assume ID-based shared libraries are being used.
14011 This is the default.
14013 @item -mleaf-id-shared-library
14014 @opindex mleaf-id-shared-library
14015 Generate code that supports shared libraries via the library ID method,
14016 but assumes that this library or executable won't link against any other
14017 ID shared libraries.  That allows the compiler to use faster code for jumps
14018 and calls.
14020 @item -mno-leaf-id-shared-library
14021 @opindex mno-leaf-id-shared-library
14022 Do not assume that the code being compiled won't link against any ID shared
14023 libraries.  Slower code is generated for jump and call insns.
14025 @item -mshared-library-id=n
14026 @opindex mshared-library-id
14027 Specifies the identification number of the ID-based shared library being
14028 compiled.  Specifying a value of 0 generates more compact code; specifying
14029 other values forces the allocation of that number to the current
14030 library but is no more space- or time-efficient than omitting this option.
14032 @item -msep-data
14033 @opindex msep-data
14034 Generate code that allows the data segment to be located in a different
14035 area of memory from the text segment.  This allows for execute in place in
14036 an environment without virtual memory management by eliminating relocations
14037 against the text section.
14039 @item -mno-sep-data
14040 @opindex mno-sep-data
14041 Generate code that assumes that the data segment follows the text segment.
14042 This is the default.
14044 @item -mlong-calls
14045 @itemx -mno-long-calls
14046 @opindex mlong-calls
14047 @opindex mno-long-calls
14048 Tells the compiler to perform function calls by first loading the
14049 address of the function into a register and then performing a subroutine
14050 call on this register.  This switch is needed if the target function
14051 lies outside of the 24-bit addressing range of the offset-based
14052 version of subroutine call instruction.
14054 This feature is not enabled by default.  Specifying
14055 @option{-mno-long-calls} restores the default behavior.  Note these
14056 switches have no effect on how the compiler generates code to handle
14057 function calls via function pointers.
14059 @item -mfast-fp
14060 @opindex mfast-fp
14061 Link with the fast floating-point library. This library relaxes some of
14062 the IEEE floating-point standard's rules for checking inputs against
14063 Not-a-Number (NAN), in the interest of performance.
14065 @item -minline-plt
14066 @opindex minline-plt
14067 Enable inlining of PLT entries in function calls to functions that are
14068 not known to bind locally.  It has no effect without @option{-mfdpic}.
14070 @item -mmulticore
14071 @opindex mmulticore
14072 Build a standalone application for multicore Blackfin processors. 
14073 This option causes proper start files and link scripts supporting 
14074 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
14075 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
14077 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
14078 selects the one-application-per-core programming model.  Without
14079 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
14080 programming model is used. In this model, the main function of Core B
14081 should be named as @code{coreb_main}.
14083 If this option is not used, the single-core application programming
14084 model is used.
14086 @item -mcorea
14087 @opindex mcorea
14088 Build a standalone application for Core A of BF561 when using
14089 the one-application-per-core programming model. Proper start files
14090 and link scripts are used to support Core A, and the macro
14091 @code{__BFIN_COREA} is defined.
14092 This option can only be used in conjunction with @option{-mmulticore}.
14094 @item -mcoreb
14095 @opindex mcoreb
14096 Build a standalone application for Core B of BF561 when using
14097 the one-application-per-core programming model. Proper start files
14098 and link scripts are used to support Core B, and the macro
14099 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
14100 should be used instead of @code{main}. 
14101 This option can only be used in conjunction with @option{-mmulticore}.
14103 @item -msdram
14104 @opindex msdram
14105 Build a standalone application for SDRAM. Proper start files and
14106 link scripts are used to put the application into SDRAM, and the macro
14107 @code{__BFIN_SDRAM} is defined.
14108 The loader should initialize SDRAM before loading the application.
14110 @item -micplb
14111 @opindex micplb
14112 Assume that ICPLBs are enabled at run time.  This has an effect on certain
14113 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
14114 are enabled; for standalone applications the default is off.
14115 @end table
14117 @node C6X Options
14118 @subsection C6X Options
14119 @cindex C6X Options
14121 @table @gcctabopt
14122 @item -march=@var{name}
14123 @opindex march
14124 This specifies the name of the target architecture.  GCC uses this
14125 name to determine what kind of instructions it can emit when generating
14126 assembly code.  Permissible names are: @samp{c62x},
14127 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
14129 @item -mbig-endian
14130 @opindex mbig-endian
14131 Generate code for a big-endian target.
14133 @item -mlittle-endian
14134 @opindex mlittle-endian
14135 Generate code for a little-endian target.  This is the default.
14137 @item -msim
14138 @opindex msim
14139 Choose startup files and linker script suitable for the simulator.
14141 @item -msdata=default
14142 @opindex msdata=default
14143 Put small global and static data in the @code{.neardata} section,
14144 which is pointed to by register @code{B14}.  Put small uninitialized
14145 global and static data in the @code{.bss} section, which is adjacent
14146 to the @code{.neardata} section.  Put small read-only data into the
14147 @code{.rodata} section.  The corresponding sections used for large
14148 pieces of data are @code{.fardata}, @code{.far} and @code{.const}.
14150 @item -msdata=all
14151 @opindex msdata=all
14152 Put all data, not just small objects, into the sections reserved for
14153 small data, and use addressing relative to the @code{B14} register to
14154 access them.
14156 @item -msdata=none
14157 @opindex msdata=none
14158 Make no use of the sections reserved for small data, and use absolute
14159 addresses to access all data.  Put all initialized global and static
14160 data in the @code{.fardata} section, and all uninitialized data in the
14161 @code{.far} section.  Put all constant data into the @code{.const}
14162 section.
14163 @end table
14165 @node CRIS Options
14166 @subsection CRIS Options
14167 @cindex CRIS Options
14169 These options are defined specifically for the CRIS ports.
14171 @table @gcctabopt
14172 @item -march=@var{architecture-type}
14173 @itemx -mcpu=@var{architecture-type}
14174 @opindex march
14175 @opindex mcpu
14176 Generate code for the specified architecture.  The choices for
14177 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
14178 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
14179 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
14180 @samp{v10}.
14182 @item -mtune=@var{architecture-type}
14183 @opindex mtune
14184 Tune to @var{architecture-type} everything applicable about the generated
14185 code, except for the ABI and the set of available instructions.  The
14186 choices for @var{architecture-type} are the same as for
14187 @option{-march=@var{architecture-type}}.
14189 @item -mmax-stack-frame=@var{n}
14190 @opindex mmax-stack-frame
14191 Warn when the stack frame of a function exceeds @var{n} bytes.
14193 @item -metrax4
14194 @itemx -metrax100
14195 @opindex metrax4
14196 @opindex metrax100
14197 The options @option{-metrax4} and @option{-metrax100} are synonyms for
14198 @option{-march=v3} and @option{-march=v8} respectively.
14200 @item -mmul-bug-workaround
14201 @itemx -mno-mul-bug-workaround
14202 @opindex mmul-bug-workaround
14203 @opindex mno-mul-bug-workaround
14204 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
14205 models where it applies.  This option is active by default.
14207 @item -mpdebug
14208 @opindex mpdebug
14209 Enable CRIS-specific verbose debug-related information in the assembly
14210 code.  This option also has the effect of turning off the @samp{#NO_APP}
14211 formatted-code indicator to the assembler at the beginning of the
14212 assembly file.
14214 @item -mcc-init
14215 @opindex mcc-init
14216 Do not use condition-code results from previous instruction; always emit
14217 compare and test instructions before use of condition codes.
14219 @item -mno-side-effects
14220 @opindex mno-side-effects
14221 Do not emit instructions with side effects in addressing modes other than
14222 post-increment.
14224 @item -mstack-align
14225 @itemx -mno-stack-align
14226 @itemx -mdata-align
14227 @itemx -mno-data-align
14228 @itemx -mconst-align
14229 @itemx -mno-const-align
14230 @opindex mstack-align
14231 @opindex mno-stack-align
14232 @opindex mdata-align
14233 @opindex mno-data-align
14234 @opindex mconst-align
14235 @opindex mno-const-align
14236 These options (@samp{no-} options) arrange (eliminate arrangements) for the
14237 stack frame, individual data and constants to be aligned for the maximum
14238 single data access size for the chosen CPU model.  The default is to
14239 arrange for 32-bit alignment.  ABI details such as structure layout are
14240 not affected by these options.
14242 @item -m32-bit
14243 @itemx -m16-bit
14244 @itemx -m8-bit
14245 @opindex m32-bit
14246 @opindex m16-bit
14247 @opindex m8-bit
14248 Similar to the stack- data- and const-align options above, these options
14249 arrange for stack frame, writable data and constants to all be 32-bit,
14250 16-bit or 8-bit aligned.  The default is 32-bit alignment.
14252 @item -mno-prologue-epilogue
14253 @itemx -mprologue-epilogue
14254 @opindex mno-prologue-epilogue
14255 @opindex mprologue-epilogue
14256 With @option{-mno-prologue-epilogue}, the normal function prologue and
14257 epilogue which set up the stack frame are omitted and no return
14258 instructions or return sequences are generated in the code.  Use this
14259 option only together with visual inspection of the compiled code: no
14260 warnings or errors are generated when call-saved registers must be saved,
14261 or storage for local variables needs to be allocated.
14263 @item -mno-gotplt
14264 @itemx -mgotplt
14265 @opindex mno-gotplt
14266 @opindex mgotplt
14267 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
14268 instruction sequences that load addresses for functions from the PLT part
14269 of the GOT rather than (traditional on other architectures) calls to the
14270 PLT@.  The default is @option{-mgotplt}.
14272 @item -melf
14273 @opindex melf
14274 Legacy no-op option only recognized with the cris-axis-elf and
14275 cris-axis-linux-gnu targets.
14277 @item -mlinux
14278 @opindex mlinux
14279 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
14281 @item -sim
14282 @opindex sim
14283 This option, recognized for the cris-axis-elf, arranges
14284 to link with input-output functions from a simulator library.  Code,
14285 initialized data and zero-initialized data are allocated consecutively.
14287 @item -sim2
14288 @opindex sim2
14289 Like @option{-sim}, but pass linker options to locate initialized data at
14290 0x40000000 and zero-initialized data at 0x80000000.
14291 @end table
14293 @node CR16 Options
14294 @subsection CR16 Options
14295 @cindex CR16 Options
14297 These options are defined specifically for the CR16 ports.
14299 @table @gcctabopt
14301 @item -mmac
14302 @opindex mmac
14303 Enable the use of multiply-accumulate instructions. Disabled by default.
14305 @item -mcr16cplus
14306 @itemx -mcr16c
14307 @opindex mcr16cplus
14308 @opindex mcr16c
14309 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
14310 is default.
14312 @item -msim
14313 @opindex msim
14314 Links the library libsim.a which is in compatible with simulator. Applicable
14315 to ELF compiler only.
14317 @item -mint32
14318 @opindex mint32
14319 Choose integer type as 32-bit wide.
14321 @item -mbit-ops
14322 @opindex mbit-ops
14323 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
14325 @item -mdata-model=@var{model}
14326 @opindex mdata-model
14327 Choose a data model. The choices for @var{model} are @samp{near},
14328 @samp{far} or @samp{medium}. @samp{medium} is default.
14329 However, @samp{far} is not valid with @option{-mcr16c}, as the
14330 CR16C architecture does not support the far data model.
14331 @end table
14333 @node Darwin Options
14334 @subsection Darwin Options
14335 @cindex Darwin options
14337 These options are defined for all architectures running the Darwin operating
14338 system.
14340 FSF GCC on Darwin does not create ``fat'' object files; it creates
14341 an object file for the single architecture that GCC was built to
14342 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
14343 @option{-arch} options are used; it does so by running the compiler or
14344 linker multiple times and joining the results together with
14345 @file{lipo}.
14347 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
14348 @samp{i686}) is determined by the flags that specify the ISA
14349 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
14350 @option{-force_cpusubtype_ALL} option can be used to override this.
14352 The Darwin tools vary in their behavior when presented with an ISA
14353 mismatch.  The assembler, @file{as}, only permits instructions to
14354 be used that are valid for the subtype of the file it is generating,
14355 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
14356 The linker for shared libraries, @file{/usr/bin/libtool}, fails
14357 and prints an error if asked to create a shared library with a less
14358 restrictive subtype than its input files (for instance, trying to put
14359 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
14360 for executables, @command{ld}, quietly gives the executable the most
14361 restrictive subtype of any of its input files.
14363 @table @gcctabopt
14364 @item -F@var{dir}
14365 @opindex F
14366 Add the framework directory @var{dir} to the head of the list of
14367 directories to be searched for header files.  These directories are
14368 interleaved with those specified by @option{-I} options and are
14369 scanned in a left-to-right order.
14371 A framework directory is a directory with frameworks in it.  A
14372 framework is a directory with a @file{Headers} and/or
14373 @file{PrivateHeaders} directory contained directly in it that ends
14374 in @file{.framework}.  The name of a framework is the name of this
14375 directory excluding the @file{.framework}.  Headers associated with
14376 the framework are found in one of those two directories, with
14377 @file{Headers} being searched first.  A subframework is a framework
14378 directory that is in a framework's @file{Frameworks} directory.
14379 Includes of subframework headers can only appear in a header of a
14380 framework that contains the subframework, or in a sibling subframework
14381 header.  Two subframeworks are siblings if they occur in the same
14382 framework.  A subframework should not have the same name as a
14383 framework; a warning is issued if this is violated.  Currently a
14384 subframework cannot have subframeworks; in the future, the mechanism
14385 may be extended to support this.  The standard frameworks can be found
14386 in @file{/System/Library/Frameworks} and
14387 @file{/Library/Frameworks}.  An example include looks like
14388 @code{#include <Framework/header.h>}, where @file{Framework} denotes
14389 the name of the framework and @file{header.h} is found in the
14390 @file{PrivateHeaders} or @file{Headers} directory.
14392 @item -iframework@var{dir}
14393 @opindex iframework
14394 Like @option{-F} except the directory is a treated as a system
14395 directory.  The main difference between this @option{-iframework} and
14396 @option{-F} is that with @option{-iframework} the compiler does not
14397 warn about constructs contained within header files found via
14398 @var{dir}.  This option is valid only for the C family of languages.
14400 @item -gused
14401 @opindex gused
14402 Emit debugging information for symbols that are used.  For stabs
14403 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
14404 This is by default ON@.
14406 @item -gfull
14407 @opindex gfull
14408 Emit debugging information for all symbols and types.
14410 @item -mmacosx-version-min=@var{version}
14411 The earliest version of MacOS X that this executable will run on
14412 is @var{version}.  Typical values of @var{version} include @code{10.1},
14413 @code{10.2}, and @code{10.3.9}.
14415 If the compiler was built to use the system's headers by default,
14416 then the default for this option is the system version on which the
14417 compiler is running, otherwise the default is to make choices that
14418 are compatible with as many systems and code bases as possible.
14420 @item -mkernel
14421 @opindex mkernel
14422 Enable kernel development mode.  The @option{-mkernel} option sets
14423 @option{-static}, @option{-fno-common}, @option{-fno-use-cxa-atexit},
14424 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
14425 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
14426 applicable.  This mode also sets @option{-mno-altivec},
14427 @option{-msoft-float}, @option{-fno-builtin} and
14428 @option{-mlong-branch} for PowerPC targets.
14430 @item -mone-byte-bool
14431 @opindex mone-byte-bool
14432 Override the defaults for @code{bool} so that @code{sizeof(bool)==1}.
14433 By default @code{sizeof(bool)} is @code{4} when compiling for
14434 Darwin/PowerPC and @code{1} when compiling for Darwin/x86, so this
14435 option has no effect on x86.
14437 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
14438 to generate code that is not binary compatible with code generated
14439 without that switch.  Using this switch may require recompiling all
14440 other modules in a program, including system libraries.  Use this
14441 switch to conform to a non-default data model.
14443 @item -mfix-and-continue
14444 @itemx -ffix-and-continue
14445 @itemx -findirect-data
14446 @opindex mfix-and-continue
14447 @opindex ffix-and-continue
14448 @opindex findirect-data
14449 Generate code suitable for fast turnaround development, such as to
14450 allow GDB to dynamically load @file{.o} files into already-running
14451 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
14452 are provided for backwards compatibility.
14454 @item -all_load
14455 @opindex all_load
14456 Loads all members of static archive libraries.
14457 See man ld(1) for more information.
14459 @item -arch_errors_fatal
14460 @opindex arch_errors_fatal
14461 Cause the errors having to do with files that have the wrong architecture
14462 to be fatal.
14464 @item -bind_at_load
14465 @opindex bind_at_load
14466 Causes the output file to be marked such that the dynamic linker will
14467 bind all undefined references when the file is loaded or launched.
14469 @item -bundle
14470 @opindex bundle
14471 Produce a Mach-o bundle format file.
14472 See man ld(1) for more information.
14474 @item -bundle_loader @var{executable}
14475 @opindex bundle_loader
14476 This option specifies the @var{executable} that will load the build
14477 output file being linked.  See man ld(1) for more information.
14479 @item -dynamiclib
14480 @opindex dynamiclib
14481 When passed this option, GCC produces a dynamic library instead of
14482 an executable when linking, using the Darwin @file{libtool} command.
14484 @item -force_cpusubtype_ALL
14485 @opindex force_cpusubtype_ALL
14486 This causes GCC's output file to have the @samp{ALL} subtype, instead of
14487 one controlled by the @option{-mcpu} or @option{-march} option.
14489 @item -allowable_client  @var{client_name}
14490 @itemx -client_name
14491 @itemx -compatibility_version
14492 @itemx -current_version
14493 @itemx -dead_strip
14494 @itemx -dependency-file
14495 @itemx -dylib_file
14496 @itemx -dylinker_install_name
14497 @itemx -dynamic
14498 @itemx -exported_symbols_list
14499 @itemx -filelist
14500 @need 800
14501 @itemx -flat_namespace
14502 @itemx -force_flat_namespace
14503 @itemx -headerpad_max_install_names
14504 @itemx -image_base
14505 @itemx -init
14506 @itemx -install_name
14507 @itemx -keep_private_externs
14508 @itemx -multi_module
14509 @itemx -multiply_defined
14510 @itemx -multiply_defined_unused
14511 @need 800
14512 @itemx -noall_load
14513 @itemx -no_dead_strip_inits_and_terms
14514 @itemx -nofixprebinding
14515 @itemx -nomultidefs
14516 @itemx -noprebind
14517 @itemx -noseglinkedit
14518 @itemx -pagezero_size
14519 @itemx -prebind
14520 @itemx -prebind_all_twolevel_modules
14521 @itemx -private_bundle
14522 @need 800
14523 @itemx -read_only_relocs
14524 @itemx -sectalign
14525 @itemx -sectobjectsymbols
14526 @itemx -whyload
14527 @itemx -seg1addr
14528 @itemx -sectcreate
14529 @itemx -sectobjectsymbols
14530 @itemx -sectorder
14531 @itemx -segaddr
14532 @itemx -segs_read_only_addr
14533 @need 800
14534 @itemx -segs_read_write_addr
14535 @itemx -seg_addr_table
14536 @itemx -seg_addr_table_filename
14537 @itemx -seglinkedit
14538 @itemx -segprot
14539 @itemx -segs_read_only_addr
14540 @itemx -segs_read_write_addr
14541 @itemx -single_module
14542 @itemx -static
14543 @itemx -sub_library
14544 @need 800
14545 @itemx -sub_umbrella
14546 @itemx -twolevel_namespace
14547 @itemx -umbrella
14548 @itemx -undefined
14549 @itemx -unexported_symbols_list
14550 @itemx -weak_reference_mismatches
14551 @itemx -whatsloaded
14552 @opindex allowable_client
14553 @opindex client_name
14554 @opindex compatibility_version
14555 @opindex current_version
14556 @opindex dead_strip
14557 @opindex dependency-file
14558 @opindex dylib_file
14559 @opindex dylinker_install_name
14560 @opindex dynamic
14561 @opindex exported_symbols_list
14562 @opindex filelist
14563 @opindex flat_namespace
14564 @opindex force_flat_namespace
14565 @opindex headerpad_max_install_names
14566 @opindex image_base
14567 @opindex init
14568 @opindex install_name
14569 @opindex keep_private_externs
14570 @opindex multi_module
14571 @opindex multiply_defined
14572 @opindex multiply_defined_unused
14573 @opindex noall_load
14574 @opindex no_dead_strip_inits_and_terms
14575 @opindex nofixprebinding
14576 @opindex nomultidefs
14577 @opindex noprebind
14578 @opindex noseglinkedit
14579 @opindex pagezero_size
14580 @opindex prebind
14581 @opindex prebind_all_twolevel_modules
14582 @opindex private_bundle
14583 @opindex read_only_relocs
14584 @opindex sectalign
14585 @opindex sectobjectsymbols
14586 @opindex whyload
14587 @opindex seg1addr
14588 @opindex sectcreate
14589 @opindex sectobjectsymbols
14590 @opindex sectorder
14591 @opindex segaddr
14592 @opindex segs_read_only_addr
14593 @opindex segs_read_write_addr
14594 @opindex seg_addr_table
14595 @opindex seg_addr_table_filename
14596 @opindex seglinkedit
14597 @opindex segprot
14598 @opindex segs_read_only_addr
14599 @opindex segs_read_write_addr
14600 @opindex single_module
14601 @opindex static
14602 @opindex sub_library
14603 @opindex sub_umbrella
14604 @opindex twolevel_namespace
14605 @opindex umbrella
14606 @opindex undefined
14607 @opindex unexported_symbols_list
14608 @opindex weak_reference_mismatches
14609 @opindex whatsloaded
14610 These options are passed to the Darwin linker.  The Darwin linker man page
14611 describes them in detail.
14612 @end table
14614 @node DEC Alpha Options
14615 @subsection DEC Alpha Options
14617 These @samp{-m} options are defined for the DEC Alpha implementations:
14619 @table @gcctabopt
14620 @item -mno-soft-float
14621 @itemx -msoft-float
14622 @opindex mno-soft-float
14623 @opindex msoft-float
14624 Use (do not use) the hardware floating-point instructions for
14625 floating-point operations.  When @option{-msoft-float} is specified,
14626 functions in @file{libgcc.a} are used to perform floating-point
14627 operations.  Unless they are replaced by routines that emulate the
14628 floating-point operations, or compiled in such a way as to call such
14629 emulations routines, these routines issue floating-point
14630 operations.   If you are compiling for an Alpha without floating-point
14631 operations, you must ensure that the library is built so as not to call
14632 them.
14634 Note that Alpha implementations without floating-point operations are
14635 required to have floating-point registers.
14637 @item -mfp-reg
14638 @itemx -mno-fp-regs
14639 @opindex mfp-reg
14640 @opindex mno-fp-regs
14641 Generate code that uses (does not use) the floating-point register set.
14642 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
14643 register set is not used, floating-point operands are passed in integer
14644 registers as if they were integers and floating-point results are passed
14645 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
14646 so any function with a floating-point argument or return value called by code
14647 compiled with @option{-mno-fp-regs} must also be compiled with that
14648 option.
14650 A typical use of this option is building a kernel that does not use,
14651 and hence need not save and restore, any floating-point registers.
14653 @item -mieee
14654 @opindex mieee
14655 The Alpha architecture implements floating-point hardware optimized for
14656 maximum performance.  It is mostly compliant with the IEEE floating-point
14657 standard.  However, for full compliance, software assistance is
14658 required.  This option generates code fully IEEE-compliant code
14659 @emph{except} that the @var{inexact-flag} is not maintained (see below).
14660 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
14661 defined during compilation.  The resulting code is less efficient but is
14662 able to correctly support denormalized numbers and exceptional IEEE
14663 values such as not-a-number and plus/minus infinity.  Other Alpha
14664 compilers call this option @option{-ieee_with_no_inexact}.
14666 @item -mieee-with-inexact
14667 @opindex mieee-with-inexact
14668 This is like @option{-mieee} except the generated code also maintains
14669 the IEEE @var{inexact-flag}.  Turning on this option causes the
14670 generated code to implement fully-compliant IEEE math.  In addition to
14671 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
14672 macro.  On some Alpha implementations the resulting code may execute
14673 significantly slower than the code generated by default.  Since there is
14674 very little code that depends on the @var{inexact-flag}, you should
14675 normally not specify this option.  Other Alpha compilers call this
14676 option @option{-ieee_with_inexact}.
14678 @item -mfp-trap-mode=@var{trap-mode}
14679 @opindex mfp-trap-mode
14680 This option controls what floating-point related traps are enabled.
14681 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
14682 The trap mode can be set to one of four values:
14684 @table @samp
14685 @item n
14686 This is the default (normal) setting.  The only traps that are enabled
14687 are the ones that cannot be disabled in software (e.g., division by zero
14688 trap).
14690 @item u
14691 In addition to the traps enabled by @samp{n}, underflow traps are enabled
14692 as well.
14694 @item su
14695 Like @samp{u}, but the instructions are marked to be safe for software
14696 completion (see Alpha architecture manual for details).
14698 @item sui
14699 Like @samp{su}, but inexact traps are enabled as well.
14700 @end table
14702 @item -mfp-rounding-mode=@var{rounding-mode}
14703 @opindex mfp-rounding-mode
14704 Selects the IEEE rounding mode.  Other Alpha compilers call this option
14705 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
14708 @table @samp
14709 @item n
14710 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
14711 the nearest machine number or towards the even machine number in case
14712 of a tie.
14714 @item m
14715 Round towards minus infinity.
14717 @item c
14718 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
14720 @item d
14721 Dynamic rounding mode.  A field in the floating-point control register
14722 (@var{fpcr}, see Alpha architecture reference manual) controls the
14723 rounding mode in effect.  The C library initializes this register for
14724 rounding towards plus infinity.  Thus, unless your program modifies the
14725 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
14726 @end table
14728 @item -mtrap-precision=@var{trap-precision}
14729 @opindex mtrap-precision
14730 In the Alpha architecture, floating-point traps are imprecise.  This
14731 means without software assistance it is impossible to recover from a
14732 floating trap and program execution normally needs to be terminated.
14733 GCC can generate code that can assist operating system trap handlers
14734 in determining the exact location that caused a floating-point trap.
14735 Depending on the requirements of an application, different levels of
14736 precisions can be selected:
14738 @table @samp
14739 @item p
14740 Program precision.  This option is the default and means a trap handler
14741 can only identify which program caused a floating-point exception.
14743 @item f
14744 Function precision.  The trap handler can determine the function that
14745 caused a floating-point exception.
14747 @item i
14748 Instruction precision.  The trap handler can determine the exact
14749 instruction that caused a floating-point exception.
14750 @end table
14752 Other Alpha compilers provide the equivalent options called
14753 @option{-scope_safe} and @option{-resumption_safe}.
14755 @item -mieee-conformant
14756 @opindex mieee-conformant
14757 This option marks the generated code as IEEE conformant.  You must not
14758 use this option unless you also specify @option{-mtrap-precision=i} and either
14759 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
14760 is to emit the line @samp{.eflag 48} in the function prologue of the
14761 generated assembly file.
14763 @item -mbuild-constants
14764 @opindex mbuild-constants
14765 Normally GCC examines a 32- or 64-bit integer constant to
14766 see if it can construct it from smaller constants in two or three
14767 instructions.  If it cannot, it outputs the constant as a literal and
14768 generates code to load it from the data segment at run time.
14770 Use this option to require GCC to construct @emph{all} integer constants
14771 using code, even if it takes more instructions (the maximum is six).
14773 You typically use this option to build a shared library dynamic
14774 loader.  Itself a shared library, it must relocate itself in memory
14775 before it can find the variables and constants in its own data segment.
14777 @item -mbwx
14778 @itemx -mno-bwx
14779 @itemx -mcix
14780 @itemx -mno-cix
14781 @itemx -mfix
14782 @itemx -mno-fix
14783 @itemx -mmax
14784 @itemx -mno-max
14785 @opindex mbwx
14786 @opindex mno-bwx
14787 @opindex mcix
14788 @opindex mno-cix
14789 @opindex mfix
14790 @opindex mno-fix
14791 @opindex mmax
14792 @opindex mno-max
14793 Indicate whether GCC should generate code to use the optional BWX,
14794 CIX, FIX and MAX instruction sets.  The default is to use the instruction
14795 sets supported by the CPU type specified via @option{-mcpu=} option or that
14796 of the CPU on which GCC was built if none is specified.
14798 @item -mfloat-vax
14799 @itemx -mfloat-ieee
14800 @opindex mfloat-vax
14801 @opindex mfloat-ieee
14802 Generate code that uses (does not use) VAX F and G floating-point
14803 arithmetic instead of IEEE single and double precision.
14805 @item -mexplicit-relocs
14806 @itemx -mno-explicit-relocs
14807 @opindex mexplicit-relocs
14808 @opindex mno-explicit-relocs
14809 Older Alpha assemblers provided no way to generate symbol relocations
14810 except via assembler macros.  Use of these macros does not allow
14811 optimal instruction scheduling.  GNU binutils as of version 2.12
14812 supports a new syntax that allows the compiler to explicitly mark
14813 which relocations should apply to which instructions.  This option
14814 is mostly useful for debugging, as GCC detects the capabilities of
14815 the assembler when it is built and sets the default accordingly.
14817 @item -msmall-data
14818 @itemx -mlarge-data
14819 @opindex msmall-data
14820 @opindex mlarge-data
14821 When @option{-mexplicit-relocs} is in effect, static data is
14822 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
14823 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
14824 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
14825 16-bit relocations off of the @code{$gp} register.  This limits the
14826 size of the small data area to 64KB, but allows the variables to be
14827 directly accessed via a single instruction.
14829 The default is @option{-mlarge-data}.  With this option the data area
14830 is limited to just below 2GB@.  Programs that require more than 2GB of
14831 data must use @code{malloc} or @code{mmap} to allocate the data in the
14832 heap instead of in the program's data segment.
14834 When generating code for shared libraries, @option{-fpic} implies
14835 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
14837 @item -msmall-text
14838 @itemx -mlarge-text
14839 @opindex msmall-text
14840 @opindex mlarge-text
14841 When @option{-msmall-text} is used, the compiler assumes that the
14842 code of the entire program (or shared library) fits in 4MB, and is
14843 thus reachable with a branch instruction.  When @option{-msmall-data}
14844 is used, the compiler can assume that all local symbols share the
14845 same @code{$gp} value, and thus reduce the number of instructions
14846 required for a function call from 4 to 1.
14848 The default is @option{-mlarge-text}.
14850 @item -mcpu=@var{cpu_type}
14851 @opindex mcpu
14852 Set the instruction set and instruction scheduling parameters for
14853 machine type @var{cpu_type}.  You can specify either the @samp{EV}
14854 style name or the corresponding chip number.  GCC supports scheduling
14855 parameters for the EV4, EV5 and EV6 family of processors and
14856 chooses the default values for the instruction set from the processor
14857 you specify.  If you do not specify a processor type, GCC defaults
14858 to the processor on which the compiler was built.
14860 Supported values for @var{cpu_type} are
14862 @table @samp
14863 @item ev4
14864 @itemx ev45
14865 @itemx 21064
14866 Schedules as an EV4 and has no instruction set extensions.
14868 @item ev5
14869 @itemx 21164
14870 Schedules as an EV5 and has no instruction set extensions.
14872 @item ev56
14873 @itemx 21164a
14874 Schedules as an EV5 and supports the BWX extension.
14876 @item pca56
14877 @itemx 21164pc
14878 @itemx 21164PC
14879 Schedules as an EV5 and supports the BWX and MAX extensions.
14881 @item ev6
14882 @itemx 21264
14883 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
14885 @item ev67
14886 @itemx 21264a
14887 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
14888 @end table
14890 Native toolchains also support the value @samp{native},
14891 which selects the best architecture option for the host processor.
14892 @option{-mcpu=native} has no effect if GCC does not recognize
14893 the processor.
14895 @item -mtune=@var{cpu_type}
14896 @opindex mtune
14897 Set only the instruction scheduling parameters for machine type
14898 @var{cpu_type}.  The instruction set is not changed.
14900 Native toolchains also support the value @samp{native},
14901 which selects the best architecture option for the host processor.
14902 @option{-mtune=native} has no effect if GCC does not recognize
14903 the processor.
14905 @item -mmemory-latency=@var{time}
14906 @opindex mmemory-latency
14907 Sets the latency the scheduler should assume for typical memory
14908 references as seen by the application.  This number is highly
14909 dependent on the memory access patterns used by the application
14910 and the size of the external cache on the machine.
14912 Valid options for @var{time} are
14914 @table @samp
14915 @item @var{number}
14916 A decimal number representing clock cycles.
14918 @item L1
14919 @itemx L2
14920 @itemx L3
14921 @itemx main
14922 The compiler contains estimates of the number of clock cycles for
14923 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
14924 (also called Dcache, Scache, and Bcache), as well as to main memory.
14925 Note that L3 is only valid for EV5.
14927 @end table
14928 @end table
14930 @node FR30 Options
14931 @subsection FR30 Options
14932 @cindex FR30 Options
14934 These options are defined specifically for the FR30 port.
14936 @table @gcctabopt
14938 @item -msmall-model
14939 @opindex msmall-model
14940 Use the small address space model.  This can produce smaller code, but
14941 it does assume that all symbolic values and addresses fit into a
14942 20-bit range.
14944 @item -mno-lsim
14945 @opindex mno-lsim
14946 Assume that runtime support has been provided and so there is no need
14947 to include the simulator library (@file{libsim.a}) on the linker
14948 command line.
14950 @end table
14952 @node FRV Options
14953 @subsection FRV Options
14954 @cindex FRV Options
14956 @table @gcctabopt
14957 @item -mgpr-32
14958 @opindex mgpr-32
14960 Only use the first 32 general-purpose registers.
14962 @item -mgpr-64
14963 @opindex mgpr-64
14965 Use all 64 general-purpose registers.
14967 @item -mfpr-32
14968 @opindex mfpr-32
14970 Use only the first 32 floating-point registers.
14972 @item -mfpr-64
14973 @opindex mfpr-64
14975 Use all 64 floating-point registers.
14977 @item -mhard-float
14978 @opindex mhard-float
14980 Use hardware instructions for floating-point operations.
14982 @item -msoft-float
14983 @opindex msoft-float
14985 Use library routines for floating-point operations.
14987 @item -malloc-cc
14988 @opindex malloc-cc
14990 Dynamically allocate condition code registers.
14992 @item -mfixed-cc
14993 @opindex mfixed-cc
14995 Do not try to dynamically allocate condition code registers, only
14996 use @code{icc0} and @code{fcc0}.
14998 @item -mdword
14999 @opindex mdword
15001 Change ABI to use double word insns.
15003 @item -mno-dword
15004 @opindex mno-dword
15006 Do not use double word instructions.
15008 @item -mdouble
15009 @opindex mdouble
15011 Use floating-point double instructions.
15013 @item -mno-double
15014 @opindex mno-double
15016 Do not use floating-point double instructions.
15018 @item -mmedia
15019 @opindex mmedia
15021 Use media instructions.
15023 @item -mno-media
15024 @opindex mno-media
15026 Do not use media instructions.
15028 @item -mmuladd
15029 @opindex mmuladd
15031 Use multiply and add/subtract instructions.
15033 @item -mno-muladd
15034 @opindex mno-muladd
15036 Do not use multiply and add/subtract instructions.
15038 @item -mfdpic
15039 @opindex mfdpic
15041 Select the FDPIC ABI, which uses function descriptors to represent
15042 pointers to functions.  Without any PIC/PIE-related options, it
15043 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
15044 assumes GOT entries and small data are within a 12-bit range from the
15045 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
15046 are computed with 32 bits.
15047 With a @samp{bfin-elf} target, this option implies @option{-msim}.
15049 @item -minline-plt
15050 @opindex minline-plt
15052 Enable inlining of PLT entries in function calls to functions that are
15053 not known to bind locally.  It has no effect without @option{-mfdpic}.
15054 It's enabled by default if optimizing for speed and compiling for
15055 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
15056 optimization option such as @option{-O3} or above is present in the
15057 command line.
15059 @item -mTLS
15060 @opindex mTLS
15062 Assume a large TLS segment when generating thread-local code.
15064 @item -mtls
15065 @opindex mtls
15067 Do not assume a large TLS segment when generating thread-local code.
15069 @item -mgprel-ro
15070 @opindex mgprel-ro
15072 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
15073 that is known to be in read-only sections.  It's enabled by default,
15074 except for @option{-fpic} or @option{-fpie}: even though it may help
15075 make the global offset table smaller, it trades 1 instruction for 4.
15076 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
15077 one of which may be shared by multiple symbols, and it avoids the need
15078 for a GOT entry for the referenced symbol, so it's more likely to be a
15079 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
15081 @item -multilib-library-pic
15082 @opindex multilib-library-pic
15084 Link with the (library, not FD) pic libraries.  It's implied by
15085 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
15086 @option{-fpic} without @option{-mfdpic}.  You should never have to use
15087 it explicitly.
15089 @item -mlinked-fp
15090 @opindex mlinked-fp
15092 Follow the EABI requirement of always creating a frame pointer whenever
15093 a stack frame is allocated.  This option is enabled by default and can
15094 be disabled with @option{-mno-linked-fp}.
15096 @item -mlong-calls
15097 @opindex mlong-calls
15099 Use indirect addressing to call functions outside the current
15100 compilation unit.  This allows the functions to be placed anywhere
15101 within the 32-bit address space.
15103 @item -malign-labels
15104 @opindex malign-labels
15106 Try to align labels to an 8-byte boundary by inserting NOPs into the
15107 previous packet.  This option only has an effect when VLIW packing
15108 is enabled.  It doesn't create new packets; it merely adds NOPs to
15109 existing ones.
15111 @item -mlibrary-pic
15112 @opindex mlibrary-pic
15114 Generate position-independent EABI code.
15116 @item -macc-4
15117 @opindex macc-4
15119 Use only the first four media accumulator registers.
15121 @item -macc-8
15122 @opindex macc-8
15124 Use all eight media accumulator registers.
15126 @item -mpack
15127 @opindex mpack
15129 Pack VLIW instructions.
15131 @item -mno-pack
15132 @opindex mno-pack
15134 Do not pack VLIW instructions.
15136 @item -mno-eflags
15137 @opindex mno-eflags
15139 Do not mark ABI switches in e_flags.
15141 @item -mcond-move
15142 @opindex mcond-move
15144 Enable the use of conditional-move instructions (default).
15146 This switch is mainly for debugging the compiler and will likely be removed
15147 in a future version.
15149 @item -mno-cond-move
15150 @opindex mno-cond-move
15152 Disable the use of conditional-move instructions.
15154 This switch is mainly for debugging the compiler and will likely be removed
15155 in a future version.
15157 @item -mscc
15158 @opindex mscc
15160 Enable the use of conditional set instructions (default).
15162 This switch is mainly for debugging the compiler and will likely be removed
15163 in a future version.
15165 @item -mno-scc
15166 @opindex mno-scc
15168 Disable the use of conditional set instructions.
15170 This switch is mainly for debugging the compiler and will likely be removed
15171 in a future version.
15173 @item -mcond-exec
15174 @opindex mcond-exec
15176 Enable the use of conditional execution (default).
15178 This switch is mainly for debugging the compiler and will likely be removed
15179 in a future version.
15181 @item -mno-cond-exec
15182 @opindex mno-cond-exec
15184 Disable the use of conditional execution.
15186 This switch is mainly for debugging the compiler and will likely be removed
15187 in a future version.
15189 @item -mvliw-branch
15190 @opindex mvliw-branch
15192 Run a pass to pack branches into VLIW instructions (default).
15194 This switch is mainly for debugging the compiler and will likely be removed
15195 in a future version.
15197 @item -mno-vliw-branch
15198 @opindex mno-vliw-branch
15200 Do not run a pass to pack branches into VLIW instructions.
15202 This switch is mainly for debugging the compiler and will likely be removed
15203 in a future version.
15205 @item -mmulti-cond-exec
15206 @opindex mmulti-cond-exec
15208 Enable optimization of @code{&&} and @code{||} in conditional execution
15209 (default).
15211 This switch is mainly for debugging the compiler and will likely be removed
15212 in a future version.
15214 @item -mno-multi-cond-exec
15215 @opindex mno-multi-cond-exec
15217 Disable optimization of @code{&&} and @code{||} in conditional execution.
15219 This switch is mainly for debugging the compiler and will likely be removed
15220 in a future version.
15222 @item -mnested-cond-exec
15223 @opindex mnested-cond-exec
15225 Enable nested conditional execution optimizations (default).
15227 This switch is mainly for debugging the compiler and will likely be removed
15228 in a future version.
15230 @item -mno-nested-cond-exec
15231 @opindex mno-nested-cond-exec
15233 Disable nested conditional execution optimizations.
15235 This switch is mainly for debugging the compiler and will likely be removed
15236 in a future version.
15238 @item -moptimize-membar
15239 @opindex moptimize-membar
15241 This switch removes redundant @code{membar} instructions from the
15242 compiler-generated code.  It is enabled by default.
15244 @item -mno-optimize-membar
15245 @opindex mno-optimize-membar
15247 This switch disables the automatic removal of redundant @code{membar}
15248 instructions from the generated code.
15250 @item -mtomcat-stats
15251 @opindex mtomcat-stats
15253 Cause gas to print out tomcat statistics.
15255 @item -mcpu=@var{cpu}
15256 @opindex mcpu
15258 Select the processor type for which to generate code.  Possible values are
15259 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
15260 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
15262 @end table
15264 @node GNU/Linux Options
15265 @subsection GNU/Linux Options
15267 These @samp{-m} options are defined for GNU/Linux targets:
15269 @table @gcctabopt
15270 @item -mglibc
15271 @opindex mglibc
15272 Use the GNU C library.  This is the default except
15273 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
15275 @item -muclibc
15276 @opindex muclibc
15277 Use uClibc C library.  This is the default on
15278 @samp{*-*-linux-*uclibc*} targets.
15280 @item -mbionic
15281 @opindex mbionic
15282 Use Bionic C library.  This is the default on
15283 @samp{*-*-linux-*android*} targets.
15285 @item -mandroid
15286 @opindex mandroid
15287 Compile code compatible with Android platform.  This is the default on
15288 @samp{*-*-linux-*android*} targets.
15290 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
15291 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
15292 this option makes the GCC driver pass Android-specific options to the linker.
15293 Finally, this option causes the preprocessor macro @code{__ANDROID__}
15294 to be defined.
15296 @item -tno-android-cc
15297 @opindex tno-android-cc
15298 Disable compilation effects of @option{-mandroid}, i.e., do not enable
15299 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
15300 @option{-fno-rtti} by default.
15302 @item -tno-android-ld
15303 @opindex tno-android-ld
15304 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
15305 linking options to the linker.
15307 @end table
15309 @node H8/300 Options
15310 @subsection H8/300 Options
15312 These @samp{-m} options are defined for the H8/300 implementations:
15314 @table @gcctabopt
15315 @item -mrelax
15316 @opindex mrelax
15317 Shorten some address references at link time, when possible; uses the
15318 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
15319 ld, Using ld}, for a fuller description.
15321 @item -mh
15322 @opindex mh
15323 Generate code for the H8/300H@.
15325 @item -ms
15326 @opindex ms
15327 Generate code for the H8S@.
15329 @item -mn
15330 @opindex mn
15331 Generate code for the H8S and H8/300H in the normal mode.  This switch
15332 must be used either with @option{-mh} or @option{-ms}.
15334 @item -ms2600
15335 @opindex ms2600
15336 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
15338 @item -mexr
15339 @opindex mexr
15340 Extended registers are stored on stack before execution of function
15341 with monitor attribute. Default option is @option{-mexr}.
15342 This option is valid only for H8S targets.
15344 @item -mno-exr
15345 @opindex mno-exr
15346 Extended registers are not stored on stack before execution of function 
15347 with monitor attribute. Default option is @option{-mno-exr}. 
15348 This option is valid only for H8S targets.
15350 @item -mint32
15351 @opindex mint32
15352 Make @code{int} data 32 bits by default.
15354 @item -malign-300
15355 @opindex malign-300
15356 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
15357 The default for the H8/300H and H8S is to align longs and floats on
15358 4-byte boundaries.
15359 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
15360 This option has no effect on the H8/300.
15361 @end table
15363 @node HPPA Options
15364 @subsection HPPA Options
15365 @cindex HPPA Options
15367 These @samp{-m} options are defined for the HPPA family of computers:
15369 @table @gcctabopt
15370 @item -march=@var{architecture-type}
15371 @opindex march
15372 Generate code for the specified architecture.  The choices for
15373 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
15374 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
15375 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
15376 architecture option for your machine.  Code compiled for lower numbered
15377 architectures runs on higher numbered architectures, but not the
15378 other way around.
15380 @item -mpa-risc-1-0
15381 @itemx -mpa-risc-1-1
15382 @itemx -mpa-risc-2-0
15383 @opindex mpa-risc-1-0
15384 @opindex mpa-risc-1-1
15385 @opindex mpa-risc-2-0
15386 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
15388 @item -mjump-in-delay
15389 @opindex mjump-in-delay
15390 This option is ignored and provided for compatibility purposes only.
15392 @item -mdisable-fpregs
15393 @opindex mdisable-fpregs
15394 Prevent floating-point registers from being used in any manner.  This is
15395 necessary for compiling kernels that perform lazy context switching of
15396 floating-point registers.  If you use this option and attempt to perform
15397 floating-point operations, the compiler aborts.
15399 @item -mdisable-indexing
15400 @opindex mdisable-indexing
15401 Prevent the compiler from using indexing address modes.  This avoids some
15402 rather obscure problems when compiling MIG generated code under MACH@.
15404 @item -mno-space-regs
15405 @opindex mno-space-regs
15406 Generate code that assumes the target has no space registers.  This allows
15407 GCC to generate faster indirect calls and use unscaled index address modes.
15409 Such code is suitable for level 0 PA systems and kernels.
15411 @item -mfast-indirect-calls
15412 @opindex mfast-indirect-calls
15413 Generate code that assumes calls never cross space boundaries.  This
15414 allows GCC to emit code that performs faster indirect calls.
15416 This option does not work in the presence of shared libraries or nested
15417 functions.
15419 @item -mfixed-range=@var{register-range}
15420 @opindex mfixed-range
15421 Generate code treating the given register range as fixed registers.
15422 A fixed register is one that the register allocator cannot use.  This is
15423 useful when compiling kernel code.  A register range is specified as
15424 two registers separated by a dash.  Multiple register ranges can be
15425 specified separated by a comma.
15427 @item -mlong-load-store
15428 @opindex mlong-load-store
15429 Generate 3-instruction load and store sequences as sometimes required by
15430 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
15431 the HP compilers.
15433 @item -mportable-runtime
15434 @opindex mportable-runtime
15435 Use the portable calling conventions proposed by HP for ELF systems.
15437 @item -mgas
15438 @opindex mgas
15439 Enable the use of assembler directives only GAS understands.
15441 @item -mschedule=@var{cpu-type}
15442 @opindex mschedule
15443 Schedule code according to the constraints for the machine type
15444 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
15445 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
15446 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
15447 proper scheduling option for your machine.  The default scheduling is
15448 @samp{8000}.
15450 @item -mlinker-opt
15451 @opindex mlinker-opt
15452 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
15453 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
15454 linkers in which they give bogus error messages when linking some programs.
15456 @item -msoft-float
15457 @opindex msoft-float
15458 Generate output containing library calls for floating point.
15459 @strong{Warning:} the requisite libraries are not available for all HPPA
15460 targets.  Normally the facilities of the machine's usual C compiler are
15461 used, but this cannot be done directly in cross-compilation.  You must make
15462 your own arrangements to provide suitable library functions for
15463 cross-compilation.
15465 @option{-msoft-float} changes the calling convention in the output file;
15466 therefore, it is only useful if you compile @emph{all} of a program with
15467 this option.  In particular, you need to compile @file{libgcc.a}, the
15468 library that comes with GCC, with @option{-msoft-float} in order for
15469 this to work.
15471 @item -msio
15472 @opindex msio
15473 Generate the predefine, @code{_SIO}, for server IO@.  The default is
15474 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
15475 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
15476 options are available under HP-UX and HI-UX@.
15478 @item -mgnu-ld
15479 @opindex mgnu-ld
15480 Use options specific to GNU @command{ld}.
15481 This passes @option{-shared} to @command{ld} when
15482 building a shared library.  It is the default when GCC is configured,
15483 explicitly or implicitly, with the GNU linker.  This option does not
15484 affect which @command{ld} is called; it only changes what parameters
15485 are passed to that @command{ld}.
15486 The @command{ld} that is called is determined by the
15487 @option{--with-ld} configure option, GCC's program search path, and
15488 finally by the user's @env{PATH}.  The linker used by GCC can be printed
15489 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
15490 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
15492 @item -mhp-ld
15493 @opindex mhp-ld
15494 Use options specific to HP @command{ld}.
15495 This passes @option{-b} to @command{ld} when building
15496 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
15497 links.  It is the default when GCC is configured, explicitly or
15498 implicitly, with the HP linker.  This option does not affect
15499 which @command{ld} is called; it only changes what parameters are passed to that
15500 @command{ld}.
15501 The @command{ld} that is called is determined by the @option{--with-ld}
15502 configure option, GCC's program search path, and finally by the user's
15503 @env{PATH}.  The linker used by GCC can be printed using @samp{which
15504 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
15505 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
15507 @item -mlong-calls
15508 @opindex mno-long-calls
15509 Generate code that uses long call sequences.  This ensures that a call
15510 is always able to reach linker generated stubs.  The default is to generate
15511 long calls only when the distance from the call site to the beginning
15512 of the function or translation unit, as the case may be, exceeds a
15513 predefined limit set by the branch type being used.  The limits for
15514 normal calls are 7,600,000 and 240,000 bytes, respectively for the
15515 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
15516 240,000 bytes.
15518 Distances are measured from the beginning of functions when using the
15519 @option{-ffunction-sections} option, or when using the @option{-mgas}
15520 and @option{-mno-portable-runtime} options together under HP-UX with
15521 the SOM linker.
15523 It is normally not desirable to use this option as it degrades
15524 performance.  However, it may be useful in large applications,
15525 particularly when partial linking is used to build the application.
15527 The types of long calls used depends on the capabilities of the
15528 assembler and linker, and the type of code being generated.  The
15529 impact on systems that support long absolute calls, and long pic
15530 symbol-difference or pc-relative calls should be relatively small.
15531 However, an indirect call is used on 32-bit ELF systems in pic code
15532 and it is quite long.
15534 @item -munix=@var{unix-std}
15535 @opindex march
15536 Generate compiler predefines and select a startfile for the specified
15537 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
15538 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
15539 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
15540 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
15541 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
15542 and later.
15544 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
15545 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
15546 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
15547 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
15548 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
15549 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
15551 It is @emph{important} to note that this option changes the interfaces
15552 for various library routines.  It also affects the operational behavior
15553 of the C library.  Thus, @emph{extreme} care is needed in using this
15554 option.
15556 Library code that is intended to operate with more than one UNIX
15557 standard must test, set and restore the variable @code{__xpg4_extended_mask}
15558 as appropriate.  Most GNU software doesn't provide this capability.
15560 @item -nolibdld
15561 @opindex nolibdld
15562 Suppress the generation of link options to search libdld.sl when the
15563 @option{-static} option is specified on HP-UX 10 and later.
15565 @item -static
15566 @opindex static
15567 The HP-UX implementation of setlocale in libc has a dependency on
15568 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
15569 when the @option{-static} option is specified, special link options
15570 are needed to resolve this dependency.
15572 On HP-UX 10 and later, the GCC driver adds the necessary options to
15573 link with libdld.sl when the @option{-static} option is specified.
15574 This causes the resulting binary to be dynamic.  On the 64-bit port,
15575 the linkers generate dynamic binaries by default in any case.  The
15576 @option{-nolibdld} option can be used to prevent the GCC driver from
15577 adding these link options.
15579 @item -threads
15580 @opindex threads
15581 Add support for multithreading with the @dfn{dce thread} library
15582 under HP-UX@.  This option sets flags for both the preprocessor and
15583 linker.
15584 @end table
15586 @node IA-64 Options
15587 @subsection IA-64 Options
15588 @cindex IA-64 Options
15590 These are the @samp{-m} options defined for the Intel IA-64 architecture.
15592 @table @gcctabopt
15593 @item -mbig-endian
15594 @opindex mbig-endian
15595 Generate code for a big-endian target.  This is the default for HP-UX@.
15597 @item -mlittle-endian
15598 @opindex mlittle-endian
15599 Generate code for a little-endian target.  This is the default for AIX5
15600 and GNU/Linux.
15602 @item -mgnu-as
15603 @itemx -mno-gnu-as
15604 @opindex mgnu-as
15605 @opindex mno-gnu-as
15606 Generate (or don't) code for the GNU assembler.  This is the default.
15607 @c Also, this is the default if the configure option @option{--with-gnu-as}
15608 @c is used.
15610 @item -mgnu-ld
15611 @itemx -mno-gnu-ld
15612 @opindex mgnu-ld
15613 @opindex mno-gnu-ld
15614 Generate (or don't) code for the GNU linker.  This is the default.
15615 @c Also, this is the default if the configure option @option{--with-gnu-ld}
15616 @c is used.
15618 @item -mno-pic
15619 @opindex mno-pic
15620 Generate code that does not use a global pointer register.  The result
15621 is not position independent code, and violates the IA-64 ABI@.
15623 @item -mvolatile-asm-stop
15624 @itemx -mno-volatile-asm-stop
15625 @opindex mvolatile-asm-stop
15626 @opindex mno-volatile-asm-stop
15627 Generate (or don't) a stop bit immediately before and after volatile asm
15628 statements.
15630 @item -mregister-names
15631 @itemx -mno-register-names
15632 @opindex mregister-names
15633 @opindex mno-register-names
15634 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
15635 the stacked registers.  This may make assembler output more readable.
15637 @item -mno-sdata
15638 @itemx -msdata
15639 @opindex mno-sdata
15640 @opindex msdata
15641 Disable (or enable) optimizations that use the small data section.  This may
15642 be useful for working around optimizer bugs.
15644 @item -mconstant-gp
15645 @opindex mconstant-gp
15646 Generate code that uses a single constant global pointer value.  This is
15647 useful when compiling kernel code.
15649 @item -mauto-pic
15650 @opindex mauto-pic
15651 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
15652 This is useful when compiling firmware code.
15654 @item -minline-float-divide-min-latency
15655 @opindex minline-float-divide-min-latency
15656 Generate code for inline divides of floating-point values
15657 using the minimum latency algorithm.
15659 @item -minline-float-divide-max-throughput
15660 @opindex minline-float-divide-max-throughput
15661 Generate code for inline divides of floating-point values
15662 using the maximum throughput algorithm.
15664 @item -mno-inline-float-divide
15665 @opindex mno-inline-float-divide
15666 Do not generate inline code for divides of floating-point values.
15668 @item -minline-int-divide-min-latency
15669 @opindex minline-int-divide-min-latency
15670 Generate code for inline divides of integer values
15671 using the minimum latency algorithm.
15673 @item -minline-int-divide-max-throughput
15674 @opindex minline-int-divide-max-throughput
15675 Generate code for inline divides of integer values
15676 using the maximum throughput algorithm.
15678 @item -mno-inline-int-divide
15679 @opindex mno-inline-int-divide
15680 Do not generate inline code for divides of integer values.
15682 @item -minline-sqrt-min-latency
15683 @opindex minline-sqrt-min-latency
15684 Generate code for inline square roots
15685 using the minimum latency algorithm.
15687 @item -minline-sqrt-max-throughput
15688 @opindex minline-sqrt-max-throughput
15689 Generate code for inline square roots
15690 using the maximum throughput algorithm.
15692 @item -mno-inline-sqrt
15693 @opindex mno-inline-sqrt
15694 Do not generate inline code for @code{sqrt}.
15696 @item -mfused-madd
15697 @itemx -mno-fused-madd
15698 @opindex mfused-madd
15699 @opindex mno-fused-madd
15700 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
15701 instructions.  The default is to use these instructions.
15703 @item -mno-dwarf2-asm
15704 @itemx -mdwarf2-asm
15705 @opindex mno-dwarf2-asm
15706 @opindex mdwarf2-asm
15707 Don't (or do) generate assembler code for the DWARF 2 line number debugging
15708 info.  This may be useful when not using the GNU assembler.
15710 @item -mearly-stop-bits
15711 @itemx -mno-early-stop-bits
15712 @opindex mearly-stop-bits
15713 @opindex mno-early-stop-bits
15714 Allow stop bits to be placed earlier than immediately preceding the
15715 instruction that triggered the stop bit.  This can improve instruction
15716 scheduling, but does not always do so.
15718 @item -mfixed-range=@var{register-range}
15719 @opindex mfixed-range
15720 Generate code treating the given register range as fixed registers.
15721 A fixed register is one that the register allocator cannot use.  This is
15722 useful when compiling kernel code.  A register range is specified as
15723 two registers separated by a dash.  Multiple register ranges can be
15724 specified separated by a comma.
15726 @item -mtls-size=@var{tls-size}
15727 @opindex mtls-size
15728 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
15731 @item -mtune=@var{cpu-type}
15732 @opindex mtune
15733 Tune the instruction scheduling for a particular CPU, Valid values are
15734 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
15735 and @samp{mckinley}.
15737 @item -milp32
15738 @itemx -mlp64
15739 @opindex milp32
15740 @opindex mlp64
15741 Generate code for a 32-bit or 64-bit environment.
15742 The 32-bit environment sets int, long and pointer to 32 bits.
15743 The 64-bit environment sets int to 32 bits and long and pointer
15744 to 64 bits.  These are HP-UX specific flags.
15746 @item -mno-sched-br-data-spec
15747 @itemx -msched-br-data-spec
15748 @opindex mno-sched-br-data-spec
15749 @opindex msched-br-data-spec
15750 (Dis/En)able data speculative scheduling before reload.
15751 This results in generation of @code{ld.a} instructions and
15752 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
15753 The default is 'disable'.
15755 @item -msched-ar-data-spec
15756 @itemx -mno-sched-ar-data-spec
15757 @opindex msched-ar-data-spec
15758 @opindex mno-sched-ar-data-spec
15759 (En/Dis)able data speculative scheduling after reload.
15760 This results in generation of @code{ld.a} instructions and
15761 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
15762 The default is 'enable'.
15764 @item -mno-sched-control-spec
15765 @itemx -msched-control-spec
15766 @opindex mno-sched-control-spec
15767 @opindex msched-control-spec
15768 (Dis/En)able control speculative scheduling.  This feature is
15769 available only during region scheduling (i.e.@: before reload).
15770 This results in generation of the @code{ld.s} instructions and
15771 the corresponding check instructions @code{chk.s}.
15772 The default is 'disable'.
15774 @item -msched-br-in-data-spec
15775 @itemx -mno-sched-br-in-data-spec
15776 @opindex msched-br-in-data-spec
15777 @opindex mno-sched-br-in-data-spec
15778 (En/Dis)able speculative scheduling of the instructions that
15779 are dependent on the data speculative loads before reload.
15780 This is effective only with @option{-msched-br-data-spec} enabled.
15781 The default is 'enable'.
15783 @item -msched-ar-in-data-spec
15784 @itemx -mno-sched-ar-in-data-spec
15785 @opindex msched-ar-in-data-spec
15786 @opindex mno-sched-ar-in-data-spec
15787 (En/Dis)able speculative scheduling of the instructions that
15788 are dependent on the data speculative loads after reload.
15789 This is effective only with @option{-msched-ar-data-spec} enabled.
15790 The default is 'enable'.
15792 @item -msched-in-control-spec
15793 @itemx -mno-sched-in-control-spec
15794 @opindex msched-in-control-spec
15795 @opindex mno-sched-in-control-spec
15796 (En/Dis)able speculative scheduling of the instructions that
15797 are dependent on the control speculative loads.
15798 This is effective only with @option{-msched-control-spec} enabled.
15799 The default is 'enable'.
15801 @item -mno-sched-prefer-non-data-spec-insns
15802 @itemx -msched-prefer-non-data-spec-insns
15803 @opindex mno-sched-prefer-non-data-spec-insns
15804 @opindex msched-prefer-non-data-spec-insns
15805 If enabled, data-speculative instructions are chosen for schedule
15806 only if there are no other choices at the moment.  This makes
15807 the use of the data speculation much more conservative.
15808 The default is 'disable'.
15810 @item -mno-sched-prefer-non-control-spec-insns
15811 @itemx -msched-prefer-non-control-spec-insns
15812 @opindex mno-sched-prefer-non-control-spec-insns
15813 @opindex msched-prefer-non-control-spec-insns
15814 If enabled, control-speculative instructions are chosen for schedule
15815 only if there are no other choices at the moment.  This makes
15816 the use of the control speculation much more conservative.
15817 The default is 'disable'.
15819 @item -mno-sched-count-spec-in-critical-path
15820 @itemx -msched-count-spec-in-critical-path
15821 @opindex mno-sched-count-spec-in-critical-path
15822 @opindex msched-count-spec-in-critical-path
15823 If enabled, speculative dependencies are considered during
15824 computation of the instructions priorities.  This makes the use of the
15825 speculation a bit more conservative.
15826 The default is 'disable'.
15828 @item -msched-spec-ldc
15829 @opindex msched-spec-ldc
15830 Use a simple data speculation check.  This option is on by default.
15832 @item -msched-control-spec-ldc
15833 @opindex msched-spec-ldc
15834 Use a simple check for control speculation.  This option is on by default.
15836 @item -msched-stop-bits-after-every-cycle
15837 @opindex msched-stop-bits-after-every-cycle
15838 Place a stop bit after every cycle when scheduling.  This option is on
15839 by default.
15841 @item -msched-fp-mem-deps-zero-cost
15842 @opindex msched-fp-mem-deps-zero-cost
15843 Assume that floating-point stores and loads are not likely to cause a conflict
15844 when placed into the same instruction group.  This option is disabled by
15845 default.
15847 @item -msel-sched-dont-check-control-spec
15848 @opindex msel-sched-dont-check-control-spec
15849 Generate checks for control speculation in selective scheduling.
15850 This flag is disabled by default.
15852 @item -msched-max-memory-insns=@var{max-insns}
15853 @opindex msched-max-memory-insns
15854 Limit on the number of memory insns per instruction group, giving lower
15855 priority to subsequent memory insns attempting to schedule in the same
15856 instruction group. Frequently useful to prevent cache bank conflicts.
15857 The default value is 1.
15859 @item -msched-max-memory-insns-hard-limit
15860 @opindex msched-max-memory-insns-hard-limit
15861 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
15862 disallowing more than that number in an instruction group.
15863 Otherwise, the limit is ``soft'', meaning that non-memory operations
15864 are preferred when the limit is reached, but memory operations may still
15865 be scheduled.
15867 @end table
15869 @node LM32 Options
15870 @subsection LM32 Options
15871 @cindex LM32 options
15873 These @option{-m} options are defined for the LatticeMico32 architecture:
15875 @table @gcctabopt
15876 @item -mbarrel-shift-enabled
15877 @opindex mbarrel-shift-enabled
15878 Enable barrel-shift instructions.
15880 @item -mdivide-enabled
15881 @opindex mdivide-enabled
15882 Enable divide and modulus instructions.
15884 @item -mmultiply-enabled
15885 @opindex multiply-enabled
15886 Enable multiply instructions.
15888 @item -msign-extend-enabled
15889 @opindex msign-extend-enabled
15890 Enable sign extend instructions.
15892 @item -muser-enabled
15893 @opindex muser-enabled
15894 Enable user-defined instructions.
15896 @end table
15898 @node M32C Options
15899 @subsection M32C Options
15900 @cindex M32C options
15902 @table @gcctabopt
15903 @item -mcpu=@var{name}
15904 @opindex mcpu=
15905 Select the CPU for which code is generated.  @var{name} may be one of
15906 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
15907 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
15908 the M32C/80 series.
15910 @item -msim
15911 @opindex msim
15912 Specifies that the program will be run on the simulator.  This causes
15913 an alternate runtime library to be linked in which supports, for
15914 example, file I/O@.  You must not use this option when generating
15915 programs that will run on real hardware; you must provide your own
15916 runtime library for whatever I/O functions are needed.
15918 @item -memregs=@var{number}
15919 @opindex memregs=
15920 Specifies the number of memory-based pseudo-registers GCC uses
15921 during code generation.  These pseudo-registers are used like real
15922 registers, so there is a tradeoff between GCC's ability to fit the
15923 code into available registers, and the performance penalty of using
15924 memory instead of registers.  Note that all modules in a program must
15925 be compiled with the same value for this option.  Because of that, you
15926 must not use this option with GCC's default runtime libraries.
15928 @end table
15930 @node M32R/D Options
15931 @subsection M32R/D Options
15932 @cindex M32R/D options
15934 These @option{-m} options are defined for Renesas M32R/D architectures:
15936 @table @gcctabopt
15937 @item -m32r2
15938 @opindex m32r2
15939 Generate code for the M32R/2@.
15941 @item -m32rx
15942 @opindex m32rx
15943 Generate code for the M32R/X@.
15945 @item -m32r
15946 @opindex m32r
15947 Generate code for the M32R@.  This is the default.
15949 @item -mmodel=small
15950 @opindex mmodel=small
15951 Assume all objects live in the lower 16MB of memory (so that their addresses
15952 can be loaded with the @code{ld24} instruction), and assume all subroutines
15953 are reachable with the @code{bl} instruction.
15954 This is the default.
15956 The addressability of a particular object can be set with the
15957 @code{model} attribute.
15959 @item -mmodel=medium
15960 @opindex mmodel=medium
15961 Assume objects may be anywhere in the 32-bit address space (the compiler
15962 generates @code{seth/add3} instructions to load their addresses), and
15963 assume all subroutines are reachable with the @code{bl} instruction.
15965 @item -mmodel=large
15966 @opindex mmodel=large
15967 Assume objects may be anywhere in the 32-bit address space (the compiler
15968 generates @code{seth/add3} instructions to load their addresses), and
15969 assume subroutines may not be reachable with the @code{bl} instruction
15970 (the compiler generates the much slower @code{seth/add3/jl}
15971 instruction sequence).
15973 @item -msdata=none
15974 @opindex msdata=none
15975 Disable use of the small data area.  Variables are put into
15976 one of @code{.data}, @code{.bss}, or @code{.rodata} (unless the
15977 @code{section} attribute has been specified).
15978 This is the default.
15980 The small data area consists of sections @code{.sdata} and @code{.sbss}.
15981 Objects may be explicitly put in the small data area with the
15982 @code{section} attribute using one of these sections.
15984 @item -msdata=sdata
15985 @opindex msdata=sdata
15986 Put small global and static data in the small data area, but do not
15987 generate special code to reference them.
15989 @item -msdata=use
15990 @opindex msdata=use
15991 Put small global and static data in the small data area, and generate
15992 special instructions to reference them.
15994 @item -G @var{num}
15995 @opindex G
15996 @cindex smaller data references
15997 Put global and static objects less than or equal to @var{num} bytes
15998 into the small data or BSS sections instead of the normal data or BSS
15999 sections.  The default value of @var{num} is 8.
16000 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
16001 for this option to have any effect.
16003 All modules should be compiled with the same @option{-G @var{num}} value.
16004 Compiling with different values of @var{num} may or may not work; if it
16005 doesn't the linker gives an error message---incorrect code is not
16006 generated.
16008 @item -mdebug
16009 @opindex mdebug
16010 Makes the M32R-specific code in the compiler display some statistics
16011 that might help in debugging programs.
16013 @item -malign-loops
16014 @opindex malign-loops
16015 Align all loops to a 32-byte boundary.
16017 @item -mno-align-loops
16018 @opindex mno-align-loops
16019 Do not enforce a 32-byte alignment for loops.  This is the default.
16021 @item -missue-rate=@var{number}
16022 @opindex missue-rate=@var{number}
16023 Issue @var{number} instructions per cycle.  @var{number} can only be 1
16024 or 2.
16026 @item -mbranch-cost=@var{number}
16027 @opindex mbranch-cost=@var{number}
16028 @var{number} can only be 1 or 2.  If it is 1 then branches are
16029 preferred over conditional code, if it is 2, then the opposite applies.
16031 @item -mflush-trap=@var{number}
16032 @opindex mflush-trap=@var{number}
16033 Specifies the trap number to use to flush the cache.  The default is
16034 12.  Valid numbers are between 0 and 15 inclusive.
16036 @item -mno-flush-trap
16037 @opindex mno-flush-trap
16038 Specifies that the cache cannot be flushed by using a trap.
16040 @item -mflush-func=@var{name}
16041 @opindex mflush-func=@var{name}
16042 Specifies the name of the operating system function to call to flush
16043 the cache.  The default is @samp{_flush_cache}, but a function call
16044 is only used if a trap is not available.
16046 @item -mno-flush-func
16047 @opindex mno-flush-func
16048 Indicates that there is no OS function for flushing the cache.
16050 @end table
16052 @node M680x0 Options
16053 @subsection M680x0 Options
16054 @cindex M680x0 options
16056 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
16057 The default settings depend on which architecture was selected when
16058 the compiler was configured; the defaults for the most common choices
16059 are given below.
16061 @table @gcctabopt
16062 @item -march=@var{arch}
16063 @opindex march
16064 Generate code for a specific M680x0 or ColdFire instruction set
16065 architecture.  Permissible values of @var{arch} for M680x0
16066 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
16067 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
16068 architectures are selected according to Freescale's ISA classification
16069 and the permissible values are: @samp{isaa}, @samp{isaaplus},
16070 @samp{isab} and @samp{isac}.
16072 GCC defines a macro @code{__mcf@var{arch}__} whenever it is generating
16073 code for a ColdFire target.  The @var{arch} in this macro is one of the
16074 @option{-march} arguments given above.
16076 When used together, @option{-march} and @option{-mtune} select code
16077 that runs on a family of similar processors but that is optimized
16078 for a particular microarchitecture.
16080 @item -mcpu=@var{cpu}
16081 @opindex mcpu
16082 Generate code for a specific M680x0 or ColdFire processor.
16083 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
16084 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
16085 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
16086 below, which also classifies the CPUs into families:
16088 @multitable @columnfractions 0.20 0.80
16089 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
16090 @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}
16091 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
16092 @item @samp{5206e} @tab @samp{5206e}
16093 @item @samp{5208} @tab @samp{5207} @samp{5208}
16094 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
16095 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
16096 @item @samp{5216} @tab @samp{5214} @samp{5216}
16097 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
16098 @item @samp{5225} @tab @samp{5224} @samp{5225}
16099 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
16100 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
16101 @item @samp{5249} @tab @samp{5249}
16102 @item @samp{5250} @tab @samp{5250}
16103 @item @samp{5271} @tab @samp{5270} @samp{5271}
16104 @item @samp{5272} @tab @samp{5272}
16105 @item @samp{5275} @tab @samp{5274} @samp{5275}
16106 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
16107 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
16108 @item @samp{5307} @tab @samp{5307}
16109 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
16110 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
16111 @item @samp{5407} @tab @samp{5407}
16112 @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}
16113 @end multitable
16115 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
16116 @var{arch} is compatible with @var{cpu}.  Other combinations of
16117 @option{-mcpu} and @option{-march} are rejected.
16119 GCC defines the macro @code{__mcf_cpu_@var{cpu}} when ColdFire target
16120 @var{cpu} is selected.  It also defines @code{__mcf_family_@var{family}},
16121 where the value of @var{family} is given by the table above.
16123 @item -mtune=@var{tune}
16124 @opindex mtune
16125 Tune the code for a particular microarchitecture within the
16126 constraints set by @option{-march} and @option{-mcpu}.
16127 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
16128 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
16129 and @samp{cpu32}.  The ColdFire microarchitectures
16130 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
16132 You can also use @option{-mtune=68020-40} for code that needs
16133 to run relatively well on 68020, 68030 and 68040 targets.
16134 @option{-mtune=68020-60} is similar but includes 68060 targets
16135 as well.  These two options select the same tuning decisions as
16136 @option{-m68020-40} and @option{-m68020-60} respectively.
16138 GCC defines the macros @code{__mc@var{arch}} and @code{__mc@var{arch}__}
16139 when tuning for 680x0 architecture @var{arch}.  It also defines
16140 @code{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
16141 option is used.  If GCC is tuning for a range of architectures,
16142 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
16143 it defines the macros for every architecture in the range.
16145 GCC also defines the macro @code{__m@var{uarch}__} when tuning for
16146 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
16147 of the arguments given above.
16149 @item -m68000
16150 @itemx -mc68000
16151 @opindex m68000
16152 @opindex mc68000
16153 Generate output for a 68000.  This is the default
16154 when the compiler is configured for 68000-based systems.
16155 It is equivalent to @option{-march=68000}.
16157 Use this option for microcontrollers with a 68000 or EC000 core,
16158 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
16160 @item -m68010
16161 @opindex m68010
16162 Generate output for a 68010.  This is the default
16163 when the compiler is configured for 68010-based systems.
16164 It is equivalent to @option{-march=68010}.
16166 @item -m68020
16167 @itemx -mc68020
16168 @opindex m68020
16169 @opindex mc68020
16170 Generate output for a 68020.  This is the default
16171 when the compiler is configured for 68020-based systems.
16172 It is equivalent to @option{-march=68020}.
16174 @item -m68030
16175 @opindex m68030
16176 Generate output for a 68030.  This is the default when the compiler is
16177 configured for 68030-based systems.  It is equivalent to
16178 @option{-march=68030}.
16180 @item -m68040
16181 @opindex m68040
16182 Generate output for a 68040.  This is the default when the compiler is
16183 configured for 68040-based systems.  It is equivalent to
16184 @option{-march=68040}.
16186 This option inhibits the use of 68881/68882 instructions that have to be
16187 emulated by software on the 68040.  Use this option if your 68040 does not
16188 have code to emulate those instructions.
16190 @item -m68060
16191 @opindex m68060
16192 Generate output for a 68060.  This is the default when the compiler is
16193 configured for 68060-based systems.  It is equivalent to
16194 @option{-march=68060}.
16196 This option inhibits the use of 68020 and 68881/68882 instructions that
16197 have to be emulated by software on the 68060.  Use this option if your 68060
16198 does not have code to emulate those instructions.
16200 @item -mcpu32
16201 @opindex mcpu32
16202 Generate output for a CPU32.  This is the default
16203 when the compiler is configured for CPU32-based systems.
16204 It is equivalent to @option{-march=cpu32}.
16206 Use this option for microcontrollers with a
16207 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
16208 68336, 68340, 68341, 68349 and 68360.
16210 @item -m5200
16211 @opindex m5200
16212 Generate output for a 520X ColdFire CPU@.  This is the default
16213 when the compiler is configured for 520X-based systems.
16214 It is equivalent to @option{-mcpu=5206}, and is now deprecated
16215 in favor of that option.
16217 Use this option for microcontroller with a 5200 core, including
16218 the MCF5202, MCF5203, MCF5204 and MCF5206.
16220 @item -m5206e
16221 @opindex m5206e
16222 Generate output for a 5206e ColdFire CPU@.  The option is now
16223 deprecated in favor of the equivalent @option{-mcpu=5206e}.
16225 @item -m528x
16226 @opindex m528x
16227 Generate output for a member of the ColdFire 528X family.
16228 The option is now deprecated in favor of the equivalent
16229 @option{-mcpu=528x}.
16231 @item -m5307
16232 @opindex m5307
16233 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
16234 in favor of the equivalent @option{-mcpu=5307}.
16236 @item -m5407
16237 @opindex m5407
16238 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
16239 in favor of the equivalent @option{-mcpu=5407}.
16241 @item -mcfv4e
16242 @opindex mcfv4e
16243 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
16244 This includes use of hardware floating-point instructions.
16245 The option is equivalent to @option{-mcpu=547x}, and is now
16246 deprecated in favor of that option.
16248 @item -m68020-40
16249 @opindex m68020-40
16250 Generate output for a 68040, without using any of the new instructions.
16251 This results in code that can run relatively efficiently on either a
16252 68020/68881 or a 68030 or a 68040.  The generated code does use the
16253 68881 instructions that are emulated on the 68040.
16255 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
16257 @item -m68020-60
16258 @opindex m68020-60
16259 Generate output for a 68060, without using any of the new instructions.
16260 This results in code that can run relatively efficiently on either a
16261 68020/68881 or a 68030 or a 68040.  The generated code does use the
16262 68881 instructions that are emulated on the 68060.
16264 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
16266 @item -mhard-float
16267 @itemx -m68881
16268 @opindex mhard-float
16269 @opindex m68881
16270 Generate floating-point instructions.  This is the default for 68020
16271 and above, and for ColdFire devices that have an FPU@.  It defines the
16272 macro @code{__HAVE_68881__} on M680x0 targets and @code{__mcffpu__}
16273 on ColdFire targets.
16275 @item -msoft-float
16276 @opindex msoft-float
16277 Do not generate floating-point instructions; use library calls instead.
16278 This is the default for 68000, 68010, and 68832 targets.  It is also
16279 the default for ColdFire devices that have no FPU.
16281 @item -mdiv
16282 @itemx -mno-div
16283 @opindex mdiv
16284 @opindex mno-div
16285 Generate (do not generate) ColdFire hardware divide and remainder
16286 instructions.  If @option{-march} is used without @option{-mcpu},
16287 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
16288 architectures.  Otherwise, the default is taken from the target CPU
16289 (either the default CPU, or the one specified by @option{-mcpu}).  For
16290 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
16291 @option{-mcpu=5206e}.
16293 GCC defines the macro @code{__mcfhwdiv__} when this option is enabled.
16295 @item -mshort
16296 @opindex mshort
16297 Consider type @code{int} to be 16 bits wide, like @code{short int}.
16298 Additionally, parameters passed on the stack are also aligned to a
16299 16-bit boundary even on targets whose API mandates promotion to 32-bit.
16301 @item -mno-short
16302 @opindex mno-short
16303 Do not consider type @code{int} to be 16 bits wide.  This is the default.
16305 @item -mnobitfield
16306 @itemx -mno-bitfield
16307 @opindex mnobitfield
16308 @opindex mno-bitfield
16309 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
16310 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
16312 @item -mbitfield
16313 @opindex mbitfield
16314 Do use the bit-field instructions.  The @option{-m68020} option implies
16315 @option{-mbitfield}.  This is the default if you use a configuration
16316 designed for a 68020.
16318 @item -mrtd
16319 @opindex mrtd
16320 Use a different function-calling convention, in which functions
16321 that take a fixed number of arguments return with the @code{rtd}
16322 instruction, which pops their arguments while returning.  This
16323 saves one instruction in the caller since there is no need to pop
16324 the arguments there.
16326 This calling convention is incompatible with the one normally
16327 used on Unix, so you cannot use it if you need to call libraries
16328 compiled with the Unix compiler.
16330 Also, you must provide function prototypes for all functions that
16331 take variable numbers of arguments (including @code{printf});
16332 otherwise incorrect code is generated for calls to those
16333 functions.
16335 In addition, seriously incorrect code results if you call a
16336 function with too many arguments.  (Normally, extra arguments are
16337 harmlessly ignored.)
16339 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
16340 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
16342 @item -mno-rtd
16343 @opindex mno-rtd
16344 Do not use the calling conventions selected by @option{-mrtd}.
16345 This is the default.
16347 @item -malign-int
16348 @itemx -mno-align-int
16349 @opindex malign-int
16350 @opindex mno-align-int
16351 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
16352 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
16353 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
16354 Aligning variables on 32-bit boundaries produces code that runs somewhat
16355 faster on processors with 32-bit busses at the expense of more memory.
16357 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
16358 aligns structures containing the above types differently than
16359 most published application binary interface specifications for the m68k.
16361 @item -mpcrel
16362 @opindex mpcrel
16363 Use the pc-relative addressing mode of the 68000 directly, instead of
16364 using a global offset table.  At present, this option implies @option{-fpic},
16365 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
16366 not presently supported with @option{-mpcrel}, though this could be supported for
16367 68020 and higher processors.
16369 @item -mno-strict-align
16370 @itemx -mstrict-align
16371 @opindex mno-strict-align
16372 @opindex mstrict-align
16373 Do not (do) assume that unaligned memory references are handled by
16374 the system.
16376 @item -msep-data
16377 Generate code that allows the data segment to be located in a different
16378 area of memory from the text segment.  This allows for execute-in-place in
16379 an environment without virtual memory management.  This option implies
16380 @option{-fPIC}.
16382 @item -mno-sep-data
16383 Generate code that assumes that the data segment follows the text segment.
16384 This is the default.
16386 @item -mid-shared-library
16387 Generate code that supports shared libraries via the library ID method.
16388 This allows for execute-in-place and shared libraries in an environment
16389 without virtual memory management.  This option implies @option{-fPIC}.
16391 @item -mno-id-shared-library
16392 Generate code that doesn't assume ID-based shared libraries are being used.
16393 This is the default.
16395 @item -mshared-library-id=n
16396 Specifies the identification number of the ID-based shared library being
16397 compiled.  Specifying a value of 0 generates more compact code; specifying
16398 other values forces the allocation of that number to the current
16399 library, but is no more space- or time-efficient than omitting this option.
16401 @item -mxgot
16402 @itemx -mno-xgot
16403 @opindex mxgot
16404 @opindex mno-xgot
16405 When generating position-independent code for ColdFire, generate code
16406 that works if the GOT has more than 8192 entries.  This code is
16407 larger and slower than code generated without this option.  On M680x0
16408 processors, this option is not needed; @option{-fPIC} suffices.
16410 GCC normally uses a single instruction to load values from the GOT@.
16411 While this is relatively efficient, it only works if the GOT
16412 is smaller than about 64k.  Anything larger causes the linker
16413 to report an error such as:
16415 @cindex relocation truncated to fit (ColdFire)
16416 @smallexample
16417 relocation truncated to fit: R_68K_GOT16O foobar
16418 @end smallexample
16420 If this happens, you should recompile your code with @option{-mxgot}.
16421 It should then work with very large GOTs.  However, code generated with
16422 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
16423 the value of a global symbol.
16425 Note that some linkers, including newer versions of the GNU linker,
16426 can create multiple GOTs and sort GOT entries.  If you have such a linker,
16427 you should only need to use @option{-mxgot} when compiling a single
16428 object file that accesses more than 8192 GOT entries.  Very few do.
16430 These options have no effect unless GCC is generating
16431 position-independent code.
16433 @end table
16435 @node MCore Options
16436 @subsection MCore Options
16437 @cindex MCore options
16439 These are the @samp{-m} options defined for the Motorola M*Core
16440 processors.
16442 @table @gcctabopt
16444 @item -mhardlit
16445 @itemx -mno-hardlit
16446 @opindex mhardlit
16447 @opindex mno-hardlit
16448 Inline constants into the code stream if it can be done in two
16449 instructions or less.
16451 @item -mdiv
16452 @itemx -mno-div
16453 @opindex mdiv
16454 @opindex mno-div
16455 Use the divide instruction.  (Enabled by default).
16457 @item -mrelax-immediate
16458 @itemx -mno-relax-immediate
16459 @opindex mrelax-immediate
16460 @opindex mno-relax-immediate
16461 Allow arbitrary-sized immediates in bit operations.
16463 @item -mwide-bitfields
16464 @itemx -mno-wide-bitfields
16465 @opindex mwide-bitfields
16466 @opindex mno-wide-bitfields
16467 Always treat bit-fields as @code{int}-sized.
16469 @item -m4byte-functions
16470 @itemx -mno-4byte-functions
16471 @opindex m4byte-functions
16472 @opindex mno-4byte-functions
16473 Force all functions to be aligned to a 4-byte boundary.
16475 @item -mcallgraph-data
16476 @itemx -mno-callgraph-data
16477 @opindex mcallgraph-data
16478 @opindex mno-callgraph-data
16479 Emit callgraph information.
16481 @item -mslow-bytes
16482 @itemx -mno-slow-bytes
16483 @opindex mslow-bytes
16484 @opindex mno-slow-bytes
16485 Prefer word access when reading byte quantities.
16487 @item -mlittle-endian
16488 @itemx -mbig-endian
16489 @opindex mlittle-endian
16490 @opindex mbig-endian
16491 Generate code for a little-endian target.
16493 @item -m210
16494 @itemx -m340
16495 @opindex m210
16496 @opindex m340
16497 Generate code for the 210 processor.
16499 @item -mno-lsim
16500 @opindex mno-lsim
16501 Assume that runtime support has been provided and so omit the
16502 simulator library (@file{libsim.a)} from the linker command line.
16504 @item -mstack-increment=@var{size}
16505 @opindex mstack-increment
16506 Set the maximum amount for a single stack increment operation.  Large
16507 values can increase the speed of programs that contain functions
16508 that need a large amount of stack space, but they can also trigger a
16509 segmentation fault if the stack is extended too much.  The default
16510 value is 0x1000.
16512 @end table
16514 @node MeP Options
16515 @subsection MeP Options
16516 @cindex MeP options
16518 @table @gcctabopt
16520 @item -mabsdiff
16521 @opindex mabsdiff
16522 Enables the @code{abs} instruction, which is the absolute difference
16523 between two registers.
16525 @item -mall-opts
16526 @opindex mall-opts
16527 Enables all the optional instructions---average, multiply, divide, bit
16528 operations, leading zero, absolute difference, min/max, clip, and
16529 saturation.
16532 @item -maverage
16533 @opindex maverage
16534 Enables the @code{ave} instruction, which computes the average of two
16535 registers.
16537 @item -mbased=@var{n}
16538 @opindex mbased=
16539 Variables of size @var{n} bytes or smaller are placed in the
16540 @code{.based} section by default.  Based variables use the @code{$tp}
16541 register as a base register, and there is a 128-byte limit to the
16542 @code{.based} section.
16544 @item -mbitops
16545 @opindex mbitops
16546 Enables the bit operation instructions---bit test (@code{btstm}), set
16547 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
16548 test-and-set (@code{tas}).
16550 @item -mc=@var{name}
16551 @opindex mc=
16552 Selects which section constant data is placed in.  @var{name} may
16553 be @samp{tiny}, @samp{near}, or @samp{far}.
16555 @item -mclip
16556 @opindex mclip
16557 Enables the @code{clip} instruction.  Note that @option{-mclip} is not
16558 useful unless you also provide @option{-mminmax}.
16560 @item -mconfig=@var{name}
16561 @opindex mconfig=
16562 Selects one of the built-in core configurations.  Each MeP chip has
16563 one or more modules in it; each module has a core CPU and a variety of
16564 coprocessors, optional instructions, and peripherals.  The
16565 @code{MeP-Integrator} tool, not part of GCC, provides these
16566 configurations through this option; using this option is the same as
16567 using all the corresponding command-line options.  The default
16568 configuration is @samp{default}.
16570 @item -mcop
16571 @opindex mcop
16572 Enables the coprocessor instructions.  By default, this is a 32-bit
16573 coprocessor.  Note that the coprocessor is normally enabled via the
16574 @option{-mconfig=} option.
16576 @item -mcop32
16577 @opindex mcop32
16578 Enables the 32-bit coprocessor's instructions.
16580 @item -mcop64
16581 @opindex mcop64
16582 Enables the 64-bit coprocessor's instructions.
16584 @item -mivc2
16585 @opindex mivc2
16586 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
16588 @item -mdc
16589 @opindex mdc
16590 Causes constant variables to be placed in the @code{.near} section.
16592 @item -mdiv
16593 @opindex mdiv
16594 Enables the @code{div} and @code{divu} instructions.
16596 @item -meb
16597 @opindex meb
16598 Generate big-endian code.
16600 @item -mel
16601 @opindex mel
16602 Generate little-endian code.
16604 @item -mio-volatile
16605 @opindex mio-volatile
16606 Tells the compiler that any variable marked with the @code{io}
16607 attribute is to be considered volatile.
16609 @item -ml
16610 @opindex ml
16611 Causes variables to be assigned to the @code{.far} section by default.
16613 @item -mleadz
16614 @opindex mleadz
16615 Enables the @code{leadz} (leading zero) instruction.
16617 @item -mm
16618 @opindex mm
16619 Causes variables to be assigned to the @code{.near} section by default.
16621 @item -mminmax
16622 @opindex mminmax
16623 Enables the @code{min} and @code{max} instructions.
16625 @item -mmult
16626 @opindex mmult
16627 Enables the multiplication and multiply-accumulate instructions.
16629 @item -mno-opts
16630 @opindex mno-opts
16631 Disables all the optional instructions enabled by @option{-mall-opts}.
16633 @item -mrepeat
16634 @opindex mrepeat
16635 Enables the @code{repeat} and @code{erepeat} instructions, used for
16636 low-overhead looping.
16638 @item -ms
16639 @opindex ms
16640 Causes all variables to default to the @code{.tiny} section.  Note
16641 that there is a 65536-byte limit to this section.  Accesses to these
16642 variables use the @code{%gp} base register.
16644 @item -msatur
16645 @opindex msatur
16646 Enables the saturation instructions.  Note that the compiler does not
16647 currently generate these itself, but this option is included for
16648 compatibility with other tools, like @code{as}.
16650 @item -msdram
16651 @opindex msdram
16652 Link the SDRAM-based runtime instead of the default ROM-based runtime.
16654 @item -msim
16655 @opindex msim
16656 Link the simulator run-time libraries.
16658 @item -msimnovec
16659 @opindex msimnovec
16660 Link the simulator runtime libraries, excluding built-in support
16661 for reset and exception vectors and tables.
16663 @item -mtf
16664 @opindex mtf
16665 Causes all functions to default to the @code{.far} section.  Without
16666 this option, functions default to the @code{.near} section.
16668 @item -mtiny=@var{n}
16669 @opindex mtiny=
16670 Variables that are @var{n} bytes or smaller are allocated to the
16671 @code{.tiny} section.  These variables use the @code{$gp} base
16672 register.  The default for this option is 4, but note that there's a
16673 65536-byte limit to the @code{.tiny} section.
16675 @end table
16677 @node MicroBlaze Options
16678 @subsection MicroBlaze Options
16679 @cindex MicroBlaze Options
16681 @table @gcctabopt
16683 @item -msoft-float
16684 @opindex msoft-float
16685 Use software emulation for floating point (default).
16687 @item -mhard-float
16688 @opindex mhard-float
16689 Use hardware floating-point instructions.
16691 @item -mmemcpy
16692 @opindex mmemcpy
16693 Do not optimize block moves, use @code{memcpy}.
16695 @item -mno-clearbss
16696 @opindex mno-clearbss
16697 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
16699 @item -mcpu=@var{cpu-type}
16700 @opindex mcpu=
16701 Use features of, and schedule code for, the given CPU.
16702 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
16703 where @var{X} is a major version, @var{YY} is the minor version, and
16704 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
16705 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
16707 @item -mxl-soft-mul
16708 @opindex mxl-soft-mul
16709 Use software multiply emulation (default).
16711 @item -mxl-soft-div
16712 @opindex mxl-soft-div
16713 Use software emulation for divides (default).
16715 @item -mxl-barrel-shift
16716 @opindex mxl-barrel-shift
16717 Use the hardware barrel shifter.
16719 @item -mxl-pattern-compare
16720 @opindex mxl-pattern-compare
16721 Use pattern compare instructions.
16723 @item -msmall-divides
16724 @opindex msmall-divides
16725 Use table lookup optimization for small signed integer divisions.
16727 @item -mxl-stack-check
16728 @opindex mxl-stack-check
16729 This option is deprecated.  Use @option{-fstack-check} instead.
16731 @item -mxl-gp-opt
16732 @opindex mxl-gp-opt
16733 Use GP-relative @code{.sdata}/@code{.sbss} sections.
16735 @item -mxl-multiply-high
16736 @opindex mxl-multiply-high
16737 Use multiply high instructions for high part of 32x32 multiply.
16739 @item -mxl-float-convert
16740 @opindex mxl-float-convert
16741 Use hardware floating-point conversion instructions.
16743 @item -mxl-float-sqrt
16744 @opindex mxl-float-sqrt
16745 Use hardware floating-point square root instruction.
16747 @item -mbig-endian
16748 @opindex mbig-endian
16749 Generate code for a big-endian target.
16751 @item -mlittle-endian
16752 @opindex mlittle-endian
16753 Generate code for a little-endian target.
16755 @item -mxl-reorder
16756 @opindex mxl-reorder
16757 Use reorder instructions (swap and byte reversed load/store).
16759 @item -mxl-mode-@var{app-model}
16760 Select application model @var{app-model}.  Valid models are
16761 @table @samp
16762 @item executable
16763 normal executable (default), uses startup code @file{crt0.o}.
16765 @item xmdstub
16766 for use with Xilinx Microprocessor Debugger (XMD) based
16767 software intrusive debug agent called xmdstub. This uses startup file
16768 @file{crt1.o} and sets the start address of the program to 0x800.
16770 @item bootstrap
16771 for applications that are loaded using a bootloader.
16772 This model uses startup file @file{crt2.o} which does not contain a processor
16773 reset vector handler. This is suitable for transferring control on a
16774 processor reset to the bootloader rather than the application.
16776 @item novectors
16777 for applications that do not require any of the
16778 MicroBlaze vectors. This option may be useful for applications running
16779 within a monitoring application. This model uses @file{crt3.o} as a startup file.
16780 @end table
16782 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
16783 @option{-mxl-mode-@var{app-model}}.
16785 @end table
16787 @node MIPS Options
16788 @subsection MIPS Options
16789 @cindex MIPS options
16791 @table @gcctabopt
16793 @item -EB
16794 @opindex EB
16795 Generate big-endian code.
16797 @item -EL
16798 @opindex EL
16799 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
16800 configurations.
16802 @item -march=@var{arch}
16803 @opindex march
16804 Generate code that runs on @var{arch}, which can be the name of a
16805 generic MIPS ISA, or the name of a particular processor.
16806 The ISA names are:
16807 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
16808 @samp{mips32}, @samp{mips32r2}, @samp{mips32r3}, @samp{mips32r5},
16809 @samp{mips32r6}, @samp{mips64}, @samp{mips64r2}, @samp{mips64r3},
16810 @samp{mips64r5} and @samp{mips64r6}.
16811 The processor names are:
16812 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
16813 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
16814 @samp{5kc}, @samp{5kf},
16815 @samp{20kc},
16816 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
16817 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
16818 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
16819 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
16820 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
16821 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
16822 @samp{m4k},
16823 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
16824 @samp{octeon}, @samp{octeon+}, @samp{octeon2}, @samp{octeon3},
16825 @samp{orion},
16826 @samp{p5600},
16827 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
16828 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
16829 @samp{rm7000}, @samp{rm9000},
16830 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
16831 @samp{sb1},
16832 @samp{sr71000},
16833 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
16834 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
16835 @samp{xlr} and @samp{xlp}.
16836 The special value @samp{from-abi} selects the
16837 most compatible architecture for the selected ABI (that is,
16838 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
16840 The native Linux/GNU toolchain also supports the value @samp{native},
16841 which selects the best architecture option for the host processor.
16842 @option{-march=native} has no effect if GCC does not recognize
16843 the processor.
16845 In processor names, a final @samp{000} can be abbreviated as @samp{k}
16846 (for example, @option{-march=r2k}).  Prefixes are optional, and
16847 @samp{vr} may be written @samp{r}.
16849 Names of the form @samp{@var{n}f2_1} refer to processors with
16850 FPUs clocked at half the rate of the core, names of the form
16851 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
16852 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
16853 processors with FPUs clocked a ratio of 3:2 with respect to the core.
16854 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
16855 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
16856 accepted as synonyms for @samp{@var{n}f1_1}.
16858 GCC defines two macros based on the value of this option.  The first
16859 is @code{_MIPS_ARCH}, which gives the name of target architecture, as
16860 a string.  The second has the form @code{_MIPS_ARCH_@var{foo}},
16861 where @var{foo} is the capitalized value of @code{_MIPS_ARCH}@.
16862 For example, @option{-march=r2000} sets @code{_MIPS_ARCH}
16863 to @code{"r2000"} and defines the macro @code{_MIPS_ARCH_R2000}.
16865 Note that the @code{_MIPS_ARCH} macro uses the processor names given
16866 above.  In other words, it has the full prefix and does not
16867 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
16868 the macro names the resolved architecture (either @code{"mips1"} or
16869 @code{"mips3"}).  It names the default architecture when no
16870 @option{-march} option is given.
16872 @item -mtune=@var{arch}
16873 @opindex mtune
16874 Optimize for @var{arch}.  Among other things, this option controls
16875 the way instructions are scheduled, and the perceived cost of arithmetic
16876 operations.  The list of @var{arch} values is the same as for
16877 @option{-march}.
16879 When this option is not used, GCC optimizes for the processor
16880 specified by @option{-march}.  By using @option{-march} and
16881 @option{-mtune} together, it is possible to generate code that
16882 runs on a family of processors, but optimize the code for one
16883 particular member of that family.
16885 @option{-mtune} defines the macros @code{_MIPS_TUNE} and
16886 @code{_MIPS_TUNE_@var{foo}}, which work in the same way as the
16887 @option{-march} ones described above.
16889 @item -mips1
16890 @opindex mips1
16891 Equivalent to @option{-march=mips1}.
16893 @item -mips2
16894 @opindex mips2
16895 Equivalent to @option{-march=mips2}.
16897 @item -mips3
16898 @opindex mips3
16899 Equivalent to @option{-march=mips3}.
16901 @item -mips4
16902 @opindex mips4
16903 Equivalent to @option{-march=mips4}.
16905 @item -mips32
16906 @opindex mips32
16907 Equivalent to @option{-march=mips32}.
16909 @item -mips32r3
16910 @opindex mips32r3
16911 Equivalent to @option{-march=mips32r3}.
16913 @item -mips32r5
16914 @opindex mips32r5
16915 Equivalent to @option{-march=mips32r5}.
16917 @item -mips32r6
16918 @opindex mips32r6
16919 Equivalent to @option{-march=mips32r6}.
16921 @item -mips64
16922 @opindex mips64
16923 Equivalent to @option{-march=mips64}.
16925 @item -mips64r2
16926 @opindex mips64r2
16927 Equivalent to @option{-march=mips64r2}.
16929 @item -mips64r3
16930 @opindex mips64r3
16931 Equivalent to @option{-march=mips64r3}.
16933 @item -mips64r5
16934 @opindex mips64r5
16935 Equivalent to @option{-march=mips64r5}.
16937 @item -mips64r6
16938 @opindex mips64r6
16939 Equivalent to @option{-march=mips64r6}.
16941 @item -mips16
16942 @itemx -mno-mips16
16943 @opindex mips16
16944 @opindex mno-mips16
16945 Generate (do not generate) MIPS16 code.  If GCC is targeting a
16946 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
16948 MIPS16 code generation can also be controlled on a per-function basis
16949 by means of @code{mips16} and @code{nomips16} attributes.
16950 @xref{Function Attributes}, for more information.
16952 @item -mflip-mips16
16953 @opindex mflip-mips16
16954 Generate MIPS16 code on alternating functions.  This option is provided
16955 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
16956 not intended for ordinary use in compiling user code.
16958 @item -minterlink-compressed
16959 @item -mno-interlink-compressed
16960 @opindex minterlink-compressed
16961 @opindex mno-interlink-compressed
16962 Require (do not require) that code using the standard (uncompressed) MIPS ISA
16963 be link-compatible with MIPS16 and microMIPS code, and vice versa.
16965 For example, code using the standard ISA encoding cannot jump directly
16966 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
16967 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
16968 knows that the target of the jump is not compressed.
16970 @item -minterlink-mips16
16971 @itemx -mno-interlink-mips16
16972 @opindex minterlink-mips16
16973 @opindex mno-interlink-mips16
16974 Aliases of @option{-minterlink-compressed} and
16975 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
16976 and are retained for backwards compatibility.
16978 @item -mabi=32
16979 @itemx -mabi=o64
16980 @itemx -mabi=n32
16981 @itemx -mabi=64
16982 @itemx -mabi=eabi
16983 @opindex mabi=32
16984 @opindex mabi=o64
16985 @opindex mabi=n32
16986 @opindex mabi=64
16987 @opindex mabi=eabi
16988 Generate code for the given ABI@.
16990 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
16991 generates 64-bit code when you select a 64-bit architecture, but you
16992 can use @option{-mgp32} to get 32-bit code instead.
16994 For information about the O64 ABI, see
16995 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
16997 GCC supports a variant of the o32 ABI in which floating-point registers
16998 are 64 rather than 32 bits wide.  You can select this combination with
16999 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
17000 and @code{mfhc1} instructions and is therefore only supported for
17001 MIPS32R2, MIPS32R3 and MIPS32R5 processors.
17003 The register assignments for arguments and return values remain the
17004 same, but each scalar value is passed in a single 64-bit register
17005 rather than a pair of 32-bit registers.  For example, scalar
17006 floating-point values are returned in @samp{$f0} only, not a
17007 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
17008 remains the same in that the even-numbered double-precision registers
17009 are saved.
17011 Two additional variants of the o32 ABI are supported to enable
17012 a transition from 32-bit to 64-bit registers.  These are FPXX
17013 (@option{-mfpxx}) and FP64A (@option{-mfp64} @option{-mno-odd-spreg}).
17014 The FPXX extension mandates that all code must execute correctly
17015 when run using 32-bit or 64-bit registers.  The code can be interlinked
17016 with either FP32 or FP64, but not both.
17017 The FP64A extension is similar to the FP64 extension but forbids the
17018 use of odd-numbered single-precision registers.  This can be used
17019 in conjunction with the @code{FRE} mode of FPUs in MIPS32R5
17020 processors and allows both FP32 and FP64A code to interlink and
17021 run in the same process without changing FPU modes.
17023 @item -mabicalls
17024 @itemx -mno-abicalls
17025 @opindex mabicalls
17026 @opindex mno-abicalls
17027 Generate (do not generate) code that is suitable for SVR4-style
17028 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
17029 systems.
17031 @item -mshared
17032 @itemx -mno-shared
17033 Generate (do not generate) code that is fully position-independent,
17034 and that can therefore be linked into shared libraries.  This option
17035 only affects @option{-mabicalls}.
17037 All @option{-mabicalls} code has traditionally been position-independent,
17038 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
17039 as an extension, the GNU toolchain allows executables to use absolute
17040 accesses for locally-binding symbols.  It can also use shorter GP
17041 initialization sequences and generate direct calls to locally-defined
17042 functions.  This mode is selected by @option{-mno-shared}.
17044 @option{-mno-shared} depends on binutils 2.16 or higher and generates
17045 objects that can only be linked by the GNU linker.  However, the option
17046 does not affect the ABI of the final executable; it only affects the ABI
17047 of relocatable objects.  Using @option{-mno-shared} generally makes
17048 executables both smaller and quicker.
17050 @option{-mshared} is the default.
17052 @item -mplt
17053 @itemx -mno-plt
17054 @opindex mplt
17055 @opindex mno-plt
17056 Assume (do not assume) that the static and dynamic linkers
17057 support PLTs and copy relocations.  This option only affects
17058 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
17059 has no effect without @option{-msym32}.
17061 You can make @option{-mplt} the default by configuring
17062 GCC with @option{--with-mips-plt}.  The default is
17063 @option{-mno-plt} otherwise.
17065 @item -mxgot
17066 @itemx -mno-xgot
17067 @opindex mxgot
17068 @opindex mno-xgot
17069 Lift (do not lift) the usual restrictions on the size of the global
17070 offset table.
17072 GCC normally uses a single instruction to load values from the GOT@.
17073 While this is relatively efficient, it only works if the GOT
17074 is smaller than about 64k.  Anything larger causes the linker
17075 to report an error such as:
17077 @cindex relocation truncated to fit (MIPS)
17078 @smallexample
17079 relocation truncated to fit: R_MIPS_GOT16 foobar
17080 @end smallexample
17082 If this happens, you should recompile your code with @option{-mxgot}.
17083 This works with very large GOTs, although the code is also
17084 less efficient, since it takes three instructions to fetch the
17085 value of a global symbol.
17087 Note that some linkers can create multiple GOTs.  If you have such a
17088 linker, you should only need to use @option{-mxgot} when a single object
17089 file accesses more than 64k's worth of GOT entries.  Very few do.
17091 These options have no effect unless GCC is generating position
17092 independent code.
17094 @item -mgp32
17095 @opindex mgp32
17096 Assume that general-purpose registers are 32 bits wide.
17098 @item -mgp64
17099 @opindex mgp64
17100 Assume that general-purpose registers are 64 bits wide.
17102 @item -mfp32
17103 @opindex mfp32
17104 Assume that floating-point registers are 32 bits wide.
17106 @item -mfp64
17107 @opindex mfp64
17108 Assume that floating-point registers are 64 bits wide.
17110 @item -mfpxx
17111 @opindex mfpxx
17112 Do not assume the width of floating-point registers.
17114 @item -mhard-float
17115 @opindex mhard-float
17116 Use floating-point coprocessor instructions.
17118 @item -msoft-float
17119 @opindex msoft-float
17120 Do not use floating-point coprocessor instructions.  Implement
17121 floating-point calculations using library calls instead.
17123 @item -mno-float
17124 @opindex mno-float
17125 Equivalent to @option{-msoft-float}, but additionally asserts that the
17126 program being compiled does not perform any floating-point operations.
17127 This option is presently supported only by some bare-metal MIPS
17128 configurations, where it may select a special set of libraries
17129 that lack all floating-point support (including, for example, the
17130 floating-point @code{printf} formats).  
17131 If code compiled with @option{-mno-float} accidentally contains
17132 floating-point operations, it is likely to suffer a link-time
17133 or run-time failure.
17135 @item -msingle-float
17136 @opindex msingle-float
17137 Assume that the floating-point coprocessor only supports single-precision
17138 operations.
17140 @item -mdouble-float
17141 @opindex mdouble-float
17142 Assume that the floating-point coprocessor supports double-precision
17143 operations.  This is the default.
17145 @item -modd-spreg
17146 @itemx -mno-odd-spreg
17147 @opindex modd-spreg
17148 @opindex mno-odd-spreg
17149 Enable the use of odd-numbered single-precision floating-point registers
17150 for the o32 ABI.  This is the default for processors that are known to
17151 support these registers.  When using the o32 FPXX ABI, @option{-mno-odd-spreg}
17152 is set by default.
17154 @item -mabs=2008
17155 @itemx -mabs=legacy
17156 @opindex mabs=2008
17157 @opindex mabs=legacy
17158 These options control the treatment of the special not-a-number (NaN)
17159 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
17160 @code{neg.@i{fmt}} machine instructions.
17162 By default or when the @option{-mabs=legacy} is used the legacy
17163 treatment is selected.  In this case these instructions are considered
17164 arithmetic and avoided where correct operation is required and the
17165 input operand might be a NaN.  A longer sequence of instructions that
17166 manipulate the sign bit of floating-point datum manually is used
17167 instead unless the @option{-ffinite-math-only} option has also been
17168 specified.
17170 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
17171 this case these instructions are considered non-arithmetic and therefore
17172 operating correctly in all cases, including in particular where the
17173 input operand is a NaN.  These instructions are therefore always used
17174 for the respective operations.
17176 @item -mnan=2008
17177 @itemx -mnan=legacy
17178 @opindex mnan=2008
17179 @opindex mnan=legacy
17180 These options control the encoding of the special not-a-number (NaN)
17181 IEEE 754 floating-point data.
17183 The @option{-mnan=legacy} option selects the legacy encoding.  In this
17184 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
17185 significand field being 0, whereas signalling NaNs (sNaNs) are denoted
17186 by the first bit of their trailing significand field being 1.
17188 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
17189 this case qNaNs are denoted by the first bit of their trailing
17190 significand field being 1, whereas sNaNs are denoted by the first bit of
17191 their trailing significand field being 0.
17193 The default is @option{-mnan=legacy} unless GCC has been configured with
17194 @option{--with-nan=2008}.
17196 @item -mllsc
17197 @itemx -mno-llsc
17198 @opindex mllsc
17199 @opindex mno-llsc
17200 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
17201 implement atomic memory built-in functions.  When neither option is
17202 specified, GCC uses the instructions if the target architecture
17203 supports them.
17205 @option{-mllsc} is useful if the runtime environment can emulate the
17206 instructions and @option{-mno-llsc} can be useful when compiling for
17207 nonstandard ISAs.  You can make either option the default by
17208 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
17209 respectively.  @option{--with-llsc} is the default for some
17210 configurations; see the installation documentation for details.
17212 @item -mdsp
17213 @itemx -mno-dsp
17214 @opindex mdsp
17215 @opindex mno-dsp
17216 Use (do not use) revision 1 of the MIPS DSP ASE@.
17217 @xref{MIPS DSP Built-in Functions}.  This option defines the
17218 preprocessor macro @code{__mips_dsp}.  It also defines
17219 @code{__mips_dsp_rev} to 1.
17221 @item -mdspr2
17222 @itemx -mno-dspr2
17223 @opindex mdspr2
17224 @opindex mno-dspr2
17225 Use (do not use) revision 2 of the MIPS DSP ASE@.
17226 @xref{MIPS DSP Built-in Functions}.  This option defines the
17227 preprocessor macros @code{__mips_dsp} and @code{__mips_dspr2}.
17228 It also defines @code{__mips_dsp_rev} to 2.
17230 @item -msmartmips
17231 @itemx -mno-smartmips
17232 @opindex msmartmips
17233 @opindex mno-smartmips
17234 Use (do not use) the MIPS SmartMIPS ASE.
17236 @item -mpaired-single
17237 @itemx -mno-paired-single
17238 @opindex mpaired-single
17239 @opindex mno-paired-single
17240 Use (do not use) paired-single floating-point instructions.
17241 @xref{MIPS Paired-Single Support}.  This option requires
17242 hardware floating-point support to be enabled.
17244 @item -mdmx
17245 @itemx -mno-mdmx
17246 @opindex mdmx
17247 @opindex mno-mdmx
17248 Use (do not use) MIPS Digital Media Extension instructions.
17249 This option can only be used when generating 64-bit code and requires
17250 hardware floating-point support to be enabled.
17252 @item -mips3d
17253 @itemx -mno-mips3d
17254 @opindex mips3d
17255 @opindex mno-mips3d
17256 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
17257 The option @option{-mips3d} implies @option{-mpaired-single}.
17259 @item -mmicromips
17260 @itemx -mno-micromips
17261 @opindex mmicromips
17262 @opindex mno-mmicromips
17263 Generate (do not generate) microMIPS code.
17265 MicroMIPS code generation can also be controlled on a per-function basis
17266 by means of @code{micromips} and @code{nomicromips} attributes.
17267 @xref{Function Attributes}, for more information.
17269 @item -mmt
17270 @itemx -mno-mt
17271 @opindex mmt
17272 @opindex mno-mt
17273 Use (do not use) MT Multithreading instructions.
17275 @item -mmcu
17276 @itemx -mno-mcu
17277 @opindex mmcu
17278 @opindex mno-mcu
17279 Use (do not use) the MIPS MCU ASE instructions.
17281 @item -meva
17282 @itemx -mno-eva
17283 @opindex meva
17284 @opindex mno-eva
17285 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
17287 @item -mvirt
17288 @itemx -mno-virt
17289 @opindex mvirt
17290 @opindex mno-virt
17291 Use (do not use) the MIPS Virtualization Application Specific instructions.
17293 @item -mxpa
17294 @itemx -mno-xpa
17295 @opindex mxpa
17296 @opindex mno-xpa
17297 Use (do not use) the MIPS eXtended Physical Address (XPA) instructions.
17299 @item -mlong64
17300 @opindex mlong64
17301 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
17302 an explanation of the default and the way that the pointer size is
17303 determined.
17305 @item -mlong32
17306 @opindex mlong32
17307 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
17309 The default size of @code{int}s, @code{long}s and pointers depends on
17310 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
17311 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
17312 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
17313 or the same size as integer registers, whichever is smaller.
17315 @item -msym32
17316 @itemx -mno-sym32
17317 @opindex msym32
17318 @opindex mno-sym32
17319 Assume (do not assume) that all symbols have 32-bit values, regardless
17320 of the selected ABI@.  This option is useful in combination with
17321 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
17322 to generate shorter and faster references to symbolic addresses.
17324 @item -G @var{num}
17325 @opindex G
17326 Put definitions of externally-visible data in a small data section
17327 if that data is no bigger than @var{num} bytes.  GCC can then generate
17328 more efficient accesses to the data; see @option{-mgpopt} for details.
17330 The default @option{-G} option depends on the configuration.
17332 @item -mlocal-sdata
17333 @itemx -mno-local-sdata
17334 @opindex mlocal-sdata
17335 @opindex mno-local-sdata
17336 Extend (do not extend) the @option{-G} behavior to local data too,
17337 such as to static variables in C@.  @option{-mlocal-sdata} is the
17338 default for all configurations.
17340 If the linker complains that an application is using too much small data,
17341 you might want to try rebuilding the less performance-critical parts with
17342 @option{-mno-local-sdata}.  You might also want to build large
17343 libraries with @option{-mno-local-sdata}, so that the libraries leave
17344 more room for the main program.
17346 @item -mextern-sdata
17347 @itemx -mno-extern-sdata
17348 @opindex mextern-sdata
17349 @opindex mno-extern-sdata
17350 Assume (do not assume) that externally-defined data is in
17351 a small data section if the size of that data is within the @option{-G} limit.
17352 @option{-mextern-sdata} is the default for all configurations.
17354 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
17355 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
17356 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
17357 is placed in a small data section.  If @var{Var} is defined by another
17358 module, you must either compile that module with a high-enough
17359 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
17360 definition.  If @var{Var} is common, you must link the application
17361 with a high-enough @option{-G} setting.
17363 The easiest way of satisfying these restrictions is to compile
17364 and link every module with the same @option{-G} option.  However,
17365 you may wish to build a library that supports several different
17366 small data limits.  You can do this by compiling the library with
17367 the highest supported @option{-G} setting and additionally using
17368 @option{-mno-extern-sdata} to stop the library from making assumptions
17369 about externally-defined data.
17371 @item -mgpopt
17372 @itemx -mno-gpopt
17373 @opindex mgpopt
17374 @opindex mno-gpopt
17375 Use (do not use) GP-relative accesses for symbols that are known to be
17376 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
17377 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
17378 configurations.
17380 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
17381 might not hold the value of @code{_gp}.  For example, if the code is
17382 part of a library that might be used in a boot monitor, programs that
17383 call boot monitor routines pass an unknown value in @code{$gp}.
17384 (In such situations, the boot monitor itself is usually compiled
17385 with @option{-G0}.)
17387 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
17388 @option{-mno-extern-sdata}.
17390 @item -membedded-data
17391 @itemx -mno-embedded-data
17392 @opindex membedded-data
17393 @opindex mno-embedded-data
17394 Allocate variables to the read-only data section first if possible, then
17395 next in the small data section if possible, otherwise in data.  This gives
17396 slightly slower code than the default, but reduces the amount of RAM required
17397 when executing, and thus may be preferred for some embedded systems.
17399 @item -muninit-const-in-rodata
17400 @itemx -mno-uninit-const-in-rodata
17401 @opindex muninit-const-in-rodata
17402 @opindex mno-uninit-const-in-rodata
17403 Put uninitialized @code{const} variables in the read-only data section.
17404 This option is only meaningful in conjunction with @option{-membedded-data}.
17406 @item -mcode-readable=@var{setting}
17407 @opindex mcode-readable
17408 Specify whether GCC may generate code that reads from executable sections.
17409 There are three possible settings:
17411 @table @gcctabopt
17412 @item -mcode-readable=yes
17413 Instructions may freely access executable sections.  This is the
17414 default setting.
17416 @item -mcode-readable=pcrel
17417 MIPS16 PC-relative load instructions can access executable sections,
17418 but other instructions must not do so.  This option is useful on 4KSc
17419 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
17420 It is also useful on processors that can be configured to have a dual
17421 instruction/data SRAM interface and that, like the M4K, automatically
17422 redirect PC-relative loads to the instruction RAM.
17424 @item -mcode-readable=no
17425 Instructions must not access executable sections.  This option can be
17426 useful on targets that are configured to have a dual instruction/data
17427 SRAM interface but that (unlike the M4K) do not automatically redirect
17428 PC-relative loads to the instruction RAM.
17429 @end table
17431 @item -msplit-addresses
17432 @itemx -mno-split-addresses
17433 @opindex msplit-addresses
17434 @opindex mno-split-addresses
17435 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
17436 relocation operators.  This option has been superseded by
17437 @option{-mexplicit-relocs} but is retained for backwards compatibility.
17439 @item -mexplicit-relocs
17440 @itemx -mno-explicit-relocs
17441 @opindex mexplicit-relocs
17442 @opindex mno-explicit-relocs
17443 Use (do not use) assembler relocation operators when dealing with symbolic
17444 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
17445 is to use assembler macros instead.
17447 @option{-mexplicit-relocs} is the default if GCC was configured
17448 to use an assembler that supports relocation operators.
17450 @item -mcheck-zero-division
17451 @itemx -mno-check-zero-division
17452 @opindex mcheck-zero-division
17453 @opindex mno-check-zero-division
17454 Trap (do not trap) on integer division by zero.
17456 The default is @option{-mcheck-zero-division}.
17458 @item -mdivide-traps
17459 @itemx -mdivide-breaks
17460 @opindex mdivide-traps
17461 @opindex mdivide-breaks
17462 MIPS systems check for division by zero by generating either a
17463 conditional trap or a break instruction.  Using traps results in
17464 smaller code, but is only supported on MIPS II and later.  Also, some
17465 versions of the Linux kernel have a bug that prevents trap from
17466 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
17467 allow conditional traps on architectures that support them and
17468 @option{-mdivide-breaks} to force the use of breaks.
17470 The default is usually @option{-mdivide-traps}, but this can be
17471 overridden at configure time using @option{--with-divide=breaks}.
17472 Divide-by-zero checks can be completely disabled using
17473 @option{-mno-check-zero-division}.
17475 @item -mmemcpy
17476 @itemx -mno-memcpy
17477 @opindex mmemcpy
17478 @opindex mno-memcpy
17479 Force (do not force) the use of @code{memcpy} for non-trivial block
17480 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
17481 most constant-sized copies.
17483 @item -mlong-calls
17484 @itemx -mno-long-calls
17485 @opindex mlong-calls
17486 @opindex mno-long-calls
17487 Disable (do not disable) use of the @code{jal} instruction.  Calling
17488 functions using @code{jal} is more efficient but requires the caller
17489 and callee to be in the same 256 megabyte segment.
17491 This option has no effect on abicalls code.  The default is
17492 @option{-mno-long-calls}.
17494 @item -mmad
17495 @itemx -mno-mad
17496 @opindex mmad
17497 @opindex mno-mad
17498 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
17499 instructions, as provided by the R4650 ISA@.
17501 @item -mimadd
17502 @itemx -mno-imadd
17503 @opindex mimadd
17504 @opindex mno-imadd
17505 Enable (disable) use of the @code{madd} and @code{msub} integer
17506 instructions.  The default is @option{-mimadd} on architectures
17507 that support @code{madd} and @code{msub} except for the 74k 
17508 architecture where it was found to generate slower code.
17510 @item -mfused-madd
17511 @itemx -mno-fused-madd
17512 @opindex mfused-madd
17513 @opindex mno-fused-madd
17514 Enable (disable) use of the floating-point multiply-accumulate
17515 instructions, when they are available.  The default is
17516 @option{-mfused-madd}.
17518 On the R8000 CPU when multiply-accumulate instructions are used,
17519 the intermediate product is calculated to infinite precision
17520 and is not subject to the FCSR Flush to Zero bit.  This may be
17521 undesirable in some circumstances.  On other processors the result
17522 is numerically identical to the equivalent computation using
17523 separate multiply, add, subtract and negate instructions.
17525 @item -nocpp
17526 @opindex nocpp
17527 Tell the MIPS assembler to not run its preprocessor over user
17528 assembler files (with a @samp{.s} suffix) when assembling them.
17530 @item -mfix-24k
17531 @item -mno-fix-24k
17532 @opindex mfix-24k
17533 @opindex mno-fix-24k
17534 Work around the 24K E48 (lost data on stores during refill) errata.
17535 The workarounds are implemented by the assembler rather than by GCC@.
17537 @item -mfix-r4000
17538 @itemx -mno-fix-r4000
17539 @opindex mfix-r4000
17540 @opindex mno-fix-r4000
17541 Work around certain R4000 CPU errata:
17542 @itemize @minus
17543 @item
17544 A double-word or a variable shift may give an incorrect result if executed
17545 immediately after starting an integer division.
17546 @item
17547 A double-word or a variable shift may give an incorrect result if executed
17548 while an integer multiplication is in progress.
17549 @item
17550 An integer division may give an incorrect result if started in a delay slot
17551 of a taken branch or a jump.
17552 @end itemize
17554 @item -mfix-r4400
17555 @itemx -mno-fix-r4400
17556 @opindex mfix-r4400
17557 @opindex mno-fix-r4400
17558 Work around certain R4400 CPU errata:
17559 @itemize @minus
17560 @item
17561 A double-word or a variable shift may give an incorrect result if executed
17562 immediately after starting an integer division.
17563 @end itemize
17565 @item -mfix-r10000
17566 @itemx -mno-fix-r10000
17567 @opindex mfix-r10000
17568 @opindex mno-fix-r10000
17569 Work around certain R10000 errata:
17570 @itemize @minus
17571 @item
17572 @code{ll}/@code{sc} sequences may not behave atomically on revisions
17573 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
17574 @end itemize
17576 This option can only be used if the target architecture supports
17577 branch-likely instructions.  @option{-mfix-r10000} is the default when
17578 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
17579 otherwise.
17581 @item -mfix-rm7000
17582 @itemx -mno-fix-rm7000
17583 @opindex mfix-rm7000
17584 Work around the RM7000 @code{dmult}/@code{dmultu} errata.  The
17585 workarounds are implemented by the assembler rather than by GCC@.
17587 @item -mfix-vr4120
17588 @itemx -mno-fix-vr4120
17589 @opindex mfix-vr4120
17590 Work around certain VR4120 errata:
17591 @itemize @minus
17592 @item
17593 @code{dmultu} does not always produce the correct result.
17594 @item
17595 @code{div} and @code{ddiv} do not always produce the correct result if one
17596 of the operands is negative.
17597 @end itemize
17598 The workarounds for the division errata rely on special functions in
17599 @file{libgcc.a}.  At present, these functions are only provided by
17600 the @code{mips64vr*-elf} configurations.
17602 Other VR4120 errata require a NOP to be inserted between certain pairs of
17603 instructions.  These errata are handled by the assembler, not by GCC itself.
17605 @item -mfix-vr4130
17606 @opindex mfix-vr4130
17607 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
17608 workarounds are implemented by the assembler rather than by GCC,
17609 although GCC avoids using @code{mflo} and @code{mfhi} if the
17610 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
17611 instructions are available instead.
17613 @item -mfix-sb1
17614 @itemx -mno-fix-sb1
17615 @opindex mfix-sb1
17616 Work around certain SB-1 CPU core errata.
17617 (This flag currently works around the SB-1 revision 2
17618 ``F1'' and ``F2'' floating-point errata.)
17620 @item -mr10k-cache-barrier=@var{setting}
17621 @opindex mr10k-cache-barrier
17622 Specify whether GCC should insert cache barriers to avoid the
17623 side-effects of speculation on R10K processors.
17625 In common with many processors, the R10K tries to predict the outcome
17626 of a conditional branch and speculatively executes instructions from
17627 the ``taken'' branch.  It later aborts these instructions if the
17628 predicted outcome is wrong.  However, on the R10K, even aborted
17629 instructions can have side effects.
17631 This problem only affects kernel stores and, depending on the system,
17632 kernel loads.  As an example, a speculatively-executed store may load
17633 the target memory into cache and mark the cache line as dirty, even if
17634 the store itself is later aborted.  If a DMA operation writes to the
17635 same area of memory before the ``dirty'' line is flushed, the cached
17636 data overwrites the DMA-ed data.  See the R10K processor manual
17637 for a full description, including other potential problems.
17639 One workaround is to insert cache barrier instructions before every memory
17640 access that might be speculatively executed and that might have side
17641 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
17642 controls GCC's implementation of this workaround.  It assumes that
17643 aborted accesses to any byte in the following regions does not have
17644 side effects:
17646 @enumerate
17647 @item
17648 the memory occupied by the current function's stack frame;
17650 @item
17651 the memory occupied by an incoming stack argument;
17653 @item
17654 the memory occupied by an object with a link-time-constant address.
17655 @end enumerate
17657 It is the kernel's responsibility to ensure that speculative
17658 accesses to these regions are indeed safe.
17660 If the input program contains a function declaration such as:
17662 @smallexample
17663 void foo (void);
17664 @end smallexample
17666 then the implementation of @code{foo} must allow @code{j foo} and
17667 @code{jal foo} to be executed speculatively.  GCC honors this
17668 restriction for functions it compiles itself.  It expects non-GCC
17669 functions (such as hand-written assembly code) to do the same.
17671 The option has three forms:
17673 @table @gcctabopt
17674 @item -mr10k-cache-barrier=load-store
17675 Insert a cache barrier before a load or store that might be
17676 speculatively executed and that might have side effects even
17677 if aborted.
17679 @item -mr10k-cache-barrier=store
17680 Insert a cache barrier before a store that might be speculatively
17681 executed and that might have side effects even if aborted.
17683 @item -mr10k-cache-barrier=none
17684 Disable the insertion of cache barriers.  This is the default setting.
17685 @end table
17687 @item -mflush-func=@var{func}
17688 @itemx -mno-flush-func
17689 @opindex mflush-func
17690 Specifies the function to call to flush the I and D caches, or to not
17691 call any such function.  If called, the function must take the same
17692 arguments as the common @code{_flush_func}, that is, the address of the
17693 memory range for which the cache is being flushed, the size of the
17694 memory range, and the number 3 (to flush both caches).  The default
17695 depends on the target GCC was configured for, but commonly is either
17696 @code{_flush_func} or @code{__cpu_flush}.
17698 @item mbranch-cost=@var{num}
17699 @opindex mbranch-cost
17700 Set the cost of branches to roughly @var{num} ``simple'' instructions.
17701 This cost is only a heuristic and is not guaranteed to produce
17702 consistent results across releases.  A zero cost redundantly selects
17703 the default, which is based on the @option{-mtune} setting.
17705 @item -mbranch-likely
17706 @itemx -mno-branch-likely
17707 @opindex mbranch-likely
17708 @opindex mno-branch-likely
17709 Enable or disable use of Branch Likely instructions, regardless of the
17710 default for the selected architecture.  By default, Branch Likely
17711 instructions may be generated if they are supported by the selected
17712 architecture.  An exception is for the MIPS32 and MIPS64 architectures
17713 and processors that implement those architectures; for those, Branch
17714 Likely instructions are not be generated by default because the MIPS32
17715 and MIPS64 architectures specifically deprecate their use.
17717 @item -mfp-exceptions
17718 @itemx -mno-fp-exceptions
17719 @opindex mfp-exceptions
17720 Specifies whether FP exceptions are enabled.  This affects how
17721 FP instructions are scheduled for some processors.
17722 The default is that FP exceptions are
17723 enabled.
17725 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
17726 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
17727 FP pipe.
17729 @item -mvr4130-align
17730 @itemx -mno-vr4130-align
17731 @opindex mvr4130-align
17732 The VR4130 pipeline is two-way superscalar, but can only issue two
17733 instructions together if the first one is 8-byte aligned.  When this
17734 option is enabled, GCC aligns pairs of instructions that it
17735 thinks should execute in parallel.
17737 This option only has an effect when optimizing for the VR4130.
17738 It normally makes code faster, but at the expense of making it bigger.
17739 It is enabled by default at optimization level @option{-O3}.
17741 @item -msynci
17742 @itemx -mno-synci
17743 @opindex msynci
17744 Enable (disable) generation of @code{synci} instructions on
17745 architectures that support it.  The @code{synci} instructions (if
17746 enabled) are generated when @code{__builtin___clear_cache} is
17747 compiled.
17749 This option defaults to @option{-mno-synci}, but the default can be
17750 overridden by configuring GCC with @option{--with-synci}.
17752 When compiling code for single processor systems, it is generally safe
17753 to use @code{synci}.  However, on many multi-core (SMP) systems, it
17754 does not invalidate the instruction caches on all cores and may lead
17755 to undefined behavior.
17757 @item -mrelax-pic-calls
17758 @itemx -mno-relax-pic-calls
17759 @opindex mrelax-pic-calls
17760 Try to turn PIC calls that are normally dispatched via register
17761 @code{$25} into direct calls.  This is only possible if the linker can
17762 resolve the destination at link-time and if the destination is within
17763 range for a direct call.
17765 @option{-mrelax-pic-calls} is the default if GCC was configured to use
17766 an assembler and a linker that support the @code{.reloc} assembly
17767 directive and @option{-mexplicit-relocs} is in effect.  With
17768 @option{-mno-explicit-relocs}, this optimization can be performed by the
17769 assembler and the linker alone without help from the compiler.
17771 @item -mmcount-ra-address
17772 @itemx -mno-mcount-ra-address
17773 @opindex mmcount-ra-address
17774 @opindex mno-mcount-ra-address
17775 Emit (do not emit) code that allows @code{_mcount} to modify the
17776 calling function's return address.  When enabled, this option extends
17777 the usual @code{_mcount} interface with a new @var{ra-address}
17778 parameter, which has type @code{intptr_t *} and is passed in register
17779 @code{$12}.  @code{_mcount} can then modify the return address by
17780 doing both of the following:
17781 @itemize
17782 @item
17783 Returning the new address in register @code{$31}.
17784 @item
17785 Storing the new address in @code{*@var{ra-address}},
17786 if @var{ra-address} is nonnull.
17787 @end itemize
17789 The default is @option{-mno-mcount-ra-address}.
17791 @end table
17793 @node MMIX Options
17794 @subsection MMIX Options
17795 @cindex MMIX Options
17797 These options are defined for the MMIX:
17799 @table @gcctabopt
17800 @item -mlibfuncs
17801 @itemx -mno-libfuncs
17802 @opindex mlibfuncs
17803 @opindex mno-libfuncs
17804 Specify that intrinsic library functions are being compiled, passing all
17805 values in registers, no matter the size.
17807 @item -mepsilon
17808 @itemx -mno-epsilon
17809 @opindex mepsilon
17810 @opindex mno-epsilon
17811 Generate floating-point comparison instructions that compare with respect
17812 to the @code{rE} epsilon register.
17814 @item -mabi=mmixware
17815 @itemx -mabi=gnu
17816 @opindex mabi=mmixware
17817 @opindex mabi=gnu
17818 Generate code that passes function parameters and return values that (in
17819 the called function) are seen as registers @code{$0} and up, as opposed to
17820 the GNU ABI which uses global registers @code{$231} and up.
17822 @item -mzero-extend
17823 @itemx -mno-zero-extend
17824 @opindex mzero-extend
17825 @opindex mno-zero-extend
17826 When reading data from memory in sizes shorter than 64 bits, use (do not
17827 use) zero-extending load instructions by default, rather than
17828 sign-extending ones.
17830 @item -mknuthdiv
17831 @itemx -mno-knuthdiv
17832 @opindex mknuthdiv
17833 @opindex mno-knuthdiv
17834 Make the result of a division yielding a remainder have the same sign as
17835 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
17836 remainder follows the sign of the dividend.  Both methods are
17837 arithmetically valid, the latter being almost exclusively used.
17839 @item -mtoplevel-symbols
17840 @itemx -mno-toplevel-symbols
17841 @opindex mtoplevel-symbols
17842 @opindex mno-toplevel-symbols
17843 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
17844 code can be used with the @code{PREFIX} assembly directive.
17846 @item -melf
17847 @opindex melf
17848 Generate an executable in the ELF format, rather than the default
17849 @samp{mmo} format used by the @command{mmix} simulator.
17851 @item -mbranch-predict
17852 @itemx -mno-branch-predict
17853 @opindex mbranch-predict
17854 @opindex mno-branch-predict
17855 Use (do not use) the probable-branch instructions, when static branch
17856 prediction indicates a probable branch.
17858 @item -mbase-addresses
17859 @itemx -mno-base-addresses
17860 @opindex mbase-addresses
17861 @opindex mno-base-addresses
17862 Generate (do not generate) code that uses @emph{base addresses}.  Using a
17863 base address automatically generates a request (handled by the assembler
17864 and the linker) for a constant to be set up in a global register.  The
17865 register is used for one or more base address requests within the range 0
17866 to 255 from the value held in the register.  The generally leads to short
17867 and fast code, but the number of different data items that can be
17868 addressed is limited.  This means that a program that uses lots of static
17869 data may require @option{-mno-base-addresses}.
17871 @item -msingle-exit
17872 @itemx -mno-single-exit
17873 @opindex msingle-exit
17874 @opindex mno-single-exit
17875 Force (do not force) generated code to have a single exit point in each
17876 function.
17877 @end table
17879 @node MN10300 Options
17880 @subsection MN10300 Options
17881 @cindex MN10300 options
17883 These @option{-m} options are defined for Matsushita MN10300 architectures:
17885 @table @gcctabopt
17886 @item -mmult-bug
17887 @opindex mmult-bug
17888 Generate code to avoid bugs in the multiply instructions for the MN10300
17889 processors.  This is the default.
17891 @item -mno-mult-bug
17892 @opindex mno-mult-bug
17893 Do not generate code to avoid bugs in the multiply instructions for the
17894 MN10300 processors.
17896 @item -mam33
17897 @opindex mam33
17898 Generate code using features specific to the AM33 processor.
17900 @item -mno-am33
17901 @opindex mno-am33
17902 Do not generate code using features specific to the AM33 processor.  This
17903 is the default.
17905 @item -mam33-2
17906 @opindex mam33-2
17907 Generate code using features specific to the AM33/2.0 processor.
17909 @item -mam34
17910 @opindex mam34
17911 Generate code using features specific to the AM34 processor.
17913 @item -mtune=@var{cpu-type}
17914 @opindex mtune
17915 Use the timing characteristics of the indicated CPU type when
17916 scheduling instructions.  This does not change the targeted processor
17917 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
17918 @samp{am33-2} or @samp{am34}.
17920 @item -mreturn-pointer-on-d0
17921 @opindex mreturn-pointer-on-d0
17922 When generating a function that returns a pointer, return the pointer
17923 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
17924 only in @code{a0}, and attempts to call such functions without a prototype
17925 result in errors.  Note that this option is on by default; use
17926 @option{-mno-return-pointer-on-d0} to disable it.
17928 @item -mno-crt0
17929 @opindex mno-crt0
17930 Do not link in the C run-time initialization object file.
17932 @item -mrelax
17933 @opindex mrelax
17934 Indicate to the linker that it should perform a relaxation optimization pass
17935 to shorten branches, calls and absolute memory addresses.  This option only
17936 has an effect when used on the command line for the final link step.
17938 This option makes symbolic debugging impossible.
17940 @item -mliw
17941 @opindex mliw
17942 Allow the compiler to generate @emph{Long Instruction Word}
17943 instructions if the target is the @samp{AM33} or later.  This is the
17944 default.  This option defines the preprocessor macro @code{__LIW__}.
17946 @item -mnoliw
17947 @opindex mnoliw
17948 Do not allow the compiler to generate @emph{Long Instruction Word}
17949 instructions.  This option defines the preprocessor macro
17950 @code{__NO_LIW__}.
17952 @item -msetlb
17953 @opindex msetlb
17954 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
17955 instructions if the target is the @samp{AM33} or later.  This is the
17956 default.  This option defines the preprocessor macro @code{__SETLB__}.
17958 @item -mnosetlb
17959 @opindex mnosetlb
17960 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
17961 instructions.  This option defines the preprocessor macro
17962 @code{__NO_SETLB__}.
17964 @end table
17966 @node Moxie Options
17967 @subsection Moxie Options
17968 @cindex Moxie Options
17970 @table @gcctabopt
17972 @item -meb
17973 @opindex meb
17974 Generate big-endian code.  This is the default for @samp{moxie-*-*}
17975 configurations.
17977 @item -mel
17978 @opindex mel
17979 Generate little-endian code.
17981 @item -mmul.x
17982 @opindex mmul.x
17983 Generate mul.x and umul.x instructions.  This is the default for
17984 @samp{moxiebox-*-*} configurations.
17986 @item -mno-crt0
17987 @opindex mno-crt0
17988 Do not link in the C run-time initialization object file.
17990 @end table
17992 @node MSP430 Options
17993 @subsection MSP430 Options
17994 @cindex MSP430 Options
17996 These options are defined for the MSP430:
17998 @table @gcctabopt
18000 @item -masm-hex
18001 @opindex masm-hex
18002 Force assembly output to always use hex constants.  Normally such
18003 constants are signed decimals, but this option is available for
18004 testsuite and/or aesthetic purposes.
18006 @item -mmcu=
18007 @opindex mmcu=
18008 Select the MCU to target.  This is used to create a C preprocessor
18009 symbol based upon the MCU name, converted to upper case and pre- and
18010 post-fixed with @samp{__}.  This in turn is used by the
18011 @file{msp430.h} header file to select an MCU-specific supplementary
18012 header file.
18014 The option also sets the ISA to use.  If the MCU name is one that is
18015 known to only support the 430 ISA then that is selected, otherwise the
18016 430X ISA is selected.  A generic MCU name of @samp{msp430} can also be
18017 used to select the 430 ISA.  Similarly the generic @samp{msp430x} MCU
18018 name selects the 430X ISA.
18020 In addition an MCU-specific linker script is added to the linker
18021 command line.  The script's name is the name of the MCU with
18022 @file{.ld} appended.  Thus specifying @option{-mmcu=xxx} on the @command{gcc}
18023 command line defines the C preprocessor symbol @code{__XXX__} and
18024 cause the linker to search for a script called @file{xxx.ld}.
18026 This option is also passed on to the assembler.
18028 @item -mcpu=
18029 @opindex mcpu=
18030 Specifies the ISA to use.  Accepted values are @samp{msp430},
18031 @samp{msp430x} and @samp{msp430xv2}.  This option is deprecated.  The
18032 @option{-mmcu=} option should be used to select the ISA.
18034 @item -msim
18035 @opindex msim
18036 Link to the simulator runtime libraries and linker script.  Overrides
18037 any scripts that would be selected by the @option{-mmcu=} option.
18039 @item -mlarge
18040 @opindex mlarge
18041 Use large-model addressing (20-bit pointers, 32-bit @code{size_t}).
18043 @item -msmall
18044 @opindex msmall
18045 Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
18047 @item -mrelax
18048 @opindex mrelax
18049 This option is passed to the assembler and linker, and allows the
18050 linker to perform certain optimizations that cannot be done until
18051 the final link.
18053 @item mhwmult=
18054 @opindex mhwmult=
18055 Describes the type of hardware multiply supported by the target.
18056 Accepted values are @samp{none} for no hardware multiply, @samp{16bit}
18057 for the original 16-bit-only multiply supported by early MCUs.
18058 @samp{32bit} for the 16/32-bit multiply supported by later MCUs and
18059 @samp{f5series} for the 16/32-bit multiply supported by F5-series MCUs.
18060 A value of @samp{auto} can also be given.  This tells GCC to deduce
18061 the hardware multiply support based upon the MCU name provided by the
18062 @option{-mmcu} option.  If no @option{-mmcu} option is specified then
18063 @samp{32bit} hardware multiply support is assumed.  @samp{auto} is the
18064 default setting.
18066 Hardware multiplies are normally performed by calling a library
18067 routine.  This saves space in the generated code.  When compiling at
18068 @option{-O3} or higher however the hardware multiplier is invoked
18069 inline.  This makes for bigger, but faster code.
18071 The hardware multiply routines disable interrupts whilst running and
18072 restore the previous interrupt state when they finish.  This makes
18073 them safe to use inside interrupt handlers as well as in normal code.
18075 @item -minrt
18076 @opindex minrt
18077 Enable the use of a minimum runtime environment - no static
18078 initializers or constructors.  This is intended for memory-constrained
18079 devices.  The compiler includes special symbols in some objects
18080 that tell the linker and runtime which code fragments are required.
18082 @end table
18084 @node NDS32 Options
18085 @subsection NDS32 Options
18086 @cindex NDS32 Options
18088 These options are defined for NDS32 implementations:
18090 @table @gcctabopt
18092 @item -mbig-endian
18093 @opindex mbig-endian
18094 Generate code in big-endian mode.
18096 @item -mlittle-endian
18097 @opindex mlittle-endian
18098 Generate code in little-endian mode.
18100 @item -mreduced-regs
18101 @opindex mreduced-regs
18102 Use reduced-set registers for register allocation.
18104 @item -mfull-regs
18105 @opindex mfull-regs
18106 Use full-set registers for register allocation.
18108 @item -mcmov
18109 @opindex mcmov
18110 Generate conditional move instructions.
18112 @item -mno-cmov
18113 @opindex mno-cmov
18114 Do not generate conditional move instructions.
18116 @item -mperf-ext
18117 @opindex mperf-ext
18118 Generate performance extension instructions.
18120 @item -mno-perf-ext
18121 @opindex mno-perf-ext
18122 Do not generate performance extension instructions.
18124 @item -mv3push
18125 @opindex mv3push
18126 Generate v3 push25/pop25 instructions.
18128 @item -mno-v3push
18129 @opindex mno-v3push
18130 Do not generate v3 push25/pop25 instructions.
18132 @item -m16-bit
18133 @opindex m16-bit
18134 Generate 16-bit instructions.
18136 @item -mno-16-bit
18137 @opindex mno-16-bit
18138 Do not generate 16-bit instructions.
18140 @item -misr-vector-size=@var{num}
18141 @opindex misr-vector-size
18142 Specify the size of each interrupt vector, which must be 4 or 16.
18144 @item -mcache-block-size=@var{num}
18145 @opindex mcache-block-size
18146 Specify the size of each cache block,
18147 which must be a power of 2 between 4 and 512.
18149 @item -march=@var{arch}
18150 @opindex march
18151 Specify the name of the target architecture.
18153 @item -mcmodel=@var{code-model}
18154 @opindex mcmodel
18155 Set the code model to one of
18156 @table @asis
18157 @item @samp{small}
18158 All the data and read-only data segments must be within 512KB addressing space.
18159 The text segment must be within 16MB addressing space.
18160 @item @samp{medium}
18161 The data segment must be within 512KB while the read-only data segment can be
18162 within 4GB addressing space.  The text segment should be still within 16MB
18163 addressing space.
18164 @item @samp{large}
18165 All the text and data segments can be within 4GB addressing space.
18166 @end table
18168 @item -mctor-dtor
18169 @opindex mctor-dtor
18170 Enable constructor/destructor feature.
18172 @item -mrelax
18173 @opindex mrelax
18174 Guide linker to relax instructions.
18176 @end table
18178 @node Nios II Options
18179 @subsection Nios II Options
18180 @cindex Nios II options
18181 @cindex Altera Nios II options
18183 These are the options defined for the Altera Nios II processor.
18185 @table @gcctabopt
18187 @item -G @var{num}
18188 @opindex G
18189 @cindex smaller data references
18190 Put global and static objects less than or equal to @var{num} bytes
18191 into the small data or BSS sections instead of the normal data or BSS
18192 sections.  The default value of @var{num} is 8.
18194 @item -mgpopt=@var{option}
18195 @item -mgpopt
18196 @itemx -mno-gpopt
18197 @opindex mgpopt
18198 @opindex mno-gpopt
18199 Generate (do not generate) GP-relative accesses.  The following 
18200 @var{option} names are recognized:
18202 @table @samp
18204 @item none
18205 Do not generate GP-relative accesses.
18207 @item local
18208 Generate GP-relative accesses for small data objects that are not 
18209 external or weak.  Also use GP-relative addressing for objects that
18210 have been explicitly placed in a small data section via a @code{section}
18211 attribute.
18213 @item global
18214 As for @samp{local}, but also generate GP-relative accesses for
18215 small data objects that are external or weak.  If you use this option,
18216 you must ensure that all parts of your program (including libraries) are
18217 compiled with the same @option{-G} setting.
18219 @item data
18220 Generate GP-relative accesses for all data objects in the program.  If you
18221 use this option, the entire data and BSS segments
18222 of your program must fit in 64K of memory and you must use an appropriate
18223 linker script to allocate them within the addressible range of the
18224 global pointer.
18226 @item all
18227 Generate GP-relative addresses for function pointers as well as data
18228 pointers.  If you use this option, the entire text, data, and BSS segments
18229 of your program must fit in 64K of memory and you must use an appropriate
18230 linker script to allocate them within the addressible range of the
18231 global pointer.
18233 @end table
18235 @option{-mgpopt} is equivalent to @option{-mgpopt=local}, and
18236 @option{-mno-gpopt} is equivalent to @option{-mgpopt=none}.
18238 The default is @option{-mgpopt} except when @option{-fpic} or
18239 @option{-fPIC} is specified to generate position-independent code.
18240 Note that the Nios II ABI does not permit GP-relative accesses from
18241 shared libraries.
18243 You may need to specify @option{-mno-gpopt} explicitly when building
18244 programs that include large amounts of small data, including large
18245 GOT data sections.  In this case, the 16-bit offset for GP-relative
18246 addressing may not be large enough to allow access to the entire 
18247 small data section.
18249 @item -mel
18250 @itemx -meb
18251 @opindex mel
18252 @opindex meb
18253 Generate little-endian (default) or big-endian (experimental) code,
18254 respectively.
18256 @item -mbypass-cache
18257 @itemx -mno-bypass-cache
18258 @opindex mno-bypass-cache
18259 @opindex mbypass-cache
18260 Force all load and store instructions to always bypass cache by 
18261 using I/O variants of the instructions. The default is not to
18262 bypass the cache.
18264 @item -mno-cache-volatile 
18265 @itemx -mcache-volatile       
18266 @opindex mcache-volatile 
18267 @opindex mno-cache-volatile
18268 Volatile memory access bypass the cache using the I/O variants of 
18269 the load and store instructions. The default is not to bypass the cache.
18271 @item -mno-fast-sw-div
18272 @itemx -mfast-sw-div
18273 @opindex mno-fast-sw-div
18274 @opindex mfast-sw-div
18275 Do not use table-based fast divide for small numbers. The default 
18276 is to use the fast divide at @option{-O3} and above.
18278 @item -mno-hw-mul
18279 @itemx -mhw-mul
18280 @itemx -mno-hw-mulx
18281 @itemx -mhw-mulx
18282 @itemx -mno-hw-div
18283 @itemx -mhw-div
18284 @opindex mno-hw-mul
18285 @opindex mhw-mul
18286 @opindex mno-hw-mulx
18287 @opindex mhw-mulx
18288 @opindex mno-hw-div
18289 @opindex mhw-div
18290 Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of 
18291 instructions by the compiler. The default is to emit @code{mul}
18292 and not emit @code{div} and @code{mulx}.
18294 @item -mcustom-@var{insn}=@var{N}
18295 @itemx -mno-custom-@var{insn}
18296 @opindex mcustom-@var{insn}
18297 @opindex mno-custom-@var{insn}
18298 Each @option{-mcustom-@var{insn}=@var{N}} option enables use of a
18299 custom instruction with encoding @var{N} when generating code that uses 
18300 @var{insn}.  For example, @option{-mcustom-fadds=253} generates custom
18301 instruction 253 for single-precision floating-point add operations instead
18302 of the default behavior of using a library call.
18304 The following values of @var{insn} are supported.  Except as otherwise
18305 noted, floating-point operations are expected to be implemented with
18306 normal IEEE 754 semantics and correspond directly to the C operators or the
18307 equivalent GCC built-in functions (@pxref{Other Builtins}).
18309 Single-precision floating point:
18310 @table @asis
18312 @item @samp{fadds}, @samp{fsubs}, @samp{fdivs}, @samp{fmuls}
18313 Binary arithmetic operations.
18315 @item @samp{fnegs}
18316 Unary negation.
18318 @item @samp{fabss}
18319 Unary absolute value.
18321 @item @samp{fcmpeqs}, @samp{fcmpges}, @samp{fcmpgts}, @samp{fcmples}, @samp{fcmplts}, @samp{fcmpnes}
18322 Comparison operations.
18324 @item @samp{fmins}, @samp{fmaxs}
18325 Floating-point minimum and maximum.  These instructions are only
18326 generated if @option{-ffinite-math-only} is specified.
18328 @item @samp{fsqrts}
18329 Unary square root operation.
18331 @item @samp{fcoss}, @samp{fsins}, @samp{ftans}, @samp{fatans}, @samp{fexps}, @samp{flogs}
18332 Floating-point trigonometric and exponential functions.  These instructions
18333 are only generated if @option{-funsafe-math-optimizations} is also specified.
18335 @end table
18337 Double-precision floating point:
18338 @table @asis
18340 @item @samp{faddd}, @samp{fsubd}, @samp{fdivd}, @samp{fmuld}
18341 Binary arithmetic operations.
18343 @item @samp{fnegd}
18344 Unary negation.
18346 @item @samp{fabsd}
18347 Unary absolute value.
18349 @item @samp{fcmpeqd}, @samp{fcmpged}, @samp{fcmpgtd}, @samp{fcmpled}, @samp{fcmpltd}, @samp{fcmpned}
18350 Comparison operations.
18352 @item @samp{fmind}, @samp{fmaxd}
18353 Double-precision minimum and maximum.  These instructions are only
18354 generated if @option{-ffinite-math-only} is specified.
18356 @item @samp{fsqrtd}
18357 Unary square root operation.
18359 @item @samp{fcosd}, @samp{fsind}, @samp{ftand}, @samp{fatand}, @samp{fexpd}, @samp{flogd}
18360 Double-precision trigonometric and exponential functions.  These instructions
18361 are only generated if @option{-funsafe-math-optimizations} is also specified.
18363 @end table
18365 Conversions:
18366 @table @asis
18367 @item @samp{fextsd}
18368 Conversion from single precision to double precision.
18370 @item @samp{ftruncds}
18371 Conversion from double precision to single precision.
18373 @item @samp{fixsi}, @samp{fixsu}, @samp{fixdi}, @samp{fixdu}
18374 Conversion from floating point to signed or unsigned integer types, with
18375 truncation towards zero.
18377 @item @samp{round}
18378 Conversion from single-precision floating point to signed integer,
18379 rounding to the nearest integer and ties away from zero.
18380 This corresponds to the @code{__builtin_lroundf} function when
18381 @option{-fno-math-errno} is used.
18383 @item @samp{floatis}, @samp{floatus}, @samp{floatid}, @samp{floatud}
18384 Conversion from signed or unsigned integer types to floating-point types.
18386 @end table
18388 In addition, all of the following transfer instructions for internal
18389 registers X and Y must be provided to use any of the double-precision
18390 floating-point instructions.  Custom instructions taking two
18391 double-precision source operands expect the first operand in the
18392 64-bit register X.  The other operand (or only operand of a unary
18393 operation) is given to the custom arithmetic instruction with the
18394 least significant half in source register @var{src1} and the most
18395 significant half in @var{src2}.  A custom instruction that returns a
18396 double-precision result returns the most significant 32 bits in the
18397 destination register and the other half in 32-bit register Y.  
18398 GCC automatically generates the necessary code sequences to write
18399 register X and/or read register Y when double-precision floating-point
18400 instructions are used.
18402 @table @asis
18404 @item @samp{fwrx}
18405 Write @var{src1} into the least significant half of X and @var{src2} into
18406 the most significant half of X.
18408 @item @samp{fwry}
18409 Write @var{src1} into Y.
18411 @item @samp{frdxhi}, @samp{frdxlo}
18412 Read the most or least (respectively) significant half of X and store it in
18413 @var{dest}.
18415 @item @samp{frdy}
18416 Read the value of Y and store it into @var{dest}.
18417 @end table
18419 Note that you can gain more local control over generation of Nios II custom
18420 instructions by using the @code{target("custom-@var{insn}=@var{N}")}
18421 and @code{target("no-custom-@var{insn}")} function attributes
18422 (@pxref{Function Attributes})
18423 or pragmas (@pxref{Function Specific Option Pragmas}).
18425 @item -mcustom-fpu-cfg=@var{name}
18426 @opindex mcustom-fpu-cfg
18428 This option enables a predefined, named set of custom instruction encodings
18429 (see @option{-mcustom-@var{insn}} above).  
18430 Currently, the following sets are defined:
18432 @option{-mcustom-fpu-cfg=60-1} is equivalent to:
18433 @gccoptlist{-mcustom-fmuls=252 @gol
18434 -mcustom-fadds=253 @gol
18435 -mcustom-fsubs=254 @gol
18436 -fsingle-precision-constant}
18438 @option{-mcustom-fpu-cfg=60-2} is equivalent to:
18439 @gccoptlist{-mcustom-fmuls=252 @gol
18440 -mcustom-fadds=253 @gol
18441 -mcustom-fsubs=254 @gol
18442 -mcustom-fdivs=255 @gol
18443 -fsingle-precision-constant}
18445 @option{-mcustom-fpu-cfg=72-3} is equivalent to:
18446 @gccoptlist{-mcustom-floatus=243 @gol
18447 -mcustom-fixsi=244 @gol
18448 -mcustom-floatis=245 @gol
18449 -mcustom-fcmpgts=246 @gol
18450 -mcustom-fcmples=249 @gol
18451 -mcustom-fcmpeqs=250 @gol
18452 -mcustom-fcmpnes=251 @gol
18453 -mcustom-fmuls=252 @gol
18454 -mcustom-fadds=253 @gol
18455 -mcustom-fsubs=254 @gol
18456 -mcustom-fdivs=255 @gol
18457 -fsingle-precision-constant}
18459 Custom instruction assignments given by individual
18460 @option{-mcustom-@var{insn}=} options override those given by
18461 @option{-mcustom-fpu-cfg=}, regardless of the
18462 order of the options on the command line.
18464 Note that you can gain more local control over selection of a FPU
18465 configuration by using the @code{target("custom-fpu-cfg=@var{name}")}
18466 function attribute (@pxref{Function Attributes})
18467 or pragma (@pxref{Function Specific Option Pragmas}).
18469 @end table
18471 These additional @samp{-m} options are available for the Altera Nios II
18472 ELF (bare-metal) target:
18474 @table @gcctabopt
18476 @item -mhal
18477 @opindex mhal
18478 Link with HAL BSP.  This suppresses linking with the GCC-provided C runtime
18479 startup and termination code, and is typically used in conjunction with
18480 @option{-msys-crt0=} to specify the location of the alternate startup code
18481 provided by the HAL BSP.
18483 @item -msmallc
18484 @opindex msmallc
18485 Link with a limited version of the C library, @option{-lsmallc}, rather than
18486 Newlib.
18488 @item -msys-crt0=@var{startfile}
18489 @opindex msys-crt0
18490 @var{startfile} is the file name of the startfile (crt0) to use 
18491 when linking.  This option is only useful in conjunction with @option{-mhal}.
18493 @item -msys-lib=@var{systemlib}
18494 @opindex msys-lib
18495 @var{systemlib} is the library name of the library that provides
18496 low-level system calls required by the C library,
18497 e.g. @code{read} and @code{write}.
18498 This option is typically used to link with a library provided by a HAL BSP.
18500 @end table
18502 @node Nvidia PTX Options
18503 @subsection Nvidia PTX Options
18504 @cindex Nvidia PTX options
18505 @cindex nvptx options
18507 These options are defined for Nvidia PTX:
18509 @table @gcctabopt
18511 @item -m32
18512 @itemx -m64
18513 @opindex m32
18514 @opindex m64
18515 Generate code for 32-bit or 64-bit ABI.
18517 @item -mmainkernel
18518 @opindex mmainkernel
18519 Link in code for a __main kernel.  This is for stand-alone instead of
18520 offloading execution.
18522 @end table
18524 @node PDP-11 Options
18525 @subsection PDP-11 Options
18526 @cindex PDP-11 Options
18528 These options are defined for the PDP-11:
18530 @table @gcctabopt
18531 @item -mfpu
18532 @opindex mfpu
18533 Use hardware FPP floating point.  This is the default.  (FIS floating
18534 point on the PDP-11/40 is not supported.)
18536 @item -msoft-float
18537 @opindex msoft-float
18538 Do not use hardware floating point.
18540 @item -mac0
18541 @opindex mac0
18542 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
18544 @item -mno-ac0
18545 @opindex mno-ac0
18546 Return floating-point results in memory.  This is the default.
18548 @item -m40
18549 @opindex m40
18550 Generate code for a PDP-11/40.
18552 @item -m45
18553 @opindex m45
18554 Generate code for a PDP-11/45.  This is the default.
18556 @item -m10
18557 @opindex m10
18558 Generate code for a PDP-11/10.
18560 @item -mbcopy-builtin
18561 @opindex mbcopy-builtin
18562 Use inline @code{movmemhi} patterns for copying memory.  This is the
18563 default.
18565 @item -mbcopy
18566 @opindex mbcopy
18567 Do not use inline @code{movmemhi} patterns for copying memory.
18569 @item -mint16
18570 @itemx -mno-int32
18571 @opindex mint16
18572 @opindex mno-int32
18573 Use 16-bit @code{int}.  This is the default.
18575 @item -mint32
18576 @itemx -mno-int16
18577 @opindex mint32
18578 @opindex mno-int16
18579 Use 32-bit @code{int}.
18581 @item -mfloat64
18582 @itemx -mno-float32
18583 @opindex mfloat64
18584 @opindex mno-float32
18585 Use 64-bit @code{float}.  This is the default.
18587 @item -mfloat32
18588 @itemx -mno-float64
18589 @opindex mfloat32
18590 @opindex mno-float64
18591 Use 32-bit @code{float}.
18593 @item -mabshi
18594 @opindex mabshi
18595 Use @code{abshi2} pattern.  This is the default.
18597 @item -mno-abshi
18598 @opindex mno-abshi
18599 Do not use @code{abshi2} pattern.
18601 @item -mbranch-expensive
18602 @opindex mbranch-expensive
18603 Pretend that branches are expensive.  This is for experimenting with
18604 code generation only.
18606 @item -mbranch-cheap
18607 @opindex mbranch-cheap
18608 Do not pretend that branches are expensive.  This is the default.
18610 @item -munix-asm
18611 @opindex munix-asm
18612 Use Unix assembler syntax.  This is the default when configured for
18613 @samp{pdp11-*-bsd}.
18615 @item -mdec-asm
18616 @opindex mdec-asm
18617 Use DEC assembler syntax.  This is the default when configured for any
18618 PDP-11 target other than @samp{pdp11-*-bsd}.
18619 @end table
18621 @node picoChip Options
18622 @subsection picoChip Options
18623 @cindex picoChip options
18625 These @samp{-m} options are defined for picoChip implementations:
18627 @table @gcctabopt
18629 @item -mae=@var{ae_type}
18630 @opindex mcpu
18631 Set the instruction set, register set, and instruction scheduling
18632 parameters for array element type @var{ae_type}.  Supported values
18633 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
18635 @option{-mae=ANY} selects a completely generic AE type.  Code
18636 generated with this option runs on any of the other AE types.  The
18637 code is not as efficient as it would be if compiled for a specific
18638 AE type, and some types of operation (e.g., multiplication) do not
18639 work properly on all types of AE.
18641 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
18642 for compiled code, and is the default.
18644 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
18645 option may suffer from poor performance of byte (char) manipulation,
18646 since the DSP AE does not provide hardware support for byte load/stores.
18648 @item -msymbol-as-address
18649 Enable the compiler to directly use a symbol name as an address in a
18650 load/store instruction, without first loading it into a
18651 register.  Typically, the use of this option generates larger
18652 programs, which run faster than when the option isn't used.  However, the
18653 results vary from program to program, so it is left as a user option,
18654 rather than being permanently enabled.
18656 @item -mno-inefficient-warnings
18657 Disables warnings about the generation of inefficient code.  These
18658 warnings can be generated, for example, when compiling code that
18659 performs byte-level memory operations on the MAC AE type.  The MAC AE has
18660 no hardware support for byte-level memory operations, so all byte
18661 load/stores must be synthesized from word load/store operations.  This is
18662 inefficient and a warning is generated to indicate
18663 that you should rewrite the code to avoid byte operations, or to target
18664 an AE type that has the necessary hardware support.  This option disables
18665 these warnings.
18667 @end table
18669 @node PowerPC Options
18670 @subsection PowerPC Options
18671 @cindex PowerPC options
18673 These are listed under @xref{RS/6000 and PowerPC Options}.
18675 @node RL78 Options
18676 @subsection RL78 Options
18677 @cindex RL78 Options
18679 @table @gcctabopt
18681 @item -msim
18682 @opindex msim
18683 Links in additional target libraries to support operation within a
18684 simulator.
18686 @item -mmul=none
18687 @itemx -mmul=g13
18688 @itemx -mmul=rl78
18689 @opindex mmul
18690 Specifies the type of hardware multiplication support to be used.  The
18691 default is @samp{none}, which uses software multiplication functions.
18692 The @samp{g13} option is for the hardware multiply/divide peripheral
18693 only on the RL78/G13 targets.  The @samp{rl78} option is for the
18694 standard hardware multiplication defined in the RL78 software manual.
18696 @item -m64bit-doubles
18697 @itemx -m32bit-doubles
18698 @opindex m64bit-doubles
18699 @opindex m32bit-doubles
18700 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
18701 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
18702 @option{-m32bit-doubles}.
18704 @end table
18706 @node RS/6000 and PowerPC Options
18707 @subsection IBM RS/6000 and PowerPC Options
18708 @cindex RS/6000 and PowerPC Options
18709 @cindex IBM RS/6000 and PowerPC Options
18711 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
18712 @table @gcctabopt
18713 @item -mpowerpc-gpopt
18714 @itemx -mno-powerpc-gpopt
18715 @itemx -mpowerpc-gfxopt
18716 @itemx -mno-powerpc-gfxopt
18717 @need 800
18718 @itemx -mpowerpc64
18719 @itemx -mno-powerpc64
18720 @itemx -mmfcrf
18721 @itemx -mno-mfcrf
18722 @itemx -mpopcntb
18723 @itemx -mno-popcntb
18724 @itemx -mpopcntd
18725 @itemx -mno-popcntd
18726 @itemx -mfprnd
18727 @itemx -mno-fprnd
18728 @need 800
18729 @itemx -mcmpb
18730 @itemx -mno-cmpb
18731 @itemx -mmfpgpr
18732 @itemx -mno-mfpgpr
18733 @itemx -mhard-dfp
18734 @itemx -mno-hard-dfp
18735 @opindex mpowerpc-gpopt
18736 @opindex mno-powerpc-gpopt
18737 @opindex mpowerpc-gfxopt
18738 @opindex mno-powerpc-gfxopt
18739 @opindex mpowerpc64
18740 @opindex mno-powerpc64
18741 @opindex mmfcrf
18742 @opindex mno-mfcrf
18743 @opindex mpopcntb
18744 @opindex mno-popcntb
18745 @opindex mpopcntd
18746 @opindex mno-popcntd
18747 @opindex mfprnd
18748 @opindex mno-fprnd
18749 @opindex mcmpb
18750 @opindex mno-cmpb
18751 @opindex mmfpgpr
18752 @opindex mno-mfpgpr
18753 @opindex mhard-dfp
18754 @opindex mno-hard-dfp
18755 You use these options to specify which instructions are available on the
18756 processor you are using.  The default value of these options is
18757 determined when configuring GCC@.  Specifying the
18758 @option{-mcpu=@var{cpu_type}} overrides the specification of these
18759 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
18760 rather than the options listed above.
18762 Specifying @option{-mpowerpc-gpopt} allows
18763 GCC to use the optional PowerPC architecture instructions in the
18764 General Purpose group, including floating-point square root.  Specifying
18765 @option{-mpowerpc-gfxopt} allows GCC to
18766 use the optional PowerPC architecture instructions in the Graphics
18767 group, including floating-point select.
18769 The @option{-mmfcrf} option allows GCC to generate the move from
18770 condition register field instruction implemented on the POWER4
18771 processor and other processors that support the PowerPC V2.01
18772 architecture.
18773 The @option{-mpopcntb} option allows GCC to generate the popcount and
18774 double-precision FP reciprocal estimate instruction implemented on the
18775 POWER5 processor and other processors that support the PowerPC V2.02
18776 architecture.
18777 The @option{-mpopcntd} option allows GCC to generate the popcount
18778 instruction implemented on the POWER7 processor and other processors
18779 that support the PowerPC V2.06 architecture.
18780 The @option{-mfprnd} option allows GCC to generate the FP round to
18781 integer instructions implemented on the POWER5+ processor and other
18782 processors that support the PowerPC V2.03 architecture.
18783 The @option{-mcmpb} option allows GCC to generate the compare bytes
18784 instruction implemented on the POWER6 processor and other processors
18785 that support the PowerPC V2.05 architecture.
18786 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
18787 general-purpose register instructions implemented on the POWER6X
18788 processor and other processors that support the extended PowerPC V2.05
18789 architecture.
18790 The @option{-mhard-dfp} option allows GCC to generate the decimal
18791 floating-point instructions implemented on some POWER processors.
18793 The @option{-mpowerpc64} option allows GCC to generate the additional
18794 64-bit instructions that are found in the full PowerPC64 architecture
18795 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
18796 @option{-mno-powerpc64}.
18798 @item -mcpu=@var{cpu_type}
18799 @opindex mcpu
18800 Set architecture type, register usage, and
18801 instruction scheduling parameters for machine type @var{cpu_type}.
18802 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
18803 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
18804 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
18805 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
18806 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
18807 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
18808 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
18809 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
18810 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
18811 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8}, @samp{powerpc},
18812 @samp{powerpc64}, @samp{powerpc64le}, and @samp{rs64}.
18814 @option{-mcpu=powerpc}, @option{-mcpu=powerpc64}, and
18815 @option{-mcpu=powerpc64le} specify pure 32-bit PowerPC (either
18816 endian), 64-bit big endian PowerPC and 64-bit little endian PowerPC
18817 architecture machine types, with an appropriate, generic processor
18818 model assumed for scheduling purposes.
18820 The other options specify a specific processor.  Code generated under
18821 those options runs best on that processor, and may not run at all on
18822 others.
18824 The @option{-mcpu} options automatically enable or disable the
18825 following options:
18827 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
18828 -mpopcntb -mpopcntd  -mpowerpc64 @gol
18829 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
18830 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
18831 -mcrypto -mdirect-move -mpower8-fusion -mpower8-vector @gol
18832 -mquad-memory -mquad-memory-atomic}
18834 The particular options set for any particular CPU varies between
18835 compiler versions, depending on what setting seems to produce optimal
18836 code for that CPU; it doesn't necessarily reflect the actual hardware's
18837 capabilities.  If you wish to set an individual option to a particular
18838 value, you may specify it after the @option{-mcpu} option, like
18839 @option{-mcpu=970 -mno-altivec}.
18841 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
18842 not enabled or disabled by the @option{-mcpu} option at present because
18843 AIX does not have full support for these options.  You may still
18844 enable or disable them individually if you're sure it'll work in your
18845 environment.
18847 @item -mtune=@var{cpu_type}
18848 @opindex mtune
18849 Set the instruction scheduling parameters for machine type
18850 @var{cpu_type}, but do not set the architecture type or register usage,
18851 as @option{-mcpu=@var{cpu_type}} does.  The same
18852 values for @var{cpu_type} are used for @option{-mtune} as for
18853 @option{-mcpu}.  If both are specified, the code generated uses the
18854 architecture and registers set by @option{-mcpu}, but the
18855 scheduling parameters set by @option{-mtune}.
18857 @item -mcmodel=small
18858 @opindex mcmodel=small
18859 Generate PowerPC64 code for the small model: The TOC is limited to
18860 64k.
18862 @item -mcmodel=medium
18863 @opindex mcmodel=medium
18864 Generate PowerPC64 code for the medium model: The TOC and other static
18865 data may be up to a total of 4G in size.
18867 @item -mcmodel=large
18868 @opindex mcmodel=large
18869 Generate PowerPC64 code for the large model: The TOC may be up to 4G
18870 in size.  Other data and code is only limited by the 64-bit address
18871 space.
18873 @item -maltivec
18874 @itemx -mno-altivec
18875 @opindex maltivec
18876 @opindex mno-altivec
18877 Generate code that uses (does not use) AltiVec instructions, and also
18878 enable the use of built-in functions that allow more direct access to
18879 the AltiVec instruction set.  You may also need to set
18880 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
18881 enhancements.
18883 When @option{-maltivec} is used, rather than @option{-maltivec=le} or
18884 @option{-maltivec=be}, the element order for Altivec intrinsics such
18885 as @code{vec_splat}, @code{vec_extract}, and @code{vec_insert} 
18886 match array element order corresponding to the endianness of the
18887 target.  That is, element zero identifies the leftmost element in a
18888 vector register when targeting a big-endian platform, and identifies
18889 the rightmost element in a vector register when targeting a
18890 little-endian platform.
18892 @item -maltivec=be
18893 @opindex maltivec=be
18894 Generate Altivec instructions using big-endian element order,
18895 regardless of whether the target is big- or little-endian.  This is
18896 the default when targeting a big-endian platform.
18898 The element order is used to interpret element numbers in Altivec
18899 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
18900 @code{vec_insert}.  By default, these match array element order
18901 corresponding to the endianness for the target.
18903 @item -maltivec=le
18904 @opindex maltivec=le
18905 Generate Altivec instructions using little-endian element order,
18906 regardless of whether the target is big- or little-endian.  This is
18907 the default when targeting a little-endian platform.  This option is
18908 currently ignored when targeting a big-endian platform.
18910 The element order is used to interpret element numbers in Altivec
18911 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
18912 @code{vec_insert}.  By default, these match array element order
18913 corresponding to the endianness for the target.
18915 @item -mvrsave
18916 @itemx -mno-vrsave
18917 @opindex mvrsave
18918 @opindex mno-vrsave
18919 Generate VRSAVE instructions when generating AltiVec code.
18921 @item -mgen-cell-microcode
18922 @opindex mgen-cell-microcode
18923 Generate Cell microcode instructions.
18925 @item -mwarn-cell-microcode
18926 @opindex mwarn-cell-microcode
18927 Warn when a Cell microcode instruction is emitted.  An example
18928 of a Cell microcode instruction is a variable shift.
18930 @item -msecure-plt
18931 @opindex msecure-plt
18932 Generate code that allows @command{ld} and @command{ld.so}
18933 to build executables and shared
18934 libraries with non-executable @code{.plt} and @code{.got} sections.
18935 This is a PowerPC
18936 32-bit SYSV ABI option.
18938 @item -mbss-plt
18939 @opindex mbss-plt
18940 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
18941 fills in, and
18942 requires @code{.plt} and @code{.got}
18943 sections that are both writable and executable.
18944 This is a PowerPC 32-bit SYSV ABI option.
18946 @item -misel
18947 @itemx -mno-isel
18948 @opindex misel
18949 @opindex mno-isel
18950 This switch enables or disables the generation of ISEL instructions.
18952 @item -misel=@var{yes/no}
18953 This switch has been deprecated.  Use @option{-misel} and
18954 @option{-mno-isel} instead.
18956 @item -mspe
18957 @itemx -mno-spe
18958 @opindex mspe
18959 @opindex mno-spe
18960 This switch enables or disables the generation of SPE simd
18961 instructions.
18963 @item -mpaired
18964 @itemx -mno-paired
18965 @opindex mpaired
18966 @opindex mno-paired
18967 This switch enables or disables the generation of PAIRED simd
18968 instructions.
18970 @item -mspe=@var{yes/no}
18971 This option has been deprecated.  Use @option{-mspe} and
18972 @option{-mno-spe} instead.
18974 @item -mvsx
18975 @itemx -mno-vsx
18976 @opindex mvsx
18977 @opindex mno-vsx
18978 Generate code that uses (does not use) vector/scalar (VSX)
18979 instructions, and also enable the use of built-in functions that allow
18980 more direct access to the VSX instruction set.
18982 @item -mcrypto
18983 @itemx -mno-crypto
18984 @opindex mcrypto
18985 @opindex mno-crypto
18986 Enable the use (disable) of the built-in functions that allow direct
18987 access to the cryptographic instructions that were added in version
18988 2.07 of the PowerPC ISA.
18990 @item -mdirect-move
18991 @itemx -mno-direct-move
18992 @opindex mdirect-move
18993 @opindex mno-direct-move
18994 Generate code that uses (does not use) the instructions to move data
18995 between the general purpose registers and the vector/scalar (VSX)
18996 registers that were added in version 2.07 of the PowerPC ISA.
18998 @item -mpower8-fusion
18999 @itemx -mno-power8-fusion
19000 @opindex mpower8-fusion
19001 @opindex mno-power8-fusion
19002 Generate code that keeps (does not keeps) some integer operations
19003 adjacent so that the instructions can be fused together on power8 and
19004 later processors.
19006 @item -mpower8-vector
19007 @itemx -mno-power8-vector
19008 @opindex mpower8-vector
19009 @opindex mno-power8-vector
19010 Generate code that uses (does not use) the vector and scalar
19011 instructions that were added in version 2.07 of the PowerPC ISA.  Also
19012 enable the use of built-in functions that allow more direct access to
19013 the vector instructions.
19015 @item -mquad-memory
19016 @itemx -mno-quad-memory
19017 @opindex mquad-memory
19018 @opindex mno-quad-memory
19019 Generate code that uses (does not use) the non-atomic quad word memory
19020 instructions.  The @option{-mquad-memory} option requires use of
19021 64-bit mode.
19023 @item -mquad-memory-atomic
19024 @itemx -mno-quad-memory-atomic
19025 @opindex mquad-memory-atomic
19026 @opindex mno-quad-memory-atomic
19027 Generate code that uses (does not use) the atomic quad word memory
19028 instructions.  The @option{-mquad-memory-atomic} option requires use of
19029 64-bit mode.
19031 @item -mupper-regs-df
19032 @itemx -mno-upper-regs-df
19033 @opindex mupper-regs-df
19034 @opindex mno-upper-regs-df
19035 Generate code that uses (does not use) the scalar double precision
19036 instructions that target all 64 registers in the vector/scalar
19037 floating point register set that were added in version 2.06 of the
19038 PowerPC ISA.  The @option{-mupper-regs-df} turned on by default if you
19039 use either of the @option{-mcpu=power7}, @option{-mcpu=power8}, or
19040 @option{-mvsx} options.
19042 @item -mupper-regs-sf
19043 @itemx -mno-upper-regs-sf
19044 @opindex mupper-regs-sf
19045 @opindex mno-upper-regs-sf
19046 Generate code that uses (does not use) the scalar single precision
19047 instructions that target all 64 registers in the vector/scalar
19048 floating point register set that were added in version 2.07 of the
19049 PowerPC ISA.  The @option{-mupper-regs-sf} turned on by default if you
19050 use either of the @option{-mcpu=power8}, or @option{-mpower8-vector}
19051 options.
19053 @item -mupper-regs
19054 @itemx -mno-upper-regs
19055 @opindex mupper-regs
19056 @opindex mno-upper-regs
19057 Generate code that uses (does not use) the scalar
19058 instructions that target all 64 registers in the vector/scalar
19059 floating point register set, depending on the model of the machine.
19061 If the @option{-mno-upper-regs} option is used, it turns off both
19062 @option{-mupper-regs-sf} and @option{-mupper-regs-df} options.
19064 @item -mfloat-gprs=@var{yes/single/double/no}
19065 @itemx -mfloat-gprs
19066 @opindex mfloat-gprs
19067 This switch enables or disables the generation of floating-point
19068 operations on the general-purpose registers for architectures that
19069 support it.
19071 The argument @samp{yes} or @samp{single} enables the use of
19072 single-precision floating-point operations.
19074 The argument @samp{double} enables the use of single and
19075 double-precision floating-point operations.
19077 The argument @samp{no} disables floating-point operations on the
19078 general-purpose registers.
19080 This option is currently only available on the MPC854x.
19082 @item -m32
19083 @itemx -m64
19084 @opindex m32
19085 @opindex m64
19086 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
19087 targets (including GNU/Linux).  The 32-bit environment sets int, long
19088 and pointer to 32 bits and generates code that runs on any PowerPC
19089 variant.  The 64-bit environment sets int to 32 bits and long and
19090 pointer to 64 bits, and generates code for PowerPC64, as for
19091 @option{-mpowerpc64}.
19093 @item -mfull-toc
19094 @itemx -mno-fp-in-toc
19095 @itemx -mno-sum-in-toc
19096 @itemx -mminimal-toc
19097 @opindex mfull-toc
19098 @opindex mno-fp-in-toc
19099 @opindex mno-sum-in-toc
19100 @opindex mminimal-toc
19101 Modify generation of the TOC (Table Of Contents), which is created for
19102 every executable file.  The @option{-mfull-toc} option is selected by
19103 default.  In that case, GCC allocates at least one TOC entry for
19104 each unique non-automatic variable reference in your program.  GCC
19105 also places floating-point constants in the TOC@.  However, only
19106 16,384 entries are available in the TOC@.
19108 If you receive a linker error message that saying you have overflowed
19109 the available TOC space, you can reduce the amount of TOC space used
19110 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
19111 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
19112 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
19113 generate code to calculate the sum of an address and a constant at
19114 run time instead of putting that sum into the TOC@.  You may specify one
19115 or both of these options.  Each causes GCC to produce very slightly
19116 slower and larger code at the expense of conserving TOC space.
19118 If you still run out of space in the TOC even when you specify both of
19119 these options, specify @option{-mminimal-toc} instead.  This option causes
19120 GCC to make only one TOC entry for every file.  When you specify this
19121 option, GCC produces code that is slower and larger but which
19122 uses extremely little TOC space.  You may wish to use this option
19123 only on files that contain less frequently-executed code.
19125 @item -maix64
19126 @itemx -maix32
19127 @opindex maix64
19128 @opindex maix32
19129 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
19130 @code{long} type, and the infrastructure needed to support them.
19131 Specifying @option{-maix64} implies @option{-mpowerpc64},
19132 while @option{-maix32} disables the 64-bit ABI and
19133 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
19135 @item -mxl-compat
19136 @itemx -mno-xl-compat
19137 @opindex mxl-compat
19138 @opindex mno-xl-compat
19139 Produce code that conforms more closely to IBM XL compiler semantics
19140 when using AIX-compatible ABI@.  Pass floating-point arguments to
19141 prototyped functions beyond the register save area (RSA) on the stack
19142 in addition to argument FPRs.  Do not assume that most significant
19143 double in 128-bit long double value is properly rounded when comparing
19144 values and converting to double.  Use XL symbol names for long double
19145 support routines.
19147 The AIX calling convention was extended but not initially documented to
19148 handle an obscure K&R C case of calling a function that takes the
19149 address of its arguments with fewer arguments than declared.  IBM XL
19150 compilers access floating-point arguments that do not fit in the
19151 RSA from the stack when a subroutine is compiled without
19152 optimization.  Because always storing floating-point arguments on the
19153 stack is inefficient and rarely needed, this option is not enabled by
19154 default and only is necessary when calling subroutines compiled by IBM
19155 XL compilers without optimization.
19157 @item -mpe
19158 @opindex mpe
19159 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
19160 application written to use message passing with special startup code to
19161 enable the application to run.  The system must have PE installed in the
19162 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
19163 must be overridden with the @option{-specs=} option to specify the
19164 appropriate directory location.  The Parallel Environment does not
19165 support threads, so the @option{-mpe} option and the @option{-pthread}
19166 option are incompatible.
19168 @item -malign-natural
19169 @itemx -malign-power
19170 @opindex malign-natural
19171 @opindex malign-power
19172 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
19173 @option{-malign-natural} overrides the ABI-defined alignment of larger
19174 types, such as floating-point doubles, on their natural size-based boundary.
19175 The option @option{-malign-power} instructs GCC to follow the ABI-specified
19176 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
19178 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
19179 is not supported.
19181 @item -msoft-float
19182 @itemx -mhard-float
19183 @opindex msoft-float
19184 @opindex mhard-float
19185 Generate code that does not use (uses) the floating-point register set.
19186 Software floating-point emulation is provided if you use the
19187 @option{-msoft-float} option, and pass the option to GCC when linking.
19189 @item -msingle-float
19190 @itemx -mdouble-float
19191 @opindex msingle-float
19192 @opindex mdouble-float
19193 Generate code for single- or double-precision floating-point operations.
19194 @option{-mdouble-float} implies @option{-msingle-float}.
19196 @item -msimple-fpu
19197 @opindex msimple-fpu
19198 Do not generate @code{sqrt} and @code{div} instructions for hardware
19199 floating-point unit.
19201 @item -mfpu=@var{name}
19202 @opindex mfpu
19203 Specify type of floating-point unit.  Valid values for @var{name} are
19204 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
19205 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
19206 @samp{sp_full} (equivalent to @option{-msingle-float}),
19207 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
19209 @item -mxilinx-fpu
19210 @opindex mxilinx-fpu
19211 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
19213 @item -mmultiple
19214 @itemx -mno-multiple
19215 @opindex mmultiple
19216 @opindex mno-multiple
19217 Generate code that uses (does not use) the load multiple word
19218 instructions and the store multiple word instructions.  These
19219 instructions are generated by default on POWER systems, and not
19220 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
19221 PowerPC systems, since those instructions do not work when the
19222 processor is in little-endian mode.  The exceptions are PPC740 and
19223 PPC750 which permit these instructions in little-endian mode.
19225 @item -mstring
19226 @itemx -mno-string
19227 @opindex mstring
19228 @opindex mno-string
19229 Generate code that uses (does not use) the load string instructions
19230 and the store string word instructions to save multiple registers and
19231 do small block moves.  These instructions are generated by default on
19232 POWER systems, and not generated on PowerPC systems.  Do not use
19233 @option{-mstring} on little-endian PowerPC systems, since those
19234 instructions do not work when the processor is in little-endian mode.
19235 The exceptions are PPC740 and PPC750 which permit these instructions
19236 in little-endian mode.
19238 @item -mupdate
19239 @itemx -mno-update
19240 @opindex mupdate
19241 @opindex mno-update
19242 Generate code that uses (does not use) the load or store instructions
19243 that update the base register to the address of the calculated memory
19244 location.  These instructions are generated by default.  If you use
19245 @option{-mno-update}, there is a small window between the time that the
19246 stack pointer is updated and the address of the previous frame is
19247 stored, which means code that walks the stack frame across interrupts or
19248 signals may get corrupted data.
19250 @item -mavoid-indexed-addresses
19251 @itemx -mno-avoid-indexed-addresses
19252 @opindex mavoid-indexed-addresses
19253 @opindex mno-avoid-indexed-addresses
19254 Generate code that tries to avoid (not avoid) the use of indexed load
19255 or store instructions. These instructions can incur a performance
19256 penalty on Power6 processors in certain situations, such as when
19257 stepping through large arrays that cross a 16M boundary.  This option
19258 is enabled by default when targeting Power6 and disabled otherwise.
19260 @item -mfused-madd
19261 @itemx -mno-fused-madd
19262 @opindex mfused-madd
19263 @opindex mno-fused-madd
19264 Generate code that uses (does not use) the floating-point multiply and
19265 accumulate instructions.  These instructions are generated by default
19266 if hardware floating point is used.  The machine-dependent
19267 @option{-mfused-madd} option is now mapped to the machine-independent
19268 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
19269 mapped to @option{-ffp-contract=off}.
19271 @item -mmulhw
19272 @itemx -mno-mulhw
19273 @opindex mmulhw
19274 @opindex mno-mulhw
19275 Generate code that uses (does not use) the half-word multiply and
19276 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
19277 These instructions are generated by default when targeting those
19278 processors.
19280 @item -mdlmzb
19281 @itemx -mno-dlmzb
19282 @opindex mdlmzb
19283 @opindex mno-dlmzb
19284 Generate code that uses (does not use) the string-search @samp{dlmzb}
19285 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
19286 generated by default when targeting those processors.
19288 @item -mno-bit-align
19289 @itemx -mbit-align
19290 @opindex mno-bit-align
19291 @opindex mbit-align
19292 On System V.4 and embedded PowerPC systems do not (do) force structures
19293 and unions that contain bit-fields to be aligned to the base type of the
19294 bit-field.
19296 For example, by default a structure containing nothing but 8
19297 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
19298 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
19299 the structure is aligned to a 1-byte boundary and is 1 byte in
19300 size.
19302 @item -mno-strict-align
19303 @itemx -mstrict-align
19304 @opindex mno-strict-align
19305 @opindex mstrict-align
19306 On System V.4 and embedded PowerPC systems do not (do) assume that
19307 unaligned memory references are handled by the system.
19309 @item -mrelocatable
19310 @itemx -mno-relocatable
19311 @opindex mrelocatable
19312 @opindex mno-relocatable
19313 Generate code that allows (does not allow) a static executable to be
19314 relocated to a different address at run time.  A simple embedded
19315 PowerPC system loader should relocate the entire contents of
19316 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
19317 a table of 32-bit addresses generated by this option.  For this to
19318 work, all objects linked together must be compiled with
19319 @option{-mrelocatable} or @option{-mrelocatable-lib}.
19320 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
19322 @item -mrelocatable-lib
19323 @itemx -mno-relocatable-lib
19324 @opindex mrelocatable-lib
19325 @opindex mno-relocatable-lib
19326 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
19327 @code{.fixup} section to allow static executables to be relocated at
19328 run time, but @option{-mrelocatable-lib} does not use the smaller stack
19329 alignment of @option{-mrelocatable}.  Objects compiled with
19330 @option{-mrelocatable-lib} may be linked with objects compiled with
19331 any combination of the @option{-mrelocatable} options.
19333 @item -mno-toc
19334 @itemx -mtoc
19335 @opindex mno-toc
19336 @opindex mtoc
19337 On System V.4 and embedded PowerPC systems do not (do) assume that
19338 register 2 contains a pointer to a global area pointing to the addresses
19339 used in the program.
19341 @item -mlittle
19342 @itemx -mlittle-endian
19343 @opindex mlittle
19344 @opindex mlittle-endian
19345 On System V.4 and embedded PowerPC systems compile code for the
19346 processor in little-endian mode.  The @option{-mlittle-endian} option is
19347 the same as @option{-mlittle}.
19349 @item -mbig
19350 @itemx -mbig-endian
19351 @opindex mbig
19352 @opindex mbig-endian
19353 On System V.4 and embedded PowerPC systems compile code for the
19354 processor in big-endian mode.  The @option{-mbig-endian} option is
19355 the same as @option{-mbig}.
19357 @item -mdynamic-no-pic
19358 @opindex mdynamic-no-pic
19359 On Darwin and Mac OS X systems, compile code so that it is not
19360 relocatable, but that its external references are relocatable.  The
19361 resulting code is suitable for applications, but not shared
19362 libraries.
19364 @item -msingle-pic-base
19365 @opindex msingle-pic-base
19366 Treat the register used for PIC addressing as read-only, rather than
19367 loading it in the prologue for each function.  The runtime system is
19368 responsible for initializing this register with an appropriate value
19369 before execution begins.
19371 @item -mprioritize-restricted-insns=@var{priority}
19372 @opindex mprioritize-restricted-insns
19373 This option controls the priority that is assigned to
19374 dispatch-slot restricted instructions during the second scheduling
19375 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
19376 or @samp{2} to assign no, highest, or second-highest (respectively) 
19377 priority to dispatch-slot restricted
19378 instructions.
19380 @item -msched-costly-dep=@var{dependence_type}
19381 @opindex msched-costly-dep
19382 This option controls which dependences are considered costly
19383 by the target during instruction scheduling.  The argument
19384 @var{dependence_type} takes one of the following values:
19386 @table @asis
19387 @item @samp{no}
19388 No dependence is costly.
19390 @item @samp{all}
19391 All dependences are costly.
19393 @item @samp{true_store_to_load}
19394 A true dependence from store to load is costly.
19396 @item @samp{store_to_load}
19397 Any dependence from store to load is costly.
19399 @item @var{number}
19400 Any dependence for which the latency is greater than or equal to 
19401 @var{number} is costly.
19402 @end table
19404 @item -minsert-sched-nops=@var{scheme}
19405 @opindex minsert-sched-nops
19406 This option controls which NOP insertion scheme is used during
19407 the second scheduling pass.  The argument @var{scheme} takes one of the
19408 following values:
19410 @table @asis
19411 @item @samp{no}
19412 Don't insert NOPs.
19414 @item @samp{pad}
19415 Pad with NOPs any dispatch group that has vacant issue slots,
19416 according to the scheduler's grouping.
19418 @item @samp{regroup_exact}
19419 Insert NOPs to force costly dependent insns into
19420 separate groups.  Insert exactly as many NOPs as needed to force an insn
19421 to a new group, according to the estimated processor grouping.
19423 @item @var{number}
19424 Insert NOPs to force costly dependent insns into
19425 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
19426 @end table
19428 @item -mcall-sysv
19429 @opindex mcall-sysv
19430 On System V.4 and embedded PowerPC systems compile code using calling
19431 conventions that adhere to the March 1995 draft of the System V
19432 Application Binary Interface, PowerPC processor supplement.  This is the
19433 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
19435 @item -mcall-sysv-eabi
19436 @itemx -mcall-eabi
19437 @opindex mcall-sysv-eabi
19438 @opindex mcall-eabi
19439 Specify both @option{-mcall-sysv} and @option{-meabi} options.
19441 @item -mcall-sysv-noeabi
19442 @opindex mcall-sysv-noeabi
19443 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
19445 @item -mcall-aixdesc
19446 @opindex m
19447 On System V.4 and embedded PowerPC systems compile code for the AIX
19448 operating system.
19450 @item -mcall-linux
19451 @opindex mcall-linux
19452 On System V.4 and embedded PowerPC systems compile code for the
19453 Linux-based GNU system.
19455 @item -mcall-freebsd
19456 @opindex mcall-freebsd
19457 On System V.4 and embedded PowerPC systems compile code for the
19458 FreeBSD operating system.
19460 @item -mcall-netbsd
19461 @opindex mcall-netbsd
19462 On System V.4 and embedded PowerPC systems compile code for the
19463 NetBSD operating system.
19465 @item -mcall-openbsd
19466 @opindex mcall-netbsd
19467 On System V.4 and embedded PowerPC systems compile code for the
19468 OpenBSD operating system.
19470 @item -maix-struct-return
19471 @opindex maix-struct-return
19472 Return all structures in memory (as specified by the AIX ABI)@.
19474 @item -msvr4-struct-return
19475 @opindex msvr4-struct-return
19476 Return structures smaller than 8 bytes in registers (as specified by the
19477 SVR4 ABI)@.
19479 @item -mabi=@var{abi-type}
19480 @opindex mabi
19481 Extend the current ABI with a particular extension, or remove such extension.
19482 Valid values are @samp{altivec}, @samp{no-altivec}, @samp{spe},
19483 @samp{no-spe}, @samp{ibmlongdouble}, @samp{ieeelongdouble},
19484 @samp{elfv1}, @samp{elfv2}@.
19486 @item -mabi=spe
19487 @opindex mabi=spe
19488 Extend the current ABI with SPE ABI extensions.  This does not change
19489 the default ABI, instead it adds the SPE ABI extensions to the current
19490 ABI@.
19492 @item -mabi=no-spe
19493 @opindex mabi=no-spe
19494 Disable Book-E SPE ABI extensions for the current ABI@.
19496 @item -mabi=ibmlongdouble
19497 @opindex mabi=ibmlongdouble
19498 Change the current ABI to use IBM extended-precision long double.
19499 This is a PowerPC 32-bit SYSV ABI option.
19501 @item -mabi=ieeelongdouble
19502 @opindex mabi=ieeelongdouble
19503 Change the current ABI to use IEEE extended-precision long double.
19504 This is a PowerPC 32-bit Linux ABI option.
19506 @item -mabi=elfv1
19507 @opindex mabi=elfv1
19508 Change the current ABI to use the ELFv1 ABI.
19509 This is the default ABI for big-endian PowerPC 64-bit Linux.
19510 Overriding the default ABI requires special system support and is
19511 likely to fail in spectacular ways.
19513 @item -mabi=elfv2
19514 @opindex mabi=elfv2
19515 Change the current ABI to use the ELFv2 ABI.
19516 This is the default ABI for little-endian PowerPC 64-bit Linux.
19517 Overriding the default ABI requires special system support and is
19518 likely to fail in spectacular ways.
19520 @item -mprototype
19521 @itemx -mno-prototype
19522 @opindex mprototype
19523 @opindex mno-prototype
19524 On System V.4 and embedded PowerPC systems assume that all calls to
19525 variable argument functions are properly prototyped.  Otherwise, the
19526 compiler must insert an instruction before every non-prototyped call to
19527 set or clear bit 6 of the condition code register (@code{CR}) to
19528 indicate whether floating-point values are passed in the floating-point
19529 registers in case the function takes variable arguments.  With
19530 @option{-mprototype}, only calls to prototyped variable argument functions
19531 set or clear the bit.
19533 @item -msim
19534 @opindex msim
19535 On embedded PowerPC systems, assume that the startup module is called
19536 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
19537 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
19538 configurations.
19540 @item -mmvme
19541 @opindex mmvme
19542 On embedded PowerPC systems, assume that the startup module is called
19543 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
19544 @file{libc.a}.
19546 @item -mads
19547 @opindex mads
19548 On embedded PowerPC systems, assume that the startup module is called
19549 @file{crt0.o} and the standard C libraries are @file{libads.a} and
19550 @file{libc.a}.
19552 @item -myellowknife
19553 @opindex myellowknife
19554 On embedded PowerPC systems, assume that the startup module is called
19555 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
19556 @file{libc.a}.
19558 @item -mvxworks
19559 @opindex mvxworks
19560 On System V.4 and embedded PowerPC systems, specify that you are
19561 compiling for a VxWorks system.
19563 @item -memb
19564 @opindex memb
19565 On embedded PowerPC systems, set the @code{PPC_EMB} bit in the ELF flags
19566 header to indicate that @samp{eabi} extended relocations are used.
19568 @item -meabi
19569 @itemx -mno-eabi
19570 @opindex meabi
19571 @opindex mno-eabi
19572 On System V.4 and embedded PowerPC systems do (do not) adhere to the
19573 Embedded Applications Binary Interface (EABI), which is a set of
19574 modifications to the System V.4 specifications.  Selecting @option{-meabi}
19575 means that the stack is aligned to an 8-byte boundary, a function
19576 @code{__eabi} is called from @code{main} to set up the EABI
19577 environment, and the @option{-msdata} option can use both @code{r2} and
19578 @code{r13} to point to two separate small data areas.  Selecting
19579 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
19580 no EABI initialization function is called from @code{main}, and the
19581 @option{-msdata} option only uses @code{r13} to point to a single
19582 small data area.  The @option{-meabi} option is on by default if you
19583 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
19585 @item -msdata=eabi
19586 @opindex msdata=eabi
19587 On System V.4 and embedded PowerPC systems, put small initialized
19588 @code{const} global and static data in the @code{.sdata2} section, which
19589 is pointed to by register @code{r2}.  Put small initialized
19590 non-@code{const} global and static data in the @code{.sdata} section,
19591 which is pointed to by register @code{r13}.  Put small uninitialized
19592 global and static data in the @code{.sbss} section, which is adjacent to
19593 the @code{.sdata} section.  The @option{-msdata=eabi} option is
19594 incompatible with the @option{-mrelocatable} option.  The
19595 @option{-msdata=eabi} option also sets the @option{-memb} option.
19597 @item -msdata=sysv
19598 @opindex msdata=sysv
19599 On System V.4 and embedded PowerPC systems, put small global and static
19600 data in the @code{.sdata} section, which is pointed to by register
19601 @code{r13}.  Put small uninitialized global and static data in the
19602 @code{.sbss} section, which is adjacent to the @code{.sdata} section.
19603 The @option{-msdata=sysv} option is incompatible with the
19604 @option{-mrelocatable} option.
19606 @item -msdata=default
19607 @itemx -msdata
19608 @opindex msdata=default
19609 @opindex msdata
19610 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
19611 compile code the same as @option{-msdata=eabi}, otherwise compile code the
19612 same as @option{-msdata=sysv}.
19614 @item -msdata=data
19615 @opindex msdata=data
19616 On System V.4 and embedded PowerPC systems, put small global
19617 data in the @code{.sdata} section.  Put small uninitialized global
19618 data in the @code{.sbss} section.  Do not use register @code{r13}
19619 to address small data however.  This is the default behavior unless
19620 other @option{-msdata} options are used.
19622 @item -msdata=none
19623 @itemx -mno-sdata
19624 @opindex msdata=none
19625 @opindex mno-sdata
19626 On embedded PowerPC systems, put all initialized global and static data
19627 in the @code{.data} section, and all uninitialized data in the
19628 @code{.bss} section.
19630 @item -mblock-move-inline-limit=@var{num}
19631 @opindex mblock-move-inline-limit
19632 Inline all block moves (such as calls to @code{memcpy} or structure
19633 copies) less than or equal to @var{num} bytes.  The minimum value for
19634 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
19635 targets.  The default value is target-specific.
19637 @item -G @var{num}
19638 @opindex G
19639 @cindex smaller data references (PowerPC)
19640 @cindex .sdata/.sdata2 references (PowerPC)
19641 On embedded PowerPC systems, put global and static items less than or
19642 equal to @var{num} bytes into the small data or BSS sections instead of
19643 the normal data or BSS section.  By default, @var{num} is 8.  The
19644 @option{-G @var{num}} switch is also passed to the linker.
19645 All modules should be compiled with the same @option{-G @var{num}} value.
19647 @item -mregnames
19648 @itemx -mno-regnames
19649 @opindex mregnames
19650 @opindex mno-regnames
19651 On System V.4 and embedded PowerPC systems do (do not) emit register
19652 names in the assembly language output using symbolic forms.
19654 @item -mlongcall
19655 @itemx -mno-longcall
19656 @opindex mlongcall
19657 @opindex mno-longcall
19658 By default assume that all calls are far away so that a longer and more
19659 expensive calling sequence is required.  This is required for calls
19660 farther than 32 megabytes (33,554,432 bytes) from the current location.
19661 A short call is generated if the compiler knows
19662 the call cannot be that far away.  This setting can be overridden by
19663 the @code{shortcall} function attribute, or by @code{#pragma
19664 longcall(0)}.
19666 Some linkers are capable of detecting out-of-range calls and generating
19667 glue code on the fly.  On these systems, long calls are unnecessary and
19668 generate slower code.  As of this writing, the AIX linker can do this,
19669 as can the GNU linker for PowerPC/64.  It is planned to add this feature
19670 to the GNU linker for 32-bit PowerPC systems as well.
19672 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
19673 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
19674 addresses represent the callee and the branch island.  The
19675 Darwin/PPC linker prefers the first address and generates a @code{bl
19676 callee} if the PPC @code{bl} instruction reaches the callee directly;
19677 otherwise, the linker generates @code{bl L42} to call the branch
19678 island.  The branch island is appended to the body of the
19679 calling function; it computes the full 32-bit address of the callee
19680 and jumps to it.
19682 On Mach-O (Darwin) systems, this option directs the compiler emit to
19683 the glue for every direct call, and the Darwin linker decides whether
19684 to use or discard it.
19686 In the future, GCC may ignore all longcall specifications
19687 when the linker is known to generate glue.
19689 @item -mtls-markers
19690 @itemx -mno-tls-markers
19691 @opindex mtls-markers
19692 @opindex mno-tls-markers
19693 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
19694 specifying the function argument.  The relocation allows the linker to
19695 reliably associate function call with argument setup instructions for
19696 TLS optimization, which in turn allows GCC to better schedule the
19697 sequence.
19699 @item -pthread
19700 @opindex pthread
19701 Adds support for multithreading with the @dfn{pthreads} library.
19702 This option sets flags for both the preprocessor and linker.
19704 @item -mrecip
19705 @itemx -mno-recip
19706 @opindex mrecip
19707 This option enables use of the reciprocal estimate and
19708 reciprocal square root estimate instructions with additional
19709 Newton-Raphson steps to increase precision instead of doing a divide or
19710 square root and divide for floating-point arguments.  You should use
19711 the @option{-ffast-math} option when using @option{-mrecip} (or at
19712 least @option{-funsafe-math-optimizations},
19713 @option{-finite-math-only}, @option{-freciprocal-math} and
19714 @option{-fno-trapping-math}).  Note that while the throughput of the
19715 sequence is generally higher than the throughput of the non-reciprocal
19716 instruction, the precision of the sequence can be decreased by up to 2
19717 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
19718 roots.
19720 @item -mrecip=@var{opt}
19721 @opindex mrecip=opt
19722 This option controls which reciprocal estimate instructions
19723 may be used.  @var{opt} is a comma-separated list of options, which may
19724 be preceded by a @code{!} to invert the option:
19726 @table @samp
19728 @item all
19729 Enable all estimate instructions.
19731 @item default 
19732 Enable the default instructions, equivalent to @option{-mrecip}.
19734 @item none 
19735 Disable all estimate instructions, equivalent to @option{-mno-recip}.
19737 @item div 
19738 Enable the reciprocal approximation instructions for both 
19739 single and double precision.
19741 @item divf 
19742 Enable the single-precision reciprocal approximation instructions.
19744 @item divd 
19745 Enable the double-precision reciprocal approximation instructions.
19747 @item rsqrt 
19748 Enable the reciprocal square root approximation instructions for both
19749 single and double precision.
19751 @item rsqrtf 
19752 Enable the single-precision reciprocal square root approximation instructions.
19754 @item rsqrtd 
19755 Enable the double-precision reciprocal square root approximation instructions.
19757 @end table
19759 So, for example, @option{-mrecip=all,!rsqrtd} enables
19760 all of the reciprocal estimate instructions, except for the
19761 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
19762 which handle the double-precision reciprocal square root calculations.
19764 @item -mrecip-precision
19765 @itemx -mno-recip-precision
19766 @opindex mrecip-precision
19767 Assume (do not assume) that the reciprocal estimate instructions
19768 provide higher-precision estimates than is mandated by the PowerPC
19769 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
19770 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
19771 The double-precision square root estimate instructions are not generated by
19772 default on low-precision machines, since they do not provide an
19773 estimate that converges after three steps.
19775 @item -mveclibabi=@var{type}
19776 @opindex mveclibabi
19777 Specifies the ABI type to use for vectorizing intrinsics using an
19778 external library.  The only type supported at present is @samp{mass},
19779 which specifies to use IBM's Mathematical Acceleration Subsystem
19780 (MASS) libraries for vectorizing intrinsics using external libraries.
19781 GCC currently emits calls to @code{acosd2}, @code{acosf4},
19782 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
19783 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
19784 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
19785 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
19786 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
19787 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
19788 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
19789 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
19790 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
19791 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
19792 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
19793 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
19794 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
19795 for power7.  Both @option{-ftree-vectorize} and
19796 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
19797 libraries must be specified at link time.
19799 @item -mfriz
19800 @itemx -mno-friz
19801 @opindex mfriz
19802 Generate (do not generate) the @code{friz} instruction when the
19803 @option{-funsafe-math-optimizations} option is used to optimize
19804 rounding of floating-point values to 64-bit integer and back to floating
19805 point.  The @code{friz} instruction does not return the same value if
19806 the floating-point number is too large to fit in an integer.
19808 @item -mpointers-to-nested-functions
19809 @itemx -mno-pointers-to-nested-functions
19810 @opindex mpointers-to-nested-functions
19811 Generate (do not generate) code to load up the static chain register
19812 (@code{r11}) when calling through a pointer on AIX and 64-bit Linux
19813 systems where a function pointer points to a 3-word descriptor giving
19814 the function address, TOC value to be loaded in register @code{r2}, and
19815 static chain value to be loaded in register @code{r11}.  The
19816 @option{-mpointers-to-nested-functions} is on by default.  You cannot
19817 call through pointers to nested functions or pointers
19818 to functions compiled in other languages that use the static chain if
19819 you use the @option{-mno-pointers-to-nested-functions}.
19821 @item -msave-toc-indirect
19822 @itemx -mno-save-toc-indirect
19823 @opindex msave-toc-indirect
19824 Generate (do not generate) code to save the TOC value in the reserved
19825 stack location in the function prologue if the function calls through
19826 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
19827 saved in the prologue, it is saved just before the call through the
19828 pointer.  The @option{-mno-save-toc-indirect} option is the default.
19830 @item -mcompat-align-parm
19831 @itemx -mno-compat-align-parm
19832 @opindex mcompat-align-parm
19833 Generate (do not generate) code to pass structure parameters with a
19834 maximum alignment of 64 bits, for compatibility with older versions
19835 of GCC.
19837 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
19838 structure parameter on a 128-bit boundary when that structure contained
19839 a member requiring 128-bit alignment.  This is corrected in more
19840 recent versions of GCC.  This option may be used to generate code
19841 that is compatible with functions compiled with older versions of
19842 GCC.
19844 The @option{-mno-compat-align-parm} option is the default.
19845 @end table
19847 @node RX Options
19848 @subsection RX Options
19849 @cindex RX Options
19851 These command-line options are defined for RX targets:
19853 @table @gcctabopt
19854 @item -m64bit-doubles
19855 @itemx -m32bit-doubles
19856 @opindex m64bit-doubles
19857 @opindex m32bit-doubles
19858 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
19859 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
19860 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
19861 works on 32-bit values, which is why the default is
19862 @option{-m32bit-doubles}.
19864 @item -fpu
19865 @itemx -nofpu
19866 @opindex fpu
19867 @opindex nofpu
19868 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
19869 floating-point hardware.  The default is enabled for the RX600
19870 series and disabled for the RX200 series.
19872 Floating-point instructions are only generated for 32-bit floating-point 
19873 values, however, so the FPU hardware is not used for doubles if the
19874 @option{-m64bit-doubles} option is used.
19876 @emph{Note} If the @option{-fpu} option is enabled then
19877 @option{-funsafe-math-optimizations} is also enabled automatically.
19878 This is because the RX FPU instructions are themselves unsafe.
19880 @item -mcpu=@var{name}
19881 @opindex mcpu
19882 Selects the type of RX CPU to be targeted.  Currently three types are
19883 supported, the generic @samp{RX600} and @samp{RX200} series hardware and
19884 the specific @samp{RX610} CPU.  The default is @samp{RX600}.
19886 The only difference between @samp{RX600} and @samp{RX610} is that the
19887 @samp{RX610} does not support the @code{MVTIPL} instruction.
19889 The @samp{RX200} series does not have a hardware floating-point unit
19890 and so @option{-nofpu} is enabled by default when this type is
19891 selected.
19893 @item -mbig-endian-data
19894 @itemx -mlittle-endian-data
19895 @opindex mbig-endian-data
19896 @opindex mlittle-endian-data
19897 Store data (but not code) in the big-endian format.  The default is
19898 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
19899 format.
19901 @item -msmall-data-limit=@var{N}
19902 @opindex msmall-data-limit
19903 Specifies the maximum size in bytes of global and static variables
19904 which can be placed into the small data area.  Using the small data
19905 area can lead to smaller and faster code, but the size of area is
19906 limited and it is up to the programmer to ensure that the area does
19907 not overflow.  Also when the small data area is used one of the RX's
19908 registers (usually @code{r13}) is reserved for use pointing to this
19909 area, so it is no longer available for use by the compiler.  This
19910 could result in slower and/or larger code if variables are pushed onto
19911 the stack instead of being held in this register.
19913 Note, common variables (variables that have not been initialized) and
19914 constants are not placed into the small data area as they are assigned
19915 to other sections in the output executable.
19917 The default value is zero, which disables this feature.  Note, this
19918 feature is not enabled by default with higher optimization levels
19919 (@option{-O2} etc) because of the potentially detrimental effects of
19920 reserving a register.  It is up to the programmer to experiment and
19921 discover whether this feature is of benefit to their program.  See the
19922 description of the @option{-mpid} option for a description of how the
19923 actual register to hold the small data area pointer is chosen.
19925 @item -msim
19926 @itemx -mno-sim
19927 @opindex msim
19928 @opindex mno-sim
19929 Use the simulator runtime.  The default is to use the libgloss
19930 board-specific runtime.
19932 @item -mas100-syntax
19933 @itemx -mno-as100-syntax
19934 @opindex mas100-syntax
19935 @opindex mno-as100-syntax
19936 When generating assembler output use a syntax that is compatible with
19937 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
19938 assembler, but it has some restrictions so it is not generated by default.
19940 @item -mmax-constant-size=@var{N}
19941 @opindex mmax-constant-size
19942 Specifies the maximum size, in bytes, of a constant that can be used as
19943 an operand in a RX instruction.  Although the RX instruction set does
19944 allow constants of up to 4 bytes in length to be used in instructions,
19945 a longer value equates to a longer instruction.  Thus in some
19946 circumstances it can be beneficial to restrict the size of constants
19947 that are used in instructions.  Constants that are too big are instead
19948 placed into a constant pool and referenced via register indirection.
19950 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
19951 or 4 means that constants of any size are allowed.
19953 @item -mrelax
19954 @opindex mrelax
19955 Enable linker relaxation.  Linker relaxation is a process whereby the
19956 linker attempts to reduce the size of a program by finding shorter
19957 versions of various instructions.  Disabled by default.
19959 @item -mint-register=@var{N}
19960 @opindex mint-register
19961 Specify the number of registers to reserve for fast interrupt handler
19962 functions.  The value @var{N} can be between 0 and 4.  A value of 1
19963 means that register @code{r13} is reserved for the exclusive use
19964 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
19965 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
19966 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
19967 A value of 0, the default, does not reserve any registers.
19969 @item -msave-acc-in-interrupts
19970 @opindex msave-acc-in-interrupts
19971 Specifies that interrupt handler functions should preserve the
19972 accumulator register.  This is only necessary if normal code might use
19973 the accumulator register, for example because it performs 64-bit
19974 multiplications.  The default is to ignore the accumulator as this
19975 makes the interrupt handlers faster.
19977 @item -mpid
19978 @itemx -mno-pid
19979 @opindex mpid
19980 @opindex mno-pid
19981 Enables the generation of position independent data.  When enabled any
19982 access to constant data is done via an offset from a base address
19983 held in a register.  This allows the location of constant data to be
19984 determined at run time without requiring the executable to be
19985 relocated, which is a benefit to embedded applications with tight
19986 memory constraints.  Data that can be modified is not affected by this
19987 option.
19989 Note, using this feature reserves a register, usually @code{r13}, for
19990 the constant data base address.  This can result in slower and/or
19991 larger code, especially in complicated functions.
19993 The actual register chosen to hold the constant data base address
19994 depends upon whether the @option{-msmall-data-limit} and/or the
19995 @option{-mint-register} command-line options are enabled.  Starting
19996 with register @code{r13} and proceeding downwards, registers are
19997 allocated first to satisfy the requirements of @option{-mint-register},
19998 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
19999 is possible for the small data area register to be @code{r8} if both
20000 @option{-mint-register=4} and @option{-mpid} are specified on the
20001 command line.
20003 By default this feature is not enabled.  The default can be restored
20004 via the @option{-mno-pid} command-line option.
20006 @item -mno-warn-multiple-fast-interrupts
20007 @itemx -mwarn-multiple-fast-interrupts
20008 @opindex mno-warn-multiple-fast-interrupts
20009 @opindex mwarn-multiple-fast-interrupts
20010 Prevents GCC from issuing a warning message if it finds more than one
20011 fast interrupt handler when it is compiling a file.  The default is to
20012 issue a warning for each extra fast interrupt handler found, as the RX
20013 only supports one such interrupt.
20015 @end table
20017 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
20018 has special significance to the RX port when used with the
20019 @code{interrupt} function attribute.  This attribute indicates a
20020 function intended to process fast interrupts.  GCC ensures
20021 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
20022 and/or @code{r13} and only provided that the normal use of the
20023 corresponding registers have been restricted via the
20024 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
20025 options.
20027 @node S/390 and zSeries Options
20028 @subsection S/390 and zSeries Options
20029 @cindex S/390 and zSeries Options
20031 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
20033 @table @gcctabopt
20034 @item -mhard-float
20035 @itemx -msoft-float
20036 @opindex mhard-float
20037 @opindex msoft-float
20038 Use (do not use) the hardware floating-point instructions and registers
20039 for floating-point operations.  When @option{-msoft-float} is specified,
20040 functions in @file{libgcc.a} are used to perform floating-point
20041 operations.  When @option{-mhard-float} is specified, the compiler
20042 generates IEEE floating-point instructions.  This is the default.
20044 @item -mhard-dfp
20045 @itemx -mno-hard-dfp
20046 @opindex mhard-dfp
20047 @opindex mno-hard-dfp
20048 Use (do not use) the hardware decimal-floating-point instructions for
20049 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
20050 specified, functions in @file{libgcc.a} are used to perform
20051 decimal-floating-point operations.  When @option{-mhard-dfp} is
20052 specified, the compiler generates decimal-floating-point hardware
20053 instructions.  This is the default for @option{-march=z9-ec} or higher.
20055 @item -mlong-double-64
20056 @itemx -mlong-double-128
20057 @opindex mlong-double-64
20058 @opindex mlong-double-128
20059 These switches control the size of @code{long double} type. A size
20060 of 64 bits makes the @code{long double} type equivalent to the @code{double}
20061 type. This is the default.
20063 @item -mbackchain
20064 @itemx -mno-backchain
20065 @opindex mbackchain
20066 @opindex mno-backchain
20067 Store (do not store) the address of the caller's frame as backchain pointer
20068 into the callee's stack frame.
20069 A backchain may be needed to allow debugging using tools that do not understand
20070 DWARF 2 call frame information.
20071 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
20072 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
20073 the backchain is placed into the topmost word of the 96/160 byte register
20074 save area.
20076 In general, code compiled with @option{-mbackchain} is call-compatible with
20077 code compiled with @option{-mmo-backchain}; however, use of the backchain
20078 for debugging purposes usually requires that the whole binary is built with
20079 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
20080 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
20081 to build a linux kernel use @option{-msoft-float}.
20083 The default is to not maintain the backchain.
20085 @item -mpacked-stack
20086 @itemx -mno-packed-stack
20087 @opindex mpacked-stack
20088 @opindex mno-packed-stack
20089 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
20090 specified, the compiler uses the all fields of the 96/160 byte register save
20091 area only for their default purpose; unused fields still take up stack space.
20092 When @option{-mpacked-stack} is specified, register save slots are densely
20093 packed at the top of the register save area; unused space is reused for other
20094 purposes, allowing for more efficient use of the available stack space.
20095 However, when @option{-mbackchain} is also in effect, the topmost word of
20096 the save area is always used to store the backchain, and the return address
20097 register is always saved two words below the backchain.
20099 As long as the stack frame backchain is not used, code generated with
20100 @option{-mpacked-stack} is call-compatible with code generated with
20101 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
20102 S/390 or zSeries generated code that uses the stack frame backchain at run
20103 time, not just for debugging purposes.  Such code is not call-compatible
20104 with code compiled with @option{-mpacked-stack}.  Also, note that the
20105 combination of @option{-mbackchain},
20106 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
20107 to build a linux kernel use @option{-msoft-float}.
20109 The default is to not use the packed stack layout.
20111 @item -msmall-exec
20112 @itemx -mno-small-exec
20113 @opindex msmall-exec
20114 @opindex mno-small-exec
20115 Generate (or do not generate) code using the @code{bras} instruction
20116 to do subroutine calls.
20117 This only works reliably if the total executable size does not
20118 exceed 64k.  The default is to use the @code{basr} instruction instead,
20119 which does not have this limitation.
20121 @item -m64
20122 @itemx -m31
20123 @opindex m64
20124 @opindex m31
20125 When @option{-m31} is specified, generate code compliant to the
20126 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
20127 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
20128 particular to generate 64-bit instructions.  For the @samp{s390}
20129 targets, the default is @option{-m31}, while the @samp{s390x}
20130 targets default to @option{-m64}.
20132 @item -mzarch
20133 @itemx -mesa
20134 @opindex mzarch
20135 @opindex mesa
20136 When @option{-mzarch} is specified, generate code using the
20137 instructions available on z/Architecture.
20138 When @option{-mesa} is specified, generate code using the
20139 instructions available on ESA/390.  Note that @option{-mesa} is
20140 not possible with @option{-m64}.
20141 When generating code compliant to the GNU/Linux for S/390 ABI,
20142 the default is @option{-mesa}.  When generating code compliant
20143 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
20145 @item -mmvcle
20146 @itemx -mno-mvcle
20147 @opindex mmvcle
20148 @opindex mno-mvcle
20149 Generate (or do not generate) code using the @code{mvcle} instruction
20150 to perform block moves.  When @option{-mno-mvcle} is specified,
20151 use a @code{mvc} loop instead.  This is the default unless optimizing for
20152 size.
20154 @item -mdebug
20155 @itemx -mno-debug
20156 @opindex mdebug
20157 @opindex mno-debug
20158 Print (or do not print) additional debug information when compiling.
20159 The default is to not print debug information.
20161 @item -march=@var{cpu-type}
20162 @opindex march
20163 Generate code that runs on @var{cpu-type}, which is the name of a system
20164 representing a certain processor type.  Possible values for
20165 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
20166 @samp{z9-109}, @samp{z9-ec}, @samp{z10},  @samp{z196}, and @samp{zEC12}.
20167 When generating code using the instructions available on z/Architecture,
20168 the default is @option{-march=z900}.  Otherwise, the default is
20169 @option{-march=g5}.
20171 @item -mtune=@var{cpu-type}
20172 @opindex mtune
20173 Tune to @var{cpu-type} everything applicable about the generated code,
20174 except for the ABI and the set of available instructions.
20175 The list of @var{cpu-type} values is the same as for @option{-march}.
20176 The default is the value used for @option{-march}.
20178 @item -mtpf-trace
20179 @itemx -mno-tpf-trace
20180 @opindex mtpf-trace
20181 @opindex mno-tpf-trace
20182 Generate code that adds (does not add) in TPF OS specific branches to trace
20183 routines in the operating system.  This option is off by default, even
20184 when compiling for the TPF OS@.
20186 @item -mfused-madd
20187 @itemx -mno-fused-madd
20188 @opindex mfused-madd
20189 @opindex mno-fused-madd
20190 Generate code that uses (does not use) the floating-point multiply and
20191 accumulate instructions.  These instructions are generated by default if
20192 hardware floating point is used.
20194 @item -mwarn-framesize=@var{framesize}
20195 @opindex mwarn-framesize
20196 Emit a warning if the current function exceeds the given frame size.  Because
20197 this is a compile-time check it doesn't need to be a real problem when the program
20198 runs.  It is intended to identify functions that most probably cause
20199 a stack overflow.  It is useful to be used in an environment with limited stack
20200 size e.g.@: the linux kernel.
20202 @item -mwarn-dynamicstack
20203 @opindex mwarn-dynamicstack
20204 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
20205 arrays.  This is generally a bad idea with a limited stack size.
20207 @item -mstack-guard=@var{stack-guard}
20208 @itemx -mstack-size=@var{stack-size}
20209 @opindex mstack-guard
20210 @opindex mstack-size
20211 If these options are provided the S/390 back end emits additional instructions in
20212 the function prologue that trigger a trap if the stack size is @var{stack-guard}
20213 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
20214 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
20215 the frame size of the compiled function is chosen.
20216 These options are intended to be used to help debugging stack overflow problems.
20217 The additionally emitted code causes only little overhead and hence can also be
20218 used in production-like systems without greater performance degradation.  The given
20219 values have to be exact powers of 2 and @var{stack-size} has to be greater than
20220 @var{stack-guard} without exceeding 64k.
20221 In order to be efficient the extra code makes the assumption that the stack starts
20222 at an address aligned to the value given by @var{stack-size}.
20223 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
20225 @item -mhotpatch=@var{pre-halfwords},@var{post-halfwords}
20226 @opindex mhotpatch
20227 If the hotpatch option is enabled, a ``hot-patching'' function
20228 prologue is generated for all functions in the compilation unit.
20229 The funtion label is prepended with the given number of two-byte
20230 NOP instructions (@var{pre-halfwords}, maximum 1000000).  After
20231 the label, 2 * @var{post-halfwords} bytes are appended, using the
20232 largest NOP like instructions the architecture allows (maximum
20233 1000000).
20235 If both arguments are zero, hotpatching is disabled.
20237 This option can be overridden for individual functions with the
20238 @code{hotpatch} attribute.
20239 @end table
20241 @node Score Options
20242 @subsection Score Options
20243 @cindex Score Options
20245 These options are defined for Score implementations:
20247 @table @gcctabopt
20248 @item -meb
20249 @opindex meb
20250 Compile code for big-endian mode.  This is the default.
20252 @item -mel
20253 @opindex mel
20254 Compile code for little-endian mode.
20256 @item -mnhwloop
20257 @opindex mnhwloop
20258 Disable generation of @code{bcnz} instructions.
20260 @item -muls
20261 @opindex muls
20262 Enable generation of unaligned load and store instructions.
20264 @item -mmac
20265 @opindex mmac
20266 Enable the use of multiply-accumulate instructions. Disabled by default.
20268 @item -mscore5
20269 @opindex mscore5
20270 Specify the SCORE5 as the target architecture.
20272 @item -mscore5u
20273 @opindex mscore5u
20274 Specify the SCORE5U of the target architecture.
20276 @item -mscore7
20277 @opindex mscore7
20278 Specify the SCORE7 as the target architecture. This is the default.
20280 @item -mscore7d
20281 @opindex mscore7d
20282 Specify the SCORE7D as the target architecture.
20283 @end table
20285 @node SH Options
20286 @subsection SH Options
20288 These @samp{-m} options are defined for the SH implementations:
20290 @table @gcctabopt
20291 @item -m1
20292 @opindex m1
20293 Generate code for the SH1.
20295 @item -m2
20296 @opindex m2
20297 Generate code for the SH2.
20299 @item -m2e
20300 Generate code for the SH2e.
20302 @item -m2a-nofpu
20303 @opindex m2a-nofpu
20304 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
20305 that the floating-point unit is not used.
20307 @item -m2a-single-only
20308 @opindex m2a-single-only
20309 Generate code for the SH2a-FPU, in such a way that no double-precision
20310 floating-point operations are used.
20312 @item -m2a-single
20313 @opindex m2a-single
20314 Generate code for the SH2a-FPU assuming the floating-point unit is in
20315 single-precision mode by default.
20317 @item -m2a
20318 @opindex m2a
20319 Generate code for the SH2a-FPU assuming the floating-point unit is in
20320 double-precision mode by default.
20322 @item -m3
20323 @opindex m3
20324 Generate code for the SH3.
20326 @item -m3e
20327 @opindex m3e
20328 Generate code for the SH3e.
20330 @item -m4-nofpu
20331 @opindex m4-nofpu
20332 Generate code for the SH4 without a floating-point unit.
20334 @item -m4-single-only
20335 @opindex m4-single-only
20336 Generate code for the SH4 with a floating-point unit that only
20337 supports single-precision arithmetic.
20339 @item -m4-single
20340 @opindex m4-single
20341 Generate code for the SH4 assuming the floating-point unit is in
20342 single-precision mode by default.
20344 @item -m4
20345 @opindex m4
20346 Generate code for the SH4.
20348 @item -m4-100
20349 @opindex m4-100
20350 Generate code for SH4-100.
20352 @item -m4-100-nofpu
20353 @opindex m4-100-nofpu
20354 Generate code for SH4-100 in such a way that the
20355 floating-point unit is not used.
20357 @item -m4-100-single
20358 @opindex m4-100-single
20359 Generate code for SH4-100 assuming the floating-point unit is in
20360 single-precision mode by default.
20362 @item -m4-100-single-only
20363 @opindex m4-100-single-only
20364 Generate code for SH4-100 in such a way that no double-precision
20365 floating-point operations are used.
20367 @item -m4-200
20368 @opindex m4-200
20369 Generate code for SH4-200.
20371 @item -m4-200-nofpu
20372 @opindex m4-200-nofpu
20373 Generate code for SH4-200 without in such a way that the
20374 floating-point unit is not used.
20376 @item -m4-200-single
20377 @opindex m4-200-single
20378 Generate code for SH4-200 assuming the floating-point unit is in
20379 single-precision mode by default.
20381 @item -m4-200-single-only
20382 @opindex m4-200-single-only
20383 Generate code for SH4-200 in such a way that no double-precision
20384 floating-point operations are used.
20386 @item -m4-300
20387 @opindex m4-300
20388 Generate code for SH4-300.
20390 @item -m4-300-nofpu
20391 @opindex m4-300-nofpu
20392 Generate code for SH4-300 without in such a way that the
20393 floating-point unit is not used.
20395 @item -m4-300-single
20396 @opindex m4-300-single
20397 Generate code for SH4-300 in such a way that no double-precision
20398 floating-point operations are used.
20400 @item -m4-300-single-only
20401 @opindex m4-300-single-only
20402 Generate code for SH4-300 in such a way that no double-precision
20403 floating-point operations are used.
20405 @item -m4-340
20406 @opindex m4-340
20407 Generate code for SH4-340 (no MMU, no FPU).
20409 @item -m4-500
20410 @opindex m4-500
20411 Generate code for SH4-500 (no FPU).  Passes @option{-isa=sh4-nofpu} to the
20412 assembler.
20414 @item -m4a-nofpu
20415 @opindex m4a-nofpu
20416 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
20417 floating-point unit is not used.
20419 @item -m4a-single-only
20420 @opindex m4a-single-only
20421 Generate code for the SH4a, in such a way that no double-precision
20422 floating-point operations are used.
20424 @item -m4a-single
20425 @opindex m4a-single
20426 Generate code for the SH4a assuming the floating-point unit is in
20427 single-precision mode by default.
20429 @item -m4a
20430 @opindex m4a
20431 Generate code for the SH4a.
20433 @item -m4al
20434 @opindex m4al
20435 Same as @option{-m4a-nofpu}, except that it implicitly passes
20436 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
20437 instructions at the moment.
20439 @item -m5-32media
20440 @opindex m5-32media
20441 Generate 32-bit code for SHmedia.
20443 @item -m5-32media-nofpu
20444 @opindex m5-32media-nofpu
20445 Generate 32-bit code for SHmedia in such a way that the
20446 floating-point unit is not used.
20448 @item -m5-64media
20449 @opindex m5-64media
20450 Generate 64-bit code for SHmedia.
20452 @item -m5-64media-nofpu
20453 @opindex m5-64media-nofpu
20454 Generate 64-bit code for SHmedia in such a way that the
20455 floating-point unit is not used.
20457 @item -m5-compact
20458 @opindex m5-compact
20459 Generate code for SHcompact.
20461 @item -m5-compact-nofpu
20462 @opindex m5-compact-nofpu
20463 Generate code for SHcompact in such a way that the
20464 floating-point unit is not used.
20466 @item -mb
20467 @opindex mb
20468 Compile code for the processor in big-endian mode.
20470 @item -ml
20471 @opindex ml
20472 Compile code for the processor in little-endian mode.
20474 @item -mdalign
20475 @opindex mdalign
20476 Align doubles at 64-bit boundaries.  Note that this changes the calling
20477 conventions, and thus some functions from the standard C library do
20478 not work unless you recompile it first with @option{-mdalign}.
20480 @item -mrelax
20481 @opindex mrelax
20482 Shorten some address references at link time, when possible; uses the
20483 linker option @option{-relax}.
20485 @item -mbigtable
20486 @opindex mbigtable
20487 Use 32-bit offsets in @code{switch} tables.  The default is to use
20488 16-bit offsets.
20490 @item -mbitops
20491 @opindex mbitops
20492 Enable the use of bit manipulation instructions on SH2A.
20494 @item -mfmovd
20495 @opindex mfmovd
20496 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
20497 alignment constraints.
20499 @item -mrenesas
20500 @opindex mrenesas
20501 Comply with the calling conventions defined by Renesas.
20503 @item -mno-renesas
20504 @opindex mno-renesas
20505 Comply with the calling conventions defined for GCC before the Renesas
20506 conventions were available.  This option is the default for all
20507 targets of the SH toolchain.
20509 @item -mnomacsave
20510 @opindex mnomacsave
20511 Mark the @code{MAC} register as call-clobbered, even if
20512 @option{-mrenesas} is given.
20514 @item -mieee
20515 @itemx -mno-ieee
20516 @opindex mieee
20517 @opindex mno-ieee
20518 Control the IEEE compliance of floating-point comparisons, which affects the
20519 handling of cases where the result of a comparison is unordered.  By default
20520 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
20521 enabled @option{-mno-ieee} is implicitly set, which results in faster
20522 floating-point greater-equal and less-equal comparisons.  The implcit settings
20523 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
20525 @item -minline-ic_invalidate
20526 @opindex minline-ic_invalidate
20527 Inline code to invalidate instruction cache entries after setting up
20528 nested function trampolines.
20529 This option has no effect if @option{-musermode} is in effect and the selected
20530 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
20531 instruction.
20532 If the selected code generation option does not allow the use of the @code{icbi}
20533 instruction, and @option{-musermode} is not in effect, the inlined code
20534 manipulates the instruction cache address array directly with an associative
20535 write.  This not only requires privileged mode at run time, but it also
20536 fails if the cache line had been mapped via the TLB and has become unmapped.
20538 @item -misize
20539 @opindex misize
20540 Dump instruction size and location in the assembly code.
20542 @item -mpadstruct
20543 @opindex mpadstruct
20544 This option is deprecated.  It pads structures to multiple of 4 bytes,
20545 which is incompatible with the SH ABI@.
20547 @item -matomic-model=@var{model}
20548 @opindex matomic-model=@var{model}
20549 Sets the model of atomic operations and additional parameters as a comma
20550 separated list.  For details on the atomic built-in functions see
20551 @ref{__atomic Builtins}.  The following models and parameters are supported:
20553 @table @samp
20555 @item none
20556 Disable compiler generated atomic sequences and emit library calls for atomic
20557 operations.  This is the default if the target is not @code{sh*-*-linux*}.
20559 @item soft-gusa
20560 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
20561 built-in functions.  The generated atomic sequences require additional support
20562 from the interrupt/exception handling code of the system and are only suitable
20563 for SH3* and SH4* single-core systems.  This option is enabled by default when
20564 the target is @code{sh*-*-linux*} and SH3* or SH4*.  When the target is SH4A,
20565 this option also partially utilizes the hardware atomic instructions
20566 @code{movli.l} and @code{movco.l} to create more efficient code, unless
20567 @samp{strict} is specified.  
20569 @item soft-tcb
20570 Generate software atomic sequences that use a variable in the thread control
20571 block.  This is a variation of the gUSA sequences which can also be used on
20572 SH1* and SH2* targets.  The generated atomic sequences require additional
20573 support from the interrupt/exception handling code of the system and are only
20574 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
20575 parameter has to be specified as well.
20577 @item soft-imask
20578 Generate software atomic sequences that temporarily disable interrupts by
20579 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
20580 in privileged mode and is only suitable for single-core systems.  Additional
20581 support from the interrupt/exception handling code of the system is not
20582 required.  This model is enabled by default when the target is
20583 @code{sh*-*-linux*} and SH1* or SH2*.
20585 @item hard-llcs
20586 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
20587 instructions only.  This is only available on SH4A and is suitable for
20588 multi-core systems.  Since the hardware instructions support only 32 bit atomic
20589 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
20590 Code compiled with this option is also compatible with other software
20591 atomic model interrupt/exception handling systems if executed on an SH4A
20592 system.  Additional support from the interrupt/exception handling code of the
20593 system is not required for this model.
20595 @item gbr-offset=
20596 This parameter specifies the offset in bytes of the variable in the thread
20597 control block structure that should be used by the generated atomic sequences
20598 when the @samp{soft-tcb} model has been selected.  For other models this
20599 parameter is ignored.  The specified value must be an integer multiple of four
20600 and in the range 0-1020.
20602 @item strict
20603 This parameter prevents mixed usage of multiple atomic models, even if they
20604 are compatible, and makes the compiler generate atomic sequences of the
20605 specified model only.
20607 @end table
20609 @item -mtas
20610 @opindex mtas
20611 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
20612 Notice that depending on the particular hardware and software configuration
20613 this can degrade overall performance due to the operand cache line flushes
20614 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
20615 processors the @code{tas.b} instruction must be used with caution since it
20616 can result in data corruption for certain cache configurations.
20618 @item -mprefergot
20619 @opindex mprefergot
20620 When generating position-independent code, emit function calls using
20621 the Global Offset Table instead of the Procedure Linkage Table.
20623 @item -musermode
20624 @itemx -mno-usermode
20625 @opindex musermode
20626 @opindex mno-usermode
20627 Don't allow (allow) the compiler generating privileged mode code.  Specifying
20628 @option{-musermode} also implies @option{-mno-inline-ic_invalidate} if the
20629 inlined code would not work in user mode.  @option{-musermode} is the default
20630 when the target is @code{sh*-*-linux*}.  If the target is SH1* or SH2*
20631 @option{-musermode} has no effect, since there is no user mode.
20633 @item -multcost=@var{number}
20634 @opindex multcost=@var{number}
20635 Set the cost to assume for a multiply insn.
20637 @item -mdiv=@var{strategy}
20638 @opindex mdiv=@var{strategy}
20639 Set the division strategy to be used for integer division operations.
20640 For SHmedia @var{strategy} can be one of: 
20642 @table @samp
20644 @item fp 
20645 Performs the operation in floating point.  This has a very high latency,
20646 but needs only a few instructions, so it might be a good choice if
20647 your code has enough easily-exploitable ILP to allow the compiler to
20648 schedule the floating-point instructions together with other instructions.
20649 Division by zero causes a floating-point exception.
20651 @item inv
20652 Uses integer operations to calculate the inverse of the divisor,
20653 and then multiplies the dividend with the inverse.  This strategy allows
20654 CSE and hoisting of the inverse calculation.  Division by zero calculates
20655 an unspecified result, but does not trap.
20657 @item inv:minlat
20658 A variant of @samp{inv} where, if no CSE or hoisting opportunities
20659 have been found, or if the entire operation has been hoisted to the same
20660 place, the last stages of the inverse calculation are intertwined with the
20661 final multiply to reduce the overall latency, at the expense of using a few
20662 more instructions, and thus offering fewer scheduling opportunities with
20663 other code.
20665 @item call
20666 Calls a library function that usually implements the @samp{inv:minlat}
20667 strategy.
20668 This gives high code density for @code{m5-*media-nofpu} compilations.
20670 @item call2
20671 Uses a different entry point of the same library function, where it
20672 assumes that a pointer to a lookup table has already been set up, which
20673 exposes the pointer load to CSE and code hoisting optimizations.
20675 @item inv:call
20676 @itemx inv:call2
20677 @itemx inv:fp
20678 Use the @samp{inv} algorithm for initial
20679 code generation, but if the code stays unoptimized, revert to the @samp{call},
20680 @samp{call2}, or @samp{fp} strategies, respectively.  Note that the
20681 potentially-trapping side effect of division by zero is carried by a
20682 separate instruction, so it is possible that all the integer instructions
20683 are hoisted out, but the marker for the side effect stays where it is.
20684 A recombination to floating-point operations or a call is not possible
20685 in that case.
20687 @item inv20u
20688 @itemx inv20l
20689 Variants of the @samp{inv:minlat} strategy.  In the case
20690 that the inverse calculation is not separated from the multiply, they speed
20691 up division where the dividend fits into 20 bits (plus sign where applicable)
20692 by inserting a test to skip a number of operations in this case; this test
20693 slows down the case of larger dividends.  @samp{inv20u} assumes the case of a such
20694 a small dividend to be unlikely, and @samp{inv20l} assumes it to be likely.
20696 @end table
20698 For targets other than SHmedia @var{strategy} can be one of:
20700 @table @samp
20702 @item call-div1
20703 Calls a library function that uses the single-step division instruction
20704 @code{div1} to perform the operation.  Division by zero calculates an
20705 unspecified result and does not trap.  This is the default except for SH4,
20706 SH2A and SHcompact.
20708 @item call-fp
20709 Calls a library function that performs the operation in double precision
20710 floating point.  Division by zero causes a floating-point exception.  This is
20711 the default for SHcompact with FPU.  Specifying this for targets that do not
20712 have a double precision FPU defaults to @code{call-div1}.
20714 @item call-table
20715 Calls a library function that uses a lookup table for small divisors and
20716 the @code{div1} instruction with case distinction for larger divisors.  Division
20717 by zero calculates an unspecified result and does not trap.  This is the default
20718 for SH4.  Specifying this for targets that do not have dynamic shift
20719 instructions defaults to @code{call-div1}.
20721 @end table
20723 When a division strategy has not been specified the default strategy is
20724 selected based on the current target.  For SH2A the default strategy is to
20725 use the @code{divs} and @code{divu} instructions instead of library function
20726 calls.
20728 @item -maccumulate-outgoing-args
20729 @opindex maccumulate-outgoing-args
20730 Reserve space once for outgoing arguments in the function prologue rather
20731 than around each call.  Generally beneficial for performance and size.  Also
20732 needed for unwinding to avoid changing the stack frame around conditional code.
20734 @item -mdivsi3_libfunc=@var{name}
20735 @opindex mdivsi3_libfunc=@var{name}
20736 Set the name of the library function used for 32-bit signed division to
20737 @var{name}.
20738 This only affects the name used in the @samp{call} and @samp{inv:call}
20739 division strategies, and the compiler still expects the same
20740 sets of input/output/clobbered registers as if this option were not present.
20742 @item -mfixed-range=@var{register-range}
20743 @opindex mfixed-range
20744 Generate code treating the given register range as fixed registers.
20745 A fixed register is one that the register allocator can not use.  This is
20746 useful when compiling kernel code.  A register range is specified as
20747 two registers separated by a dash.  Multiple register ranges can be
20748 specified separated by a comma.
20750 @item -mindexed-addressing
20751 @opindex mindexed-addressing
20752 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
20753 This is only safe if the hardware and/or OS implement 32-bit wrap-around
20754 semantics for the indexed addressing mode.  The architecture allows the
20755 implementation of processors with 64-bit MMU, which the OS could use to
20756 get 32-bit addressing, but since no current hardware implementation supports
20757 this or any other way to make the indexed addressing mode safe to use in
20758 the 32-bit ABI, the default is @option{-mno-indexed-addressing}.
20760 @item -mgettrcost=@var{number}
20761 @opindex mgettrcost=@var{number}
20762 Set the cost assumed for the @code{gettr} instruction to @var{number}.
20763 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
20765 @item -mpt-fixed
20766 @opindex mpt-fixed
20767 Assume @code{pt*} instructions won't trap.  This generally generates
20768 better-scheduled code, but is unsafe on current hardware.
20769 The current architecture
20770 definition says that @code{ptabs} and @code{ptrel} trap when the target 
20771 anded with 3 is 3.
20772 This has the unintentional effect of making it unsafe to schedule these
20773 instructions before a branch, or hoist them out of a loop.  For example,
20774 @code{__do_global_ctors}, a part of @file{libgcc}
20775 that runs constructors at program
20776 startup, calls functions in a list which is delimited by @minus{}1.  With the
20777 @option{-mpt-fixed} option, the @code{ptabs} is done before testing against @minus{}1.
20778 That means that all the constructors run a bit more quickly, but when
20779 the loop comes to the end of the list, the program crashes because @code{ptabs}
20780 loads @minus{}1 into a target register.  
20782 Since this option is unsafe for any
20783 hardware implementing the current architecture specification, the default
20784 is @option{-mno-pt-fixed}.  Unless specified explicitly with 
20785 @option{-mgettrcost}, @option{-mno-pt-fixed} also implies @option{-mgettrcost=100};
20786 this deters register allocation from using target registers for storing
20787 ordinary integers.
20789 @item -minvalid-symbols
20790 @opindex minvalid-symbols
20791 Assume symbols might be invalid.  Ordinary function symbols generated by
20792 the compiler are always valid to load with
20793 @code{movi}/@code{shori}/@code{ptabs} or
20794 @code{movi}/@code{shori}/@code{ptrel},
20795 but with assembler and/or linker tricks it is possible
20796 to generate symbols that cause @code{ptabs} or @code{ptrel} to trap.
20797 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
20798 It prevents cross-basic-block CSE, hoisting and most scheduling
20799 of symbol loads.  The default is @option{-mno-invalid-symbols}.
20801 @item -mbranch-cost=@var{num}
20802 @opindex mbranch-cost=@var{num}
20803 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
20804 make the compiler try to generate more branch-free code if possible.  
20805 If not specified the value is selected depending on the processor type that
20806 is being compiled for.
20808 @item -mzdcbranch
20809 @itemx -mno-zdcbranch
20810 @opindex mzdcbranch
20811 @opindex mno-zdcbranch
20812 Assume (do not assume) that zero displacement conditional branch instructions
20813 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
20814 compiler prefers zero displacement branch code sequences.  This is
20815 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
20816 disabled by specifying @option{-mno-zdcbranch}.
20818 @item -mcbranch-force-delay-slot
20819 @opindex mcbranch-force-delay-slot
20820 Force the usage of delay slots for conditional branches, which stuffs the delay
20821 slot with a @code{nop} if a suitable instruction can't be found.  By default
20822 this option is disabled.  It can be enabled to work around hardware bugs as
20823 found in the original SH7055.
20825 @item -mfused-madd
20826 @itemx -mno-fused-madd
20827 @opindex mfused-madd
20828 @opindex mno-fused-madd
20829 Generate code that uses (does not use) the floating-point multiply and
20830 accumulate instructions.  These instructions are generated by default
20831 if hardware floating point is used.  The machine-dependent
20832 @option{-mfused-madd} option is now mapped to the machine-independent
20833 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
20834 mapped to @option{-ffp-contract=off}.
20836 @item -mfsca
20837 @itemx -mno-fsca
20838 @opindex mfsca
20839 @opindex mno-fsca
20840 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
20841 and cosine approximations.  The option @option{-mfsca} must be used in
20842 combination with @option{-funsafe-math-optimizations}.  It is enabled by default
20843 when generating code for SH4A.  Using @option{-mno-fsca} disables sine and cosine
20844 approximations even if @option{-funsafe-math-optimizations} is in effect.
20846 @item -mfsrra
20847 @itemx -mno-fsrra
20848 @opindex mfsrra
20849 @opindex mno-fsrra
20850 Allow or disallow the compiler to emit the @code{fsrra} instruction for
20851 reciprocal square root approximations.  The option @option{-mfsrra} must be used
20852 in combination with @option{-funsafe-math-optimizations} and
20853 @option{-ffinite-math-only}.  It is enabled by default when generating code for
20854 SH4A.  Using @option{-mno-fsrra} disables reciprocal square root approximations
20855 even if @option{-funsafe-math-optimizations} and @option{-ffinite-math-only} are
20856 in effect.
20858 @item -mpretend-cmove
20859 @opindex mpretend-cmove
20860 Prefer zero-displacement conditional branches for conditional move instruction
20861 patterns.  This can result in faster code on the SH4 processor.
20863 @end table
20865 @node Solaris 2 Options
20866 @subsection Solaris 2 Options
20867 @cindex Solaris 2 options
20869 These @samp{-m} options are supported on Solaris 2:
20871 @table @gcctabopt
20872 @item -mclear-hwcap
20873 @opindex mclear-hwcap
20874 @option{-mclear-hwcap} tells the compiler to remove the hardware
20875 capabilities generated by the Solaris assembler.  This is only necessary
20876 when object files use ISA extensions not supported by the current
20877 machine, but check at runtime whether or not to use them.
20879 @item -mimpure-text
20880 @opindex mimpure-text
20881 @option{-mimpure-text}, used in addition to @option{-shared}, tells
20882 the compiler to not pass @option{-z text} to the linker when linking a
20883 shared object.  Using this option, you can link position-dependent
20884 code into a shared object.
20886 @option{-mimpure-text} suppresses the ``relocations remain against
20887 allocatable but non-writable sections'' linker error message.
20888 However, the necessary relocations trigger copy-on-write, and the
20889 shared object is not actually shared across processes.  Instead of
20890 using @option{-mimpure-text}, you should compile all source code with
20891 @option{-fpic} or @option{-fPIC}.
20893 @end table
20895 These switches are supported in addition to the above on Solaris 2:
20897 @table @gcctabopt
20898 @item -pthreads
20899 @opindex pthreads
20900 Add support for multithreading using the POSIX threads library.  This
20901 option sets flags for both the preprocessor and linker.  This option does
20902 not affect the thread safety of object code produced  by the compiler or
20903 that of libraries supplied with it.
20905 @item -pthread
20906 @opindex pthread
20907 This is a synonym for @option{-pthreads}.
20908 @end table
20910 @node SPARC Options
20911 @subsection SPARC Options
20912 @cindex SPARC options
20914 These @samp{-m} options are supported on the SPARC:
20916 @table @gcctabopt
20917 @item -mno-app-regs
20918 @itemx -mapp-regs
20919 @opindex mno-app-regs
20920 @opindex mapp-regs
20921 Specify @option{-mapp-regs} to generate output using the global registers
20922 2 through 4, which the SPARC SVR4 ABI reserves for applications.  Like the
20923 global register 1, each global register 2 through 4 is then treated as an
20924 allocable register that is clobbered by function calls.  This is the default.
20926 To be fully SVR4 ABI-compliant at the cost of some performance loss,
20927 specify @option{-mno-app-regs}.  You should compile libraries and system
20928 software with this option.
20930 @item -mflat
20931 @itemx -mno-flat
20932 @opindex mflat
20933 @opindex mno-flat
20934 With @option{-mflat}, the compiler does not generate save/restore instructions
20935 and uses a ``flat'' or single register window model.  This model is compatible
20936 with the regular register window model.  The local registers and the input
20937 registers (0--5) are still treated as ``call-saved'' registers and are
20938 saved on the stack as needed.
20940 With @option{-mno-flat} (the default), the compiler generates save/restore
20941 instructions (except for leaf functions).  This is the normal operating mode.
20943 @item -mfpu
20944 @itemx -mhard-float
20945 @opindex mfpu
20946 @opindex mhard-float
20947 Generate output containing floating-point instructions.  This is the
20948 default.
20950 @item -mno-fpu
20951 @itemx -msoft-float
20952 @opindex mno-fpu
20953 @opindex msoft-float
20954 Generate output containing library calls for floating point.
20955 @strong{Warning:} the requisite libraries are not available for all SPARC
20956 targets.  Normally the facilities of the machine's usual C compiler are
20957 used, but this cannot be done directly in cross-compilation.  You must make
20958 your own arrangements to provide suitable library functions for
20959 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
20960 @samp{sparclite-*-*} do provide software floating-point support.
20962 @option{-msoft-float} changes the calling convention in the output file;
20963 therefore, it is only useful if you compile @emph{all} of a program with
20964 this option.  In particular, you need to compile @file{libgcc.a}, the
20965 library that comes with GCC, with @option{-msoft-float} in order for
20966 this to work.
20968 @item -mhard-quad-float
20969 @opindex mhard-quad-float
20970 Generate output containing quad-word (long double) floating-point
20971 instructions.
20973 @item -msoft-quad-float
20974 @opindex msoft-quad-float
20975 Generate output containing library calls for quad-word (long double)
20976 floating-point instructions.  The functions called are those specified
20977 in the SPARC ABI@.  This is the default.
20979 As of this writing, there are no SPARC implementations that have hardware
20980 support for the quad-word floating-point instructions.  They all invoke
20981 a trap handler for one of these instructions, and then the trap handler
20982 emulates the effect of the instruction.  Because of the trap handler overhead,
20983 this is much slower than calling the ABI library routines.  Thus the
20984 @option{-msoft-quad-float} option is the default.
20986 @item -mno-unaligned-doubles
20987 @itemx -munaligned-doubles
20988 @opindex mno-unaligned-doubles
20989 @opindex munaligned-doubles
20990 Assume that doubles have 8-byte alignment.  This is the default.
20992 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
20993 alignment only if they are contained in another type, or if they have an
20994 absolute address.  Otherwise, it assumes they have 4-byte alignment.
20995 Specifying this option avoids some rare compatibility problems with code
20996 generated by other compilers.  It is not the default because it results
20997 in a performance loss, especially for floating-point code.
20999 @item -muser-mode
21000 @itemx -mno-user-mode
21001 @opindex muser-mode
21002 @opindex mno-user-mode
21003 Do not generate code that can only run in supervisor mode.  This is relevant
21004 only for the @code{casa} instruction emitted for the LEON3 processor.  The
21005 default is @option{-mno-user-mode}.
21007 @item -mno-faster-structs
21008 @itemx -mfaster-structs
21009 @opindex mno-faster-structs
21010 @opindex mfaster-structs
21011 With @option{-mfaster-structs}, the compiler assumes that structures
21012 should have 8-byte alignment.  This enables the use of pairs of
21013 @code{ldd} and @code{std} instructions for copies in structure
21014 assignment, in place of twice as many @code{ld} and @code{st} pairs.
21015 However, the use of this changed alignment directly violates the SPARC
21016 ABI@.  Thus, it's intended only for use on targets where the developer
21017 acknowledges that their resulting code is not directly in line with
21018 the rules of the ABI@.
21020 @item -mcpu=@var{cpu_type}
21021 @opindex mcpu
21022 Set the instruction set, register set, and instruction scheduling parameters
21023 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
21024 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
21025 @samp{leon}, @samp{leon3}, @samp{leon3v7}, @samp{sparclite}, @samp{f930},
21026 @samp{f934}, @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
21027 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
21028 @samp{niagara3} and @samp{niagara4}.
21030 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
21031 which selects the best architecture option for the host processor.
21032 @option{-mcpu=native} has no effect if GCC does not recognize
21033 the processor.
21035 Default instruction scheduling parameters are used for values that select
21036 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
21037 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
21039 Here is a list of each supported architecture and their supported
21040 implementations.
21042 @table @asis
21043 @item v7
21044 cypress, leon3v7
21046 @item v8
21047 supersparc, hypersparc, leon, leon3
21049 @item sparclite
21050 f930, f934, sparclite86x
21052 @item sparclet
21053 tsc701
21055 @item v9
21056 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4
21057 @end table
21059 By default (unless configured otherwise), GCC generates code for the V7
21060 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
21061 additionally optimizes it for the Cypress CY7C602 chip, as used in the
21062 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
21063 SPARCStation 1, 2, IPX etc.
21065 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
21066 architecture.  The only difference from V7 code is that the compiler emits
21067 the integer multiply and integer divide instructions which exist in SPARC-V8
21068 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
21069 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
21070 2000 series.
21072 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
21073 the SPARC architecture.  This adds the integer multiply, integer divide step
21074 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
21075 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
21076 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
21077 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
21078 MB86934 chip, which is the more recent SPARClite with FPU@.
21080 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
21081 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
21082 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
21083 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
21084 optimizes it for the TEMIC SPARClet chip.
21086 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
21087 architecture.  This adds 64-bit integer and floating-point move instructions,
21088 3 additional floating-point condition code registers and conditional move
21089 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
21090 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
21091 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
21092 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
21093 @option{-mcpu=niagara}, the compiler additionally optimizes it for
21094 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
21095 additionally optimizes it for Sun UltraSPARC T2 chips. With
21096 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
21097 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
21098 additionally optimizes it for Sun UltraSPARC T4 chips.
21100 @item -mtune=@var{cpu_type}
21101 @opindex mtune
21102 Set the instruction scheduling parameters for machine type
21103 @var{cpu_type}, but do not set the instruction set or register set that the
21104 option @option{-mcpu=@var{cpu_type}} does.
21106 The same values for @option{-mcpu=@var{cpu_type}} can be used for
21107 @option{-mtune=@var{cpu_type}}, but the only useful values are those
21108 that select a particular CPU implementation.  Those are @samp{cypress},
21109 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{leon3},
21110 @samp{leon3v7}, @samp{f930}, @samp{f934}, @samp{sparclite86x}, @samp{tsc701},
21111 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
21112 @samp{niagara3} and @samp{niagara4}.  With native Solaris and GNU/Linux
21113 toolchains, @samp{native} can also be used.
21115 @item -mv8plus
21116 @itemx -mno-v8plus
21117 @opindex mv8plus
21118 @opindex mno-v8plus
21119 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
21120 difference from the V8 ABI is that the global and out registers are
21121 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
21122 mode for all SPARC-V9 processors.
21124 @item -mvis
21125 @itemx -mno-vis
21126 @opindex mvis
21127 @opindex mno-vis
21128 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
21129 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
21131 @item -mvis2
21132 @itemx -mno-vis2
21133 @opindex mvis2
21134 @opindex mno-vis2
21135 With @option{-mvis2}, GCC generates code that takes advantage of
21136 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
21137 default is @option{-mvis2} when targeting a cpu that supports such
21138 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
21139 also sets @option{-mvis}.
21141 @item -mvis3
21142 @itemx -mno-vis3
21143 @opindex mvis3
21144 @opindex mno-vis3
21145 With @option{-mvis3}, GCC generates code that takes advantage of
21146 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
21147 default is @option{-mvis3} when targeting a cpu that supports such
21148 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
21149 also sets @option{-mvis2} and @option{-mvis}.
21151 @item -mcbcond
21152 @itemx -mno-cbcond
21153 @opindex mcbcond
21154 @opindex mno-cbcond
21155 With @option{-mcbcond}, GCC generates code that takes advantage of
21156 compare-and-branch instructions, as defined in the Sparc Architecture 2011.
21157 The default is @option{-mcbcond} when targeting a cpu that supports such
21158 instructions, such as niagara-4 and later.
21160 @item -mpopc
21161 @itemx -mno-popc
21162 @opindex mpopc
21163 @opindex mno-popc
21164 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
21165 population count instruction.  The default is @option{-mpopc}
21166 when targeting a cpu that supports such instructions, such as Niagara-2 and
21167 later.
21169 @item -mfmaf
21170 @itemx -mno-fmaf
21171 @opindex mfmaf
21172 @opindex mno-fmaf
21173 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
21174 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
21175 when targeting a cpu that supports such instructions, such as Niagara-3 and
21176 later.
21178 @item -mfix-at697f
21179 @opindex mfix-at697f
21180 Enable the documented workaround for the single erratum of the Atmel AT697F
21181 processor (which corresponds to erratum #13 of the AT697E processor).
21183 @item -mfix-ut699
21184 @opindex mfix-ut699
21185 Enable the documented workarounds for the floating-point errata and the data
21186 cache nullify errata of the UT699 processor.
21187 @end table
21189 These @samp{-m} options are supported in addition to the above
21190 on SPARC-V9 processors in 64-bit environments:
21192 @table @gcctabopt
21193 @item -m32
21194 @itemx -m64
21195 @opindex m32
21196 @opindex m64
21197 Generate code for a 32-bit or 64-bit environment.
21198 The 32-bit environment sets int, long and pointer to 32 bits.
21199 The 64-bit environment sets int to 32 bits and long and pointer
21200 to 64 bits.
21202 @item -mcmodel=@var{which}
21203 @opindex mcmodel
21204 Set the code model to one of
21206 @table @samp
21207 @item medlow
21208 The Medium/Low code model: 64-bit addresses, programs
21209 must be linked in the low 32 bits of memory.  Programs can be statically
21210 or dynamically linked.
21212 @item medmid
21213 The Medium/Middle code model: 64-bit addresses, programs
21214 must be linked in the low 44 bits of memory, the text and data segments must
21215 be less than 2GB in size and the data segment must be located within 2GB of
21216 the text segment.
21218 @item medany
21219 The Medium/Anywhere code model: 64-bit addresses, programs
21220 may be linked anywhere in memory, the text and data segments must be less
21221 than 2GB in size and the data segment must be located within 2GB of the
21222 text segment.
21224 @item embmedany
21225 The Medium/Anywhere code model for embedded systems:
21226 64-bit addresses, the text and data segments must be less than 2GB in
21227 size, both starting anywhere in memory (determined at link time).  The
21228 global register %g4 points to the base of the data segment.  Programs
21229 are statically linked and PIC is not supported.
21230 @end table
21232 @item -mmemory-model=@var{mem-model}
21233 @opindex mmemory-model
21234 Set the memory model in force on the processor to one of
21236 @table @samp
21237 @item default
21238 The default memory model for the processor and operating system.
21240 @item rmo
21241 Relaxed Memory Order
21243 @item pso
21244 Partial Store Order
21246 @item tso
21247 Total Store Order
21249 @item sc
21250 Sequential Consistency
21251 @end table
21253 These memory models are formally defined in Appendix D of the Sparc V9
21254 architecture manual, as set in the processor's @code{PSTATE.MM} field.
21256 @item -mstack-bias
21257 @itemx -mno-stack-bias
21258 @opindex mstack-bias
21259 @opindex mno-stack-bias
21260 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
21261 frame pointer if present, are offset by @minus{}2047 which must be added back
21262 when making stack frame references.  This is the default in 64-bit mode.
21263 Otherwise, assume no such offset is present.
21264 @end table
21266 @node SPU Options
21267 @subsection SPU Options
21268 @cindex SPU options
21270 These @samp{-m} options are supported on the SPU:
21272 @table @gcctabopt
21273 @item -mwarn-reloc
21274 @itemx -merror-reloc
21275 @opindex mwarn-reloc
21276 @opindex merror-reloc
21278 The loader for SPU does not handle dynamic relocations.  By default, GCC
21279 gives an error when it generates code that requires a dynamic
21280 relocation.  @option{-mno-error-reloc} disables the error,
21281 @option{-mwarn-reloc} generates a warning instead.
21283 @item -msafe-dma
21284 @itemx -munsafe-dma
21285 @opindex msafe-dma
21286 @opindex munsafe-dma
21288 Instructions that initiate or test completion of DMA must not be
21289 reordered with respect to loads and stores of the memory that is being
21290 accessed.
21291 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
21292 memory accesses, but that can lead to inefficient code in places where the
21293 memory is known to not change.  Rather than mark the memory as volatile,
21294 you can use @option{-msafe-dma} to tell the compiler to treat
21295 the DMA instructions as potentially affecting all memory.  
21297 @item -mbranch-hints
21298 @opindex mbranch-hints
21300 By default, GCC generates a branch hint instruction to avoid
21301 pipeline stalls for always-taken or probably-taken branches.  A hint
21302 is not generated closer than 8 instructions away from its branch.
21303 There is little reason to disable them, except for debugging purposes,
21304 or to make an object a little bit smaller.
21306 @item -msmall-mem
21307 @itemx -mlarge-mem
21308 @opindex msmall-mem
21309 @opindex mlarge-mem
21311 By default, GCC generates code assuming that addresses are never larger
21312 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
21313 a full 32-bit address.
21315 @item -mstdmain
21316 @opindex mstdmain
21318 By default, GCC links against startup code that assumes the SPU-style
21319 main function interface (which has an unconventional parameter list).
21320 With @option{-mstdmain}, GCC links your program against startup
21321 code that assumes a C99-style interface to @code{main}, including a
21322 local copy of @code{argv} strings.
21324 @item -mfixed-range=@var{register-range}
21325 @opindex mfixed-range
21326 Generate code treating the given register range as fixed registers.
21327 A fixed register is one that the register allocator cannot use.  This is
21328 useful when compiling kernel code.  A register range is specified as
21329 two registers separated by a dash.  Multiple register ranges can be
21330 specified separated by a comma.
21332 @item -mea32
21333 @itemx -mea64
21334 @opindex mea32
21335 @opindex mea64
21336 Compile code assuming that pointers to the PPU address space accessed
21337 via the @code{__ea} named address space qualifier are either 32 or 64
21338 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
21339 all object code in an executable must be compiled with the same setting.
21341 @item -maddress-space-conversion
21342 @itemx -mno-address-space-conversion
21343 @opindex maddress-space-conversion
21344 @opindex mno-address-space-conversion
21345 Allow/disallow treating the @code{__ea} address space as superset
21346 of the generic address space.  This enables explicit type casts
21347 between @code{__ea} and generic pointer as well as implicit
21348 conversions of generic pointers to @code{__ea} pointers.  The
21349 default is to allow address space pointer conversions.
21351 @item -mcache-size=@var{cache-size}
21352 @opindex mcache-size
21353 This option controls the version of libgcc that the compiler links to an
21354 executable and selects a software-managed cache for accessing variables
21355 in the @code{__ea} address space with a particular cache size.  Possible
21356 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
21357 and @samp{128}.  The default cache size is 64KB.
21359 @item -matomic-updates
21360 @itemx -mno-atomic-updates
21361 @opindex matomic-updates
21362 @opindex mno-atomic-updates
21363 This option controls the version of libgcc that the compiler links to an
21364 executable and selects whether atomic updates to the software-managed
21365 cache of PPU-side variables are used.  If you use atomic updates, changes
21366 to a PPU variable from SPU code using the @code{__ea} named address space
21367 qualifier do not interfere with changes to other PPU variables residing
21368 in the same cache line from PPU code.  If you do not use atomic updates,
21369 such interference may occur; however, writing back cache lines is
21370 more efficient.  The default behavior is to use atomic updates.
21372 @item -mdual-nops
21373 @itemx -mdual-nops=@var{n}
21374 @opindex mdual-nops
21375 By default, GCC inserts nops to increase dual issue when it expects
21376 it to increase performance.  @var{n} can be a value from 0 to 10.  A
21377 smaller @var{n} inserts fewer nops.  10 is the default, 0 is the
21378 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
21380 @item -mhint-max-nops=@var{n}
21381 @opindex mhint-max-nops
21382 Maximum number of nops to insert for a branch hint.  A branch hint must
21383 be at least 8 instructions away from the branch it is affecting.  GCC
21384 inserts up to @var{n} nops to enforce this, otherwise it does not
21385 generate the branch hint.
21387 @item -mhint-max-distance=@var{n}
21388 @opindex mhint-max-distance
21389 The encoding of the branch hint instruction limits the hint to be within
21390 256 instructions of the branch it is affecting.  By default, GCC makes
21391 sure it is within 125.
21393 @item -msafe-hints
21394 @opindex msafe-hints
21395 Work around a hardware bug that causes the SPU to stall indefinitely.
21396 By default, GCC inserts the @code{hbrp} instruction to make sure
21397 this stall won't happen.
21399 @end table
21401 @node System V Options
21402 @subsection Options for System V
21404 These additional options are available on System V Release 4 for
21405 compatibility with other compilers on those systems:
21407 @table @gcctabopt
21408 @item -G
21409 @opindex G
21410 Create a shared object.
21411 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
21413 @item -Qy
21414 @opindex Qy
21415 Identify the versions of each tool used by the compiler, in a
21416 @code{.ident} assembler directive in the output.
21418 @item -Qn
21419 @opindex Qn
21420 Refrain from adding @code{.ident} directives to the output file (this is
21421 the default).
21423 @item -YP,@var{dirs}
21424 @opindex YP
21425 Search the directories @var{dirs}, and no others, for libraries
21426 specified with @option{-l}.
21428 @item -Ym,@var{dir}
21429 @opindex Ym
21430 Look in the directory @var{dir} to find the M4 preprocessor.
21431 The assembler uses this option.
21432 @c This is supposed to go with a -Yd for predefined M4 macro files, but
21433 @c the generic assembler that comes with Solaris takes just -Ym.
21434 @end table
21436 @node TILE-Gx Options
21437 @subsection TILE-Gx Options
21438 @cindex TILE-Gx options
21440 These @samp{-m} options are supported on the TILE-Gx:
21442 @table @gcctabopt
21443 @item -mcmodel=small
21444 @opindex mcmodel=small
21445 Generate code for the small model.  The distance for direct calls is
21446 limited to 500M in either direction.  PC-relative addresses are 32
21447 bits.  Absolute addresses support the full address range.
21449 @item -mcmodel=large
21450 @opindex mcmodel=large
21451 Generate code for the large model.  There is no limitation on call
21452 distance, pc-relative addresses, or absolute addresses.
21454 @item -mcpu=@var{name}
21455 @opindex mcpu
21456 Selects the type of CPU to be targeted.  Currently the only supported
21457 type is @samp{tilegx}.
21459 @item -m32
21460 @itemx -m64
21461 @opindex m32
21462 @opindex m64
21463 Generate code for a 32-bit or 64-bit environment.  The 32-bit
21464 environment sets int, long, and pointer to 32 bits.  The 64-bit
21465 environment sets int to 32 bits and long and pointer to 64 bits.
21467 @item -mbig-endian
21468 @itemx -mlittle-endian
21469 @opindex mbig-endian
21470 @opindex mlittle-endian
21471 Generate code in big/little endian mode, respectively.
21472 @end table
21474 @node TILEPro Options
21475 @subsection TILEPro Options
21476 @cindex TILEPro options
21478 These @samp{-m} options are supported on the TILEPro:
21480 @table @gcctabopt
21481 @item -mcpu=@var{name}
21482 @opindex mcpu
21483 Selects the type of CPU to be targeted.  Currently the only supported
21484 type is @samp{tilepro}.
21486 @item -m32
21487 @opindex m32
21488 Generate code for a 32-bit environment, which sets int, long, and
21489 pointer to 32 bits.  This is the only supported behavior so the flag
21490 is essentially ignored.
21491 @end table
21493 @node V850 Options
21494 @subsection V850 Options
21495 @cindex V850 Options
21497 These @samp{-m} options are defined for V850 implementations:
21499 @table @gcctabopt
21500 @item -mlong-calls
21501 @itemx -mno-long-calls
21502 @opindex mlong-calls
21503 @opindex mno-long-calls
21504 Treat all calls as being far away (near).  If calls are assumed to be
21505 far away, the compiler always loads the function's address into a
21506 register, and calls indirect through the pointer.
21508 @item -mno-ep
21509 @itemx -mep
21510 @opindex mno-ep
21511 @opindex mep
21512 Do not optimize (do optimize) basic blocks that use the same index
21513 pointer 4 or more times to copy pointer into the @code{ep} register, and
21514 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
21515 option is on by default if you optimize.
21517 @item -mno-prolog-function
21518 @itemx -mprolog-function
21519 @opindex mno-prolog-function
21520 @opindex mprolog-function
21521 Do not use (do use) external functions to save and restore registers
21522 at the prologue and epilogue of a function.  The external functions
21523 are slower, but use less code space if more than one function saves
21524 the same number of registers.  The @option{-mprolog-function} option
21525 is on by default if you optimize.
21527 @item -mspace
21528 @opindex mspace
21529 Try to make the code as small as possible.  At present, this just turns
21530 on the @option{-mep} and @option{-mprolog-function} options.
21532 @item -mtda=@var{n}
21533 @opindex mtda
21534 Put static or global variables whose size is @var{n} bytes or less into
21535 the tiny data area that register @code{ep} points to.  The tiny data
21536 area can hold up to 256 bytes in total (128 bytes for byte references).
21538 @item -msda=@var{n}
21539 @opindex msda
21540 Put static or global variables whose size is @var{n} bytes or less into
21541 the small data area that register @code{gp} points to.  The small data
21542 area can hold up to 64 kilobytes.
21544 @item -mzda=@var{n}
21545 @opindex mzda
21546 Put static or global variables whose size is @var{n} bytes or less into
21547 the first 32 kilobytes of memory.
21549 @item -mv850
21550 @opindex mv850
21551 Specify that the target processor is the V850.
21553 @item -mv850e3v5
21554 @opindex mv850e3v5
21555 Specify that the target processor is the V850E3V5.  The preprocessor
21556 constant @code{__v850e3v5__} is defined if this option is used.
21558 @item -mv850e2v4
21559 @opindex mv850e2v4
21560 Specify that the target processor is the V850E3V5.  This is an alias for
21561 the @option{-mv850e3v5} option.
21563 @item -mv850e2v3
21564 @opindex mv850e2v3
21565 Specify that the target processor is the V850E2V3.  The preprocessor
21566 constant @code{__v850e2v3__} is defined if this option is used.
21568 @item -mv850e2
21569 @opindex mv850e2
21570 Specify that the target processor is the V850E2.  The preprocessor
21571 constant @code{__v850e2__} is defined if this option is used.
21573 @item -mv850e1
21574 @opindex mv850e1
21575 Specify that the target processor is the V850E1.  The preprocessor
21576 constants @code{__v850e1__} and @code{__v850e__} are defined if
21577 this option is used.
21579 @item -mv850es
21580 @opindex mv850es
21581 Specify that the target processor is the V850ES.  This is an alias for
21582 the @option{-mv850e1} option.
21584 @item -mv850e
21585 @opindex mv850e
21586 Specify that the target processor is the V850E@.  The preprocessor
21587 constant @code{__v850e__} is defined if this option is used.
21589 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
21590 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
21591 are defined then a default target processor is chosen and the
21592 relevant @samp{__v850*__} preprocessor constant is defined.
21594 The preprocessor constants @code{__v850} and @code{__v851__} are always
21595 defined, regardless of which processor variant is the target.
21597 @item -mdisable-callt
21598 @itemx -mno-disable-callt
21599 @opindex mdisable-callt
21600 @opindex mno-disable-callt
21601 This option suppresses generation of the @code{CALLT} instruction for the
21602 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
21603 architecture.
21605 This option is enabled by default when the RH850 ABI is
21606 in use (see @option{-mrh850-abi}), and disabled by default when the
21607 GCC ABI is in use.  If @code{CALLT} instructions are being generated
21608 then the C preprocessor symbol @code{__V850_CALLT__} is defined.
21610 @item -mrelax
21611 @itemx -mno-relax
21612 @opindex mrelax
21613 @opindex mno-relax
21614 Pass on (or do not pass on) the @option{-mrelax} command line option
21615 to the assembler.
21617 @item -mlong-jumps
21618 @itemx -mno-long-jumps
21619 @opindex mlong-jumps
21620 @opindex mno-long-jumps
21621 Disable (or re-enable) the generation of PC-relative jump instructions.
21623 @item -msoft-float
21624 @itemx -mhard-float
21625 @opindex msoft-float
21626 @opindex mhard-float
21627 Disable (or re-enable) the generation of hardware floating point
21628 instructions.  This option is only significant when the target
21629 architecture is @samp{V850E2V3} or higher.  If hardware floating point
21630 instructions are being generated then the C preprocessor symbol
21631 @code{__FPU_OK__} is defined, otherwise the symbol
21632 @code{__NO_FPU__} is defined.
21634 @item -mloop
21635 @opindex mloop
21636 Enables the use of the e3v5 LOOP instruction.  The use of this
21637 instruction is not enabled by default when the e3v5 architecture is
21638 selected because its use is still experimental.
21640 @item -mrh850-abi
21641 @itemx -mghs
21642 @opindex mrh850-abi
21643 @opindex mghs
21644 Enables support for the RH850 version of the V850 ABI.  This is the
21645 default.  With this version of the ABI the following rules apply:
21647 @itemize
21648 @item
21649 Integer sized structures and unions are returned via a memory pointer
21650 rather than a register.
21652 @item
21653 Large structures and unions (more than 8 bytes in size) are passed by
21654 value.
21656 @item
21657 Functions are aligned to 16-bit boundaries.
21659 @item
21660 The @option{-m8byte-align} command line option is supported.
21662 @item
21663 The @option{-mdisable-callt} command line option is enabled by
21664 default.  The @option{-mno-disable-callt} command line option is not
21665 supported.
21666 @end itemize
21668 When this version of the ABI is enabled the C preprocessor symbol
21669 @code{__V850_RH850_ABI__} is defined.
21671 @item -mgcc-abi
21672 @opindex mgcc-abi
21673 Enables support for the old GCC version of the V850 ABI.  With this
21674 version of the ABI the following rules apply:
21676 @itemize
21677 @item
21678 Integer sized structures and unions are returned in register @code{r10}.
21680 @item
21681 Large structures and unions (more than 8 bytes in size) are passed by
21682 reference.
21684 @item
21685 Functions are aligned to 32-bit boundaries, unless optimizing for
21686 size.
21688 @item
21689 The @option{-m8byte-align} command line option is not supported.
21691 @item
21692 The @option{-mdisable-callt} command line option is supported but not
21693 enabled by default.
21694 @end itemize
21696 When this version of the ABI is enabled the C preprocessor symbol
21697 @code{__V850_GCC_ABI__} is defined.
21699 @item -m8byte-align
21700 @itemx -mno-8byte-align
21701 @opindex m8byte-align
21702 @opindex mno-8byte-align
21703 Enables support for @code{double} and @code{long long} types to be
21704 aligned on 8-byte boundaries.  The default is to restrict the
21705 alignment of all objects to at most 4-bytes.  When
21706 @option{-m8byte-align} is in effect the C preprocessor symbol
21707 @code{__V850_8BYTE_ALIGN__} is defined.
21709 @item -mbig-switch
21710 @opindex mbig-switch
21711 Generate code suitable for big switch tables.  Use this option only if
21712 the assembler/linker complain about out of range branches within a switch
21713 table.
21715 @item -mapp-regs
21716 @opindex mapp-regs
21717 This option causes r2 and r5 to be used in the code generated by
21718 the compiler.  This setting is the default.
21720 @item -mno-app-regs
21721 @opindex mno-app-regs
21722 This option causes r2 and r5 to be treated as fixed registers.
21724 @end table
21726 @node VAX Options
21727 @subsection VAX Options
21728 @cindex VAX options
21730 These @samp{-m} options are defined for the VAX:
21732 @table @gcctabopt
21733 @item -munix
21734 @opindex munix
21735 Do not output certain jump instructions (@code{aobleq} and so on)
21736 that the Unix assembler for the VAX cannot handle across long
21737 ranges.
21739 @item -mgnu
21740 @opindex mgnu
21741 Do output those jump instructions, on the assumption that the
21742 GNU assembler is being used.
21744 @item -mg
21745 @opindex mg
21746 Output code for G-format floating-point numbers instead of D-format.
21747 @end table
21749 @node Visium Options
21750 @subsection Visium Options
21751 @cindex Visium options
21753 @table @gcctabopt
21755 @item -mdebug
21756 @opindex mdebug
21757 A program which performs file I/O and is destined to run on an MCM target
21758 should be linked with this option.  It causes the libraries libc.a and
21759 libdebug.a to be linked.  The program should be run on the target under
21760 the control of the GDB remote debugging stub.
21762 @item -msim
21763 @opindex msim
21764 A program which performs file I/O and is destined to run on the simulator
21765 should be linked with option.  This causes libraries libc.a and libsim.a to
21766 be linked.
21768 @item -mfpu
21769 @itemx -mhard-float
21770 @opindex mfpu
21771 @opindex mhard-float
21772 Generate code containing floating-point instructions.  This is the
21773 default.
21775 @item -mno-fpu
21776 @itemx -msoft-float
21777 @opindex mno-fpu
21778 @opindex msoft-float
21779 Generate code containing library calls for floating-point.
21781 @option{-msoft-float} changes the calling convention in the output file;
21782 therefore, it is only useful if you compile @emph{all} of a program with
21783 this option.  In particular, you need to compile @file{libgcc.a}, the
21784 library that comes with GCC, with @option{-msoft-float} in order for
21785 this to work.
21787 @item -mcpu=@var{cpu_type}
21788 @opindex mcpu
21789 Set the instruction set, register set, and instruction scheduling parameters
21790 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
21791 @samp{mcm}, @samp{gr5} and @samp{gr6}.
21793 @samp{mcm} is a synonym of @samp{gr5} present for backward compatibility.
21795 By default (unless configured otherwise), GCC generates code for the GR5
21796 variant of the Visium architecture.  
21798 With @option{-mcpu=gr6}, GCC generates code for the GR6 variant of the Visium
21799 architecture.  The only difference from GR5 code is that the compiler will
21800 generate block move instructions.
21802 @item -mtune=@var{cpu_type}
21803 @opindex mtune
21804 Set the instruction scheduling parameters for machine type @var{cpu_type},
21805 but do not set the instruction set or register set that the option
21806 @option{-mcpu=@var{cpu_type}} would.
21808 @item -msv-mode
21809 @opindex msv-mode
21810 Generate code for the supervisor mode, where there are no restrictions on
21811 the access to general registers.  This is the default.
21813 @item -muser-mode
21814 @opindex muser-mode
21815 Generate code for the user mode, where the access to some general registers
21816 is forbidden: on the GR5, registers r24 to r31 cannot be accessed in this
21817 mode; on the GR6, only registers r29 to r31 are affected.
21818 @end table
21820 @node VMS Options
21821 @subsection VMS Options
21823 These @samp{-m} options are defined for the VMS implementations:
21825 @table @gcctabopt
21826 @item -mvms-return-codes
21827 @opindex mvms-return-codes
21828 Return VMS condition codes from @code{main}. The default is to return POSIX-style
21829 condition (e.g.@ error) codes.
21831 @item -mdebug-main=@var{prefix}
21832 @opindex mdebug-main=@var{prefix}
21833 Flag the first routine whose name starts with @var{prefix} as the main
21834 routine for the debugger.
21836 @item -mmalloc64
21837 @opindex mmalloc64
21838 Default to 64-bit memory allocation routines.
21840 @item -mpointer-size=@var{size}
21841 @opindex mpointer-size=@var{size}
21842 Set the default size of pointers. Possible options for @var{size} are
21843 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
21844 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
21845 The later option disables @code{pragma pointer_size}.
21846 @end table
21848 @node VxWorks Options
21849 @subsection VxWorks Options
21850 @cindex VxWorks Options
21852 The options in this section are defined for all VxWorks targets.
21853 Options specific to the target hardware are listed with the other
21854 options for that target.
21856 @table @gcctabopt
21857 @item -mrtp
21858 @opindex mrtp
21859 GCC can generate code for both VxWorks kernels and real time processes
21860 (RTPs).  This option switches from the former to the latter.  It also
21861 defines the preprocessor macro @code{__RTP__}.
21863 @item -non-static
21864 @opindex non-static
21865 Link an RTP executable against shared libraries rather than static
21866 libraries.  The options @option{-static} and @option{-shared} can
21867 also be used for RTPs (@pxref{Link Options}); @option{-static}
21868 is the default.
21870 @item -Bstatic
21871 @itemx -Bdynamic
21872 @opindex Bstatic
21873 @opindex Bdynamic
21874 These options are passed down to the linker.  They are defined for
21875 compatibility with Diab.
21877 @item -Xbind-lazy
21878 @opindex Xbind-lazy
21879 Enable lazy binding of function calls.  This option is equivalent to
21880 @option{-Wl,-z,now} and is defined for compatibility with Diab.
21882 @item -Xbind-now
21883 @opindex Xbind-now
21884 Disable lazy binding of function calls.  This option is the default and
21885 is defined for compatibility with Diab.
21886 @end table
21888 @node x86 Options
21889 @subsection x86 Options
21890 @cindex x86 Options
21892 These @samp{-m} options are defined for the x86 family of computers.
21894 @table @gcctabopt
21896 @item -march=@var{cpu-type}
21897 @opindex march
21898 Generate instructions for the machine type @var{cpu-type}.  In contrast to
21899 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
21900 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
21901 to generate code that may not run at all on processors other than the one
21902 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
21903 @option{-mtune=@var{cpu-type}}.
21905 The choices for @var{cpu-type} are:
21907 @table @samp
21908 @item native
21909 This selects the CPU to generate code for at compilation time by determining
21910 the processor type of the compiling machine.  Using @option{-march=native}
21911 enables all instruction subsets supported by the local machine (hence
21912 the result might not run on different machines).  Using @option{-mtune=native}
21913 produces code optimized for the local machine under the constraints
21914 of the selected instruction set.  
21916 @item i386
21917 Original Intel i386 CPU@.
21919 @item i486
21920 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
21922 @item i586
21923 @itemx pentium
21924 Intel Pentium CPU with no MMX support.
21926 @item pentium-mmx
21927 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
21929 @item pentiumpro
21930 Intel Pentium Pro CPU@.
21932 @item i686
21933 When used with @option{-march}, the Pentium Pro
21934 instruction set is used, so the code runs on all i686 family chips.
21935 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
21937 @item pentium2
21938 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
21939 support.
21941 @item pentium3
21942 @itemx pentium3m
21943 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
21944 set support.
21946 @item pentium-m
21947 Intel Pentium M; low-power version of Intel Pentium III CPU
21948 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
21950 @item pentium4
21951 @itemx pentium4m
21952 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
21954 @item prescott
21955 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
21956 set support.
21958 @item nocona
21959 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
21960 SSE2 and SSE3 instruction set support.
21962 @item core2
21963 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
21964 instruction set support.
21966 @item nehalem
21967 Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
21968 SSE4.1, SSE4.2 and POPCNT instruction set support.
21970 @item westmere
21971 Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
21972 SSE4.1, SSE4.2, POPCNT, AES and PCLMUL instruction set support.
21974 @item sandybridge
21975 Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
21976 SSE4.1, SSE4.2, POPCNT, AVX, AES and PCLMUL instruction set support.
21978 @item ivybridge
21979 Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
21980 SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C
21981 instruction set support.
21983 @item haswell
21984 Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
21985 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
21986 BMI, BMI2 and F16C instruction set support.
21988 @item broadwell
21989 Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
21990 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
21991 BMI, BMI2, F16C, RDSEED, ADCX and PREFETCHW instruction set support.
21993 @item bonnell
21994 Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
21995 instruction set support.
21997 @item silvermont
21998 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
21999 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL and RDRND instruction set support.
22001 @item knl
22002 Intel Knight's Landing CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
22003 SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
22004 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER and
22005 AVX512CD instruction set support.
22007 @item k6
22008 AMD K6 CPU with MMX instruction set support.
22010 @item k6-2
22011 @itemx k6-3
22012 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
22014 @item athlon
22015 @itemx athlon-tbird
22016 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
22017 support.
22019 @item athlon-4
22020 @itemx athlon-xp
22021 @itemx athlon-mp
22022 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
22023 instruction set support.
22025 @item k8
22026 @itemx opteron
22027 @itemx athlon64
22028 @itemx athlon-fx
22029 Processors based on the AMD K8 core with x86-64 instruction set support,
22030 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
22031 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
22032 instruction set extensions.)
22034 @item k8-sse3
22035 @itemx opteron-sse3
22036 @itemx athlon64-sse3
22037 Improved versions of AMD K8 cores with SSE3 instruction set support.
22039 @item amdfam10
22040 @itemx barcelona
22041 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
22042 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
22043 instruction set extensions.)
22045 @item bdver1
22046 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
22047 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
22048 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
22049 @item bdver2
22050 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
22051 supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX,
22052 SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
22053 extensions.)
22054 @item bdver3
22055 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
22056 supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, XOP, LWP, AES, 
22057 PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 
22058 64-bit instruction set extensions.
22059 @item bdver4
22060 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
22061 supersets BMI, BMI2, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, AVX2, XOP, LWP, 
22062 AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, 
22063 SSE4.2, ABM and 64-bit instruction set extensions.
22065 @item btver1
22066 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
22067 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
22068 instruction set extensions.)
22070 @item btver2
22071 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
22072 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
22073 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
22075 @item winchip-c6
22076 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
22077 set support.
22079 @item winchip2
22080 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
22081 instruction set support.
22083 @item c3
22084 VIA C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
22085 implemented for this chip.)
22087 @item c3-2
22088 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
22089 (No scheduling is
22090 implemented for this chip.)
22092 @item geode
22093 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
22094 @end table
22096 @item -mtune=@var{cpu-type}
22097 @opindex mtune
22098 Tune to @var{cpu-type} everything applicable about the generated code, except
22099 for the ABI and the set of available instructions.  
22100 While picking a specific @var{cpu-type} schedules things appropriately
22101 for that particular chip, the compiler does not generate any code that
22102 cannot run on the default machine type unless you use a
22103 @option{-march=@var{cpu-type}} option.
22104 For example, if GCC is configured for i686-pc-linux-gnu
22105 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
22106 but still runs on i686 machines.
22108 The choices for @var{cpu-type} are the same as for @option{-march}.
22109 In addition, @option{-mtune} supports 2 extra choices for @var{cpu-type}:
22111 @table @samp
22112 @item generic
22113 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
22114 If you know the CPU on which your code will run, then you should use
22115 the corresponding @option{-mtune} or @option{-march} option instead of
22116 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
22117 of your application will have, then you should use this option.
22119 As new processors are deployed in the marketplace, the behavior of this
22120 option will change.  Therefore, if you upgrade to a newer version of
22121 GCC, code generation controlled by this option will change to reflect
22122 the processors
22123 that are most common at the time that version of GCC is released.
22125 There is no @option{-march=generic} option because @option{-march}
22126 indicates the instruction set the compiler can use, and there is no
22127 generic instruction set applicable to all processors.  In contrast,
22128 @option{-mtune} indicates the processor (or, in this case, collection of
22129 processors) for which the code is optimized.
22131 @item intel
22132 Produce code optimized for the most current Intel processors, which are
22133 Haswell and Silvermont for this version of GCC.  If you know the CPU
22134 on which your code will run, then you should use the corresponding
22135 @option{-mtune} or @option{-march} option instead of @option{-mtune=intel}.
22136 But, if you want your application performs better on both Haswell and
22137 Silvermont, then you should use this option.
22139 As new Intel processors are deployed in the marketplace, the behavior of
22140 this option will change.  Therefore, if you upgrade to a newer version of
22141 GCC, code generation controlled by this option will change to reflect
22142 the most current Intel processors at the time that version of GCC is
22143 released.
22145 There is no @option{-march=intel} option because @option{-march} indicates
22146 the instruction set the compiler can use, and there is no common
22147 instruction set applicable to all processors.  In contrast,
22148 @option{-mtune} indicates the processor (or, in this case, collection of
22149 processors) for which the code is optimized.
22150 @end table
22152 @item -mcpu=@var{cpu-type}
22153 @opindex mcpu
22154 A deprecated synonym for @option{-mtune}.
22156 @item -mfpmath=@var{unit}
22157 @opindex mfpmath
22158 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
22159 for @var{unit} are:
22161 @table @samp
22162 @item 387
22163 Use the standard 387 floating-point coprocessor present on the majority of chips and
22164 emulated otherwise.  Code compiled with this option runs almost everywhere.
22165 The temporary results are computed in 80-bit precision instead of the precision
22166 specified by the type, resulting in slightly different results compared to most
22167 of other chips.  See @option{-ffloat-store} for more detailed description.
22169 This is the default choice for x86-32 targets.
22171 @item sse
22172 Use scalar floating-point instructions present in the SSE instruction set.
22173 This instruction set is supported by Pentium III and newer chips,
22174 and in the AMD line
22175 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
22176 instruction set supports only single-precision arithmetic, thus the double and
22177 extended-precision arithmetic are still done using 387.  A later version, present
22178 only in Pentium 4 and AMD x86-64 chips, supports double-precision
22179 arithmetic too.
22181 For the x86-32 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
22182 or @option{-msse2} switches to enable SSE extensions and make this option
22183 effective.  For the x86-64 compiler, these extensions are enabled by default.
22185 The resulting code should be considerably faster in the majority of cases and avoid
22186 the numerical instability problems of 387 code, but may break some existing
22187 code that expects temporaries to be 80 bits.
22189 This is the default choice for the x86-64 compiler.
22191 @item sse,387
22192 @itemx sse+387
22193 @itemx both
22194 Attempt to utilize both instruction sets at once.  This effectively doubles the
22195 amount of available registers, and on chips with separate execution units for
22196 387 and SSE the execution resources too.  Use this option with care, as it is
22197 still experimental, because the GCC register allocator does not model separate
22198 functional units well, resulting in unstable performance.
22199 @end table
22201 @item -masm=@var{dialect}
22202 @opindex masm=@var{dialect}
22203 Output assembly instructions using selected @var{dialect}.  Also affects
22204 which dialect is used for basic @code{asm} (@pxref{Basic Asm}) and
22205 extended @code{asm} (@pxref{Extended Asm}). Supported choices (in dialect
22206 order) are @samp{att} or @samp{intel}. The default is @samp{att}. Darwin does
22207 not support @samp{intel}.
22209 @item -mieee-fp
22210 @itemx -mno-ieee-fp
22211 @opindex mieee-fp
22212 @opindex mno-ieee-fp
22213 Control whether or not the compiler uses IEEE floating-point
22214 comparisons.  These correctly handle the case where the result of a
22215 comparison is unordered.
22217 @item -msoft-float
22218 @opindex msoft-float
22219 Generate output containing library calls for floating point.
22221 @strong{Warning:} the requisite libraries are not part of GCC@.
22222 Normally the facilities of the machine's usual C compiler are used, but
22223 this can't be done directly in cross-compilation.  You must make your
22224 own arrangements to provide suitable library functions for
22225 cross-compilation.
22227 On machines where a function returns floating-point results in the 80387
22228 register stack, some floating-point opcodes may be emitted even if
22229 @option{-msoft-float} is used.
22231 @item -mno-fp-ret-in-387
22232 @opindex mno-fp-ret-in-387
22233 Do not use the FPU registers for return values of functions.
22235 The usual calling convention has functions return values of types
22236 @code{float} and @code{double} in an FPU register, even if there
22237 is no FPU@.  The idea is that the operating system should emulate
22238 an FPU@.
22240 The option @option{-mno-fp-ret-in-387} causes such values to be returned
22241 in ordinary CPU registers instead.
22243 @item -mno-fancy-math-387
22244 @opindex mno-fancy-math-387
22245 Some 387 emulators do not support the @code{sin}, @code{cos} and
22246 @code{sqrt} instructions for the 387.  Specify this option to avoid
22247 generating those instructions.  This option is the default on FreeBSD,
22248 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
22249 indicates that the target CPU always has an FPU and so the
22250 instruction does not need emulation.  These
22251 instructions are not generated unless you also use the
22252 @option{-funsafe-math-optimizations} switch.
22254 @item -malign-double
22255 @itemx -mno-align-double
22256 @opindex malign-double
22257 @opindex mno-align-double
22258 Control whether GCC aligns @code{double}, @code{long double}, and
22259 @code{long long} variables on a two-word boundary or a one-word
22260 boundary.  Aligning @code{double} variables on a two-word boundary
22261 produces code that runs somewhat faster on a Pentium at the
22262 expense of more memory.
22264 On x86-64, @option{-malign-double} is enabled by default.
22266 @strong{Warning:} if you use the @option{-malign-double} switch,
22267 structures containing the above types are aligned differently than
22268 the published application binary interface specifications for the x86-32
22269 and are not binary compatible with structures in code compiled
22270 without that switch.
22272 @item -m96bit-long-double
22273 @itemx -m128bit-long-double
22274 @opindex m96bit-long-double
22275 @opindex m128bit-long-double
22276 These switches control the size of @code{long double} type.  The x86-32
22277 application binary interface specifies the size to be 96 bits,
22278 so @option{-m96bit-long-double} is the default in 32-bit mode.
22280 Modern architectures (Pentium and newer) prefer @code{long double}
22281 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
22282 conforming to the ABI, this is not possible.  So specifying
22283 @option{-m128bit-long-double} aligns @code{long double}
22284 to a 16-byte boundary by padding the @code{long double} with an additional
22285 32-bit zero.
22287 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
22288 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
22290 Notice that neither of these options enable any extra precision over the x87
22291 standard of 80 bits for a @code{long double}.
22293 @strong{Warning:} if you override the default value for your target ABI, this
22294 changes the size of 
22295 structures and arrays containing @code{long double} variables,
22296 as well as modifying the function calling convention for functions taking
22297 @code{long double}.  Hence they are not binary-compatible
22298 with code compiled without that switch.
22300 @item -mlong-double-64
22301 @itemx -mlong-double-80
22302 @itemx -mlong-double-128
22303 @opindex mlong-double-64
22304 @opindex mlong-double-80
22305 @opindex mlong-double-128
22306 These switches control the size of @code{long double} type. A size
22307 of 64 bits makes the @code{long double} type equivalent to the @code{double}
22308 type. This is the default for 32-bit Bionic C library.  A size
22309 of 128 bits makes the @code{long double} type equivalent to the
22310 @code{__float128} type. This is the default for 64-bit Bionic C library.
22312 @strong{Warning:} if you override the default value for your target ABI, this
22313 changes the size of
22314 structures and arrays containing @code{long double} variables,
22315 as well as modifying the function calling convention for functions taking
22316 @code{long double}.  Hence they are not binary-compatible
22317 with code compiled without that switch.
22319 @item -malign-data=@var{type}
22320 @opindex malign-data
22321 Control how GCC aligns variables.  Supported values for @var{type} are
22322 @samp{compat} uses increased alignment value compatible uses GCC 4.8
22323 and earlier, @samp{abi} uses alignment value as specified by the
22324 psABI, and @samp{cacheline} uses increased alignment value to match
22325 the cache line size.  @samp{compat} is the default.
22327 @item -mlarge-data-threshold=@var{threshold}
22328 @opindex mlarge-data-threshold
22329 When @option{-mcmodel=medium} is specified, data objects larger than
22330 @var{threshold} are placed in the large data section.  This value must be the
22331 same across all objects linked into the binary, and defaults to 65535.
22333 @item -mrtd
22334 @opindex mrtd
22335 Use a different function-calling convention, in which functions that
22336 take a fixed number of arguments return with the @code{ret @var{num}}
22337 instruction, which pops their arguments while returning.  This saves one
22338 instruction in the caller since there is no need to pop the arguments
22339 there.
22341 You can specify that an individual function is called with this calling
22342 sequence with the function attribute @code{stdcall}.  You can also
22343 override the @option{-mrtd} option by using the function attribute
22344 @code{cdecl}.  @xref{Function Attributes}.
22346 @strong{Warning:} this calling convention is incompatible with the one
22347 normally used on Unix, so you cannot use it if you need to call
22348 libraries compiled with the Unix compiler.
22350 Also, you must provide function prototypes for all functions that
22351 take variable numbers of arguments (including @code{printf});
22352 otherwise incorrect code is generated for calls to those
22353 functions.
22355 In addition, seriously incorrect code results if you call a
22356 function with too many arguments.  (Normally, extra arguments are
22357 harmlessly ignored.)
22359 @item -mregparm=@var{num}
22360 @opindex mregparm
22361 Control how many registers are used to pass integer arguments.  By
22362 default, no registers are used to pass arguments, and at most 3
22363 registers can be used.  You can control this behavior for a specific
22364 function by using the function attribute @code{regparm}.
22365 @xref{Function Attributes}.
22367 @strong{Warning:} if you use this switch, and
22368 @var{num} is nonzero, then you must build all modules with the same
22369 value, including any libraries.  This includes the system libraries and
22370 startup modules.
22372 @item -msseregparm
22373 @opindex msseregparm
22374 Use SSE register passing conventions for float and double arguments
22375 and return values.  You can control this behavior for a specific
22376 function by using the function attribute @code{sseregparm}.
22377 @xref{Function Attributes}.
22379 @strong{Warning:} if you use this switch then you must build all
22380 modules with the same value, including any libraries.  This includes
22381 the system libraries and startup modules.
22383 @item -mvect8-ret-in-mem
22384 @opindex mvect8-ret-in-mem
22385 Return 8-byte vectors in memory instead of MMX registers.  This is the
22386 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
22387 Studio compilers until version 12.  Later compiler versions (starting
22388 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
22389 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
22390 you need to remain compatible with existing code produced by those
22391 previous compiler versions or older versions of GCC@.
22393 @item -mpc32
22394 @itemx -mpc64
22395 @itemx -mpc80
22396 @opindex mpc32
22397 @opindex mpc64
22398 @opindex mpc80
22400 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
22401 is specified, the significands of results of floating-point operations are
22402 rounded to 24 bits (single precision); @option{-mpc64} rounds the
22403 significands of results of floating-point operations to 53 bits (double
22404 precision) and @option{-mpc80} rounds the significands of results of
22405 floating-point operations to 64 bits (extended double precision), which is
22406 the default.  When this option is used, floating-point operations in higher
22407 precisions are not available to the programmer without setting the FPU
22408 control word explicitly.
22410 Setting the rounding of floating-point operations to less than the default
22411 80 bits can speed some programs by 2% or more.  Note that some mathematical
22412 libraries assume that extended-precision (80-bit) floating-point operations
22413 are enabled by default; routines in such libraries could suffer significant
22414 loss of accuracy, typically through so-called ``catastrophic cancellation'',
22415 when this option is used to set the precision to less than extended precision.
22417 @item -mstackrealign
22418 @opindex mstackrealign
22419 Realign the stack at entry.  On the x86, the @option{-mstackrealign}
22420 option generates an alternate prologue and epilogue that realigns the
22421 run-time stack if necessary.  This supports mixing legacy codes that keep
22422 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
22423 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
22424 applicable to individual functions.
22426 @item -mpreferred-stack-boundary=@var{num}
22427 @opindex mpreferred-stack-boundary
22428 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
22429 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
22430 the default is 4 (16 bytes or 128 bits).
22432 @strong{Warning:} When generating code for the x86-64 architecture with
22433 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
22434 used to keep the stack boundary aligned to 8 byte boundary.  Since
22435 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
22436 intended to be used in controlled environment where stack space is
22437 important limitation.  This option leads to wrong code when functions
22438 compiled with 16 byte stack alignment (such as functions from a standard
22439 library) are called with misaligned stack.  In this case, SSE
22440 instructions may lead to misaligned memory access traps.  In addition,
22441 variable arguments are handled incorrectly for 16 byte aligned
22442 objects (including x87 long double and __int128), leading to wrong
22443 results.  You must build all modules with
22444 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
22445 includes the system libraries and startup modules.
22447 @item -mincoming-stack-boundary=@var{num}
22448 @opindex mincoming-stack-boundary
22449 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
22450 boundary.  If @option{-mincoming-stack-boundary} is not specified,
22451 the one specified by @option{-mpreferred-stack-boundary} is used.
22453 On Pentium and Pentium Pro, @code{double} and @code{long double} values
22454 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
22455 suffer significant run time performance penalties.  On Pentium III, the
22456 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
22457 properly if it is not 16-byte aligned.
22459 To ensure proper alignment of this values on the stack, the stack boundary
22460 must be as aligned as that required by any value stored on the stack.
22461 Further, every function must be generated such that it keeps the stack
22462 aligned.  Thus calling a function compiled with a higher preferred
22463 stack boundary from a function compiled with a lower preferred stack
22464 boundary most likely misaligns the stack.  It is recommended that
22465 libraries that use callbacks always use the default setting.
22467 This extra alignment does consume extra stack space, and generally
22468 increases code size.  Code that is sensitive to stack space usage, such
22469 as embedded systems and operating system kernels, may want to reduce the
22470 preferred alignment to @option{-mpreferred-stack-boundary=2}.
22472 @need 200
22473 @item -mmmx
22474 @opindex mmmx
22475 @need 200
22476 @itemx -msse
22477 @opindex msse
22478 @need 200
22479 @itemx -msse2
22480 @need 200
22481 @itemx -msse3
22482 @need 200
22483 @itemx -mssse3
22484 @need 200
22485 @itemx -msse4
22486 @need 200
22487 @itemx -msse4a
22488 @need 200
22489 @itemx -msse4.1
22490 @need 200
22491 @itemx -msse4.2
22492 @need 200
22493 @itemx -mavx
22494 @opindex mavx
22495 @need 200
22496 @itemx -mavx2
22497 @need 200
22498 @itemx -mavx512f
22499 @need 200
22500 @itemx -mavx512pf
22501 @need 200
22502 @itemx -mavx512er
22503 @need 200
22504 @itemx -mavx512cd
22505 @need 200
22506 @itemx -msha
22507 @opindex msha
22508 @need 200
22509 @itemx -maes
22510 @opindex maes
22511 @need 200
22512 @itemx -mpclmul
22513 @opindex mpclmul
22514 @need 200
22515 @itemx -mclfushopt
22516 @opindex mclfushopt
22517 @need 200
22518 @itemx -mfsgsbase
22519 @opindex mfsgsbase
22520 @need 200
22521 @itemx -mrdrnd
22522 @opindex mrdrnd
22523 @need 200
22524 @itemx -mf16c
22525 @opindex mf16c
22526 @need 200
22527 @itemx -mfma
22528 @opindex mfma
22529 @need 200
22530 @itemx -mfma4
22531 @need 200
22532 @itemx -mno-fma4
22533 @need 200
22534 @itemx -mprefetchwt1
22535 @opindex mprefetchwt1
22536 @need 200
22537 @itemx -mxop
22538 @opindex mxop
22539 @need 200
22540 @itemx -mlwp
22541 @opindex mlwp
22542 @need 200
22543 @itemx -m3dnow
22544 @opindex m3dnow
22545 @need 200
22546 @itemx -mpopcnt
22547 @opindex mpopcnt
22548 @need 200
22549 @itemx -mabm
22550 @opindex mabm
22551 @need 200
22552 @itemx -mbmi
22553 @opindex mbmi
22554 @need 200
22555 @itemx -mbmi2
22556 @need 200
22557 @itemx -mlzcnt
22558 @opindex mlzcnt
22559 @need 200
22560 @itemx -mfxsr
22561 @opindex mfxsr
22562 @need 200
22563 @itemx -mxsave
22564 @opindex mxsave
22565 @need 200
22566 @itemx -mxsaveopt
22567 @opindex mxsaveopt
22568 @need 200
22569 @itemx -mxsavec
22570 @opindex mxsavec
22571 @need 200
22572 @itemx -mxsaves
22573 @opindex mxsaves
22574 @need 200
22575 @itemx -mrtm
22576 @opindex mrtm
22577 @need 200
22578 @itemx -mtbm
22579 @opindex mtbm
22580 @need 200
22581 @itemx -mmpx
22582 @opindex mmpx
22583 These switches enable the use of instructions in the MMX, SSE,
22584 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER, AVX512CD,
22585 SHA, AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A, FMA4, XOP, LWP, ABM,
22586 BMI, BMI2, FXSR, XSAVE, XSAVEOPT, LZCNT, RTM, MPX or 3DNow!@:
22587 extended instruction sets.  Each has a corresponding @option{-mno-} option
22588 to disable use of these instructions.
22590 These extensions are also available as built-in functions: see
22591 @ref{x86 Built-in Functions}, for details of the functions enabled and
22592 disabled by these switches.
22594 To generate SSE/SSE2 instructions automatically from floating-point
22595 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
22597 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
22598 generates new AVX instructions or AVX equivalence for all SSEx instructions
22599 when needed.
22601 These options enable GCC to use these extended instructions in
22602 generated code, even without @option{-mfpmath=sse}.  Applications that
22603 perform run-time CPU detection must compile separate files for each
22604 supported architecture, using the appropriate flags.  In particular,
22605 the file containing the CPU detection code should be compiled without
22606 these options.
22608 @item -mdump-tune-features
22609 @opindex mdump-tune-features
22610 This option instructs GCC to dump the names of the x86 performance 
22611 tuning features and default settings. The names can be used in 
22612 @option{-mtune-ctrl=@var{feature-list}}.
22614 @item -mtune-ctrl=@var{feature-list}
22615 @opindex mtune-ctrl=@var{feature-list}
22616 This option is used to do fine grain control of x86 code generation features.
22617 @var{feature-list} is a comma separated list of @var{feature} names. See also
22618 @option{-mdump-tune-features}. When specified, the @var{feature} is turned
22619 on if it is not preceded with @samp{^}, otherwise, it is turned off. 
22620 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
22621 developers. Using it may lead to code paths not covered by testing and can
22622 potentially result in compiler ICEs or runtime errors.
22624 @item -mno-default
22625 @opindex mno-default
22626 This option instructs GCC to turn off all tunable features. See also 
22627 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
22629 @item -mcld
22630 @opindex mcld
22631 This option instructs GCC to emit a @code{cld} instruction in the prologue
22632 of functions that use string instructions.  String instructions depend on
22633 the DF flag to select between autoincrement or autodecrement mode.  While the
22634 ABI specifies the DF flag to be cleared on function entry, some operating
22635 systems violate this specification by not clearing the DF flag in their
22636 exception dispatchers.  The exception handler can be invoked with the DF flag
22637 set, which leads to wrong direction mode when string instructions are used.
22638 This option can be enabled by default on 32-bit x86 targets by configuring
22639 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
22640 instructions can be suppressed with the @option{-mno-cld} compiler option
22641 in this case.
22643 @item -mvzeroupper
22644 @opindex mvzeroupper
22645 This option instructs GCC to emit a @code{vzeroupper} instruction
22646 before a transfer of control flow out of the function to minimize
22647 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
22648 intrinsics.
22650 @item -mprefer-avx128
22651 @opindex mprefer-avx128
22652 This option instructs GCC to use 128-bit AVX instructions instead of
22653 256-bit AVX instructions in the auto-vectorizer.
22655 @item -mcx16
22656 @opindex mcx16
22657 This option enables GCC to generate @code{CMPXCHG16B} instructions.
22658 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
22659 (or oword) data types.  
22660 This is useful for high-resolution counters that can be updated
22661 by multiple processors (or cores).  This instruction is generated as part of
22662 atomic built-in functions: see @ref{__sync Builtins} or
22663 @ref{__atomic Builtins} for details.
22665 @item -msahf
22666 @opindex msahf
22667 This option enables generation of @code{SAHF} instructions in 64-bit code.
22668 Early Intel Pentium 4 CPUs with Intel 64 support,
22669 prior to the introduction of Pentium 4 G1 step in December 2005,
22670 lacked the @code{LAHF} and @code{SAHF} instructions
22671 which are supported by AMD64.
22672 These are load and store instructions, respectively, for certain status flags.
22673 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
22674 @code{drem}, and @code{remainder} built-in functions;
22675 see @ref{Other Builtins} for details.
22677 @item -mmovbe
22678 @opindex mmovbe
22679 This option enables use of the @code{movbe} instruction to implement
22680 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
22682 @item -mcrc32
22683 @opindex mcrc32
22684 This option enables built-in functions @code{__builtin_ia32_crc32qi},
22685 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
22686 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
22688 @item -mrecip
22689 @opindex mrecip
22690 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
22691 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
22692 with an additional Newton-Raphson step
22693 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
22694 (and their vectorized
22695 variants) for single-precision floating-point arguments.  These instructions
22696 are generated only when @option{-funsafe-math-optimizations} is enabled
22697 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
22698 Note that while the throughput of the sequence is higher than the throughput
22699 of the non-reciprocal instruction, the precision of the sequence can be
22700 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
22702 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
22703 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
22704 combination), and doesn't need @option{-mrecip}.
22706 Also note that GCC emits the above sequence with additional Newton-Raphson step
22707 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
22708 already with @option{-ffast-math} (or the above option combination), and
22709 doesn't need @option{-mrecip}.
22711 @item -mrecip=@var{opt}
22712 @opindex mrecip=opt
22713 This option controls which reciprocal estimate instructions
22714 may be used.  @var{opt} is a comma-separated list of options, which may
22715 be preceded by a @samp{!} to invert the option:
22717 @table @samp
22718 @item all
22719 Enable all estimate instructions.
22721 @item default
22722 Enable the default instructions, equivalent to @option{-mrecip}.
22724 @item none
22725 Disable all estimate instructions, equivalent to @option{-mno-recip}.
22727 @item div
22728 Enable the approximation for scalar division.
22730 @item vec-div
22731 Enable the approximation for vectorized division.
22733 @item sqrt
22734 Enable the approximation for scalar square root.
22736 @item vec-sqrt
22737 Enable the approximation for vectorized square root.
22738 @end table
22740 So, for example, @option{-mrecip=all,!sqrt} enables
22741 all of the reciprocal approximations, except for square root.
22743 @item -mveclibabi=@var{type}
22744 @opindex mveclibabi
22745 Specifies the ABI type to use for vectorizing intrinsics using an
22746 external library.  Supported values for @var{type} are @samp{svml} 
22747 for the Intel short
22748 vector math library and @samp{acml} for the AMD math core library.
22749 To use this option, both @option{-ftree-vectorize} and
22750 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
22751 ABI-compatible library must be specified at link time.
22753 GCC currently emits calls to @code{vmldExp2},
22754 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
22755 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
22756 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
22757 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
22758 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
22759 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
22760 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
22761 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
22762 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
22763 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
22764 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
22765 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
22766 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
22767 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
22768 when @option{-mveclibabi=acml} is used.  
22770 @item -mabi=@var{name}
22771 @opindex mabi
22772 Generate code for the specified calling convention.  Permissible values
22773 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
22774 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
22775 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
22776 You can control this behavior for specific functions by
22777 using the function attributes @code{ms_abi} and @code{sysv_abi}.
22778 @xref{Function Attributes}.
22780 @item -mtls-dialect=@var{type}
22781 @opindex mtls-dialect
22782 Generate code to access thread-local storage using the @samp{gnu} or
22783 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
22784 @samp{gnu2} is more efficient, but it may add compile- and run-time
22785 requirements that cannot be satisfied on all systems.
22787 @item -mpush-args
22788 @itemx -mno-push-args
22789 @opindex mpush-args
22790 @opindex mno-push-args
22791 Use PUSH operations to store outgoing parameters.  This method is shorter
22792 and usually equally fast as method using SUB/MOV operations and is enabled
22793 by default.  In some cases disabling it may improve performance because of
22794 improved scheduling and reduced dependencies.
22796 @item -maccumulate-outgoing-args
22797 @opindex maccumulate-outgoing-args
22798 If enabled, the maximum amount of space required for outgoing arguments is
22799 computed in the function prologue.  This is faster on most modern CPUs
22800 because of reduced dependencies, improved scheduling and reduced stack usage
22801 when the preferred stack boundary is not equal to 2.  The drawback is a notable
22802 increase in code size.  This switch implies @option{-mno-push-args}.
22804 @item -mthreads
22805 @opindex mthreads
22806 Support thread-safe exception handling on MinGW.  Programs that rely
22807 on thread-safe exception handling must compile and link all code with the
22808 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
22809 @option{-D_MT}; when linking, it links in a special thread helper library
22810 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
22812 @item -mno-align-stringops
22813 @opindex mno-align-stringops
22814 Do not align the destination of inlined string operations.  This switch reduces
22815 code size and improves performance in case the destination is already aligned,
22816 but GCC doesn't know about it.
22818 @item -minline-all-stringops
22819 @opindex minline-all-stringops
22820 By default GCC inlines string operations only when the destination is 
22821 known to be aligned to least a 4-byte boundary.  
22822 This enables more inlining and increases code
22823 size, but may improve performance of code that depends on fast
22824 @code{memcpy}, @code{strlen},
22825 and @code{memset} for short lengths.
22827 @item -minline-stringops-dynamically
22828 @opindex minline-stringops-dynamically
22829 For string operations of unknown size, use run-time checks with
22830 inline code for small blocks and a library call for large blocks.
22832 @item -mstringop-strategy=@var{alg}
22833 @opindex mstringop-strategy=@var{alg}
22834 Override the internal decision heuristic for the particular algorithm to use
22835 for inlining string operations.  The allowed values for @var{alg} are:
22837 @table @samp
22838 @item rep_byte
22839 @itemx rep_4byte
22840 @itemx rep_8byte
22841 Expand using i386 @code{rep} prefix of the specified size.
22843 @item byte_loop
22844 @itemx loop
22845 @itemx unrolled_loop
22846 Expand into an inline loop.
22848 @item libcall
22849 Always use a library call.
22850 @end table
22852 @item -mmemcpy-strategy=@var{strategy}
22853 @opindex mmemcpy-strategy=@var{strategy}
22854 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
22855 should be inlined and what inline algorithm to use when the expected size
22856 of the copy operation is known. @var{strategy} 
22857 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
22858 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
22859 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
22860 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
22861 in the list must be specified in increasing order.  The minimal byte size for 
22862 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
22863 preceding range.
22865 @item -mmemset-strategy=@var{strategy}
22866 @opindex mmemset-strategy=@var{strategy}
22867 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
22868 @code{__builtin_memset} expansion.
22870 @item -momit-leaf-frame-pointer
22871 @opindex momit-leaf-frame-pointer
22872 Don't keep the frame pointer in a register for leaf functions.  This
22873 avoids the instructions to save, set up, and restore frame pointers and
22874 makes an extra register available in leaf functions.  The option
22875 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
22876 which might make debugging harder.
22878 @item -mtls-direct-seg-refs
22879 @itemx -mno-tls-direct-seg-refs
22880 @opindex mtls-direct-seg-refs
22881 Controls whether TLS variables may be accessed with offsets from the
22882 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
22883 or whether the thread base pointer must be added.  Whether or not this
22884 is valid depends on the operating system, and whether it maps the
22885 segment to cover the entire TLS area.
22887 For systems that use the GNU C Library, the default is on.
22889 @item -msse2avx
22890 @itemx -mno-sse2avx
22891 @opindex msse2avx
22892 Specify that the assembler should encode SSE instructions with VEX
22893 prefix.  The option @option{-mavx} turns this on by default.
22895 @item -mfentry
22896 @itemx -mno-fentry
22897 @opindex mfentry
22898 If profiling is active (@option{-pg}), put the profiling
22899 counter call before the prologue.
22900 Note: On x86 architectures the attribute @code{ms_hook_prologue}
22901 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
22903 @item -mrecord-mcount
22904 @itemx -mno-record-mcount
22905 @opindex mrecord-mcount
22906 If profiling is active (@option{-pg}), generate a __mcount_loc section
22907 that contains pointers to each profiling call. This is useful for
22908 automatically patching and out calls.
22910 @item -mnop-mcount
22911 @itemx -mno-nop-mcount
22912 @opindex mnop-mcount
22913 If profiling is active (@option{-pg}), generate the calls to
22914 the profiling functions as nops. This is useful when they
22915 should be patched in later dynamically. This is likely only
22916 useful together with @option{-mrecord-mcount}.
22918 @item -mskip-rax-setup
22919 @itemx -mno-skip-rax-setup
22920 @opindex mskip-rax-setup
22921 When generating code for the x86-64 architecture with SSE extensions
22922 disabled, @option{-skip-rax-setup} can be used to skip setting up RAX
22923 register when there are no variable arguments passed in vector registers.
22925 @strong{Warning:} Since RAX register is used to avoid unnecessarily
22926 saving vector registers on stack when passing variable arguments, the
22927 impacts of this option are callees may waste some stack space,
22928 misbehave or jump to a random location.  GCC 4.4 or newer don't have
22929 those issues, regardless the RAX register value.
22931 @item -m8bit-idiv
22932 @itemx -mno-8bit-idiv
22933 @opindex m8bit-idiv
22934 On some processors, like Intel Atom, 8-bit unsigned integer divide is
22935 much faster than 32-bit/64-bit integer divide.  This option generates a
22936 run-time check.  If both dividend and divisor are within range of 0
22937 to 255, 8-bit unsigned integer divide is used instead of
22938 32-bit/64-bit integer divide.
22940 @item -mavx256-split-unaligned-load
22941 @itemx -mavx256-split-unaligned-store
22942 @opindex mavx256-split-unaligned-load
22943 @opindex mavx256-split-unaligned-store
22944 Split 32-byte AVX unaligned load and store.
22946 @item -mstack-protector-guard=@var{guard}
22947 @opindex mstack-protector-guard=@var{guard}
22948 Generate stack protection code using canary at @var{guard}.  Supported
22949 locations are @samp{global} for global canary or @samp{tls} for per-thread
22950 canary in the TLS block (the default).  This option has effect only when
22951 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
22953 @end table
22955 These @samp{-m} switches are supported in addition to the above
22956 on x86-64 processors in 64-bit environments.
22958 @table @gcctabopt
22959 @item -m32
22960 @itemx -m64
22961 @itemx -mx32
22962 @itemx -m16
22963 @opindex m32
22964 @opindex m64
22965 @opindex mx32
22966 @opindex m16
22967 Generate code for a 16-bit, 32-bit or 64-bit environment.
22968 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
22969 to 32 bits, and
22970 generates code that runs on any i386 system.
22972 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
22973 types to 64 bits, and generates code for the x86-64 architecture.
22974 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
22975 and @option{-mdynamic-no-pic} options.
22977 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
22978 to 32 bits, and
22979 generates code for the x86-64 architecture.
22981 The @option{-m16} option is the same as @option{-m32}, except for that
22982 it outputs the @code{.code16gcc} assembly directive at the beginning of
22983 the assembly output so that the binary can run in 16-bit mode.
22985 @item -mno-red-zone
22986 @opindex mno-red-zone
22987 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
22988 by the x86-64 ABI; it is a 128-byte area beyond the location of the
22989 stack pointer that is not modified by signal or interrupt handlers
22990 and therefore can be used for temporary data without adjusting the stack
22991 pointer.  The flag @option{-mno-red-zone} disables this red zone.
22993 @item -mcmodel=small
22994 @opindex mcmodel=small
22995 Generate code for the small code model: the program and its symbols must
22996 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
22997 Programs can be statically or dynamically linked.  This is the default
22998 code model.
23000 @item -mcmodel=kernel
23001 @opindex mcmodel=kernel
23002 Generate code for the kernel code model.  The kernel runs in the
23003 negative 2 GB of the address space.
23004 This model has to be used for Linux kernel code.
23006 @item -mcmodel=medium
23007 @opindex mcmodel=medium
23008 Generate code for the medium model: the program is linked in the lower 2
23009 GB of the address space.  Small symbols are also placed there.  Symbols
23010 with sizes larger than @option{-mlarge-data-threshold} are put into
23011 large data or BSS sections and can be located above 2GB.  Programs can
23012 be statically or dynamically linked.
23014 @item -mcmodel=large
23015 @opindex mcmodel=large
23016 Generate code for the large model.  This model makes no assumptions
23017 about addresses and sizes of sections.
23019 @item -maddress-mode=long
23020 @opindex maddress-mode=long
23021 Generate code for long address mode.  This is only supported for 64-bit
23022 and x32 environments.  It is the default address mode for 64-bit
23023 environments.
23025 @item -maddress-mode=short
23026 @opindex maddress-mode=short
23027 Generate code for short address mode.  This is only supported for 32-bit
23028 and x32 environments.  It is the default address mode for 32-bit and
23029 x32 environments.
23030 @end table
23032 @node x86 Windows Options
23033 @subsection x86 Windows Options
23034 @cindex x86 Windows Options
23035 @cindex Windows Options for x86
23037 These additional options are available for Microsoft Windows targets:
23039 @table @gcctabopt
23040 @item -mconsole
23041 @opindex mconsole
23042 This option
23043 specifies that a console application is to be generated, by
23044 instructing the linker to set the PE header subsystem type
23045 required for console applications.
23046 This option is available for Cygwin and MinGW targets and is
23047 enabled by default on those targets.
23049 @item -mdll
23050 @opindex mdll
23051 This option is available for Cygwin and MinGW targets.  It
23052 specifies that a DLL---a dynamic link library---is to be
23053 generated, enabling the selection of the required runtime
23054 startup object and entry point.
23056 @item -mnop-fun-dllimport
23057 @opindex mnop-fun-dllimport
23058 This option is available for Cygwin and MinGW targets.  It
23059 specifies that the @code{dllimport} attribute should be ignored.
23061 @item -mthread
23062 @opindex mthread
23063 This option is available for MinGW targets. It specifies
23064 that MinGW-specific thread support is to be used.
23066 @item -municode
23067 @opindex municode
23068 This option is available for MinGW-w64 targets.  It causes
23069 the @code{UNICODE} preprocessor macro to be predefined, and
23070 chooses Unicode-capable runtime startup code.
23072 @item -mwin32
23073 @opindex mwin32
23074 This option is available for Cygwin and MinGW targets.  It
23075 specifies that the typical Microsoft Windows predefined macros are to
23076 be set in the pre-processor, but does not influence the choice
23077 of runtime library/startup code.
23079 @item -mwindows
23080 @opindex mwindows
23081 This option is available for Cygwin and MinGW targets.  It
23082 specifies that a GUI application is to be generated by
23083 instructing the linker to set the PE header subsystem type
23084 appropriately.
23086 @item -fno-set-stack-executable
23087 @opindex fno-set-stack-executable
23088 This option is available for MinGW targets. It specifies that
23089 the executable flag for the stack used by nested functions isn't
23090 set. This is necessary for binaries running in kernel mode of
23091 Microsoft Windows, as there the User32 API, which is used to set executable
23092 privileges, isn't available.
23094 @item -fwritable-relocated-rdata
23095 @opindex fno-writable-relocated-rdata
23096 This option is available for MinGW and Cygwin targets.  It specifies
23097 that relocated-data in read-only section is put into .data
23098 section.  This is a necessary for older runtimes not supporting
23099 modification of .rdata sections for pseudo-relocation.
23101 @item -mpe-aligned-commons
23102 @opindex mpe-aligned-commons
23103 This option is available for Cygwin and MinGW targets.  It
23104 specifies that the GNU extension to the PE file format that
23105 permits the correct alignment of COMMON variables should be
23106 used when generating code.  It is enabled by default if
23107 GCC detects that the target assembler found during configuration
23108 supports the feature.
23109 @end table
23111 See also under @ref{x86 Options} for standard options.
23113 @node Xstormy16 Options
23114 @subsection Xstormy16 Options
23115 @cindex Xstormy16 Options
23117 These options are defined for Xstormy16:
23119 @table @gcctabopt
23120 @item -msim
23121 @opindex msim
23122 Choose startup files and linker script suitable for the simulator.
23123 @end table
23125 @node Xtensa Options
23126 @subsection Xtensa Options
23127 @cindex Xtensa Options
23129 These options are supported for Xtensa targets:
23131 @table @gcctabopt
23132 @item -mconst16
23133 @itemx -mno-const16
23134 @opindex mconst16
23135 @opindex mno-const16
23136 Enable or disable use of @code{CONST16} instructions for loading
23137 constant values.  The @code{CONST16} instruction is currently not a
23138 standard option from Tensilica.  When enabled, @code{CONST16}
23139 instructions are always used in place of the standard @code{L32R}
23140 instructions.  The use of @code{CONST16} is enabled by default only if
23141 the @code{L32R} instruction is not available.
23143 @item -mfused-madd
23144 @itemx -mno-fused-madd
23145 @opindex mfused-madd
23146 @opindex mno-fused-madd
23147 Enable or disable use of fused multiply/add and multiply/subtract
23148 instructions in the floating-point option.  This has no effect if the
23149 floating-point option is not also enabled.  Disabling fused multiply/add
23150 and multiply/subtract instructions forces the compiler to use separate
23151 instructions for the multiply and add/subtract operations.  This may be
23152 desirable in some cases where strict IEEE 754-compliant results are
23153 required: the fused multiply add/subtract instructions do not round the
23154 intermediate result, thereby producing results with @emph{more} bits of
23155 precision than specified by the IEEE standard.  Disabling fused multiply
23156 add/subtract instructions also ensures that the program output is not
23157 sensitive to the compiler's ability to combine multiply and add/subtract
23158 operations.
23160 @item -mserialize-volatile
23161 @itemx -mno-serialize-volatile
23162 @opindex mserialize-volatile
23163 @opindex mno-serialize-volatile
23164 When this option is enabled, GCC inserts @code{MEMW} instructions before
23165 @code{volatile} memory references to guarantee sequential consistency.
23166 The default is @option{-mserialize-volatile}.  Use
23167 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
23169 @item -mforce-no-pic
23170 @opindex mforce-no-pic
23171 For targets, like GNU/Linux, where all user-mode Xtensa code must be
23172 position-independent code (PIC), this option disables PIC for compiling
23173 kernel code.
23175 @item -mtext-section-literals
23176 @itemx -mno-text-section-literals
23177 @opindex mtext-section-literals
23178 @opindex mno-text-section-literals
23179 These options control the treatment of literal pools.  The default is
23180 @option{-mno-text-section-literals}, which places literals in a separate
23181 section in the output file.  This allows the literal pool to be placed
23182 in a data RAM/ROM, and it also allows the linker to combine literal
23183 pools from separate object files to remove redundant literals and
23184 improve code size.  With @option{-mtext-section-literals}, the literals
23185 are interspersed in the text section in order to keep them as close as
23186 possible to their references.  This may be necessary for large assembly
23187 files.
23189 @item -mtarget-align
23190 @itemx -mno-target-align
23191 @opindex mtarget-align
23192 @opindex mno-target-align
23193 When this option is enabled, GCC instructs the assembler to
23194 automatically align instructions to reduce branch penalties at the
23195 expense of some code density.  The assembler attempts to widen density
23196 instructions to align branch targets and the instructions following call
23197 instructions.  If there are not enough preceding safe density
23198 instructions to align a target, no widening is performed.  The
23199 default is @option{-mtarget-align}.  These options do not affect the
23200 treatment of auto-aligned instructions like @code{LOOP}, which the
23201 assembler always aligns, either by widening density instructions or
23202 by inserting NOP instructions.
23204 @item -mlongcalls
23205 @itemx -mno-longcalls
23206 @opindex mlongcalls
23207 @opindex mno-longcalls
23208 When this option is enabled, GCC instructs the assembler to translate
23209 direct calls to indirect calls unless it can determine that the target
23210 of a direct call is in the range allowed by the call instruction.  This
23211 translation typically occurs for calls to functions in other source
23212 files.  Specifically, the assembler translates a direct @code{CALL}
23213 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
23214 The default is @option{-mno-longcalls}.  This option should be used in
23215 programs where the call target can potentially be out of range.  This
23216 option is implemented in the assembler, not the compiler, so the
23217 assembly code generated by GCC still shows direct call
23218 instructions---look at the disassembled object code to see the actual
23219 instructions.  Note that the assembler uses an indirect call for
23220 every cross-file call, not just those that really are out of range.
23221 @end table
23223 @node zSeries Options
23224 @subsection zSeries Options
23225 @cindex zSeries options
23227 These are listed under @xref{S/390 and zSeries Options}.
23229 @node Code Gen Options
23230 @section Options for Code Generation Conventions
23231 @cindex code generation conventions
23232 @cindex options, code generation
23233 @cindex run-time options
23235 These machine-independent options control the interface conventions
23236 used in code generation.
23238 Most of them have both positive and negative forms; the negative form
23239 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
23240 one of the forms is listed---the one that is not the default.  You
23241 can figure out the other form by either removing @samp{no-} or adding
23244 @table @gcctabopt
23245 @item -fbounds-check
23246 @opindex fbounds-check
23247 For front ends that support it, generate additional code to check that
23248 indices used to access arrays are within the declared range.  This is
23249 currently only supported by the Java and Fortran front ends, where
23250 this option defaults to true and false respectively.
23252 @item -fstack-reuse=@var{reuse-level}
23253 @opindex fstack_reuse
23254 This option controls stack space reuse for user declared local/auto variables
23255 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
23256 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
23257 local variables and temporaries, @samp{named_vars} enables the reuse only for
23258 user defined local variables with names, and @samp{none} disables stack reuse
23259 completely. The default value is @samp{all}. The option is needed when the
23260 program extends the lifetime of a scoped local variable or a compiler generated
23261 temporary beyond the end point defined by the language.  When a lifetime of
23262 a variable ends, and if the variable lives in memory, the optimizing compiler
23263 has the freedom to reuse its stack space with other temporaries or scoped
23264 local variables whose live range does not overlap with it. Legacy code extending
23265 local lifetime is likely to break with the stack reuse optimization.
23267 For example,
23269 @smallexample
23270    int *p;
23271    @{
23272      int local1;
23274      p = &local1;
23275      local1 = 10;
23276      ....
23277    @}
23278    @{
23279       int local2;
23280       local2 = 20;
23281       ...
23282    @}
23284    if (*p == 10)  // out of scope use of local1
23285      @{
23287      @}
23288 @end smallexample
23290 Another example:
23291 @smallexample
23293    struct A
23294    @{
23295        A(int k) : i(k), j(k) @{ @}
23296        int i;
23297        int j;
23298    @};
23300    A *ap;
23302    void foo(const A& ar)
23303    @{
23304       ap = &ar;
23305    @}
23307    void bar()
23308    @{
23309       foo(A(10)); // temp object's lifetime ends when foo returns
23311       @{
23312         A a(20);
23313         ....
23314       @}
23315       ap->i+= 10;  // ap references out of scope temp whose space
23316                    // is reused with a. What is the value of ap->i?
23317    @}
23319 @end smallexample
23321 The lifetime of a compiler generated temporary is well defined by the C++
23322 standard. When a lifetime of a temporary ends, and if the temporary lives
23323 in memory, the optimizing compiler has the freedom to reuse its stack
23324 space with other temporaries or scoped local variables whose live range
23325 does not overlap with it. However some of the legacy code relies on
23326 the behavior of older compilers in which temporaries' stack space is
23327 not reused, the aggressive stack reuse can lead to runtime errors. This
23328 option is used to control the temporary stack reuse optimization.
23330 @item -ftrapv
23331 @opindex ftrapv
23332 This option generates traps for signed overflow on addition, subtraction,
23333 multiplication operations.
23335 @item -fwrapv
23336 @opindex fwrapv
23337 This option instructs the compiler to assume that signed arithmetic
23338 overflow of addition, subtraction and multiplication wraps around
23339 using twos-complement representation.  This flag enables some optimizations
23340 and disables others.  This option is enabled by default for the Java
23341 front end, as required by the Java language specification.
23343 @item -fexceptions
23344 @opindex fexceptions
23345 Enable exception handling.  Generates extra code needed to propagate
23346 exceptions.  For some targets, this implies GCC generates frame
23347 unwind information for all functions, which can produce significant data
23348 size overhead, although it does not affect execution.  If you do not
23349 specify this option, GCC enables it by default for languages like
23350 C++ that normally require exception handling, and disables it for
23351 languages like C that do not normally require it.  However, you may need
23352 to enable this option when compiling C code that needs to interoperate
23353 properly with exception handlers written in C++.  You may also wish to
23354 disable this option if you are compiling older C++ programs that don't
23355 use exception handling.
23357 @item -fnon-call-exceptions
23358 @opindex fnon-call-exceptions
23359 Generate code that allows trapping instructions to throw exceptions.
23360 Note that this requires platform-specific runtime support that does
23361 not exist everywhere.  Moreover, it only allows @emph{trapping}
23362 instructions to throw exceptions, i.e.@: memory references or floating-point
23363 instructions.  It does not allow exceptions to be thrown from
23364 arbitrary signal handlers such as @code{SIGALRM}.
23366 @item -fdelete-dead-exceptions
23367 @opindex fdelete-dead-exceptions
23368 Consider that instructions that may throw exceptions but don't otherwise
23369 contribute to the execution of the program can be optimized away.
23370 This option is enabled by default for the Ada front end, as permitted by
23371 the Ada language specification.
23372 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
23374 @item -funwind-tables
23375 @opindex funwind-tables
23376 Similar to @option{-fexceptions}, except that it just generates any needed
23377 static data, but does not affect the generated code in any other way.
23378 You normally do not need to enable this option; instead, a language processor
23379 that needs this handling enables it on your behalf.
23381 @item -fasynchronous-unwind-tables
23382 @opindex fasynchronous-unwind-tables
23383 Generate unwind table in DWARF 2 format, if supported by target machine.  The
23384 table is exact at each instruction boundary, so it can be used for stack
23385 unwinding from asynchronous events (such as debugger or garbage collector).
23387 @item -fno-gnu-unique
23388 @opindex fno-gnu-unique
23389 On systems with recent GNU assembler and C library, the C++ compiler
23390 uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
23391 of template static data members and static local variables in inline
23392 functions are unique even in the presence of @code{RTLD_LOCAL}; this
23393 is necessary to avoid problems with a library used by two different
23394 @code{RTLD_LOCAL} plugins depending on a definition in one of them and
23395 therefore disagreeing with the other one about the binding of the
23396 symbol.  But this causes @code{dlclose} to be ignored for affected
23397 DSOs; if your program relies on reinitialization of a DSO via
23398 @code{dlclose} and @code{dlopen}, you can use
23399 @option{-fno-gnu-unique}.
23401 @item -fpcc-struct-return
23402 @opindex fpcc-struct-return
23403 Return ``short'' @code{struct} and @code{union} values in memory like
23404 longer ones, rather than in registers.  This convention is less
23405 efficient, but it has the advantage of allowing intercallability between
23406 GCC-compiled files and files compiled with other compilers, particularly
23407 the Portable C Compiler (pcc).
23409 The precise convention for returning structures in memory depends
23410 on the target configuration macros.
23412 Short structures and unions are those whose size and alignment match
23413 that of some integer type.
23415 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
23416 switch is not binary compatible with code compiled with the
23417 @option{-freg-struct-return} switch.
23418 Use it to conform to a non-default application binary interface.
23420 @item -freg-struct-return
23421 @opindex freg-struct-return
23422 Return @code{struct} and @code{union} values in registers when possible.
23423 This is more efficient for small structures than
23424 @option{-fpcc-struct-return}.
23426 If you specify neither @option{-fpcc-struct-return} nor
23427 @option{-freg-struct-return}, GCC defaults to whichever convention is
23428 standard for the target.  If there is no standard convention, GCC
23429 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
23430 the principal compiler.  In those cases, we can choose the standard, and
23431 we chose the more efficient register return alternative.
23433 @strong{Warning:} code compiled with the @option{-freg-struct-return}
23434 switch is not binary compatible with code compiled with the
23435 @option{-fpcc-struct-return} switch.
23436 Use it to conform to a non-default application binary interface.
23438 @item -fshort-enums
23439 @opindex fshort-enums
23440 Allocate to an @code{enum} type only as many bytes as it needs for the
23441 declared range of possible values.  Specifically, the @code{enum} type
23442 is equivalent to the smallest integer type that has enough room.
23444 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
23445 code that is not binary compatible with code generated without that switch.
23446 Use it to conform to a non-default application binary interface.
23448 @item -fshort-double
23449 @opindex fshort-double
23450 Use the same size for @code{double} as for @code{float}.
23452 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
23453 code that is not binary compatible with code generated without that switch.
23454 Use it to conform to a non-default application binary interface.
23456 @item -fshort-wchar
23457 @opindex fshort-wchar
23458 Override the underlying type for @code{wchar_t} to be @code{short
23459 unsigned int} instead of the default for the target.  This option is
23460 useful for building programs to run under WINE@.
23462 @strong{Warning:} the @option{-fshort-wchar} 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 -fno-common
23467 @opindex fno-common
23468 In C code, controls the placement of uninitialized global variables.
23469 Unix C compilers have traditionally permitted multiple definitions of
23470 such variables in different compilation units by placing the variables
23471 in a common block.
23472 This is the behavior specified by @option{-fcommon}, and is the default
23473 for GCC on most targets.
23474 On the other hand, this behavior is not required by ISO C, and on some
23475 targets may carry a speed or code size penalty on variable references.
23476 The @option{-fno-common} option specifies that the compiler should place
23477 uninitialized global variables in the data section of the object file,
23478 rather than generating them as common blocks.
23479 This has the effect that if the same variable is declared
23480 (without @code{extern}) in two different compilations,
23481 you get a multiple-definition error when you link them.
23482 In this case, you must compile with @option{-fcommon} instead.
23483 Compiling with @option{-fno-common} is useful on targets for which
23484 it provides better performance, or if you wish to verify that the
23485 program will work on other systems that always treat uninitialized
23486 variable declarations this way.
23488 @item -fno-ident
23489 @opindex fno-ident
23490 Ignore the @code{#ident} directive.
23492 @item -finhibit-size-directive
23493 @opindex finhibit-size-directive
23494 Don't output a @code{.size} assembler directive, or anything else that
23495 would cause trouble if the function is split in the middle, and the
23496 two halves are placed at locations far apart in memory.  This option is
23497 used when compiling @file{crtstuff.c}; you should not need to use it
23498 for anything else.
23500 @item -fverbose-asm
23501 @opindex fverbose-asm
23502 Put extra commentary information in the generated assembly code to
23503 make it more readable.  This option is generally only of use to those
23504 who actually need to read the generated assembly code (perhaps while
23505 debugging the compiler itself).
23507 @option{-fno-verbose-asm}, the default, causes the
23508 extra information to be omitted and is useful when comparing two assembler
23509 files.
23511 @item -frecord-gcc-switches
23512 @opindex frecord-gcc-switches
23513 This switch causes the command line used to invoke the
23514 compiler to be recorded into the object file that is being created.
23515 This switch is only implemented on some targets and the exact format
23516 of the recording is target and binary file format dependent, but it
23517 usually takes the form of a section containing ASCII text.  This
23518 switch is related to the @option{-fverbose-asm} switch, but that
23519 switch only records information in the assembler output file as
23520 comments, so it never reaches the object file.
23521 See also @option{-grecord-gcc-switches} for another
23522 way of storing compiler options into the object file.
23524 @item -fpic
23525 @opindex fpic
23526 @cindex global offset table
23527 @cindex PIC
23528 Generate position-independent code (PIC) suitable for use in a shared
23529 library, if supported for the target machine.  Such code accesses all
23530 constant addresses through a global offset table (GOT)@.  The dynamic
23531 loader resolves the GOT entries when the program starts (the dynamic
23532 loader is not part of GCC; it is part of the operating system).  If
23533 the GOT size for the linked executable exceeds a machine-specific
23534 maximum size, you get an error message from the linker indicating that
23535 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
23536 instead.  (These maximums are 8k on the SPARC and 32k
23537 on the m68k and RS/6000.  The x86 has no such limit.)
23539 Position-independent code requires special support, and therefore works
23540 only on certain machines.  For the x86, GCC supports PIC for System V
23541 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
23542 position-independent.
23544 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
23545 are defined to 1.
23547 @item -fPIC
23548 @opindex fPIC
23549 If supported for the target machine, emit position-independent code,
23550 suitable for dynamic linking and avoiding any limit on the size of the
23551 global offset table.  This option makes a difference on the m68k,
23552 PowerPC and SPARC@.
23554 Position-independent code requires special support, and therefore works
23555 only on certain machines.
23557 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
23558 are defined to 2.
23560 @item -fpie
23561 @itemx -fPIE
23562 @opindex fpie
23563 @opindex fPIE
23564 These options are similar to @option{-fpic} and @option{-fPIC}, but
23565 generated position independent code can be only linked into executables.
23566 Usually these options are used when @option{-pie} GCC option is
23567 used during linking.
23569 @option{-fpie} and @option{-fPIE} both define the macros
23570 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
23571 for @option{-fpie} and 2 for @option{-fPIE}.
23573 @item -fno-jump-tables
23574 @opindex fno-jump-tables
23575 Do not use jump tables for switch statements even where it would be
23576 more efficient than other code generation strategies.  This option is
23577 of use in conjunction with @option{-fpic} or @option{-fPIC} for
23578 building code that forms part of a dynamic linker and cannot
23579 reference the address of a jump table.  On some targets, jump tables
23580 do not require a GOT and this option is not needed.
23582 @item -ffixed-@var{reg}
23583 @opindex ffixed
23584 Treat the register named @var{reg} as a fixed register; generated code
23585 should never refer to it (except perhaps as a stack pointer, frame
23586 pointer or in some other fixed role).
23588 @var{reg} must be the name of a register.  The register names accepted
23589 are machine-specific and are defined in the @code{REGISTER_NAMES}
23590 macro in the machine description macro file.
23592 This flag does not have a negative form, because it specifies a
23593 three-way choice.
23595 @item -fcall-used-@var{reg}
23596 @opindex fcall-used
23597 Treat the register named @var{reg} as an allocable register that is
23598 clobbered by function calls.  It may be allocated for temporaries or
23599 variables that do not live across a call.  Functions compiled this way
23600 do not save and restore the register @var{reg}.
23602 It is an error to use this flag with the frame pointer or stack pointer.
23603 Use of this flag for other registers that have fixed pervasive roles in
23604 the machine's execution model produces disastrous results.
23606 This flag does not have a negative form, because it specifies a
23607 three-way choice.
23609 @item -fcall-saved-@var{reg}
23610 @opindex fcall-saved
23611 Treat the register named @var{reg} as an allocable register saved by
23612 functions.  It may be allocated even for temporaries or variables that
23613 live across a call.  Functions compiled this way save and restore
23614 the register @var{reg} if they use it.
23616 It is an error to use this flag with the frame pointer or stack pointer.
23617 Use of this flag for other registers that have fixed pervasive roles in
23618 the machine's execution model produces disastrous results.
23620 A different sort of disaster results from the use of this flag for
23621 a register in which function values may be returned.
23623 This flag does not have a negative form, because it specifies a
23624 three-way choice.
23626 @item -fpack-struct[=@var{n}]
23627 @opindex fpack-struct
23628 Without a value specified, pack all structure members together without
23629 holes.  When a value is specified (which must be a small power of two), pack
23630 structure members according to this value, representing the maximum
23631 alignment (that is, objects with default alignment requirements larger than
23632 this are output potentially unaligned at the next fitting location.
23634 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
23635 code that is not binary compatible with code generated without that switch.
23636 Additionally, it makes the code suboptimal.
23637 Use it to conform to a non-default application binary interface.
23639 @item -finstrument-functions
23640 @opindex finstrument-functions
23641 Generate instrumentation calls for entry and exit to functions.  Just
23642 after function entry and just before function exit, the following
23643 profiling functions are called with the address of the current
23644 function and its call site.  (On some platforms,
23645 @code{__builtin_return_address} does not work beyond the current
23646 function, so the call site information may not be available to the
23647 profiling functions otherwise.)
23649 @smallexample
23650 void __cyg_profile_func_enter (void *this_fn,
23651                                void *call_site);
23652 void __cyg_profile_func_exit  (void *this_fn,
23653                                void *call_site);
23654 @end smallexample
23656 The first argument is the address of the start of the current function,
23657 which may be looked up exactly in the symbol table.
23659 This instrumentation is also done for functions expanded inline in other
23660 functions.  The profiling calls indicate where, conceptually, the
23661 inline function is entered and exited.  This means that addressable
23662 versions of such functions must be available.  If all your uses of a
23663 function are expanded inline, this may mean an additional expansion of
23664 code size.  If you use @code{extern inline} in your C code, an
23665 addressable version of such functions must be provided.  (This is
23666 normally the case anyway, but if you get lucky and the optimizer always
23667 expands the functions inline, you might have gotten away without
23668 providing static copies.)
23670 A function may be given the attribute @code{no_instrument_function}, in
23671 which case this instrumentation is not done.  This can be used, for
23672 example, for the profiling functions listed above, high-priority
23673 interrupt routines, and any functions from which the profiling functions
23674 cannot safely be called (perhaps signal handlers, if the profiling
23675 routines generate output or allocate memory).
23677 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
23678 @opindex finstrument-functions-exclude-file-list
23680 Set the list of functions that are excluded from instrumentation (see
23681 the description of @option{-finstrument-functions}).  If the file that
23682 contains a function definition matches with one of @var{file}, then
23683 that function is not instrumented.  The match is done on substrings:
23684 if the @var{file} parameter is a substring of the file name, it is
23685 considered to be a match.
23687 For example:
23689 @smallexample
23690 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
23691 @end smallexample
23693 @noindent
23694 excludes any inline function defined in files whose pathnames
23695 contain @file{/bits/stl} or @file{include/sys}.
23697 If, for some reason, you want to include letter @samp{,} in one of
23698 @var{sym}, write @samp{\,}. For example,
23699 @option{-finstrument-functions-exclude-file-list='\,\,tmp'}
23700 (note the single quote surrounding the option).
23702 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
23703 @opindex finstrument-functions-exclude-function-list
23705 This is similar to @option{-finstrument-functions-exclude-file-list},
23706 but this option sets the list of function names to be excluded from
23707 instrumentation.  The function name to be matched is its user-visible
23708 name, such as @code{vector<int> blah(const vector<int> &)}, not the
23709 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
23710 match is done on substrings: if the @var{sym} parameter is a substring
23711 of the function name, it is considered to be a match.  For C99 and C++
23712 extended identifiers, the function name must be given in UTF-8, not
23713 using universal character names.
23715 @item -fstack-check
23716 @opindex fstack-check
23717 Generate code to verify that you do not go beyond the boundary of the
23718 stack.  You should specify this flag if you are running in an
23719 environment with multiple threads, but you only rarely need to specify it in
23720 a single-threaded environment since stack overflow is automatically
23721 detected on nearly all systems if there is only one stack.
23723 Note that this switch does not actually cause checking to be done; the
23724 operating system or the language runtime must do that.  The switch causes
23725 generation of code to ensure that they see the stack being extended.
23727 You can additionally specify a string parameter: @samp{no} means no
23728 checking, @samp{generic} means force the use of old-style checking,
23729 @samp{specific} means use the best checking method and is equivalent
23730 to bare @option{-fstack-check}.
23732 Old-style checking is a generic mechanism that requires no specific
23733 target support in the compiler but comes with the following drawbacks:
23735 @enumerate
23736 @item
23737 Modified allocation strategy for large objects: they are always
23738 allocated dynamically if their size exceeds a fixed threshold.
23740 @item
23741 Fixed limit on the size of the static frame of functions: when it is
23742 topped by a particular function, stack checking is not reliable and
23743 a warning is issued by the compiler.
23745 @item
23746 Inefficiency: because of both the modified allocation strategy and the
23747 generic implementation, code performance is hampered.
23748 @end enumerate
23750 Note that old-style stack checking is also the fallback method for
23751 @samp{specific} if no target support has been added in the compiler.
23753 @item -fstack-limit-register=@var{reg}
23754 @itemx -fstack-limit-symbol=@var{sym}
23755 @itemx -fno-stack-limit
23756 @opindex fstack-limit-register
23757 @opindex fstack-limit-symbol
23758 @opindex fno-stack-limit
23759 Generate code to ensure that the stack does not grow beyond a certain value,
23760 either the value of a register or the address of a symbol.  If a larger
23761 stack is required, a signal is raised at run time.  For most targets,
23762 the signal is raised before the stack overruns the boundary, so
23763 it is possible to catch the signal without taking special precautions.
23765 For instance, if the stack starts at absolute address @samp{0x80000000}
23766 and grows downwards, you can use the flags
23767 @option{-fstack-limit-symbol=__stack_limit} and
23768 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
23769 of 128KB@.  Note that this may only work with the GNU linker.
23771 @item -fsplit-stack
23772 @opindex fsplit-stack
23773 Generate code to automatically split the stack before it overflows.
23774 The resulting program has a discontiguous stack which can only
23775 overflow if the program is unable to allocate any more memory.  This
23776 is most useful when running threaded programs, as it is no longer
23777 necessary to calculate a good stack size to use for each thread.  This
23778 is currently only implemented for the x86 targets running
23779 GNU/Linux.
23781 When code compiled with @option{-fsplit-stack} calls code compiled
23782 without @option{-fsplit-stack}, there may not be much stack space
23783 available for the latter code to run.  If compiling all code,
23784 including library code, with @option{-fsplit-stack} is not an option,
23785 then the linker can fix up these calls so that the code compiled
23786 without @option{-fsplit-stack} always has a large stack.  Support for
23787 this is implemented in the gold linker in GNU binutils release 2.21
23788 and later.
23790 @item -fleading-underscore
23791 @opindex fleading-underscore
23792 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
23793 change the way C symbols are represented in the object file.  One use
23794 is to help link with legacy assembly code.
23796 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
23797 generate code that is not binary compatible with code generated without that
23798 switch.  Use it to conform to a non-default application binary interface.
23799 Not all targets provide complete support for this switch.
23801 @item -ftls-model=@var{model}
23802 @opindex ftls-model
23803 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
23804 The @var{model} argument should be one of @samp{global-dynamic},
23805 @samp{local-dynamic}, @samp{initial-exec} or @samp{local-exec}.
23806 Note that the choice is subject to optimization: the compiler may use
23807 a more efficient model for symbols not visible outside of the translation
23808 unit, or if @option{-fpic} is not given on the command line.
23810 The default without @option{-fpic} is @samp{initial-exec}; with
23811 @option{-fpic} the default is @samp{global-dynamic}.
23813 @item -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]}
23814 @opindex fvisibility
23815 Set the default ELF image symbol visibility to the specified option---all
23816 symbols are marked with this unless overridden within the code.
23817 Using this feature can very substantially improve linking and
23818 load times of shared object libraries, produce more optimized
23819 code, provide near-perfect API export and prevent symbol clashes.
23820 It is @strong{strongly} recommended that you use this in any shared objects
23821 you distribute.
23823 Despite the nomenclature, @samp{default} always means public; i.e.,
23824 available to be linked against from outside the shared object.
23825 @samp{protected} and @samp{internal} are pretty useless in real-world
23826 usage so the only other commonly used option is @samp{hidden}.
23827 The default if @option{-fvisibility} isn't specified is
23828 @samp{default}, i.e., make every symbol public.
23830 A good explanation of the benefits offered by ensuring ELF
23831 symbols have the correct visibility is given by ``How To Write
23832 Shared Libraries'' by Ulrich Drepper (which can be found at
23833 @w{@uref{http://www.akkadia.org/drepper/}})---however a superior
23834 solution made possible by this option to marking things hidden when
23835 the default is public is to make the default hidden and mark things
23836 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
23837 and @code{__attribute__ ((visibility("default")))} instead of
23838 @code{__declspec(dllexport)} you get almost identical semantics with
23839 identical syntax.  This is a great boon to those working with
23840 cross-platform projects.
23842 For those adding visibility support to existing code, you may find
23843 @code{#pragma GCC visibility} of use.  This works by you enclosing
23844 the declarations you wish to set visibility for with (for example)
23845 @code{#pragma GCC visibility push(hidden)} and
23846 @code{#pragma GCC visibility pop}.
23847 Bear in mind that symbol visibility should be viewed @strong{as
23848 part of the API interface contract} and thus all new code should
23849 always specify visibility when it is not the default; i.e., declarations
23850 only for use within the local DSO should @strong{always} be marked explicitly
23851 as hidden as so to avoid PLT indirection overheads---making this
23852 abundantly clear also aids readability and self-documentation of the code.
23853 Note that due to ISO C++ specification requirements, @code{operator new} and
23854 @code{operator delete} must always be of default visibility.
23856 Be aware that headers from outside your project, in particular system
23857 headers and headers from any other library you use, may not be
23858 expecting to be compiled with visibility other than the default.  You
23859 may need to explicitly say @code{#pragma GCC visibility push(default)}
23860 before including any such headers.
23862 @code{extern} declarations are not affected by @option{-fvisibility}, so
23863 a lot of code can be recompiled with @option{-fvisibility=hidden} with
23864 no modifications.  However, this means that calls to @code{extern}
23865 functions with no explicit visibility use the PLT, so it is more
23866 effective to use @code{__attribute ((visibility))} and/or
23867 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
23868 declarations should be treated as hidden.
23870 Note that @option{-fvisibility} does affect C++ vague linkage
23871 entities. This means that, for instance, an exception class that is
23872 be thrown between DSOs must be explicitly marked with default
23873 visibility so that the @samp{type_info} nodes are unified between
23874 the DSOs.
23876 An overview of these techniques, their benefits and how to use them
23877 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
23879 @item -fstrict-volatile-bitfields
23880 @opindex fstrict-volatile-bitfields
23881 This option should be used if accesses to volatile bit-fields (or other
23882 structure fields, although the compiler usually honors those types
23883 anyway) should use a single access of the width of the
23884 field's type, aligned to a natural alignment if possible.  For
23885 example, targets with memory-mapped peripheral registers might require
23886 all such accesses to be 16 bits wide; with this flag you can
23887 declare all peripheral bit-fields as @code{unsigned short} (assuming short
23888 is 16 bits on these targets) to force GCC to use 16-bit accesses
23889 instead of, perhaps, a more efficient 32-bit access.
23891 If this option is disabled, the compiler uses the most efficient
23892 instruction.  In the previous example, that might be a 32-bit load
23893 instruction, even though that accesses bytes that do not contain
23894 any portion of the bit-field, or memory-mapped registers unrelated to
23895 the one being updated.
23897 In some cases, such as when the @code{packed} attribute is applied to a 
23898 structure field, it may not be possible to access the field with a single
23899 read or write that is correctly aligned for the target machine.  In this
23900 case GCC falls back to generating multiple accesses rather than code that 
23901 will fault or truncate the result at run time.
23903 Note:  Due to restrictions of the C/C++11 memory model, write accesses are
23904 not allowed to touch non bit-field members.  It is therefore recommended
23905 to define all bits of the field's type as bit-field members.
23907 The default value of this option is determined by the application binary
23908 interface for the target processor.
23910 @item -fsync-libcalls
23911 @opindex fsync-libcalls
23912 This option controls whether any out-of-line instance of the @code{__sync}
23913 family of functions may be used to implement the C++11 @code{__atomic}
23914 family of functions.
23916 The default value of this option is enabled, thus the only useful form
23917 of the option is @option{-fno-sync-libcalls}.  This option is used in
23918 the implementation of the @file{libatomic} runtime library.
23920 @end table
23922 @c man end
23924 @node Environment Variables
23925 @section Environment Variables Affecting GCC
23926 @cindex environment variables
23928 @c man begin ENVIRONMENT
23929 This section describes several environment variables that affect how GCC
23930 operates.  Some of them work by specifying directories or prefixes to use
23931 when searching for various kinds of files.  Some are used to specify other
23932 aspects of the compilation environment.
23934 Note that you can also specify places to search using options such as
23935 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
23936 take precedence over places specified using environment variables, which
23937 in turn take precedence over those specified by the configuration of GCC@.
23938 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
23939 GNU Compiler Collection (GCC) Internals}.
23941 @table @env
23942 @item LANG
23943 @itemx LC_CTYPE
23944 @c @itemx LC_COLLATE
23945 @itemx LC_MESSAGES
23946 @c @itemx LC_MONETARY
23947 @c @itemx LC_NUMERIC
23948 @c @itemx LC_TIME
23949 @itemx LC_ALL
23950 @findex LANG
23951 @findex LC_CTYPE
23952 @c @findex LC_COLLATE
23953 @findex LC_MESSAGES
23954 @c @findex LC_MONETARY
23955 @c @findex LC_NUMERIC
23956 @c @findex LC_TIME
23957 @findex LC_ALL
23958 @cindex locale
23959 These environment variables control the way that GCC uses
23960 localization information which allows GCC to work with different
23961 national conventions.  GCC inspects the locale categories
23962 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
23963 so.  These locale categories can be set to any value supported by your
23964 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
23965 Kingdom encoded in UTF-8.
23967 The @env{LC_CTYPE} environment variable specifies character
23968 classification.  GCC uses it to determine the character boundaries in
23969 a string; this is needed for some multibyte encodings that contain quote
23970 and escape characters that are otherwise interpreted as a string
23971 end or escape.
23973 The @env{LC_MESSAGES} environment variable specifies the language to
23974 use in diagnostic messages.
23976 If the @env{LC_ALL} environment variable is set, it overrides the value
23977 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
23978 and @env{LC_MESSAGES} default to the value of the @env{LANG}
23979 environment variable.  If none of these variables are set, GCC
23980 defaults to traditional C English behavior.
23982 @item TMPDIR
23983 @findex TMPDIR
23984 If @env{TMPDIR} is set, it specifies the directory to use for temporary
23985 files.  GCC uses temporary files to hold the output of one stage of
23986 compilation which is to be used as input to the next stage: for example,
23987 the output of the preprocessor, which is the input to the compiler
23988 proper.
23990 @item GCC_COMPARE_DEBUG
23991 @findex GCC_COMPARE_DEBUG
23992 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
23993 @option{-fcompare-debug} to the compiler driver.  See the documentation
23994 of this option for more details.
23996 @item GCC_EXEC_PREFIX
23997 @findex GCC_EXEC_PREFIX
23998 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
23999 names of the subprograms executed by the compiler.  No slash is added
24000 when this prefix is combined with the name of a subprogram, but you can
24001 specify a prefix that ends with a slash if you wish.
24003 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
24004 an appropriate prefix to use based on the pathname it is invoked with.
24006 If GCC cannot find the subprogram using the specified prefix, it
24007 tries looking in the usual places for the subprogram.
24009 The default value of @env{GCC_EXEC_PREFIX} is
24010 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
24011 the installed compiler. In many cases @var{prefix} is the value
24012 of @code{prefix} when you ran the @file{configure} script.
24014 Other prefixes specified with @option{-B} take precedence over this prefix.
24016 This prefix is also used for finding files such as @file{crt0.o} that are
24017 used for linking.
24019 In addition, the prefix is used in an unusual way in finding the
24020 directories to search for header files.  For each of the standard
24021 directories whose name normally begins with @samp{/usr/local/lib/gcc}
24022 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
24023 replacing that beginning with the specified prefix to produce an
24024 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
24025 @file{foo/bar} just before it searches the standard directory 
24026 @file{/usr/local/lib/bar}.
24027 If a standard directory begins with the configured
24028 @var{prefix} then the value of @var{prefix} is replaced by
24029 @env{GCC_EXEC_PREFIX} when looking for header files.
24031 @item COMPILER_PATH
24032 @findex COMPILER_PATH
24033 The value of @env{COMPILER_PATH} is a colon-separated list of
24034 directories, much like @env{PATH}.  GCC tries the directories thus
24035 specified when searching for subprograms, if it can't find the
24036 subprograms using @env{GCC_EXEC_PREFIX}.
24038 @item LIBRARY_PATH
24039 @findex LIBRARY_PATH
24040 The value of @env{LIBRARY_PATH} is a colon-separated list of
24041 directories, much like @env{PATH}.  When configured as a native compiler,
24042 GCC tries the directories thus specified when searching for special
24043 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
24044 using GCC also uses these directories when searching for ordinary
24045 libraries for the @option{-l} option (but directories specified with
24046 @option{-L} come first).
24048 @item LANG
24049 @findex LANG
24050 @cindex locale definition
24051 This variable is used to pass locale information to the compiler.  One way in
24052 which this information is used is to determine the character set to be used
24053 when character literals, string literals and comments are parsed in C and C++.
24054 When the compiler is configured to allow multibyte characters,
24055 the following values for @env{LANG} are recognized:
24057 @table @samp
24058 @item C-JIS
24059 Recognize JIS characters.
24060 @item C-SJIS
24061 Recognize SJIS characters.
24062 @item C-EUCJP
24063 Recognize EUCJP characters.
24064 @end table
24066 If @env{LANG} is not defined, or if it has some other value, then the
24067 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
24068 recognize and translate multibyte characters.
24069 @end table
24071 @noindent
24072 Some additional environment variables affect the behavior of the
24073 preprocessor.
24075 @include cppenv.texi
24077 @c man end
24079 @node Precompiled Headers
24080 @section Using Precompiled Headers
24081 @cindex precompiled headers
24082 @cindex speed of compilation
24084 Often large projects have many header files that are included in every
24085 source file.  The time the compiler takes to process these header files
24086 over and over again can account for nearly all of the time required to
24087 build the project.  To make builds faster, GCC allows you to
24088 @dfn{precompile} a header file.
24090 To create a precompiled header file, simply compile it as you would any
24091 other file, if necessary using the @option{-x} option to make the driver
24092 treat it as a C or C++ header file.  You may want to use a
24093 tool like @command{make} to keep the precompiled header up-to-date when
24094 the headers it contains change.
24096 A precompiled header file is searched for when @code{#include} is
24097 seen in the compilation.  As it searches for the included file
24098 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
24099 compiler looks for a precompiled header in each directory just before it
24100 looks for the include file in that directory.  The name searched for is
24101 the name specified in the @code{#include} with @samp{.gch} appended.  If
24102 the precompiled header file can't be used, it is ignored.
24104 For instance, if you have @code{#include "all.h"}, and you have
24105 @file{all.h.gch} in the same directory as @file{all.h}, then the
24106 precompiled header file is used if possible, and the original
24107 header is used otherwise.
24109 Alternatively, you might decide to put the precompiled header file in a
24110 directory and use @option{-I} to ensure that directory is searched
24111 before (or instead of) the directory containing the original header.
24112 Then, if you want to check that the precompiled header file is always
24113 used, you can put a file of the same name as the original header in this
24114 directory containing an @code{#error} command.
24116 This also works with @option{-include}.  So yet another way to use
24117 precompiled headers, good for projects not designed with precompiled
24118 header files in mind, is to simply take most of the header files used by
24119 a project, include them from another header file, precompile that header
24120 file, and @option{-include} the precompiled header.  If the header files
24121 have guards against multiple inclusion, they are skipped because
24122 they've already been included (in the precompiled header).
24124 If you need to precompile the same header file for different
24125 languages, targets, or compiler options, you can instead make a
24126 @emph{directory} named like @file{all.h.gch}, and put each precompiled
24127 header in the directory, perhaps using @option{-o}.  It doesn't matter
24128 what you call the files in the directory; every precompiled header in
24129 the directory is considered.  The first precompiled header
24130 encountered in the directory that is valid for this compilation is
24131 used; they're searched in no particular order.
24133 There are many other possibilities, limited only by your imagination,
24134 good sense, and the constraints of your build system.
24136 A precompiled header file can be used only when these conditions apply:
24138 @itemize
24139 @item
24140 Only one precompiled header can be used in a particular compilation.
24142 @item
24143 A precompiled header can't be used once the first C token is seen.  You
24144 can have preprocessor directives before a precompiled header; you cannot
24145 include a precompiled header from inside another header.
24147 @item
24148 The precompiled header file must be produced for the same language as
24149 the current compilation.  You can't use a C precompiled header for a C++
24150 compilation.
24152 @item
24153 The precompiled header file must have been produced by the same compiler
24154 binary as the current compilation is using.
24156 @item
24157 Any macros defined before the precompiled header is included must
24158 either be defined in the same way as when the precompiled header was
24159 generated, or must not affect the precompiled header, which usually
24160 means that they don't appear in the precompiled header at all.
24162 The @option{-D} option is one way to define a macro before a
24163 precompiled header is included; using a @code{#define} can also do it.
24164 There are also some options that define macros implicitly, like
24165 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
24166 defined this way.
24168 @item If debugging information is output when using the precompiled
24169 header, using @option{-g} or similar, the same kind of debugging information
24170 must have been output when building the precompiled header.  However,
24171 a precompiled header built using @option{-g} can be used in a compilation
24172 when no debugging information is being output.
24174 @item The same @option{-m} options must generally be used when building
24175 and using the precompiled header.  @xref{Submodel Options},
24176 for any cases where this rule is relaxed.
24178 @item Each of the following options must be the same when building and using
24179 the precompiled header:
24181 @gccoptlist{-fexceptions}
24183 @item
24184 Some other command-line options starting with @option{-f},
24185 @option{-p}, or @option{-O} must be defined in the same way as when
24186 the precompiled header was generated.  At present, it's not clear
24187 which options are safe to change and which are not; the safest choice
24188 is to use exactly the same options when generating and using the
24189 precompiled header.  The following are known to be safe:
24191 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
24192 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
24193 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
24194 -pedantic-errors}
24196 @end itemize
24198 For all of these except the last, the compiler automatically
24199 ignores the precompiled header if the conditions aren't met.  If you
24200 find an option combination that doesn't work and doesn't cause the
24201 precompiled header to be ignored, please consider filing a bug report,
24202 see @ref{Bugs}.
24204 If you do use differing options when generating and using the
24205 precompiled header, the actual behavior is a mixture of the
24206 behavior for the options.  For instance, if you use @option{-g} to
24207 generate the precompiled header but not when using it, you may or may
24208 not get debugging information for routines in the precompiled header.