In cp/error.c, I separate the initialization of the diagnostic context
[official-gcc.git] / gcc / doc / invoke.texi
blob9f21c9623a9348777c6c7b9d8f2a7e506dd841c9
1 @c Copyright (C) 1988-2014 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-2014 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.  @samp{g++} accepts mostly the same options as @samp{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 -fopenmp -fopenmp-simd -fms-extensions @gol
172 -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  -fstats  -ftemplate-backtrace-limit=@var{n} @gol
191 -ftemplate-depth=@var{n} @gol
192 -fno-threadsafe-statics  -fuse-cxa-atexit @gol
193 -fno-weak  -nostdinc++ @gol
194 -fvisibility-inlines-hidden @gol
195 -fvtable-verify=@var{std|preinit|none} @gol
196 -fvtv-counts -fvtv-debug @gol
197 -fvisibility-ms-compat @gol
198 -fext-numeric-literals @gol
199 -Wabi=@var{n}  -Wconversion-null  -Wctor-dtor-privacy @gol
200 -Wdelete-non-virtual-dtor -Wliteral-suffix -Wnarrowing @gol
201 -Wnoexcept -Wnon-virtual-dtor  -Wreorder @gol
202 -Weffc++  -Wstrict-null-sentinel @gol
203 -Wno-non-template-friend  -Wold-style-cast @gol
204 -Woverloaded-virtual  -Wno-pmf-conversions @gol
205 -Wsign-promo}
207 @item Objective-C and Objective-C++ Language Options
208 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
209 Objective-C and Objective-C++ Dialects}.
210 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
211 -fgnu-runtime  -fnext-runtime @gol
212 -fno-nil-receivers @gol
213 -fobjc-abi-version=@var{n} @gol
214 -fobjc-call-cxx-cdtors @gol
215 -fobjc-direct-dispatch @gol
216 -fobjc-exceptions @gol
217 -fobjc-gc @gol
218 -fobjc-nilcheck @gol
219 -fobjc-std=objc1 @gol
220 -fno-local-ivars @gol
221 -fivar-visibility=@var{public|protected|private|package} @gol
222 -freplace-objc-classes @gol
223 -fzero-link @gol
224 -gen-decls @gol
225 -Wassign-intercept @gol
226 -Wno-protocol  -Wselector @gol
227 -Wstrict-selector-match @gol
228 -Wundeclared-selector}
230 @item Language Independent Options
231 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
232 @gccoptlist{-fmessage-length=@var{n}  @gol
233 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
234 -fdiagnostics-color=@r{[}auto@r{|}never@r{|}always@r{]}  @gol
235 -fno-diagnostics-show-option -fno-diagnostics-show-caret}
237 @item Warning Options
238 @xref{Warning Options,,Options to Request or Suppress Warnings}.
239 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -Wpedantic @gol
240 -pedantic-errors @gol
241 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  @gol
242 -Waggressive-loop-optimizations -Warray-bounds @gol
243 -Wbool-compare @gol
244 -Wno-attributes -Wno-builtin-macro-redefined @gol
245 -Wc90-c99-compat -Wc99-c11-compat @gol
246 -Wc++-compat -Wc++11-compat -Wcast-align  -Wcast-qual  @gol
247 -Wchar-subscripts -Wclobbered  -Wcomment -Wconditionally-supported  @gol
248 -Wconversion -Wcoverage-mismatch -Wdate-time -Wdelete-incomplete -Wno-cpp  @gol
249 -Wno-deprecated -Wno-deprecated-declarations -Wno-designated-init @gol
250 -Wdisabled-optimization -Wno-discarded-qualifiers @gol
251 -Wno-div-by-zero -Wdouble-promotion -Wempty-body  -Wenum-compare @gol
252 -Wno-endif-labels -Werror  -Werror=* @gol
253 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
254 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
255 -Wformat-security  -Wformat-signedness  -Wformat-y2k @gol
256 -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol
257 -Wignored-qualifiers  -Wincompatible-pointer-types @gol
258 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
259 -Winit-self  -Winline  -Wno-int-conversion @gol
260 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
261 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
262 -Wlogical-op -Wlogical-not-parentheses -Wlong-long @gol
263 -Wmain -Wmaybe-uninitialized -Wmemset-transposed-args -Wmissing-braces @gol
264 -Wmissing-field-initializers -Wmissing-include-dirs @gol
265 -Wno-multichar  -Wnonnull  -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]} @gol
266  -Wodr  -Wno-overflow  -Wopenmp-simd @gol
267 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
268 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
269 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
270 -Wredundant-decls  -Wno-return-local-addr @gol
271 -Wreturn-type  -Wsequence-point  -Wshadow  -Wno-shadow-ivar @gol
272 -Wsign-compare  -Wsign-conversion -Wfloat-conversion @gol
273 -Wsizeof-pointer-memaccess  -Wsizeof-array-argument @gol
274 -Wstack-protector -Wstack-usage=@var{len} -Wstrict-aliasing @gol
275 -Wstrict-aliasing=n @gol -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
276 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]} @gol
277 -Wsuggest-final-types @gol -Wsuggest-final-methods @gol
278 -Wmissing-format-attribute @gol
279 -Wswitch  -Wswitch-default  -Wswitch-enum -Wswitch-bool -Wsync-nand @gol
280 -Wsystem-headers  -Wtrampolines  -Wtrigraphs  -Wtype-limits  -Wundef @gol
281 -Wuninitialized  -Wunknown-pragmas  -Wno-pragmas @gol
282 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
283 -Wunused-label  -Wunused-local-typedefs -Wunused-parameter @gol
284 -Wno-unused-result -Wunused-value @gol -Wunused-variable @gol
285 -Wunused-but-set-parameter -Wunused-but-set-variable @gol
286 -Wuseless-cast -Wvariadic-macros -Wvector-operation-performance @gol
287 -Wvla -Wvolatile-register-var  -Wwrite-strings -Wzero-as-null-pointer-constant}
289 @item C and Objective-C-only Warning Options
290 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
291 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
292 -Wold-style-declaration  -Wold-style-definition @gol
293 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
294 -Wdeclaration-after-statement -Wpointer-sign}
296 @item Debugging Options
297 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
298 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
299 -fsanitize=@var{style} -fsanitize-recover -fsanitize-recover=@var{style} @gol
300 -fsanitize-undefined-trap-on-error @gol
301 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
302 -fdisable-ipa-@var{pass_name} @gol
303 -fdisable-rtl-@var{pass_name} @gol
304 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
305 -fdisable-tree-@var{pass_name} @gol
306 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
307 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
308 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
309 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
310 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
311 -fdump-passes @gol
312 -fdump-statistics @gol
313 -fdump-tree-all @gol
314 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
315 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
316 -fdump-tree-cfg -fdump-tree-alias @gol
317 -fdump-tree-ch @gol
318 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
319 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
320 -fdump-tree-gimple@r{[}-raw@r{]} @gol
321 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
322 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
323 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
324 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
325 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
326 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
327 -fdump-tree-nrv -fdump-tree-vect @gol
328 -fdump-tree-sink @gol
329 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
330 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
331 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
332 -fdump-tree-vtable-verify @gol
333 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
334 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
335 -fdump-final-insns=@var{file} @gol
336 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
337 -feliminate-dwarf2-dups -fno-eliminate-unused-debug-types @gol
338 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
339 -fenable-@var{kind}-@var{pass} @gol
340 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
341 -fdebug-types-section -fmem-report-wpa @gol
342 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
343 -fopt-info @gol
344 -fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
345 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
346 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
347 -fstack-usage  -ftest-coverage  -ftime-report -fvar-tracking @gol
348 -fvar-tracking-assignments  -fvar-tracking-assignments-toggle @gol
349 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
350 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
351 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
352 -gvms  -gxcoff  -gxcoff+ -gz@r{[}=@var{type}@r{]} @gol
353 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
354 -fdebug-prefix-map=@var{old}=@var{new} @gol
355 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
356 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
357 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
358 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
359 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
360 -print-sysroot -print-sysroot-headers-suffix @gol
361 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
363 @item Optimization Options
364 @xref{Optimize Options,,Options that Control Optimization}.
365 @gccoptlist{-faggressive-loop-optimizations -falign-functions[=@var{n}] @gol
366 -falign-jumps[=@var{n}] @gol
367 -falign-labels[=@var{n}] -falign-loops[=@var{n}] @gol
368 -fassociative-math -fauto-profile -fauto-profile[=@var{path}] @gol
369 -fauto-inc-dec -fbranch-probabilities @gol
370 -fbranch-target-load-optimize -fbranch-target-load-optimize2 @gol
371 -fbtr-bb-exclusive -fcaller-saves @gol
372 -fcheck-data-deps -fcombine-stack-adjustments -fconserve-stack @gol
373 -fcompare-elim -fcprop-registers -fcrossjumping @gol
374 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
375 -fcx-limited-range @gol
376 -fdata-sections -fdce -fdelayed-branch @gol
377 -fdelete-null-pointer-checks -fdevirtualize -fdevirtualize-speculatively -fdse @gol
378 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects @gol
379 -ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
380 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
381 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
382 -fgcse-sm -fhoist-adjacent-loads -fif-conversion @gol
383 -fif-conversion2 -findirect-inlining @gol
384 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
385 -finline-small-functions -fipa-cp -fipa-cp-clone @gol
386 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference -fipa-icf @gol
387 -fira-algorithm=@var{algorithm} @gol
388 -fira-region=@var{region} -fira-hoist-pressure @gol
389 -fira-loop-pressure -fno-ira-share-save-slots @gol
390 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
391 -fisolate-erroneous-paths-dereference -fisolate-erroneous-paths-attribute @gol
392 -fivopts -fkeep-inline-functions -fkeep-static-consts -flive-range-shrinkage @gol
393 -floop-block -floop-interchange -floop-strip-mine -floop-nest-optimize @gol
394 -floop-parallelize-all -flto -flto-compression-level @gol
395 -flto-partition=@var{alg} -flto-report -flto-report-wpa -fmerge-all-constants @gol
396 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
397 -fmove-loop-invariants -fno-branch-count-reg @gol
398 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
399 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
400 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
401 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
402 -fomit-frame-pointer -foptimize-sibling-calls @gol
403 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
404 -fprefetch-loop-arrays -fprofile-report @gol
405 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
406 -fprofile-generate=@var{path} @gol
407 -fprofile-use -fprofile-use=@var{path} -fprofile-values -fprofile-reorder-functions @gol
408 -freciprocal-math -free -frename-registers -freorder-blocks @gol
409 -freorder-blocks-and-partition -freorder-functions @gol
410 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
411 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
412 -fsched-spec-load -fsched-spec-load-dangerous @gol
413 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
414 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
415 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
416 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
417 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
418 -fselective-scheduling -fselective-scheduling2 @gol
419 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
420 -fsemantic-interposition @gol
421 -fshrink-wrap -fsignaling-nans -fsingle-precision-constant @gol
422 -fsplit-ivs-in-unroller -fsplit-wide-types -fssa-phiopt -fstack-protector @gol
423 -fstack-protector-all -fstack-protector-strong -fstrict-aliasing @gol
424 -fstrict-overflow -fthread-jumps -ftracer -ftree-bit-ccp @gol
425 -ftree-builtin-call-dce -ftree-ccp -ftree-ch @gol
426 -ftree-coalesce-inline-vars -ftree-coalesce-vars -ftree-copy-prop @gol
427 -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
428 -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
429 -ftree-loop-if-convert-stores -ftree-loop-im @gol
430 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
431 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
432 -ftree-loop-vectorize @gol
433 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-partial-pre -ftree-pta @gol
434 -ftree-reassoc -ftree-sink -ftree-slsr -ftree-sra @gol
435 -ftree-switch-conversion -ftree-tail-merge -ftree-ter @gol
436 -ftree-vectorize -ftree-vrp @gol
437 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
438 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
439 -fuse-caller-save -fvariable-expansion-in-unroller -fvect-cost-model -fvpt @gol
440 -fweb -fwhole-program -fwpa -fuse-ld=@var{linker} -fuse-linker-plugin @gol
441 --param @var{name}=@var{value}
442 -O  -O0  -O1  -O2  -O3  -Os -Ofast -Og}
444 @item Preprocessor Options
445 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
446 @gccoptlist{-A@var{question}=@var{answer} @gol
447 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
448 -C  -dD  -dI  -dM  -dN @gol
449 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
450 -idirafter @var{dir} @gol
451 -include @var{file}  -imacros @var{file} @gol
452 -iprefix @var{file}  -iwithprefix @var{dir} @gol
453 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
454 -imultilib @var{dir} -isysroot @var{dir} @gol
455 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
456 -P  -fdebug-cpp -ftrack-macro-expansion -fworking-directory @gol
457 -remap -trigraphs  -undef  -U@var{macro}  @gol
458 -Wp,@var{option} -Xpreprocessor @var{option} -no-integrated-cpp}
460 @item Assembler Option
461 @xref{Assembler Options,,Passing Options to the Assembler}.
462 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
464 @item Linker Options
465 @xref{Link Options,,Options for Linking}.
466 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
467 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
468 -s  -static -static-libgcc -static-libstdc++ @gol
469 -static-libasan -static-libtsan -static-liblsan -static-libubsan @gol
470 -shared -shared-libgcc  -symbolic @gol
471 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
472 -u @var{symbol} -z @var{keyword}}
474 @item Directory Options
475 @xref{Directory Options,,Options for Directory Search}.
476 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
477 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol
478 --sysroot=@var{dir} --no-sysroot-suffix}
480 @item Machine Dependent Options
481 @xref{Submodel Options,,Hardware Models and Configurations}.
482 @c This list is ordered alphanumerically by subsection name.
483 @c Try and put the significant identifier (CPU or system) first,
484 @c so users have a clue at guessing where the ones they want will be.
486 @emph{AArch64 Options}
487 @gccoptlist{-mabi=@var{name}  -mbig-endian  -mlittle-endian @gol
488 -mgeneral-regs-only @gol
489 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
490 -mstrict-align @gol
491 -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
492 -mtls-dialect=desc  -mtls-dialect=traditional @gol
493 -mfix-cortex-a53-835769  -mno-fix-cortex-a53-835769 @gol
494 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}}
496 @emph{Adapteva Epiphany Options}
497 @gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs @gol
498 -mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf @gol
499 -msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} @gol
500 -mround-nearest -mlong-calls -mshort-calls -msmall16 @gol
501 -mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} @gol
502 -msplit-vecmove-early -m1reg-@var{reg}}
504 @emph{ARC Options}
505 @gccoptlist{-mbarrel-shifter @gol
506 -mcpu=@var{cpu} -mA6 -mARC600 -mA7 -mARC700 @gol
507 -mdpfp -mdpfp-compact -mdpfp-fast -mno-dpfp-lrsr @gol
508 -mea -mno-mpy -mmul32x16 -mmul64 @gol
509 -mnorm -mspfp -mspfp-compact -mspfp-fast -msimd -msoft-float -mswap @gol
510 -mcrc -mdsp-packa -mdvbf -mlock -mmac-d16 -mmac-24 -mrtsc -mswape @gol
511 -mtelephony -mxy -misize -mannotate-align -marclinux -marclinux_prof @gol
512 -mepilogue-cfi -mlong-calls -mmedium-calls -msdata @gol
513 -mucb-mcount -mvolatile-cache @gol
514 -malign-call -mauto-modify-reg -mbbit-peephole -mno-brcc @gol
515 -mcase-vector-pcrel -mcompact-casesi -mno-cond-exec -mearly-cbranchsi @gol
516 -mexpand-adddi -mindexed-loads -mlra -mlra-priority-none @gol
517 -mlra-priority-compact mlra-priority-noncompact -mno-millicode @gol
518 -mmixed-code -mq-class -mRcq -mRcw -msize-level=@var{level} @gol
519 -mtune=@var{cpu} -mmultcost=@var{num} -munalign-prob-threshold=@var{probability}}
521 @emph{ARM Options}
522 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
523 -mabi=@var{name} @gol
524 -mapcs-stack-check  -mno-apcs-stack-check @gol
525 -mapcs-float  -mno-apcs-float @gol
526 -mapcs-reentrant  -mno-apcs-reentrant @gol
527 -msched-prolog  -mno-sched-prolog @gol
528 -mlittle-endian  -mbig-endian @gol
529 -mfloat-abi=@var{name} @gol
530 -mfp16-format=@var{name}
531 -mthumb-interwork  -mno-thumb-interwork @gol
532 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
533 -mstructure-size-boundary=@var{n} @gol
534 -mabort-on-noreturn @gol
535 -mlong-calls  -mno-long-calls @gol
536 -msingle-pic-base  -mno-single-pic-base @gol
537 -mpic-register=@var{reg} @gol
538 -mnop-fun-dllimport @gol
539 -mpoke-function-name @gol
540 -mthumb  -marm @gol
541 -mtpcs-frame  -mtpcs-leaf-frame @gol
542 -mcaller-super-interworking  -mcallee-super-interworking @gol
543 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
544 -mword-relocations @gol
545 -mfix-cortex-m3-ldrd @gol
546 -munaligned-access @gol
547 -mneon-for-64bits @gol
548 -mslow-flash-data @gol
549 -mrestrict-it}
551 @emph{AVR Options}
552 @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
553 -mcall-prologues -mint8 -mno-interrupts -mrelax @gol
554 -mstrict-X -mtiny-stack -Waddr-space-convert}
556 @emph{Blackfin Options}
557 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
558 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
559 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
560 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
561 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
562 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
563 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
564 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
565 -micplb}
567 @emph{C6X Options}
568 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
569 -msim -msdata=@var{sdata-type}}
571 @emph{CRIS Options}
572 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
573 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
574 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
575 -mstack-align  -mdata-align  -mconst-align @gol
576 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
577 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
578 -mmul-bug-workaround  -mno-mul-bug-workaround}
580 @emph{CR16 Options}
581 @gccoptlist{-mmac @gol
582 -mcr16cplus -mcr16c @gol
583 -msim -mint32 -mbit-ops
584 -mdata-model=@var{model}}
586 @emph{Darwin Options}
587 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
588 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
589 -client_name  -compatibility_version  -current_version @gol
590 -dead_strip @gol
591 -dependency-file  -dylib_file  -dylinker_install_name @gol
592 -dynamic  -dynamiclib  -exported_symbols_list @gol
593 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
594 -force_flat_namespace  -headerpad_max_install_names @gol
595 -iframework @gol
596 -image_base  -init  -install_name  -keep_private_externs @gol
597 -multi_module  -multiply_defined  -multiply_defined_unused @gol
598 -noall_load   -no_dead_strip_inits_and_terms @gol
599 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
600 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
601 -private_bundle  -read_only_relocs  -sectalign @gol
602 -sectobjectsymbols  -whyload  -seg1addr @gol
603 -sectcreate  -sectobjectsymbols  -sectorder @gol
604 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
605 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
606 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
607 -single_module  -static  -sub_library  -sub_umbrella @gol
608 -twolevel_namespace  -umbrella  -undefined @gol
609 -unexported_symbols_list  -weak_reference_mismatches @gol
610 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
611 -mkernel -mone-byte-bool}
613 @emph{DEC Alpha Options}
614 @gccoptlist{-mno-fp-regs  -msoft-float @gol
615 -mieee  -mieee-with-inexact  -mieee-conformant @gol
616 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
617 -mtrap-precision=@var{mode}  -mbuild-constants @gol
618 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
619 -mbwx  -mmax  -mfix  -mcix @gol
620 -mfloat-vax  -mfloat-ieee @gol
621 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
622 -msmall-text  -mlarge-text @gol
623 -mmemory-latency=@var{time}}
625 @emph{FR30 Options}
626 @gccoptlist{-msmall-model -mno-lsim}
628 @emph{FRV Options}
629 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
630 -mhard-float  -msoft-float @gol
631 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
632 -mdouble  -mno-double @gol
633 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
634 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
635 -mlinked-fp  -mlong-calls  -malign-labels @gol
636 -mlibrary-pic  -macc-4  -macc-8 @gol
637 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
638 -moptimize-membar -mno-optimize-membar @gol
639 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
640 -mvliw-branch  -mno-vliw-branch @gol
641 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
642 -mno-nested-cond-exec  -mtomcat-stats @gol
643 -mTLS -mtls @gol
644 -mcpu=@var{cpu}}
646 @emph{GNU/Linux Options}
647 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
648 -tno-android-cc -tno-android-ld}
650 @emph{H8/300 Options}
651 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr -mno-exr  -mint32  -malign-300}
653 @emph{HPPA Options}
654 @gccoptlist{-march=@var{architecture-type} @gol
655 -mdisable-fpregs  -mdisable-indexing @gol
656 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
657 -mfixed-range=@var{register-range} @gol
658 -mjump-in-delay -mlinker-opt -mlong-calls @gol
659 -mlong-load-store  -mno-disable-fpregs @gol
660 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
661 -mno-jump-in-delay  -mno-long-load-store @gol
662 -mno-portable-runtime  -mno-soft-float @gol
663 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
664 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
665 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
666 -munix=@var{unix-std}  -nolibdld  -static  -threads}
668 @emph{i386 and x86-64 Options}
669 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
670 -mtune-ctrl=@var{feature-list} -mdump-tune-features -mno-default @gol
671 -mfpmath=@var{unit} @gol
672 -masm=@var{dialect}  -mno-fancy-math-387 @gol
673 -mno-fp-ret-in-387  -msoft-float @gol
674 -mno-wide-multiply  -mrtd  -malign-double @gol
675 -mpreferred-stack-boundary=@var{num} @gol
676 -mincoming-stack-boundary=@var{num} @gol
677 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
678 -mrecip -mrecip=@var{opt} @gol
679 -mvzeroupper -mprefer-avx128 @gol
680 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
681 -mavx2 -mavx512f -mavx512pf -mavx512er -mavx512cd -msha @gol
682 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma -mprefetchwt1 @gol
683 -mclflushopt -mxsavec -mxsaves @gol
684 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
685 -mbmi2 -mfxsr -mxsave -mxsaveopt -mrtm -mlwp -mthreads @gol
686 -mno-align-stringops  -minline-all-stringops @gol
687 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
688 -mmemcpy-strategy=@var{strategy} -mmemset-strategy=@var{strategy}
689 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
690 -m96bit-long-double -mlong-double-64 -mlong-double-80 -mlong-double-128 @gol
691 -mregparm=@var{num}  -msseregparm @gol
692 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
693 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
694 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
695 -mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
696 -m32 -m64 -mx32 -m16 -mlarge-data-threshold=@var{num} @gol
697 -msse2avx -mfentry -mrecord-mcount -mnop-mcount -m8bit-idiv @gol
698 -mavx256-split-unaligned-load -mavx256-split-unaligned-store @gol
699 -mstack-protector-guard=@var{guard}}
701 @emph{i386 and x86-64 Windows Options}
702 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
703 -mnop-fun-dllimport -mthread @gol
704 -municode -mwin32 -mwindows -fno-set-stack-executable}
706 @emph{IA-64 Options}
707 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
708 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
709 -mconstant-gp  -mauto-pic  -mfused-madd @gol
710 -minline-float-divide-min-latency @gol
711 -minline-float-divide-max-throughput @gol
712 -mno-inline-float-divide @gol
713 -minline-int-divide-min-latency @gol
714 -minline-int-divide-max-throughput  @gol
715 -mno-inline-int-divide @gol
716 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
717 -mno-inline-sqrt @gol
718 -mdwarf2-asm -mearly-stop-bits @gol
719 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
720 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
721 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
722 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
723 -msched-spec-ldc -msched-spec-control-ldc @gol
724 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
725 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
726 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
727 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
729 @emph{LM32 Options}
730 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
731 -msign-extend-enabled -muser-enabled}
733 @emph{M32R/D Options}
734 @gccoptlist{-m32r2 -m32rx -m32r @gol
735 -mdebug @gol
736 -malign-loops -mno-align-loops @gol
737 -missue-rate=@var{number} @gol
738 -mbranch-cost=@var{number} @gol
739 -mmodel=@var{code-size-model-type} @gol
740 -msdata=@var{sdata-type} @gol
741 -mno-flush-func -mflush-func=@var{name} @gol
742 -mno-flush-trap -mflush-trap=@var{number} @gol
743 -G @var{num}}
745 @emph{M32C Options}
746 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
748 @emph{M680x0 Options}
749 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
750 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
751 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
752 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
753 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
754 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
755 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
756 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
757 -mxgot -mno-xgot}
759 @emph{MCore Options}
760 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
761 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
762 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
763 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
764 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
766 @emph{MeP Options}
767 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
768 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
769 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
770 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
771 -mtiny=@var{n}}
773 @emph{MicroBlaze Options}
774 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
775 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
776 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
777 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
778 -mbig-endian -mlittle-endian -mxl-reorder -mxl-mode-@var{app-model}}
780 @emph{MIPS Options}
781 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
782 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips32r3  -mips32r5 @gol
783 -mips64  -mips64r2  -mips64r3  -mips64r5 @gol
784 -mips16  -mno-mips16  -mflip-mips16 @gol
785 -minterlink-compressed -mno-interlink-compressed @gol
786 -minterlink-mips16  -mno-interlink-mips16 @gol
787 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
788 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
789 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
790 -mno-float  -msingle-float  -mdouble-float @gol
791 -mabs=@var{mode}  -mnan=@var{encoding} @gol
792 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
793 -mmcu -mmno-mcu @gol
794 -meva -mno-eva @gol
795 -mvirt -mno-virt @gol
796 -mxpa -mno-xpa @gol
797 -mmicromips -mno-micromips @gol
798 -mfpu=@var{fpu-type} @gol
799 -msmartmips  -mno-smartmips @gol
800 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
801 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
802 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
803 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
804 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
805 -membedded-data  -mno-embedded-data @gol
806 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
807 -mcode-readable=@var{setting} @gol
808 -msplit-addresses  -mno-split-addresses @gol
809 -mexplicit-relocs  -mno-explicit-relocs @gol
810 -mcheck-zero-division  -mno-check-zero-division @gol
811 -mdivide-traps  -mdivide-breaks @gol
812 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
813 -mmad -mno-mad -mimadd -mno-imadd -mfused-madd  -mno-fused-madd  -nocpp @gol
814 -mfix-24k -mno-fix-24k @gol
815 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
816 -mfix-r10000 -mno-fix-r10000  -mfix-rm7000 -mno-fix-rm7000 @gol
817 -mfix-vr4120  -mno-fix-vr4120 @gol
818 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
819 -mflush-func=@var{func}  -mno-flush-func @gol
820 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
821 -mfp-exceptions -mno-fp-exceptions @gol
822 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
823 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
825 @emph{MMIX Options}
826 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
827 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
828 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
829 -mno-base-addresses  -msingle-exit  -mno-single-exit}
831 @emph{MN10300 Options}
832 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
833 -mno-am33 -mam33 -mam33-2 -mam34 @gol
834 -mtune=@var{cpu-type} @gol
835 -mreturn-pointer-on-d0 @gol
836 -mno-crt0  -mrelax -mliw -msetlb}
838 @emph{Moxie Options}
839 @gccoptlist{-meb -mel -mno-crt0}
841 @emph{MSP430 Options}
842 @gccoptlist{-msim -masm-hex -mmcu= -mcpu= -mlarge -msmall -mrelax @gol
843 -mhwmult= -minrt}
845 @emph{NDS32 Options}
846 @gccoptlist{-mbig-endian -mlittle-endian @gol
847 -mreduced-regs -mfull-regs @gol
848 -mcmov -mno-cmov @gol
849 -mperf-ext -mno-perf-ext @gol
850 -mv3push -mno-v3push @gol
851 -m16bit -mno-16bit @gol
852 -mgp-direct -mno-gp-direct @gol
853 -misr-vector-size=@var{num} @gol
854 -mcache-block-size=@var{num} @gol
855 -march=@var{arch} @gol
856 -mforce-fp-as-gp -mforbid-fp-as-gp @gol
857 -mex9 -mctor-dtor -mrelax}
859 @emph{Nios II Options}
860 @gccoptlist{-G @var{num} -mgpopt -mno-gpopt -mel -meb @gol
861 -mno-bypass-cache -mbypass-cache @gol
862 -mno-cache-volatile -mcache-volatile @gol
863 -mno-fast-sw-div -mfast-sw-div @gol
864 -mhw-mul -mno-hw-mul -mhw-mulx -mno-hw-mulx -mno-hw-div -mhw-div @gol
865 -mcustom-@var{insn}=@var{N} -mno-custom-@var{insn} @gol
866 -mcustom-fpu-cfg=@var{name} @gol
867 -mhal -msmallc -msys-crt0=@var{name} -msys-lib=@var{name}}
869 @emph{PDP-11 Options}
870 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
871 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
872 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
873 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
874 -mbranch-expensive  -mbranch-cheap @gol
875 -munix-asm  -mdec-asm}
877 @emph{picoChip Options}
878 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
879 -msymbol-as-address -mno-inefficient-warnings}
881 @emph{PowerPC Options}
882 See RS/6000 and PowerPC Options.
884 @emph{RL78 Options}
885 @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=rl78 @gol
886 -m64bit-doubles -m32bit-doubles}
888 @emph{RS/6000 and PowerPC Options}
889 @gccoptlist{-mcpu=@var{cpu-type} @gol
890 -mtune=@var{cpu-type} @gol
891 -mcmodel=@var{code-model} @gol
892 -mpowerpc64 @gol
893 -maltivec  -mno-altivec @gol
894 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
895 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
896 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
897 -mfprnd  -mno-fprnd @gol
898 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
899 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
900 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
901 -malign-power  -malign-natural @gol
902 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
903 -msingle-float -mdouble-float -msimple-fpu @gol
904 -mstring  -mno-string  -mupdate  -mno-update @gol
905 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
906 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
907 -mstrict-align  -mno-strict-align  -mrelocatable @gol
908 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
909 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
910 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
911 -mprioritize-restricted-insns=@var{priority} @gol
912 -msched-costly-dep=@var{dependence_type} @gol
913 -minsert-sched-nops=@var{scheme} @gol
914 -mcall-sysv  -mcall-netbsd @gol
915 -maix-struct-return  -msvr4-struct-return @gol
916 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
917 -mblock-move-inline-limit=@var{num} @gol
918 -misel -mno-isel @gol
919 -misel=yes  -misel=no @gol
920 -mspe -mno-spe @gol
921 -mspe=yes  -mspe=no @gol
922 -mpaired @gol
923 -mgen-cell-microcode -mwarn-cell-microcode @gol
924 -mvrsave -mno-vrsave @gol
925 -mmulhw -mno-mulhw @gol
926 -mdlmzb -mno-dlmzb @gol
927 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
928 -mprototype  -mno-prototype @gol
929 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
930 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
931 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
932 -mno-recip-precision @gol
933 -mveclibabi=@var{type} -mfriz -mno-friz @gol
934 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
935 -msave-toc-indirect -mno-save-toc-indirect @gol
936 -mpower8-fusion -mno-mpower8-fusion -mpower8-vector -mno-power8-vector @gol
937 -mcrypto -mno-crypto -mdirect-move -mno-direct-move @gol
938 -mquad-memory -mno-quad-memory @gol
939 -mquad-memory-atomic -mno-quad-memory-atomic @gol
940 -mcompat-align-parm -mno-compat-align-parm}
942 @emph{RX Options}
943 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
944 -mcpu=@gol
945 -mbig-endian-data -mlittle-endian-data @gol
946 -msmall-data @gol
947 -msim  -mno-sim@gol
948 -mas100-syntax -mno-as100-syntax@gol
949 -mrelax@gol
950 -mmax-constant-size=@gol
951 -mint-register=@gol
952 -mpid@gol
953 -mno-warn-multiple-fast-interrupts@gol
954 -msave-acc-in-interrupts}
956 @emph{S/390 and zSeries Options}
957 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
958 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
959 -mlong-double-64 -mlong-double-128 @gol
960 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
961 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
962 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
963 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
964 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard @gol
965 -mhotpatch[=@var{halfwords}] -mno-hotpatch}
967 @emph{Score Options}
968 @gccoptlist{-meb -mel @gol
969 -mnhwloop @gol
970 -muls @gol
971 -mmac @gol
972 -mscore5 -mscore5u -mscore7 -mscore7d}
974 @emph{SH Options}
975 @gccoptlist{-m1  -m2  -m2e @gol
976 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
977 -m3  -m3e @gol
978 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
979 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
980 -m5-64media  -m5-64media-nofpu @gol
981 -m5-32media  -m5-32media-nofpu @gol
982 -m5-compact  -m5-compact-nofpu @gol
983 -mb  -ml  -mdalign  -mrelax @gol
984 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
985 -mieee -mno-ieee -mbitops  -misize  -minline-ic_invalidate -mpadstruct @gol
986 -mspace -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
987 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
988 -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
989 -maccumulate-outgoing-args -minvalid-symbols @gol
990 -matomic-model=@var{atomic-model} @gol
991 -mbranch-cost=@var{num} -mzdcbranch -mno-zdcbranch @gol
992 -mfused-madd -mno-fused-madd -mfsca -mno-fsca -mfsrra -mno-fsrra @gol
993 -mpretend-cmove -mtas}
995 @emph{Solaris 2 Options}
996 @gccoptlist{-mclear-hwcap -mno-clear-hwcap -mimpure-text  -mno-impure-text @gol
997 -pthreads -pthread}
999 @emph{SPARC Options}
1000 @gccoptlist{-mcpu=@var{cpu-type} @gol
1001 -mtune=@var{cpu-type} @gol
1002 -mcmodel=@var{code-model} @gol
1003 -mmemory-model=@var{mem-model} @gol
1004 -m32  -m64  -mapp-regs  -mno-app-regs @gol
1005 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
1006 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
1007 -mhard-quad-float  -msoft-quad-float @gol
1008 -mstack-bias  -mno-stack-bias @gol
1009 -munaligned-doubles  -mno-unaligned-doubles @gol
1010 -muser-mode  -mno-user-mode @gol
1011 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
1012 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
1013 -mcbcond -mno-cbcond @gol
1014 -mfmaf  -mno-fmaf  -mpopc  -mno-popc @gol
1015 -mfix-at697f -mfix-ut699}
1017 @emph{SPU Options}
1018 @gccoptlist{-mwarn-reloc -merror-reloc @gol
1019 -msafe-dma -munsafe-dma @gol
1020 -mbranch-hints @gol
1021 -msmall-mem -mlarge-mem -mstdmain @gol
1022 -mfixed-range=@var{register-range} @gol
1023 -mea32 -mea64 @gol
1024 -maddress-space-conversion -mno-address-space-conversion @gol
1025 -mcache-size=@var{cache-size} @gol
1026 -matomic-updates -mno-atomic-updates}
1028 @emph{System V Options}
1029 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
1031 @emph{TILE-Gx Options}
1032 @gccoptlist{-mcpu=CPU -m32 -m64 -mbig-endian -mlittle-endian @gol
1033 -mcmodel=@var{code-model}}
1035 @emph{TILEPro Options}
1036 @gccoptlist{-mcpu=@var{cpu} -m32}
1038 @emph{V850 Options}
1039 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
1040 -mprolog-function  -mno-prolog-function  -mspace @gol
1041 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
1042 -mapp-regs  -mno-app-regs @gol
1043 -mdisable-callt  -mno-disable-callt @gol
1044 -mv850e2v3 -mv850e2 -mv850e1 -mv850es @gol
1045 -mv850e -mv850 -mv850e3v5 @gol
1046 -mloop @gol
1047 -mrelax @gol
1048 -mlong-jumps @gol
1049 -msoft-float @gol
1050 -mhard-float @gol
1051 -mgcc-abi @gol
1052 -mrh850-abi @gol
1053 -mbig-switch}
1055 @emph{VAX Options}
1056 @gccoptlist{-mg  -mgnu  -munix}
1058 @emph{VMS Options}
1059 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64 @gol
1060 -mpointer-size=@var{size}}
1062 @emph{VxWorks Options}
1063 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
1064 -Xbind-lazy  -Xbind-now}
1066 @emph{x86-64 Options}
1067 See i386 and x86-64 Options.
1069 @emph{Xstormy16 Options}
1070 @gccoptlist{-msim}
1072 @emph{Xtensa Options}
1073 @gccoptlist{-mconst16 -mno-const16 @gol
1074 -mfused-madd  -mno-fused-madd @gol
1075 -mforce-no-pic @gol
1076 -mserialize-volatile  -mno-serialize-volatile @gol
1077 -mtext-section-literals  -mno-text-section-literals @gol
1078 -mtarget-align  -mno-target-align @gol
1079 -mlongcalls  -mno-longcalls}
1081 @emph{zSeries Options}
1082 See S/390 and zSeries Options.
1084 @item Code Generation Options
1085 @xref{Code Gen Options,,Options for Code Generation Conventions}.
1086 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
1087 -ffixed-@var{reg}  -fexceptions @gol
1088 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
1089 -fasynchronous-unwind-tables @gol
1090 -fno-gnu-unique @gol
1091 -finhibit-size-directive  -finstrument-functions @gol
1092 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
1093 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
1094 -fno-common  -fno-ident @gol
1095 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
1096 -fno-jump-tables @gol
1097 -frecord-gcc-switches @gol
1098 -freg-struct-return  -fshort-enums @gol
1099 -fshort-double  -fshort-wchar @gol
1100 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
1101 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
1102 -fno-stack-limit -fsplit-stack @gol
1103 -fleading-underscore  -ftls-model=@var{model} @gol
1104 -fstack-reuse=@var{reuse_level} @gol
1105 -ftrapv  -fwrapv  -fbounds-check @gol
1106 -fvisibility -fstrict-volatile-bitfields -fsync-libcalls}
1107 @end table
1110 @node Overall Options
1111 @section Options Controlling the Kind of Output
1113 Compilation can involve up to four stages: preprocessing, compilation
1114 proper, assembly and linking, always in that order.  GCC is capable of
1115 preprocessing and compiling several files either into several
1116 assembler input files, or into one assembler input file; then each
1117 assembler input file produces an object file, and linking combines all
1118 the object files (those newly compiled, and those specified as input)
1119 into an executable file.
1121 @cindex file name suffix
1122 For any given input file, the file name suffix determines what kind of
1123 compilation is done:
1125 @table @gcctabopt
1126 @item @var{file}.c
1127 C source code that must be preprocessed.
1129 @item @var{file}.i
1130 C source code that should not be preprocessed.
1132 @item @var{file}.ii
1133 C++ source code that should not be preprocessed.
1135 @item @var{file}.m
1136 Objective-C source code.  Note that you must link with the @file{libobjc}
1137 library to make an Objective-C program work.
1139 @item @var{file}.mi
1140 Objective-C source code that should not be preprocessed.
1142 @item @var{file}.mm
1143 @itemx @var{file}.M
1144 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1145 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1146 to a literal capital M@.
1148 @item @var{file}.mii
1149 Objective-C++ source code that should not be preprocessed.
1151 @item @var{file}.h
1152 C, C++, Objective-C or Objective-C++ header file to be turned into a
1153 precompiled header (default), or C, C++ header file to be turned into an
1154 Ada spec (via the @option{-fdump-ada-spec} switch).
1156 @item @var{file}.cc
1157 @itemx @var{file}.cp
1158 @itemx @var{file}.cxx
1159 @itemx @var{file}.cpp
1160 @itemx @var{file}.CPP
1161 @itemx @var{file}.c++
1162 @itemx @var{file}.C
1163 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1164 the last two letters must both be literally @samp{x}.  Likewise,
1165 @samp{.C} refers to a literal capital C@.
1167 @item @var{file}.mm
1168 @itemx @var{file}.M
1169 Objective-C++ source code that must be preprocessed.
1171 @item @var{file}.mii
1172 Objective-C++ source code that should not be preprocessed.
1174 @item @var{file}.hh
1175 @itemx @var{file}.H
1176 @itemx @var{file}.hp
1177 @itemx @var{file}.hxx
1178 @itemx @var{file}.hpp
1179 @itemx @var{file}.HPP
1180 @itemx @var{file}.h++
1181 @itemx @var{file}.tcc
1182 C++ header file to be turned into a precompiled header or Ada spec.
1184 @item @var{file}.f
1185 @itemx @var{file}.for
1186 @itemx @var{file}.ftn
1187 Fixed form Fortran source code that should not be preprocessed.
1189 @item @var{file}.F
1190 @itemx @var{file}.FOR
1191 @itemx @var{file}.fpp
1192 @itemx @var{file}.FPP
1193 @itemx @var{file}.FTN
1194 Fixed form Fortran source code that must be preprocessed (with the traditional
1195 preprocessor).
1197 @item @var{file}.f90
1198 @itemx @var{file}.f95
1199 @itemx @var{file}.f03
1200 @itemx @var{file}.f08
1201 Free form Fortran source code that should not be preprocessed.
1203 @item @var{file}.F90
1204 @itemx @var{file}.F95
1205 @itemx @var{file}.F03
1206 @itemx @var{file}.F08
1207 Free form Fortran source code that must be preprocessed (with the
1208 traditional preprocessor).
1210 @item @var{file}.go
1211 Go source code.
1213 @c FIXME: Descriptions of Java file types.
1214 @c @var{file}.java
1215 @c @var{file}.class
1216 @c @var{file}.zip
1217 @c @var{file}.jar
1219 @item @var{file}.ads
1220 Ada source code file that contains a library unit declaration (a
1221 declaration of a package, subprogram, or generic, or a generic
1222 instantiation), or a library unit renaming declaration (a package,
1223 generic, or subprogram renaming declaration).  Such files are also
1224 called @dfn{specs}.
1226 @item @var{file}.adb
1227 Ada source code file containing a library unit body (a subprogram or
1228 package body).  Such files are also called @dfn{bodies}.
1230 @c GCC also knows about some suffixes for languages not yet included:
1231 @c Pascal:
1232 @c @var{file}.p
1233 @c @var{file}.pas
1234 @c Ratfor:
1235 @c @var{file}.r
1237 @item @var{file}.s
1238 Assembler code.
1240 @item @var{file}.S
1241 @itemx @var{file}.sx
1242 Assembler code that must be preprocessed.
1244 @item @var{other}
1245 An object file to be fed straight into linking.
1246 Any file name with no recognized suffix is treated this way.
1247 @end table
1249 @opindex x
1250 You can specify the input language explicitly with the @option{-x} option:
1252 @table @gcctabopt
1253 @item -x @var{language}
1254 Specify explicitly the @var{language} for the following input files
1255 (rather than letting the compiler choose a default based on the file
1256 name suffix).  This option applies to all following input files until
1257 the next @option{-x} option.  Possible values for @var{language} are:
1258 @smallexample
1259 c  c-header  cpp-output
1260 c++  c++-header  c++-cpp-output
1261 objective-c  objective-c-header  objective-c-cpp-output
1262 objective-c++ objective-c++-header objective-c++-cpp-output
1263 assembler  assembler-with-cpp
1265 f77  f77-cpp-input f95  f95-cpp-input
1267 java
1268 @end smallexample
1270 @item -x none
1271 Turn off any specification of a language, so that subsequent files are
1272 handled according to their file name suffixes (as they are if @option{-x}
1273 has not been used at all).
1275 @item -pass-exit-codes
1276 @opindex pass-exit-codes
1277 Normally the @command{gcc} program exits with the code of 1 if any
1278 phase of the compiler returns a non-success return code.  If you specify
1279 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1280 the numerically highest error produced by any phase returning an error
1281 indication.  The C, C++, and Fortran front ends return 4 if an internal
1282 compiler error is encountered.
1283 @end table
1285 If you only want some of the stages of compilation, you can use
1286 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1287 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1288 @command{gcc} is to stop.  Note that some combinations (for example,
1289 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1291 @table @gcctabopt
1292 @item -c
1293 @opindex c
1294 Compile or assemble the source files, but do not link.  The linking
1295 stage simply is not done.  The ultimate output is in the form of an
1296 object file for each source file.
1298 By default, the object file name for a source file is made by replacing
1299 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1301 Unrecognized input files, not requiring compilation or assembly, are
1302 ignored.
1304 @item -S
1305 @opindex S
1306 Stop after the stage of compilation proper; do not assemble.  The output
1307 is in the form of an assembler code file for each non-assembler input
1308 file specified.
1310 By default, the assembler file name for a source file is made by
1311 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1313 Input files that don't require compilation are ignored.
1315 @item -E
1316 @opindex E
1317 Stop after the preprocessing stage; do not run the compiler proper.  The
1318 output is in the form of preprocessed source code, which is sent to the
1319 standard output.
1321 Input files that don't require preprocessing are ignored.
1323 @cindex output file option
1324 @item -o @var{file}
1325 @opindex o
1326 Place output in file @var{file}.  This applies to whatever
1327 sort of output is being produced, whether it be an executable file,
1328 an object file, an assembler file or preprocessed C code.
1330 If @option{-o} is not specified, the default is to put an executable
1331 file in @file{a.out}, the object file for
1332 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1333 assembler file in @file{@var{source}.s}, a precompiled header file in
1334 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1335 standard output.
1337 @item -v
1338 @opindex v
1339 Print (on standard error output) the commands executed to run the stages
1340 of compilation.  Also print the version number of the compiler driver
1341 program and of the preprocessor and the compiler proper.
1343 @item -###
1344 @opindex ###
1345 Like @option{-v} except the commands are not executed and arguments
1346 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1347 This is useful for shell scripts to capture the driver-generated command lines.
1349 @item -pipe
1350 @opindex pipe
1351 Use pipes rather than temporary files for communication between the
1352 various stages of compilation.  This fails to work on some systems where
1353 the assembler is unable to read from a pipe; but the GNU assembler has
1354 no trouble.
1356 @item --help
1357 @opindex help
1358 Print (on the standard output) a description of the command-line options
1359 understood by @command{gcc}.  If the @option{-v} option is also specified
1360 then @option{--help} is also passed on to the various processes
1361 invoked by @command{gcc}, so that they can display the command-line options
1362 they accept.  If the @option{-Wextra} option has also been specified
1363 (prior to the @option{--help} option), then command-line options that
1364 have no documentation associated with them are also displayed.
1366 @item --target-help
1367 @opindex target-help
1368 Print (on the standard output) a description of target-specific command-line
1369 options for each tool.  For some targets extra target-specific
1370 information may also be printed.
1372 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1373 Print (on the standard output) a description of the command-line
1374 options understood by the compiler that fit into all specified classes
1375 and qualifiers.  These are the supported classes:
1377 @table @asis
1378 @item @samp{optimizers}
1379 Display all of the optimization options supported by the
1380 compiler.
1382 @item @samp{warnings}
1383 Display all of the options controlling warning messages
1384 produced by the compiler.
1386 @item @samp{target}
1387 Display target-specific options.  Unlike the
1388 @option{--target-help} option however, target-specific options of the
1389 linker and assembler are not displayed.  This is because those
1390 tools do not currently support the extended @option{--help=} syntax.
1392 @item @samp{params}
1393 Display the values recognized by the @option{--param}
1394 option.
1396 @item @var{language}
1397 Display the options supported for @var{language}, where
1398 @var{language} is the name of one of the languages supported in this
1399 version of GCC@.
1401 @item @samp{common}
1402 Display the options that are common to all languages.
1403 @end table
1405 These are the supported qualifiers:
1407 @table @asis
1408 @item @samp{undocumented}
1409 Display only those options that are undocumented.
1411 @item @samp{joined}
1412 Display options taking an argument that appears after an equal
1413 sign in the same continuous piece of text, such as:
1414 @samp{--help=target}.
1416 @item @samp{separate}
1417 Display options taking an argument that appears as a separate word
1418 following the original option, such as: @samp{-o output-file}.
1419 @end table
1421 Thus for example to display all the undocumented target-specific
1422 switches supported by the compiler, use:
1424 @smallexample
1425 --help=target,undocumented
1426 @end smallexample
1428 The sense of a qualifier can be inverted by prefixing it with the
1429 @samp{^} character, so for example to display all binary warning
1430 options (i.e., ones that are either on or off and that do not take an
1431 argument) that have a description, use:
1433 @smallexample
1434 --help=warnings,^joined,^undocumented
1435 @end smallexample
1437 The argument to @option{--help=} should not consist solely of inverted
1438 qualifiers.
1440 Combining several classes is possible, although this usually
1441 restricts the output so much that there is nothing to display.  One
1442 case where it does work, however, is when one of the classes is
1443 @var{target}.  For example, to display all the target-specific
1444 optimization options, use:
1446 @smallexample
1447 --help=target,optimizers
1448 @end smallexample
1450 The @option{--help=} option can be repeated on the command line.  Each
1451 successive use displays its requested class of options, skipping
1452 those that have already been displayed.
1454 If the @option{-Q} option appears on the command line before the
1455 @option{--help=} option, then the descriptive text displayed by
1456 @option{--help=} is changed.  Instead of describing the displayed
1457 options, an indication is given as to whether the option is enabled,
1458 disabled or set to a specific value (assuming that the compiler
1459 knows this at the point where the @option{--help=} option is used).
1461 Here is a truncated example from the ARM port of @command{gcc}:
1463 @smallexample
1464   % gcc -Q -mabi=2 --help=target -c
1465   The following options are target specific:
1466   -mabi=                                2
1467   -mabort-on-noreturn                   [disabled]
1468   -mapcs                                [disabled]
1469 @end smallexample
1471 The output is sensitive to the effects of previous command-line
1472 options, so for example it is possible to find out which optimizations
1473 are enabled at @option{-O2} by using:
1475 @smallexample
1476 -Q -O2 --help=optimizers
1477 @end smallexample
1479 Alternatively you can discover which binary optimizations are enabled
1480 by @option{-O3} by using:
1482 @smallexample
1483 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1484 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1485 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1486 @end smallexample
1488 @item -no-canonical-prefixes
1489 @opindex no-canonical-prefixes
1490 Do not expand any symbolic links, resolve references to @samp{/../}
1491 or @samp{/./}, or make the path absolute when generating a relative
1492 prefix.
1494 @item --version
1495 @opindex version
1496 Display the version number and copyrights of the invoked GCC@.
1498 @item -wrapper
1499 @opindex wrapper
1500 Invoke all subcommands under a wrapper program.  The name of the
1501 wrapper program and its parameters are passed as a comma separated
1502 list.
1504 @smallexample
1505 gcc -c t.c -wrapper gdb,--args
1506 @end smallexample
1508 @noindent
1509 This invokes all subprograms of @command{gcc} under
1510 @samp{gdb --args}, thus the invocation of @command{cc1} is
1511 @samp{gdb --args cc1 @dots{}}.
1513 @item -fplugin=@var{name}.so
1514 @opindex fplugin
1515 Load the plugin code in file @var{name}.so, assumed to be a
1516 shared object to be dlopen'd by the compiler.  The base name of
1517 the shared object file is used to identify the plugin for the
1518 purposes of argument parsing (See
1519 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1520 Each plugin should define the callback functions specified in the
1521 Plugins API.
1523 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1524 @opindex fplugin-arg
1525 Define an argument called @var{key} with a value of @var{value}
1526 for the plugin called @var{name}.
1528 @item -fdump-ada-spec@r{[}-slim@r{]}
1529 @opindex fdump-ada-spec
1530 For C and C++ source and include files, generate corresponding Ada specs.
1531 @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1532 GNAT User's Guide}, which provides detailed documentation on this feature.
1534 @item -fada-spec-parent=@var{unit}
1535 @opindex fada-spec-parent
1536 In conjunction with @option{-fdump-ada-spec@r{[}-slim@r{]}} above, generate
1537 Ada specs as child units of parent @var{unit}.
1539 @item -fdump-go-spec=@var{file}
1540 @opindex fdump-go-spec
1541 For input files in any language, generate corresponding Go
1542 declarations in @var{file}.  This generates Go @code{const},
1543 @code{type}, @code{var}, and @code{func} declarations which may be a
1544 useful way to start writing a Go interface to code written in some
1545 other language.
1547 @include @value{srcdir}/../libiberty/at-file.texi
1548 @end table
1550 @node Invoking G++
1551 @section Compiling C++ Programs
1553 @cindex suffixes for C++ source
1554 @cindex C++ source file suffixes
1555 C++ source files conventionally use one of the suffixes @samp{.C},
1556 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1557 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1558 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1559 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1560 files with these names and compiles them as C++ programs even if you
1561 call the compiler the same way as for compiling C programs (usually
1562 with the name @command{gcc}).
1564 @findex g++
1565 @findex c++
1566 However, the use of @command{gcc} does not add the C++ library.
1567 @command{g++} is a program that calls GCC and automatically specifies linking
1568 against the C++ library.  It treats @samp{.c},
1569 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1570 files unless @option{-x} is used.  This program is also useful when
1571 precompiling a C header file with a @samp{.h} extension for use in C++
1572 compilations.  On many systems, @command{g++} is also installed with
1573 the name @command{c++}.
1575 @cindex invoking @command{g++}
1576 When you compile C++ programs, you may specify many of the same
1577 command-line options that you use for compiling programs in any
1578 language; or command-line options meaningful for C and related
1579 languages; or options that are meaningful only for C++ programs.
1580 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1581 explanations of options for languages related to C@.
1582 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1583 explanations of options that are meaningful only for C++ programs.
1585 @node C Dialect Options
1586 @section Options Controlling C Dialect
1587 @cindex dialect options
1588 @cindex language dialect options
1589 @cindex options, dialect
1591 The following options control the dialect of C (or languages derived
1592 from C, such as C++, Objective-C and Objective-C++) that the compiler
1593 accepts:
1595 @table @gcctabopt
1596 @cindex ANSI support
1597 @cindex ISO support
1598 @item -ansi
1599 @opindex ansi
1600 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1601 equivalent to @option{-std=c++98}.
1603 This turns off certain features of GCC that are incompatible with ISO
1604 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1605 such as the @code{asm} and @code{typeof} keywords, and
1606 predefined macros such as @code{unix} and @code{vax} that identify the
1607 type of system you are using.  It also enables the undesirable and
1608 rarely used ISO trigraph feature.  For the C compiler,
1609 it disables recognition of C++ style @samp{//} comments as well as
1610 the @code{inline} keyword.
1612 The alternate keywords @code{__asm__}, @code{__extension__},
1613 @code{__inline__} and @code{__typeof__} continue to work despite
1614 @option{-ansi}.  You would not want to use them in an ISO C program, of
1615 course, but it is useful to put them in header files that might be included
1616 in compilations done with @option{-ansi}.  Alternate predefined macros
1617 such as @code{__unix__} and @code{__vax__} are also available, with or
1618 without @option{-ansi}.
1620 The @option{-ansi} option does not cause non-ISO programs to be
1621 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1622 addition to @option{-ansi}.  @xref{Warning Options}.
1624 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1625 option is used.  Some header files may notice this macro and refrain
1626 from declaring certain functions or defining certain macros that the
1627 ISO standard doesn't call for; this is to avoid interfering with any
1628 programs that might use these names for other things.
1630 Functions that are normally built in but do not have semantics
1631 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1632 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1633 built-in functions provided by GCC}, for details of the functions
1634 affected.
1636 @item -std=
1637 @opindex std
1638 Determine the language standard. @xref{Standards,,Language Standards
1639 Supported by GCC}, for details of these standard versions.  This option
1640 is currently only supported when compiling C or C++.
1642 The compiler can accept several base standards, such as @samp{c90} or
1643 @samp{c++98}, and GNU dialects of those standards, such as
1644 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1645 compiler accepts all programs following that standard plus those
1646 using GNU extensions that do not contradict it.  For example,
1647 @option{-std=c90} turns off certain features of GCC that are
1648 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1649 keywords, but not other GNU extensions that do not have a meaning in
1650 ISO C90, such as omitting the middle term of a @code{?:}
1651 expression. On the other hand, when a GNU dialect of a standard is
1652 specified, all features supported by the compiler are enabled, even when
1653 those features change the meaning of the base standard.  As a result, some
1654 strict-conforming programs may be rejected.  The particular standard
1655 is used by @option{-Wpedantic} to identify which features are GNU
1656 extensions given that version of the standard. For example
1657 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1658 comments, while @option{-std=gnu99 -Wpedantic} does not.
1660 A value for this option must be provided; possible values are
1662 @table @samp
1663 @item c90
1664 @itemx c89
1665 @itemx iso9899:1990
1666 Support all ISO C90 programs (certain GNU extensions that conflict
1667 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1669 @item iso9899:199409
1670 ISO C90 as modified in amendment 1.
1672 @item c99
1673 @itemx c9x
1674 @itemx iso9899:1999
1675 @itemx iso9899:199x
1676 ISO C99.  This standard is substantially completely supported, modulo
1677 bugs, extended identifiers (supported except for corner cases when
1678 @option{-fextended-identifiers} is used) and floating-point issues
1679 (mainly but not entirely relating to optional C99 features from
1680 Annexes F and G).  See
1681 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1682 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1684 @item c11
1685 @itemx c1x
1686 @itemx iso9899:2011
1687 ISO C11, the 2011 revision of the ISO C standard.  This standard is
1688 substantially completely supported, modulo bugs, extended identifiers
1689 (supported except for corner cases when
1690 @option{-fextended-identifiers} is used), floating-point issues
1691 (mainly but not entirely relating to optional C11 features from
1692 Annexes F and G) and the optional Annexes K (Bounds-checking
1693 interfaces) and L (Analyzability).  The name @samp{c1x} is deprecated.
1695 @item gnu90
1696 @itemx gnu89
1697 GNU dialect of ISO C90 (including some C99 features).
1699 @item gnu99
1700 @itemx gnu9x
1701 GNU dialect of ISO C99.  The name @samp{gnu9x} is deprecated.
1703 @item gnu11
1704 @itemx gnu1x
1705 GNU dialect of ISO C11.  This is the default for C code.
1706 The name @samp{gnu1x} is deprecated.
1708 @item c++98
1709 @itemx c++03
1710 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1711 additional defect reports. Same as @option{-ansi} for C++ code.
1713 @item gnu++98
1714 @itemx gnu++03
1715 GNU dialect of @option{-std=c++98}.  This is the default for
1716 C++ code.
1718 @item c++11
1719 @itemx c++0x
1720 The 2011 ISO C++ standard plus amendments.
1721 The name @samp{c++0x} is deprecated.
1723 @item gnu++11
1724 @itemx gnu++0x
1725 GNU dialect of @option{-std=c++11}.
1726 The name @samp{gnu++0x} is deprecated.
1728 @item c++14
1729 @itemx c++1y
1730 The 2014 ISO C++ standard plus amendments.
1731 The name @samp{c++1y} is deprecated.
1733 @item gnu++14
1734 @itemx gnu++1y
1735 GNU dialect of @option{-std=c++14}.
1736 The name @samp{gnu++1y} is deprecated.
1738 @item c++1z
1739 The next revision of the ISO C++ standard, tentatively planned for
1740 2017.  Support is highly experimental, and will almost certainly
1741 change in incompatible ways in future releases.
1743 @item gnu++1z
1744 GNU dialect of @option{-std=c++1z}.  Support is highly experimental,
1745 and will almost certainly change in incompatible ways in future
1746 releases.
1747 @end table
1749 @item -fgnu89-inline
1750 @opindex fgnu89-inline
1751 The option @option{-fgnu89-inline} tells GCC to use the traditional
1752 GNU semantics for @code{inline} functions when in C99 mode.
1753 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1754 is accepted and ignored by GCC versions 4.1.3 up to but not including
1755 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1756 C99 mode.  Using this option is roughly equivalent to adding the
1757 @code{gnu_inline} function attribute to all inline functions
1758 (@pxref{Function Attributes}).
1760 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1761 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1762 specifies the default behavior).  This option was first supported in
1763 GCC 4.3.  This option is not supported in @option{-std=c90} or
1764 @option{-std=gnu90} mode.
1766 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1767 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1768 in effect for @code{inline} functions.  @xref{Common Predefined
1769 Macros,,,cpp,The C Preprocessor}.
1771 @item -aux-info @var{filename}
1772 @opindex aux-info
1773 Output to the given filename prototyped declarations for all functions
1774 declared and/or defined in a translation unit, including those in header
1775 files.  This option is silently ignored in any language other than C@.
1777 Besides declarations, the file indicates, in comments, the origin of
1778 each declaration (source file and line), whether the declaration was
1779 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1780 @samp{O} for old, respectively, in the first character after the line
1781 number and the colon), and whether it came from a declaration or a
1782 definition (@samp{C} or @samp{F}, respectively, in the following
1783 character).  In the case of function definitions, a K&R-style list of
1784 arguments followed by their declarations is also provided, inside
1785 comments, after the declaration.
1787 @item -fallow-parameterless-variadic-functions
1788 @opindex fallow-parameterless-variadic-functions
1789 Accept variadic functions without named parameters.
1791 Although it is possible to define such a function, this is not very
1792 useful as it is not possible to read the arguments.  This is only
1793 supported for C as this construct is allowed by C++.
1795 @item -fno-asm
1796 @opindex fno-asm
1797 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1798 keyword, so that code can use these words as identifiers.  You can use
1799 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1800 instead.  @option{-ansi} implies @option{-fno-asm}.
1802 In C++, this switch only affects the @code{typeof} keyword, since
1803 @code{asm} and @code{inline} are standard keywords.  You may want to
1804 use the @option{-fno-gnu-keywords} flag instead, which has the same
1805 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1806 switch only affects the @code{asm} and @code{typeof} keywords, since
1807 @code{inline} is a standard keyword in ISO C99.
1809 @item -fno-builtin
1810 @itemx -fno-builtin-@var{function}
1811 @opindex fno-builtin
1812 @cindex built-in functions
1813 Don't recognize built-in functions that do not begin with
1814 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1815 functions provided by GCC}, for details of the functions affected,
1816 including those which are not built-in functions when @option{-ansi} or
1817 @option{-std} options for strict ISO C conformance are used because they
1818 do not have an ISO standard meaning.
1820 GCC normally generates special code to handle certain built-in functions
1821 more efficiently; for instance, calls to @code{alloca} may become single
1822 instructions which adjust the stack directly, and calls to @code{memcpy}
1823 may become inline copy loops.  The resulting code is often both smaller
1824 and faster, but since the function calls no longer appear as such, you
1825 cannot set a breakpoint on those calls, nor can you change the behavior
1826 of the functions by linking with a different library.  In addition,
1827 when a function is recognized as a built-in function, GCC may use
1828 information about that function to warn about problems with calls to
1829 that function, or to generate more efficient code, even if the
1830 resulting code still contains calls to that function.  For example,
1831 warnings are given with @option{-Wformat} for bad calls to
1832 @code{printf} when @code{printf} is built in and @code{strlen} is
1833 known not to modify global memory.
1835 With the @option{-fno-builtin-@var{function}} option
1836 only the built-in function @var{function} is
1837 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1838 function is named that is not built-in in this version of GCC, this
1839 option is ignored.  There is no corresponding
1840 @option{-fbuiltin-@var{function}} option; if you wish to enable
1841 built-in functions selectively when using @option{-fno-builtin} or
1842 @option{-ffreestanding}, you may define macros such as:
1844 @smallexample
1845 #define abs(n)          __builtin_abs ((n))
1846 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1847 @end smallexample
1849 @item -fhosted
1850 @opindex fhosted
1851 @cindex hosted environment
1853 Assert that compilation targets a hosted environment.  This implies
1854 @option{-fbuiltin}.  A hosted environment is one in which the
1855 entire standard library is available, and in which @code{main} has a return
1856 type of @code{int}.  Examples are nearly everything except a kernel.
1857 This is equivalent to @option{-fno-freestanding}.
1859 @item -ffreestanding
1860 @opindex ffreestanding
1861 @cindex hosted environment
1863 Assert that compilation targets a freestanding environment.  This
1864 implies @option{-fno-builtin}.  A freestanding environment
1865 is one in which the standard library may not exist, and program startup may
1866 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1867 This is equivalent to @option{-fno-hosted}.
1869 @xref{Standards,,Language Standards Supported by GCC}, for details of
1870 freestanding and hosted environments.
1872 @item -fopenmp
1873 @opindex fopenmp
1874 @cindex OpenMP parallel
1875 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1876 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1877 compiler generates parallel code according to the OpenMP Application
1878 Program Interface v4.0 @w{@uref{http://www.openmp.org/}}.  This option
1879 implies @option{-pthread}, and thus is only supported on targets that
1880 have support for @option{-pthread}. @option{-fopenmp} implies
1881 @option{-fopenmp-simd}.
1883 @item -fopenmp-simd
1884 @opindex fopenmp-simd
1885 @cindex OpenMP SIMD
1886 @cindex SIMD
1887 Enable handling of OpenMP's SIMD directives with @code{#pragma omp}
1888 in C/C++ and @code{!$omp} in Fortran. Other OpenMP directives
1889 are ignored.
1891 @item -fcilkplus
1892 @opindex fcilkplus
1893 @cindex Enable Cilk Plus
1894 Enable the usage of Cilk Plus language extension features for C/C++.
1895 When the option @option{-fcilkplus} is specified, enable the usage of
1896 the Cilk Plus Language extension features for C/C++.  The present
1897 implementation follows ABI version 1.2.  This is an experimental
1898 feature that is only partially complete, and whose interface may
1899 change in future versions of GCC as the official specification
1900 changes.  Currently, all features but @code{_Cilk_for} have been
1901 implemented.
1903 @item -fgnu-tm
1904 @opindex fgnu-tm
1905 When the option @option{-fgnu-tm} is specified, the compiler
1906 generates code for the Linux variant of Intel's current Transactional
1907 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
1908 an experimental feature whose interface may change in future versions
1909 of GCC, as the official specification changes.  Please note that not
1910 all architectures are supported for this feature.
1912 For more information on GCC's support for transactional memory,
1913 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
1914 Transactional Memory Library}.
1916 Note that the transactional memory feature is not supported with
1917 non-call exceptions (@option{-fnon-call-exceptions}).
1919 @item -fms-extensions
1920 @opindex fms-extensions
1921 Accept some non-standard constructs used in Microsoft header files.
1923 In C++ code, this allows member names in structures to be similar
1924 to previous types declarations.
1926 @smallexample
1927 typedef int UOW;
1928 struct ABC @{
1929   UOW UOW;
1931 @end smallexample
1933 Some cases of unnamed fields in structures and unions are only
1934 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1935 fields within structs/unions}, for details.
1937 Note that this option is off for all targets but i?86 and x86_64
1938 targets using ms-abi.
1939 @item -fplan9-extensions
1940 Accept some non-standard constructs used in Plan 9 code.
1942 This enables @option{-fms-extensions}, permits passing pointers to
1943 structures with anonymous fields to functions that expect pointers to
1944 elements of the type of the field, and permits referring to anonymous
1945 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
1946 struct/union fields within structs/unions}, for details.  This is only
1947 supported for C, not C++.
1949 @item -trigraphs
1950 @opindex trigraphs
1951 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1952 options for strict ISO C conformance) implies @option{-trigraphs}.
1954 @cindex traditional C language
1955 @cindex C language, traditional
1956 @item -traditional
1957 @itemx -traditional-cpp
1958 @opindex traditional-cpp
1959 @opindex traditional
1960 Formerly, these options caused GCC to attempt to emulate a pre-standard
1961 C compiler.  They are now only supported with the @option{-E} switch.
1962 The preprocessor continues to support a pre-standard mode.  See the GNU
1963 CPP manual for details.
1965 @item -fcond-mismatch
1966 @opindex fcond-mismatch
1967 Allow conditional expressions with mismatched types in the second and
1968 third arguments.  The value of such an expression is void.  This option
1969 is not supported for C++.
1971 @item -flax-vector-conversions
1972 @opindex flax-vector-conversions
1973 Allow implicit conversions between vectors with differing numbers of
1974 elements and/or incompatible element types.  This option should not be
1975 used for new code.
1977 @item -funsigned-char
1978 @opindex funsigned-char
1979 Let the type @code{char} be unsigned, like @code{unsigned char}.
1981 Each kind of machine has a default for what @code{char} should
1982 be.  It is either like @code{unsigned char} by default or like
1983 @code{signed char} by default.
1985 Ideally, a portable program should always use @code{signed char} or
1986 @code{unsigned char} when it depends on the signedness of an object.
1987 But many programs have been written to use plain @code{char} and
1988 expect it to be signed, or expect it to be unsigned, depending on the
1989 machines they were written for.  This option, and its inverse, let you
1990 make such a program work with the opposite default.
1992 The type @code{char} is always a distinct type from each of
1993 @code{signed char} or @code{unsigned char}, even though its behavior
1994 is always just like one of those two.
1996 @item -fsigned-char
1997 @opindex fsigned-char
1998 Let the type @code{char} be signed, like @code{signed char}.
2000 Note that this is equivalent to @option{-fno-unsigned-char}, which is
2001 the negative form of @option{-funsigned-char}.  Likewise, the option
2002 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
2004 @item -fsigned-bitfields
2005 @itemx -funsigned-bitfields
2006 @itemx -fno-signed-bitfields
2007 @itemx -fno-unsigned-bitfields
2008 @opindex fsigned-bitfields
2009 @opindex funsigned-bitfields
2010 @opindex fno-signed-bitfields
2011 @opindex fno-unsigned-bitfields
2012 These options control whether a bit-field is signed or unsigned, when the
2013 declaration does not use either @code{signed} or @code{unsigned}.  By
2014 default, such a bit-field is signed, because this is consistent: the
2015 basic integer types such as @code{int} are signed types.
2016 @end table
2018 @node C++ Dialect Options
2019 @section Options Controlling C++ Dialect
2021 @cindex compiler options, C++
2022 @cindex C++ options, command-line
2023 @cindex options, C++
2024 This section describes the command-line options that are only meaningful
2025 for C++ programs.  You can also use most of the GNU compiler options
2026 regardless of what language your program is in.  For example, you
2027 might compile a file @code{firstClass.C} like this:
2029 @smallexample
2030 g++ -g -frepo -O -c firstClass.C
2031 @end smallexample
2033 @noindent
2034 In this example, only @option{-frepo} is an option meant
2035 only for C++ programs; you can use the other options with any
2036 language supported by GCC@.
2038 Here is a list of options that are @emph{only} for compiling C++ programs:
2040 @table @gcctabopt
2042 @item -fabi-version=@var{n}
2043 @opindex fabi-version
2044 Use version @var{n} of the C++ ABI@.  The default is version 0.
2046 Version 0 refers to the version conforming most closely to
2047 the C++ ABI specification.  Therefore, the ABI obtained using version 0
2048 will change in different versions of G++ as ABI bugs are fixed.
2050 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.  
2052 Version 2 is the version of the C++ ABI that first appeared in G++
2053 3.4, and was the default through G++ 4.9.
2055 Version 3 corrects an error in mangling a constant address as a
2056 template argument.
2058 Version 4, which first appeared in G++ 4.5, implements a standard
2059 mangling for vector types.
2061 Version 5, which first appeared in G++ 4.6, corrects the mangling of
2062 attribute const/volatile on function pointer types, decltype of a
2063 plain decl, and use of a function parameter in the declaration of
2064 another parameter.
2066 Version 6, which first appeared in G++ 4.7, corrects the promotion
2067 behavior of C++11 scoped enums and the mangling of template argument
2068 packs, const/static_cast, prefix ++ and --, and a class scope function
2069 used as a template argument.
2071 Version 7, which first appeared in G++ 4.8, that treats nullptr_t as a
2072 builtin type and corrects the mangling of lambdas in default argument
2073 scope.
2075 Version 8, which first appeared in G++ 4.9, corrects the substitution
2076 behavior of function types with function-cv-qualifiers.
2078 See also @option{-Wabi}.
2080 @item -fabi-compat-version=@var{n}
2081 @opindex fabi-compat-version
2082 Starting with GCC 4.5, on targets that support strong aliases, G++
2083 works around mangling changes by creating an alias with the correct
2084 mangled name when defining a symbol with an incorrect mangled name.
2085 This switch specifies which ABI version to use for the alias.
2087 With @option{-fabi-version=0} (the default), this defaults to 2.  If
2088 another ABI version is explicitly selected, this defaults to 0.
2090 The compatibility version is also set by @option{-Wabi=@var{n}}.
2092 @item -fno-access-control
2093 @opindex fno-access-control
2094 Turn off all access checking.  This switch is mainly useful for working
2095 around bugs in the access control code.
2097 @item -fcheck-new
2098 @opindex fcheck-new
2099 Check that the pointer returned by @code{operator new} is non-null
2100 before attempting to modify the storage allocated.  This check is
2101 normally unnecessary because the C++ standard specifies that
2102 @code{operator new} only returns @code{0} if it is declared
2103 @samp{throw()}, in which case the compiler always checks the
2104 return value even without this option.  In all other cases, when
2105 @code{operator new} has a non-empty exception specification, memory
2106 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
2107 @samp{new (nothrow)}.
2109 @item -fconstexpr-depth=@var{n}
2110 @opindex fconstexpr-depth
2111 Set the maximum nested evaluation depth for C++11 constexpr functions
2112 to @var{n}.  A limit is needed to detect endless recursion during
2113 constant expression evaluation.  The minimum specified by the standard
2114 is 512.
2116 @item -fdeduce-init-list
2117 @opindex fdeduce-init-list
2118 Enable deduction of a template type parameter as
2119 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
2121 @smallexample
2122 template <class T> auto forward(T t) -> decltype (realfn (t))
2124   return realfn (t);
2127 void f()
2129   forward(@{1,2@}); // call forward<std::initializer_list<int>>
2131 @end smallexample
2133 This deduction was implemented as a possible extension to the
2134 originally proposed semantics for the C++11 standard, but was not part
2135 of the final standard, so it is disabled by default.  This option is
2136 deprecated, and may be removed in a future version of G++.
2138 @item -ffriend-injection
2139 @opindex ffriend-injection
2140 Inject friend functions into the enclosing namespace, so that they are
2141 visible outside the scope of the class in which they are declared.
2142 Friend functions were documented to work this way in the old Annotated
2143 C++ Reference Manual, and versions of G++ before 4.1 always worked
2144 that way.  However, in ISO C++ a friend function that is not declared
2145 in an enclosing scope can only be found using argument dependent
2146 lookup.  This option causes friends to be injected as they were in
2147 earlier releases.
2149 This option is for compatibility, and may be removed in a future
2150 release of G++.
2152 @item -fno-elide-constructors
2153 @opindex fno-elide-constructors
2154 The C++ standard allows an implementation to omit creating a temporary
2155 that is only used to initialize another object of the same type.
2156 Specifying this option disables that optimization, and forces G++ to
2157 call the copy constructor in all cases.
2159 @item -fno-enforce-eh-specs
2160 @opindex fno-enforce-eh-specs
2161 Don't generate code to check for violation of exception specifications
2162 at run time.  This option violates the C++ standard, but may be useful
2163 for reducing code size in production builds, much like defining
2164 @samp{NDEBUG}.  This does not give user code permission to throw
2165 exceptions in violation of the exception specifications; the compiler
2166 still optimizes based on the specifications, so throwing an
2167 unexpected exception results in undefined behavior at run time.
2169 @item -fextern-tls-init
2170 @itemx -fno-extern-tls-init
2171 @opindex fextern-tls-init
2172 @opindex fno-extern-tls-init
2173 The C++11 and OpenMP standards allow @samp{thread_local} and
2174 @samp{threadprivate} variables to have dynamic (runtime)
2175 initialization.  To support this, any use of such a variable goes
2176 through a wrapper function that performs any necessary initialization.
2177 When the use and definition of the variable are in the same
2178 translation unit, this overhead can be optimized away, but when the
2179 use is in a different translation unit there is significant overhead
2180 even if the variable doesn't actually need dynamic initialization.  If
2181 the programmer can be sure that no use of the variable in a
2182 non-defining TU needs to trigger dynamic initialization (either
2183 because the variable is statically initialized, or a use of the
2184 variable in the defining TU will be executed before any uses in
2185 another TU), they can avoid this overhead with the
2186 @option{-fno-extern-tls-init} option.
2188 On targets that support symbol aliases, the default is
2189 @option{-fextern-tls-init}.  On targets that do not support symbol
2190 aliases, the default is @option{-fno-extern-tls-init}.
2192 @item -ffor-scope
2193 @itemx -fno-for-scope
2194 @opindex ffor-scope
2195 @opindex fno-for-scope
2196 If @option{-ffor-scope} is specified, the scope of variables declared in
2197 a @i{for-init-statement} is limited to the @samp{for} loop itself,
2198 as specified by the C++ standard.
2199 If @option{-fno-for-scope} is specified, the scope of variables declared in
2200 a @i{for-init-statement} extends to the end of the enclosing scope,
2201 as was the case in old versions of G++, and other (traditional)
2202 implementations of C++.
2204 If neither flag is given, the default is to follow the standard,
2205 but to allow and give a warning for old-style code that would
2206 otherwise be invalid, or have different behavior.
2208 @item -fno-gnu-keywords
2209 @opindex fno-gnu-keywords
2210 Do not recognize @code{typeof} as a keyword, so that code can use this
2211 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2212 @option{-ansi} implies @option{-fno-gnu-keywords}.
2214 @item -fno-implicit-templates
2215 @opindex fno-implicit-templates
2216 Never emit code for non-inline templates that are instantiated
2217 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2218 @xref{Template Instantiation}, for more information.
2220 @item -fno-implicit-inline-templates
2221 @opindex fno-implicit-inline-templates
2222 Don't emit code for implicit instantiations of inline templates, either.
2223 The default is to handle inlines differently so that compiles with and
2224 without optimization need the same set of explicit instantiations.
2226 @item -fno-implement-inlines
2227 @opindex fno-implement-inlines
2228 To save space, do not emit out-of-line copies of inline functions
2229 controlled by @samp{#pragma implementation}.  This causes linker
2230 errors if these functions are not inlined everywhere they are called.
2232 @item -fms-extensions
2233 @opindex fms-extensions
2234 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2235 int and getting a pointer to member function via non-standard syntax.
2237 @item -fno-nonansi-builtins
2238 @opindex fno-nonansi-builtins
2239 Disable built-in declarations of functions that are not mandated by
2240 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2241 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2243 @item -fnothrow-opt
2244 @opindex fnothrow-opt
2245 Treat a @code{throw()} exception specification as if it were a
2246 @code{noexcept} specification to reduce or eliminate the text size
2247 overhead relative to a function with no exception specification.  If
2248 the function has local variables of types with non-trivial
2249 destructors, the exception specification actually makes the
2250 function smaller because the EH cleanups for those variables can be
2251 optimized away.  The semantic effect is that an exception thrown out of
2252 a function with such an exception specification results in a call
2253 to @code{terminate} rather than @code{unexpected}.
2255 @item -fno-operator-names
2256 @opindex fno-operator-names
2257 Do not treat the operator name keywords @code{and}, @code{bitand},
2258 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2259 synonyms as keywords.
2261 @item -fno-optional-diags
2262 @opindex fno-optional-diags
2263 Disable diagnostics that the standard says a compiler does not need to
2264 issue.  Currently, the only such diagnostic issued by G++ is the one for
2265 a name having multiple meanings within a class.
2267 @item -fpermissive
2268 @opindex fpermissive
2269 Downgrade some diagnostics about nonconformant code from errors to
2270 warnings.  Thus, using @option{-fpermissive} allows some
2271 nonconforming code to compile.
2273 @item -fno-pretty-templates
2274 @opindex fno-pretty-templates
2275 When an error message refers to a specialization of a function
2276 template, the compiler normally prints the signature of the
2277 template followed by the template arguments and any typedefs or
2278 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2279 rather than @code{void f(int)}) so that it's clear which template is
2280 involved.  When an error message refers to a specialization of a class
2281 template, the compiler omits any template arguments that match
2282 the default template arguments for that template.  If either of these
2283 behaviors make it harder to understand the error message rather than
2284 easier, you can use @option{-fno-pretty-templates} to disable them.
2286 @item -frepo
2287 @opindex frepo
2288 Enable automatic template instantiation at link time.  This option also
2289 implies @option{-fno-implicit-templates}.  @xref{Template
2290 Instantiation}, for more information.
2292 @item -fno-rtti
2293 @opindex fno-rtti
2294 Disable generation of information about every class with virtual
2295 functions for use by the C++ run-time type identification features
2296 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
2297 of the language, you can save some space by using this flag.  Note that
2298 exception handling uses the same information, but G++ generates it as
2299 needed. The @samp{dynamic_cast} operator can still be used for casts that
2300 do not require run-time type information, i.e.@: casts to @code{void *} or to
2301 unambiguous base classes.
2303 @item -fstats
2304 @opindex fstats
2305 Emit statistics about front-end processing at the end of the compilation.
2306 This information is generally only useful to the G++ development team.
2308 @item -fstrict-enums
2309 @opindex fstrict-enums
2310 Allow the compiler to optimize using the assumption that a value of
2311 enumerated type can only be one of the values of the enumeration (as
2312 defined in the C++ standard; basically, a value that can be
2313 represented in the minimum number of bits needed to represent all the
2314 enumerators).  This assumption may not be valid if the program uses a
2315 cast to convert an arbitrary integer value to the enumerated type.
2317 @item -ftemplate-backtrace-limit=@var{n}
2318 @opindex ftemplate-backtrace-limit
2319 Set the maximum number of template instantiation notes for a single
2320 warning or error to @var{n}.  The default value is 10.
2322 @item -ftemplate-depth=@var{n}
2323 @opindex ftemplate-depth
2324 Set the maximum instantiation depth for template classes to @var{n}.
2325 A limit on the template instantiation depth is needed to detect
2326 endless recursions during template class instantiation.  ANSI/ISO C++
2327 conforming programs must not rely on a maximum depth greater than 17
2328 (changed to 1024 in C++11).  The default value is 900, as the compiler
2329 can run out of stack space before hitting 1024 in some situations.
2331 @item -fno-threadsafe-statics
2332 @opindex fno-threadsafe-statics
2333 Do not emit the extra code to use the routines specified in the C++
2334 ABI for thread-safe initialization of local statics.  You can use this
2335 option to reduce code size slightly in code that doesn't need to be
2336 thread-safe.
2338 @item -fuse-cxa-atexit
2339 @opindex fuse-cxa-atexit
2340 Register destructors for objects with static storage duration with the
2341 @code{__cxa_atexit} function rather than the @code{atexit} function.
2342 This option is required for fully standards-compliant handling of static
2343 destructors, but only works if your C library supports
2344 @code{__cxa_atexit}.
2346 @item -fno-use-cxa-get-exception-ptr
2347 @opindex fno-use-cxa-get-exception-ptr
2348 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2349 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2350 if the runtime routine is not available.
2352 @item -fvisibility-inlines-hidden
2353 @opindex fvisibility-inlines-hidden
2354 This switch declares that the user does not attempt to compare
2355 pointers to inline functions or methods where the addresses of the two functions
2356 are taken in different shared objects.
2358 The effect of this is that GCC may, effectively, mark inline methods with
2359 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2360 appear in the export table of a DSO and do not require a PLT indirection
2361 when used within the DSO@.  Enabling this option can have a dramatic effect
2362 on load and link times of a DSO as it massively reduces the size of the
2363 dynamic export table when the library makes heavy use of templates.
2365 The behavior of this switch is not quite the same as marking the
2366 methods as hidden directly, because it does not affect static variables
2367 local to the function or cause the compiler to deduce that
2368 the function is defined in only one shared object.
2370 You may mark a method as having a visibility explicitly to negate the
2371 effect of the switch for that method.  For example, if you do want to
2372 compare pointers to a particular inline method, you might mark it as
2373 having default visibility.  Marking the enclosing class with explicit
2374 visibility has no effect.
2376 Explicitly instantiated inline methods are unaffected by this option
2377 as their linkage might otherwise cross a shared library boundary.
2378 @xref{Template Instantiation}.
2380 @item -fvisibility-ms-compat
2381 @opindex fvisibility-ms-compat
2382 This flag attempts to use visibility settings to make GCC's C++
2383 linkage model compatible with that of Microsoft Visual Studio.
2385 The flag makes these changes to GCC's linkage model:
2387 @enumerate
2388 @item
2389 It sets the default visibility to @code{hidden}, like
2390 @option{-fvisibility=hidden}.
2392 @item
2393 Types, but not their members, are not hidden by default.
2395 @item
2396 The One Definition Rule is relaxed for types without explicit
2397 visibility specifications that are defined in more than one
2398 shared object: those declarations are permitted if they are
2399 permitted when this option is not used.
2400 @end enumerate
2402 In new code it is better to use @option{-fvisibility=hidden} and
2403 export those classes that are intended to be externally visible.
2404 Unfortunately it is possible for code to rely, perhaps accidentally,
2405 on the Visual Studio behavior.
2407 Among the consequences of these changes are that static data members
2408 of the same type with the same name but defined in different shared
2409 objects are different, so changing one does not change the other;
2410 and that pointers to function members defined in different shared
2411 objects may not compare equal.  When this flag is given, it is a
2412 violation of the ODR to define types with the same name differently.
2414 @item -fvtable-verify=@var{std|preinit|none}
2415 @opindex fvtable-verify
2416 Turn on (or off, if using @option{-fvtable-verify=none}) the security
2417 feature that verifies at runtime, for every virtual call that is made, that
2418 the vtable pointer through which the call is made is valid for the type of
2419 the object, and has not been corrupted or overwritten.  If an invalid vtable
2420 pointer is detected (at runtime), an error is reported and execution of the
2421 program is immediately halted.
2423 This option causes runtime data structures to be built, at program start up,
2424 for verifying the vtable pointers.  The options @code{std} and @code{preinit}
2425 control the timing of when these data structures are built.  In both cases the
2426 data structures are built before execution reaches 'main'.  The
2427 @option{-fvtable-verify=std} causes these data structure to be built after the
2428 shared libraries have been loaded and initialized.
2429 @option{-fvtable-verify=preinit} causes them to be built before the shared
2430 libraries have been loaded and initialized.
2432 If this option appears multiple times in the compiler line, with different
2433 values specified, 'none' will take highest priority over both 'std' and
2434 'preinit'; 'preinit' will take priority over 'std'.
2436 @item -fvtv-debug
2437 @opindex (fvtv-debug)
2438 Causes debug versions of the runtime functions for the vtable verification 
2439 feature to be called.  This assumes the @option{-fvtable-verify=std} or
2440 @option{-fvtable-verify=preinit} has been used.  This flag will also cause the
2441 compiler to keep track of which vtable pointers it found for each class, and
2442 record that information in the file ``vtv_set_ptr_data.log'', in the dump
2443 file directory on the user's machine.
2445 Note:  This feature APPENDS data to the log file. If you want a fresh log
2446 file, be sure to delete any existing one.
2448 @item -fvtv-counts
2449 @opindex fvtv-counts
2450 This is a debugging flag.  When used in conjunction with
2451 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
2452 causes the compiler to keep track of the total number of virtual calls
2453 it encountered and the number of verifications it inserted.  It also
2454 counts the number of calls to certain runtime library functions
2455 that it inserts.  This information, for each compilation unit, is written
2456 to a file named ``vtv_count_data.log'', in the dump_file directory on
2457 the user's machine.   It also counts the size of the vtable pointer sets
2458 for each class, and writes this information to ``vtv_class_set_sizes.log''
2459 in the same directory.
2461 Note:  This feature APPENDS data to the log files.  To get a fresh log
2462 files, be sure to delete any existing ones.
2464 @item -fno-weak
2465 @opindex fno-weak
2466 Do not use weak symbol support, even if it is provided by the linker.
2467 By default, G++ uses weak symbols if they are available.  This
2468 option exists only for testing, and should not be used by end-users;
2469 it results in inferior code and has no benefits.  This option may
2470 be removed in a future release of G++.
2472 @item -nostdinc++
2473 @opindex nostdinc++
2474 Do not search for header files in the standard directories specific to
2475 C++, but do still search the other standard directories.  (This option
2476 is used when building the C++ library.)
2477 @end table
2479 In addition, these optimization, warning, and code generation options
2480 have meanings only for C++ programs:
2482 @table @gcctabopt
2483 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2484 @opindex Wabi
2485 @opindex Wno-abi
2486 When an explicit @option{-fabi-version=@var{n}} option is used, causes
2487 G++ to warn when it generates code that is probably not compatible with the
2488 vendor-neutral C++ ABI@.  Since G++ now defaults to
2489 @option{-fabi-version=0}, @option{-Wabi} has no effect unless either
2490 an older ABI version is selected (with @option{-fabi-version=@var{n}})
2491 or an older compatibility version is selected (with
2492 @option{-Wabi=@var{n}} or @option{-fabi-compat-version=@var{n}}).
2494 Although an effort has been made to warn about
2495 all such cases, there are probably some cases that are not warned about,
2496 even though G++ is generating incompatible code.  There may also be
2497 cases where warnings are emitted even though the code that is generated
2498 is compatible.
2500 You should rewrite your code to avoid these warnings if you are
2501 concerned about the fact that code generated by G++ may not be binary
2502 compatible with code generated by other compilers.
2504 @option{-Wabi} can also be used with an explicit version number to
2505 warn about compatibility with a particular @option{-fabi-version}
2506 level, e.g. @option{-Wabi=2} to warn about changes relative to
2507 @option{-fabi-version=2}.  Specifying a version number also sets
2508 @option{-fabi-compat-version=@var{n}}.
2510 The known incompatibilities in @option{-fabi-version=2} (which was the
2511 default from GCC 3.4 to 4.9) include:
2513 @itemize @bullet
2515 @item
2516 A template with a non-type template parameter of reference type was
2517 mangled incorrectly:
2518 @smallexample
2519 extern int N;
2520 template <int &> struct S @{@};
2521 void n (S<N>) @{2@}
2522 @end smallexample
2524 This was fixed in @option{-fabi-version=3}.
2526 @item
2527 SIMD vector types declared using @code{__attribute ((vector_size))} were
2528 mangled in a non-standard way that does not allow for overloading of
2529 functions taking vectors of different sizes.
2531 The mangling was changed in @option{-fabi-version=4}.
2533 @item
2534 @code{__attribute ((const))} and @code{noreturn} were mangled as type
2535 qualifiers, and @code{decltype} of a plain declaration was folded away.
2537 These mangling issues were fixed in @option{-fabi-version=5}.
2539 @item
2540 Scoped enumerators passed as arguments to a variadic function are
2541 promoted like unscoped enumerators, causing @samp{va_arg} to complain.
2542 On most targets this does not actually affect the parameter passing
2543 ABI, as there is no way to pass an argument smaller than @samp{int}.
2545 Also, the ABI changed the mangling of template argument packs,
2546 @code{const_cast}, @code{static_cast}, prefix increment/decrement, and
2547 a class scope function used as a template argument.
2549 These issues were corrected in @option{-fabi-version=6}.
2551 @item
2552 Lambdas in default argument scope were mangled incorrectly, and the
2553 ABI changed the mangling of nullptr_t.
2555 These issues were corrected in @option{-fabi-version=7}.
2557 @item
2558 When mangling a function type with function-cv-qualifiers, the
2559 un-qualified function type was incorrectly treated as a substitution
2560 candidate.
2562 This was fixed in @option{-fabi-version=8}.
2563 @end itemize
2565 It also warns about psABI-related changes.  The known psABI changes at this
2566 point include:
2568 @itemize @bullet
2570 @item
2571 For SysV/x86-64, unions with @code{long double} members are 
2572 passed in memory as specified in psABI.  For example:
2574 @smallexample
2575 union U @{
2576   long double ld;
2577   int i;
2579 @end smallexample
2581 @noindent
2582 @code{union U} is always passed in memory.
2584 @end itemize
2586 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2587 @opindex Wctor-dtor-privacy
2588 @opindex Wno-ctor-dtor-privacy
2589 Warn when a class seems unusable because all the constructors or
2590 destructors in that class are private, and it has neither friends nor
2591 public static member functions.  Also warn if there are no non-private
2592 methods, and there's at least one private member function that isn't
2593 a constructor or destructor.
2595 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2596 @opindex Wdelete-non-virtual-dtor
2597 @opindex Wno-delete-non-virtual-dtor
2598 Warn when @samp{delete} is used to destroy an instance of a class that
2599 has virtual functions and non-virtual destructor. It is unsafe to delete
2600 an instance of a derived class through a pointer to a base class if the
2601 base class does not have a virtual destructor.  This warning is enabled
2602 by @option{-Wall}.
2604 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
2605 @opindex Wliteral-suffix
2606 @opindex Wno-literal-suffix
2607 Warn when a string or character literal is followed by a ud-suffix which does
2608 not begin with an underscore.  As a conforming extension, GCC treats such
2609 suffixes as separate preprocessing tokens in order to maintain backwards
2610 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
2611 For example:
2613 @smallexample
2614 #define __STDC_FORMAT_MACROS
2615 #include <inttypes.h>
2616 #include <stdio.h>
2618 int main() @{
2619   int64_t i64 = 123;
2620   printf("My int64: %"PRId64"\n", i64);
2622 @end smallexample
2624 In this case, @code{PRId64} is treated as a separate preprocessing token.
2626 This warning is enabled by default.
2628 @item -Wnarrowing @r{(C++ and Objective-C++ only)}
2629 @opindex Wnarrowing
2630 @opindex Wno-narrowing
2631 Warn when a narrowing conversion prohibited by C++11 occurs within
2632 @samp{@{ @}}, e.g.
2634 @smallexample
2635 int i = @{ 2.2 @}; // error: narrowing from double to int
2636 @end smallexample
2638 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2640 With @option{-std=c++11}, @option{-Wno-narrowing} suppresses for
2641 non-constants the diagnostic required by the standard.  Note that this
2642 does not affect the meaning of well-formed code; narrowing conversions
2643 are still considered ill-formed in SFINAE context.
2645 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2646 @opindex Wnoexcept
2647 @opindex Wno-noexcept
2648 Warn when a noexcept-expression evaluates to false because of a call
2649 to a function that does not have a non-throwing exception
2650 specification (i.e. @samp{throw()} or @samp{noexcept}) but is known by
2651 the compiler to never throw an exception.
2653 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2654 @opindex Wnon-virtual-dtor
2655 @opindex Wno-non-virtual-dtor
2656 Warn when a class has virtual functions and an accessible non-virtual
2657 destructor itself or in an accessible polymorphic base class, in which
2658 case it is possible but unsafe to delete an instance of a derived
2659 class through a pointer to the class itself or base class.  This
2660 warning is automatically enabled if @option{-Weffc++} is specified.
2662 @item -Wreorder @r{(C++ and Objective-C++ only)}
2663 @opindex Wreorder
2664 @opindex Wno-reorder
2665 @cindex reordering, warning
2666 @cindex warning for reordering of member initializers
2667 Warn when the order of member initializers given in the code does not
2668 match the order in which they must be executed.  For instance:
2670 @smallexample
2671 struct A @{
2672   int i;
2673   int j;
2674   A(): j (0), i (1) @{ @}
2676 @end smallexample
2678 @noindent
2679 The compiler rearranges the member initializers for @samp{i}
2680 and @samp{j} to match the declaration order of the members, emitting
2681 a warning to that effect.  This warning is enabled by @option{-Wall}.
2683 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
2684 @opindex fext-numeric-literals
2685 @opindex fno-ext-numeric-literals
2686 Accept imaginary, fixed-point, or machine-defined
2687 literal number suffixes as GNU extensions.
2688 When this option is turned off these suffixes are treated
2689 as C++11 user-defined literal numeric suffixes.
2690 This is on by default for all pre-C++11 dialects and all GNU dialects:
2691 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
2692 @option{-std=gnu++14}.
2693 This option is off by default
2694 for ISO C++11 onwards (@option{-std=c++11}, ...).
2695 @end table
2697 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2699 @table @gcctabopt
2700 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2701 @opindex Weffc++
2702 @opindex Wno-effc++
2703 Warn about violations of the following style guidelines from Scott Meyers'
2704 @cite{Effective C++} series of books:
2706 @itemize @bullet
2707 @item
2708 Define a copy constructor and an assignment operator for classes
2709 with dynamically-allocated memory.
2711 @item
2712 Prefer initialization to assignment in constructors.
2714 @item
2715 Have @code{operator=} return a reference to @code{*this}.
2717 @item
2718 Don't try to return a reference when you must return an object.
2720 @item
2721 Distinguish between prefix and postfix forms of increment and
2722 decrement operators.
2724 @item
2725 Never overload @code{&&}, @code{||}, or @code{,}.
2727 @end itemize
2729 This option also enables @option{-Wnon-virtual-dtor}, which is also
2730 one of the effective C++ recommendations.  However, the check is
2731 extended to warn about the lack of virtual destructor in accessible
2732 non-polymorphic bases classes too.
2734 When selecting this option, be aware that the standard library
2735 headers do not obey all of these guidelines; use @samp{grep -v}
2736 to filter out those warnings.
2738 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2739 @opindex Wstrict-null-sentinel
2740 @opindex Wno-strict-null-sentinel
2741 Warn about the use of an uncasted @code{NULL} as sentinel.  When
2742 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2743 to @code{__null}.  Although it is a null pointer constant rather than a
2744 null pointer, it is guaranteed to be of the same size as a pointer.
2745 But this use is not portable across different compilers.
2747 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2748 @opindex Wno-non-template-friend
2749 @opindex Wnon-template-friend
2750 Disable warnings when non-templatized friend functions are declared
2751 within a template.  Since the advent of explicit template specification
2752 support in G++, if the name of the friend is an unqualified-id (i.e.,
2753 @samp{friend foo(int)}), the C++ language specification demands that the
2754 friend declare or define an ordinary, nontemplate function.  (Section
2755 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2756 could be interpreted as a particular specialization of a templatized
2757 function.  Because this non-conforming behavior is no longer the default
2758 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2759 check existing code for potential trouble spots and is on by default.
2760 This new compiler behavior can be turned off with
2761 @option{-Wno-non-template-friend}, which keeps the conformant compiler code
2762 but disables the helpful warning.
2764 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2765 @opindex Wold-style-cast
2766 @opindex Wno-old-style-cast
2767 Warn if an old-style (C-style) cast to a non-void type is used within
2768 a C++ program.  The new-style casts (@samp{dynamic_cast},
2769 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2770 less vulnerable to unintended effects and much easier to search for.
2772 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2773 @opindex Woverloaded-virtual
2774 @opindex Wno-overloaded-virtual
2775 @cindex overloaded virtual function, warning
2776 @cindex warning for overloaded virtual function
2777 Warn when a function declaration hides virtual functions from a
2778 base class.  For example, in:
2780 @smallexample
2781 struct A @{
2782   virtual void f();
2785 struct B: public A @{
2786   void f(int);
2788 @end smallexample
2790 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2791 like:
2793 @smallexample
2794 B* b;
2795 b->f();
2796 @end smallexample
2798 @noindent
2799 fails to compile.
2801 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2802 @opindex Wno-pmf-conversions
2803 @opindex Wpmf-conversions
2804 Disable the diagnostic for converting a bound pointer to member function
2805 to a plain pointer.
2807 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2808 @opindex Wsign-promo
2809 @opindex Wno-sign-promo
2810 Warn when overload resolution chooses a promotion from unsigned or
2811 enumerated type to a signed type, over a conversion to an unsigned type of
2812 the same size.  Previous versions of G++ tried to preserve
2813 unsignedness, but the standard mandates the current behavior.
2814 @end table
2816 @node Objective-C and Objective-C++ Dialect Options
2817 @section Options Controlling Objective-C and Objective-C++ Dialects
2819 @cindex compiler options, Objective-C and Objective-C++
2820 @cindex Objective-C and Objective-C++ options, command-line
2821 @cindex options, Objective-C and Objective-C++
2822 (NOTE: This manual does not describe the Objective-C and Objective-C++
2823 languages themselves.  @xref{Standards,,Language Standards
2824 Supported by GCC}, for references.)
2826 This section describes the command-line options that are only meaningful
2827 for Objective-C and Objective-C++ programs.  You can also use most of
2828 the language-independent GNU compiler options.
2829 For example, you might compile a file @code{some_class.m} like this:
2831 @smallexample
2832 gcc -g -fgnu-runtime -O -c some_class.m
2833 @end smallexample
2835 @noindent
2836 In this example, @option{-fgnu-runtime} is an option meant only for
2837 Objective-C and Objective-C++ programs; you can use the other options with
2838 any language supported by GCC@.
2840 Note that since Objective-C is an extension of the C language, Objective-C
2841 compilations may also use options specific to the C front-end (e.g.,
2842 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2843 C++-specific options (e.g., @option{-Wabi}).
2845 Here is a list of options that are @emph{only} for compiling Objective-C
2846 and Objective-C++ programs:
2848 @table @gcctabopt
2849 @item -fconstant-string-class=@var{class-name}
2850 @opindex fconstant-string-class
2851 Use @var{class-name} as the name of the class to instantiate for each
2852 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2853 class name is @code{NXConstantString} if the GNU runtime is being used, and
2854 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2855 @option{-fconstant-cfstrings} option, if also present, overrides the
2856 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2857 to be laid out as constant CoreFoundation strings.
2859 @item -fgnu-runtime
2860 @opindex fgnu-runtime
2861 Generate object code compatible with the standard GNU Objective-C
2862 runtime.  This is the default for most types of systems.
2864 @item -fnext-runtime
2865 @opindex fnext-runtime
2866 Generate output compatible with the NeXT runtime.  This is the default
2867 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2868 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2869 used.
2871 @item -fno-nil-receivers
2872 @opindex fno-nil-receivers
2873 Assume that all Objective-C message dispatches (@code{[receiver
2874 message:arg]}) in this translation unit ensure that the receiver is
2875 not @code{nil}.  This allows for more efficient entry points in the
2876 runtime to be used.  This option is only available in conjunction with
2877 the NeXT runtime and ABI version 0 or 1.
2879 @item -fobjc-abi-version=@var{n}
2880 @opindex fobjc-abi-version
2881 Use version @var{n} of the Objective-C ABI for the selected runtime.
2882 This option is currently supported only for the NeXT runtime.  In that
2883 case, Version 0 is the traditional (32-bit) ABI without support for
2884 properties and other Objective-C 2.0 additions.  Version 1 is the
2885 traditional (32-bit) ABI with support for properties and other
2886 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
2887 nothing is specified, the default is Version 0 on 32-bit target
2888 machines, and Version 2 on 64-bit target machines.
2890 @item -fobjc-call-cxx-cdtors
2891 @opindex fobjc-call-cxx-cdtors
2892 For each Objective-C class, check if any of its instance variables is a
2893 C++ object with a non-trivial default constructor.  If so, synthesize a
2894 special @code{- (id) .cxx_construct} instance method which runs
2895 non-trivial default constructors on any such instance variables, in order,
2896 and then return @code{self}.  Similarly, check if any instance variable
2897 is a C++ object with a non-trivial destructor, and if so, synthesize a
2898 special @code{- (void) .cxx_destruct} method which runs
2899 all such default destructors, in reverse order.
2901 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
2902 methods thusly generated only operate on instance variables
2903 declared in the current Objective-C class, and not those inherited
2904 from superclasses.  It is the responsibility of the Objective-C
2905 runtime to invoke all such methods in an object's inheritance
2906 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
2907 by the runtime immediately after a new object instance is allocated;
2908 the @code{- (void) .cxx_destruct} methods are invoked immediately
2909 before the runtime deallocates an object instance.
2911 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2912 support for invoking the @code{- (id) .cxx_construct} and
2913 @code{- (void) .cxx_destruct} methods.
2915 @item -fobjc-direct-dispatch
2916 @opindex fobjc-direct-dispatch
2917 Allow fast jumps to the message dispatcher.  On Darwin this is
2918 accomplished via the comm page.
2920 @item -fobjc-exceptions
2921 @opindex fobjc-exceptions
2922 Enable syntactic support for structured exception handling in
2923 Objective-C, similar to what is offered by C++ and Java.  This option
2924 is required to use the Objective-C keywords @code{@@try},
2925 @code{@@throw}, @code{@@catch}, @code{@@finally} and
2926 @code{@@synchronized}.  This option is available with both the GNU
2927 runtime and the NeXT runtime (but not available in conjunction with
2928 the NeXT runtime on Mac OS X 10.2 and earlier).
2930 @item -fobjc-gc
2931 @opindex fobjc-gc
2932 Enable garbage collection (GC) in Objective-C and Objective-C++
2933 programs.  This option is only available with the NeXT runtime; the
2934 GNU runtime has a different garbage collection implementation that
2935 does not require special compiler flags.
2937 @item -fobjc-nilcheck
2938 @opindex fobjc-nilcheck
2939 For the NeXT runtime with version 2 of the ABI, check for a nil
2940 receiver in method invocations before doing the actual method call.
2941 This is the default and can be disabled using
2942 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
2943 checked for nil in this way no matter what this flag is set to.
2944 Currently this flag does nothing when the GNU runtime, or an older
2945 version of the NeXT runtime ABI, is used.
2947 @item -fobjc-std=objc1
2948 @opindex fobjc-std
2949 Conform to the language syntax of Objective-C 1.0, the language
2950 recognized by GCC 4.0.  This only affects the Objective-C additions to
2951 the C/C++ language; it does not affect conformance to C/C++ standards,
2952 which is controlled by the separate C/C++ dialect option flags.  When
2953 this option is used with the Objective-C or Objective-C++ compiler,
2954 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
2955 This is useful if you need to make sure that your Objective-C code can
2956 be compiled with older versions of GCC@.
2958 @item -freplace-objc-classes
2959 @opindex freplace-objc-classes
2960 Emit a special marker instructing @command{ld(1)} not to statically link in
2961 the resulting object file, and allow @command{dyld(1)} to load it in at
2962 run time instead.  This is used in conjunction with the Fix-and-Continue
2963 debugging mode, where the object file in question may be recompiled and
2964 dynamically reloaded in the course of program execution, without the need
2965 to restart the program itself.  Currently, Fix-and-Continue functionality
2966 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2967 and later.
2969 @item -fzero-link
2970 @opindex fzero-link
2971 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2972 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2973 compile time) with static class references that get initialized at load time,
2974 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2975 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2976 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2977 for individual class implementations to be modified during program execution.
2978 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
2979 regardless of command-line options.
2981 @item -fno-local-ivars
2982 @opindex fno-local-ivars
2983 @opindex flocal-ivars
2984 By default instance variables in Objective-C can be accessed as if
2985 they were local variables from within the methods of the class they're
2986 declared in.  This can lead to shadowing between instance variables
2987 and other variables declared either locally inside a class method or
2988 globally with the same name.  Specifying the @option{-fno-local-ivars}
2989 flag disables this behavior thus avoiding variable shadowing issues.
2991 @item -fivar-visibility=@var{public|protected|private|package}
2992 @opindex fivar-visibility
2993 Set the default instance variable visibility to the specified option
2994 so that instance variables declared outside the scope of any access
2995 modifier directives default to the specified visibility.
2997 @item -gen-decls
2998 @opindex gen-decls
2999 Dump interface declarations for all classes seen in the source file to a
3000 file named @file{@var{sourcename}.decl}.
3002 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
3003 @opindex Wassign-intercept
3004 @opindex Wno-assign-intercept
3005 Warn whenever an Objective-C assignment is being intercepted by the
3006 garbage collector.
3008 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
3009 @opindex Wno-protocol
3010 @opindex Wprotocol
3011 If a class is declared to implement a protocol, a warning is issued for
3012 every method in the protocol that is not implemented by the class.  The
3013 default behavior is to issue a warning for every method not explicitly
3014 implemented in the class, even if a method implementation is inherited
3015 from the superclass.  If you use the @option{-Wno-protocol} option, then
3016 methods inherited from the superclass are considered to be implemented,
3017 and no warning is issued for them.
3019 @item -Wselector @r{(Objective-C and Objective-C++ only)}
3020 @opindex Wselector
3021 @opindex Wno-selector
3022 Warn if multiple methods of different types for the same selector are
3023 found during compilation.  The check is performed on the list of methods
3024 in the final stage of compilation.  Additionally, a check is performed
3025 for each selector appearing in a @code{@@selector(@dots{})}
3026 expression, and a corresponding method for that selector has been found
3027 during compilation.  Because these checks scan the method table only at
3028 the end of compilation, these warnings are not produced if the final
3029 stage of compilation is not reached, for example because an error is
3030 found during compilation, or because the @option{-fsyntax-only} option is
3031 being used.
3033 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
3034 @opindex Wstrict-selector-match
3035 @opindex Wno-strict-selector-match
3036 Warn if multiple methods with differing argument and/or return types are
3037 found for a given selector when attempting to send a message using this
3038 selector to a receiver of type @code{id} or @code{Class}.  When this flag
3039 is off (which is the default behavior), the compiler omits such warnings
3040 if any differences found are confined to types that share the same size
3041 and alignment.
3043 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
3044 @opindex Wundeclared-selector
3045 @opindex Wno-undeclared-selector
3046 Warn if a @code{@@selector(@dots{})} expression referring to an
3047 undeclared selector is found.  A selector is considered undeclared if no
3048 method with that name has been declared before the
3049 @code{@@selector(@dots{})} expression, either explicitly in an
3050 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
3051 an @code{@@implementation} section.  This option always performs its
3052 checks as soon as a @code{@@selector(@dots{})} expression is found,
3053 while @option{-Wselector} only performs its checks in the final stage of
3054 compilation.  This also enforces the coding style convention
3055 that methods and selectors must be declared before being used.
3057 @item -print-objc-runtime-info
3058 @opindex print-objc-runtime-info
3059 Generate C header describing the largest structure that is passed by
3060 value, if any.
3062 @end table
3064 @node Language Independent Options
3065 @section Options to Control Diagnostic Messages Formatting
3066 @cindex options to control diagnostics formatting
3067 @cindex diagnostic messages
3068 @cindex message formatting
3070 Traditionally, diagnostic messages have been formatted irrespective of
3071 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
3072 options described below
3073 to control the formatting algorithm for diagnostic messages, 
3074 e.g.@: how many characters per line, how often source location
3075 information should be reported.  Note that some language front ends may not
3076 honor these options.
3078 @table @gcctabopt
3079 @item -fmessage-length=@var{n}
3080 @opindex fmessage-length
3081 Try to format error messages so that they fit on lines of about
3082 @var{n} characters.  If @var{n} is zero, then no line-wrapping will be
3083 done; each error message will appear on a single line.  This is the
3084 default for all front ends.
3086 @item -fdiagnostics-show-location=once
3087 @opindex fdiagnostics-show-location
3088 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
3089 reporter to emit source location information @emph{once}; that is, in
3090 case the message is too long to fit on a single physical line and has to
3091 be wrapped, the source location won't be emitted (as prefix) again,
3092 over and over, in subsequent continuation lines.  This is the default
3093 behavior.
3095 @item -fdiagnostics-show-location=every-line
3096 Only meaningful in line-wrapping mode.  Instructs the diagnostic
3097 messages reporter to emit the same source location information (as
3098 prefix) for physical lines that result from the process of breaking
3099 a message which is too long to fit on a single line.
3101 @item -fdiagnostics-color[=@var{WHEN}]
3102 @itemx -fno-diagnostics-color
3103 @opindex fdiagnostics-color
3104 @cindex highlight, color, colour
3105 @vindex GCC_COLORS @r{environment variable}
3106 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
3107 or @samp{auto}.  The default is @samp{never} if @env{GCC_COLORS} environment
3108 variable isn't present in the environment, and @samp{auto} otherwise.
3109 @samp{auto} means to use color only when the standard error is a terminal.
3110 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
3111 aliases for @option{-fdiagnostics-color=always} and
3112 @option{-fdiagnostics-color=never}, respectively.
3114 The colors are defined by the environment variable @env{GCC_COLORS}.
3115 Its value is a colon-separated list of capabilities and Select Graphic
3116 Rendition (SGR) substrings. SGR commands are interpreted by the
3117 terminal or terminal emulator.  (See the section in the documentation
3118 of your text terminal for permitted values and their meanings as
3119 character attributes.)  These substring values are integers in decimal
3120 representation and can be concatenated with semicolons.
3121 Common values to concatenate include
3122 @samp{1} for bold,
3123 @samp{4} for underline,
3124 @samp{5} for blink,
3125 @samp{7} for inverse,
3126 @samp{39} for default foreground color,
3127 @samp{30} to @samp{37} for foreground colors,
3128 @samp{90} to @samp{97} for 16-color mode foreground colors,
3129 @samp{38;5;0} to @samp{38;5;255}
3130 for 88-color and 256-color modes foreground colors,
3131 @samp{49} for default background color,
3132 @samp{40} to @samp{47} for background colors,
3133 @samp{100} to @samp{107} for 16-color mode background colors,
3134 and @samp{48;5;0} to @samp{48;5;255}
3135 for 88-color and 256-color modes background colors.
3137 The default @env{GCC_COLORS} is
3138 @samp{error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01}
3139 where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
3140 @samp{01;36} is bold cyan, @samp{01;32} is bold green and
3141 @samp{01} is bold. Setting @env{GCC_COLORS} to the empty
3142 string disables colors.
3143 Supported capabilities are as follows.
3145 @table @code
3146 @item error=
3147 @vindex error GCC_COLORS @r{capability}
3148 SGR substring for error: markers.
3150 @item warning=
3151 @vindex warning GCC_COLORS @r{capability}
3152 SGR substring for warning: markers.
3154 @item note=
3155 @vindex note GCC_COLORS @r{capability}
3156 SGR substring for note: markers.
3158 @item caret=
3159 @vindex caret GCC_COLORS @r{capability}
3160 SGR substring for caret line.
3162 @item locus=
3163 @vindex locus GCC_COLORS @r{capability}
3164 SGR substring for location information, @samp{file:line} or
3165 @samp{file:line:column} etc.
3167 @item quote=
3168 @vindex quote GCC_COLORS @r{capability}
3169 SGR substring for information printed within quotes.
3170 @end table
3172 @item -fno-diagnostics-show-option
3173 @opindex fno-diagnostics-show-option
3174 @opindex fdiagnostics-show-option
3175 By default, each diagnostic emitted includes text indicating the
3176 command-line option that directly controls the diagnostic (if such an
3177 option is known to the diagnostic machinery).  Specifying the
3178 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
3180 @item -fno-diagnostics-show-caret
3181 @opindex fno-diagnostics-show-caret
3182 @opindex fdiagnostics-show-caret
3183 By default, each diagnostic emitted includes the original source line
3184 and a caret '^' indicating the column.  This option suppresses this
3185 information.
3187 @end table
3189 @node Warning Options
3190 @section Options to Request or Suppress Warnings
3191 @cindex options to control warnings
3192 @cindex warning messages
3193 @cindex messages, warning
3194 @cindex suppressing warnings
3196 Warnings are diagnostic messages that report constructions that
3197 are not inherently erroneous but that are risky or suggest there
3198 may have been an error.
3200 The following language-independent options do not enable specific
3201 warnings but control the kinds of diagnostics produced by GCC@.
3203 @table @gcctabopt
3204 @cindex syntax checking
3205 @item -fsyntax-only
3206 @opindex fsyntax-only
3207 Check the code for syntax errors, but don't do anything beyond that.
3209 @item -fmax-errors=@var{n}
3210 @opindex fmax-errors
3211 Limits the maximum number of error messages to @var{n}, at which point
3212 GCC bails out rather than attempting to continue processing the source
3213 code.  If @var{n} is 0 (the default), there is no limit on the number
3214 of error messages produced.  If @option{-Wfatal-errors} is also
3215 specified, then @option{-Wfatal-errors} takes precedence over this
3216 option.
3218 @item -w
3219 @opindex w
3220 Inhibit all warning messages.
3222 @item -Werror
3223 @opindex Werror
3224 @opindex Wno-error
3225 Make all warnings into errors.
3227 @item -Werror=
3228 @opindex Werror=
3229 @opindex Wno-error=
3230 Make the specified warning into an error.  The specifier for a warning
3231 is appended; for example @option{-Werror=switch} turns the warnings
3232 controlled by @option{-Wswitch} into errors.  This switch takes a
3233 negative form, to be used to negate @option{-Werror} for specific
3234 warnings; for example @option{-Wno-error=switch} makes
3235 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3236 is in effect.
3238 The warning message for each controllable warning includes the
3239 option that controls the warning.  That option can then be used with
3240 @option{-Werror=} and @option{-Wno-error=} as described above.
3241 (Printing of the option in the warning message can be disabled using the
3242 @option{-fno-diagnostics-show-option} flag.)
3244 Note that specifying @option{-Werror=}@var{foo} automatically implies
3245 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3246 imply anything.
3248 @item -Wfatal-errors
3249 @opindex Wfatal-errors
3250 @opindex Wno-fatal-errors
3251 This option causes the compiler to abort compilation on the first error
3252 occurred rather than trying to keep going and printing further error
3253 messages.
3255 @end table
3257 You can request many specific warnings with options beginning with
3258 @samp{-W}, for example @option{-Wimplicit} to request warnings on
3259 implicit declarations.  Each of these specific warning options also
3260 has a negative form beginning @samp{-Wno-} to turn off warnings; for
3261 example, @option{-Wno-implicit}.  This manual lists only one of the
3262 two forms, whichever is not the default.  For further
3263 language-specific options also refer to @ref{C++ Dialect Options} and
3264 @ref{Objective-C and Objective-C++ Dialect Options}.
3266 Some options, such as @option{-Wall} and @option{-Wextra}, turn on other
3267 options, such as @option{-Wunused}, which may turn on further options,
3268 such as @option{-Wunused-value}. The combined effect of positive and
3269 negative forms is that more specific options have priority over less
3270 specific ones, independently of their position in the command-line. For
3271 options of the same specificity, the last one takes effect. Options
3272 enabled or disabled via pragmas (@pxref{Diagnostic Pragmas}) take effect
3273 as if they appeared at the end of the command-line.
3275 When an unrecognized warning option is requested (e.g.,
3276 @option{-Wunknown-warning}), GCC emits a diagnostic stating
3277 that the option is not recognized.  However, if the @option{-Wno-} form
3278 is used, the behavior is slightly different: no diagnostic is
3279 produced for @option{-Wno-unknown-warning} unless other diagnostics
3280 are being produced.  This allows the use of new @option{-Wno-} options
3281 with old compilers, but if something goes wrong, the compiler
3282 warns that an unrecognized option is present.
3284 @table @gcctabopt
3285 @item -Wpedantic
3286 @itemx -pedantic
3287 @opindex pedantic
3288 @opindex Wpedantic
3289 Issue all the warnings demanded by strict ISO C and ISO C++;
3290 reject all programs that use forbidden extensions, and some other
3291 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
3292 version of the ISO C standard specified by any @option{-std} option used.
3294 Valid ISO C and ISO C++ programs should compile properly with or without
3295 this option (though a rare few require @option{-ansi} or a
3296 @option{-std} option specifying the required version of ISO C)@.  However,
3297 without this option, certain GNU extensions and traditional C and C++
3298 features are supported as well.  With this option, they are rejected.
3300 @option{-Wpedantic} does not cause warning messages for use of the
3301 alternate keywords whose names begin and end with @samp{__}.  Pedantic
3302 warnings are also disabled in the expression that follows
3303 @code{__extension__}.  However, only system header files should use
3304 these escape routes; application programs should avoid them.
3305 @xref{Alternate Keywords}.
3307 Some users try to use @option{-Wpedantic} to check programs for strict ISO
3308 C conformance.  They soon find that it does not do quite what they want:
3309 it finds some non-ISO practices, but not all---only those for which
3310 ISO C @emph{requires} a diagnostic, and some others for which
3311 diagnostics have been added.
3313 A feature to report any failure to conform to ISO C might be useful in
3314 some instances, but would require considerable additional work and would
3315 be quite different from @option{-Wpedantic}.  We don't have plans to
3316 support such a feature in the near future.
3318 Where the standard specified with @option{-std} represents a GNU
3319 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3320 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3321 extended dialect is based.  Warnings from @option{-Wpedantic} are given
3322 where they are required by the base standard.  (It does not make sense
3323 for such warnings to be given only for features not in the specified GNU
3324 C dialect, since by definition the GNU dialects of C include all
3325 features the compiler supports with the given option, and there would be
3326 nothing to warn about.)
3328 @item -pedantic-errors
3329 @opindex pedantic-errors
3330 Give an error whenever the @dfn{base standard} (see @option{-Wpedantic})
3331 requires a diagnostic, in some cases where there is undefined behavior
3332 at compile-time and in some other cases that do not prevent compilation
3333 of programs that are valid according to the standard. This is not
3334 equivalent to @option{-Werror=pedantic}, since there are errors enabled
3335 by this option and not enabled by the latter and vice versa.
3337 @item -Wall
3338 @opindex Wall
3339 @opindex Wno-all
3340 This enables all the warnings about constructions that some users
3341 consider questionable, and that are easy to avoid (or modify to
3342 prevent the warning), even in conjunction with macros.  This also
3343 enables some language-specific warnings described in @ref{C++ Dialect
3344 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3346 @option{-Wall} turns on the following warning flags:
3348 @gccoptlist{-Waddress   @gol
3349 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
3350 -Wc++11-compat  @gol
3351 -Wchar-subscripts  @gol
3352 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
3353 -Wimplicit-int @r{(C and Objective-C only)} @gol
3354 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3355 -Wcomment  @gol
3356 -Wformat   @gol
3357 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3358 -Wmaybe-uninitialized @gol
3359 -Wmissing-braces @r{(only for C/ObjC)} @gol
3360 -Wnonnull  @gol
3361 -Wopenmp-simd @gol
3362 -Wparentheses  @gol
3363 -Wpointer-sign  @gol
3364 -Wreorder   @gol
3365 -Wreturn-type  @gol
3366 -Wsequence-point  @gol
3367 -Wsign-compare @r{(only in C++)}  @gol
3368 -Wstrict-aliasing  @gol
3369 -Wstrict-overflow=1  @gol
3370 -Wswitch  @gol
3371 -Wtrigraphs  @gol
3372 -Wuninitialized  @gol
3373 -Wunknown-pragmas  @gol
3374 -Wunused-function  @gol
3375 -Wunused-label     @gol
3376 -Wunused-value     @gol
3377 -Wunused-variable  @gol
3378 -Wvolatile-register-var @gol
3381 Note that some warning flags are not implied by @option{-Wall}.  Some of
3382 them warn about constructions that users generally do not consider
3383 questionable, but which occasionally you might wish to check for;
3384 others warn about constructions that are necessary or hard to avoid in
3385 some cases, and there is no simple way to modify the code to suppress
3386 the warning. Some of them are enabled by @option{-Wextra} but many of
3387 them must be enabled individually.
3389 @item -Wextra
3390 @opindex W
3391 @opindex Wextra
3392 @opindex Wno-extra
3393 This enables some extra warning flags that are not enabled by
3394 @option{-Wall}. (This option used to be called @option{-W}.  The older
3395 name is still supported, but the newer name is more descriptive.)
3397 @gccoptlist{-Wclobbered  @gol
3398 -Wempty-body  @gol
3399 -Wignored-qualifiers @gol
3400 -Wmissing-field-initializers  @gol
3401 -Wmissing-parameter-type @r{(C only)}  @gol
3402 -Wold-style-declaration @r{(C only)}  @gol
3403 -Woverride-init  @gol
3404 -Wsign-compare  @gol
3405 -Wtype-limits  @gol
3406 -Wuninitialized  @gol
3407 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3408 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3411 The option @option{-Wextra} also prints warning messages for the
3412 following cases:
3414 @itemize @bullet
3416 @item
3417 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3418 @samp{>}, or @samp{>=}.
3420 @item
3421 (C++ only) An enumerator and a non-enumerator both appear in a
3422 conditional expression.
3424 @item
3425 (C++ only) Ambiguous virtual bases.
3427 @item
3428 (C++ only) Subscripting an array that has been declared @samp{register}.
3430 @item
3431 (C++ only) Taking the address of a variable that has been declared
3432 @samp{register}.
3434 @item
3435 (C++ only) A base class is not initialized in a derived class's copy
3436 constructor.
3438 @end itemize
3440 @item -Wchar-subscripts
3441 @opindex Wchar-subscripts
3442 @opindex Wno-char-subscripts
3443 Warn if an array subscript has type @code{char}.  This is a common cause
3444 of error, as programmers often forget that this type is signed on some
3445 machines.
3446 This warning is enabled by @option{-Wall}.
3448 @item -Wcomment
3449 @opindex Wcomment
3450 @opindex Wno-comment
3451 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3452 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3453 This warning is enabled by @option{-Wall}.
3455 @item -Wno-coverage-mismatch
3456 @opindex Wno-coverage-mismatch
3457 Warn if feedback profiles do not match when using the
3458 @option{-fprofile-use} option.
3459 If a source file is changed between compiling with @option{-fprofile-gen} and
3460 with @option{-fprofile-use}, the files with the profile feedback can fail
3461 to match the source file and GCC cannot use the profile feedback
3462 information.  By default, this warning is enabled and is treated as an
3463 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3464 warning or @option{-Wno-error=coverage-mismatch} can be used to
3465 disable the error.  Disabling the error for this warning can result in
3466 poorly optimized code and is useful only in the
3467 case of very minor changes such as bug fixes to an existing code-base.
3468 Completely disabling the warning is not recommended.
3470 @item -Wno-cpp
3471 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3473 Suppress warning messages emitted by @code{#warning} directives.
3475 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3476 @opindex Wdouble-promotion
3477 @opindex Wno-double-promotion
3478 Give a warning when a value of type @code{float} is implicitly
3479 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3480 floating-point unit implement @code{float} in hardware, but emulate
3481 @code{double} in software.  On such a machine, doing computations
3482 using @code{double} values is much more expensive because of the
3483 overhead required for software emulation.
3485 It is easy to accidentally do computations with @code{double} because
3486 floating-point literals are implicitly of type @code{double}.  For
3487 example, in:
3488 @smallexample
3489 @group
3490 float area(float radius)
3492    return 3.14159 * radius * radius;
3494 @end group
3495 @end smallexample
3496 the compiler performs the entire computation with @code{double}
3497 because the floating-point literal is a @code{double}.
3499 @item -Wformat
3500 @itemx -Wformat=@var{n}
3501 @opindex Wformat
3502 @opindex Wno-format
3503 @opindex ffreestanding
3504 @opindex fno-builtin
3505 @opindex Wformat=
3506 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3507 the arguments supplied have types appropriate to the format string
3508 specified, and that the conversions specified in the format string make
3509 sense.  This includes standard functions, and others specified by format
3510 attributes (@pxref{Function Attributes}), in the @code{printf},
3511 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3512 not in the C standard) families (or other target-specific families).
3513 Which functions are checked without format attributes having been
3514 specified depends on the standard version selected, and such checks of
3515 functions without the attribute specified are disabled by
3516 @option{-ffreestanding} or @option{-fno-builtin}.
3518 The formats are checked against the format features supported by GNU
3519 libc version 2.2.  These include all ISO C90 and C99 features, as well
3520 as features from the Single Unix Specification and some BSD and GNU
3521 extensions.  Other library implementations may not support all these
3522 features; GCC does not support warning about features that go beyond a
3523 particular library's limitations.  However, if @option{-Wpedantic} is used
3524 with @option{-Wformat}, warnings are given about format features not
3525 in the selected standard version (but not for @code{strfmon} formats,
3526 since those are not in any version of the C standard).  @xref{C Dialect
3527 Options,,Options Controlling C Dialect}.
3529 @table @gcctabopt
3530 @item -Wformat=1
3531 @itemx -Wformat
3532 @opindex Wformat
3533 @opindex Wformat=1
3534 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
3535 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
3536 @option{-Wformat} also checks for null format arguments for several
3537 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
3538 aspects of this level of format checking can be disabled by the
3539 options: @option{-Wno-format-contains-nul},
3540 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
3541 @option{-Wformat} is enabled by @option{-Wall}.
3543 @item -Wno-format-contains-nul
3544 @opindex Wno-format-contains-nul
3545 @opindex Wformat-contains-nul
3546 If @option{-Wformat} is specified, do not warn about format strings that
3547 contain NUL bytes.
3549 @item -Wno-format-extra-args
3550 @opindex Wno-format-extra-args
3551 @opindex Wformat-extra-args
3552 If @option{-Wformat} is specified, do not warn about excess arguments to a
3553 @code{printf} or @code{scanf} format function.  The C standard specifies
3554 that such arguments are ignored.
3556 Where the unused arguments lie between used arguments that are
3557 specified with @samp{$} operand number specifications, normally
3558 warnings are still given, since the implementation could not know what
3559 type to pass to @code{va_arg} to skip the unused arguments.  However,
3560 in the case of @code{scanf} formats, this option suppresses the
3561 warning if the unused arguments are all pointers, since the Single
3562 Unix Specification says that such unused arguments are allowed.
3564 @item -Wno-format-zero-length
3565 @opindex Wno-format-zero-length
3566 @opindex Wformat-zero-length
3567 If @option{-Wformat} is specified, do not warn about zero-length formats.
3568 The C standard specifies that zero-length formats are allowed.
3571 @item -Wformat=2
3572 @opindex Wformat=2
3573 Enable @option{-Wformat} plus additional format checks.  Currently
3574 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
3575 -Wformat-signedness -Wformat-y2k}.
3577 @item -Wformat-nonliteral
3578 @opindex Wformat-nonliteral
3579 @opindex Wno-format-nonliteral
3580 If @option{-Wformat} is specified, also warn if the format string is not a
3581 string literal and so cannot be checked, unless the format function
3582 takes its format arguments as a @code{va_list}.
3584 @item -Wformat-security
3585 @opindex Wformat-security
3586 @opindex Wno-format-security
3587 If @option{-Wformat} is specified, also warn about uses of format
3588 functions that represent possible security problems.  At present, this
3589 warns about calls to @code{printf} and @code{scanf} functions where the
3590 format string is not a string literal and there are no format arguments,
3591 as in @code{printf (foo);}.  This may be a security hole if the format
3592 string came from untrusted input and contains @samp{%n}.  (This is
3593 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3594 in future warnings may be added to @option{-Wformat-security} that are not
3595 included in @option{-Wformat-nonliteral}.)
3597 @item -Wformat-signedness
3598 @opindex Wformat-signedness
3599 @opindex Wno-format-signedness
3600 If @option{-Wformat} is specified, also warn if the format string
3601 requires an unsigned argument and the argument is signed and vice versa.
3603 @item -Wformat-y2k
3604 @opindex Wformat-y2k
3605 @opindex Wno-format-y2k
3606 If @option{-Wformat} is specified, also warn about @code{strftime}
3607 formats that may yield only a two-digit year.
3608 @end table
3610 @item -Wnonnull
3611 @opindex Wnonnull
3612 @opindex Wno-nonnull
3613 Warn about passing a null pointer for arguments marked as
3614 requiring a non-null value by the @code{nonnull} function attribute.
3616 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3617 can be disabled with the @option{-Wno-nonnull} option.
3619 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3620 @opindex Winit-self
3621 @opindex Wno-init-self
3622 Warn about uninitialized variables that are initialized with themselves.
3623 Note this option can only be used with the @option{-Wuninitialized} option.
3625 For example, GCC warns about @code{i} being uninitialized in the
3626 following snippet only when @option{-Winit-self} has been specified:
3627 @smallexample
3628 @group
3629 int f()
3631   int i = i;
3632   return i;
3634 @end group
3635 @end smallexample
3637 This warning is enabled by @option{-Wall} in C++.
3639 @item -Wimplicit-int @r{(C and Objective-C only)}
3640 @opindex Wimplicit-int
3641 @opindex Wno-implicit-int
3642 Warn when a declaration does not specify a type.
3643 This warning is enabled by @option{-Wall}.
3645 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3646 @opindex Wimplicit-function-declaration
3647 @opindex Wno-implicit-function-declaration
3648 Give a warning whenever a function is used before being declared. In
3649 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3650 enabled by default and it is made into an error by
3651 @option{-pedantic-errors}. This warning is also enabled by
3652 @option{-Wall}.
3654 @item -Wimplicit @r{(C and Objective-C only)}
3655 @opindex Wimplicit
3656 @opindex Wno-implicit
3657 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3658 This warning is enabled by @option{-Wall}.
3660 @item -Wignored-qualifiers @r{(C and C++ only)}
3661 @opindex Wignored-qualifiers
3662 @opindex Wno-ignored-qualifiers
3663 Warn if the return type of a function has a type qualifier
3664 such as @code{const}.  For ISO C such a type qualifier has no effect,
3665 since the value returned by a function is not an lvalue.
3666 For C++, the warning is only emitted for scalar types or @code{void}.
3667 ISO C prohibits qualified @code{void} return types on function
3668 definitions, so such return types always receive a warning
3669 even without this option.
3671 This warning is also enabled by @option{-Wextra}.
3673 @item -Wmain
3674 @opindex Wmain
3675 @opindex Wno-main
3676 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3677 a function with external linkage, returning int, taking either zero
3678 arguments, two, or three arguments of appropriate types.  This warning
3679 is enabled by default in C++ and is enabled by either @option{-Wall}
3680 or @option{-Wpedantic}.
3682 @item -Wmissing-braces
3683 @opindex Wmissing-braces
3684 @opindex Wno-missing-braces
3685 Warn if an aggregate or union initializer is not fully bracketed.  In
3686 the following example, the initializer for @samp{a} is not fully
3687 bracketed, but that for @samp{b} is fully bracketed.  This warning is
3688 enabled by @option{-Wall} in C.
3690 @smallexample
3691 int a[2][2] = @{ 0, 1, 2, 3 @};
3692 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3693 @end smallexample
3695 This warning is enabled by @option{-Wall}.
3697 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3698 @opindex Wmissing-include-dirs
3699 @opindex Wno-missing-include-dirs
3700 Warn if a user-supplied include directory does not exist.
3702 @item -Wparentheses
3703 @opindex Wparentheses
3704 @opindex Wno-parentheses
3705 Warn if parentheses are omitted in certain contexts, such
3706 as when there is an assignment in a context where a truth value
3707 is expected, or when operators are nested whose precedence people
3708 often get confused about.
3710 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3711 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3712 interpretation from that of ordinary mathematical notation.
3714 Also warn about constructions where there may be confusion to which
3715 @code{if} statement an @code{else} branch belongs.  Here is an example of
3716 such a case:
3718 @smallexample
3719 @group
3721   if (a)
3722     if (b)
3723       foo ();
3724   else
3725     bar ();
3727 @end group
3728 @end smallexample
3730 In C/C++, every @code{else} branch belongs to the innermost possible
3731 @code{if} statement, which in this example is @code{if (b)}.  This is
3732 often not what the programmer expected, as illustrated in the above
3733 example by indentation the programmer chose.  When there is the
3734 potential for this confusion, GCC issues a warning when this flag
3735 is specified.  To eliminate the warning, add explicit braces around
3736 the innermost @code{if} statement so there is no way the @code{else}
3737 can belong to the enclosing @code{if}.  The resulting code
3738 looks like this:
3740 @smallexample
3741 @group
3743   if (a)
3744     @{
3745       if (b)
3746         foo ();
3747       else
3748         bar ();
3749     @}
3751 @end group
3752 @end smallexample
3754 Also warn for dangerous uses of the GNU extension to
3755 @code{?:} with omitted middle operand. When the condition
3756 in the @code{?}: operator is a boolean expression, the omitted value is
3757 always 1.  Often programmers expect it to be a value computed
3758 inside the conditional expression instead.
3760 This warning is enabled by @option{-Wall}.
3762 @item -Wsequence-point
3763 @opindex Wsequence-point
3764 @opindex Wno-sequence-point
3765 Warn about code that may have undefined semantics because of violations
3766 of sequence point rules in the C and C++ standards.
3768 The C and C++ standards define the order in which expressions in a C/C++
3769 program are evaluated in terms of @dfn{sequence points}, which represent
3770 a partial ordering between the execution of parts of the program: those
3771 executed before the sequence point, and those executed after it.  These
3772 occur after the evaluation of a full expression (one which is not part
3773 of a larger expression), after the evaluation of the first operand of a
3774 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3775 function is called (but after the evaluation of its arguments and the
3776 expression denoting the called function), and in certain other places.
3777 Other than as expressed by the sequence point rules, the order of
3778 evaluation of subexpressions of an expression is not specified.  All
3779 these rules describe only a partial order rather than a total order,
3780 since, for example, if two functions are called within one expression
3781 with no sequence point between them, the order in which the functions
3782 are called is not specified.  However, the standards committee have
3783 ruled that function calls do not overlap.
3785 It is not specified when between sequence points modifications to the
3786 values of objects take effect.  Programs whose behavior depends on this
3787 have undefined behavior; the C and C++ standards specify that ``Between
3788 the previous and next sequence point an object shall have its stored
3789 value modified at most once by the evaluation of an expression.
3790 Furthermore, the prior value shall be read only to determine the value
3791 to be stored.''.  If a program breaks these rules, the results on any
3792 particular implementation are entirely unpredictable.
3794 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3795 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3796 diagnosed by this option, and it may give an occasional false positive
3797 result, but in general it has been found fairly effective at detecting
3798 this sort of problem in programs.
3800 The standard is worded confusingly, therefore there is some debate
3801 over the precise meaning of the sequence point rules in subtle cases.
3802 Links to discussions of the problem, including proposed formal
3803 definitions, may be found on the GCC readings page, at
3804 @uref{http://gcc.gnu.org/@/readings.html}.
3806 This warning is enabled by @option{-Wall} for C and C++.
3808 @item -Wno-return-local-addr
3809 @opindex Wno-return-local-addr
3810 @opindex Wreturn-local-addr
3811 Do not warn about returning a pointer (or in C++, a reference) to a
3812 variable that goes out of scope after the function returns.
3814 @item -Wreturn-type
3815 @opindex Wreturn-type
3816 @opindex Wno-return-type
3817 Warn whenever a function is defined with a return type that defaults
3818 to @code{int}.  Also warn about any @code{return} statement with no
3819 return value in a function whose return type is not @code{void}
3820 (falling off the end of the function body is considered returning
3821 without a value), and about a @code{return} statement with an
3822 expression in a function whose return type is @code{void}.
3824 For C++, a function without return type always produces a diagnostic
3825 message, even when @option{-Wno-return-type} is specified.  The only
3826 exceptions are @samp{main} and functions defined in system headers.
3828 This warning is enabled by @option{-Wall}.
3830 @item -Wswitch
3831 @opindex Wswitch
3832 @opindex Wno-switch
3833 Warn whenever a @code{switch} statement has an index of enumerated type
3834 and lacks a @code{case} for one or more of the named codes of that
3835 enumeration.  (The presence of a @code{default} label prevents this
3836 warning.)  @code{case} labels outside the enumeration range also
3837 provoke warnings when this option is used (even if there is a
3838 @code{default} label).
3839 This warning is enabled by @option{-Wall}.
3841 @item -Wswitch-default
3842 @opindex Wswitch-default
3843 @opindex Wno-switch-default
3844 Warn whenever a @code{switch} statement does not have a @code{default}
3845 case.
3847 @item -Wswitch-enum
3848 @opindex Wswitch-enum
3849 @opindex Wno-switch-enum
3850 Warn whenever a @code{switch} statement has an index of enumerated type
3851 and lacks a @code{case} for one or more of the named codes of that
3852 enumeration.  @code{case} labels outside the enumeration range also
3853 provoke warnings when this option is used.  The only difference
3854 between @option{-Wswitch} and this option is that this option gives a
3855 warning about an omitted enumeration code even if there is a
3856 @code{default} label.
3858 @item -Wswitch-bool
3859 @opindex Wswitch-bool
3860 @opindex Wno-switch-bool
3861 Warn whenever a @code{switch} statement has an index of boolean type.
3862 It is possible to suppress this warning by casting the controlling
3863 expression to a type other than @code{bool}.  For example:
3864 @smallexample
3865 @group
3866 switch ((int) (a == 4))
3867   @{
3868   @dots{}
3869   @}
3870 @end group
3871 @end smallexample
3872 This warning is enabled by default for C and C++ programs.
3874 @item -Wsync-nand @r{(C and C++ only)}
3875 @opindex Wsync-nand
3876 @opindex Wno-sync-nand
3877 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3878 built-in functions are used.  These functions changed semantics in GCC 4.4.
3880 @item -Wtrigraphs
3881 @opindex Wtrigraphs
3882 @opindex Wno-trigraphs
3883 Warn if any trigraphs are encountered that might change the meaning of
3884 the program (trigraphs within comments are not warned about).
3885 This warning is enabled by @option{-Wall}.
3887 @item -Wunused-but-set-parameter
3888 @opindex Wunused-but-set-parameter
3889 @opindex Wno-unused-but-set-parameter
3890 Warn whenever a function parameter is assigned to, but otherwise unused
3891 (aside from its declaration).
3893 To suppress this warning use the @samp{unused} attribute
3894 (@pxref{Variable Attributes}).
3896 This warning is also enabled by @option{-Wunused} together with
3897 @option{-Wextra}.
3899 @item -Wunused-but-set-variable
3900 @opindex Wunused-but-set-variable
3901 @opindex Wno-unused-but-set-variable
3902 Warn whenever a local variable is assigned to, but otherwise unused
3903 (aside from its declaration).
3904 This warning is enabled by @option{-Wall}.
3906 To suppress this warning use the @samp{unused} attribute
3907 (@pxref{Variable Attributes}).
3909 This warning is also enabled by @option{-Wunused}, which is enabled
3910 by @option{-Wall}.
3912 @item -Wunused-function
3913 @opindex Wunused-function
3914 @opindex Wno-unused-function
3915 Warn whenever a static function is declared but not defined or a
3916 non-inline static function is unused.
3917 This warning is enabled by @option{-Wall}.
3919 @item -Wunused-label
3920 @opindex Wunused-label
3921 @opindex Wno-unused-label
3922 Warn whenever a label is declared but not used.
3923 This warning is enabled by @option{-Wall}.
3925 To suppress this warning use the @samp{unused} attribute
3926 (@pxref{Variable Attributes}).
3928 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
3929 @opindex Wunused-local-typedefs
3930 Warn when a typedef locally defined in a function is not used.
3931 This warning is enabled by @option{-Wall}.
3933 @item -Wunused-parameter
3934 @opindex Wunused-parameter
3935 @opindex Wno-unused-parameter
3936 Warn whenever a function parameter is unused aside from its declaration.
3938 To suppress this warning use the @samp{unused} attribute
3939 (@pxref{Variable Attributes}).
3941 @item -Wno-unused-result
3942 @opindex Wunused-result
3943 @opindex Wno-unused-result
3944 Do not warn if a caller of a function marked with attribute
3945 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
3946 its return value. The default is @option{-Wunused-result}.
3948 @item -Wunused-variable
3949 @opindex Wunused-variable
3950 @opindex Wno-unused-variable
3951 Warn whenever a local variable or non-constant static variable is unused
3952 aside from its declaration.
3953 This warning is enabled by @option{-Wall}.
3955 To suppress this warning use the @samp{unused} attribute
3956 (@pxref{Variable Attributes}).
3958 @item -Wunused-value
3959 @opindex Wunused-value
3960 @opindex Wno-unused-value
3961 Warn whenever a statement computes a result that is explicitly not
3962 used. To suppress this warning cast the unused expression to
3963 @samp{void}. This includes an expression-statement or the left-hand
3964 side of a comma expression that contains no side effects. For example,
3965 an expression such as @samp{x[i,j]} causes a warning, while
3966 @samp{x[(void)i,j]} does not.
3968 This warning is enabled by @option{-Wall}.
3970 @item -Wunused
3971 @opindex Wunused
3972 @opindex Wno-unused
3973 All the above @option{-Wunused} options combined.
3975 In order to get a warning about an unused function parameter, you must
3976 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
3977 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
3979 @item -Wuninitialized
3980 @opindex Wuninitialized
3981 @opindex Wno-uninitialized
3982 Warn if an automatic variable is used without first being initialized
3983 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3984 warn if a non-static reference or non-static @samp{const} member
3985 appears in a class without constructors.
3987 If you want to warn about code that uses the uninitialized value of the
3988 variable in its own initializer, use the @option{-Winit-self} option.
3990 These warnings occur for individual uninitialized or clobbered
3991 elements of structure, union or array variables as well as for
3992 variables that are uninitialized or clobbered as a whole.  They do
3993 not occur for variables or elements declared @code{volatile}.  Because
3994 these warnings depend on optimization, the exact variables or elements
3995 for which there are warnings depends on the precise optimization
3996 options and version of GCC used.
3998 Note that there may be no warning about a variable that is used only
3999 to compute a value that itself is never used, because such
4000 computations may be deleted by data flow analysis before the warnings
4001 are printed.
4003 @item -Wmaybe-uninitialized
4004 @opindex Wmaybe-uninitialized
4005 @opindex Wno-maybe-uninitialized
4006 For an automatic variable, if there exists a path from the function
4007 entry to a use of the variable that is initialized, but there exist
4008 some other paths for which the variable is not initialized, the compiler
4009 emits a warning if it cannot prove the uninitialized paths are not
4010 executed at run time. These warnings are made optional because GCC is
4011 not smart enough to see all the reasons why the code might be correct
4012 in spite of appearing to have an error.  Here is one example of how
4013 this can happen:
4015 @smallexample
4016 @group
4018   int x;
4019   switch (y)
4020     @{
4021     case 1: x = 1;
4022       break;
4023     case 2: x = 4;
4024       break;
4025     case 3: x = 5;
4026     @}
4027   foo (x);
4029 @end group
4030 @end smallexample
4032 @noindent
4033 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
4034 always initialized, but GCC doesn't know this. To suppress the
4035 warning, you need to provide a default case with assert(0) or
4036 similar code.
4038 @cindex @code{longjmp} warnings
4039 This option also warns when a non-volatile automatic variable might be
4040 changed by a call to @code{longjmp}.  These warnings as well are possible
4041 only in optimizing compilation.
4043 The compiler sees only the calls to @code{setjmp}.  It cannot know
4044 where @code{longjmp} will be called; in fact, a signal handler could
4045 call it at any point in the code.  As a result, you may get a warning
4046 even when there is in fact no problem because @code{longjmp} cannot
4047 in fact be called at the place that would cause a problem.
4049 Some spurious warnings can be avoided if you declare all the functions
4050 you use that never return as @code{noreturn}.  @xref{Function
4051 Attributes}.
4053 This warning is enabled by @option{-Wall} or @option{-Wextra}.
4055 @item -Wunknown-pragmas
4056 @opindex Wunknown-pragmas
4057 @opindex Wno-unknown-pragmas
4058 @cindex warning for unknown pragmas
4059 @cindex unknown pragmas, warning
4060 @cindex pragmas, warning of unknown
4061 Warn when a @code{#pragma} directive is encountered that is not understood by 
4062 GCC@.  If this command-line option is used, warnings are even issued
4063 for unknown pragmas in system header files.  This is not the case if
4064 the warnings are only enabled by the @option{-Wall} command-line option.
4066 @item -Wno-pragmas
4067 @opindex Wno-pragmas
4068 @opindex Wpragmas
4069 Do not warn about misuses of pragmas, such as incorrect parameters,
4070 invalid syntax, or conflicts between pragmas.  See also
4071 @option{-Wunknown-pragmas}.
4073 @item -Wstrict-aliasing
4074 @opindex Wstrict-aliasing
4075 @opindex Wno-strict-aliasing
4076 This option is only active when @option{-fstrict-aliasing} is active.
4077 It warns about code that might break the strict aliasing rules that the
4078 compiler is using for optimization.  The warning does not catch all
4079 cases, but does attempt to catch the more common pitfalls.  It is
4080 included in @option{-Wall}.
4081 It is equivalent to @option{-Wstrict-aliasing=3}
4083 @item -Wstrict-aliasing=n
4084 @opindex Wstrict-aliasing=n
4085 This option is only active when @option{-fstrict-aliasing} is active.
4086 It warns about code that might break the strict aliasing rules that the
4087 compiler is using for optimization.
4088 Higher levels correspond to higher accuracy (fewer false positives).
4089 Higher levels also correspond to more effort, similar to the way @option{-O} 
4090 works.
4091 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
4093 Level 1: Most aggressive, quick, least accurate.
4094 Possibly useful when higher levels
4095 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
4096 false negatives.  However, it has many false positives.
4097 Warns for all pointer conversions between possibly incompatible types,
4098 even if never dereferenced.  Runs in the front end only.
4100 Level 2: Aggressive, quick, not too precise.
4101 May still have many false positives (not as many as level 1 though),
4102 and few false negatives (but possibly more than level 1).
4103 Unlike level 1, it only warns when an address is taken.  Warns about
4104 incomplete types.  Runs in the front end only.
4106 Level 3 (default for @option{-Wstrict-aliasing}):
4107 Should have very few false positives and few false
4108 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
4109 Takes care of the common pun+dereference pattern in the front end:
4110 @code{*(int*)&some_float}.
4111 If optimization is enabled, it also runs in the back end, where it deals
4112 with multiple statement cases using flow-sensitive points-to information.
4113 Only warns when the converted pointer is dereferenced.
4114 Does not warn about incomplete types.
4116 @item -Wstrict-overflow
4117 @itemx -Wstrict-overflow=@var{n}
4118 @opindex Wstrict-overflow
4119 @opindex Wno-strict-overflow
4120 This option is only active when @option{-fstrict-overflow} is active.
4121 It warns about cases where the compiler optimizes based on the
4122 assumption that signed overflow does not occur.  Note that it does not
4123 warn about all cases where the code might overflow: it only warns
4124 about cases where the compiler implements some optimization.  Thus
4125 this warning depends on the optimization level.
4127 An optimization that assumes that signed overflow does not occur is
4128 perfectly safe if the values of the variables involved are such that
4129 overflow never does, in fact, occur.  Therefore this warning can
4130 easily give a false positive: a warning about code that is not
4131 actually a problem.  To help focus on important issues, several
4132 warning levels are defined.  No warnings are issued for the use of
4133 undefined signed overflow when estimating how many iterations a loop
4134 requires, in particular when determining whether a loop will be
4135 executed at all.
4137 @table @gcctabopt
4138 @item -Wstrict-overflow=1
4139 Warn about cases that are both questionable and easy to avoid.  For
4140 example,  with @option{-fstrict-overflow}, the compiler simplifies
4141 @code{x + 1 > x} to @code{1}.  This level of
4142 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
4143 are not, and must be explicitly requested.
4145 @item -Wstrict-overflow=2
4146 Also warn about other cases where a comparison is simplified to a
4147 constant.  For example: @code{abs (x) >= 0}.  This can only be
4148 simplified when @option{-fstrict-overflow} is in effect, because
4149 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
4150 zero.  @option{-Wstrict-overflow} (with no level) is the same as
4151 @option{-Wstrict-overflow=2}.
4153 @item -Wstrict-overflow=3
4154 Also warn about other cases where a comparison is simplified.  For
4155 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
4157 @item -Wstrict-overflow=4
4158 Also warn about other simplifications not covered by the above cases.
4159 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
4161 @item -Wstrict-overflow=5
4162 Also warn about cases where the compiler reduces the magnitude of a
4163 constant involved in a comparison.  For example: @code{x + 2 > y} is
4164 simplified to @code{x + 1 >= y}.  This is reported only at the
4165 highest warning level because this simplification applies to many
4166 comparisons, so this warning level gives a very large number of
4167 false positives.
4168 @end table
4170 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]}
4171 @opindex Wsuggest-attribute=
4172 @opindex Wno-suggest-attribute=
4173 Warn for cases where adding an attribute may be beneficial. The
4174 attributes currently supported are listed below.
4176 @table @gcctabopt
4177 @item -Wsuggest-attribute=pure
4178 @itemx -Wsuggest-attribute=const
4179 @itemx -Wsuggest-attribute=noreturn
4180 @opindex Wsuggest-attribute=pure
4181 @opindex Wno-suggest-attribute=pure
4182 @opindex Wsuggest-attribute=const
4183 @opindex Wno-suggest-attribute=const
4184 @opindex Wsuggest-attribute=noreturn
4185 @opindex Wno-suggest-attribute=noreturn
4187 Warn about functions that might be candidates for attributes
4188 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
4189 functions visible in other compilation units or (in the case of @code{pure} and
4190 @code{const}) if it cannot prove that the function returns normally. A function
4191 returns normally if it doesn't contain an infinite loop or return abnormally
4192 by throwing, calling @code{abort()} or trapping.  This analysis requires option
4193 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
4194 higher.  Higher optimization levels improve the accuracy of the analysis.
4196 @item -Wsuggest-attribute=format
4197 @itemx -Wmissing-format-attribute
4198 @opindex Wsuggest-attribute=format
4199 @opindex Wmissing-format-attribute
4200 @opindex Wno-suggest-attribute=format
4201 @opindex Wno-missing-format-attribute
4202 @opindex Wformat
4203 @opindex Wno-format
4205 Warn about function pointers that might be candidates for @code{format}
4206 attributes.  Note these are only possible candidates, not absolute ones.
4207 GCC guesses that function pointers with @code{format} attributes that
4208 are used in assignment, initialization, parameter passing or return
4209 statements should have a corresponding @code{format} attribute in the
4210 resulting type.  I.e.@: the left-hand side of the assignment or
4211 initialization, the type of the parameter variable, or the return type
4212 of the containing function respectively should also have a @code{format}
4213 attribute to avoid the warning.
4215 GCC also warns about function definitions that might be
4216 candidates for @code{format} attributes.  Again, these are only
4217 possible candidates.  GCC guesses that @code{format} attributes
4218 might be appropriate for any function that calls a function like
4219 @code{vprintf} or @code{vscanf}, but this might not always be the
4220 case, and some functions for which @code{format} attributes are
4221 appropriate may not be detected.
4222 @end table
4224 @item -Wsuggest-final-types
4225 @opindex Wno-suggest-final-types
4226 @opindex Wsuggest-final-types
4227 Warn about types with virtual methods where code quality would be improved
4228 if the type was declared with C++11 final specifier, or, if possible,
4229 declared in anonymous namespace. This allows GCC to devritualize more aggressively
4230 the polymorphic calls. This warning is more effective with link time optimization,
4231 where the information about the class hiearchy graph is more complete.
4233 @item -Wsuggest-final-methods
4234 @opindex Wno-suggest-final-methods
4235 @opindex Wsuggest-final-methods
4236 Warn about virtual methods where code quality would be improved if the method
4237 was declared with C++11 final specifier, or, if possible, its type was declared
4238 in the anonymous namespace or with final specifier. This warning is more
4239 effective with link time optimization, where the information about the class
4240 hiearchy graph is more complete. It is recommended to first consider suggestins
4241 of @option{-Wsuggest-final-types} and then rebuild with new annotations.
4243 @item -Warray-bounds
4244 @opindex Wno-array-bounds
4245 @opindex Warray-bounds
4246 This option is only active when @option{-ftree-vrp} is active
4247 (default for @option{-O2} and above). It warns about subscripts to arrays
4248 that are always out of bounds. This warning is enabled by @option{-Wall}.
4250 @item -Wbool-compare
4251 @opindex Wno-bool-compare
4252 @opindex Wbool-compare
4253 Warn about boolean expression compared with an integer value different from
4254 @code{true}/@code{false}.  For instance, the following comparison is
4255 always false:
4256 @smallexample
4257 int n = 5;
4258 @dots{}
4259 if ((n > 1) == 2) @{ @dots{} @}
4260 @end smallexample
4261 This warning is enabled by @option{-Wall}.
4263 @item -Wno-discarded-qualifiers @r{(C and Objective-C only)}
4264 @opindex Wno-discarded-qualifiers
4265 @opindex Wdiscarded-qualifiers
4266 Do not warn if type qualifiers on pointers are being discarded.
4267 Typically, the compiler will warn if a @code{const char *} variable is
4268 passed to a function that takes @code{char *} parameter.  This option
4269 can be used to suppress such a warning.
4271 @item -Wno-incompatible-pointer-types @r{(C and Objective-C only)}
4272 @opindex Wno-incompatible-pointer-types
4273 @opindex Wincompatible-pointer-types
4274 Do not warn when there is a conversion between pointers that have incompatible
4275 types.  This warning is for cases not covered by @option{-Wno-pointer-sign},
4276 which warns for pointer argument passing or assignment with different signedness
4278 @item -Wno-int-conversion @r{(C and Objective-C only)}
4279 @opindex Wno-int-conversion
4280 @opindex Wint-conversion
4281 Do not warn about incompatible integer to pointer and pointer to integer
4282 conversions.  This warning is about implicit conversions; for explicit
4283 conversions the warnings @option{-Wno-int-to-pointer-cast} and
4284 @option{-Wno-pointer-to-int-cast} may be used.
4286 @item -Wno-div-by-zero
4287 @opindex Wno-div-by-zero
4288 @opindex Wdiv-by-zero
4289 Do not warn about compile-time integer division by zero.  Floating-point
4290 division by zero is not warned about, as it can be a legitimate way of
4291 obtaining infinities and NaNs.
4293 @item -Wsystem-headers
4294 @opindex Wsystem-headers
4295 @opindex Wno-system-headers
4296 @cindex warnings from system headers
4297 @cindex system headers, warnings from
4298 Print warning messages for constructs found in system header files.
4299 Warnings from system headers are normally suppressed, on the assumption
4300 that they usually do not indicate real problems and would only make the
4301 compiler output harder to read.  Using this command-line option tells
4302 GCC to emit warnings from system headers as if they occurred in user
4303 code.  However, note that using @option{-Wall} in conjunction with this
4304 option does @emph{not} warn about unknown pragmas in system
4305 headers---for that, @option{-Wunknown-pragmas} must also be used.
4307 @item -Wtrampolines
4308 @opindex Wtrampolines
4309 @opindex Wno-trampolines
4310 Warn about trampolines generated for pointers to nested functions.
4311 A trampoline is a small piece of data or code that is created at run
4312 time on the stack when the address of a nested function is taken, and is
4313 used to call the nested function indirectly.  For some targets, it is
4314 made up of data only and thus requires no special treatment.  But, for
4315 most targets, it is made up of code and thus requires the stack to be
4316 made executable in order for the program to work properly.
4318 @item -Wfloat-equal
4319 @opindex Wfloat-equal
4320 @opindex Wno-float-equal
4321 Warn if floating-point values are used in equality comparisons.
4323 The idea behind this is that sometimes it is convenient (for the
4324 programmer) to consider floating-point values as approximations to
4325 infinitely precise real numbers.  If you are doing this, then you need
4326 to compute (by analyzing the code, or in some other way) the maximum or
4327 likely maximum error that the computation introduces, and allow for it
4328 when performing comparisons (and when producing output, but that's a
4329 different problem).  In particular, instead of testing for equality, you
4330 should check to see whether the two values have ranges that overlap; and
4331 this is done with the relational operators, so equality comparisons are
4332 probably mistaken.
4334 @item -Wtraditional @r{(C and Objective-C only)}
4335 @opindex Wtraditional
4336 @opindex Wno-traditional
4337 Warn about certain constructs that behave differently in traditional and
4338 ISO C@.  Also warn about ISO C constructs that have no traditional C
4339 equivalent, and/or problematic constructs that should be avoided.
4341 @itemize @bullet
4342 @item
4343 Macro parameters that appear within string literals in the macro body.
4344 In traditional C macro replacement takes place within string literals,
4345 but in ISO C it does not.
4347 @item
4348 In traditional C, some preprocessor directives did not exist.
4349 Traditional preprocessors only considered a line to be a directive
4350 if the @samp{#} appeared in column 1 on the line.  Therefore
4351 @option{-Wtraditional} warns about directives that traditional C
4352 understands but ignores because the @samp{#} does not appear as the
4353 first character on the line.  It also suggests you hide directives like
4354 @samp{#pragma} not understood by traditional C by indenting them.  Some
4355 traditional implementations do not recognize @samp{#elif}, so this option
4356 suggests avoiding it altogether.
4358 @item
4359 A function-like macro that appears without arguments.
4361 @item
4362 The unary plus operator.
4364 @item
4365 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
4366 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
4367 constants.)  Note, these suffixes appear in macros defined in the system
4368 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
4369 Use of these macros in user code might normally lead to spurious
4370 warnings, however GCC's integrated preprocessor has enough context to
4371 avoid warning in these cases.
4373 @item
4374 A function declared external in one block and then used after the end of
4375 the block.
4377 @item
4378 A @code{switch} statement has an operand of type @code{long}.
4380 @item
4381 A non-@code{static} function declaration follows a @code{static} one.
4382 This construct is not accepted by some traditional C compilers.
4384 @item
4385 The ISO type of an integer constant has a different width or
4386 signedness from its traditional type.  This warning is only issued if
4387 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
4388 typically represent bit patterns, are not warned about.
4390 @item
4391 Usage of ISO string concatenation is detected.
4393 @item
4394 Initialization of automatic aggregates.
4396 @item
4397 Identifier conflicts with labels.  Traditional C lacks a separate
4398 namespace for labels.
4400 @item
4401 Initialization of unions.  If the initializer is zero, the warning is
4402 omitted.  This is done under the assumption that the zero initializer in
4403 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
4404 initializer warnings and relies on default initialization to zero in the
4405 traditional C case.
4407 @item
4408 Conversions by prototypes between fixed/floating-point values and vice
4409 versa.  The absence of these prototypes when compiling with traditional
4410 C causes serious problems.  This is a subset of the possible
4411 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
4413 @item
4414 Use of ISO C style function definitions.  This warning intentionally is
4415 @emph{not} issued for prototype declarations or variadic functions
4416 because these ISO C features appear in your code when using
4417 libiberty's traditional C compatibility macros, @code{PARAMS} and
4418 @code{VPARAMS}.  This warning is also bypassed for nested functions
4419 because that feature is already a GCC extension and thus not relevant to
4420 traditional C compatibility.
4421 @end itemize
4423 @item -Wtraditional-conversion @r{(C and Objective-C only)}
4424 @opindex Wtraditional-conversion
4425 @opindex Wno-traditional-conversion
4426 Warn if a prototype causes a type conversion that is different from what
4427 would happen to the same argument in the absence of a prototype.  This
4428 includes conversions of fixed point to floating and vice versa, and
4429 conversions changing the width or signedness of a fixed-point argument
4430 except when the same as the default promotion.
4432 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
4433 @opindex Wdeclaration-after-statement
4434 @opindex Wno-declaration-after-statement
4435 Warn when a declaration is found after a statement in a block.  This
4436 construct, known from C++, was introduced with ISO C99 and is by default
4437 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
4438 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
4440 @item -Wundef
4441 @opindex Wundef
4442 @opindex Wno-undef
4443 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
4445 @item -Wno-endif-labels
4446 @opindex Wno-endif-labels
4447 @opindex Wendif-labels
4448 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
4450 @item -Wshadow
4451 @opindex Wshadow
4452 @opindex Wno-shadow
4453 Warn whenever a local variable or type declaration shadows another
4454 variable, parameter, type, class member (in C++), or instance variable
4455 (in Objective-C) or whenever a built-in function is shadowed. Note
4456 that in C++, the compiler warns if a local variable shadows an
4457 explicit typedef, but not if it shadows a struct/class/enum.
4459 @item -Wno-shadow-ivar @r{(Objective-C only)}
4460 @opindex Wno-shadow-ivar
4461 @opindex Wshadow-ivar
4462 Do not warn whenever a local variable shadows an instance variable in an
4463 Objective-C method.
4465 @item -Wlarger-than=@var{len}
4466 @opindex Wlarger-than=@var{len}
4467 @opindex Wlarger-than-@var{len}
4468 Warn whenever an object of larger than @var{len} bytes is defined.
4470 @item -Wframe-larger-than=@var{len}
4471 @opindex Wframe-larger-than
4472 Warn if the size of a function frame is larger than @var{len} bytes.
4473 The computation done to determine the stack frame size is approximate
4474 and not conservative.
4475 The actual requirements may be somewhat greater than @var{len}
4476 even if you do not get a warning.  In addition, any space allocated
4477 via @code{alloca}, variable-length arrays, or related constructs
4478 is not included by the compiler when determining
4479 whether or not to issue a warning.
4481 @item -Wno-free-nonheap-object
4482 @opindex Wno-free-nonheap-object
4483 @opindex Wfree-nonheap-object
4484 Do not warn when attempting to free an object that was not allocated
4485 on the heap.
4487 @item -Wstack-usage=@var{len}
4488 @opindex Wstack-usage
4489 Warn if the stack usage of a function might be larger than @var{len} bytes.
4490 The computation done to determine the stack usage is conservative.
4491 Any space allocated via @code{alloca}, variable-length arrays, or related
4492 constructs is included by the compiler when determining whether or not to
4493 issue a warning.
4495 The message is in keeping with the output of @option{-fstack-usage}.
4497 @itemize
4498 @item
4499 If the stack usage is fully static but exceeds the specified amount, it's:
4501 @smallexample
4502   warning: stack usage is 1120 bytes
4503 @end smallexample
4504 @item
4505 If the stack usage is (partly) dynamic but bounded, it's:
4507 @smallexample
4508   warning: stack usage might be 1648 bytes
4509 @end smallexample
4510 @item
4511 If the stack usage is (partly) dynamic and not bounded, it's:
4513 @smallexample
4514   warning: stack usage might be unbounded
4515 @end smallexample
4516 @end itemize
4518 @item -Wunsafe-loop-optimizations
4519 @opindex Wunsafe-loop-optimizations
4520 @opindex Wno-unsafe-loop-optimizations
4521 Warn if the loop cannot be optimized because the compiler cannot
4522 assume anything on the bounds of the loop indices.  With
4523 @option{-funsafe-loop-optimizations} warn if the compiler makes
4524 such assumptions.
4526 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
4527 @opindex Wno-pedantic-ms-format
4528 @opindex Wpedantic-ms-format
4529 When used in combination with @option{-Wformat}
4530 and @option{-pedantic} without GNU extensions, this option
4531 disables the warnings about non-ISO @code{printf} / @code{scanf} format
4532 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
4533 which depend on the MS runtime.
4535 @item -Wpointer-arith
4536 @opindex Wpointer-arith
4537 @opindex Wno-pointer-arith
4538 Warn about anything that depends on the ``size of'' a function type or
4539 of @code{void}.  GNU C assigns these types a size of 1, for
4540 convenience in calculations with @code{void *} pointers and pointers
4541 to functions.  In C++, warn also when an arithmetic operation involves
4542 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
4544 @item -Wtype-limits
4545 @opindex Wtype-limits
4546 @opindex Wno-type-limits
4547 Warn if a comparison is always true or always false due to the limited
4548 range of the data type, but do not warn for constant expressions.  For
4549 example, warn if an unsigned variable is compared against zero with
4550 @samp{<} or @samp{>=}.  This warning is also enabled by
4551 @option{-Wextra}.
4553 @item -Wbad-function-cast @r{(C and Objective-C only)}
4554 @opindex Wbad-function-cast
4555 @opindex Wno-bad-function-cast
4556 Warn whenever a function call is cast to a non-matching type.
4557 For example, warn if @code{int malloc()} is cast to @code{anything *}.
4559 @item -Wc90-c99-compat @r{(C and Objective-C only)}
4560 @opindex Wc90-c99-compat
4561 @opindex Wno-c90-c99-compat
4562 Warn about features not present in ISO C90, but present in ISO C99.
4563 For instance, warn about use of variable length arrays, @code{long long}
4564 type, @code{bool} type, compound literals, designated initializers, and so
4565 on.  This option is independent of the standards mode.  Warnings are disabled
4566 in the expression that follows @code{__extension__}.
4568 @item -Wc99-c11-compat @r{(C and Objective-C only)}
4569 @opindex Wc99-c11-compat
4570 @opindex Wno-c99-c11-compat
4571 Warn about features not present in ISO C99, but present in ISO C11.
4572 For instance, warn about use of anonymous structures and unions,
4573 @code{_Atomic} type qualifier, @code{_Thread_local} storage-class specifier,
4574 @code{_Alignas} specifier, @code{Alignof} operator, @code{_Generic} keyword,
4575 and so on.  This option is independent of the standards mode.  Warnings are
4576 disabled in the expression that follows @code{__extension__}.
4578 @item -Wc++-compat @r{(C and Objective-C only)}
4579 Warn about ISO C constructs that are outside of the common subset of
4580 ISO C and ISO C++, e.g.@: request for implicit conversion from
4581 @code{void *} to a pointer to non-@code{void} type.
4583 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
4584 Warn about C++ constructs whose meaning differs between ISO C++ 1998
4585 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
4586 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
4587 enabled by @option{-Wall}.
4589 @item -Wcast-qual
4590 @opindex Wcast-qual
4591 @opindex Wno-cast-qual
4592 Warn whenever a pointer is cast so as to remove a type qualifier from
4593 the target type.  For example, warn if a @code{const char *} is cast
4594 to an ordinary @code{char *}.
4596 Also warn when making a cast that introduces a type qualifier in an
4597 unsafe way.  For example, casting @code{char **} to @code{const char **}
4598 is unsafe, as in this example:
4600 @smallexample
4601   /* p is char ** value.  */
4602   const char **q = (const char **) p;
4603   /* Assignment of readonly string to const char * is OK.  */
4604   *q = "string";
4605   /* Now char** pointer points to read-only memory.  */
4606   **p = 'b';
4607 @end smallexample
4609 @item -Wcast-align
4610 @opindex Wcast-align
4611 @opindex Wno-cast-align
4612 Warn whenever a pointer is cast such that the required alignment of the
4613 target is increased.  For example, warn if a @code{char *} is cast to
4614 an @code{int *} on machines where integers can only be accessed at
4615 two- or four-byte boundaries.
4617 @item -Wwrite-strings
4618 @opindex Wwrite-strings
4619 @opindex Wno-write-strings
4620 When compiling C, give string constants the type @code{const
4621 char[@var{length}]} so that copying the address of one into a
4622 non-@code{const} @code{char *} pointer produces a warning.  These
4623 warnings help you find at compile time code that can try to write
4624 into a string constant, but only if you have been very careful about
4625 using @code{const} in declarations and prototypes.  Otherwise, it is
4626 just a nuisance. This is why we did not make @option{-Wall} request
4627 these warnings.
4629 When compiling C++, warn about the deprecated conversion from string
4630 literals to @code{char *}.  This warning is enabled by default for C++
4631 programs.
4633 @item -Wclobbered
4634 @opindex Wclobbered
4635 @opindex Wno-clobbered
4636 Warn for variables that might be changed by @samp{longjmp} or
4637 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
4639 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
4640 @opindex Wconditionally-supported
4641 @opindex Wno-conditionally-supported
4642 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
4644 @item -Wconversion
4645 @opindex Wconversion
4646 @opindex Wno-conversion
4647 Warn for implicit conversions that may alter a value. This includes
4648 conversions between real and integer, like @code{abs (x)} when
4649 @code{x} is @code{double}; conversions between signed and unsigned,
4650 like @code{unsigned ui = -1}; and conversions to smaller types, like
4651 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4652 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4653 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4654 conversions between signed and unsigned integers can be disabled by
4655 using @option{-Wno-sign-conversion}.
4657 For C++, also warn for confusing overload resolution for user-defined
4658 conversions; and conversions that never use a type conversion
4659 operator: conversions to @code{void}, the same type, a base class or a
4660 reference to them. Warnings about conversions between signed and
4661 unsigned integers are disabled by default in C++ unless
4662 @option{-Wsign-conversion} is explicitly enabled.
4664 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4665 @opindex Wconversion-null
4666 @opindex Wno-conversion-null
4667 Do not warn for conversions between @code{NULL} and non-pointer
4668 types. @option{-Wconversion-null} is enabled by default.
4670 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
4671 @opindex Wzero-as-null-pointer-constant
4672 @opindex Wno-zero-as-null-pointer-constant
4673 Warn when a literal '0' is used as null pointer constant.  This can
4674 be useful to facilitate the conversion to @code{nullptr} in C++11.
4676 @item -Wdate-time
4677 @opindex Wdate-time
4678 @opindex Wno-date-time
4679 Warn when macros @code{__TIME__}, @code{__DATE__} or @code{__TIMESTAMP__}
4680 are encountered as they might prevent bit-wise-identical reproducible
4681 compilations.
4683 @item -Wdelete-incomplete @r{(C++ and Objective-C++ only)}
4684 @opindex Wdelete-incomplete
4685 @opindex Wno-delete-incomplete
4686 Warn when deleting a pointer to incomplete type, which may cause
4687 undefined behavior at runtime.  This warning is enabled by default.
4689 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
4690 @opindex Wuseless-cast
4691 @opindex Wno-useless-cast
4692 Warn when an expression is casted to its own type.
4694 @item -Wempty-body
4695 @opindex Wempty-body
4696 @opindex Wno-empty-body
4697 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4698 while} statement.  This warning is also enabled by @option{-Wextra}.
4700 @item -Wenum-compare
4701 @opindex Wenum-compare
4702 @opindex Wno-enum-compare
4703 Warn about a comparison between values of different enumerated types.
4704 In C++ enumeral mismatches in conditional expressions are also
4705 diagnosed and the warning is enabled by default.  In C this warning is 
4706 enabled by @option{-Wall}.
4708 @item -Wjump-misses-init @r{(C, Objective-C only)}
4709 @opindex Wjump-misses-init
4710 @opindex Wno-jump-misses-init
4711 Warn if a @code{goto} statement or a @code{switch} statement jumps
4712 forward across the initialization of a variable, or jumps backward to a
4713 label after the variable has been initialized.  This only warns about
4714 variables that are initialized when they are declared.  This warning is
4715 only supported for C and Objective-C; in C++ this sort of branch is an
4716 error in any case.
4718 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4719 can be disabled with the @option{-Wno-jump-misses-init} option.
4721 @item -Wsign-compare
4722 @opindex Wsign-compare
4723 @opindex Wno-sign-compare
4724 @cindex warning for comparison of signed and unsigned values
4725 @cindex comparison of signed and unsigned values, warning
4726 @cindex signed and unsigned values, comparison warning
4727 Warn when a comparison between signed and unsigned values could produce
4728 an incorrect result when the signed value is converted to unsigned.
4729 This warning is also enabled by @option{-Wextra}; to get the other warnings
4730 of @option{-Wextra} without this warning, use @option{-Wextra -Wno-sign-compare}.
4732 @item -Wsign-conversion
4733 @opindex Wsign-conversion
4734 @opindex Wno-sign-conversion
4735 Warn for implicit conversions that may change the sign of an integer
4736 value, like assigning a signed integer expression to an unsigned
4737 integer variable. An explicit cast silences the warning. In C, this
4738 option is enabled also by @option{-Wconversion}.
4740 @item -Wfloat-conversion
4741 @opindex Wfloat-conversion
4742 @opindex Wno-float-conversion
4743 Warn for implicit conversions that reduce the precision of a real value.
4744 This includes conversions from real to integer, and from higher precision
4745 real to lower precision real values.  This option is also enabled by
4746 @option{-Wconversion}.
4748 @item -Wsizeof-pointer-memaccess
4749 @opindex Wsizeof-pointer-memaccess
4750 @opindex Wno-sizeof-pointer-memaccess
4751 Warn for suspicious length parameters to certain string and memory built-in
4752 functions if the argument uses @code{sizeof}.  This warning warns e.g.@:
4753 about @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not an array,
4754 but a pointer, and suggests a possible fix, or about
4755 @code{memcpy (&foo, ptr, sizeof (&foo));}.  This warning is enabled by
4756 @option{-Wall}.
4758 @item -Wsizeof-array-argument
4759 @opindex Wsizeof-array-argument
4760 @opindex Wno-sizeof-array-argument
4761 Warn when the @code{sizeof} operator is applied to a parameter that is
4762 declared as an array in a function definition.  This warning is enabled by
4763 default for C and C++ programs.
4765 @item -Wmemset-transposed-args
4766 @opindex Wmemset-transposed-args
4767 @opindex Wno-memset-transposed-args
4768 Warn for suspicious calls to the @code{memset} built-in function, if the
4769 second argument is not zero and the third argument is zero.  This warns e.g.@
4770 about @code{memset (buf, sizeof buf, 0)} where most probably
4771 @code{memset (buf, 0, sizeof buf)} was meant instead.  The diagnostics
4772 is only emitted if the third argument is literal zero, if it is some expression
4773 that is folded to zero, or e.g. a cast of zero to some type etc., it
4774 is far less likely that user has mistakenly exchanged the arguments and
4775 no warning is emitted.  This warning is enabled by @option{-Wall}.
4777 @item -Waddress
4778 @opindex Waddress
4779 @opindex Wno-address
4780 Warn about suspicious uses of memory addresses. These include using
4781 the address of a function in a conditional expression, such as
4782 @code{void func(void); if (func)}, and comparisons against the memory
4783 address of a string literal, such as @code{if (x == "abc")}.  Such
4784 uses typically indicate a programmer error: the address of a function
4785 always evaluates to true, so their use in a conditional usually
4786 indicate that the programmer forgot the parentheses in a function
4787 call; and comparisons against string literals result in unspecified
4788 behavior and are not portable in C, so they usually indicate that the
4789 programmer intended to use @code{strcmp}.  This warning is enabled by
4790 @option{-Wall}.
4792 @item -Wlogical-op
4793 @opindex Wlogical-op
4794 @opindex Wno-logical-op
4795 Warn about suspicious uses of logical operators in expressions.
4796 This includes using logical operators in contexts where a
4797 bit-wise operator is likely to be expected.
4799 @item -Wlogical-not-parentheses
4800 @opindex Wlogical-not-parentheses
4801 @opindex Wno-logical-not-parentheses
4802 Warn about logical not used on the left hand side operand of a comparison.
4803 This option does not warn if the RHS operand is of a boolean type.  Its
4804 purpose is to detect suspicious code like the following:
4805 @smallexample
4806 int a;
4807 @dots{}
4808 if (!a > 1) @{ @dots{} @}
4809 @end smallexample
4811 It is possible to suppress the warning by wrapping the LHS into
4812 parentheses:
4813 @smallexample
4814 if ((!a) > 1) @{ @dots{} @}
4815 @end smallexample
4817 This warning is enabled by @option{-Wall}.
4819 @item -Waggregate-return
4820 @opindex Waggregate-return
4821 @opindex Wno-aggregate-return
4822 Warn if any functions that return structures or unions are defined or
4823 called.  (In languages where you can return an array, this also elicits
4824 a warning.)
4826 @item -Wno-aggressive-loop-optimizations
4827 @opindex Wno-aggressive-loop-optimizations
4828 @opindex Waggressive-loop-optimizations
4829 Warn if in a loop with constant number of iterations the compiler detects
4830 undefined behavior in some statement during one or more of the iterations.
4832 @item -Wno-attributes
4833 @opindex Wno-attributes
4834 @opindex Wattributes
4835 Do not warn if an unexpected @code{__attribute__} is used, such as
4836 unrecognized attributes, function attributes applied to variables,
4837 etc.  This does not stop errors for incorrect use of supported
4838 attributes.
4840 @item -Wno-builtin-macro-redefined
4841 @opindex Wno-builtin-macro-redefined
4842 @opindex Wbuiltin-macro-redefined
4843 Do not warn if certain built-in macros are redefined.  This suppresses
4844 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4845 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4847 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4848 @opindex Wstrict-prototypes
4849 @opindex Wno-strict-prototypes
4850 Warn if a function is declared or defined without specifying the
4851 argument types.  (An old-style function definition is permitted without
4852 a warning if preceded by a declaration that specifies the argument
4853 types.)
4855 @item -Wold-style-declaration @r{(C and Objective-C only)}
4856 @opindex Wold-style-declaration
4857 @opindex Wno-old-style-declaration
4858 Warn for obsolescent usages, according to the C Standard, in a
4859 declaration. For example, warn if storage-class specifiers like
4860 @code{static} are not the first things in a declaration.  This warning
4861 is also enabled by @option{-Wextra}.
4863 @item -Wold-style-definition @r{(C and Objective-C only)}
4864 @opindex Wold-style-definition
4865 @opindex Wno-old-style-definition
4866 Warn if an old-style function definition is used.  A warning is given
4867 even if there is a previous prototype.
4869 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4870 @opindex Wmissing-parameter-type
4871 @opindex Wno-missing-parameter-type
4872 A function parameter is declared without a type specifier in K&R-style
4873 functions:
4875 @smallexample
4876 void foo(bar) @{ @}
4877 @end smallexample
4879 This warning is also enabled by @option{-Wextra}.
4881 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4882 @opindex Wmissing-prototypes
4883 @opindex Wno-missing-prototypes
4884 Warn if a global function is defined without a previous prototype
4885 declaration.  This warning is issued even if the definition itself
4886 provides a prototype.  Use this option to detect global functions
4887 that do not have a matching prototype declaration in a header file.
4888 This option is not valid for C++ because all function declarations
4889 provide prototypes and a non-matching declaration will declare an
4890 overload rather than conflict with an earlier declaration.
4891 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
4893 @item -Wmissing-declarations
4894 @opindex Wmissing-declarations
4895 @opindex Wno-missing-declarations
4896 Warn if a global function is defined without a previous declaration.
4897 Do so even if the definition itself provides a prototype.
4898 Use this option to detect global functions that are not declared in
4899 header files.  In C, no warnings are issued for functions with previous
4900 non-prototype declarations; use @option{-Wmissing-prototypes} to detect
4901 missing prototypes.  In C++, no warnings are issued for function templates,
4902 or for inline functions, or for functions in anonymous namespaces.
4904 @item -Wmissing-field-initializers
4905 @opindex Wmissing-field-initializers
4906 @opindex Wno-missing-field-initializers
4907 @opindex W
4908 @opindex Wextra
4909 @opindex Wno-extra
4910 Warn if a structure's initializer has some fields missing.  For
4911 example, the following code causes such a warning, because
4912 @code{x.h} is implicitly zero:
4914 @smallexample
4915 struct s @{ int f, g, h; @};
4916 struct s x = @{ 3, 4 @};
4917 @end smallexample
4919 This option does not warn about designated initializers, so the following
4920 modification does not trigger a warning:
4922 @smallexample
4923 struct s @{ int f, g, h; @};
4924 struct s x = @{ .f = 3, .g = 4 @};
4925 @end smallexample
4927 In C++ this option does not warn either about the empty @{ @}
4928 initializer, for example:
4930 @smallexample
4931 struct s @{ int f, g, h; @};
4932 s x = @{ @};
4933 @end smallexample
4935 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4936 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
4938 @item -Wno-multichar
4939 @opindex Wno-multichar
4940 @opindex Wmultichar
4941 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4942 Usually they indicate a typo in the user's code, as they have
4943 implementation-defined values, and should not be used in portable code.
4945 @item -Wnormalized@r{[}=@r{<}none@r{|}id@r{|}nfc@r{|}nfkc@r{>]}
4946 @opindex Wnormalized=
4947 @opindex Wnormalized
4948 @opindex Wno-normalized
4949 @cindex NFC
4950 @cindex NFKC
4951 @cindex character set, input normalization
4952 In ISO C and ISO C++, two identifiers are different if they are
4953 different sequences of characters.  However, sometimes when characters
4954 outside the basic ASCII character set are used, you can have two
4955 different character sequences that look the same.  To avoid confusion,
4956 the ISO 10646 standard sets out some @dfn{normalization rules} which
4957 when applied ensure that two sequences that look the same are turned into
4958 the same sequence.  GCC can warn you if you are using identifiers that
4959 have not been normalized; this option controls that warning.
4961 There are four levels of warning supported by GCC@.  The default is
4962 @option{-Wnormalized=nfc}, which warns about any identifier that is
4963 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4964 recommended form for most uses.  It is equivalent to
4965 @option{-Wnormalized}.
4967 Unfortunately, there are some characters allowed in identifiers by
4968 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
4969 identifiers.  That is, there's no way to use these symbols in portable
4970 ISO C or C++ and have all your identifiers in NFC@.
4971 @option{-Wnormalized=id} suppresses the warning for these characters.
4972 It is hoped that future versions of the standards involved will correct
4973 this, which is why this option is not the default.
4975 You can switch the warning off for all characters by writing
4976 @option{-Wnormalized=none} or @option{-Wno-normalized}.  You should
4977 only do this if you are using some other normalization scheme (like
4978 ``D''), because otherwise you can easily create bugs that are
4979 literally impossible to see.
4981 Some characters in ISO 10646 have distinct meanings but look identical
4982 in some fonts or display methodologies, especially once formatting has
4983 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4984 LETTER N'', displays just like a regular @code{n} that has been
4985 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4986 normalization scheme to convert all these into a standard form as
4987 well, and GCC warns if your code is not in NFKC if you use
4988 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4989 about every identifier that contains the letter O because it might be
4990 confused with the digit 0, and so is not the default, but may be
4991 useful as a local coding convention if the programming environment 
4992 cannot be fixed to display these characters distinctly.
4994 @item -Wno-deprecated
4995 @opindex Wno-deprecated
4996 @opindex Wdeprecated
4997 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4999 @item -Wno-deprecated-declarations
5000 @opindex Wno-deprecated-declarations
5001 @opindex Wdeprecated-declarations
5002 Do not warn about uses of functions (@pxref{Function Attributes}),
5003 variables (@pxref{Variable Attributes}), and types (@pxref{Type
5004 Attributes}) marked as deprecated by using the @code{deprecated}
5005 attribute.
5007 @item -Wno-overflow
5008 @opindex Wno-overflow
5009 @opindex Woverflow
5010 Do not warn about compile-time overflow in constant expressions.
5012 @item -Wno-odr
5013 @opindex Wno-odr
5014 @opindex Wodr
5015 Warn about One Definition Rule violations during link-time optimization.
5016 Requires @option{-flto-odr-type-merging} to be enabled.  Enabled by default.
5018 @item -Wopenmp-simd
5019 @opindex Wopenm-simd
5020 Warn if the vectorizer cost model overrides the OpenMP or the Cilk Plus
5021 simd directive set by user.  The @option{-fsimd-cost-model=unlimited} can
5022 be used to relax the cost model.
5024 @item -Woverride-init @r{(C and Objective-C only)}
5025 @opindex Woverride-init
5026 @opindex Wno-override-init
5027 @opindex W
5028 @opindex Wextra
5029 @opindex Wno-extra
5030 Warn if an initialized field without side effects is overridden when
5031 using designated initializers (@pxref{Designated Inits, , Designated
5032 Initializers}).
5034 This warning is included in @option{-Wextra}.  To get other
5035 @option{-Wextra} warnings without this one, use @option{-Wextra
5036 -Wno-override-init}.
5038 @item -Wpacked
5039 @opindex Wpacked
5040 @opindex Wno-packed
5041 Warn if a structure is given the packed attribute, but the packed
5042 attribute has no effect on the layout or size of the structure.
5043 Such structures may be mis-aligned for little benefit.  For
5044 instance, in this code, the variable @code{f.x} in @code{struct bar}
5045 is misaligned even though @code{struct bar} does not itself
5046 have the packed attribute:
5048 @smallexample
5049 @group
5050 struct foo @{
5051   int x;
5052   char a, b, c, d;
5053 @} __attribute__((packed));
5054 struct bar @{
5055   char z;
5056   struct foo f;
5058 @end group
5059 @end smallexample
5061 @item -Wpacked-bitfield-compat
5062 @opindex Wpacked-bitfield-compat
5063 @opindex Wno-packed-bitfield-compat
5064 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
5065 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
5066 the change can lead to differences in the structure layout.  GCC
5067 informs you when the offset of such a field has changed in GCC 4.4.
5068 For example there is no longer a 4-bit padding between field @code{a}
5069 and @code{b} in this structure:
5071 @smallexample
5072 struct foo
5074   char a:4;
5075   char b:8;
5076 @} __attribute__ ((packed));
5077 @end smallexample
5079 This warning is enabled by default.  Use
5080 @option{-Wno-packed-bitfield-compat} to disable this warning.
5082 @item -Wpadded
5083 @opindex Wpadded
5084 @opindex Wno-padded
5085 Warn if padding is included in a structure, either to align an element
5086 of the structure or to align the whole structure.  Sometimes when this
5087 happens it is possible to rearrange the fields of the structure to
5088 reduce the padding and so make the structure smaller.
5090 @item -Wredundant-decls
5091 @opindex Wredundant-decls
5092 @opindex Wno-redundant-decls
5093 Warn if anything is declared more than once in the same scope, even in
5094 cases where multiple declaration is valid and changes nothing.
5096 @item -Wnested-externs @r{(C and Objective-C only)}
5097 @opindex Wnested-externs
5098 @opindex Wno-nested-externs
5099 Warn if an @code{extern} declaration is encountered within a function.
5101 @item -Wno-inherited-variadic-ctor
5102 @opindex Winherited-variadic-ctor
5103 @opindex Wno-inherited-variadic-ctor
5104 Suppress warnings about use of C++11 inheriting constructors when the
5105 base class inherited from has a C variadic constructor; the warning is
5106 on by default because the ellipsis is not inherited.
5108 @item -Winline
5109 @opindex Winline
5110 @opindex Wno-inline
5111 Warn if a function that is declared as inline cannot be inlined.
5112 Even with this option, the compiler does not warn about failures to
5113 inline functions declared in system headers.
5115 The compiler uses a variety of heuristics to determine whether or not
5116 to inline a function.  For example, the compiler takes into account
5117 the size of the function being inlined and the amount of inlining
5118 that has already been done in the current function.  Therefore,
5119 seemingly insignificant changes in the source program can cause the
5120 warnings produced by @option{-Winline} to appear or disappear.
5122 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
5123 @opindex Wno-invalid-offsetof
5124 @opindex Winvalid-offsetof
5125 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
5126 type.  According to the 2014 ISO C++ standard, applying @samp{offsetof}
5127 to a non-standard-layout type is undefined.  In existing C++ implementations,
5128 however, @samp{offsetof} typically gives meaningful results.
5129 This flag is for users who are aware that they are
5130 writing nonportable code and who have deliberately chosen to ignore the
5131 warning about it.
5133 The restrictions on @samp{offsetof} may be relaxed in a future version
5134 of the C++ standard.
5136 @item -Wno-int-to-pointer-cast
5137 @opindex Wno-int-to-pointer-cast
5138 @opindex Wint-to-pointer-cast
5139 Suppress warnings from casts to pointer type of an integer of a
5140 different size. In C++, casting to a pointer type of smaller size is
5141 an error. @option{Wint-to-pointer-cast} is enabled by default.
5144 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
5145 @opindex Wno-pointer-to-int-cast
5146 @opindex Wpointer-to-int-cast
5147 Suppress warnings from casts from a pointer to an integer type of a
5148 different size.
5150 @item -Winvalid-pch
5151 @opindex Winvalid-pch
5152 @opindex Wno-invalid-pch
5153 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
5154 the search path but can't be used.
5156 @item -Wlong-long
5157 @opindex Wlong-long
5158 @opindex Wno-long-long
5159 Warn if @samp{long long} type is used.  This is enabled by either
5160 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
5161 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
5163 @item -Wvariadic-macros
5164 @opindex Wvariadic-macros
5165 @opindex Wno-variadic-macros
5166 Warn if variadic macros are used in ISO C90 mode, or if the GNU
5167 alternate syntax is used in ISO C99 mode.  This is enabled by either
5168 @option{-Wpedantic} or @option{-Wtraditional}.  To inhibit the warning
5169 messages, use @option{-Wno-variadic-macros}.
5171 @item -Wvarargs
5172 @opindex Wvarargs
5173 @opindex Wno-varargs
5174 Warn upon questionable usage of the macros used to handle variable
5175 arguments like @samp{va_start}.  This is default.  To inhibit the
5176 warning messages, use @option{-Wno-varargs}.
5178 @item -Wvector-operation-performance
5179 @opindex Wvector-operation-performance
5180 @opindex Wno-vector-operation-performance
5181 Warn if vector operation is not implemented via SIMD capabilities of the
5182 architecture.  Mainly useful for the performance tuning.
5183 Vector operation can be implemented @code{piecewise}, which means that the
5184 scalar operation is performed on every vector element; 
5185 @code{in parallel}, which means that the vector operation is implemented
5186 using scalars of wider type, which normally is more performance efficient;
5187 and @code{as a single scalar}, which means that vector fits into a
5188 scalar type.
5190 @item -Wno-virtual-move-assign
5191 @opindex Wvirtual-move-assign
5192 @opindex Wno-virtual-move-assign
5193 Suppress warnings about inheriting from a virtual base with a
5194 non-trivial C++11 move assignment operator.  This is dangerous because
5195 if the virtual base is reachable along more than one path, it will be
5196 moved multiple times, which can mean both objects end up in the
5197 moved-from state.  If the move assignment operator is written to avoid
5198 moving from a moved-from object, this warning can be disabled.
5200 @item -Wvla
5201 @opindex Wvla
5202 @opindex Wno-vla
5203 Warn if variable length array is used in the code.
5204 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
5205 the variable length array.
5207 @item -Wvolatile-register-var
5208 @opindex Wvolatile-register-var
5209 @opindex Wno-volatile-register-var
5210 Warn if a register variable is declared volatile.  The volatile
5211 modifier does not inhibit all optimizations that may eliminate reads
5212 and/or writes to register variables.  This warning is enabled by
5213 @option{-Wall}.
5215 @item -Wdisabled-optimization
5216 @opindex Wdisabled-optimization
5217 @opindex Wno-disabled-optimization
5218 Warn if a requested optimization pass is disabled.  This warning does
5219 not generally indicate that there is anything wrong with your code; it
5220 merely indicates that GCC's optimizers are unable to handle the code
5221 effectively.  Often, the problem is that your code is too big or too
5222 complex; GCC refuses to optimize programs when the optimization
5223 itself is likely to take inordinate amounts of time.
5225 @item -Wpointer-sign @r{(C and Objective-C only)}
5226 @opindex Wpointer-sign
5227 @opindex Wno-pointer-sign
5228 Warn for pointer argument passing or assignment with different signedness.
5229 This option is only supported for C and Objective-C@.  It is implied by
5230 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
5231 @option{-Wno-pointer-sign}.
5233 @item -Wstack-protector
5234 @opindex Wstack-protector
5235 @opindex Wno-stack-protector
5236 This option is only active when @option{-fstack-protector} is active.  It
5237 warns about functions that are not protected against stack smashing.
5239 @item -Woverlength-strings
5240 @opindex Woverlength-strings
5241 @opindex Wno-overlength-strings
5242 Warn about string constants that are longer than the ``minimum
5243 maximum'' length specified in the C standard.  Modern compilers
5244 generally allow string constants that are much longer than the
5245 standard's minimum limit, but very portable programs should avoid
5246 using longer strings.
5248 The limit applies @emph{after} string constant concatenation, and does
5249 not count the trailing NUL@.  In C90, the limit was 509 characters; in
5250 C99, it was raised to 4095.  C++98 does not specify a normative
5251 minimum maximum, so we do not diagnose overlength strings in C++@.
5253 This option is implied by @option{-Wpedantic}, and can be disabled with
5254 @option{-Wno-overlength-strings}.
5256 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
5257 @opindex Wunsuffixed-float-constants
5259 Issue a warning for any floating constant that does not have
5260 a suffix.  When used together with @option{-Wsystem-headers} it
5261 warns about such constants in system header files.  This can be useful
5262 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
5263 from the decimal floating-point extension to C99.
5265 @item -Wno-designated-init @r{(C and Objective-C only)}
5266 Suppress warnings when a positional initializer is used to initialize
5267 a structure that has been marked with the @code{designated_init}
5268 attribute.
5270 @end table
5272 @node Debugging Options
5273 @section Options for Debugging Your Program or GCC
5274 @cindex options, debugging
5275 @cindex debugging information options
5277 GCC has various special options that are used for debugging
5278 either your program or GCC:
5280 @table @gcctabopt
5281 @item -g
5282 @opindex g
5283 Produce debugging information in the operating system's native format
5284 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
5285 information.
5287 On most systems that use stabs format, @option{-g} enables use of extra
5288 debugging information that only GDB can use; this extra information
5289 makes debugging work better in GDB but probably makes other debuggers
5290 crash or
5291 refuse to read the program.  If you want to control for certain whether
5292 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
5293 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
5295 GCC allows you to use @option{-g} with
5296 @option{-O}.  The shortcuts taken by optimized code may occasionally
5297 produce surprising results: some variables you declared may not exist
5298 at all; flow of control may briefly move where you did not expect it;
5299 some statements may not be executed because they compute constant
5300 results or their values are already at hand; some statements may
5301 execute in different places because they have been moved out of loops.
5303 Nevertheless it proves possible to debug optimized output.  This makes
5304 it reasonable to use the optimizer for programs that might have bugs.
5306 The following options are useful when GCC is generated with the
5307 capability for more than one debugging format.
5309 @item -gsplit-dwarf
5310 @opindex gsplit-dwarf
5311 Separate as much dwarf debugging information as possible into a
5312 separate output file with the extension .dwo.  This option allows
5313 the build system to avoid linking files with debug information.  To
5314 be useful, this option requires a debugger capable of reading .dwo
5315 files.
5317 @item -ggdb
5318 @opindex ggdb
5319 Produce debugging information for use by GDB@.  This means to use the
5320 most expressive format available (DWARF 2, stabs, or the native format
5321 if neither of those are supported), including GDB extensions if at all
5322 possible.
5324 @item -gpubnames
5325 @opindex gpubnames
5326 Generate dwarf .debug_pubnames and .debug_pubtypes sections.
5328 @item -ggnu-pubnames
5329 @opindex ggnu-pubnames
5330 Generate .debug_pubnames and .debug_pubtypes sections in a format
5331 suitable for conversion into a GDB@ index.  This option is only useful
5332 with a linker that can produce GDB@ index version 7.
5334 @item -gstabs
5335 @opindex gstabs
5336 Produce debugging information in stabs format (if that is supported),
5337 without GDB extensions.  This is the format used by DBX on most BSD
5338 systems.  On MIPS, Alpha and System V Release 4 systems this option
5339 produces stabs debugging output that is not understood by DBX or SDB@.
5340 On System V Release 4 systems this option requires the GNU assembler.
5342 @item -feliminate-unused-debug-symbols
5343 @opindex feliminate-unused-debug-symbols
5344 Produce debugging information in stabs format (if that is supported),
5345 for only symbols that are actually used.
5347 @item -femit-class-debug-always
5348 Instead of emitting debugging information for a C++ class in only one
5349 object file, emit it in all object files using the class.  This option
5350 should be used only with debuggers that are unable to handle the way GCC
5351 normally emits debugging information for classes because using this
5352 option increases the size of debugging information by as much as a
5353 factor of two.
5355 @item -fdebug-types-section
5356 @opindex fdebug-types-section
5357 @opindex fno-debug-types-section
5358 When using DWARF Version 4 or higher, type DIEs can be put into
5359 their own @code{.debug_types} section instead of making them part of the
5360 @code{.debug_info} section.  It is more efficient to put them in a separate
5361 comdat sections since the linker can then remove duplicates.
5362 But not all DWARF consumers support @code{.debug_types} sections yet
5363 and on some objects @code{.debug_types} produces larger instead of smaller
5364 debugging information.
5366 @item -gstabs+
5367 @opindex gstabs+
5368 Produce debugging information in stabs format (if that is supported),
5369 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5370 use of these extensions is likely to make other debuggers crash or
5371 refuse to read the program.
5373 @item -gcoff
5374 @opindex gcoff
5375 Produce debugging information in COFF format (if that is supported).
5376 This is the format used by SDB on most System V systems prior to
5377 System V Release 4.
5379 @item -gxcoff
5380 @opindex gxcoff
5381 Produce debugging information in XCOFF format (if that is supported).
5382 This is the format used by the DBX debugger on IBM RS/6000 systems.
5384 @item -gxcoff+
5385 @opindex gxcoff+
5386 Produce debugging information in XCOFF format (if that is supported),
5387 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5388 use of these extensions is likely to make other debuggers crash or
5389 refuse to read the program, and may cause assemblers other than the GNU
5390 assembler (GAS) to fail with an error.
5392 @item -gdwarf-@var{version}
5393 @opindex gdwarf-@var{version}
5394 Produce debugging information in DWARF format (if that is supported).
5395 The value of @var{version} may be either 2, 3 or 4; the default version
5396 for most targets is 4.
5398 Note that with DWARF Version 2, some ports require and always
5399 use some non-conflicting DWARF 3 extensions in the unwind tables.
5401 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
5402 for maximum benefit.
5404 @item -grecord-gcc-switches
5405 @opindex grecord-gcc-switches
5406 This switch causes the command-line options used to invoke the
5407 compiler that may affect code generation to be appended to the
5408 DW_AT_producer attribute in DWARF debugging information.  The options
5409 are concatenated with spaces separating them from each other and from
5410 the compiler version.  See also @option{-frecord-gcc-switches} for another
5411 way of storing compiler options into the object file.  This is the default.
5413 @item -gno-record-gcc-switches
5414 @opindex gno-record-gcc-switches
5415 Disallow appending command-line options to the DW_AT_producer attribute
5416 in DWARF debugging information.
5418 @item -gstrict-dwarf
5419 @opindex gstrict-dwarf
5420 Disallow using extensions of later DWARF standard version than selected
5421 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
5422 DWARF extensions from later standard versions is allowed.
5424 @item -gno-strict-dwarf
5425 @opindex gno-strict-dwarf
5426 Allow using extensions of later DWARF standard version than selected with
5427 @option{-gdwarf-@var{version}}.
5429 @item -gz@r{[}=@var{type}@r{]}
5430 @opindex gz
5431 Produce compressed debug sections in DWARF format, if that is supported.
5432 If @var{type} is not given, the default type depends on the capabilities
5433 of the assembler and linker used.  @var{type} may be one of
5434 @option{none} (don't compress debug sections), @option{zlib} (use zlib
5435 compression in ELF gABI format), or @option{zlib-gnu} (use zlib
5436 compression in traditional GNU format).  If the linker doesn't support
5437 writing compressed debug sections, the option is rejected.  Otherwise,
5438 if the assembler does not support them, @option{-gz} is silently ignored
5439 when producing object files.
5441 @item -gvms
5442 @opindex gvms
5443 Produce debugging information in Alpha/VMS debug format (if that is
5444 supported).  This is the format used by DEBUG on Alpha/VMS systems.
5446 @item -g@var{level}
5447 @itemx -ggdb@var{level}
5448 @itemx -gstabs@var{level}
5449 @itemx -gcoff@var{level}
5450 @itemx -gxcoff@var{level}
5451 @itemx -gvms@var{level}
5452 Request debugging information and also use @var{level} to specify how
5453 much information.  The default level is 2.
5455 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
5456 @option{-g}.
5458 Level 1 produces minimal information, enough for making backtraces in
5459 parts of the program that you don't plan to debug.  This includes
5460 descriptions of functions and external variables, and line number
5461 tables, but no information about local variables.
5463 Level 3 includes extra information, such as all the macro definitions
5464 present in the program.  Some debuggers support macro expansion when
5465 you use @option{-g3}.
5467 @option{-gdwarf-2} does not accept a concatenated debug level, because
5468 GCC used to support an option @option{-gdwarf} that meant to generate
5469 debug information in version 1 of the DWARF format (which is very
5470 different from version 2), and it would have been too confusing.  That
5471 debug format is long obsolete, but the option cannot be changed now.
5472 Instead use an additional @option{-g@var{level}} option to change the
5473 debug level for DWARF.
5475 @item -gtoggle
5476 @opindex gtoggle
5477 Turn off generation of debug info, if leaving out this option
5478 generates it, or turn it on at level 2 otherwise.  The position of this
5479 argument in the command line does not matter; it takes effect after all
5480 other options are processed, and it does so only once, no matter how
5481 many times it is given.  This is mainly intended to be used with
5482 @option{-fcompare-debug}.
5484 @item -fsanitize=address
5485 @opindex fsanitize=address
5486 Enable AddressSanitizer, a fast memory error detector.
5487 Memory access instructions will be instrumented to detect
5488 out-of-bounds and use-after-free bugs.
5489 See @uref{http://code.google.com/p/address-sanitizer/} for
5490 more details.  The run-time behavior can be influenced using the
5491 @env{ASAN_OPTIONS} environment variable; see
5492 @url{https://code.google.com/p/address-sanitizer/wiki/Flags#Run-time_flags} for
5493 a list of supported options.
5495 @item -fsanitize=kernel-address
5496 @opindex fsanitize=kernel-address
5497 Enable AddressSanitizer for Linux kernel.
5498 See @uref{http://code.google.com/p/address-sanitizer/wiki/AddressSanitizerForKernel} for more details.
5500 @item -fsanitize=thread
5501 @opindex fsanitize=thread
5502 Enable ThreadSanitizer, a fast data race detector.
5503 Memory access instructions will be instrumented to detect
5504 data race bugs.  See @uref{http://code.google.com/p/thread-sanitizer/} for more
5505 details. The run-time behavior can be influenced using the @env{TSAN_OPTIONS}
5506 environment variable; see
5507 @url{https://code.google.com/p/thread-sanitizer/wiki/Flags} for a list of
5508 supported options.
5510 @item -fsanitize=leak
5511 @opindex fsanitize=leak
5512 Enable LeakSanitizer, a memory leak detector.
5513 This option only matters for linking of executables and if neither
5514 @option{-fsanitize=address} nor @option{-fsanitize=thread} is used.  In that
5515 case it will link the executable against a library that overrides @code{malloc}
5516 and other allocator functions.  See
5517 @uref{https://code.google.com/p/address-sanitizer/wiki/LeakSanitizer} for more
5518 details.  The run-time behavior can be influenced using the
5519 @env{LSAN_OPTIONS} environment variable.
5521 @item -fsanitize=undefined
5522 @opindex fsanitize=undefined
5523 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector.
5524 Various computations will be instrumented to detect undefined behavior
5525 at runtime.  Current suboptions are:
5527 @table @gcctabopt
5529 @item -fsanitize=shift
5530 @opindex fsanitize=shift
5531 This option enables checking that the result of a shift operation is
5532 not undefined.  Note that what exactly is considered undefined differs
5533 slightly between C and C++, as well as between ISO C90 and C99, etc.
5535 @item -fsanitize=integer-divide-by-zero
5536 @opindex fsanitize=integer-divide-by-zero
5537 Detect integer division by zero as well as @code{INT_MIN / -1} division.
5539 @item -fsanitize=unreachable
5540 @opindex fsanitize=unreachable
5541 With this option, the compiler will turn the @code{__builtin_unreachable}
5542 call into a diagnostics message call instead.  When reaching the
5543 @code{__builtin_unreachable} call, the behavior is undefined.
5545 @item -fsanitize=vla-bound
5546 @opindex fsanitize=vla-bound
5547 This option instructs the compiler to check that the size of a variable
5548 length array is positive.  This option does not have any effect in
5549 @option{-std=c++14} mode, as the standard requires the exception be thrown
5550 instead.
5552 @item -fsanitize=null
5553 @opindex fsanitize=null
5554 This option enables pointer checking.  Particularly, the application
5555 built with this option turned on will issue an error message when it
5556 tries to dereference a NULL pointer, or if a reference (possibly an
5557 rvalue reference) is bound to a NULL pointer, or if a method is invoked
5558 on an object pointed by a NULL pointer.
5560 @item -fsanitize=return
5561 @opindex fsanitize=return
5562 This option enables return statement checking.  Programs
5563 built with this option turned on will issue an error message
5564 when the end of a non-void function is reached without actually
5565 returning a value.  This option works in C++ only.
5567 @item -fsanitize=signed-integer-overflow
5568 @opindex fsanitize=signed-integer-overflow
5569 This option enables signed integer overflow checking.  We check that
5570 the result of @code{+}, @code{*}, and both unary and binary @code{-}
5571 does not overflow in the signed arithmetics.  Note, integer promotion
5572 rules must be taken into account.  That is, the following is not an
5573 overflow:
5574 @smallexample
5575 signed char a = SCHAR_MAX;
5576 a++;
5577 @end smallexample
5579 @item -fsanitize=bounds
5580 @opindex fsanitize=bounds
5581 This option enables instrumentation of array bounds.  Various out of bounds
5582 accesses are detected.  Flexible array members and initializers of variables
5583 with static storage are not instrumented.
5585 @item -fsanitize=alignment
5586 @opindex fsanitize=alignment
5588 This option enables checking of alignment of pointers when they are
5589 dereferenced, or when a reference is bound to insufficiently aligned target,
5590 or when a method or constructor is invoked on insufficiently aligned object.
5592 @item -fsanitize=object-size
5593 @opindex fsanitize=object-size
5594 This option enables instrumentation of memory references using the
5595 @code{__builtin_object_size} function.  Various out of bounds pointer
5596 accesses are detected.
5598 @item -fsanitize=float-divide-by-zero
5599 @opindex fsanitize=float-divide-by-zero
5600 Detect floating-point division by zero.  Unlike other similar options,
5601 @option{-fsanitize=float-divide-by-zero} is not enabled by
5602 @option{-fsanitize=undefined}, since floating-point division by zero can
5603 be a legitimate way of obtaining infinities and NaNs.
5605 @item -fsanitize=float-cast-overflow
5606 @opindex fsanitize=float-cast-overflow
5607 This option enables floating-point type to integer conversion checking.
5608 We check that the result of the conversion does not overflow.
5609 This option does not work well with @code{FE_INVALID} exceptions enabled.
5611 @item -fsanitize=nonnull-attribute
5612 @opindex fsanitize=nonnull-attribute
5614 This option enables instrumentation of calls, checking whether null values
5615 are not passed to arguments marked as requiring a non-null value by the
5616 @code{nonnull} function attribute.
5618 @item -fsanitize=returns-nonnull-attribute
5619 @opindex fsanitize=returns-nonnull-attribute
5621 This option enables instrumentation of return statements in functions
5622 marked with @code{returns_nonnull} function attribute, to detect returning
5623 of null values from such functions.
5625 @item -fsanitize=bool
5626 @opindex fsanitize=bool
5628 This option enables instrumentation of loads from bool.  If a value other
5629 than 0/1 is loaded, a run-time error is issued.
5631 @item -fsanitize=enum
5632 @opindex fsanitize=enum
5634 This option enables instrumentation of loads from an enum type.  If
5635 a value outside the range of values for the enum type is loaded,
5636 a run-time error is issued.
5638 @end table
5640 While @option{-ftrapv} causes traps for signed overflows to be emitted,
5641 @option{-fsanitize=undefined} gives a diagnostic message.
5642 This currently works only for the C family of languages.
5644 @item -fsanitize-recover@r{[}=@var{opts}@r{]}
5645 @opindex fsanitize-recover
5646 @opindex fno-sanitize-recover
5647 @option{-fsanitize-recover=} controls error recovery mode for sanitizers
5648 mentioned in comma-separated list of @var{opts}.  Enabling this option
5649 for a sanitizer component would cause it to attempt to continue
5650 running the program as if no error happened.  This means multiple
5651 runtime errors can be reported in a single program run, and the exit
5652 code of the program may indicate success even when errors
5653 have been reported.  The @option{-fno-sanitize-recover=} can be used to alter
5654 this behavior, only the first detected error will be reported
5655 and program will exit after that with non-zero exit code.
5657 Currently this feature only works for @option{-fsanitize=undefined} (and its suboptions
5658 except for @option{-fsanitize=unreachable} and @option{-fsanitize=return}),
5659 @option{-fsanitize=float-cast-overflow} and @option{-fsanitize=float-divide-by-zero}.
5660 For these sanitizers error recovery is turned on by default.
5662 Syntax without explicit @var{opts} parameter is deprecated.  It is equivalent to
5663 @option{-fsanitize-recover=undefined,float-cast-overflow,float-divide-by-zero}.
5664 Similarly @option{-fno-sanitize-recover} is equivalent to
5665 @option{-fno-sanitize-recover=undefined,float-cast-overflow,float-divide-by-zero}.
5667 @item -fsanitize-undefined-trap-on-error
5668 @opindex fsanitize-undefined-trap-on-error
5669 The @option{-fsanitize-undefined-trap-on-error} instructs the compiler to
5670 report undefined behavior using @code{__builtin_trap ()} rather than
5671 a @code{libubsan} library routine.  The advantage of this is that the
5672 @code{libubsan} library is not needed and will not be linked in, so this
5673 is usable even for use in freestanding environments.
5675 @item -fdump-final-insns@r{[}=@var{file}@r{]}
5676 @opindex fdump-final-insns
5677 Dump the final internal representation (RTL) to @var{file}.  If the
5678 optional argument is omitted (or if @var{file} is @code{.}), the name
5679 of the dump file is determined by appending @code{.gkd} to the
5680 compilation output file name.
5682 @item -fcompare-debug@r{[}=@var{opts}@r{]}
5683 @opindex fcompare-debug
5684 @opindex fno-compare-debug
5685 If no error occurs during compilation, run the compiler a second time,
5686 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
5687 passed to the second compilation.  Dump the final internal
5688 representation in both compilations, and print an error if they differ.
5690 If the equal sign is omitted, the default @option{-gtoggle} is used.
5692 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
5693 and nonzero, implicitly enables @option{-fcompare-debug}.  If
5694 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
5695 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
5696 is used.
5698 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
5699 is equivalent to @option{-fno-compare-debug}, which disables the dumping
5700 of the final representation and the second compilation, preventing even
5701 @env{GCC_COMPARE_DEBUG} from taking effect.
5703 To verify full coverage during @option{-fcompare-debug} testing, set
5704 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
5705 which GCC rejects as an invalid option in any actual compilation
5706 (rather than preprocessing, assembly or linking).  To get just a
5707 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
5708 not overridden} will do.
5710 @item -fcompare-debug-second
5711 @opindex fcompare-debug-second
5712 This option is implicitly passed to the compiler for the second
5713 compilation requested by @option{-fcompare-debug}, along with options to
5714 silence warnings, and omitting other options that would cause
5715 side-effect compiler outputs to files or to the standard output.  Dump
5716 files and preserved temporary files are renamed so as to contain the
5717 @code{.gk} additional extension during the second compilation, to avoid
5718 overwriting those generated by the first.
5720 When this option is passed to the compiler driver, it causes the
5721 @emph{first} compilation to be skipped, which makes it useful for little
5722 other than debugging the compiler proper.
5724 @item -feliminate-dwarf2-dups
5725 @opindex feliminate-dwarf2-dups
5726 Compress DWARF 2 debugging information by eliminating duplicated
5727 information about each symbol.  This option only makes sense when
5728 generating DWARF 2 debugging information with @option{-gdwarf-2}.
5730 @item -femit-struct-debug-baseonly
5731 @opindex femit-struct-debug-baseonly
5732 Emit debug information for struct-like types
5733 only when the base name of the compilation source file
5734 matches the base name of file in which the struct is defined.
5736 This option substantially reduces the size of debugging information,
5737 but at significant potential loss in type information to the debugger.
5738 See @option{-femit-struct-debug-reduced} for a less aggressive option.
5739 See @option{-femit-struct-debug-detailed} for more detailed control.
5741 This option works only with DWARF 2.
5743 @item -femit-struct-debug-reduced
5744 @opindex femit-struct-debug-reduced
5745 Emit debug information for struct-like types
5746 only when the base name of the compilation source file
5747 matches the base name of file in which the type is defined,
5748 unless the struct is a template or defined in a system header.
5750 This option significantly reduces the size of debugging information,
5751 with some potential loss in type information to the debugger.
5752 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
5753 See @option{-femit-struct-debug-detailed} for more detailed control.
5755 This option works only with DWARF 2.
5757 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
5758 Specify the struct-like types
5759 for which the compiler generates debug information.
5760 The intent is to reduce duplicate struct debug information
5761 between different object files within the same program.
5763 This option is a detailed version of
5764 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
5765 which serves for most needs.
5767 A specification has the syntax@*
5768 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
5770 The optional first word limits the specification to
5771 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
5772 A struct type is used directly when it is the type of a variable, member.
5773 Indirect uses arise through pointers to structs.
5774 That is, when use of an incomplete struct is valid, the use is indirect.
5775 An example is
5776 @samp{struct one direct; struct two * indirect;}.
5778 The optional second word limits the specification to
5779 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
5780 Generic structs are a bit complicated to explain.
5781 For C++, these are non-explicit specializations of template classes,
5782 or non-template classes within the above.
5783 Other programming languages have generics,
5784 but @option{-femit-struct-debug-detailed} does not yet implement them.
5786 The third word specifies the source files for those
5787 structs for which the compiler should emit debug information.
5788 The values @samp{none} and @samp{any} have the normal meaning.
5789 The value @samp{base} means that
5790 the base of name of the file in which the type declaration appears
5791 must match the base of the name of the main compilation file.
5792 In practice, this means that when compiling @file{foo.c}, debug information
5793 is generated for types declared in that file and @file{foo.h},
5794 but not other header files.
5795 The value @samp{sys} means those types satisfying @samp{base}
5796 or declared in system or compiler headers.
5798 You may need to experiment to determine the best settings for your application.
5800 The default is @option{-femit-struct-debug-detailed=all}.
5802 This option works only with DWARF 2.
5804 @item -fno-merge-debug-strings
5805 @opindex fmerge-debug-strings
5806 @opindex fno-merge-debug-strings
5807 Direct the linker to not merge together strings in the debugging
5808 information that are identical in different object files.  Merging is
5809 not supported by all assemblers or linkers.  Merging decreases the size
5810 of the debug information in the output file at the cost of increasing
5811 link processing time.  Merging is enabled by default.
5813 @item -fdebug-prefix-map=@var{old}=@var{new}
5814 @opindex fdebug-prefix-map
5815 When compiling files in directory @file{@var{old}}, record debugging
5816 information describing them as in @file{@var{new}} instead.
5818 @item -fno-dwarf2-cfi-asm
5819 @opindex fdwarf2-cfi-asm
5820 @opindex fno-dwarf2-cfi-asm
5821 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
5822 instead of using GAS @code{.cfi_*} directives.
5824 @cindex @command{prof}
5825 @item -p
5826 @opindex p
5827 Generate extra code to write profile information suitable for the
5828 analysis program @command{prof}.  You must use this option when compiling
5829 the source files you want data about, and you must also use it when
5830 linking.
5832 @cindex @command{gprof}
5833 @item -pg
5834 @opindex pg
5835 Generate extra code to write profile information suitable for the
5836 analysis program @command{gprof}.  You must use this option when compiling
5837 the source files you want data about, and you must also use it when
5838 linking.
5840 @item -Q
5841 @opindex Q
5842 Makes the compiler print out each function name as it is compiled, and
5843 print some statistics about each pass when it finishes.
5845 @item -ftime-report
5846 @opindex ftime-report
5847 Makes the compiler print some statistics about the time consumed by each
5848 pass when it finishes.
5850 @item -fmem-report
5851 @opindex fmem-report
5852 Makes the compiler print some statistics about permanent memory
5853 allocation when it finishes.
5855 @item -fmem-report-wpa
5856 @opindex fmem-report-wpa
5857 Makes the compiler print some statistics about permanent memory
5858 allocation for the WPA phase only.
5860 @item -fpre-ipa-mem-report
5861 @opindex fpre-ipa-mem-report
5862 @item -fpost-ipa-mem-report
5863 @opindex fpost-ipa-mem-report
5864 Makes the compiler print some statistics about permanent memory
5865 allocation before or after interprocedural optimization.
5867 @item -fprofile-report
5868 @opindex fprofile-report
5869 Makes the compiler print some statistics about consistency of the
5870 (estimated) profile and effect of individual passes.
5872 @item -fstack-usage
5873 @opindex fstack-usage
5874 Makes the compiler output stack usage information for the program, on a
5875 per-function basis.  The filename for the dump is made by appending
5876 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
5877 the output file, if explicitly specified and it is not an executable,
5878 otherwise it is the basename of the source file.  An entry is made up
5879 of three fields:
5881 @itemize
5882 @item
5883 The name of the function.
5884 @item
5885 A number of bytes.
5886 @item
5887 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
5888 @end itemize
5890 The qualifier @code{static} means that the function manipulates the stack
5891 statically: a fixed number of bytes are allocated for the frame on function
5892 entry and released on function exit; no stack adjustments are otherwise made
5893 in the function.  The second field is this fixed number of bytes.
5895 The qualifier @code{dynamic} means that the function manipulates the stack
5896 dynamically: in addition to the static allocation described above, stack
5897 adjustments are made in the body of the function, for example to push/pop
5898 arguments around function calls.  If the qualifier @code{bounded} is also
5899 present, the amount of these adjustments is bounded at compile time and
5900 the second field is an upper bound of the total amount of stack used by
5901 the function.  If it is not present, the amount of these adjustments is
5902 not bounded at compile time and the second field only represents the
5903 bounded part.
5905 @item -fprofile-arcs
5906 @opindex fprofile-arcs
5907 Add code so that program flow @dfn{arcs} are instrumented.  During
5908 execution the program records how many times each branch and call is
5909 executed and how many times it is taken or returns.  When the compiled
5910 program exits it saves this data to a file called
5911 @file{@var{auxname}.gcda} for each source file.  The data may be used for
5912 profile-directed optimizations (@option{-fbranch-probabilities}), or for
5913 test coverage analysis (@option{-ftest-coverage}).  Each object file's
5914 @var{auxname} is generated from the name of the output file, if
5915 explicitly specified and it is not the final executable, otherwise it is
5916 the basename of the source file.  In both cases any suffix is removed
5917 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
5918 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
5919 @xref{Cross-profiling}.
5921 @cindex @command{gcov}
5922 @item --coverage
5923 @opindex coverage
5925 This option is used to compile and link code instrumented for coverage
5926 analysis.  The option is a synonym for @option{-fprofile-arcs}
5927 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
5928 linking).  See the documentation for those options for more details.
5930 @itemize
5932 @item
5933 Compile the source files with @option{-fprofile-arcs} plus optimization
5934 and code generation options.  For test coverage analysis, use the
5935 additional @option{-ftest-coverage} option.  You do not need to profile
5936 every source file in a program.
5938 @item
5939 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
5940 (the latter implies the former).
5942 @item
5943 Run the program on a representative workload to generate the arc profile
5944 information.  This may be repeated any number of times.  You can run
5945 concurrent instances of your program, and provided that the file system
5946 supports locking, the data files will be correctly updated.  Also
5947 @code{fork} calls are detected and correctly handled (double counting
5948 will not happen).
5950 @item
5951 For profile-directed optimizations, compile the source files again with
5952 the same optimization and code generation options plus
5953 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
5954 Control Optimization}).
5956 @item
5957 For test coverage analysis, use @command{gcov} to produce human readable
5958 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
5959 @command{gcov} documentation for further information.
5961 @end itemize
5963 With @option{-fprofile-arcs}, for each function of your program GCC
5964 creates a program flow graph, then finds a spanning tree for the graph.
5965 Only arcs that are not on the spanning tree have to be instrumented: the
5966 compiler adds code to count the number of times that these arcs are
5967 executed.  When an arc is the only exit or only entrance to a block, the
5968 instrumentation code can be added to the block; otherwise, a new basic
5969 block must be created to hold the instrumentation code.
5971 @need 2000
5972 @item -ftest-coverage
5973 @opindex ftest-coverage
5974 Produce a notes file that the @command{gcov} code-coverage utility
5975 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
5976 show program coverage.  Each source file's note file is called
5977 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
5978 above for a description of @var{auxname} and instructions on how to
5979 generate test coverage data.  Coverage data matches the source files
5980 more closely if you do not optimize.
5982 @item -fdbg-cnt-list
5983 @opindex fdbg-cnt-list
5984 Print the name and the counter upper bound for all debug counters.
5987 @item -fdbg-cnt=@var{counter-value-list}
5988 @opindex fdbg-cnt
5989 Set the internal debug counter upper bound.  @var{counter-value-list}
5990 is a comma-separated list of @var{name}:@var{value} pairs
5991 which sets the upper bound of each debug counter @var{name} to @var{value}.
5992 All debug counters have the initial upper bound of @code{UINT_MAX};
5993 thus @code{dbg_cnt()} returns true always unless the upper bound
5994 is set by this option.
5995 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
5996 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
5998 @item -fenable-@var{kind}-@var{pass}
5999 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
6000 @opindex fdisable-
6001 @opindex fenable-
6003 This is a set of options that are used to explicitly disable/enable
6004 optimization passes.  These options are intended for use for debugging GCC.
6005 Compiler users should use regular options for enabling/disabling
6006 passes instead.
6008 @table @gcctabopt
6010 @item -fdisable-ipa-@var{pass}
6011 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
6012 statically invoked in the compiler multiple times, the pass name should be
6013 appended with a sequential number starting from 1.
6015 @item -fdisable-rtl-@var{pass}
6016 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
6017 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
6018 statically invoked in the compiler multiple times, the pass name should be
6019 appended with a sequential number starting from 1.  @var{range-list} is a 
6020 comma-separated list of function ranges or assembler names.  Each range is a number
6021 pair separated by a colon.  The range is inclusive in both ends.  If the range
6022 is trivial, the number pair can be simplified as a single number.  If the
6023 function's call graph node's @var{uid} falls within one of the specified ranges,
6024 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
6025 function header of a dump file, and the pass names can be dumped by using
6026 option @option{-fdump-passes}.
6028 @item -fdisable-tree-@var{pass}
6029 @itemx -fdisable-tree-@var{pass}=@var{range-list}
6030 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
6031 option arguments.
6033 @item -fenable-ipa-@var{pass}
6034 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
6035 statically invoked in the compiler multiple times, the pass name should be
6036 appended with a sequential number starting from 1.
6038 @item -fenable-rtl-@var{pass}
6039 @itemx -fenable-rtl-@var{pass}=@var{range-list}
6040 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
6041 description and examples.
6043 @item -fenable-tree-@var{pass}
6044 @itemx -fenable-tree-@var{pass}=@var{range-list}
6045 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
6046 of option arguments.
6048 @end table
6050 Here are some examples showing uses of these options.
6052 @smallexample
6054 # disable ccp1 for all functions
6055    -fdisable-tree-ccp1
6056 # disable complete unroll for function whose cgraph node uid is 1
6057    -fenable-tree-cunroll=1
6058 # disable gcse2 for functions at the following ranges [1,1],
6059 # [300,400], and [400,1000]
6060 # disable gcse2 for functions foo and foo2
6061    -fdisable-rtl-gcse2=foo,foo2
6062 # disable early inlining
6063    -fdisable-tree-einline
6064 # disable ipa inlining
6065    -fdisable-ipa-inline
6066 # enable tree full unroll
6067    -fenable-tree-unroll
6069 @end smallexample
6071 @item -d@var{letters}
6072 @itemx -fdump-rtl-@var{pass}
6073 @itemx -fdump-rtl-@var{pass}=@var{filename}
6074 @opindex d
6075 @opindex fdump-rtl-@var{pass}
6076 Says to make debugging dumps during compilation at times specified by
6077 @var{letters}.  This is used for debugging the RTL-based passes of the
6078 compiler.  The file names for most of the dumps are made by appending
6079 a pass number and a word to the @var{dumpname}, and the files are
6080 created in the directory of the output file. In case of
6081 @option{=@var{filename}} option, the dump is output on the given file
6082 instead of the pass numbered dump files. Note that the pass number is
6083 computed statically as passes get registered into the pass manager.
6084 Thus the numbering is not related to the dynamic order of execution of
6085 passes.  In particular, a pass installed by a plugin could have a
6086 number over 200 even if it executed quite early.  @var{dumpname} is
6087 generated from the name of the output file, if explicitly specified
6088 and it is not an executable, otherwise it is the basename of the
6089 source file. These switches may have different effects when
6090 @option{-E} is used for preprocessing.
6092 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
6093 @option{-d} option @var{letters}.  Here are the possible
6094 letters for use in @var{pass} and @var{letters}, and their meanings:
6096 @table @gcctabopt
6098 @item -fdump-rtl-alignments
6099 @opindex fdump-rtl-alignments
6100 Dump after branch alignments have been computed.
6102 @item -fdump-rtl-asmcons
6103 @opindex fdump-rtl-asmcons
6104 Dump after fixing rtl statements that have unsatisfied in/out constraints.
6106 @item -fdump-rtl-auto_inc_dec
6107 @opindex fdump-rtl-auto_inc_dec
6108 Dump after auto-inc-dec discovery.  This pass is only run on
6109 architectures that have auto inc or auto dec instructions.
6111 @item -fdump-rtl-barriers
6112 @opindex fdump-rtl-barriers
6113 Dump after cleaning up the barrier instructions.
6115 @item -fdump-rtl-bbpart
6116 @opindex fdump-rtl-bbpart
6117 Dump after partitioning hot and cold basic blocks.
6119 @item -fdump-rtl-bbro
6120 @opindex fdump-rtl-bbro
6121 Dump after block reordering.
6123 @item -fdump-rtl-btl1
6124 @itemx -fdump-rtl-btl2
6125 @opindex fdump-rtl-btl2
6126 @opindex fdump-rtl-btl2
6127 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
6128 after the two branch
6129 target load optimization passes.
6131 @item -fdump-rtl-bypass
6132 @opindex fdump-rtl-bypass
6133 Dump after jump bypassing and control flow optimizations.
6135 @item -fdump-rtl-combine
6136 @opindex fdump-rtl-combine
6137 Dump after the RTL instruction combination pass.
6139 @item -fdump-rtl-compgotos
6140 @opindex fdump-rtl-compgotos
6141 Dump after duplicating the computed gotos.
6143 @item -fdump-rtl-ce1
6144 @itemx -fdump-rtl-ce2
6145 @itemx -fdump-rtl-ce3
6146 @opindex fdump-rtl-ce1
6147 @opindex fdump-rtl-ce2
6148 @opindex fdump-rtl-ce3
6149 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
6150 @option{-fdump-rtl-ce3} enable dumping after the three
6151 if conversion passes.
6153 @item -fdump-rtl-cprop_hardreg
6154 @opindex fdump-rtl-cprop_hardreg
6155 Dump after hard register copy propagation.
6157 @item -fdump-rtl-csa
6158 @opindex fdump-rtl-csa
6159 Dump after combining stack adjustments.
6161 @item -fdump-rtl-cse1
6162 @itemx -fdump-rtl-cse2
6163 @opindex fdump-rtl-cse1
6164 @opindex fdump-rtl-cse2
6165 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
6166 the two common subexpression elimination passes.
6168 @item -fdump-rtl-dce
6169 @opindex fdump-rtl-dce
6170 Dump after the standalone dead code elimination passes.
6172 @item -fdump-rtl-dbr
6173 @opindex fdump-rtl-dbr
6174 Dump after delayed branch scheduling.
6176 @item -fdump-rtl-dce1
6177 @itemx -fdump-rtl-dce2
6178 @opindex fdump-rtl-dce1
6179 @opindex fdump-rtl-dce2
6180 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
6181 the two dead store elimination passes.
6183 @item -fdump-rtl-eh
6184 @opindex fdump-rtl-eh
6185 Dump after finalization of EH handling code.
6187 @item -fdump-rtl-eh_ranges
6188 @opindex fdump-rtl-eh_ranges
6189 Dump after conversion of EH handling range regions.
6191 @item -fdump-rtl-expand
6192 @opindex fdump-rtl-expand
6193 Dump after RTL generation.
6195 @item -fdump-rtl-fwprop1
6196 @itemx -fdump-rtl-fwprop2
6197 @opindex fdump-rtl-fwprop1
6198 @opindex fdump-rtl-fwprop2
6199 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
6200 dumping after the two forward propagation passes.
6202 @item -fdump-rtl-gcse1
6203 @itemx -fdump-rtl-gcse2
6204 @opindex fdump-rtl-gcse1
6205 @opindex fdump-rtl-gcse2
6206 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
6207 after global common subexpression elimination.
6209 @item -fdump-rtl-init-regs
6210 @opindex fdump-rtl-init-regs
6211 Dump after the initialization of the registers.
6213 @item -fdump-rtl-initvals
6214 @opindex fdump-rtl-initvals
6215 Dump after the computation of the initial value sets.
6217 @item -fdump-rtl-into_cfglayout
6218 @opindex fdump-rtl-into_cfglayout
6219 Dump after converting to cfglayout mode.
6221 @item -fdump-rtl-ira
6222 @opindex fdump-rtl-ira
6223 Dump after iterated register allocation.
6225 @item -fdump-rtl-jump
6226 @opindex fdump-rtl-jump
6227 Dump after the second jump optimization.
6229 @item -fdump-rtl-loop2
6230 @opindex fdump-rtl-loop2
6231 @option{-fdump-rtl-loop2} enables dumping after the rtl
6232 loop optimization passes.
6234 @item -fdump-rtl-mach
6235 @opindex fdump-rtl-mach
6236 Dump after performing the machine dependent reorganization pass, if that
6237 pass exists.
6239 @item -fdump-rtl-mode_sw
6240 @opindex fdump-rtl-mode_sw
6241 Dump after removing redundant mode switches.
6243 @item -fdump-rtl-rnreg
6244 @opindex fdump-rtl-rnreg
6245 Dump after register renumbering.
6247 @item -fdump-rtl-outof_cfglayout
6248 @opindex fdump-rtl-outof_cfglayout
6249 Dump after converting from cfglayout mode.
6251 @item -fdump-rtl-peephole2
6252 @opindex fdump-rtl-peephole2
6253 Dump after the peephole pass.
6255 @item -fdump-rtl-postreload
6256 @opindex fdump-rtl-postreload
6257 Dump after post-reload optimizations.
6259 @item -fdump-rtl-pro_and_epilogue
6260 @opindex fdump-rtl-pro_and_epilogue
6261 Dump after generating the function prologues and epilogues.
6263 @item -fdump-rtl-sched1
6264 @itemx -fdump-rtl-sched2
6265 @opindex fdump-rtl-sched1
6266 @opindex fdump-rtl-sched2
6267 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
6268 after the basic block scheduling passes.
6270 @item -fdump-rtl-ree
6271 @opindex fdump-rtl-ree
6272 Dump after sign/zero extension elimination.
6274 @item -fdump-rtl-seqabstr
6275 @opindex fdump-rtl-seqabstr
6276 Dump after common sequence discovery.
6278 @item -fdump-rtl-shorten
6279 @opindex fdump-rtl-shorten
6280 Dump after shortening branches.
6282 @item -fdump-rtl-sibling
6283 @opindex fdump-rtl-sibling
6284 Dump after sibling call optimizations.
6286 @item -fdump-rtl-split1
6287 @itemx -fdump-rtl-split2
6288 @itemx -fdump-rtl-split3
6289 @itemx -fdump-rtl-split4
6290 @itemx -fdump-rtl-split5
6291 @opindex fdump-rtl-split1
6292 @opindex fdump-rtl-split2
6293 @opindex fdump-rtl-split3
6294 @opindex fdump-rtl-split4
6295 @opindex fdump-rtl-split5
6296 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
6297 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
6298 @option{-fdump-rtl-split5} enable dumping after five rounds of
6299 instruction splitting.
6301 @item -fdump-rtl-sms
6302 @opindex fdump-rtl-sms
6303 Dump after modulo scheduling.  This pass is only run on some
6304 architectures.
6306 @item -fdump-rtl-stack
6307 @opindex fdump-rtl-stack
6308 Dump after conversion from GCC's ``flat register file'' registers to the
6309 x87's stack-like registers.  This pass is only run on x86 variants.
6311 @item -fdump-rtl-subreg1
6312 @itemx -fdump-rtl-subreg2
6313 @opindex fdump-rtl-subreg1
6314 @opindex fdump-rtl-subreg2
6315 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
6316 the two subreg expansion passes.
6318 @item -fdump-rtl-unshare
6319 @opindex fdump-rtl-unshare
6320 Dump after all rtl has been unshared.
6322 @item -fdump-rtl-vartrack
6323 @opindex fdump-rtl-vartrack
6324 Dump after variable tracking.
6326 @item -fdump-rtl-vregs
6327 @opindex fdump-rtl-vregs
6328 Dump after converting virtual registers to hard registers.
6330 @item -fdump-rtl-web
6331 @opindex fdump-rtl-web
6332 Dump after live range splitting.
6334 @item -fdump-rtl-regclass
6335 @itemx -fdump-rtl-subregs_of_mode_init
6336 @itemx -fdump-rtl-subregs_of_mode_finish
6337 @itemx -fdump-rtl-dfinit
6338 @itemx -fdump-rtl-dfinish
6339 @opindex fdump-rtl-regclass
6340 @opindex fdump-rtl-subregs_of_mode_init
6341 @opindex fdump-rtl-subregs_of_mode_finish
6342 @opindex fdump-rtl-dfinit
6343 @opindex fdump-rtl-dfinish
6344 These dumps are defined but always produce empty files.
6346 @item -da
6347 @itemx -fdump-rtl-all
6348 @opindex da
6349 @opindex fdump-rtl-all
6350 Produce all the dumps listed above.
6352 @item -dA
6353 @opindex dA
6354 Annotate the assembler output with miscellaneous debugging information.
6356 @item -dD
6357 @opindex dD
6358 Dump all macro definitions, at the end of preprocessing, in addition to
6359 normal output.
6361 @item -dH
6362 @opindex dH
6363 Produce a core dump whenever an error occurs.
6365 @item -dp
6366 @opindex dp
6367 Annotate the assembler output with a comment indicating which
6368 pattern and alternative is used.  The length of each instruction is
6369 also printed.
6371 @item -dP
6372 @opindex dP
6373 Dump the RTL in the assembler output as a comment before each instruction.
6374 Also turns on @option{-dp} annotation.
6376 @item -dx
6377 @opindex dx
6378 Just generate RTL for a function instead of compiling it.  Usually used
6379 with @option{-fdump-rtl-expand}.
6380 @end table
6382 @item -fdump-noaddr
6383 @opindex fdump-noaddr
6384 When doing debugging dumps, suppress address output.  This makes it more
6385 feasible to use diff on debugging dumps for compiler invocations with
6386 different compiler binaries and/or different
6387 text / bss / data / heap / stack / dso start locations.
6389 @item -freport-bug
6390 @opindex freport-bug
6391 Collect and dump debug information into temporary file if ICE in C/C++
6392 compiler occured.
6394 @item -fdump-unnumbered
6395 @opindex fdump-unnumbered
6396 When doing debugging dumps, suppress instruction numbers and address output.
6397 This makes it more feasible to use diff on debugging dumps for compiler
6398 invocations with different options, in particular with and without
6399 @option{-g}.
6401 @item -fdump-unnumbered-links
6402 @opindex fdump-unnumbered-links
6403 When doing debugging dumps (see @option{-d} option above), suppress
6404 instruction numbers for the links to the previous and next instructions
6405 in a sequence.
6407 @item -fdump-translation-unit @r{(C++ only)}
6408 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
6409 @opindex fdump-translation-unit
6410 Dump a representation of the tree structure for the entire translation
6411 unit to a file.  The file name is made by appending @file{.tu} to the
6412 source file name, and the file is created in the same directory as the
6413 output file.  If the @samp{-@var{options}} form is used, @var{options}
6414 controls the details of the dump as described for the
6415 @option{-fdump-tree} options.
6417 @item -fdump-class-hierarchy @r{(C++ only)}
6418 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
6419 @opindex fdump-class-hierarchy
6420 Dump a representation of each class's hierarchy and virtual function
6421 table layout to a file.  The file name is made by appending
6422 @file{.class} to the source file name, and the file is created in the
6423 same directory as the output file.  If the @samp{-@var{options}} form
6424 is used, @var{options} controls the details of the dump as described
6425 for the @option{-fdump-tree} options.
6427 @item -fdump-ipa-@var{switch}
6428 @opindex fdump-ipa
6429 Control the dumping at various stages of inter-procedural analysis
6430 language tree to a file.  The file name is generated by appending a
6431 switch specific suffix to the source file name, and the file is created
6432 in the same directory as the output file.  The following dumps are
6433 possible:
6435 @table @samp
6436 @item all
6437 Enables all inter-procedural analysis dumps.
6439 @item cgraph
6440 Dumps information about call-graph optimization, unused function removal,
6441 and inlining decisions.
6443 @item inline
6444 Dump after function inlining.
6446 @end table
6448 @item -fdump-passes
6449 @opindex fdump-passes
6450 Dump the list of optimization passes that are turned on and off by
6451 the current command-line options.
6453 @item -fdump-statistics-@var{option}
6454 @opindex fdump-statistics
6455 Enable and control dumping of pass statistics in a separate file.  The
6456 file name is generated by appending a suffix ending in
6457 @samp{.statistics} to the source file name, and the file is created in
6458 the same directory as the output file.  If the @samp{-@var{option}}
6459 form is used, @samp{-stats} causes counters to be summed over the
6460 whole compilation unit while @samp{-details} dumps every event as
6461 the passes generate them.  The default with no option is to sum
6462 counters for each function compiled.
6464 @item -fdump-tree-@var{switch}
6465 @itemx -fdump-tree-@var{switch}-@var{options}
6466 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
6467 @opindex fdump-tree
6468 Control the dumping at various stages of processing the intermediate
6469 language tree to a file.  The file name is generated by appending a
6470 switch-specific suffix to the source file name, and the file is
6471 created in the same directory as the output file. In case of
6472 @option{=@var{filename}} option, the dump is output on the given file
6473 instead of the auto named dump files.  If the @samp{-@var{options}}
6474 form is used, @var{options} is a list of @samp{-} separated options
6475 which control the details of the dump.  Not all options are applicable
6476 to all dumps; those that are not meaningful are ignored.  The
6477 following options are available
6479 @table @samp
6480 @item address
6481 Print the address of each node.  Usually this is not meaningful as it
6482 changes according to the environment and source file.  Its primary use
6483 is for tying up a dump file with a debug environment.
6484 @item asmname
6485 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
6486 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
6487 use working backward from mangled names in the assembly file.
6488 @item slim
6489 When dumping front-end intermediate representations, inhibit dumping
6490 of members of a scope or body of a function merely because that scope
6491 has been reached.  Only dump such items when they are directly reachable
6492 by some other path.
6494 When dumping pretty-printed trees, this option inhibits dumping the
6495 bodies of control structures.
6497 When dumping RTL, print the RTL in slim (condensed) form instead of
6498 the default LISP-like representation.
6499 @item raw
6500 Print a raw representation of the tree.  By default, trees are
6501 pretty-printed into a C-like representation.
6502 @item details
6503 Enable more detailed dumps (not honored by every dump option). Also
6504 include information from the optimization passes.
6505 @item stats
6506 Enable dumping various statistics about the pass (not honored by every dump
6507 option).
6508 @item blocks
6509 Enable showing basic block boundaries (disabled in raw dumps).
6510 @item graph
6511 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
6512 dump a representation of the control flow graph suitable for viewing with
6513 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
6514 the file is pretty-printed as a subgraph, so that GraphViz can render them
6515 all in a single plot.
6517 This option currently only works for RTL dumps, and the RTL is always
6518 dumped in slim form.
6519 @item vops
6520 Enable showing virtual operands for every statement.
6521 @item lineno
6522 Enable showing line numbers for statements.
6523 @item uid
6524 Enable showing the unique ID (@code{DECL_UID}) for each variable.
6525 @item verbose
6526 Enable showing the tree dump for each statement.
6527 @item eh
6528 Enable showing the EH region number holding each statement.
6529 @item scev
6530 Enable showing scalar evolution analysis details.
6531 @item optimized
6532 Enable showing optimization information (only available in certain
6533 passes).
6534 @item missed
6535 Enable showing missed optimization information (only available in certain
6536 passes).
6537 @item note
6538 Enable other detailed optimization information (only available in
6539 certain passes).
6540 @item =@var{filename}
6541 Instead of an auto named dump file, output into the given file
6542 name. The file names @file{stdout} and @file{stderr} are treated
6543 specially and are considered already open standard streams. For
6544 example,
6546 @smallexample
6547 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
6548      -fdump-tree-pre=stderr file.c
6549 @end smallexample
6551 outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
6552 output on to @file{stderr}. If two conflicting dump filenames are
6553 given for the same pass, then the latter option overrides the earlier
6554 one.
6556 @item all
6557 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
6558 and @option{lineno}.
6560 @item optall
6561 Turn on all optimization options, i.e., @option{optimized},
6562 @option{missed}, and @option{note}.
6563 @end table
6565 The following tree dumps are possible:
6566 @table @samp
6568 @item original
6569 @opindex fdump-tree-original
6570 Dump before any tree based optimization, to @file{@var{file}.original}.
6572 @item optimized
6573 @opindex fdump-tree-optimized
6574 Dump after all tree based optimization, to @file{@var{file}.optimized}.
6576 @item gimple
6577 @opindex fdump-tree-gimple
6578 Dump each function before and after the gimplification pass to a file.  The
6579 file name is made by appending @file{.gimple} to the source file name.
6581 @item cfg
6582 @opindex fdump-tree-cfg
6583 Dump the control flow graph of each function to a file.  The file name is
6584 made by appending @file{.cfg} to the source file name.
6586 @item ch
6587 @opindex fdump-tree-ch
6588 Dump each function after copying loop headers.  The file name is made by
6589 appending @file{.ch} to the source file name.
6591 @item ssa
6592 @opindex fdump-tree-ssa
6593 Dump SSA related information to a file.  The file name is made by appending
6594 @file{.ssa} to the source file name.
6596 @item alias
6597 @opindex fdump-tree-alias
6598 Dump aliasing information for each function.  The file name is made by
6599 appending @file{.alias} to the source file name.
6601 @item ccp
6602 @opindex fdump-tree-ccp
6603 Dump each function after CCP@.  The file name is made by appending
6604 @file{.ccp} to the source file name.
6606 @item storeccp
6607 @opindex fdump-tree-storeccp
6608 Dump each function after STORE-CCP@.  The file name is made by appending
6609 @file{.storeccp} to the source file name.
6611 @item pre
6612 @opindex fdump-tree-pre
6613 Dump trees after partial redundancy elimination.  The file name is made
6614 by appending @file{.pre} to the source file name.
6616 @item fre
6617 @opindex fdump-tree-fre
6618 Dump trees after full redundancy elimination.  The file name is made
6619 by appending @file{.fre} to the source file name.
6621 @item copyprop
6622 @opindex fdump-tree-copyprop
6623 Dump trees after copy propagation.  The file name is made
6624 by appending @file{.copyprop} to the source file name.
6626 @item store_copyprop
6627 @opindex fdump-tree-store_copyprop
6628 Dump trees after store copy-propagation.  The file name is made
6629 by appending @file{.store_copyprop} to the source file name.
6631 @item dce
6632 @opindex fdump-tree-dce
6633 Dump each function after dead code elimination.  The file name is made by
6634 appending @file{.dce} to the source file name.
6636 @item sra
6637 @opindex fdump-tree-sra
6638 Dump each function after performing scalar replacement of aggregates.  The
6639 file name is made by appending @file{.sra} to the source file name.
6641 @item sink
6642 @opindex fdump-tree-sink
6643 Dump each function after performing code sinking.  The file name is made
6644 by appending @file{.sink} to the source file name.
6646 @item dom
6647 @opindex fdump-tree-dom
6648 Dump each function after applying dominator tree optimizations.  The file
6649 name is made by appending @file{.dom} to the source file name.
6651 @item dse
6652 @opindex fdump-tree-dse
6653 Dump each function after applying dead store elimination.  The file
6654 name is made by appending @file{.dse} to the source file name.
6656 @item phiopt
6657 @opindex fdump-tree-phiopt
6658 Dump each function after optimizing PHI nodes into straightline code.  The file
6659 name is made by appending @file{.phiopt} to the source file name.
6661 @item forwprop
6662 @opindex fdump-tree-forwprop
6663 Dump each function after forward propagating single use variables.  The file
6664 name is made by appending @file{.forwprop} to the source file name.
6666 @item copyrename
6667 @opindex fdump-tree-copyrename
6668 Dump each function after applying the copy rename optimization.  The file
6669 name is made by appending @file{.copyrename} to the source file name.
6671 @item nrv
6672 @opindex fdump-tree-nrv
6673 Dump each function after applying the named return value optimization on
6674 generic trees.  The file name is made by appending @file{.nrv} to the source
6675 file name.
6677 @item vect
6678 @opindex fdump-tree-vect
6679 Dump each function after applying vectorization of loops.  The file name is
6680 made by appending @file{.vect} to the source file name.
6682 @item slp
6683 @opindex fdump-tree-slp
6684 Dump each function after applying vectorization of basic blocks.  The file name
6685 is made by appending @file{.slp} to the source file name.
6687 @item vrp
6688 @opindex fdump-tree-vrp
6689 Dump each function after Value Range Propagation (VRP).  The file name
6690 is made by appending @file{.vrp} to the source file name.
6692 @item all
6693 @opindex fdump-tree-all
6694 Enable all the available tree dumps with the flags provided in this option.
6695 @end table
6697 @item -fopt-info
6698 @itemx -fopt-info-@var{options}
6699 @itemx -fopt-info-@var{options}=@var{filename}
6700 @opindex fopt-info
6701 Controls optimization dumps from various optimization passes. If the
6702 @samp{-@var{options}} form is used, @var{options} is a list of
6703 @samp{-} separated options to select the dump details and
6704 optimizations.  If @var{options} is not specified, it defaults to
6705 @option{optimized} for details and @option{optall} for optimization
6706 groups. If the @var{filename} is not specified, it defaults to
6707 @file{stderr}. Note that the output @var{filename} will be overwritten
6708 in case of multiple translation units. If a combined output from
6709 multiple translation units is desired, @file{stderr} should be used
6710 instead.
6712 The options can be divided into two groups, 1) options describing the
6713 verbosity of the dump, and 2) options describing which optimizations
6714 should be included. The options from both the groups can be freely
6715 mixed as they are non-overlapping. However, in case of any conflicts,
6716 the latter options override the earlier options on the command
6717 line. Though multiple -fopt-info options are accepted, only one of
6718 them can have @option{=filename}. If other filenames are provided then
6719 all but the first one are ignored.
6721 The dump verbosity has the following options
6723 @table @samp
6724 @item optimized
6725 Print information when an optimization is successfully applied. It is
6726 up to a pass to decide which information is relevant. For example, the
6727 vectorizer passes print the source location of loops which got
6728 successfully vectorized.
6729 @item missed
6730 Print information about missed optimizations. Individual passes
6731 control which information to include in the output. For example,
6733 @smallexample
6734 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
6735 @end smallexample
6737 will print information about missed optimization opportunities from
6738 vectorization passes on stderr.
6739 @item note
6740 Print verbose information about optimizations, such as certain
6741 transformations, more detailed messages about decisions etc.
6742 @item all
6743 Print detailed optimization information. This includes
6744 @var{optimized}, @var{missed}, and @var{note}.
6745 @end table
6747 The second set of options describes a group of optimizations and may
6748 include one or more of the following.
6750 @table @samp
6751 @item ipa
6752 Enable dumps from all interprocedural optimizations.
6753 @item loop
6754 Enable dumps from all loop optimizations.
6755 @item inline
6756 Enable dumps from all inlining optimizations.
6757 @item vec
6758 Enable dumps from all vectorization optimizations.
6759 @item optall
6760 Enable dumps from all optimizations. This is a superset of
6761 the optimization groups listed above.
6762 @end table
6764 For example,
6765 @smallexample
6766 gcc -O3 -fopt-info-missed=missed.all
6767 @end smallexample
6769 outputs missed optimization report from all the passes into
6770 @file{missed.all}.
6772 As another example,
6773 @smallexample
6774 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
6775 @end smallexample
6777 will output information about missed optimizations as well as
6778 optimized locations from all the inlining passes into
6779 @file{inline.txt}.
6781 If the @var{filename} is provided, then the dumps from all the
6782 applicable optimizations are concatenated into the @file{filename}.
6783 Otherwise the dump is output onto @file{stderr}. If @var{options} is
6784 omitted, it defaults to @option{all-optall}, which means dump all
6785 available optimization info from all the passes. In the following
6786 example, all optimization info is output on to @file{stderr}.
6788 @smallexample
6789 gcc -O3 -fopt-info
6790 @end smallexample
6792 Note that @option{-fopt-info-vec-missed} behaves the same as
6793 @option{-fopt-info-missed-vec}.
6795 As another example, consider
6797 @smallexample
6798 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
6799 @end smallexample
6801 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
6802 in conflict since only one output file is allowed. In this case, only
6803 the first option takes effect and the subsequent options are
6804 ignored. Thus only the @file{vec.miss} is produced which contains
6805 dumps from the vectorizer about missed opportunities.
6807 @item -frandom-seed=@var{string}
6808 @opindex frandom-seed
6809 This option provides a seed that GCC uses in place of
6810 random numbers in generating certain symbol names
6811 that have to be different in every compiled file.  It is also used to
6812 place unique stamps in coverage data files and the object files that
6813 produce them.  You can use the @option{-frandom-seed} option to produce
6814 reproducibly identical object files.
6816 The @var{string} should be different for every file you compile.
6818 @item -fsched-verbose=@var{n}
6819 @opindex fsched-verbose
6820 On targets that use instruction scheduling, this option controls the
6821 amount of debugging output the scheduler prints.  This information is
6822 written to standard error, unless @option{-fdump-rtl-sched1} or
6823 @option{-fdump-rtl-sched2} is specified, in which case it is output
6824 to the usual dump listing file, @file{.sched1} or @file{.sched2}
6825 respectively.  However for @var{n} greater than nine, the output is
6826 always printed to standard error.
6828 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
6829 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
6830 For @var{n} greater than one, it also output basic block probabilities,
6831 detailed ready list information and unit/insn info.  For @var{n} greater
6832 than two, it includes RTL at abort point, control-flow and regions info.
6833 And for @var{n} over four, @option{-fsched-verbose} also includes
6834 dependence info.
6836 @item -save-temps
6837 @itemx -save-temps=cwd
6838 @opindex save-temps
6839 Store the usual ``temporary'' intermediate files permanently; place them
6840 in the current directory and name them based on the source file.  Thus,
6841 compiling @file{foo.c} with @option{-c -save-temps} produces files
6842 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
6843 preprocessed @file{foo.i} output file even though the compiler now
6844 normally uses an integrated preprocessor.
6846 When used in combination with the @option{-x} command-line option,
6847 @option{-save-temps} is sensible enough to avoid over writing an
6848 input source file with the same extension as an intermediate file.
6849 The corresponding intermediate file may be obtained by renaming the
6850 source file before using @option{-save-temps}.
6852 If you invoke GCC in parallel, compiling several different source
6853 files that share a common base name in different subdirectories or the
6854 same source file compiled for multiple output destinations, it is
6855 likely that the different parallel compilers will interfere with each
6856 other, and overwrite the temporary files.  For instance:
6858 @smallexample
6859 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
6860 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
6861 @end smallexample
6863 may result in @file{foo.i} and @file{foo.o} being written to
6864 simultaneously by both compilers.
6866 @item -save-temps=obj
6867 @opindex save-temps=obj
6868 Store the usual ``temporary'' intermediate files permanently.  If the
6869 @option{-o} option is used, the temporary files are based on the
6870 object file.  If the @option{-o} option is not used, the
6871 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
6873 For example:
6875 @smallexample
6876 gcc -save-temps=obj -c foo.c
6877 gcc -save-temps=obj -c bar.c -o dir/xbar.o
6878 gcc -save-temps=obj foobar.c -o dir2/yfoobar
6879 @end smallexample
6881 @noindent
6882 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
6883 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
6884 @file{dir2/yfoobar.o}.
6886 @item -time@r{[}=@var{file}@r{]}
6887 @opindex time
6888 Report the CPU time taken by each subprocess in the compilation
6889 sequence.  For C source files, this is the compiler proper and assembler
6890 (plus the linker if linking is done).
6892 Without the specification of an output file, the output looks like this:
6894 @smallexample
6895 # cc1 0.12 0.01
6896 # as 0.00 0.01
6897 @end smallexample
6899 The first number on each line is the ``user time'', that is time spent
6900 executing the program itself.  The second number is ``system time'',
6901 time spent executing operating system routines on behalf of the program.
6902 Both numbers are in seconds.
6904 With the specification of an output file, the output is appended to the
6905 named file, and it looks like this:
6907 @smallexample
6908 0.12 0.01 cc1 @var{options}
6909 0.00 0.01 as @var{options}
6910 @end smallexample
6912 The ``user time'' and the ``system time'' are moved before the program
6913 name, and the options passed to the program are displayed, so that one
6914 can later tell what file was being compiled, and with which options.
6916 @item -fvar-tracking
6917 @opindex fvar-tracking
6918 Run variable tracking pass.  It computes where variables are stored at each
6919 position in code.  Better debugging information is then generated
6920 (if the debugging information format supports this information).
6922 It is enabled by default when compiling with optimization (@option{-Os},
6923 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
6924 the debug info format supports it.
6926 @item -fvar-tracking-assignments
6927 @opindex fvar-tracking-assignments
6928 @opindex fno-var-tracking-assignments
6929 Annotate assignments to user variables early in the compilation and
6930 attempt to carry the annotations over throughout the compilation all the
6931 way to the end, in an attempt to improve debug information while
6932 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
6934 It can be enabled even if var-tracking is disabled, in which case
6935 annotations are created and maintained, but discarded at the end.
6937 @item -fvar-tracking-assignments-toggle
6938 @opindex fvar-tracking-assignments-toggle
6939 @opindex fno-var-tracking-assignments-toggle
6940 Toggle @option{-fvar-tracking-assignments}, in the same way that
6941 @option{-gtoggle} toggles @option{-g}.
6943 @item -print-file-name=@var{library}
6944 @opindex print-file-name
6945 Print the full absolute name of the library file @var{library} that
6946 would be used when linking---and don't do anything else.  With this
6947 option, GCC does not compile or link anything; it just prints the
6948 file name.
6950 @item -print-multi-directory
6951 @opindex print-multi-directory
6952 Print the directory name corresponding to the multilib selected by any
6953 other switches present in the command line.  This directory is supposed
6954 to exist in @env{GCC_EXEC_PREFIX}.
6956 @item -print-multi-lib
6957 @opindex print-multi-lib
6958 Print the mapping from multilib directory names to compiler switches
6959 that enable them.  The directory name is separated from the switches by
6960 @samp{;}, and each switch starts with an @samp{@@} instead of the
6961 @samp{-}, without spaces between multiple switches.  This is supposed to
6962 ease shell processing.
6964 @item -print-multi-os-directory
6965 @opindex print-multi-os-directory
6966 Print the path to OS libraries for the selected
6967 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
6968 present in the @file{lib} subdirectory and no multilibs are used, this is
6969 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
6970 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
6971 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
6972 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
6974 @item -print-multiarch
6975 @opindex print-multiarch
6976 Print the path to OS libraries for the selected multiarch,
6977 relative to some @file{lib} subdirectory.
6979 @item -print-prog-name=@var{program}
6980 @opindex print-prog-name
6981 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
6983 @item -print-libgcc-file-name
6984 @opindex print-libgcc-file-name
6985 Same as @option{-print-file-name=libgcc.a}.
6987 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
6988 but you do want to link with @file{libgcc.a}.  You can do:
6990 @smallexample
6991 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
6992 @end smallexample
6994 @item -print-search-dirs
6995 @opindex print-search-dirs
6996 Print the name of the configured installation directory and a list of
6997 program and library directories @command{gcc} searches---and don't do anything else.
6999 This is useful when @command{gcc} prints the error message
7000 @samp{installation problem, cannot exec cpp0: No such file or directory}.
7001 To resolve this you either need to put @file{cpp0} and the other compiler
7002 components where @command{gcc} expects to find them, or you can set the environment
7003 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
7004 Don't forget the trailing @samp{/}.
7005 @xref{Environment Variables}.
7007 @item -print-sysroot
7008 @opindex print-sysroot
7009 Print the target sysroot directory that is used during
7010 compilation.  This is the target sysroot specified either at configure
7011 time or using the @option{--sysroot} option, possibly with an extra
7012 suffix that depends on compilation options.  If no target sysroot is
7013 specified, the option prints nothing.
7015 @item -print-sysroot-headers-suffix
7016 @opindex print-sysroot-headers-suffix
7017 Print the suffix added to the target sysroot when searching for
7018 headers, or give an error if the compiler is not configured with such
7019 a suffix---and don't do anything else.
7021 @item -dumpmachine
7022 @opindex dumpmachine
7023 Print the compiler's target machine (for example,
7024 @samp{i686-pc-linux-gnu})---and don't do anything else.
7026 @item -dumpversion
7027 @opindex dumpversion
7028 Print the compiler version (for example, @samp{3.0})---and don't do
7029 anything else.
7031 @item -dumpspecs
7032 @opindex dumpspecs
7033 Print the compiler's built-in specs---and don't do anything else.  (This
7034 is used when GCC itself is being built.)  @xref{Spec Files}.
7036 @item -fno-eliminate-unused-debug-types
7037 @opindex feliminate-unused-debug-types
7038 @opindex fno-eliminate-unused-debug-types
7039 Normally, when producing DWARF 2 output, GCC avoids producing debug symbol 
7040 output for types that are nowhere used in the source file being compiled.
7041 Sometimes it is useful to have GCC emit debugging
7042 information for all types declared in a compilation
7043 unit, regardless of whether or not they are actually used
7044 in that compilation unit, for example 
7045 if, in the debugger, you want to cast a value to a type that is
7046 not actually used in your program (but is declared).  More often,
7047 however, this results in a significant amount of wasted space.
7048 @end table
7050 @node Optimize Options
7051 @section Options That Control Optimization
7052 @cindex optimize options
7053 @cindex options, optimization
7055 These options control various sorts of optimizations.
7057 Without any optimization option, the compiler's goal is to reduce the
7058 cost of compilation and to make debugging produce the expected
7059 results.  Statements are independent: if you stop the program with a
7060 breakpoint between statements, you can then assign a new value to any
7061 variable or change the program counter to any other statement in the
7062 function and get exactly the results you expect from the source
7063 code.
7065 Turning on optimization flags makes the compiler attempt to improve
7066 the performance and/or code size at the expense of compilation time
7067 and possibly the ability to debug the program.
7069 The compiler performs optimization based on the knowledge it has of the
7070 program.  Compiling multiple files at once to a single output file mode allows
7071 the compiler to use information gained from all of the files when compiling
7072 each of them.
7074 Not all optimizations are controlled directly by a flag.  Only
7075 optimizations that have a flag are listed in this section.
7077 Most optimizations are only enabled if an @option{-O} level is set on
7078 the command line.  Otherwise they are disabled, even if individual
7079 optimization flags are specified.
7081 Depending on the target and how GCC was configured, a slightly different
7082 set of optimizations may be enabled at each @option{-O} level than
7083 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
7084 to find out the exact set of optimizations that are enabled at each level.
7085 @xref{Overall Options}, for examples.
7087 @table @gcctabopt
7088 @item -O
7089 @itemx -O1
7090 @opindex O
7091 @opindex O1
7092 Optimize.  Optimizing compilation takes somewhat more time, and a lot
7093 more memory for a large function.
7095 With @option{-O}, the compiler tries to reduce code size and execution
7096 time, without performing any optimizations that take a great deal of
7097 compilation time.
7099 @option{-O} turns on the following optimization flags:
7100 @gccoptlist{
7101 -fauto-inc-dec @gol
7102 -fbranch-count-reg @gol
7103 -fcombine-stack-adjustments @gol
7104 -fcompare-elim @gol
7105 -fcprop-registers @gol
7106 -fdce @gol
7107 -fdefer-pop @gol
7108 -fdelayed-branch @gol
7109 -fdse @gol
7110 -fforward-propagate @gol
7111 -fguess-branch-probability @gol
7112 -fif-conversion2 @gol
7113 -fif-conversion @gol
7114 -finline-functions-called-once @gol
7115 -fipa-pure-const @gol
7116 -fipa-profile @gol
7117 -fipa-reference @gol
7118 -fmerge-constants @gol
7119 -fmove-loop-invariants @gol
7120 -fshrink-wrap @gol
7121 -fsplit-wide-types @gol
7122 -ftree-bit-ccp @gol
7123 -ftree-ccp @gol
7124 -fssa-phiopt @gol
7125 -ftree-ch @gol
7126 -ftree-copy-prop @gol
7127 -ftree-copyrename @gol
7128 -ftree-dce @gol
7129 -ftree-dominator-opts @gol
7130 -ftree-dse @gol
7131 -ftree-forwprop @gol
7132 -ftree-fre @gol
7133 -ftree-phiprop @gol
7134 -ftree-sink @gol
7135 -ftree-slsr @gol
7136 -ftree-sra @gol
7137 -ftree-pta @gol
7138 -ftree-ter @gol
7139 -funit-at-a-time}
7141 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
7142 where doing so does not interfere with debugging.
7144 @item -O2
7145 @opindex O2
7146 Optimize even more.  GCC performs nearly all supported optimizations
7147 that do not involve a space-speed tradeoff.
7148 As compared to @option{-O}, this option increases both compilation time
7149 and the performance of the generated code.
7151 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
7152 also turns on the following optimization flags:
7153 @gccoptlist{-fthread-jumps @gol
7154 -falign-functions  -falign-jumps @gol
7155 -falign-loops  -falign-labels @gol
7156 -fcaller-saves @gol
7157 -fcrossjumping @gol
7158 -fcse-follow-jumps  -fcse-skip-blocks @gol
7159 -fdelete-null-pointer-checks @gol
7160 -fdevirtualize -fdevirtualize-speculatively @gol
7161 -fexpensive-optimizations @gol
7162 -fgcse  -fgcse-lm  @gol
7163 -fhoist-adjacent-loads @gol
7164 -finline-small-functions @gol
7165 -findirect-inlining @gol
7166 -fipa-cp @gol
7167 -fipa-sra @gol
7168 -fipa-icf @gol
7169 -fisolate-erroneous-paths-dereference @gol
7170 -foptimize-sibling-calls @gol
7171 -foptimize-strlen @gol
7172 -fpartial-inlining @gol
7173 -fpeephole2 @gol
7174 -freorder-blocks -freorder-blocks-and-partition -freorder-functions @gol
7175 -frerun-cse-after-loop  @gol
7176 -fsched-interblock  -fsched-spec @gol
7177 -fschedule-insns  -fschedule-insns2 @gol
7178 -fstrict-aliasing -fstrict-overflow @gol
7179 -ftree-builtin-call-dce @gol
7180 -ftree-switch-conversion -ftree-tail-merge @gol
7181 -ftree-pre @gol
7182 -ftree-vrp @gol
7183 -fuse-caller-save}
7185 Please note the warning under @option{-fgcse} about
7186 invoking @option{-O2} on programs that use computed gotos.
7188 @item -O3
7189 @opindex O3
7190 Optimize yet more.  @option{-O3} turns on all optimizations specified
7191 by @option{-O2} and also turns on the @option{-finline-functions},
7192 @option{-funswitch-loops}, @option{-fpredictive-commoning},
7193 @option{-fgcse-after-reload}, @option{-ftree-loop-vectorize},
7194 @option{-ftree-loop-distribute-patterns},
7195 @option{-ftree-slp-vectorize}, @option{-fvect-cost-model},
7196 @option{-ftree-partial-pre} and @option{-fipa-cp-clone} options.
7198 @item -O0
7199 @opindex O0
7200 Reduce compilation time and make debugging produce the expected
7201 results.  This is the default.
7203 @item -Os
7204 @opindex Os
7205 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
7206 do not typically increase code size.  It also performs further
7207 optimizations designed to reduce code size.
7209 @option{-Os} disables the following optimization flags:
7210 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
7211 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
7212 -fprefetch-loop-arrays}
7214 @item -Ofast
7215 @opindex Ofast
7216 Disregard strict standards compliance.  @option{-Ofast} enables all
7217 @option{-O3} optimizations.  It also enables optimizations that are not
7218 valid for all standard-compliant programs.
7219 It turns on @option{-ffast-math} and the Fortran-specific
7220 @option{-fno-protect-parens} and @option{-fstack-arrays}.
7222 @item -Og
7223 @opindex Og
7224 Optimize debugging experience.  @option{-Og} enables optimizations
7225 that do not interfere with debugging. It should be the optimization
7226 level of choice for the standard edit-compile-debug cycle, offering
7227 a reasonable level of optimization while maintaining fast compilation
7228 and a good debugging experience.
7230 If you use multiple @option{-O} options, with or without level numbers,
7231 the last such option is the one that is effective.
7232 @end table
7234 Options of the form @option{-f@var{flag}} specify machine-independent
7235 flags.  Most flags have both positive and negative forms; the negative
7236 form of @option{-ffoo} is @option{-fno-foo}.  In the table
7237 below, only one of the forms is listed---the one you typically 
7238 use.  You can figure out the other form by either removing @samp{no-}
7239 or adding it.
7241 The following options control specific optimizations.  They are either
7242 activated by @option{-O} options or are related to ones that are.  You
7243 can use the following flags in the rare cases when ``fine-tuning'' of
7244 optimizations to be performed is desired.
7246 @table @gcctabopt
7247 @item -fno-defer-pop
7248 @opindex fno-defer-pop
7249 Always pop the arguments to each function call as soon as that function
7250 returns.  For machines that must pop arguments after a function call,
7251 the compiler normally lets arguments accumulate on the stack for several
7252 function calls and pops them all at once.
7254 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7256 @item -fforward-propagate
7257 @opindex fforward-propagate
7258 Perform a forward propagation pass on RTL@.  The pass tries to combine two
7259 instructions and checks if the result can be simplified.  If loop unrolling
7260 is active, two passes are performed and the second is scheduled after
7261 loop unrolling.
7263 This option is enabled by default at optimization levels @option{-O},
7264 @option{-O2}, @option{-O3}, @option{-Os}.
7266 @item -ffp-contract=@var{style}
7267 @opindex ffp-contract
7268 @option{-ffp-contract=off} disables floating-point expression contraction.
7269 @option{-ffp-contract=fast} enables floating-point expression contraction
7270 such as forming of fused multiply-add operations if the target has
7271 native support for them.
7272 @option{-ffp-contract=on} enables floating-point expression contraction
7273 if allowed by the language standard.  This is currently not implemented
7274 and treated equal to @option{-ffp-contract=off}.
7276 The default is @option{-ffp-contract=fast}.
7278 @item -fomit-frame-pointer
7279 @opindex fomit-frame-pointer
7280 Don't keep the frame pointer in a register for functions that
7281 don't need one.  This avoids the instructions to save, set up and
7282 restore frame pointers; it also makes an extra register available
7283 in many functions.  @strong{It also makes debugging impossible on
7284 some machines.}
7286 On some machines, such as the VAX, this flag has no effect, because
7287 the standard calling sequence automatically handles the frame pointer
7288 and nothing is saved by pretending it doesn't exist.  The
7289 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
7290 whether a target machine supports this flag.  @xref{Registers,,Register
7291 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
7293 Starting with GCC version 4.6, the default setting (when not optimizing for
7294 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets has been changed to
7295 @option{-fomit-frame-pointer}.  The default can be reverted to
7296 @option{-fno-omit-frame-pointer} by configuring GCC with the
7297 @option{--enable-frame-pointer} configure option.
7299 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7301 @item -foptimize-sibling-calls
7302 @opindex foptimize-sibling-calls
7303 Optimize sibling and tail recursive calls.
7305 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7307 @item -foptimize-strlen
7308 @opindex foptimize-strlen
7309 Optimize various standard C string functions (e.g. @code{strlen},
7310 @code{strchr} or @code{strcpy}) and
7311 their @code{_FORTIFY_SOURCE} counterparts into faster alternatives.
7313 Enabled at levels @option{-O2}, @option{-O3}.
7315 @item -fno-inline
7316 @opindex fno-inline
7317 Do not expand any functions inline apart from those marked with
7318 the @code{always_inline} attribute.  This is the default when not
7319 optimizing.
7321 Single functions can be exempted from inlining by marking them
7322 with the @code{noinline} attribute.
7324 @item -finline-small-functions
7325 @opindex finline-small-functions
7326 Integrate functions into their callers when their body is smaller than expected
7327 function call code (so overall size of program gets smaller).  The compiler
7328 heuristically decides which functions are simple enough to be worth integrating
7329 in this way.  This inlining applies to all functions, even those not declared
7330 inline.
7332 Enabled at level @option{-O2}.
7334 @item -findirect-inlining
7335 @opindex findirect-inlining
7336 Inline also indirect calls that are discovered to be known at compile
7337 time thanks to previous inlining.  This option has any effect only
7338 when inlining itself is turned on by the @option{-finline-functions}
7339 or @option{-finline-small-functions} options.
7341 Enabled at level @option{-O2}.
7343 @item -finline-functions
7344 @opindex finline-functions
7345 Consider all functions for inlining, even if they are not declared inline.
7346 The compiler heuristically decides which functions are worth integrating
7347 in this way.
7349 If all calls to a given function are integrated, and the function is
7350 declared @code{static}, then the function is normally not output as
7351 assembler code in its own right.
7353 Enabled at level @option{-O3}.
7355 @item -finline-functions-called-once
7356 @opindex finline-functions-called-once
7357 Consider all @code{static} functions called once for inlining into their
7358 caller even if they are not marked @code{inline}.  If a call to a given
7359 function is integrated, then the function is not output as assembler code
7360 in its own right.
7362 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
7364 @item -fearly-inlining
7365 @opindex fearly-inlining
7366 Inline functions marked by @code{always_inline} and functions whose body seems
7367 smaller than the function call overhead early before doing
7368 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
7369 makes profiling significantly cheaper and usually inlining faster on programs
7370 having large chains of nested wrapper functions.
7372 Enabled by default.
7374 @item -fipa-sra
7375 @opindex fipa-sra
7376 Perform interprocedural scalar replacement of aggregates, removal of
7377 unused parameters and replacement of parameters passed by reference
7378 by parameters passed by value.
7380 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
7382 @item -finline-limit=@var{n}
7383 @opindex finline-limit
7384 By default, GCC limits the size of functions that can be inlined.  This flag
7385 allows coarse control of this limit.  @var{n} is the size of functions that
7386 can be inlined in number of pseudo instructions.
7388 Inlining is actually controlled by a number of parameters, which may be
7389 specified individually by using @option{--param @var{name}=@var{value}}.
7390 The @option{-finline-limit=@var{n}} option sets some of these parameters
7391 as follows:
7393 @table @gcctabopt
7394 @item max-inline-insns-single
7395 is set to @var{n}/2.
7396 @item max-inline-insns-auto
7397 is set to @var{n}/2.
7398 @end table
7400 See below for a documentation of the individual
7401 parameters controlling inlining and for the defaults of these parameters.
7403 @emph{Note:} there may be no value to @option{-finline-limit} that results
7404 in default behavior.
7406 @emph{Note:} pseudo instruction represents, in this particular context, an
7407 abstract measurement of function's size.  In no way does it represent a count
7408 of assembly instructions and as such its exact meaning might change from one
7409 release to an another.
7411 @item -fno-keep-inline-dllexport
7412 @opindex -fno-keep-inline-dllexport
7413 This is a more fine-grained version of @option{-fkeep-inline-functions},
7414 which applies only to functions that are declared using the @code{dllexport}
7415 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
7416 Functions}.)
7418 @item -fkeep-inline-functions
7419 @opindex fkeep-inline-functions
7420 In C, emit @code{static} functions that are declared @code{inline}
7421 into the object file, even if the function has been inlined into all
7422 of its callers.  This switch does not affect functions using the
7423 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
7424 inline functions into the object file.
7426 @item -fkeep-static-consts
7427 @opindex fkeep-static-consts
7428 Emit variables declared @code{static const} when optimization isn't turned
7429 on, even if the variables aren't referenced.
7431 GCC enables this option by default.  If you want to force the compiler to
7432 check if a variable is referenced, regardless of whether or not
7433 optimization is turned on, use the @option{-fno-keep-static-consts} option.
7435 @item -fmerge-constants
7436 @opindex fmerge-constants
7437 Attempt to merge identical constants (string constants and floating-point
7438 constants) across compilation units.
7440 This option is the default for optimized compilation if the assembler and
7441 linker support it.  Use @option{-fno-merge-constants} to inhibit this
7442 behavior.
7444 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7446 @item -fmerge-all-constants
7447 @opindex fmerge-all-constants
7448 Attempt to merge identical constants and identical variables.
7450 This option implies @option{-fmerge-constants}.  In addition to
7451 @option{-fmerge-constants} this considers e.g.@: even constant initialized
7452 arrays or initialized constant variables with integral or floating-point
7453 types.  Languages like C or C++ require each variable, including multiple
7454 instances of the same variable in recursive calls, to have distinct locations,
7455 so using this option results in non-conforming
7456 behavior.
7458 @item -fmodulo-sched
7459 @opindex fmodulo-sched
7460 Perform swing modulo scheduling immediately before the first scheduling
7461 pass.  This pass looks at innermost loops and reorders their
7462 instructions by overlapping different iterations.
7464 @item -fmodulo-sched-allow-regmoves
7465 @opindex fmodulo-sched-allow-regmoves
7466 Perform more aggressive SMS-based modulo scheduling with register moves
7467 allowed.  By setting this flag certain anti-dependences edges are
7468 deleted, which triggers the generation of reg-moves based on the
7469 life-range analysis.  This option is effective only with
7470 @option{-fmodulo-sched} enabled.
7472 @item -fno-branch-count-reg
7473 @opindex fno-branch-count-reg
7474 Do not use ``decrement and branch'' instructions on a count register,
7475 but instead generate a sequence of instructions that decrement a
7476 register, compare it against zero, then branch based upon the result.
7477 This option is only meaningful on architectures that support such
7478 instructions, which include x86, PowerPC, IA-64 and S/390.
7480 Enabled by default at @option{-O1} and higher.
7482 The default is @option{-fbranch-count-reg}.
7484 @item -fno-function-cse
7485 @opindex fno-function-cse
7486 Do not put function addresses in registers; make each instruction that
7487 calls a constant function contain the function's address explicitly.
7489 This option results in less efficient code, but some strange hacks
7490 that alter the assembler output may be confused by the optimizations
7491 performed when this option is not used.
7493 The default is @option{-ffunction-cse}
7495 @item -fno-zero-initialized-in-bss
7496 @opindex fno-zero-initialized-in-bss
7497 If the target supports a BSS section, GCC by default puts variables that
7498 are initialized to zero into BSS@.  This can save space in the resulting
7499 code.
7501 This option turns off this behavior because some programs explicitly
7502 rely on variables going to the data section---e.g., so that the
7503 resulting executable can find the beginning of that section and/or make
7504 assumptions based on that.
7506 The default is @option{-fzero-initialized-in-bss}.
7508 @item -fthread-jumps
7509 @opindex fthread-jumps
7510 Perform optimizations that check to see if a jump branches to a
7511 location where another comparison subsumed by the first is found.  If
7512 so, the first branch is redirected to either the destination of the
7513 second branch or a point immediately following it, depending on whether
7514 the condition is known to be true or false.
7516 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7518 @item -fsplit-wide-types
7519 @opindex fsplit-wide-types
7520 When using a type that occupies multiple registers, such as @code{long
7521 long} on a 32-bit system, split the registers apart and allocate them
7522 independently.  This normally generates better code for those types,
7523 but may make debugging more difficult.
7525 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
7526 @option{-Os}.
7528 @item -fcse-follow-jumps
7529 @opindex fcse-follow-jumps
7530 In common subexpression elimination (CSE), scan through jump instructions
7531 when the target of the jump is not reached by any other path.  For
7532 example, when CSE encounters an @code{if} statement with an
7533 @code{else} clause, CSE follows the jump when the condition
7534 tested is false.
7536 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7538 @item -fcse-skip-blocks
7539 @opindex fcse-skip-blocks
7540 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
7541 follow jumps that conditionally skip over blocks.  When CSE
7542 encounters a simple @code{if} statement with no else clause,
7543 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
7544 body of the @code{if}.
7546 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7548 @item -frerun-cse-after-loop
7549 @opindex frerun-cse-after-loop
7550 Re-run common subexpression elimination after loop optimizations are
7551 performed.
7553 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7555 @item -fgcse
7556 @opindex fgcse
7557 Perform a global common subexpression elimination pass.
7558 This pass also performs global constant and copy propagation.
7560 @emph{Note:} When compiling a program using computed gotos, a GCC
7561 extension, you may get better run-time performance if you disable
7562 the global common subexpression elimination pass by adding
7563 @option{-fno-gcse} to the command line.
7565 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7567 @item -fgcse-lm
7568 @opindex fgcse-lm
7569 When @option{-fgcse-lm} is enabled, global common subexpression elimination
7570 attempts to move loads that are only killed by stores into themselves.  This
7571 allows a loop containing a load/store sequence to be changed to a load outside
7572 the loop, and a copy/store within the loop.
7574 Enabled by default when @option{-fgcse} is enabled.
7576 @item -fgcse-sm
7577 @opindex fgcse-sm
7578 When @option{-fgcse-sm} is enabled, a store motion pass is run after
7579 global common subexpression elimination.  This pass attempts to move
7580 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
7581 loops containing a load/store sequence can be changed to a load before
7582 the loop and a store after the loop.
7584 Not enabled at any optimization level.
7586 @item -fgcse-las
7587 @opindex fgcse-las
7588 When @option{-fgcse-las} is enabled, the global common subexpression
7589 elimination pass eliminates redundant loads that come after stores to the
7590 same memory location (both partial and full redundancies).
7592 Not enabled at any optimization level.
7594 @item -fgcse-after-reload
7595 @opindex fgcse-after-reload
7596 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
7597 pass is performed after reload.  The purpose of this pass is to clean up
7598 redundant spilling.
7600 @item -faggressive-loop-optimizations
7601 @opindex faggressive-loop-optimizations
7602 This option tells the loop optimizer to use language constraints to
7603 derive bounds for the number of iterations of a loop.  This assumes that
7604 loop code does not invoke undefined behavior by for example causing signed
7605 integer overflows or out-of-bound array accesses.  The bounds for the
7606 number of iterations of a loop are used to guide loop unrolling and peeling
7607 and loop exit test optimizations.
7608 This option is enabled by default.
7610 @item -funsafe-loop-optimizations
7611 @opindex funsafe-loop-optimizations
7612 This option tells the loop optimizer to assume that loop indices do not
7613 overflow, and that loops with nontrivial exit condition are not
7614 infinite.  This enables a wider range of loop optimizations even if
7615 the loop optimizer itself cannot prove that these assumptions are valid.
7616 If you use @option{-Wunsafe-loop-optimizations}, the compiler warns you
7617 if it finds this kind of loop.
7619 @item -fcrossjumping
7620 @opindex fcrossjumping
7621 Perform cross-jumping transformation.
7622 This transformation unifies equivalent code and saves code size.  The
7623 resulting code may or may not perform better than without cross-jumping.
7625 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7627 @item -fauto-inc-dec
7628 @opindex fauto-inc-dec
7629 Combine increments or decrements of addresses with memory accesses.
7630 This pass is always skipped on architectures that do not have
7631 instructions to support this.  Enabled by default at @option{-O} and
7632 higher on architectures that support this.
7634 @item -fdce
7635 @opindex fdce
7636 Perform dead code elimination (DCE) on RTL@.
7637 Enabled by default at @option{-O} and higher.
7639 @item -fdse
7640 @opindex fdse
7641 Perform dead store elimination (DSE) on RTL@.
7642 Enabled by default at @option{-O} and higher.
7644 @item -fif-conversion
7645 @opindex fif-conversion
7646 Attempt to transform conditional jumps into branch-less equivalents.  This
7647 includes use of conditional moves, min, max, set flags and abs instructions, and
7648 some tricks doable by standard arithmetics.  The use of conditional execution
7649 on chips where it is available is controlled by @code{if-conversion2}.
7651 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7653 @item -fif-conversion2
7654 @opindex fif-conversion2
7655 Use conditional execution (where available) to transform conditional jumps into
7656 branch-less equivalents.
7658 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7660 @item -fdeclone-ctor-dtor
7661 @opindex fdeclone-ctor-dtor
7662 The C++ ABI requires multiple entry points for constructors and
7663 destructors: one for a base subobject, one for a complete object, and
7664 one for a virtual destructor that calls operator delete afterwards.
7665 For a hierarchy with virtual bases, the base and complete variants are
7666 clones, which means two copies of the function.  With this option, the
7667 base and complete variants are changed to be thunks that call a common
7668 implementation.
7670 Enabled by @option{-Os}.
7672 @item -fdelete-null-pointer-checks
7673 @opindex fdelete-null-pointer-checks
7674 Assume that programs cannot safely dereference null pointers, and that
7675 no code or data element resides there.  This enables simple constant
7676 folding optimizations at all optimization levels.  In addition, other
7677 optimization passes in GCC use this flag to control global dataflow
7678 analyses that eliminate useless checks for null pointers; these assume
7679 that if a pointer is checked after it has already been dereferenced,
7680 it cannot be null.
7682 Note however that in some environments this assumption is not true.
7683 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
7684 for programs that depend on that behavior.
7686 Some targets, especially embedded ones, disable this option at all levels.
7687 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
7688 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
7689 are enabled independently at different optimization levels.
7691 @item -fdevirtualize
7692 @opindex fdevirtualize
7693 Attempt to convert calls to virtual functions to direct calls.  This
7694 is done both within a procedure and interprocedurally as part of
7695 indirect inlining (@code{-findirect-inlining}) and interprocedural constant
7696 propagation (@option{-fipa-cp}).
7697 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7699 @item -fdevirtualize-speculatively
7700 @opindex fdevirtualize-speculatively
7701 Attempt to convert calls to virtual functions to speculative direct calls.
7702 Based on the analysis of the type inheritance graph, determine for a given call
7703 the set of likely targets. If the set is small, preferably of size 1, change
7704 the call into an conditional deciding on direct and indirect call.  The
7705 speculative calls enable more optimizations, such as inlining.  When they seem
7706 useless after further optimization, they are converted back into original form.
7708 @item -fexpensive-optimizations
7709 @opindex fexpensive-optimizations
7710 Perform a number of minor optimizations that are relatively expensive.
7712 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7714 @item -free
7715 @opindex free
7716 Attempt to remove redundant extension instructions.  This is especially
7717 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
7718 registers after writing to their lower 32-bit half.
7720 Enabled for Alpha, AArch64 and x86 at levels @option{-O2},
7721 @option{-O3}, @option{-Os}.
7723 @item -flive-range-shrinkage
7724 @opindex flive-range-shrinkage
7725 Attempt to decrease register pressure through register live range
7726 shrinkage.  This is helpful for fast processors with small or moderate
7727 size register sets.
7729 @item -fira-algorithm=@var{algorithm}
7730 Use the specified coloring algorithm for the integrated register
7731 allocator.  The @var{algorithm} argument can be @samp{priority}, which
7732 specifies Chow's priority coloring, or @samp{CB}, which specifies
7733 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
7734 for all architectures, but for those targets that do support it, it is
7735 the default because it generates better code.
7737 @item -fira-region=@var{region}
7738 Use specified regions for the integrated register allocator.  The
7739 @var{region} argument should be one of the following:
7741 @table @samp
7743 @item all
7744 Use all loops as register allocation regions.
7745 This can give the best results for machines with a small and/or
7746 irregular register set.
7748 @item mixed
7749 Use all loops except for loops with small register pressure 
7750 as the regions.  This value usually gives
7751 the best results in most cases and for most architectures,
7752 and is enabled by default when compiling with optimization for speed
7753 (@option{-O}, @option{-O2}, @dots{}).
7755 @item one
7756 Use all functions as a single region.  
7757 This typically results in the smallest code size, and is enabled by default for
7758 @option{-Os} or @option{-O0}.
7760 @end table
7762 @item -fira-hoist-pressure
7763 @opindex fira-hoist-pressure
7764 Use IRA to evaluate register pressure in the code hoisting pass for
7765 decisions to hoist expressions.  This option usually results in smaller
7766 code, but it can slow the compiler down.
7768 This option is enabled at level @option{-Os} for all targets.
7770 @item -fira-loop-pressure
7771 @opindex fira-loop-pressure
7772 Use IRA to evaluate register pressure in loops for decisions to move
7773 loop invariants.  This option usually results in generation
7774 of faster and smaller code on machines with large register files (>= 32
7775 registers), but it can slow the compiler down.
7777 This option is enabled at level @option{-O3} for some targets.
7779 @item -fno-ira-share-save-slots
7780 @opindex fno-ira-share-save-slots
7781 Disable sharing of stack slots used for saving call-used hard
7782 registers living through a call.  Each hard register gets a
7783 separate stack slot, and as a result function stack frames are
7784 larger.
7786 @item -fno-ira-share-spill-slots
7787 @opindex fno-ira-share-spill-slots
7788 Disable sharing of stack slots allocated for pseudo-registers.  Each
7789 pseudo-register that does not get a hard register gets a separate
7790 stack slot, and as a result function stack frames are larger.
7792 @item -fira-verbose=@var{n}
7793 @opindex fira-verbose
7794 Control the verbosity of the dump file for the integrated register allocator.
7795 The default value is 5.  If the value @var{n} is greater or equal to 10,
7796 the dump output is sent to stderr using the same format as @var{n} minus 10.
7798 @item -fdelayed-branch
7799 @opindex fdelayed-branch
7800 If supported for the target machine, attempt to reorder instructions
7801 to exploit instruction slots available after delayed branch
7802 instructions.
7804 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7806 @item -fschedule-insns
7807 @opindex fschedule-insns
7808 If supported for the target machine, attempt to reorder instructions to
7809 eliminate execution stalls due to required data being unavailable.  This
7810 helps machines that have slow floating point or memory load instructions
7811 by allowing other instructions to be issued until the result of the load
7812 or floating-point instruction is required.
7814 Enabled at levels @option{-O2}, @option{-O3}.
7816 @item -fschedule-insns2
7817 @opindex fschedule-insns2
7818 Similar to @option{-fschedule-insns}, but requests an additional pass of
7819 instruction scheduling after register allocation has been done.  This is
7820 especially useful on machines with a relatively small number of
7821 registers and where memory load instructions take more than one cycle.
7823 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7825 @item -fno-sched-interblock
7826 @opindex fno-sched-interblock
7827 Don't schedule instructions across basic blocks.  This is normally
7828 enabled by default when scheduling before register allocation, i.e.@:
7829 with @option{-fschedule-insns} or at @option{-O2} or higher.
7831 @item -fno-sched-spec
7832 @opindex fno-sched-spec
7833 Don't allow speculative motion of non-load instructions.  This is normally
7834 enabled by default when scheduling before register allocation, i.e.@:
7835 with @option{-fschedule-insns} or at @option{-O2} or higher.
7837 @item -fsched-pressure
7838 @opindex fsched-pressure
7839 Enable register pressure sensitive insn scheduling before register
7840 allocation.  This only makes sense when scheduling before register
7841 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
7842 @option{-O2} or higher.  Usage of this option can improve the
7843 generated code and decrease its size by preventing register pressure
7844 increase above the number of available hard registers and subsequent
7845 spills in register allocation.
7847 @item -fsched-spec-load
7848 @opindex fsched-spec-load
7849 Allow speculative motion of some load instructions.  This only makes
7850 sense when scheduling before register allocation, i.e.@: with
7851 @option{-fschedule-insns} or at @option{-O2} or higher.
7853 @item -fsched-spec-load-dangerous
7854 @opindex fsched-spec-load-dangerous
7855 Allow speculative motion of more load instructions.  This only makes
7856 sense when scheduling before register allocation, i.e.@: with
7857 @option{-fschedule-insns} or at @option{-O2} or higher.
7859 @item -fsched-stalled-insns
7860 @itemx -fsched-stalled-insns=@var{n}
7861 @opindex fsched-stalled-insns
7862 Define how many insns (if any) can be moved prematurely from the queue
7863 of stalled insns into the ready list during the second scheduling pass.
7864 @option{-fno-sched-stalled-insns} means that no insns are moved
7865 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
7866 on how many queued insns can be moved prematurely.
7867 @option{-fsched-stalled-insns} without a value is equivalent to
7868 @option{-fsched-stalled-insns=1}.
7870 @item -fsched-stalled-insns-dep
7871 @itemx -fsched-stalled-insns-dep=@var{n}
7872 @opindex fsched-stalled-insns-dep
7873 Define how many insn groups (cycles) are examined for a dependency
7874 on a stalled insn that is a candidate for premature removal from the queue
7875 of stalled insns.  This has an effect only during the second scheduling pass,
7876 and only if @option{-fsched-stalled-insns} is used.
7877 @option{-fno-sched-stalled-insns-dep} is equivalent to
7878 @option{-fsched-stalled-insns-dep=0}.
7879 @option{-fsched-stalled-insns-dep} without a value is equivalent to
7880 @option{-fsched-stalled-insns-dep=1}.
7882 @item -fsched2-use-superblocks
7883 @opindex fsched2-use-superblocks
7884 When scheduling after register allocation, use superblock scheduling.
7885 This allows motion across basic block boundaries,
7886 resulting in faster schedules.  This option is experimental, as not all machine
7887 descriptions used by GCC model the CPU closely enough to avoid unreliable
7888 results from the algorithm.
7890 This only makes sense when scheduling after register allocation, i.e.@: with
7891 @option{-fschedule-insns2} or at @option{-O2} or higher.
7893 @item -fsched-group-heuristic
7894 @opindex fsched-group-heuristic
7895 Enable the group heuristic in the scheduler.  This heuristic favors
7896 the instruction that belongs to a schedule group.  This is enabled
7897 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7898 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7900 @item -fsched-critical-path-heuristic
7901 @opindex fsched-critical-path-heuristic
7902 Enable the critical-path heuristic in the scheduler.  This heuristic favors
7903 instructions on the critical path.  This is enabled by default when
7904 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7905 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7907 @item -fsched-spec-insn-heuristic
7908 @opindex fsched-spec-insn-heuristic
7909 Enable the speculative instruction heuristic in the scheduler.  This
7910 heuristic favors speculative instructions with greater dependency weakness.
7911 This is enabled by default when scheduling is enabled, i.e.@:
7912 with @option{-fschedule-insns} or @option{-fschedule-insns2}
7913 or at @option{-O2} or higher.
7915 @item -fsched-rank-heuristic
7916 @opindex fsched-rank-heuristic
7917 Enable the rank heuristic in the scheduler.  This heuristic favors
7918 the instruction belonging to a basic block with greater size or frequency.
7919 This is enabled by default when scheduling is enabled, i.e.@:
7920 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7921 at @option{-O2} or higher.
7923 @item -fsched-last-insn-heuristic
7924 @opindex fsched-last-insn-heuristic
7925 Enable the last-instruction heuristic in the scheduler.  This heuristic
7926 favors the instruction that is less dependent on the last instruction
7927 scheduled.  This is enabled by default when scheduling is enabled,
7928 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7929 at @option{-O2} or higher.
7931 @item -fsched-dep-count-heuristic
7932 @opindex fsched-dep-count-heuristic
7933 Enable the dependent-count heuristic in the scheduler.  This heuristic
7934 favors the instruction that has more instructions depending on it.
7935 This is enabled by default when scheduling is enabled, i.e.@:
7936 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7937 at @option{-O2} or higher.
7939 @item -freschedule-modulo-scheduled-loops
7940 @opindex freschedule-modulo-scheduled-loops
7941 Modulo scheduling is performed before traditional scheduling.  If a loop
7942 is modulo scheduled, later scheduling passes may change its schedule.  
7943 Use this option to control that behavior.
7945 @item -fselective-scheduling
7946 @opindex fselective-scheduling
7947 Schedule instructions using selective scheduling algorithm.  Selective
7948 scheduling runs instead of the first scheduler pass.
7950 @item -fselective-scheduling2
7951 @opindex fselective-scheduling2
7952 Schedule instructions using selective scheduling algorithm.  Selective
7953 scheduling runs instead of the second scheduler pass.
7955 @item -fsel-sched-pipelining
7956 @opindex fsel-sched-pipelining
7957 Enable software pipelining of innermost loops during selective scheduling.
7958 This option has no effect unless one of @option{-fselective-scheduling} or
7959 @option{-fselective-scheduling2} is turned on.
7961 @item -fsel-sched-pipelining-outer-loops
7962 @opindex fsel-sched-pipelining-outer-loops
7963 When pipelining loops during selective scheduling, also pipeline outer loops.
7964 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
7966 @item -fsemantic-interposition
7967 @opindex fsemantic-interposition
7968 Some object formats, like ELF, allow interposing of symbols by dynamic linker.
7969 This means that for symbols exported from the DSO compiler can not perform
7970 inter-procedural propagation, inlining and other optimizations in anticipation
7971 that the function or variable in question may change. While this feature is
7972 useful, for example, to rewrite memory allocation functions by a debugging
7973 implementation, it is expensive in the terms of code quality.
7974 With @option{-fno-semantic-inteposition} compiler assumest that if interposition
7975 happens for functions the overwritting function will have
7976 precisely same semantics (and side effects). Similarly if interposition happens
7977 for variables, the constructor of the variable will be the same. The flag
7978 has no effect for functions explicitly declared inline, where
7979 interposition changing semantic is never allowed and for symbols explicitly
7980 declared weak.
7982 @item -fshrink-wrap
7983 @opindex fshrink-wrap
7984 Emit function prologues only before parts of the function that need it,
7985 rather than at the top of the function.  This flag is enabled by default at
7986 @option{-O} and higher.
7988 @item -fcaller-saves
7989 @opindex fcaller-saves
7990 Enable allocation of values to registers that are clobbered by
7991 function calls, by emitting extra instructions to save and restore the
7992 registers around such calls.  Such allocation is done only when it
7993 seems to result in better code.
7995 This option is always enabled by default on certain machines, usually
7996 those which have no call-preserved registers to use instead.
7998 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8000 @item -fcombine-stack-adjustments
8001 @opindex fcombine-stack-adjustments
8002 Tracks stack adjustments (pushes and pops) and stack memory references
8003 and then tries to find ways to combine them.
8005 Enabled by default at @option{-O1} and higher.
8007 @item -fuse-caller-save
8008 Use caller save registers for allocation if those registers are not used by
8009 any called function.  In that case it is not necessary to save and restore
8010 them around calls.  This is only possible if called functions are part of
8011 same compilation unit as current function and they are compiled before it.
8013 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8015 @item -fconserve-stack
8016 @opindex fconserve-stack
8017 Attempt to minimize stack usage.  The compiler attempts to use less
8018 stack space, even if that makes the program slower.  This option
8019 implies setting the @option{large-stack-frame} parameter to 100
8020 and the @option{large-stack-frame-growth} parameter to 400.
8022 @item -ftree-reassoc
8023 @opindex ftree-reassoc
8024 Perform reassociation on trees.  This flag is enabled by default
8025 at @option{-O} and higher.
8027 @item -ftree-pre
8028 @opindex ftree-pre
8029 Perform partial redundancy elimination (PRE) on trees.  This flag is
8030 enabled by default at @option{-O2} and @option{-O3}.
8032 @item -ftree-partial-pre
8033 @opindex ftree-partial-pre
8034 Make partial redundancy elimination (PRE) more aggressive.  This flag is
8035 enabled by default at @option{-O3}.
8037 @item -ftree-forwprop
8038 @opindex ftree-forwprop
8039 Perform forward propagation on trees.  This flag is enabled by default
8040 at @option{-O} and higher.
8042 @item -ftree-fre
8043 @opindex ftree-fre
8044 Perform full redundancy elimination (FRE) on trees.  The difference
8045 between FRE and PRE is that FRE only considers expressions
8046 that are computed on all paths leading to the redundant computation.
8047 This analysis is faster than PRE, though it exposes fewer redundancies.
8048 This flag is enabled by default at @option{-O} and higher.
8050 @item -ftree-phiprop
8051 @opindex ftree-phiprop
8052 Perform hoisting of loads from conditional pointers on trees.  This
8053 pass is enabled by default at @option{-O} and higher.
8055 @item -fhoist-adjacent-loads
8056 @opindex hoist-adjacent-loads
8057 Speculatively hoist loads from both branches of an if-then-else if the
8058 loads are from adjacent locations in the same structure and the target
8059 architecture has a conditional move instruction.  This flag is enabled
8060 by default at @option{-O2} and higher.
8062 @item -ftree-copy-prop
8063 @opindex ftree-copy-prop
8064 Perform copy propagation on trees.  This pass eliminates unnecessary
8065 copy operations.  This flag is enabled by default at @option{-O} and
8066 higher.
8068 @item -fipa-pure-const
8069 @opindex fipa-pure-const
8070 Discover which functions are pure or constant.
8071 Enabled by default at @option{-O} and higher.
8073 @item -fipa-reference
8074 @opindex fipa-reference
8075 Discover which static variables do not escape the
8076 compilation unit.
8077 Enabled by default at @option{-O} and higher.
8079 @item -fipa-pta
8080 @opindex fipa-pta
8081 Perform interprocedural pointer analysis and interprocedural modification
8082 and reference analysis.  This option can cause excessive memory and
8083 compile-time usage on large compilation units.  It is not enabled by
8084 default at any optimization level.
8086 @item -fipa-profile
8087 @opindex fipa-profile
8088 Perform interprocedural profile propagation.  The functions called only from
8089 cold functions are marked as cold. Also functions executed once (such as
8090 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
8091 functions and loop less parts of functions executed once are then optimized for
8092 size.
8093 Enabled by default at @option{-O} and higher.
8095 @item -fipa-cp
8096 @opindex fipa-cp
8097 Perform interprocedural constant propagation.
8098 This optimization analyzes the program to determine when values passed
8099 to functions are constants and then optimizes accordingly.
8100 This optimization can substantially increase performance
8101 if the application has constants passed to functions.
8102 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
8104 @item -fipa-cp-clone
8105 @opindex fipa-cp-clone
8106 Perform function cloning to make interprocedural constant propagation stronger.
8107 When enabled, interprocedural constant propagation performs function cloning
8108 when externally visible function can be called with constant arguments.
8109 Because this optimization can create multiple copies of functions,
8110 it may significantly increase code size
8111 (see @option{--param ipcp-unit-growth=@var{value}}).
8112 This flag is enabled by default at @option{-O3}.
8114 @item -fipa-icf
8115 @opindex fipa-icf
8116 Perform Identical Code Folding for functions and read-only variables.
8117 The optimization reduces code size and may disturb unwind stacks by replacing
8118 a function by equivalent one with a different name. The optimization works
8119 more effectively with link time optimization enabled.
8121 Nevertheless the behavior is similar to Gold Linker ICF optimization, GCC ICF
8122 works on different levels and thus the optimizations are not same - there are
8123 equivalences that are found only by GCC and equivalences found only by Gold.
8125 This flag is enabled by default at @option{-O2} and @option{-Os}.
8127 @item -fisolate-erroneous-paths-dereference
8128 Detect paths which trigger erroneous or undefined behaviour due to
8129 dereferencing a NULL pointer.  Isolate those paths from the main control
8130 flow and turn the statement with erroneous or undefined behaviour into a trap.
8132 @item -fisolate-erroneous-paths-attribute
8133 Detect paths which trigger erroneous or undefined behaviour due a NULL value
8134 being used in a way which is forbidden by a @code{returns_nonnull} or @code{nonnull}
8135 attribute.  Isolate those paths from the main control flow and turn the
8136 statement with erroneous or undefined behaviour into a trap.  This is not
8137 currently enabled, but may be enabled by @code{-O2} in the future.
8139 @item -ftree-sink
8140 @opindex ftree-sink
8141 Perform forward store motion  on trees.  This flag is
8142 enabled by default at @option{-O} and higher.
8144 @item -ftree-bit-ccp
8145 @opindex ftree-bit-ccp
8146 Perform sparse conditional bit constant propagation on trees and propagate
8147 pointer alignment information.
8148 This pass only operates on local scalar variables and is enabled by default
8149 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
8151 @item -ftree-ccp
8152 @opindex ftree-ccp
8153 Perform sparse conditional constant propagation (CCP) on trees.  This
8154 pass only operates on local scalar variables and is enabled by default
8155 at @option{-O} and higher.
8157 @item -fssa-phiopt
8158 @opindex fssa-phiopt
8159 Perform pattern matching on SSA PHI nodes to optimize conditional
8160 code.  This pass is enabled by default at @option{-O} and higher.
8162 @item -ftree-switch-conversion
8163 Perform conversion of simple initializations in a switch to
8164 initializations from a scalar array.  This flag is enabled by default
8165 at @option{-O2} and higher.
8167 @item -ftree-tail-merge
8168 Look for identical code sequences.  When found, replace one with a jump to the
8169 other.  This optimization is known as tail merging or cross jumping.  This flag
8170 is enabled by default at @option{-O2} and higher.  The compilation time
8171 in this pass can
8172 be limited using @option{max-tail-merge-comparisons} parameter and
8173 @option{max-tail-merge-iterations} parameter.
8175 @item -ftree-dce
8176 @opindex ftree-dce
8177 Perform dead code elimination (DCE) on trees.  This flag is enabled by
8178 default at @option{-O} and higher.
8180 @item -ftree-builtin-call-dce
8181 @opindex ftree-builtin-call-dce
8182 Perform conditional dead code elimination (DCE) for calls to built-in functions
8183 that may set @code{errno} but are otherwise side-effect free.  This flag is
8184 enabled by default at @option{-O2} and higher if @option{-Os} is not also
8185 specified.
8187 @item -ftree-dominator-opts
8188 @opindex ftree-dominator-opts
8189 Perform a variety of simple scalar cleanups (constant/copy
8190 propagation, redundancy elimination, range propagation and expression
8191 simplification) based on a dominator tree traversal.  This also
8192 performs jump threading (to reduce jumps to jumps). This flag is
8193 enabled by default at @option{-O} and higher.
8195 @item -ftree-dse
8196 @opindex ftree-dse
8197 Perform dead store elimination (DSE) on trees.  A dead store is a store into
8198 a memory location that is later overwritten by another store without
8199 any intervening loads.  In this case the earlier store can be deleted.  This
8200 flag is enabled by default at @option{-O} and higher.
8202 @item -ftree-ch
8203 @opindex ftree-ch
8204 Perform loop header copying on trees.  This is beneficial since it increases
8205 effectiveness of code motion optimizations.  It also saves one jump.  This flag
8206 is enabled by default at @option{-O} and higher.  It is not enabled
8207 for @option{-Os}, since it usually increases code size.
8209 @item -ftree-loop-optimize
8210 @opindex ftree-loop-optimize
8211 Perform loop optimizations on trees.  This flag is enabled by default
8212 at @option{-O} and higher.
8214 @item -ftree-loop-linear
8215 @opindex ftree-loop-linear
8216 Perform loop interchange transformations on tree.  Same as
8217 @option{-floop-interchange}.  To use this code transformation, GCC has
8218 to be configured with @option{--with-ppl} and @option{--with-cloog} to
8219 enable the Graphite loop transformation infrastructure.
8221 @item -floop-interchange
8222 @opindex floop-interchange
8223 Perform loop interchange transformations on loops.  Interchanging two
8224 nested loops switches the inner and outer loops.  For example, given a
8225 loop like:
8226 @smallexample
8227 DO J = 1, M
8228   DO I = 1, N
8229     A(J, I) = A(J, I) * C
8230   ENDDO
8231 ENDDO
8232 @end smallexample
8233 loop interchange transforms the loop as if it were written:
8234 @smallexample
8235 DO I = 1, N
8236   DO J = 1, M
8237     A(J, I) = A(J, I) * C
8238   ENDDO
8239 ENDDO
8240 @end smallexample
8241 which can be beneficial when @code{N} is larger than the caches,
8242 because in Fortran, the elements of an array are stored in memory
8243 contiguously by column, and the original loop iterates over rows,
8244 potentially creating at each access a cache miss.  This optimization
8245 applies to all the languages supported by GCC and is not limited to
8246 Fortran.  To use this code transformation, GCC has to be configured
8247 with @option{--with-ppl} and @option{--with-cloog} to enable the
8248 Graphite loop transformation infrastructure.
8250 @item -floop-strip-mine
8251 @opindex floop-strip-mine
8252 Perform loop strip mining transformations on loops.  Strip mining
8253 splits a loop into two nested loops.  The outer loop has strides
8254 equal to the strip size and the inner loop has strides of the
8255 original loop within a strip.  The strip length can be changed
8256 using the @option{loop-block-tile-size} parameter.  For example,
8257 given a loop like:
8258 @smallexample
8259 DO I = 1, N
8260   A(I) = A(I) + C
8261 ENDDO
8262 @end smallexample
8263 loop strip mining transforms the loop as if it were written:
8264 @smallexample
8265 DO II = 1, N, 51
8266   DO I = II, min (II + 50, N)
8267     A(I) = A(I) + C
8268   ENDDO
8269 ENDDO
8270 @end smallexample
8271 This optimization applies to all the languages supported by GCC and is
8272 not limited to Fortran.  To use this code transformation, GCC has to
8273 be configured with @option{--with-ppl} and @option{--with-cloog} to
8274 enable the Graphite loop transformation infrastructure.
8276 @item -floop-block
8277 @opindex floop-block
8278 Perform loop blocking transformations on loops.  Blocking strip mines
8279 each loop in the loop nest such that the memory accesses of the
8280 element loops fit inside caches.  The strip length can be changed
8281 using the @option{loop-block-tile-size} parameter.  For example, given
8282 a loop like:
8283 @smallexample
8284 DO I = 1, N
8285   DO J = 1, M
8286     A(J, I) = B(I) + C(J)
8287   ENDDO
8288 ENDDO
8289 @end smallexample
8290 loop blocking transforms the loop as if it were written:
8291 @smallexample
8292 DO II = 1, N, 51
8293   DO JJ = 1, M, 51
8294     DO I = II, min (II + 50, N)
8295       DO J = JJ, min (JJ + 50, M)
8296         A(J, I) = B(I) + C(J)
8297       ENDDO
8298     ENDDO
8299   ENDDO
8300 ENDDO
8301 @end smallexample
8302 which can be beneficial when @code{M} is larger than the caches,
8303 because the innermost loop iterates over a smaller amount of data
8304 which can be kept in the caches.  This optimization applies to all the
8305 languages supported by GCC and is not limited to Fortran.  To use this
8306 code transformation, GCC has to be configured with @option{--with-ppl}
8307 and @option{--with-cloog} to enable the Graphite loop transformation
8308 infrastructure.
8310 @item -fgraphite-identity
8311 @opindex fgraphite-identity
8312 Enable the identity transformation for graphite.  For every SCoP we generate
8313 the polyhedral representation and transform it back to gimple.  Using
8314 @option{-fgraphite-identity} we can check the costs or benefits of the
8315 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
8316 are also performed by the code generator CLooG, like index splitting and
8317 dead code elimination in loops.
8319 @item -floop-nest-optimize
8320 @opindex floop-nest-optimize
8321 Enable the ISL based loop nest optimizer.  This is a generic loop nest
8322 optimizer based on the Pluto optimization algorithms.  It calculates a loop
8323 structure optimized for data-locality and parallelism.  This option
8324 is experimental.
8326 @item -floop-parallelize-all
8327 @opindex floop-parallelize-all
8328 Use the Graphite data dependence analysis to identify loops that can
8329 be parallelized.  Parallelize all the loops that can be analyzed to
8330 not contain loop carried dependences without checking that it is
8331 profitable to parallelize the loops.
8333 @item -fcheck-data-deps
8334 @opindex fcheck-data-deps
8335 Compare the results of several data dependence analyzers.  This option
8336 is used for debugging the data dependence analyzers.
8338 @item -ftree-loop-if-convert
8339 Attempt to transform conditional jumps in the innermost loops to
8340 branch-less equivalents.  The intent is to remove control-flow from
8341 the innermost loops in order to improve the ability of the
8342 vectorization pass to handle these loops.  This is enabled by default
8343 if vectorization is enabled.
8345 @item -ftree-loop-if-convert-stores
8346 Attempt to also if-convert conditional jumps containing memory writes.
8347 This transformation can be unsafe for multi-threaded programs as it
8348 transforms conditional memory writes into unconditional memory writes.
8349 For example,
8350 @smallexample
8351 for (i = 0; i < N; i++)
8352   if (cond)
8353     A[i] = expr;
8354 @end smallexample
8355 is transformed to
8356 @smallexample
8357 for (i = 0; i < N; i++)
8358   A[i] = cond ? expr : A[i];
8359 @end smallexample
8360 potentially producing data races.
8362 @item -ftree-loop-distribution
8363 Perform loop distribution.  This flag can improve cache performance on
8364 big loop bodies and allow further loop optimizations, like
8365 parallelization or vectorization, to take place.  For example, the loop
8366 @smallexample
8367 DO I = 1, N
8368   A(I) = B(I) + C
8369   D(I) = E(I) * F
8370 ENDDO
8371 @end smallexample
8372 is transformed to
8373 @smallexample
8374 DO I = 1, N
8375    A(I) = B(I) + C
8376 ENDDO
8377 DO I = 1, N
8378    D(I) = E(I) * F
8379 ENDDO
8380 @end smallexample
8382 @item -ftree-loop-distribute-patterns
8383 Perform loop distribution of patterns that can be code generated with
8384 calls to a library.  This flag is enabled by default at @option{-O3}.
8386 This pass distributes the initialization loops and generates a call to
8387 memset zero.  For example, the loop
8388 @smallexample
8389 DO I = 1, N
8390   A(I) = 0
8391   B(I) = A(I) + I
8392 ENDDO
8393 @end smallexample
8394 is transformed to
8395 @smallexample
8396 DO I = 1, N
8397    A(I) = 0
8398 ENDDO
8399 DO I = 1, N
8400    B(I) = A(I) + I
8401 ENDDO
8402 @end smallexample
8403 and the initialization loop is transformed into a call to memset zero.
8405 @item -ftree-loop-im
8406 @opindex ftree-loop-im
8407 Perform loop invariant motion on trees.  This pass moves only invariants that
8408 are hard to handle at RTL level (function calls, operations that expand to
8409 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
8410 operands of conditions that are invariant out of the loop, so that we can use
8411 just trivial invariantness analysis in loop unswitching.  The pass also includes
8412 store motion.
8414 @item -ftree-loop-ivcanon
8415 @opindex ftree-loop-ivcanon
8416 Create a canonical counter for number of iterations in loops for which
8417 determining number of iterations requires complicated analysis.  Later
8418 optimizations then may determine the number easily.  Useful especially
8419 in connection with unrolling.
8421 @item -fivopts
8422 @opindex fivopts
8423 Perform induction variable optimizations (strength reduction, induction
8424 variable merging and induction variable elimination) on trees.
8426 @item -ftree-parallelize-loops=n
8427 @opindex ftree-parallelize-loops
8428 Parallelize loops, i.e., split their iteration space to run in n threads.
8429 This is only possible for loops whose iterations are independent
8430 and can be arbitrarily reordered.  The optimization is only
8431 profitable on multiprocessor machines, for loops that are CPU-intensive,
8432 rather than constrained e.g.@: by memory bandwidth.  This option
8433 implies @option{-pthread}, and thus is only supported on targets
8434 that have support for @option{-pthread}.
8436 @item -ftree-pta
8437 @opindex ftree-pta
8438 Perform function-local points-to analysis on trees.  This flag is
8439 enabled by default at @option{-O} and higher.
8441 @item -ftree-sra
8442 @opindex ftree-sra
8443 Perform scalar replacement of aggregates.  This pass replaces structure
8444 references with scalars to prevent committing structures to memory too
8445 early.  This flag is enabled by default at @option{-O} and higher.
8447 @item -ftree-copyrename
8448 @opindex ftree-copyrename
8449 Perform copy renaming on trees.  This pass attempts to rename compiler
8450 temporaries to other variables at copy locations, usually resulting in
8451 variable names which more closely resemble the original variables.  This flag
8452 is enabled by default at @option{-O} and higher.
8454 @item -ftree-coalesce-inlined-vars
8455 @opindex ftree-coalesce-inlined-vars
8456 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
8457 combine small user-defined variables too, but only if they were inlined
8458 from other functions.  It is a more limited form of
8459 @option{-ftree-coalesce-vars}.  This may harm debug information of such
8460 inlined variables, but it will keep variables of the inlined-into
8461 function apart from each other, such that they are more likely to
8462 contain the expected values in a debugging session.  This was the
8463 default in GCC versions older than 4.7.
8465 @item -ftree-coalesce-vars
8466 @opindex ftree-coalesce-vars
8467 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
8468 combine small user-defined variables too, instead of just compiler
8469 temporaries.  This may severely limit the ability to debug an optimized
8470 program compiled with @option{-fno-var-tracking-assignments}.  In the
8471 negated form, this flag prevents SSA coalescing of user variables,
8472 including inlined ones.  This option is enabled by default.
8474 @item -ftree-ter
8475 @opindex ftree-ter
8476 Perform temporary expression replacement during the SSA->normal phase.  Single
8477 use/single def temporaries are replaced at their use location with their
8478 defining expression.  This results in non-GIMPLE code, but gives the expanders
8479 much more complex trees to work on resulting in better RTL generation.  This is
8480 enabled by default at @option{-O} and higher.
8482 @item -ftree-slsr
8483 @opindex ftree-slsr
8484 Perform straight-line strength reduction on trees.  This recognizes related
8485 expressions involving multiplications and replaces them by less expensive
8486 calculations when possible.  This is enabled by default at @option{-O} and
8487 higher.
8489 @item -ftree-vectorize
8490 @opindex ftree-vectorize
8491 Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
8492 and @option{-ftree-slp-vectorize} if not explicitly specified.
8494 @item -ftree-loop-vectorize
8495 @opindex ftree-loop-vectorize
8496 Perform loop vectorization on trees. This flag is enabled by default at
8497 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8499 @item -ftree-slp-vectorize
8500 @opindex ftree-slp-vectorize
8501 Perform basic block vectorization on trees. This flag is enabled by default at
8502 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8504 @item -fvect-cost-model=@var{model}
8505 @opindex fvect-cost-model
8506 Alter the cost model used for vectorization.  The @var{model} argument
8507 should be one of @code{unlimited}, @code{dynamic} or @code{cheap}.
8508 With the @code{unlimited} model the vectorized code-path is assumed
8509 to be profitable while with the @code{dynamic} model a runtime check
8510 will guard the vectorized code-path to enable it only for iteration
8511 counts that will likely execute faster than when executing the original
8512 scalar loop.  The @code{cheap} model will disable vectorization of
8513 loops where doing so would be cost prohibitive for example due to
8514 required runtime checks for data dependence or alignment but otherwise
8515 is equal to the @code{dynamic} model.
8516 The default cost model depends on other optimization flags and is
8517 either @code{dynamic} or @code{cheap}.
8519 @item -fsimd-cost-model=@var{model}
8520 @opindex fsimd-cost-model
8521 Alter the cost model used for vectorization of loops marked with the OpenMP
8522 or Cilk Plus simd directive.  The @var{model} argument should be one of
8523 @code{unlimited}, @code{dynamic}, @code{cheap}.  All values of @var{model}
8524 have the same meaning as described in @option{-fvect-cost-model} and by
8525 default a cost model defined with @option{-fvect-cost-model} is used.
8527 @item -ftree-vrp
8528 @opindex ftree-vrp
8529 Perform Value Range Propagation on trees.  This is similar to the
8530 constant propagation pass, but instead of values, ranges of values are
8531 propagated.  This allows the optimizers to remove unnecessary range
8532 checks like array bound checks and null pointer checks.  This is
8533 enabled by default at @option{-O2} and higher.  Null pointer check
8534 elimination is only done if @option{-fdelete-null-pointer-checks} is
8535 enabled.
8537 @item -ftracer
8538 @opindex ftracer
8539 Perform tail duplication to enlarge superblock size.  This transformation
8540 simplifies the control flow of the function allowing other optimizations to do
8541 a better job.
8543 @item -funroll-loops
8544 @opindex funroll-loops
8545 Unroll loops whose number of iterations can be determined at compile
8546 time or upon entry to the loop.  @option{-funroll-loops} implies
8547 @option{-frerun-cse-after-loop}.  This option makes code larger,
8548 and may or may not make it run faster.
8550 @item -funroll-all-loops
8551 @opindex funroll-all-loops
8552 Unroll all loops, even if their number of iterations is uncertain when
8553 the loop is entered.  This usually makes programs run more slowly.
8554 @option{-funroll-all-loops} implies the same options as
8555 @option{-funroll-loops},
8557 @item -fsplit-ivs-in-unroller
8558 @opindex fsplit-ivs-in-unroller
8559 Enables expression of values of induction variables in later iterations
8560 of the unrolled loop using the value in the first iteration.  This breaks
8561 long dependency chains, thus improving efficiency of the scheduling passes.
8563 A combination of @option{-fweb} and CSE is often sufficient to obtain the
8564 same effect.  However, that is not reliable in cases where the loop body
8565 is more complicated than a single basic block.  It also does not work at all
8566 on some architectures due to restrictions in the CSE pass.
8568 This optimization is enabled by default.
8570 @item -fvariable-expansion-in-unroller
8571 @opindex fvariable-expansion-in-unroller
8572 With this option, the compiler creates multiple copies of some
8573 local variables when unrolling a loop, which can result in superior code.
8575 @item -fpartial-inlining
8576 @opindex fpartial-inlining
8577 Inline parts of functions.  This option has any effect only
8578 when inlining itself is turned on by the @option{-finline-functions}
8579 or @option{-finline-small-functions} options.
8581 Enabled at level @option{-O2}.
8583 @item -fpredictive-commoning
8584 @opindex fpredictive-commoning
8585 Perform predictive commoning optimization, i.e., reusing computations
8586 (especially memory loads and stores) performed in previous
8587 iterations of loops.
8589 This option is enabled at level @option{-O3}.
8591 @item -fprefetch-loop-arrays
8592 @opindex fprefetch-loop-arrays
8593 If supported by the target machine, generate instructions to prefetch
8594 memory to improve the performance of loops that access large arrays.
8596 This option may generate better or worse code; results are highly
8597 dependent on the structure of loops within the source code.
8599 Disabled at level @option{-Os}.
8601 @item -fno-peephole
8602 @itemx -fno-peephole2
8603 @opindex fno-peephole
8604 @opindex fno-peephole2
8605 Disable any machine-specific peephole optimizations.  The difference
8606 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
8607 are implemented in the compiler; some targets use one, some use the
8608 other, a few use both.
8610 @option{-fpeephole} is enabled by default.
8611 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8613 @item -fno-guess-branch-probability
8614 @opindex fno-guess-branch-probability
8615 Do not guess branch probabilities using heuristics.
8617 GCC uses heuristics to guess branch probabilities if they are
8618 not provided by profiling feedback (@option{-fprofile-arcs}).  These
8619 heuristics are based on the control flow graph.  If some branch probabilities
8620 are specified by @samp{__builtin_expect}, then the heuristics are
8621 used to guess branch probabilities for the rest of the control flow graph,
8622 taking the @samp{__builtin_expect} info into account.  The interactions
8623 between the heuristics and @samp{__builtin_expect} can be complex, and in
8624 some cases, it may be useful to disable the heuristics so that the effects
8625 of @samp{__builtin_expect} are easier to understand.
8627 The default is @option{-fguess-branch-probability} at levels
8628 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8630 @item -freorder-blocks
8631 @opindex freorder-blocks
8632 Reorder basic blocks in the compiled function in order to reduce number of
8633 taken branches and improve code locality.
8635 Enabled at levels @option{-O2}, @option{-O3}.
8637 @item -freorder-blocks-and-partition
8638 @opindex freorder-blocks-and-partition
8639 In addition to reordering basic blocks in the compiled function, in order
8640 to reduce number of taken branches, partitions hot and cold basic blocks
8641 into separate sections of the assembly and .o files, to improve
8642 paging and cache locality performance.
8644 This optimization is automatically turned off in the presence of
8645 exception handling, for linkonce sections, for functions with a user-defined
8646 section attribute and on any architecture that does not support named
8647 sections.
8649 Enabled for x86 at levels @option{-O2}, @option{-O3}.
8651 @item -freorder-functions
8652 @opindex freorder-functions
8653 Reorder functions in the object file in order to
8654 improve code locality.  This is implemented by using special
8655 subsections @code{.text.hot} for most frequently executed functions and
8656 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
8657 the linker so object file format must support named sections and linker must
8658 place them in a reasonable way.
8660 Also profile feedback must be available to make this option effective.  See
8661 @option{-fprofile-arcs} for details.
8663 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8665 @item -fstrict-aliasing
8666 @opindex fstrict-aliasing
8667 Allow the compiler to assume the strictest aliasing rules applicable to
8668 the language being compiled.  For C (and C++), this activates
8669 optimizations based on the type of expressions.  In particular, an
8670 object of one type is assumed never to reside at the same address as an
8671 object of a different type, unless the types are almost the same.  For
8672 example, an @code{unsigned int} can alias an @code{int}, but not a
8673 @code{void*} or a @code{double}.  A character type may alias any other
8674 type.
8676 @anchor{Type-punning}Pay special attention to code like this:
8677 @smallexample
8678 union a_union @{
8679   int i;
8680   double d;
8683 int f() @{
8684   union a_union t;
8685   t.d = 3.0;
8686   return t.i;
8688 @end smallexample
8689 The practice of reading from a different union member than the one most
8690 recently written to (called ``type-punning'') is common.  Even with
8691 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
8692 is accessed through the union type.  So, the code above works as
8693 expected.  @xref{Structures unions enumerations and bit-fields
8694 implementation}.  However, this code might not:
8695 @smallexample
8696 int f() @{
8697   union a_union t;
8698   int* ip;
8699   t.d = 3.0;
8700   ip = &t.i;
8701   return *ip;
8703 @end smallexample
8705 Similarly, access by taking the address, casting the resulting pointer
8706 and dereferencing the result has undefined behavior, even if the cast
8707 uses a union type, e.g.:
8708 @smallexample
8709 int f() @{
8710   double d = 3.0;
8711   return ((union a_union *) &d)->i;
8713 @end smallexample
8715 The @option{-fstrict-aliasing} option is enabled at levels
8716 @option{-O2}, @option{-O3}, @option{-Os}.
8718 @item -fstrict-overflow
8719 @opindex fstrict-overflow
8720 Allow the compiler to assume strict signed overflow rules, depending
8721 on the language being compiled.  For C (and C++) this means that
8722 overflow when doing arithmetic with signed numbers is undefined, which
8723 means that the compiler may assume that it does not happen.  This
8724 permits various optimizations.  For example, the compiler assumes
8725 that an expression like @code{i + 10 > i} is always true for
8726 signed @code{i}.  This assumption is only valid if signed overflow is
8727 undefined, as the expression is false if @code{i + 10} overflows when
8728 using twos complement arithmetic.  When this option is in effect any
8729 attempt to determine whether an operation on signed numbers 
8730 overflows must be written carefully to not actually involve overflow.
8732 This option also allows the compiler to assume strict pointer
8733 semantics: given a pointer to an object, if adding an offset to that
8734 pointer does not produce a pointer to the same object, the addition is
8735 undefined.  This permits the compiler to conclude that @code{p + u >
8736 p} is always true for a pointer @code{p} and unsigned integer
8737 @code{u}.  This assumption is only valid because pointer wraparound is
8738 undefined, as the expression is false if @code{p + u} overflows using
8739 twos complement arithmetic.
8741 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
8742 that integer signed overflow is fully defined: it wraps.  When
8743 @option{-fwrapv} is used, there is no difference between
8744 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
8745 integers.  With @option{-fwrapv} certain types of overflow are
8746 permitted.  For example, if the compiler gets an overflow when doing
8747 arithmetic on constants, the overflowed value can still be used with
8748 @option{-fwrapv}, but not otherwise.
8750 The @option{-fstrict-overflow} option is enabled at levels
8751 @option{-O2}, @option{-O3}, @option{-Os}.
8753 @item -falign-functions
8754 @itemx -falign-functions=@var{n}
8755 @opindex falign-functions
8756 Align the start of functions to the next power-of-two greater than
8757 @var{n}, skipping up to @var{n} bytes.  For instance,
8758 @option{-falign-functions=32} aligns functions to the next 32-byte
8759 boundary, but @option{-falign-functions=24} aligns to the next
8760 32-byte boundary only if this can be done by skipping 23 bytes or less.
8762 @option{-fno-align-functions} and @option{-falign-functions=1} are
8763 equivalent and mean that functions are not aligned.
8765 Some assemblers only support this flag when @var{n} is a power of two;
8766 in that case, it is rounded up.
8768 If @var{n} is not specified or is zero, use a machine-dependent default.
8770 Enabled at levels @option{-O2}, @option{-O3}.
8772 @item -falign-labels
8773 @itemx -falign-labels=@var{n}
8774 @opindex falign-labels
8775 Align all branch targets to a power-of-two boundary, skipping up to
8776 @var{n} bytes like @option{-falign-functions}.  This option can easily
8777 make code slower, because it must insert dummy operations for when the
8778 branch target is reached in the usual flow of the code.
8780 @option{-fno-align-labels} and @option{-falign-labels=1} are
8781 equivalent and mean that labels are not aligned.
8783 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
8784 are greater than this value, then their values are used instead.
8786 If @var{n} is not specified or is zero, use a machine-dependent default
8787 which is very likely to be @samp{1}, meaning no alignment.
8789 Enabled at levels @option{-O2}, @option{-O3}.
8791 @item -falign-loops
8792 @itemx -falign-loops=@var{n}
8793 @opindex falign-loops
8794 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
8795 like @option{-falign-functions}.  If the loops are
8796 executed many times, this makes up for any execution of the dummy
8797 operations.
8799 @option{-fno-align-loops} and @option{-falign-loops=1} are
8800 equivalent and mean that loops are not aligned.
8802 If @var{n} is not specified or is zero, use a machine-dependent default.
8804 Enabled at levels @option{-O2}, @option{-O3}.
8806 @item -falign-jumps
8807 @itemx -falign-jumps=@var{n}
8808 @opindex falign-jumps
8809 Align branch targets to a power-of-two boundary, for branch targets
8810 where the targets can only be reached by jumping, skipping up to @var{n}
8811 bytes like @option{-falign-functions}.  In this case, no dummy operations
8812 need be executed.
8814 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
8815 equivalent and mean that loops are not aligned.
8817 If @var{n} is not specified or is zero, use a machine-dependent default.
8819 Enabled at levels @option{-O2}, @option{-O3}.
8821 @item -funit-at-a-time
8822 @opindex funit-at-a-time
8823 This option is left for compatibility reasons. @option{-funit-at-a-time}
8824 has no effect, while @option{-fno-unit-at-a-time} implies
8825 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
8827 Enabled by default.
8829 @item -fno-toplevel-reorder
8830 @opindex fno-toplevel-reorder
8831 Do not reorder top-level functions, variables, and @code{asm}
8832 statements.  Output them in the same order that they appear in the
8833 input file.  When this option is used, unreferenced static variables
8834 are not removed.  This option is intended to support existing code
8835 that relies on a particular ordering.  For new code, it is better to
8836 use attributes when possible.
8838 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
8839 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
8840 targets.
8842 @item -fweb
8843 @opindex fweb
8844 Constructs webs as commonly used for register allocation purposes and assign
8845 each web individual pseudo register.  This allows the register allocation pass
8846 to operate on pseudos directly, but also strengthens several other optimization
8847 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
8848 however, make debugging impossible, since variables no longer stay in a
8849 ``home register''.
8851 Enabled by default with @option{-funroll-loops}.
8853 @item -fwhole-program
8854 @opindex fwhole-program
8855 Assume that the current compilation unit represents the whole program being
8856 compiled.  All public functions and variables with the exception of @code{main}
8857 and those merged by attribute @code{externally_visible} become static functions
8858 and in effect are optimized more aggressively by interprocedural optimizers.
8860 This option should not be used in combination with @code{-flto}.
8861 Instead relying on a linker plugin should provide safer and more precise
8862 information.
8864 @item -flto[=@var{n}]
8865 @opindex flto
8866 This option runs the standard link-time optimizer.  When invoked
8867 with source code, it generates GIMPLE (one of GCC's internal
8868 representations) and writes it to special ELF sections in the object
8869 file.  When the object files are linked together, all the function
8870 bodies are read from these ELF sections and instantiated as if they
8871 had been part of the same translation unit.
8873 To use the link-time optimizer, @option{-flto} and optimization
8874 options should be specified at compile time and during the final link.
8875 For example:
8877 @smallexample
8878 gcc -c -O2 -flto foo.c
8879 gcc -c -O2 -flto bar.c
8880 gcc -o myprog -flto -O2 foo.o bar.o
8881 @end smallexample
8883 The first two invocations to GCC save a bytecode representation
8884 of GIMPLE into special ELF sections inside @file{foo.o} and
8885 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
8886 @file{foo.o} and @file{bar.o}, merges the two files into a single
8887 internal image, and compiles the result as usual.  Since both
8888 @file{foo.o} and @file{bar.o} are merged into a single image, this
8889 causes all the interprocedural analyses and optimizations in GCC to
8890 work across the two files as if they were a single one.  This means,
8891 for example, that the inliner is able to inline functions in
8892 @file{bar.o} into functions in @file{foo.o} and vice-versa.
8894 Another (simpler) way to enable link-time optimization is:
8896 @smallexample
8897 gcc -o myprog -flto -O2 foo.c bar.c
8898 @end smallexample
8900 The above generates bytecode for @file{foo.c} and @file{bar.c},
8901 merges them together into a single GIMPLE representation and optimizes
8902 them as usual to produce @file{myprog}.
8904 The only important thing to keep in mind is that to enable link-time
8905 optimizations you need to use the GCC driver to perform the link-step.
8906 GCC then automatically performs link-time optimization if any of the
8907 objects involved were compiled with the @option{-flto}.  You generally
8908 should specify the optimization options to be used for link-time
8909 optimization though GCC will try to be clever at guessing an
8910 optimization level to use from the options used at compile-time
8911 if you fail to specify one at link-time.  You can always override
8912 the automatic decision to do link-time optimization at link-time
8913 by passing @option{-fno-lto} to the link command.
8915 To make whole program optimization effective, it is necessary to make
8916 certain whole program assumptions.  The compiler needs to know
8917 what functions and variables can be accessed by libraries and runtime
8918 outside of the link-time optimized unit.  When supported by the linker,
8919 the linker plugin (see @option{-fuse-linker-plugin}) passes information
8920 to the compiler about used and externally visible symbols.  When
8921 the linker plugin is not available, @option{-fwhole-program} should be
8922 used to allow the compiler to make these assumptions, which leads
8923 to more aggressive optimization decisions.
8925 When @option{-fuse-linker-plugin} is not enabled then, when a file is
8926 compiled with @option{-flto}, the generated object file is larger than
8927 a regular object file because it contains GIMPLE bytecodes and the usual
8928 final code (see @option{-ffat-lto-objects}.  This means that
8929 object files with LTO information can be linked as normal object
8930 files; if @option{-fno-lto} is passed to the linker, no
8931 interprocedural optimizations are applied.  Note that when
8932 @option{-fno-fat-lto-objects} is enabled the compile-stage is faster
8933 but you cannot perform a regular, non-LTO link on them.
8935 Additionally, the optimization flags used to compile individual files
8936 are not necessarily related to those used at link time.  For instance,
8938 @smallexample
8939 gcc -c -O0 -ffat-lto-objects -flto foo.c
8940 gcc -c -O0 -ffat-lto-objects -flto bar.c
8941 gcc -o myprog -O3 foo.o bar.o
8942 @end smallexample
8944 This produces individual object files with unoptimized assembler
8945 code, but the resulting binary @file{myprog} is optimized at
8946 @option{-O3}.  If, instead, the final binary is generated with
8947 @option{-fno-lto}, then @file{myprog} is not optimized.
8949 When producing the final binary, GCC only
8950 applies link-time optimizations to those files that contain bytecode.
8951 Therefore, you can mix and match object files and libraries with
8952 GIMPLE bytecodes and final object code.  GCC automatically selects
8953 which files to optimize in LTO mode and which files to link without
8954 further processing.
8956 There are some code generation flags preserved by GCC when
8957 generating bytecodes, as they need to be used during the final link
8958 stage.  Generally options specified at link-time override those
8959 specified at compile-time.
8961 If you do not specify an optimization level option @option{-O} at
8962 link-time then GCC will compute one based on the optimization levels
8963 used when compiling the object files.  The highest optimization
8964 level will win here.
8966 Currently, the following options and their setting are take from
8967 the first object file that explicitely specified it: 
8968 @option{-fPIC}, @option{-fpic}, @option{-fpie}, @option{-fcommon},
8969 @option{-fexceptions}, @option{-fnon-call-exceptions}, @option{-fgnu-tm}
8970 and all the @option{-m} target flags.
8972 Certain ABI changing flags are required to match in all compilation-units
8973 and trying to override this at link-time with a conflicting value
8974 is ignored.  This includes options such as @option{-freg-struct-return}
8975 and @option{-fpcc-struct-return}. 
8977 Other options such as @option{-ffp-contract}, @option{-fno-strict-overflow},
8978 @option{-fwrapv}, @option{-fno-trapv} or @option{-fno-strict-aliasing}
8979 are passed through to the link stage and merged conservatively for
8980 conflicting translation units.  Specifically
8981 @option{-fno-strict-overflow}, @option{-fwrapv} and @option{-fno-trapv} take
8982 precedence and for example @option{-ffp-contract=off} takes precedence
8983 over @option{-ffp-contract=fast}.  You can override them at linke-time.
8985 It is recommended that you compile all the files participating in the
8986 same link with the same options and also specify those options at
8987 link time.
8989 If LTO encounters objects with C linkage declared with incompatible
8990 types in separate translation units to be linked together (undefined
8991 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
8992 issued.  The behavior is still undefined at run time.  Similar
8993 diagnostics may be raised for other languages.
8995 Another feature of LTO is that it is possible to apply interprocedural
8996 optimizations on files written in different languages:
8998 @smallexample
8999 gcc -c -flto foo.c
9000 g++ -c -flto bar.cc
9001 gfortran -c -flto baz.f90
9002 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
9003 @end smallexample
9005 Notice that the final link is done with @command{g++} to get the C++
9006 runtime libraries and @option{-lgfortran} is added to get the Fortran
9007 runtime libraries.  In general, when mixing languages in LTO mode, you
9008 should use the same link command options as when mixing languages in a
9009 regular (non-LTO) compilation.
9011 If object files containing GIMPLE bytecode are stored in a library archive, say
9012 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
9013 are using a linker with plugin support.  To create static libraries suitable
9014 for LTO, use @command{gcc-ar} and @command{gcc-ranlib} instead of @command{ar}
9015 and @code{ranlib}; to show the symbols of object files with GIMPLE bytecode, use
9016 @command{gcc-nm}.  Those commands require that @command{ar}, @command{ranlib}
9017 and @command{nm} have been compiled with plugin support.  At link time, use the the
9018 flag @option{-fuse-linker-plugin} to ensure that the library participates in
9019 the LTO optimization process:
9021 @smallexample
9022 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
9023 @end smallexample
9025 With the linker plugin enabled, the linker extracts the needed
9026 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
9027 to make them part of the aggregated GIMPLE image to be optimized.
9029 If you are not using a linker with plugin support and/or do not
9030 enable the linker plugin, then the objects inside @file{libfoo.a}
9031 are extracted and linked as usual, but they do not participate
9032 in the LTO optimization process.  In order to make a static library suitable
9033 for both LTO optimization and usual linkage, compile its object files with
9034 @option{-flto} @code{-ffat-lto-objects}.
9036 Link-time optimizations do not require the presence of the whole program to
9037 operate.  If the program does not require any symbols to be exported, it is
9038 possible to combine @option{-flto} and @option{-fwhole-program} to allow
9039 the interprocedural optimizers to use more aggressive assumptions which may
9040 lead to improved optimization opportunities.
9041 Use of @option{-fwhole-program} is not needed when linker plugin is
9042 active (see @option{-fuse-linker-plugin}).
9044 The current implementation of LTO makes no
9045 attempt to generate bytecode that is portable between different
9046 types of hosts.  The bytecode files are versioned and there is a
9047 strict version check, so bytecode files generated in one version of
9048 GCC will not work with an older or newer version of GCC.
9050 Link-time optimization does not work well with generation of debugging
9051 information.  Combining @option{-flto} with
9052 @option{-g} is currently experimental and expected to produce unexpected
9053 results.
9055 If you specify the optional @var{n}, the optimization and code
9056 generation done at link time is executed in parallel using @var{n}
9057 parallel jobs by utilizing an installed @command{make} program.  The
9058 environment variable @env{MAKE} may be used to override the program
9059 used.  The default value for @var{n} is 1.
9061 You can also specify @option{-flto=jobserver} to use GNU make's
9062 job server mode to determine the number of parallel jobs. This
9063 is useful when the Makefile calling GCC is already executing in parallel.
9064 You must prepend a @samp{+} to the command recipe in the parent Makefile
9065 for this to work.  This option likely only works if @env{MAKE} is
9066 GNU make.
9068 @item -flto-partition=@var{alg}
9069 @opindex flto-partition
9070 Specify the partitioning algorithm used by the link-time optimizer.
9071 The value is either @code{1to1} to specify a partitioning mirroring
9072 the original source files or @code{balanced} to specify partitioning
9073 into equally sized chunks (whenever possible) or @code{max} to create
9074 new partition for every symbol where possible.  Specifying @code{none}
9075 as an algorithm disables partitioning and streaming completely. 
9076 The default value is @code{balanced}. While @code{1to1} can be used
9077 as an workaround for various code ordering issues, the @code{max}
9078 partitioning is intended for internal testing only.
9079 The value @code{one} specifies that exactly one partition should be
9080 used while the value @code{none} bypasses partitioning and executes
9081 the link-time optimization step directly from the WPA phase.
9083 @item -flto-odr-type-merging
9084 @opindex flto-odr-type-merging
9085 Enable streaming of mangled types names of C++ types and their unification
9086 at linktime.  This increases size of LTO object files, but enable
9087 diagnostics about One Definition Rule violations.
9089 @item -flto-compression-level=@var{n}
9090 This option specifies the level of compression used for intermediate
9091 language written to LTO object files, and is only meaningful in
9092 conjunction with LTO mode (@option{-flto}).  Valid
9093 values are 0 (no compression) to 9 (maximum compression).  Values
9094 outside this range are clamped to either 0 or 9.  If the option is not
9095 given, a default balanced compression setting is used.
9097 @item -flto-report
9098 Prints a report with internal details on the workings of the link-time
9099 optimizer.  The contents of this report vary from version to version.
9100 It is meant to be useful to GCC developers when processing object
9101 files in LTO mode (via @option{-flto}).
9103 Disabled by default.
9105 @item -flto-report-wpa
9106 Like @option{-flto-report}, but only print for the WPA phase of Link
9107 Time Optimization.
9109 @item -fuse-linker-plugin
9110 Enables the use of a linker plugin during link-time optimization.  This
9111 option relies on plugin support in the linker, which is available in gold
9112 or in GNU ld 2.21 or newer.
9114 This option enables the extraction of object files with GIMPLE bytecode out
9115 of library archives. This improves the quality of optimization by exposing
9116 more code to the link-time optimizer.  This information specifies what
9117 symbols can be accessed externally (by non-LTO object or during dynamic
9118 linking).  Resulting code quality improvements on binaries (and shared
9119 libraries that use hidden visibility) are similar to @code{-fwhole-program}.
9120 See @option{-flto} for a description of the effect of this flag and how to
9121 use it.
9123 This option is enabled by default when LTO support in GCC is enabled
9124 and GCC was configured for use with
9125 a linker supporting plugins (GNU ld 2.21 or newer or gold).
9127 @item -ffat-lto-objects
9128 @opindex ffat-lto-objects
9129 Fat LTO objects are object files that contain both the intermediate language
9130 and the object code. This makes them usable for both LTO linking and normal
9131 linking. This option is effective only when compiling with @option{-flto}
9132 and is ignored at link time.
9134 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
9135 requires the complete toolchain to be aware of LTO. It requires a linker with
9136 linker plugin support for basic functionality.  Additionally,
9137 @command{nm}, @command{ar} and @command{ranlib}
9138 need to support linker plugins to allow a full-featured build environment
9139 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
9140 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
9141 to these tools. With non fat LTO makefiles need to be modified to use them.
9143 The default is @option{-fno-fat-lto-objects} on targets with linker plugin
9144 support.
9146 @item -fcompare-elim
9147 @opindex fcompare-elim
9148 After register allocation and post-register allocation instruction splitting,
9149 identify arithmetic instructions that compute processor flags similar to a
9150 comparison operation based on that arithmetic.  If possible, eliminate the
9151 explicit comparison operation.
9153 This pass only applies to certain targets that cannot explicitly represent
9154 the comparison operation before register allocation is complete.
9156 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9158 @item -fuse-ld=bfd
9159 @opindex fuse-ld=bfd
9160 Use the @command{bfd} linker instead of the default linker.
9162 @item -fuse-ld=gold
9163 @opindex fuse-ld=gold
9164 Use the @command{gold} linker instead of the default linker.
9166 @item -fcprop-registers
9167 @opindex fcprop-registers
9168 After register allocation and post-register allocation instruction splitting,
9169 perform a copy-propagation pass to try to reduce scheduling dependencies
9170 and occasionally eliminate the copy.
9172 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9174 @item -fprofile-correction
9175 @opindex fprofile-correction
9176 Profiles collected using an instrumented binary for multi-threaded programs may
9177 be inconsistent due to missed counter updates. When this option is specified,
9178 GCC uses heuristics to correct or smooth out such inconsistencies. By
9179 default, GCC emits an error message when an inconsistent profile is detected.
9181 @item -fprofile-dir=@var{path}
9182 @opindex fprofile-dir
9184 Set the directory to search for the profile data files in to @var{path}.
9185 This option affects only the profile data generated by
9186 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
9187 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
9188 and its related options.  Both absolute and relative paths can be used.
9189 By default, GCC uses the current directory as @var{path}, thus the
9190 profile data file appears in the same directory as the object file.
9192 @item -fprofile-generate
9193 @itemx -fprofile-generate=@var{path}
9194 @opindex fprofile-generate
9196 Enable options usually used for instrumenting application to produce
9197 profile useful for later recompilation with profile feedback based
9198 optimization.  You must use @option{-fprofile-generate} both when
9199 compiling and when linking your program.
9201 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
9203 If @var{path} is specified, GCC looks at the @var{path} to find
9204 the profile feedback data files. See @option{-fprofile-dir}.
9206 @item -fprofile-use
9207 @itemx -fprofile-use=@var{path}
9208 @opindex fprofile-use
9209 Enable profile feedback directed optimizations, and optimizations
9210 generally profitable only with profile feedback available.
9212 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
9213 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}, @code{-ftree-vectorize},
9214 @code{ftree-loop-distribute-patterns}
9216 By default, GCC emits an error message if the feedback profiles do not
9217 match the source code.  This error can be turned into a warning by using
9218 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
9219 code.
9221 If @var{path} is specified, GCC looks at the @var{path} to find
9222 the profile feedback data files. See @option{-fprofile-dir}.
9224 @item -fauto-profile
9225 @itemx -fauto-profile=@var{path}
9226 @opindex fauto-profile
9227 Enable sampling based feedback directed optimizations, and optimizations
9228 generally profitable only with profile feedback available.
9230 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
9231 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}, @code{-ftree-vectorize},
9232 @code{-finline-functions}, @code{-fipa-cp}, @code{-fipa-cp-clone},
9233 @code{-fpredictive-commoning}, @code{-funswitch-loops},
9234 @code{-fgcse-after-reload}, @code{-ftree-loop-distribute-patterns},
9236 If @var{path} is specified, GCC looks at the @var{path} to find
9237 the profile feedback data files.
9239 In order to collect AutoFDO profile, you need to have:
9241 1. A linux system with linux perf support
9242 2. (optional) An Intel processor with last branch record (LBR) support. This is
9243    to guarantee accurate instruction level profile, which is important for
9244    AutoFDO performance.
9246 To collect the profile, first use linux perf to collect raw profile
9247 (see @uref{https://perf.wiki.kernel.org/}).
9249 E.g.
9250 @code{perf record -e br_inst_retired:near_taken -b -o perf.data -- your_program}
9252 Then use create_gcov tool, which takes raw profile and unstripped binary to
9253 generate AutoFDO profile that can be used by GCC.
9254 (see @uref{https://github.com/google/autofdo}).
9256 E.g.
9257 @code{create_gcov --binary=your_program.unstripped --profile=perf.data --gcov=profile.afdo}
9258 @end table
9260 The following options control compiler behavior regarding floating-point 
9261 arithmetic.  These options trade off between speed and
9262 correctness.  All must be specifically enabled.
9264 @table @gcctabopt
9265 @item -ffloat-store
9266 @opindex ffloat-store
9267 Do not store floating-point variables in registers, and inhibit other
9268 options that might change whether a floating-point value is taken from a
9269 register or memory.
9271 @cindex floating-point precision
9272 This option prevents undesirable excess precision on machines such as
9273 the 68000 where the floating registers (of the 68881) keep more
9274 precision than a @code{double} is supposed to have.  Similarly for the
9275 x86 architecture.  For most programs, the excess precision does only
9276 good, but a few programs rely on the precise definition of IEEE floating
9277 point.  Use @option{-ffloat-store} for such programs, after modifying
9278 them to store all pertinent intermediate computations into variables.
9280 @item -fexcess-precision=@var{style}
9281 @opindex fexcess-precision
9282 This option allows further control over excess precision on machines
9283 where floating-point registers have more precision than the IEEE
9284 @code{float} and @code{double} types and the processor does not
9285 support operations rounding to those types.  By default,
9286 @option{-fexcess-precision=fast} is in effect; this means that
9287 operations are carried out in the precision of the registers and that
9288 it is unpredictable when rounding to the types specified in the source
9289 code takes place.  When compiling C, if
9290 @option{-fexcess-precision=standard} is specified then excess
9291 precision follows the rules specified in ISO C99; in particular,
9292 both casts and assignments cause values to be rounded to their
9293 semantic types (whereas @option{-ffloat-store} only affects
9294 assignments).  This option is enabled by default for C if a strict
9295 conformance option such as @option{-std=c99} is used.
9297 @opindex mfpmath
9298 @option{-fexcess-precision=standard} is not implemented for languages
9299 other than C, and has no effect if
9300 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
9301 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
9302 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
9303 semantics apply without excess precision, and in the latter, rounding
9304 is unpredictable.
9306 @item -ffast-math
9307 @opindex ffast-math
9308 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
9309 @option{-ffinite-math-only}, @option{-fno-rounding-math},
9310 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
9312 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
9314 This option is not turned on by any @option{-O} option besides
9315 @option{-Ofast} since it can result in incorrect output for programs
9316 that depend on an exact implementation of IEEE or ISO rules/specifications
9317 for math functions. It may, however, yield faster code for programs
9318 that do not require the guarantees of these specifications.
9320 @item -fno-math-errno
9321 @opindex fno-math-errno
9322 Do not set @code{errno} after calling math functions that are executed
9323 with a single instruction, e.g., @code{sqrt}.  A program that relies on
9324 IEEE exceptions for math error handling may want to use this flag
9325 for speed while maintaining IEEE arithmetic compatibility.
9327 This option is not turned on by any @option{-O} option since
9328 it can result in incorrect output for programs that depend on
9329 an exact implementation of IEEE or ISO rules/specifications for
9330 math functions. It may, however, yield faster code for programs
9331 that do not require the guarantees of these specifications.
9333 The default is @option{-fmath-errno}.
9335 On Darwin systems, the math library never sets @code{errno}.  There is
9336 therefore no reason for the compiler to consider the possibility that
9337 it might, and @option{-fno-math-errno} is the default.
9339 @item -funsafe-math-optimizations
9340 @opindex funsafe-math-optimizations
9342 Allow optimizations for floating-point arithmetic that (a) assume
9343 that arguments and results are valid and (b) may violate IEEE or
9344 ANSI standards.  When used at link-time, it may include libraries
9345 or startup files that change the default FPU control word or other
9346 similar optimizations.
9348 This option is not turned on by any @option{-O} option since
9349 it can result in incorrect output for programs that depend on
9350 an exact implementation of IEEE or ISO rules/specifications for
9351 math functions. It may, however, yield faster code for programs
9352 that do not require the guarantees of these specifications.
9353 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
9354 @option{-fassociative-math} and @option{-freciprocal-math}.
9356 The default is @option{-fno-unsafe-math-optimizations}.
9358 @item -fassociative-math
9359 @opindex fassociative-math
9361 Allow re-association of operands in series of floating-point operations.
9362 This violates the ISO C and C++ language standard by possibly changing
9363 computation result.  NOTE: re-ordering may change the sign of zero as
9364 well as ignore NaNs and inhibit or create underflow or overflow (and
9365 thus cannot be used on code that relies on rounding behavior like
9366 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
9367 and thus may not be used when ordered comparisons are required.
9368 This option requires that both @option{-fno-signed-zeros} and
9369 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
9370 much sense with @option{-frounding-math}. For Fortran the option
9371 is automatically enabled when both @option{-fno-signed-zeros} and
9372 @option{-fno-trapping-math} are in effect.
9374 The default is @option{-fno-associative-math}.
9376 @item -freciprocal-math
9377 @opindex freciprocal-math
9379 Allow the reciprocal of a value to be used instead of dividing by
9380 the value if this enables optimizations.  For example @code{x / y}
9381 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
9382 is subject to common subexpression elimination.  Note that this loses
9383 precision and increases the number of flops operating on the value.
9385 The default is @option{-fno-reciprocal-math}.
9387 @item -ffinite-math-only
9388 @opindex ffinite-math-only
9389 Allow optimizations for floating-point arithmetic that assume
9390 that arguments and results are not NaNs or +-Infs.
9392 This option is not turned on by any @option{-O} option since
9393 it can result in incorrect output for programs that depend on
9394 an exact implementation of IEEE or ISO rules/specifications for
9395 math functions. It may, however, yield faster code for programs
9396 that do not require the guarantees of these specifications.
9398 The default is @option{-fno-finite-math-only}.
9400 @item -fno-signed-zeros
9401 @opindex fno-signed-zeros
9402 Allow optimizations for floating-point arithmetic that ignore the
9403 signedness of zero.  IEEE arithmetic specifies the behavior of
9404 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
9405 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
9406 This option implies that the sign of a zero result isn't significant.
9408 The default is @option{-fsigned-zeros}.
9410 @item -fno-trapping-math
9411 @opindex fno-trapping-math
9412 Compile code assuming that floating-point operations cannot generate
9413 user-visible traps.  These traps include division by zero, overflow,
9414 underflow, inexact result and invalid operation.  This option requires
9415 that @option{-fno-signaling-nans} be in effect.  Setting this option may
9416 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
9418 This option should never be turned on by any @option{-O} option since
9419 it can result in incorrect output for programs that depend on
9420 an exact implementation of IEEE or ISO rules/specifications for
9421 math functions.
9423 The default is @option{-ftrapping-math}.
9425 @item -frounding-math
9426 @opindex frounding-math
9427 Disable transformations and optimizations that assume default floating-point
9428 rounding behavior.  This is round-to-zero for all floating point
9429 to integer conversions, and round-to-nearest for all other arithmetic
9430 truncations.  This option should be specified for programs that change
9431 the FP rounding mode dynamically, or that may be executed with a
9432 non-default rounding mode.  This option disables constant folding of
9433 floating-point expressions at compile time (which may be affected by
9434 rounding mode) and arithmetic transformations that are unsafe in the
9435 presence of sign-dependent rounding modes.
9437 The default is @option{-fno-rounding-math}.
9439 This option is experimental and does not currently guarantee to
9440 disable all GCC optimizations that are affected by rounding mode.
9441 Future versions of GCC may provide finer control of this setting
9442 using C99's @code{FENV_ACCESS} pragma.  This command-line option
9443 will be used to specify the default state for @code{FENV_ACCESS}.
9445 @item -fsignaling-nans
9446 @opindex fsignaling-nans
9447 Compile code assuming that IEEE signaling NaNs may generate user-visible
9448 traps during floating-point operations.  Setting this option disables
9449 optimizations that may change the number of exceptions visible with
9450 signaling NaNs.  This option implies @option{-ftrapping-math}.
9452 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
9453 be defined.
9455 The default is @option{-fno-signaling-nans}.
9457 This option is experimental and does not currently guarantee to
9458 disable all GCC optimizations that affect signaling NaN behavior.
9460 @item -fsingle-precision-constant
9461 @opindex fsingle-precision-constant
9462 Treat floating-point constants as single precision instead of
9463 implicitly converting them to double-precision constants.
9465 @item -fcx-limited-range
9466 @opindex fcx-limited-range
9467 When enabled, this option states that a range reduction step is not
9468 needed when performing complex division.  Also, there is no checking
9469 whether the result of a complex multiplication or division is @code{NaN
9470 + I*NaN}, with an attempt to rescue the situation in that case.  The
9471 default is @option{-fno-cx-limited-range}, but is enabled by
9472 @option{-ffast-math}.
9474 This option controls the default setting of the ISO C99
9475 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
9476 all languages.
9478 @item -fcx-fortran-rules
9479 @opindex fcx-fortran-rules
9480 Complex multiplication and division follow Fortran rules.  Range
9481 reduction is done as part of complex division, but there is no checking
9482 whether the result of a complex multiplication or division is @code{NaN
9483 + I*NaN}, with an attempt to rescue the situation in that case.
9485 The default is @option{-fno-cx-fortran-rules}.
9487 @end table
9489 The following options control optimizations that may improve
9490 performance, but are not enabled by any @option{-O} options.  This
9491 section includes experimental options that may produce broken code.
9493 @table @gcctabopt
9494 @item -fbranch-probabilities
9495 @opindex fbranch-probabilities
9496 After running a program compiled with @option{-fprofile-arcs}
9497 (@pxref{Debugging Options,, Options for Debugging Your Program or
9498 @command{gcc}}), you can compile it a second time using
9499 @option{-fbranch-probabilities}, to improve optimizations based on
9500 the number of times each branch was taken.  When a program
9501 compiled with @option{-fprofile-arcs} exits, it saves arc execution
9502 counts to a file called @file{@var{sourcename}.gcda} for each source
9503 file.  The information in this data file is very dependent on the
9504 structure of the generated code, so you must use the same source code
9505 and the same optimization options for both compilations.
9507 With @option{-fbranch-probabilities}, GCC puts a
9508 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
9509 These can be used to improve optimization.  Currently, they are only
9510 used in one place: in @file{reorg.c}, instead of guessing which path a
9511 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
9512 exactly determine which path is taken more often.
9514 @item -fprofile-values
9515 @opindex fprofile-values
9516 If combined with @option{-fprofile-arcs}, it adds code so that some
9517 data about values of expressions in the program is gathered.
9519 With @option{-fbranch-probabilities}, it reads back the data gathered
9520 from profiling values of expressions for usage in optimizations.
9522 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
9524 @item -fprofile-reorder-functions
9525 @opindex fprofile-reorder-functions
9526 Function reordering based on profile instrumentation collects
9527 first time of execution of a function and orders these functions
9528 in ascending order.
9530 Enabled with @option{-fprofile-use}.
9532 @item -fvpt
9533 @opindex fvpt
9534 If combined with @option{-fprofile-arcs}, this option instructs the compiler
9535 to add code to gather information about values of expressions.
9537 With @option{-fbranch-probabilities}, it reads back the data gathered
9538 and actually performs the optimizations based on them.
9539 Currently the optimizations include specialization of division operations
9540 using the knowledge about the value of the denominator.
9542 @item -frename-registers
9543 @opindex frename-registers
9544 Attempt to avoid false dependencies in scheduled code by making use
9545 of registers left over after register allocation.  This optimization
9546 most benefits processors with lots of registers.  Depending on the
9547 debug information format adopted by the target, however, it can
9548 make debugging impossible, since variables no longer stay in
9549 a ``home register''.
9551 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
9553 @item -ftracer
9554 @opindex ftracer
9555 Perform tail duplication to enlarge superblock size.  This transformation
9556 simplifies the control flow of the function allowing other optimizations to do
9557 a better job.
9559 Enabled with @option{-fprofile-use}.
9561 @item -funroll-loops
9562 @opindex funroll-loops
9563 Unroll loops whose number of iterations can be determined at compile time or
9564 upon entry to the loop.  @option{-funroll-loops} implies
9565 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
9566 It also turns on complete loop peeling (i.e.@: complete removal of loops with
9567 a small constant number of iterations).  This option makes code larger, and may
9568 or may not make it run faster.
9570 Enabled with @option{-fprofile-use}.
9572 @item -funroll-all-loops
9573 @opindex funroll-all-loops
9574 Unroll all loops, even if their number of iterations is uncertain when
9575 the loop is entered.  This usually makes programs run more slowly.
9576 @option{-funroll-all-loops} implies the same options as
9577 @option{-funroll-loops}.
9579 @item -fpeel-loops
9580 @opindex fpeel-loops
9581 Peels loops for which there is enough information that they do not
9582 roll much (from profile feedback).  It also turns on complete loop peeling
9583 (i.e.@: complete removal of loops with small constant number of iterations).
9585 Enabled with @option{-fprofile-use}.
9587 @item -fmove-loop-invariants
9588 @opindex fmove-loop-invariants
9589 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
9590 at level @option{-O1}
9592 @item -funswitch-loops
9593 @opindex funswitch-loops
9594 Move branches with loop invariant conditions out of the loop, with duplicates
9595 of the loop on both branches (modified according to result of the condition).
9597 @item -ffunction-sections
9598 @itemx -fdata-sections
9599 @opindex ffunction-sections
9600 @opindex fdata-sections
9601 Place each function or data item into its own section in the output
9602 file if the target supports arbitrary sections.  The name of the
9603 function or the name of the data item determines the section's name
9604 in the output file.
9606 Use these options on systems where the linker can perform optimizations
9607 to improve locality of reference in the instruction space.  Most systems
9608 using the ELF object format and SPARC processors running Solaris 2 have
9609 linkers with such optimizations.  AIX may have these optimizations in
9610 the future.
9612 Only use these options when there are significant benefits from doing
9613 so.  When you specify these options, the assembler and linker
9614 create larger object and executable files and are also slower.
9615 You cannot use @code{gprof} on all systems if you
9616 specify this option, and you may have problems with debugging if
9617 you specify both this option and @option{-g}.
9619 @item -fbranch-target-load-optimize
9620 @opindex fbranch-target-load-optimize
9621 Perform branch target register load optimization before prologue / epilogue
9622 threading.
9623 The use of target registers can typically be exposed only during reload,
9624 thus hoisting loads out of loops and doing inter-block scheduling needs
9625 a separate optimization pass.
9627 @item -fbranch-target-load-optimize2
9628 @opindex fbranch-target-load-optimize2
9629 Perform branch target register load optimization after prologue / epilogue
9630 threading.
9632 @item -fbtr-bb-exclusive
9633 @opindex fbtr-bb-exclusive
9634 When performing branch target register load optimization, don't reuse
9635 branch target registers within any basic block.
9637 @item -fstack-protector
9638 @opindex fstack-protector
9639 Emit extra code to check for buffer overflows, such as stack smashing
9640 attacks.  This is done by adding a guard variable to functions with
9641 vulnerable objects.  This includes functions that call @code{alloca}, and
9642 functions with buffers larger than 8 bytes.  The guards are initialized
9643 when a function is entered and then checked when the function exits.
9644 If a guard check fails, an error message is printed and the program exits.
9646 @item -fstack-protector-all
9647 @opindex fstack-protector-all
9648 Like @option{-fstack-protector} except that all functions are protected.
9650 @item -fstack-protector-strong
9651 @opindex fstack-protector-strong
9652 Like @option{-fstack-protector} but includes additional functions to
9653 be protected --- those that have local array definitions, or have
9654 references to local frame addresses.
9656 @item -fsection-anchors
9657 @opindex fsection-anchors
9658 Try to reduce the number of symbolic address calculations by using
9659 shared ``anchor'' symbols to address nearby objects.  This transformation
9660 can help to reduce the number of GOT entries and GOT accesses on some
9661 targets.
9663 For example, the implementation of the following function @code{foo}:
9665 @smallexample
9666 static int a, b, c;
9667 int foo (void) @{ return a + b + c; @}
9668 @end smallexample
9670 @noindent
9671 usually calculates the addresses of all three variables, but if you
9672 compile it with @option{-fsection-anchors}, it accesses the variables
9673 from a common anchor point instead.  The effect is similar to the
9674 following pseudocode (which isn't valid C):
9676 @smallexample
9677 int foo (void)
9679   register int *xr = &x;
9680   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
9682 @end smallexample
9684 Not all targets support this option.
9686 @item --param @var{name}=@var{value}
9687 @opindex param
9688 In some places, GCC uses various constants to control the amount of
9689 optimization that is done.  For example, GCC does not inline functions
9690 that contain more than a certain number of instructions.  You can
9691 control some of these constants on the command line using the
9692 @option{--param} option.
9694 The names of specific parameters, and the meaning of the values, are
9695 tied to the internals of the compiler, and are subject to change
9696 without notice in future releases.
9698 In each case, the @var{value} is an integer.  The allowable choices for
9699 @var{name} are:
9701 @table @gcctabopt
9702 @item predictable-branch-outcome
9703 When branch is predicted to be taken with probability lower than this threshold
9704 (in percent), then it is considered well predictable. The default is 10.
9706 @item max-crossjump-edges
9707 The maximum number of incoming edges to consider for cross-jumping.
9708 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
9709 the number of edges incoming to each block.  Increasing values mean
9710 more aggressive optimization, making the compilation time increase with
9711 probably small improvement in executable size.
9713 @item min-crossjump-insns
9714 The minimum number of instructions that must be matched at the end
9715 of two blocks before cross-jumping is performed on them.  This
9716 value is ignored in the case where all instructions in the block being
9717 cross-jumped from are matched.  The default value is 5.
9719 @item max-grow-copy-bb-insns
9720 The maximum code size expansion factor when copying basic blocks
9721 instead of jumping.  The expansion is relative to a jump instruction.
9722 The default value is 8.
9724 @item max-goto-duplication-insns
9725 The maximum number of instructions to duplicate to a block that jumps
9726 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
9727 passes, GCC factors computed gotos early in the compilation process,
9728 and unfactors them as late as possible.  Only computed jumps at the
9729 end of a basic blocks with no more than max-goto-duplication-insns are
9730 unfactored.  The default value is 8.
9732 @item max-delay-slot-insn-search
9733 The maximum number of instructions to consider when looking for an
9734 instruction to fill a delay slot.  If more than this arbitrary number of
9735 instructions are searched, the time savings from filling the delay slot
9736 are minimal, so stop searching.  Increasing values mean more
9737 aggressive optimization, making the compilation time increase with probably
9738 small improvement in execution time.
9740 @item max-delay-slot-live-search
9741 When trying to fill delay slots, the maximum number of instructions to
9742 consider when searching for a block with valid live register
9743 information.  Increasing this arbitrarily chosen value means more
9744 aggressive optimization, increasing the compilation time.  This parameter
9745 should be removed when the delay slot code is rewritten to maintain the
9746 control-flow graph.
9748 @item max-gcse-memory
9749 The approximate maximum amount of memory that can be allocated in
9750 order to perform the global common subexpression elimination
9751 optimization.  If more memory than specified is required, the
9752 optimization is not done.
9754 @item max-gcse-insertion-ratio
9755 If the ratio of expression insertions to deletions is larger than this value
9756 for any expression, then RTL PRE inserts or removes the expression and thus
9757 leaves partially redundant computations in the instruction stream.  The default value is 20.
9759 @item max-pending-list-length
9760 The maximum number of pending dependencies scheduling allows
9761 before flushing the current state and starting over.  Large functions
9762 with few branches or calls can create excessively large lists which
9763 needlessly consume memory and resources.
9765 @item max-modulo-backtrack-attempts
9766 The maximum number of backtrack attempts the scheduler should make
9767 when modulo scheduling a loop.  Larger values can exponentially increase
9768 compilation time.
9770 @item max-inline-insns-single
9771 Several parameters control the tree inliner used in GCC@.
9772 This number sets the maximum number of instructions (counted in GCC's
9773 internal representation) in a single function that the tree inliner
9774 considers for inlining.  This only affects functions declared
9775 inline and methods implemented in a class declaration (C++).
9776 The default value is 400.
9778 @item max-inline-insns-auto
9779 When you use @option{-finline-functions} (included in @option{-O3}),
9780 a lot of functions that would otherwise not be considered for inlining
9781 by the compiler are investigated.  To those functions, a different
9782 (more restrictive) limit compared to functions declared inline can
9783 be applied.
9784 The default value is 40.
9786 @item inline-min-speedup
9787 When estimated performance improvement of caller + callee runtime exceeds this
9788 threshold (in precent), the function can be inlined regardless the limit on
9789 @option{--param max-inline-insns-single} and @option{--param
9790 max-inline-insns-auto}.
9792 @item large-function-insns
9793 The limit specifying really large functions.  For functions larger than this
9794 limit after inlining, inlining is constrained by
9795 @option{--param large-function-growth}.  This parameter is useful primarily
9796 to avoid extreme compilation time caused by non-linear algorithms used by the
9797 back end.
9798 The default value is 2700.
9800 @item large-function-growth
9801 Specifies maximal growth of large function caused by inlining in percents.
9802 The default value is 100 which limits large function growth to 2.0 times
9803 the original size.
9805 @item large-unit-insns
9806 The limit specifying large translation unit.  Growth caused by inlining of
9807 units larger than this limit is limited by @option{--param inline-unit-growth}.
9808 For small units this might be too tight.
9809 For example, consider a unit consisting of function A
9810 that is inline and B that just calls A three times.  If B is small relative to
9811 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
9812 large units consisting of small inlineable functions, however, the overall unit
9813 growth limit is needed to avoid exponential explosion of code size.  Thus for
9814 smaller units, the size is increased to @option{--param large-unit-insns}
9815 before applying @option{--param inline-unit-growth}.  The default is 10000.
9817 @item inline-unit-growth
9818 Specifies maximal overall growth of the compilation unit caused by inlining.
9819 The default value is 30 which limits unit growth to 1.3 times the original
9820 size. Cold functions (either marked cold via an attribute or by profile
9821 feedback) are not accounted into the unit size.
9823 @item ipcp-unit-growth
9824 Specifies maximal overall growth of the compilation unit caused by
9825 interprocedural constant propagation.  The default value is 10 which limits
9826 unit growth to 1.1 times the original size.
9828 @item large-stack-frame
9829 The limit specifying large stack frames.  While inlining the algorithm is trying
9830 to not grow past this limit too much.  The default value is 256 bytes.
9832 @item large-stack-frame-growth
9833 Specifies maximal growth of large stack frames caused by inlining in percents.
9834 The default value is 1000 which limits large stack frame growth to 11 times
9835 the original size.
9837 @item max-inline-insns-recursive
9838 @itemx max-inline-insns-recursive-auto
9839 Specifies the maximum number of instructions an out-of-line copy of a
9840 self-recursive inline
9841 function can grow into by performing recursive inlining.
9843 For functions declared inline, @option{--param max-inline-insns-recursive} is
9844 taken into account.  For functions not declared inline, recursive inlining
9845 happens only when @option{-finline-functions} (included in @option{-O3}) is
9846 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
9847 default value is 450.
9849 @item max-inline-recursive-depth
9850 @itemx max-inline-recursive-depth-auto
9851 Specifies the maximum recursion depth used for recursive inlining.
9853 For functions declared inline, @option{--param max-inline-recursive-depth} is
9854 taken into account.  For functions not declared inline, recursive inlining
9855 happens only when @option{-finline-functions} (included in @option{-O3}) is
9856 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
9857 default value is 8.
9859 @item min-inline-recursive-probability
9860 Recursive inlining is profitable only for function having deep recursion
9861 in average and can hurt for function having little recursion depth by
9862 increasing the prologue size or complexity of function body to other
9863 optimizers.
9865 When profile feedback is available (see @option{-fprofile-generate}) the actual
9866 recursion depth can be guessed from probability that function recurses via a
9867 given call expression.  This parameter limits inlining only to call expressions
9868 whose probability exceeds the given threshold (in percents).
9869 The default value is 10.
9871 @item early-inlining-insns
9872 Specify growth that the early inliner can make.  In effect it increases
9873 the amount of inlining for code having a large abstraction penalty.
9874 The default value is 10.
9876 @item max-early-inliner-iterations
9877 @itemx max-early-inliner-iterations
9878 Limit of iterations of the early inliner.  This basically bounds
9879 the number of nested indirect calls the early inliner can resolve.
9880 Deeper chains are still handled by late inlining.
9882 @item comdat-sharing-probability
9883 @itemx comdat-sharing-probability
9884 Probability (in percent) that C++ inline function with comdat visibility
9885 are shared across multiple compilation units.  The default value is 20.
9887 @item profile-func-internal-id
9888 @itemx profile-func-internal-id
9889 A parameter to control whether to use function internal id in profile
9890 database lookup. If the value is 0, the compiler will use id that
9891 is based on function assembler name and filename, which makes old profile
9892 data more tolerant to source changes such as function reordering etc.
9893 The default value is 0.
9895 @item min-vect-loop-bound
9896 The minimum number of iterations under which loops are not vectorized
9897 when @option{-ftree-vectorize} is used.  The number of iterations after
9898 vectorization needs to be greater than the value specified by this option
9899 to allow vectorization.  The default value is 0.
9901 @item gcse-cost-distance-ratio
9902 Scaling factor in calculation of maximum distance an expression
9903 can be moved by GCSE optimizations.  This is currently supported only in the
9904 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
9905 is with simple expressions, i.e., the expressions that have cost
9906 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
9907 hoisting of simple expressions.  The default value is 10.
9909 @item gcse-unrestricted-cost
9910 Cost, roughly measured as the cost of a single typical machine
9911 instruction, at which GCSE optimizations do not constrain
9912 the distance an expression can travel.  This is currently
9913 supported only in the code hoisting pass.  The lesser the cost,
9914 the more aggressive code hoisting is.  Specifying 0 
9915 allows all expressions to travel unrestricted distances.
9916 The default value is 3.
9918 @item max-hoist-depth
9919 The depth of search in the dominator tree for expressions to hoist.
9920 This is used to avoid quadratic behavior in hoisting algorithm.
9921 The value of 0 does not limit on the search, but may slow down compilation
9922 of huge functions.  The default value is 30.
9924 @item max-tail-merge-comparisons
9925 The maximum amount of similar bbs to compare a bb with.  This is used to
9926 avoid quadratic behavior in tree tail merging.  The default value is 10.
9928 @item max-tail-merge-iterations
9929 The maximum amount of iterations of the pass over the function.  This is used to
9930 limit compilation time in tree tail merging.  The default value is 2.
9932 @item max-unrolled-insns
9933 The maximum number of instructions that a loop may have to be unrolled.
9934 If a loop is unrolled, this parameter also determines how many times
9935 the loop code is unrolled.
9937 @item max-average-unrolled-insns
9938 The maximum number of instructions biased by probabilities of their execution
9939 that a loop may have to be unrolled.  If a loop is unrolled,
9940 this parameter also determines how many times the loop code is unrolled.
9942 @item max-unroll-times
9943 The maximum number of unrollings of a single loop.
9945 @item max-peeled-insns
9946 The maximum number of instructions that a loop may have to be peeled.
9947 If a loop is peeled, this parameter also determines how many times
9948 the loop code is peeled.
9950 @item max-peel-times
9951 The maximum number of peelings of a single loop.
9953 @item max-peel-branches
9954 The maximum number of branches on the hot path through the peeled sequence.
9956 @item max-completely-peeled-insns
9957 The maximum number of insns of a completely peeled loop.
9959 @item max-completely-peel-times
9960 The maximum number of iterations of a loop to be suitable for complete peeling.
9962 @item max-completely-peel-loop-nest-depth
9963 The maximum depth of a loop nest suitable for complete peeling.
9965 @item max-unswitch-insns
9966 The maximum number of insns of an unswitched loop.
9968 @item max-unswitch-level
9969 The maximum number of branches unswitched in a single loop.
9971 @item lim-expensive
9972 The minimum cost of an expensive expression in the loop invariant motion.
9974 @item iv-consider-all-candidates-bound
9975 Bound on number of candidates for induction variables, below which
9976 all candidates are considered for each use in induction variable
9977 optimizations.  If there are more candidates than this,
9978 only the most relevant ones are considered to avoid quadratic time complexity.
9980 @item iv-max-considered-uses
9981 The induction variable optimizations give up on loops that contain more
9982 induction variable uses.
9984 @item iv-always-prune-cand-set-bound
9985 If the number of candidates in the set is smaller than this value,
9986 always try to remove unnecessary ivs from the set
9987 when adding a new one.
9989 @item scev-max-expr-size
9990 Bound on size of expressions used in the scalar evolutions analyzer.
9991 Large expressions slow the analyzer.
9993 @item scev-max-expr-complexity
9994 Bound on the complexity of the expressions in the scalar evolutions analyzer.
9995 Complex expressions slow the analyzer.
9997 @item omega-max-vars
9998 The maximum number of variables in an Omega constraint system.
9999 The default value is 128.
10001 @item omega-max-geqs
10002 The maximum number of inequalities in an Omega constraint system.
10003 The default value is 256.
10005 @item omega-max-eqs
10006 The maximum number of equalities in an Omega constraint system.
10007 The default value is 128.
10009 @item omega-max-wild-cards
10010 The maximum number of wildcard variables that the Omega solver is
10011 able to insert.  The default value is 18.
10013 @item omega-hash-table-size
10014 The size of the hash table in the Omega solver.  The default value is
10015 550.
10017 @item omega-max-keys
10018 The maximal number of keys used by the Omega solver.  The default
10019 value is 500.
10021 @item omega-eliminate-redundant-constraints
10022 When set to 1, use expensive methods to eliminate all redundant
10023 constraints.  The default value is 0.
10025 @item vect-max-version-for-alignment-checks
10026 The maximum number of run-time checks that can be performed when
10027 doing loop versioning for alignment in the vectorizer.
10029 @item vect-max-version-for-alias-checks
10030 The maximum number of run-time checks that can be performed when
10031 doing loop versioning for alias in the vectorizer.
10033 @item vect-max-peeling-for-alignment
10034 The maximum number of loop peels to enhance access alignment
10035 for vectorizer. Value -1 means 'no limit'.
10037 @item max-iterations-to-track
10038 The maximum number of iterations of a loop the brute-force algorithm
10039 for analysis of the number of iterations of the loop tries to evaluate.
10041 @item hot-bb-count-ws-permille
10042 A basic block profile count is considered hot if it contributes to 
10043 the given permillage (i.e. 0...1000) of the entire profiled execution.
10045 @item hot-bb-frequency-fraction
10046 Select fraction of the entry block frequency of executions of basic block in
10047 function given basic block needs to have to be considered hot.
10049 @item max-predicted-iterations
10050 The maximum number of loop iterations we predict statically.  This is useful
10051 in cases where a function contains a single loop with known bound and
10052 another loop with unknown bound.
10053 The known number of iterations is predicted correctly, while
10054 the unknown number of iterations average to roughly 10.  This means that the
10055 loop without bounds appears artificially cold relative to the other one.
10057 @item builtin-expect-probability
10058 Control the probability of the expression having the specified value. This
10059 parameter takes a percentage (i.e. 0 ... 100) as input.
10060 The default probability of 90 is obtained empirically.
10062 @item align-threshold
10064 Select fraction of the maximal frequency of executions of a basic block in
10065 a function to align the basic block.
10067 @item align-loop-iterations
10069 A loop expected to iterate at least the selected number of iterations is
10070 aligned.
10072 @item tracer-dynamic-coverage
10073 @itemx tracer-dynamic-coverage-feedback
10075 This value is used to limit superblock formation once the given percentage of
10076 executed instructions is covered.  This limits unnecessary code size
10077 expansion.
10079 The @option{tracer-dynamic-coverage-feedback} is used only when profile
10080 feedback is available.  The real profiles (as opposed to statically estimated
10081 ones) are much less balanced allowing the threshold to be larger value.
10083 @item tracer-max-code-growth
10084 Stop tail duplication once code growth has reached given percentage.  This is
10085 a rather artificial limit, as most of the duplicates are eliminated later in
10086 cross jumping, so it may be set to much higher values than is the desired code
10087 growth.
10089 @item tracer-min-branch-ratio
10091 Stop reverse growth when the reverse probability of best edge is less than this
10092 threshold (in percent).
10094 @item tracer-min-branch-ratio
10095 @itemx tracer-min-branch-ratio-feedback
10097 Stop forward growth if the best edge has probability lower than this
10098 threshold.
10100 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
10101 compilation for profile feedback and one for compilation without.  The value
10102 for compilation with profile feedback needs to be more conservative (higher) in
10103 order to make tracer effective.
10105 @item max-cse-path-length
10107 The maximum number of basic blocks on path that CSE considers.
10108 The default is 10.
10110 @item max-cse-insns
10111 The maximum number of instructions CSE processes before flushing.
10112 The default is 1000.
10114 @item ggc-min-expand
10116 GCC uses a garbage collector to manage its own memory allocation.  This
10117 parameter specifies the minimum percentage by which the garbage
10118 collector's heap should be allowed to expand between collections.
10119 Tuning this may improve compilation speed; it has no effect on code
10120 generation.
10122 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
10123 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
10124 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
10125 GCC is not able to calculate RAM on a particular platform, the lower
10126 bound of 30% is used.  Setting this parameter and
10127 @option{ggc-min-heapsize} to zero causes a full collection to occur at
10128 every opportunity.  This is extremely slow, but can be useful for
10129 debugging.
10131 @item ggc-min-heapsize
10133 Minimum size of the garbage collector's heap before it begins bothering
10134 to collect garbage.  The first collection occurs after the heap expands
10135 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
10136 tuning this may improve compilation speed, and has no effect on code
10137 generation.
10139 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
10140 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
10141 with a lower bound of 4096 (four megabytes) and an upper bound of
10142 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
10143 particular platform, the lower bound is used.  Setting this parameter
10144 very large effectively disables garbage collection.  Setting this
10145 parameter and @option{ggc-min-expand} to zero causes a full collection
10146 to occur at every opportunity.
10148 @item max-reload-search-insns
10149 The maximum number of instruction reload should look backward for equivalent
10150 register.  Increasing values mean more aggressive optimization, making the
10151 compilation time increase with probably slightly better performance.
10152 The default value is 100.
10154 @item max-cselib-memory-locations
10155 The maximum number of memory locations cselib should take into account.
10156 Increasing values mean more aggressive optimization, making the compilation time
10157 increase with probably slightly better performance.  The default value is 500.
10159 @item reorder-blocks-duplicate
10160 @itemx reorder-blocks-duplicate-feedback
10162 Used by the basic block reordering pass to decide whether to use unconditional
10163 branch or duplicate the code on its destination.  Code is duplicated when its
10164 estimated size is smaller than this value multiplied by the estimated size of
10165 unconditional jump in the hot spots of the program.
10167 The @option{reorder-block-duplicate-feedback} is used only when profile
10168 feedback is available.  It may be set to higher values than
10169 @option{reorder-block-duplicate} since information about the hot spots is more
10170 accurate.
10172 @item max-sched-ready-insns
10173 The maximum number of instructions ready to be issued the scheduler should
10174 consider at any given time during the first scheduling pass.  Increasing
10175 values mean more thorough searches, making the compilation time increase
10176 with probably little benefit.  The default value is 100.
10178 @item max-sched-region-blocks
10179 The maximum number of blocks in a region to be considered for
10180 interblock scheduling.  The default value is 10.
10182 @item max-pipeline-region-blocks
10183 The maximum number of blocks in a region to be considered for
10184 pipelining in the selective scheduler.  The default value is 15.
10186 @item max-sched-region-insns
10187 The maximum number of insns in a region to be considered for
10188 interblock scheduling.  The default value is 100.
10190 @item max-pipeline-region-insns
10191 The maximum number of insns in a region to be considered for
10192 pipelining in the selective scheduler.  The default value is 200.
10194 @item min-spec-prob
10195 The minimum probability (in percents) of reaching a source block
10196 for interblock speculative scheduling.  The default value is 40.
10198 @item max-sched-extend-regions-iters
10199 The maximum number of iterations through CFG to extend regions.
10200 A value of 0 (the default) disables region extensions.
10202 @item max-sched-insn-conflict-delay
10203 The maximum conflict delay for an insn to be considered for speculative motion.
10204 The default value is 3.
10206 @item sched-spec-prob-cutoff
10207 The minimal probability of speculation success (in percents), so that
10208 speculative insns are scheduled.
10209 The default value is 40.
10211 @item sched-spec-state-edge-prob-cutoff
10212 The minimum probability an edge must have for the scheduler to save its
10213 state across it.
10214 The default value is 10.
10216 @item sched-mem-true-dep-cost
10217 Minimal distance (in CPU cycles) between store and load targeting same
10218 memory locations.  The default value is 1.
10220 @item selsched-max-lookahead
10221 The maximum size of the lookahead window of selective scheduling.  It is a
10222 depth of search for available instructions.
10223 The default value is 50.
10225 @item selsched-max-sched-times
10226 The maximum number of times that an instruction is scheduled during
10227 selective scheduling.  This is the limit on the number of iterations
10228 through which the instruction may be pipelined.  The default value is 2.
10230 @item selsched-max-insns-to-rename
10231 The maximum number of best instructions in the ready list that are considered
10232 for renaming in the selective scheduler.  The default value is 2.
10234 @item sms-min-sc
10235 The minimum value of stage count that swing modulo scheduler
10236 generates.  The default value is 2.
10238 @item max-last-value-rtl
10239 The maximum size measured as number of RTLs that can be recorded in an expression
10240 in combiner for a pseudo register as last known value of that register.  The default
10241 is 10000.
10243 @item max-combine-insns
10244 The maximum number of instructions the RTL combiner tries to combine.
10245 The default value is 2 at @option{-Og} and 4 otherwise.
10247 @item integer-share-limit
10248 Small integer constants can use a shared data structure, reducing the
10249 compiler's memory usage and increasing its speed.  This sets the maximum
10250 value of a shared integer constant.  The default value is 256.
10252 @item ssp-buffer-size
10253 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
10254 protection when @option{-fstack-protection} is used.
10256 @item min-size-for-stack-sharing
10257 The minimum size of variables taking part in stack slot sharing when not
10258 optimizing. The default value is 32.
10260 @item max-jump-thread-duplication-stmts
10261 Maximum number of statements allowed in a block that needs to be
10262 duplicated when threading jumps.
10264 @item max-fields-for-field-sensitive
10265 Maximum number of fields in a structure treated in
10266 a field sensitive manner during pointer analysis.  The default is zero
10267 for @option{-O0} and @option{-O1},
10268 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
10270 @item prefetch-latency
10271 Estimate on average number of instructions that are executed before
10272 prefetch finishes.  The distance prefetched ahead is proportional
10273 to this constant.  Increasing this number may also lead to less
10274 streams being prefetched (see @option{simultaneous-prefetches}).
10276 @item simultaneous-prefetches
10277 Maximum number of prefetches that can run at the same time.
10279 @item l1-cache-line-size
10280 The size of cache line in L1 cache, in bytes.
10282 @item l1-cache-size
10283 The size of L1 cache, in kilobytes.
10285 @item l2-cache-size
10286 The size of L2 cache, in kilobytes.
10288 @item min-insn-to-prefetch-ratio
10289 The minimum ratio between the number of instructions and the
10290 number of prefetches to enable prefetching in a loop.
10292 @item prefetch-min-insn-to-mem-ratio
10293 The minimum ratio between the number of instructions and the
10294 number of memory references to enable prefetching in a loop.
10296 @item use-canonical-types
10297 Whether the compiler should use the ``canonical'' type system.  By
10298 default, this should always be 1, which uses a more efficient internal
10299 mechanism for comparing types in C++ and Objective-C++.  However, if
10300 bugs in the canonical type system are causing compilation failures,
10301 set this value to 0 to disable canonical types.
10303 @item switch-conversion-max-branch-ratio
10304 Switch initialization conversion refuses to create arrays that are
10305 bigger than @option{switch-conversion-max-branch-ratio} times the number of
10306 branches in the switch.
10308 @item max-partial-antic-length
10309 Maximum length of the partial antic set computed during the tree
10310 partial redundancy elimination optimization (@option{-ftree-pre}) when
10311 optimizing at @option{-O3} and above.  For some sorts of source code
10312 the enhanced partial redundancy elimination optimization can run away,
10313 consuming all of the memory available on the host machine.  This
10314 parameter sets a limit on the length of the sets that are computed,
10315 which prevents the runaway behavior.  Setting a value of 0 for
10316 this parameter allows an unlimited set length.
10318 @item sccvn-max-scc-size
10319 Maximum size of a strongly connected component (SCC) during SCCVN
10320 processing.  If this limit is hit, SCCVN processing for the whole
10321 function is not done and optimizations depending on it are
10322 disabled.  The default maximum SCC size is 10000.
10324 @item sccvn-max-alias-queries-per-access
10325 Maximum number of alias-oracle queries we perform when looking for
10326 redundancies for loads and stores.  If this limit is hit the search
10327 is aborted and the load or store is not considered redundant.  The
10328 number of queries is algorithmically limited to the number of
10329 stores on all paths from the load to the function entry.
10330 The default maxmimum number of queries is 1000.
10332 @item ira-max-loops-num
10333 IRA uses regional register allocation by default.  If a function
10334 contains more loops than the number given by this parameter, only at most
10335 the given number of the most frequently-executed loops form regions
10336 for regional register allocation.  The default value of the
10337 parameter is 100.
10339 @item ira-max-conflict-table-size 
10340 Although IRA uses a sophisticated algorithm to compress the conflict
10341 table, the table can still require excessive amounts of memory for
10342 huge functions.  If the conflict table for a function could be more
10343 than the size in MB given by this parameter, the register allocator
10344 instead uses a faster, simpler, and lower-quality
10345 algorithm that does not require building a pseudo-register conflict table.  
10346 The default value of the parameter is 2000.
10348 @item ira-loop-reserved-regs
10349 IRA can be used to evaluate more accurate register pressure in loops
10350 for decisions to move loop invariants (see @option{-O3}).  The number
10351 of available registers reserved for some other purposes is given
10352 by this parameter.  The default value of the parameter is 2, which is
10353 the minimal number of registers needed by typical instructions.
10354 This value is the best found from numerous experiments.
10356 @item loop-invariant-max-bbs-in-loop
10357 Loop invariant motion can be very expensive, both in compilation time and
10358 in amount of needed compile-time memory, with very large loops.  Loops
10359 with more basic blocks than this parameter won't have loop invariant
10360 motion optimization performed on them.  The default value of the
10361 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
10363 @item loop-max-datarefs-for-datadeps
10364 Building data dapendencies is expensive for very large loops.  This
10365 parameter limits the number of data references in loops that are
10366 considered for data dependence analysis.  These large loops are no
10367 handled by the optimizations using loop data dependencies.
10368 The default value is 1000.
10370 @item max-vartrack-size
10371 Sets a maximum number of hash table slots to use during variable
10372 tracking dataflow analysis of any function.  If this limit is exceeded
10373 with variable tracking at assignments enabled, analysis for that
10374 function is retried without it, after removing all debug insns from
10375 the function.  If the limit is exceeded even without debug insns, var
10376 tracking analysis is completely disabled for the function.  Setting
10377 the parameter to zero makes it unlimited.
10379 @item max-vartrack-expr-depth
10380 Sets a maximum number of recursion levels when attempting to map
10381 variable names or debug temporaries to value expressions.  This trades
10382 compilation time for more complete debug information.  If this is set too
10383 low, value expressions that are available and could be represented in
10384 debug information may end up not being used; setting this higher may
10385 enable the compiler to find more complex debug expressions, but compile
10386 time and memory use may grow.  The default is 12.
10388 @item min-nondebug-insn-uid
10389 Use uids starting at this parameter for nondebug insns.  The range below
10390 the parameter is reserved exclusively for debug insns created by
10391 @option{-fvar-tracking-assignments}, but debug insns may get
10392 (non-overlapping) uids above it if the reserved range is exhausted.
10394 @item ipa-sra-ptr-growth-factor
10395 IPA-SRA replaces a pointer to an aggregate with one or more new
10396 parameters only when their cumulative size is less or equal to
10397 @option{ipa-sra-ptr-growth-factor} times the size of the original
10398 pointer parameter.
10400 @item tm-max-aggregate-size
10401 When making copies of thread-local variables in a transaction, this
10402 parameter specifies the size in bytes after which variables are
10403 saved with the logging functions as opposed to save/restore code
10404 sequence pairs.  This option only applies when using
10405 @option{-fgnu-tm}.
10407 @item graphite-max-nb-scop-params
10408 To avoid exponential effects in the Graphite loop transforms, the
10409 number of parameters in a Static Control Part (SCoP) is bounded.  The
10410 default value is 10 parameters.  A variable whose value is unknown at
10411 compilation time and defined outside a SCoP is a parameter of the SCoP.
10413 @item graphite-max-bbs-per-function
10414 To avoid exponential effects in the detection of SCoPs, the size of
10415 the functions analyzed by Graphite is bounded.  The default value is
10416 100 basic blocks.
10418 @item loop-block-tile-size
10419 Loop blocking or strip mining transforms, enabled with
10420 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
10421 loop in the loop nest by a given number of iterations.  The strip
10422 length can be changed using the @option{loop-block-tile-size}
10423 parameter.  The default value is 51 iterations.
10425 @item ipa-cp-value-list-size
10426 IPA-CP attempts to track all possible values and types passed to a function's
10427 parameter in order to propagate them and perform devirtualization.
10428 @option{ipa-cp-value-list-size} is the maximum number of values and types it
10429 stores per one formal parameter of a function.
10431 @item ipa-cp-eval-threshold
10432 IPA-CP calculates its own score of cloning profitability heuristics
10433 and performs those cloning opportunities with scores that exceed
10434 @option{ipa-cp-eval-threshold}.
10436 @item ipa-max-agg-items
10437 IPA-CP is also capable to propagate a number of scalar values passed
10438 in an aggregate. @option{ipa-max-agg-items} controls the maximum
10439 number of such values per one parameter.
10441 @item ipa-cp-loop-hint-bonus
10442 When IPA-CP determines that a cloning candidate would make the number
10443 of iterations of a loop known, it adds a bonus of
10444 @option{ipa-cp-loop-hint-bonus} to the profitability score of
10445 the candidate.
10447 @item ipa-cp-array-index-hint-bonus
10448 When IPA-CP determines that a cloning candidate would make the index of
10449 an array access known, it adds a bonus of
10450 @option{ipa-cp-array-index-hint-bonus} to the profitability
10451 score of the candidate.
10453 @item ipa-max-aa-steps
10454 During its analysis of function bodies, IPA-CP employs alias analysis
10455 in order to track values pointed to by function parameters.  In order
10456 not spend too much time analyzing huge functions, it will give up and
10457 consider all memory clobbered after examining
10458 @option{ipa-max-aa-steps} statements modifying memory.
10460 @item lto-partitions
10461 Specify desired number of partitions produced during WHOPR compilation.
10462 The number of partitions should exceed the number of CPUs used for compilation.
10463 The default value is 32.
10465 @item lto-minpartition
10466 Size of minimal partition for WHOPR (in estimated instructions).
10467 This prevents expenses of splitting very small programs into too many
10468 partitions.
10470 @item cxx-max-namespaces-for-diagnostic-help
10471 The maximum number of namespaces to consult for suggestions when C++
10472 name lookup fails for an identifier.  The default is 1000.
10474 @item sink-frequency-threshold
10475 The maximum relative execution frequency (in percents) of the target block
10476 relative to a statement's original block to allow statement sinking of a
10477 statement.  Larger numbers result in more aggressive statement sinking.
10478 The default value is 75.  A small positive adjustment is applied for
10479 statements with memory operands as those are even more profitable so sink.
10481 @item max-stores-to-sink
10482 The maximum number of conditional stores paires that can be sunk.  Set to 0
10483 if either vectorization (@option{-ftree-vectorize}) or if-conversion
10484 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
10486 @item allow-store-data-races
10487 Allow optimizers to introduce new data races on stores.
10488 Set to 1 to allow, otherwise to 0.  This option is enabled by default
10489 at optimization level @option{-Ofast}.
10491 @item case-values-threshold
10492 The smallest number of different values for which it is best to use a
10493 jump-table instead of a tree of conditional branches.  If the value is
10494 0, use the default for the machine.  The default is 0.
10496 @item tree-reassoc-width
10497 Set the maximum number of instructions executed in parallel in
10498 reassociated tree. This parameter overrides target dependent
10499 heuristics used by default if has non zero value.
10501 @item sched-pressure-algorithm
10502 Choose between the two available implementations of
10503 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
10504 and is the more likely to prevent instructions from being reordered.
10505 Algorithm 2 was designed to be a compromise between the relatively
10506 conservative approach taken by algorithm 1 and the rather aggressive
10507 approach taken by the default scheduler.  It relies more heavily on
10508 having a regular register file and accurate register pressure classes.
10509 See @file{haifa-sched.c} in the GCC sources for more details.
10511 The default choice depends on the target.
10513 @item max-slsr-cand-scan
10514 Set the maximum number of existing candidates that will be considered when
10515 seeking a basis for a new straight-line strength reduction candidate.
10517 @item asan-globals
10518 Enable buffer overflow detection for global objects.  This kind
10519 of protection is enabled by default if you are using
10520 @option{-fsanitize=address} option.
10521 To disable global objects protection use @option{--param asan-globals=0}.
10523 @item asan-stack
10524 Enable buffer overflow detection for stack objects.  This kind of
10525 protection is enabled by default when using@option{-fsanitize=address}.
10526 To disable stack protection use @option{--param asan-stack=0} option.
10528 @item asan-instrument-reads
10529 Enable buffer overflow detection for memory reads.  This kind of
10530 protection is enabled by default when using @option{-fsanitize=address}.
10531 To disable memory reads protection use
10532 @option{--param asan-instrument-reads=0}.
10534 @item asan-instrument-writes
10535 Enable buffer overflow detection for memory writes.  This kind of
10536 protection is enabled by default when using @option{-fsanitize=address}.
10537 To disable memory writes protection use
10538 @option{--param asan-instrument-writes=0} option.
10540 @item asan-memintrin
10541 Enable detection for built-in functions.  This kind of protection
10542 is enabled by default when using @option{-fsanitize=address}.
10543 To disable built-in functions protection use
10544 @option{--param asan-memintrin=0}.
10546 @item asan-use-after-return
10547 Enable detection of use-after-return.  This kind of protection
10548 is enabled by default when using @option{-fsanitize=address} option.
10549 To disable use-after-return detection use 
10550 @option{--param asan-use-after-return=0}.
10552 @item asan-instrumentation-with-call-threshold
10553 If number of memory accesses in function being instrumented
10554 is greater or equal to this number, use callbacks instead of inline checks.
10555 E.g. to disable inline code use
10556 @option{--param asan-instrumentation-with-call-threshold=0}.
10558 @end table
10559 @end table
10561 @node Preprocessor Options
10562 @section Options Controlling the Preprocessor
10563 @cindex preprocessor options
10564 @cindex options, preprocessor
10566 These options control the C preprocessor, which is run on each C source
10567 file before actual compilation.
10569 If you use the @option{-E} option, nothing is done except preprocessing.
10570 Some of these options make sense only together with @option{-E} because
10571 they cause the preprocessor output to be unsuitable for actual
10572 compilation.
10574 @table @gcctabopt
10575 @item -Wp,@var{option}
10576 @opindex Wp
10577 You can use @option{-Wp,@var{option}} to bypass the compiler driver
10578 and pass @var{option} directly through to the preprocessor.  If
10579 @var{option} contains commas, it is split into multiple options at the
10580 commas.  However, many options are modified, translated or interpreted
10581 by the compiler driver before being passed to the preprocessor, and
10582 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
10583 interface is undocumented and subject to change, so whenever possible
10584 you should avoid using @option{-Wp} and let the driver handle the
10585 options instead.
10587 @item -Xpreprocessor @var{option}
10588 @opindex Xpreprocessor
10589 Pass @var{option} as an option to the preprocessor.  You can use this to
10590 supply system-specific preprocessor options that GCC does not 
10591 recognize.
10593 If you want to pass an option that takes an argument, you must use
10594 @option{-Xpreprocessor} twice, once for the option and once for the argument.
10596 @item -no-integrated-cpp
10597 @opindex no-integrated-cpp
10598 Perform preprocessing as a separate pass before compilation.
10599 By default, GCC performs preprocessing as an integrated part of
10600 input tokenization and parsing.
10601 If this option is provided, the appropriate language front end
10602 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
10603 and Objective-C, respectively) is instead invoked twice,
10604 once for preprocessing only and once for actual compilation
10605 of the preprocessed input.
10606 This option may be useful in conjunction with the @option{-B} or
10607 @option{-wrapper} options to specify an alternate preprocessor or
10608 perform additional processing of the program source between
10609 normal preprocessing and compilation.
10610 @end table
10612 @include cppopts.texi
10614 @node Assembler Options
10615 @section Passing Options to the Assembler
10617 @c prevent bad page break with this line
10618 You can pass options to the assembler.
10620 @table @gcctabopt
10621 @item -Wa,@var{option}
10622 @opindex Wa
10623 Pass @var{option} as an option to the assembler.  If @var{option}
10624 contains commas, it is split into multiple options at the commas.
10626 @item -Xassembler @var{option}
10627 @opindex Xassembler
10628 Pass @var{option} as an option to the assembler.  You can use this to
10629 supply system-specific assembler options that GCC does not
10630 recognize.
10632 If you want to pass an option that takes an argument, you must use
10633 @option{-Xassembler} twice, once for the option and once for the argument.
10635 @end table
10637 @node Link Options
10638 @section Options for Linking
10639 @cindex link options
10640 @cindex options, linking
10642 These options come into play when the compiler links object files into
10643 an executable output file.  They are meaningless if the compiler is
10644 not doing a link step.
10646 @table @gcctabopt
10647 @cindex file names
10648 @item @var{object-file-name}
10649 A file name that does not end in a special recognized suffix is
10650 considered to name an object file or library.  (Object files are
10651 distinguished from libraries by the linker according to the file
10652 contents.)  If linking is done, these object files are used as input
10653 to the linker.
10655 @item -c
10656 @itemx -S
10657 @itemx -E
10658 @opindex c
10659 @opindex S
10660 @opindex E
10661 If any of these options is used, then the linker is not run, and
10662 object file names should not be used as arguments.  @xref{Overall
10663 Options}.
10665 @cindex Libraries
10666 @item -l@var{library}
10667 @itemx -l @var{library}
10668 @opindex l
10669 Search the library named @var{library} when linking.  (The second
10670 alternative with the library as a separate argument is only for
10671 POSIX compliance and is not recommended.)
10673 It makes a difference where in the command you write this option; the
10674 linker searches and processes libraries and object files in the order they
10675 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
10676 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
10677 to functions in @samp{z}, those functions may not be loaded.
10679 The linker searches a standard list of directories for the library,
10680 which is actually a file named @file{lib@var{library}.a}.  The linker
10681 then uses this file as if it had been specified precisely by name.
10683 The directories searched include several standard system directories
10684 plus any that you specify with @option{-L}.
10686 Normally the files found this way are library files---archive files
10687 whose members are object files.  The linker handles an archive file by
10688 scanning through it for members which define symbols that have so far
10689 been referenced but not defined.  But if the file that is found is an
10690 ordinary object file, it is linked in the usual fashion.  The only
10691 difference between using an @option{-l} option and specifying a file name
10692 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
10693 and searches several directories.
10695 @item -lobjc
10696 @opindex lobjc
10697 You need this special case of the @option{-l} option in order to
10698 link an Objective-C or Objective-C++ program.
10700 @item -nostartfiles
10701 @opindex nostartfiles
10702 Do not use the standard system startup files when linking.
10703 The standard system libraries are used normally, unless @option{-nostdlib}
10704 or @option{-nodefaultlibs} is used.
10706 @item -nodefaultlibs
10707 @opindex nodefaultlibs
10708 Do not use the standard system libraries when linking.
10709 Only the libraries you specify are passed to the linker, and options
10710 specifying linkage of the system libraries, such as @code{-static-libgcc}
10711 or @code{-shared-libgcc}, are ignored.  
10712 The standard startup files are used normally, unless @option{-nostartfiles}
10713 is used.  
10715 The compiler may generate calls to @code{memcmp},
10716 @code{memset}, @code{memcpy} and @code{memmove}.
10717 These entries are usually resolved by entries in
10718 libc.  These entry points should be supplied through some other
10719 mechanism when this option is specified.
10721 @item -nostdlib
10722 @opindex nostdlib
10723 Do not use the standard system startup files or libraries when linking.
10724 No startup files and only the libraries you specify are passed to
10725 the linker, and options specifying linkage of the system libraries, such as
10726 @code{-static-libgcc} or @code{-shared-libgcc}, are ignored.
10728 The compiler may generate calls to @code{memcmp}, @code{memset},
10729 @code{memcpy} and @code{memmove}.
10730 These entries are usually resolved by entries in
10731 libc.  These entry points should be supplied through some other
10732 mechanism when this option is specified.
10734 @cindex @option{-lgcc}, use with @option{-nostdlib}
10735 @cindex @option{-nostdlib} and unresolved references
10736 @cindex unresolved references and @option{-nostdlib}
10737 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
10738 @cindex @option{-nodefaultlibs} and unresolved references
10739 @cindex unresolved references and @option{-nodefaultlibs}
10740 One of the standard libraries bypassed by @option{-nostdlib} and
10741 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
10742 which GCC uses to overcome shortcomings of particular machines, or special
10743 needs for some languages.
10744 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
10745 Collection (GCC) Internals},
10746 for more discussion of @file{libgcc.a}.)
10747 In most cases, you need @file{libgcc.a} even when you want to avoid
10748 other standard libraries.  In other words, when you specify @option{-nostdlib}
10749 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
10750 This ensures that you have no unresolved references to internal GCC
10751 library subroutines.
10752 (An example of such an internal subroutine is @samp{__main}, used to ensure C++
10753 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
10754 GNU Compiler Collection (GCC) Internals}.)
10756 @item -pie
10757 @opindex pie
10758 Produce a position independent executable on targets that support it.
10759 For predictable results, you must also specify the same set of options
10760 used for compilation (@option{-fpie}, @option{-fPIE},
10761 or model suboptions) when you specify this linker option.
10763 @item -rdynamic
10764 @opindex rdynamic
10765 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
10766 that support it. This instructs the linker to add all symbols, not
10767 only used ones, to the dynamic symbol table. This option is needed
10768 for some uses of @code{dlopen} or to allow obtaining backtraces
10769 from within a program.
10771 @item -s
10772 @opindex s
10773 Remove all symbol table and relocation information from the executable.
10775 @item -static
10776 @opindex static
10777 On systems that support dynamic linking, this prevents linking with the shared
10778 libraries.  On other systems, this option has no effect.
10780 @item -shared
10781 @opindex shared
10782 Produce a shared object which can then be linked with other objects to
10783 form an executable.  Not all systems support this option.  For predictable
10784 results, you must also specify the same set of options used for compilation
10785 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
10786 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
10787 needs to build supplementary stub code for constructors to work.  On
10788 multi-libbed systems, @samp{gcc -shared} must select the correct support
10789 libraries to link against.  Failing to supply the correct flags may lead
10790 to subtle defects.  Supplying them in cases where they are not necessary
10791 is innocuous.}
10793 @item -shared-libgcc
10794 @itemx -static-libgcc
10795 @opindex shared-libgcc
10796 @opindex static-libgcc
10797 On systems that provide @file{libgcc} as a shared library, these options
10798 force the use of either the shared or static version, respectively.
10799 If no shared version of @file{libgcc} was built when the compiler was
10800 configured, these options have no effect.
10802 There are several situations in which an application should use the
10803 shared @file{libgcc} instead of the static version.  The most common
10804 of these is when the application wishes to throw and catch exceptions
10805 across different shared libraries.  In that case, each of the libraries
10806 as well as the application itself should use the shared @file{libgcc}.
10808 Therefore, the G++ and GCJ drivers automatically add
10809 @option{-shared-libgcc} whenever you build a shared library or a main
10810 executable, because C++ and Java programs typically use exceptions, so
10811 this is the right thing to do.
10813 If, instead, you use the GCC driver to create shared libraries, you may
10814 find that they are not always linked with the shared @file{libgcc}.
10815 If GCC finds, at its configuration time, that you have a non-GNU linker
10816 or a GNU linker that does not support option @option{--eh-frame-hdr},
10817 it links the shared version of @file{libgcc} into shared libraries
10818 by default.  Otherwise, it takes advantage of the linker and optimizes
10819 away the linking with the shared version of @file{libgcc}, linking with
10820 the static version of libgcc by default.  This allows exceptions to
10821 propagate through such shared libraries, without incurring relocation
10822 costs at library load time.
10824 However, if a library or main executable is supposed to throw or catch
10825 exceptions, you must link it using the G++ or GCJ driver, as appropriate
10826 for the languages used in the program, or using the option
10827 @option{-shared-libgcc}, such that it is linked with the shared
10828 @file{libgcc}.
10830 @item -static-libasan
10831 @opindex static-libasan
10832 When the @option{-fsanitize=address} option is used to link a program,
10833 the GCC driver automatically links against @option{libasan}.  If
10834 @file{libasan} is available as a shared library, and the @option{-static}
10835 option is not used, then this links against the shared version of
10836 @file{libasan}.  The @option{-static-libasan} option directs the GCC
10837 driver to link @file{libasan} statically, without necessarily linking
10838 other libraries statically.
10840 @item -static-libtsan
10841 @opindex static-libtsan
10842 When the @option{-fsanitize=thread} option is used to link a program,
10843 the GCC driver automatically links against @option{libtsan}.  If
10844 @file{libtsan} is available as a shared library, and the @option{-static}
10845 option is not used, then this links against the shared version of
10846 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
10847 driver to link @file{libtsan} statically, without necessarily linking
10848 other libraries statically.
10850 @item -static-liblsan
10851 @opindex static-liblsan
10852 When the @option{-fsanitize=leak} option is used to link a program,
10853 the GCC driver automatically links against @option{liblsan}.  If
10854 @file{liblsan} is available as a shared library, and the @option{-static}
10855 option is not used, then this links against the shared version of
10856 @file{liblsan}.  The @option{-static-liblsan} option directs the GCC
10857 driver to link @file{liblsan} statically, without necessarily linking
10858 other libraries statically.
10860 @item -static-libubsan
10861 @opindex static-libubsan
10862 When the @option{-fsanitize=undefined} option is used to link a program,
10863 the GCC driver automatically links against @option{libubsan}.  If
10864 @file{libubsan} is available as a shared library, and the @option{-static}
10865 option is not used, then this links against the shared version of
10866 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
10867 driver to link @file{libubsan} statically, without necessarily linking
10868 other libraries statically.
10870 @item -static-libstdc++
10871 @opindex static-libstdc++
10872 When the @command{g++} program is used to link a C++ program, it
10873 normally automatically links against @option{libstdc++}.  If
10874 @file{libstdc++} is available as a shared library, and the
10875 @option{-static} option is not used, then this links against the
10876 shared version of @file{libstdc++}.  That is normally fine.  However, it
10877 is sometimes useful to freeze the version of @file{libstdc++} used by
10878 the program without going all the way to a fully static link.  The
10879 @option{-static-libstdc++} option directs the @command{g++} driver to
10880 link @file{libstdc++} statically, without necessarily linking other
10881 libraries statically.
10883 @item -symbolic
10884 @opindex symbolic
10885 Bind references to global symbols when building a shared object.  Warn
10886 about any unresolved references (unless overridden by the link editor
10887 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
10888 this option.
10890 @item -T @var{script}
10891 @opindex T
10892 @cindex linker script
10893 Use @var{script} as the linker script.  This option is supported by most
10894 systems using the GNU linker.  On some targets, such as bare-board
10895 targets without an operating system, the @option{-T} option may be required
10896 when linking to avoid references to undefined symbols.
10898 @item -Xlinker @var{option}
10899 @opindex Xlinker
10900 Pass @var{option} as an option to the linker.  You can use this to
10901 supply system-specific linker options that GCC does not recognize.
10903 If you want to pass an option that takes a separate argument, you must use
10904 @option{-Xlinker} twice, once for the option and once for the argument.
10905 For example, to pass @option{-assert definitions}, you must write
10906 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
10907 @option{-Xlinker "-assert definitions"}, because this passes the entire
10908 string as a single argument, which is not what the linker expects.
10910 When using the GNU linker, it is usually more convenient to pass
10911 arguments to linker options using the @option{@var{option}=@var{value}}
10912 syntax than as separate arguments.  For example, you can specify
10913 @option{-Xlinker -Map=output.map} rather than
10914 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
10915 this syntax for command-line options.
10917 @item -Wl,@var{option}
10918 @opindex Wl
10919 Pass @var{option} as an option to the linker.  If @var{option} contains
10920 commas, it is split into multiple options at the commas.  You can use this
10921 syntax to pass an argument to the option.
10922 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
10923 linker.  When using the GNU linker, you can also get the same effect with
10924 @option{-Wl,-Map=output.map}.
10926 @item -u @var{symbol}
10927 @opindex u
10928 Pretend the symbol @var{symbol} is undefined, to force linking of
10929 library modules to define it.  You can use @option{-u} multiple times with
10930 different symbols to force loading of additional library modules.
10932 @item -z @var{keyword}
10933 @opindex z
10934 @option{-z} is passed directly on to the linker along with the keyword
10935 @var{keyword}. See the section in the documentation of your linker for
10936 permitted values and their meanings.
10937 @end table
10939 @node Directory Options
10940 @section Options for Directory Search
10941 @cindex directory options
10942 @cindex options, directory search
10943 @cindex search path
10945 These options specify directories to search for header files, for
10946 libraries and for parts of the compiler:
10948 @table @gcctabopt
10949 @item -I@var{dir}
10950 @opindex I
10951 Add the directory @var{dir} to the head of the list of directories to be
10952 searched for header files.  This can be used to override a system header
10953 file, substituting your own version, since these directories are
10954 searched before the system header file directories.  However, you should
10955 not use this option to add directories that contain vendor-supplied
10956 system header files (use @option{-isystem} for that).  If you use more than
10957 one @option{-I} option, the directories are scanned in left-to-right
10958 order; the standard system directories come after.
10960 If a standard system include directory, or a directory specified with
10961 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
10962 option is ignored.  The directory is still searched but as a
10963 system directory at its normal position in the system include chain.
10964 This is to ensure that GCC's procedure to fix buggy system headers and
10965 the ordering for the @code{include_next} directive are not inadvertently changed.
10966 If you really need to change the search order for system directories,
10967 use the @option{-nostdinc} and/or @option{-isystem} options.
10969 @item -iplugindir=@var{dir}
10970 @opindex iplugindir=
10971 Set the directory to search for plugins that are passed
10972 by @option{-fplugin=@var{name}} instead of
10973 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
10974 to be used by the user, but only passed by the driver.
10976 @item -iquote@var{dir}
10977 @opindex iquote
10978 Add the directory @var{dir} to the head of the list of directories to
10979 be searched for header files only for the case of @samp{#include
10980 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
10981 otherwise just like @option{-I}.
10983 @item -L@var{dir}
10984 @opindex L
10985 Add directory @var{dir} to the list of directories to be searched
10986 for @option{-l}.
10988 @item -B@var{prefix}
10989 @opindex B
10990 This option specifies where to find the executables, libraries,
10991 include files, and data files of the compiler itself.
10993 The compiler driver program runs one or more of the subprograms
10994 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
10995 @var{prefix} as a prefix for each program it tries to run, both with and
10996 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
10998 For each subprogram to be run, the compiler driver first tries the
10999 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
11000 is not specified, the driver tries two standard prefixes, 
11001 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
11002 those results in a file name that is found, the unmodified program
11003 name is searched for using the directories specified in your
11004 @env{PATH} environment variable.
11006 The compiler checks to see if the path provided by the @option{-B}
11007 refers to a directory, and if necessary it adds a directory
11008 separator character at the end of the path.
11010 @option{-B} prefixes that effectively specify directory names also apply
11011 to libraries in the linker, because the compiler translates these
11012 options into @option{-L} options for the linker.  They also apply to
11013 include files in the preprocessor, because the compiler translates these
11014 options into @option{-isystem} options for the preprocessor.  In this case,
11015 the compiler appends @samp{include} to the prefix.
11017 The runtime support file @file{libgcc.a} can also be searched for using
11018 the @option{-B} prefix, if needed.  If it is not found there, the two
11019 standard prefixes above are tried, and that is all.  The file is left
11020 out of the link if it is not found by those means.
11022 Another way to specify a prefix much like the @option{-B} prefix is to use
11023 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
11024 Variables}.
11026 As a special kludge, if the path provided by @option{-B} is
11027 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
11028 9, then it is replaced by @file{[dir/]include}.  This is to help
11029 with boot-strapping the compiler.
11031 @item -specs=@var{file}
11032 @opindex specs
11033 Process @var{file} after the compiler reads in the standard @file{specs}
11034 file, in order to override the defaults which the @command{gcc} driver
11035 program uses when determining what switches to pass to @command{cc1},
11036 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
11037 @option{-specs=@var{file}} can be specified on the command line, and they
11038 are processed in order, from left to right.
11040 @item --sysroot=@var{dir}
11041 @opindex sysroot
11042 Use @var{dir} as the logical root directory for headers and libraries.
11043 For example, if the compiler normally searches for headers in
11044 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
11045 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
11047 If you use both this option and the @option{-isysroot} option, then
11048 the @option{--sysroot} option applies to libraries, but the
11049 @option{-isysroot} option applies to header files.
11051 The GNU linker (beginning with version 2.16) has the necessary support
11052 for this option.  If your linker does not support this option, the
11053 header file aspect of @option{--sysroot} still works, but the
11054 library aspect does not.
11056 @item --no-sysroot-suffix
11057 @opindex no-sysroot-suffix
11058 For some targets, a suffix is added to the root directory specified
11059 with @option{--sysroot}, depending on the other options used, so that
11060 headers may for example be found in
11061 @file{@var{dir}/@var{suffix}/usr/include} instead of
11062 @file{@var{dir}/usr/include}.  This option disables the addition of
11063 such a suffix.
11065 @item -I-
11066 @opindex I-
11067 This option has been deprecated.  Please use @option{-iquote} instead for
11068 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
11069 Any directories you specify with @option{-I} options before the @option{-I-}
11070 option are searched only for the case of @samp{#include "@var{file}"};
11071 they are not searched for @samp{#include <@var{file}>}.
11073 If additional directories are specified with @option{-I} options after
11074 the @option{-I-}, these directories are searched for all @samp{#include}
11075 directives.  (Ordinarily @emph{all} @option{-I} directories are used
11076 this way.)
11078 In addition, the @option{-I-} option inhibits the use of the current
11079 directory (where the current input file came from) as the first search
11080 directory for @samp{#include "@var{file}"}.  There is no way to
11081 override this effect of @option{-I-}.  With @option{-I.} you can specify
11082 searching the directory that is current when the compiler is
11083 invoked.  That is not exactly the same as what the preprocessor does
11084 by default, but it is often satisfactory.
11086 @option{-I-} does not inhibit the use of the standard system directories
11087 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
11088 independent.
11089 @end table
11091 @c man end
11093 @node Spec Files
11094 @section Specifying subprocesses and the switches to pass to them
11095 @cindex Spec Files
11097 @command{gcc} is a driver program.  It performs its job by invoking a
11098 sequence of other programs to do the work of compiling, assembling and
11099 linking.  GCC interprets its command-line parameters and uses these to
11100 deduce which programs it should invoke, and which command-line options
11101 it ought to place on their command lines.  This behavior is controlled
11102 by @dfn{spec strings}.  In most cases there is one spec string for each
11103 program that GCC can invoke, but a few programs have multiple spec
11104 strings to control their behavior.  The spec strings built into GCC can
11105 be overridden by using the @option{-specs=} command-line switch to specify
11106 a spec file.
11108 @dfn{Spec files} are plaintext files that are used to construct spec
11109 strings.  They consist of a sequence of directives separated by blank
11110 lines.  The type of directive is determined by the first non-whitespace
11111 character on the line, which can be one of the following:
11113 @table @code
11114 @item %@var{command}
11115 Issues a @var{command} to the spec file processor.  The commands that can
11116 appear here are:
11118 @table @code
11119 @item %include <@var{file}>
11120 @cindex @code{%include}
11121 Search for @var{file} and insert its text at the current point in the
11122 specs file.
11124 @item %include_noerr <@var{file}>
11125 @cindex @code{%include_noerr}
11126 Just like @samp{%include}, but do not generate an error message if the include
11127 file cannot be found.
11129 @item %rename @var{old_name} @var{new_name}
11130 @cindex @code{%rename}
11131 Rename the spec string @var{old_name} to @var{new_name}.
11133 @end table
11135 @item *[@var{spec_name}]:
11136 This tells the compiler to create, override or delete the named spec
11137 string.  All lines after this directive up to the next directive or
11138 blank line are considered to be the text for the spec string.  If this
11139 results in an empty string then the spec is deleted.  (Or, if the
11140 spec did not exist, then nothing happens.)  Otherwise, if the spec
11141 does not currently exist a new spec is created.  If the spec does
11142 exist then its contents are overridden by the text of this
11143 directive, unless the first character of that text is the @samp{+}
11144 character, in which case the text is appended to the spec.
11146 @item [@var{suffix}]:
11147 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
11148 and up to the next directive or blank line are considered to make up the
11149 spec string for the indicated suffix.  When the compiler encounters an
11150 input file with the named suffix, it processes the spec string in
11151 order to work out how to compile that file.  For example:
11153 @smallexample
11154 .ZZ:
11155 z-compile -input %i
11156 @end smallexample
11158 This says that any input file whose name ends in @samp{.ZZ} should be
11159 passed to the program @samp{z-compile}, which should be invoked with the
11160 command-line switch @option{-input} and with the result of performing the
11161 @samp{%i} substitution.  (See below.)
11163 As an alternative to providing a spec string, the text following a
11164 suffix directive can be one of the following:
11166 @table @code
11167 @item @@@var{language}
11168 This says that the suffix is an alias for a known @var{language}.  This is
11169 similar to using the @option{-x} command-line switch to GCC to specify a
11170 language explicitly.  For example:
11172 @smallexample
11173 .ZZ:
11174 @@c++
11175 @end smallexample
11177 Says that .ZZ files are, in fact, C++ source files.
11179 @item #@var{name}
11180 This causes an error messages saying:
11182 @smallexample
11183 @var{name} compiler not installed on this system.
11184 @end smallexample
11185 @end table
11187 GCC already has an extensive list of suffixes built into it.
11188 This directive adds an entry to the end of the list of suffixes, but
11189 since the list is searched from the end backwards, it is effectively
11190 possible to override earlier entries using this technique.
11192 @end table
11194 GCC has the following spec strings built into it.  Spec files can
11195 override these strings or create their own.  Note that individual
11196 targets can also add their own spec strings to this list.
11198 @smallexample
11199 asm          Options to pass to the assembler
11200 asm_final    Options to pass to the assembler post-processor
11201 cpp          Options to pass to the C preprocessor
11202 cc1          Options to pass to the C compiler
11203 cc1plus      Options to pass to the C++ compiler
11204 endfile      Object files to include at the end of the link
11205 link         Options to pass to the linker
11206 lib          Libraries to include on the command line to the linker
11207 libgcc       Decides which GCC support library to pass to the linker
11208 linker       Sets the name of the linker
11209 predefines   Defines to be passed to the C preprocessor
11210 signed_char  Defines to pass to CPP to say whether @code{char} is signed
11211              by default
11212 startfile    Object files to include at the start of the link
11213 @end smallexample
11215 Here is a small example of a spec file:
11217 @smallexample
11218 %rename lib                 old_lib
11220 *lib:
11221 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
11222 @end smallexample
11224 This example renames the spec called @samp{lib} to @samp{old_lib} and
11225 then overrides the previous definition of @samp{lib} with a new one.
11226 The new definition adds in some extra command-line options before
11227 including the text of the old definition.
11229 @dfn{Spec strings} are a list of command-line options to be passed to their
11230 corresponding program.  In addition, the spec strings can contain
11231 @samp{%}-prefixed sequences to substitute variable text or to
11232 conditionally insert text into the command line.  Using these constructs
11233 it is possible to generate quite complex command lines.
11235 Here is a table of all defined @samp{%}-sequences for spec
11236 strings.  Note that spaces are not generated automatically around the
11237 results of expanding these sequences.  Therefore you can concatenate them
11238 together or combine them with constant text in a single argument.
11240 @table @code
11241 @item %%
11242 Substitute one @samp{%} into the program name or argument.
11244 @item %i
11245 Substitute the name of the input file being processed.
11247 @item %b
11248 Substitute the basename of the input file being processed.
11249 This is the substring up to (and not including) the last period
11250 and not including the directory.
11252 @item %B
11253 This is the same as @samp{%b}, but include the file suffix (text after
11254 the last period).
11256 @item %d
11257 Marks the argument containing or following the @samp{%d} as a
11258 temporary file name, so that that file is deleted if GCC exits
11259 successfully.  Unlike @samp{%g}, this contributes no text to the
11260 argument.
11262 @item %g@var{suffix}
11263 Substitute a file name that has suffix @var{suffix} and is chosen
11264 once per compilation, and mark the argument in the same way as
11265 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
11266 name is now chosen in a way that is hard to predict even when previously
11267 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
11268 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
11269 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
11270 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
11271 was simply substituted with a file name chosen once per compilation,
11272 without regard to any appended suffix (which was therefore treated
11273 just like ordinary text), making such attacks more likely to succeed.
11275 @item %u@var{suffix}
11276 Like @samp{%g}, but generates a new temporary file name
11277 each time it appears instead of once per compilation.
11279 @item %U@var{suffix}
11280 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
11281 new one if there is no such last file name.  In the absence of any
11282 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
11283 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
11284 involves the generation of two distinct file names, one
11285 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
11286 simply substituted with a file name chosen for the previous @samp{%u},
11287 without regard to any appended suffix.
11289 @item %j@var{suffix}
11290 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
11291 writable, and if @option{-save-temps} is not used; 
11292 otherwise, substitute the name
11293 of a temporary file, just like @samp{%u}.  This temporary file is not
11294 meant for communication between processes, but rather as a junk
11295 disposal mechanism.
11297 @item %|@var{suffix}
11298 @itemx %m@var{suffix}
11299 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
11300 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
11301 all.  These are the two most common ways to instruct a program that it
11302 should read from standard input or write to standard output.  If you
11303 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
11304 construct: see for example @file{f/lang-specs.h}.
11306 @item %.@var{SUFFIX}
11307 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
11308 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
11309 terminated by the next space or %.
11311 @item %w
11312 Marks the argument containing or following the @samp{%w} as the
11313 designated output file of this compilation.  This puts the argument
11314 into the sequence of arguments that @samp{%o} substitutes.
11316 @item %o
11317 Substitutes the names of all the output files, with spaces
11318 automatically placed around them.  You should write spaces
11319 around the @samp{%o} as well or the results are undefined.
11320 @samp{%o} is for use in the specs for running the linker.
11321 Input files whose names have no recognized suffix are not compiled
11322 at all, but they are included among the output files, so they are
11323 linked.
11325 @item %O
11326 Substitutes the suffix for object files.  Note that this is
11327 handled specially when it immediately follows @samp{%g, %u, or %U},
11328 because of the need for those to form complete file names.  The
11329 handling is such that @samp{%O} is treated exactly as if it had already
11330 been substituted, except that @samp{%g, %u, and %U} do not currently
11331 support additional @var{suffix} characters following @samp{%O} as they do
11332 following, for example, @samp{.o}.
11334 @item %p
11335 Substitutes the standard macro predefinitions for the
11336 current target machine.  Use this when running @code{cpp}.
11338 @item %P
11339 Like @samp{%p}, but puts @samp{__} before and after the name of each
11340 predefined macro, except for macros that start with @samp{__} or with
11341 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
11344 @item %I
11345 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
11346 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
11347 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
11348 and @option{-imultilib} as necessary.
11350 @item %s
11351 Current argument is the name of a library or startup file of some sort.
11352 Search for that file in a standard list of directories and substitute
11353 the full name found.  The current working directory is included in the
11354 list of directories scanned.
11356 @item %T
11357 Current argument is the name of a linker script.  Search for that file
11358 in the current list of directories to scan for libraries. If the file
11359 is located insert a @option{--script} option into the command line
11360 followed by the full path name found.  If the file is not found then
11361 generate an error message.  Note: the current working directory is not
11362 searched.
11364 @item %e@var{str}
11365 Print @var{str} as an error message.  @var{str} is terminated by a newline.
11366 Use this when inconsistent options are detected.
11368 @item %(@var{name})
11369 Substitute the contents of spec string @var{name} at this point.
11371 @item %x@{@var{option}@}
11372 Accumulate an option for @samp{%X}.
11374 @item %X
11375 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
11376 spec string.
11378 @item %Y
11379 Output the accumulated assembler options specified by @option{-Wa}.
11381 @item %Z
11382 Output the accumulated preprocessor options specified by @option{-Wp}.
11384 @item %a
11385 Process the @code{asm} spec.  This is used to compute the
11386 switches to be passed to the assembler.
11388 @item %A
11389 Process the @code{asm_final} spec.  This is a spec string for
11390 passing switches to an assembler post-processor, if such a program is
11391 needed.
11393 @item %l
11394 Process the @code{link} spec.  This is the spec for computing the
11395 command line passed to the linker.  Typically it makes use of the
11396 @samp{%L %G %S %D and %E} sequences.
11398 @item %D
11399 Dump out a @option{-L} option for each directory that GCC believes might
11400 contain startup files.  If the target supports multilibs then the
11401 current multilib directory is prepended to each of these paths.
11403 @item %L
11404 Process the @code{lib} spec.  This is a spec string for deciding which
11405 libraries are included on the command line to the linker.
11407 @item %G
11408 Process the @code{libgcc} spec.  This is a spec string for deciding
11409 which GCC support library is included on the command line to the linker.
11411 @item %S
11412 Process the @code{startfile} spec.  This is a spec for deciding which
11413 object files are the first ones passed to the linker.  Typically
11414 this might be a file named @file{crt0.o}.
11416 @item %E
11417 Process the @code{endfile} spec.  This is a spec string that specifies
11418 the last object files that are passed to the linker.
11420 @item %C
11421 Process the @code{cpp} spec.  This is used to construct the arguments
11422 to be passed to the C preprocessor.
11424 @item %1
11425 Process the @code{cc1} spec.  This is used to construct the options to be
11426 passed to the actual C compiler (@samp{cc1}).
11428 @item %2
11429 Process the @code{cc1plus} spec.  This is used to construct the options to be
11430 passed to the actual C++ compiler (@samp{cc1plus}).
11432 @item %*
11433 Substitute the variable part of a matched option.  See below.
11434 Note that each comma in the substituted string is replaced by
11435 a single space.
11437 @item %<@code{S}
11438 Remove all occurrences of @code{-S} from the command line.  Note---this
11439 command is position dependent.  @samp{%} commands in the spec string
11440 before this one see @code{-S}, @samp{%} commands in the spec string
11441 after this one do not.
11443 @item %:@var{function}(@var{args})
11444 Call the named function @var{function}, passing it @var{args}.
11445 @var{args} is first processed as a nested spec string, then split
11446 into an argument vector in the usual fashion.  The function returns
11447 a string which is processed as if it had appeared literally as part
11448 of the current spec.
11450 The following built-in spec functions are provided:
11452 @table @code
11453 @item @code{getenv}
11454 The @code{getenv} spec function takes two arguments: an environment
11455 variable name and a string.  If the environment variable is not
11456 defined, a fatal error is issued.  Otherwise, the return value is the
11457 value of the environment variable concatenated with the string.  For
11458 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
11460 @smallexample
11461 %:getenv(TOPDIR /include)
11462 @end smallexample
11464 expands to @file{/path/to/top/include}.
11466 @item @code{if-exists}
11467 The @code{if-exists} spec function takes one argument, an absolute
11468 pathname to a file.  If the file exists, @code{if-exists} returns the
11469 pathname.  Here is a small example of its usage:
11471 @smallexample
11472 *startfile:
11473 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
11474 @end smallexample
11476 @item @code{if-exists-else}
11477 The @code{if-exists-else} spec function is similar to the @code{if-exists}
11478 spec function, except that it takes two arguments.  The first argument is
11479 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
11480 returns the pathname.  If it does not exist, it returns the second argument.
11481 This way, @code{if-exists-else} can be used to select one file or another,
11482 based on the existence of the first.  Here is a small example of its usage:
11484 @smallexample
11485 *startfile:
11486 crt0%O%s %:if-exists(crti%O%s) \
11487 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
11488 @end smallexample
11490 @item @code{replace-outfile}
11491 The @code{replace-outfile} spec function takes two arguments.  It looks for the
11492 first argument in the outfiles array and replaces it with the second argument.  Here
11493 is a small example of its usage:
11495 @smallexample
11496 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
11497 @end smallexample
11499 @item @code{remove-outfile}
11500 The @code{remove-outfile} spec function takes one argument.  It looks for the
11501 first argument in the outfiles array and removes it.  Here is a small example
11502 its usage:
11504 @smallexample
11505 %:remove-outfile(-lm)
11506 @end smallexample
11508 @item @code{pass-through-libs}
11509 The @code{pass-through-libs} spec function takes any number of arguments.  It
11510 finds any @option{-l} options and any non-options ending in @file{.a} (which it
11511 assumes are the names of linker input library archive files) and returns a
11512 result containing all the found arguments each prepended by
11513 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
11514 intended to be passed to the LTO linker plugin.
11516 @smallexample
11517 %:pass-through-libs(%G %L %G)
11518 @end smallexample
11520 @item @code{print-asm-header}
11521 The @code{print-asm-header} function takes no arguments and simply
11522 prints a banner like:
11524 @smallexample
11525 Assembler options
11526 =================
11528 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
11529 @end smallexample
11531 It is used to separate compiler options from assembler options
11532 in the @option{--target-help} output.
11533 @end table
11535 @item %@{@code{S}@}
11536 Substitutes the @code{-S} switch, if that switch is given to GCC@.
11537 If that switch is not specified, this substitutes nothing.  Note that
11538 the leading dash is omitted when specifying this option, and it is
11539 automatically inserted if the substitution is performed.  Thus the spec
11540 string @samp{%@{foo@}} matches the command-line option @option{-foo}
11541 and outputs the command-line option @option{-foo}.
11543 @item %W@{@code{S}@}
11544 Like %@{@code{S}@} but mark last argument supplied within as a file to be
11545 deleted on failure.
11547 @item %@{@code{S}*@}
11548 Substitutes all the switches specified to GCC whose names start
11549 with @code{-S}, but which also take an argument.  This is used for
11550 switches like @option{-o}, @option{-D}, @option{-I}, etc.
11551 GCC considers @option{-o foo} as being
11552 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
11553 text, including the space.  Thus two arguments are generated.
11555 @item %@{@code{S}*&@code{T}*@}
11556 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
11557 (the order of @code{S} and @code{T} in the spec is not significant).
11558 There can be any number of ampersand-separated variables; for each the
11559 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
11561 @item %@{@code{S}:@code{X}@}
11562 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
11564 @item %@{!@code{S}:@code{X}@}
11565 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
11567 @item %@{@code{S}*:@code{X}@}
11568 Substitutes @code{X} if one or more switches whose names start with
11569 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
11570 once, no matter how many such switches appeared.  However, if @code{%*}
11571 appears somewhere in @code{X}, then @code{X} is substituted once
11572 for each matching switch, with the @code{%*} replaced by the part of
11573 that switch matching the @code{*}.
11575 If @code{%*} appears as the last part of a spec sequence then a space
11576 will be added after the end of the last substitution.  If there is more
11577 text in the sequence however then a space will not be generated.  This
11578 allows the @code{%*} substitution to be used as part of a larger
11579 string.  For example, a spec string like this:
11581 @smallexample
11582 %@{mcu=*:--script=%*/memory.ld@}
11583 @end smallexample
11585 when matching an option like @code{-mcu=newchip} will produce:
11587 @smallexample
11588 --script=newchip/memory.ld
11589 @end smallexample
11591 @item %@{.@code{S}:@code{X}@}
11592 Substitutes @code{X}, if processing a file with suffix @code{S}.
11594 @item %@{!.@code{S}:@code{X}@}
11595 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
11597 @item %@{,@code{S}:@code{X}@}
11598 Substitutes @code{X}, if processing a file for language @code{S}.
11600 @item %@{!,@code{S}:@code{X}@}
11601 Substitutes @code{X}, if not processing a file for language @code{S}.
11603 @item %@{@code{S}|@code{P}:@code{X}@}
11604 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
11605 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
11606 @code{*} sequences as well, although they have a stronger binding than
11607 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
11608 alternatives must be starred, and only the first matching alternative
11609 is substituted.
11611 For example, a spec string like this:
11613 @smallexample
11614 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
11615 @end smallexample
11617 @noindent
11618 outputs the following command-line options from the following input
11619 command-line options:
11621 @smallexample
11622 fred.c        -foo -baz
11623 jim.d         -bar -boggle
11624 -d fred.c     -foo -baz -boggle
11625 -d jim.d      -bar -baz -boggle
11626 @end smallexample
11628 @item %@{S:X; T:Y; :D@}
11630 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
11631 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
11632 be as many clauses as you need.  This may be combined with @code{.},
11633 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
11636 @end table
11638 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
11639 construct may contain other nested @samp{%} constructs or spaces, or
11640 even newlines.  They are processed as usual, as described above.
11641 Trailing white space in @code{X} is ignored.  White space may also
11642 appear anywhere on the left side of the colon in these constructs,
11643 except between @code{.} or @code{*} and the corresponding word.
11645 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
11646 handled specifically in these constructs.  If another value of
11647 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
11648 @option{-W} switch is found later in the command line, the earlier
11649 switch value is ignored, except with @{@code{S}*@} where @code{S} is
11650 just one letter, which passes all matching options.
11652 The character @samp{|} at the beginning of the predicate text is used to
11653 indicate that a command should be piped to the following command, but
11654 only if @option{-pipe} is specified.
11656 It is built into GCC which switches take arguments and which do not.
11657 (You might think it would be useful to generalize this to allow each
11658 compiler's spec to say which switches take arguments.  But this cannot
11659 be done in a consistent fashion.  GCC cannot even decide which input
11660 files have been specified without knowing which switches take arguments,
11661 and it must know which input files to compile in order to tell which
11662 compilers to run).
11664 GCC also knows implicitly that arguments starting in @option{-l} are to be
11665 treated as compiler output files, and passed to the linker in their
11666 proper position among the other output files.
11668 @c man begin OPTIONS
11670 @node Target Options
11671 @section Specifying Target Machine and Compiler Version
11672 @cindex target options
11673 @cindex cross compiling
11674 @cindex specifying machine version
11675 @cindex specifying compiler version and target machine
11676 @cindex compiler version, specifying
11677 @cindex target machine, specifying
11679 The usual way to run GCC is to run the executable called @command{gcc}, or
11680 @command{@var{machine}-gcc} when cross-compiling, or
11681 @command{@var{machine}-gcc-@var{version}} to run a version other than the
11682 one that was installed last.
11684 @node Submodel Options
11685 @section Hardware Models and Configurations
11686 @cindex submodel options
11687 @cindex specifying hardware config
11688 @cindex hardware models and configurations, specifying
11689 @cindex machine dependent options
11691 Each target machine types can have its own
11692 special options, starting with @samp{-m}, to choose among various
11693 hardware models or configurations---for example, 68010 vs 68020,
11694 floating coprocessor or none.  A single installed version of the
11695 compiler can compile for any model or configuration, according to the
11696 options specified.
11698 Some configurations of the compiler also support additional special
11699 options, usually for compatibility with other compilers on the same
11700 platform.
11702 @c This list is ordered alphanumerically by subsection name.
11703 @c It should be the same order and spelling as these options are listed
11704 @c in Machine Dependent Options
11706 @menu
11707 * AArch64 Options::
11708 * Adapteva Epiphany Options::
11709 * ARC Options::
11710 * ARM Options::
11711 * AVR Options::
11712 * Blackfin Options::
11713 * C6X Options::
11714 * CRIS Options::
11715 * CR16 Options::
11716 * Darwin Options::
11717 * DEC Alpha Options::
11718 * FR30 Options::
11719 * FRV Options::
11720 * GNU/Linux Options::
11721 * H8/300 Options::
11722 * HPPA Options::
11723 * i386 and x86-64 Options::
11724 * i386 and x86-64 Windows Options::
11725 * IA-64 Options::
11726 * LM32 Options::
11727 * M32C Options::
11728 * M32R/D Options::
11729 * M680x0 Options::
11730 * MCore Options::
11731 * MeP Options::
11732 * MicroBlaze Options::
11733 * MIPS Options::
11734 * MMIX Options::
11735 * MN10300 Options::
11736 * Moxie Options::
11737 * MSP430 Options::
11738 * NDS32 Options::
11739 * Nios II Options::
11740 * PDP-11 Options::
11741 * picoChip Options::
11742 * PowerPC Options::
11743 * RL78 Options::
11744 * RS/6000 and PowerPC Options::
11745 * RX Options::
11746 * S/390 and zSeries Options::
11747 * Score Options::
11748 * SH Options::
11749 * Solaris 2 Options::
11750 * SPARC Options::
11751 * SPU Options::
11752 * System V Options::
11753 * TILE-Gx Options::
11754 * TILEPro Options::
11755 * V850 Options::
11756 * VAX Options::
11757 * VMS Options::
11758 * VxWorks Options::
11759 * x86-64 Options::
11760 * Xstormy16 Options::
11761 * Xtensa Options::
11762 * zSeries Options::
11763 @end menu
11765 @node AArch64 Options
11766 @subsection AArch64 Options
11767 @cindex AArch64 Options
11769 These options are defined for AArch64 implementations:
11771 @table @gcctabopt
11773 @item -mabi=@var{name}
11774 @opindex mabi
11775 Generate code for the specified data model.  Permissible values
11776 are @samp{ilp32} for SysV-like data model where int, long int and pointer
11777 are 32-bit, and @samp{lp64} for SysV-like data model where int is 32-bit,
11778 but long int and pointer are 64-bit.
11780 The default depends on the specific target configuration.  Note that
11781 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
11782 entire program with the same ABI, and link with a compatible set of libraries.
11784 @item -mbig-endian
11785 @opindex mbig-endian
11786 Generate big-endian code.  This is the default when GCC is configured for an
11787 @samp{aarch64_be-*-*} target.
11789 @item -mgeneral-regs-only
11790 @opindex mgeneral-regs-only
11791 Generate code which uses only the general registers.
11793 @item -mlittle-endian
11794 @opindex mlittle-endian
11795 Generate little-endian code.  This is the default when GCC is configured for an
11796 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
11798 @item -mcmodel=tiny
11799 @opindex mcmodel=tiny
11800 Generate code for the tiny code model.  The program and its statically defined
11801 symbols must be within 1GB of each other.  Pointers are 64 bits.  Programs can
11802 be statically or dynamically linked.  This model is not fully implemented and
11803 mostly treated as @samp{small}.
11805 @item -mcmodel=small
11806 @opindex mcmodel=small
11807 Generate code for the small code model.  The program and its statically defined
11808 symbols must be within 4GB of each other.  Pointers are 64 bits.  Programs can
11809 be statically or dynamically linked.  This is the default code model.
11811 @item -mcmodel=large
11812 @opindex mcmodel=large
11813 Generate code for the large code model.  This makes no assumptions about
11814 addresses and sizes of sections.  Pointers are 64 bits.  Programs can be
11815 statically linked only.
11817 @item -mstrict-align
11818 @opindex mstrict-align
11819 Do not assume that unaligned memory references will be handled by the system.
11821 @item -momit-leaf-frame-pointer
11822 @itemx -mno-omit-leaf-frame-pointer
11823 @opindex momit-leaf-frame-pointer
11824 @opindex mno-omit-leaf-frame-pointer
11825 Omit or keep the frame pointer in leaf functions.  The former behaviour is the
11826 default.
11828 @item -mtls-dialect=desc
11829 @opindex mtls-dialect=desc
11830 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
11831 of TLS variables.  This is the default.
11833 @item -mtls-dialect=traditional
11834 @opindex mtls-dialect=traditional
11835 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
11836 of TLS variables.
11838 @item -mfix-cortex-a53-835769
11839 @itemx -mno-fix-cortex-a53-835769
11840 @opindex -mfix-cortex-a53-835769
11841 @opindex -mno-fix-cortex-a53-835769
11842 Enable or disable the workaround for the ARM Cortex-A53 erratum number 835769.
11843 This will involve inserting a NOP instruction between memory instructions and
11844 64-bit integer multiply-accumulate instructions.
11846 @item -march=@var{name}
11847 @opindex march
11848 Specify the name of the target architecture, optionally suffixed by one or
11849 more feature modifiers.  This option has the form
11850 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
11851 only permissible value for @var{arch} is @samp{armv8-a}.  The permissible
11852 values for @var{feature} are documented in the sub-section below.
11854 Where conflicting feature modifiers are specified, the right-most feature is
11855 used.
11857 GCC uses this name to determine what kind of instructions it can emit when
11858 generating assembly code.
11860 Where @option{-march} is specified without either of @option{-mtune}
11861 or @option{-mcpu} also being specified, the code will be tuned to perform
11862 well across a range of target processors implementing the target
11863 architecture.
11865 @item -mtune=@var{name}
11866 @opindex mtune
11867 Specify the name of the target processor for which GCC should tune the
11868 performance of the code.  Permissible values for this option are:
11869 @samp{generic}, @samp{cortex-a53}, @samp{cortex-a57}, @samp{thunderx}.
11871 Additionally, this option can specify that GCC should tune the performance
11872 of the code for a big.LITTLE system.  The only permissible value is
11873 @samp{cortex-a57.cortex-a53}.
11875 Where none of @option{-mtune=}, @option{-mcpu=} or @option{-march=}
11876 are specified, the code will be tuned to perform well across a range
11877 of target processors.
11879 This option cannot be suffixed by feature modifiers.
11881 @item -mcpu=@var{name}
11882 @opindex mcpu
11883 Specify the name of the target processor, optionally suffixed by one or more
11884 feature modifiers.  This option has the form
11885 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
11886 permissible values for @var{cpu} are the same as those available for
11887 @option{-mtune}.
11889 The permissible values for @var{feature} are documented in the sub-section
11890 below.
11892 Where conflicting feature modifiers are specified, the right-most feature is
11893 used.
11895 GCC uses this name to determine what kind of instructions it can emit when
11896 generating assembly code (as if by @option{-march}) and to determine
11897 the target processor for which to tune for performance (as if
11898 by @option{-mtune}).  Where this option is used in conjunction
11899 with @option{-march} or @option{-mtune}, those options take precedence
11900 over the appropriate part of this option.
11901 @end table
11903 @subsubsection @option{-march} and @option{-mcpu} feature modifiers
11904 @cindex @option{-march} feature modifiers
11905 @cindex @option{-mcpu} feature modifiers
11906 Feature modifiers used with @option{-march} and @option{-mcpu} can be one
11907 the following:
11909 @table @samp
11910 @item crc
11911 Enable CRC extension.
11912 @item crypto
11913 Enable Crypto extension.  This implies Advanced SIMD is enabled.
11914 @item fp
11915 Enable floating-point instructions.
11916 @item simd
11917 Enable Advanced SIMD instructions.  This implies floating-point instructions
11918 are enabled.  This is the default for all current possible values for options
11919 @option{-march} and @option{-mcpu=}.
11920 @end table
11922 @node Adapteva Epiphany Options
11923 @subsection Adapteva Epiphany Options
11925 These @samp{-m} options are defined for Adapteva Epiphany:
11927 @table @gcctabopt
11928 @item -mhalf-reg-file
11929 @opindex mhalf-reg-file
11930 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
11931 That allows code to run on hardware variants that lack these registers.
11933 @item -mprefer-short-insn-regs
11934 @opindex mprefer-short-insn-regs
11935 Preferrentially allocate registers that allow short instruction generation.
11936 This can result in increased instruction count, so this may either reduce or
11937 increase overall code size.
11939 @item -mbranch-cost=@var{num}
11940 @opindex mbranch-cost
11941 Set the cost of branches to roughly @var{num} ``simple'' instructions.
11942 This cost is only a heuristic and is not guaranteed to produce
11943 consistent results across releases.
11945 @item -mcmove
11946 @opindex mcmove
11947 Enable the generation of conditional moves.
11949 @item -mnops=@var{num}
11950 @opindex mnops
11951 Emit @var{num} NOPs before every other generated instruction.
11953 @item -mno-soft-cmpsf
11954 @opindex mno-soft-cmpsf
11955 For single-precision floating-point comparisons, emit an @code{fsub} instruction
11956 and test the flags.  This is faster than a software comparison, but can
11957 get incorrect results in the presence of NaNs, or when two different small
11958 numbers are compared such that their difference is calculated as zero.
11959 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
11960 software comparisons.
11962 @item -mstack-offset=@var{num}
11963 @opindex mstack-offset
11964 Set the offset between the top of the stack and the stack pointer.
11965 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
11966 can be used by leaf functions without stack allocation.
11967 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
11968 Note also that this option changes the ABI; compiling a program with a
11969 different stack offset than the libraries have been compiled with
11970 generally does not work.
11971 This option can be useful if you want to evaluate if a different stack
11972 offset would give you better code, but to actually use a different stack
11973 offset to build working programs, it is recommended to configure the
11974 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
11976 @item -mno-round-nearest
11977 @opindex mno-round-nearest
11978 Make the scheduler assume that the rounding mode has been set to
11979 truncating.  The default is @option{-mround-nearest}.
11981 @item -mlong-calls
11982 @opindex mlong-calls
11983 If not otherwise specified by an attribute, assume all calls might be beyond
11984 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
11985 function address into a register before performing a (otherwise direct) call.
11986 This is the default.
11988 @item -mshort-calls
11989 @opindex short-calls
11990 If not otherwise specified by an attribute, assume all direct calls are
11991 in the range of the @code{b} / @code{bl} instructions, so use these instructions
11992 for direct calls.  The default is @option{-mlong-calls}.
11994 @item -msmall16
11995 @opindex msmall16
11996 Assume addresses can be loaded as 16-bit unsigned values.  This does not
11997 apply to function addresses for which @option{-mlong-calls} semantics
11998 are in effect.
12000 @item -mfp-mode=@var{mode}
12001 @opindex mfp-mode
12002 Set the prevailing mode of the floating-point unit.
12003 This determines the floating-point mode that is provided and expected
12004 at function call and return time.  Making this mode match the mode you
12005 predominantly need at function start can make your programs smaller and
12006 faster by avoiding unnecessary mode switches.
12008 @var{mode} can be set to one the following values:
12010 @table @samp
12011 @item caller
12012 Any mode at function entry is valid, and retained or restored when
12013 the function returns, and when it calls other functions.
12014 This mode is useful for compiling libraries or other compilation units
12015 you might want to incorporate into different programs with different
12016 prevailing FPU modes, and the convenience of being able to use a single
12017 object file outweighs the size and speed overhead for any extra
12018 mode switching that might be needed, compared with what would be needed
12019 with a more specific choice of prevailing FPU mode.
12021 @item truncate
12022 This is the mode used for floating-point calculations with
12023 truncating (i.e.@: round towards zero) rounding mode.  That includes
12024 conversion from floating point to integer.
12026 @item round-nearest
12027 This is the mode used for floating-point calculations with
12028 round-to-nearest-or-even rounding mode.
12030 @item int
12031 This is the mode used to perform integer calculations in the FPU, e.g.@:
12032 integer multiply, or integer multiply-and-accumulate.
12033 @end table
12035 The default is @option{-mfp-mode=caller}
12037 @item -mnosplit-lohi
12038 @itemx -mno-postinc
12039 @itemx -mno-postmodify
12040 @opindex mnosplit-lohi
12041 @opindex mno-postinc
12042 @opindex mno-postmodify
12043 Code generation tweaks that disable, respectively, splitting of 32-bit
12044 loads, generation of post-increment addresses, and generation of
12045 post-modify addresses.  The defaults are @option{msplit-lohi},
12046 @option{-mpost-inc}, and @option{-mpost-modify}.
12048 @item -mnovect-double
12049 @opindex mno-vect-double
12050 Change the preferred SIMD mode to SImode.  The default is
12051 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
12053 @item -max-vect-align=@var{num}
12054 @opindex max-vect-align
12055 The maximum alignment for SIMD vector mode types.
12056 @var{num} may be 4 or 8.  The default is 8.
12057 Note that this is an ABI change, even though many library function
12058 interfaces are unaffected if they don't use SIMD vector modes
12059 in places that affect size and/or alignment of relevant types.
12061 @item -msplit-vecmove-early
12062 @opindex msplit-vecmove-early
12063 Split vector moves into single word moves before reload.  In theory this
12064 can give better register allocation, but so far the reverse seems to be
12065 generally the case.
12067 @item -m1reg-@var{reg}
12068 @opindex m1reg-
12069 Specify a register to hold the constant @minus{}1, which makes loading small negative
12070 constants and certain bitmasks faster.
12071 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
12072 which specify use of that register as a fixed register,
12073 and @samp{none}, which means that no register is used for this
12074 purpose.  The default is @option{-m1reg-none}.
12076 @end table
12078 @node ARC Options
12079 @subsection ARC Options
12080 @cindex ARC options
12082 The following options control the architecture variant for which code
12083 is being compiled:
12085 @c architecture variants
12086 @table @gcctabopt
12088 @item -mbarrel-shifter
12089 @opindex mbarrel-shifter
12090 Generate instructions supported by barrel shifter.  This is the default
12091 unless @samp{-mcpu=ARC601} is in effect.
12093 @item -mcpu=@var{cpu}
12094 @opindex mcpu
12095 Set architecture type, register usage, and instruction scheduling
12096 parameters for @var{cpu}.  There are also shortcut alias options
12097 available for backward compatibility and convenience.  Supported
12098 values for @var{cpu} are
12100 @table @samp
12101 @opindex mA6
12102 @opindex mARC600
12103 @item ARC600
12104 Compile for ARC600.  Aliases: @option{-mA6}, @option{-mARC600}.
12106 @item ARC601
12107 @opindex mARC601
12108 Compile for ARC601.  Alias: @option{-mARC601}.
12110 @item ARC700
12111 @opindex mA7
12112 @opindex mARC700
12113 Compile for ARC700.  Aliases: @option{-mA7}, @option{-mARC700}.
12114 This is the default when configured with @samp{--with-cpu=arc700}@.
12115 @end table
12117 @item -mdpfp
12118 @opindex mdpfp
12119 @itemx -mdpfp-compact
12120 @opindex mdpfp-compact
12121 FPX: Generate Double Precision FPX instructions, tuned for the compact
12122 implementation.
12124 @item -mdpfp-fast
12125 @opindex mdpfp-fast
12126 FPX: Generate Double Precision FPX instructions, tuned for the fast
12127 implementation.
12129 @item -mno-dpfp-lrsr
12130 @opindex mno-dpfp-lrsr
12131 Disable LR and SR instructions from using FPX extension aux registers.
12133 @item -mea
12134 @opindex mea
12135 Generate Extended arithmetic instructions.  Currently only
12136 @code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are
12137 supported.  This is always enabled for @samp{-mcpu=ARC700}.
12139 @item -mno-mpy
12140 @opindex mno-mpy
12141 Do not generate mpy instructions for ARC700.
12143 @item -mmul32x16
12144 @opindex mmul32x16
12145 Generate 32x16 bit multiply and mac instructions.
12147 @item -mmul64
12148 @opindex mmul64
12149 Generate mul64 and mulu64 instructions.  Only valid for @samp{-mcpu=ARC600}.
12151 @item -mnorm
12152 @opindex mnorm
12153 Generate norm instruction.  This is the default if @samp{-mcpu=ARC700}
12154 is in effect.
12156 @item -mspfp
12157 @opindex mspfp
12158 @itemx -mspfp-compact
12159 @opindex mspfp-compact
12160 FPX: Generate Single Precision FPX instructions, tuned for the compact
12161 implementation.
12163 @item -mspfp-fast
12164 @opindex mspfp-fast
12165 FPX: Generate Single Precision FPX instructions, tuned for the fast
12166 implementation.
12168 @item -msimd
12169 @opindex msimd
12170 Enable generation of ARC SIMD instructions via target-specific
12171 builtins.  Only valid for @samp{-mcpu=ARC700}.
12173 @item -msoft-float
12174 @opindex msoft-float
12175 This option ignored; it is provided for compatibility purposes only.
12176 Software floating point code is emitted by default, and this default
12177 can overridden by FPX options; @samp{mspfp}, @samp{mspfp-compact}, or
12178 @samp{mspfp-fast} for single precision, and @samp{mdpfp},
12179 @samp{mdpfp-compact}, or @samp{mdpfp-fast} for double precision.
12181 @item -mswap
12182 @opindex mswap
12183 Generate swap instructions.
12185 @end table
12187 The following options are passed through to the assembler, and also
12188 define preprocessor macro symbols.
12190 @c Flags used by the assembler, but for which we define preprocessor
12191 @c macro symbols as well.
12192 @table @gcctabopt
12193 @item -mdsp-packa
12194 @opindex mdsp-packa
12195 Passed down to the assembler to enable the DSP Pack A extensions.
12196 Also sets the preprocessor symbol @code{__Xdsp_packa}.
12198 @item -mdvbf
12199 @opindex mdvbf
12200 Passed down to the assembler to enable the dual viterbi butterfly
12201 extension.  Also sets the preprocessor symbol @code{__Xdvbf}.
12203 @c ARC700 4.10 extension instruction
12204 @item -mlock
12205 @opindex mlock
12206 Passed down to the assembler to enable the Locked Load/Store
12207 Conditional extension.  Also sets the preprocessor symbol
12208 @code{__Xlock}.
12210 @item -mmac-d16
12211 @opindex mmac-d16
12212 Passed down to the assembler.  Also sets the preprocessor symbol
12213 @code{__Xxmac_d16}.
12215 @item -mmac-24
12216 @opindex mmac-24
12217 Passed down to the assembler.  Also sets the preprocessor symbol
12218 @code{__Xxmac_24}.
12220 @c ARC700 4.10 extension instruction
12221 @item -mrtsc
12222 @opindex mrtsc
12223 Passed down to the assembler to enable the 64-bit Time-Stamp Counter
12224 extension instruction.  Also sets the preprocessor symbol
12225 @code{__Xrtsc}.
12227 @c ARC700 4.10 extension instruction
12228 @item -mswape
12229 @opindex mswape
12230 Passed down to the assembler to enable the swap byte ordering
12231 extension instruction.  Also sets the preprocessor symbol
12232 @code{__Xswape}.
12234 @item -mtelephony
12235 @opindex mtelephony
12236 Passed down to the assembler to enable dual and single operand
12237 instructions for telephony.  Also sets the preprocessor symbol
12238 @code{__Xtelephony}.
12240 @item -mxy
12241 @opindex mxy
12242 Passed down to the assembler to enable the XY Memory extension.  Also
12243 sets the preprocessor symbol @code{__Xxy}.
12245 @end table
12247 The following options control how the assembly code is annotated:
12249 @c Assembly annotation options
12250 @table @gcctabopt
12251 @item -misize
12252 @opindex misize
12253 Annotate assembler instructions with estimated addresses.
12255 @item -mannotate-align
12256 @opindex mannotate-align
12257 Explain what alignment considerations lead to the decision to make an
12258 instruction short or long.
12260 @end table
12262 The following options are passed through to the linker:
12264 @c options passed through to the linker
12265 @table @gcctabopt
12266 @item -marclinux
12267 @opindex marclinux
12268 Passed through to the linker, to specify use of the @code{arclinux} emulation.
12269 This option is enabled by default in tool chains built for
12270 @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets
12271 when profiling is not requested.
12273 @item -marclinux_prof
12274 @opindex marclinux_prof
12275 Passed through to the linker, to specify use of the
12276 @code{arclinux_prof} emulation.  This option is enabled by default in
12277 tool chains built for @w{@code{arc-linux-uclibc}} and
12278 @w{@code{arceb-linux-uclibc}} targets when profiling is requested.
12280 @end table
12282 The following options control the semantics of generated code:
12284 @c semantically relevant code generation options
12285 @table @gcctabopt
12286 @item -mepilogue-cfi
12287 @opindex mepilogue-cfi
12288 Enable generation of call frame information for epilogues.
12290 @item -mno-epilogue-cfi
12291 @opindex mno-epilogue-cfi
12292 Disable generation of call frame information for epilogues.
12294 @item -mlong-calls
12295 @opindex mlong-calls
12296 Generate call insns as register indirect calls, thus providing access
12297 to the full 32-bit address range.
12299 @item -mmedium-calls
12300 @opindex mmedium-calls
12301 Don't use less than 25 bit addressing range for calls, which is the
12302 offset available for an unconditional branch-and-link
12303 instruction.  Conditional execution of function calls is suppressed, to
12304 allow use of the 25-bit range, rather than the 21-bit range with
12305 conditional branch-and-link.  This is the default for tool chains built
12306 for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets.
12308 @item -mno-sdata
12309 @opindex mno-sdata
12310 Do not generate sdata references.  This is the default for tool chains
12311 built for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}}
12312 targets.
12314 @item -mucb-mcount
12315 @opindex mucb-mcount
12316 Instrument with mcount calls as used in UCB code.  I.e. do the
12317 counting in the callee, not the caller.  By default ARC instrumentation
12318 counts in the caller.
12320 @item -mvolatile-cache
12321 @opindex mvolatile-cache
12322 Use ordinarily cached memory accesses for volatile references.  This is the
12323 default.
12325 @item -mno-volatile-cache
12326 @opindex mno-volatile-cache
12327 Enable cache bypass for volatile references.
12329 @end table
12331 The following options fine tune code generation:
12332 @c code generation tuning options
12333 @table @gcctabopt
12334 @item -malign-call
12335 @opindex malign-call
12336 Do alignment optimizations for call instructions.
12338 @item -mauto-modify-reg
12339 @opindex mauto-modify-reg
12340 Enable the use of pre/post modify with register displacement.
12342 @item -mbbit-peephole
12343 @opindex mbbit-peephole
12344 Enable bbit peephole2.
12346 @item -mno-brcc
12347 @opindex mno-brcc
12348 This option disables a target-specific pass in @file{arc_reorg} to
12349 generate @code{BRcc} instructions.  It has no effect on @code{BRcc}
12350 generation driven by the combiner pass.
12352 @item -mcase-vector-pcrel
12353 @opindex mcase-vector-pcrel
12354 Use pc-relative switch case tables - this enables case table shortening.
12355 This is the default for @option{-Os}.
12357 @item -mcompact-casesi
12358 @opindex mcompact-casesi
12359 Enable compact casesi pattern.
12360 This is the default for @option{-Os}.
12362 @item -mno-cond-exec
12363 @opindex mno-cond-exec
12364 Disable ARCompact specific pass to generate conditional execution instructions.
12365 Due to delay slot scheduling and interactions between operand numbers,
12366 literal sizes, instruction lengths, and the support for conditional execution,
12367 the target-independent pass to generate conditional execution is often lacking,
12368 so the ARC port has kept a special pass around that tries to find more
12369 conditional execution generating opportunities after register allocation,
12370 branch shortening, and delay slot scheduling have been done.  This pass
12371 generally, but not always, improves performance and code size, at the cost of
12372 extra compilation time, which is why there is an option to switch it off.
12373 If you have a problem with call instructions exceeding their allowable
12374 offset range because they are conditionalized, you should consider using
12375 @option{-mmedium-calls} instead.
12377 @item -mearly-cbranchsi
12378 @opindex mearly-cbranchsi
12379 Enable pre-reload use of the cbranchsi pattern.
12381 @item -mexpand-adddi
12382 @opindex mexpand-adddi
12383 Expand @code{adddi3} and @code{subdi3} at rtl generation time into
12384 @code{add.f}, @code{adc} etc.
12386 @item -mindexed-loads
12387 @opindex mindexed-loads
12388 Enable the use of indexed loads.  This can be problematic because some
12389 optimizers will then assume the that indexed stores exist, which is not
12390 the case.
12392 @item -mlra
12393 @opindex mlra
12394 Enable Local Register Allocation.  This is still experimental for ARC,
12395 so by default the compiler uses standard reload
12396 (i.e. @samp{-mno-lra}).
12398 @item -mlra-priority-none
12399 @opindex mlra-priority-none
12400 Don't indicate any priority for target registers.
12402 @item -mlra-priority-compact
12403 @opindex mlra-priority-compact
12404 Indicate target register priority for r0..r3 / r12..r15.
12406 @item -mlra-priority-noncompact
12407 @opindex mlra-priority-noncompact
12408 Reduce target regsiter priority for r0..r3 / r12..r15.
12410 @item -mno-millicode
12411 @opindex mno-millicode
12412 When optimizing for size (using @option{-Os}), prologues and epilogues
12413 that have to save or restore a large number of registers are often
12414 shortened by using call to a special function in libgcc; this is
12415 referred to as a @emph{millicode} call.  As these calls can pose
12416 performance issues, and/or cause linking issues when linking in a
12417 nonstandard way, this option is provided to turn off millicode call
12418 generation.
12420 @item -mmixed-code
12421 @opindex mmixed-code
12422 Tweak register allocation to help 16-bit instruction generation.
12423 This generally has the effect of decreasing the average instruction size
12424 while increasing the instruction count.
12426 @item -mq-class
12427 @opindex mq-class
12428 Enable 'q' instruction alternatives.
12429 This is the default for @option{-Os}.
12431 @item -mRcq
12432 @opindex mRcq
12433 Enable Rcq constraint handling - most short code generation depends on this.
12434 This is the default.
12436 @item -mRcw
12437 @opindex mRcw
12438 Enable Rcw constraint handling - ccfsm condexec mostly depends on this.
12439 This is the default.
12441 @item -msize-level=@var{level}
12442 @opindex msize-level
12443 Fine-tune size optimization with regards to instruction lengths and alignment.
12444 The recognized values for @var{level} are:
12445 @table @samp
12446 @item 0
12447 No size optimization.  This level is deprecated and treated like @samp{1}.
12449 @item 1
12450 Short instructions are used opportunistically.
12452 @item 2
12453 In addition, alignment of loops and of code after barriers are dropped.
12455 @item 3
12456 In addition, optional data alignment is dropped, and the option @option{Os} is enabled.
12458 @end table
12460 This defaults to @samp{3} when @option{-Os} is in effect.  Otherwise,
12461 the behavior when this is not set is equivalent to level @samp{1}.
12463 @item -mtune=@var{cpu}
12464 @opindex mtune
12465 Set instruction scheduling parameters for @var{cpu}, overriding any implied
12466 by @option{-mcpu=}.
12468 Supported values for @var{cpu} are
12470 @table @samp
12471 @item ARC600
12472 Tune for ARC600 cpu.
12474 @item ARC601
12475 Tune for ARC601 cpu.
12477 @item ARC700
12478 Tune for ARC700 cpu with standard multiplier block.
12480 @item ARC700-xmac
12481 Tune for ARC700 cpu with XMAC block.
12483 @item ARC725D
12484 Tune for ARC725D cpu.
12486 @item ARC750D
12487 Tune for ARC750D cpu.
12489 @end table
12491 @item -mmultcost=@var{num}
12492 @opindex mmultcost
12493 Cost to assume for a multiply instruction, with @samp{4} being equal to a
12494 normal instruction.
12496 @item -munalign-prob-threshold=@var{probability}
12497 @opindex munalign-prob-threshold
12498 Set probability threshold for unaligning branches.
12499 When tuning for @samp{ARC700} and optimizing for speed, branches without
12500 filled delay slot are preferably emitted unaligned and long, unless
12501 profiling indicates that the probability for the branch to be taken
12502 is below @var{probability}.  @xref{Cross-profiling}.
12503 The default is (REG_BR_PROB_BASE/2), i.e.@: 5000.
12505 @end table
12507 The following options are maintained for backward compatibility, but
12508 are now deprecated and will be removed in a future release:
12510 @c Deprecated options
12511 @table @gcctabopt
12513 @item -margonaut
12514 @opindex margonaut
12515 Obsolete FPX.
12517 @item -mbig-endian
12518 @opindex mbig-endian
12519 @itemx -EB
12520 @opindex EB
12521 Compile code for big endian targets.  Use of these options is now
12522 deprecated.  Users wanting big-endian code, should use the
12523 @w{@code{arceb-elf32}} and @w{@code{arceb-linux-uclibc}} targets when
12524 building the tool chain, for which big-endian is the default.
12526 @item -mlittle-endian
12527 @opindex mlittle-endian
12528 @itemx -EL
12529 @opindex EL
12530 Compile code for little endian targets.  Use of these options is now
12531 deprecated.  Users wanting little-endian code should use the
12532 @w{@code{arc-elf32}} and @w{@code{arc-linux-uclibc}} targets when
12533 building the tool chain, for which little-endian is the default.
12535 @item -mbarrel_shifter
12536 @opindex mbarrel_shifter
12537 Replaced by @samp{-mbarrel-shifter}
12539 @item -mdpfp_compact
12540 @opindex mdpfp_compact
12541 Replaced by @samp{-mdpfp-compact}
12543 @item -mdpfp_fast
12544 @opindex mdpfp_fast
12545 Replaced by @samp{-mdpfp-fast}
12547 @item -mdsp_packa
12548 @opindex mdsp_packa
12549 Replaced by @samp{-mdsp-packa}
12551 @item -mEA
12552 @opindex mEA
12553 Replaced by @samp{-mea}
12555 @item -mmac_24
12556 @opindex mmac_24
12557 Replaced by @samp{-mmac-24}
12559 @item -mmac_d16
12560 @opindex mmac_d16
12561 Replaced by @samp{-mmac-d16}
12563 @item -mspfp_compact
12564 @opindex mspfp_compact
12565 Replaced by @samp{-mspfp-compact}
12567 @item -mspfp_fast
12568 @opindex mspfp_fast
12569 Replaced by @samp{-mspfp-fast}
12571 @item -mtune=@var{cpu}
12572 @opindex mtune
12573 Values @samp{arc600}, @samp{arc601}, @samp{arc700} and
12574 @samp{arc700-xmac} for @var{cpu} are replaced by @samp{ARC600},
12575 @samp{ARC601}, @samp{ARC700} and @samp{ARC700-xmac} respectively
12577 @item -multcost=@var{num}
12578 @opindex multcost
12579 Replaced by @samp{-mmultcost}.
12581 @end table
12583 @node ARM Options
12584 @subsection ARM Options
12585 @cindex ARM options
12587 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
12588 architectures:
12590 @table @gcctabopt
12591 @item -mabi=@var{name}
12592 @opindex mabi
12593 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
12594 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
12596 @item -mapcs-frame
12597 @opindex mapcs-frame
12598 Generate a stack frame that is compliant with the ARM Procedure Call
12599 Standard for all functions, even if this is not strictly necessary for
12600 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
12601 with this option causes the stack frames not to be generated for
12602 leaf functions.  The default is @option{-mno-apcs-frame}.
12604 @item -mapcs
12605 @opindex mapcs
12606 This is a synonym for @option{-mapcs-frame}.
12608 @ignore
12609 @c not currently implemented
12610 @item -mapcs-stack-check
12611 @opindex mapcs-stack-check
12612 Generate code to check the amount of stack space available upon entry to
12613 every function (that actually uses some stack space).  If there is
12614 insufficient space available then either the function
12615 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} is
12616 called, depending upon the amount of stack space required.  The runtime
12617 system is required to provide these functions.  The default is
12618 @option{-mno-apcs-stack-check}, since this produces smaller code.
12620 @c not currently implemented
12621 @item -mapcs-float
12622 @opindex mapcs-float
12623 Pass floating-point arguments using the floating-point registers.  This is
12624 one of the variants of the APCS@.  This option is recommended if the
12625 target hardware has a floating-point unit or if a lot of floating-point
12626 arithmetic is going to be performed by the code.  The default is
12627 @option{-mno-apcs-float}, since the size of integer-only code is 
12628 slightly increased if @option{-mapcs-float} is used.
12630 @c not currently implemented
12631 @item -mapcs-reentrant
12632 @opindex mapcs-reentrant
12633 Generate reentrant, position-independent code.  The default is
12634 @option{-mno-apcs-reentrant}.
12635 @end ignore
12637 @item -mthumb-interwork
12638 @opindex mthumb-interwork
12639 Generate code that supports calling between the ARM and Thumb
12640 instruction sets.  Without this option, on pre-v5 architectures, the
12641 two instruction sets cannot be reliably used inside one program.  The
12642 default is @option{-mno-thumb-interwork}, since slightly larger code
12643 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
12644 configurations this option is meaningless.
12646 @item -mno-sched-prolog
12647 @opindex mno-sched-prolog
12648 Prevent the reordering of instructions in the function prologue, or the
12649 merging of those instruction with the instructions in the function's
12650 body.  This means that all functions start with a recognizable set
12651 of instructions (or in fact one of a choice from a small set of
12652 different function prologues), and this information can be used to
12653 locate the start of functions inside an executable piece of code.  The
12654 default is @option{-msched-prolog}.
12656 @item -mfloat-abi=@var{name}
12657 @opindex mfloat-abi
12658 Specifies which floating-point ABI to use.  Permissible values
12659 are: @samp{soft}, @samp{softfp} and @samp{hard}.
12661 Specifying @samp{soft} causes GCC to generate output containing
12662 library calls for floating-point operations.
12663 @samp{softfp} allows the generation of code using hardware floating-point
12664 instructions, but still uses the soft-float calling conventions.
12665 @samp{hard} allows generation of floating-point instructions
12666 and uses FPU-specific calling conventions.
12668 The default depends on the specific target configuration.  Note that
12669 the hard-float and soft-float ABIs are not link-compatible; you must
12670 compile your entire program with the same ABI, and link with a
12671 compatible set of libraries.
12673 @item -mlittle-endian
12674 @opindex mlittle-endian
12675 Generate code for a processor running in little-endian mode.  This is
12676 the default for all standard configurations.
12678 @item -mbig-endian
12679 @opindex mbig-endian
12680 Generate code for a processor running in big-endian mode; the default is
12681 to compile code for a little-endian processor.
12683 @item -march=@var{name}
12684 @opindex march
12685 This specifies the name of the target ARM architecture.  GCC uses this
12686 name to determine what kind of instructions it can emit when generating
12687 assembly code.  This option can be used in conjunction with or instead
12688 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
12689 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
12690 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
12691 @samp{armv6}, @samp{armv6j},
12692 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
12693 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m}, @samp{armv7e-m},
12694 @samp{armv7ve}, @samp{armv8-a}, @samp{armv8-a+crc},
12695 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
12697 @option{-march=armv7ve} is the armv7-a architecture with virtualization
12698 extensions.
12700 @option{-march=armv8-a+crc} enables code generation for the ARMv8-A
12701 architecture together with the optional CRC32 extensions.
12703 @option{-march=native} causes the compiler to auto-detect the architecture
12704 of the build computer.  At present, this feature is only supported on
12705 GNU/Linux, and not all architectures are recognized.  If the auto-detect
12706 is unsuccessful the option has no effect.
12708 @item -mtune=@var{name}
12709 @opindex mtune
12710 This option specifies the name of the target ARM processor for
12711 which GCC should tune the performance of the code.
12712 For some ARM implementations better performance can be obtained by using
12713 this option.
12714 Permissible names are: @samp{arm2}, @samp{arm250},
12715 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
12716 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
12717 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
12718 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
12719 @samp{arm720},
12720 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
12721 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
12722 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
12723 @samp{strongarm1110},
12724 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
12725 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
12726 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
12727 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
12728 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
12729 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
12730 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
12731 @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8}, @samp{cortex-a9},
12732 @samp{cortex-a12}, @samp{cortex-a15}, @samp{cortex-a53}, @samp{cortex-a57},
12733 @samp{cortex-r4},
12734 @samp{cortex-r4f}, @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-m7},
12735 @samp{cortex-m4},
12736 @samp{cortex-m3},
12737 @samp{cortex-m1},
12738 @samp{cortex-m0},
12739 @samp{cortex-m0plus},
12740 @samp{marvell-pj4},
12741 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
12742 @samp{fa526}, @samp{fa626},
12743 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te}.
12745 Additionally, this option can specify that GCC should tune the performance
12746 of the code for a big.LITTLE system.  Permissible names are:
12747 @samp{cortex-a15.cortex-a7}, @samp{cortex-a57.cortex-a53}.
12749 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
12750 performance for a blend of processors within architecture @var{arch}.
12751 The aim is to generate code that run well on the current most popular
12752 processors, balancing between optimizations that benefit some CPUs in the
12753 range, and avoiding performance pitfalls of other CPUs.  The effects of
12754 this option may change in future GCC versions as CPU models come and go.
12756 @option{-mtune=native} causes the compiler to auto-detect the CPU
12757 of the build computer.  At present, this feature is only supported on
12758 GNU/Linux, and not all architectures are recognized.  If the auto-detect is
12759 unsuccessful the option has no effect.
12761 @item -mcpu=@var{name}
12762 @opindex mcpu
12763 This specifies the name of the target ARM processor.  GCC uses this name
12764 to derive the name of the target ARM architecture (as if specified
12765 by @option{-march}) and the ARM processor type for which to tune for
12766 performance (as if specified by @option{-mtune}).  Where this option
12767 is used in conjunction with @option{-march} or @option{-mtune},
12768 those options take precedence over the appropriate part of this option.
12770 Permissible names for this option are the same as those for
12771 @option{-mtune}.
12773 @option{-mcpu=generic-@var{arch}} is also permissible, and is
12774 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
12775 See @option{-mtune} for more information.
12777 @option{-mcpu=native} causes the compiler to auto-detect the CPU
12778 of the build computer.  At present, this feature is only supported on
12779 GNU/Linux, and not all architectures are recognized.  If the auto-detect
12780 is unsuccessful the option has no effect.
12782 @item -mfpu=@var{name}
12783 @opindex mfpu
12784 This specifies what floating-point hardware (or hardware emulation) is
12785 available on the target.  Permissible names are: @samp{vfp}, @samp{vfpv3},
12786 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
12787 @samp{vfpv3xd-fp16}, @samp{neon}, @samp{neon-fp16}, @samp{vfpv4},
12788 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
12789 @samp{fpv5-d16}, @samp{fpv5-sp-d16},
12790 @samp{fp-armv8}, @samp{neon-fp-armv8}, and @samp{crypto-neon-fp-armv8}.
12792 If @option{-msoft-float} is specified this specifies the format of
12793 floating-point values.
12795 If the selected floating-point hardware includes the NEON extension
12796 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
12797 operations are not generated by GCC's auto-vectorization pass unless
12798 @option{-funsafe-math-optimizations} is also specified.  This is
12799 because NEON hardware does not fully implement the IEEE 754 standard for
12800 floating-point arithmetic (in particular denormal values are treated as
12801 zero), so the use of NEON instructions may lead to a loss of precision.
12803 @item -mfp16-format=@var{name}
12804 @opindex mfp16-format
12805 Specify the format of the @code{__fp16} half-precision floating-point type.
12806 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
12807 the default is @samp{none}, in which case the @code{__fp16} type is not
12808 defined.  @xref{Half-Precision}, for more information.
12810 @item -mstructure-size-boundary=@var{n}
12811 @opindex mstructure-size-boundary
12812 The sizes of all structures and unions are rounded up to a multiple
12813 of the number of bits set by this option.  Permissible values are 8, 32
12814 and 64.  The default value varies for different toolchains.  For the COFF
12815 targeted toolchain the default value is 8.  A value of 64 is only allowed
12816 if the underlying ABI supports it.
12818 Specifying a larger number can produce faster, more efficient code, but
12819 can also increase the size of the program.  Different values are potentially
12820 incompatible.  Code compiled with one value cannot necessarily expect to
12821 work with code or libraries compiled with another value, if they exchange
12822 information using structures or unions.
12824 @item -mabort-on-noreturn
12825 @opindex mabort-on-noreturn
12826 Generate a call to the function @code{abort} at the end of a
12827 @code{noreturn} function.  It is executed if the function tries to
12828 return.
12830 @item -mlong-calls
12831 @itemx -mno-long-calls
12832 @opindex mlong-calls
12833 @opindex mno-long-calls
12834 Tells the compiler to perform function calls by first loading the
12835 address of the function into a register and then performing a subroutine
12836 call on this register.  This switch is needed if the target function
12837 lies outside of the 64-megabyte addressing range of the offset-based
12838 version of subroutine call instruction.
12840 Even if this switch is enabled, not all function calls are turned
12841 into long calls.  The heuristic is that static functions, functions
12842 that have the @samp{short-call} attribute, functions that are inside
12843 the scope of a @samp{#pragma no_long_calls} directive, and functions whose
12844 definitions have already been compiled within the current compilation
12845 unit are not turned into long calls.  The exceptions to this rule are
12846 that weak function definitions, functions with the @samp{long-call}
12847 attribute or the @samp{section} attribute, and functions that are within
12848 the scope of a @samp{#pragma long_calls} directive are always
12849 turned into long calls.
12851 This feature is not enabled by default.  Specifying
12852 @option{-mno-long-calls} restores the default behavior, as does
12853 placing the function calls within the scope of a @samp{#pragma
12854 long_calls_off} directive.  Note these switches have no effect on how
12855 the compiler generates code to handle function calls via function
12856 pointers.
12858 @item -msingle-pic-base
12859 @opindex msingle-pic-base
12860 Treat the register used for PIC addressing as read-only, rather than
12861 loading it in the prologue for each function.  The runtime system is
12862 responsible for initializing this register with an appropriate value
12863 before execution begins.
12865 @item -mpic-register=@var{reg}
12866 @opindex mpic-register
12867 Specify the register to be used for PIC addressing.
12868 For standard PIC base case, the default will be any suitable register
12869 determined by compiler.  For single PIC base case, the default is
12870 @samp{R9} if target is EABI based or stack-checking is enabled,
12871 otherwise the default is @samp{R10}.
12873 @item -mpic-data-is-text-relative
12874 @opindex mpic-data-is-text-relative
12875 Assume that each data segments are relative to text segment at load time.
12876 Therefore, it permits addressing data using PC-relative operations.
12877 This option is on by default for targets other than VxWorks RTP.
12879 @item -mpoke-function-name
12880 @opindex mpoke-function-name
12881 Write the name of each function into the text section, directly
12882 preceding the function prologue.  The generated code is similar to this:
12884 @smallexample
12885      t0
12886          .ascii "arm_poke_function_name", 0
12887          .align
12888      t1
12889          .word 0xff000000 + (t1 - t0)
12890      arm_poke_function_name
12891          mov     ip, sp
12892          stmfd   sp!, @{fp, ip, lr, pc@}
12893          sub     fp, ip, #4
12894 @end smallexample
12896 When performing a stack backtrace, code can inspect the value of
12897 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
12898 location @code{pc - 12} and the top 8 bits are set, then we know that
12899 there is a function name embedded immediately preceding this location
12900 and has length @code{((pc[-3]) & 0xff000000)}.
12902 @item -mthumb
12903 @itemx -marm
12904 @opindex marm
12905 @opindex mthumb
12907 Select between generating code that executes in ARM and Thumb
12908 states.  The default for most configurations is to generate code
12909 that executes in ARM state, but the default can be changed by
12910 configuring GCC with the @option{--with-mode=}@var{state}
12911 configure option.
12913 @item -mtpcs-frame
12914 @opindex mtpcs-frame
12915 Generate a stack frame that is compliant with the Thumb Procedure Call
12916 Standard for all non-leaf functions.  (A leaf function is one that does
12917 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
12919 @item -mtpcs-leaf-frame
12920 @opindex mtpcs-leaf-frame
12921 Generate a stack frame that is compliant with the Thumb Procedure Call
12922 Standard for all leaf functions.  (A leaf function is one that does
12923 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
12925 @item -mcallee-super-interworking
12926 @opindex mcallee-super-interworking
12927 Gives all externally visible functions in the file being compiled an ARM
12928 instruction set header which switches to Thumb mode before executing the
12929 rest of the function.  This allows these functions to be called from
12930 non-interworking code.  This option is not valid in AAPCS configurations
12931 because interworking is enabled by default.
12933 @item -mcaller-super-interworking
12934 @opindex mcaller-super-interworking
12935 Allows calls via function pointers (including virtual functions) to
12936 execute correctly regardless of whether the target code has been
12937 compiled for interworking or not.  There is a small overhead in the cost
12938 of executing a function pointer if this option is enabled.  This option
12939 is not valid in AAPCS configurations because interworking is enabled
12940 by default.
12942 @item -mtp=@var{name}
12943 @opindex mtp
12944 Specify the access model for the thread local storage pointer.  The valid
12945 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
12946 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
12947 (supported in the arm6k architecture), and @option{auto}, which uses the
12948 best available method for the selected processor.  The default setting is
12949 @option{auto}.
12951 @item -mtls-dialect=@var{dialect}
12952 @opindex mtls-dialect
12953 Specify the dialect to use for accessing thread local storage.  Two
12954 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
12955 @samp{gnu} dialect selects the original GNU scheme for supporting
12956 local and global dynamic TLS models.  The @samp{gnu2} dialect
12957 selects the GNU descriptor scheme, which provides better performance
12958 for shared libraries.  The GNU descriptor scheme is compatible with
12959 the original scheme, but does require new assembler, linker and
12960 library support.  Initial and local exec TLS models are unaffected by
12961 this option and always use the original scheme.
12963 @item -mword-relocations
12964 @opindex mword-relocations
12965 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
12966 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
12967 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
12968 is specified.
12970 @item -mfix-cortex-m3-ldrd
12971 @opindex mfix-cortex-m3-ldrd
12972 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
12973 with overlapping destination and base registers are used.  This option avoids
12974 generating these instructions.  This option is enabled by default when
12975 @option{-mcpu=cortex-m3} is specified.
12977 @item -munaligned-access
12978 @itemx -mno-unaligned-access
12979 @opindex munaligned-access
12980 @opindex mno-unaligned-access
12981 Enables (or disables) reading and writing of 16- and 32- bit values
12982 from addresses that are not 16- or 32- bit aligned.  By default
12983 unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
12984 architectures, and enabled for all other architectures.  If unaligned
12985 access is not enabled then words in packed data structures will be
12986 accessed a byte at a time.
12988 The ARM attribute @code{Tag_CPU_unaligned_access} will be set in the
12989 generated object file to either true or false, depending upon the
12990 setting of this option.  If unaligned access is enabled then the
12991 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} will also be
12992 defined.
12994 @item -mneon-for-64bits
12995 @opindex mneon-for-64bits
12996 Enables using Neon to handle scalar 64-bits operations. This is
12997 disabled by default since the cost of moving data from core registers
12998 to Neon is high.
13000 @item -mslow-flash-data
13001 @opindex mslow-flash-data
13002 Assume loading data from flash is slower than fetching instruction.
13003 Therefore literal load is minimized for better performance.
13004 This option is only supported when compiling for ARMv7 M-profile and
13005 off by default.
13007 @item -mrestrict-it
13008 @opindex mrestrict-it
13009 Restricts generation of IT blocks to conform to the rules of ARMv8.
13010 IT blocks can only contain a single 16-bit instruction from a select
13011 set of instructions. This option is on by default for ARMv8 Thumb mode.
13012 @end table
13014 @node AVR Options
13015 @subsection AVR Options
13016 @cindex AVR Options
13018 These options are defined for AVR implementations:
13020 @table @gcctabopt
13021 @item -mmcu=@var{mcu}
13022 @opindex mmcu
13023 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
13025 The default for this option is@tie{}@code{avr2}.
13027 GCC supports the following AVR devices and ISAs:
13029 @include avr-mmcu.texi
13031 @item -maccumulate-args
13032 @opindex maccumulate-args
13033 Accumulate outgoing function arguments and acquire/release the needed
13034 stack space for outgoing function arguments once in function
13035 prologue/epilogue.  Without this option, outgoing arguments are pushed
13036 before calling a function and popped afterwards.
13038 Popping the arguments after the function call can be expensive on
13039 AVR so that accumulating the stack space might lead to smaller
13040 executables because arguments need not to be removed from the
13041 stack after such a function call.
13043 This option can lead to reduced code size for functions that perform
13044 several calls to functions that get their arguments on the stack like
13045 calls to printf-like functions.
13047 @item -mbranch-cost=@var{cost}
13048 @opindex mbranch-cost
13049 Set the branch costs for conditional branch instructions to
13050 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
13051 integers. The default branch cost is 0.
13053 @item -mcall-prologues
13054 @opindex mcall-prologues
13055 Functions prologues/epilogues are expanded as calls to appropriate
13056 subroutines.  Code size is smaller.
13058 @item -mint8
13059 @opindex mint8
13060 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
13061 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
13062 and @code{long long} is 4 bytes.  Please note that this option does not
13063 conform to the C standards, but it results in smaller code
13064 size.
13066 @item -mno-interrupts
13067 @opindex mno-interrupts
13068 Generated code is not compatible with hardware interrupts.
13069 Code size is smaller.
13071 @item -mrelax
13072 @opindex mrelax
13073 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
13074 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
13075 Setting @code{-mrelax} just adds the @code{--relax} option to the
13076 linker command line when the linker is called.
13078 Jump relaxing is performed by the linker because jump offsets are not
13079 known before code is located. Therefore, the assembler code generated by the
13080 compiler is the same, but the instructions in the executable may
13081 differ from instructions in the assembler code.
13083 Relaxing must be turned on if linker stubs are needed, see the
13084 section on @code{EIND} and linker stubs below.
13086 @item -msp8
13087 @opindex msp8
13088 Treat the stack pointer register as an 8-bit register,
13089 i.e.@: assume the high byte of the stack pointer is zero.
13090 In general, you don't need to set this option by hand.
13092 This option is used internally by the compiler to select and
13093 build multilibs for architectures @code{avr2} and @code{avr25}.
13094 These architectures mix devices with and without @code{SPH}.
13095 For any setting other than @code{-mmcu=avr2} or @code{-mmcu=avr25}
13096 the compiler driver will add or remove this option from the compiler
13097 proper's command line, because the compiler then knows if the device
13098 or architecture has an 8-bit stack pointer and thus no @code{SPH}
13099 register or not.
13101 @item -mstrict-X
13102 @opindex mstrict-X
13103 Use address register @code{X} in a way proposed by the hardware.  This means
13104 that @code{X} is only used in indirect, post-increment or
13105 pre-decrement addressing.
13107 Without this option, the @code{X} register may be used in the same way
13108 as @code{Y} or @code{Z} which then is emulated by additional
13109 instructions.  
13110 For example, loading a value with @code{X+const} addressing with a
13111 small non-negative @code{const < 64} to a register @var{Rn} is
13112 performed as
13114 @example
13115 adiw r26, const   ; X += const
13116 ld   @var{Rn}, X        ; @var{Rn} = *X
13117 sbiw r26, const   ; X -= const
13118 @end example
13120 @item -mtiny-stack
13121 @opindex mtiny-stack
13122 Only change the lower 8@tie{}bits of the stack pointer.
13124 @item -Waddr-space-convert
13125 @opindex Waddr-space-convert
13126 Warn about conversions between address spaces in the case where the
13127 resulting address space is not contained in the incoming address space.
13128 @end table
13130 @subsubsection @code{EIND} and Devices with more than 128 Ki Bytes of Flash
13131 @cindex @code{EIND}
13132 Pointers in the implementation are 16@tie{}bits wide.
13133 The address of a function or label is represented as word address so
13134 that indirect jumps and calls can target any code address in the
13135 range of 64@tie{}Ki words.
13137 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
13138 bytes of program memory space, there is a special function register called
13139 @code{EIND} that serves as most significant part of the target address
13140 when @code{EICALL} or @code{EIJMP} instructions are used.
13142 Indirect jumps and calls on these devices are handled as follows by
13143 the compiler and are subject to some limitations:
13145 @itemize @bullet
13147 @item
13148 The compiler never sets @code{EIND}.
13150 @item
13151 The compiler uses @code{EIND} implicitely in @code{EICALL}/@code{EIJMP}
13152 instructions or might read @code{EIND} directly in order to emulate an
13153 indirect call/jump by means of a @code{RET} instruction.
13155 @item
13156 The compiler assumes that @code{EIND} never changes during the startup
13157 code or during the application. In particular, @code{EIND} is not
13158 saved/restored in function or interrupt service routine
13159 prologue/epilogue.
13161 @item
13162 For indirect calls to functions and computed goto, the linker
13163 generates @emph{stubs}. Stubs are jump pads sometimes also called
13164 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
13165 The stub contains a direct jump to the desired address.
13167 @item
13168 Linker relaxation must be turned on so that the linker will generate
13169 the stubs correctly an all situaltion. See the compiler option
13170 @code{-mrelax} and the linler option @code{--relax}.
13171 There are corner cases where the linker is supposed to generate stubs
13172 but aborts without relaxation and without a helpful error message.
13174 @item
13175 The default linker script is arranged for code with @code{EIND = 0}.
13176 If code is supposed to work for a setup with @code{EIND != 0}, a custom
13177 linker script has to be used in order to place the sections whose
13178 name start with @code{.trampolines} into the segment where @code{EIND}
13179 points to.
13181 @item
13182 The startup code from libgcc never sets @code{EIND}.
13183 Notice that startup code is a blend of code from libgcc and AVR-LibC.
13184 For the impact of AVR-LibC on @code{EIND}, see the
13185 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
13187 @item
13188 It is legitimate for user-specific startup code to set up @code{EIND}
13189 early, for example by means of initialization code located in
13190 section @code{.init3}. Such code runs prior to general startup code
13191 that initializes RAM and calls constructors, but after the bit
13192 of startup code from AVR-LibC that sets @code{EIND} to the segment
13193 where the vector table is located.
13194 @example
13195 #include <avr/io.h>
13197 static void
13198 __attribute__((section(".init3"),naked,used,no_instrument_function))
13199 init3_set_eind (void)
13201   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
13202                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
13204 @end example
13206 @noindent
13207 The @code{__trampolines_start} symbol is defined in the linker script.
13209 @item
13210 Stubs are generated automatically by the linker if
13211 the following two conditions are met:
13212 @itemize @minus
13214 @item The address of a label is taken by means of the @code{gs} modifier
13215 (short for @emph{generate stubs}) like so:
13216 @example
13217 LDI r24, lo8(gs(@var{func}))
13218 LDI r25, hi8(gs(@var{func}))
13219 @end example
13220 @item The final location of that label is in a code segment
13221 @emph{outside} the segment where the stubs are located.
13222 @end itemize
13224 @item
13225 The compiler emits such @code{gs} modifiers for code labels in the
13226 following situations:
13227 @itemize @minus
13228 @item Taking address of a function or code label.
13229 @item Computed goto.
13230 @item If prologue-save function is used, see @option{-mcall-prologues}
13231 command-line option.
13232 @item Switch/case dispatch tables. If you do not want such dispatch
13233 tables you can specify the @option{-fno-jump-tables} command-line option.
13234 @item C and C++ constructors/destructors called during startup/shutdown.
13235 @item If the tools hit a @code{gs()} modifier explained above.
13236 @end itemize
13238 @item
13239 Jumping to non-symbolic addresses like so is @emph{not} supported:
13241 @example
13242 int main (void)
13244     /* Call function at word address 0x2 */
13245     return ((int(*)(void)) 0x2)();
13247 @end example
13249 Instead, a stub has to be set up, i.e.@: the function has to be called
13250 through a symbol (@code{func_4} in the example):
13252 @example
13253 int main (void)
13255     extern int func_4 (void);
13257     /* Call function at byte address 0x4 */
13258     return func_4();
13260 @end example
13262 and the application be linked with @code{-Wl,--defsym,func_4=0x4}.
13263 Alternatively, @code{func_4} can be defined in the linker script.
13264 @end itemize
13266 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
13267 @cindex @code{RAMPD}
13268 @cindex @code{RAMPX}
13269 @cindex @code{RAMPY}
13270 @cindex @code{RAMPZ}
13271 Some AVR devices support memories larger than the 64@tie{}KiB range
13272 that can be accessed with 16-bit pointers.  To access memory locations
13273 outside this 64@tie{}KiB range, the contentent of a @code{RAMP}
13274 register is used as high part of the address:
13275 The @code{X}, @code{Y}, @code{Z} address register is concatenated
13276 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
13277 register, respectively, to get a wide address. Similarly,
13278 @code{RAMPD} is used together with direct addressing.
13280 @itemize
13281 @item
13282 The startup code initializes the @code{RAMP} special function
13283 registers with zero.
13285 @item
13286 If a @ref{AVR Named Address Spaces,named address space} other than
13287 generic or @code{__flash} is used, then @code{RAMPZ} is set
13288 as needed before the operation.
13290 @item
13291 If the device supports RAM larger than 64@tie{}KiB and the compiler
13292 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
13293 is reset to zero after the operation.
13295 @item
13296 If the device comes with a specific @code{RAMP} register, the ISR
13297 prologue/epilogue saves/restores that SFR and initializes it with
13298 zero in case the ISR code might (implicitly) use it.
13300 @item
13301 RAM larger than 64@tie{}KiB is not supported by GCC for AVR targets.
13302 If you use inline assembler to read from locations outside the
13303 16-bit address range and change one of the @code{RAMP} registers,
13304 you must reset it to zero after the access.
13306 @end itemize
13308 @subsubsection AVR Built-in Macros
13310 GCC defines several built-in macros so that the user code can test
13311 for the presence or absence of features.  Almost any of the following
13312 built-in macros are deduced from device capabilities and thus
13313 triggered by the @code{-mmcu=} command-line option.
13315 For even more AVR-specific built-in macros see
13316 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
13318 @table @code
13320 @item __AVR_ARCH__
13321 Build-in macro that resolves to a decimal number that identifies the
13322 architecture and depends on the @code{-mmcu=@var{mcu}} option.
13323 Possible values are:
13325 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
13326 @code{4}, @code{5}, @code{51}, @code{6}, @code{102}, @code{104},
13327 @code{105}, @code{106}, @code{107}
13329 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3},
13330 @code{avr31}, @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51},
13331 @code{avr6}, @code{avrxmega2}, @code{avrxmega4}, @code{avrxmega5},
13332 @code{avrxmega6}, @code{avrxmega7}, respectively.
13333 If @var{mcu} specifies a device, this built-in macro is set
13334 accordingly. For example, with @code{-mmcu=atmega8} the macro will be
13335 defined to @code{4}.
13337 @item __AVR_@var{Device}__
13338 Setting @code{-mmcu=@var{device}} defines this built-in macro which reflects
13339 the device's name. For example, @code{-mmcu=atmega8} defines the
13340 built-in macro @code{__AVR_ATmega8__}, @code{-mmcu=attiny261a} defines
13341 @code{__AVR_ATtiny261A__}, etc.
13343 The built-in macros' names follow
13344 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
13345 the device name as from the AVR user manual. The difference between
13346 @var{Device} in the built-in macro and @var{device} in
13347 @code{-mmcu=@var{device}} is that the latter is always lowercase.
13349 If @var{device} is not a device but only a core architecture like
13350 @code{avr51}, this macro will not be defined.
13352 @item   __AVR_DEVICE_NAME__
13353 Setting @code{-mmcu=@var{device}} defines this built-in macro to
13354 the device's name. For example, with @code{-mmcu=atmega8} the macro
13355 will be defined to @code{atmega8}.
13357 If @var{device} is not a device but only a core architecture like
13358 @code{avr51}, this macro will not be defined.
13360 @item __AVR_XMEGA__
13361 The device / architecture belongs to the XMEGA family of devices.
13363 @item __AVR_HAVE_ELPM__
13364 The device has the the @code{ELPM} instruction.
13366 @item __AVR_HAVE_ELPMX__
13367 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
13368 R@var{n},Z+} instructions.
13370 @item __AVR_HAVE_MOVW__
13371 The device has the @code{MOVW} instruction to perform 16-bit
13372 register-register moves.
13374 @item __AVR_HAVE_LPMX__
13375 The device has the @code{LPM R@var{n},Z} and
13376 @code{LPM R@var{n},Z+} instructions.
13378 @item __AVR_HAVE_MUL__
13379 The device has a hardware multiplier. 
13381 @item __AVR_HAVE_JMP_CALL__
13382 The device has the @code{JMP} and @code{CALL} instructions.
13383 This is the case for devices with at least 16@tie{}KiB of program
13384 memory.
13386 @item __AVR_HAVE_EIJMP_EICALL__
13387 @itemx __AVR_3_BYTE_PC__
13388 The device has the @code{EIJMP} and @code{EICALL} instructions.
13389 This is the case for devices with more than 128@tie{}KiB of program memory.
13390 This also means that the program counter
13391 (PC) is 3@tie{}bytes wide.
13393 @item __AVR_2_BYTE_PC__
13394 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
13395 with up to 128@tie{}KiB of program memory.
13397 @item __AVR_HAVE_8BIT_SP__
13398 @itemx __AVR_HAVE_16BIT_SP__
13399 The stack pointer (SP) register is treated as 8-bit respectively
13400 16-bit register by the compiler.
13401 The definition of these macros is affected by @code{-mtiny-stack}.
13403 @item __AVR_HAVE_SPH__
13404 @itemx __AVR_SP8__
13405 The device has the SPH (high part of stack pointer) special function
13406 register or has an 8-bit stack pointer, respectively.
13407 The definition of these macros is affected by @code{-mmcu=} and
13408 in the cases of @code{-mmcu=avr2} and @code{-mmcu=avr25} also
13409 by @code{-msp8}.
13411 @item __AVR_HAVE_RAMPD__
13412 @itemx __AVR_HAVE_RAMPX__
13413 @itemx __AVR_HAVE_RAMPY__
13414 @itemx __AVR_HAVE_RAMPZ__
13415 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
13416 @code{RAMPZ} special function register, respectively.
13418 @item __NO_INTERRUPTS__
13419 This macro reflects the @code{-mno-interrupts} command line option.
13421 @item __AVR_ERRATA_SKIP__
13422 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
13423 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
13424 instructions because of a hardware erratum.  Skip instructions are
13425 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
13426 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
13427 set.
13429 @item __AVR_ISA_RMW__
13430 The device has Read-Modify-Write instructions (XCH, LAC, LAS and LAT).
13432 @item __AVR_SFR_OFFSET__=@var{offset}
13433 Instructions that can address I/O special function registers directly
13434 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
13435 address as if addressed by an instruction to access RAM like @code{LD}
13436 or @code{STS}. This offset depends on the device architecture and has
13437 to be subtracted from the RAM address in order to get the
13438 respective I/O@tie{}address.
13440 @item __WITH_AVRLIBC__
13441 The compiler is configured to be used together with AVR-Libc.
13442 See the @code{--with-avrlibc} configure option.
13444 @end table
13446 @node Blackfin Options
13447 @subsection Blackfin Options
13448 @cindex Blackfin Options
13450 @table @gcctabopt
13451 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
13452 @opindex mcpu=
13453 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
13454 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
13455 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
13456 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
13457 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
13458 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
13459 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
13460 @samp{bf561}, @samp{bf592}.
13462 The optional @var{sirevision} specifies the silicon revision of the target
13463 Blackfin processor.  Any workarounds available for the targeted silicon revision
13464 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
13465 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
13466 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
13467 hexadecimal digits representing the major and minor numbers in the silicon
13468 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
13469 is not defined.  If @var{sirevision} is @samp{any}, the
13470 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
13471 If this optional @var{sirevision} is not used, GCC assumes the latest known
13472 silicon revision of the targeted Blackfin processor.
13474 GCC defines a preprocessor macro for the specified @var{cpu}.
13475 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
13476 provided by libgloss to be linked in if @option{-msim} is not given.
13478 Without this option, @samp{bf532} is used as the processor by default.
13480 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
13481 only the preprocessor macro is defined.
13483 @item -msim
13484 @opindex msim
13485 Specifies that the program will be run on the simulator.  This causes
13486 the simulator BSP provided by libgloss to be linked in.  This option
13487 has effect only for @samp{bfin-elf} toolchain.
13488 Certain other options, such as @option{-mid-shared-library} and
13489 @option{-mfdpic}, imply @option{-msim}.
13491 @item -momit-leaf-frame-pointer
13492 @opindex momit-leaf-frame-pointer
13493 Don't keep the frame pointer in a register for leaf functions.  This
13494 avoids the instructions to save, set up and restore frame pointers and
13495 makes an extra register available in leaf functions.  The option
13496 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
13497 which might make debugging harder.
13499 @item -mspecld-anomaly
13500 @opindex mspecld-anomaly
13501 When enabled, the compiler ensures that the generated code does not
13502 contain speculative loads after jump instructions. If this option is used,
13503 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
13505 @item -mno-specld-anomaly
13506 @opindex mno-specld-anomaly
13507 Don't generate extra code to prevent speculative loads from occurring.
13509 @item -mcsync-anomaly
13510 @opindex mcsync-anomaly
13511 When enabled, the compiler ensures that the generated code does not
13512 contain CSYNC or SSYNC instructions too soon after conditional branches.
13513 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
13515 @item -mno-csync-anomaly
13516 @opindex mno-csync-anomaly
13517 Don't generate extra code to prevent CSYNC or SSYNC instructions from
13518 occurring too soon after a conditional branch.
13520 @item -mlow-64k
13521 @opindex mlow-64k
13522 When enabled, the compiler is free to take advantage of the knowledge that
13523 the entire program fits into the low 64k of memory.
13525 @item -mno-low-64k
13526 @opindex mno-low-64k
13527 Assume that the program is arbitrarily large.  This is the default.
13529 @item -mstack-check-l1
13530 @opindex mstack-check-l1
13531 Do stack checking using information placed into L1 scratchpad memory by the
13532 uClinux kernel.
13534 @item -mid-shared-library
13535 @opindex mid-shared-library
13536 Generate code that supports shared libraries via the library ID method.
13537 This allows for execute in place and shared libraries in an environment
13538 without virtual memory management.  This option implies @option{-fPIC}.
13539 With a @samp{bfin-elf} target, this option implies @option{-msim}.
13541 @item -mno-id-shared-library
13542 @opindex mno-id-shared-library
13543 Generate code that doesn't assume ID-based shared libraries are being used.
13544 This is the default.
13546 @item -mleaf-id-shared-library
13547 @opindex mleaf-id-shared-library
13548 Generate code that supports shared libraries via the library ID method,
13549 but assumes that this library or executable won't link against any other
13550 ID shared libraries.  That allows the compiler to use faster code for jumps
13551 and calls.
13553 @item -mno-leaf-id-shared-library
13554 @opindex mno-leaf-id-shared-library
13555 Do not assume that the code being compiled won't link against any ID shared
13556 libraries.  Slower code is generated for jump and call insns.
13558 @item -mshared-library-id=n
13559 @opindex mshared-library-id
13560 Specifies the identification number of the ID-based shared library being
13561 compiled.  Specifying a value of 0 generates more compact code; specifying
13562 other values forces the allocation of that number to the current
13563 library but is no more space- or time-efficient than omitting this option.
13565 @item -msep-data
13566 @opindex msep-data
13567 Generate code that allows the data segment to be located in a different
13568 area of memory from the text segment.  This allows for execute in place in
13569 an environment without virtual memory management by eliminating relocations
13570 against the text section.
13572 @item -mno-sep-data
13573 @opindex mno-sep-data
13574 Generate code that assumes that the data segment follows the text segment.
13575 This is the default.
13577 @item -mlong-calls
13578 @itemx -mno-long-calls
13579 @opindex mlong-calls
13580 @opindex mno-long-calls
13581 Tells the compiler to perform function calls by first loading the
13582 address of the function into a register and then performing a subroutine
13583 call on this register.  This switch is needed if the target function
13584 lies outside of the 24-bit addressing range of the offset-based
13585 version of subroutine call instruction.
13587 This feature is not enabled by default.  Specifying
13588 @option{-mno-long-calls} restores the default behavior.  Note these
13589 switches have no effect on how the compiler generates code to handle
13590 function calls via function pointers.
13592 @item -mfast-fp
13593 @opindex mfast-fp
13594 Link with the fast floating-point library. This library relaxes some of
13595 the IEEE floating-point standard's rules for checking inputs against
13596 Not-a-Number (NAN), in the interest of performance.
13598 @item -minline-plt
13599 @opindex minline-plt
13600 Enable inlining of PLT entries in function calls to functions that are
13601 not known to bind locally.  It has no effect without @option{-mfdpic}.
13603 @item -mmulticore
13604 @opindex mmulticore
13605 Build a standalone application for multicore Blackfin processors. 
13606 This option causes proper start files and link scripts supporting 
13607 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
13608 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
13610 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
13611 selects the one-application-per-core programming model.  Without
13612 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
13613 programming model is used. In this model, the main function of Core B
13614 should be named as @code{coreb_main}.
13616 If this option is not used, the single-core application programming
13617 model is used.
13619 @item -mcorea
13620 @opindex mcorea
13621 Build a standalone application for Core A of BF561 when using
13622 the one-application-per-core programming model. Proper start files
13623 and link scripts are used to support Core A, and the macro
13624 @code{__BFIN_COREA} is defined.
13625 This option can only be used in conjunction with @option{-mmulticore}.
13627 @item -mcoreb
13628 @opindex mcoreb
13629 Build a standalone application for Core B of BF561 when using
13630 the one-application-per-core programming model. Proper start files
13631 and link scripts are used to support Core B, and the macro
13632 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
13633 should be used instead of @code{main}. 
13634 This option can only be used in conjunction with @option{-mmulticore}.
13636 @item -msdram
13637 @opindex msdram
13638 Build a standalone application for SDRAM. Proper start files and
13639 link scripts are used to put the application into SDRAM, and the macro
13640 @code{__BFIN_SDRAM} is defined.
13641 The loader should initialize SDRAM before loading the application.
13643 @item -micplb
13644 @opindex micplb
13645 Assume that ICPLBs are enabled at run time.  This has an effect on certain
13646 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
13647 are enabled; for standalone applications the default is off.
13648 @end table
13650 @node C6X Options
13651 @subsection C6X Options
13652 @cindex C6X Options
13654 @table @gcctabopt
13655 @item -march=@var{name}
13656 @opindex march
13657 This specifies the name of the target architecture.  GCC uses this
13658 name to determine what kind of instructions it can emit when generating
13659 assembly code.  Permissible names are: @samp{c62x},
13660 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
13662 @item -mbig-endian
13663 @opindex mbig-endian
13664 Generate code for a big-endian target.
13666 @item -mlittle-endian
13667 @opindex mlittle-endian
13668 Generate code for a little-endian target.  This is the default.
13670 @item -msim
13671 @opindex msim
13672 Choose startup files and linker script suitable for the simulator.
13674 @item -msdata=default
13675 @opindex msdata=default
13676 Put small global and static data in the @samp{.neardata} section,
13677 which is pointed to by register @code{B14}.  Put small uninitialized
13678 global and static data in the @samp{.bss} section, which is adjacent
13679 to the @samp{.neardata} section.  Put small read-only data into the
13680 @samp{.rodata} section.  The corresponding sections used for large
13681 pieces of data are @samp{.fardata}, @samp{.far} and @samp{.const}.
13683 @item -msdata=all
13684 @opindex msdata=all
13685 Put all data, not just small objects, into the sections reserved for
13686 small data, and use addressing relative to the @code{B14} register to
13687 access them.
13689 @item -msdata=none
13690 @opindex msdata=none
13691 Make no use of the sections reserved for small data, and use absolute
13692 addresses to access all data.  Put all initialized global and static
13693 data in the @samp{.fardata} section, and all uninitialized data in the
13694 @samp{.far} section.  Put all constant data into the @samp{.const}
13695 section.
13696 @end table
13698 @node CRIS Options
13699 @subsection CRIS Options
13700 @cindex CRIS Options
13702 These options are defined specifically for the CRIS ports.
13704 @table @gcctabopt
13705 @item -march=@var{architecture-type}
13706 @itemx -mcpu=@var{architecture-type}
13707 @opindex march
13708 @opindex mcpu
13709 Generate code for the specified architecture.  The choices for
13710 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
13711 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
13712 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
13713 @samp{v10}.
13715 @item -mtune=@var{architecture-type}
13716 @opindex mtune
13717 Tune to @var{architecture-type} everything applicable about the generated
13718 code, except for the ABI and the set of available instructions.  The
13719 choices for @var{architecture-type} are the same as for
13720 @option{-march=@var{architecture-type}}.
13722 @item -mmax-stack-frame=@var{n}
13723 @opindex mmax-stack-frame
13724 Warn when the stack frame of a function exceeds @var{n} bytes.
13726 @item -metrax4
13727 @itemx -metrax100
13728 @opindex metrax4
13729 @opindex metrax100
13730 The options @option{-metrax4} and @option{-metrax100} are synonyms for
13731 @option{-march=v3} and @option{-march=v8} respectively.
13733 @item -mmul-bug-workaround
13734 @itemx -mno-mul-bug-workaround
13735 @opindex mmul-bug-workaround
13736 @opindex mno-mul-bug-workaround
13737 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
13738 models where it applies.  This option is active by default.
13740 @item -mpdebug
13741 @opindex mpdebug
13742 Enable CRIS-specific verbose debug-related information in the assembly
13743 code.  This option also has the effect of turning off the @samp{#NO_APP}
13744 formatted-code indicator to the assembler at the beginning of the
13745 assembly file.
13747 @item -mcc-init
13748 @opindex mcc-init
13749 Do not use condition-code results from previous instruction; always emit
13750 compare and test instructions before use of condition codes.
13752 @item -mno-side-effects
13753 @opindex mno-side-effects
13754 Do not emit instructions with side effects in addressing modes other than
13755 post-increment.
13757 @item -mstack-align
13758 @itemx -mno-stack-align
13759 @itemx -mdata-align
13760 @itemx -mno-data-align
13761 @itemx -mconst-align
13762 @itemx -mno-const-align
13763 @opindex mstack-align
13764 @opindex mno-stack-align
13765 @opindex mdata-align
13766 @opindex mno-data-align
13767 @opindex mconst-align
13768 @opindex mno-const-align
13769 These options (@samp{no-} options) arrange (eliminate arrangements) for the
13770 stack frame, individual data and constants to be aligned for the maximum
13771 single data access size for the chosen CPU model.  The default is to
13772 arrange for 32-bit alignment.  ABI details such as structure layout are
13773 not affected by these options.
13775 @item -m32-bit
13776 @itemx -m16-bit
13777 @itemx -m8-bit
13778 @opindex m32-bit
13779 @opindex m16-bit
13780 @opindex m8-bit
13781 Similar to the stack- data- and const-align options above, these options
13782 arrange for stack frame, writable data and constants to all be 32-bit,
13783 16-bit or 8-bit aligned.  The default is 32-bit alignment.
13785 @item -mno-prologue-epilogue
13786 @itemx -mprologue-epilogue
13787 @opindex mno-prologue-epilogue
13788 @opindex mprologue-epilogue
13789 With @option{-mno-prologue-epilogue}, the normal function prologue and
13790 epilogue which set up the stack frame are omitted and no return
13791 instructions or return sequences are generated in the code.  Use this
13792 option only together with visual inspection of the compiled code: no
13793 warnings or errors are generated when call-saved registers must be saved,
13794 or storage for local variables needs to be allocated.
13796 @item -mno-gotplt
13797 @itemx -mgotplt
13798 @opindex mno-gotplt
13799 @opindex mgotplt
13800 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
13801 instruction sequences that load addresses for functions from the PLT part
13802 of the GOT rather than (traditional on other architectures) calls to the
13803 PLT@.  The default is @option{-mgotplt}.
13805 @item -melf
13806 @opindex melf
13807 Legacy no-op option only recognized with the cris-axis-elf and
13808 cris-axis-linux-gnu targets.
13810 @item -mlinux
13811 @opindex mlinux
13812 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
13814 @item -sim
13815 @opindex sim
13816 This option, recognized for the cris-axis-elf, arranges
13817 to link with input-output functions from a simulator library.  Code,
13818 initialized data and zero-initialized data are allocated consecutively.
13820 @item -sim2
13821 @opindex sim2
13822 Like @option{-sim}, but pass linker options to locate initialized data at
13823 0x40000000 and zero-initialized data at 0x80000000.
13824 @end table
13826 @node CR16 Options
13827 @subsection CR16 Options
13828 @cindex CR16 Options
13830 These options are defined specifically for the CR16 ports.
13832 @table @gcctabopt
13834 @item -mmac
13835 @opindex mmac
13836 Enable the use of multiply-accumulate instructions. Disabled by default.
13838 @item -mcr16cplus
13839 @itemx -mcr16c
13840 @opindex mcr16cplus
13841 @opindex mcr16c
13842 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
13843 is default.
13845 @item -msim
13846 @opindex msim
13847 Links the library libsim.a which is in compatible with simulator. Applicable
13848 to ELF compiler only.
13850 @item -mint32
13851 @opindex mint32
13852 Choose integer type as 32-bit wide.
13854 @item -mbit-ops
13855 @opindex mbit-ops
13856 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
13858 @item -mdata-model=@var{model}
13859 @opindex mdata-model
13860 Choose a data model. The choices for @var{model} are @samp{near},
13861 @samp{far} or @samp{medium}. @samp{medium} is default.
13862 However, @samp{far} is not valid with @option{-mcr16c}, as the
13863 CR16C architecture does not support the far data model.
13864 @end table
13866 @node Darwin Options
13867 @subsection Darwin Options
13868 @cindex Darwin options
13870 These options are defined for all architectures running the Darwin operating
13871 system.
13873 FSF GCC on Darwin does not create ``fat'' object files; it creates
13874 an object file for the single architecture that GCC was built to
13875 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
13876 @option{-arch} options are used; it does so by running the compiler or
13877 linker multiple times and joining the results together with
13878 @file{lipo}.
13880 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
13881 @samp{i686}) is determined by the flags that specify the ISA
13882 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
13883 @option{-force_cpusubtype_ALL} option can be used to override this.
13885 The Darwin tools vary in their behavior when presented with an ISA
13886 mismatch.  The assembler, @file{as}, only permits instructions to
13887 be used that are valid for the subtype of the file it is generating,
13888 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
13889 The linker for shared libraries, @file{/usr/bin/libtool}, fails
13890 and prints an error if asked to create a shared library with a less
13891 restrictive subtype than its input files (for instance, trying to put
13892 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
13893 for executables, @command{ld}, quietly gives the executable the most
13894 restrictive subtype of any of its input files.
13896 @table @gcctabopt
13897 @item -F@var{dir}
13898 @opindex F
13899 Add the framework directory @var{dir} to the head of the list of
13900 directories to be searched for header files.  These directories are
13901 interleaved with those specified by @option{-I} options and are
13902 scanned in a left-to-right order.
13904 A framework directory is a directory with frameworks in it.  A
13905 framework is a directory with a @file{Headers} and/or
13906 @file{PrivateHeaders} directory contained directly in it that ends
13907 in @file{.framework}.  The name of a framework is the name of this
13908 directory excluding the @file{.framework}.  Headers associated with
13909 the framework are found in one of those two directories, with
13910 @file{Headers} being searched first.  A subframework is a framework
13911 directory that is in a framework's @file{Frameworks} directory.
13912 Includes of subframework headers can only appear in a header of a
13913 framework that contains the subframework, or in a sibling subframework
13914 header.  Two subframeworks are siblings if they occur in the same
13915 framework.  A subframework should not have the same name as a
13916 framework; a warning is issued if this is violated.  Currently a
13917 subframework cannot have subframeworks; in the future, the mechanism
13918 may be extended to support this.  The standard frameworks can be found
13919 in @file{/System/Library/Frameworks} and
13920 @file{/Library/Frameworks}.  An example include looks like
13921 @code{#include <Framework/header.h>}, where @file{Framework} denotes
13922 the name of the framework and @file{header.h} is found in the
13923 @file{PrivateHeaders} or @file{Headers} directory.
13925 @item -iframework@var{dir}
13926 @opindex iframework
13927 Like @option{-F} except the directory is a treated as a system
13928 directory.  The main difference between this @option{-iframework} and
13929 @option{-F} is that with @option{-iframework} the compiler does not
13930 warn about constructs contained within header files found via
13931 @var{dir}.  This option is valid only for the C family of languages.
13933 @item -gused
13934 @opindex gused
13935 Emit debugging information for symbols that are used.  For stabs
13936 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
13937 This is by default ON@.
13939 @item -gfull
13940 @opindex gfull
13941 Emit debugging information for all symbols and types.
13943 @item -mmacosx-version-min=@var{version}
13944 The earliest version of MacOS X that this executable will run on
13945 is @var{version}.  Typical values of @var{version} include @code{10.1},
13946 @code{10.2}, and @code{10.3.9}.
13948 If the compiler was built to use the system's headers by default,
13949 then the default for this option is the system version on which the
13950 compiler is running, otherwise the default is to make choices that
13951 are compatible with as many systems and code bases as possible.
13953 @item -mkernel
13954 @opindex mkernel
13955 Enable kernel development mode.  The @option{-mkernel} option sets
13956 @option{-static}, @option{-fno-common}, @option{-fno-use-cxa-atexit},
13957 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
13958 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
13959 applicable.  This mode also sets @option{-mno-altivec},
13960 @option{-msoft-float}, @option{-fno-builtin} and
13961 @option{-mlong-branch} for PowerPC targets.
13963 @item -mone-byte-bool
13964 @opindex mone-byte-bool
13965 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
13966 By default @samp{sizeof(bool)} is @samp{4} when compiling for
13967 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
13968 option has no effect on x86.
13970 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
13971 to generate code that is not binary compatible with code generated
13972 without that switch.  Using this switch may require recompiling all
13973 other modules in a program, including system libraries.  Use this
13974 switch to conform to a non-default data model.
13976 @item -mfix-and-continue
13977 @itemx -ffix-and-continue
13978 @itemx -findirect-data
13979 @opindex mfix-and-continue
13980 @opindex ffix-and-continue
13981 @opindex findirect-data
13982 Generate code suitable for fast turnaround development, such as to
13983 allow GDB to dynamically load @code{.o} files into already-running
13984 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
13985 are provided for backwards compatibility.
13987 @item -all_load
13988 @opindex all_load
13989 Loads all members of static archive libraries.
13990 See man ld(1) for more information.
13992 @item -arch_errors_fatal
13993 @opindex arch_errors_fatal
13994 Cause the errors having to do with files that have the wrong architecture
13995 to be fatal.
13997 @item -bind_at_load
13998 @opindex bind_at_load
13999 Causes the output file to be marked such that the dynamic linker will
14000 bind all undefined references when the file is loaded or launched.
14002 @item -bundle
14003 @opindex bundle
14004 Produce a Mach-o bundle format file.
14005 See man ld(1) for more information.
14007 @item -bundle_loader @var{executable}
14008 @opindex bundle_loader
14009 This option specifies the @var{executable} that will load the build
14010 output file being linked.  See man ld(1) for more information.
14012 @item -dynamiclib
14013 @opindex dynamiclib
14014 When passed this option, GCC produces a dynamic library instead of
14015 an executable when linking, using the Darwin @file{libtool} command.
14017 @item -force_cpusubtype_ALL
14018 @opindex force_cpusubtype_ALL
14019 This causes GCC's output file to have the @var{ALL} subtype, instead of
14020 one controlled by the @option{-mcpu} or @option{-march} option.
14022 @item -allowable_client  @var{client_name}
14023 @itemx -client_name
14024 @itemx -compatibility_version
14025 @itemx -current_version
14026 @itemx -dead_strip
14027 @itemx -dependency-file
14028 @itemx -dylib_file
14029 @itemx -dylinker_install_name
14030 @itemx -dynamic
14031 @itemx -exported_symbols_list
14032 @itemx -filelist
14033 @need 800
14034 @itemx -flat_namespace
14035 @itemx -force_flat_namespace
14036 @itemx -headerpad_max_install_names
14037 @itemx -image_base
14038 @itemx -init
14039 @itemx -install_name
14040 @itemx -keep_private_externs
14041 @itemx -multi_module
14042 @itemx -multiply_defined
14043 @itemx -multiply_defined_unused
14044 @need 800
14045 @itemx -noall_load
14046 @itemx -no_dead_strip_inits_and_terms
14047 @itemx -nofixprebinding
14048 @itemx -nomultidefs
14049 @itemx -noprebind
14050 @itemx -noseglinkedit
14051 @itemx -pagezero_size
14052 @itemx -prebind
14053 @itemx -prebind_all_twolevel_modules
14054 @itemx -private_bundle
14055 @need 800
14056 @itemx -read_only_relocs
14057 @itemx -sectalign
14058 @itemx -sectobjectsymbols
14059 @itemx -whyload
14060 @itemx -seg1addr
14061 @itemx -sectcreate
14062 @itemx -sectobjectsymbols
14063 @itemx -sectorder
14064 @itemx -segaddr
14065 @itemx -segs_read_only_addr
14066 @need 800
14067 @itemx -segs_read_write_addr
14068 @itemx -seg_addr_table
14069 @itemx -seg_addr_table_filename
14070 @itemx -seglinkedit
14071 @itemx -segprot
14072 @itemx -segs_read_only_addr
14073 @itemx -segs_read_write_addr
14074 @itemx -single_module
14075 @itemx -static
14076 @itemx -sub_library
14077 @need 800
14078 @itemx -sub_umbrella
14079 @itemx -twolevel_namespace
14080 @itemx -umbrella
14081 @itemx -undefined
14082 @itemx -unexported_symbols_list
14083 @itemx -weak_reference_mismatches
14084 @itemx -whatsloaded
14085 @opindex allowable_client
14086 @opindex client_name
14087 @opindex compatibility_version
14088 @opindex current_version
14089 @opindex dead_strip
14090 @opindex dependency-file
14091 @opindex dylib_file
14092 @opindex dylinker_install_name
14093 @opindex dynamic
14094 @opindex exported_symbols_list
14095 @opindex filelist
14096 @opindex flat_namespace
14097 @opindex force_flat_namespace
14098 @opindex headerpad_max_install_names
14099 @opindex image_base
14100 @opindex init
14101 @opindex install_name
14102 @opindex keep_private_externs
14103 @opindex multi_module
14104 @opindex multiply_defined
14105 @opindex multiply_defined_unused
14106 @opindex noall_load
14107 @opindex no_dead_strip_inits_and_terms
14108 @opindex nofixprebinding
14109 @opindex nomultidefs
14110 @opindex noprebind
14111 @opindex noseglinkedit
14112 @opindex pagezero_size
14113 @opindex prebind
14114 @opindex prebind_all_twolevel_modules
14115 @opindex private_bundle
14116 @opindex read_only_relocs
14117 @opindex sectalign
14118 @opindex sectobjectsymbols
14119 @opindex whyload
14120 @opindex seg1addr
14121 @opindex sectcreate
14122 @opindex sectobjectsymbols
14123 @opindex sectorder
14124 @opindex segaddr
14125 @opindex segs_read_only_addr
14126 @opindex segs_read_write_addr
14127 @opindex seg_addr_table
14128 @opindex seg_addr_table_filename
14129 @opindex seglinkedit
14130 @opindex segprot
14131 @opindex segs_read_only_addr
14132 @opindex segs_read_write_addr
14133 @opindex single_module
14134 @opindex static
14135 @opindex sub_library
14136 @opindex sub_umbrella
14137 @opindex twolevel_namespace
14138 @opindex umbrella
14139 @opindex undefined
14140 @opindex unexported_symbols_list
14141 @opindex weak_reference_mismatches
14142 @opindex whatsloaded
14143 These options are passed to the Darwin linker.  The Darwin linker man page
14144 describes them in detail.
14145 @end table
14147 @node DEC Alpha Options
14148 @subsection DEC Alpha Options
14150 These @samp{-m} options are defined for the DEC Alpha implementations:
14152 @table @gcctabopt
14153 @item -mno-soft-float
14154 @itemx -msoft-float
14155 @opindex mno-soft-float
14156 @opindex msoft-float
14157 Use (do not use) the hardware floating-point instructions for
14158 floating-point operations.  When @option{-msoft-float} is specified,
14159 functions in @file{libgcc.a} are used to perform floating-point
14160 operations.  Unless they are replaced by routines that emulate the
14161 floating-point operations, or compiled in such a way as to call such
14162 emulations routines, these routines issue floating-point
14163 operations.   If you are compiling for an Alpha without floating-point
14164 operations, you must ensure that the library is built so as not to call
14165 them.
14167 Note that Alpha implementations without floating-point operations are
14168 required to have floating-point registers.
14170 @item -mfp-reg
14171 @itemx -mno-fp-regs
14172 @opindex mfp-reg
14173 @opindex mno-fp-regs
14174 Generate code that uses (does not use) the floating-point register set.
14175 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
14176 register set is not used, floating-point operands are passed in integer
14177 registers as if they were integers and floating-point results are passed
14178 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
14179 so any function with a floating-point argument or return value called by code
14180 compiled with @option{-mno-fp-regs} must also be compiled with that
14181 option.
14183 A typical use of this option is building a kernel that does not use,
14184 and hence need not save and restore, any floating-point registers.
14186 @item -mieee
14187 @opindex mieee
14188 The Alpha architecture implements floating-point hardware optimized for
14189 maximum performance.  It is mostly compliant with the IEEE floating-point
14190 standard.  However, for full compliance, software assistance is
14191 required.  This option generates code fully IEEE-compliant code
14192 @emph{except} that the @var{inexact-flag} is not maintained (see below).
14193 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
14194 defined during compilation.  The resulting code is less efficient but is
14195 able to correctly support denormalized numbers and exceptional IEEE
14196 values such as not-a-number and plus/minus infinity.  Other Alpha
14197 compilers call this option @option{-ieee_with_no_inexact}.
14199 @item -mieee-with-inexact
14200 @opindex mieee-with-inexact
14201 This is like @option{-mieee} except the generated code also maintains
14202 the IEEE @var{inexact-flag}.  Turning on this option causes the
14203 generated code to implement fully-compliant IEEE math.  In addition to
14204 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
14205 macro.  On some Alpha implementations the resulting code may execute
14206 significantly slower than the code generated by default.  Since there is
14207 very little code that depends on the @var{inexact-flag}, you should
14208 normally not specify this option.  Other Alpha compilers call this
14209 option @option{-ieee_with_inexact}.
14211 @item -mfp-trap-mode=@var{trap-mode}
14212 @opindex mfp-trap-mode
14213 This option controls what floating-point related traps are enabled.
14214 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
14215 The trap mode can be set to one of four values:
14217 @table @samp
14218 @item n
14219 This is the default (normal) setting.  The only traps that are enabled
14220 are the ones that cannot be disabled in software (e.g., division by zero
14221 trap).
14223 @item u
14224 In addition to the traps enabled by @samp{n}, underflow traps are enabled
14225 as well.
14227 @item su
14228 Like @samp{u}, but the instructions are marked to be safe for software
14229 completion (see Alpha architecture manual for details).
14231 @item sui
14232 Like @samp{su}, but inexact traps are enabled as well.
14233 @end table
14235 @item -mfp-rounding-mode=@var{rounding-mode}
14236 @opindex mfp-rounding-mode
14237 Selects the IEEE rounding mode.  Other Alpha compilers call this option
14238 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
14241 @table @samp
14242 @item n
14243 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
14244 the nearest machine number or towards the even machine number in case
14245 of a tie.
14247 @item m
14248 Round towards minus infinity.
14250 @item c
14251 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
14253 @item d
14254 Dynamic rounding mode.  A field in the floating-point control register
14255 (@var{fpcr}, see Alpha architecture reference manual) controls the
14256 rounding mode in effect.  The C library initializes this register for
14257 rounding towards plus infinity.  Thus, unless your program modifies the
14258 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
14259 @end table
14261 @item -mtrap-precision=@var{trap-precision}
14262 @opindex mtrap-precision
14263 In the Alpha architecture, floating-point traps are imprecise.  This
14264 means without software assistance it is impossible to recover from a
14265 floating trap and program execution normally needs to be terminated.
14266 GCC can generate code that can assist operating system trap handlers
14267 in determining the exact location that caused a floating-point trap.
14268 Depending on the requirements of an application, different levels of
14269 precisions can be selected:
14271 @table @samp
14272 @item p
14273 Program precision.  This option is the default and means a trap handler
14274 can only identify which program caused a floating-point exception.
14276 @item f
14277 Function precision.  The trap handler can determine the function that
14278 caused a floating-point exception.
14280 @item i
14281 Instruction precision.  The trap handler can determine the exact
14282 instruction that caused a floating-point exception.
14283 @end table
14285 Other Alpha compilers provide the equivalent options called
14286 @option{-scope_safe} and @option{-resumption_safe}.
14288 @item -mieee-conformant
14289 @opindex mieee-conformant
14290 This option marks the generated code as IEEE conformant.  You must not
14291 use this option unless you also specify @option{-mtrap-precision=i} and either
14292 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
14293 is to emit the line @samp{.eflag 48} in the function prologue of the
14294 generated assembly file.
14296 @item -mbuild-constants
14297 @opindex mbuild-constants
14298 Normally GCC examines a 32- or 64-bit integer constant to
14299 see if it can construct it from smaller constants in two or three
14300 instructions.  If it cannot, it outputs the constant as a literal and
14301 generates code to load it from the data segment at run time.
14303 Use this option to require GCC to construct @emph{all} integer constants
14304 using code, even if it takes more instructions (the maximum is six).
14306 You typically use this option to build a shared library dynamic
14307 loader.  Itself a shared library, it must relocate itself in memory
14308 before it can find the variables and constants in its own data segment.
14310 @item -mbwx
14311 @itemx -mno-bwx
14312 @itemx -mcix
14313 @itemx -mno-cix
14314 @itemx -mfix
14315 @itemx -mno-fix
14316 @itemx -mmax
14317 @itemx -mno-max
14318 @opindex mbwx
14319 @opindex mno-bwx
14320 @opindex mcix
14321 @opindex mno-cix
14322 @opindex mfix
14323 @opindex mno-fix
14324 @opindex mmax
14325 @opindex mno-max
14326 Indicate whether GCC should generate code to use the optional BWX,
14327 CIX, FIX and MAX instruction sets.  The default is to use the instruction
14328 sets supported by the CPU type specified via @option{-mcpu=} option or that
14329 of the CPU on which GCC was built if none is specified.
14331 @item -mfloat-vax
14332 @itemx -mfloat-ieee
14333 @opindex mfloat-vax
14334 @opindex mfloat-ieee
14335 Generate code that uses (does not use) VAX F and G floating-point
14336 arithmetic instead of IEEE single and double precision.
14338 @item -mexplicit-relocs
14339 @itemx -mno-explicit-relocs
14340 @opindex mexplicit-relocs
14341 @opindex mno-explicit-relocs
14342 Older Alpha assemblers provided no way to generate symbol relocations
14343 except via assembler macros.  Use of these macros does not allow
14344 optimal instruction scheduling.  GNU binutils as of version 2.12
14345 supports a new syntax that allows the compiler to explicitly mark
14346 which relocations should apply to which instructions.  This option
14347 is mostly useful for debugging, as GCC detects the capabilities of
14348 the assembler when it is built and sets the default accordingly.
14350 @item -msmall-data
14351 @itemx -mlarge-data
14352 @opindex msmall-data
14353 @opindex mlarge-data
14354 When @option{-mexplicit-relocs} is in effect, static data is
14355 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
14356 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
14357 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
14358 16-bit relocations off of the @code{$gp} register.  This limits the
14359 size of the small data area to 64KB, but allows the variables to be
14360 directly accessed via a single instruction.
14362 The default is @option{-mlarge-data}.  With this option the data area
14363 is limited to just below 2GB@.  Programs that require more than 2GB of
14364 data must use @code{malloc} or @code{mmap} to allocate the data in the
14365 heap instead of in the program's data segment.
14367 When generating code for shared libraries, @option{-fpic} implies
14368 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
14370 @item -msmall-text
14371 @itemx -mlarge-text
14372 @opindex msmall-text
14373 @opindex mlarge-text
14374 When @option{-msmall-text} is used, the compiler assumes that the
14375 code of the entire program (or shared library) fits in 4MB, and is
14376 thus reachable with a branch instruction.  When @option{-msmall-data}
14377 is used, the compiler can assume that all local symbols share the
14378 same @code{$gp} value, and thus reduce the number of instructions
14379 required for a function call from 4 to 1.
14381 The default is @option{-mlarge-text}.
14383 @item -mcpu=@var{cpu_type}
14384 @opindex mcpu
14385 Set the instruction set and instruction scheduling parameters for
14386 machine type @var{cpu_type}.  You can specify either the @samp{EV}
14387 style name or the corresponding chip number.  GCC supports scheduling
14388 parameters for the EV4, EV5 and EV6 family of processors and
14389 chooses the default values for the instruction set from the processor
14390 you specify.  If you do not specify a processor type, GCC defaults
14391 to the processor on which the compiler was built.
14393 Supported values for @var{cpu_type} are
14395 @table @samp
14396 @item ev4
14397 @itemx ev45
14398 @itemx 21064
14399 Schedules as an EV4 and has no instruction set extensions.
14401 @item ev5
14402 @itemx 21164
14403 Schedules as an EV5 and has no instruction set extensions.
14405 @item ev56
14406 @itemx 21164a
14407 Schedules as an EV5 and supports the BWX extension.
14409 @item pca56
14410 @itemx 21164pc
14411 @itemx 21164PC
14412 Schedules as an EV5 and supports the BWX and MAX extensions.
14414 @item ev6
14415 @itemx 21264
14416 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
14418 @item ev67
14419 @itemx 21264a
14420 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
14421 @end table
14423 Native toolchains also support the value @samp{native},
14424 which selects the best architecture option for the host processor.
14425 @option{-mcpu=native} has no effect if GCC does not recognize
14426 the processor.
14428 @item -mtune=@var{cpu_type}
14429 @opindex mtune
14430 Set only the instruction scheduling parameters for machine type
14431 @var{cpu_type}.  The instruction set is not changed.
14433 Native toolchains also support the value @samp{native},
14434 which selects the best architecture option for the host processor.
14435 @option{-mtune=native} has no effect if GCC does not recognize
14436 the processor.
14438 @item -mmemory-latency=@var{time}
14439 @opindex mmemory-latency
14440 Sets the latency the scheduler should assume for typical memory
14441 references as seen by the application.  This number is highly
14442 dependent on the memory access patterns used by the application
14443 and the size of the external cache on the machine.
14445 Valid options for @var{time} are
14447 @table @samp
14448 @item @var{number}
14449 A decimal number representing clock cycles.
14451 @item L1
14452 @itemx L2
14453 @itemx L3
14454 @itemx main
14455 The compiler contains estimates of the number of clock cycles for
14456 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
14457 (also called Dcache, Scache, and Bcache), as well as to main memory.
14458 Note that L3 is only valid for EV5.
14460 @end table
14461 @end table
14463 @node FR30 Options
14464 @subsection FR30 Options
14465 @cindex FR30 Options
14467 These options are defined specifically for the FR30 port.
14469 @table @gcctabopt
14471 @item -msmall-model
14472 @opindex msmall-model
14473 Use the small address space model.  This can produce smaller code, but
14474 it does assume that all symbolic values and addresses fit into a
14475 20-bit range.
14477 @item -mno-lsim
14478 @opindex mno-lsim
14479 Assume that runtime support has been provided and so there is no need
14480 to include the simulator library (@file{libsim.a}) on the linker
14481 command line.
14483 @end table
14485 @node FRV Options
14486 @subsection FRV Options
14487 @cindex FRV Options
14489 @table @gcctabopt
14490 @item -mgpr-32
14491 @opindex mgpr-32
14493 Only use the first 32 general-purpose registers.
14495 @item -mgpr-64
14496 @opindex mgpr-64
14498 Use all 64 general-purpose registers.
14500 @item -mfpr-32
14501 @opindex mfpr-32
14503 Use only the first 32 floating-point registers.
14505 @item -mfpr-64
14506 @opindex mfpr-64
14508 Use all 64 floating-point registers.
14510 @item -mhard-float
14511 @opindex mhard-float
14513 Use hardware instructions for floating-point operations.
14515 @item -msoft-float
14516 @opindex msoft-float
14518 Use library routines for floating-point operations.
14520 @item -malloc-cc
14521 @opindex malloc-cc
14523 Dynamically allocate condition code registers.
14525 @item -mfixed-cc
14526 @opindex mfixed-cc
14528 Do not try to dynamically allocate condition code registers, only
14529 use @code{icc0} and @code{fcc0}.
14531 @item -mdword
14532 @opindex mdword
14534 Change ABI to use double word insns.
14536 @item -mno-dword
14537 @opindex mno-dword
14539 Do not use double word instructions.
14541 @item -mdouble
14542 @opindex mdouble
14544 Use floating-point double instructions.
14546 @item -mno-double
14547 @opindex mno-double
14549 Do not use floating-point double instructions.
14551 @item -mmedia
14552 @opindex mmedia
14554 Use media instructions.
14556 @item -mno-media
14557 @opindex mno-media
14559 Do not use media instructions.
14561 @item -mmuladd
14562 @opindex mmuladd
14564 Use multiply and add/subtract instructions.
14566 @item -mno-muladd
14567 @opindex mno-muladd
14569 Do not use multiply and add/subtract instructions.
14571 @item -mfdpic
14572 @opindex mfdpic
14574 Select the FDPIC ABI, which uses function descriptors to represent
14575 pointers to functions.  Without any PIC/PIE-related options, it
14576 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
14577 assumes GOT entries and small data are within a 12-bit range from the
14578 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
14579 are computed with 32 bits.
14580 With a @samp{bfin-elf} target, this option implies @option{-msim}.
14582 @item -minline-plt
14583 @opindex minline-plt
14585 Enable inlining of PLT entries in function calls to functions that are
14586 not known to bind locally.  It has no effect without @option{-mfdpic}.
14587 It's enabled by default if optimizing for speed and compiling for
14588 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
14589 optimization option such as @option{-O3} or above is present in the
14590 command line.
14592 @item -mTLS
14593 @opindex mTLS
14595 Assume a large TLS segment when generating thread-local code.
14597 @item -mtls
14598 @opindex mtls
14600 Do not assume a large TLS segment when generating thread-local code.
14602 @item -mgprel-ro
14603 @opindex mgprel-ro
14605 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
14606 that is known to be in read-only sections.  It's enabled by default,
14607 except for @option{-fpic} or @option{-fpie}: even though it may help
14608 make the global offset table smaller, it trades 1 instruction for 4.
14609 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
14610 one of which may be shared by multiple symbols, and it avoids the need
14611 for a GOT entry for the referenced symbol, so it's more likely to be a
14612 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
14614 @item -multilib-library-pic
14615 @opindex multilib-library-pic
14617 Link with the (library, not FD) pic libraries.  It's implied by
14618 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
14619 @option{-fpic} without @option{-mfdpic}.  You should never have to use
14620 it explicitly.
14622 @item -mlinked-fp
14623 @opindex mlinked-fp
14625 Follow the EABI requirement of always creating a frame pointer whenever
14626 a stack frame is allocated.  This option is enabled by default and can
14627 be disabled with @option{-mno-linked-fp}.
14629 @item -mlong-calls
14630 @opindex mlong-calls
14632 Use indirect addressing to call functions outside the current
14633 compilation unit.  This allows the functions to be placed anywhere
14634 within the 32-bit address space.
14636 @item -malign-labels
14637 @opindex malign-labels
14639 Try to align labels to an 8-byte boundary by inserting NOPs into the
14640 previous packet.  This option only has an effect when VLIW packing
14641 is enabled.  It doesn't create new packets; it merely adds NOPs to
14642 existing ones.
14644 @item -mlibrary-pic
14645 @opindex mlibrary-pic
14647 Generate position-independent EABI code.
14649 @item -macc-4
14650 @opindex macc-4
14652 Use only the first four media accumulator registers.
14654 @item -macc-8
14655 @opindex macc-8
14657 Use all eight media accumulator registers.
14659 @item -mpack
14660 @opindex mpack
14662 Pack VLIW instructions.
14664 @item -mno-pack
14665 @opindex mno-pack
14667 Do not pack VLIW instructions.
14669 @item -mno-eflags
14670 @opindex mno-eflags
14672 Do not mark ABI switches in e_flags.
14674 @item -mcond-move
14675 @opindex mcond-move
14677 Enable the use of conditional-move instructions (default).
14679 This switch is mainly for debugging the compiler and will likely be removed
14680 in a future version.
14682 @item -mno-cond-move
14683 @opindex mno-cond-move
14685 Disable the use of conditional-move instructions.
14687 This switch is mainly for debugging the compiler and will likely be removed
14688 in a future version.
14690 @item -mscc
14691 @opindex mscc
14693 Enable the use of conditional set instructions (default).
14695 This switch is mainly for debugging the compiler and will likely be removed
14696 in a future version.
14698 @item -mno-scc
14699 @opindex mno-scc
14701 Disable the use of conditional set instructions.
14703 This switch is mainly for debugging the compiler and will likely be removed
14704 in a future version.
14706 @item -mcond-exec
14707 @opindex mcond-exec
14709 Enable the use of conditional execution (default).
14711 This switch is mainly for debugging the compiler and will likely be removed
14712 in a future version.
14714 @item -mno-cond-exec
14715 @opindex mno-cond-exec
14717 Disable the use of conditional execution.
14719 This switch is mainly for debugging the compiler and will likely be removed
14720 in a future version.
14722 @item -mvliw-branch
14723 @opindex mvliw-branch
14725 Run a pass to pack branches into VLIW instructions (default).
14727 This switch is mainly for debugging the compiler and will likely be removed
14728 in a future version.
14730 @item -mno-vliw-branch
14731 @opindex mno-vliw-branch
14733 Do not run a pass to pack branches into VLIW instructions.
14735 This switch is mainly for debugging the compiler and will likely be removed
14736 in a future version.
14738 @item -mmulti-cond-exec
14739 @opindex mmulti-cond-exec
14741 Enable optimization of @code{&&} and @code{||} in conditional execution
14742 (default).
14744 This switch is mainly for debugging the compiler and will likely be removed
14745 in a future version.
14747 @item -mno-multi-cond-exec
14748 @opindex mno-multi-cond-exec
14750 Disable optimization of @code{&&} and @code{||} in conditional execution.
14752 This switch is mainly for debugging the compiler and will likely be removed
14753 in a future version.
14755 @item -mnested-cond-exec
14756 @opindex mnested-cond-exec
14758 Enable nested conditional execution optimizations (default).
14760 This switch is mainly for debugging the compiler and will likely be removed
14761 in a future version.
14763 @item -mno-nested-cond-exec
14764 @opindex mno-nested-cond-exec
14766 Disable nested conditional execution optimizations.
14768 This switch is mainly for debugging the compiler and will likely be removed
14769 in a future version.
14771 @item -moptimize-membar
14772 @opindex moptimize-membar
14774 This switch removes redundant @code{membar} instructions from the
14775 compiler-generated code.  It is enabled by default.
14777 @item -mno-optimize-membar
14778 @opindex mno-optimize-membar
14780 This switch disables the automatic removal of redundant @code{membar}
14781 instructions from the generated code.
14783 @item -mtomcat-stats
14784 @opindex mtomcat-stats
14786 Cause gas to print out tomcat statistics.
14788 @item -mcpu=@var{cpu}
14789 @opindex mcpu
14791 Select the processor type for which to generate code.  Possible values are
14792 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
14793 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
14795 @end table
14797 @node GNU/Linux Options
14798 @subsection GNU/Linux Options
14800 These @samp{-m} options are defined for GNU/Linux targets:
14802 @table @gcctabopt
14803 @item -mglibc
14804 @opindex mglibc
14805 Use the GNU C library.  This is the default except
14806 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
14808 @item -muclibc
14809 @opindex muclibc
14810 Use uClibc C library.  This is the default on
14811 @samp{*-*-linux-*uclibc*} targets.
14813 @item -mbionic
14814 @opindex mbionic
14815 Use Bionic C library.  This is the default on
14816 @samp{*-*-linux-*android*} targets.
14818 @item -mandroid
14819 @opindex mandroid
14820 Compile code compatible with Android platform.  This is the default on
14821 @samp{*-*-linux-*android*} targets.
14823 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
14824 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
14825 this option makes the GCC driver pass Android-specific options to the linker.
14826 Finally, this option causes the preprocessor macro @code{__ANDROID__}
14827 to be defined.
14829 @item -tno-android-cc
14830 @opindex tno-android-cc
14831 Disable compilation effects of @option{-mandroid}, i.e., do not enable
14832 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
14833 @option{-fno-rtti} by default.
14835 @item -tno-android-ld
14836 @opindex tno-android-ld
14837 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
14838 linking options to the linker.
14840 @end table
14842 @node H8/300 Options
14843 @subsection H8/300 Options
14845 These @samp{-m} options are defined for the H8/300 implementations:
14847 @table @gcctabopt
14848 @item -mrelax
14849 @opindex mrelax
14850 Shorten some address references at link time, when possible; uses the
14851 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
14852 ld, Using ld}, for a fuller description.
14854 @item -mh
14855 @opindex mh
14856 Generate code for the H8/300H@.
14858 @item -ms
14859 @opindex ms
14860 Generate code for the H8S@.
14862 @item -mn
14863 @opindex mn
14864 Generate code for the H8S and H8/300H in the normal mode.  This switch
14865 must be used either with @option{-mh} or @option{-ms}.
14867 @item -ms2600
14868 @opindex ms2600
14869 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
14871 @item -mexr
14872 @opindex mexr
14873 Extended registers are stored on stack before execution of function
14874 with monitor attribute. Default option is @option{-mexr}.
14875 This option is valid only for H8S targets.
14877 @item -mno-exr
14878 @opindex mno-exr
14879 Extended registers are not stored on stack before execution of function 
14880 with monitor attribute. Default option is @option{-mno-exr}. 
14881 This option is valid only for H8S targets.
14883 @item -mint32
14884 @opindex mint32
14885 Make @code{int} data 32 bits by default.
14887 @item -malign-300
14888 @opindex malign-300
14889 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
14890 The default for the H8/300H and H8S is to align longs and floats on
14891 4-byte boundaries.
14892 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
14893 This option has no effect on the H8/300.
14894 @end table
14896 @node HPPA Options
14897 @subsection HPPA Options
14898 @cindex HPPA Options
14900 These @samp{-m} options are defined for the HPPA family of computers:
14902 @table @gcctabopt
14903 @item -march=@var{architecture-type}
14904 @opindex march
14905 Generate code for the specified architecture.  The choices for
14906 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
14907 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
14908 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
14909 architecture option for your machine.  Code compiled for lower numbered
14910 architectures runs on higher numbered architectures, but not the
14911 other way around.
14913 @item -mpa-risc-1-0
14914 @itemx -mpa-risc-1-1
14915 @itemx -mpa-risc-2-0
14916 @opindex mpa-risc-1-0
14917 @opindex mpa-risc-1-1
14918 @opindex mpa-risc-2-0
14919 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
14921 @item -mjump-in-delay
14922 @opindex mjump-in-delay
14923 This option is ignored and provided for compatibility purposes only.
14925 @item -mdisable-fpregs
14926 @opindex mdisable-fpregs
14927 Prevent floating-point registers from being used in any manner.  This is
14928 necessary for compiling kernels that perform lazy context switching of
14929 floating-point registers.  If you use this option and attempt to perform
14930 floating-point operations, the compiler aborts.
14932 @item -mdisable-indexing
14933 @opindex mdisable-indexing
14934 Prevent the compiler from using indexing address modes.  This avoids some
14935 rather obscure problems when compiling MIG generated code under MACH@.
14937 @item -mno-space-regs
14938 @opindex mno-space-regs
14939 Generate code that assumes the target has no space registers.  This allows
14940 GCC to generate faster indirect calls and use unscaled index address modes.
14942 Such code is suitable for level 0 PA systems and kernels.
14944 @item -mfast-indirect-calls
14945 @opindex mfast-indirect-calls
14946 Generate code that assumes calls never cross space boundaries.  This
14947 allows GCC to emit code that performs faster indirect calls.
14949 This option does not work in the presence of shared libraries or nested
14950 functions.
14952 @item -mfixed-range=@var{register-range}
14953 @opindex mfixed-range
14954 Generate code treating the given register range as fixed registers.
14955 A fixed register is one that the register allocator cannot use.  This is
14956 useful when compiling kernel code.  A register range is specified as
14957 two registers separated by a dash.  Multiple register ranges can be
14958 specified separated by a comma.
14960 @item -mlong-load-store
14961 @opindex mlong-load-store
14962 Generate 3-instruction load and store sequences as sometimes required by
14963 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
14964 the HP compilers.
14966 @item -mportable-runtime
14967 @opindex mportable-runtime
14968 Use the portable calling conventions proposed by HP for ELF systems.
14970 @item -mgas
14971 @opindex mgas
14972 Enable the use of assembler directives only GAS understands.
14974 @item -mschedule=@var{cpu-type}
14975 @opindex mschedule
14976 Schedule code according to the constraints for the machine type
14977 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
14978 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
14979 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
14980 proper scheduling option for your machine.  The default scheduling is
14981 @samp{8000}.
14983 @item -mlinker-opt
14984 @opindex mlinker-opt
14985 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
14986 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
14987 linkers in which they give bogus error messages when linking some programs.
14989 @item -msoft-float
14990 @opindex msoft-float
14991 Generate output containing library calls for floating point.
14992 @strong{Warning:} the requisite libraries are not available for all HPPA
14993 targets.  Normally the facilities of the machine's usual C compiler are
14994 used, but this cannot be done directly in cross-compilation.  You must make
14995 your own arrangements to provide suitable library functions for
14996 cross-compilation.
14998 @option{-msoft-float} changes the calling convention in the output file;
14999 therefore, it is only useful if you compile @emph{all} of a program with
15000 this option.  In particular, you need to compile @file{libgcc.a}, the
15001 library that comes with GCC, with @option{-msoft-float} in order for
15002 this to work.
15004 @item -msio
15005 @opindex msio
15006 Generate the predefine, @code{_SIO}, for server IO@.  The default is
15007 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
15008 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
15009 options are available under HP-UX and HI-UX@.
15011 @item -mgnu-ld
15012 @opindex mgnu-ld
15013 Use options specific to GNU @command{ld}.
15014 This passes @option{-shared} to @command{ld} when
15015 building a shared library.  It is the default when GCC is configured,
15016 explicitly or implicitly, with the GNU linker.  This option does not
15017 affect which @command{ld} is called; it only changes what parameters
15018 are passed to that @command{ld}.
15019 The @command{ld} that is called is determined by the
15020 @option{--with-ld} configure option, GCC's program search path, and
15021 finally by the user's @env{PATH}.  The linker used by GCC can be printed
15022 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
15023 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
15025 @item -mhp-ld
15026 @opindex mhp-ld
15027 Use options specific to HP @command{ld}.
15028 This passes @option{-b} to @command{ld} when building
15029 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
15030 links.  It is the default when GCC is configured, explicitly or
15031 implicitly, with the HP linker.  This option does not affect
15032 which @command{ld} is called; it only changes what parameters are passed to that
15033 @command{ld}.
15034 The @command{ld} that is called is determined by the @option{--with-ld}
15035 configure option, GCC's program search path, and finally by the user's
15036 @env{PATH}.  The linker used by GCC can be printed using @samp{which
15037 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
15038 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
15040 @item -mlong-calls
15041 @opindex mno-long-calls
15042 Generate code that uses long call sequences.  This ensures that a call
15043 is always able to reach linker generated stubs.  The default is to generate
15044 long calls only when the distance from the call site to the beginning
15045 of the function or translation unit, as the case may be, exceeds a
15046 predefined limit set by the branch type being used.  The limits for
15047 normal calls are 7,600,000 and 240,000 bytes, respectively for the
15048 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
15049 240,000 bytes.
15051 Distances are measured from the beginning of functions when using the
15052 @option{-ffunction-sections} option, or when using the @option{-mgas}
15053 and @option{-mno-portable-runtime} options together under HP-UX with
15054 the SOM linker.
15056 It is normally not desirable to use this option as it degrades
15057 performance.  However, it may be useful in large applications,
15058 particularly when partial linking is used to build the application.
15060 The types of long calls used depends on the capabilities of the
15061 assembler and linker, and the type of code being generated.  The
15062 impact on systems that support long absolute calls, and long pic
15063 symbol-difference or pc-relative calls should be relatively small.
15064 However, an indirect call is used on 32-bit ELF systems in pic code
15065 and it is quite long.
15067 @item -munix=@var{unix-std}
15068 @opindex march
15069 Generate compiler predefines and select a startfile for the specified
15070 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
15071 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
15072 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
15073 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
15074 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
15075 and later.
15077 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
15078 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
15079 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
15080 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
15081 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
15082 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
15084 It is @emph{important} to note that this option changes the interfaces
15085 for various library routines.  It also affects the operational behavior
15086 of the C library.  Thus, @emph{extreme} care is needed in using this
15087 option.
15089 Library code that is intended to operate with more than one UNIX
15090 standard must test, set and restore the variable @var{__xpg4_extended_mask}
15091 as appropriate.  Most GNU software doesn't provide this capability.
15093 @item -nolibdld
15094 @opindex nolibdld
15095 Suppress the generation of link options to search libdld.sl when the
15096 @option{-static} option is specified on HP-UX 10 and later.
15098 @item -static
15099 @opindex static
15100 The HP-UX implementation of setlocale in libc has a dependency on
15101 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
15102 when the @option{-static} option is specified, special link options
15103 are needed to resolve this dependency.
15105 On HP-UX 10 and later, the GCC driver adds the necessary options to
15106 link with libdld.sl when the @option{-static} option is specified.
15107 This causes the resulting binary to be dynamic.  On the 64-bit port,
15108 the linkers generate dynamic binaries by default in any case.  The
15109 @option{-nolibdld} option can be used to prevent the GCC driver from
15110 adding these link options.
15112 @item -threads
15113 @opindex threads
15114 Add support for multithreading with the @dfn{dce thread} library
15115 under HP-UX@.  This option sets flags for both the preprocessor and
15116 linker.
15117 @end table
15119 @node i386 and x86-64 Options
15120 @subsection Intel 386 and AMD x86-64 Options
15121 @cindex i386 Options
15122 @cindex x86-64 Options
15123 @cindex Intel 386 Options
15124 @cindex AMD x86-64 Options
15126 These @samp{-m} options are defined for the i386 and x86-64 family of
15127 computers:
15129 @table @gcctabopt
15131 @item -march=@var{cpu-type}
15132 @opindex march
15133 Generate instructions for the machine type @var{cpu-type}.  In contrast to
15134 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
15135 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
15136 to generate code that may not run at all on processors other than the one
15137 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
15138 @option{-mtune=@var{cpu-type}}.
15140 The choices for @var{cpu-type} are:
15142 @table @samp
15143 @item native
15144 This selects the CPU to generate code for at compilation time by determining
15145 the processor type of the compiling machine.  Using @option{-march=native}
15146 enables all instruction subsets supported by the local machine (hence
15147 the result might not run on different machines).  Using @option{-mtune=native}
15148 produces code optimized for the local machine under the constraints
15149 of the selected instruction set.  
15151 @item i386
15152 Original Intel i386 CPU@.
15154 @item i486
15155 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
15157 @item i586
15158 @itemx pentium
15159 Intel Pentium CPU with no MMX support.
15161 @item pentium-mmx
15162 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
15164 @item pentiumpro
15165 Intel Pentium Pro CPU@.
15167 @item i686
15168 When used with @option{-march}, the Pentium Pro
15169 instruction set is used, so the code runs on all i686 family chips.
15170 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
15172 @item pentium2
15173 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
15174 support.
15176 @item pentium3
15177 @itemx pentium3m
15178 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
15179 set support.
15181 @item pentium-m
15182 Intel Pentium M; low-power version of Intel Pentium III CPU
15183 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
15185 @item pentium4
15186 @itemx pentium4m
15187 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
15189 @item prescott
15190 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
15191 set support.
15193 @item nocona
15194 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
15195 SSE2 and SSE3 instruction set support.
15197 @item core2
15198 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
15199 instruction set support.
15201 @item nehalem
15202 Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
15203 SSE4.1, SSE4.2 and POPCNT instruction set support.
15205 @item westmere
15206 Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
15207 SSE4.1, SSE4.2, POPCNT, AES and PCLMUL instruction set support.
15209 @item sandybridge
15210 Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
15211 SSE4.1, SSE4.2, POPCNT, AVX, AES and PCLMUL instruction set support.
15213 @item ivybridge
15214 Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
15215 SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C
15216 instruction set support.
15218 @item haswell
15219 Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
15220 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
15221 BMI, BMI2 and F16C instruction set support.
15223 @item broadwell
15224 Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
15225 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
15226 BMI, BMI2, F16C, RDSEED, ADCX and PREFETCHW instruction set support.
15228 @item bonnell
15229 Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
15230 instruction set support.
15232 @item silvermont
15233 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
15234 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL and RDRND instruction set support.
15236 @item k6
15237 AMD K6 CPU with MMX instruction set support.
15239 @item k6-2
15240 @itemx k6-3
15241 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
15243 @item athlon
15244 @itemx athlon-tbird
15245 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
15246 support.
15248 @item athlon-4
15249 @itemx athlon-xp
15250 @itemx athlon-mp
15251 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
15252 instruction set support.
15254 @item k8
15255 @itemx opteron
15256 @itemx athlon64
15257 @itemx athlon-fx
15258 Processors based on the AMD K8 core with x86-64 instruction set support,
15259 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
15260 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
15261 instruction set extensions.)
15263 @item k8-sse3
15264 @itemx opteron-sse3
15265 @itemx athlon64-sse3
15266 Improved versions of AMD K8 cores with SSE3 instruction set support.
15268 @item amdfam10
15269 @itemx barcelona
15270 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
15271 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
15272 instruction set extensions.)
15274 @item bdver1
15275 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
15276 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
15277 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
15278 @item bdver2
15279 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
15280 supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX,
15281 SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
15282 extensions.)
15283 @item bdver3
15284 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
15285 supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, XOP, LWP, AES, 
15286 PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 
15287 64-bit instruction set extensions.
15288 @item bdver4
15289 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
15290 supersets BMI, BMI2, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, AVX2, XOP, LWP, 
15291 AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, 
15292 SSE4.2, ABM and 64-bit instruction set extensions.
15294 @item btver1
15295 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
15296 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
15297 instruction set extensions.)
15299 @item btver2
15300 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
15301 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
15302 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
15304 @item winchip-c6
15305 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
15306 set support.
15308 @item winchip2
15309 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
15310 instruction set support.
15312 @item c3
15313 VIA C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
15314 implemented for this chip.)
15316 @item c3-2
15317 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
15318 (No scheduling is
15319 implemented for this chip.)
15321 @item geode
15322 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
15323 @end table
15325 @item -mtune=@var{cpu-type}
15326 @opindex mtune
15327 Tune to @var{cpu-type} everything applicable about the generated code, except
15328 for the ABI and the set of available instructions.  
15329 While picking a specific @var{cpu-type} schedules things appropriately
15330 for that particular chip, the compiler does not generate any code that
15331 cannot run on the default machine type unless you use a
15332 @option{-march=@var{cpu-type}} option.
15333 For example, if GCC is configured for i686-pc-linux-gnu
15334 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
15335 but still runs on i686 machines.
15337 The choices for @var{cpu-type} are the same as for @option{-march}.
15338 In addition, @option{-mtune} supports 2 extra choices for @var{cpu-type}:
15340 @table @samp
15341 @item generic
15342 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
15343 If you know the CPU on which your code will run, then you should use
15344 the corresponding @option{-mtune} or @option{-march} option instead of
15345 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
15346 of your application will have, then you should use this option.
15348 As new processors are deployed in the marketplace, the behavior of this
15349 option will change.  Therefore, if you upgrade to a newer version of
15350 GCC, code generation controlled by this option will change to reflect
15351 the processors
15352 that are most common at the time that version of GCC is released.
15354 There is no @option{-march=generic} option because @option{-march}
15355 indicates the instruction set the compiler can use, and there is no
15356 generic instruction set applicable to all processors.  In contrast,
15357 @option{-mtune} indicates the processor (or, in this case, collection of
15358 processors) for which the code is optimized.
15360 @item intel
15361 Produce code optimized for the most current Intel processors, which are
15362 Haswell and Silvermont for this version of GCC.  If you know the CPU
15363 on which your code will run, then you should use the corresponding
15364 @option{-mtune} or @option{-march} option instead of @option{-mtune=intel}.
15365 But, if you want your application performs better on both Haswell and
15366 Silvermont, then you should use this option.
15368 As new Intel processors are deployed in the marketplace, the behavior of
15369 this option will change.  Therefore, if you upgrade to a newer version of
15370 GCC, code generation controlled by this option will change to reflect
15371 the most current Intel processors at the time that version of GCC is
15372 released.
15374 There is no @option{-march=intel} option because @option{-march} indicates
15375 the instruction set the compiler can use, and there is no common
15376 instruction set applicable to all processors.  In contrast,
15377 @option{-mtune} indicates the processor (or, in this case, collection of
15378 processors) for which the code is optimized.
15379 @end table
15381 @item -mcpu=@var{cpu-type}
15382 @opindex mcpu
15383 A deprecated synonym for @option{-mtune}.
15385 @item -mfpmath=@var{unit}
15386 @opindex mfpmath
15387 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
15388 for @var{unit} are:
15390 @table @samp
15391 @item 387
15392 Use the standard 387 floating-point coprocessor present on the majority of chips and
15393 emulated otherwise.  Code compiled with this option runs almost everywhere.
15394 The temporary results are computed in 80-bit precision instead of the precision
15395 specified by the type, resulting in slightly different results compared to most
15396 of other chips.  See @option{-ffloat-store} for more detailed description.
15398 This is the default choice for i386 compiler.
15400 @item sse
15401 Use scalar floating-point instructions present in the SSE instruction set.
15402 This instruction set is supported by Pentium III and newer chips,
15403 and in the AMD line
15404 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
15405 instruction set supports only single-precision arithmetic, thus the double and
15406 extended-precision arithmetic are still done using 387.  A later version, present
15407 only in Pentium 4 and AMD x86-64 chips, supports double-precision
15408 arithmetic too.
15410 For the i386 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
15411 or @option{-msse2} switches to enable SSE extensions and make this option
15412 effective.  For the x86-64 compiler, these extensions are enabled by default.
15414 The resulting code should be considerably faster in the majority of cases and avoid
15415 the numerical instability problems of 387 code, but may break some existing
15416 code that expects temporaries to be 80 bits.
15418 This is the default choice for the x86-64 compiler.
15420 @item sse,387
15421 @itemx sse+387
15422 @itemx both
15423 Attempt to utilize both instruction sets at once.  This effectively doubles the
15424 amount of available registers, and on chips with separate execution units for
15425 387 and SSE the execution resources too.  Use this option with care, as it is
15426 still experimental, because the GCC register allocator does not model separate
15427 functional units well, resulting in unstable performance.
15428 @end table
15430 @item -masm=@var{dialect}
15431 @opindex masm=@var{dialect}
15432 Output assembly instructions using selected @var{dialect}.  Supported
15433 choices are @samp{intel} or @samp{att} (the default).  Darwin does
15434 not support @samp{intel}.
15436 @item -mieee-fp
15437 @itemx -mno-ieee-fp
15438 @opindex mieee-fp
15439 @opindex mno-ieee-fp
15440 Control whether or not the compiler uses IEEE floating-point
15441 comparisons.  These correctly handle the case where the result of a
15442 comparison is unordered.
15444 @item -msoft-float
15445 @opindex msoft-float
15446 Generate output containing library calls for floating point.
15448 @strong{Warning:} the requisite libraries are not part of GCC@.
15449 Normally the facilities of the machine's usual C compiler are used, but
15450 this can't be done directly in cross-compilation.  You must make your
15451 own arrangements to provide suitable library functions for
15452 cross-compilation.
15454 On machines where a function returns floating-point results in the 80387
15455 register stack, some floating-point opcodes may be emitted even if
15456 @option{-msoft-float} is used.
15458 @item -mno-fp-ret-in-387
15459 @opindex mno-fp-ret-in-387
15460 Do not use the FPU registers for return values of functions.
15462 The usual calling convention has functions return values of types
15463 @code{float} and @code{double} in an FPU register, even if there
15464 is no FPU@.  The idea is that the operating system should emulate
15465 an FPU@.
15467 The option @option{-mno-fp-ret-in-387} causes such values to be returned
15468 in ordinary CPU registers instead.
15470 @item -mno-fancy-math-387
15471 @opindex mno-fancy-math-387
15472 Some 387 emulators do not support the @code{sin}, @code{cos} and
15473 @code{sqrt} instructions for the 387.  Specify this option to avoid
15474 generating those instructions.  This option is the default on FreeBSD,
15475 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
15476 indicates that the target CPU always has an FPU and so the
15477 instruction does not need emulation.  These
15478 instructions are not generated unless you also use the
15479 @option{-funsafe-math-optimizations} switch.
15481 @item -malign-double
15482 @itemx -mno-align-double
15483 @opindex malign-double
15484 @opindex mno-align-double
15485 Control whether GCC aligns @code{double}, @code{long double}, and
15486 @code{long long} variables on a two-word boundary or a one-word
15487 boundary.  Aligning @code{double} variables on a two-word boundary
15488 produces code that runs somewhat faster on a Pentium at the
15489 expense of more memory.
15491 On x86-64, @option{-malign-double} is enabled by default.
15493 @strong{Warning:} if you use the @option{-malign-double} switch,
15494 structures containing the above types are aligned differently than
15495 the published application binary interface specifications for the 386
15496 and are not binary compatible with structures in code compiled
15497 without that switch.
15499 @item -m96bit-long-double
15500 @itemx -m128bit-long-double
15501 @opindex m96bit-long-double
15502 @opindex m128bit-long-double
15503 These switches control the size of @code{long double} type.  The i386
15504 application binary interface specifies the size to be 96 bits,
15505 so @option{-m96bit-long-double} is the default in 32-bit mode.
15507 Modern architectures (Pentium and newer) prefer @code{long double}
15508 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
15509 conforming to the ABI, this is not possible.  So specifying
15510 @option{-m128bit-long-double} aligns @code{long double}
15511 to a 16-byte boundary by padding the @code{long double} with an additional
15512 32-bit zero.
15514 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
15515 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
15517 Notice that neither of these options enable any extra precision over the x87
15518 standard of 80 bits for a @code{long double}.
15520 @strong{Warning:} if you override the default value for your target ABI, this
15521 changes the size of 
15522 structures and arrays containing @code{long double} variables,
15523 as well as modifying the function calling convention for functions taking
15524 @code{long double}.  Hence they are not binary-compatible
15525 with code compiled without that switch.
15527 @item -mlong-double-64
15528 @itemx -mlong-double-80
15529 @itemx -mlong-double-128
15530 @opindex mlong-double-64
15531 @opindex mlong-double-80
15532 @opindex mlong-double-128
15533 These switches control the size of @code{long double} type. A size
15534 of 64 bits makes the @code{long double} type equivalent to the @code{double}
15535 type. This is the default for 32-bit Bionic C library.  A size
15536 of 128 bits makes the @code{long double} type equivalent to the
15537 @code{__float128} type. This is the default for 64-bit Bionic C library.
15539 @strong{Warning:} if you override the default value for your target ABI, this
15540 changes the size of
15541 structures and arrays containing @code{long double} variables,
15542 as well as modifying the function calling convention for functions taking
15543 @code{long double}.  Hence they are not binary-compatible
15544 with code compiled without that switch.
15546 @item -mlarge-data-threshold=@var{threshold}
15547 @opindex mlarge-data-threshold
15548 When @option{-mcmodel=medium} is specified, data objects larger than
15549 @var{threshold} are placed in the large data section.  This value must be the
15550 same across all objects linked into the binary, and defaults to 65535.
15552 @item -mrtd
15553 @opindex mrtd
15554 Use a different function-calling convention, in which functions that
15555 take a fixed number of arguments return with the @code{ret @var{num}}
15556 instruction, which pops their arguments while returning.  This saves one
15557 instruction in the caller since there is no need to pop the arguments
15558 there.
15560 You can specify that an individual function is called with this calling
15561 sequence with the function attribute @samp{stdcall}.  You can also
15562 override the @option{-mrtd} option by using the function attribute
15563 @samp{cdecl}.  @xref{Function Attributes}.
15565 @strong{Warning:} this calling convention is incompatible with the one
15566 normally used on Unix, so you cannot use it if you need to call
15567 libraries compiled with the Unix compiler.
15569 Also, you must provide function prototypes for all functions that
15570 take variable numbers of arguments (including @code{printf});
15571 otherwise incorrect code is generated for calls to those
15572 functions.
15574 In addition, seriously incorrect code results if you call a
15575 function with too many arguments.  (Normally, extra arguments are
15576 harmlessly ignored.)
15578 @item -mregparm=@var{num}
15579 @opindex mregparm
15580 Control how many registers are used to pass integer arguments.  By
15581 default, no registers are used to pass arguments, and at most 3
15582 registers can be used.  You can control this behavior for a specific
15583 function by using the function attribute @samp{regparm}.
15584 @xref{Function Attributes}.
15586 @strong{Warning:} if you use this switch, and
15587 @var{num} is nonzero, then you must build all modules with the same
15588 value, including any libraries.  This includes the system libraries and
15589 startup modules.
15591 @item -msseregparm
15592 @opindex msseregparm
15593 Use SSE register passing conventions for float and double arguments
15594 and return values.  You can control this behavior for a specific
15595 function by using the function attribute @samp{sseregparm}.
15596 @xref{Function Attributes}.
15598 @strong{Warning:} if you use this switch then you must build all
15599 modules with the same value, including any libraries.  This includes
15600 the system libraries and startup modules.
15602 @item -mvect8-ret-in-mem
15603 @opindex mvect8-ret-in-mem
15604 Return 8-byte vectors in memory instead of MMX registers.  This is the
15605 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
15606 Studio compilers until version 12.  Later compiler versions (starting
15607 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
15608 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
15609 you need to remain compatible with existing code produced by those
15610 previous compiler versions or older versions of GCC@.
15612 @item -mpc32
15613 @itemx -mpc64
15614 @itemx -mpc80
15615 @opindex mpc32
15616 @opindex mpc64
15617 @opindex mpc80
15619 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
15620 is specified, the significands of results of floating-point operations are
15621 rounded to 24 bits (single precision); @option{-mpc64} rounds the
15622 significands of results of floating-point operations to 53 bits (double
15623 precision) and @option{-mpc80} rounds the significands of results of
15624 floating-point operations to 64 bits (extended double precision), which is
15625 the default.  When this option is used, floating-point operations in higher
15626 precisions are not available to the programmer without setting the FPU
15627 control word explicitly.
15629 Setting the rounding of floating-point operations to less than the default
15630 80 bits can speed some programs by 2% or more.  Note that some mathematical
15631 libraries assume that extended-precision (80-bit) floating-point operations
15632 are enabled by default; routines in such libraries could suffer significant
15633 loss of accuracy, typically through so-called ``catastrophic cancellation'',
15634 when this option is used to set the precision to less than extended precision.
15636 @item -mstackrealign
15637 @opindex mstackrealign
15638 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
15639 option generates an alternate prologue and epilogue that realigns the
15640 run-time stack if necessary.  This supports mixing legacy codes that keep
15641 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
15642 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
15643 applicable to individual functions.
15645 @item -mpreferred-stack-boundary=@var{num}
15646 @opindex mpreferred-stack-boundary
15647 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
15648 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
15649 the default is 4 (16 bytes or 128 bits).
15651 @strong{Warning:} When generating code for the x86-64 architecture with
15652 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
15653 used to keep the stack boundary aligned to 8 byte boundary.  Since
15654 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
15655 intended to be used in controlled environment where stack space is
15656 important limitation.  This option will lead to wrong code when functions
15657 compiled with 16 byte stack alignment (such as functions from a standard
15658 library) are called with misaligned stack.  In this case, SSE
15659 instructions may lead to misaligned memory access traps.  In addition,
15660 variable arguments will be handled incorrectly for 16 byte aligned
15661 objects (including x87 long double and __int128), leading to wrong
15662 results.  You must build all modules with
15663 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
15664 includes the system libraries and startup modules.
15666 @item -mincoming-stack-boundary=@var{num}
15667 @opindex mincoming-stack-boundary
15668 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
15669 boundary.  If @option{-mincoming-stack-boundary} is not specified,
15670 the one specified by @option{-mpreferred-stack-boundary} is used.
15672 On Pentium and Pentium Pro, @code{double} and @code{long double} values
15673 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
15674 suffer significant run time performance penalties.  On Pentium III, the
15675 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
15676 properly if it is not 16-byte aligned.
15678 To ensure proper alignment of this values on the stack, the stack boundary
15679 must be as aligned as that required by any value stored on the stack.
15680 Further, every function must be generated such that it keeps the stack
15681 aligned.  Thus calling a function compiled with a higher preferred
15682 stack boundary from a function compiled with a lower preferred stack
15683 boundary most likely misaligns the stack.  It is recommended that
15684 libraries that use callbacks always use the default setting.
15686 This extra alignment does consume extra stack space, and generally
15687 increases code size.  Code that is sensitive to stack space usage, such
15688 as embedded systems and operating system kernels, may want to reduce the
15689 preferred alignment to @option{-mpreferred-stack-boundary=2}.
15691 @item -mmmx
15692 @itemx -mno-mmx
15693 @itemx -msse
15694 @itemx -mno-sse
15695 @itemx -msse2
15696 @itemx -mno-sse2
15697 @itemx -msse3
15698 @itemx -mno-sse3
15699 @itemx -mssse3
15700 @itemx -mno-ssse3
15701 @itemx -msse4.1
15702 @need 800
15703 @itemx -mno-sse4.1
15704 @itemx -msse4.2
15705 @itemx -mno-sse4.2
15706 @itemx -msse4
15707 @itemx -mno-sse4
15708 @itemx -mavx
15709 @itemx -mno-avx
15710 @itemx -mavx2
15711 @itemx -mno-avx2
15712 @itemx -mavx512f
15713 @itemx -mno-avx512f
15714 @need 800
15715 @itemx -mavx512pf
15716 @itemx -mno-avx512pf
15717 @itemx -mavx512er
15718 @itemx -mno-avx512er
15719 @itemx -mavx512cd
15720 @itemx -mno-avx512cd
15721 @itemx -msha
15722 @itemx -mno-sha
15723 @itemx -maes
15724 @itemx -mno-aes
15725 @itemx -mpclmul
15726 @itemx -mno-pclmul
15727 @itemx -mclfushopt
15728 @itemx -mno-clflsuhopt
15729 @need 800
15730 @itemx -mfsgsbase
15731 @itemx -mno-fsgsbase
15732 @itemx -mrdrnd
15733 @itemx -mno-rdrnd
15734 @itemx -mf16c
15735 @itemx -mno-f16c
15736 @itemx -mfma
15737 @itemx -mno-fma
15738 @itemx -mprefetchwt1
15739 @itemx -mno-prefetchwt1
15740 @itemx -msse4a
15741 @itemx -mno-sse4a
15742 @itemx -mfma4
15743 @itemx -mno-fma4
15744 @need 800
15745 @itemx -mxop
15746 @itemx -mno-xop
15747 @itemx -mlwp
15748 @itemx -mno-lwp
15749 @itemx -m3dnow
15750 @itemx -mno-3dnow
15751 @itemx -mpopcnt
15752 @itemx -mno-popcnt
15753 @itemx -mabm
15754 @itemx -mno-abm
15755 @itemx -mbmi
15756 @itemx -mbmi2
15757 @itemx -mno-bmi
15758 @itemx -mno-bmi2
15759 @itemx -mlzcnt
15760 @itemx -mno-lzcnt
15761 @itemx -mfxsr
15762 @itemx -mxsave
15763 @itemx -mxsaveopt
15764 @itemx -mrtm
15765 @itemx -mtbm
15766 @itemx -mno-tbm
15767 @itemx -mxsavec
15768 @itemx -mno-xsavec
15769 @itemx -mxsaves
15770 @itemx -mno-xsaves
15771 @opindex mmmx
15772 @opindex mno-mmx
15773 @opindex msse
15774 @opindex mno-sse
15775 @opindex m3dnow
15776 @opindex mno-3dnow
15777 These switches enable or disable the use of instructions in the MMX, SSE,
15778 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER, AVX512CD,
15779 SHA, AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A, FMA4, XOP, LWP, ABM,
15780 BMI, BMI2, FXSR, XSAVE, XSAVEOPT, LZCNT, RTM, or 3DNow!@:
15781 extended instruction sets.
15782 These extensions are also available as built-in functions: see
15783 @ref{X86 Built-in Functions}, for details of the functions enabled and
15784 disabled by these switches.
15786 To generate SSE/SSE2 instructions automatically from floating-point
15787 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
15789 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
15790 generates new AVX instructions or AVX equivalence for all SSEx instructions
15791 when needed.
15793 These options enable GCC to use these extended instructions in
15794 generated code, even without @option{-mfpmath=sse}.  Applications that
15795 perform run-time CPU detection must compile separate files for each
15796 supported architecture, using the appropriate flags.  In particular,
15797 the file containing the CPU detection code should be compiled without
15798 these options.
15800 @item -mdump-tune-features
15801 @opindex mdump-tune-features
15802 This option instructs GCC to dump the names of the x86 performance 
15803 tuning features and default settings. The names can be used in 
15804 @option{-mtune-ctrl=@var{feature-list}}.
15806 @item -mtune-ctrl=@var{feature-list}
15807 @opindex mtune-ctrl=@var{feature-list}
15808 This option is used to do fine grain control of x86 code generation features.
15809 @var{feature-list} is a comma separated list of @var{feature} names. See also
15810 @option{-mdump-tune-features}. When specified, the @var{feature} will be turned
15811 on if it is not preceded with @code{^}, otherwise, it will be turned off. 
15812 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
15813 developers. Using it may lead to code paths not covered by testing and can
15814 potentially result in compiler ICEs or runtime errors.
15816 @item -mno-default
15817 @opindex mno-default
15818 This option instructs GCC to turn off all tunable features. See also 
15819 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
15821 @item -mcld
15822 @opindex mcld
15823 This option instructs GCC to emit a @code{cld} instruction in the prologue
15824 of functions that use string instructions.  String instructions depend on
15825 the DF flag to select between autoincrement or autodecrement mode.  While the
15826 ABI specifies the DF flag to be cleared on function entry, some operating
15827 systems violate this specification by not clearing the DF flag in their
15828 exception dispatchers.  The exception handler can be invoked with the DF flag
15829 set, which leads to wrong direction mode when string instructions are used.
15830 This option can be enabled by default on 32-bit x86 targets by configuring
15831 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
15832 instructions can be suppressed with the @option{-mno-cld} compiler option
15833 in this case.
15835 @item -mvzeroupper
15836 @opindex mvzeroupper
15837 This option instructs GCC to emit a @code{vzeroupper} instruction
15838 before a transfer of control flow out of the function to minimize
15839 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
15840 intrinsics.
15842 @item -mprefer-avx128
15843 @opindex mprefer-avx128
15844 This option instructs GCC to use 128-bit AVX instructions instead of
15845 256-bit AVX instructions in the auto-vectorizer.
15847 @item -mcx16
15848 @opindex mcx16
15849 This option enables GCC to generate @code{CMPXCHG16B} instructions.
15850 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
15851 (or oword) data types.  
15852 This is useful for high-resolution counters that can be updated
15853 by multiple processors (or cores).  This instruction is generated as part of
15854 atomic built-in functions: see @ref{__sync Builtins} or
15855 @ref{__atomic Builtins} for details.
15857 @item -msahf
15858 @opindex msahf
15859 This option enables generation of @code{SAHF} instructions in 64-bit code.
15860 Early Intel Pentium 4 CPUs with Intel 64 support,
15861 prior to the introduction of Pentium 4 G1 step in December 2005,
15862 lacked the @code{LAHF} and @code{SAHF} instructions
15863 which were supported by AMD64.
15864 These are load and store instructions, respectively, for certain status flags.
15865 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
15866 @code{drem}, and @code{remainder} built-in functions;
15867 see @ref{Other Builtins} for details.
15869 @item -mmovbe
15870 @opindex mmovbe
15871 This option enables use of the @code{movbe} instruction to implement
15872 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
15874 @item -mcrc32
15875 @opindex mcrc32
15876 This option enables built-in functions @code{__builtin_ia32_crc32qi},
15877 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
15878 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
15880 @item -mrecip
15881 @opindex mrecip
15882 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
15883 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
15884 with an additional Newton-Raphson step
15885 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
15886 (and their vectorized
15887 variants) for single-precision floating-point arguments.  These instructions
15888 are generated only when @option{-funsafe-math-optimizations} is enabled
15889 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
15890 Note that while the throughput of the sequence is higher than the throughput
15891 of the non-reciprocal instruction, the precision of the sequence can be
15892 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
15894 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
15895 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
15896 combination), and doesn't need @option{-mrecip}.
15898 Also note that GCC emits the above sequence with additional Newton-Raphson step
15899 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
15900 already with @option{-ffast-math} (or the above option combination), and
15901 doesn't need @option{-mrecip}.
15903 @item -mrecip=@var{opt}
15904 @opindex mrecip=opt
15905 This option controls which reciprocal estimate instructions
15906 may be used.  @var{opt} is a comma-separated list of options, which may
15907 be preceded by a @samp{!} to invert the option:
15909 @table @samp
15910 @item all
15911 Enable all estimate instructions.
15913 @item default
15914 Enable the default instructions, equivalent to @option{-mrecip}.
15916 @item none
15917 Disable all estimate instructions, equivalent to @option{-mno-recip}.
15919 @item div
15920 Enable the approximation for scalar division.
15922 @item vec-div
15923 Enable the approximation for vectorized division.
15925 @item sqrt
15926 Enable the approximation for scalar square root.
15928 @item vec-sqrt
15929 Enable the approximation for vectorized square root.
15930 @end table
15932 So, for example, @option{-mrecip=all,!sqrt} enables
15933 all of the reciprocal approximations, except for square root.
15935 @item -mveclibabi=@var{type}
15936 @opindex mveclibabi
15937 Specifies the ABI type to use for vectorizing intrinsics using an
15938 external library.  Supported values for @var{type} are @samp{svml} 
15939 for the Intel short
15940 vector math library and @samp{acml} for the AMD math core library.
15941 To use this option, both @option{-ftree-vectorize} and
15942 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
15943 ABI-compatible library must be specified at link time.
15945 GCC currently emits calls to @code{vmldExp2},
15946 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
15947 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
15948 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
15949 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
15950 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
15951 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
15952 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
15953 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
15954 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
15955 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
15956 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
15957 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
15958 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
15959 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
15960 when @option{-mveclibabi=acml} is used.  
15962 @item -mabi=@var{name}
15963 @opindex mabi
15964 Generate code for the specified calling convention.  Permissible values
15965 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
15966 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
15967 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
15968 You can control this behavior for a specific function by
15969 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
15970 @xref{Function Attributes}.
15972 @item -mtls-dialect=@var{type}
15973 @opindex mtls-dialect
15974 Generate code to access thread-local storage using the @samp{gnu} or
15975 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
15976 @samp{gnu2} is more efficient, but it may add compile- and run-time
15977 requirements that cannot be satisfied on all systems.
15979 @item -mpush-args
15980 @itemx -mno-push-args
15981 @opindex mpush-args
15982 @opindex mno-push-args
15983 Use PUSH operations to store outgoing parameters.  This method is shorter
15984 and usually equally fast as method using SUB/MOV operations and is enabled
15985 by default.  In some cases disabling it may improve performance because of
15986 improved scheduling and reduced dependencies.
15988 @item -maccumulate-outgoing-args
15989 @opindex maccumulate-outgoing-args
15990 If enabled, the maximum amount of space required for outgoing arguments is
15991 computed in the function prologue.  This is faster on most modern CPUs
15992 because of reduced dependencies, improved scheduling and reduced stack usage
15993 when the preferred stack boundary is not equal to 2.  The drawback is a notable
15994 increase in code size.  This switch implies @option{-mno-push-args}.
15996 @item -mthreads
15997 @opindex mthreads
15998 Support thread-safe exception handling on MinGW.  Programs that rely
15999 on thread-safe exception handling must compile and link all code with the
16000 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
16001 @code{-D_MT}; when linking, it links in a special thread helper library
16002 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
16004 @item -mno-align-stringops
16005 @opindex mno-align-stringops
16006 Do not align the destination of inlined string operations.  This switch reduces
16007 code size and improves performance in case the destination is already aligned,
16008 but GCC doesn't know about it.
16010 @item -minline-all-stringops
16011 @opindex minline-all-stringops
16012 By default GCC inlines string operations only when the destination is 
16013 known to be aligned to least a 4-byte boundary.  
16014 This enables more inlining and increases code
16015 size, but may improve performance of code that depends on fast
16016 @code{memcpy}, @code{strlen},
16017 and @code{memset} for short lengths.
16019 @item -minline-stringops-dynamically
16020 @opindex minline-stringops-dynamically
16021 For string operations of unknown size, use run-time checks with
16022 inline code for small blocks and a library call for large blocks.
16024 @item -mstringop-strategy=@var{alg}
16025 @opindex mstringop-strategy=@var{alg}
16026 Override the internal decision heuristic for the particular algorithm to use
16027 for inlining string operations.  The allowed values for @var{alg} are:
16029 @table @samp
16030 @item rep_byte
16031 @itemx rep_4byte
16032 @itemx rep_8byte
16033 Expand using i386 @code{rep} prefix of the specified size.
16035 @item byte_loop
16036 @itemx loop
16037 @itemx unrolled_loop
16038 Expand into an inline loop.
16040 @item libcall
16041 Always use a library call.
16042 @end table
16044 @item -mmemcpy-strategy=@var{strategy}
16045 @opindex mmemcpy-strategy=@var{strategy}
16046 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
16047 should be inlined and what inline algorithm to use when the expected size
16048 of the copy operation is known. @var{strategy} 
16049 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
16050 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
16051 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
16052 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
16053 in the list must be specified in increasing order.  The minimal byte size for 
16054 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
16055 preceding range.
16057 @item -mmemset-strategy=@var{strategy}
16058 @opindex mmemset-strategy=@var{strategy}
16059 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
16060 @code{__builtin_memset} expansion.
16062 @item -momit-leaf-frame-pointer
16063 @opindex momit-leaf-frame-pointer
16064 Don't keep the frame pointer in a register for leaf functions.  This
16065 avoids the instructions to save, set up, and restore frame pointers and
16066 makes an extra register available in leaf functions.  The option
16067 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
16068 which might make debugging harder.
16070 @item -mtls-direct-seg-refs
16071 @itemx -mno-tls-direct-seg-refs
16072 @opindex mtls-direct-seg-refs
16073 Controls whether TLS variables may be accessed with offsets from the
16074 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
16075 or whether the thread base pointer must be added.  Whether or not this
16076 is valid depends on the operating system, and whether it maps the
16077 segment to cover the entire TLS area.
16079 For systems that use the GNU C Library, the default is on.
16081 @item -msse2avx
16082 @itemx -mno-sse2avx
16083 @opindex msse2avx
16084 Specify that the assembler should encode SSE instructions with VEX
16085 prefix.  The option @option{-mavx} turns this on by default.
16087 @item -mfentry
16088 @itemx -mno-fentry
16089 @opindex mfentry
16090 If profiling is active (@option{-pg}), put the profiling
16091 counter call before the prologue.
16092 Note: On x86 architectures the attribute @code{ms_hook_prologue}
16093 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
16095 @item -mrecord-mcount
16096 @itemx -mno-record-mcount
16097 @opindex mrecord-mcount
16098 If profiling is active (@option{-pg}), generate a __mcount_loc section
16099 that contains pointers to each profiling call. This is useful for
16100 automatically patching and out calls.
16102 @item -mnop-mcount
16103 @itemx -mno-nop-mcount
16104 @opindex mnop-mcount
16105 If profiling is active (@option{-pg}), generate the calls to
16106 the profiling functions as nops. This is useful when they
16107 should be patched in later dynamically. This is likely only
16108 useful together with @option{-mrecord-mcount}.
16110 @item -m8bit-idiv
16111 @itemx -mno-8bit-idiv
16112 @opindex 8bit-idiv
16113 On some processors, like Intel Atom, 8-bit unsigned integer divide is
16114 much faster than 32-bit/64-bit integer divide.  This option generates a
16115 run-time check.  If both dividend and divisor are within range of 0
16116 to 255, 8-bit unsigned integer divide is used instead of
16117 32-bit/64-bit integer divide.
16119 @item -mavx256-split-unaligned-load
16120 @itemx -mavx256-split-unaligned-store
16121 @opindex avx256-split-unaligned-load
16122 @opindex avx256-split-unaligned-store
16123 Split 32-byte AVX unaligned load and store.
16125 @item -mstack-protector-guard=@var{guard}
16126 @opindex mstack-protector-guard=@var{guard}
16127 Generate stack protection code using canary at @var{guard}.  Supported
16128 locations are @samp{global} for global canary or @samp{tls} for per-thread
16129 canary in the TLS block (the default).  This option has effect only when
16130 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
16132 @end table
16134 These @samp{-m} switches are supported in addition to the above
16135 on x86-64 processors in 64-bit environments.
16137 @table @gcctabopt
16138 @item -m32
16139 @itemx -m64
16140 @itemx -mx32
16141 @itemx -m16
16142 @opindex m32
16143 @opindex m64
16144 @opindex mx32
16145 @opindex m16
16146 Generate code for a 16-bit, 32-bit or 64-bit environment.
16147 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
16148 to 32 bits, and
16149 generates code that runs on any i386 system.
16151 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
16152 types to 64 bits, and generates code for the x86-64 architecture.
16153 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
16154 and @option{-mdynamic-no-pic} options.
16156 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
16157 to 32 bits, and
16158 generates code for the x86-64 architecture.
16160 The @option{-m16} option is the same as @option{-m32}, except for that
16161 it outputs the @code{.code16gcc} assembly directive at the beginning of
16162 the assembly output so that the binary can run in 16-bit mode.
16164 @item -mno-red-zone
16165 @opindex mno-red-zone
16166 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
16167 by the x86-64 ABI; it is a 128-byte area beyond the location of the
16168 stack pointer that is not modified by signal or interrupt handlers
16169 and therefore can be used for temporary data without adjusting the stack
16170 pointer.  The flag @option{-mno-red-zone} disables this red zone.
16172 @item -mcmodel=small
16173 @opindex mcmodel=small
16174 Generate code for the small code model: the program and its symbols must
16175 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
16176 Programs can be statically or dynamically linked.  This is the default
16177 code model.
16179 @item -mcmodel=kernel
16180 @opindex mcmodel=kernel
16181 Generate code for the kernel code model.  The kernel runs in the
16182 negative 2 GB of the address space.
16183 This model has to be used for Linux kernel code.
16185 @item -mcmodel=medium
16186 @opindex mcmodel=medium
16187 Generate code for the medium model: the program is linked in the lower 2
16188 GB of the address space.  Small symbols are also placed there.  Symbols
16189 with sizes larger than @option{-mlarge-data-threshold} are put into
16190 large data or BSS sections and can be located above 2GB.  Programs can
16191 be statically or dynamically linked.
16193 @item -mcmodel=large
16194 @opindex mcmodel=large
16195 Generate code for the large model.  This model makes no assumptions
16196 about addresses and sizes of sections.
16198 @item -maddress-mode=long
16199 @opindex maddress-mode=long
16200 Generate code for long address mode.  This is only supported for 64-bit
16201 and x32 environments.  It is the default address mode for 64-bit
16202 environments.
16204 @item -maddress-mode=short
16205 @opindex maddress-mode=short
16206 Generate code for short address mode.  This is only supported for 32-bit
16207 and x32 environments.  It is the default address mode for 32-bit and
16208 x32 environments.
16209 @end table
16211 @node i386 and x86-64 Windows Options
16212 @subsection i386 and x86-64 Windows Options
16213 @cindex i386 and x86-64 Windows Options
16215 These additional options are available for Microsoft Windows targets:
16217 @table @gcctabopt
16218 @item -mconsole
16219 @opindex mconsole
16220 This option
16221 specifies that a console application is to be generated, by
16222 instructing the linker to set the PE header subsystem type
16223 required for console applications.
16224 This option is available for Cygwin and MinGW targets and is
16225 enabled by default on those targets.
16227 @item -mdll
16228 @opindex mdll
16229 This option is available for Cygwin and MinGW targets.  It
16230 specifies that a DLL---a dynamic link library---is to be
16231 generated, enabling the selection of the required runtime
16232 startup object and entry point.
16234 @item -mnop-fun-dllimport
16235 @opindex mnop-fun-dllimport
16236 This option is available for Cygwin and MinGW targets.  It
16237 specifies that the @code{dllimport} attribute should be ignored.
16239 @item -mthread
16240 @opindex mthread
16241 This option is available for MinGW targets. It specifies
16242 that MinGW-specific thread support is to be used.
16244 @item -municode
16245 @opindex municode
16246 This option is available for MinGW-w64 targets.  It causes
16247 the @code{UNICODE} preprocessor macro to be predefined, and
16248 chooses Unicode-capable runtime startup code.
16250 @item -mwin32
16251 @opindex mwin32
16252 This option is available for Cygwin and MinGW targets.  It
16253 specifies that the typical Microsoft Windows predefined macros are to
16254 be set in the pre-processor, but does not influence the choice
16255 of runtime library/startup code.
16257 @item -mwindows
16258 @opindex mwindows
16259 This option is available for Cygwin and MinGW targets.  It
16260 specifies that a GUI application is to be generated by
16261 instructing the linker to set the PE header subsystem type
16262 appropriately.
16264 @item -fno-set-stack-executable
16265 @opindex fno-set-stack-executable
16266 This option is available for MinGW targets. It specifies that
16267 the executable flag for the stack used by nested functions isn't
16268 set. This is necessary for binaries running in kernel mode of
16269 Microsoft Windows, as there the User32 API, which is used to set executable
16270 privileges, isn't available.
16272 @item -fwritable-relocated-rdata
16273 @opindex fno-writable-relocated-rdata
16274 This option is available for MinGW and Cygwin targets.  It specifies
16275 that relocated-data in read-only section is put into .data
16276 section.  This is a necessary for older runtimes not supporting
16277 modification of .rdata sections for pseudo-relocation.
16279 @item -mpe-aligned-commons
16280 @opindex mpe-aligned-commons
16281 This option is available for Cygwin and MinGW targets.  It
16282 specifies that the GNU extension to the PE file format that
16283 permits the correct alignment of COMMON variables should be
16284 used when generating code.  It is enabled by default if
16285 GCC detects that the target assembler found during configuration
16286 supports the feature.
16287 @end table
16289 See also under @ref{i386 and x86-64 Options} for standard options.
16291 @node IA-64 Options
16292 @subsection IA-64 Options
16293 @cindex IA-64 Options
16295 These are the @samp{-m} options defined for the Intel IA-64 architecture.
16297 @table @gcctabopt
16298 @item -mbig-endian
16299 @opindex mbig-endian
16300 Generate code for a big-endian target.  This is the default for HP-UX@.
16302 @item -mlittle-endian
16303 @opindex mlittle-endian
16304 Generate code for a little-endian target.  This is the default for AIX5
16305 and GNU/Linux.
16307 @item -mgnu-as
16308 @itemx -mno-gnu-as
16309 @opindex mgnu-as
16310 @opindex mno-gnu-as
16311 Generate (or don't) code for the GNU assembler.  This is the default.
16312 @c Also, this is the default if the configure option @option{--with-gnu-as}
16313 @c is used.
16315 @item -mgnu-ld
16316 @itemx -mno-gnu-ld
16317 @opindex mgnu-ld
16318 @opindex mno-gnu-ld
16319 Generate (or don't) code for the GNU linker.  This is the default.
16320 @c Also, this is the default if the configure option @option{--with-gnu-ld}
16321 @c is used.
16323 @item -mno-pic
16324 @opindex mno-pic
16325 Generate code that does not use a global pointer register.  The result
16326 is not position independent code, and violates the IA-64 ABI@.
16328 @item -mvolatile-asm-stop
16329 @itemx -mno-volatile-asm-stop
16330 @opindex mvolatile-asm-stop
16331 @opindex mno-volatile-asm-stop
16332 Generate (or don't) a stop bit immediately before and after volatile asm
16333 statements.
16335 @item -mregister-names
16336 @itemx -mno-register-names
16337 @opindex mregister-names
16338 @opindex mno-register-names
16339 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
16340 the stacked registers.  This may make assembler output more readable.
16342 @item -mno-sdata
16343 @itemx -msdata
16344 @opindex mno-sdata
16345 @opindex msdata
16346 Disable (or enable) optimizations that use the small data section.  This may
16347 be useful for working around optimizer bugs.
16349 @item -mconstant-gp
16350 @opindex mconstant-gp
16351 Generate code that uses a single constant global pointer value.  This is
16352 useful when compiling kernel code.
16354 @item -mauto-pic
16355 @opindex mauto-pic
16356 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
16357 This is useful when compiling firmware code.
16359 @item -minline-float-divide-min-latency
16360 @opindex minline-float-divide-min-latency
16361 Generate code for inline divides of floating-point values
16362 using the minimum latency algorithm.
16364 @item -minline-float-divide-max-throughput
16365 @opindex minline-float-divide-max-throughput
16366 Generate code for inline divides of floating-point values
16367 using the maximum throughput algorithm.
16369 @item -mno-inline-float-divide
16370 @opindex mno-inline-float-divide
16371 Do not generate inline code for divides of floating-point values.
16373 @item -minline-int-divide-min-latency
16374 @opindex minline-int-divide-min-latency
16375 Generate code for inline divides of integer values
16376 using the minimum latency algorithm.
16378 @item -minline-int-divide-max-throughput
16379 @opindex minline-int-divide-max-throughput
16380 Generate code for inline divides of integer values
16381 using the maximum throughput algorithm.
16383 @item -mno-inline-int-divide
16384 @opindex mno-inline-int-divide
16385 Do not generate inline code for divides of integer values.
16387 @item -minline-sqrt-min-latency
16388 @opindex minline-sqrt-min-latency
16389 Generate code for inline square roots
16390 using the minimum latency algorithm.
16392 @item -minline-sqrt-max-throughput
16393 @opindex minline-sqrt-max-throughput
16394 Generate code for inline square roots
16395 using the maximum throughput algorithm.
16397 @item -mno-inline-sqrt
16398 @opindex mno-inline-sqrt
16399 Do not generate inline code for @code{sqrt}.
16401 @item -mfused-madd
16402 @itemx -mno-fused-madd
16403 @opindex mfused-madd
16404 @opindex mno-fused-madd
16405 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
16406 instructions.  The default is to use these instructions.
16408 @item -mno-dwarf2-asm
16409 @itemx -mdwarf2-asm
16410 @opindex mno-dwarf2-asm
16411 @opindex mdwarf2-asm
16412 Don't (or do) generate assembler code for the DWARF 2 line number debugging
16413 info.  This may be useful when not using the GNU assembler.
16415 @item -mearly-stop-bits
16416 @itemx -mno-early-stop-bits
16417 @opindex mearly-stop-bits
16418 @opindex mno-early-stop-bits
16419 Allow stop bits to be placed earlier than immediately preceding the
16420 instruction that triggered the stop bit.  This can improve instruction
16421 scheduling, but does not always do so.
16423 @item -mfixed-range=@var{register-range}
16424 @opindex mfixed-range
16425 Generate code treating the given register range as fixed registers.
16426 A fixed register is one that the register allocator cannot use.  This is
16427 useful when compiling kernel code.  A register range is specified as
16428 two registers separated by a dash.  Multiple register ranges can be
16429 specified separated by a comma.
16431 @item -mtls-size=@var{tls-size}
16432 @opindex mtls-size
16433 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
16436 @item -mtune=@var{cpu-type}
16437 @opindex mtune
16438 Tune the instruction scheduling for a particular CPU, Valid values are
16439 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
16440 and @samp{mckinley}.
16442 @item -milp32
16443 @itemx -mlp64
16444 @opindex milp32
16445 @opindex mlp64
16446 Generate code for a 32-bit or 64-bit environment.
16447 The 32-bit environment sets int, long and pointer to 32 bits.
16448 The 64-bit environment sets int to 32 bits and long and pointer
16449 to 64 bits.  These are HP-UX specific flags.
16451 @item -mno-sched-br-data-spec
16452 @itemx -msched-br-data-spec
16453 @opindex mno-sched-br-data-spec
16454 @opindex msched-br-data-spec
16455 (Dis/En)able data speculative scheduling before reload.
16456 This results in generation of @code{ld.a} instructions and
16457 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
16458 The default is 'disable'.
16460 @item -msched-ar-data-spec
16461 @itemx -mno-sched-ar-data-spec
16462 @opindex msched-ar-data-spec
16463 @opindex mno-sched-ar-data-spec
16464 (En/Dis)able data speculative scheduling after reload.
16465 This results in generation of @code{ld.a} instructions and
16466 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
16467 The default is 'enable'.
16469 @item -mno-sched-control-spec
16470 @itemx -msched-control-spec
16471 @opindex mno-sched-control-spec
16472 @opindex msched-control-spec
16473 (Dis/En)able control speculative scheduling.  This feature is
16474 available only during region scheduling (i.e.@: before reload).
16475 This results in generation of the @code{ld.s} instructions and
16476 the corresponding check instructions @code{chk.s}.
16477 The default is 'disable'.
16479 @item -msched-br-in-data-spec
16480 @itemx -mno-sched-br-in-data-spec
16481 @opindex msched-br-in-data-spec
16482 @opindex mno-sched-br-in-data-spec
16483 (En/Dis)able speculative scheduling of the instructions that
16484 are dependent on the data speculative loads before reload.
16485 This is effective only with @option{-msched-br-data-spec} enabled.
16486 The default is 'enable'.
16488 @item -msched-ar-in-data-spec
16489 @itemx -mno-sched-ar-in-data-spec
16490 @opindex msched-ar-in-data-spec
16491 @opindex mno-sched-ar-in-data-spec
16492 (En/Dis)able speculative scheduling of the instructions that
16493 are dependent on the data speculative loads after reload.
16494 This is effective only with @option{-msched-ar-data-spec} enabled.
16495 The default is 'enable'.
16497 @item -msched-in-control-spec
16498 @itemx -mno-sched-in-control-spec
16499 @opindex msched-in-control-spec
16500 @opindex mno-sched-in-control-spec
16501 (En/Dis)able speculative scheduling of the instructions that
16502 are dependent on the control speculative loads.
16503 This is effective only with @option{-msched-control-spec} enabled.
16504 The default is 'enable'.
16506 @item -mno-sched-prefer-non-data-spec-insns
16507 @itemx -msched-prefer-non-data-spec-insns
16508 @opindex mno-sched-prefer-non-data-spec-insns
16509 @opindex msched-prefer-non-data-spec-insns
16510 If enabled, data-speculative instructions are chosen for schedule
16511 only if there are no other choices at the moment.  This makes
16512 the use of the data speculation much more conservative.
16513 The default is 'disable'.
16515 @item -mno-sched-prefer-non-control-spec-insns
16516 @itemx -msched-prefer-non-control-spec-insns
16517 @opindex mno-sched-prefer-non-control-spec-insns
16518 @opindex msched-prefer-non-control-spec-insns
16519 If enabled, control-speculative instructions are chosen for schedule
16520 only if there are no other choices at the moment.  This makes
16521 the use of the control speculation much more conservative.
16522 The default is 'disable'.
16524 @item -mno-sched-count-spec-in-critical-path
16525 @itemx -msched-count-spec-in-critical-path
16526 @opindex mno-sched-count-spec-in-critical-path
16527 @opindex msched-count-spec-in-critical-path
16528 If enabled, speculative dependencies are considered during
16529 computation of the instructions priorities.  This makes the use of the
16530 speculation a bit more conservative.
16531 The default is 'disable'.
16533 @item -msched-spec-ldc
16534 @opindex msched-spec-ldc
16535 Use a simple data speculation check.  This option is on by default.
16537 @item -msched-control-spec-ldc
16538 @opindex msched-spec-ldc
16539 Use a simple check for control speculation.  This option is on by default.
16541 @item -msched-stop-bits-after-every-cycle
16542 @opindex msched-stop-bits-after-every-cycle
16543 Place a stop bit after every cycle when scheduling.  This option is on
16544 by default.
16546 @item -msched-fp-mem-deps-zero-cost
16547 @opindex msched-fp-mem-deps-zero-cost
16548 Assume that floating-point stores and loads are not likely to cause a conflict
16549 when placed into the same instruction group.  This option is disabled by
16550 default.
16552 @item -msel-sched-dont-check-control-spec
16553 @opindex msel-sched-dont-check-control-spec
16554 Generate checks for control speculation in selective scheduling.
16555 This flag is disabled by default.
16557 @item -msched-max-memory-insns=@var{max-insns}
16558 @opindex msched-max-memory-insns
16559 Limit on the number of memory insns per instruction group, giving lower
16560 priority to subsequent memory insns attempting to schedule in the same
16561 instruction group. Frequently useful to prevent cache bank conflicts.
16562 The default value is 1.
16564 @item -msched-max-memory-insns-hard-limit
16565 @opindex msched-max-memory-insns-hard-limit
16566 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
16567 disallowing more than that number in an instruction group.
16568 Otherwise, the limit is ``soft'', meaning that non-memory operations
16569 are preferred when the limit is reached, but memory operations may still
16570 be scheduled.
16572 @end table
16574 @node LM32 Options
16575 @subsection LM32 Options
16576 @cindex LM32 options
16578 These @option{-m} options are defined for the LatticeMico32 architecture:
16580 @table @gcctabopt
16581 @item -mbarrel-shift-enabled
16582 @opindex mbarrel-shift-enabled
16583 Enable barrel-shift instructions.
16585 @item -mdivide-enabled
16586 @opindex mdivide-enabled
16587 Enable divide and modulus instructions.
16589 @item -mmultiply-enabled
16590 @opindex multiply-enabled
16591 Enable multiply instructions.
16593 @item -msign-extend-enabled
16594 @opindex msign-extend-enabled
16595 Enable sign extend instructions.
16597 @item -muser-enabled
16598 @opindex muser-enabled
16599 Enable user-defined instructions.
16601 @end table
16603 @node M32C Options
16604 @subsection M32C Options
16605 @cindex M32C options
16607 @table @gcctabopt
16608 @item -mcpu=@var{name}
16609 @opindex mcpu=
16610 Select the CPU for which code is generated.  @var{name} may be one of
16611 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
16612 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
16613 the M32C/80 series.
16615 @item -msim
16616 @opindex msim
16617 Specifies that the program will be run on the simulator.  This causes
16618 an alternate runtime library to be linked in which supports, for
16619 example, file I/O@.  You must not use this option when generating
16620 programs that will run on real hardware; you must provide your own
16621 runtime library for whatever I/O functions are needed.
16623 @item -memregs=@var{number}
16624 @opindex memregs=
16625 Specifies the number of memory-based pseudo-registers GCC uses
16626 during code generation.  These pseudo-registers are used like real
16627 registers, so there is a tradeoff between GCC's ability to fit the
16628 code into available registers, and the performance penalty of using
16629 memory instead of registers.  Note that all modules in a program must
16630 be compiled with the same value for this option.  Because of that, you
16631 must not use this option with GCC's default runtime libraries.
16633 @end table
16635 @node M32R/D Options
16636 @subsection M32R/D Options
16637 @cindex M32R/D options
16639 These @option{-m} options are defined for Renesas M32R/D architectures:
16641 @table @gcctabopt
16642 @item -m32r2
16643 @opindex m32r2
16644 Generate code for the M32R/2@.
16646 @item -m32rx
16647 @opindex m32rx
16648 Generate code for the M32R/X@.
16650 @item -m32r
16651 @opindex m32r
16652 Generate code for the M32R@.  This is the default.
16654 @item -mmodel=small
16655 @opindex mmodel=small
16656 Assume all objects live in the lower 16MB of memory (so that their addresses
16657 can be loaded with the @code{ld24} instruction), and assume all subroutines
16658 are reachable with the @code{bl} instruction.
16659 This is the default.
16661 The addressability of a particular object can be set with the
16662 @code{model} attribute.
16664 @item -mmodel=medium
16665 @opindex mmodel=medium
16666 Assume objects may be anywhere in the 32-bit address space (the compiler
16667 generates @code{seth/add3} instructions to load their addresses), and
16668 assume all subroutines are reachable with the @code{bl} instruction.
16670 @item -mmodel=large
16671 @opindex mmodel=large
16672 Assume objects may be anywhere in the 32-bit address space (the compiler
16673 generates @code{seth/add3} instructions to load their addresses), and
16674 assume subroutines may not be reachable with the @code{bl} instruction
16675 (the compiler generates the much slower @code{seth/add3/jl}
16676 instruction sequence).
16678 @item -msdata=none
16679 @opindex msdata=none
16680 Disable use of the small data area.  Variables are put into
16681 one of @samp{.data}, @samp{.bss}, or @samp{.rodata} (unless the
16682 @code{section} attribute has been specified).
16683 This is the default.
16685 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
16686 Objects may be explicitly put in the small data area with the
16687 @code{section} attribute using one of these sections.
16689 @item -msdata=sdata
16690 @opindex msdata=sdata
16691 Put small global and static data in the small data area, but do not
16692 generate special code to reference them.
16694 @item -msdata=use
16695 @opindex msdata=use
16696 Put small global and static data in the small data area, and generate
16697 special instructions to reference them.
16699 @item -G @var{num}
16700 @opindex G
16701 @cindex smaller data references
16702 Put global and static objects less than or equal to @var{num} bytes
16703 into the small data or BSS sections instead of the normal data or BSS
16704 sections.  The default value of @var{num} is 8.
16705 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
16706 for this option to have any effect.
16708 All modules should be compiled with the same @option{-G @var{num}} value.
16709 Compiling with different values of @var{num} may or may not work; if it
16710 doesn't the linker gives an error message---incorrect code is not
16711 generated.
16713 @item -mdebug
16714 @opindex mdebug
16715 Makes the M32R-specific code in the compiler display some statistics
16716 that might help in debugging programs.
16718 @item -malign-loops
16719 @opindex malign-loops
16720 Align all loops to a 32-byte boundary.
16722 @item -mno-align-loops
16723 @opindex mno-align-loops
16724 Do not enforce a 32-byte alignment for loops.  This is the default.
16726 @item -missue-rate=@var{number}
16727 @opindex missue-rate=@var{number}
16728 Issue @var{number} instructions per cycle.  @var{number} can only be 1
16729 or 2.
16731 @item -mbranch-cost=@var{number}
16732 @opindex mbranch-cost=@var{number}
16733 @var{number} can only be 1 or 2.  If it is 1 then branches are
16734 preferred over conditional code, if it is 2, then the opposite applies.
16736 @item -mflush-trap=@var{number}
16737 @opindex mflush-trap=@var{number}
16738 Specifies the trap number to use to flush the cache.  The default is
16739 12.  Valid numbers are between 0 and 15 inclusive.
16741 @item -mno-flush-trap
16742 @opindex mno-flush-trap
16743 Specifies that the cache cannot be flushed by using a trap.
16745 @item -mflush-func=@var{name}
16746 @opindex mflush-func=@var{name}
16747 Specifies the name of the operating system function to call to flush
16748 the cache.  The default is @emph{_flush_cache}, but a function call
16749 is only used if a trap is not available.
16751 @item -mno-flush-func
16752 @opindex mno-flush-func
16753 Indicates that there is no OS function for flushing the cache.
16755 @end table
16757 @node M680x0 Options
16758 @subsection M680x0 Options
16759 @cindex M680x0 options
16761 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
16762 The default settings depend on which architecture was selected when
16763 the compiler was configured; the defaults for the most common choices
16764 are given below.
16766 @table @gcctabopt
16767 @item -march=@var{arch}
16768 @opindex march
16769 Generate code for a specific M680x0 or ColdFire instruction set
16770 architecture.  Permissible values of @var{arch} for M680x0
16771 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
16772 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
16773 architectures are selected according to Freescale's ISA classification
16774 and the permissible values are: @samp{isaa}, @samp{isaaplus},
16775 @samp{isab} and @samp{isac}.
16777 GCC defines a macro @samp{__mcf@var{arch}__} whenever it is generating
16778 code for a ColdFire target.  The @var{arch} in this macro is one of the
16779 @option{-march} arguments given above.
16781 When used together, @option{-march} and @option{-mtune} select code
16782 that runs on a family of similar processors but that is optimized
16783 for a particular microarchitecture.
16785 @item -mcpu=@var{cpu}
16786 @opindex mcpu
16787 Generate code for a specific M680x0 or ColdFire processor.
16788 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
16789 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
16790 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
16791 below, which also classifies the CPUs into families:
16793 @multitable @columnfractions 0.20 0.80
16794 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
16795 @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}
16796 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
16797 @item @samp{5206e} @tab @samp{5206e}
16798 @item @samp{5208} @tab @samp{5207} @samp{5208}
16799 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
16800 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
16801 @item @samp{5216} @tab @samp{5214} @samp{5216}
16802 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
16803 @item @samp{5225} @tab @samp{5224} @samp{5225}
16804 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
16805 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
16806 @item @samp{5249} @tab @samp{5249}
16807 @item @samp{5250} @tab @samp{5250}
16808 @item @samp{5271} @tab @samp{5270} @samp{5271}
16809 @item @samp{5272} @tab @samp{5272}
16810 @item @samp{5275} @tab @samp{5274} @samp{5275}
16811 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
16812 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
16813 @item @samp{5307} @tab @samp{5307}
16814 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
16815 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
16816 @item @samp{5407} @tab @samp{5407}
16817 @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}
16818 @end multitable
16820 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
16821 @var{arch} is compatible with @var{cpu}.  Other combinations of
16822 @option{-mcpu} and @option{-march} are rejected.
16824 GCC defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
16825 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
16826 where the value of @var{family} is given by the table above.
16828 @item -mtune=@var{tune}
16829 @opindex mtune
16830 Tune the code for a particular microarchitecture within the
16831 constraints set by @option{-march} and @option{-mcpu}.
16832 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
16833 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
16834 and @samp{cpu32}.  The ColdFire microarchitectures
16835 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
16837 You can also use @option{-mtune=68020-40} for code that needs
16838 to run relatively well on 68020, 68030 and 68040 targets.
16839 @option{-mtune=68020-60} is similar but includes 68060 targets
16840 as well.  These two options select the same tuning decisions as
16841 @option{-m68020-40} and @option{-m68020-60} respectively.
16843 GCC defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
16844 when tuning for 680x0 architecture @var{arch}.  It also defines
16845 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
16846 option is used.  If GCC is tuning for a range of architectures,
16847 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
16848 it defines the macros for every architecture in the range.
16850 GCC also defines the macro @samp{__m@var{uarch}__} when tuning for
16851 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
16852 of the arguments given above.
16854 @item -m68000
16855 @itemx -mc68000
16856 @opindex m68000
16857 @opindex mc68000
16858 Generate output for a 68000.  This is the default
16859 when the compiler is configured for 68000-based systems.
16860 It is equivalent to @option{-march=68000}.
16862 Use this option for microcontrollers with a 68000 or EC000 core,
16863 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
16865 @item -m68010
16866 @opindex m68010
16867 Generate output for a 68010.  This is the default
16868 when the compiler is configured for 68010-based systems.
16869 It is equivalent to @option{-march=68010}.
16871 @item -m68020
16872 @itemx -mc68020
16873 @opindex m68020
16874 @opindex mc68020
16875 Generate output for a 68020.  This is the default
16876 when the compiler is configured for 68020-based systems.
16877 It is equivalent to @option{-march=68020}.
16879 @item -m68030
16880 @opindex m68030
16881 Generate output for a 68030.  This is the default when the compiler is
16882 configured for 68030-based systems.  It is equivalent to
16883 @option{-march=68030}.
16885 @item -m68040
16886 @opindex m68040
16887 Generate output for a 68040.  This is the default when the compiler is
16888 configured for 68040-based systems.  It is equivalent to
16889 @option{-march=68040}.
16891 This option inhibits the use of 68881/68882 instructions that have to be
16892 emulated by software on the 68040.  Use this option if your 68040 does not
16893 have code to emulate those instructions.
16895 @item -m68060
16896 @opindex m68060
16897 Generate output for a 68060.  This is the default when the compiler is
16898 configured for 68060-based systems.  It is equivalent to
16899 @option{-march=68060}.
16901 This option inhibits the use of 68020 and 68881/68882 instructions that
16902 have to be emulated by software on the 68060.  Use this option if your 68060
16903 does not have code to emulate those instructions.
16905 @item -mcpu32
16906 @opindex mcpu32
16907 Generate output for a CPU32.  This is the default
16908 when the compiler is configured for CPU32-based systems.
16909 It is equivalent to @option{-march=cpu32}.
16911 Use this option for microcontrollers with a
16912 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
16913 68336, 68340, 68341, 68349 and 68360.
16915 @item -m5200
16916 @opindex m5200
16917 Generate output for a 520X ColdFire CPU@.  This is the default
16918 when the compiler is configured for 520X-based systems.
16919 It is equivalent to @option{-mcpu=5206}, and is now deprecated
16920 in favor of that option.
16922 Use this option for microcontroller with a 5200 core, including
16923 the MCF5202, MCF5203, MCF5204 and MCF5206.
16925 @item -m5206e
16926 @opindex m5206e
16927 Generate output for a 5206e ColdFire CPU@.  The option is now
16928 deprecated in favor of the equivalent @option{-mcpu=5206e}.
16930 @item -m528x
16931 @opindex m528x
16932 Generate output for a member of the ColdFire 528X family.
16933 The option is now deprecated in favor of the equivalent
16934 @option{-mcpu=528x}.
16936 @item -m5307
16937 @opindex m5307
16938 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
16939 in favor of the equivalent @option{-mcpu=5307}.
16941 @item -m5407
16942 @opindex m5407
16943 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
16944 in favor of the equivalent @option{-mcpu=5407}.
16946 @item -mcfv4e
16947 @opindex mcfv4e
16948 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
16949 This includes use of hardware floating-point instructions.
16950 The option is equivalent to @option{-mcpu=547x}, and is now
16951 deprecated in favor of that option.
16953 @item -m68020-40
16954 @opindex m68020-40
16955 Generate output for a 68040, without using any of the new instructions.
16956 This results in code that can run relatively efficiently on either a
16957 68020/68881 or a 68030 or a 68040.  The generated code does use the
16958 68881 instructions that are emulated on the 68040.
16960 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
16962 @item -m68020-60
16963 @opindex m68020-60
16964 Generate output for a 68060, without using any of the new instructions.
16965 This results in code that can run relatively efficiently on either a
16966 68020/68881 or a 68030 or a 68040.  The generated code does use the
16967 68881 instructions that are emulated on the 68060.
16969 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
16971 @item -mhard-float
16972 @itemx -m68881
16973 @opindex mhard-float
16974 @opindex m68881
16975 Generate floating-point instructions.  This is the default for 68020
16976 and above, and for ColdFire devices that have an FPU@.  It defines the
16977 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
16978 on ColdFire targets.
16980 @item -msoft-float
16981 @opindex msoft-float
16982 Do not generate floating-point instructions; use library calls instead.
16983 This is the default for 68000, 68010, and 68832 targets.  It is also
16984 the default for ColdFire devices that have no FPU.
16986 @item -mdiv
16987 @itemx -mno-div
16988 @opindex mdiv
16989 @opindex mno-div
16990 Generate (do not generate) ColdFire hardware divide and remainder
16991 instructions.  If @option{-march} is used without @option{-mcpu},
16992 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
16993 architectures.  Otherwise, the default is taken from the target CPU
16994 (either the default CPU, or the one specified by @option{-mcpu}).  For
16995 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
16996 @option{-mcpu=5206e}.
16998 GCC defines the macro @samp{__mcfhwdiv__} when this option is enabled.
17000 @item -mshort
17001 @opindex mshort
17002 Consider type @code{int} to be 16 bits wide, like @code{short int}.
17003 Additionally, parameters passed on the stack are also aligned to a
17004 16-bit boundary even on targets whose API mandates promotion to 32-bit.
17006 @item -mno-short
17007 @opindex mno-short
17008 Do not consider type @code{int} to be 16 bits wide.  This is the default.
17010 @item -mnobitfield
17011 @itemx -mno-bitfield
17012 @opindex mnobitfield
17013 @opindex mno-bitfield
17014 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
17015 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
17017 @item -mbitfield
17018 @opindex mbitfield
17019 Do use the bit-field instructions.  The @option{-m68020} option implies
17020 @option{-mbitfield}.  This is the default if you use a configuration
17021 designed for a 68020.
17023 @item -mrtd
17024 @opindex mrtd
17025 Use a different function-calling convention, in which functions
17026 that take a fixed number of arguments return with the @code{rtd}
17027 instruction, which pops their arguments while returning.  This
17028 saves one instruction in the caller since there is no need to pop
17029 the arguments there.
17031 This calling convention is incompatible with the one normally
17032 used on Unix, so you cannot use it if you need to call libraries
17033 compiled with the Unix compiler.
17035 Also, you must provide function prototypes for all functions that
17036 take variable numbers of arguments (including @code{printf});
17037 otherwise incorrect code is generated for calls to those
17038 functions.
17040 In addition, seriously incorrect code results if you call a
17041 function with too many arguments.  (Normally, extra arguments are
17042 harmlessly ignored.)
17044 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
17045 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
17047 @item -mno-rtd
17048 @opindex mno-rtd
17049 Do not use the calling conventions selected by @option{-mrtd}.
17050 This is the default.
17052 @item -malign-int
17053 @itemx -mno-align-int
17054 @opindex malign-int
17055 @opindex mno-align-int
17056 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
17057 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
17058 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
17059 Aligning variables on 32-bit boundaries produces code that runs somewhat
17060 faster on processors with 32-bit busses at the expense of more memory.
17062 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
17063 aligns structures containing the above types differently than
17064 most published application binary interface specifications for the m68k.
17066 @item -mpcrel
17067 @opindex mpcrel
17068 Use the pc-relative addressing mode of the 68000 directly, instead of
17069 using a global offset table.  At present, this option implies @option{-fpic},
17070 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
17071 not presently supported with @option{-mpcrel}, though this could be supported for
17072 68020 and higher processors.
17074 @item -mno-strict-align
17075 @itemx -mstrict-align
17076 @opindex mno-strict-align
17077 @opindex mstrict-align
17078 Do not (do) assume that unaligned memory references are handled by
17079 the system.
17081 @item -msep-data
17082 Generate code that allows the data segment to be located in a different
17083 area of memory from the text segment.  This allows for execute-in-place in
17084 an environment without virtual memory management.  This option implies
17085 @option{-fPIC}.
17087 @item -mno-sep-data
17088 Generate code that assumes that the data segment follows the text segment.
17089 This is the default.
17091 @item -mid-shared-library
17092 Generate code that supports shared libraries via the library ID method.
17093 This allows for execute-in-place and shared libraries in an environment
17094 without virtual memory management.  This option implies @option{-fPIC}.
17096 @item -mno-id-shared-library
17097 Generate code that doesn't assume ID-based shared libraries are being used.
17098 This is the default.
17100 @item -mshared-library-id=n
17101 Specifies the identification number of the ID-based shared library being
17102 compiled.  Specifying a value of 0 generates more compact code; specifying
17103 other values forces the allocation of that number to the current
17104 library, but is no more space- or time-efficient than omitting this option.
17106 @item -mxgot
17107 @itemx -mno-xgot
17108 @opindex mxgot
17109 @opindex mno-xgot
17110 When generating position-independent code for ColdFire, generate code
17111 that works if the GOT has more than 8192 entries.  This code is
17112 larger and slower than code generated without this option.  On M680x0
17113 processors, this option is not needed; @option{-fPIC} suffices.
17115 GCC normally uses a single instruction to load values from the GOT@.
17116 While this is relatively efficient, it only works if the GOT
17117 is smaller than about 64k.  Anything larger causes the linker
17118 to report an error such as:
17120 @cindex relocation truncated to fit (ColdFire)
17121 @smallexample
17122 relocation truncated to fit: R_68K_GOT16O foobar
17123 @end smallexample
17125 If this happens, you should recompile your code with @option{-mxgot}.
17126 It should then work with very large GOTs.  However, code generated with
17127 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
17128 the value of a global symbol.
17130 Note that some linkers, including newer versions of the GNU linker,
17131 can create multiple GOTs and sort GOT entries.  If you have such a linker,
17132 you should only need to use @option{-mxgot} when compiling a single
17133 object file that accesses more than 8192 GOT entries.  Very few do.
17135 These options have no effect unless GCC is generating
17136 position-independent code.
17138 @end table
17140 @node MCore Options
17141 @subsection MCore Options
17142 @cindex MCore options
17144 These are the @samp{-m} options defined for the Motorola M*Core
17145 processors.
17147 @table @gcctabopt
17149 @item -mhardlit
17150 @itemx -mno-hardlit
17151 @opindex mhardlit
17152 @opindex mno-hardlit
17153 Inline constants into the code stream if it can be done in two
17154 instructions or less.
17156 @item -mdiv
17157 @itemx -mno-div
17158 @opindex mdiv
17159 @opindex mno-div
17160 Use the divide instruction.  (Enabled by default).
17162 @item -mrelax-immediate
17163 @itemx -mno-relax-immediate
17164 @opindex mrelax-immediate
17165 @opindex mno-relax-immediate
17166 Allow arbitrary-sized immediates in bit operations.
17168 @item -mwide-bitfields
17169 @itemx -mno-wide-bitfields
17170 @opindex mwide-bitfields
17171 @opindex mno-wide-bitfields
17172 Always treat bit-fields as @code{int}-sized.
17174 @item -m4byte-functions
17175 @itemx -mno-4byte-functions
17176 @opindex m4byte-functions
17177 @opindex mno-4byte-functions
17178 Force all functions to be aligned to a 4-byte boundary.
17180 @item -mcallgraph-data
17181 @itemx -mno-callgraph-data
17182 @opindex mcallgraph-data
17183 @opindex mno-callgraph-data
17184 Emit callgraph information.
17186 @item -mslow-bytes
17187 @itemx -mno-slow-bytes
17188 @opindex mslow-bytes
17189 @opindex mno-slow-bytes
17190 Prefer word access when reading byte quantities.
17192 @item -mlittle-endian
17193 @itemx -mbig-endian
17194 @opindex mlittle-endian
17195 @opindex mbig-endian
17196 Generate code for a little-endian target.
17198 @item -m210
17199 @itemx -m340
17200 @opindex m210
17201 @opindex m340
17202 Generate code for the 210 processor.
17204 @item -mno-lsim
17205 @opindex mno-lsim
17206 Assume that runtime support has been provided and so omit the
17207 simulator library (@file{libsim.a)} from the linker command line.
17209 @item -mstack-increment=@var{size}
17210 @opindex mstack-increment
17211 Set the maximum amount for a single stack increment operation.  Large
17212 values can increase the speed of programs that contain functions
17213 that need a large amount of stack space, but they can also trigger a
17214 segmentation fault if the stack is extended too much.  The default
17215 value is 0x1000.
17217 @end table
17219 @node MeP Options
17220 @subsection MeP Options
17221 @cindex MeP options
17223 @table @gcctabopt
17225 @item -mabsdiff
17226 @opindex mabsdiff
17227 Enables the @code{abs} instruction, which is the absolute difference
17228 between two registers.
17230 @item -mall-opts
17231 @opindex mall-opts
17232 Enables all the optional instructions---average, multiply, divide, bit
17233 operations, leading zero, absolute difference, min/max, clip, and
17234 saturation.
17237 @item -maverage
17238 @opindex maverage
17239 Enables the @code{ave} instruction, which computes the average of two
17240 registers.
17242 @item -mbased=@var{n}
17243 @opindex mbased=
17244 Variables of size @var{n} bytes or smaller are placed in the
17245 @code{.based} section by default.  Based variables use the @code{$tp}
17246 register as a base register, and there is a 128-byte limit to the
17247 @code{.based} section.
17249 @item -mbitops
17250 @opindex mbitops
17251 Enables the bit operation instructions---bit test (@code{btstm}), set
17252 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
17253 test-and-set (@code{tas}).
17255 @item -mc=@var{name}
17256 @opindex mc=
17257 Selects which section constant data is placed in.  @var{name} may
17258 be @code{tiny}, @code{near}, or @code{far}.
17260 @item -mclip
17261 @opindex mclip
17262 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
17263 useful unless you also provide @code{-mminmax}.
17265 @item -mconfig=@var{name}
17266 @opindex mconfig=
17267 Selects one of the built-in core configurations.  Each MeP chip has
17268 one or more modules in it; each module has a core CPU and a variety of
17269 coprocessors, optional instructions, and peripherals.  The
17270 @code{MeP-Integrator} tool, not part of GCC, provides these
17271 configurations through this option; using this option is the same as
17272 using all the corresponding command-line options.  The default
17273 configuration is @code{default}.
17275 @item -mcop
17276 @opindex mcop
17277 Enables the coprocessor instructions.  By default, this is a 32-bit
17278 coprocessor.  Note that the coprocessor is normally enabled via the
17279 @code{-mconfig=} option.
17281 @item -mcop32
17282 @opindex mcop32
17283 Enables the 32-bit coprocessor's instructions.
17285 @item -mcop64
17286 @opindex mcop64
17287 Enables the 64-bit coprocessor's instructions.
17289 @item -mivc2
17290 @opindex mivc2
17291 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
17293 @item -mdc
17294 @opindex mdc
17295 Causes constant variables to be placed in the @code{.near} section.
17297 @item -mdiv
17298 @opindex mdiv
17299 Enables the @code{div} and @code{divu} instructions.
17301 @item -meb
17302 @opindex meb
17303 Generate big-endian code.
17305 @item -mel
17306 @opindex mel
17307 Generate little-endian code.
17309 @item -mio-volatile
17310 @opindex mio-volatile
17311 Tells the compiler that any variable marked with the @code{io}
17312 attribute is to be considered volatile.
17314 @item -ml
17315 @opindex ml
17316 Causes variables to be assigned to the @code{.far} section by default.
17318 @item -mleadz
17319 @opindex mleadz
17320 Enables the @code{leadz} (leading zero) instruction.
17322 @item -mm
17323 @opindex mm
17324 Causes variables to be assigned to the @code{.near} section by default.
17326 @item -mminmax
17327 @opindex mminmax
17328 Enables the @code{min} and @code{max} instructions.
17330 @item -mmult
17331 @opindex mmult
17332 Enables the multiplication and multiply-accumulate instructions.
17334 @item -mno-opts
17335 @opindex mno-opts
17336 Disables all the optional instructions enabled by @code{-mall-opts}.
17338 @item -mrepeat
17339 @opindex mrepeat
17340 Enables the @code{repeat} and @code{erepeat} instructions, used for
17341 low-overhead looping.
17343 @item -ms
17344 @opindex ms
17345 Causes all variables to default to the @code{.tiny} section.  Note
17346 that there is a 65536-byte limit to this section.  Accesses to these
17347 variables use the @code{%gp} base register.
17349 @item -msatur
17350 @opindex msatur
17351 Enables the saturation instructions.  Note that the compiler does not
17352 currently generate these itself, but this option is included for
17353 compatibility with other tools, like @code{as}.
17355 @item -msdram
17356 @opindex msdram
17357 Link the SDRAM-based runtime instead of the default ROM-based runtime.
17359 @item -msim
17360 @opindex msim
17361 Link the simulator run-time libraries.
17363 @item -msimnovec
17364 @opindex msimnovec
17365 Link the simulator runtime libraries, excluding built-in support
17366 for reset and exception vectors and tables.
17368 @item -mtf
17369 @opindex mtf
17370 Causes all functions to default to the @code{.far} section.  Without
17371 this option, functions default to the @code{.near} section.
17373 @item -mtiny=@var{n}
17374 @opindex mtiny=
17375 Variables that are @var{n} bytes or smaller are allocated to the
17376 @code{.tiny} section.  These variables use the @code{$gp} base
17377 register.  The default for this option is 4, but note that there's a
17378 65536-byte limit to the @code{.tiny} section.
17380 @end table
17382 @node MicroBlaze Options
17383 @subsection MicroBlaze Options
17384 @cindex MicroBlaze Options
17386 @table @gcctabopt
17388 @item -msoft-float
17389 @opindex msoft-float
17390 Use software emulation for floating point (default).
17392 @item -mhard-float
17393 @opindex mhard-float
17394 Use hardware floating-point instructions.
17396 @item -mmemcpy
17397 @opindex mmemcpy
17398 Do not optimize block moves, use @code{memcpy}.
17400 @item -mno-clearbss
17401 @opindex mno-clearbss
17402 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
17404 @item -mcpu=@var{cpu-type}
17405 @opindex mcpu=
17406 Use features of, and schedule code for, the given CPU.
17407 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
17408 where @var{X} is a major version, @var{YY} is the minor version, and
17409 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
17410 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
17412 @item -mxl-soft-mul
17413 @opindex mxl-soft-mul
17414 Use software multiply emulation (default).
17416 @item -mxl-soft-div
17417 @opindex mxl-soft-div
17418 Use software emulation for divides (default).
17420 @item -mxl-barrel-shift
17421 @opindex mxl-barrel-shift
17422 Use the hardware barrel shifter.
17424 @item -mxl-pattern-compare
17425 @opindex mxl-pattern-compare
17426 Use pattern compare instructions.
17428 @item -msmall-divides
17429 @opindex msmall-divides
17430 Use table lookup optimization for small signed integer divisions.
17432 @item -mxl-stack-check
17433 @opindex mxl-stack-check
17434 This option is deprecated.  Use @option{-fstack-check} instead.
17436 @item -mxl-gp-opt
17437 @opindex mxl-gp-opt
17438 Use GP-relative @code{.sdata}/@code{.sbss} sections.
17440 @item -mxl-multiply-high
17441 @opindex mxl-multiply-high
17442 Use multiply high instructions for high part of 32x32 multiply.
17444 @item -mxl-float-convert
17445 @opindex mxl-float-convert
17446 Use hardware floating-point conversion instructions.
17448 @item -mxl-float-sqrt
17449 @opindex mxl-float-sqrt
17450 Use hardware floating-point square root instruction.
17452 @item -mbig-endian
17453 @opindex mbig-endian
17454 Generate code for a big-endian target.
17456 @item -mlittle-endian
17457 @opindex mlittle-endian
17458 Generate code for a little-endian target.
17460 @item -mxl-reorder
17461 @opindex mxl-reorder
17462 Use reorder instructions (swap and byte reversed load/store).
17464 @item -mxl-mode-@var{app-model}
17465 Select application model @var{app-model}.  Valid models are
17466 @table @samp
17467 @item executable
17468 normal executable (default), uses startup code @file{crt0.o}.
17470 @item xmdstub
17471 for use with Xilinx Microprocessor Debugger (XMD) based
17472 software intrusive debug agent called xmdstub. This uses startup file
17473 @file{crt1.o} and sets the start address of the program to 0x800.
17475 @item bootstrap
17476 for applications that are loaded using a bootloader.
17477 This model uses startup file @file{crt2.o} which does not contain a processor
17478 reset vector handler. This is suitable for transferring control on a
17479 processor reset to the bootloader rather than the application.
17481 @item novectors
17482 for applications that do not require any of the
17483 MicroBlaze vectors. This option may be useful for applications running
17484 within a monitoring application. This model uses @file{crt3.o} as a startup file.
17485 @end table
17487 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
17488 @option{-mxl-mode-@var{app-model}}.
17490 @end table
17492 @node MIPS Options
17493 @subsection MIPS Options
17494 @cindex MIPS options
17496 @table @gcctabopt
17498 @item -EB
17499 @opindex EB
17500 Generate big-endian code.
17502 @item -EL
17503 @opindex EL
17504 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
17505 configurations.
17507 @item -march=@var{arch}
17508 @opindex march
17509 Generate code that runs on @var{arch}, which can be the name of a
17510 generic MIPS ISA, or the name of a particular processor.
17511 The ISA names are:
17512 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
17513 @samp{mips32}, @samp{mips32r2}, @samp{mips32r3}, @samp{mips32r5}, 
17514 @samp{mips64}, @samp{mips64r2}, @samp{mips64r3} and @samp{mips64r5}.
17515 The processor names are:
17516 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
17517 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
17518 @samp{5kc}, @samp{5kf},
17519 @samp{20kc},
17520 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
17521 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
17522 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
17523 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
17524 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
17525 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
17526 @samp{m4k},
17527 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
17528 @samp{octeon}, @samp{octeon+}, @samp{octeon2},
17529 @samp{orion},
17530 @samp{p5600},
17531 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
17532 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
17533 @samp{rm7000}, @samp{rm9000},
17534 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
17535 @samp{sb1},
17536 @samp{sr71000},
17537 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
17538 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
17539 @samp{xlr} and @samp{xlp}.
17540 The special value @samp{from-abi} selects the
17541 most compatible architecture for the selected ABI (that is,
17542 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
17544 The native Linux/GNU toolchain also supports the value @samp{native},
17545 which selects the best architecture option for the host processor.
17546 @option{-march=native} has no effect if GCC does not recognize
17547 the processor.
17549 In processor names, a final @samp{000} can be abbreviated as @samp{k}
17550 (for example, @option{-march=r2k}).  Prefixes are optional, and
17551 @samp{vr} may be written @samp{r}.
17553 Names of the form @samp{@var{n}f2_1} refer to processors with
17554 FPUs clocked at half the rate of the core, names of the form
17555 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
17556 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
17557 processors with FPUs clocked a ratio of 3:2 with respect to the core.
17558 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
17559 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
17560 accepted as synonyms for @samp{@var{n}f1_1}.
17562 GCC defines two macros based on the value of this option.  The first
17563 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
17564 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
17565 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
17566 For example, @option{-march=r2000} sets @samp{_MIPS_ARCH}
17567 to @samp{"r2000"} and defines the macro @samp{_MIPS_ARCH_R2000}.
17569 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
17570 above.  In other words, it has the full prefix and does not
17571 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
17572 the macro names the resolved architecture (either @samp{"mips1"} or
17573 @samp{"mips3"}).  It names the default architecture when no
17574 @option{-march} option is given.
17576 @item -mtune=@var{arch}
17577 @opindex mtune
17578 Optimize for @var{arch}.  Among other things, this option controls
17579 the way instructions are scheduled, and the perceived cost of arithmetic
17580 operations.  The list of @var{arch} values is the same as for
17581 @option{-march}.
17583 When this option is not used, GCC optimizes for the processor
17584 specified by @option{-march}.  By using @option{-march} and
17585 @option{-mtune} together, it is possible to generate code that
17586 runs on a family of processors, but optimize the code for one
17587 particular member of that family.
17589 @option{-mtune} defines the macros @samp{_MIPS_TUNE} and
17590 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
17591 @option{-march} ones described above.
17593 @item -mips1
17594 @opindex mips1
17595 Equivalent to @option{-march=mips1}.
17597 @item -mips2
17598 @opindex mips2
17599 Equivalent to @option{-march=mips2}.
17601 @item -mips3
17602 @opindex mips3
17603 Equivalent to @option{-march=mips3}.
17605 @item -mips4
17606 @opindex mips4
17607 Equivalent to @option{-march=mips4}.
17609 @item -mips32
17610 @opindex mips32
17611 Equivalent to @option{-march=mips32}.
17613 @item -mips32r3
17614 @opindex mips32r3
17615 Equivalent to @option{-march=mips32r3}.
17617 @item -mips32r5
17618 @opindex mips32r5
17619 Equivalent to @option{-march=mips32r5}.
17621 @item -mips64
17622 @opindex mips64
17623 Equivalent to @option{-march=mips64}.
17625 @item -mips64r2
17626 @opindex mips64r2
17627 Equivalent to @option{-march=mips64r2}.
17629 @item -mips64r3
17630 @opindex mips64r3
17631 Equivalent to @option{-march=mips64r3}.
17633 @item -mips64r5
17634 @opindex mips64r5
17635 Equivalent to @option{-march=mips64r5}.
17637 @item -mips16
17638 @itemx -mno-mips16
17639 @opindex mips16
17640 @opindex mno-mips16
17641 Generate (do not generate) MIPS16 code.  If GCC is targeting a
17642 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
17644 MIPS16 code generation can also be controlled on a per-function basis
17645 by means of @code{mips16} and @code{nomips16} attributes.
17646 @xref{Function Attributes}, for more information.
17648 @item -mflip-mips16
17649 @opindex mflip-mips16
17650 Generate MIPS16 code on alternating functions.  This option is provided
17651 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
17652 not intended for ordinary use in compiling user code.
17654 @item -minterlink-compressed
17655 @item -mno-interlink-compressed
17656 @opindex minterlink-compressed
17657 @opindex mno-interlink-compressed
17658 Require (do not require) that code using the standard (uncompressed) MIPS ISA
17659 be link-compatible with MIPS16 and microMIPS code, and vice versa.
17661 For example, code using the standard ISA encoding cannot jump directly
17662 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
17663 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
17664 knows that the target of the jump is not compressed.
17666 @item -minterlink-mips16
17667 @itemx -mno-interlink-mips16
17668 @opindex minterlink-mips16
17669 @opindex mno-interlink-mips16
17670 Aliases of @option{-minterlink-compressed} and
17671 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
17672 and are retained for backwards compatibility.
17674 @item -mabi=32
17675 @itemx -mabi=o64
17676 @itemx -mabi=n32
17677 @itemx -mabi=64
17678 @itemx -mabi=eabi
17679 @opindex mabi=32
17680 @opindex mabi=o64
17681 @opindex mabi=n32
17682 @opindex mabi=64
17683 @opindex mabi=eabi
17684 Generate code for the given ABI@.
17686 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
17687 generates 64-bit code when you select a 64-bit architecture, but you
17688 can use @option{-mgp32} to get 32-bit code instead.
17690 For information about the O64 ABI, see
17691 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
17693 GCC supports a variant of the o32 ABI in which floating-point registers
17694 are 64 rather than 32 bits wide.  You can select this combination with
17695 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
17696 and @code{mfhc1} instructions and is therefore only supported for
17697 MIPS32R2, MIPS32R3 and MIPS32R5 processors.
17699 The register assignments for arguments and return values remain the
17700 same, but each scalar value is passed in a single 64-bit register
17701 rather than a pair of 32-bit registers.  For example, scalar
17702 floating-point values are returned in @samp{$f0} only, not a
17703 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
17704 remains the same, but all 64 bits are saved.
17706 @item -mabicalls
17707 @itemx -mno-abicalls
17708 @opindex mabicalls
17709 @opindex mno-abicalls
17710 Generate (do not generate) code that is suitable for SVR4-style
17711 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
17712 systems.
17714 @item -mshared
17715 @itemx -mno-shared
17716 Generate (do not generate) code that is fully position-independent,
17717 and that can therefore be linked into shared libraries.  This option
17718 only affects @option{-mabicalls}.
17720 All @option{-mabicalls} code has traditionally been position-independent,
17721 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
17722 as an extension, the GNU toolchain allows executables to use absolute
17723 accesses for locally-binding symbols.  It can also use shorter GP
17724 initialization sequences and generate direct calls to locally-defined
17725 functions.  This mode is selected by @option{-mno-shared}.
17727 @option{-mno-shared} depends on binutils 2.16 or higher and generates
17728 objects that can only be linked by the GNU linker.  However, the option
17729 does not affect the ABI of the final executable; it only affects the ABI
17730 of relocatable objects.  Using @option{-mno-shared} generally makes
17731 executables both smaller and quicker.
17733 @option{-mshared} is the default.
17735 @item -mplt
17736 @itemx -mno-plt
17737 @opindex mplt
17738 @opindex mno-plt
17739 Assume (do not assume) that the static and dynamic linkers
17740 support PLTs and copy relocations.  This option only affects
17741 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
17742 has no effect without @option{-msym32}.
17744 You can make @option{-mplt} the default by configuring
17745 GCC with @option{--with-mips-plt}.  The default is
17746 @option{-mno-plt} otherwise.
17748 @item -mxgot
17749 @itemx -mno-xgot
17750 @opindex mxgot
17751 @opindex mno-xgot
17752 Lift (do not lift) the usual restrictions on the size of the global
17753 offset table.
17755 GCC normally uses a single instruction to load values from the GOT@.
17756 While this is relatively efficient, it only works if the GOT
17757 is smaller than about 64k.  Anything larger causes the linker
17758 to report an error such as:
17760 @cindex relocation truncated to fit (MIPS)
17761 @smallexample
17762 relocation truncated to fit: R_MIPS_GOT16 foobar
17763 @end smallexample
17765 If this happens, you should recompile your code with @option{-mxgot}.
17766 This works with very large GOTs, although the code is also
17767 less efficient, since it takes three instructions to fetch the
17768 value of a global symbol.
17770 Note that some linkers can create multiple GOTs.  If you have such a
17771 linker, you should only need to use @option{-mxgot} when a single object
17772 file accesses more than 64k's worth of GOT entries.  Very few do.
17774 These options have no effect unless GCC is generating position
17775 independent code.
17777 @item -mgp32
17778 @opindex mgp32
17779 Assume that general-purpose registers are 32 bits wide.
17781 @item -mgp64
17782 @opindex mgp64
17783 Assume that general-purpose registers are 64 bits wide.
17785 @item -mfp32
17786 @opindex mfp32
17787 Assume that floating-point registers are 32 bits wide.
17789 @item -mfp64
17790 @opindex mfp64
17791 Assume that floating-point registers are 64 bits wide.
17793 @item -mhard-float
17794 @opindex mhard-float
17795 Use floating-point coprocessor instructions.
17797 @item -msoft-float
17798 @opindex msoft-float
17799 Do not use floating-point coprocessor instructions.  Implement
17800 floating-point calculations using library calls instead.
17802 @item -mno-float
17803 @opindex mno-float
17804 Equivalent to @option{-msoft-float}, but additionally asserts that the
17805 program being compiled does not perform any floating-point operations.
17806 This option is presently supported only by some bare-metal MIPS
17807 configurations, where it may select a special set of libraries
17808 that lack all floating-point support (including, for example, the
17809 floating-point @code{printf} formats).  
17810 If code compiled with @code{-mno-float} accidentally contains
17811 floating-point operations, it is likely to suffer a link-time
17812 or run-time failure.
17814 @item -msingle-float
17815 @opindex msingle-float
17816 Assume that the floating-point coprocessor only supports single-precision
17817 operations.
17819 @item -mdouble-float
17820 @opindex mdouble-float
17821 Assume that the floating-point coprocessor supports double-precision
17822 operations.  This is the default.
17824 @item -mabs=2008
17825 @itemx -mabs=legacy
17826 @opindex mabs=2008
17827 @opindex mabs=legacy
17828 These options control the treatment of the special not-a-number (NaN)
17829 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
17830 @code{neg.@i{fmt}} machine instructions.
17832 By default or when the @option{-mabs=legacy} is used the legacy
17833 treatment is selected.  In this case these instructions are considered
17834 arithmetic and avoided where correct operation is required and the
17835 input operand might be a NaN.  A longer sequence of instructions that
17836 manipulate the sign bit of floating-point datum manually is used
17837 instead unless the @option{-ffinite-math-only} option has also been
17838 specified.
17840 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
17841 this case these instructions are considered non-arithmetic and therefore
17842 operating correctly in all cases, including in particular where the
17843 input operand is a NaN.  These instructions are therefore always used
17844 for the respective operations.
17846 @item -mnan=2008
17847 @itemx -mnan=legacy
17848 @opindex mnan=2008
17849 @opindex mnan=legacy
17850 These options control the encoding of the special not-a-number (NaN)
17851 IEEE 754 floating-point data.
17853 The @option{-mnan=legacy} option selects the legacy encoding.  In this
17854 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
17855 significand field being 0, whereas signalling NaNs (sNaNs) are denoted
17856 by the first bit of their trailing significand field being 1.
17858 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
17859 this case qNaNs are denoted by the first bit of their trailing
17860 significand field being 1, whereas sNaNs are denoted by the first bit of
17861 their trailing significand field being 0.
17863 The default is @option{-mnan=legacy} unless GCC has been configured with
17864 @option{--with-nan=2008}.
17866 @item -mllsc
17867 @itemx -mno-llsc
17868 @opindex mllsc
17869 @opindex mno-llsc
17870 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
17871 implement atomic memory built-in functions.  When neither option is
17872 specified, GCC uses the instructions if the target architecture
17873 supports them.
17875 @option{-mllsc} is useful if the runtime environment can emulate the
17876 instructions and @option{-mno-llsc} can be useful when compiling for
17877 nonstandard ISAs.  You can make either option the default by
17878 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
17879 respectively.  @option{--with-llsc} is the default for some
17880 configurations; see the installation documentation for details.
17882 @item -mdsp
17883 @itemx -mno-dsp
17884 @opindex mdsp
17885 @opindex mno-dsp
17886 Use (do not use) revision 1 of the MIPS DSP ASE@.
17887 @xref{MIPS DSP Built-in Functions}.  This option defines the
17888 preprocessor macro @samp{__mips_dsp}.  It also defines
17889 @samp{__mips_dsp_rev} to 1.
17891 @item -mdspr2
17892 @itemx -mno-dspr2
17893 @opindex mdspr2
17894 @opindex mno-dspr2
17895 Use (do not use) revision 2 of the MIPS DSP ASE@.
17896 @xref{MIPS DSP Built-in Functions}.  This option defines the
17897 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
17898 It also defines @samp{__mips_dsp_rev} to 2.
17900 @item -msmartmips
17901 @itemx -mno-smartmips
17902 @opindex msmartmips
17903 @opindex mno-smartmips
17904 Use (do not use) the MIPS SmartMIPS ASE.
17906 @item -mpaired-single
17907 @itemx -mno-paired-single
17908 @opindex mpaired-single
17909 @opindex mno-paired-single
17910 Use (do not use) paired-single floating-point instructions.
17911 @xref{MIPS Paired-Single Support}.  This option requires
17912 hardware floating-point support to be enabled.
17914 @item -mdmx
17915 @itemx -mno-mdmx
17916 @opindex mdmx
17917 @opindex mno-mdmx
17918 Use (do not use) MIPS Digital Media Extension instructions.
17919 This option can only be used when generating 64-bit code and requires
17920 hardware floating-point support to be enabled.
17922 @item -mips3d
17923 @itemx -mno-mips3d
17924 @opindex mips3d
17925 @opindex mno-mips3d
17926 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
17927 The option @option{-mips3d} implies @option{-mpaired-single}.
17929 @item -mmicromips
17930 @itemx -mno-micromips
17931 @opindex mmicromips
17932 @opindex mno-mmicromips
17933 Generate (do not generate) microMIPS code.
17935 MicroMIPS code generation can also be controlled on a per-function basis
17936 by means of @code{micromips} and @code{nomicromips} attributes.
17937 @xref{Function Attributes}, for more information.
17939 @item -mmt
17940 @itemx -mno-mt
17941 @opindex mmt
17942 @opindex mno-mt
17943 Use (do not use) MT Multithreading instructions.
17945 @item -mmcu
17946 @itemx -mno-mcu
17947 @opindex mmcu
17948 @opindex mno-mcu
17949 Use (do not use) the MIPS MCU ASE instructions.
17951 @item -meva
17952 @itemx -mno-eva
17953 @opindex meva
17954 @opindex mno-eva
17955 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
17957 @item -mvirt
17958 @itemx -mno-virt
17959 @opindex mvirt
17960 @opindex mno-virt
17961 Use (do not use) the MIPS Virtualization Application Specific instructions.
17963 @item -mxpa
17964 @itemx -mno-xpa
17965 @opindex mxpa
17966 @opindex mno-xpa
17967 Use (do not use) the MIPS eXtended Physical Address (XPA) instructions.
17969 @item -mlong64
17970 @opindex mlong64
17971 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
17972 an explanation of the default and the way that the pointer size is
17973 determined.
17975 @item -mlong32
17976 @opindex mlong32
17977 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
17979 The default size of @code{int}s, @code{long}s and pointers depends on
17980 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
17981 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
17982 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
17983 or the same size as integer registers, whichever is smaller.
17985 @item -msym32
17986 @itemx -mno-sym32
17987 @opindex msym32
17988 @opindex mno-sym32
17989 Assume (do not assume) that all symbols have 32-bit values, regardless
17990 of the selected ABI@.  This option is useful in combination with
17991 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
17992 to generate shorter and faster references to symbolic addresses.
17994 @item -G @var{num}
17995 @opindex G
17996 Put definitions of externally-visible data in a small data section
17997 if that data is no bigger than @var{num} bytes.  GCC can then generate
17998 more efficient accesses to the data; see @option{-mgpopt} for details.
18000 The default @option{-G} option depends on the configuration.
18002 @item -mlocal-sdata
18003 @itemx -mno-local-sdata
18004 @opindex mlocal-sdata
18005 @opindex mno-local-sdata
18006 Extend (do not extend) the @option{-G} behavior to local data too,
18007 such as to static variables in C@.  @option{-mlocal-sdata} is the
18008 default for all configurations.
18010 If the linker complains that an application is using too much small data,
18011 you might want to try rebuilding the less performance-critical parts with
18012 @option{-mno-local-sdata}.  You might also want to build large
18013 libraries with @option{-mno-local-sdata}, so that the libraries leave
18014 more room for the main program.
18016 @item -mextern-sdata
18017 @itemx -mno-extern-sdata
18018 @opindex mextern-sdata
18019 @opindex mno-extern-sdata
18020 Assume (do not assume) that externally-defined data is in
18021 a small data section if the size of that data is within the @option{-G} limit.
18022 @option{-mextern-sdata} is the default for all configurations.
18024 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
18025 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
18026 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
18027 is placed in a small data section.  If @var{Var} is defined by another
18028 module, you must either compile that module with a high-enough
18029 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
18030 definition.  If @var{Var} is common, you must link the application
18031 with a high-enough @option{-G} setting.
18033 The easiest way of satisfying these restrictions is to compile
18034 and link every module with the same @option{-G} option.  However,
18035 you may wish to build a library that supports several different
18036 small data limits.  You can do this by compiling the library with
18037 the highest supported @option{-G} setting and additionally using
18038 @option{-mno-extern-sdata} to stop the library from making assumptions
18039 about externally-defined data.
18041 @item -mgpopt
18042 @itemx -mno-gpopt
18043 @opindex mgpopt
18044 @opindex mno-gpopt
18045 Use (do not use) GP-relative accesses for symbols that are known to be
18046 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
18047 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
18048 configurations.
18050 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
18051 might not hold the value of @code{_gp}.  For example, if the code is
18052 part of a library that might be used in a boot monitor, programs that
18053 call boot monitor routines pass an unknown value in @code{$gp}.
18054 (In such situations, the boot monitor itself is usually compiled
18055 with @option{-G0}.)
18057 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
18058 @option{-mno-extern-sdata}.
18060 @item -membedded-data
18061 @itemx -mno-embedded-data
18062 @opindex membedded-data
18063 @opindex mno-embedded-data
18064 Allocate variables to the read-only data section first if possible, then
18065 next in the small data section if possible, otherwise in data.  This gives
18066 slightly slower code than the default, but reduces the amount of RAM required
18067 when executing, and thus may be preferred for some embedded systems.
18069 @item -muninit-const-in-rodata
18070 @itemx -mno-uninit-const-in-rodata
18071 @opindex muninit-const-in-rodata
18072 @opindex mno-uninit-const-in-rodata
18073 Put uninitialized @code{const} variables in the read-only data section.
18074 This option is only meaningful in conjunction with @option{-membedded-data}.
18076 @item -mcode-readable=@var{setting}
18077 @opindex mcode-readable
18078 Specify whether GCC may generate code that reads from executable sections.
18079 There are three possible settings:
18081 @table @gcctabopt
18082 @item -mcode-readable=yes
18083 Instructions may freely access executable sections.  This is the
18084 default setting.
18086 @item -mcode-readable=pcrel
18087 MIPS16 PC-relative load instructions can access executable sections,
18088 but other instructions must not do so.  This option is useful on 4KSc
18089 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
18090 It is also useful on processors that can be configured to have a dual
18091 instruction/data SRAM interface and that, like the M4K, automatically
18092 redirect PC-relative loads to the instruction RAM.
18094 @item -mcode-readable=no
18095 Instructions must not access executable sections.  This option can be
18096 useful on targets that are configured to have a dual instruction/data
18097 SRAM interface but that (unlike the M4K) do not automatically redirect
18098 PC-relative loads to the instruction RAM.
18099 @end table
18101 @item -msplit-addresses
18102 @itemx -mno-split-addresses
18103 @opindex msplit-addresses
18104 @opindex mno-split-addresses
18105 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
18106 relocation operators.  This option has been superseded by
18107 @option{-mexplicit-relocs} but is retained for backwards compatibility.
18109 @item -mexplicit-relocs
18110 @itemx -mno-explicit-relocs
18111 @opindex mexplicit-relocs
18112 @opindex mno-explicit-relocs
18113 Use (do not use) assembler relocation operators when dealing with symbolic
18114 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
18115 is to use assembler macros instead.
18117 @option{-mexplicit-relocs} is the default if GCC was configured
18118 to use an assembler that supports relocation operators.
18120 @item -mcheck-zero-division
18121 @itemx -mno-check-zero-division
18122 @opindex mcheck-zero-division
18123 @opindex mno-check-zero-division
18124 Trap (do not trap) on integer division by zero.
18126 The default is @option{-mcheck-zero-division}.
18128 @item -mdivide-traps
18129 @itemx -mdivide-breaks
18130 @opindex mdivide-traps
18131 @opindex mdivide-breaks
18132 MIPS systems check for division by zero by generating either a
18133 conditional trap or a break instruction.  Using traps results in
18134 smaller code, but is only supported on MIPS II and later.  Also, some
18135 versions of the Linux kernel have a bug that prevents trap from
18136 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
18137 allow conditional traps on architectures that support them and
18138 @option{-mdivide-breaks} to force the use of breaks.
18140 The default is usually @option{-mdivide-traps}, but this can be
18141 overridden at configure time using @option{--with-divide=breaks}.
18142 Divide-by-zero checks can be completely disabled using
18143 @option{-mno-check-zero-division}.
18145 @item -mmemcpy
18146 @itemx -mno-memcpy
18147 @opindex mmemcpy
18148 @opindex mno-memcpy
18149 Force (do not force) the use of @code{memcpy()} for non-trivial block
18150 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
18151 most constant-sized copies.
18153 @item -mlong-calls
18154 @itemx -mno-long-calls
18155 @opindex mlong-calls
18156 @opindex mno-long-calls
18157 Disable (do not disable) use of the @code{jal} instruction.  Calling
18158 functions using @code{jal} is more efficient but requires the caller
18159 and callee to be in the same 256 megabyte segment.
18161 This option has no effect on abicalls code.  The default is
18162 @option{-mno-long-calls}.
18164 @item -mmad
18165 @itemx -mno-mad
18166 @opindex mmad
18167 @opindex mno-mad
18168 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
18169 instructions, as provided by the R4650 ISA@.
18171 @item -mimadd
18172 @itemx -mno-imadd
18173 @opindex mimadd
18174 @opindex mno-imadd
18175 Enable (disable) use of the @code{madd} and @code{msub} integer
18176 instructions.  The default is @option{-mimadd} on architectures
18177 that support @code{madd} and @code{msub} except for the 74k 
18178 architecture where it was found to generate slower code.
18180 @item -mfused-madd
18181 @itemx -mno-fused-madd
18182 @opindex mfused-madd
18183 @opindex mno-fused-madd
18184 Enable (disable) use of the floating-point multiply-accumulate
18185 instructions, when they are available.  The default is
18186 @option{-mfused-madd}.
18188 On the R8000 CPU when multiply-accumulate instructions are used,
18189 the intermediate product is calculated to infinite precision
18190 and is not subject to the FCSR Flush to Zero bit.  This may be
18191 undesirable in some circumstances.  On other processors the result
18192 is numerically identical to the equivalent computation using
18193 separate multiply, add, subtract and negate instructions.
18195 @item -nocpp
18196 @opindex nocpp
18197 Tell the MIPS assembler to not run its preprocessor over user
18198 assembler files (with a @samp{.s} suffix) when assembling them.
18200 @item -mfix-24k
18201 @item -mno-fix-24k
18202 @opindex mfix-24k
18203 @opindex mno-fix-24k
18204 Work around the 24K E48 (lost data on stores during refill) errata.
18205 The workarounds are implemented by the assembler rather than by GCC@.
18207 @item -mfix-r4000
18208 @itemx -mno-fix-r4000
18209 @opindex mfix-r4000
18210 @opindex mno-fix-r4000
18211 Work around certain R4000 CPU errata:
18212 @itemize @minus
18213 @item
18214 A double-word or a variable shift may give an incorrect result if executed
18215 immediately after starting an integer division.
18216 @item
18217 A double-word or a variable shift may give an incorrect result if executed
18218 while an integer multiplication is in progress.
18219 @item
18220 An integer division may give an incorrect result if started in a delay slot
18221 of a taken branch or a jump.
18222 @end itemize
18224 @item -mfix-r4400
18225 @itemx -mno-fix-r4400
18226 @opindex mfix-r4400
18227 @opindex mno-fix-r4400
18228 Work around certain R4400 CPU errata:
18229 @itemize @minus
18230 @item
18231 A double-word or a variable shift may give an incorrect result if executed
18232 immediately after starting an integer division.
18233 @end itemize
18235 @item -mfix-r10000
18236 @itemx -mno-fix-r10000
18237 @opindex mfix-r10000
18238 @opindex mno-fix-r10000
18239 Work around certain R10000 errata:
18240 @itemize @minus
18241 @item
18242 @code{ll}/@code{sc} sequences may not behave atomically on revisions
18243 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
18244 @end itemize
18246 This option can only be used if the target architecture supports
18247 branch-likely instructions.  @option{-mfix-r10000} is the default when
18248 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
18249 otherwise.
18251 @item -mfix-rm7000
18252 @itemx -mno-fix-rm7000
18253 @opindex mfix-rm7000
18254 Work around the RM7000 @code{dmult}/@code{dmultu} errata.  The
18255 workarounds are implemented by the assembler rather than by GCC@.
18257 @item -mfix-vr4120
18258 @itemx -mno-fix-vr4120
18259 @opindex mfix-vr4120
18260 Work around certain VR4120 errata:
18261 @itemize @minus
18262 @item
18263 @code{dmultu} does not always produce the correct result.
18264 @item
18265 @code{div} and @code{ddiv} do not always produce the correct result if one
18266 of the operands is negative.
18267 @end itemize
18268 The workarounds for the division errata rely on special functions in
18269 @file{libgcc.a}.  At present, these functions are only provided by
18270 the @code{mips64vr*-elf} configurations.
18272 Other VR4120 errata require a NOP to be inserted between certain pairs of
18273 instructions.  These errata are handled by the assembler, not by GCC itself.
18275 @item -mfix-vr4130
18276 @opindex mfix-vr4130
18277 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
18278 workarounds are implemented by the assembler rather than by GCC,
18279 although GCC avoids using @code{mflo} and @code{mfhi} if the
18280 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
18281 instructions are available instead.
18283 @item -mfix-sb1
18284 @itemx -mno-fix-sb1
18285 @opindex mfix-sb1
18286 Work around certain SB-1 CPU core errata.
18287 (This flag currently works around the SB-1 revision 2
18288 ``F1'' and ``F2'' floating-point errata.)
18290 @item -mr10k-cache-barrier=@var{setting}
18291 @opindex mr10k-cache-barrier
18292 Specify whether GCC should insert cache barriers to avoid the
18293 side-effects of speculation on R10K processors.
18295 In common with many processors, the R10K tries to predict the outcome
18296 of a conditional branch and speculatively executes instructions from
18297 the ``taken'' branch.  It later aborts these instructions if the
18298 predicted outcome is wrong.  However, on the R10K, even aborted
18299 instructions can have side effects.
18301 This problem only affects kernel stores and, depending on the system,
18302 kernel loads.  As an example, a speculatively-executed store may load
18303 the target memory into cache and mark the cache line as dirty, even if
18304 the store itself is later aborted.  If a DMA operation writes to the
18305 same area of memory before the ``dirty'' line is flushed, the cached
18306 data overwrites the DMA-ed data.  See the R10K processor manual
18307 for a full description, including other potential problems.
18309 One workaround is to insert cache barrier instructions before every memory
18310 access that might be speculatively executed and that might have side
18311 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
18312 controls GCC's implementation of this workaround.  It assumes that
18313 aborted accesses to any byte in the following regions does not have
18314 side effects:
18316 @enumerate
18317 @item
18318 the memory occupied by the current function's stack frame;
18320 @item
18321 the memory occupied by an incoming stack argument;
18323 @item
18324 the memory occupied by an object with a link-time-constant address.
18325 @end enumerate
18327 It is the kernel's responsibility to ensure that speculative
18328 accesses to these regions are indeed safe.
18330 If the input program contains a function declaration such as:
18332 @smallexample
18333 void foo (void);
18334 @end smallexample
18336 then the implementation of @code{foo} must allow @code{j foo} and
18337 @code{jal foo} to be executed speculatively.  GCC honors this
18338 restriction for functions it compiles itself.  It expects non-GCC
18339 functions (such as hand-written assembly code) to do the same.
18341 The option has three forms:
18343 @table @gcctabopt
18344 @item -mr10k-cache-barrier=load-store
18345 Insert a cache barrier before a load or store that might be
18346 speculatively executed and that might have side effects even
18347 if aborted.
18349 @item -mr10k-cache-barrier=store
18350 Insert a cache barrier before a store that might be speculatively
18351 executed and that might have side effects even if aborted.
18353 @item -mr10k-cache-barrier=none
18354 Disable the insertion of cache barriers.  This is the default setting.
18355 @end table
18357 @item -mflush-func=@var{func}
18358 @itemx -mno-flush-func
18359 @opindex mflush-func
18360 Specifies the function to call to flush the I and D caches, or to not
18361 call any such function.  If called, the function must take the same
18362 arguments as the common @code{_flush_func()}, that is, the address of the
18363 memory range for which the cache is being flushed, the size of the
18364 memory range, and the number 3 (to flush both caches).  The default
18365 depends on the target GCC was configured for, but commonly is either
18366 @samp{_flush_func} or @samp{__cpu_flush}.
18368 @item mbranch-cost=@var{num}
18369 @opindex mbranch-cost
18370 Set the cost of branches to roughly @var{num} ``simple'' instructions.
18371 This cost is only a heuristic and is not guaranteed to produce
18372 consistent results across releases.  A zero cost redundantly selects
18373 the default, which is based on the @option{-mtune} setting.
18375 @item -mbranch-likely
18376 @itemx -mno-branch-likely
18377 @opindex mbranch-likely
18378 @opindex mno-branch-likely
18379 Enable or disable use of Branch Likely instructions, regardless of the
18380 default for the selected architecture.  By default, Branch Likely
18381 instructions may be generated if they are supported by the selected
18382 architecture.  An exception is for the MIPS32 and MIPS64 architectures
18383 and processors that implement those architectures; for those, Branch
18384 Likely instructions are not be generated by default because the MIPS32
18385 and MIPS64 architectures specifically deprecate their use.
18387 @item -mfp-exceptions
18388 @itemx -mno-fp-exceptions
18389 @opindex mfp-exceptions
18390 Specifies whether FP exceptions are enabled.  This affects how
18391 FP instructions are scheduled for some processors.
18392 The default is that FP exceptions are
18393 enabled.
18395 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
18396 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
18397 FP pipe.
18399 @item -mvr4130-align
18400 @itemx -mno-vr4130-align
18401 @opindex mvr4130-align
18402 The VR4130 pipeline is two-way superscalar, but can only issue two
18403 instructions together if the first one is 8-byte aligned.  When this
18404 option is enabled, GCC aligns pairs of instructions that it
18405 thinks should execute in parallel.
18407 This option only has an effect when optimizing for the VR4130.
18408 It normally makes code faster, but at the expense of making it bigger.
18409 It is enabled by default at optimization level @option{-O3}.
18411 @item -msynci
18412 @itemx -mno-synci
18413 @opindex msynci
18414 Enable (disable) generation of @code{synci} instructions on
18415 architectures that support it.  The @code{synci} instructions (if
18416 enabled) are generated when @code{__builtin___clear_cache()} is
18417 compiled.
18419 This option defaults to @code{-mno-synci}, but the default can be
18420 overridden by configuring with @code{--with-synci}.
18422 When compiling code for single processor systems, it is generally safe
18423 to use @code{synci}.  However, on many multi-core (SMP) systems, it
18424 does not invalidate the instruction caches on all cores and may lead
18425 to undefined behavior.
18427 @item -mrelax-pic-calls
18428 @itemx -mno-relax-pic-calls
18429 @opindex mrelax-pic-calls
18430 Try to turn PIC calls that are normally dispatched via register
18431 @code{$25} into direct calls.  This is only possible if the linker can
18432 resolve the destination at link-time and if the destination is within
18433 range for a direct call.
18435 @option{-mrelax-pic-calls} is the default if GCC was configured to use
18436 an assembler and a linker that support the @code{.reloc} assembly
18437 directive and @code{-mexplicit-relocs} is in effect.  With
18438 @code{-mno-explicit-relocs}, this optimization can be performed by the
18439 assembler and the linker alone without help from the compiler.
18441 @item -mmcount-ra-address
18442 @itemx -mno-mcount-ra-address
18443 @opindex mmcount-ra-address
18444 @opindex mno-mcount-ra-address
18445 Emit (do not emit) code that allows @code{_mcount} to modify the
18446 calling function's return address.  When enabled, this option extends
18447 the usual @code{_mcount} interface with a new @var{ra-address}
18448 parameter, which has type @code{intptr_t *} and is passed in register
18449 @code{$12}.  @code{_mcount} can then modify the return address by
18450 doing both of the following:
18451 @itemize
18452 @item
18453 Returning the new address in register @code{$31}.
18454 @item
18455 Storing the new address in @code{*@var{ra-address}},
18456 if @var{ra-address} is nonnull.
18457 @end itemize
18459 The default is @option{-mno-mcount-ra-address}.
18461 @end table
18463 @node MMIX Options
18464 @subsection MMIX Options
18465 @cindex MMIX Options
18467 These options are defined for the MMIX:
18469 @table @gcctabopt
18470 @item -mlibfuncs
18471 @itemx -mno-libfuncs
18472 @opindex mlibfuncs
18473 @opindex mno-libfuncs
18474 Specify that intrinsic library functions are being compiled, passing all
18475 values in registers, no matter the size.
18477 @item -mepsilon
18478 @itemx -mno-epsilon
18479 @opindex mepsilon
18480 @opindex mno-epsilon
18481 Generate floating-point comparison instructions that compare with respect
18482 to the @code{rE} epsilon register.
18484 @item -mabi=mmixware
18485 @itemx -mabi=gnu
18486 @opindex mabi=mmixware
18487 @opindex mabi=gnu
18488 Generate code that passes function parameters and return values that (in
18489 the called function) are seen as registers @code{$0} and up, as opposed to
18490 the GNU ABI which uses global registers @code{$231} and up.
18492 @item -mzero-extend
18493 @itemx -mno-zero-extend
18494 @opindex mzero-extend
18495 @opindex mno-zero-extend
18496 When reading data from memory in sizes shorter than 64 bits, use (do not
18497 use) zero-extending load instructions by default, rather than
18498 sign-extending ones.
18500 @item -mknuthdiv
18501 @itemx -mno-knuthdiv
18502 @opindex mknuthdiv
18503 @opindex mno-knuthdiv
18504 Make the result of a division yielding a remainder have the same sign as
18505 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
18506 remainder follows the sign of the dividend.  Both methods are
18507 arithmetically valid, the latter being almost exclusively used.
18509 @item -mtoplevel-symbols
18510 @itemx -mno-toplevel-symbols
18511 @opindex mtoplevel-symbols
18512 @opindex mno-toplevel-symbols
18513 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
18514 code can be used with the @code{PREFIX} assembly directive.
18516 @item -melf
18517 @opindex melf
18518 Generate an executable in the ELF format, rather than the default
18519 @samp{mmo} format used by the @command{mmix} simulator.
18521 @item -mbranch-predict
18522 @itemx -mno-branch-predict
18523 @opindex mbranch-predict
18524 @opindex mno-branch-predict
18525 Use (do not use) the probable-branch instructions, when static branch
18526 prediction indicates a probable branch.
18528 @item -mbase-addresses
18529 @itemx -mno-base-addresses
18530 @opindex mbase-addresses
18531 @opindex mno-base-addresses
18532 Generate (do not generate) code that uses @emph{base addresses}.  Using a
18533 base address automatically generates a request (handled by the assembler
18534 and the linker) for a constant to be set up in a global register.  The
18535 register is used for one or more base address requests within the range 0
18536 to 255 from the value held in the register.  The generally leads to short
18537 and fast code, but the number of different data items that can be
18538 addressed is limited.  This means that a program that uses lots of static
18539 data may require @option{-mno-base-addresses}.
18541 @item -msingle-exit
18542 @itemx -mno-single-exit
18543 @opindex msingle-exit
18544 @opindex mno-single-exit
18545 Force (do not force) generated code to have a single exit point in each
18546 function.
18547 @end table
18549 @node MN10300 Options
18550 @subsection MN10300 Options
18551 @cindex MN10300 options
18553 These @option{-m} options are defined for Matsushita MN10300 architectures:
18555 @table @gcctabopt
18556 @item -mmult-bug
18557 @opindex mmult-bug
18558 Generate code to avoid bugs in the multiply instructions for the MN10300
18559 processors.  This is the default.
18561 @item -mno-mult-bug
18562 @opindex mno-mult-bug
18563 Do not generate code to avoid bugs in the multiply instructions for the
18564 MN10300 processors.
18566 @item -mam33
18567 @opindex mam33
18568 Generate code using features specific to the AM33 processor.
18570 @item -mno-am33
18571 @opindex mno-am33
18572 Do not generate code using features specific to the AM33 processor.  This
18573 is the default.
18575 @item -mam33-2
18576 @opindex mam33-2
18577 Generate code using features specific to the AM33/2.0 processor.
18579 @item -mam34
18580 @opindex mam34
18581 Generate code using features specific to the AM34 processor.
18583 @item -mtune=@var{cpu-type}
18584 @opindex mtune
18585 Use the timing characteristics of the indicated CPU type when
18586 scheduling instructions.  This does not change the targeted processor
18587 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
18588 @samp{am33-2} or @samp{am34}.
18590 @item -mreturn-pointer-on-d0
18591 @opindex mreturn-pointer-on-d0
18592 When generating a function that returns a pointer, return the pointer
18593 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
18594 only in @code{a0}, and attempts to call such functions without a prototype
18595 result in errors.  Note that this option is on by default; use
18596 @option{-mno-return-pointer-on-d0} to disable it.
18598 @item -mno-crt0
18599 @opindex mno-crt0
18600 Do not link in the C run-time initialization object file.
18602 @item -mrelax
18603 @opindex mrelax
18604 Indicate to the linker that it should perform a relaxation optimization pass
18605 to shorten branches, calls and absolute memory addresses.  This option only
18606 has an effect when used on the command line for the final link step.
18608 This option makes symbolic debugging impossible.
18610 @item -mliw
18611 @opindex mliw
18612 Allow the compiler to generate @emph{Long Instruction Word}
18613 instructions if the target is the @samp{AM33} or later.  This is the
18614 default.  This option defines the preprocessor macro @samp{__LIW__}.
18616 @item -mnoliw
18617 @opindex mnoliw
18618 Do not allow the compiler to generate @emph{Long Instruction Word}
18619 instructions.  This option defines the preprocessor macro
18620 @samp{__NO_LIW__}.
18622 @item -msetlb
18623 @opindex msetlb
18624 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
18625 instructions if the target is the @samp{AM33} or later.  This is the
18626 default.  This option defines the preprocessor macro @samp{__SETLB__}.
18628 @item -mnosetlb
18629 @opindex mnosetlb
18630 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
18631 instructions.  This option defines the preprocessor macro
18632 @samp{__NO_SETLB__}.
18634 @end table
18636 @node Moxie Options
18637 @subsection Moxie Options
18638 @cindex Moxie Options
18640 @table @gcctabopt
18642 @item -meb
18643 @opindex meb
18644 Generate big-endian code.  This is the default for @samp{moxie-*-*}
18645 configurations.
18647 @item -mel
18648 @opindex mel
18649 Generate little-endian code.
18651 @item -mno-crt0
18652 @opindex mno-crt0
18653 Do not link in the C run-time initialization object file.
18655 @end table
18657 @node MSP430 Options
18658 @subsection MSP430 Options
18659 @cindex MSP430 Options
18661 These options are defined for the MSP430:
18663 @table @gcctabopt
18665 @item -masm-hex
18666 @opindex masm-hex
18667 Force assembly output to always use hex constants.  Normally such
18668 constants are signed decimals, but this option is available for
18669 testsuite and/or aesthetic purposes.
18671 @item -mmcu=
18672 @opindex mmcu=
18673 Select the MCU to target.  This is used to create a C preprocessor
18674 symbol based upon the MCU name, converted to upper case and pre- and
18675 post- fixed with @code{__}.  This in turn will be used by the
18676 @code{msp430.h} header file to select an MCU specific supplimentary
18677 header file.
18679 The option also sets the ISA to use.  If the MCU name is one that is
18680 known to only support the 430 ISA then that is selected, otherwise the
18681 430X ISA is selected.  A generic MCU name of @code{msp430} can also be
18682 used to select the 430 ISA.  Similarly the generic @code{msp430x} MCU
18683 name will select the 430X ISA.
18685 In addition an MCU specific linker script will be added to the linker
18686 command line.  The script's name is the name of the MCU with
18687 @code{.ld} appended.  Thus specifying @option{-mmcu=xxx} on the gcc
18688 command line will define the C preprocessor symbol @code{__XXX__} and
18689 cause the linker to search for a script called @file{xxx.ld}.
18691 This option is also passed on to the assembler.
18693 @item -mcpu=
18694 @opindex -mcpu=
18695 Specifies the ISA to use.  Accepted values are @code{msp430},
18696 @code{msp430x} and @code{msp430xv2}.  This option is deprecated.  The
18697 @option{-mmcu=} option should be used to select the ISA.
18699 @item -msim
18700 @opindex msim
18701 Link to the simulator runtime libraries and linker script.  Overrides
18702 any scripts that would be selected by the @option{-mmcu=} option.
18704 @item -mlarge
18705 @opindex mlarge
18706 Use large-model addressing (20-bit pointers, 32-bit @code{size_t}).
18708 @item -msmall
18709 @opindex msmall
18710 Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
18712 @item -mrelax
18713 @opindex mrelax
18714 This option is passed to the assembler and linker, and allows the
18715 linker to perform certain optimizations that cannot be done until
18716 the final link.
18718 @item mhwmult=
18719 @opindex mhwmult=
18720 Describes the type of hardware multiply supported by the target.
18721 Accepted values are @code{none} for no hardware multiply, @code{16bit}
18722 for the original 16-bit-only multiply supported by early MCUs.
18723 @code{32bit} for the 16/32-bit multiply supported by later MCUs and
18724 @code{f5series} for the 16/32-bit multiply supported by F5-series MCUs.
18725 A value of @code{auto} can also be given.  This tells GCC to deduce
18726 the hardware multiply support based upon the MCU name provided by the
18727 @option{-mmcu} option.  If no @option{-mmcu} option is specified then
18728 @code{32bit} hardware multiply support is assumed.  @code{auto} is the
18729 default setting.
18731 Hardware multiplies are normally performed by calling a library
18732 routine.  This saves space in the generated code.  When compiling at
18733 @code{-O3} or higher however the hardware multiplier is invoked
18734 inline.  This makes for bigger, but faster code.
18736 The hardware multiply routines disable interrupts whilst running and
18737 restore the previous interrupt state when they finish.  This makes
18738 them safe to use inside interrupt handlers as well as in normal code.
18740 @item -minrt
18741 @opindex minrt
18742 Enable the use of a minimum runtime environment - no static
18743 initializers or constructors.  This is intended for memory-constrained
18744 devices.  The compiler will include special symbols in some objects
18745 that tell the linker and runtime which code fragments are required.
18747 @end table
18749 @node NDS32 Options
18750 @subsection NDS32 Options
18751 @cindex NDS32 Options
18753 These options are defined for NDS32 implementations:
18755 @table @gcctabopt
18757 @item -mbig-endian
18758 @opindex mbig-endian
18759 Generate code in big-endian mode.
18761 @item -mlittle-endian
18762 @opindex mlittle-endian
18763 Generate code in little-endian mode.
18765 @item -mreduced-regs
18766 @opindex mreduced-regs
18767 Use reduced-set registers for register allocation.
18769 @item -mfull-regs
18770 @opindex mfull-regs
18771 Use full-set registers for register allocation.
18773 @item -mcmov
18774 @opindex mcmov
18775 Generate conditional move instructions.
18777 @item -mno-cmov
18778 @opindex mno-cmov
18779 Do not generate conditional move instructions.
18781 @item -mperf-ext
18782 @opindex mperf-ext
18783 Generate performance extension instructions.
18785 @item -mno-perf-ext
18786 @opindex mno-perf-ext
18787 Do not generate performance extension instructions.
18789 @item -mv3push
18790 @opindex mv3push
18791 Generate v3 push25/pop25 instructions.
18793 @item -mno-v3push
18794 @opindex mno-v3push
18795 Do not generate v3 push25/pop25 instructions.
18797 @item -m16-bit
18798 @opindex m16-bit
18799 Generate 16-bit instructions.
18801 @item -mno-16-bit
18802 @opindex mno-16-bit
18803 Do not generate 16-bit instructions.
18805 @item -mgp-direct
18806 @opindex mgp-direct
18807 Generate GP base instructions directly.
18809 @item -mno-gp-direct
18810 @opindex mno-gp-direct
18811 Do no generate GP base instructions directly.
18813 @item -misr-vector-size=@var{num}
18814 @opindex misr-vector-size
18815 Specify the size of each interrupt vector, which must be 4 or 16.
18817 @item -mcache-block-size=@var{num}
18818 @opindex mcache-block-size
18819 Specify the size of each cache block,
18820 which must be a power of 2 between 4 and 512.
18822 @item -march=@var{arch}
18823 @opindex march
18824 Specify the name of the target architecture.
18826 @item -mforce-fp-as-gp
18827 @opindex mforce-fp-as-gp
18828 Prevent $fp being allocated during register allocation so that compiler
18829 is able to force performing fp-as-gp optimization.
18831 @item -mforbid-fp-as-gp
18832 @opindex mforbid-fp-as-gp
18833 Forbid using $fp to access static and global variables.
18834 This option strictly forbids fp-as-gp optimization
18835 regardless of @option{-mforce-fp-as-gp}.
18837 @item -mex9
18838 @opindex mex9
18839 Use special directives to guide linker doing ex9 optimization.
18841 @item -mctor-dtor
18842 @opindex mctor-dtor
18843 Enable constructor/destructor feature.
18845 @item -mrelax
18846 @opindex mrelax
18847 Guide linker to relax instructions.
18849 @end table
18851 @node Nios II Options
18852 @subsection Nios II Options
18853 @cindex Nios II options
18854 @cindex Altera Nios II options
18856 These are the options defined for the Altera Nios II processor.
18858 @table @gcctabopt
18860 @item -G @var{num}
18861 @opindex G
18862 @cindex smaller data references
18863 Put global and static objects less than or equal to @var{num} bytes
18864 into the small data or BSS sections instead of the normal data or BSS
18865 sections.  The default value of @var{num} is 8.
18867 @item -mgpopt
18868 @itemx -mno-gpopt
18869 @opindex mgpopt
18870 @opindex mno-gpopt
18871 Generate (do not generate) GP-relative accesses for objects in the
18872 small data or BSS sections.  The default is @option{-mgpopt} except
18873 when @option{-fpic} or @option{-fPIC} is specified to generate
18874 position-independent code.  Note that the Nios II ABI does not permit
18875 GP-relative accesses from shared libraries.
18877 You may need to specify @option{-mno-gpopt} explicitly when building
18878 programs that include large amounts of small data, including large
18879 GOT data sections.  In this case, the 16-bit offset for GP-relative
18880 addressing may not be large enough to allow access to the entire 
18881 small data section.
18883 @item -mel
18884 @itemx -meb
18885 @opindex mel
18886 @opindex meb
18887 Generate little-endian (default) or big-endian (experimental) code,
18888 respectively.
18890 @item -mbypass-cache
18891 @itemx -mno-bypass-cache
18892 @opindex mno-bypass-cache
18893 @opindex mbypass-cache
18894 Force all load and store instructions to always bypass cache by 
18895 using I/O variants of the instructions. The default is not to
18896 bypass the cache.
18898 @item -mno-cache-volatile 
18899 @itemx -mcache-volatile       
18900 @opindex mcache-volatile 
18901 @opindex mno-cache-volatile
18902 Volatile memory access bypass the cache using the I/O variants of 
18903 the load and store instructions. The default is not to bypass the cache.
18905 @item -mno-fast-sw-div
18906 @itemx -mfast-sw-div
18907 @opindex mno-fast-sw-div
18908 @opindex mfast-sw-div
18909 Do not use table-based fast divide for small numbers. The default 
18910 is to use the fast divide at @option{-O3} and above.
18912 @item -mno-hw-mul
18913 @itemx -mhw-mul
18914 @itemx -mno-hw-mulx
18915 @itemx -mhw-mulx
18916 @itemx -mno-hw-div
18917 @itemx -mhw-div
18918 @opindex mno-hw-mul
18919 @opindex mhw-mul
18920 @opindex mno-hw-mulx
18921 @opindex mhw-mulx
18922 @opindex mno-hw-div
18923 @opindex mhw-div
18924 Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of 
18925 instructions by the compiler. The default is to emit @code{mul}
18926 and not emit @code{div} and @code{mulx}.
18928 @item -mcustom-@var{insn}=@var{N}
18929 @itemx -mno-custom-@var{insn}
18930 @opindex mcustom-@var{insn}
18931 @opindex mno-custom-@var{insn}
18932 Each @option{-mcustom-@var{insn}=@var{N}} option enables use of a
18933 custom instruction with encoding @var{N} when generating code that uses 
18934 @var{insn}.  For example, @code{-mcustom-fadds=253} generates custom
18935 instruction 253 for single-precision floating-point add operations instead
18936 of the default behavior of using a library call.
18938 The following values of @var{insn} are supported.  Except as otherwise
18939 noted, floating-point operations are expected to be implemented with
18940 normal IEEE 754 semantics and correspond directly to the C operators or the
18941 equivalent GCC built-in functions (@pxref{Other Builtins}).
18943 Single-precision floating point:
18944 @table @asis
18946 @item @samp{fadds}, @samp{fsubs}, @samp{fdivs}, @samp{fmuls}
18947 Binary arithmetic operations.
18949 @item @samp{fnegs}
18950 Unary negation.
18952 @item @samp{fabss}
18953 Unary absolute value.
18955 @item @samp{fcmpeqs}, @samp{fcmpges}, @samp{fcmpgts}, @samp{fcmples}, @samp{fcmplts}, @samp{fcmpnes}
18956 Comparison operations.
18958 @item @samp{fmins}, @samp{fmaxs}
18959 Floating-point minimum and maximum.  These instructions are only
18960 generated if @option{-ffinite-math-only} is specified.
18962 @item @samp{fsqrts}
18963 Unary square root operation.
18965 @item @samp{fcoss}, @samp{fsins}, @samp{ftans}, @samp{fatans}, @samp{fexps}, @samp{flogs}
18966 Floating-point trigonometric and exponential functions.  These instructions
18967 are only generated if @option{-funsafe-math-optimizations} is also specified.
18969 @end table
18971 Double-precision floating point:
18972 @table @asis
18974 @item @samp{faddd}, @samp{fsubd}, @samp{fdivd}, @samp{fmuld}
18975 Binary arithmetic operations.
18977 @item @samp{fnegd}
18978 Unary negation.
18980 @item @samp{fabsd}
18981 Unary absolute value.
18983 @item @samp{fcmpeqd}, @samp{fcmpged}, @samp{fcmpgtd}, @samp{fcmpled}, @samp{fcmpltd}, @samp{fcmpned}
18984 Comparison operations.
18986 @item @samp{fmind}, @samp{fmaxd}
18987 Double-precision minimum and maximum.  These instructions are only
18988 generated if @option{-ffinite-math-only} is specified.
18990 @item @samp{fsqrtd}
18991 Unary square root operation.
18993 @item @samp{fcosd}, @samp{fsind}, @samp{ftand}, @samp{fatand}, @samp{fexpd}, @samp{flogd}
18994 Double-precision trigonometric and exponential functions.  These instructions
18995 are only generated if @option{-funsafe-math-optimizations} is also specified.
18997 @end table
18999 Conversions:
19000 @table @asis
19001 @item @samp{fextsd}
19002 Conversion from single precision to double precision.
19004 @item @samp{ftruncds}
19005 Conversion from double precision to single precision.
19007 @item @samp{fixsi}, @samp{fixsu}, @samp{fixdi}, @samp{fixdu}
19008 Conversion from floating point to signed or unsigned integer types, with
19009 truncation towards zero.
19011 @item @samp{round}
19012 Conversion from single-precision floating point to signed integer,
19013 rounding to the nearest integer and ties away from zero.
19014 This corresponds to the @code{__builtin_lroundf} function when
19015 @option{-fno-math-errno} is used.
19017 @item @samp{floatis}, @samp{floatus}, @samp{floatid}, @samp{floatud}
19018 Conversion from signed or unsigned integer types to floating-point types.
19020 @end table
19022 In addition, all of the following transfer instructions for internal
19023 registers X and Y must be provided to use any of the double-precision
19024 floating-point instructions.  Custom instructions taking two
19025 double-precision source operands expect the first operand in the
19026 64-bit register X.  The other operand (or only operand of a unary
19027 operation) is given to the custom arithmetic instruction with the
19028 least significant half in source register @var{src1} and the most
19029 significant half in @var{src2}.  A custom instruction that returns a
19030 double-precision result returns the most significant 32 bits in the
19031 destination register and the other half in 32-bit register Y.  
19032 GCC automatically generates the necessary code sequences to write
19033 register X and/or read register Y when double-precision floating-point
19034 instructions are used.
19036 @table @asis
19038 @item @samp{fwrx}
19039 Write @var{src1} into the least significant half of X and @var{src2} into
19040 the most significant half of X.
19042 @item @samp{fwry}
19043 Write @var{src1} into Y.
19045 @item @samp{frdxhi}, @samp{frdxlo}
19046 Read the most or least (respectively) significant half of X and store it in
19047 @var{dest}.
19049 @item @samp{frdy}
19050 Read the value of Y and store it into @var{dest}.
19051 @end table
19053 Note that you can gain more local control over generation of Nios II custom
19054 instructions by using the @code{target("custom-@var{insn}=@var{N}")}
19055 and @code{target("no-custom-@var{insn}")} function attributes
19056 (@pxref{Function Attributes})
19057 or pragmas (@pxref{Function Specific Option Pragmas}).
19059 @item -mcustom-fpu-cfg=@var{name}
19060 @opindex mcustom-fpu-cfg
19062 This option enables a predefined, named set of custom instruction encodings
19063 (see @option{-mcustom-@var{insn}} above).  
19064 Currently, the following sets are defined:
19066 @option{-mcustom-fpu-cfg=60-1} is equivalent to:
19067 @gccoptlist{-mcustom-fmuls=252 @gol
19068 -mcustom-fadds=253 @gol
19069 -mcustom-fsubs=254 @gol
19070 -fsingle-precision-constant}
19072 @option{-mcustom-fpu-cfg=60-2} is equivalent to:
19073 @gccoptlist{-mcustom-fmuls=252 @gol
19074 -mcustom-fadds=253 @gol
19075 -mcustom-fsubs=254 @gol
19076 -mcustom-fdivs=255 @gol
19077 -fsingle-precision-constant}
19079 @option{-mcustom-fpu-cfg=72-3} is equivalent to:
19080 @gccoptlist{-mcustom-floatus=243 @gol
19081 -mcustom-fixsi=244 @gol
19082 -mcustom-floatis=245 @gol
19083 -mcustom-fcmpgts=246 @gol
19084 -mcustom-fcmples=249 @gol
19085 -mcustom-fcmpeqs=250 @gol
19086 -mcustom-fcmpnes=251 @gol
19087 -mcustom-fmuls=252 @gol
19088 -mcustom-fadds=253 @gol
19089 -mcustom-fsubs=254 @gol
19090 -mcustom-fdivs=255 @gol
19091 -fsingle-precision-constant}
19093 Custom instruction assignments given by individual
19094 @option{-mcustom-@var{insn}=} options override those given by
19095 @option{-mcustom-fpu-cfg=}, regardless of the
19096 order of the options on the command line.
19098 Note that you can gain more local control over selection of a FPU
19099 configuration by using the @code{target("custom-fpu-cfg=@var{name}")}
19100 function attribute (@pxref{Function Attributes})
19101 or pragma (@pxref{Function Specific Option Pragmas}).
19103 @end table
19105 These additional @samp{-m} options are available for the Altera Nios II
19106 ELF (bare-metal) target:
19108 @table @gcctabopt
19110 @item -mhal
19111 @opindex mhal
19112 Link with HAL BSP.  This suppresses linking with the GCC-provided C runtime
19113 startup and termination code, and is typically used in conjunction with
19114 @option{-msys-crt0=} to specify the location of the alternate startup code
19115 provided by the HAL BSP.
19117 @item -msmallc
19118 @opindex msmallc
19119 Link with a limited version of the C library, @option{-lsmallc}, rather than
19120 Newlib.
19122 @item -msys-crt0=@var{startfile}
19123 @opindex msys-crt0
19124 @var{startfile} is the file name of the startfile (crt0) to use 
19125 when linking.  This option is only useful in conjunction with @option{-mhal}.
19127 @item -msys-lib=@var{systemlib}
19128 @opindex msys-lib
19129 @var{systemlib} is the library name of the library that provides
19130 low-level system calls required by the C library,
19131 e.g. @code{read} and @code{write}.
19132 This option is typically used to link with a library provided by a HAL BSP.
19134 @end table
19136 @node PDP-11 Options
19137 @subsection PDP-11 Options
19138 @cindex PDP-11 Options
19140 These options are defined for the PDP-11:
19142 @table @gcctabopt
19143 @item -mfpu
19144 @opindex mfpu
19145 Use hardware FPP floating point.  This is the default.  (FIS floating
19146 point on the PDP-11/40 is not supported.)
19148 @item -msoft-float
19149 @opindex msoft-float
19150 Do not use hardware floating point.
19152 @item -mac0
19153 @opindex mac0
19154 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
19156 @item -mno-ac0
19157 @opindex mno-ac0
19158 Return floating-point results in memory.  This is the default.
19160 @item -m40
19161 @opindex m40
19162 Generate code for a PDP-11/40.
19164 @item -m45
19165 @opindex m45
19166 Generate code for a PDP-11/45.  This is the default.
19168 @item -m10
19169 @opindex m10
19170 Generate code for a PDP-11/10.
19172 @item -mbcopy-builtin
19173 @opindex mbcopy-builtin
19174 Use inline @code{movmemhi} patterns for copying memory.  This is the
19175 default.
19177 @item -mbcopy
19178 @opindex mbcopy
19179 Do not use inline @code{movmemhi} patterns for copying memory.
19181 @item -mint16
19182 @itemx -mno-int32
19183 @opindex mint16
19184 @opindex mno-int32
19185 Use 16-bit @code{int}.  This is the default.
19187 @item -mint32
19188 @itemx -mno-int16
19189 @opindex mint32
19190 @opindex mno-int16
19191 Use 32-bit @code{int}.
19193 @item -mfloat64
19194 @itemx -mno-float32
19195 @opindex mfloat64
19196 @opindex mno-float32
19197 Use 64-bit @code{float}.  This is the default.
19199 @item -mfloat32
19200 @itemx -mno-float64
19201 @opindex mfloat32
19202 @opindex mno-float64
19203 Use 32-bit @code{float}.
19205 @item -mabshi
19206 @opindex mabshi
19207 Use @code{abshi2} pattern.  This is the default.
19209 @item -mno-abshi
19210 @opindex mno-abshi
19211 Do not use @code{abshi2} pattern.
19213 @item -mbranch-expensive
19214 @opindex mbranch-expensive
19215 Pretend that branches are expensive.  This is for experimenting with
19216 code generation only.
19218 @item -mbranch-cheap
19219 @opindex mbranch-cheap
19220 Do not pretend that branches are expensive.  This is the default.
19222 @item -munix-asm
19223 @opindex munix-asm
19224 Use Unix assembler syntax.  This is the default when configured for
19225 @samp{pdp11-*-bsd}.
19227 @item -mdec-asm
19228 @opindex mdec-asm
19229 Use DEC assembler syntax.  This is the default when configured for any
19230 PDP-11 target other than @samp{pdp11-*-bsd}.
19231 @end table
19233 @node picoChip Options
19234 @subsection picoChip Options
19235 @cindex picoChip options
19237 These @samp{-m} options are defined for picoChip implementations:
19239 @table @gcctabopt
19241 @item -mae=@var{ae_type}
19242 @opindex mcpu
19243 Set the instruction set, register set, and instruction scheduling
19244 parameters for array element type @var{ae_type}.  Supported values
19245 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
19247 @option{-mae=ANY} selects a completely generic AE type.  Code
19248 generated with this option runs on any of the other AE types.  The
19249 code is not as efficient as it would be if compiled for a specific
19250 AE type, and some types of operation (e.g., multiplication) do not
19251 work properly on all types of AE.
19253 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
19254 for compiled code, and is the default.
19256 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
19257 option may suffer from poor performance of byte (char) manipulation,
19258 since the DSP AE does not provide hardware support for byte load/stores.
19260 @item -msymbol-as-address
19261 Enable the compiler to directly use a symbol name as an address in a
19262 load/store instruction, without first loading it into a
19263 register.  Typically, the use of this option generates larger
19264 programs, which run faster than when the option isn't used.  However, the
19265 results vary from program to program, so it is left as a user option,
19266 rather than being permanently enabled.
19268 @item -mno-inefficient-warnings
19269 Disables warnings about the generation of inefficient code.  These
19270 warnings can be generated, for example, when compiling code that
19271 performs byte-level memory operations on the MAC AE type.  The MAC AE has
19272 no hardware support for byte-level memory operations, so all byte
19273 load/stores must be synthesized from word load/store operations.  This is
19274 inefficient and a warning is generated to indicate
19275 that you should rewrite the code to avoid byte operations, or to target
19276 an AE type that has the necessary hardware support.  This option disables
19277 these warnings.
19279 @end table
19281 @node PowerPC Options
19282 @subsection PowerPC Options
19283 @cindex PowerPC options
19285 These are listed under @xref{RS/6000 and PowerPC Options}.
19287 @node RL78 Options
19288 @subsection RL78 Options
19289 @cindex RL78 Options
19291 @table @gcctabopt
19293 @item -msim
19294 @opindex msim
19295 Links in additional target libraries to support operation within a
19296 simulator.
19298 @item -mmul=none
19299 @itemx -mmul=g13
19300 @itemx -mmul=rl78
19301 @opindex mmul
19302 Specifies the type of hardware multiplication support to be used.  The
19303 default is @code{none}, which uses software multiplication functions.
19304 The @code{g13} option is for the hardware multiply/divide peripheral
19305 only on the RL78/G13 targets.  The @code{rl78} option is for the
19306 standard hardware multiplication defined in the RL78 software manual.
19308 @item -m64bit-doubles
19309 @itemx -m32bit-doubles
19310 @opindex m64bit-doubles
19311 @opindex m32bit-doubles
19312 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
19313 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
19314 @option{-m32bit-doubles}.
19316 @end table
19318 @node RS/6000 and PowerPC Options
19319 @subsection IBM RS/6000 and PowerPC Options
19320 @cindex RS/6000 and PowerPC Options
19321 @cindex IBM RS/6000 and PowerPC Options
19323 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
19324 @table @gcctabopt
19325 @item -mpowerpc-gpopt
19326 @itemx -mno-powerpc-gpopt
19327 @itemx -mpowerpc-gfxopt
19328 @itemx -mno-powerpc-gfxopt
19329 @need 800
19330 @itemx -mpowerpc64
19331 @itemx -mno-powerpc64
19332 @itemx -mmfcrf
19333 @itemx -mno-mfcrf
19334 @itemx -mpopcntb
19335 @itemx -mno-popcntb
19336 @itemx -mpopcntd
19337 @itemx -mno-popcntd
19338 @itemx -mfprnd
19339 @itemx -mno-fprnd
19340 @need 800
19341 @itemx -mcmpb
19342 @itemx -mno-cmpb
19343 @itemx -mmfpgpr
19344 @itemx -mno-mfpgpr
19345 @itemx -mhard-dfp
19346 @itemx -mno-hard-dfp
19347 @opindex mpowerpc-gpopt
19348 @opindex mno-powerpc-gpopt
19349 @opindex mpowerpc-gfxopt
19350 @opindex mno-powerpc-gfxopt
19351 @opindex mpowerpc64
19352 @opindex mno-powerpc64
19353 @opindex mmfcrf
19354 @opindex mno-mfcrf
19355 @opindex mpopcntb
19356 @opindex mno-popcntb
19357 @opindex mpopcntd
19358 @opindex mno-popcntd
19359 @opindex mfprnd
19360 @opindex mno-fprnd
19361 @opindex mcmpb
19362 @opindex mno-cmpb
19363 @opindex mmfpgpr
19364 @opindex mno-mfpgpr
19365 @opindex mhard-dfp
19366 @opindex mno-hard-dfp
19367 You use these options to specify which instructions are available on the
19368 processor you are using.  The default value of these options is
19369 determined when configuring GCC@.  Specifying the
19370 @option{-mcpu=@var{cpu_type}} overrides the specification of these
19371 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
19372 rather than the options listed above.
19374 Specifying @option{-mpowerpc-gpopt} allows
19375 GCC to use the optional PowerPC architecture instructions in the
19376 General Purpose group, including floating-point square root.  Specifying
19377 @option{-mpowerpc-gfxopt} allows GCC to
19378 use the optional PowerPC architecture instructions in the Graphics
19379 group, including floating-point select.
19381 The @option{-mmfcrf} option allows GCC to generate the move from
19382 condition register field instruction implemented on the POWER4
19383 processor and other processors that support the PowerPC V2.01
19384 architecture.
19385 The @option{-mpopcntb} option allows GCC to generate the popcount and
19386 double-precision FP reciprocal estimate instruction implemented on the
19387 POWER5 processor and other processors that support the PowerPC V2.02
19388 architecture.
19389 The @option{-mpopcntd} option allows GCC to generate the popcount
19390 instruction implemented on the POWER7 processor and other processors
19391 that support the PowerPC V2.06 architecture.
19392 The @option{-mfprnd} option allows GCC to generate the FP round to
19393 integer instructions implemented on the POWER5+ processor and other
19394 processors that support the PowerPC V2.03 architecture.
19395 The @option{-mcmpb} option allows GCC to generate the compare bytes
19396 instruction implemented on the POWER6 processor and other processors
19397 that support the PowerPC V2.05 architecture.
19398 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
19399 general-purpose register instructions implemented on the POWER6X
19400 processor and other processors that support the extended PowerPC V2.05
19401 architecture.
19402 The @option{-mhard-dfp} option allows GCC to generate the decimal
19403 floating-point instructions implemented on some POWER processors.
19405 The @option{-mpowerpc64} option allows GCC to generate the additional
19406 64-bit instructions that are found in the full PowerPC64 architecture
19407 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
19408 @option{-mno-powerpc64}.
19410 @item -mcpu=@var{cpu_type}
19411 @opindex mcpu
19412 Set architecture type, register usage, and
19413 instruction scheduling parameters for machine type @var{cpu_type}.
19414 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
19415 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
19416 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
19417 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
19418 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
19419 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
19420 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
19421 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
19422 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
19423 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8}, @samp{powerpc},
19424 @samp{powerpc64}, and @samp{rs64}.
19426 @option{-mcpu=powerpc}, and @option{-mcpu=powerpc64} specify pure 32-bit
19427 PowerPC and 64-bit PowerPC architecture machine
19428 types, with an appropriate, generic processor model assumed for
19429 scheduling purposes.
19431 The other options specify a specific processor.  Code generated under
19432 those options runs best on that processor, and may not run at all on
19433 others.
19435 The @option{-mcpu} options automatically enable or disable the
19436 following options:
19438 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
19439 -mpopcntb -mpopcntd  -mpowerpc64 @gol
19440 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
19441 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
19442 -mcrypto -mdirect-move -mpower8-fusion -mpower8-vector @gol
19443 -mquad-memory -mquad-memory-atomic}
19445 The particular options set for any particular CPU varies between
19446 compiler versions, depending on what setting seems to produce optimal
19447 code for that CPU; it doesn't necessarily reflect the actual hardware's
19448 capabilities.  If you wish to set an individual option to a particular
19449 value, you may specify it after the @option{-mcpu} option, like
19450 @option{-mcpu=970 -mno-altivec}.
19452 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
19453 not enabled or disabled by the @option{-mcpu} option at present because
19454 AIX does not have full support for these options.  You may still
19455 enable or disable them individually if you're sure it'll work in your
19456 environment.
19458 @item -mtune=@var{cpu_type}
19459 @opindex mtune
19460 Set the instruction scheduling parameters for machine type
19461 @var{cpu_type}, but do not set the architecture type or register usage,
19462 as @option{-mcpu=@var{cpu_type}} does.  The same
19463 values for @var{cpu_type} are used for @option{-mtune} as for
19464 @option{-mcpu}.  If both are specified, the code generated uses the
19465 architecture and registers set by @option{-mcpu}, but the
19466 scheduling parameters set by @option{-mtune}.
19468 @item -mcmodel=small
19469 @opindex mcmodel=small
19470 Generate PowerPC64 code for the small model: The TOC is limited to
19471 64k.
19473 @item -mcmodel=medium
19474 @opindex mcmodel=medium
19475 Generate PowerPC64 code for the medium model: The TOC and other static
19476 data may be up to a total of 4G in size.
19478 @item -mcmodel=large
19479 @opindex mcmodel=large
19480 Generate PowerPC64 code for the large model: The TOC may be up to 4G
19481 in size.  Other data and code is only limited by the 64-bit address
19482 space.
19484 @item -maltivec
19485 @itemx -mno-altivec
19486 @opindex maltivec
19487 @opindex mno-altivec
19488 Generate code that uses (does not use) AltiVec instructions, and also
19489 enable the use of built-in functions that allow more direct access to
19490 the AltiVec instruction set.  You may also need to set
19491 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
19492 enhancements.
19494 When @option{-maltivec} is used, rather than @option{-maltivec=le} or
19495 @option{-maltivec=be}, the element order for Altivec intrinsics such
19496 as @code{vec_splat}, @code{vec_extract}, and @code{vec_insert} will
19497 match array element order corresponding to the endianness of the
19498 target.  That is, element zero identifies the leftmost element in a
19499 vector register when targeting a big-endian platform, and identifies
19500 the rightmost element in a vector register when targeting a
19501 little-endian platform.
19503 @item -maltivec=be
19504 @opindex maltivec=be
19505 Generate Altivec instructions using big-endian element order,
19506 regardless of whether the target is big- or little-endian.  This is
19507 the default when targeting a big-endian platform.
19509 The element order is used to interpret element numbers in Altivec
19510 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
19511 @code{vec_insert}.  By default, these will match array element order
19512 corresponding to the endianness for the target.
19514 @item -maltivec=le
19515 @opindex maltivec=le
19516 Generate Altivec instructions using little-endian element order,
19517 regardless of whether the target is big- or little-endian.  This is
19518 the default when targeting a little-endian platform.  This option is
19519 currently ignored when targeting a big-endian platform.
19521 The element order is used to interpret element numbers in Altivec
19522 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
19523 @code{vec_insert}.  By default, these will match array element order
19524 corresponding to the endianness for the target.
19526 @item -mvrsave
19527 @itemx -mno-vrsave
19528 @opindex mvrsave
19529 @opindex mno-vrsave
19530 Generate VRSAVE instructions when generating AltiVec code.
19532 @item -mgen-cell-microcode
19533 @opindex mgen-cell-microcode
19534 Generate Cell microcode instructions.
19536 @item -mwarn-cell-microcode
19537 @opindex mwarn-cell-microcode
19538 Warn when a Cell microcode instruction is emitted.  An example
19539 of a Cell microcode instruction is a variable shift.
19541 @item -msecure-plt
19542 @opindex msecure-plt
19543 Generate code that allows @command{ld} and @command{ld.so}
19544 to build executables and shared
19545 libraries with non-executable @code{.plt} and @code{.got} sections.
19546 This is a PowerPC
19547 32-bit SYSV ABI option.
19549 @item -mbss-plt
19550 @opindex mbss-plt
19551 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
19552 fills in, and
19553 requires @code{.plt} and @code{.got}
19554 sections that are both writable and executable.
19555 This is a PowerPC 32-bit SYSV ABI option.
19557 @item -misel
19558 @itemx -mno-isel
19559 @opindex misel
19560 @opindex mno-isel
19561 This switch enables or disables the generation of ISEL instructions.
19563 @item -misel=@var{yes/no}
19564 This switch has been deprecated.  Use @option{-misel} and
19565 @option{-mno-isel} instead.
19567 @item -mspe
19568 @itemx -mno-spe
19569 @opindex mspe
19570 @opindex mno-spe
19571 This switch enables or disables the generation of SPE simd
19572 instructions.
19574 @item -mpaired
19575 @itemx -mno-paired
19576 @opindex mpaired
19577 @opindex mno-paired
19578 This switch enables or disables the generation of PAIRED simd
19579 instructions.
19581 @item -mspe=@var{yes/no}
19582 This option has been deprecated.  Use @option{-mspe} and
19583 @option{-mno-spe} instead.
19585 @item -mvsx
19586 @itemx -mno-vsx
19587 @opindex mvsx
19588 @opindex mno-vsx
19589 Generate code that uses (does not use) vector/scalar (VSX)
19590 instructions, and also enable the use of built-in functions that allow
19591 more direct access to the VSX instruction set.
19593 @item -mcrypto
19594 @itemx -mno-crypto
19595 @opindex mcrypto
19596 @opindex mno-crypto
19597 Enable the use (disable) of the built-in functions that allow direct
19598 access to the cryptographic instructions that were added in version
19599 2.07 of the PowerPC ISA.
19601 @item -mdirect-move
19602 @itemx -mno-direct-move
19603 @opindex mdirect-move
19604 @opindex mno-direct-move
19605 Generate code that uses (does not use) the instructions to move data
19606 between the general purpose registers and the vector/scalar (VSX)
19607 registers that were added in version 2.07 of the PowerPC ISA.
19609 @item -mpower8-fusion
19610 @itemx -mno-power8-fusion
19611 @opindex mpower8-fusion
19612 @opindex mno-power8-fusion
19613 Generate code that keeps (does not keeps) some integer operations
19614 adjacent so that the instructions can be fused together on power8 and
19615 later processors.
19617 @item -mpower8-vector
19618 @itemx -mno-power8-vector
19619 @opindex mpower8-vector
19620 @opindex mno-power8-vector
19621 Generate code that uses (does not use) the vector and scalar
19622 instructions that were added in version 2.07 of the PowerPC ISA.  Also
19623 enable the use of built-in functions that allow more direct access to
19624 the vector instructions.
19626 @item -mquad-memory
19627 @itemx -mno-quad-memory
19628 @opindex mquad-memory
19629 @opindex mno-quad-memory
19630 Generate code that uses (does not use) the non-atomic quad word memory
19631 instructions.  The @option{-mquad-memory} option requires use of
19632 64-bit mode.
19634 @item -mquad-memory-atomic
19635 @itemx -mno-quad-memory-atomic
19636 @opindex mquad-memory-atomic
19637 @opindex mno-quad-memory-atomic
19638 Generate code that uses (does not use) the atomic quad word memory
19639 instructions.  The @option{-mquad-memory-atomic} option requires use of
19640 64-bit mode.
19642 @item -mfloat-gprs=@var{yes/single/double/no}
19643 @itemx -mfloat-gprs
19644 @opindex mfloat-gprs
19645 This switch enables or disables the generation of floating-point
19646 operations on the general-purpose registers for architectures that
19647 support it.
19649 The argument @var{yes} or @var{single} enables the use of
19650 single-precision floating-point operations.
19652 The argument @var{double} enables the use of single and
19653 double-precision floating-point operations.
19655 The argument @var{no} disables floating-point operations on the
19656 general-purpose registers.
19658 This option is currently only available on the MPC854x.
19660 @item -m32
19661 @itemx -m64
19662 @opindex m32
19663 @opindex m64
19664 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
19665 targets (including GNU/Linux).  The 32-bit environment sets int, long
19666 and pointer to 32 bits and generates code that runs on any PowerPC
19667 variant.  The 64-bit environment sets int to 32 bits and long and
19668 pointer to 64 bits, and generates code for PowerPC64, as for
19669 @option{-mpowerpc64}.
19671 @item -mfull-toc
19672 @itemx -mno-fp-in-toc
19673 @itemx -mno-sum-in-toc
19674 @itemx -mminimal-toc
19675 @opindex mfull-toc
19676 @opindex mno-fp-in-toc
19677 @opindex mno-sum-in-toc
19678 @opindex mminimal-toc
19679 Modify generation of the TOC (Table Of Contents), which is created for
19680 every executable file.  The @option{-mfull-toc} option is selected by
19681 default.  In that case, GCC allocates at least one TOC entry for
19682 each unique non-automatic variable reference in your program.  GCC
19683 also places floating-point constants in the TOC@.  However, only
19684 16,384 entries are available in the TOC@.
19686 If you receive a linker error message that saying you have overflowed
19687 the available TOC space, you can reduce the amount of TOC space used
19688 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
19689 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
19690 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
19691 generate code to calculate the sum of an address and a constant at
19692 run time instead of putting that sum into the TOC@.  You may specify one
19693 or both of these options.  Each causes GCC to produce very slightly
19694 slower and larger code at the expense of conserving TOC space.
19696 If you still run out of space in the TOC even when you specify both of
19697 these options, specify @option{-mminimal-toc} instead.  This option causes
19698 GCC to make only one TOC entry for every file.  When you specify this
19699 option, GCC produces code that is slower and larger but which
19700 uses extremely little TOC space.  You may wish to use this option
19701 only on files that contain less frequently-executed code.
19703 @item -maix64
19704 @itemx -maix32
19705 @opindex maix64
19706 @opindex maix32
19707 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
19708 @code{long} type, and the infrastructure needed to support them.
19709 Specifying @option{-maix64} implies @option{-mpowerpc64},
19710 while @option{-maix32} disables the 64-bit ABI and
19711 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
19713 @item -mxl-compat
19714 @itemx -mno-xl-compat
19715 @opindex mxl-compat
19716 @opindex mno-xl-compat
19717 Produce code that conforms more closely to IBM XL compiler semantics
19718 when using AIX-compatible ABI@.  Pass floating-point arguments to
19719 prototyped functions beyond the register save area (RSA) on the stack
19720 in addition to argument FPRs.  Do not assume that most significant
19721 double in 128-bit long double value is properly rounded when comparing
19722 values and converting to double.  Use XL symbol names for long double
19723 support routines.
19725 The AIX calling convention was extended but not initially documented to
19726 handle an obscure K&R C case of calling a function that takes the
19727 address of its arguments with fewer arguments than declared.  IBM XL
19728 compilers access floating-point arguments that do not fit in the
19729 RSA from the stack when a subroutine is compiled without
19730 optimization.  Because always storing floating-point arguments on the
19731 stack is inefficient and rarely needed, this option is not enabled by
19732 default and only is necessary when calling subroutines compiled by IBM
19733 XL compilers without optimization.
19735 @item -mpe
19736 @opindex mpe
19737 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
19738 application written to use message passing with special startup code to
19739 enable the application to run.  The system must have PE installed in the
19740 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
19741 must be overridden with the @option{-specs=} option to specify the
19742 appropriate directory location.  The Parallel Environment does not
19743 support threads, so the @option{-mpe} option and the @option{-pthread}
19744 option are incompatible.
19746 @item -malign-natural
19747 @itemx -malign-power
19748 @opindex malign-natural
19749 @opindex malign-power
19750 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
19751 @option{-malign-natural} overrides the ABI-defined alignment of larger
19752 types, such as floating-point doubles, on their natural size-based boundary.
19753 The option @option{-malign-power} instructs GCC to follow the ABI-specified
19754 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
19756 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
19757 is not supported.
19759 @item -msoft-float
19760 @itemx -mhard-float
19761 @opindex msoft-float
19762 @opindex mhard-float
19763 Generate code that does not use (uses) the floating-point register set.
19764 Software floating-point emulation is provided if you use the
19765 @option{-msoft-float} option, and pass the option to GCC when linking.
19767 @item -msingle-float
19768 @itemx -mdouble-float
19769 @opindex msingle-float
19770 @opindex mdouble-float
19771 Generate code for single- or double-precision floating-point operations.
19772 @option{-mdouble-float} implies @option{-msingle-float}.
19774 @item -msimple-fpu
19775 @opindex msimple-fpu
19776 Do not generate @code{sqrt} and @code{div} instructions for hardware
19777 floating-point unit.
19779 @item -mfpu=@var{name}
19780 @opindex mfpu
19781 Specify type of floating-point unit.  Valid values for @var{name} are
19782 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
19783 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
19784 @samp{sp_full} (equivalent to @option{-msingle-float}),
19785 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
19787 @item -mxilinx-fpu
19788 @opindex mxilinx-fpu
19789 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
19791 @item -mmultiple
19792 @itemx -mno-multiple
19793 @opindex mmultiple
19794 @opindex mno-multiple
19795 Generate code that uses (does not use) the load multiple word
19796 instructions and the store multiple word instructions.  These
19797 instructions are generated by default on POWER systems, and not
19798 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
19799 PowerPC systems, since those instructions do not work when the
19800 processor is in little-endian mode.  The exceptions are PPC740 and
19801 PPC750 which permit these instructions in little-endian mode.
19803 @item -mstring
19804 @itemx -mno-string
19805 @opindex mstring
19806 @opindex mno-string
19807 Generate code that uses (does not use) the load string instructions
19808 and the store string word instructions to save multiple registers and
19809 do small block moves.  These instructions are generated by default on
19810 POWER systems, and not generated on PowerPC systems.  Do not use
19811 @option{-mstring} on little-endian PowerPC systems, since those
19812 instructions do not work when the processor is in little-endian mode.
19813 The exceptions are PPC740 and PPC750 which permit these instructions
19814 in little-endian mode.
19816 @item -mupdate
19817 @itemx -mno-update
19818 @opindex mupdate
19819 @opindex mno-update
19820 Generate code that uses (does not use) the load or store instructions
19821 that update the base register to the address of the calculated memory
19822 location.  These instructions are generated by default.  If you use
19823 @option{-mno-update}, there is a small window between the time that the
19824 stack pointer is updated and the address of the previous frame is
19825 stored, which means code that walks the stack frame across interrupts or
19826 signals may get corrupted data.
19828 @item -mavoid-indexed-addresses
19829 @itemx -mno-avoid-indexed-addresses
19830 @opindex mavoid-indexed-addresses
19831 @opindex mno-avoid-indexed-addresses
19832 Generate code that tries to avoid (not avoid) the use of indexed load
19833 or store instructions. These instructions can incur a performance
19834 penalty on Power6 processors in certain situations, such as when
19835 stepping through large arrays that cross a 16M boundary.  This option
19836 is enabled by default when targeting Power6 and disabled otherwise.
19838 @item -mfused-madd
19839 @itemx -mno-fused-madd
19840 @opindex mfused-madd
19841 @opindex mno-fused-madd
19842 Generate code that uses (does not use) the floating-point multiply and
19843 accumulate instructions.  These instructions are generated by default
19844 if hardware floating point is used.  The machine-dependent
19845 @option{-mfused-madd} option is now mapped to the machine-independent
19846 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
19847 mapped to @option{-ffp-contract=off}.
19849 @item -mmulhw
19850 @itemx -mno-mulhw
19851 @opindex mmulhw
19852 @opindex mno-mulhw
19853 Generate code that uses (does not use) the half-word multiply and
19854 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
19855 These instructions are generated by default when targeting those
19856 processors.
19858 @item -mdlmzb
19859 @itemx -mno-dlmzb
19860 @opindex mdlmzb
19861 @opindex mno-dlmzb
19862 Generate code that uses (does not use) the string-search @samp{dlmzb}
19863 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
19864 generated by default when targeting those processors.
19866 @item -mno-bit-align
19867 @itemx -mbit-align
19868 @opindex mno-bit-align
19869 @opindex mbit-align
19870 On System V.4 and embedded PowerPC systems do not (do) force structures
19871 and unions that contain bit-fields to be aligned to the base type of the
19872 bit-field.
19874 For example, by default a structure containing nothing but 8
19875 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
19876 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
19877 the structure is aligned to a 1-byte boundary and is 1 byte in
19878 size.
19880 @item -mno-strict-align
19881 @itemx -mstrict-align
19882 @opindex mno-strict-align
19883 @opindex mstrict-align
19884 On System V.4 and embedded PowerPC systems do not (do) assume that
19885 unaligned memory references are handled by the system.
19887 @item -mrelocatable
19888 @itemx -mno-relocatable
19889 @opindex mrelocatable
19890 @opindex mno-relocatable
19891 Generate code that allows (does not allow) a static executable to be
19892 relocated to a different address at run time.  A simple embedded
19893 PowerPC system loader should relocate the entire contents of
19894 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
19895 a table of 32-bit addresses generated by this option.  For this to
19896 work, all objects linked together must be compiled with
19897 @option{-mrelocatable} or @option{-mrelocatable-lib}.
19898 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
19900 @item -mrelocatable-lib
19901 @itemx -mno-relocatable-lib
19902 @opindex mrelocatable-lib
19903 @opindex mno-relocatable-lib
19904 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
19905 @code{.fixup} section to allow static executables to be relocated at
19906 run time, but @option{-mrelocatable-lib} does not use the smaller stack
19907 alignment of @option{-mrelocatable}.  Objects compiled with
19908 @option{-mrelocatable-lib} may be linked with objects compiled with
19909 any combination of the @option{-mrelocatable} options.
19911 @item -mno-toc
19912 @itemx -mtoc
19913 @opindex mno-toc
19914 @opindex mtoc
19915 On System V.4 and embedded PowerPC systems do not (do) assume that
19916 register 2 contains a pointer to a global area pointing to the addresses
19917 used in the program.
19919 @item -mlittle
19920 @itemx -mlittle-endian
19921 @opindex mlittle
19922 @opindex mlittle-endian
19923 On System V.4 and embedded PowerPC systems compile code for the
19924 processor in little-endian mode.  The @option{-mlittle-endian} option is
19925 the same as @option{-mlittle}.
19927 @item -mbig
19928 @itemx -mbig-endian
19929 @opindex mbig
19930 @opindex mbig-endian
19931 On System V.4 and embedded PowerPC systems compile code for the
19932 processor in big-endian mode.  The @option{-mbig-endian} option is
19933 the same as @option{-mbig}.
19935 @item -mdynamic-no-pic
19936 @opindex mdynamic-no-pic
19937 On Darwin and Mac OS X systems, compile code so that it is not
19938 relocatable, but that its external references are relocatable.  The
19939 resulting code is suitable for applications, but not shared
19940 libraries.
19942 @item -msingle-pic-base
19943 @opindex msingle-pic-base
19944 Treat the register used for PIC addressing as read-only, rather than
19945 loading it in the prologue for each function.  The runtime system is
19946 responsible for initializing this register with an appropriate value
19947 before execution begins.
19949 @item -mprioritize-restricted-insns=@var{priority}
19950 @opindex mprioritize-restricted-insns
19951 This option controls the priority that is assigned to
19952 dispatch-slot restricted instructions during the second scheduling
19953 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
19954 or @samp{2} to assign no, highest, or second-highest (respectively) 
19955 priority to dispatch-slot restricted
19956 instructions.
19958 @item -msched-costly-dep=@var{dependence_type}
19959 @opindex msched-costly-dep
19960 This option controls which dependences are considered costly
19961 by the target during instruction scheduling.  The argument
19962 @var{dependence_type} takes one of the following values:
19964 @table @asis
19965 @item @samp{no}
19966 No dependence is costly.
19968 @item @samp{all}
19969 All dependences are costly.
19971 @item @samp{true_store_to_load}
19972 A true dependence from store to load is costly.
19974 @item @samp{store_to_load}
19975 Any dependence from store to load is costly.
19977 @item @var{number}
19978 Any dependence for which the latency is greater than or equal to 
19979 @var{number} is costly.
19980 @end table
19982 @item -minsert-sched-nops=@var{scheme}
19983 @opindex minsert-sched-nops
19984 This option controls which NOP insertion scheme is used during
19985 the second scheduling pass.  The argument @var{scheme} takes one of the
19986 following values:
19988 @table @asis
19989 @item @samp{no}
19990 Don't insert NOPs.
19992 @item @samp{pad}
19993 Pad with NOPs any dispatch group that has vacant issue slots,
19994 according to the scheduler's grouping.
19996 @item @samp{regroup_exact}
19997 Insert NOPs to force costly dependent insns into
19998 separate groups.  Insert exactly as many NOPs as needed to force an insn
19999 to a new group, according to the estimated processor grouping.
20001 @item @var{number}
20002 Insert NOPs to force costly dependent insns into
20003 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
20004 @end table
20006 @item -mcall-sysv
20007 @opindex mcall-sysv
20008 On System V.4 and embedded PowerPC systems compile code using calling
20009 conventions that adhere to the March 1995 draft of the System V
20010 Application Binary Interface, PowerPC processor supplement.  This is the
20011 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
20013 @item -mcall-sysv-eabi
20014 @itemx -mcall-eabi
20015 @opindex mcall-sysv-eabi
20016 @opindex mcall-eabi
20017 Specify both @option{-mcall-sysv} and @option{-meabi} options.
20019 @item -mcall-sysv-noeabi
20020 @opindex mcall-sysv-noeabi
20021 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
20023 @item -mcall-aixdesc
20024 @opindex m
20025 On System V.4 and embedded PowerPC systems compile code for the AIX
20026 operating system.
20028 @item -mcall-linux
20029 @opindex mcall-linux
20030 On System V.4 and embedded PowerPC systems compile code for the
20031 Linux-based GNU system.
20033 @item -mcall-freebsd
20034 @opindex mcall-freebsd
20035 On System V.4 and embedded PowerPC systems compile code for the
20036 FreeBSD operating system.
20038 @item -mcall-netbsd
20039 @opindex mcall-netbsd
20040 On System V.4 and embedded PowerPC systems compile code for the
20041 NetBSD operating system.
20043 @item -mcall-openbsd
20044 @opindex mcall-netbsd
20045 On System V.4 and embedded PowerPC systems compile code for the
20046 OpenBSD operating system.
20048 @item -maix-struct-return
20049 @opindex maix-struct-return
20050 Return all structures in memory (as specified by the AIX ABI)@.
20052 @item -msvr4-struct-return
20053 @opindex msvr4-struct-return
20054 Return structures smaller than 8 bytes in registers (as specified by the
20055 SVR4 ABI)@.
20057 @item -mabi=@var{abi-type}
20058 @opindex mabi
20059 Extend the current ABI with a particular extension, or remove such extension.
20060 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
20061 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble},
20062 @var{elfv1}, @var{elfv2}@.
20064 @item -mabi=spe
20065 @opindex mabi=spe
20066 Extend the current ABI with SPE ABI extensions.  This does not change
20067 the default ABI, instead it adds the SPE ABI extensions to the current
20068 ABI@.
20070 @item -mabi=no-spe
20071 @opindex mabi=no-spe
20072 Disable Book-E SPE ABI extensions for the current ABI@.
20074 @item -mabi=ibmlongdouble
20075 @opindex mabi=ibmlongdouble
20076 Change the current ABI to use IBM extended-precision long double.
20077 This is a PowerPC 32-bit SYSV ABI option.
20079 @item -mabi=ieeelongdouble
20080 @opindex mabi=ieeelongdouble
20081 Change the current ABI to use IEEE extended-precision long double.
20082 This is a PowerPC 32-bit Linux ABI option.
20084 @item -mabi=elfv1
20085 @opindex mabi=elfv1
20086 Change the current ABI to use the ELFv1 ABI.
20087 This is the default ABI for big-endian PowerPC 64-bit Linux.
20088 Overriding the default ABI requires special system support and is
20089 likely to fail in spectacular ways.
20091 @item -mabi=elfv2
20092 @opindex mabi=elfv2
20093 Change the current ABI to use the ELFv2 ABI.
20094 This is the default ABI for little-endian PowerPC 64-bit Linux.
20095 Overriding the default ABI requires special system support and is
20096 likely to fail in spectacular ways.
20098 @item -mprototype
20099 @itemx -mno-prototype
20100 @opindex mprototype
20101 @opindex mno-prototype
20102 On System V.4 and embedded PowerPC systems assume that all calls to
20103 variable argument functions are properly prototyped.  Otherwise, the
20104 compiler must insert an instruction before every non-prototyped call to
20105 set or clear bit 6 of the condition code register (@var{CR}) to
20106 indicate whether floating-point values are passed in the floating-point
20107 registers in case the function takes variable arguments.  With
20108 @option{-mprototype}, only calls to prototyped variable argument functions
20109 set or clear the bit.
20111 @item -msim
20112 @opindex msim
20113 On embedded PowerPC systems, assume that the startup module is called
20114 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
20115 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
20116 configurations.
20118 @item -mmvme
20119 @opindex mmvme
20120 On embedded PowerPC systems, assume that the startup module is called
20121 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
20122 @file{libc.a}.
20124 @item -mads
20125 @opindex mads
20126 On embedded PowerPC systems, assume that the startup module is called
20127 @file{crt0.o} and the standard C libraries are @file{libads.a} and
20128 @file{libc.a}.
20130 @item -myellowknife
20131 @opindex myellowknife
20132 On embedded PowerPC systems, assume that the startup module is called
20133 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
20134 @file{libc.a}.
20136 @item -mvxworks
20137 @opindex mvxworks
20138 On System V.4 and embedded PowerPC systems, specify that you are
20139 compiling for a VxWorks system.
20141 @item -memb
20142 @opindex memb
20143 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
20144 header to indicate that @samp{eabi} extended relocations are used.
20146 @item -meabi
20147 @itemx -mno-eabi
20148 @opindex meabi
20149 @opindex mno-eabi
20150 On System V.4 and embedded PowerPC systems do (do not) adhere to the
20151 Embedded Applications Binary Interface (EABI), which is a set of
20152 modifications to the System V.4 specifications.  Selecting @option{-meabi}
20153 means that the stack is aligned to an 8-byte boundary, a function
20154 @code{__eabi} is called from @code{main} to set up the EABI
20155 environment, and the @option{-msdata} option can use both @code{r2} and
20156 @code{r13} to point to two separate small data areas.  Selecting
20157 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
20158 no EABI initialization function is called from @code{main}, and the
20159 @option{-msdata} option only uses @code{r13} to point to a single
20160 small data area.  The @option{-meabi} option is on by default if you
20161 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
20163 @item -msdata=eabi
20164 @opindex msdata=eabi
20165 On System V.4 and embedded PowerPC systems, put small initialized
20166 @code{const} global and static data in the @samp{.sdata2} section, which
20167 is pointed to by register @code{r2}.  Put small initialized
20168 non-@code{const} global and static data in the @samp{.sdata} section,
20169 which is pointed to by register @code{r13}.  Put small uninitialized
20170 global and static data in the @samp{.sbss} section, which is adjacent to
20171 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
20172 incompatible with the @option{-mrelocatable} option.  The
20173 @option{-msdata=eabi} option also sets the @option{-memb} option.
20175 @item -msdata=sysv
20176 @opindex msdata=sysv
20177 On System V.4 and embedded PowerPC systems, put small global and static
20178 data in the @samp{.sdata} section, which is pointed to by register
20179 @code{r13}.  Put small uninitialized global and static data in the
20180 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
20181 The @option{-msdata=sysv} option is incompatible with the
20182 @option{-mrelocatable} option.
20184 @item -msdata=default
20185 @itemx -msdata
20186 @opindex msdata=default
20187 @opindex msdata
20188 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
20189 compile code the same as @option{-msdata=eabi}, otherwise compile code the
20190 same as @option{-msdata=sysv}.
20192 @item -msdata=data
20193 @opindex msdata=data
20194 On System V.4 and embedded PowerPC systems, put small global
20195 data in the @samp{.sdata} section.  Put small uninitialized global
20196 data in the @samp{.sbss} section.  Do not use register @code{r13}
20197 to address small data however.  This is the default behavior unless
20198 other @option{-msdata} options are used.
20200 @item -msdata=none
20201 @itemx -mno-sdata
20202 @opindex msdata=none
20203 @opindex mno-sdata
20204 On embedded PowerPC systems, put all initialized global and static data
20205 in the @samp{.data} section, and all uninitialized data in the
20206 @samp{.bss} section.
20208 @item -mblock-move-inline-limit=@var{num}
20209 @opindex mblock-move-inline-limit
20210 Inline all block moves (such as calls to @code{memcpy} or structure
20211 copies) less than or equal to @var{num} bytes.  The minimum value for
20212 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
20213 targets.  The default value is target-specific.
20215 @item -G @var{num}
20216 @opindex G
20217 @cindex smaller data references (PowerPC)
20218 @cindex .sdata/.sdata2 references (PowerPC)
20219 On embedded PowerPC systems, put global and static items less than or
20220 equal to @var{num} bytes into the small data or BSS sections instead of
20221 the normal data or BSS section.  By default, @var{num} is 8.  The
20222 @option{-G @var{num}} switch is also passed to the linker.
20223 All modules should be compiled with the same @option{-G @var{num}} value.
20225 @item -mregnames
20226 @itemx -mno-regnames
20227 @opindex mregnames
20228 @opindex mno-regnames
20229 On System V.4 and embedded PowerPC systems do (do not) emit register
20230 names in the assembly language output using symbolic forms.
20232 @item -mlongcall
20233 @itemx -mno-longcall
20234 @opindex mlongcall
20235 @opindex mno-longcall
20236 By default assume that all calls are far away so that a longer and more
20237 expensive calling sequence is required.  This is required for calls
20238 farther than 32 megabytes (33,554,432 bytes) from the current location.
20239 A short call is generated if the compiler knows
20240 the call cannot be that far away.  This setting can be overridden by
20241 the @code{shortcall} function attribute, or by @code{#pragma
20242 longcall(0)}.
20244 Some linkers are capable of detecting out-of-range calls and generating
20245 glue code on the fly.  On these systems, long calls are unnecessary and
20246 generate slower code.  As of this writing, the AIX linker can do this,
20247 as can the GNU linker for PowerPC/64.  It is planned to add this feature
20248 to the GNU linker for 32-bit PowerPC systems as well.
20250 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
20251 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
20252 addresses represent the callee and the branch island.  The
20253 Darwin/PPC linker prefers the first address and generates a @code{bl
20254 callee} if the PPC @code{bl} instruction reaches the callee directly;
20255 otherwise, the linker generates @code{bl L42} to call the branch
20256 island.  The branch island is appended to the body of the
20257 calling function; it computes the full 32-bit address of the callee
20258 and jumps to it.
20260 On Mach-O (Darwin) systems, this option directs the compiler emit to
20261 the glue for every direct call, and the Darwin linker decides whether
20262 to use or discard it.
20264 In the future, GCC may ignore all longcall specifications
20265 when the linker is known to generate glue.
20267 @item -mtls-markers
20268 @itemx -mno-tls-markers
20269 @opindex mtls-markers
20270 @opindex mno-tls-markers
20271 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
20272 specifying the function argument.  The relocation allows the linker to
20273 reliably associate function call with argument setup instructions for
20274 TLS optimization, which in turn allows GCC to better schedule the
20275 sequence.
20277 @item -pthread
20278 @opindex pthread
20279 Adds support for multithreading with the @dfn{pthreads} library.
20280 This option sets flags for both the preprocessor and linker.
20282 @item -mrecip
20283 @itemx -mno-recip
20284 @opindex mrecip
20285 This option enables use of the reciprocal estimate and
20286 reciprocal square root estimate instructions with additional
20287 Newton-Raphson steps to increase precision instead of doing a divide or
20288 square root and divide for floating-point arguments.  You should use
20289 the @option{-ffast-math} option when using @option{-mrecip} (or at
20290 least @option{-funsafe-math-optimizations},
20291 @option{-finite-math-only}, @option{-freciprocal-math} and
20292 @option{-fno-trapping-math}).  Note that while the throughput of the
20293 sequence is generally higher than the throughput of the non-reciprocal
20294 instruction, the precision of the sequence can be decreased by up to 2
20295 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
20296 roots.
20298 @item -mrecip=@var{opt}
20299 @opindex mrecip=opt
20300 This option controls which reciprocal estimate instructions
20301 may be used.  @var{opt} is a comma-separated list of options, which may
20302 be preceded by a @code{!} to invert the option:
20303 @code{all}: enable all estimate instructions,
20304 @code{default}: enable the default instructions, equivalent to @option{-mrecip},
20305 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
20306 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
20307 @code{divf}: enable the single-precision reciprocal approximation instructions;
20308 @code{divd}: enable the double-precision reciprocal approximation instructions;
20309 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
20310 @code{rsqrtf}: enable the single-precision reciprocal square root approximation instructions;
20311 @code{rsqrtd}: enable the double-precision reciprocal square root approximation instructions;
20313 So, for example, @option{-mrecip=all,!rsqrtd} enables
20314 all of the reciprocal estimate instructions, except for the
20315 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
20316 which handle the double-precision reciprocal square root calculations.
20318 @item -mrecip-precision
20319 @itemx -mno-recip-precision
20320 @opindex mrecip-precision
20321 Assume (do not assume) that the reciprocal estimate instructions
20322 provide higher-precision estimates than is mandated by the PowerPC
20323 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
20324 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
20325 The double-precision square root estimate instructions are not generated by
20326 default on low-precision machines, since they do not provide an
20327 estimate that converges after three steps.
20329 @item -mveclibabi=@var{type}
20330 @opindex mveclibabi
20331 Specifies the ABI type to use for vectorizing intrinsics using an
20332 external library.  The only type supported at present is @code{mass},
20333 which specifies to use IBM's Mathematical Acceleration Subsystem
20334 (MASS) libraries for vectorizing intrinsics using external libraries.
20335 GCC currently emits calls to @code{acosd2}, @code{acosf4},
20336 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
20337 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
20338 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
20339 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
20340 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
20341 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
20342 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
20343 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
20344 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
20345 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
20346 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
20347 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
20348 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
20349 for power7.  Both @option{-ftree-vectorize} and
20350 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
20351 libraries must be specified at link time.
20353 @item -mfriz
20354 @itemx -mno-friz
20355 @opindex mfriz
20356 Generate (do not generate) the @code{friz} instruction when the
20357 @option{-funsafe-math-optimizations} option is used to optimize
20358 rounding of floating-point values to 64-bit integer and back to floating
20359 point.  The @code{friz} instruction does not return the same value if
20360 the floating-point number is too large to fit in an integer.
20362 @item -mpointers-to-nested-functions
20363 @itemx -mno-pointers-to-nested-functions
20364 @opindex mpointers-to-nested-functions
20365 Generate (do not generate) code to load up the static chain register
20366 (@var{r11}) when calling through a pointer on AIX and 64-bit Linux
20367 systems where a function pointer points to a 3-word descriptor giving
20368 the function address, TOC value to be loaded in register @var{r2}, and
20369 static chain value to be loaded in register @var{r11}.  The
20370 @option{-mpointers-to-nested-functions} is on by default.  You cannot
20371 call through pointers to nested functions or pointers
20372 to functions compiled in other languages that use the static chain if
20373 you use the @option{-mno-pointers-to-nested-functions}.
20375 @item -msave-toc-indirect
20376 @itemx -mno-save-toc-indirect
20377 @opindex msave-toc-indirect
20378 Generate (do not generate) code to save the TOC value in the reserved
20379 stack location in the function prologue if the function calls through
20380 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
20381 saved in the prologue, it is saved just before the call through the
20382 pointer.  The @option{-mno-save-toc-indirect} option is the default.
20384 @item -mcompat-align-parm
20385 @itemx -mno-compat-align-parm
20386 @opindex mcompat-align-parm
20387 Generate (do not generate) code to pass structure parameters with a
20388 maximum alignment of 64 bits, for compatibility with older versions
20389 of GCC.
20391 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
20392 structure parameter on a 128-bit boundary when that structure contained
20393 a member requiring 128-bit alignment.  This is corrected in more
20394 recent versions of GCC.  This option may be used to generate code
20395 that is compatible with functions compiled with older versions of
20396 GCC.
20398 The @option{-mno-compat-align-parm} option is the default.
20399 @end table
20401 @node RX Options
20402 @subsection RX Options
20403 @cindex RX Options
20405 These command-line options are defined for RX targets:
20407 @table @gcctabopt
20408 @item -m64bit-doubles
20409 @itemx -m32bit-doubles
20410 @opindex m64bit-doubles
20411 @opindex m32bit-doubles
20412 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
20413 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
20414 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
20415 works on 32-bit values, which is why the default is
20416 @option{-m32bit-doubles}.
20418 @item -fpu
20419 @itemx -nofpu
20420 @opindex fpu
20421 @opindex nofpu
20422 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
20423 floating-point hardware.  The default is enabled for the @var{RX600}
20424 series and disabled for the @var{RX200} series.
20426 Floating-point instructions are only generated for 32-bit floating-point 
20427 values, however, so the FPU hardware is not used for doubles if the
20428 @option{-m64bit-doubles} option is used.
20430 @emph{Note} If the @option{-fpu} option is enabled then
20431 @option{-funsafe-math-optimizations} is also enabled automatically.
20432 This is because the RX FPU instructions are themselves unsafe.
20434 @item -mcpu=@var{name}
20435 @opindex -mcpu
20436 Selects the type of RX CPU to be targeted.  Currently three types are
20437 supported, the generic @var{RX600} and @var{RX200} series hardware and
20438 the specific @var{RX610} CPU.  The default is @var{RX600}.
20440 The only difference between @var{RX600} and @var{RX610} is that the
20441 @var{RX610} does not support the @code{MVTIPL} instruction.
20443 The @var{RX200} series does not have a hardware floating-point unit
20444 and so @option{-nofpu} is enabled by default when this type is
20445 selected.
20447 @item -mbig-endian-data
20448 @itemx -mlittle-endian-data
20449 @opindex mbig-endian-data
20450 @opindex mlittle-endian-data
20451 Store data (but not code) in the big-endian format.  The default is
20452 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
20453 format.
20455 @item -msmall-data-limit=@var{N}
20456 @opindex msmall-data-limit
20457 Specifies the maximum size in bytes of global and static variables
20458 which can be placed into the small data area.  Using the small data
20459 area can lead to smaller and faster code, but the size of area is
20460 limited and it is up to the programmer to ensure that the area does
20461 not overflow.  Also when the small data area is used one of the RX's
20462 registers (usually @code{r13}) is reserved for use pointing to this
20463 area, so it is no longer available for use by the compiler.  This
20464 could result in slower and/or larger code if variables are pushed onto
20465 the stack instead of being held in this register.
20467 Note, common variables (variables that have not been initialized) and
20468 constants are not placed into the small data area as they are assigned
20469 to other sections in the output executable.
20471 The default value is zero, which disables this feature.  Note, this
20472 feature is not enabled by default with higher optimization levels
20473 (@option{-O2} etc) because of the potentially detrimental effects of
20474 reserving a register.  It is up to the programmer to experiment and
20475 discover whether this feature is of benefit to their program.  See the
20476 description of the @option{-mpid} option for a description of how the
20477 actual register to hold the small data area pointer is chosen.
20479 @item -msim
20480 @itemx -mno-sim
20481 @opindex msim
20482 @opindex mno-sim
20483 Use the simulator runtime.  The default is to use the libgloss
20484 board-specific runtime.
20486 @item -mas100-syntax
20487 @itemx -mno-as100-syntax
20488 @opindex mas100-syntax
20489 @opindex mno-as100-syntax
20490 When generating assembler output use a syntax that is compatible with
20491 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
20492 assembler, but it has some restrictions so it is not generated by default.
20494 @item -mmax-constant-size=@var{N}
20495 @opindex mmax-constant-size
20496 Specifies the maximum size, in bytes, of a constant that can be used as
20497 an operand in a RX instruction.  Although the RX instruction set does
20498 allow constants of up to 4 bytes in length to be used in instructions,
20499 a longer value equates to a longer instruction.  Thus in some
20500 circumstances it can be beneficial to restrict the size of constants
20501 that are used in instructions.  Constants that are too big are instead
20502 placed into a constant pool and referenced via register indirection.
20504 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
20505 or 4 means that constants of any size are allowed.
20507 @item -mrelax
20508 @opindex mrelax
20509 Enable linker relaxation.  Linker relaxation is a process whereby the
20510 linker attempts to reduce the size of a program by finding shorter
20511 versions of various instructions.  Disabled by default.
20513 @item -mint-register=@var{N}
20514 @opindex mint-register
20515 Specify the number of registers to reserve for fast interrupt handler
20516 functions.  The value @var{N} can be between 0 and 4.  A value of 1
20517 means that register @code{r13} is reserved for the exclusive use
20518 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
20519 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
20520 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
20521 A value of 0, the default, does not reserve any registers.
20523 @item -msave-acc-in-interrupts
20524 @opindex msave-acc-in-interrupts
20525 Specifies that interrupt handler functions should preserve the
20526 accumulator register.  This is only necessary if normal code might use
20527 the accumulator register, for example because it performs 64-bit
20528 multiplications.  The default is to ignore the accumulator as this
20529 makes the interrupt handlers faster.
20531 @item -mpid
20532 @itemx -mno-pid
20533 @opindex mpid
20534 @opindex mno-pid
20535 Enables the generation of position independent data.  When enabled any
20536 access to constant data is done via an offset from a base address
20537 held in a register.  This allows the location of constant data to be
20538 determined at run time without requiring the executable to be
20539 relocated, which is a benefit to embedded applications with tight
20540 memory constraints.  Data that can be modified is not affected by this
20541 option.
20543 Note, using this feature reserves a register, usually @code{r13}, for
20544 the constant data base address.  This can result in slower and/or
20545 larger code, especially in complicated functions.
20547 The actual register chosen to hold the constant data base address
20548 depends upon whether the @option{-msmall-data-limit} and/or the
20549 @option{-mint-register} command-line options are enabled.  Starting
20550 with register @code{r13} and proceeding downwards, registers are
20551 allocated first to satisfy the requirements of @option{-mint-register},
20552 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
20553 is possible for the small data area register to be @code{r8} if both
20554 @option{-mint-register=4} and @option{-mpid} are specified on the
20555 command line.
20557 By default this feature is not enabled.  The default can be restored
20558 via the @option{-mno-pid} command-line option.
20560 @item -mno-warn-multiple-fast-interrupts
20561 @itemx -mwarn-multiple-fast-interrupts
20562 @opindex mno-warn-multiple-fast-interrupts
20563 @opindex mwarn-multiple-fast-interrupts
20564 Prevents GCC from issuing a warning message if it finds more than one
20565 fast interrupt handler when it is compiling a file.  The default is to
20566 issue a warning for each extra fast interrupt handler found, as the RX
20567 only supports one such interrupt.
20569 @end table
20571 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
20572 has special significance to the RX port when used with the
20573 @code{interrupt} function attribute.  This attribute indicates a
20574 function intended to process fast interrupts.  GCC ensures
20575 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
20576 and/or @code{r13} and only provided that the normal use of the
20577 corresponding registers have been restricted via the
20578 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
20579 options.
20581 @node S/390 and zSeries Options
20582 @subsection S/390 and zSeries Options
20583 @cindex S/390 and zSeries Options
20585 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
20587 @table @gcctabopt
20588 @item -mhard-float
20589 @itemx -msoft-float
20590 @opindex mhard-float
20591 @opindex msoft-float
20592 Use (do not use) the hardware floating-point instructions and registers
20593 for floating-point operations.  When @option{-msoft-float} is specified,
20594 functions in @file{libgcc.a} are used to perform floating-point
20595 operations.  When @option{-mhard-float} is specified, the compiler
20596 generates IEEE floating-point instructions.  This is the default.
20598 @item -mhard-dfp
20599 @itemx -mno-hard-dfp
20600 @opindex mhard-dfp
20601 @opindex mno-hard-dfp
20602 Use (do not use) the hardware decimal-floating-point instructions for
20603 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
20604 specified, functions in @file{libgcc.a} are used to perform
20605 decimal-floating-point operations.  When @option{-mhard-dfp} is
20606 specified, the compiler generates decimal-floating-point hardware
20607 instructions.  This is the default for @option{-march=z9-ec} or higher.
20609 @item -mlong-double-64
20610 @itemx -mlong-double-128
20611 @opindex mlong-double-64
20612 @opindex mlong-double-128
20613 These switches control the size of @code{long double} type. A size
20614 of 64 bits makes the @code{long double} type equivalent to the @code{double}
20615 type. This is the default.
20617 @item -mbackchain
20618 @itemx -mno-backchain
20619 @opindex mbackchain
20620 @opindex mno-backchain
20621 Store (do not store) the address of the caller's frame as backchain pointer
20622 into the callee's stack frame.
20623 A backchain may be needed to allow debugging using tools that do not understand
20624 DWARF 2 call frame information.
20625 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
20626 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
20627 the backchain is placed into the topmost word of the 96/160 byte register
20628 save area.
20630 In general, code compiled with @option{-mbackchain} is call-compatible with
20631 code compiled with @option{-mmo-backchain}; however, use of the backchain
20632 for debugging purposes usually requires that the whole binary is built with
20633 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
20634 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
20635 to build a linux kernel use @option{-msoft-float}.
20637 The default is to not maintain the backchain.
20639 @item -mpacked-stack
20640 @itemx -mno-packed-stack
20641 @opindex mpacked-stack
20642 @opindex mno-packed-stack
20643 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
20644 specified, the compiler uses the all fields of the 96/160 byte register save
20645 area only for their default purpose; unused fields still take up stack space.
20646 When @option{-mpacked-stack} is specified, register save slots are densely
20647 packed at the top of the register save area; unused space is reused for other
20648 purposes, allowing for more efficient use of the available stack space.
20649 However, when @option{-mbackchain} is also in effect, the topmost word of
20650 the save area is always used to store the backchain, and the return address
20651 register is always saved two words below the backchain.
20653 As long as the stack frame backchain is not used, code generated with
20654 @option{-mpacked-stack} is call-compatible with code generated with
20655 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
20656 S/390 or zSeries generated code that uses the stack frame backchain at run
20657 time, not just for debugging purposes.  Such code is not call-compatible
20658 with code compiled with @option{-mpacked-stack}.  Also, note that the
20659 combination of @option{-mbackchain},
20660 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
20661 to build a linux kernel use @option{-msoft-float}.
20663 The default is to not use the packed stack layout.
20665 @item -msmall-exec
20666 @itemx -mno-small-exec
20667 @opindex msmall-exec
20668 @opindex mno-small-exec
20669 Generate (or do not generate) code using the @code{bras} instruction
20670 to do subroutine calls.
20671 This only works reliably if the total executable size does not
20672 exceed 64k.  The default is to use the @code{basr} instruction instead,
20673 which does not have this limitation.
20675 @item -m64
20676 @itemx -m31
20677 @opindex m64
20678 @opindex m31
20679 When @option{-m31} is specified, generate code compliant to the
20680 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
20681 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
20682 particular to generate 64-bit instructions.  For the @samp{s390}
20683 targets, the default is @option{-m31}, while the @samp{s390x}
20684 targets default to @option{-m64}.
20686 @item -mzarch
20687 @itemx -mesa
20688 @opindex mzarch
20689 @opindex mesa
20690 When @option{-mzarch} is specified, generate code using the
20691 instructions available on z/Architecture.
20692 When @option{-mesa} is specified, generate code using the
20693 instructions available on ESA/390.  Note that @option{-mesa} is
20694 not possible with @option{-m64}.
20695 When generating code compliant to the GNU/Linux for S/390 ABI,
20696 the default is @option{-mesa}.  When generating code compliant
20697 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
20699 @item -mmvcle
20700 @itemx -mno-mvcle
20701 @opindex mmvcle
20702 @opindex mno-mvcle
20703 Generate (or do not generate) code using the @code{mvcle} instruction
20704 to perform block moves.  When @option{-mno-mvcle} is specified,
20705 use a @code{mvc} loop instead.  This is the default unless optimizing for
20706 size.
20708 @item -mdebug
20709 @itemx -mno-debug
20710 @opindex mdebug
20711 @opindex mno-debug
20712 Print (or do not print) additional debug information when compiling.
20713 The default is to not print debug information.
20715 @item -march=@var{cpu-type}
20716 @opindex march
20717 Generate code that runs on @var{cpu-type}, which is the name of a system
20718 representing a certain processor type.  Possible values for
20719 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
20720 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
20721 When generating code using the instructions available on z/Architecture,
20722 the default is @option{-march=z900}.  Otherwise, the default is
20723 @option{-march=g5}.
20725 @item -mtune=@var{cpu-type}
20726 @opindex mtune
20727 Tune to @var{cpu-type} everything applicable about the generated code,
20728 except for the ABI and the set of available instructions.
20729 The list of @var{cpu-type} values is the same as for @option{-march}.
20730 The default is the value used for @option{-march}.
20732 @item -mtpf-trace
20733 @itemx -mno-tpf-trace
20734 @opindex mtpf-trace
20735 @opindex mno-tpf-trace
20736 Generate code that adds (does not add) in TPF OS specific branches to trace
20737 routines in the operating system.  This option is off by default, even
20738 when compiling for the TPF OS@.
20740 @item -mfused-madd
20741 @itemx -mno-fused-madd
20742 @opindex mfused-madd
20743 @opindex mno-fused-madd
20744 Generate code that uses (does not use) the floating-point multiply and
20745 accumulate instructions.  These instructions are generated by default if
20746 hardware floating point is used.
20748 @item -mwarn-framesize=@var{framesize}
20749 @opindex mwarn-framesize
20750 Emit a warning if the current function exceeds the given frame size.  Because
20751 this is a compile-time check it doesn't need to be a real problem when the program
20752 runs.  It is intended to identify functions that most probably cause
20753 a stack overflow.  It is useful to be used in an environment with limited stack
20754 size e.g.@: the linux kernel.
20756 @item -mwarn-dynamicstack
20757 @opindex mwarn-dynamicstack
20758 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
20759 arrays.  This is generally a bad idea with a limited stack size.
20761 @item -mstack-guard=@var{stack-guard}
20762 @itemx -mstack-size=@var{stack-size}
20763 @opindex mstack-guard
20764 @opindex mstack-size
20765 If these options are provided the S/390 back end emits additional instructions in
20766 the function prologue that trigger a trap if the stack size is @var{stack-guard}
20767 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
20768 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
20769 the frame size of the compiled function is chosen.
20770 These options are intended to be used to help debugging stack overflow problems.
20771 The additionally emitted code causes only little overhead and hence can also be
20772 used in production-like systems without greater performance degradation.  The given
20773 values have to be exact powers of 2 and @var{stack-size} has to be greater than
20774 @var{stack-guard} without exceeding 64k.
20775 In order to be efficient the extra code makes the assumption that the stack starts
20776 at an address aligned to the value given by @var{stack-size}.
20777 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
20779 @item -mhotpatch[=@var{halfwords}]
20780 @itemx -mno-hotpatch
20781 @opindex mhotpatch
20782 If the hotpatch option is enabled, a ``hot-patching'' function
20783 prologue is generated for all functions in the compilation unit.
20784 The funtion label is prepended with the given number of two-byte
20785 Nop instructions (@var{halfwords}, maximum 1000000) or 12 Nop
20786 instructions if no argument is present.  Functions with a
20787 hot-patching prologue are never inlined automatically, and a
20788 hot-patching prologue is never generated for functions
20789 that are explicitly inline.
20791 This option can be overridden for individual functions with the
20792 @code{hotpatch} attribute.
20793 @end table
20795 @node Score Options
20796 @subsection Score Options
20797 @cindex Score Options
20799 These options are defined for Score implementations:
20801 @table @gcctabopt
20802 @item -meb
20803 @opindex meb
20804 Compile code for big-endian mode.  This is the default.
20806 @item -mel
20807 @opindex mel
20808 Compile code for little-endian mode.
20810 @item -mnhwloop
20811 @opindex mnhwloop
20812 Disable generation of @code{bcnz} instructions.
20814 @item -muls
20815 @opindex muls
20816 Enable generation of unaligned load and store instructions.
20818 @item -mmac
20819 @opindex mmac
20820 Enable the use of multiply-accumulate instructions. Disabled by default.
20822 @item -mscore5
20823 @opindex mscore5
20824 Specify the SCORE5 as the target architecture.
20826 @item -mscore5u
20827 @opindex mscore5u
20828 Specify the SCORE5U of the target architecture.
20830 @item -mscore7
20831 @opindex mscore7
20832 Specify the SCORE7 as the target architecture. This is the default.
20834 @item -mscore7d
20835 @opindex mscore7d
20836 Specify the SCORE7D as the target architecture.
20837 @end table
20839 @node SH Options
20840 @subsection SH Options
20842 These @samp{-m} options are defined for the SH implementations:
20844 @table @gcctabopt
20845 @item -m1
20846 @opindex m1
20847 Generate code for the SH1.
20849 @item -m2
20850 @opindex m2
20851 Generate code for the SH2.
20853 @item -m2e
20854 Generate code for the SH2e.
20856 @item -m2a-nofpu
20857 @opindex m2a-nofpu
20858 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
20859 that the floating-point unit is not used.
20861 @item -m2a-single-only
20862 @opindex m2a-single-only
20863 Generate code for the SH2a-FPU, in such a way that no double-precision
20864 floating-point operations are used.
20866 @item -m2a-single
20867 @opindex m2a-single
20868 Generate code for the SH2a-FPU assuming the floating-point unit is in
20869 single-precision mode by default.
20871 @item -m2a
20872 @opindex m2a
20873 Generate code for the SH2a-FPU assuming the floating-point unit is in
20874 double-precision mode by default.
20876 @item -m3
20877 @opindex m3
20878 Generate code for the SH3.
20880 @item -m3e
20881 @opindex m3e
20882 Generate code for the SH3e.
20884 @item -m4-nofpu
20885 @opindex m4-nofpu
20886 Generate code for the SH4 without a floating-point unit.
20888 @item -m4-single-only
20889 @opindex m4-single-only
20890 Generate code for the SH4 with a floating-point unit that only
20891 supports single-precision arithmetic.
20893 @item -m4-single
20894 @opindex m4-single
20895 Generate code for the SH4 assuming the floating-point unit is in
20896 single-precision mode by default.
20898 @item -m4
20899 @opindex m4
20900 Generate code for the SH4.
20902 @item -m4-100
20903 @opindex m4-100
20904 Generate code for SH4-100.
20906 @item -m4-100-nofpu
20907 @opindex m4-100-nofpu
20908 Generate code for SH4-100 in such a way that the
20909 floating-point unit is not used.
20911 @item -m4-100-single
20912 @opindex m4-100-single
20913 Generate code for SH4-100 assuming the floating-point unit is in
20914 single-precision mode by default.
20916 @item -m4-100-single-only
20917 @opindex m4-100-single-only
20918 Generate code for SH4-100 in such a way that no double-precision
20919 floating-point operations are used.
20921 @item -m4-200
20922 @opindex m4-200
20923 Generate code for SH4-200.
20925 @item -m4-200-nofpu
20926 @opindex m4-200-nofpu
20927 Generate code for SH4-200 without in such a way that the
20928 floating-point unit is not used.
20930 @item -m4-200-single
20931 @opindex m4-200-single
20932 Generate code for SH4-200 assuming the floating-point unit is in
20933 single-precision mode by default.
20935 @item -m4-200-single-only
20936 @opindex m4-200-single-only
20937 Generate code for SH4-200 in such a way that no double-precision
20938 floating-point operations are used.
20940 @item -m4-300
20941 @opindex m4-300
20942 Generate code for SH4-300.
20944 @item -m4-300-nofpu
20945 @opindex m4-300-nofpu
20946 Generate code for SH4-300 without in such a way that the
20947 floating-point unit is not used.
20949 @item -m4-300-single
20950 @opindex m4-300-single
20951 Generate code for SH4-300 in such a way that no double-precision
20952 floating-point operations are used.
20954 @item -m4-300-single-only
20955 @opindex m4-300-single-only
20956 Generate code for SH4-300 in such a way that no double-precision
20957 floating-point operations are used.
20959 @item -m4-340
20960 @opindex m4-340
20961 Generate code for SH4-340 (no MMU, no FPU).
20963 @item -m4-500
20964 @opindex m4-500
20965 Generate code for SH4-500 (no FPU).  Passes @option{-isa=sh4-nofpu} to the
20966 assembler.
20968 @item -m4a-nofpu
20969 @opindex m4a-nofpu
20970 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
20971 floating-point unit is not used.
20973 @item -m4a-single-only
20974 @opindex m4a-single-only
20975 Generate code for the SH4a, in such a way that no double-precision
20976 floating-point operations are used.
20978 @item -m4a-single
20979 @opindex m4a-single
20980 Generate code for the SH4a assuming the floating-point unit is in
20981 single-precision mode by default.
20983 @item -m4a
20984 @opindex m4a
20985 Generate code for the SH4a.
20987 @item -m4al
20988 @opindex m4al
20989 Same as @option{-m4a-nofpu}, except that it implicitly passes
20990 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
20991 instructions at the moment.
20993 @item -m5-32media
20994 @opindex m5-32media
20995 Generate 32-bit code for SHmedia.
20997 @item -m5-32media-nofpu
20998 @opindex m5-32media-nofpu
20999 Generate 32-bit code for SHmedia in such a way that the
21000 floating-point unit is not used.
21002 @item -m5-64media
21003 @opindex m5-64media
21004 Generate 64-bit code for SHmedia.
21006 @item -m5-64media-nofpu
21007 @opindex m5-64media-nofpu
21008 Generate 64-bit code for SHmedia in such a way that the
21009 floating-point unit is not used.
21011 @item -m5-compact
21012 @opindex m5-compact
21013 Generate code for SHcompact.
21015 @item -m5-compact-nofpu
21016 @opindex m5-compact-nofpu
21017 Generate code for SHcompact in such a way that the
21018 floating-point unit is not used.
21020 @item -mb
21021 @opindex mb
21022 Compile code for the processor in big-endian mode.
21024 @item -ml
21025 @opindex ml
21026 Compile code for the processor in little-endian mode.
21028 @item -mdalign
21029 @opindex mdalign
21030 Align doubles at 64-bit boundaries.  Note that this changes the calling
21031 conventions, and thus some functions from the standard C library do
21032 not work unless you recompile it first with @option{-mdalign}.
21034 @item -mrelax
21035 @opindex mrelax
21036 Shorten some address references at link time, when possible; uses the
21037 linker option @option{-relax}.
21039 @item -mbigtable
21040 @opindex mbigtable
21041 Use 32-bit offsets in @code{switch} tables.  The default is to use
21042 16-bit offsets.
21044 @item -mbitops
21045 @opindex mbitops
21046 Enable the use of bit manipulation instructions on SH2A.
21048 @item -mfmovd
21049 @opindex mfmovd
21050 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
21051 alignment constraints.
21053 @item -mrenesas
21054 @opindex mrenesas
21055 Comply with the calling conventions defined by Renesas.
21057 @item -mno-renesas
21058 @opindex mno-renesas
21059 Comply with the calling conventions defined for GCC before the Renesas
21060 conventions were available.  This option is the default for all
21061 targets of the SH toolchain.
21063 @item -mnomacsave
21064 @opindex mnomacsave
21065 Mark the @code{MAC} register as call-clobbered, even if
21066 @option{-mrenesas} is given.
21068 @item -mieee
21069 @itemx -mno-ieee
21070 @opindex mieee
21071 @opindex mno-ieee
21072 Control the IEEE compliance of floating-point comparisons, which affects the
21073 handling of cases where the result of a comparison is unordered.  By default
21074 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
21075 enabled @option{-mno-ieee} is implicitly set, which results in faster
21076 floating-point greater-equal and less-equal comparisons.  The implcit settings
21077 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
21079 @item -minline-ic_invalidate
21080 @opindex minline-ic_invalidate
21081 Inline code to invalidate instruction cache entries after setting up
21082 nested function trampolines.
21083 This option has no effect if @option{-musermode} is in effect and the selected
21084 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
21085 instruction.
21086 If the selected code generation option does not allow the use of the @code{icbi}
21087 instruction, and @option{-musermode} is not in effect, the inlined code
21088 manipulates the instruction cache address array directly with an associative
21089 write.  This not only requires privileged mode at run time, but it also
21090 fails if the cache line had been mapped via the TLB and has become unmapped.
21092 @item -misize
21093 @opindex misize
21094 Dump instruction size and location in the assembly code.
21096 @item -mpadstruct
21097 @opindex mpadstruct
21098 This option is deprecated.  It pads structures to multiple of 4 bytes,
21099 which is incompatible with the SH ABI@.
21101 @item -matomic-model=@var{model}
21102 @opindex matomic-model=@var{model}
21103 Sets the model of atomic operations and additional parameters as a comma
21104 separated list.  For details on the atomic built-in functions see
21105 @ref{__atomic Builtins}.  The following models and parameters are supported:
21107 @table @samp
21109 @item none
21110 Disable compiler generated atomic sequences and emit library calls for atomic
21111 operations.  This is the default if the target is not @code{sh*-*-linux*}.
21113 @item soft-gusa
21114 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
21115 built-in functions.  The generated atomic sequences require additional support
21116 from the interrupt/exception handling code of the system and are only suitable
21117 for SH3* and SH4* single-core systems.  This option is enabled by default when
21118 the target is @code{sh*-*-linux*} and SH3* or SH4*.  When the target is SH4A,
21119 this option will also partially utilize the hardware atomic instructions
21120 @code{movli.l} and @code{movco.l} to create more efficient code, unless
21121 @samp{strict} is specified.  
21123 @item soft-tcb
21124 Generate software atomic sequences that use a variable in the thread control
21125 block.  This is a variation of the gUSA sequences which can also be used on
21126 SH1* and SH2* targets.  The generated atomic sequences require additional
21127 support from the interrupt/exception handling code of the system and are only
21128 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
21129 parameter has to be specified as well.
21131 @item soft-imask
21132 Generate software atomic sequences that temporarily disable interrupts by
21133 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
21134 in privileged mode and is only suitable for single-core systems.  Additional
21135 support from the interrupt/exception handling code of the system is not
21136 required.  This model is enabled by default when the target is
21137 @code{sh*-*-linux*} and SH1* or SH2*.
21139 @item hard-llcs
21140 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
21141 instructions only.  This is only available on SH4A and is suitable for
21142 multi-core systems.  Since the hardware instructions support only 32 bit atomic
21143 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
21144 Code compiled with this option will also be compatible with other software
21145 atomic model interrupt/exception handling systems if executed on an SH4A
21146 system.  Additional support from the interrupt/exception handling code of the
21147 system is not required for this model.
21149 @item gbr-offset=
21150 This parameter specifies the offset in bytes of the variable in the thread
21151 control block structure that should be used by the generated atomic sequences
21152 when the @samp{soft-tcb} model has been selected.  For other models this
21153 parameter is ignored.  The specified value must be an integer multiple of four
21154 and in the range 0-1020.
21156 @item strict
21157 This parameter prevents mixed usage of multiple atomic models, even though they
21158 would be compatible, and will make the compiler generate atomic sequences of the
21159 specified model only.
21161 @end table
21163 @item -mtas
21164 @opindex mtas
21165 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
21166 Notice that depending on the particular hardware and software configuration
21167 this can degrade overall performance due to the operand cache line flushes
21168 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
21169 processors the @code{tas.b} instruction must be used with caution since it
21170 can result in data corruption for certain cache configurations.
21172 @item -mprefergot
21173 @opindex mprefergot
21174 When generating position-independent code, emit function calls using
21175 the Global Offset Table instead of the Procedure Linkage Table.
21177 @item -musermode
21178 @itemx -mno-usermode
21179 @opindex musermode
21180 @opindex mno-usermode
21181 Don't allow (allow) the compiler generating privileged mode code.  Specifying
21182 @option{-musermode} also implies @option{-mno-inline-ic_invalidate} if the
21183 inlined code would not work in user mode.  @option{-musermode} is the default
21184 when the target is @code{sh*-*-linux*}.  If the target is SH1* or SH2*
21185 @option{-musermode} has no effect, since there is no user mode.
21187 @item -multcost=@var{number}
21188 @opindex multcost=@var{number}
21189 Set the cost to assume for a multiply insn.
21191 @item -mdiv=@var{strategy}
21192 @opindex mdiv=@var{strategy}
21193 Set the division strategy to be used for integer division operations.
21194 For SHmedia @var{strategy} can be one of: 
21196 @table @samp
21198 @item fp 
21199 Performs the operation in floating point.  This has a very high latency,
21200 but needs only a few instructions, so it might be a good choice if
21201 your code has enough easily-exploitable ILP to allow the compiler to
21202 schedule the floating-point instructions together with other instructions.
21203 Division by zero causes a floating-point exception.
21205 @item inv
21206 Uses integer operations to calculate the inverse of the divisor,
21207 and then multiplies the dividend with the inverse.  This strategy allows
21208 CSE and hoisting of the inverse calculation.  Division by zero calculates
21209 an unspecified result, but does not trap.
21211 @item inv:minlat
21212 A variant of @samp{inv} where, if no CSE or hoisting opportunities
21213 have been found, or if the entire operation has been hoisted to the same
21214 place, the last stages of the inverse calculation are intertwined with the
21215 final multiply to reduce the overall latency, at the expense of using a few
21216 more instructions, and thus offering fewer scheduling opportunities with
21217 other code.
21219 @item call
21220 Calls a library function that usually implements the @samp{inv:minlat}
21221 strategy.
21222 This gives high code density for @code{m5-*media-nofpu} compilations.
21224 @item call2
21225 Uses a different entry point of the same library function, where it
21226 assumes that a pointer to a lookup table has already been set up, which
21227 exposes the pointer load to CSE and code hoisting optimizations.
21229 @item inv:call
21230 @itemx inv:call2
21231 @itemx inv:fp
21232 Use the @samp{inv} algorithm for initial
21233 code generation, but if the code stays unoptimized, revert to the @samp{call},
21234 @samp{call2}, or @samp{fp} strategies, respectively.  Note that the
21235 potentially-trapping side effect of division by zero is carried by a
21236 separate instruction, so it is possible that all the integer instructions
21237 are hoisted out, but the marker for the side effect stays where it is.
21238 A recombination to floating-point operations or a call is not possible
21239 in that case.
21241 @item inv20u
21242 @itemx inv20l
21243 Variants of the @samp{inv:minlat} strategy.  In the case
21244 that the inverse calculation is not separated from the multiply, they speed
21245 up division where the dividend fits into 20 bits (plus sign where applicable)
21246 by inserting a test to skip a number of operations in this case; this test
21247 slows down the case of larger dividends.  @samp{inv20u} assumes the case of a such
21248 a small dividend to be unlikely, and @samp{inv20l} assumes it to be likely.
21250 @end table
21252 For targets other than SHmedia @var{strategy} can be one of:
21254 @table @samp
21256 @item call-div1
21257 Calls a library function that uses the single-step division instruction
21258 @code{div1} to perform the operation.  Division by zero calculates an
21259 unspecified result and does not trap.  This is the default except for SH4,
21260 SH2A and SHcompact.
21262 @item call-fp
21263 Calls a library function that performs the operation in double precision
21264 floating point.  Division by zero causes a floating-point exception.  This is
21265 the default for SHcompact with FPU.  Specifying this for targets that do not
21266 have a double precision FPU will default to @code{call-div1}.
21268 @item call-table
21269 Calls a library function that uses a lookup table for small divisors and
21270 the @code{div1} instruction with case distinction for larger divisors.  Division
21271 by zero calculates an unspecified result and does not trap.  This is the default
21272 for SH4.  Specifying this for targets that do not have dynamic shift
21273 instructions will default to @code{call-div1}.
21275 @end table
21277 When a division strategy has not been specified the default strategy will be
21278 selected based on the current target.  For SH2A the default strategy is to
21279 use the @code{divs} and @code{divu} instructions instead of library function
21280 calls.
21282 @item -maccumulate-outgoing-args
21283 @opindex maccumulate-outgoing-args
21284 Reserve space once for outgoing arguments in the function prologue rather
21285 than around each call.  Generally beneficial for performance and size.  Also
21286 needed for unwinding to avoid changing the stack frame around conditional code.
21288 @item -mdivsi3_libfunc=@var{name}
21289 @opindex mdivsi3_libfunc=@var{name}
21290 Set the name of the library function used for 32-bit signed division to
21291 @var{name}.
21292 This only affects the name used in the @samp{call} and @samp{inv:call}
21293 division strategies, and the compiler still expects the same
21294 sets of input/output/clobbered registers as if this option were not present.
21296 @item -mfixed-range=@var{register-range}
21297 @opindex mfixed-range
21298 Generate code treating the given register range as fixed registers.
21299 A fixed register is one that the register allocator can not use.  This is
21300 useful when compiling kernel code.  A register range is specified as
21301 two registers separated by a dash.  Multiple register ranges can be
21302 specified separated by a comma.
21304 @item -mindexed-addressing
21305 @opindex mindexed-addressing
21306 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
21307 This is only safe if the hardware and/or OS implement 32-bit wrap-around
21308 semantics for the indexed addressing mode.  The architecture allows the
21309 implementation of processors with 64-bit MMU, which the OS could use to
21310 get 32-bit addressing, but since no current hardware implementation supports
21311 this or any other way to make the indexed addressing mode safe to use in
21312 the 32-bit ABI, the default is @option{-mno-indexed-addressing}.
21314 @item -mgettrcost=@var{number}
21315 @opindex mgettrcost=@var{number}
21316 Set the cost assumed for the @code{gettr} instruction to @var{number}.
21317 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
21319 @item -mpt-fixed
21320 @opindex mpt-fixed
21321 Assume @code{pt*} instructions won't trap.  This generally generates
21322 better-scheduled code, but is unsafe on current hardware.
21323 The current architecture
21324 definition says that @code{ptabs} and @code{ptrel} trap when the target 
21325 anded with 3 is 3.
21326 This has the unintentional effect of making it unsafe to schedule these
21327 instructions before a branch, or hoist them out of a loop.  For example,
21328 @code{__do_global_ctors}, a part of @file{libgcc}
21329 that runs constructors at program
21330 startup, calls functions in a list which is delimited by @minus{}1.  With the
21331 @option{-mpt-fixed} option, the @code{ptabs} is done before testing against @minus{}1.
21332 That means that all the constructors run a bit more quickly, but when
21333 the loop comes to the end of the list, the program crashes because @code{ptabs}
21334 loads @minus{}1 into a target register.  
21336 Since this option is unsafe for any
21337 hardware implementing the current architecture specification, the default
21338 is @option{-mno-pt-fixed}.  Unless specified explicitly with 
21339 @option{-mgettrcost}, @option{-mno-pt-fixed} also implies @option{-mgettrcost=100};
21340 this deters register allocation from using target registers for storing
21341 ordinary integers.
21343 @item -minvalid-symbols
21344 @opindex minvalid-symbols
21345 Assume symbols might be invalid.  Ordinary function symbols generated by
21346 the compiler are always valid to load with
21347 @code{movi}/@code{shori}/@code{ptabs} or
21348 @code{movi}/@code{shori}/@code{ptrel},
21349 but with assembler and/or linker tricks it is possible
21350 to generate symbols that cause @code{ptabs} or @code{ptrel} to trap.
21351 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
21352 It prevents cross-basic-block CSE, hoisting and most scheduling
21353 of symbol loads.  The default is @option{-mno-invalid-symbols}.
21355 @item -mbranch-cost=@var{num}
21356 @opindex mbranch-cost=@var{num}
21357 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
21358 make the compiler try to generate more branch-free code if possible.  
21359 If not specified the value is selected depending on the processor type that
21360 is being compiled for.
21362 @item -mzdcbranch
21363 @itemx -mno-zdcbranch
21364 @opindex mzdcbranch
21365 @opindex mno-zdcbranch
21366 Assume (do not assume) that zero displacement conditional branch instructions
21367 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
21368 compiler will try to prefer zero displacement branch code sequences.  This is
21369 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
21370 disabled by specifying @option{-mno-zdcbranch}.
21372 @item -mfused-madd
21373 @itemx -mno-fused-madd
21374 @opindex mfused-madd
21375 @opindex mno-fused-madd
21376 Generate code that uses (does not use) the floating-point multiply and
21377 accumulate instructions.  These instructions are generated by default
21378 if hardware floating point is used.  The machine-dependent
21379 @option{-mfused-madd} option is now mapped to the machine-independent
21380 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
21381 mapped to @option{-ffp-contract=off}.
21383 @item -mfsca
21384 @itemx -mno-fsca
21385 @opindex mfsca
21386 @opindex mno-fsca
21387 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
21388 and cosine approximations.  The option @code{-mfsca} must be used in
21389 combination with @code{-funsafe-math-optimizations}.  It is enabled by default
21390 when generating code for SH4A.  Using @code{-mno-fsca} disables sine and cosine
21391 approximations even if @code{-funsafe-math-optimizations} is in effect.
21393 @item -mfsrra
21394 @itemx -mno-fsrra
21395 @opindex mfsrra
21396 @opindex mno-fsrra
21397 Allow or disallow the compiler to emit the @code{fsrra} instruction for
21398 reciprocal square root approximations.  The option @code{-mfsrra} must be used
21399 in combination with @code{-funsafe-math-optimizations} and
21400 @code{-ffinite-math-only}.  It is enabled by default when generating code for
21401 SH4A.  Using @code{-mno-fsrra} disables reciprocal square root approximations
21402 even if @code{-funsafe-math-optimizations} and @code{-ffinite-math-only} are
21403 in effect.
21405 @item -mpretend-cmove
21406 @opindex mpretend-cmove
21407 Prefer zero-displacement conditional branches for conditional move instruction
21408 patterns.  This can result in faster code on the SH4 processor.
21410 @end table
21412 @node Solaris 2 Options
21413 @subsection Solaris 2 Options
21414 @cindex Solaris 2 options
21416 These @samp{-m} options are supported on Solaris 2:
21418 @table @gcctabopt
21419 @item -mclear-hwcap
21420 @opindex mclear-hwcap
21421 @option{-mclear-hwcap} tells the compiler to remove the hardware
21422 capabilities generated by the Solaris assembler.  This is only necessary
21423 when object files use ISA extensions not supported by the current
21424 machine, but check at runtime whether or not to use them.
21426 @item -mimpure-text
21427 @opindex mimpure-text
21428 @option{-mimpure-text}, used in addition to @option{-shared}, tells
21429 the compiler to not pass @option{-z text} to the linker when linking a
21430 shared object.  Using this option, you can link position-dependent
21431 code into a shared object.
21433 @option{-mimpure-text} suppresses the ``relocations remain against
21434 allocatable but non-writable sections'' linker error message.
21435 However, the necessary relocations trigger copy-on-write, and the
21436 shared object is not actually shared across processes.  Instead of
21437 using @option{-mimpure-text}, you should compile all source code with
21438 @option{-fpic} or @option{-fPIC}.
21440 @end table
21442 These switches are supported in addition to the above on Solaris 2:
21444 @table @gcctabopt
21445 @item -pthreads
21446 @opindex pthreads
21447 Add support for multithreading using the POSIX threads library.  This
21448 option sets flags for both the preprocessor and linker.  This option does
21449 not affect the thread safety of object code produced  by the compiler or
21450 that of libraries supplied with it.
21452 @item -pthread
21453 @opindex pthread
21454 This is a synonym for @option{-pthreads}.
21455 @end table
21457 @node SPARC Options
21458 @subsection SPARC Options
21459 @cindex SPARC options
21461 These @samp{-m} options are supported on the SPARC:
21463 @table @gcctabopt
21464 @item -mno-app-regs
21465 @itemx -mapp-regs
21466 @opindex mno-app-regs
21467 @opindex mapp-regs
21468 Specify @option{-mapp-regs} to generate output using the global registers
21469 2 through 4, which the SPARC SVR4 ABI reserves for applications.  Like the
21470 global register 1, each global register 2 through 4 is then treated as an
21471 allocable register that is clobbered by function calls.  This is the default.
21473 To be fully SVR4 ABI-compliant at the cost of some performance loss,
21474 specify @option{-mno-app-regs}.  You should compile libraries and system
21475 software with this option.
21477 @item -mflat
21478 @itemx -mno-flat
21479 @opindex mflat
21480 @opindex mno-flat
21481 With @option{-mflat}, the compiler does not generate save/restore instructions
21482 and uses a ``flat'' or single register window model.  This model is compatible
21483 with the regular register window model.  The local registers and the input
21484 registers (0--5) are still treated as ``call-saved'' registers and are
21485 saved on the stack as needed.
21487 With @option{-mno-flat} (the default), the compiler generates save/restore
21488 instructions (except for leaf functions).  This is the normal operating mode.
21490 @item -mfpu
21491 @itemx -mhard-float
21492 @opindex mfpu
21493 @opindex mhard-float
21494 Generate output containing floating-point instructions.  This is the
21495 default.
21497 @item -mno-fpu
21498 @itemx -msoft-float
21499 @opindex mno-fpu
21500 @opindex msoft-float
21501 Generate output containing library calls for floating point.
21502 @strong{Warning:} the requisite libraries are not available for all SPARC
21503 targets.  Normally the facilities of the machine's usual C compiler are
21504 used, but this cannot be done directly in cross-compilation.  You must make
21505 your own arrangements to provide suitable library functions for
21506 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
21507 @samp{sparclite-*-*} do provide software floating-point support.
21509 @option{-msoft-float} changes the calling convention in the output file;
21510 therefore, it is only useful if you compile @emph{all} of a program with
21511 this option.  In particular, you need to compile @file{libgcc.a}, the
21512 library that comes with GCC, with @option{-msoft-float} in order for
21513 this to work.
21515 @item -mhard-quad-float
21516 @opindex mhard-quad-float
21517 Generate output containing quad-word (long double) floating-point
21518 instructions.
21520 @item -msoft-quad-float
21521 @opindex msoft-quad-float
21522 Generate output containing library calls for quad-word (long double)
21523 floating-point instructions.  The functions called are those specified
21524 in the SPARC ABI@.  This is the default.
21526 As of this writing, there are no SPARC implementations that have hardware
21527 support for the quad-word floating-point instructions.  They all invoke
21528 a trap handler for one of these instructions, and then the trap handler
21529 emulates the effect of the instruction.  Because of the trap handler overhead,
21530 this is much slower than calling the ABI library routines.  Thus the
21531 @option{-msoft-quad-float} option is the default.
21533 @item -mno-unaligned-doubles
21534 @itemx -munaligned-doubles
21535 @opindex mno-unaligned-doubles
21536 @opindex munaligned-doubles
21537 Assume that doubles have 8-byte alignment.  This is the default.
21539 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
21540 alignment only if they are contained in another type, or if they have an
21541 absolute address.  Otherwise, it assumes they have 4-byte alignment.
21542 Specifying this option avoids some rare compatibility problems with code
21543 generated by other compilers.  It is not the default because it results
21544 in a performance loss, especially for floating-point code.
21546 @item -muser-mode
21547 @itemx -mno-user-mode
21548 @opindex muser-mode
21549 @opindex mno-user-mode
21550 Do not generate code that can only run in supervisor mode.  This is relevant
21551 only for the @code{casa} instruction emitted for the LEON3 processor.  The
21552 default is @option{-mno-user-mode}.
21554 @item -mno-faster-structs
21555 @itemx -mfaster-structs
21556 @opindex mno-faster-structs
21557 @opindex mfaster-structs
21558 With @option{-mfaster-structs}, the compiler assumes that structures
21559 should have 8-byte alignment.  This enables the use of pairs of
21560 @code{ldd} and @code{std} instructions for copies in structure
21561 assignment, in place of twice as many @code{ld} and @code{st} pairs.
21562 However, the use of this changed alignment directly violates the SPARC
21563 ABI@.  Thus, it's intended only for use on targets where the developer
21564 acknowledges that their resulting code is not directly in line with
21565 the rules of the ABI@.
21567 @item -mcpu=@var{cpu_type}
21568 @opindex mcpu
21569 Set the instruction set, register set, and instruction scheduling parameters
21570 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
21571 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
21572 @samp{leon}, @samp{leon3}, @samp{leon3v7}, @samp{sparclite}, @samp{f930},
21573 @samp{f934}, @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
21574 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
21575 @samp{niagara3} and @samp{niagara4}.
21577 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
21578 which selects the best architecture option for the host processor.
21579 @option{-mcpu=native} has no effect if GCC does not recognize
21580 the processor.
21582 Default instruction scheduling parameters are used for values that select
21583 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
21584 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
21586 Here is a list of each supported architecture and their supported
21587 implementations.
21589 @table @asis
21590 @item v7
21591 cypress, leon3v7
21593 @item v8
21594 supersparc, hypersparc, leon, leon3
21596 @item sparclite
21597 f930, f934, sparclite86x
21599 @item sparclet
21600 tsc701
21602 @item v9
21603 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4
21604 @end table
21606 By default (unless configured otherwise), GCC generates code for the V7
21607 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
21608 additionally optimizes it for the Cypress CY7C602 chip, as used in the
21609 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
21610 SPARCStation 1, 2, IPX etc.
21612 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
21613 architecture.  The only difference from V7 code is that the compiler emits
21614 the integer multiply and integer divide instructions which exist in SPARC-V8
21615 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
21616 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
21617 2000 series.
21619 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
21620 the SPARC architecture.  This adds the integer multiply, integer divide step
21621 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
21622 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
21623 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
21624 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
21625 MB86934 chip, which is the more recent SPARClite with FPU@.
21627 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
21628 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
21629 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
21630 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
21631 optimizes it for the TEMIC SPARClet chip.
21633 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
21634 architecture.  This adds 64-bit integer and floating-point move instructions,
21635 3 additional floating-point condition code registers and conditional move
21636 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
21637 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
21638 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
21639 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
21640 @option{-mcpu=niagara}, the compiler additionally optimizes it for
21641 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
21642 additionally optimizes it for Sun UltraSPARC T2 chips. With
21643 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
21644 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
21645 additionally optimizes it for Sun UltraSPARC T4 chips.
21647 @item -mtune=@var{cpu_type}
21648 @opindex mtune
21649 Set the instruction scheduling parameters for machine type
21650 @var{cpu_type}, but do not set the instruction set or register set that the
21651 option @option{-mcpu=@var{cpu_type}} does.
21653 The same values for @option{-mcpu=@var{cpu_type}} can be used for
21654 @option{-mtune=@var{cpu_type}}, but the only useful values are those
21655 that select a particular CPU implementation.  Those are @samp{cypress},
21656 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{leon3},
21657 @samp{leon3v7}, @samp{f930}, @samp{f934}, @samp{sparclite86x}, @samp{tsc701},
21658 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
21659 @samp{niagara3} and @samp{niagara4}.  With native Solaris and GNU/Linux
21660 toolchains, @samp{native} can also be used.
21662 @item -mv8plus
21663 @itemx -mno-v8plus
21664 @opindex mv8plus
21665 @opindex mno-v8plus
21666 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
21667 difference from the V8 ABI is that the global and out registers are
21668 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
21669 mode for all SPARC-V9 processors.
21671 @item -mvis
21672 @itemx -mno-vis
21673 @opindex mvis
21674 @opindex mno-vis
21675 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
21676 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
21678 @item -mvis2
21679 @itemx -mno-vis2
21680 @opindex mvis2
21681 @opindex mno-vis2
21682 With @option{-mvis2}, GCC generates code that takes advantage of
21683 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
21684 default is @option{-mvis2} when targeting a cpu that supports such
21685 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
21686 also sets @option{-mvis}.
21688 @item -mvis3
21689 @itemx -mno-vis3
21690 @opindex mvis3
21691 @opindex mno-vis3
21692 With @option{-mvis3}, GCC generates code that takes advantage of
21693 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
21694 default is @option{-mvis3} when targeting a cpu that supports such
21695 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
21696 also sets @option{-mvis2} and @option{-mvis}.
21698 @item -mcbcond
21699 @itemx -mno-cbcond
21700 @opindex mcbcond
21701 @opindex mno-cbcond
21702 With @option{-mcbcond}, GCC generates code that takes advantage of
21703 compare-and-branch instructions, as defined in the Sparc Architecture 2011.
21704 The default is @option{-mcbcond} when targeting a cpu that supports such
21705 instructions, such as niagara-4 and later.
21707 @item -mpopc
21708 @itemx -mno-popc
21709 @opindex mpopc
21710 @opindex mno-popc
21711 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
21712 population count instruction.  The default is @option{-mpopc}
21713 when targeting a cpu that supports such instructions, such as Niagara-2 and
21714 later.
21716 @item -mfmaf
21717 @itemx -mno-fmaf
21718 @opindex mfmaf
21719 @opindex mno-fmaf
21720 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
21721 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
21722 when targeting a cpu that supports such instructions, such as Niagara-3 and
21723 later.
21725 @item -mfix-at697f
21726 @opindex mfix-at697f
21727 Enable the documented workaround for the single erratum of the Atmel AT697F
21728 processor (which corresponds to erratum #13 of the AT697E processor).
21730 @item -mfix-ut699
21731 @opindex mfix-ut699
21732 Enable the documented workarounds for the floating-point errata and the data
21733 cache nullify errata of the UT699 processor.
21734 @end table
21736 These @samp{-m} options are supported in addition to the above
21737 on SPARC-V9 processors in 64-bit environments:
21739 @table @gcctabopt
21740 @item -m32
21741 @itemx -m64
21742 @opindex m32
21743 @opindex m64
21744 Generate code for a 32-bit or 64-bit environment.
21745 The 32-bit environment sets int, long and pointer to 32 bits.
21746 The 64-bit environment sets int to 32 bits and long and pointer
21747 to 64 bits.
21749 @item -mcmodel=@var{which}
21750 @opindex mcmodel
21751 Set the code model to one of
21753 @table @samp
21754 @item medlow
21755 The Medium/Low code model: 64-bit addresses, programs
21756 must be linked in the low 32 bits of memory.  Programs can be statically
21757 or dynamically linked.
21759 @item medmid
21760 The Medium/Middle code model: 64-bit addresses, programs
21761 must be linked in the low 44 bits of memory, the text and data segments must
21762 be less than 2GB in size and the data segment must be located within 2GB of
21763 the text segment.
21765 @item medany
21766 The Medium/Anywhere code model: 64-bit addresses, programs
21767 may be linked anywhere in memory, the text and data segments must be less
21768 than 2GB in size and the data segment must be located within 2GB of the
21769 text segment.
21771 @item embmedany
21772 The Medium/Anywhere code model for embedded systems:
21773 64-bit addresses, the text and data segments must be less than 2GB in
21774 size, both starting anywhere in memory (determined at link time).  The
21775 global register %g4 points to the base of the data segment.  Programs
21776 are statically linked and PIC is not supported.
21777 @end table
21779 @item -mmemory-model=@var{mem-model}
21780 @opindex mmemory-model
21781 Set the memory model in force on the processor to one of
21783 @table @samp
21784 @item default
21785 The default memory model for the processor and operating system.
21787 @item rmo
21788 Relaxed Memory Order
21790 @item pso
21791 Partial Store Order
21793 @item tso
21794 Total Store Order
21796 @item sc
21797 Sequential Consistency
21798 @end table
21800 These memory models are formally defined in Appendix D of the Sparc V9
21801 architecture manual, as set in the processor's @code{PSTATE.MM} field.
21803 @item -mstack-bias
21804 @itemx -mno-stack-bias
21805 @opindex mstack-bias
21806 @opindex mno-stack-bias
21807 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
21808 frame pointer if present, are offset by @minus{}2047 which must be added back
21809 when making stack frame references.  This is the default in 64-bit mode.
21810 Otherwise, assume no such offset is present.
21811 @end table
21813 @node SPU Options
21814 @subsection SPU Options
21815 @cindex SPU options
21817 These @samp{-m} options are supported on the SPU:
21819 @table @gcctabopt
21820 @item -mwarn-reloc
21821 @itemx -merror-reloc
21822 @opindex mwarn-reloc
21823 @opindex merror-reloc
21825 The loader for SPU does not handle dynamic relocations.  By default, GCC
21826 gives an error when it generates code that requires a dynamic
21827 relocation.  @option{-mno-error-reloc} disables the error,
21828 @option{-mwarn-reloc} generates a warning instead.
21830 @item -msafe-dma
21831 @itemx -munsafe-dma
21832 @opindex msafe-dma
21833 @opindex munsafe-dma
21835 Instructions that initiate or test completion of DMA must not be
21836 reordered with respect to loads and stores of the memory that is being
21837 accessed.
21838 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
21839 memory accesses, but that can lead to inefficient code in places where the
21840 memory is known to not change.  Rather than mark the memory as volatile,
21841 you can use @option{-msafe-dma} to tell the compiler to treat
21842 the DMA instructions as potentially affecting all memory.  
21844 @item -mbranch-hints
21845 @opindex mbranch-hints
21847 By default, GCC generates a branch hint instruction to avoid
21848 pipeline stalls for always-taken or probably-taken branches.  A hint
21849 is not generated closer than 8 instructions away from its branch.
21850 There is little reason to disable them, except for debugging purposes,
21851 or to make an object a little bit smaller.
21853 @item -msmall-mem
21854 @itemx -mlarge-mem
21855 @opindex msmall-mem
21856 @opindex mlarge-mem
21858 By default, GCC generates code assuming that addresses are never larger
21859 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
21860 a full 32-bit address.
21862 @item -mstdmain
21863 @opindex mstdmain
21865 By default, GCC links against startup code that assumes the SPU-style
21866 main function interface (which has an unconventional parameter list).
21867 With @option{-mstdmain}, GCC links your program against startup
21868 code that assumes a C99-style interface to @code{main}, including a
21869 local copy of @code{argv} strings.
21871 @item -mfixed-range=@var{register-range}
21872 @opindex mfixed-range
21873 Generate code treating the given register range as fixed registers.
21874 A fixed register is one that the register allocator cannot use.  This is
21875 useful when compiling kernel code.  A register range is specified as
21876 two registers separated by a dash.  Multiple register ranges can be
21877 specified separated by a comma.
21879 @item -mea32
21880 @itemx -mea64
21881 @opindex mea32
21882 @opindex mea64
21883 Compile code assuming that pointers to the PPU address space accessed
21884 via the @code{__ea} named address space qualifier are either 32 or 64
21885 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
21886 all object code in an executable must be compiled with the same setting.
21888 @item -maddress-space-conversion
21889 @itemx -mno-address-space-conversion
21890 @opindex maddress-space-conversion
21891 @opindex mno-address-space-conversion
21892 Allow/disallow treating the @code{__ea} address space as superset
21893 of the generic address space.  This enables explicit type casts
21894 between @code{__ea} and generic pointer as well as implicit
21895 conversions of generic pointers to @code{__ea} pointers.  The
21896 default is to allow address space pointer conversions.
21898 @item -mcache-size=@var{cache-size}
21899 @opindex mcache-size
21900 This option controls the version of libgcc that the compiler links to an
21901 executable and selects a software-managed cache for accessing variables
21902 in the @code{__ea} address space with a particular cache size.  Possible
21903 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
21904 and @samp{128}.  The default cache size is 64KB.
21906 @item -matomic-updates
21907 @itemx -mno-atomic-updates
21908 @opindex matomic-updates
21909 @opindex mno-atomic-updates
21910 This option controls the version of libgcc that the compiler links to an
21911 executable and selects whether atomic updates to the software-managed
21912 cache of PPU-side variables are used.  If you use atomic updates, changes
21913 to a PPU variable from SPU code using the @code{__ea} named address space
21914 qualifier do not interfere with changes to other PPU variables residing
21915 in the same cache line from PPU code.  If you do not use atomic updates,
21916 such interference may occur; however, writing back cache lines is
21917 more efficient.  The default behavior is to use atomic updates.
21919 @item -mdual-nops
21920 @itemx -mdual-nops=@var{n}
21921 @opindex mdual-nops
21922 By default, GCC inserts nops to increase dual issue when it expects
21923 it to increase performance.  @var{n} can be a value from 0 to 10.  A
21924 smaller @var{n} inserts fewer nops.  10 is the default, 0 is the
21925 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
21927 @item -mhint-max-nops=@var{n}
21928 @opindex mhint-max-nops
21929 Maximum number of nops to insert for a branch hint.  A branch hint must
21930 be at least 8 instructions away from the branch it is affecting.  GCC
21931 inserts up to @var{n} nops to enforce this, otherwise it does not
21932 generate the branch hint.
21934 @item -mhint-max-distance=@var{n}
21935 @opindex mhint-max-distance
21936 The encoding of the branch hint instruction limits the hint to be within
21937 256 instructions of the branch it is affecting.  By default, GCC makes
21938 sure it is within 125.
21940 @item -msafe-hints
21941 @opindex msafe-hints
21942 Work around a hardware bug that causes the SPU to stall indefinitely.
21943 By default, GCC inserts the @code{hbrp} instruction to make sure
21944 this stall won't happen.
21946 @end table
21948 @node System V Options
21949 @subsection Options for System V
21951 These additional options are available on System V Release 4 for
21952 compatibility with other compilers on those systems:
21954 @table @gcctabopt
21955 @item -G
21956 @opindex G
21957 Create a shared object.
21958 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
21960 @item -Qy
21961 @opindex Qy
21962 Identify the versions of each tool used by the compiler, in a
21963 @code{.ident} assembler directive in the output.
21965 @item -Qn
21966 @opindex Qn
21967 Refrain from adding @code{.ident} directives to the output file (this is
21968 the default).
21970 @item -YP,@var{dirs}
21971 @opindex YP
21972 Search the directories @var{dirs}, and no others, for libraries
21973 specified with @option{-l}.
21975 @item -Ym,@var{dir}
21976 @opindex Ym
21977 Look in the directory @var{dir} to find the M4 preprocessor.
21978 The assembler uses this option.
21979 @c This is supposed to go with a -Yd for predefined M4 macro files, but
21980 @c the generic assembler that comes with Solaris takes just -Ym.
21981 @end table
21983 @node TILE-Gx Options
21984 @subsection TILE-Gx Options
21985 @cindex TILE-Gx options
21987 These @samp{-m} options are supported on the TILE-Gx:
21989 @table @gcctabopt
21990 @item -mcmodel=small
21991 @opindex mcmodel=small
21992 Generate code for the small model.  The distance for direct calls is
21993 limited to 500M in either direction.  PC-relative addresses are 32
21994 bits.  Absolute addresses support the full address range.
21996 @item -mcmodel=large
21997 @opindex mcmodel=large
21998 Generate code for the large model.  There is no limitation on call
21999 distance, pc-relative addresses, or absolute addresses.
22001 @item -mcpu=@var{name}
22002 @opindex mcpu
22003 Selects the type of CPU to be targeted.  Currently the only supported
22004 type is @samp{tilegx}.
22006 @item -m32
22007 @itemx -m64
22008 @opindex m32
22009 @opindex m64
22010 Generate code for a 32-bit or 64-bit environment.  The 32-bit
22011 environment sets int, long, and pointer to 32 bits.  The 64-bit
22012 environment sets int to 32 bits and long and pointer to 64 bits.
22014 @item -mbig-endian
22015 @itemx -mlittle-endian
22016 @opindex mbig-endian
22017 @opindex mlittle-endian
22018 Generate code in big/little endian mode, respectively.
22019 @end table
22021 @node TILEPro Options
22022 @subsection TILEPro Options
22023 @cindex TILEPro options
22025 These @samp{-m} options are supported on the TILEPro:
22027 @table @gcctabopt
22028 @item -mcpu=@var{name}
22029 @opindex mcpu
22030 Selects the type of CPU to be targeted.  Currently the only supported
22031 type is @samp{tilepro}.
22033 @item -m32
22034 @opindex m32
22035 Generate code for a 32-bit environment, which sets int, long, and
22036 pointer to 32 bits.  This is the only supported behavior so the flag
22037 is essentially ignored.
22038 @end table
22040 @node V850 Options
22041 @subsection V850 Options
22042 @cindex V850 Options
22044 These @samp{-m} options are defined for V850 implementations:
22046 @table @gcctabopt
22047 @item -mlong-calls
22048 @itemx -mno-long-calls
22049 @opindex mlong-calls
22050 @opindex mno-long-calls
22051 Treat all calls as being far away (near).  If calls are assumed to be
22052 far away, the compiler always loads the function's address into a
22053 register, and calls indirect through the pointer.
22055 @item -mno-ep
22056 @itemx -mep
22057 @opindex mno-ep
22058 @opindex mep
22059 Do not optimize (do optimize) basic blocks that use the same index
22060 pointer 4 or more times to copy pointer into the @code{ep} register, and
22061 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
22062 option is on by default if you optimize.
22064 @item -mno-prolog-function
22065 @itemx -mprolog-function
22066 @opindex mno-prolog-function
22067 @opindex mprolog-function
22068 Do not use (do use) external functions to save and restore registers
22069 at the prologue and epilogue of a function.  The external functions
22070 are slower, but use less code space if more than one function saves
22071 the same number of registers.  The @option{-mprolog-function} option
22072 is on by default if you optimize.
22074 @item -mspace
22075 @opindex mspace
22076 Try to make the code as small as possible.  At present, this just turns
22077 on the @option{-mep} and @option{-mprolog-function} options.
22079 @item -mtda=@var{n}
22080 @opindex mtda
22081 Put static or global variables whose size is @var{n} bytes or less into
22082 the tiny data area that register @code{ep} points to.  The tiny data
22083 area can hold up to 256 bytes in total (128 bytes for byte references).
22085 @item -msda=@var{n}
22086 @opindex msda
22087 Put static or global variables whose size is @var{n} bytes or less into
22088 the small data area that register @code{gp} points to.  The small data
22089 area can hold up to 64 kilobytes.
22091 @item -mzda=@var{n}
22092 @opindex mzda
22093 Put static or global variables whose size is @var{n} bytes or less into
22094 the first 32 kilobytes of memory.
22096 @item -mv850
22097 @opindex mv850
22098 Specify that the target processor is the V850.
22100 @item -mv850e3v5
22101 @opindex mv850e3v5
22102 Specify that the target processor is the V850E3V5.  The preprocessor
22103 constant @samp{__v850e3v5__} is defined if this option is used.
22105 @item -mv850e2v4
22106 @opindex mv850e2v4
22107 Specify that the target processor is the V850E3V5.  This is an alias for
22108 the @option{-mv850e3v5} option.
22110 @item -mv850e2v3
22111 @opindex mv850e2v3
22112 Specify that the target processor is the V850E2V3.  The preprocessor
22113 constant @samp{__v850e2v3__} is defined if this option is used.
22115 @item -mv850e2
22116 @opindex mv850e2
22117 Specify that the target processor is the V850E2.  The preprocessor
22118 constant @samp{__v850e2__} is defined if this option is used.
22120 @item -mv850e1
22121 @opindex mv850e1
22122 Specify that the target processor is the V850E1.  The preprocessor
22123 constants @samp{__v850e1__} and @samp{__v850e__} are defined if
22124 this option is used.
22126 @item -mv850es
22127 @opindex mv850es
22128 Specify that the target processor is the V850ES.  This is an alias for
22129 the @option{-mv850e1} option.
22131 @item -mv850e
22132 @opindex mv850e
22133 Specify that the target processor is the V850E@.  The preprocessor
22134 constant @samp{__v850e__} is defined if this option is used.
22136 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
22137 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
22138 are defined then a default target processor is chosen and the
22139 relevant @samp{__v850*__} preprocessor constant is defined.
22141 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
22142 defined, regardless of which processor variant is the target.
22144 @item -mdisable-callt
22145 @itemx -mno-disable-callt
22146 @opindex mdisable-callt
22147 @opindex mno-disable-callt
22148 This option suppresses generation of the @code{CALLT} instruction for the
22149 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
22150 architecture.
22152 This option is enabled by default when the RH850 ABI is
22153 in use (see @option{-mrh850-abi}), and disabled by default when the
22154 GCC ABI is in use.  If @code{CALLT} instructions are being generated
22155 then the C preprocessor symbol @code{__V850_CALLT__} will be defined.
22157 @item -mrelax
22158 @itemx -mno-relax
22159 @opindex mrelax
22160 @opindex mno-relax
22161 Pass on (or do not pass on) the @option{-mrelax} command line option
22162 to the assembler.
22164 @item -mlong-jumps
22165 @itemx -mno-long-jumps
22166 @opindex mlong-jumps
22167 @opindex mno-long-jumps
22168 Disable (or re-enable) the generation of PC-relative jump instructions.
22170 @item -msoft-float
22171 @itemx -mhard-float
22172 @opindex msoft-float
22173 @opindex mhard-float
22174 Disable (or re-enable) the generation of hardware floating point
22175 instructions.  This option is only significant when the target
22176 architecture is @samp{V850E2V3} or higher.  If hardware floating point
22177 instructions are being generated then the C preprocessor symbol
22178 @code{__FPU_OK__} will be defined, otherwise the symbol
22179 @code{__NO_FPU__} will be defined.
22181 @item -mloop
22182 @opindex mloop
22183 Enables the use of the e3v5 LOOP instruction.  The use of this
22184 instruction is not enabled by default when the e3v5 architecture is
22185 selected because its use is still experimental.
22187 @item -mrh850-abi
22188 @itemx -mghs
22189 @opindex mrh850-abi
22190 @opindex mghs
22191 Enables support for the RH850 version of the V850 ABI.  This is the
22192 default.  With this version of the ABI the following rules apply:
22194 @itemize
22195 @item
22196 Integer sized structures and unions are returned via a memory pointer
22197 rather than a register.
22199 @item
22200 Large structures and unions (more than 8 bytes in size) are passed by
22201 value.
22203 @item
22204 Functions are aligned to 16-bit boundaries.
22206 @item
22207 The @option{-m8byte-align} command line option is supported.
22209 @item
22210 The @option{-mdisable-callt} command line option is enabled by
22211 default.  The @option{-mno-disable-callt} command line option is not
22212 supported.
22213 @end itemize
22215 When this version of the ABI is enabled the C preprocessor symbol
22216 @code{__V850_RH850_ABI__} is defined.
22218 @item -mgcc-abi
22219 @opindex mgcc-abi
22220 Enables support for the old GCC version of the V850 ABI.  With this
22221 version of the ABI the following rules apply:
22223 @itemize
22224 @item
22225 Integer sized structures and unions are returned in register @code{r10}.
22227 @item
22228 Large structures and unions (more than 8 bytes in size) are passed by
22229 reference.
22231 @item
22232 Functions are aligned to 32-bit boundaries, unless optimizing for
22233 size.
22235 @item
22236 The @option{-m8byte-align} command line option is not supported.
22238 @item
22239 The @option{-mdisable-callt} command line option is supported but not
22240 enabled by default.
22241 @end itemize
22243 When this version of the ABI is enabled the C preprocessor symbol
22244 @code{__V850_GCC_ABI__} is defined.
22246 @item -m8byte-align
22247 @itemx -mno-8byte-align
22248 @opindex m8byte-align
22249 @opindex mno-8byte-align
22250 Enables support for @code{doubles} and @code{long long} types to be
22251 aligned on 8-byte boundaries.  The default is to restrict the
22252 alignment of all objects to at most 4-bytes.  When
22253 @option{-m8byte-align} is in effect the C preprocessor symbol
22254 @code{__V850_8BYTE_ALIGN__} will be defined.
22256 @item -mbig-switch
22257 @opindex mbig-switch
22258 Generate code suitable for big switch tables.  Use this option only if
22259 the assembler/linker complain about out of range branches within a switch
22260 table.
22262 @item -mapp-regs
22263 @opindex mapp-regs
22264 This option causes r2 and r5 to be used in the code generated by
22265 the compiler.  This setting is the default.
22267 @item -mno-app-regs
22268 @opindex mno-app-regs
22269 This option causes r2 and r5 to be treated as fixed registers.
22271 @end table
22273 @node VAX Options
22274 @subsection VAX Options
22275 @cindex VAX options
22277 These @samp{-m} options are defined for the VAX:
22279 @table @gcctabopt
22280 @item -munix
22281 @opindex munix
22282 Do not output certain jump instructions (@code{aobleq} and so on)
22283 that the Unix assembler for the VAX cannot handle across long
22284 ranges.
22286 @item -mgnu
22287 @opindex mgnu
22288 Do output those jump instructions, on the assumption that the
22289 GNU assembler is being used.
22291 @item -mg
22292 @opindex mg
22293 Output code for G-format floating-point numbers instead of D-format.
22294 @end table
22296 @node VMS Options
22297 @subsection VMS Options
22299 These @samp{-m} options are defined for the VMS implementations:
22301 @table @gcctabopt
22302 @item -mvms-return-codes
22303 @opindex mvms-return-codes
22304 Return VMS condition codes from @code{main}. The default is to return POSIX-style
22305 condition (e.g.@ error) codes.
22307 @item -mdebug-main=@var{prefix}
22308 @opindex mdebug-main=@var{prefix}
22309 Flag the first routine whose name starts with @var{prefix} as the main
22310 routine for the debugger.
22312 @item -mmalloc64
22313 @opindex mmalloc64
22314 Default to 64-bit memory allocation routines.
22316 @item -mpointer-size=@var{size}
22317 @opindex -mpointer-size=@var{size}
22318 Set the default size of pointers. Possible options for @var{size} are
22319 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
22320 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
22321 The later option disables @code{pragma pointer_size}.
22322 @end table
22324 @node VxWorks Options
22325 @subsection VxWorks Options
22326 @cindex VxWorks Options
22328 The options in this section are defined for all VxWorks targets.
22329 Options specific to the target hardware are listed with the other
22330 options for that target.
22332 @table @gcctabopt
22333 @item -mrtp
22334 @opindex mrtp
22335 GCC can generate code for both VxWorks kernels and real time processes
22336 (RTPs).  This option switches from the former to the latter.  It also
22337 defines the preprocessor macro @code{__RTP__}.
22339 @item -non-static
22340 @opindex non-static
22341 Link an RTP executable against shared libraries rather than static
22342 libraries.  The options @option{-static} and @option{-shared} can
22343 also be used for RTPs (@pxref{Link Options}); @option{-static}
22344 is the default.
22346 @item -Bstatic
22347 @itemx -Bdynamic
22348 @opindex Bstatic
22349 @opindex Bdynamic
22350 These options are passed down to the linker.  They are defined for
22351 compatibility with Diab.
22353 @item -Xbind-lazy
22354 @opindex Xbind-lazy
22355 Enable lazy binding of function calls.  This option is equivalent to
22356 @option{-Wl,-z,now} and is defined for compatibility with Diab.
22358 @item -Xbind-now
22359 @opindex Xbind-now
22360 Disable lazy binding of function calls.  This option is the default and
22361 is defined for compatibility with Diab.
22362 @end table
22364 @node x86-64 Options
22365 @subsection x86-64 Options
22366 @cindex x86-64 options
22368 These are listed under @xref{i386 and x86-64 Options}.
22370 @node Xstormy16 Options
22371 @subsection Xstormy16 Options
22372 @cindex Xstormy16 Options
22374 These options are defined for Xstormy16:
22376 @table @gcctabopt
22377 @item -msim
22378 @opindex msim
22379 Choose startup files and linker script suitable for the simulator.
22380 @end table
22382 @node Xtensa Options
22383 @subsection Xtensa Options
22384 @cindex Xtensa Options
22386 These options are supported for Xtensa targets:
22388 @table @gcctabopt
22389 @item -mconst16
22390 @itemx -mno-const16
22391 @opindex mconst16
22392 @opindex mno-const16
22393 Enable or disable use of @code{CONST16} instructions for loading
22394 constant values.  The @code{CONST16} instruction is currently not a
22395 standard option from Tensilica.  When enabled, @code{CONST16}
22396 instructions are always used in place of the standard @code{L32R}
22397 instructions.  The use of @code{CONST16} is enabled by default only if
22398 the @code{L32R} instruction is not available.
22400 @item -mfused-madd
22401 @itemx -mno-fused-madd
22402 @opindex mfused-madd
22403 @opindex mno-fused-madd
22404 Enable or disable use of fused multiply/add and multiply/subtract
22405 instructions in the floating-point option.  This has no effect if the
22406 floating-point option is not also enabled.  Disabling fused multiply/add
22407 and multiply/subtract instructions forces the compiler to use separate
22408 instructions for the multiply and add/subtract operations.  This may be
22409 desirable in some cases where strict IEEE 754-compliant results are
22410 required: the fused multiply add/subtract instructions do not round the
22411 intermediate result, thereby producing results with @emph{more} bits of
22412 precision than specified by the IEEE standard.  Disabling fused multiply
22413 add/subtract instructions also ensures that the program output is not
22414 sensitive to the compiler's ability to combine multiply and add/subtract
22415 operations.
22417 @item -mserialize-volatile
22418 @itemx -mno-serialize-volatile
22419 @opindex mserialize-volatile
22420 @opindex mno-serialize-volatile
22421 When this option is enabled, GCC inserts @code{MEMW} instructions before
22422 @code{volatile} memory references to guarantee sequential consistency.
22423 The default is @option{-mserialize-volatile}.  Use
22424 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
22426 @item -mforce-no-pic
22427 @opindex mforce-no-pic
22428 For targets, like GNU/Linux, where all user-mode Xtensa code must be
22429 position-independent code (PIC), this option disables PIC for compiling
22430 kernel code.
22432 @item -mtext-section-literals
22433 @itemx -mno-text-section-literals
22434 @opindex mtext-section-literals
22435 @opindex mno-text-section-literals
22436 Control the treatment of literal pools.  The default is
22437 @option{-mno-text-section-literals}, which places literals in a separate
22438 section in the output file.  This allows the literal pool to be placed
22439 in a data RAM/ROM, and it also allows the linker to combine literal
22440 pools from separate object files to remove redundant literals and
22441 improve code size.  With @option{-mtext-section-literals}, the literals
22442 are interspersed in the text section in order to keep them as close as
22443 possible to their references.  This may be necessary for large assembly
22444 files.
22446 @item -mtarget-align
22447 @itemx -mno-target-align
22448 @opindex mtarget-align
22449 @opindex mno-target-align
22450 When this option is enabled, GCC instructs the assembler to
22451 automatically align instructions to reduce branch penalties at the
22452 expense of some code density.  The assembler attempts to widen density
22453 instructions to align branch targets and the instructions following call
22454 instructions.  If there are not enough preceding safe density
22455 instructions to align a target, no widening is performed.  The
22456 default is @option{-mtarget-align}.  These options do not affect the
22457 treatment of auto-aligned instructions like @code{LOOP}, which the
22458 assembler always aligns, either by widening density instructions or
22459 by inserting NOP instructions.
22461 @item -mlongcalls
22462 @itemx -mno-longcalls
22463 @opindex mlongcalls
22464 @opindex mno-longcalls
22465 When this option is enabled, GCC instructs the assembler to translate
22466 direct calls to indirect calls unless it can determine that the target
22467 of a direct call is in the range allowed by the call instruction.  This
22468 translation typically occurs for calls to functions in other source
22469 files.  Specifically, the assembler translates a direct @code{CALL}
22470 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
22471 The default is @option{-mno-longcalls}.  This option should be used in
22472 programs where the call target can potentially be out of range.  This
22473 option is implemented in the assembler, not the compiler, so the
22474 assembly code generated by GCC still shows direct call
22475 instructions---look at the disassembled object code to see the actual
22476 instructions.  Note that the assembler uses an indirect call for
22477 every cross-file call, not just those that really are out of range.
22478 @end table
22480 @node zSeries Options
22481 @subsection zSeries Options
22482 @cindex zSeries options
22484 These are listed under @xref{S/390 and zSeries Options}.
22486 @node Code Gen Options
22487 @section Options for Code Generation Conventions
22488 @cindex code generation conventions
22489 @cindex options, code generation
22490 @cindex run-time options
22492 These machine-independent options control the interface conventions
22493 used in code generation.
22495 Most of them have both positive and negative forms; the negative form
22496 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
22497 one of the forms is listed---the one that is not the default.  You
22498 can figure out the other form by either removing @samp{no-} or adding
22501 @table @gcctabopt
22502 @item -fbounds-check
22503 @opindex fbounds-check
22504 For front ends that support it, generate additional code to check that
22505 indices used to access arrays are within the declared range.  This is
22506 currently only supported by the Java and Fortran front ends, where
22507 this option defaults to true and false respectively.
22509 @item -fstack-reuse=@var{reuse-level}
22510 @opindex fstack_reuse
22511 This option controls stack space reuse for user declared local/auto variables
22512 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
22513 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
22514 local variables and temporaries, @samp{named_vars} enables the reuse only for
22515 user defined local variables with names, and @samp{none} disables stack reuse
22516 completely. The default value is @samp{all}. The option is needed when the
22517 program extends the lifetime of a scoped local variable or a compiler generated
22518 temporary beyond the end point defined by the language.  When a lifetime of
22519 a variable ends, and if the variable lives in memory, the optimizing compiler
22520 has the freedom to reuse its stack space with other temporaries or scoped
22521 local variables whose live range does not overlap with it. Legacy code extending
22522 local lifetime will likely to break with the stack reuse optimization.
22524 For example,
22526 @smallexample
22527    int *p;
22528    @{
22529      int local1;
22531      p = &local1;
22532      local1 = 10;
22533      ....
22534    @}
22535    @{
22536       int local2;
22537       local2 = 20;
22538       ...
22539    @}
22541    if (*p == 10)  // out of scope use of local1
22542      @{
22544      @}
22545 @end smallexample
22547 Another example:
22548 @smallexample
22550    struct A
22551    @{
22552        A(int k) : i(k), j(k) @{ @}
22553        int i;
22554        int j;
22555    @};
22557    A *ap;
22559    void foo(const A& ar)
22560    @{
22561       ap = &ar;
22562    @}
22564    void bar()
22565    @{
22566       foo(A(10)); // temp object's lifetime ends when foo returns
22568       @{
22569         A a(20);
22570         ....
22571       @}
22572       ap->i+= 10;  // ap references out of scope temp whose space
22573                    // is reused with a. What is the value of ap->i?
22574    @}
22576 @end smallexample
22578 The lifetime of a compiler generated temporary is well defined by the C++
22579 standard. When a lifetime of a temporary ends, and if the temporary lives
22580 in memory, the optimizing compiler has the freedom to reuse its stack
22581 space with other temporaries or scoped local variables whose live range
22582 does not overlap with it. However some of the legacy code relies on
22583 the behavior of older compilers in which temporaries' stack space is
22584 not reused, the aggressive stack reuse can lead to runtime errors. This
22585 option is used to control the temporary stack reuse optimization.
22587 @item -ftrapv
22588 @opindex ftrapv
22589 This option generates traps for signed overflow on addition, subtraction,
22590 multiplication operations.
22592 @item -fwrapv
22593 @opindex fwrapv
22594 This option instructs the compiler to assume that signed arithmetic
22595 overflow of addition, subtraction and multiplication wraps around
22596 using twos-complement representation.  This flag enables some optimizations
22597 and disables others.  This option is enabled by default for the Java
22598 front end, as required by the Java language specification.
22600 @item -fexceptions
22601 @opindex fexceptions
22602 Enable exception handling.  Generates extra code needed to propagate
22603 exceptions.  For some targets, this implies GCC generates frame
22604 unwind information for all functions, which can produce significant data
22605 size overhead, although it does not affect execution.  If you do not
22606 specify this option, GCC enables it by default for languages like
22607 C++ that normally require exception handling, and disables it for
22608 languages like C that do not normally require it.  However, you may need
22609 to enable this option when compiling C code that needs to interoperate
22610 properly with exception handlers written in C++.  You may also wish to
22611 disable this option if you are compiling older C++ programs that don't
22612 use exception handling.
22614 @item -fnon-call-exceptions
22615 @opindex fnon-call-exceptions
22616 Generate code that allows trapping instructions to throw exceptions.
22617 Note that this requires platform-specific runtime support that does
22618 not exist everywhere.  Moreover, it only allows @emph{trapping}
22619 instructions to throw exceptions, i.e.@: memory references or floating-point
22620 instructions.  It does not allow exceptions to be thrown from
22621 arbitrary signal handlers such as @code{SIGALRM}.
22623 @item -fdelete-dead-exceptions
22624 @opindex fdelete-dead-exceptions
22625 Consider that instructions that may throw exceptions but don't otherwise
22626 contribute to the execution of the program can be optimized away.
22627 This option is enabled by default for the Ada front end, as permitted by
22628 the Ada language specification.
22629 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
22631 @item -funwind-tables
22632 @opindex funwind-tables
22633 Similar to @option{-fexceptions}, except that it just generates any needed
22634 static data, but does not affect the generated code in any other way.
22635 You normally do not need to enable this option; instead, a language processor
22636 that needs this handling enables it on your behalf.
22638 @item -fasynchronous-unwind-tables
22639 @opindex fasynchronous-unwind-tables
22640 Generate unwind table in DWARF 2 format, if supported by target machine.  The
22641 table is exact at each instruction boundary, so it can be used for stack
22642 unwinding from asynchronous events (such as debugger or garbage collector).
22644 @item -fno-gnu-unique
22645 @opindex fno-gnu-unique
22646 On systems with recent GNU assembler and C library, the C++ compiler
22647 uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
22648 of template static data members and static local variables in inline
22649 functions are unique even in the presence of @code{RTLD_LOCAL}; this
22650 is necessary to avoid problems with a library used by two different
22651 @code{RTLD_LOCAL} plugins depending on a definition in one of them and
22652 therefore disagreeing with the other one about the binding of the
22653 symbol.  But this causes @code{dlclose} to be ignored for affected
22654 DSOs; if your program relies on reinitialization of a DSO via
22655 @code{dlclose} and @code{dlopen}, you can use
22656 @option{-fno-gnu-unique}.
22658 @item -fpcc-struct-return
22659 @opindex fpcc-struct-return
22660 Return ``short'' @code{struct} and @code{union} values in memory like
22661 longer ones, rather than in registers.  This convention is less
22662 efficient, but it has the advantage of allowing intercallability between
22663 GCC-compiled files and files compiled with other compilers, particularly
22664 the Portable C Compiler (pcc).
22666 The precise convention for returning structures in memory depends
22667 on the target configuration macros.
22669 Short structures and unions are those whose size and alignment match
22670 that of some integer type.
22672 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
22673 switch is not binary compatible with code compiled with the
22674 @option{-freg-struct-return} switch.
22675 Use it to conform to a non-default application binary interface.
22677 @item -freg-struct-return
22678 @opindex freg-struct-return
22679 Return @code{struct} and @code{union} values in registers when possible.
22680 This is more efficient for small structures than
22681 @option{-fpcc-struct-return}.
22683 If you specify neither @option{-fpcc-struct-return} nor
22684 @option{-freg-struct-return}, GCC defaults to whichever convention is
22685 standard for the target.  If there is no standard convention, GCC
22686 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
22687 the principal compiler.  In those cases, we can choose the standard, and
22688 we chose the more efficient register return alternative.
22690 @strong{Warning:} code compiled with the @option{-freg-struct-return}
22691 switch is not binary compatible with code compiled with the
22692 @option{-fpcc-struct-return} switch.
22693 Use it to conform to a non-default application binary interface.
22695 @item -fshort-enums
22696 @opindex fshort-enums
22697 Allocate to an @code{enum} type only as many bytes as it needs for the
22698 declared range of possible values.  Specifically, the @code{enum} type
22699 is equivalent to the smallest integer type that has enough room.
22701 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
22702 code that is not binary compatible with code generated without that switch.
22703 Use it to conform to a non-default application binary interface.
22705 @item -fshort-double
22706 @opindex fshort-double
22707 Use the same size for @code{double} as for @code{float}.
22709 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
22710 code that is not binary compatible with code generated without that switch.
22711 Use it to conform to a non-default application binary interface.
22713 @item -fshort-wchar
22714 @opindex fshort-wchar
22715 Override the underlying type for @samp{wchar_t} to be @samp{short
22716 unsigned int} instead of the default for the target.  This option is
22717 useful for building programs to run under WINE@.
22719 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
22720 code that is not binary compatible with code generated without that switch.
22721 Use it to conform to a non-default application binary interface.
22723 @item -fno-common
22724 @opindex fno-common
22725 In C code, controls the placement of uninitialized global variables.
22726 Unix C compilers have traditionally permitted multiple definitions of
22727 such variables in different compilation units by placing the variables
22728 in a common block.
22729 This is the behavior specified by @option{-fcommon}, and is the default
22730 for GCC on most targets.
22731 On the other hand, this behavior is not required by ISO C, and on some
22732 targets may carry a speed or code size penalty on variable references.
22733 The @option{-fno-common} option specifies that the compiler should place
22734 uninitialized global variables in the data section of the object file,
22735 rather than generating them as common blocks.
22736 This has the effect that if the same variable is declared
22737 (without @code{extern}) in two different compilations,
22738 you get a multiple-definition error when you link them.
22739 In this case, you must compile with @option{-fcommon} instead.
22740 Compiling with @option{-fno-common} is useful on targets for which
22741 it provides better performance, or if you wish to verify that the
22742 program will work on other systems that always treat uninitialized
22743 variable declarations this way.
22745 @item -fno-ident
22746 @opindex fno-ident
22747 Ignore the @samp{#ident} directive.
22749 @item -finhibit-size-directive
22750 @opindex finhibit-size-directive
22751 Don't output a @code{.size} assembler directive, or anything else that
22752 would cause trouble if the function is split in the middle, and the
22753 two halves are placed at locations far apart in memory.  This option is
22754 used when compiling @file{crtstuff.c}; you should not need to use it
22755 for anything else.
22757 @item -fverbose-asm
22758 @opindex fverbose-asm
22759 Put extra commentary information in the generated assembly code to
22760 make it more readable.  This option is generally only of use to those
22761 who actually need to read the generated assembly code (perhaps while
22762 debugging the compiler itself).
22764 @option{-fno-verbose-asm}, the default, causes the
22765 extra information to be omitted and is useful when comparing two assembler
22766 files.
22768 @item -frecord-gcc-switches
22769 @opindex frecord-gcc-switches
22770 This switch causes the command line used to invoke the
22771 compiler to be recorded into the object file that is being created.
22772 This switch is only implemented on some targets and the exact format
22773 of the recording is target and binary file format dependent, but it
22774 usually takes the form of a section containing ASCII text.  This
22775 switch is related to the @option{-fverbose-asm} switch, but that
22776 switch only records information in the assembler output file as
22777 comments, so it never reaches the object file.
22778 See also @option{-grecord-gcc-switches} for another
22779 way of storing compiler options into the object file.
22781 @item -fpic
22782 @opindex fpic
22783 @cindex global offset table
22784 @cindex PIC
22785 Generate position-independent code (PIC) suitable for use in a shared
22786 library, if supported for the target machine.  Such code accesses all
22787 constant addresses through a global offset table (GOT)@.  The dynamic
22788 loader resolves the GOT entries when the program starts (the dynamic
22789 loader is not part of GCC; it is part of the operating system).  If
22790 the GOT size for the linked executable exceeds a machine-specific
22791 maximum size, you get an error message from the linker indicating that
22792 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
22793 instead.  (These maximums are 8k on the SPARC and 32k
22794 on the m68k and RS/6000.  The 386 has no such limit.)
22796 Position-independent code requires special support, and therefore works
22797 only on certain machines.  For the 386, GCC supports PIC for System V
22798 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
22799 position-independent.
22801 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
22802 are defined to 1.
22804 @item -fPIC
22805 @opindex fPIC
22806 If supported for the target machine, emit position-independent code,
22807 suitable for dynamic linking and avoiding any limit on the size of the
22808 global offset table.  This option makes a difference on the m68k,
22809 PowerPC and SPARC@.
22811 Position-independent code requires special support, and therefore works
22812 only on certain machines.
22814 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
22815 are defined to 2.
22817 @item -fpie
22818 @itemx -fPIE
22819 @opindex fpie
22820 @opindex fPIE
22821 These options are similar to @option{-fpic} and @option{-fPIC}, but
22822 generated position independent code can be only linked into executables.
22823 Usually these options are used when @option{-pie} GCC option is
22824 used during linking.
22826 @option{-fpie} and @option{-fPIE} both define the macros
22827 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
22828 for @option{-fpie} and 2 for @option{-fPIE}.
22830 @item -fno-jump-tables
22831 @opindex fno-jump-tables
22832 Do not use jump tables for switch statements even where it would be
22833 more efficient than other code generation strategies.  This option is
22834 of use in conjunction with @option{-fpic} or @option{-fPIC} for
22835 building code that forms part of a dynamic linker and cannot
22836 reference the address of a jump table.  On some targets, jump tables
22837 do not require a GOT and this option is not needed.
22839 @item -ffixed-@var{reg}
22840 @opindex ffixed
22841 Treat the register named @var{reg} as a fixed register; generated code
22842 should never refer to it (except perhaps as a stack pointer, frame
22843 pointer or in some other fixed role).
22845 @var{reg} must be the name of a register.  The register names accepted
22846 are machine-specific and are defined in the @code{REGISTER_NAMES}
22847 macro in the machine description macro file.
22849 This flag does not have a negative form, because it specifies a
22850 three-way choice.
22852 @item -fcall-used-@var{reg}
22853 @opindex fcall-used
22854 Treat the register named @var{reg} as an allocable register that is
22855 clobbered by function calls.  It may be allocated for temporaries or
22856 variables that do not live across a call.  Functions compiled this way
22857 do not save and restore the register @var{reg}.
22859 It is an error to use this flag with the frame pointer or stack pointer.
22860 Use of this flag for other registers that have fixed pervasive roles in
22861 the machine's execution model produces disastrous results.
22863 This flag does not have a negative form, because it specifies a
22864 three-way choice.
22866 @item -fcall-saved-@var{reg}
22867 @opindex fcall-saved
22868 Treat the register named @var{reg} as an allocable register saved by
22869 functions.  It may be allocated even for temporaries or variables that
22870 live across a call.  Functions compiled this way save and restore
22871 the register @var{reg} if they use it.
22873 It is an error to use this flag with the frame pointer or stack pointer.
22874 Use of this flag for other registers that have fixed pervasive roles in
22875 the machine's execution model produces disastrous results.
22877 A different sort of disaster results from the use of this flag for
22878 a register in which function values may be returned.
22880 This flag does not have a negative form, because it specifies a
22881 three-way choice.
22883 @item -fpack-struct[=@var{n}]
22884 @opindex fpack-struct
22885 Without a value specified, pack all structure members together without
22886 holes.  When a value is specified (which must be a small power of two), pack
22887 structure members according to this value, representing the maximum
22888 alignment (that is, objects with default alignment requirements larger than
22889 this are output potentially unaligned at the next fitting location.
22891 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
22892 code that is not binary compatible with code generated without that switch.
22893 Additionally, it makes the code suboptimal.
22894 Use it to conform to a non-default application binary interface.
22896 @item -finstrument-functions
22897 @opindex finstrument-functions
22898 Generate instrumentation calls for entry and exit to functions.  Just
22899 after function entry and just before function exit, the following
22900 profiling functions are called with the address of the current
22901 function and its call site.  (On some platforms,
22902 @code{__builtin_return_address} does not work beyond the current
22903 function, so the call site information may not be available to the
22904 profiling functions otherwise.)
22906 @smallexample
22907 void __cyg_profile_func_enter (void *this_fn,
22908                                void *call_site);
22909 void __cyg_profile_func_exit  (void *this_fn,
22910                                void *call_site);
22911 @end smallexample
22913 The first argument is the address of the start of the current function,
22914 which may be looked up exactly in the symbol table.
22916 This instrumentation is also done for functions expanded inline in other
22917 functions.  The profiling calls indicate where, conceptually, the
22918 inline function is entered and exited.  This means that addressable
22919 versions of such functions must be available.  If all your uses of a
22920 function are expanded inline, this may mean an additional expansion of
22921 code size.  If you use @samp{extern inline} in your C code, an
22922 addressable version of such functions must be provided.  (This is
22923 normally the case anyway, but if you get lucky and the optimizer always
22924 expands the functions inline, you might have gotten away without
22925 providing static copies.)
22927 A function may be given the attribute @code{no_instrument_function}, in
22928 which case this instrumentation is not done.  This can be used, for
22929 example, for the profiling functions listed above, high-priority
22930 interrupt routines, and any functions from which the profiling functions
22931 cannot safely be called (perhaps signal handlers, if the profiling
22932 routines generate output or allocate memory).
22934 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
22935 @opindex finstrument-functions-exclude-file-list
22937 Set the list of functions that are excluded from instrumentation (see
22938 the description of @code{-finstrument-functions}).  If the file that
22939 contains a function definition matches with one of @var{file}, then
22940 that function is not instrumented.  The match is done on substrings:
22941 if the @var{file} parameter is a substring of the file name, it is
22942 considered to be a match.
22944 For example:
22946 @smallexample
22947 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
22948 @end smallexample
22950 @noindent
22951 excludes any inline function defined in files whose pathnames
22952 contain @code{/bits/stl} or @code{include/sys}.
22954 If, for some reason, you want to include letter @code{','} in one of
22955 @var{sym}, write @code{'\,'}. For example,
22956 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
22957 (note the single quote surrounding the option).
22959 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
22960 @opindex finstrument-functions-exclude-function-list
22962 This is similar to @code{-finstrument-functions-exclude-file-list},
22963 but this option sets the list of function names to be excluded from
22964 instrumentation.  The function name to be matched is its user-visible
22965 name, such as @code{vector<int> blah(const vector<int> &)}, not the
22966 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
22967 match is done on substrings: if the @var{sym} parameter is a substring
22968 of the function name, it is considered to be a match.  For C99 and C++
22969 extended identifiers, the function name must be given in UTF-8, not
22970 using universal character names.
22972 @item -fstack-check
22973 @opindex fstack-check
22974 Generate code to verify that you do not go beyond the boundary of the
22975 stack.  You should specify this flag if you are running in an
22976 environment with multiple threads, but you only rarely need to specify it in
22977 a single-threaded environment since stack overflow is automatically
22978 detected on nearly all systems if there is only one stack.
22980 Note that this switch does not actually cause checking to be done; the
22981 operating system or the language runtime must do that.  The switch causes
22982 generation of code to ensure that they see the stack being extended.
22984 You can additionally specify a string parameter: @code{no} means no
22985 checking, @code{generic} means force the use of old-style checking,
22986 @code{specific} means use the best checking method and is equivalent
22987 to bare @option{-fstack-check}.
22989 Old-style checking is a generic mechanism that requires no specific
22990 target support in the compiler but comes with the following drawbacks:
22992 @enumerate
22993 @item
22994 Modified allocation strategy for large objects: they are always
22995 allocated dynamically if their size exceeds a fixed threshold.
22997 @item
22998 Fixed limit on the size of the static frame of functions: when it is
22999 topped by a particular function, stack checking is not reliable and
23000 a warning is issued by the compiler.
23002 @item
23003 Inefficiency: because of both the modified allocation strategy and the
23004 generic implementation, code performance is hampered.
23005 @end enumerate
23007 Note that old-style stack checking is also the fallback method for
23008 @code{specific} if no target support has been added in the compiler.
23010 @item -fstack-limit-register=@var{reg}
23011 @itemx -fstack-limit-symbol=@var{sym}
23012 @itemx -fno-stack-limit
23013 @opindex fstack-limit-register
23014 @opindex fstack-limit-symbol
23015 @opindex fno-stack-limit
23016 Generate code to ensure that the stack does not grow beyond a certain value,
23017 either the value of a register or the address of a symbol.  If a larger
23018 stack is required, a signal is raised at run time.  For most targets,
23019 the signal is raised before the stack overruns the boundary, so
23020 it is possible to catch the signal without taking special precautions.
23022 For instance, if the stack starts at absolute address @samp{0x80000000}
23023 and grows downwards, you can use the flags
23024 @option{-fstack-limit-symbol=__stack_limit} and
23025 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
23026 of 128KB@.  Note that this may only work with the GNU linker.
23028 @item -fsplit-stack
23029 @opindex fsplit-stack
23030 Generate code to automatically split the stack before it overflows.
23031 The resulting program has a discontiguous stack which can only
23032 overflow if the program is unable to allocate any more memory.  This
23033 is most useful when running threaded programs, as it is no longer
23034 necessary to calculate a good stack size to use for each thread.  This
23035 is currently only implemented for the i386 and x86_64 back ends running
23036 GNU/Linux.
23038 When code compiled with @option{-fsplit-stack} calls code compiled
23039 without @option{-fsplit-stack}, there may not be much stack space
23040 available for the latter code to run.  If compiling all code,
23041 including library code, with @option{-fsplit-stack} is not an option,
23042 then the linker can fix up these calls so that the code compiled
23043 without @option{-fsplit-stack} always has a large stack.  Support for
23044 this is implemented in the gold linker in GNU binutils release 2.21
23045 and later.
23047 @item -fleading-underscore
23048 @opindex fleading-underscore
23049 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
23050 change the way C symbols are represented in the object file.  One use
23051 is to help link with legacy assembly code.
23053 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
23054 generate code that is not binary compatible with code generated without that
23055 switch.  Use it to conform to a non-default application binary interface.
23056 Not all targets provide complete support for this switch.
23058 @item -ftls-model=@var{model}
23059 @opindex ftls-model
23060 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
23061 The @var{model} argument should be one of @code{global-dynamic},
23062 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
23063 Note that the choice is subject to optimization: the compiler may use
23064 a more efficient model for symbols not visible outside of the translation
23065 unit, or if @option{-fpic} is not given on the command line.
23067 The default without @option{-fpic} is @code{initial-exec}; with
23068 @option{-fpic} the default is @code{global-dynamic}.
23070 @item -fvisibility=@var{default|internal|hidden|protected}
23071 @opindex fvisibility
23072 Set the default ELF image symbol visibility to the specified option---all
23073 symbols are marked with this unless overridden within the code.
23074 Using this feature can very substantially improve linking and
23075 load times of shared object libraries, produce more optimized
23076 code, provide near-perfect API export and prevent symbol clashes.
23077 It is @strong{strongly} recommended that you use this in any shared objects
23078 you distribute.
23080 Despite the nomenclature, @code{default} always means public; i.e.,
23081 available to be linked against from outside the shared object.
23082 @code{protected} and @code{internal} are pretty useless in real-world
23083 usage so the only other commonly used option is @code{hidden}.
23084 The default if @option{-fvisibility} isn't specified is
23085 @code{default}, i.e., make every
23086 symbol public---this causes the same behavior as previous versions of
23087 GCC@.
23089 A good explanation of the benefits offered by ensuring ELF
23090 symbols have the correct visibility is given by ``How To Write
23091 Shared Libraries'' by Ulrich Drepper (which can be found at
23092 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
23093 solution made possible by this option to marking things hidden when
23094 the default is public is to make the default hidden and mark things
23095 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
23096 and @code{__attribute__ ((visibility("default")))} instead of
23097 @code{__declspec(dllexport)} you get almost identical semantics with
23098 identical syntax.  This is a great boon to those working with
23099 cross-platform projects.
23101 For those adding visibility support to existing code, you may find
23102 @samp{#pragma GCC visibility} of use.  This works by you enclosing
23103 the declarations you wish to set visibility for with (for example)
23104 @samp{#pragma GCC visibility push(hidden)} and
23105 @samp{#pragma GCC visibility pop}.
23106 Bear in mind that symbol visibility should be viewed @strong{as
23107 part of the API interface contract} and thus all new code should
23108 always specify visibility when it is not the default; i.e., declarations
23109 only for use within the local DSO should @strong{always} be marked explicitly
23110 as hidden as so to avoid PLT indirection overheads---making this
23111 abundantly clear also aids readability and self-documentation of the code.
23112 Note that due to ISO C++ specification requirements, @code{operator new} and
23113 @code{operator delete} must always be of default visibility.
23115 Be aware that headers from outside your project, in particular system
23116 headers and headers from any other library you use, may not be
23117 expecting to be compiled with visibility other than the default.  You
23118 may need to explicitly say @samp{#pragma GCC visibility push(default)}
23119 before including any such headers.
23121 @samp{extern} declarations are not affected by @option{-fvisibility}, so
23122 a lot of code can be recompiled with @option{-fvisibility=hidden} with
23123 no modifications.  However, this means that calls to @code{extern}
23124 functions with no explicit visibility use the PLT, so it is more
23125 effective to use @code{__attribute ((visibility))} and/or
23126 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
23127 declarations should be treated as hidden.
23129 Note that @option{-fvisibility} does affect C++ vague linkage
23130 entities. This means that, for instance, an exception class that is
23131 be thrown between DSOs must be explicitly marked with default
23132 visibility so that the @samp{type_info} nodes are unified between
23133 the DSOs.
23135 An overview of these techniques, their benefits and how to use them
23136 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
23138 @item -fstrict-volatile-bitfields
23139 @opindex fstrict-volatile-bitfields
23140 This option should be used if accesses to volatile bit-fields (or other
23141 structure fields, although the compiler usually honors those types
23142 anyway) should use a single access of the width of the
23143 field's type, aligned to a natural alignment if possible.  For
23144 example, targets with memory-mapped peripheral registers might require
23145 all such accesses to be 16 bits wide; with this flag you can
23146 declare all peripheral bit-fields as @code{unsigned short} (assuming short
23147 is 16 bits on these targets) to force GCC to use 16-bit accesses
23148 instead of, perhaps, a more efficient 32-bit access.
23150 If this option is disabled, the compiler uses the most efficient
23151 instruction.  In the previous example, that might be a 32-bit load
23152 instruction, even though that accesses bytes that do not contain
23153 any portion of the bit-field, or memory-mapped registers unrelated to
23154 the one being updated.
23156 In some cases, such as when the @code{packed} attribute is applied to a 
23157 structure field, it may not be possible to access the field with a single
23158 read or write that is correctly aligned for the target machine.  In this
23159 case GCC falls back to generating multiple accesses rather than code that 
23160 will fault or truncate the result at run time.
23162 Note:  Due to restrictions of the C/C++11 memory model, write accesses are
23163 not allowed to touch non bit-field members.  It is therefore recommended
23164 to define all bits of the field's type as bit-field members.
23166 The default value of this option is determined by the application binary
23167 interface for the target processor.
23169 @item -fsync-libcalls
23170 @opindex fsync-libcalls
23171 This option controls whether any out-of-line instance of the @code{__sync}
23172 family of functions may be used to implement the C++11 @code{__atomic}
23173 family of functions.
23175 The default value of this option is enabled, thus the only useful form
23176 of the option is @option{-fno-sync-libcalls}.  This option is used in
23177 the implementation of the @file{libatomic} runtime library.
23179 @end table
23181 @c man end
23183 @node Environment Variables
23184 @section Environment Variables Affecting GCC
23185 @cindex environment variables
23187 @c man begin ENVIRONMENT
23188 This section describes several environment variables that affect how GCC
23189 operates.  Some of them work by specifying directories or prefixes to use
23190 when searching for various kinds of files.  Some are used to specify other
23191 aspects of the compilation environment.
23193 Note that you can also specify places to search using options such as
23194 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
23195 take precedence over places specified using environment variables, which
23196 in turn take precedence over those specified by the configuration of GCC@.
23197 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
23198 GNU Compiler Collection (GCC) Internals}.
23200 @table @env
23201 @item LANG
23202 @itemx LC_CTYPE
23203 @c @itemx LC_COLLATE
23204 @itemx LC_MESSAGES
23205 @c @itemx LC_MONETARY
23206 @c @itemx LC_NUMERIC
23207 @c @itemx LC_TIME
23208 @itemx LC_ALL
23209 @findex LANG
23210 @findex LC_CTYPE
23211 @c @findex LC_COLLATE
23212 @findex LC_MESSAGES
23213 @c @findex LC_MONETARY
23214 @c @findex LC_NUMERIC
23215 @c @findex LC_TIME
23216 @findex LC_ALL
23217 @cindex locale
23218 These environment variables control the way that GCC uses
23219 localization information which allows GCC to work with different
23220 national conventions.  GCC inspects the locale categories
23221 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
23222 so.  These locale categories can be set to any value supported by your
23223 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
23224 Kingdom encoded in UTF-8.
23226 The @env{LC_CTYPE} environment variable specifies character
23227 classification.  GCC uses it to determine the character boundaries in
23228 a string; this is needed for some multibyte encodings that contain quote
23229 and escape characters that are otherwise interpreted as a string
23230 end or escape.
23232 The @env{LC_MESSAGES} environment variable specifies the language to
23233 use in diagnostic messages.
23235 If the @env{LC_ALL} environment variable is set, it overrides the value
23236 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
23237 and @env{LC_MESSAGES} default to the value of the @env{LANG}
23238 environment variable.  If none of these variables are set, GCC
23239 defaults to traditional C English behavior.
23241 @item TMPDIR
23242 @findex TMPDIR
23243 If @env{TMPDIR} is set, it specifies the directory to use for temporary
23244 files.  GCC uses temporary files to hold the output of one stage of
23245 compilation which is to be used as input to the next stage: for example,
23246 the output of the preprocessor, which is the input to the compiler
23247 proper.
23249 @item GCC_COMPARE_DEBUG
23250 @findex GCC_COMPARE_DEBUG
23251 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
23252 @option{-fcompare-debug} to the compiler driver.  See the documentation
23253 of this option for more details.
23255 @item GCC_EXEC_PREFIX
23256 @findex GCC_EXEC_PREFIX
23257 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
23258 names of the subprograms executed by the compiler.  No slash is added
23259 when this prefix is combined with the name of a subprogram, but you can
23260 specify a prefix that ends with a slash if you wish.
23262 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
23263 an appropriate prefix to use based on the pathname it is invoked with.
23265 If GCC cannot find the subprogram using the specified prefix, it
23266 tries looking in the usual places for the subprogram.
23268 The default value of @env{GCC_EXEC_PREFIX} is
23269 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
23270 the installed compiler. In many cases @var{prefix} is the value
23271 of @code{prefix} when you ran the @file{configure} script.
23273 Other prefixes specified with @option{-B} take precedence over this prefix.
23275 This prefix is also used for finding files such as @file{crt0.o} that are
23276 used for linking.
23278 In addition, the prefix is used in an unusual way in finding the
23279 directories to search for header files.  For each of the standard
23280 directories whose name normally begins with @samp{/usr/local/lib/gcc}
23281 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
23282 replacing that beginning with the specified prefix to produce an
23283 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
23284 @file{foo/bar} just before it searches the standard directory 
23285 @file{/usr/local/lib/bar}.
23286 If a standard directory begins with the configured
23287 @var{prefix} then the value of @var{prefix} is replaced by
23288 @env{GCC_EXEC_PREFIX} when looking for header files.
23290 @item COMPILER_PATH
23291 @findex COMPILER_PATH
23292 The value of @env{COMPILER_PATH} is a colon-separated list of
23293 directories, much like @env{PATH}.  GCC tries the directories thus
23294 specified when searching for subprograms, if it can't find the
23295 subprograms using @env{GCC_EXEC_PREFIX}.
23297 @item LIBRARY_PATH
23298 @findex LIBRARY_PATH
23299 The value of @env{LIBRARY_PATH} is a colon-separated list of
23300 directories, much like @env{PATH}.  When configured as a native compiler,
23301 GCC tries the directories thus specified when searching for special
23302 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
23303 using GCC also uses these directories when searching for ordinary
23304 libraries for the @option{-l} option (but directories specified with
23305 @option{-L} come first).
23307 @item LANG
23308 @findex LANG
23309 @cindex locale definition
23310 This variable is used to pass locale information to the compiler.  One way in
23311 which this information is used is to determine the character set to be used
23312 when character literals, string literals and comments are parsed in C and C++.
23313 When the compiler is configured to allow multibyte characters,
23314 the following values for @env{LANG} are recognized:
23316 @table @samp
23317 @item C-JIS
23318 Recognize JIS characters.
23319 @item C-SJIS
23320 Recognize SJIS characters.
23321 @item C-EUCJP
23322 Recognize EUCJP characters.
23323 @end table
23325 If @env{LANG} is not defined, or if it has some other value, then the
23326 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
23327 recognize and translate multibyte characters.
23328 @end table
23330 @noindent
23331 Some additional environment variables affect the behavior of the
23332 preprocessor.
23334 @include cppenv.texi
23336 @c man end
23338 @node Precompiled Headers
23339 @section Using Precompiled Headers
23340 @cindex precompiled headers
23341 @cindex speed of compilation
23343 Often large projects have many header files that are included in every
23344 source file.  The time the compiler takes to process these header files
23345 over and over again can account for nearly all of the time required to
23346 build the project.  To make builds faster, GCC allows you to
23347 @dfn{precompile} a header file.
23349 To create a precompiled header file, simply compile it as you would any
23350 other file, if necessary using the @option{-x} option to make the driver
23351 treat it as a C or C++ header file.  You may want to use a
23352 tool like @command{make} to keep the precompiled header up-to-date when
23353 the headers it contains change.
23355 A precompiled header file is searched for when @code{#include} is
23356 seen in the compilation.  As it searches for the included file
23357 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
23358 compiler looks for a precompiled header in each directory just before it
23359 looks for the include file in that directory.  The name searched for is
23360 the name specified in the @code{#include} with @samp{.gch} appended.  If
23361 the precompiled header file can't be used, it is ignored.
23363 For instance, if you have @code{#include "all.h"}, and you have
23364 @file{all.h.gch} in the same directory as @file{all.h}, then the
23365 precompiled header file is used if possible, and the original
23366 header is used otherwise.
23368 Alternatively, you might decide to put the precompiled header file in a
23369 directory and use @option{-I} to ensure that directory is searched
23370 before (or instead of) the directory containing the original header.
23371 Then, if you want to check that the precompiled header file is always
23372 used, you can put a file of the same name as the original header in this
23373 directory containing an @code{#error} command.
23375 This also works with @option{-include}.  So yet another way to use
23376 precompiled headers, good for projects not designed with precompiled
23377 header files in mind, is to simply take most of the header files used by
23378 a project, include them from another header file, precompile that header
23379 file, and @option{-include} the precompiled header.  If the header files
23380 have guards against multiple inclusion, they are skipped because
23381 they've already been included (in the precompiled header).
23383 If you need to precompile the same header file for different
23384 languages, targets, or compiler options, you can instead make a
23385 @emph{directory} named like @file{all.h.gch}, and put each precompiled
23386 header in the directory, perhaps using @option{-o}.  It doesn't matter
23387 what you call the files in the directory; every precompiled header in
23388 the directory is considered.  The first precompiled header
23389 encountered in the directory that is valid for this compilation is
23390 used; they're searched in no particular order.
23392 There are many other possibilities, limited only by your imagination,
23393 good sense, and the constraints of your build system.
23395 A precompiled header file can be used only when these conditions apply:
23397 @itemize
23398 @item
23399 Only one precompiled header can be used in a particular compilation.
23401 @item
23402 A precompiled header can't be used once the first C token is seen.  You
23403 can have preprocessor directives before a precompiled header; you cannot
23404 include a precompiled header from inside another header.
23406 @item
23407 The precompiled header file must be produced for the same language as
23408 the current compilation.  You can't use a C precompiled header for a C++
23409 compilation.
23411 @item
23412 The precompiled header file must have been produced by the same compiler
23413 binary as the current compilation is using.
23415 @item
23416 Any macros defined before the precompiled header is included must
23417 either be defined in the same way as when the precompiled header was
23418 generated, or must not affect the precompiled header, which usually
23419 means that they don't appear in the precompiled header at all.
23421 The @option{-D} option is one way to define a macro before a
23422 precompiled header is included; using a @code{#define} can also do it.
23423 There are also some options that define macros implicitly, like
23424 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
23425 defined this way.
23427 @item If debugging information is output when using the precompiled
23428 header, using @option{-g} or similar, the same kind of debugging information
23429 must have been output when building the precompiled header.  However,
23430 a precompiled header built using @option{-g} can be used in a compilation
23431 when no debugging information is being output.
23433 @item The same @option{-m} options must generally be used when building
23434 and using the precompiled header.  @xref{Submodel Options},
23435 for any cases where this rule is relaxed.
23437 @item Each of the following options must be the same when building and using
23438 the precompiled header:
23440 @gccoptlist{-fexceptions}
23442 @item
23443 Some other command-line options starting with @option{-f},
23444 @option{-p}, or @option{-O} must be defined in the same way as when
23445 the precompiled header was generated.  At present, it's not clear
23446 which options are safe to change and which are not; the safest choice
23447 is to use exactly the same options when generating and using the
23448 precompiled header.  The following are known to be safe:
23450 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
23451 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
23452 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
23453 -pedantic-errors}
23455 @end itemize
23457 For all of these except the last, the compiler automatically
23458 ignores the precompiled header if the conditions aren't met.  If you
23459 find an option combination that doesn't work and doesn't cause the
23460 precompiled header to be ignored, please consider filing a bug report,
23461 see @ref{Bugs}.
23463 If you do use differing options when generating and using the
23464 precompiled header, the actual behavior is a mixture of the
23465 behavior for the options.  For instance, if you use @option{-g} to
23466 generate the precompiled header but not when using it, you may or may
23467 not get debugging information for routines in the precompiled header.